From 6af84b10e8ba3e6deb30bddbb20d56b5fb5f7b8b Mon Sep 17 00:00:00 2001 From: qinlijie <57082839+563316158@users.noreply.github.com> Date: Fri, 19 Apr 2024 17:58:39 +0800 Subject: [PATCH] feat(textarea):New component: Textarea (#130) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 新增textarea组件,测试待完善 * feat: 新增textarea test * docs(textarea): updated docs of textarea * docs(textarea): add html source code * docs(textarea): update index.md of textarea * fix(textarea): fix broken unit test * chore: changeset --------- Co-authored-by: Jerry.Qin 秦利杰 Co-authored-by: BugMaker.Huang --- .changeset/brave-turkeys-suffer.md | 6 + .dumirc.ts | 4 + docs/example/Textarea/demos/basicUsage.tsx | 21 + docs/example/Textarea/demos/formTest.tsx | 62 +++ docs/example/Textarea/demos/rows.tsx | 22 ++ docs/example/Textarea/demos/size.tsx | 22 ++ docs/example/Textarea/index.md | 115 ++++++ packages/banana-react/src/index.ts | 2 + packages/banana-react/src/textarea/index.ts | 12 + packages/banana/src/index.ts | 2 + packages/banana/src/rating/index.test.ts | 4 +- packages/banana/src/textarea/index.styles.ts | 115 ++++++ packages/banana/src/textarea/index.test.ts | 379 +++++++++++++++++++ packages/banana/src/textarea/index.ts | 182 +++++++++ packages/banana/styles/global-variables.ts | 2 +- public/Textarea/basicUsage.html | 5 + public/Textarea/rows.html | 5 + public/Textarea/size.html | 5 + 18 files changed, 962 insertions(+), 3 deletions(-) create mode 100644 .changeset/brave-turkeys-suffer.md create mode 100644 docs/example/Textarea/demos/basicUsage.tsx create mode 100644 docs/example/Textarea/demos/formTest.tsx create mode 100644 docs/example/Textarea/demos/rows.tsx create mode 100644 docs/example/Textarea/demos/size.tsx create mode 100644 docs/example/Textarea/index.md create mode 100644 packages/banana-react/src/textarea/index.ts create mode 100644 packages/banana/src/textarea/index.styles.ts create mode 100644 packages/banana/src/textarea/index.test.ts create mode 100644 packages/banana/src/textarea/index.ts create mode 100644 public/Textarea/basicUsage.html create mode 100644 public/Textarea/rows.html create mode 100644 public/Textarea/size.html diff --git a/.changeset/brave-turkeys-suffer.md b/.changeset/brave-turkeys-suffer.md new file mode 100644 index 00000000..0934514d --- /dev/null +++ b/.changeset/brave-turkeys-suffer.md @@ -0,0 +1,6 @@ +--- +'@banana-ui/react': minor +'@banana-ui/banana': minor +--- + +New Component: Textarea diff --git a/.dumirc.ts b/.dumirc.ts index b9f41882..f66ec74c 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -124,6 +124,10 @@ export default defineConfig({ link: '/example/stepper', title: 'Stepper 数量选择器', }, + { + link: '/example/textarea', + title: 'Textarea 文本输入框', + }, ], }, { diff --git a/docs/example/Textarea/demos/basicUsage.tsx b/docs/example/Textarea/demos/basicUsage.tsx new file mode 100644 index 00000000..655219c8 --- /dev/null +++ b/docs/example/Textarea/demos/basicUsage.tsx @@ -0,0 +1,21 @@ +/** + * title: 基本使用 + */ + +import { Textarea } from '@banana-ui/react'; + +export default function BasicUsage() { + return ( +
+ +
+ `; + } +} diff --git a/packages/banana/styles/global-variables.ts b/packages/banana/styles/global-variables.ts index e77ad8c6..51e57d53 100644 --- a/packages/banana/styles/global-variables.ts +++ b/packages/banana/styles/global-variables.ts @@ -121,7 +121,7 @@ export const Variables = { InputBackgroundColor: '#fff', InputDisabledColor: `rgba(0, 0, 0, 0.25)`, InputDisabledBackgroundColor: `rgba(0, 0, 0, 0.03)`, - InputDisabledBorderColor: `rgba(${Colors.Gray3}, 1})`, + InputDisabledBorderColor: `rgba(${Colors.Gray3}, 1)`, InputBoxShadowFocus: `0 0 0 2px rgba(${Colors.Blue6}, 0.2)`, InputFontFamily: 'Inter, AppleSystem, BlinkMacSystemFont, Segoe UI, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sansSerif', diff --git a/public/Textarea/basicUsage.html b/public/Textarea/basicUsage.html new file mode 100644 index 00000000..59f3757a --- /dev/null +++ b/public/Textarea/basicUsage.html @@ -0,0 +1,5 @@ +
+ + + +
\ No newline at end of file diff --git a/public/Textarea/rows.html b/public/Textarea/rows.html new file mode 100644 index 00000000..29c9c2c2 --- /dev/null +++ b/public/Textarea/rows.html @@ -0,0 +1,5 @@ +
+ + + +
diff --git a/public/Textarea/size.html b/public/Textarea/size.html new file mode 100644 index 00000000..091ec121 --- /dev/null +++ b/public/Textarea/size.html @@ -0,0 +1,5 @@ +
+ + + +
\ No newline at end of file