Skip to content

Commit c746efb

Browse files
author
Nikolai Lopin
committed
docs: moves Checkbox stories to the checkbox folder
1 parent 488700b commit c746efb

File tree

5 files changed

+77
-171
lines changed

5 files changed

+77
-171
lines changed

src/components/Checkbox/docs/Checkbox.mdx

Lines changed: 0 additions & 56 deletions
This file was deleted.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import { Meta, StoryObj } from '@storybook/react';
2+
import { Checkbox } from '../Checkbox';
3+
4+
const meta: Meta = {
5+
title: 'Form Elements/Checkbox',
6+
component: Checkbox,
7+
argTypes: {
8+
size: {
9+
control: 'radio',
10+
options: ['small', 'medium', 'large']
11+
},
12+
textVerticalAlign: {
13+
control: 'radio',
14+
options: ['center', 'top']
15+
}
16+
},
17+
args: {
18+
label: 'Accept T&C'
19+
}
20+
};
21+
22+
export default meta;
23+
24+
type Story = StoryObj<typeof Checkbox>;
25+
26+
export const Default: Story = {};
27+
28+
export const Selected: Story = {
29+
args: {
30+
defaultChecked: true
31+
}
32+
};
33+
34+
export const Error: Story = {
35+
args: {
36+
label: 'With Error',
37+
error: true
38+
}
39+
};
40+
41+
export const Disabled: Story = {
42+
args: {
43+
disabled: true
44+
}
45+
};
46+
47+
export const Indeterminate: Story = {
48+
args: {
49+
indeterminate: true
50+
}
51+
};
52+
53+
export const Size: Story = {
54+
args: {
55+
size: 'large'
56+
}
57+
};
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { Meta, Primary, ArgsTable, Stories } from '@storybook/blocks';
2+
import * as CheckboxStories from './Checkbox.stories';
3+
4+
<Meta of={CheckboxStories} />
5+
6+
# Checkbox
7+
8+
Checkboxes are used for a list of options where the user may select multiple options, including all or none. A
9+
stand-alone checkbox is used for a single option that the user can turn on or off.
10+
11+
You can provide the label as either a `string` or as a React component. If a `string` is provided as the label, it
12+
will be wrapped with the [Text](/components/Text) component.
13+
14+
<Primary />
15+
16+
## Properties
17+
18+
<ArgsTable story="Default" />
19+
20+
<Stories includePrimary={false} />{' '}

src/components/Checkbox/docs/CheckboxPropsTable.tsx

Lines changed: 0 additions & 45 deletions
This file was deleted.

src/stories/components/Checkbox.stories.tsx

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)