@itcase/ui 1.0.99 → 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.
Files changed (66) hide show
  1. package/dist/components/Button.js +3 -3
  2. package/dist/components/DatePicker.js +46 -28
  3. package/dist/components/FormField.js +1 -1
  4. package/dist/components/Response.js +246 -0
  5. package/dist/components/Select.js +62 -65
  6. package/dist/css/components/Avatar/Avatar.css +1 -1
  7. package/dist/css/components/Badge/Badge.css +1 -1
  8. package/dist/css/components/Checkbox/Checkbox.css +2 -1
  9. package/dist/css/components/DatePicker/DatePicker.css +1 -1
  10. package/dist/css/components/Menu/Menu.css +3 -2
  11. package/dist/css/components/MenuItem/MenuItem.css +26 -0
  12. package/dist/css/components/Pagination/Pagination.css +5 -3
  13. package/dist/css/components/Pagination/css/__item/pagination__item.css +4 -3
  14. package/dist/css/components/Pagination/css/__item/pagination__item_state_disabled.css +1 -0
  15. package/dist/css/components/Response/Response.css +21 -0
  16. package/dist/css/components/Tile/Tile.css +7 -0
  17. package/dist/css/components/Tooltip/Tooltip.css +9 -9
  18. package/dist/{floating-ui.dom-D_Zct5p2.js → floating-ui.dom-C34fOuI9.js} +20 -39
  19. package/dist/stories/Accordion.stories.js +88 -0
  20. package/dist/stories/AccordionItem.stories.js +150 -0
  21. package/dist/stories/Badge.stories.js +116 -0
  22. package/dist/stories/Button.stories.js +287 -0
  23. package/dist/stories/Checkbox.stories.js +116 -0
  24. package/dist/stories/Chips.stories.js +151 -0
  25. package/dist/stories/Choice.stories.js +117 -0
  26. package/dist/stories/Code.stories.js +99 -0
  27. package/dist/stories/DatePicker.stories.js +178 -0
  28. package/dist/stories/Divider.stories.js +132 -0
  29. package/dist/stories/Dot.stories.js +86 -0
  30. package/dist/stories/Dropdown.stories.js +74 -0
  31. package/dist/stories/DropdownItem.stories.js +152 -0
  32. package/dist/stories/Empty.stories.js +115 -0
  33. package/dist/stories/FormFieldCheckbox.stories.js +77 -0
  34. package/dist/stories/FormFieldChoice.stories.js +75 -0
  35. package/dist/stories/FormFieldDatepicker.stories.js +51 -0
  36. package/dist/stories/FormFieldFileInput.stories.js +58 -0
  37. package/dist/stories/FormFieldInput.stories.js +66 -0
  38. package/dist/stories/FormFieldInputPassword.stories.js +66 -0
  39. package/dist/stories/FormFieldMultiBadgeSelect.stories.js +132 -0
  40. package/dist/stories/FormFieldMultiSelect.stories.js +127 -0
  41. package/dist/stories/FormFieldSelect.stories.js +99 -0
  42. package/dist/stories/FormFieldSelectGroup.stories.js +84 -0
  43. package/dist/stories/Icon.stories.js +208 -0
  44. package/dist/stories/Input.stories.js +124 -0
  45. package/dist/stories/InputPassword.stories.js +114 -0
  46. package/dist/stories/Label.stories.js +163 -0
  47. package/dist/stories/Loader.stories.js +121 -0
  48. package/dist/stories/Logo.stories.js +99 -0
  49. package/dist/stories/MenuItem.stories.js +193 -0
  50. package/dist/stories/ModalConfirm.stories.js +61 -0
  51. package/dist/stories/ModalDefault.stories.js +34 -0
  52. package/dist/stories/NotFound.stories.js +94 -0
  53. package/dist/stories/Notification.stories.js +128 -0
  54. package/dist/stories/Pagination.stories.js +66 -0
  55. package/dist/stories/RadioButton.stories.js +101 -0
  56. package/dist/stories/Search-input.stories.js +182 -0
  57. package/dist/stories/Segmented.stories.js +110 -0
  58. package/dist/stories/Select.stories.js +280 -0
  59. package/dist/stories/Switch.stories.js +84 -0
  60. package/dist/stories/Tab.appearance.stories.js +260 -0
  61. package/dist/stories/Tab.group.stories.js +149 -0
  62. package/dist/stories/Tab.size.stories.js +259 -0
  63. package/dist/stories/Tab.state.stories.js +227 -0
  64. package/dist/stories/Textarea.stories.js +90 -0
  65. package/dist/stories/Tile.stories.js +235 -0
  66. package/package.json +1 -1
