@itcase/ui 1.0.100 → 1.0.102

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 (62) hide show
  1. package/dist/css/components/Badge/Badge.css +1 -1
  2. package/dist/css/components/Checkbox/Checkbox.css +2 -1
  3. package/dist/css/components/DatePicker/DatePicker.css +1 -1
  4. package/dist/css/components/Group/Group.css +1 -1
  5. package/dist/css/components/Menu/Menu.css +3 -2
  6. package/dist/css/components/MenuItem/MenuItem.css +26 -0
  7. package/dist/css/components/Pagination/Pagination.css +5 -3
  8. package/dist/css/components/Pagination/css/__item/pagination__item.css +4 -3
  9. package/dist/css/components/Pagination/css/__item/pagination__item_state_disabled.css +1 -0
  10. package/dist/css/components/Select/Select.css +5 -0
  11. package/dist/css/components/Select/css/__indicators/select__indicators.css +1 -0
  12. package/dist/css/components/Select/css/__value-container/select__value-container.css +4 -0
  13. package/dist/css/components/Tile/Tile.css +7 -0
  14. package/dist/css/components/Tooltip/Tooltip.css +9 -9
  15. package/dist/stories/Accordion.stories.js +88 -0
  16. package/dist/stories/AccordionItem.stories.js +150 -0
  17. package/dist/stories/Badge.stories.js +116 -0
  18. package/dist/stories/Button.stories.js +287 -0
  19. package/dist/stories/Checkbox.stories.js +116 -0
  20. package/dist/stories/Chips.stories.js +151 -0
  21. package/dist/stories/Choice.stories.js +117 -0
  22. package/dist/stories/Code.stories.js +99 -0
  23. package/dist/stories/DatePicker.stories.js +178 -0
  24. package/dist/stories/Divider.stories.js +132 -0
  25. package/dist/stories/Dot.stories.js +86 -0
  26. package/dist/stories/Dropdown.stories.js +74 -0
  27. package/dist/stories/DropdownItem.stories.js +152 -0
  28. package/dist/stories/Empty.stories.js +115 -0
  29. package/dist/stories/FormFieldCheckbox.stories.js +77 -0
  30. package/dist/stories/FormFieldChoice.stories.js +75 -0
  31. package/dist/stories/FormFieldDatepicker.stories.js +51 -0
  32. package/dist/stories/FormFieldFileInput.stories.js +58 -0
  33. package/dist/stories/FormFieldInput.stories.js +66 -0
  34. package/dist/stories/FormFieldInputPassword.stories.js +66 -0
  35. package/dist/stories/FormFieldMultiBadgeSelect.stories.js +132 -0
  36. package/dist/stories/FormFieldMultiSelect.stories.js +127 -0
  37. package/dist/stories/FormFieldSelect.stories.js +99 -0
  38. package/dist/stories/FormFieldSelectGroup.stories.js +84 -0
  39. package/dist/stories/Icon.stories.js +208 -0
  40. package/dist/stories/Input.stories.js +124 -0
  41. package/dist/stories/InputPassword.stories.js +114 -0
  42. package/dist/stories/Label.stories.js +163 -0
  43. package/dist/stories/Loader.stories.js +121 -0
  44. package/dist/stories/Logo.stories.js +99 -0
  45. package/dist/stories/MenuItem.stories.js +193 -0
  46. package/dist/stories/ModalConfirm.stories.js +61 -0
  47. package/dist/stories/ModalDefault.stories.js +34 -0
  48. package/dist/stories/NotFound.stories.js +94 -0
  49. package/dist/stories/Notification.stories.js +128 -0
  50. package/dist/stories/Pagination.stories.js +66 -0
  51. package/dist/stories/RadioButton.stories.js +101 -0
  52. package/dist/stories/Search-input.stories.js +182 -0
  53. package/dist/stories/Segmented.stories.js +110 -0
  54. package/dist/stories/Select.stories.js +280 -0
  55. package/dist/stories/Switch.stories.js +84 -0
  56. package/dist/stories/Tab.appearance.stories.js +260 -0
  57. package/dist/stories/Tab.group.stories.js +149 -0
  58. package/dist/stories/Tab.size.stories.js +259 -0
  59. package/dist/stories/Tab.state.stories.js +227 -0
  60. package/dist/stories/Textarea.stories.js +90 -0
  61. package/dist/stories/Tile.stories.js +235 -0
  62. package/package.json +1 -1
