@itcase/ui 1.0.100 → 1.0.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/components/Badge/Badge.css +1 -1
- package/dist/css/components/Checkbox/Checkbox.css +2 -1
- package/dist/css/components/DatePicker/DatePicker.css +1 -1
- package/dist/css/components/Menu/Menu.css +3 -2
- package/dist/css/components/MenuItem/MenuItem.css +26 -0
- package/dist/css/components/Pagination/Pagination.css +5 -3
- package/dist/css/components/Pagination/css/__item/pagination__item.css +4 -3
- package/dist/css/components/Pagination/css/__item/pagination__item_state_disabled.css +1 -0
- package/dist/css/components/Tile/Tile.css +7 -0
- package/dist/css/components/Tooltip/Tooltip.css +9 -9
- package/dist/stories/Accordion.stories.js +88 -0
- package/dist/stories/AccordionItem.stories.js +150 -0
- package/dist/stories/Badge.stories.js +116 -0
- package/dist/stories/Button.stories.js +287 -0
- package/dist/stories/Checkbox.stories.js +116 -0
- package/dist/stories/Chips.stories.js +151 -0
- package/dist/stories/Choice.stories.js +117 -0
- package/dist/stories/Code.stories.js +99 -0
- package/dist/stories/DatePicker.stories.js +178 -0
- package/dist/stories/Divider.stories.js +132 -0
- package/dist/stories/Dot.stories.js +86 -0
- package/dist/stories/Dropdown.stories.js +74 -0
- package/dist/stories/DropdownItem.stories.js +152 -0
- package/dist/stories/Empty.stories.js +115 -0
- package/dist/stories/FormFieldCheckbox.stories.js +77 -0
- package/dist/stories/FormFieldChoice.stories.js +75 -0
- package/dist/stories/FormFieldDatepicker.stories.js +51 -0
- package/dist/stories/FormFieldFileInput.stories.js +58 -0
- package/dist/stories/FormFieldInput.stories.js +66 -0
- package/dist/stories/FormFieldInputPassword.stories.js +66 -0
- package/dist/stories/FormFieldMultiBadgeSelect.stories.js +132 -0
- package/dist/stories/FormFieldMultiSelect.stories.js +127 -0
- package/dist/stories/FormFieldSelect.stories.js +99 -0
- package/dist/stories/FormFieldSelectGroup.stories.js +84 -0
- package/dist/stories/Icon.stories.js +208 -0
- package/dist/stories/Input.stories.js +124 -0
- package/dist/stories/InputPassword.stories.js +114 -0
- package/dist/stories/Label.stories.js +163 -0
- package/dist/stories/Loader.stories.js +121 -0
- package/dist/stories/Logo.stories.js +99 -0
- package/dist/stories/MenuItem.stories.js +193 -0
- package/dist/stories/ModalConfirm.stories.js +61 -0
- package/dist/stories/ModalDefault.stories.js +34 -0
- package/dist/stories/NotFound.stories.js +94 -0
- package/dist/stories/Notification.stories.js +128 -0
- package/dist/stories/Pagination.stories.js +66 -0
- package/dist/stories/RadioButton.stories.js +101 -0
- package/dist/stories/Search-input.stories.js +182 -0
- package/dist/stories/Segmented.stories.js +110 -0
- package/dist/stories/Select.stories.js +280 -0
- package/dist/stories/Switch.stories.js +84 -0
- package/dist/stories/Tab.appearance.stories.js +260 -0
- package/dist/stories/Tab.group.stories.js +149 -0
- package/dist/stories/Tab.size.stories.js +259 -0
- package/dist/stories/Tab.state.stories.js +227 -0
- package/dist/stories/Textarea.stories.js +90 -0
- package/dist/stories/Tile.stories.js +235 -0
- package/package.json +1 -1
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import { Badge, badgeConfig } from '@itcase/ui/components/Badge'
|
|
2
|
+
import { Button, buttonConfig } from '@itcase/ui/components/Button'
|
|
3
|
+
import {
|
|
4
|
+
borderColorProps,
|
|
5
|
+
borderTypeProps,
|
|
6
|
+
fillProps,
|
|
7
|
+
itemColorProps,
|
|
8
|
+
shapeProps,
|
|
9
|
+
sizeProps,
|
|
10
|
+
sizePXProps,
|
|
11
|
+
strokeColorProps,
|
|
12
|
+
textColorHoverProps,
|
|
13
|
+
textColorProps,
|
|
14
|
+
textSizeProps,
|
|
15
|
+
textWrapProps,
|
|
16
|
+
widthProps,
|
|
17
|
+
} from '@itcase/ui/constants'
|
|
18
|
+
|
|
19
|
+
import badgeAppearance from 'src/components/Badge/appearance.json'
|
|
20
|
+
import buttonAppearance from 'src/components/Button/appearance.json'
|
|
21
|
+
import { icon24 } from '../../../icons'
|
|
22
|
+
|
|
23
|
+
badgeConfig.setAppearance(badgeAppearance)
|
|
24
|
+
buttonConfig.setAppearance(buttonAppearance)
|
|
25
|
+
|
|
26
|
+
export default {
|
|
27
|
+
title: 'Atoms / Button',
|
|
28
|
+
component: Button,
|
|
29
|
+
parameters: {
|
|
30
|
+
// controls: { exclude: ['textColor', 'textColorHover'] },
|
|
31
|
+
},
|
|
32
|
+
argTypes: {
|
|
33
|
+
advancedProps: { control: 'boolean' },
|
|
34
|
+
after: {
|
|
35
|
+
if: { arg: 'advancedProps' },
|
|
36
|
+
},
|
|
37
|
+
className: {
|
|
38
|
+
if: { arg: 'advancedProps' },
|
|
39
|
+
},
|
|
40
|
+
href: {
|
|
41
|
+
if: { arg: 'advancedProps' },
|
|
42
|
+
},
|
|
43
|
+
link: {
|
|
44
|
+
if: { arg: 'advancedProps' },
|
|
45
|
+
},
|
|
46
|
+
before: {
|
|
47
|
+
if: { arg: 'advancedProps' },
|
|
48
|
+
},
|
|
49
|
+
rel: {
|
|
50
|
+
if: { arg: 'advancedProps' },
|
|
51
|
+
},
|
|
52
|
+
htmlType: {
|
|
53
|
+
if: { arg: 'advancedProps' },
|
|
54
|
+
},
|
|
55
|
+
children: {
|
|
56
|
+
if: { arg: 'advancedProps' },
|
|
57
|
+
},
|
|
58
|
+
target: {
|
|
59
|
+
if: { arg: 'advancedProps' },
|
|
60
|
+
},
|
|
61
|
+
dataTour: {
|
|
62
|
+
if: { arg: 'advancedProps' },
|
|
63
|
+
},
|
|
64
|
+
onClick: {
|
|
65
|
+
if: { arg: 'advancedProps' },
|
|
66
|
+
},
|
|
67
|
+
onMouseDown: {
|
|
68
|
+
if: { arg: 'advancedProps' },
|
|
69
|
+
},
|
|
70
|
+
appearance: {
|
|
71
|
+
options: [
|
|
72
|
+
null,
|
|
73
|
+
'dev',
|
|
74
|
+
'accent',
|
|
75
|
+
'primary',
|
|
76
|
+
'secondary',
|
|
77
|
+
'surfacePrimary',
|
|
78
|
+
'surfaceSecondary',
|
|
79
|
+
'surfaceTertiary',
|
|
80
|
+
'surfaceDisabled',
|
|
81
|
+
],
|
|
82
|
+
control: 'inline-radio',
|
|
83
|
+
},
|
|
84
|
+
width: {
|
|
85
|
+
options: widthProps,
|
|
86
|
+
control: 'inline-radio',
|
|
87
|
+
},
|
|
88
|
+
size: {
|
|
89
|
+
options: sizeProps,
|
|
90
|
+
control: 'inline-radio',
|
|
91
|
+
},
|
|
92
|
+
fill: {
|
|
93
|
+
options: fillProps,
|
|
94
|
+
control: 'select',
|
|
95
|
+
},
|
|
96
|
+
labelTextWrap: {
|
|
97
|
+
options: textWrapProps,
|
|
98
|
+
control: 'inline-radio',
|
|
99
|
+
if: { arg: 'advancedProps' },
|
|
100
|
+
},
|
|
101
|
+
borderColor: {
|
|
102
|
+
options: borderColorProps,
|
|
103
|
+
control: 'select',
|
|
104
|
+
},
|
|
105
|
+
borderType: {
|
|
106
|
+
options: borderTypeProps,
|
|
107
|
+
control: 'inline-radio',
|
|
108
|
+
},
|
|
109
|
+
loading: {
|
|
110
|
+
control: 'boolean',
|
|
111
|
+
if: { arg: 'advancedProps' },
|
|
112
|
+
},
|
|
113
|
+
labelTextSize: {
|
|
114
|
+
options: textSizeProps,
|
|
115
|
+
control: 'inline-radio',
|
|
116
|
+
},
|
|
117
|
+
labelTextColor: {
|
|
118
|
+
options: textColorProps,
|
|
119
|
+
control: 'select',
|
|
120
|
+
},
|
|
121
|
+
labelTextColorHover: {
|
|
122
|
+
options: textColorHoverProps,
|
|
123
|
+
control: 'select',
|
|
124
|
+
},
|
|
125
|
+
shape: {
|
|
126
|
+
options: shapeProps,
|
|
127
|
+
control: 'inline-radio',
|
|
128
|
+
},
|
|
129
|
+
isDisabled: {
|
|
130
|
+
control: 'boolean',
|
|
131
|
+
if: { arg: 'advancedProps' },
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
loaderFill: {
|
|
135
|
+
options: fillProps,
|
|
136
|
+
control: 'select',
|
|
137
|
+
if: { arg: 'loader', eq: null },
|
|
138
|
+
},
|
|
139
|
+
loaderItemFill: {
|
|
140
|
+
options: itemColorProps,
|
|
141
|
+
control: 'select',
|
|
142
|
+
if: { arg: 'loader', eq: null },
|
|
143
|
+
},
|
|
144
|
+
loaderSet: {
|
|
145
|
+
control: 'text',
|
|
146
|
+
if: { arg: 'loader', eq: null },
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
iconSrc: {
|
|
150
|
+
control: 'radio',
|
|
151
|
+
options: [null, 'assets/24/SignOut.svg'],
|
|
152
|
+
},
|
|
153
|
+
iconFill: {
|
|
154
|
+
options: fillProps,
|
|
155
|
+
control: 'select',
|
|
156
|
+
if: { arg: 'iconSrc', neq: null },
|
|
157
|
+
},
|
|
158
|
+
iconSize: {
|
|
159
|
+
options: sizePXProps,
|
|
160
|
+
control: 'select',
|
|
161
|
+
if: { arg: 'iconSrc', neq: null },
|
|
162
|
+
},
|
|
163
|
+
iconStroke: {
|
|
164
|
+
options: strokeColorProps,
|
|
165
|
+
control: 'select',
|
|
166
|
+
if: { arg: 'iconSrc', neq: null },
|
|
167
|
+
},
|
|
168
|
+
|
|
169
|
+
iconAfterSrc: {
|
|
170
|
+
control: 'radio',
|
|
171
|
+
options: [null, 'assets/24/ChevronRight.svg'],
|
|
172
|
+
},
|
|
173
|
+
iconAfterFill: {
|
|
174
|
+
options: fillProps,
|
|
175
|
+
control: 'select',
|
|
176
|
+
if: { arg: 'iconAfterSrc', neq: null },
|
|
177
|
+
},
|
|
178
|
+
iconAfterStroke: {
|
|
179
|
+
options: strokeColorProps,
|
|
180
|
+
control: 'select',
|
|
181
|
+
if: { arg: 'iconAfterSrc', neq: null },
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
iconBeforeSrc: {
|
|
185
|
+
control: 'radio',
|
|
186
|
+
options: [null, 'assets/24/ChevronLeft.svg'],
|
|
187
|
+
},
|
|
188
|
+
iconBeforeFill: {
|
|
189
|
+
options: fillProps,
|
|
190
|
+
control: 'select',
|
|
191
|
+
if: { arg: 'iconBeforeSrc', neq: null },
|
|
192
|
+
},
|
|
193
|
+
iconBeforeStroke: {
|
|
194
|
+
options: strokeColorProps,
|
|
195
|
+
control: 'select',
|
|
196
|
+
if: { arg: 'iconBeforeSrc', neq: null },
|
|
197
|
+
},
|
|
198
|
+
Badge: {
|
|
199
|
+
control: 'select',
|
|
200
|
+
options: [null, <Badge appearance="secondary" size="xs" textSize="xxs" value={3} />],
|
|
201
|
+
},
|
|
202
|
+
type: {
|
|
203
|
+
if: { arg: 'advancedProps' },
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
args: {
|
|
207
|
+
appearance: 'accent',
|
|
208
|
+
label: 'Button',
|
|
209
|
+
shape: 'rounded',
|
|
210
|
+
iconSrc: null,
|
|
211
|
+
},
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export const Default = {}
|
|
215
|
+
|
|
216
|
+
export const Accent = {
|
|
217
|
+
args: {
|
|
218
|
+
...Default.args,
|
|
219
|
+
appearance: 'accent',
|
|
220
|
+
},
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export const Primary = {
|
|
224
|
+
args: {
|
|
225
|
+
...Default.args,
|
|
226
|
+
appearance: 'primary',
|
|
227
|
+
},
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export const Secondary = {
|
|
231
|
+
args: {
|
|
232
|
+
...Default.args,
|
|
233
|
+
appearance: 'secondary',
|
|
234
|
+
},
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export const SurfacePrimary = {
|
|
238
|
+
args: {
|
|
239
|
+
...Default.args,
|
|
240
|
+
appearance: 'surfacePrimary',
|
|
241
|
+
},
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export const SurfaceSecondary = {
|
|
245
|
+
args: {
|
|
246
|
+
...Default.args,
|
|
247
|
+
appearance: 'surfaceSecondary',
|
|
248
|
+
},
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export const SurfaceTertiary = {
|
|
252
|
+
args: {
|
|
253
|
+
...Default.args,
|
|
254
|
+
appearance: 'surfaceTertiary',
|
|
255
|
+
},
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export const SurfaceDisabled = {
|
|
259
|
+
args: {
|
|
260
|
+
...Default.args,
|
|
261
|
+
appearance: 'surfaceDisabled',
|
|
262
|
+
},
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export const IconBefore = {
|
|
266
|
+
args: {
|
|
267
|
+
...Default.args,
|
|
268
|
+
iconBefore: icon24.Filter,
|
|
269
|
+
iconBeforeFill: 'accentItemPrimary',
|
|
270
|
+
},
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export const IconAfter = {
|
|
274
|
+
args: {
|
|
275
|
+
...Default.args,
|
|
276
|
+
iconAfter: icon24.Filter,
|
|
277
|
+
iconAfterFill: 'accentItemPrimary',
|
|
278
|
+
},
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export const WithBadge = {
|
|
282
|
+
args: {
|
|
283
|
+
...Default.args,
|
|
284
|
+
shape: 'rounded',
|
|
285
|
+
Badge: <Badge appearance="primary" size="m" textSize="m" value={3} />,
|
|
286
|
+
},
|
|
287
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { Checkbox, checkboxConfig } from '@itcase/ui/components/Checkbox'
|
|
2
|
+
import checkboxState from 'src/components/Checkbox/state.json'
|
|
3
|
+
|
|
4
|
+
import { fillProps, textColorProps, textSizeProps } from '@itcase/ui/constants'
|
|
5
|
+
|
|
6
|
+
checkboxConfig.setState(checkboxState)
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Atoms / Checkbox',
|
|
10
|
+
component: Checkbox,
|
|
11
|
+
argTypes: {
|
|
12
|
+
advancedProps: { control: 'boolean' },
|
|
13
|
+
className: {
|
|
14
|
+
if: { arg: 'advancedProps' },
|
|
15
|
+
},
|
|
16
|
+
checked: {
|
|
17
|
+
control: 'boolean',
|
|
18
|
+
},
|
|
19
|
+
disabled: {
|
|
20
|
+
control: 'boolean',
|
|
21
|
+
},
|
|
22
|
+
descTextColor: {
|
|
23
|
+
options: textColorProps,
|
|
24
|
+
control: 'select',
|
|
25
|
+
},
|
|
26
|
+
descTextSize: {
|
|
27
|
+
options: textSizeProps,
|
|
28
|
+
control: 'inline-radio',
|
|
29
|
+
},
|
|
30
|
+
fill: {
|
|
31
|
+
options: fillProps,
|
|
32
|
+
control: 'select',
|
|
33
|
+
},
|
|
34
|
+
labelTextColor: {
|
|
35
|
+
options: textColorProps,
|
|
36
|
+
control: 'select',
|
|
37
|
+
},
|
|
38
|
+
labelTextSize: {
|
|
39
|
+
options: textSizeProps,
|
|
40
|
+
control: 'inline-radio',
|
|
41
|
+
},
|
|
42
|
+
shape: {
|
|
43
|
+
options: [null, 'rounded'],
|
|
44
|
+
control: 'inline-radio',
|
|
45
|
+
},
|
|
46
|
+
stateShape: {
|
|
47
|
+
options: [null, 'rounded'],
|
|
48
|
+
control: 'inline-radio',
|
|
49
|
+
},
|
|
50
|
+
stateBorderWidth: {
|
|
51
|
+
options: [1, 2, 3, 4, 5],
|
|
52
|
+
control: 'inline-radio',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const Default = {
|
|
58
|
+
args: {
|
|
59
|
+
checked: false,
|
|
60
|
+
disabled: false,
|
|
61
|
+
label: 'Checkbox',
|
|
62
|
+
labelTextSize: 'm',
|
|
63
|
+
labelTextColor: 'surfaceTextPrimary',
|
|
64
|
+
desc: 'Description',
|
|
65
|
+
descTextSize: 'xxs',
|
|
66
|
+
descTextColor: 'surfaceTextTertiary',
|
|
67
|
+
|
|
68
|
+
stateShape: 'rounded',
|
|
69
|
+
|
|
70
|
+
stateBorderColor: 'accentBorderSecondary',
|
|
71
|
+
stateBorderColorChecked: 'accentBorderSecondary',
|
|
72
|
+
stateBorderColorDisabled: 'accentBorderSecondary',
|
|
73
|
+
stateBorderColorDisabledChecked: 'accentBorderSecondary',
|
|
74
|
+
|
|
75
|
+
stateBorderWidth: 1,
|
|
76
|
+
|
|
77
|
+
stateFillChecked: 'accentPrimary',
|
|
78
|
+
stateFillDisabled: 'accentDisabled',
|
|
79
|
+
stateFillDisabledChecked: 'accentDisabled',
|
|
80
|
+
stateCheckmarkFill: 'accentItemPrimary',
|
|
81
|
+
stateCheckmarkFillDisabled: 'accentItemDisabled',
|
|
82
|
+
},
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export const CheckedActive = {
|
|
86
|
+
args: {
|
|
87
|
+
...Default.args,
|
|
88
|
+
checked: true,
|
|
89
|
+
disabled: false,
|
|
90
|
+
desc: 'Checked / Active',
|
|
91
|
+
},
|
|
92
|
+
}
|
|
93
|
+
export const CheckedDisabled = {
|
|
94
|
+
args: {
|
|
95
|
+
...Default.args,
|
|
96
|
+
checked: true,
|
|
97
|
+
disabled: true,
|
|
98
|
+
desc: 'Checked / Disabled',
|
|
99
|
+
},
|
|
100
|
+
}
|
|
101
|
+
export const NotCheckedActive = {
|
|
102
|
+
args: {
|
|
103
|
+
...Default.args,
|
|
104
|
+
checked: false,
|
|
105
|
+
disabled: false,
|
|
106
|
+
desc: 'Not Checked / Active',
|
|
107
|
+
},
|
|
108
|
+
}
|
|
109
|
+
export const NotCheckedDisabled = {
|
|
110
|
+
args: {
|
|
111
|
+
...Default.args,
|
|
112
|
+
checked: false,
|
|
113
|
+
disabled: true,
|
|
114
|
+
desc: 'Not Checked / Disabled',
|
|
115
|
+
},
|
|
116
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { Chips, chipsConfig } from '@itcase/ui/components/Chips'
|
|
2
|
+
import chipsAppearance from 'src/components/Chips/appearance.json'
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
borderColorProps,
|
|
6
|
+
borderTypeProps,
|
|
7
|
+
textSizeProps,
|
|
8
|
+
fillProps,
|
|
9
|
+
sizeProps,
|
|
10
|
+
shapeProps,
|
|
11
|
+
} from '@itcase/ui/constants'
|
|
12
|
+
|
|
13
|
+
chipsConfig.setAppearance(chipsAppearance)
|
|
14
|
+
|
|
15
|
+
import { Icon } from '@itcase/ui/components/Icon'
|
|
16
|
+
|
|
17
|
+
import { icon16 } from 'src/icons'
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
title: 'Atoms / Chips ',
|
|
21
|
+
component: Chips,
|
|
22
|
+
parameters: {
|
|
23
|
+
controls: {
|
|
24
|
+
exclude: [
|
|
25
|
+
'borderDesktop',
|
|
26
|
+
'borderMobile',
|
|
27
|
+
'borderTablet',
|
|
28
|
+
'borderTypeDesktop',
|
|
29
|
+
'borderTypeMobile',
|
|
30
|
+
'borderTypeTablet',
|
|
31
|
+
'fillDesktop',
|
|
32
|
+
'fillMobile',
|
|
33
|
+
'fillTablet',
|
|
34
|
+
'fillHover',
|
|
35
|
+
'labelSizeDesktop',
|
|
36
|
+
'labelSizeMobile',
|
|
37
|
+
'labelSizeTablet',
|
|
38
|
+
'shapeDesktop',
|
|
39
|
+
'shapeMobile',
|
|
40
|
+
'shapeTablet',
|
|
41
|
+
'sizeDesktop',
|
|
42
|
+
'sizeMobile',
|
|
43
|
+
'sizeTablet',
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
argTypes: {
|
|
48
|
+
advancedProps: { control: 'boolean' },
|
|
49
|
+
className: {
|
|
50
|
+
if: { arg: 'advancedProps' },
|
|
51
|
+
},
|
|
52
|
+
onClick: {
|
|
53
|
+
if: { arg: 'advancedProps' },
|
|
54
|
+
},
|
|
55
|
+
type: {
|
|
56
|
+
control: 'text',
|
|
57
|
+
if: { arg: 'advancedProps' },
|
|
58
|
+
},
|
|
59
|
+
border: {
|
|
60
|
+
options: borderColorProps,
|
|
61
|
+
control: 'select',
|
|
62
|
+
},
|
|
63
|
+
borderType: {
|
|
64
|
+
options: borderTypeProps,
|
|
65
|
+
control: 'inline-radio',
|
|
66
|
+
},
|
|
67
|
+
fill: {
|
|
68
|
+
options: fillProps,
|
|
69
|
+
control: 'select',
|
|
70
|
+
},
|
|
71
|
+
labelSize: {
|
|
72
|
+
options: textSizeProps,
|
|
73
|
+
control: 'inline-radio',
|
|
74
|
+
},
|
|
75
|
+
shape: {
|
|
76
|
+
options: shapeProps,
|
|
77
|
+
control: 'inline-radio',
|
|
78
|
+
},
|
|
79
|
+
size: {
|
|
80
|
+
options: sizeProps,
|
|
81
|
+
control: 'inline-radio',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export const Default = {
|
|
87
|
+
argTypes: {
|
|
88
|
+
appearance: {
|
|
89
|
+
options: [
|
|
90
|
+
null,
|
|
91
|
+
'accent',
|
|
92
|
+
'primary',
|
|
93
|
+
'secondary',
|
|
94
|
+
'surfacePrimary',
|
|
95
|
+
'surfaceSecondary',
|
|
96
|
+
'surfaceTertiary',
|
|
97
|
+
],
|
|
98
|
+
control: 'inline-radio',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
args: {
|
|
102
|
+
appearance: 'accent',
|
|
103
|
+
shape: 'rounded',
|
|
104
|
+
label: 'Chips',
|
|
105
|
+
size: 'xxl',
|
|
106
|
+
labelSize: 'xxl',
|
|
107
|
+
},
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export const Accent = {
|
|
111
|
+
args: {
|
|
112
|
+
...Default.args,
|
|
113
|
+
appearance: 'accent',
|
|
114
|
+
children: <Icon iconFill="accentItemPrimary" size="16" SvgImage={icon16.Close} />,
|
|
115
|
+
},
|
|
116
|
+
}
|
|
117
|
+
export const Primary = {
|
|
118
|
+
args: {
|
|
119
|
+
...Default.args,
|
|
120
|
+
appearance: 'primary',
|
|
121
|
+
children: <Icon iconFill="primaryItemPrimary" size="16" SvgImage={icon16.Close} />,
|
|
122
|
+
},
|
|
123
|
+
}
|
|
124
|
+
export const Secondary = {
|
|
125
|
+
args: {
|
|
126
|
+
...Default.args,
|
|
127
|
+
appearance: 'secondary',
|
|
128
|
+
children: <Icon iconFill="secondaryItemPrimary" size="16" SvgImage={icon16.Close} />,
|
|
129
|
+
},
|
|
130
|
+
}
|
|
131
|
+
export const SurfacePrimary = {
|
|
132
|
+
args: {
|
|
133
|
+
...Default.args,
|
|
134
|
+
appearance: 'surfacePrimary',
|
|
135
|
+
children: <Icon iconFill="surfaceItemPrimary" size="16" SvgImage={icon16.Close} />,
|
|
136
|
+
},
|
|
137
|
+
}
|
|
138
|
+
export const SurfaceSecondary = {
|
|
139
|
+
args: {
|
|
140
|
+
...Default.args,
|
|
141
|
+
appearance: 'surfaceSecondary',
|
|
142
|
+
children: <Icon iconFill="surfaceItemPrimary" size="16" SvgImage={icon16.Close} />,
|
|
143
|
+
},
|
|
144
|
+
}
|
|
145
|
+
export const SurfaceTertiary = {
|
|
146
|
+
args: {
|
|
147
|
+
...Default.args,
|
|
148
|
+
appearance: 'surfaceTertiary',
|
|
149
|
+
children: <Icon iconFill="surfaceItemPrimary" size="16" SvgImage={icon16.Close} />,
|
|
150
|
+
},
|
|
151
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { Choice } from '@itcase/ui/components/Choice'
|
|
2
|
+
import {
|
|
3
|
+
borderColorProps,
|
|
4
|
+
borderWidthProps,
|
|
5
|
+
textColorProps,
|
|
6
|
+
textSizeProps,
|
|
7
|
+
textWeightProps,
|
|
8
|
+
fillProps,
|
|
9
|
+
fillHoverProps,
|
|
10
|
+
sizeProps,
|
|
11
|
+
shapeProps,
|
|
12
|
+
textColorActiveProps,
|
|
13
|
+
} from '@itcase/ui/constants'
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
title: 'Atoms / Choice',
|
|
17
|
+
component: Choice,
|
|
18
|
+
parameters: {
|
|
19
|
+
controls: {
|
|
20
|
+
exclude: [
|
|
21
|
+
'fill',
|
|
22
|
+
'icon',
|
|
23
|
+
'iconSize',
|
|
24
|
+
'iconItemFillHover',
|
|
25
|
+
'firstName',
|
|
26
|
+
'secondName',
|
|
27
|
+
'textColor',
|
|
28
|
+
'textSize',
|
|
29
|
+
'textWeight',
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
argTypes: {
|
|
34
|
+
advancedProps: { control: 'boolean' },
|
|
35
|
+
className: {
|
|
36
|
+
if: { arg: 'advancedProps' },
|
|
37
|
+
},
|
|
38
|
+
name: {
|
|
39
|
+
if: { arg: 'advancedProps' },
|
|
40
|
+
},
|
|
41
|
+
setActiveSegment: {
|
|
42
|
+
if: { arg: 'advancedProps' },
|
|
43
|
+
},
|
|
44
|
+
type: {
|
|
45
|
+
if: { arg: 'advancedProps' },
|
|
46
|
+
},
|
|
47
|
+
borderColor: {
|
|
48
|
+
options: borderColorProps,
|
|
49
|
+
control: 'select',
|
|
50
|
+
},
|
|
51
|
+
borderWidth: {
|
|
52
|
+
options: borderWidthProps,
|
|
53
|
+
control: 'inline-radio',
|
|
54
|
+
},
|
|
55
|
+
fill: {
|
|
56
|
+
options: fillProps,
|
|
57
|
+
control: 'select',
|
|
58
|
+
},
|
|
59
|
+
fillActive: {
|
|
60
|
+
options: fillProps,
|
|
61
|
+
control: 'select',
|
|
62
|
+
},
|
|
63
|
+
fillActiveHover: {
|
|
64
|
+
options: fillHoverProps,
|
|
65
|
+
control: 'select',
|
|
66
|
+
},
|
|
67
|
+
fillHover: {
|
|
68
|
+
options: fillHoverProps,
|
|
69
|
+
control: 'select',
|
|
70
|
+
},
|
|
71
|
+
labelTextActiveColor: {
|
|
72
|
+
options: textColorActiveProps,
|
|
73
|
+
control: 'select',
|
|
74
|
+
},
|
|
75
|
+
labelTextColor: {
|
|
76
|
+
options: textColorProps,
|
|
77
|
+
control: 'select',
|
|
78
|
+
},
|
|
79
|
+
labelTextSize: {
|
|
80
|
+
options: textSizeProps,
|
|
81
|
+
control: 'inline-radio',
|
|
82
|
+
},
|
|
83
|
+
shape: {
|
|
84
|
+
options: shapeProps,
|
|
85
|
+
control: 'inline-radio',
|
|
86
|
+
},
|
|
87
|
+
size: {
|
|
88
|
+
options: ['tiny', 'compact', 'normal'],
|
|
89
|
+
control: 'inline-radio',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export const Default = {
|
|
95
|
+
args: {
|
|
96
|
+
fill: 'surfacePrimary',
|
|
97
|
+
fillHover: 'surfacePrimaryHover',
|
|
98
|
+
fillActive: 'surfacePrimaryActive',
|
|
99
|
+
fillActiveHover: 'surfacePrimaryActiveHover',
|
|
100
|
+
size: 'normal',
|
|
101
|
+
shape: 'rounded',
|
|
102
|
+
borderColor: 'surfaceBorderTertiary',
|
|
103
|
+
labelTextActiveColor: 'surfaceTextPrimary',
|
|
104
|
+
labelTextColor: 'surfaceTextPrimary',
|
|
105
|
+
labelTextSize: 'm',
|
|
106
|
+
options: [
|
|
107
|
+
{ value: 1, label: 'Label 1' },
|
|
108
|
+
{ value: 2, label: 'Label 2' },
|
|
109
|
+
{ value: 3, label: 'Label 3' },
|
|
110
|
+
{ value: 4, label: 'Label 4' },
|
|
111
|
+
{ value: 5, label: 'Label 5' },
|
|
112
|
+
],
|
|
113
|
+
active: {
|
|
114
|
+
value: 1,
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
}
|