diff --git a/apps/storybook/stories/text-area.stories.tsx b/apps/storybook/stories/text-area.stories.tsx index 304d267f..0ddd2ddb 100644 --- a/apps/storybook/stories/text-area.stories.tsx +++ b/apps/storybook/stories/text-area.stories.tsx @@ -15,6 +15,9 @@ export default { autoComplete: { control: 'text', }, + description: { + control: 'text', + }, disabled: { control: 'boolean', }, @@ -108,6 +111,20 @@ export function Error() { ); } +export function Description() { + const [value, setValue] = useState('Some comment'); + + return ( + + ); +} + export function ReadOnly() { return ( = { function TextArea( { defaultValue, + description, disabled, errorMessage, id: idParam, @@ -82,7 +84,7 @@ function TextArea( const hasError = errorMessage != null; const generatedId = useId(); const id = idParam ?? generatedId; - const errorId = useId(); + const messageId = useId(); const state: State = hasError ? 'error' : 'normal'; return ( @@ -105,7 +107,9 @@ function TextArea( - {errorMessage && ( - - {errorMessage} + {(errorMessage ?? description) && ( + + {errorMessage ?? description} )}
- {errorMessage} + {(errorMessage ?? description) && ( +
+ {errorMessage ?? description}