@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.
- package/dist/components/Button.js +3 -3
- package/dist/components/DatePicker.js +46 -28
- package/dist/components/FormField.js +1 -1
- package/dist/components/Response.js +246 -0
- package/dist/components/Select.js +62 -65
- package/dist/css/components/Avatar/Avatar.css +1 -1
- 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/Response/Response.css +21 -0
- package/dist/css/components/Tile/Tile.css +7 -0
- package/dist/css/components/Tooltip/Tooltip.css +9 -9
- package/dist/{floating-ui.dom-D_Zct5p2.js → floating-ui.dom-C34fOuI9.js} +20 -39
- 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,127 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { formTypes, emailValidation, addRequiredFieldsParamToSchema } from '@itcase/forms'
|
|
3
|
+
import * as yup from 'yup'
|
|
4
|
+
|
|
5
|
+
import Form from './form.js'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Form Field / SelectMulti',
|
|
9
|
+
component: Form,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
import { icon16, icon24 } from '../../../icons'
|
|
13
|
+
|
|
14
|
+
const Template = (args) => {
|
|
15
|
+
const DEFAULT_REQUIRED_MESSAGE = 'This field is required'
|
|
16
|
+
const DEFAULT_INVALID_EMAIL_MESSAGE = 'Username must be a valid email'
|
|
17
|
+
|
|
18
|
+
// Create validation schema with rules for form fields
|
|
19
|
+
const validationSchema = yup.object().shape({
|
|
20
|
+
formFieldSelect: yup
|
|
21
|
+
.string()
|
|
22
|
+
.test('formFieldSelect', DEFAULT_INVALID_EMAIL_MESSAGE, emailValidation)
|
|
23
|
+
.required(DEFAULT_REQUIRED_MESSAGE),
|
|
24
|
+
password: yup.string().trim().required(DEFAULT_REQUIRED_MESSAGE),
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
// Add "requiredFields" as new param to schema
|
|
28
|
+
if (!('requiredFields' in validationSchema)) {
|
|
29
|
+
addRequiredFieldsParamToSchema(validationSchema)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Create form config with fields
|
|
33
|
+
const config = {
|
|
34
|
+
formFieldSelect: {
|
|
35
|
+
type: formTypes.select,
|
|
36
|
+
name: 'types',
|
|
37
|
+
fieldProps: {
|
|
38
|
+
type: 'normal',
|
|
39
|
+
width: 'fill',
|
|
40
|
+
direction: 'vertical',
|
|
41
|
+
dividerFill: 'errorPrimary',
|
|
42
|
+
fill: 'surfacePrimary',
|
|
43
|
+
label: 'Title',
|
|
44
|
+
labelTextSize: 'm',
|
|
45
|
+
labelTextColor: 'surfaceTextPrimary',
|
|
46
|
+
message: 'Help Text',
|
|
47
|
+
messageTextSize: 'xs',
|
|
48
|
+
messageTextColor: 'surfaceTextSecondary',
|
|
49
|
+
errorMessageTextSize: 'xs',
|
|
50
|
+
errorMessageTextColor: 'errorTextPrimary',
|
|
51
|
+
},
|
|
52
|
+
selectProps: {
|
|
53
|
+
elevation: 8,
|
|
54
|
+
showDivider: true,
|
|
55
|
+
dividerDirection: 'horizontal',
|
|
56
|
+
dividerFill: 'surfaceTertiary',
|
|
57
|
+
dividerSize: 'xxs',
|
|
58
|
+
size: 'normal',
|
|
59
|
+
optionFill: 'surfacePrimary',
|
|
60
|
+
optionFillHover: 'surfacePrimaryHover',
|
|
61
|
+
optionBorder: 'none',
|
|
62
|
+
optionShape: 'rounded',
|
|
63
|
+
optionTextColor: 'surfaceTextPrimary',
|
|
64
|
+
optionTextSize: 'm',
|
|
65
|
+
inputFill: 'surfacePrimary',
|
|
66
|
+
inputTextSize: 'm',
|
|
67
|
+
inputTextColor: 'surfaceTextPrimary',
|
|
68
|
+
inputCaretColor: 'secondaryItemPrimary',
|
|
69
|
+
inputShape: 'rounded',
|
|
70
|
+
inputBorderColor: 'surfaceBorderTertiary',
|
|
71
|
+
|
|
72
|
+
multipleItemFill: 'accentPrimary',
|
|
73
|
+
multipleItemFillHover: 'accentPrimaryHover',
|
|
74
|
+
multipleItemTextSize: 'm',
|
|
75
|
+
multipleItemTextColor: 'accentTextPrimary',
|
|
76
|
+
|
|
77
|
+
multipleItemIcon: icon16.Remove,
|
|
78
|
+
multipleItemIconFill: 'accentItemPrimary',
|
|
79
|
+
|
|
80
|
+
clearIcon: icon24.Clear,
|
|
81
|
+
clearIconFill: 'surfaceItemPrimary',
|
|
82
|
+
|
|
83
|
+
dropdownIcon: icon24.ChevronDownSmall,
|
|
84
|
+
dropdownIconFill: 'surfaceItemPrimary',
|
|
85
|
+
|
|
86
|
+
placeholder: 'Выбрать...',
|
|
87
|
+
placeholderTextSize: 'm',
|
|
88
|
+
placeholderTextColor: 'surfaceTextPrimary',
|
|
89
|
+
|
|
90
|
+
noOptionsText: 'Ничего не найдено...',
|
|
91
|
+
noOptionsTextSize: 'm',
|
|
92
|
+
noOptionsTextColor: 'surfaceTextPrimary',
|
|
93
|
+
isClearable: true,
|
|
94
|
+
|
|
95
|
+
isMulti: true,
|
|
96
|
+
isSearchable: false,
|
|
97
|
+
closeMenuOnSelect: false,
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
options: [
|
|
101
|
+
{
|
|
102
|
+
label: 'Администратор',
|
|
103
|
+
value: 'admin',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
label: 'Менеджер',
|
|
107
|
+
value: 'manager',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
label: 'Модератор',
|
|
111
|
+
value: 'moderator',
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
label: 'Участник',
|
|
115
|
+
value: 'participant',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
label: 'Сотрудник службы безопасности',
|
|
119
|
+
value: 'security',
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
}
|
|
124
|
+
return <Form config={config} validationSchema={validationSchema} />
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export const Normal = Template.bind({})
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { formTypes, emailValidation, addRequiredFieldsParamToSchema } from '@itcase/forms'
|
|
3
|
+
import * as yup from 'yup'
|
|
4
|
+
|
|
5
|
+
import Form from './form.js'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Form Field / Select',
|
|
9
|
+
component: Form,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
import { icon24 } from '../../../icons'
|
|
13
|
+
|
|
14
|
+
const Template = (args) => {
|
|
15
|
+
const DEFAULT_REQUIRED_MESSAGE = 'This field is required'
|
|
16
|
+
const DEFAULT_INVALID_EMAIL_MESSAGE = 'Username must be a valid email'
|
|
17
|
+
|
|
18
|
+
// Create validation schema with rules for form fields
|
|
19
|
+
const validationSchema = yup.object().shape({
|
|
20
|
+
formFieldSelect: yup
|
|
21
|
+
.string()
|
|
22
|
+
.test('formFieldSelect', DEFAULT_INVALID_EMAIL_MESSAGE, emailValidation)
|
|
23
|
+
.required(DEFAULT_REQUIRED_MESSAGE),
|
|
24
|
+
password: yup.string().trim().required(DEFAULT_REQUIRED_MESSAGE),
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
// Add "requiredFields" as new param to schema
|
|
28
|
+
if (!('requiredFields' in validationSchema)) {
|
|
29
|
+
addRequiredFieldsParamToSchema(validationSchema)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Create form config with fields
|
|
33
|
+
const config = {
|
|
34
|
+
formFieldSelect: {
|
|
35
|
+
type: formTypes.select,
|
|
36
|
+
isRequired: true,
|
|
37
|
+
name: 'formFieldSelect',
|
|
38
|
+
fieldProps: {
|
|
39
|
+
type: 'normal',
|
|
40
|
+
width: 'fill',
|
|
41
|
+
direction: 'vertical',
|
|
42
|
+
dividerFill: 'errorPrimary',
|
|
43
|
+
fill: 'surfacePrimary',
|
|
44
|
+
label: 'Title',
|
|
45
|
+
labelTextSize: 'm',
|
|
46
|
+
labelTextColor: 'surfaceTextPrimary',
|
|
47
|
+
message: 'Help Text',
|
|
48
|
+
messageTextSize: 'xs',
|
|
49
|
+
messageTextColor: 'surfaceTextSecondary',
|
|
50
|
+
errorMessageTextSize: 'xs',
|
|
51
|
+
errorMessageTextColor: 'errorTextPrimary',
|
|
52
|
+
},
|
|
53
|
+
selectProps: {
|
|
54
|
+
elevation: 8,
|
|
55
|
+
showDivider: true,
|
|
56
|
+
dividerDirection: 'horizontal',
|
|
57
|
+
dividerFill: 'surfaceTertiary',
|
|
58
|
+
dividerSize: 'xxs',
|
|
59
|
+
size: 'normal',
|
|
60
|
+
optionFill: 'surfacePrimary',
|
|
61
|
+
optionFillHover: 'surfacePrimaryHover',
|
|
62
|
+
optionBorder: 'none',
|
|
63
|
+
optionShape: 'rounded',
|
|
64
|
+
optionTextColor: 'surfaceTextPrimary',
|
|
65
|
+
optionTextSize: 'm',
|
|
66
|
+
inputFill: 'surfacePrimary',
|
|
67
|
+
inputTextSize: 'm',
|
|
68
|
+
inputTextColor: 'surfaceTextPrimary',
|
|
69
|
+
inputCaretColor: 'secondaryItemPrimary',
|
|
70
|
+
inputShape: 'rounded',
|
|
71
|
+
inputBorderColor: 'surfaceBorderTertiary',
|
|
72
|
+
|
|
73
|
+
clearIcon: icon24.Clear,
|
|
74
|
+
clearIconFill: 'surfaceItemPrimary',
|
|
75
|
+
|
|
76
|
+
dropdownIcon: icon24.ChevronDownSmall,
|
|
77
|
+
dropdownIconFill: 'surfaceItemPrimary',
|
|
78
|
+
|
|
79
|
+
placeholder: 'Выбрать...',
|
|
80
|
+
placeholderTextSize: 'm',
|
|
81
|
+
placeholderTextColor: 'surfaceTextPrimary',
|
|
82
|
+
|
|
83
|
+
noOptionsText: 'Ничего не найдено...',
|
|
84
|
+
noOptionsTextSize: 'm',
|
|
85
|
+
noOptionsTextColor: 'surfaceTextPrimary',
|
|
86
|
+
isClearable: true,
|
|
87
|
+
isSearchable: true,
|
|
88
|
+
},
|
|
89
|
+
options: [
|
|
90
|
+
{ value: 'Категория 1', label: 'Категория 1' },
|
|
91
|
+
{ value: 'Категория 2', label: 'Категория 2' },
|
|
92
|
+
{ value: 'Категория 3', label: 'Категория 3', editable: true },
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
}
|
|
96
|
+
return <Form config={config} validationSchema={validationSchema} />
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export const Normal = Template.bind({})
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { formTypes, emailValidation, addRequiredFieldsParamToSchema } from '@itcase/forms'
|
|
3
|
+
import * as yup from 'yup'
|
|
4
|
+
|
|
5
|
+
import Form from './form.js'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Form Field / SelectGroup',
|
|
9
|
+
component: Form,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
import { defaultSelectProps, defaultFieldProps } from 'src/config/forms'
|
|
13
|
+
|
|
14
|
+
import { icon24 } from '../../../icons'
|
|
15
|
+
|
|
16
|
+
const Template = (args) => {
|
|
17
|
+
const DEFAULT_REQUIRED_MESSAGE = 'This field is required'
|
|
18
|
+
const DEFAULT_INVALID_EMAIL_MESSAGE = 'Username must be a valid email'
|
|
19
|
+
|
|
20
|
+
// Create validation schema with rules for form fields
|
|
21
|
+
const validationSchema = yup.object().shape({
|
|
22
|
+
formFieldSelect: yup
|
|
23
|
+
.string()
|
|
24
|
+
.test('formFieldSelect', DEFAULT_INVALID_EMAIL_MESSAGE, emailValidation)
|
|
25
|
+
.required(DEFAULT_REQUIRED_MESSAGE),
|
|
26
|
+
password: yup.string().trim().required(DEFAULT_REQUIRED_MESSAGE),
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
// Add "requiredFields" as new param to schema
|
|
30
|
+
if (!('requiredFields' in validationSchema)) {
|
|
31
|
+
addRequiredFieldsParamToSchema(validationSchema)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const colourOptions = [
|
|
35
|
+
{ value: 'ocean', label: 'Ocean', color: '#00B8D9' },
|
|
36
|
+
{ value: 'blue', label: 'Blue', color: '#0052CC' },
|
|
37
|
+
{ value: 'purple', label: 'Purple', color: '#5243AA' },
|
|
38
|
+
{ value: 'red', label: 'Red', color: '#FF5630' },
|
|
39
|
+
{ value: 'orange', label: 'Orange', color: '#FF8B00' },
|
|
40
|
+
{ value: 'yellow', label: 'Yellow', color: '#FFC400' },
|
|
41
|
+
{ value: 'green', label: 'Green', color: '#36B37E' },
|
|
42
|
+
{ value: 'forest', label: 'Forest', color: '#00875A' },
|
|
43
|
+
{ value: 'slate', label: 'Slate', color: '#253858' },
|
|
44
|
+
{ value: 'silver', label: 'Silver', color: '#666666' },
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
const flavourOptions = [
|
|
48
|
+
{ value: 'vanilla', label: 'Vanilla', rating: 'safe' },
|
|
49
|
+
{ value: 'chocolate', label: 'Chocolate', rating: 'good' },
|
|
50
|
+
{ value: 'strawberry', label: 'Strawberry', rating: 'wild' },
|
|
51
|
+
{ value: 'salted-caramel', label: 'Salted Caramel', rating: 'crazy' },
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
// Create form config with fields
|
|
55
|
+
const config = {
|
|
56
|
+
formFieldSelect: {
|
|
57
|
+
type: formTypes.select,
|
|
58
|
+
isRequired: true,
|
|
59
|
+
name: 'formFieldSelect',
|
|
60
|
+
fieldProps: {
|
|
61
|
+
...defaultFieldProps,
|
|
62
|
+
label: 'Title',
|
|
63
|
+
message: 'Help Text',
|
|
64
|
+
},
|
|
65
|
+
selectProps: {
|
|
66
|
+
...defaultSelectProps
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
options: [
|
|
70
|
+
{
|
|
71
|
+
label: '5555555',
|
|
72
|
+
options: colourOptions,
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
label: '7777777',
|
|
76
|
+
options: flavourOptions,
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
}
|
|
81
|
+
return <Form config={config} validationSchema={validationSchema} />
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export const Normal = Template.bind({})
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { Badge } from '@itcase/ui/components/Badge'
|
|
2
|
+
import { Icon, iconConfig } from '@itcase/ui/components/Icon'
|
|
3
|
+
import {
|
|
4
|
+
borderColorHoverProps,
|
|
5
|
+
borderColorProps,
|
|
6
|
+
borderTypeProps,
|
|
7
|
+
borderWidthProps,
|
|
8
|
+
fillHoverProps,
|
|
9
|
+
fillProps,
|
|
10
|
+
shapeProps,
|
|
11
|
+
sizePXProps,
|
|
12
|
+
strokeColorProps,
|
|
13
|
+
} from '@itcase/ui/constants'
|
|
14
|
+
|
|
15
|
+
import iconAppearance from 'src/components/Icon/appearance.json'
|
|
16
|
+
|
|
17
|
+
iconConfig.setAppearance(iconAppearance)
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
title: 'Atoms / Icon',
|
|
21
|
+
component: Icon,
|
|
22
|
+
parameters: {
|
|
23
|
+
controls: {
|
|
24
|
+
exclude: [
|
|
25
|
+
'textColor',
|
|
26
|
+
'textColorHover',
|
|
27
|
+
'fillDesktop',
|
|
28
|
+
'fillMobile',
|
|
29
|
+
'fillTablet',
|
|
30
|
+
'fillSizeDesktop',
|
|
31
|
+
'fillSizeMobile',
|
|
32
|
+
'fillSizeTablet',
|
|
33
|
+
'shapeDesktop',
|
|
34
|
+
'shapeMobile',
|
|
35
|
+
'shapeTablet',
|
|
36
|
+
'size',
|
|
37
|
+
'sizeDesktop',
|
|
38
|
+
'sizeMobile',
|
|
39
|
+
'sizeTablet',
|
|
40
|
+
'iconStrokeDesktop',
|
|
41
|
+
'iconStrokeMobile',
|
|
42
|
+
'iconStrokeTablet',
|
|
43
|
+
'height',
|
|
44
|
+
'href',
|
|
45
|
+
'link',
|
|
46
|
+
'linkRel',
|
|
47
|
+
'linkTarget',
|
|
48
|
+
'strokeDesktop',
|
|
49
|
+
'strokeMobile',
|
|
50
|
+
'strokeTablet',
|
|
51
|
+
'width',
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
argTypes: {
|
|
56
|
+
advancedProps: { control: 'boolean' },
|
|
57
|
+
fill: {
|
|
58
|
+
options: fillProps,
|
|
59
|
+
control: 'select',
|
|
60
|
+
},
|
|
61
|
+
fillHover: {
|
|
62
|
+
options: fillHoverProps,
|
|
63
|
+
control: 'select',
|
|
64
|
+
},
|
|
65
|
+
fillSize: {
|
|
66
|
+
options: sizePXProps,
|
|
67
|
+
control: 'select',
|
|
68
|
+
},
|
|
69
|
+
iconFill: {
|
|
70
|
+
options: fillProps,
|
|
71
|
+
control: 'select',
|
|
72
|
+
},
|
|
73
|
+
iconFillHover: {
|
|
74
|
+
options: fillProps,
|
|
75
|
+
control: 'select',
|
|
76
|
+
},
|
|
77
|
+
iconSize: {
|
|
78
|
+
options: sizePXProps,
|
|
79
|
+
control: 'select',
|
|
80
|
+
},
|
|
81
|
+
iconStroke: {
|
|
82
|
+
options: strokeColorProps,
|
|
83
|
+
control: 'select',
|
|
84
|
+
},
|
|
85
|
+
iconStrokeHover: {
|
|
86
|
+
options: strokeColorProps,
|
|
87
|
+
control: 'select',
|
|
88
|
+
},
|
|
89
|
+
borderType: {
|
|
90
|
+
options: borderTypeProps,
|
|
91
|
+
control: 'inline-radio',
|
|
92
|
+
},
|
|
93
|
+
borderColor: {
|
|
94
|
+
options: borderColorProps,
|
|
95
|
+
control: 'select',
|
|
96
|
+
},
|
|
97
|
+
borderColorHover: {
|
|
98
|
+
options: borderColorHoverProps,
|
|
99
|
+
control: 'select',
|
|
100
|
+
},
|
|
101
|
+
borderWidth: {
|
|
102
|
+
options: borderWidthProps,
|
|
103
|
+
control: 'select',
|
|
104
|
+
},
|
|
105
|
+
className: {
|
|
106
|
+
if: { arg: 'advancedProps' },
|
|
107
|
+
},
|
|
108
|
+
dataTour: {
|
|
109
|
+
if: { arg: 'advancedProps' },
|
|
110
|
+
},
|
|
111
|
+
onClick: {
|
|
112
|
+
if: { arg: 'advancedProps' },
|
|
113
|
+
},
|
|
114
|
+
LinkComponent: {
|
|
115
|
+
if: { arg: 'advancedProps' },
|
|
116
|
+
},
|
|
117
|
+
SvgImage: {
|
|
118
|
+
if: { arg: 'advancedProps' },
|
|
119
|
+
},
|
|
120
|
+
shape: {
|
|
121
|
+
options: shapeProps,
|
|
122
|
+
control: 'inline-radio',
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export const Default = {
|
|
128
|
+
args: {
|
|
129
|
+
iconStroke: 'surfaceItemPrimary',
|
|
130
|
+
imageSrc: 'assets/24/Bell.svg',
|
|
131
|
+
fill: 'surfaceSecondary',
|
|
132
|
+
fillHover: 'surfaceSecondaryHover',
|
|
133
|
+
fillSize: '40',
|
|
134
|
+
iconSize: '24',
|
|
135
|
+
shape: 'circular',
|
|
136
|
+
},
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export const WithBadge = {
|
|
140
|
+
args: {
|
|
141
|
+
imageSrc: 'assets/24/Bell.svg',
|
|
142
|
+
fill: 'surfaceSecondary',
|
|
143
|
+
fillHover: 'surfaceSecondaryHover',
|
|
144
|
+
fillSize: '40',
|
|
145
|
+
iconSize: '24',
|
|
146
|
+
iconStroke: 'surfaceItemPrimary',
|
|
147
|
+
shape: 'circular',
|
|
148
|
+
Badge: <Badge appearance="accent" position="absolute" size="xs" textSize="xxs" value={3} />,
|
|
149
|
+
},
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export const WithTooltip = {
|
|
153
|
+
args: {
|
|
154
|
+
width: '16',
|
|
155
|
+
iconFill: 'surfaceItemPrimary',
|
|
156
|
+
imageSrc: 'assets/16/Search.svg',
|
|
157
|
+
tooltipText: 'Search',
|
|
158
|
+
tooltipTextSize: 'm',
|
|
159
|
+
showTooltip: true,
|
|
160
|
+
tooltipAppearance: 'surfaceTertiary',
|
|
161
|
+
alignment: 'topRight',
|
|
162
|
+
},
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export const Size14 = {
|
|
166
|
+
args: {
|
|
167
|
+
imageSrc: 'assets/14/Remove.svg',
|
|
168
|
+
fill: 'surfaceSecondary',
|
|
169
|
+
fillHover: 'surfaceSecondaryHover',
|
|
170
|
+
fillSize: '24',
|
|
171
|
+
iconSize: '14',
|
|
172
|
+
iconFill: 'surfaceItemPrimary',
|
|
173
|
+
shape: 'circular',
|
|
174
|
+
},
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export const Size16 = {
|
|
178
|
+
args: {
|
|
179
|
+
imageSrc: 'assets/16/Search.svg',
|
|
180
|
+
fill: 'surfaceSecondary',
|
|
181
|
+
fillHover: 'surfaceSecondaryHover',
|
|
182
|
+
fillSize: '32',
|
|
183
|
+
iconSize: '16',
|
|
184
|
+
iconFill: 'surfaceItemPrimary',
|
|
185
|
+
shape: 'circular',
|
|
186
|
+
},
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export const Size24 = {
|
|
190
|
+
args: {
|
|
191
|
+
imageSrc: 'assets/24/Delete.svg',
|
|
192
|
+
fill: 'surfaceSecondary',
|
|
193
|
+
fillHover: 'surfaceSecondaryHover',
|
|
194
|
+
fillSize: '40',
|
|
195
|
+
iconSize: '24',
|
|
196
|
+
iconFill: 'surfaceItemPrimary',
|
|
197
|
+
shape: 'circular',
|
|
198
|
+
},
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export const Size40 = {
|
|
202
|
+
args: {
|
|
203
|
+
imageSrc: 'assets/40/close.svg',
|
|
204
|
+
fillHover: 'surfaceSecondaryHover',
|
|
205
|
+
iconSize: '40',
|
|
206
|
+
shape: 'circular',
|
|
207
|
+
},
|
|
208
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Input, inputConfig } from '@itcase/ui/components/Input'
|
|
2
|
+
import inputState from 'src/components/Input/state.json'
|
|
3
|
+
import { borderColorProps, textColorProps, textSizeProps } from '@itcase/ui/constants'
|
|
4
|
+
|
|
5
|
+
inputConfig.setState(inputState)
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Atoms / Input',
|
|
9
|
+
component: Input,
|
|
10
|
+
argTypes: {
|
|
11
|
+
advancedProps: { control: 'boolean' },
|
|
12
|
+
className: {
|
|
13
|
+
if: { arg: 'advancedProps' },
|
|
14
|
+
},
|
|
15
|
+
checked: {
|
|
16
|
+
if: { arg: 'advancedProps' },
|
|
17
|
+
control: 'boolean',
|
|
18
|
+
},
|
|
19
|
+
id: {
|
|
20
|
+
if: { arg: 'advancedProps' },
|
|
21
|
+
},
|
|
22
|
+
onBlur: {
|
|
23
|
+
if: { arg: 'advancedProps' },
|
|
24
|
+
},
|
|
25
|
+
onKeyDown: {
|
|
26
|
+
if: { arg: 'advancedProps' },
|
|
27
|
+
},
|
|
28
|
+
borderColor: {
|
|
29
|
+
options: borderColorProps,
|
|
30
|
+
control: 'select',
|
|
31
|
+
},
|
|
32
|
+
disabled: {
|
|
33
|
+
control: 'boolean',
|
|
34
|
+
},
|
|
35
|
+
shape: {
|
|
36
|
+
options: [null, 'rounded', 'underline'],
|
|
37
|
+
control: 'inline-radio',
|
|
38
|
+
},
|
|
39
|
+
state: {
|
|
40
|
+
options: [
|
|
41
|
+
null,
|
|
42
|
+
'normal',
|
|
43
|
+
'filled',
|
|
44
|
+
'active',
|
|
45
|
+
'activeFilled',
|
|
46
|
+
'error',
|
|
47
|
+
'errorFilled',
|
|
48
|
+
'readonly',
|
|
49
|
+
'disabled',
|
|
50
|
+
'success',
|
|
51
|
+
'require',
|
|
52
|
+
],
|
|
53
|
+
control: 'inline-radio',
|
|
54
|
+
},
|
|
55
|
+
size: {
|
|
56
|
+
options: [null, 'xs', 's', 'm', 'l', 'xl', 'xxl', 'tiny', 'compact', 'normal', 'large'],
|
|
57
|
+
control: 'inline-radio',
|
|
58
|
+
},
|
|
59
|
+
textColor: {
|
|
60
|
+
options: textColorProps,
|
|
61
|
+
control: 'select',
|
|
62
|
+
},
|
|
63
|
+
textSize: {
|
|
64
|
+
options: textSizeProps,
|
|
65
|
+
control: 'inline-radio',
|
|
66
|
+
},
|
|
67
|
+
type: {
|
|
68
|
+
options: ['text', 'number', 'password'],
|
|
69
|
+
control: 'inline-radio',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export const Default = {
|
|
75
|
+
args: {
|
|
76
|
+
borderColor: 'surfaceBorderTertiary',
|
|
77
|
+
placeholder: 'Placeholder',
|
|
78
|
+
shape: 'rounded',
|
|
79
|
+
textSize: 'm',
|
|
80
|
+
value: 'Filled',
|
|
81
|
+
},
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export const SizeXS = {
|
|
85
|
+
args: {
|
|
86
|
+
...Default.args,
|
|
87
|
+
size: 'xs',
|
|
88
|
+
},
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export const SizeS = {
|
|
92
|
+
args: {
|
|
93
|
+
...Default.args,
|
|
94
|
+
size: 's',
|
|
95
|
+
},
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export const SizeM = {
|
|
99
|
+
args: {
|
|
100
|
+
...Default.args,
|
|
101
|
+
size: 'm',
|
|
102
|
+
},
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export const SizeL = {
|
|
106
|
+
args: {
|
|
107
|
+
...Default.args,
|
|
108
|
+
size: 'l',
|
|
109
|
+
},
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export const SizeXL = {
|
|
113
|
+
args: {
|
|
114
|
+
...Default.args,
|
|
115
|
+
size: 'xl',
|
|
116
|
+
},
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export const SizeXXL = {
|
|
120
|
+
args: {
|
|
121
|
+
...Default.args,
|
|
122
|
+
size: 'xxl',
|
|
123
|
+
},
|
|
124
|
+
}
|