@@ -0,0 +1,115 @@
1
+ import { buttonConfig } from '@itcase/ui/components/Button'
2
+ import { Empty } from '@itcase/ui/components/Empty'
3
+ import { Image } from '@itcase/ui/components/Image'
4
+ import {
5
+ fillHoverProps,
6
+ fillProps,
7
+ shapeProps,
8
+ sizeProps,
9
+ textColorProps,
10
+ textSizeProps,
11
+ widthProps,
12
+ } from '@itcase/ui/constants'
13
+
14
+ import buttonAppearance from 'src/components/Button/appearance.json'
15
+
16
+ buttonConfig.setAppearance(buttonAppearance)
17
+
18
+ export default {
19
+ title: 'Atoms / Empty',
20
+ component: Empty,
21
+ argTypes: {
22
+ advancedProps: { control: 'boolean' },
23
+ buttonAfter: {
24
+ if: { arg: 'advancedProps' },
25
+ },
26
+ buttonBefore: {
27
+ if: { arg: 'advancedProps' },
28
+ },
29
+ buttonFill: {
30
+ options: fillProps,
31
+ control: 'select',
32
+ },
33
+ buttonFillHover: {
34
+ options: fillHoverProps,
35
+ control: 'select',
36
+ },
37
+ buttonLabelTextColor: {
38
+ options: textColorProps,
39
+ control: 'select',
40
+ },
41
+ buttonLabelTextSize: {
42
+ options: textSizeProps,
43
+ control: 'inline-radio',
44
+ },
45
+ buttonShape: {
46
+ options: shapeProps,
47
+ control: 'inline-radio',
48
+ },
49
+ buttonSize: {
50
+ options: sizeProps,
51
+ control: 'inline-radio',
52
+ },
53
+ buttonWidth: {
54
+ options: widthProps,
55
+ control: 'inline-radio',
56
+ },
57
+ messageTextColor: {
58
+ options: textColorProps,
59
+ control: 'select',
60
+ },
61
+ messageTextSize: {
62
+ options: textSizeProps,
63
+ control: 'inline-radio',
64
+ },
65
+ buttonAppearance: {
66
+ options: [
67
+ null,
68
+ 'accent',
69
+ 'primary',
70
+ 'secondary',
71
+ 'surfacePrimary',
72
+ 'surfaceSecondary',
73
+ 'surfaceTertiary',
74
+ 'surfaceDisabled',
75
+ ],
76
+ control: 'inline-radio',
77
+ },
78
+ },
79
+ }
80
+
81
+ export const Default = {
82
+ args: {
83
+ // before: <Image alt="search_sign" src="assets/img/search.svg" />,
84
+ message: 'message',
85
+ messageTextColor: 'surfaceTextPrimary',
86
+ messageTextSize: 'l',
87
+ buttonLabel: 'Label',
88
+ buttonLabelTextSize: 'm',
89
+ buttonShape: 'rounded',
90
+ buttonSize: 'xxl',
91
+ buttonWidth: 'fixed',
92
+ buttonAppearance: 'surfaceDisabled',
93
+ },
94
+ }
95
+
96
+ export const Accent = {
97
+ args: {
98
+ ...Default.args,
99
+ buttonAppearance: 'accent',
100
+ },
101
+ }
102
+
103
+ export const Primary = {
104
+ args: {
105
+ ...Default.args,
106
+ buttonAppearance: 'primary',
107
+ },
108
+ }
109
+
110
+ export const Secondary = {
111
+ args: {
112
+ ...Default.args,
113
+ buttonAppearance: 'secondary',
114
+ },
115
+ }
@@ -0,0 +1,77 @@
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 / Checkbox',
9
+ component: Form,
10
+ }
11
+
12
+ const Template = (args) => {
13
+ const DEFAULT_REQUIRED_MESSAGE = 'This field is required'
14
+ const DEFAULT_INVALID_EMAIL_MESSAGE = 'Username must be a valid email'
15
+
16
+ // Create validation schema with rules for form fields
17
+ const validationSchema = yup.object().shape({
18
+ formFieldCheckbox: yup
19
+ .string()
20
+ .test('formFieldCheckbox', DEFAULT_INVALID_EMAIL_MESSAGE, emailValidation)
21
+ .required(DEFAULT_REQUIRED_MESSAGE),
22
+ password: yup.string().trim().required(DEFAULT_REQUIRED_MESSAGE),
23
+ })
24
+
25
+ // Add "requiredFields" as new param to schema
26
+ if (!('requiredFields' in validationSchema)) {
27
+ addRequiredFieldsParamToSchema(validationSchema)
28
+ }
29
+
30
+ // Create form config with fields
31
+ const config = {
32
+ formFieldCheckbox: {
33
+ type: formTypes.checkbox,
34
+ isRequired: true,
35
+ name: 'formFieldCheckbox',
36
+ fieldProps: {
37
+ type: 'normal',
38
+ width: 'fill',
39
+ direction: 'vertical',
40
+ dividerFill: 'errorPrimary',
41
+ fill: 'surfacePrimary',
42
+ label: 'Title',
43
+ labelTextSize: 'm',
44
+ labelTextColor: 'surfaceTextPrimary',
45
+ message: 'Help Text',
46
+ messageTextSize: 'xs',
47
+ messageTextColor: 'surfaceTextSecondary',
48
+ errorMessageTextSize: 'xs',
49
+ errorMessageTextColor: 'errorTextPrimary',
50
+ },
51
+ inputProps: {
52
+ width: 'fill',
53
+ caret: 'secondaryItemSecondary',
54
+ placeholder: 'Placeholder',
55
+ placeholderTextColor: 'surfaceTextSecondary',
56
+ shape: 'rounded',
57
+ borderColor: 'surfaceBorderQuaternary',
58
+ textColor: 'surfaceTextPrimary',
59
+ textSize: 'm',
60
+ stateShape: 'rounded',
61
+ stateBorderColor: 'accentBorderSecondary',
62
+ stateBorderColorChecked: 'accentBorderSecondary',
63
+ stateBorderColorDisabled: 'accentBorderSecondary',
64
+ stateBorderColorDisabledChecked: 'accentBorderSecondary',
65
+ stateBorderWidth: 1,
66
+ stateFillChecked: 'accentPrimary',
67
+ stateFillDisabled: 'accentDisabled',
68
+ stateFillDisabledChecked: 'accentDisabled',
69
+ stateCheckmarkFill: 'accentItemPrimary',
70
+ stateCheckmarkFillDisabled: 'accentItemDisabled',
71
+ },
72
+ },
73
+ }
74
+ return <Form config={config} validationSchema={validationSchema} />
75
+ }
76
+
77
+ export const Normal = Template.bind({})
@@ -0,0 +1,75 @@
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 / Choice',
9
+ component: Form,
10
+ }
11
+
12
+ const Template = (args) => {
13
+ const DEFAULT_REQUIRED_MESSAGE = 'This field is required'
14
+ const DEFAULT_INVALID_EMAIL_MESSAGE = 'Username must be a valid email'
15
+
16
+ // Create validation schema with rules for form fields
17
+ const validationSchema = yup.object().shape({
18
+ formFieldChoice: yup
19
+ .string()
20
+ .test('formFieldChoice', DEFAULT_INVALID_EMAIL_MESSAGE, emailValidation)
21
+ .required(DEFAULT_REQUIRED_MESSAGE),
22
+ password: yup.string().trim().required(DEFAULT_REQUIRED_MESSAGE),
23
+ })
24
+
25
+ // Add "requiredFields" as new param to schema
26
+ if (!('requiredFields' in validationSchema)) {
27
+ addRequiredFieldsParamToSchema(validationSchema)
28
+ }
29
+
30
+ // Create form config with fields
31
+ const config = {
32
+ formFieldChoice: {
33
+ type: formTypes.choice,
34
+ isRequired: true,
35
+ name: 'formFieldChoice',
36
+ fieldProps: {
37
+ type: 'normal',
38
+ width: 'fill',
39
+ direction: 'vertical',
40
+ dividerFill: 'errorPrimary',
41
+ fill: 'surfacePrimary',
42
+ label: 'Title',
43
+ labelTextSize: 'm',
44
+ labelTextColor: 'surfaceTextPrimary',
45
+ message: 'Help Text',
46
+ messageTextSize: 'xs',
47
+ messageTextColor: 'surfaceTextSecondary',
48
+ errorMessageTextSize: 'xs',
49
+ errorMessageTextColor: 'errorTextPrimary',
50
+ },
51
+ inputProps: {
52
+ width: 'fill',
53
+ size: 'normal',
54
+ shape: 'rounded',
55
+ borderColor: 'surfaceBorderTertiary',
56
+ labelTextActiveColor: 'surfaceTextPrimary',
57
+ labelTextColor: 'surfaceTextPrimary',
58
+ labelTextSize: 'm',
59
+ },
60
+ options: [
61
+ { value: 1, label: 'Label 1' },
62
+ { value: 2, label: 'Label 2' },
63
+ { value: 3, label: 'Label 3' },
64
+ { value: 4, label: 'Label 4' },
65
+ { value: 5, label: 'Label 5' },
66
+ ],
67
+ active: {
68
+ value: 1,
69
+ },
70
+ },
71
+ }
72
+ return <Form config={config} validationSchema={validationSchema} />
73
+ }
74
+
75
+ export const Normal = Template.bind({})
@@ -0,0 +1,51 @@
1
+ import React from 'react'
2
+ import * as yup from 'yup'
3
+
4
+ import { formTypes } from '@itcase/forms'
5
+
6
+ import Form from './form.js'
7
+
8
+ import { defaultFieldProps, defaultInputProps, defaultDatepickerProps } from 'src/config/forms'
9
+ import { DEFAULT_REQUIRED_MESSAGE } from 'src/config/forms/messages'
10
+
11
+ export default {
12
+ title: 'Form Field / DatePicker',
13
+ component: Form,
14
+ }
15
+
16
+ const Template = (args) => {
17
+ const validationSchema = yup.object().shape({
18
+ formFieldDatePicker: yup.string().required(DEFAULT_REQUIRED_MESSAGE),
19
+ password: yup.string().trim().required(DEFAULT_REQUIRED_MESSAGE),
20
+ })
21
+
22
+ const config = {
23
+ formFieldDatePicker: {
24
+ type: formTypes.datePicker,
25
+ name: 'formFieldDatePicker',
26
+ fieldProps: {
27
+ ...defaultFieldProps,
28
+ label: args?.config?.fieldProps?.label || 'Дата',
29
+ message: 'Например: 20/06/2023',
30
+ },
31
+ inputProps: {
32
+ ...defaultInputProps,
33
+ },
34
+ datePickerProps: {
35
+ ...defaultDatepickerProps,
36
+ },
37
+ },
38
+ }
39
+ return <Form config={config} validationSchema={validationSchema} />
40
+ }
41
+
42
+ export const Date = Template.bind({})
43
+
44
+ export const DateTime = Template.bind()
45
+ DateTime.args = {
46
+ config: {
47
+ fieldProps: {
48
+ label: 'asdasdasdasdasd'
49
+ }
50
+ }
51
+ }
@@ -0,0 +1,58 @@
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 / File Input',
9
+ component: Form,
10
+ }
11
+
12
+ const Template = (args) => {
13
+ const DEFAULT_REQUIRED_MESSAGE = 'This field is required'
14
+ const DEFAULT_INVALID_EMAIL_MESSAGE = 'Username must be a valid email'
15
+
16
+ // Create validation schema with rules for form fields
17
+ const validationSchema = yup.object().shape({
18
+ formFieldInput: yup
19
+ .string()
20
+ .test('formFieldInput', DEFAULT_INVALID_EMAIL_MESSAGE, emailValidation)
21
+ .required(DEFAULT_REQUIRED_MESSAGE),
22
+ password: yup.string().trim().required(DEFAULT_REQUIRED_MESSAGE),
23
+ })
24
+
25
+ // Add "requiredFields" as new param to schema
26
+ if (!('requiredFields' in validationSchema)) {
27
+ addRequiredFieldsParamToSchema(validationSchema)
28
+ }
29
+
30
+ // Create form config with fields
31
+ const config = {
32
+ formFieldInput: {
33
+ type: formTypes.fileInput,
34
+ isRequired: true,
35
+ isPreviews: true,
36
+ showFilename: true,
37
+ size: 'normal',
38
+ name: 'formFieldInput',
39
+ hintTitle: 'Перетащите изображение или выберите файл с компьютера ',
40
+ hintTitleTextSize: 'm',
41
+ hintTitleTextColor: 'surfaceTextPrimary',
42
+ fill: 'surfacePrimary',
43
+ fillHover: 'surfacePrimaryHover',
44
+ borderColor: 'surfaceBorderTertiary',
45
+ thumbNameTextSize: 'm',
46
+ thumbNameTextColor: 'surfaceTextPrimary',
47
+ removeThumbText: 'удалить',
48
+ removeThumbTextSize: 's',
49
+ removeThumbTextColor: 'errorTextPrimary',
50
+ removeThumbTextHoverColor: 'errorTextPrimaryHover',
51
+ thumbBorderWidth: 1,
52
+ thumbBorderColor: 'surfaceBorderTertiary',
53
+ },
54
+ }
55
+ return <Form config={config} validationSchema={validationSchema} />
56
+ }
57
+
58
+ export const Normal = Template.bind({})
@@ -0,0 +1,66 @@
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 / Input',
9
+ component: Form,
10
+ }
11
+
12
+ const Template = (args) => {
13
+ const DEFAULT_REQUIRED_MESSAGE = 'This field is required'
14
+ const DEFAULT_INVALID_EMAIL_MESSAGE = 'Username must be a valid email'
15
+
16
+ // Create validation schema with rules for form fields
17
+ const validationSchema = yup.object().shape({
18
+ formFieldInput: yup
19
+ .string()
20
+ .test('formFieldInput', DEFAULT_INVALID_EMAIL_MESSAGE, emailValidation)
21
+ .required(DEFAULT_REQUIRED_MESSAGE),
22
+ password: yup.string().trim().required(DEFAULT_REQUIRED_MESSAGE),
23
+ })
24
+
25
+ // Add "requiredFields" as new param to schema
26
+ if (!('requiredFields' in validationSchema)) {
27
+ addRequiredFieldsParamToSchema(validationSchema)
28
+ }
29
+
30
+ // Create form config with fields
31
+ const config = {
32
+ formFieldInput: {
33
+ type: formTypes.text,
34
+ isRequired: true,
35
+ name: 'formFieldInput',
36
+ fieldProps: {
37
+ type: 'normal',
38
+ width: 'fill',
39
+ direction: 'vertical',
40
+ dividerFill: 'errorPrimary',
41
+ fill: 'surfacePrimary',
42
+ label: 'Title',
43
+ labelTextSize: 'm',
44
+ labelTextColor: 'surfaceTextPrimary',
45
+ message: 'Help Text',
46
+ messageTextSize: 'xs',
47
+ messageTextColor: 'surfaceTextSecondary',
48
+ errorMessageTextSize: 'xs',
49
+ errorMessageTextColor: 'errorTextPrimary',
50
+ },
51
+ inputProps: {
52
+ width: 'fill',
53
+ caret: 'secondaryItemSecondary',
54
+ placeholder: 'Placeholder',
55
+ placeholderTextColor: 'surfaceTextSecondary',
56
+ shape: 'rounded',
57
+ borderColor: 'surfaceBorderQuaternary',
58
+ textColor: 'surfaceTextPrimary',
59
+ textSize: 'm',
60
+ },
61
+ },
62
+ }
63
+ return <Form config={config} validationSchema={validationSchema} />
64
+ }
65
+
66
+ export const Normal = Template.bind({})
@@ -0,0 +1,66 @@
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 / Password',
9
+ component: Form,
10
+ }
11
+
12
+ const Template = (args) => {
13
+ const DEFAULT_REQUIRED_MESSAGE = 'This field is required'
14
+ const DEFAULT_INVALID_EMAIL_MESSAGE = 'Username must be a valid email'
15
+
16
+ // Create validation schema with rules for form fields
17
+ const validationSchema = yup.object().shape({
18
+ formFieldInput: yup
19
+ .string()
20
+ .test('formFieldInput', DEFAULT_INVALID_EMAIL_MESSAGE, emailValidation)
21
+ .required(DEFAULT_REQUIRED_MESSAGE),
22
+ password: yup.string().trim().required(DEFAULT_REQUIRED_MESSAGE),
23
+ })
24
+
25
+ // Add "requiredFields" as new param to schema
26
+ if (!('requiredFields' in validationSchema)) {
27
+ addRequiredFieldsParamToSchema(validationSchema)
28
+ }
29
+
30
+ // Create form config with fields
31
+ const config = {
32
+ formFieldInput: {
33
+ type: formTypes.text,
34
+ isRequired: true,
35
+ name: 'formFieldInput',
36
+ fieldProps: {
37
+ type: 'normal',
38
+ width: 'fill',
39
+ direction: 'vertical',
40
+ dividerFill: 'errorPrimary',
41
+ fill: 'surfacePrimary',
42
+ label: 'Title',
43
+ labelTextSize: 'm',
44
+ labelTextColor: 'surfaceTextPrimary',
45
+ message: 'Help Text',
46
+ messageTextSize: 'xs',
47
+ messageTextColor: 'surfaceTextSecondary',
48
+ errorMessageTextSize: 'xs',
49
+ errorMessageTextColor: 'errorTextPrimary',
50
+ },
51
+ inputProps: {
52
+ width: 'fill',
53
+ caret: 'secondaryItemSecondary',
54
+ placeholder: 'Placeholder',
55
+ placeholderTextColor: 'surfaceTextSecondary',
56
+ shape: 'rounded',
57
+ borderColor: 'surfaceBorderQuaternary',
58
+ textColor: 'surfaceTextPrimary',
59
+ textSize: 'm',
60
+ },
61
+ },
62
+ }
63
+ return <Form config={config} validationSchema={validationSchema} />
64
+ }
65
+
66
+ export const Normal = Template.bind({})
@@ -0,0 +1,132 @@
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 / SelectBadgeMulti',
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
+ showBadge: true,
81
+ badgeAppearance: 'accent',
82
+ badgeSize: 'm',
83
+ badgeTextSize: 'm',
84
+
85
+ clearIcon: icon24.Clear,
86
+ clearIconFill: 'surfaceItemPrimary',
87
+
88
+ dropdownIcon: icon24.ChevronDownSmall,
89
+ dropdownIconFill: 'surfaceItemPrimary',
90
+
91
+ placeholder: 'Выбрать...',
92
+ placeholderTextSize: 'm',
93
+ placeholderTextColor: 'surfaceTextPrimary',
94
+
95
+ noOptionsText: 'Ничего не найдено...',
96
+ noOptionsTextSize: 'm',
97
+ noOptionsTextColor: 'surfaceTextPrimary',
98
+ isClearable: true,
99
+
100
+ isMulti: true,
101
+ isSearchable: false,
102
+ closeMenuOnSelect: false,
103
+ },
104
+
105
+ options: [
106
+ {
107
+ label: 'Администратор',
108
+ value: 'admin',
109
+ },
110
+ {
111
+ label: 'Менеджер',
112
+ value: 'manager',
113
+ },
114
+ {
115
+ label: 'Модератор',
116
+ value: 'moderator',
117
+ },
118
+ {
119
+ label: 'Участник',
120
+ value: 'participant',
121
+ },
122
+ {
123
+ label: 'Сотрудник службы безопасности',
124
+ value: 'security',
125
+ },
126
+ ],
127
+ },
128
+ }
129
+ return <Form config={config} validationSchema={validationSchema} />
130
+ }
131
+
132
+ export const Normal = Template.bind({})