From af8cce23ce98240549cb71e4ce4ec4e8ebfe7d99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Alvarez=20Sordo?= Date: Mon, 24 Jul 2023 15:45:14 +0200 Subject: [PATCH] feat(textarea): improve textarea props and doc --- .../components/textarea/src/Textarea.doc.mdx | 39 ++++++++-- .../textarea/src/Textarea.stories.tsx | 77 +++++++++++++------ .../components/textarea/src/TextareaGroup.tsx | 2 +- 3 files changed, 88 insertions(+), 30 deletions(-) diff --git a/packages/components/textarea/src/Textarea.doc.mdx b/packages/components/textarea/src/Textarea.doc.mdx index 5898b5b1a..58e152617 100644 --- a/packages/components/textarea/src/Textarea.doc.mdx +++ b/packages/components/textarea/src/Textarea.doc.mdx @@ -1,7 +1,7 @@ import { Meta, Canvas } from '@storybook/addon-docs' -import { ArgTypes } from '@storybook/blocks' +import { ArgTypes as ExtendedArgTypes } from '@docs/helpers/ArgTypes' -import { Textarea } from '.' +import { Textarea, TextareaGroup } from '.' import * as stories from './Textarea.stories' @@ -25,7 +25,26 @@ import { Textarea } from '@spark-ui/textarea' ## Props - + ## Usage @@ -49,17 +68,23 @@ Use `disabled` prop to indicate the textarea is disabled. -## InputGroup +## TextareaGroup -Use `InputGroup` component to group your textarea with elements like icons. +Use `TextareaGroup` component to group your textarea with elements like icons. ### Elements - + + +### State + +Use `state` prop to assign a specific state to the group, choosing from: `error`, `alert` and `success`. By doing so, the outline styles will be updated, and a state indicator will be displayed accordingly. + + ### Disabled -Use `isDisabled` prop of the `InputGroup` to indicate that the input group is disabled. Use this prop instead of the textarea's disabled prop when it is within a group. +Use `disabled` prop of the `TextareaGroup` to indicate that the textarea group is disabled. Use this prop instead of the textarea's disabled prop when it is within a group. diff --git a/packages/components/textarea/src/Textarea.stories.tsx b/packages/components/textarea/src/Textarea.stories.tsx index c5a2b7853..884327493 100644 --- a/packages/components/textarea/src/Textarea.stories.tsx +++ b/packages/components/textarea/src/Textarea.stories.tsx @@ -14,30 +14,32 @@ const meta: Meta = { export default meta -export const Default: StoryFn = _args =>