-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Expand file tree
/
Copy pathindex.stories.tsx
More file actions
121 lines (112 loc) · 2.9 KB
/
index.stories.tsx
File metadata and controls
121 lines (112 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import type { Meta as MetaObj, StoryObj } from '@storybook/react';
import Select from '#ui/Common/Select';
import StatelessSelect from '#ui/Common/Select/StatelessSelect';
import * as OSIcons from '#ui/Icons/OperatingSystem';
type Story = StoryObj<typeof Select>;
type Meta = MetaObj<typeof Select>;
export const Default: Story = {
args: {
values: ['v20.8.0', 'v19.9.0', 'v18.18.0', 'v17.9.1', 'v16.20.2'],
defaultValue: 'v16.20.2',
label: 'Node.js version',
},
};
export const WithoutLabel: Story = {
args: {
values: ['v20.8.0', 'v19.9.0', 'v18.18.0', 'v17.9.1', 'v16.20.2'],
defaultValue: 'v16.20.2',
},
};
export const WithScrollButtons: Story = {
args: {
values: Array.from({ length: 100 }, (_, i) => `Item ${i}`),
defaultValue: 'Item 50',
},
};
export const DropdownLabel: Story = {
args: {
values: [
{
label: 'Getting Started',
items: [
{
value: 'section-1',
label: 'Getting Started',
},
{
value: 'section-2',
label: 'How to install Node.js',
},
{
value: 'section-3',
label: 'How much JavaScript do you need to know to use Node.js?',
},
{
value: 'section-4',
label: 'Differences between Node.js and the Browser',
},
{
value: 'section-5',
label: 'The V8 JavaScript Engine',
},
{
value: 'section-6',
label: 'An introduction to the npm package manager',
},
{
value: 'section-7',
label: 'ECMAScript 2015 (ES6) and beyond',
},
{
value: 'section-8',
label: 'Node.js, the difference between development and production',
},
],
},
],
placeholder: 'Select a guide',
label: 'Getting Started',
},
};
export const InlineSelect: Story = {
args: {
values: [
{
label: 'Platform',
items: [
{
value: 'linux',
label: 'Linux',
iconImage: <OSIcons.Linux width={16} height={16} />,
},
{
value: 'macos',
label: 'macOS',
iconImage: <OSIcons.Apple width={16} height={16} />,
},
{
value: 'windows',
label: 'Windows',
iconImage: <OSIcons.Microsoft width={16} height={16} />,
},
{
value: 'aix',
label: 'AIX',
iconImage: <OSIcons.AIX width={16} height={16} />,
},
],
},
],
defaultValue: 'macos',
inline: true,
},
};
export const WithNoScriptSelect: Story = {
render: () => (
<StatelessSelect
values={Array.from({ length: 100 }, (_, i) => `Item ${i}`)}
defaultValue="Item 50"
/>
),
};
export default { component: Select } as Meta;