Skip to content

Commit 0fa46b1

Browse files
author
Nikolai Lopin
committed
docs: migrate Textarea docs to csf3
1 parent 87e40ad commit 0fa46b1

File tree

4 files changed

+84
-102
lines changed

4 files changed

+84
-102
lines changed

src/components/Textarea/Textarea.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,19 @@ const TextareaField: FC<TextAreaProps & Pick<InternalInputComponentProps, 'hasVa
4040
resize: ${p => p.resize};
4141
`;
4242

43+
// TODO looks like neither variant nor size props are used
4344
interface TextAreaProps
4445
extends WrapperProps,
4546
Omit<ComponentPropsWithoutRef<'textarea'>, 'size' | 'width'>,
4647
Pick<CSSProperties, 'resize'> {
4748
/**
4849
* Sets the variant of the textarea
50+
* @default 'boxed'
4951
*/
5052
variant?: ResponsiveValue<'boxed' | 'bottom-lined'>;
5153
/**
5254
* Sets the size of the input
55+
* @default 'medium'
5356
*/
5457
size?: ResponsiveValue<'small' | 'medium'>;
5558
/**

src/components/Textarea/docs/Textarea.stories.mdx

Lines changed: 0 additions & 102 deletions
This file was deleted.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import { Meta, StoryObj } from '@storybook/react';
2+
3+
import { Textarea } from '../Textarea';
4+
import { onDarkBackground } from '../../../docs/parameters';
5+
6+
const meta: Meta = {
7+
title: 'Components/Textarea',
8+
component: Textarea,
9+
argTypes: {
10+
variant: {
11+
table: {
12+
disable: true
13+
}
14+
},
15+
size: {
16+
table: {
17+
disable: true
18+
}
19+
}
20+
},
21+
args: {
22+
label: 'E-Mail Address'
23+
}
24+
};
25+
26+
export default meta;
27+
28+
type Story = StoryObj<typeof Textarea>;
29+
30+
export const Default: Story = {
31+
args: {
32+
label: undefined
33+
}
34+
};
35+
36+
export const WithLabel: Story = {};
37+
38+
export const WithPlaceholder: Story = {
39+
args: {
40+
placeholder: '[email protected]'
41+
}
42+
};
43+
44+
export const WithError: Story = {
45+
args: {
46+
error: true
47+
}
48+
};
49+
50+
export const Disabled: Story = {
51+
args: {
52+
disabled: true
53+
}
54+
};
55+
56+
export const Inverted: Story = {
57+
args: {
58+
inverted: true
59+
},
60+
parameters: {
61+
...onDarkBackground
62+
}
63+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Primary, Stories, ArgTypes, Meta } from '@storybook/blocks';
2+
import { StyledSystemLinks } from '../../../docs/StyledSystemLinks';
3+
4+
import * as TextareaStories from './Textarea.stories';
5+
6+
<Meta of={TextareaStories} />
7+
8+
# Textarea
9+
10+
<Primary />
11+
12+
## Properties
13+
14+
<ArgTypes of={TextareaStories} />
15+
16+
<StyledSystemLinks component="Textarea" supportedProps={['margin', 'height', 'width']} />
17+
18+
<Stories includePrimary={false} />

0 commit comments

Comments
 (0)