Skip to content

Commit 225584e

Browse files
author
Nikolai Lopin
committed
docs: migrate SelectList docs to csf3
1 parent 54ca704 commit 225584e

File tree

3 files changed

+201
-306
lines changed

3 files changed

+201
-306
lines changed

src/components/SelectList/docs/SelectList.stories.mdx

Lines changed: 0 additions & 306 deletions
This file was deleted.
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
import { Meta, StoryObj } from '@storybook/react';
2+
import { SelectList } from '../SelectList';
3+
import { onDarkBackground } from '../../../docs/parameters';
4+
5+
const meta: Meta = {
6+
title: 'Form Elements/SelectList',
7+
component: SelectList,
8+
argTypes: {
9+
variant: {
10+
options: ['boxed', 'bottom-lined'],
11+
defaultValue: 'boxed',
12+
control: 'radio'
13+
},
14+
size: {
15+
options: ['small', 'medium'],
16+
defaultValue: 'medium',
17+
control: 'radio'
18+
},
19+
menuPortalTarget: {
20+
description: 'The element to append the menu to',
21+
control: false
22+
},
23+
options: {
24+
description: 'Options to display in the select list'
25+
}
26+
},
27+
args: {
28+
id: 'select-list',
29+
menuPortalTarget: document.body,
30+
options: [
31+
{
32+
label: 'Barcelona',
33+
value: 'bcn'
34+
},
35+
{
36+
label: 'Hamburg',
37+
value: 'ham'
38+
},
39+
{
40+
label: 'Paris',
41+
value: 'par',
42+
isDisabled: true
43+
}
44+
]
45+
}
46+
};
47+
48+
export default meta;
49+
50+
type Story = StoryObj<typeof SelectList>;
51+
52+
export const Default: Story = {};
53+
54+
export const WithLabel: Story = {
55+
args: {
56+
label: 'City'
57+
}
58+
};
59+
60+
export const MultiSelect: Story = {
61+
args: {
62+
isMulti: true
63+
}
64+
};
65+
66+
export const BottomLined: Story = {
67+
args: {
68+
variant: 'bottom-lined'
69+
}
70+
};
71+
72+
export const WithError: Story = {
73+
args: {
74+
error: true
75+
}
76+
};
77+
78+
export const Inverted: Story = {
79+
args: {
80+
inverted: true
81+
},
82+
parameters: {
83+
...onDarkBackground
84+
}
85+
};

0 commit comments

Comments
 (0)