@scbt-ecom/ui 0.0.27 → 0.0.30
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/.env +2 -0
- package/.eslintrc.cjs +134 -0
- package/.github/workflows/npm-publish.yml +22 -0
- package/.github/workflows/publish.yml +49 -0
- package/.github/workflows/setup-node/action.yml +22 -0
- package/.husky/pre-commit +1 -0
- package/.prettierrc +19 -0
- package/.storybook/main.ts +44 -0
- package/.storybook/preview.tsx +37 -0
- package/chromatic.config.json +5 -0
- package/index.html +13 -0
- package/lib/client.ts +80 -0
- package/lib/configs/index.ts +1 -0
- package/lib/configs/tailwindConfigBase.ts +110 -0
- package/lib/server.ts +2 -0
- package/lib/shared/constants/api.ts +2 -0
- package/lib/shared/constants/designSystem/colors.ts +117 -0
- package/lib/shared/constants/designSystem/index.ts +3 -0
- package/lib/shared/constants/designSystem/others.ts +18 -0
- package/lib/shared/constants/designSystem/typography.ts +88 -0
- package/lib/shared/constants/index.ts +2 -0
- package/lib/shared/hooks/index.ts +4 -0
- package/lib/shared/hooks/useBoolean.ts +12 -0
- package/lib/shared/hooks/useClickOutside.ts +19 -0
- package/lib/shared/hooks/useControlledForm.ts +16 -0
- package/lib/shared/hooks/useDebounce.ts +38 -0
- package/lib/shared/style.css +74 -0
- package/lib/shared/ui/Badge.tsx +20 -0
- package/lib/shared/ui/Breadcrumbs.tsx +57 -0
- package/lib/shared/ui/ButtonIcon.tsx +52 -0
- package/lib/shared/ui/CustomLink.tsx +70 -0
- package/lib/shared/ui/Document.tsx +51 -0
- package/lib/shared/ui/Heading.tsx +33 -0
- package/lib/shared/ui/Hint.tsx +62 -0
- package/lib/shared/ui/Loader.tsx +58 -0
- package/lib/shared/ui/PhoneView.tsx +23 -0
- package/lib/shared/ui/Portal.tsx +9 -0
- package/lib/shared/ui/ProgressBar.tsx +43 -0
- package/lib/shared/ui/ResponsiveContainer.tsx +11 -0
- package/lib/shared/ui/Section.tsx +15 -0
- package/lib/shared/ui/Skeleton.tsx +9 -0
- package/lib/shared/ui/TabsSwitcher.tsx +80 -0
- package/lib/shared/ui/accordion/Accordion.tsx +36 -0
- package/lib/shared/ui/accordion/index.ts +1 -0
- package/lib/shared/ui/accordion/model/types.ts +20 -0
- package/lib/shared/ui/accordion/ui/AccordionHeader.tsx +35 -0
- package/lib/shared/ui/brandLogos.tsx +14 -0
- package/lib/shared/ui/button/Button.tsx +111 -0
- package/lib/shared/ui/button/index.ts +1 -0
- package/lib/shared/ui/button/model/helpers.ts +16 -0
- package/lib/shared/ui/calendar/Calendar.tsx +228 -0
- package/lib/shared/ui/calendar/index.ts +231 -0
- package/lib/shared/ui/calendar/model/animation.ts +112 -0
- package/lib/shared/ui/calendar/model/classes.ts +34 -0
- package/lib/shared/ui/calendar/model/helpers.ts +51 -0
- package/lib/shared/ui/calendar/model/hooks/index.ts +2 -0
- package/lib/shared/ui/calendar/model/hooks/useCalendarDropdowns.ts +38 -0
- package/lib/shared/ui/calendar/model/hooks/useDatePicker.ts +103 -0
- package/lib/shared/ui/calendar/ui/CalendarHeader.tsx +54 -0
- package/lib/shared/ui/calendar/ui/Dropdown.tsx +75 -0
- package/lib/shared/ui/calendar/ui/NavigationArrows.tsx +23 -0
- package/lib/shared/ui/calendar/ui/Weekdays.tsx +16 -0
- package/lib/shared/ui/calendar/ui/index.ts +2 -0
- package/lib/shared/ui/formControlElements/CheckboxControl.tsx +92 -0
- package/lib/shared/ui/formControlElements/FormControl.tsx +5 -0
- package/lib/shared/ui/formControlElements/InputControl.tsx +68 -0
- package/lib/shared/ui/formControlElements/InputControlMask.tsx +80 -0
- package/lib/shared/ui/formControlElements/RadioControl.tsx +130 -0
- package/lib/shared/ui/formControlElements/SelectControl.tsx +185 -0
- package/lib/shared/ui/formControlElements/SwitchControl.tsx +79 -0
- package/lib/shared/ui/formControlElements/TextareaControl.tsx +92 -0
- package/lib/shared/ui/formControlElements/calendarControl/CalendarControl.tsx +175 -0
- package/lib/shared/ui/formControlElements/calendarControl/hooks/index.ts +2 -0
- package/lib/shared/ui/formControlElements/calendarControl/hooks/useCalendar.tsx +86 -0
- package/lib/shared/ui/formControlElements/calendarControl/hooks/useCalendarDropdowns.ts +38 -0
- package/{dist/shared/ui/formControlElements/calendarControl/index.d.ts → lib/shared/ui/formControlElements/calendarControl/index.ts} +1 -1
- package/lib/shared/ui/formControlElements/calendarControl/model/helpers.ts +60 -0
- package/lib/shared/ui/formControlElements/calendarControl/model/types.ts +44 -0
- package/lib/shared/ui/formControlElements/calendarControl/ui/DaysOfMonth.tsx +53 -0
- package/lib/shared/ui/formControlElements/calendarControl/ui/DaysOfWeek.tsx +28 -0
- package/lib/shared/ui/formControlElements/calendarControl/ui/Dropdown.tsx +62 -0
- package/lib/shared/ui/formControlElements/calendarControl/ui/Header.tsx +51 -0
- package/lib/shared/ui/formControlElements/calendarControl/ui/Navigation.tsx +32 -0
- package/lib/shared/ui/formControlElements/calendarControl/ui/OptionsList.tsx +44 -0
- package/lib/shared/ui/formControlElements/calendarControl/ui/index.ts +4 -0
- package/lib/shared/ui/formControlElements/dadata/DadataInputControl.tsx +132 -0
- package/{dist/shared/ui/formControlElements/dadata/index.d.ts → lib/shared/ui/formControlElements/dadata/index.ts} +1 -1
- package/lib/shared/ui/formControlElements/dadata/model/api.ts +25 -0
- package/lib/shared/ui/formControlElements/dadata/model/helpers.ts +76 -0
- package/lib/shared/ui/formControlElements/dadata/model/types.ts +52 -0
- package/lib/shared/ui/formControlElements/dadata/model/useDadata.ts +25 -0
- package/{dist/shared/ui/formControlElements/index.d.ts → lib/shared/ui/formControlElements/index.ts} +10 -10
- package/lib/shared/ui/formControlElements/model/classes-types.ts +22 -0
- package/lib/shared/ui/formControlElements/model/index.ts +2 -0
- package/lib/shared/ui/formControlElements/model/props-types.ts +26 -0
- package/lib/shared/ui/formControlElements/ui/FieldAttachment.tsx +66 -0
- package/lib/shared/ui/formControlElements/ui/FieldContainer.tsx +36 -0
- package/lib/shared/ui/formControlElements/ui/FieldWrapper.tsx +55 -0
- package/lib/shared/ui/formControlElements/ui/MessageView.tsx +37 -0
- package/lib/shared/ui/formControlElements/ui/index.ts +4 -0
- package/lib/shared/ui/icon/Icon.tsx +43 -0
- package/{dist/shared/ui/icon/index.d.ts → lib/shared/ui/icon/index.ts} +2 -2
- package/lib/shared/ui/icon/sprite.gen.ts +121 -0
- package/lib/shared/ui/index.ts +56 -0
- package/lib/shared/ui/popover/Popover.tsx +77 -0
- package/lib/shared/ui/popover/index.ts +1 -0
- package/lib/shared/ui/table/Table.tsx +143 -0
- package/lib/shared/ui/table/index.ts +1 -0
- package/lib/shared/ui/table/type.ts +30 -0
- package/lib/shared/utils/capitalize.ts +6 -0
- package/lib/shared/utils/cn.ts +6 -0
- package/lib/shared/utils/deepCompare.ts +1 -0
- package/lib/shared/utils/formatToDate.ts +5 -0
- package/lib/shared/utils/index.ts +5 -0
- package/lib/shared/utils/isClient.ts +1 -0
- package/lib/shared/validation/index.ts +3 -0
- package/lib/shared/validation/messages.ts +12 -0
- package/lib/shared/validation/regExp.ts +5 -0
- package/lib/shared/validation/zodValidation/calendar.ts +32 -0
- package/lib/shared/validation/zodValidation/dadataFio.ts +67 -0
- package/lib/shared/validation/zodValidation/index.ts +2 -0
- package/lib/vite-env.d.ts +2 -0
- package/lib/widgets/Advantages.tsx +45 -0
- package/lib/widgets/banner/Banner.tsx +62 -0
- package/lib/widgets/banner/index.ts +1 -0
- package/lib/widgets/banner/model/helpers.ts +44 -0
- package/lib/widgets/banner/money.png +0 -0
- package/lib/widgets/banner/ui/BannerButtonsGroup.tsx +30 -0
- package/{dist/widgets/index.d.ts → lib/widgets/index.ts} +3 -3
- package/lib/widgets/pageHeader/PageHeader.tsx +54 -0
- package/{dist/widgets/pageHeader/index.d.ts → lib/widgets/pageHeader/index.ts} +1 -1
- package/package.json +10 -12
- package/postcss.config.mjs +8 -0
- package/src/App.tsx +9 -0
- package/src/app/providers/RootProvider.tsx +11 -0
- package/src/app/providers/index.ts +1 -0
- package/src/app/providers/model/types.ts +5 -0
- package/src/app/providers/ui/ToasterProvider.tsx +23 -0
- package/src/app/providers/ui/index.ts +1 -0
- package/src/configs/setup.ts +9 -0
- package/src/configs/storybook.config.ts +23 -0
- package/src/main.tsx +10 -0
- package/src/stories/primitives/Accordion.stories.tsx +66 -0
- package/src/stories/primitives/Badge.stories.tsx +28 -0
- package/src/stories/primitives/Breadcrumbs.stories.tsx +29 -0
- package/src/stories/primitives/Button/Button.stories.tsx +149 -0
- package/src/stories/primitives/Button/Button.test.tsx +150 -0
- package/src/stories/primitives/ButtonIcon.stories.tsx +75 -0
- package/src/stories/primitives/CustomLink.stories.tsx +64 -0
- package/src/stories/primitives/Document.stories.tsx +36 -0
- package/src/stories/primitives/Heading.stories.tsx +29 -0
- package/src/stories/primitives/Hint.stories.tsx +82 -0
- package/src/stories/primitives/Icon.stories.tsx +36 -0
- package/src/stories/primitives/Loader.stories.tsx +39 -0
- package/src/stories/primitives/PhoneView.stories.tsx +22 -0
- package/src/stories/primitives/Popover.stories.tsx +41 -0
- package/src/stories/primitives/ProgressBar.stories.tsx +68 -0
- package/src/stories/primitives/Skeleton.stories.tsx +21 -0
- package/src/stories/primitives/Table.stories.tsx +44 -0
- package/src/stories/primitives/TabsSwitcher.stories.tsx +34 -0
- package/src/stories/primitives/formControl/Calendar.stories.tsx +61 -0
- package/src/stories/primitives/formControl/CalendarControl.stories.tsx +39 -0
- package/src/stories/primitives/formControl/CheckboxControl.stories.tsx +64 -0
- package/src/stories/primitives/formControl/DadataInputControl.stories.tsx +83 -0
- package/src/stories/primitives/formControl/FormControlAllFields.stories.tsx +25 -0
- package/src/stories/primitives/formControl/InputControl.stories.tsx +77 -0
- package/src/stories/primitives/formControl/RadioContol.stories.tsx +63 -0
- package/src/stories/primitives/formControl/SelectControl.stories.tsx +117 -0
- package/src/stories/primitives/formControl/SwitchControl.stories.tsx +51 -0
- package/src/stories/primitives/formControl/TextareaControl.stories.tsx +55 -0
- package/src/stories/primitives/formControl/inputControlMask.stories.tsx +69 -0
- package/src/stories/widgets/Advantages.stories.tsx +42 -0
- package/src/stories/widgets/Banner.stories.tsx +40 -0
- package/src/stories/widgets/PageHeader.stories.tsx +33 -0
- package/src/storybookHelpers/actions.tsx +5 -0
- package/src/storybookHelpers/index.ts +2 -0
- package/src/storybookHelpers/reactHookForm/index.ts +3 -0
- package/src/storybookHelpers/reactHookForm/model/mockData.ts +21 -0
- package/src/storybookHelpers/reactHookForm/model/mocks.tsx +71 -0
- package/src/storybookHelpers/reactHookForm/model/types.ts +62 -0
- package/src/storybookHelpers/reactHookForm/ui/StorybookFieldsMapper.tsx +76 -0
- package/src/storybookHelpers/reactHookForm/ui/StorybookFormProvider.tsx +43 -0
- package/src/storybookHelpers/reactHookForm/ui/index.ts +2 -0
- package/src/storybookHelpers/table/utils/defaultValue.ts +51 -0
- package/static/arrows/arrowCircle.svg +18 -0
- package/static/arrows/arrowLink.svg +3 -0
- package/static/arrows/arrowRight.svg +3 -0
- package/static/brandLogos/logoBlack.svg +14 -0
- package/static/brandLogos/logoBusiness.svg +80 -0
- package/static/brandLogos/logoGray.svg +56 -0
- package/static/brandLogos/logoInsurance.svg +124 -0
- package/static/brandLogos/logoMain.svg +14 -0
- package/static/brandLogos/logoWhite.svg +56 -0
- package/static/files/documentFilled.svg +4 -0
- package/static/files/documentOutline.svg +4 -0
- package/static/general/calendar.svg +3 -0
- package/static/general/check.svg +6 -0
- package/static/general/close.svg +12 -0
- package/static/info/warningCircle.svg +5 -0
- package/tailwind.config.ts +9 -0
- package/tsconfig.json +33 -0
- package/tsconfig.node.json +11 -0
- package/vite.config.ts +63 -0
- package/vitest.config.mjs +12 -0
- package/dist/ExampleContainer.d.ts +0 -5
- package/dist/configs/index.d.ts +0 -1
- package/dist/configs/tailwindConfigBase.d.ts +0 -2
- package/dist/index.d.ts +0 -8
- package/dist/shared/constants/api.d.ts +0 -2
- package/dist/shared/constants/designSystem/colors.d.ts +0 -120
- package/dist/shared/constants/designSystem/index.d.ts +0 -3
- package/dist/shared/constants/designSystem/others.d.ts +0 -16
- package/dist/shared/constants/designSystem/typography.d.ts +0 -75
- package/dist/shared/constants/index.d.ts +0 -2
- package/dist/shared/hooks/index.d.ts +0 -4
- package/dist/shared/hooks/useBoolean.d.ts +0 -3
- package/dist/shared/hooks/useClickOutside.d.ts +0 -2
- package/dist/shared/hooks/useControlledForm.d.ts +0 -7
- package/dist/shared/hooks/useDebounce.d.ts +0 -3
- package/dist/shared/ui/Badge.d.ts +0 -6
- package/dist/shared/ui/Breadcrumbs.d.ts +0 -15
- package/dist/shared/ui/ButtonIcon.d.ts +0 -17
- package/dist/shared/ui/CustomLink.d.ts +0 -15
- package/dist/shared/ui/Document.d.ts +0 -13
- package/dist/shared/ui/Heading.d.ts +0 -12
- package/dist/shared/ui/Hint.d.ts +0 -21
- package/dist/shared/ui/Loader.d.ts +0 -21
- package/dist/shared/ui/PhoneView.d.ts +0 -12
- package/dist/shared/ui/Portal.d.ts +0 -7
- package/dist/shared/ui/ProgressBar.d.ts +0 -18
- package/dist/shared/ui/ResponsiveContainer.d.ts +0 -6
- package/dist/shared/ui/Section.d.ts +0 -6
- package/dist/shared/ui/Skeleton.d.ts +0 -4
- package/dist/shared/ui/TabsSwitcher.d.ts +0 -33
- package/dist/shared/ui/accordion/Accordion.d.ts +0 -13
- package/dist/shared/ui/accordion/index.d.ts +0 -1
- package/dist/shared/ui/accordion/model/types.d.ts +0 -17
- package/dist/shared/ui/accordion/ui/AccordionHeader.d.ts +0 -8
- package/dist/shared/ui/brandLogos.d.ts +0 -5
- package/dist/shared/ui/button/Button.d.ts +0 -17
- package/dist/shared/ui/button/index.d.ts +0 -1
- package/dist/shared/ui/button/model/helpers.d.ts +0 -2
- package/dist/shared/ui/calendar/Calendar.d.ts +0 -20
- package/dist/shared/ui/calendar/index.d.ts +0 -1
- package/dist/shared/ui/calendar/model/animation.d.ts +0 -18
- package/dist/shared/ui/calendar/model/classes.d.ts +0 -24
- package/dist/shared/ui/calendar/model/helpers.d.ts +0 -9
- package/dist/shared/ui/calendar/model/hooks/index.d.ts +0 -2
- package/dist/shared/ui/calendar/model/hooks/useCalendarDropdowns.d.ts +0 -9
- package/dist/shared/ui/calendar/model/hooks/useDatePicker.d.ts +0 -19
- package/dist/shared/ui/calendar/ui/CalendarHeader.d.ts +0 -15
- package/dist/shared/ui/calendar/ui/Dropdown.d.ts +0 -10
- package/dist/shared/ui/calendar/ui/NavigationArrows.d.ts +0 -5
- package/dist/shared/ui/calendar/ui/Weekdays.d.ts +0 -1
- package/dist/shared/ui/calendar/ui/index.d.ts +0 -2
- package/dist/shared/ui/formControlElements/CheckboxControl.d.ts +0 -13
- package/dist/shared/ui/formControlElements/FormControl.d.ts +0 -3
- package/dist/shared/ui/formControlElements/InputControl.d.ts +0 -6
- package/dist/shared/ui/formControlElements/InputControlMask.d.ts +0 -10
- package/dist/shared/ui/formControlElements/RadioControl.d.ts +0 -26
- package/dist/shared/ui/formControlElements/SelectControl.d.ts +0 -27
- package/dist/shared/ui/formControlElements/SwitchControl.d.ts +0 -16
- package/dist/shared/ui/formControlElements/TextareaControl.d.ts +0 -11
- package/dist/shared/ui/formControlElements/calendarControl/CalendarControl.d.ts +0 -13
- package/dist/shared/ui/formControlElements/calendarControl/hooks/index.d.ts +0 -2
- package/dist/shared/ui/formControlElements/calendarControl/hooks/useCalendar.d.ts +0 -16
- package/dist/shared/ui/formControlElements/calendarControl/hooks/useCalendarDropdowns.d.ts +0 -9
- package/dist/shared/ui/formControlElements/calendarControl/model/helpers.d.ts +0 -24
- package/dist/shared/ui/formControlElements/calendarControl/model/types.d.ts +0 -33
- package/dist/shared/ui/formControlElements/calendarControl/ui/DaysOfMonth.d.ts +0 -10
- package/dist/shared/ui/formControlElements/calendarControl/ui/DaysOfWeek.d.ts +0 -6
- package/dist/shared/ui/formControlElements/calendarControl/ui/Dropdown.d.ts +0 -11
- package/dist/shared/ui/formControlElements/calendarControl/ui/Header.d.ts +0 -14
- package/dist/shared/ui/formControlElements/calendarControl/ui/Navigation.d.ts +0 -9
- package/dist/shared/ui/formControlElements/calendarControl/ui/OptionsList.d.ts +0 -5
- package/dist/shared/ui/formControlElements/calendarControl/ui/index.d.ts +0 -4
- package/dist/shared/ui/formControlElements/dadata/DadataInputControl.d.ts +0 -14
- package/dist/shared/ui/formControlElements/dadata/model/api.d.ts +0 -2
- package/dist/shared/ui/formControlElements/dadata/model/helpers.d.ts +0 -7
- package/dist/shared/ui/formControlElements/dadata/model/types.d.ts +0 -42
- package/dist/shared/ui/formControlElements/dadata/model/useDadata.d.ts +0 -7
- package/dist/shared/ui/formControlElements/model/classes-types.d.ts +0 -18
- package/dist/shared/ui/formControlElements/model/index.d.ts +0 -2
- package/dist/shared/ui/formControlElements/model/props-types.d.ts +0 -20
- package/dist/shared/ui/formControlElements/ui/FieldAttachment.d.ts +0 -13
- package/dist/shared/ui/formControlElements/ui/FieldContainer.d.ts +0 -14
- package/dist/shared/ui/formControlElements/ui/FieldWrapper.d.ts +0 -14
- package/dist/shared/ui/formControlElements/ui/MessageView.d.ts +0 -13
- package/dist/shared/ui/formControlElements/ui/index.d.ts +0 -4
- package/dist/shared/ui/icon/Icon.d.ts +0 -10
- package/dist/shared/ui/icon/sprite.gen.d.ts +0 -17
- package/dist/shared/ui/index.d.ts +0 -21
- package/dist/shared/ui/popover/Popover.d.ts +0 -23
- package/dist/shared/ui/popover/index.d.ts +0 -1
- package/dist/shared/ui/table/Table.d.ts +0 -17
- package/dist/shared/ui/table/index.d.ts +0 -1
- package/dist/shared/ui/table/type.d.ts +0 -21
- package/dist/shared/utils/capitalize.d.ts +0 -1
- package/dist/shared/utils/cn.d.ts +0 -2
- package/dist/shared/utils/deepCompare.d.ts +0 -1
- package/dist/shared/utils/formatToDate.d.ts +0 -1
- package/dist/shared/utils/index.d.ts +0 -5
- package/dist/shared/utils/isClient.d.ts +0 -1
- package/dist/shared/validation/index.d.ts +0 -3
- package/dist/shared/validation/messages.d.ts +0 -12
- package/dist/shared/validation/regExp.d.ts +0 -3
- package/dist/shared/validation/zodValidation/calendar.d.ts +0 -2
- package/dist/shared/validation/zodValidation/dadataFio.d.ts +0 -6
- package/dist/shared/validation/zodValidation/index.d.ts +0 -2
- package/dist/style.css +0 -1
- package/dist/ui.es.js +0 -25268
- package/dist/ui.umd.js +0 -85
- package/dist/widgets/Advantages.d.ts +0 -17
- package/dist/widgets/banner/Banner.d.ts +0 -28
- package/dist/widgets/banner/index.d.ts +0 -1
- package/dist/widgets/banner/model/helpers.d.ts +0 -4
- package/dist/widgets/banner/ui/BannerButtonsGroup.d.ts +0 -12
- package/dist/widgets/pageHeader/PageHeader.d.ts +0 -16
- /package/{dist → public}/sprites/arrows.svg +0 -0
- /package/{dist → public}/sprites/brandLogos.svg +0 -0
- /package/{dist → public}/sprites/common.svg +0 -0
- /package/{dist → public}/sprites/files.svg +0 -0
- /package/{dist → public}/sprites/general.svg +0 -0
- /package/{dist → public}/sprites/info.svg +0 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
IDadataAutoOption,
|
|
3
|
+
IDadataCacheOption,
|
|
4
|
+
IDadataCacheSuggestion,
|
|
5
|
+
IDadataConstantsAutoSuggestion,
|
|
6
|
+
IDadataConstantsCountrySuggestion,
|
|
7
|
+
IDadataCountryOption,
|
|
8
|
+
IDadataOrganizationOption,
|
|
9
|
+
TDadataBaseUrl,
|
|
10
|
+
TDadataReturn,
|
|
11
|
+
TDadataSuggestionType,
|
|
12
|
+
TDadataType
|
|
13
|
+
} from './types'
|
|
14
|
+
import { DADATA_BASE_CACHE_URL, DADATA_BASE_CONSTANTS_URL } from '$/shared/constants'
|
|
15
|
+
|
|
16
|
+
export const getDadataBaseUrl = (baseUrl: TDadataBaseUrl) => {
|
|
17
|
+
switch (baseUrl) {
|
|
18
|
+
case 'cache':
|
|
19
|
+
return DADATA_BASE_CACHE_URL
|
|
20
|
+
case 'constants':
|
|
21
|
+
return DADATA_BASE_CONSTANTS_URL
|
|
22
|
+
default:
|
|
23
|
+
return DADATA_BASE_CACHE_URL
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const getDataByDadataType = <T>(dadataType: TDadataType, data: TDadataReturn<T>) => {
|
|
28
|
+
switch (dadataType) {
|
|
29
|
+
case 'country':
|
|
30
|
+
return (data as IDadataConstantsCountrySuggestion).matches
|
|
31
|
+
case 'auto':
|
|
32
|
+
return (data as IDadataConstantsAutoSuggestion).matches
|
|
33
|
+
default:
|
|
34
|
+
return (data as IDadataCacheSuggestion<T>).suggestions
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const getOptionsByDadataType = <T>(dadataType: TDadataType, suggestions: TDadataSuggestionType<T>) => {
|
|
39
|
+
switch (dadataType) {
|
|
40
|
+
case 'country':
|
|
41
|
+
return (suggestions as IDadataCountryOption[])?.map((suggestion) => {
|
|
42
|
+
return {
|
|
43
|
+
value: suggestion?.country_name,
|
|
44
|
+
label: suggestion?.country_name
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
case 'auto':
|
|
49
|
+
return (suggestions as IDadataAutoOption[])?.map((suggestion) => {
|
|
50
|
+
return {
|
|
51
|
+
value: suggestion?.model_mark,
|
|
52
|
+
label: suggestion?.model_mark
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
case 'party':
|
|
57
|
+
return (suggestions as IDadataOrganizationOption[])?.map((suggestion) => {
|
|
58
|
+
return {
|
|
59
|
+
value: suggestion?.value,
|
|
60
|
+
label: suggestion?.value,
|
|
61
|
+
additionalText: `ИНН: ${suggestion?.data?.inn}`
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
case 'fio':
|
|
65
|
+
case 'address':
|
|
66
|
+
return (suggestions as IDadataCacheOption<T>[])?.map((suggestion) => {
|
|
67
|
+
return {
|
|
68
|
+
value: suggestion?.value,
|
|
69
|
+
label: suggestion?.value
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
default:
|
|
74
|
+
return []
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export type TDadataType = 'address' | 'fio' | 'country' | 'auto' | 'party'
|
|
2
|
+
export type TDadataBaseUrl = 'cache' | 'constants'
|
|
3
|
+
|
|
4
|
+
export type TDadataOption = {
|
|
5
|
+
value: string
|
|
6
|
+
additionalText?: string
|
|
7
|
+
isDisabled?: boolean
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// # constants suggestions COUNTRY
|
|
11
|
+
export interface IDadataCountryOption {
|
|
12
|
+
id: number
|
|
13
|
+
country_name: string
|
|
14
|
+
}
|
|
15
|
+
export interface IDadataConstantsCountrySuggestion {
|
|
16
|
+
matches: IDadataCountryOption[]
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// # constants suggestions AUTO
|
|
20
|
+
export interface IDadataAutoOption {
|
|
21
|
+
id: number
|
|
22
|
+
mark: string
|
|
23
|
+
model: string
|
|
24
|
+
model_mark: string
|
|
25
|
+
year_max: string
|
|
26
|
+
year_min: string
|
|
27
|
+
}
|
|
28
|
+
export interface IDadataConstantsAutoSuggestion {
|
|
29
|
+
matches: IDadataAutoOption[]
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// # Default dadata suggestions [FIO, ADDRESS]
|
|
33
|
+
export interface IDadataCacheOption<T> {
|
|
34
|
+
value: string
|
|
35
|
+
unrestricted_value: string
|
|
36
|
+
data: T
|
|
37
|
+
}
|
|
38
|
+
export interface IDadataCacheSuggestion<T> {
|
|
39
|
+
suggestions: IDadataCacheOption<T>[]
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// # dadata suggestions organization (party)
|
|
43
|
+
export interface IDadataOrganizationOption {
|
|
44
|
+
value: string
|
|
45
|
+
unrestricted_value: string
|
|
46
|
+
data: {
|
|
47
|
+
inn: 'string'
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export type TDadataReturn<T> = IDadataConstantsCountrySuggestion | IDadataCacheSuggestion<T> | IDadataConstantsAutoSuggestion
|
|
52
|
+
export type TDadataSuggestionType<T> = IDadataCountryOption[] | IDadataCacheOption<T>[] | IDadataAutoOption[]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { fetchSuggestions } from './api'
|
|
5
|
+
import { getOptionsByDadataType } from './helpers'
|
|
6
|
+
import type { TDadataBaseUrl, TDadataOption, TDadataType } from './types'
|
|
7
|
+
import { useDebounceValue } from '$/shared/hooks'
|
|
8
|
+
|
|
9
|
+
export const useDadata = (dadataType: TDadataType, dadataBaseUrl: TDadataBaseUrl) => {
|
|
10
|
+
const [query, setQuery] = React.useState('')
|
|
11
|
+
const [suggestionsOptions, setSuggestionsOptions] = React.useState<TDadataOption[] | null>(null)
|
|
12
|
+
const debounceQuery = useDebounceValue(query, 300)
|
|
13
|
+
|
|
14
|
+
React.useEffect(() => {
|
|
15
|
+
if (debounceQuery) {
|
|
16
|
+
const handleSearch = async () => {
|
|
17
|
+
const suggestions = await fetchSuggestions(debounceQuery, dadataType, dadataBaseUrl)
|
|
18
|
+
setSuggestionsOptions(getOptionsByDadataType(dadataType, suggestions))
|
|
19
|
+
}
|
|
20
|
+
handleSearch()
|
|
21
|
+
}
|
|
22
|
+
}, [debounceQuery, dadataType, dadataBaseUrl])
|
|
23
|
+
|
|
24
|
+
return { setQuery, suggestionsOptions, debounceQuery }
|
|
25
|
+
}
|
package/{dist/shared/ui/formControlElements/index.d.ts → lib/shared/ui/formControlElements/index.ts}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { InputControl, type InputControlProps } from './InputControl'
|
|
2
|
-
export { InputControlMask, type InputControlMaskProps } from './InputControlMask'
|
|
3
|
-
export { FormControl } from './FormControl'
|
|
4
|
-
export { DadataInputControl, type IDadataInputControlProps } from './dadata'
|
|
5
|
-
export { CheckboxControl, type ICheckboxControlProps } from './CheckboxControl'
|
|
6
|
-
export { RadioControl, type IRadioControlProps, type IRadioGroupOption } from './RadioControl'
|
|
7
|
-
export { SwitchControl, type ISwitchControlProps } from './SwitchControl'
|
|
8
|
-
export { SelectControl, type ISelectControlProps, type ISelectOption } from './SelectControl'
|
|
9
|
-
export { TextareaControl, type ITextareaControlProps } from './TextareaControl'
|
|
10
|
-
export { CalendarControl, type ICalendarControlProps } from './calendarControl'
|
|
1
|
+
export { InputControl, type InputControlProps } from './InputControl'
|
|
2
|
+
export { InputControlMask, type InputControlMaskProps } from './InputControlMask'
|
|
3
|
+
export { FormControl } from './FormControl'
|
|
4
|
+
export { DadataInputControl, type IDadataInputControlProps } from './dadata'
|
|
5
|
+
export { CheckboxControl, type ICheckboxControlProps } from './CheckboxControl'
|
|
6
|
+
export { RadioControl, type IRadioControlProps, type IRadioGroupOption } from './RadioControl'
|
|
7
|
+
export { SwitchControl, type ISwitchControlProps } from './SwitchControl'
|
|
8
|
+
export { SelectControl, type ISelectControlProps, type ISelectOption } from './SelectControl'
|
|
9
|
+
export { TextareaControl, type ITextareaControlProps } from './TextareaControl'
|
|
10
|
+
export { CalendarControl, type ICalendarControlProps } from './calendarControl'
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type TFieldWrapperClasses = {
|
|
2
|
+
field: string
|
|
3
|
+
label: string
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export type TFieldAttachmentClasses = {
|
|
7
|
+
badge: string
|
|
8
|
+
icon: string
|
|
9
|
+
attachmentWrapper: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type TFieldContainerClasses = {
|
|
13
|
+
container: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type TInputCommonClasses = {
|
|
17
|
+
input: string
|
|
18
|
+
message: string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type TAdditionalInputPrimitiveClasses = TFieldWrapperClasses & TFieldContainerClasses & TInputCommonClasses
|
|
22
|
+
export type TAdditionalInputClassesWithAttachment = TAdditionalInputPrimitiveClasses & TFieldAttachmentClasses
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type * as React from 'react'
|
|
2
|
+
import type { Control, FieldValues, Path } from 'react-hook-form'
|
|
3
|
+
import type { TFieldContainerConfig } from '../ui/FieldContainer'
|
|
4
|
+
|
|
5
|
+
export type TInputCommonProps = Omit<React.ComponentProps<'input'>, 'name' | 'placeholder' | 'size' | 'type' | 'defaultValue'>
|
|
6
|
+
export type TTextareaCommonProps = Omit<React.ComponentProps<'textarea'>, 'name' | 'size' | 'type' | 'defaultValue'>
|
|
7
|
+
|
|
8
|
+
type TFieldControlledProps<T extends FieldValues> = {
|
|
9
|
+
name: Path<T>
|
|
10
|
+
control: Control<T>
|
|
11
|
+
label: string
|
|
12
|
+
helperText?: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type TFieldContainerSize = 'sm' | 'md' | 'lg' | 'full'
|
|
16
|
+
export type TFieldAttachment = {
|
|
17
|
+
badge?: string
|
|
18
|
+
icon?: React.ReactElement
|
|
19
|
+
swapPosition?: boolean
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// # Required props on controlled INPUTS - [maskInput, baseInput, dadata]
|
|
23
|
+
export type TControlledInputProps<T extends FieldValues> = TFieldContainerConfig & TFieldAttachment & TFieldControlledProps<T>
|
|
24
|
+
|
|
25
|
+
// # Required props on controlled INPUTS - [checkbox, radio]
|
|
26
|
+
export type TControlledInputPrimitiveProps<T extends FieldValues> = TInputCommonProps & TFieldControlledProps<T>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { Badge } from '../../Badge'
|
|
5
|
+
import { Icon } from '../../icon/Icon'
|
|
6
|
+
import type { TFieldAttachmentClasses } from '../model/classes-types'
|
|
7
|
+
import type { TFieldAttachment } from '../model/props-types'
|
|
8
|
+
import { cn } from '$/shared/utils'
|
|
9
|
+
|
|
10
|
+
interface IFieldAttachmentProps extends TFieldAttachment {
|
|
11
|
+
classes?: Partial<TFieldAttachmentClasses>
|
|
12
|
+
error?: boolean
|
|
13
|
+
isTextarea?: boolean
|
|
14
|
+
swapPosition?: boolean
|
|
15
|
+
onClickIcon?: (...args: unknown[]) => unknown
|
|
16
|
+
onKeyDownIcon?: (event: React.KeyboardEvent) => unknown
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const FieldAttachment = ({
|
|
20
|
+
badge,
|
|
21
|
+
icon,
|
|
22
|
+
error,
|
|
23
|
+
isTextarea = false,
|
|
24
|
+
classes,
|
|
25
|
+
swapPosition,
|
|
26
|
+
onClickIcon,
|
|
27
|
+
onKeyDownIcon
|
|
28
|
+
}: IFieldAttachmentProps) => {
|
|
29
|
+
const interactiveIconAttr = (onClickIcon || onKeyDownIcon) && {
|
|
30
|
+
role: 'button',
|
|
31
|
+
tabIndex: 0,
|
|
32
|
+
onClick: onClickIcon,
|
|
33
|
+
onKeyDown: onKeyDownIcon
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<>
|
|
38
|
+
{error ? (
|
|
39
|
+
<Icon name='info/warningCircle' className={cn('text-icon-secondary-default size-6 mr-4', { 'm-0 size-5': isTextarea })} />
|
|
40
|
+
) : (
|
|
41
|
+
<>
|
|
42
|
+
{(badge || icon) && (
|
|
43
|
+
<div
|
|
44
|
+
className={cn(
|
|
45
|
+
'flex items-center gap-4 mr-4',
|
|
46
|
+
{ 'm-0': isTextarea },
|
|
47
|
+
{ 'flex-row-reverse': swapPosition },
|
|
48
|
+
classes?.attachmentWrapper
|
|
49
|
+
)}
|
|
50
|
+
>
|
|
51
|
+
{icon && (
|
|
52
|
+
<span
|
|
53
|
+
{...interactiveIconAttr}
|
|
54
|
+
className={cn('size-6 flex justify-center items-center', { 'size-5': isTextarea }, classes?.icon)}
|
|
55
|
+
>
|
|
56
|
+
{icon}
|
|
57
|
+
</span>
|
|
58
|
+
)}
|
|
59
|
+
{badge && <Badge className={cn('bg-color-positive', classes?.badge)}>{badge}</Badge>}
|
|
60
|
+
</div>
|
|
61
|
+
)}
|
|
62
|
+
</>
|
|
63
|
+
)}
|
|
64
|
+
</>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
5
|
+
import type { TFieldContainerClasses } from '../model/classes-types'
|
|
6
|
+
import { cn } from '$/shared/utils'
|
|
7
|
+
|
|
8
|
+
const fieldContainerConfig = cva('relative flex flex-col group', {
|
|
9
|
+
variants: {
|
|
10
|
+
intent: {
|
|
11
|
+
clear: '!w-full min-w-[140px]',
|
|
12
|
+
filled: ''
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
sm: 'w-[360px]',
|
|
16
|
+
md: 'w-[520px]',
|
|
17
|
+
lg: 'w-[720px]',
|
|
18
|
+
full: 'w-full'
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
size: 'full',
|
|
23
|
+
intent: 'filled'
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
export type TFieldContainerConfig = VariantProps<typeof fieldContainerConfig>
|
|
28
|
+
|
|
29
|
+
interface IFieldContainerProps extends TFieldContainerConfig {
|
|
30
|
+
classes?: Partial<TFieldContainerClasses>
|
|
31
|
+
children: React.ReactNode
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const FieldContainer = ({ size, intent, classes, children }: IFieldContainerProps) => {
|
|
35
|
+
return <div className={cn(fieldContainerConfig({ size, intent }), classes?.container)}>{children}</div>
|
|
36
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import type { TFieldWrapperClasses } from '../model'
|
|
5
|
+
import { cn } from '$/shared/utils'
|
|
6
|
+
|
|
7
|
+
interface IFieldWrapperProps<V> {
|
|
8
|
+
children: React.ReactElement
|
|
9
|
+
label: string
|
|
10
|
+
fieldId: string
|
|
11
|
+
value: V
|
|
12
|
+
error?: boolean
|
|
13
|
+
classes?: Partial<TFieldWrapperClasses>
|
|
14
|
+
disabled?: boolean
|
|
15
|
+
isTextarea?: boolean
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const FieldWrapper = <V,>({
|
|
19
|
+
children,
|
|
20
|
+
error,
|
|
21
|
+
disabled,
|
|
22
|
+
classes,
|
|
23
|
+
fieldId,
|
|
24
|
+
label,
|
|
25
|
+
value,
|
|
26
|
+
isTextarea = false
|
|
27
|
+
}: IFieldWrapperProps<V>) => {
|
|
28
|
+
return (
|
|
29
|
+
<div
|
|
30
|
+
className={cn(
|
|
31
|
+
'relative border-solid transition-colors rounded-sm border border-transparent bg-color-blue-grey-100 group-focus-within:border-blue-grey-800 focus:outline-blue-grey-800 hover:bg-color-blue-grey-200 active:bg-color-blue-grey-100 flex items-center justify-between',
|
|
32
|
+
{ '!border-negative': error },
|
|
33
|
+
{ '!bg-color-blue-grey-100': disabled },
|
|
34
|
+
classes?.field
|
|
35
|
+
)}
|
|
36
|
+
>
|
|
37
|
+
<label
|
|
38
|
+
htmlFor={fieldId}
|
|
39
|
+
className={cn(
|
|
40
|
+
'absolute top-2/4 -translate-y-1/2 left-4 desk-body-regular-l text-color-tetriary pointer-events-none transition-all duration-15 ',
|
|
41
|
+
{ 'top-2 bg-color-transparent translate-y-0 desk-body-regular-s': value && !isTextarea },
|
|
42
|
+
{
|
|
43
|
+
'group-focus-within:top-2 group-focus-within:bg-color-transparent group-focus-within:translate-y-0 group-focus-within:desk-body-regular-s':
|
|
44
|
+
!isTextarea
|
|
45
|
+
},
|
|
46
|
+
{ 'top-2 desk-body-regular-s translate-y-0': isTextarea },
|
|
47
|
+
classes?.label
|
|
48
|
+
)}
|
|
49
|
+
>
|
|
50
|
+
{label}
|
|
51
|
+
</label>
|
|
52
|
+
{children}
|
|
53
|
+
</div>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import type { FieldError } from 'react-hook-form'
|
|
4
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
5
|
+
import { cn } from '$/shared/utils'
|
|
6
|
+
|
|
7
|
+
const messageViewConfig = cva('desk-body-regular-m mt-2', {
|
|
8
|
+
variants: {
|
|
9
|
+
intent: {
|
|
10
|
+
simple: 'text-color-tetriary',
|
|
11
|
+
error: 'text-color-negative'
|
|
12
|
+
},
|
|
13
|
+
disabled: {
|
|
14
|
+
true: 'text-color-disabled',
|
|
15
|
+
false: ''
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
intent: 'simple'
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
export interface IMessageViewProps extends VariantProps<typeof messageViewConfig> {
|
|
24
|
+
as?: 'div' | 'span' | 'p'
|
|
25
|
+
text?: string | FieldError['message']
|
|
26
|
+
className?: string
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const MessageView = ({ intent, as: Element = 'p', disabled, text, className, ...props }: IMessageViewProps) => {
|
|
30
|
+
if (!text) return null
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<Element className={cn(messageViewConfig({ intent, disabled }), className)} {...props}>
|
|
34
|
+
{text}
|
|
35
|
+
</Element>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { SPRITES_META, type SpritesMap } from './sprite.gen'
|
|
5
|
+
import { cn } from '$/shared/utils'
|
|
6
|
+
|
|
7
|
+
export type IconName<Key extends keyof SpritesMap> = `${Key}/${SpritesMap[Key]}`
|
|
8
|
+
export type TAllowedIcons = { [Key in keyof SpritesMap]: IconName<Key> }[keyof SpritesMap]
|
|
9
|
+
|
|
10
|
+
export interface IconProps extends React.SVGProps<SVGSVGElement> {
|
|
11
|
+
name: TAllowedIcons
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const getIconMeta = <Key extends keyof SpritesMap>(name: IconName<Key>) => {
|
|
15
|
+
const [spriteName, iconName] = name.split('/') as [Key, SpritesMap[Key]]
|
|
16
|
+
const {
|
|
17
|
+
filePath,
|
|
18
|
+
items: {
|
|
19
|
+
[iconName]: { viewBox, width, height }
|
|
20
|
+
}
|
|
21
|
+
} = SPRITES_META[spriteName]
|
|
22
|
+
// eslint-disable-next-line no-nested-ternary
|
|
23
|
+
const axis = width === height ? 'xy' : width > height ? 'x' : 'y'
|
|
24
|
+
|
|
25
|
+
return { filePath, iconName, viewBox, axis }
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const Icon = ({ name, className, ...props }: IconProps) => {
|
|
29
|
+
const { viewBox, filePath, iconName, axis } = getIconMeta(name)
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<svg
|
|
33
|
+
className={cn('select-none fill-current inline-block text-inherit size-6', className)}
|
|
34
|
+
focusable='false'
|
|
35
|
+
viewBox={viewBox}
|
|
36
|
+
aria-hidden
|
|
37
|
+
data-axis={axis}
|
|
38
|
+
{...props}
|
|
39
|
+
>
|
|
40
|
+
<use href={`sprites/${filePath}#${iconName}`} />
|
|
41
|
+
</svg>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Icon, type IconProps, type TAllowedIcons } from './Icon'
|
|
2
|
-
export * from './sprite.gen'
|
|
1
|
+
export { Icon, type IconProps, type TAllowedIcons } from './Icon'
|
|
2
|
+
export * from './sprite.gen'
|
|
@@ -0,0 +1,121 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
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'
|