Skip to content

Commit 4e6099c

Browse files
authored
DS storybook - add select story (#5783)
* add select story * edit the ts on select story * address comments * Update Select.stories.tsx
1 parent 47c793d commit 4e6099c

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import type { Meta, StoryObj } from '@storybook/react';
2+
import { Select } from 'grommet';
3+
import {
4+
a11yTitleArg,
5+
disabledArg,
6+
placeholderArg,
7+
} from '../utils/commonArgs';
8+
9+
const meta = {
10+
title: 'Components/Select',
11+
component: Select,
12+
argTypes: {
13+
a11yTitle: a11yTitleArg,
14+
clear: {
15+
control: { type: 'boolean' },
16+
},
17+
disabled: disabledArg,
18+
open: {
19+
control: { type: 'boolean' },
20+
},
21+
options: {
22+
control: { type: 'object' },
23+
},
24+
placeholder: placeholderArg,
25+
},
26+
} satisfies Meta<typeof Select>;
27+
28+
export default meta;
29+
type Story = StoryObj<typeof meta>;
30+
31+
export const Default = {
32+
name: 'Select',
33+
render: args => <Select {...args} />,
34+
args: {
35+
a11yTitle: 'Select a size',
36+
clear: false,
37+
disabled: false,
38+
open: false,
39+
options: ['small', 'medium', 'large'],
40+
placeholder: 'Select an option...',
41+
},
42+
} satisfies Story;

0 commit comments

Comments
 (0)