@@ -0,0 +1,110 @@
1
+ import { Segmented } from '@itcase/ui/components/Segmented'
2
+
3
+ import {
4
+ borderColorProps,
5
+ borderTypeProps,
6
+ borderWidthProps,
7
+ fillProps,
8
+ fillHoverProps,
9
+ shapeProps,
10
+ textColorProps,
11
+ textSizeProps,
12
+ textWrapProps,
13
+ widthProps,
14
+ } from '@itcase/ui/constants'
15
+
16
+ export default {
17
+ title: 'Atoms / Segmented',
18
+ component: Segmented,
19
+ argTypes: {
20
+ advancedProps: { control: 'boolean' },
21
+ className: {
22
+ if: { arg: 'advancedProps' },
23
+ },
24
+ name: {
25
+ if: { arg: 'advancedProps' },
26
+ },
27
+ type: {
28
+ if: { arg: 'advancedProps' },
29
+ },
30
+ setActiveSegment: {
31
+ if: { arg: 'advancedProps' },
32
+ },
33
+ indicatorFill: {
34
+ options: fillProps,
35
+ control: 'select',
36
+ },
37
+ borderColor: {
38
+ options: borderColorProps,
39
+ control: 'select',
40
+ },
41
+ borderWidth: {
42
+ options: borderWidthProps,
43
+ control: 'inline-radio',
44
+ },
45
+ borderType: {
46
+ options: borderTypeProps,
47
+ control: 'inline-radio',
48
+ },
49
+ shape: {
50
+ options: shapeProps,
51
+ control: 'inline-radio',
52
+ },
53
+ fill: {
54
+ options: fillProps,
55
+ control: 'select',
56
+ },
57
+ fillHover: {
58
+ options: fillHoverProps,
59
+ control: 'select',
60
+ },
61
+ size: {
62
+ options: ['normal', 'compact'],
63
+ control: 'inline-radio',
64
+ },
65
+ labelTextColor: {
66
+ options: textColorProps,
67
+ control: 'select',
68
+ },
69
+ labelTextActiveColor: {
70
+ options: textColorProps,
71
+ control: 'select',
72
+ },
73
+ labelTextSize: {
74
+ options: textSizeProps,
75
+ control: 'inline-radio',
76
+ },
77
+ labelTextWrap: {
78
+ options: textWrapProps,
79
+ control: 'inline-radio',
80
+ },
81
+ width: {
82
+ options: widthProps,
83
+ control: 'inline-radio',
84
+ },
85
+ },
86
+ }
87
+
88
+ export const Default = {
89
+ args: {
90
+ width: 'fill',
91
+ size: 'normal',
92
+ fill: 'surfaceSecondary',
93
+ fillHover: 'surfacePrimaryHover',
94
+ shape: 'rounded',
95
+ indicatorFill: 'accentPrimary',
96
+ labelTextActiveColor: 'accentTextPrimary',
97
+ labelTextColor: 'surfaceTextPrimary',
98
+ labelTextSize: 'm',
99
+ labelTextWrap: 'wrap',
100
+ segments: [
101
+ { value: 1, label: 'Label 1 Lorem ipsum dolor sit amet' },
102
+ { value: 2, label: 'Label 2' },
103
+ { value: 3, label: 'Label 3' },
104
+ { value: 4, label: 'Label 4' },
105
+ ],
106
+ activeSegment: {
107
+ value: 1,
108
+ },
109
+ },
110
+ }
@@ -0,0 +1,280 @@
1
+ import { Select } from '@itcase/ui/components/Select'
2
+ import { Button } from '@itcase/ui/components/Button'
3
+ import { Loader } from '@itcase/ui/components/Loader'
4
+
5
+ import {
6
+ borderColorProps,
7
+ borderColorHoverProps,
8
+ fillProps,
9
+ fillHoverProps,
10
+ textColorProps,
11
+ textSizeProps,
12
+ sizeProps,
13
+ strokeColorProps,
14
+ } from '@itcase/ui/constants'
15
+
16
+ import { defaultSelectProps } from 'src/config/forms'
17
+
18
+ import { icon14, icon16 } from 'src/icons'
19
+
20
+ export default {
21
+ title: 'Atoms / Select',
22
+ component: Select,
23
+ parameters: {
24
+ controls: {
25
+ exclude: [
26
+ 'optionShape',
27
+ 'inputCaretColor',
28
+ 'inputShape',
29
+ 'animationOpen',
30
+ 'animationClose',
31
+ 'optionFillHover',
32
+ 'headingFill',
33
+ 'headingTextColor',
34
+ 'headingTextSize',
35
+ 'headingTextWeight',
36
+ 'filterOption',
37
+ 'initialValue',
38
+ 'set',
39
+ 'onChange',
40
+ 'openMenuOnClick',
41
+ ],
42
+ },
43
+ docs: {
44
+ story: {
45
+ inline: false,
46
+ iframeHeight: 800,
47
+ },
48
+ },
49
+ },
50
+ argTypes: {
51
+ advancedProps: { control: 'boolean' },
52
+ className: {
53
+ if: { arg: 'advancedProps' },
54
+ },
55
+ inputBefore: {
56
+ if: { arg: 'advancedProps' },
57
+ },
58
+ inputAfter: {
59
+ if: { arg: 'advancedProps' },
60
+ },
61
+ closeMenuOnSelect: {
62
+ control: 'boolean',
63
+ },
64
+ elevation: {
65
+ options: [1, 2, 4, 6, 8, 12, 16, 24],
66
+ control: 'inline-radio',
67
+ },
68
+ optionFill: {
69
+ options: fillProps,
70
+ control: 'select',
71
+ },
72
+ optionTextColor: {
73
+ options: textColorProps,
74
+ control: 'select',
75
+ },
76
+ optionTextSize: {
77
+ options: textSizeProps,
78
+ control: 'inline-radio',
79
+ },
80
+ clearIcon: {
81
+ if: { arg: 'isClearable', eq: true },
82
+ },
83
+ clearIconFill: {
84
+ if: { arg: 'isClearable', eq: true },
85
+ options: fillProps,
86
+ control: 'select',
87
+ },
88
+ clearIconStroke: {
89
+ if: { arg: 'isClearable', eq: true },
90
+ options: strokeColorProps,
91
+ control: 'select',
92
+ },
93
+ isClearable: {
94
+ control: 'boolean',
95
+ },
96
+ inputFill: {
97
+ if: { arg: 'hideValueContainer', neq: true },
98
+ options: fillProps,
99
+ control: 'select',
100
+ },
101
+ inputTextSize: {
102
+ if: { arg: 'hideValueContainer', neq: true },
103
+ options: textSizeProps,
104
+ control: 'inline-radio',
105
+ },
106
+ inputTextColor: {
107
+ if: { arg: 'hideValueContainer', neq: true },
108
+ options: textColorProps,
109
+ control: 'select',
110
+ },
111
+ inputBorderColor: {
112
+ if: { arg: 'hideValueContainer', neq: true },
113
+ options: borderColorProps,
114
+ control: 'select',
115
+ },
116
+ inputBorderColorHover: {
117
+ if: { arg: 'hideValueContainer', neq: true },
118
+ options: borderColorHoverProps,
119
+ control: 'select',
120
+ },
121
+ dropdownIconFill: {
122
+ options: fillProps,
123
+ control: 'select',
124
+ },
125
+ dropdownIconStroke: {
126
+ options: strokeColorProps,
127
+ control: 'select',
128
+ },
129
+ placeholder: {
130
+ if: { arg: 'hideValueContainer', neq: true },
131
+ },
132
+ placeholderTextSize: {
133
+ if: { arg: 'hideValueContainer', neq: true },
134
+ options: textSizeProps,
135
+ control: 'inline-radio',
136
+ },
137
+ placeholderTextColor: {
138
+ if: { arg: 'hideValueContainer', neq: true },
139
+ options: textColorProps,
140
+ control: 'select',
141
+ },
142
+ noOptionsTextSize: {
143
+ options: textSizeProps,
144
+ control: 'inline-radio',
145
+ },
146
+ noOptionsTextColor: {
147
+ options: textColorProps,
148
+ control: 'select',
149
+ },
150
+ multipleItemFill: {
151
+ if: { arg: 'hideValueContainer', neq: true },
152
+ options: fillProps,
153
+ control: 'select',
154
+ },
155
+ multipleItemFillHover: {
156
+ if: { arg: 'hideValueContainer', neq: true },
157
+ options: fillHoverProps,
158
+ control: 'select',
159
+ },
160
+ multipleItemTextSize: {
161
+ if: { arg: 'hideValueContainer', neq: true },
162
+ options: textSizeProps,
163
+ control: 'inline-radio',
164
+ },
165
+ multipleItemTextColor: {
166
+ if: { arg: 'hideValueContainer', neq: true },
167
+ options: textColorProps,
168
+ control: 'select',
169
+ },
170
+ multipleItemIcon: {
171
+ if: { arg: 'hideValueContainer', neq: true },
172
+ },
173
+ multipleItemIconFill: {
174
+ if: { arg: 'hideValueContainer', neq: true },
175
+ options: fillProps,
176
+ control: 'select',
177
+ },
178
+ isMulti: {
179
+ control: 'boolean',
180
+ },
181
+ isSearchable: {
182
+ control: 'boolean',
183
+ },
184
+ hideSelectedOptions: {
185
+ control: 'boolean',
186
+ },
187
+ hideValueContainer: {
188
+ control: 'boolean',
189
+ },
190
+ menuItemSize: {
191
+ options: ['xs', 's', 'm', 'l', 'xl', 'xxl'],
192
+ control: 'inline-radio',
193
+ },
194
+ dividerDirection: {
195
+ if: { arg: 'advancedProps' },
196
+ },
197
+ dividerFill: {
198
+ options: fillProps,
199
+ control: 'select',
200
+ },
201
+ dividerSize: {
202
+ options: sizeProps,
203
+ control: 'inline-radio',
204
+ },
205
+ },
206
+ args: {
207
+ ...defaultSelectProps,
208
+ noOptionsText: (
209
+ <Loader
210
+ fill="surfacePrimary"
211
+ height="fill"
212
+ itemFill="surfaceItemAccent"
213
+ left="0px"
214
+ position="absolute"
215
+ right="0px"
216
+ set="simple"
217
+ width="fill"
218
+ zIndex="1"
219
+ />
220
+ ),
221
+ optionFill: 'surfacePrimary',
222
+ optionFillHover: 'surfacePrimaryHover',
223
+ optionTextColor: 'surfaceTextPrimary',
224
+ optionTextSize: 'l',
225
+ options: [
226
+ { label: 'Завершены', value: 'completed' },
227
+ { label: 'Идут торги', value: 'active' },
228
+ { label: 'Остановлены', value: 'stopped' },
229
+ { label: 'Отменены', value: 'canceled' },
230
+ { label: 'Планируемые', value: 'planned' },
231
+ { label: 'Продолжены', value: 'continued' },
232
+ ],
233
+ dropdownIconFill: 'surfaceItemPrimary',
234
+ menuItemSize: 'l',
235
+ hideSelectedOptions: false,
236
+ isClearable: true,
237
+ isMulti: false,
238
+ isSearchable: false,
239
+ showDivider: false,
240
+ },
241
+ }
242
+
243
+ export const Default = {
244
+ args: {},
245
+ }
246
+
247
+ export const WithSearch = {
248
+ args: {
249
+ ...Default.args,
250
+ isSearchable: true,
251
+ },
252
+ }
253
+
254
+ export const Multi = {
255
+ args: {
256
+ ...Default.args,
257
+ isMulti: true,
258
+ },
259
+ }
260
+
261
+ export const NoInput = {
262
+ args: {
263
+ ...Default.args,
264
+ isClearable: false,
265
+ isMulti: true,
266
+ hideValueContainer: true,
267
+ dropdownIcon: icon16.Filter,
268
+ menuAfter: (
269
+ <Button
270
+ appearance="surfaceSecondary"
271
+ label="Очистить"
272
+ labelTextSize="m"
273
+ size="l"
274
+ width="fill"
275
+ />
276
+ ),
277
+ size: 'none',
278
+ showDivider: true,
279
+ },
280
+ }
@@ -0,0 +1,84 @@
1
+ import { Switch } from '@itcase/ui/components/Switch'
2
+
3
+ export default {
4
+ title: 'Atoms / Switch ',
5
+ component: Switch,
6
+ argTypes: {
7
+ advancedProps: { control: 'boolean' },
8
+ className: {
9
+ if: { arg: 'advancedProps' },
10
+ },
11
+ id: {
12
+ if: { arg: 'advancedProps' },
13
+ },
14
+ set: {
15
+ if: { arg: 'advancedProps' },
16
+ },
17
+ onChange: {
18
+ if: { arg: 'advancedProps' },
19
+ },
20
+ size: {
21
+ options: ['normal', 'compact'],
22
+ control: 'inline-radio',
23
+ },
24
+ checked: {
25
+ control: 'boolean',
26
+ },
27
+ disabled: {
28
+ control: 'boolean',
29
+ },
30
+ },
31
+ }
32
+
33
+ export const Default = {
34
+ args: {
35
+ disabled: false,
36
+ checked: false,
37
+ size: 'normal',
38
+ },
39
+ }
40
+
41
+ export const Active = {
42
+ args: {
43
+ ...Default.args,
44
+ disabled: false,
45
+ checked: false,
46
+ },
47
+ }
48
+ export const ActiveChecked = {
49
+ args: {
50
+ ...Default.args,
51
+ disabled: false,
52
+ checked: true,
53
+ },
54
+ }
55
+ export const Disabled = {
56
+ args: {
57
+ ...Default.args,
58
+ disabled: true,
59
+ checked: false,
60
+ },
61
+ }
62
+ export const DisabledChecked = {
63
+ args: {
64
+ ...Default.args,
65
+ disabled: true,
66
+ checked: true,
67
+ },
68
+ }
69
+
70
+ export const Normal = {
71
+ args: {
72
+ size: 'normal',
73
+ disabled: false,
74
+ checked: true,
75
+ },
76
+ }
77
+
78
+ export const Compact = {
79
+ args: {
80
+ size: 'compact',
81
+ disabled: false,
82
+ checked: true,
83
+ },
84
+ }