Skip to content

Commit 87cc378

Browse files
committed
refactor: Group TextInput stories into a shared sidebar folder with a shared Overview
1 parent 7e72009 commit 87cc378

File tree

3 files changed

+45
-10
lines changed

3 files changed

+45
-10
lines changed

src/components/TextInput/TextArea.stories.tsx

+25-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
22
import { TextArea } from './TextArea';
33

44
const meta: Meta<typeof TextArea> = {
5-
title: 'Components (Verified)/TextArea',
5+
title: 'Components (Verified)/Text inputs/Text area',
66
tags: ['autodocs'],
77
component: TextArea,
88
argTypes: {
@@ -17,55 +17,71 @@ type Story = StoryObj<typeof meta>;
1717

1818
export const Enabled: Story = {
1919
args: {
20-
placeholder: 'Enabled'
20+
id: 'Enabled',
21+
placeholder: 'Enabled',
22+
name: 'Enabled'
2123
}
2224
};
2325

2426
export const Hover: Story = {
2527
args: {
28+
id: 'Hover',
2629
placeholder: 'Hover',
30+
name: 'Hover',
2731
className: 'hover'
2832
}
2933
};
3034

3135
export const Focus: Story = {
3236
args: {
37+
id: 'Focus',
3338
placeholder: 'Focus',
39+
name: 'Focus',
3440
className: 'focus'
3541
}
3642
};
3743

3844
export const Disabled: Story = {
3945
args: {
46+
id: 'Disabled',
4047
placeholder: 'Disabled',
48+
name: 'Disabled',
4149
isDisabled: true
4250
}
4351
};
4452

45-
export const FullWidth: Story = {
46-
args: {
47-
placeholder: 'Full width',
48-
isFullWidth: true
49-
}
50-
};
51-
5253
export const Success: Story = {
5354
args: {
55+
id: 'Success',
5456
placeholder: 'Success',
57+
name: 'Success',
5558
className: 'a-text-input__success'
5659
}
5760
};
5861

5962
export const Warning: Story = {
6063
args: {
64+
id: 'Warning',
6165
placeholder: 'Warning',
66+
name: 'Warning',
6267
className: 'a-text-input__warning'
6368
}
6469
};
6570

6671
export const Error: Story = {
6772
args: {
73+
id: 'Error',
6874
placeholder: 'Error',
75+
name: 'Error',
6976
className: 'a-text-input__error'
7077
}
7178
};
79+
80+
export const FullWidth: Story = {
81+
args: {
82+
id: 'Full width',
83+
placeholder: 'Full width',
84+
name: 'Full width',
85+
isFullWidth: true
86+
}
87+
};

src/components/TextInput/TextInput.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
22
import { Button, Icon, TextInput } from '~/src/index';
33

44
const meta: Meta<typeof TextInput> = {
5-
title: 'Components (Verified)/Text inputs',
5+
title: 'Components (Verified)/Text inputs/Text input',
66
tags: ['autodocs'],
77
component: TextInput,
88
argTypes: {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Meta } from '@storybook/addon-docs';
2+
import { List, Link, ListItem, Heading, Paragraph } from '~/src/index';
3+
4+
<Meta title='Components (Verified)/Text inputs/Overview' />
5+
<Heading type='1'>Text inputs</Heading>
6+
7+
<Paragraph>Text inputs allow the user to enter any combination of letters, numbers, or symbols. Text input fields can span single or multiple lines.</Paragraph>
8+
9+
<Paragraph>Source: <Link href='https://cfpb.github.io/design-system/components/text-inputs'>https://cfpb.github.io/design-system/components/text-inputs</Link></Paragraph>
10+
11+
<br />
12+
13+
<div className="sb-unstyled">
14+
<Heading type='4'>Types</Heading>
15+
<List>
16+
<ListItem><Link href='/?path=/docs/components-verified-text-inputs-text-area--overview'>Text area</Link></ListItem>
17+
<ListItem><Link href='/?path=/docs/components-verified-text-inputs-text-input--overview'>Text input</Link></ListItem>
18+
</List>
19+
</div>

0 commit comments

Comments
 (0)