@scbt-ecom/ui 0.0.30 → 0.0.31
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/client.d.ts +2 -0
- package/dist/client.js +921 -0
- package/dist/cn-uh4jkx7b.js +2892 -0
- package/dist/configs/index.d.ts +1 -0
- package/dist/configs/tailwindConfigBase.d.ts +2 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +15 -0
- package/dist/shared/constants/api.d.ts +2 -0
- package/dist/shared/constants/designSystem/colors.d.ts +120 -0
- package/dist/shared/constants/designSystem/index.d.ts +3 -0
- package/dist/shared/constants/designSystem/others.d.ts +16 -0
- package/dist/shared/constants/designSystem/typography.d.ts +75 -0
- package/dist/shared/constants/index.d.ts +2 -0
- package/dist/shared/hooks/index.d.ts +4 -0
- package/dist/shared/hooks/useBoolean.d.ts +3 -0
- package/dist/shared/hooks/useClickOutside.d.ts +2 -0
- package/dist/shared/hooks/useControlledForm.d.ts +7 -0
- package/dist/shared/hooks/useDebounce.d.ts +3 -0
- package/dist/shared/ui/Badge.d.ts +6 -0
- package/dist/shared/ui/Breadcrumbs.d.ts +15 -0
- package/dist/shared/ui/ButtonIcon.d.ts +17 -0
- package/dist/shared/ui/CustomLink.d.ts +15 -0
- package/dist/shared/ui/Document.d.ts +13 -0
- package/dist/shared/ui/Heading.d.ts +12 -0
- package/dist/shared/ui/Hint.d.ts +21 -0
- package/dist/shared/ui/Loader.d.ts +21 -0
- package/dist/shared/ui/PhoneView.d.ts +12 -0
- package/dist/shared/ui/Portal.d.ts +7 -0
- package/dist/shared/ui/ProgressBar.d.ts +18 -0
- package/dist/shared/ui/ResponsiveContainer.d.ts +6 -0
- package/dist/shared/ui/Section.d.ts +6 -0
- package/dist/shared/ui/Skeleton.d.ts +4 -0
- package/dist/shared/ui/TabsSwitcher.d.ts +33 -0
- package/dist/shared/ui/accordion/Accordion.d.ts +13 -0
- package/dist/shared/ui/accordion/index.d.ts +1 -0
- package/dist/shared/ui/accordion/model/types.d.ts +17 -0
- package/dist/shared/ui/accordion/ui/AccordionHeader.d.ts +8 -0
- package/dist/shared/ui/brandLogos.d.ts +5 -0
- package/dist/shared/ui/button/Button.d.ts +17 -0
- package/dist/shared/ui/button/index.d.ts +1 -0
- package/dist/shared/ui/button/model/helpers.d.ts +2 -0
- package/dist/shared/ui/calendar/Calendar.d.ts +20 -0
- package/dist/shared/ui/calendar/index.d.ts +1 -0
- package/dist/shared/ui/calendar/model/animation.d.ts +18 -0
- package/dist/shared/ui/calendar/model/classes.d.ts +24 -0
- package/dist/shared/ui/calendar/model/helpers.d.ts +9 -0
- package/dist/shared/ui/calendar/model/hooks/index.d.ts +2 -0
- package/dist/shared/ui/calendar/model/hooks/useCalendarDropdowns.d.ts +9 -0
- package/dist/shared/ui/calendar/model/hooks/useDatePicker.d.ts +19 -0
- package/dist/shared/ui/calendar/ui/CalendarHeader.d.ts +15 -0
- package/dist/shared/ui/calendar/ui/Dropdown.d.ts +10 -0
- package/dist/shared/ui/calendar/ui/NavigationArrows.d.ts +5 -0
- package/dist/shared/ui/calendar/ui/Weekdays.d.ts +1 -0
- package/dist/shared/ui/calendar/ui/index.d.ts +2 -0
- package/dist/shared/ui/formControlElements/CheckboxControl.d.ts +13 -0
- package/dist/shared/ui/formControlElements/FormControl.d.ts +3 -0
- package/dist/shared/ui/formControlElements/InputControl.d.ts +6 -0
- package/dist/shared/ui/formControlElements/InputControlMask.d.ts +10 -0
- package/dist/shared/ui/formControlElements/RadioControl.d.ts +26 -0
- package/dist/shared/ui/formControlElements/SelectControl.d.ts +27 -0
- package/dist/shared/ui/formControlElements/SwitchControl.d.ts +16 -0
- package/dist/shared/ui/formControlElements/TextareaControl.d.ts +11 -0
- package/dist/shared/ui/formControlElements/calendarControl/CalendarControl.d.ts +13 -0
- package/dist/shared/ui/formControlElements/calendarControl/hooks/index.d.ts +2 -0
- package/dist/shared/ui/formControlElements/calendarControl/hooks/useCalendar.d.ts +16 -0
- package/dist/shared/ui/formControlElements/calendarControl/hooks/useCalendarDropdowns.d.ts +9 -0
- package/{lib/shared/ui/formControlElements/calendarControl/index.ts → dist/shared/ui/formControlElements/calendarControl/index.d.ts} +1 -1
- package/dist/shared/ui/formControlElements/calendarControl/model/helpers.d.ts +24 -0
- package/dist/shared/ui/formControlElements/calendarControl/model/types.d.ts +33 -0
- package/dist/shared/ui/formControlElements/calendarControl/ui/DaysOfMonth.d.ts +10 -0
- package/dist/shared/ui/formControlElements/calendarControl/ui/DaysOfWeek.d.ts +6 -0
- package/dist/shared/ui/formControlElements/calendarControl/ui/Dropdown.d.ts +11 -0
- package/dist/shared/ui/formControlElements/calendarControl/ui/Header.d.ts +14 -0
- package/dist/shared/ui/formControlElements/calendarControl/ui/Navigation.d.ts +9 -0
- package/dist/shared/ui/formControlElements/calendarControl/ui/OptionsList.d.ts +5 -0
- package/dist/shared/ui/formControlElements/calendarControl/ui/index.d.ts +4 -0
- package/dist/shared/ui/formControlElements/dadata/DadataInputControl.d.ts +14 -0
- package/{lib/shared/ui/formControlElements/dadata/index.ts → dist/shared/ui/formControlElements/dadata/index.d.ts} +1 -1
- package/dist/shared/ui/formControlElements/dadata/model/api.d.ts +2 -0
- package/dist/shared/ui/formControlElements/dadata/model/helpers.d.ts +7 -0
- package/dist/shared/ui/formControlElements/dadata/model/types.d.ts +42 -0
- package/dist/shared/ui/formControlElements/dadata/model/useDadata.d.ts +7 -0
- package/{lib/shared/ui/formControlElements/index.ts → dist/shared/ui/formControlElements/index.d.ts} +10 -10
- package/dist/shared/ui/formControlElements/model/classes-types.d.ts +18 -0
- package/dist/shared/ui/formControlElements/model/index.d.ts +2 -0
- package/dist/shared/ui/formControlElements/model/props-types.d.ts +20 -0
- package/dist/shared/ui/formControlElements/ui/FieldAttachment.d.ts +13 -0
- package/dist/shared/ui/formControlElements/ui/FieldContainer.d.ts +14 -0
- package/dist/shared/ui/formControlElements/ui/FieldWrapper.d.ts +14 -0
- package/dist/shared/ui/formControlElements/ui/MessageView.d.ts +13 -0
- package/dist/shared/ui/formControlElements/ui/index.d.ts +4 -0
- package/dist/shared/ui/icon/Icon.d.ts +10 -0
- package/{lib/shared/ui/icon/index.ts → dist/shared/ui/icon/index.d.ts} +2 -2
- package/dist/shared/ui/icon/sprite.gen.d.ts +17 -0
- package/dist/shared/ui/index.d.ts +21 -0
- package/dist/shared/ui/popover/Popover.d.ts +23 -0
- package/dist/shared/ui/popover/index.d.ts +1 -0
- package/dist/shared/ui/table/Table.d.ts +17 -0
- package/dist/shared/ui/table/index.d.ts +1 -0
- package/dist/shared/ui/table/type.d.ts +21 -0
- package/dist/shared/utils/capitalize.d.ts +1 -0
- package/dist/shared/utils/cn.d.ts +2 -0
- package/dist/shared/utils/deepCompare.d.ts +1 -0
- package/dist/shared/utils/formatToDate.d.ts +1 -0
- package/dist/shared/utils/index.d.ts +5 -0
- package/dist/shared/utils/isClient.d.ts +1 -0
- package/dist/shared/validation/index.d.ts +3 -0
- package/dist/shared/validation/messages.d.ts +12 -0
- package/dist/shared/validation/regExp.d.ts +3 -0
- package/dist/shared/validation/zodValidation/calendar.d.ts +2 -0
- package/dist/shared/validation/zodValidation/dadataFio.d.ts +6 -0
- package/dist/shared/validation/zodValidation/index.d.ts +2 -0
- package/dist/widgets/Advantages.d.ts +17 -0
- package/dist/widgets/banner/Banner.d.ts +28 -0
- package/dist/widgets/banner/index.d.ts +1 -0
- package/dist/widgets/banner/model/helpers.d.ts +4 -0
- package/dist/widgets/banner/ui/BannerButtonsGroup.d.ts +12 -0
- package/{lib/widgets/index.ts → dist/widgets/index.d.ts} +3 -3
- package/dist/widgets/pageHeader/PageHeader.d.ts +16 -0
- package/{lib/widgets/pageHeader/index.ts → dist/widgets/pageHeader/index.d.ts} +1 -1
- package/package.json +4 -1
- package/.env +0 -2
- package/.eslintrc.cjs +0 -134
- package/.github/workflows/npm-publish.yml +0 -22
- package/.github/workflows/publish.yml +0 -49
- package/.github/workflows/setup-node/action.yml +0 -22
- package/.husky/pre-commit +0 -1
- package/.prettierrc +0 -19
- package/.storybook/main.ts +0 -44
- package/.storybook/preview.tsx +0 -37
- package/chromatic.config.json +0 -5
- package/index.html +0 -13
- package/lib/client.ts +0 -80
- package/lib/configs/index.ts +0 -1
- package/lib/configs/tailwindConfigBase.ts +0 -110
- package/lib/server.ts +0 -2
- package/lib/shared/constants/api.ts +0 -2
- package/lib/shared/constants/designSystem/colors.ts +0 -117
- package/lib/shared/constants/designSystem/index.ts +0 -3
- package/lib/shared/constants/designSystem/others.ts +0 -18
- package/lib/shared/constants/designSystem/typography.ts +0 -88
- package/lib/shared/constants/index.ts +0 -2
- package/lib/shared/hooks/index.ts +0 -4
- package/lib/shared/hooks/useBoolean.ts +0 -12
- package/lib/shared/hooks/useClickOutside.ts +0 -19
- package/lib/shared/hooks/useControlledForm.ts +0 -16
- package/lib/shared/hooks/useDebounce.ts +0 -38
- package/lib/shared/style.css +0 -74
- package/lib/shared/ui/Badge.tsx +0 -20
- package/lib/shared/ui/Breadcrumbs.tsx +0 -57
- package/lib/shared/ui/ButtonIcon.tsx +0 -52
- package/lib/shared/ui/CustomLink.tsx +0 -70
- package/lib/shared/ui/Document.tsx +0 -51
- package/lib/shared/ui/Heading.tsx +0 -33
- package/lib/shared/ui/Hint.tsx +0 -62
- package/lib/shared/ui/Loader.tsx +0 -58
- package/lib/shared/ui/PhoneView.tsx +0 -23
- package/lib/shared/ui/Portal.tsx +0 -9
- package/lib/shared/ui/ProgressBar.tsx +0 -43
- package/lib/shared/ui/ResponsiveContainer.tsx +0 -11
- package/lib/shared/ui/Section.tsx +0 -15
- package/lib/shared/ui/Skeleton.tsx +0 -9
- package/lib/shared/ui/TabsSwitcher.tsx +0 -80
- package/lib/shared/ui/accordion/Accordion.tsx +0 -36
- package/lib/shared/ui/accordion/index.ts +0 -1
- package/lib/shared/ui/accordion/model/types.ts +0 -20
- package/lib/shared/ui/accordion/ui/AccordionHeader.tsx +0 -35
- package/lib/shared/ui/brandLogos.tsx +0 -14
- package/lib/shared/ui/button/Button.tsx +0 -111
- package/lib/shared/ui/button/index.ts +0 -1
- package/lib/shared/ui/button/model/helpers.ts +0 -16
- package/lib/shared/ui/calendar/Calendar.tsx +0 -228
- package/lib/shared/ui/calendar/index.ts +0 -231
- package/lib/shared/ui/calendar/model/animation.ts +0 -112
- package/lib/shared/ui/calendar/model/classes.ts +0 -34
- package/lib/shared/ui/calendar/model/helpers.ts +0 -51
- package/lib/shared/ui/calendar/model/hooks/index.ts +0 -2
- package/lib/shared/ui/calendar/model/hooks/useCalendarDropdowns.ts +0 -38
- package/lib/shared/ui/calendar/model/hooks/useDatePicker.ts +0 -103
- package/lib/shared/ui/calendar/ui/CalendarHeader.tsx +0 -54
- package/lib/shared/ui/calendar/ui/Dropdown.tsx +0 -75
- package/lib/shared/ui/calendar/ui/NavigationArrows.tsx +0 -23
- package/lib/shared/ui/calendar/ui/Weekdays.tsx +0 -16
- package/lib/shared/ui/calendar/ui/index.ts +0 -2
- package/lib/shared/ui/formControlElements/CheckboxControl.tsx +0 -92
- package/lib/shared/ui/formControlElements/FormControl.tsx +0 -5
- package/lib/shared/ui/formControlElements/InputControl.tsx +0 -68
- package/lib/shared/ui/formControlElements/InputControlMask.tsx +0 -80
- package/lib/shared/ui/formControlElements/RadioControl.tsx +0 -130
- package/lib/shared/ui/formControlElements/SelectControl.tsx +0 -185
- package/lib/shared/ui/formControlElements/SwitchControl.tsx +0 -79
- package/lib/shared/ui/formControlElements/TextareaControl.tsx +0 -92
- package/lib/shared/ui/formControlElements/calendarControl/CalendarControl.tsx +0 -175
- package/lib/shared/ui/formControlElements/calendarControl/hooks/index.ts +0 -2
- package/lib/shared/ui/formControlElements/calendarControl/hooks/useCalendar.tsx +0 -86
- package/lib/shared/ui/formControlElements/calendarControl/hooks/useCalendarDropdowns.ts +0 -38
- package/lib/shared/ui/formControlElements/calendarControl/model/helpers.ts +0 -60
- package/lib/shared/ui/formControlElements/calendarControl/model/types.ts +0 -44
- package/lib/shared/ui/formControlElements/calendarControl/ui/DaysOfMonth.tsx +0 -53
- package/lib/shared/ui/formControlElements/calendarControl/ui/DaysOfWeek.tsx +0 -28
- package/lib/shared/ui/formControlElements/calendarControl/ui/Dropdown.tsx +0 -62
- package/lib/shared/ui/formControlElements/calendarControl/ui/Header.tsx +0 -51
- package/lib/shared/ui/formControlElements/calendarControl/ui/Navigation.tsx +0 -32
- package/lib/shared/ui/formControlElements/calendarControl/ui/OptionsList.tsx +0 -44
- package/lib/shared/ui/formControlElements/calendarControl/ui/index.ts +0 -4
- package/lib/shared/ui/formControlElements/dadata/DadataInputControl.tsx +0 -132
- package/lib/shared/ui/formControlElements/dadata/model/api.ts +0 -25
- package/lib/shared/ui/formControlElements/dadata/model/helpers.ts +0 -76
- package/lib/shared/ui/formControlElements/dadata/model/types.ts +0 -52
- package/lib/shared/ui/formControlElements/dadata/model/useDadata.ts +0 -25
- package/lib/shared/ui/formControlElements/model/classes-types.ts +0 -22
- package/lib/shared/ui/formControlElements/model/index.ts +0 -2
- package/lib/shared/ui/formControlElements/model/props-types.ts +0 -26
- package/lib/shared/ui/formControlElements/ui/FieldAttachment.tsx +0 -66
- package/lib/shared/ui/formControlElements/ui/FieldContainer.tsx +0 -36
- package/lib/shared/ui/formControlElements/ui/FieldWrapper.tsx +0 -55
- package/lib/shared/ui/formControlElements/ui/MessageView.tsx +0 -37
- package/lib/shared/ui/formControlElements/ui/index.ts +0 -4
- package/lib/shared/ui/icon/Icon.tsx +0 -43
- package/lib/shared/ui/icon/sprite.gen.ts +0 -121
- package/lib/shared/ui/index.ts +0 -56
- package/lib/shared/ui/popover/Popover.tsx +0 -77
- package/lib/shared/ui/popover/index.ts +0 -1
- package/lib/shared/ui/table/Table.tsx +0 -143
- package/lib/shared/ui/table/index.ts +0 -1
- package/lib/shared/ui/table/type.ts +0 -30
- package/lib/shared/utils/capitalize.ts +0 -6
- package/lib/shared/utils/cn.ts +0 -6
- package/lib/shared/utils/deepCompare.ts +0 -1
- package/lib/shared/utils/formatToDate.ts +0 -5
- package/lib/shared/utils/index.ts +0 -5
- package/lib/shared/utils/isClient.ts +0 -1
- package/lib/shared/validation/index.ts +0 -3
- package/lib/shared/validation/messages.ts +0 -12
- package/lib/shared/validation/regExp.ts +0 -5
- package/lib/shared/validation/zodValidation/calendar.ts +0 -32
- package/lib/shared/validation/zodValidation/dadataFio.ts +0 -67
- package/lib/shared/validation/zodValidation/index.ts +0 -2
- package/lib/vite-env.d.ts +0 -2
- package/lib/widgets/Advantages.tsx +0 -45
- package/lib/widgets/banner/Banner.tsx +0 -62
- package/lib/widgets/banner/index.ts +0 -1
- package/lib/widgets/banner/model/helpers.ts +0 -44
- package/lib/widgets/banner/money.png +0 -0
- package/lib/widgets/banner/ui/BannerButtonsGroup.tsx +0 -30
- package/lib/widgets/pageHeader/PageHeader.tsx +0 -54
- package/postcss.config.mjs +0 -8
- package/src/App.tsx +0 -9
- package/src/app/providers/RootProvider.tsx +0 -11
- package/src/app/providers/index.ts +0 -1
- package/src/app/providers/model/types.ts +0 -5
- package/src/app/providers/ui/ToasterProvider.tsx +0 -23
- package/src/app/providers/ui/index.ts +0 -1
- package/src/configs/setup.ts +0 -9
- package/src/configs/storybook.config.ts +0 -23
- package/src/main.tsx +0 -10
- package/src/stories/primitives/Accordion.stories.tsx +0 -66
- package/src/stories/primitives/Badge.stories.tsx +0 -28
- package/src/stories/primitives/Breadcrumbs.stories.tsx +0 -29
- package/src/stories/primitives/Button/Button.stories.tsx +0 -149
- package/src/stories/primitives/Button/Button.test.tsx +0 -150
- package/src/stories/primitives/ButtonIcon.stories.tsx +0 -75
- package/src/stories/primitives/CustomLink.stories.tsx +0 -64
- package/src/stories/primitives/Document.stories.tsx +0 -36
- package/src/stories/primitives/Heading.stories.tsx +0 -29
- package/src/stories/primitives/Hint.stories.tsx +0 -82
- package/src/stories/primitives/Icon.stories.tsx +0 -36
- package/src/stories/primitives/Loader.stories.tsx +0 -39
- package/src/stories/primitives/PhoneView.stories.tsx +0 -22
- package/src/stories/primitives/Popover.stories.tsx +0 -41
- package/src/stories/primitives/ProgressBar.stories.tsx +0 -68
- package/src/stories/primitives/Skeleton.stories.tsx +0 -21
- package/src/stories/primitives/Table.stories.tsx +0 -44
- package/src/stories/primitives/TabsSwitcher.stories.tsx +0 -34
- package/src/stories/primitives/formControl/Calendar.stories.tsx +0 -61
- package/src/stories/primitives/formControl/CalendarControl.stories.tsx +0 -39
- package/src/stories/primitives/formControl/CheckboxControl.stories.tsx +0 -64
- package/src/stories/primitives/formControl/DadataInputControl.stories.tsx +0 -83
- package/src/stories/primitives/formControl/FormControlAllFields.stories.tsx +0 -25
- package/src/stories/primitives/formControl/InputControl.stories.tsx +0 -77
- package/src/stories/primitives/formControl/RadioContol.stories.tsx +0 -63
- package/src/stories/primitives/formControl/SelectControl.stories.tsx +0 -117
- package/src/stories/primitives/formControl/SwitchControl.stories.tsx +0 -51
- package/src/stories/primitives/formControl/TextareaControl.stories.tsx +0 -55
- package/src/stories/primitives/formControl/inputControlMask.stories.tsx +0 -69
- package/src/stories/widgets/Advantages.stories.tsx +0 -42
- package/src/stories/widgets/Banner.stories.tsx +0 -40
- package/src/stories/widgets/PageHeader.stories.tsx +0 -33
- package/src/storybookHelpers/actions.tsx +0 -5
- package/src/storybookHelpers/index.ts +0 -2
- package/src/storybookHelpers/reactHookForm/index.ts +0 -3
- package/src/storybookHelpers/reactHookForm/model/mockData.ts +0 -21
- package/src/storybookHelpers/reactHookForm/model/mocks.tsx +0 -71
- package/src/storybookHelpers/reactHookForm/model/types.ts +0 -62
- package/src/storybookHelpers/reactHookForm/ui/StorybookFieldsMapper.tsx +0 -76
- package/src/storybookHelpers/reactHookForm/ui/StorybookFormProvider.tsx +0 -43
- package/src/storybookHelpers/reactHookForm/ui/index.ts +0 -2
- package/src/storybookHelpers/table/utils/defaultValue.ts +0 -51
- package/static/arrows/arrowCircle.svg +0 -18
- package/static/arrows/arrowLink.svg +0 -3
- package/static/arrows/arrowRight.svg +0 -3
- package/static/brandLogos/logoBlack.svg +0 -14
- package/static/brandLogos/logoBusiness.svg +0 -80
- package/static/brandLogos/logoGray.svg +0 -56
- package/static/brandLogos/logoInsurance.svg +0 -124
- package/static/brandLogos/logoMain.svg +0 -14
- package/static/brandLogos/logoWhite.svg +0 -56
- package/static/files/documentFilled.svg +0 -4
- package/static/files/documentOutline.svg +0 -4
- package/static/general/calendar.svg +0 -3
- package/static/general/check.svg +0 -6
- package/static/general/close.svg +0 -12
- package/static/info/warningCircle.svg +0 -5
- package/tailwind.config.ts +0 -9
- package/tsconfig.json +0 -33
- package/tsconfig.node.json +0 -11
- package/vite.config.ts +0 -63
- package/vitest.config.mjs +0 -12
- /package/{public → dist}/sprites/arrows.svg +0 -0
- /package/{public → dist}/sprites/brandLogos.svg +0 -0
- /package/{public → dist}/sprites/common.svg +0 -0
- /package/{public → dist}/sprites/files.svg +0 -0
- /package/{public → dist}/sprites/general.svg +0 -0
- /package/{public → dist}/sprites/info.svg +0 -0
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
export interface SpritesMap {
|
|
2
|
-
arrows: 'arrowCircle' | 'arrowLink' | 'arrowRight'
|
|
3
|
-
brandLogos: 'logoBlack' | 'logoBusiness' | 'logoGray' | 'logoInsurance' | 'logoMain' | 'logoWhite'
|
|
4
|
-
files: 'documentFilled' | 'documentOutline'
|
|
5
|
-
general: 'calendar' | 'check' | 'close'
|
|
6
|
-
info: 'warningCircle'
|
|
7
|
-
}
|
|
8
|
-
export const SPRITES_META: {
|
|
9
|
-
[Key in keyof SpritesMap]: {
|
|
10
|
-
filePath: string
|
|
11
|
-
items: Record<
|
|
12
|
-
SpritesMap[Key],
|
|
13
|
-
{
|
|
14
|
-
viewBox: string
|
|
15
|
-
width: number
|
|
16
|
-
height: number
|
|
17
|
-
}
|
|
18
|
-
>
|
|
19
|
-
}
|
|
20
|
-
} = {
|
|
21
|
-
arrows: {
|
|
22
|
-
filePath: 'arrows.svg',
|
|
23
|
-
items: {
|
|
24
|
-
arrowCircle: {
|
|
25
|
-
viewBox: '0 0 32 32',
|
|
26
|
-
width: 32,
|
|
27
|
-
height: 32
|
|
28
|
-
},
|
|
29
|
-
arrowLink: {
|
|
30
|
-
viewBox: '0 0 24 24',
|
|
31
|
-
width: 24,
|
|
32
|
-
height: 24
|
|
33
|
-
},
|
|
34
|
-
arrowRight: {
|
|
35
|
-
viewBox: '0 0 16 17',
|
|
36
|
-
width: 16,
|
|
37
|
-
height: 17
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
brandLogos: {
|
|
42
|
-
filePath: 'brandLogos.svg',
|
|
43
|
-
items: {
|
|
44
|
-
logoBlack: {
|
|
45
|
-
viewBox: '0 0 194 32',
|
|
46
|
-
width: 194,
|
|
47
|
-
height: 32
|
|
48
|
-
},
|
|
49
|
-
logoBusiness: {
|
|
50
|
-
viewBox: '0 0 192 32',
|
|
51
|
-
width: 192,
|
|
52
|
-
height: 32
|
|
53
|
-
},
|
|
54
|
-
logoGray: {
|
|
55
|
-
viewBox: '0 0 194 32',
|
|
56
|
-
width: 194,
|
|
57
|
-
height: 32
|
|
58
|
-
},
|
|
59
|
-
logoInsurance: {
|
|
60
|
-
viewBox: '0 0 193 32',
|
|
61
|
-
width: 193,
|
|
62
|
-
height: 32
|
|
63
|
-
},
|
|
64
|
-
logoMain: {
|
|
65
|
-
viewBox: '0 0 192 32',
|
|
66
|
-
width: 192,
|
|
67
|
-
height: 32
|
|
68
|
-
},
|
|
69
|
-
logoWhite: {
|
|
70
|
-
viewBox: '0 0 194 32',
|
|
71
|
-
width: 194,
|
|
72
|
-
height: 32
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
files: {
|
|
77
|
-
filePath: 'files.svg',
|
|
78
|
-
items: {
|
|
79
|
-
documentFilled: {
|
|
80
|
-
viewBox: '0 0 22 28',
|
|
81
|
-
width: 22,
|
|
82
|
-
height: 28
|
|
83
|
-
},
|
|
84
|
-
documentOutline: {
|
|
85
|
-
viewBox: '0 0 22 28',
|
|
86
|
-
width: 22,
|
|
87
|
-
height: 28
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
general: {
|
|
92
|
-
filePath: 'general.svg',
|
|
93
|
-
items: {
|
|
94
|
-
calendar: {
|
|
95
|
-
viewBox: '0 0 19 20',
|
|
96
|
-
width: 19,
|
|
97
|
-
height: 20
|
|
98
|
-
},
|
|
99
|
-
check: {
|
|
100
|
-
viewBox: '0 0 24 24',
|
|
101
|
-
width: 800,
|
|
102
|
-
height: 800
|
|
103
|
-
},
|
|
104
|
-
close: {
|
|
105
|
-
viewBox: '0 0 24 24',
|
|
106
|
-
width: 24,
|
|
107
|
-
height: 24
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
info: {
|
|
112
|
-
filePath: 'info.svg',
|
|
113
|
-
items: {
|
|
114
|
-
warningCircle: {
|
|
115
|
-
viewBox: '0 0 20 20',
|
|
116
|
-
width: 20,
|
|
117
|
-
height: 20
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
package/lib/shared/ui/index.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// # BASE
|
|
2
|
-
export { Section, type ISectionProps } from './Section'
|
|
3
|
-
export { ResponsiveContainer, type IResponsiveContainerProps } from './ResponsiveContainer'
|
|
4
|
-
export { Button, type IButtonProps } from './button'
|
|
5
|
-
export { ButtonIcon, type IButtonIconProps } from './ButtonIcon'
|
|
6
|
-
export { PhoneView } from './PhoneView'
|
|
7
|
-
export { Badge, type IBadgeProps } from './Badge'
|
|
8
|
-
export { Loader, type ILoaderProps } from './Loader'
|
|
9
|
-
export { Skeleton, type ISkeletonProps } from './Skeleton'
|
|
10
|
-
export { Table } from './table'
|
|
11
|
-
|
|
12
|
-
// # INTERACTIVE
|
|
13
|
-
export { Accordion, type IAccordionProps } from './accordion'
|
|
14
|
-
export { Hint, type IHintProps } from './Hint'
|
|
15
|
-
export { Popover } from './popover'
|
|
16
|
-
export { ProgressBar, type IProgressBarProps } from './ProgressBar'
|
|
17
|
-
export { TabsSwitcher, type ITabsSwitcherProps, type ITabRenderContent } from './TabsSwitcher'
|
|
18
|
-
|
|
19
|
-
// # TYPOGRAPHY
|
|
20
|
-
export { Heading, type IHeadingProps } from './Heading'
|
|
21
|
-
|
|
22
|
-
// # ICONS
|
|
23
|
-
export { Icon, type IconProps, type TAllowedIcons } from './icon'
|
|
24
|
-
export { brandLogos, type TBrandLogoVariant } from './brandLogos'
|
|
25
|
-
|
|
26
|
-
// # NAVIGATION
|
|
27
|
-
export { Breadcrumbs, type IBreadcrumbsProps } from './Breadcrumbs'
|
|
28
|
-
export { CustomLink, type ICustomLinkProps } from './CustomLink'
|
|
29
|
-
|
|
30
|
-
// # FILes
|
|
31
|
-
export { Document, type IDocumentProps } from './Document'
|
|
32
|
-
|
|
33
|
-
// # CONTROLLED FORM UI
|
|
34
|
-
export {
|
|
35
|
-
InputControl,
|
|
36
|
-
type InputControlProps,
|
|
37
|
-
InputControlMask,
|
|
38
|
-
type InputControlMaskProps,
|
|
39
|
-
FormControl,
|
|
40
|
-
DadataInputControl,
|
|
41
|
-
type IDadataInputControlProps,
|
|
42
|
-
CheckboxControl,
|
|
43
|
-
type ICheckboxControlProps,
|
|
44
|
-
RadioControl,
|
|
45
|
-
type IRadioControlProps,
|
|
46
|
-
type IRadioGroupOption,
|
|
47
|
-
SwitchControl,
|
|
48
|
-
type ISwitchControlProps,
|
|
49
|
-
SelectControl,
|
|
50
|
-
type ISelectControlProps,
|
|
51
|
-
type ISelectOption,
|
|
52
|
-
TextareaControl,
|
|
53
|
-
type ITextareaControlProps,
|
|
54
|
-
CalendarControl,
|
|
55
|
-
type ICalendarControlProps
|
|
56
|
-
} from './formControlElements'
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import type { ReactElement, ReactNode } from 'react'
|
|
2
|
-
import type { PopoverContentProps as TPopoverContentPropsBase } from '@radix-ui/react-popover'
|
|
3
|
-
import * as PopoverPrimitive from '@radix-ui/react-popover'
|
|
4
|
-
import { Icon } from '../icon/Icon'
|
|
5
|
-
import { cn } from '$/shared/utils'
|
|
6
|
-
|
|
7
|
-
type TAdditionalClasses = {
|
|
8
|
-
content: string
|
|
9
|
-
arrow: string
|
|
10
|
-
trigger: string
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface IPopoverContentProps extends TPopoverContentPropsBase {
|
|
14
|
-
sideOffset?: number
|
|
15
|
-
alignOffset?: number
|
|
16
|
-
align?: 'end' | 'center' | 'start'
|
|
17
|
-
side?: 'top' | 'right' | 'bottom' | 'left'
|
|
18
|
-
defaultOpen?: boolean
|
|
19
|
-
avoidCollisions?: boolean
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface IPopoverProps extends IPopoverContentProps {
|
|
23
|
-
triggerElement: ReactElement
|
|
24
|
-
children: ReactNode
|
|
25
|
-
classes?: Partial<TAdditionalClasses>
|
|
26
|
-
headLine?: string
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const Popover = ({
|
|
30
|
-
triggerElement,
|
|
31
|
-
classes,
|
|
32
|
-
sideOffset,
|
|
33
|
-
alignOffset,
|
|
34
|
-
align,
|
|
35
|
-
side,
|
|
36
|
-
defaultOpen = false,
|
|
37
|
-
avoidCollisions = false,
|
|
38
|
-
headLine,
|
|
39
|
-
children,
|
|
40
|
-
arrowPadding,
|
|
41
|
-
...contentProps
|
|
42
|
-
}: IPopoverProps) => {
|
|
43
|
-
return (
|
|
44
|
-
<div className=''>
|
|
45
|
-
<PopoverPrimitive.Root defaultOpen={defaultOpen}>
|
|
46
|
-
<div className='flex items-center gap-2 w-max'>
|
|
47
|
-
<h3 className='text-[24px] font-bold'>{headLine}</h3>
|
|
48
|
-
<PopoverPrimitive.Trigger className={cn('cursor-pointer', classes?.trigger)} asChild>
|
|
49
|
-
{triggerElement}
|
|
50
|
-
</PopoverPrimitive.Trigger>
|
|
51
|
-
</div>
|
|
52
|
-
<PopoverPrimitive.Anchor />
|
|
53
|
-
<PopoverPrimitive.Portal>
|
|
54
|
-
<PopoverPrimitive.Content
|
|
55
|
-
className={cn(
|
|
56
|
-
'p-4 w-64 desk-body-regular-m flex items-start gap-2 shadow-sm rounded-sm bg-color-white',
|
|
57
|
-
classes?.content
|
|
58
|
-
)}
|
|
59
|
-
sideOffset={sideOffset}
|
|
60
|
-
alignOffset={alignOffset}
|
|
61
|
-
avoidCollisions={avoidCollisions}
|
|
62
|
-
arrowPadding={arrowPadding}
|
|
63
|
-
align={align}
|
|
64
|
-
side={side}
|
|
65
|
-
{...contentProps}
|
|
66
|
-
>
|
|
67
|
-
{children}
|
|
68
|
-
<PopoverPrimitive.Close aria-label='Close' className='size-4 outline-transparent outline-0'>
|
|
69
|
-
<Icon name='general/close' className='size-4 text-icon-blue-grey-600 cursor-pointer ' />
|
|
70
|
-
</PopoverPrimitive.Close>
|
|
71
|
-
<PopoverPrimitive.Arrow width={12} height={6} className={cn('fill-secondary-default', classes?.arrow)} />
|
|
72
|
-
</PopoverPrimitive.Content>
|
|
73
|
-
</PopoverPrimitive.Portal>
|
|
74
|
-
</PopoverPrimitive.Root>
|
|
75
|
-
</div>
|
|
76
|
-
)
|
|
77
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Popover } from './Popover'
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import type { ReactElement } from 'react'
|
|
2
|
-
import { cva, type VariantProps } from 'class-variance-authority'
|
|
3
|
-
import { Heading } from '../Heading'
|
|
4
|
-
import { ResponsiveContainer } from '../ResponsiveContainer'
|
|
5
|
-
import type { TableRows, TTableClasses, TTableColumnCount } from './type'
|
|
6
|
-
import { cn } from '$/shared/utils'
|
|
7
|
-
|
|
8
|
-
const tableConfig = cva('grid', {
|
|
9
|
-
variants: {
|
|
10
|
-
columnCount: {
|
|
11
|
-
twoColumns: 'grid-cols-[repeat(2,minmax(172px,_1fr))] desktop:grid-cols-[repeat(2,minmax(172px,_1fr))]',
|
|
12
|
-
threeColumns: 'grid-cols-[repeat(3,minmax(172px,_1fr))] desktop:grid-cols-[repeat(3,minmax(312px,_1fr))]'
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
const itemTableConfig = cva('grid', {
|
|
18
|
-
variants: {
|
|
19
|
-
columnCount: {
|
|
20
|
-
twoColumns: '',
|
|
21
|
-
threeColumns: ''
|
|
22
|
-
},
|
|
23
|
-
titlesExist: {
|
|
24
|
-
exist: '',
|
|
25
|
-
notExist: ''
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
compoundVariants: [
|
|
29
|
-
{
|
|
30
|
-
titlesExist: 'notExist',
|
|
31
|
-
columnCount: 'twoColumns',
|
|
32
|
-
class: 'grid-rows-[repeat(2,_auto)] border-b border-warm-grey-200 py-4'
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
titlesExist: 'notExist',
|
|
36
|
-
columnCount: 'threeColumns',
|
|
37
|
-
class: 'grid-cols-[repeat(3,_auto)]'
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
titlesExist: 'exist',
|
|
41
|
-
columnCount: 'twoColumns',
|
|
42
|
-
class: 'grid-cols-[repeat(2,_auto)]'
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
titlesExist: 'exist',
|
|
46
|
-
columnCount: 'threeColumns',
|
|
47
|
-
class: 'grid-cols-[repeat(3,_auto)]'
|
|
48
|
-
}
|
|
49
|
-
]
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
const tableOverflowConfig = cva('grid', {
|
|
53
|
-
variants: {
|
|
54
|
-
columnCount: {
|
|
55
|
-
twoColumns: '',
|
|
56
|
-
threeColumns: ''
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
compoundVariants: [
|
|
60
|
-
{
|
|
61
|
-
columnCount: 'threeColumns',
|
|
62
|
-
class: 'mobile:overflow-x-scroll mobile:max-w-[368px] mb-1'
|
|
63
|
-
}
|
|
64
|
-
]
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
const textTableConfig = cva('border-b border-warm-grey-200 py-4 desktop:desk-body-regular-l mob-body-regular-l', {
|
|
68
|
-
variants: {
|
|
69
|
-
columnCount: {
|
|
70
|
-
twoColumns: '',
|
|
71
|
-
threeColumns: ''
|
|
72
|
-
},
|
|
73
|
-
titlesExist: {
|
|
74
|
-
exist: '',
|
|
75
|
-
notExist: ''
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
compoundVariants: [
|
|
79
|
-
{
|
|
80
|
-
titlesExist: 'notExist',
|
|
81
|
-
columnCount: 'twoColumns',
|
|
82
|
-
class: 'border-transparent border-0 p-0'
|
|
83
|
-
}
|
|
84
|
-
]
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
type TTableProps = VariantProps<typeof tableConfig>
|
|
88
|
-
|
|
89
|
-
export interface ITable<C extends TTableColumnCount> extends TTableProps {
|
|
90
|
-
headTitle: string | ReactElement
|
|
91
|
-
columnCount: TTableColumnCount
|
|
92
|
-
tableHead?: string[]
|
|
93
|
-
tableRows: TableRows<C>
|
|
94
|
-
additionalText?: string
|
|
95
|
-
classes?: Partial<TTableClasses>
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export const Table = <C extends TTableColumnCount>({
|
|
99
|
-
headTitle,
|
|
100
|
-
tableRows,
|
|
101
|
-
tableHead,
|
|
102
|
-
additionalText,
|
|
103
|
-
columnCount,
|
|
104
|
-
classes
|
|
105
|
-
}: ITable<C>) => {
|
|
106
|
-
const titlesExist = tableHead && tableHead.length > 0 ? 'exist' : 'notExist'
|
|
107
|
-
|
|
108
|
-
return (
|
|
109
|
-
<ResponsiveContainer>
|
|
110
|
-
<div className={cn('flex flex-col', classes?.tableRootWrapper)}>
|
|
111
|
-
<Heading as='h3' className={cn('mob-title-bold-m desktop:desk-title-bold-s pb-6', classes?.tableHeading)}>
|
|
112
|
-
{headTitle}
|
|
113
|
-
</Heading>
|
|
114
|
-
<div className={cn(tableOverflowConfig({ columnCount }), classes?.tableBody)}>
|
|
115
|
-
<ul className={cn(tableConfig({ columnCount }), classes?.tableTitlesContainer)}>
|
|
116
|
-
{tableHead?.map((title) => (
|
|
117
|
-
<li
|
|
118
|
-
key={title}
|
|
119
|
-
className={cn(
|
|
120
|
-
'border-b border-warm-grey-200 mob-body-regular-l desktop:desk-body-regular-l py-4',
|
|
121
|
-
classes?.tableTitleRow
|
|
122
|
-
)}
|
|
123
|
-
>
|
|
124
|
-
{title}
|
|
125
|
-
</li>
|
|
126
|
-
))}
|
|
127
|
-
</ul>
|
|
128
|
-
|
|
129
|
-
<ul className={cn('mb-4 flex flex-col', classes?.tableBodyContainer)}>
|
|
130
|
-
{tableRows.map((row) => (
|
|
131
|
-
<li className={cn(itemTableConfig({ columnCount, titlesExist }), classes?.tableBodyRow)}>
|
|
132
|
-
{row.map((ceil) => (
|
|
133
|
-
<p className={cn(textTableConfig({ titlesExist, columnCount }), classes?.tableBodyCeil)}>{ceil.text}</p>
|
|
134
|
-
))}
|
|
135
|
-
</li>
|
|
136
|
-
))}
|
|
137
|
-
</ul>
|
|
138
|
-
</div>
|
|
139
|
-
<p className={cn('mob-body-regular-m desktop:desk-body-regular-l', classes?.tableAdditionalText)}>{additionalText}</p>
|
|
140
|
-
</div>
|
|
141
|
-
</ResponsiveContainer>
|
|
142
|
-
)
|
|
143
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Table } from './Table'
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { ReactElement } from 'react'
|
|
2
|
-
|
|
3
|
-
export type TTableColumnCount = 'twoColumns' | 'threeColumns'
|
|
4
|
-
|
|
5
|
-
export type TableRows<C extends TTableColumnCount> = ColumnsCount<C>[]
|
|
6
|
-
|
|
7
|
-
export type Ceil = {
|
|
8
|
-
text: string | ReactElement
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export type ColumnsCount<C extends TTableColumnCount> = C extends 'twoColumns'
|
|
12
|
-
? [Ceil, Ceil]
|
|
13
|
-
: C extends 'threeColumns'
|
|
14
|
-
? [Ceil, Ceil, Ceil]
|
|
15
|
-
: never
|
|
16
|
-
|
|
17
|
-
export type TTableClasses = {
|
|
18
|
-
tableRootWrapper: string
|
|
19
|
-
tableHeading: string
|
|
20
|
-
tableBody: string
|
|
21
|
-
tableRowTitles: string
|
|
22
|
-
tableCell: string
|
|
23
|
-
tableAdditionalText: string
|
|
24
|
-
tableTitlesContainer: string
|
|
25
|
-
tableTitleCeil: string
|
|
26
|
-
tableBodyContainer: string
|
|
27
|
-
tableTitleRow: string
|
|
28
|
-
tableBodyRow: string
|
|
29
|
-
tableBodyCeil: string
|
|
30
|
-
}
|
package/lib/shared/utils/cn.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const deepCompare = <A, B>(dataA: A, dataB: B): boolean => JSON.stringify(dataA) === JSON.stringify(dataB)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const isClient = typeof window !== 'undefined' && window.document !== undefined
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export const VALIDATION_MESSAGES = {
|
|
2
|
-
REQUIRED: 'Поле обязательно к заполнению',
|
|
3
|
-
MIN_LENGTH: 'Минимальная длина символов должна быть не менее',
|
|
4
|
-
MAX_LENGTH: 'Максимальная длина символов должна быть не более',
|
|
5
|
-
FIX_LENGTH: 'Длина символов должна быть равна',
|
|
6
|
-
MAX_LENGTH_ELEMENTS: 'Максимальное количество элементов должно быть не более',
|
|
7
|
-
MIN_LENGTH_ELEMENTS: 'Минимальное количество элементов должно быть не менее',
|
|
8
|
-
FIX_LENGTH_ELEMENTS: 'Количество элементов должно быть равно',
|
|
9
|
-
INVALID_VALUE: 'Поле заполнено некорректно',
|
|
10
|
-
INVALID_DATE: 'Введите корректную дату',
|
|
11
|
-
FUTURE_DATE_NOT_ALLOWED: 'Нельзя выбрать дату позже текущей'
|
|
12
|
-
} as const
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/* eslint-disable operator-linebreak */
|
|
2
|
-
export const RgxUnicode = /^[\u0400-\u04FF\u00CB\u00EB -]+$/ // Диапазон символов Unicode, включающий кириллические символы.*
|
|
3
|
-
export const RgxCheckForHyphen = /^(?:[^-]+(?:-[^-]+){0,4}|[^-]+)$/ // Проверяет количество дефисов a-b-c-d-e Валидный (до 4 дефисов), не валидный*
|
|
4
|
-
export const RgxPatronymic =
|
|
5
|
-
/^[a-zA-Zа-яА-ЯёЁ]+(?:\s*-\s*[a-zA-Zа-яА-ЯёЁ]+){0,4}(?:\s+[a-zA-Zа-яА-ЯёЁ]+(?:\s*-\s*[a-zA-Zа-яА-ЯёЁ]+){0,4})?$/i
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { isValid, parse } from 'date-fns'
|
|
2
|
-
import { z } from 'zod'
|
|
3
|
-
import { VALIDATION_MESSAGES } from '../messages'
|
|
4
|
-
|
|
5
|
-
export const zodCalendarValidate = z
|
|
6
|
-
.string()
|
|
7
|
-
.length(10, { message: VALIDATION_MESSAGES.INVALID_DATE })
|
|
8
|
-
.superRefine((val, ctx) => {
|
|
9
|
-
const [day, month, year] = val?.split('.') ?? ''
|
|
10
|
-
const parsed = parse(`${day}/${month}/${year}`, 'dd/MM/yyyy', new Date())
|
|
11
|
-
|
|
12
|
-
if (+year <= 1950) {
|
|
13
|
-
ctx.addIssue({
|
|
14
|
-
code: z.ZodIssueCode.custom,
|
|
15
|
-
message: VALIDATION_MESSAGES.INVALID_DATE
|
|
16
|
-
})
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
if (!isValid(parsed)) {
|
|
20
|
-
ctx.addIssue({
|
|
21
|
-
code: z.ZodIssueCode.custom,
|
|
22
|
-
message: VALIDATION_MESSAGES.INVALID_DATE
|
|
23
|
-
})
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (new Date().getTime() < new Date(parsed).getTime()) {
|
|
27
|
-
ctx.addIssue({
|
|
28
|
-
code: z.ZodIssueCode.custom,
|
|
29
|
-
message: VALIDATION_MESSAGES.FUTURE_DATE_NOT_ALLOWED
|
|
30
|
-
})
|
|
31
|
-
}
|
|
32
|
-
})
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
import { RgxCheckForHyphen, RgxPatronymic, RgxUnicode } from '../regExp'
|
|
3
|
-
import { capitalize } from '$/shared/utils'
|
|
4
|
-
|
|
5
|
-
const formattedFio = (value: string) => {
|
|
6
|
-
const parts = value.trim().replace(/\s+/g, ' ').split(' ')
|
|
7
|
-
const [surname, name, ...patronymicArr] = parts
|
|
8
|
-
const patronymic = patronymicArr?.join(' ')
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
surname,
|
|
12
|
-
name,
|
|
13
|
-
patronymic
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const zodDadataFioValidate = z
|
|
18
|
-
.string({ invalid_type_error: 'Обязательно к заполнению', required_error: 'Обязательно к заполнению' })
|
|
19
|
-
.superRefine((value, ctx) => {
|
|
20
|
-
if (!RgxUnicode.test(value)) {
|
|
21
|
-
ctx.addIssue({
|
|
22
|
-
code: z.ZodIssueCode.custom,
|
|
23
|
-
message: 'Должна быть только кириллица'
|
|
24
|
-
})
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const { surname, name, patronymic } = formattedFio(value)
|
|
28
|
-
|
|
29
|
-
if (!surname || !name) {
|
|
30
|
-
ctx.addIssue({
|
|
31
|
-
code: z.ZodIssueCode.custom,
|
|
32
|
-
message: 'Введите имя и фамилию'
|
|
33
|
-
})
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (!RgxCheckForHyphen.test(name)) {
|
|
37
|
-
ctx.addIssue({
|
|
38
|
-
code: z.ZodIssueCode.custom,
|
|
39
|
-
message: 'Неверно введено имя'
|
|
40
|
-
})
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (!RgxCheckForHyphen.test(surname)) {
|
|
44
|
-
ctx.addIssue({
|
|
45
|
-
code: z.ZodIssueCode.custom,
|
|
46
|
-
message: 'Неверно введена фамилия'
|
|
47
|
-
})
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (patronymic) {
|
|
51
|
-
if (!RgxPatronymic.test(patronymic)) {
|
|
52
|
-
ctx.addIssue({
|
|
53
|
-
code: z.ZodIssueCode.custom,
|
|
54
|
-
message: 'Неверно введено отчество'
|
|
55
|
-
})
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
})
|
|
59
|
-
.transform((value) => {
|
|
60
|
-
const { surname, name, patronymic } = formattedFio(value)
|
|
61
|
-
|
|
62
|
-
return {
|
|
63
|
-
surname: capitalize(surname),
|
|
64
|
-
name: capitalize(name),
|
|
65
|
-
patronymic: patronymic ? capitalize(patronymic) : undefined
|
|
66
|
-
}
|
|
67
|
-
})
|
package/lib/vite-env.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import { Heading } from '$/shared/ui'
|
|
3
|
-
import { cn } from '$/shared/utils'
|
|
4
|
-
|
|
5
|
-
interface IAdvantageClasses {
|
|
6
|
-
wrapper: string
|
|
7
|
-
advantage: string
|
|
8
|
-
title: string
|
|
9
|
-
description: string
|
|
10
|
-
}
|
|
11
|
-
export interface IAdvantage {
|
|
12
|
-
title: string
|
|
13
|
-
description: string | React.ReactElement
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface IAdvantagesProps {
|
|
17
|
-
advantagesList: IAdvantage[]
|
|
18
|
-
classes?: Partial<IAdvantageClasses>
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const Advantages = ({ advantagesList, classes }: IAdvantagesProps) => {
|
|
22
|
-
return (
|
|
23
|
-
<div
|
|
24
|
-
className={cn(
|
|
25
|
-
'flex flex-col gap-8 w-[328px] desktop:w-full desktop:flex-row desktop:items-start desktop:gap-0 mobile:p-6 desktop:py-6 bg-color-white rounded-md shadow-sm',
|
|
26
|
-
classes?.wrapper
|
|
27
|
-
)}
|
|
28
|
-
>
|
|
29
|
-
{advantagesList?.map(({ title, description }) => (
|
|
30
|
-
<div
|
|
31
|
-
key={title}
|
|
32
|
-
className={cn(
|
|
33
|
-
'relative w-[285px] h-full flex flex-col gap-2 after:w-[280px] after:h-[1px] mobile:after:left-1/2 mobile:after:-bottom-4 mobile:after:-translate-x-1/2 desktop:px-8 desktop:after:right-0 desktop:after:top-1/2 desktop:after:-translate-y-1/2 desktop:after:h-10 desktop:after:w-[1px] after:content-[" "] after:absolute after:bg-color-blue-grey-300 last:after:hidden',
|
|
34
|
-
classes?.advantage
|
|
35
|
-
)}
|
|
36
|
-
>
|
|
37
|
-
<Heading as='h4' className={cn('text-color-dark', classes?.title)}>
|
|
38
|
-
{title}
|
|
39
|
-
</Heading>
|
|
40
|
-
<p className={cn('desk-body-regular-l text-color-tetriary', classes?.description)}>{description}</p>
|
|
41
|
-
</div>
|
|
42
|
-
))}
|
|
43
|
-
</div>
|
|
44
|
-
)
|
|
45
|
-
}
|