-
Notifications
You must be signed in to change notification settings - Fork 4k
/
index.js
94 lines (90 loc) · 1.74 KB
/
index.js
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
/**
* Internal dependencies
*/
import CustomSelectControl from '..';
export default {
title: 'Components/CustomSelectControl',
component: CustomSelectControl,
argTypes: {
__next36pxDefaultSize: { control: { type: 'boolean' } },
__experimentalShowSelectedHint: { control: { type: 'boolean' } },
size: {
control: {
type: 'radio',
options: [ 'small', 'default', '__unstable-large' ],
},
},
},
};
export const Default = CustomSelectControl.bind( {} );
Default.args = {
__nextUnconstrainedWidth: true,
label: 'Label',
options: [
{
key: 'small',
name: 'Small',
style: { fontSize: '50%' },
},
{
key: 'normal',
name: 'Normal',
style: { fontSize: '100%' },
className: 'can-apply-custom-class-to-option',
},
{
key: 'large',
name: 'Large',
style: { fontSize: '200%' },
},
{
key: 'huge',
name: 'Huge',
style: { fontSize: '300%' },
},
],
};
export const WithLongLabels = CustomSelectControl.bind( {} );
WithLongLabels.args = {
...Default.args,
options: [
{
key: 'reallylonglabel1',
name: 'Really long labels are good for stress testing',
},
{
key: 'reallylonglabel2',
name: 'But they can take a long time to type.',
},
{
key: 'reallylonglabel3',
name: 'That really is ok though because you should stress test your UIs.',
},
],
};
export const WithHints = CustomSelectControl.bind( {} );
WithHints.args = {
...Default.args,
options: [
{
key: 'thumbnail',
name: 'Thumbnail',
__experimentalHint: '150x150',
},
{
key: 'medium',
name: 'Medium',
__experimentalHint: '250x250',
},
{
key: 'large',
name: 'Large',
__experimentalHint: '1024x1024',
},
{
key: 'full',
name: 'Full Size',
__experimentalHint: '1600x1600',
},
],
};