@scbt-ecom/ui 0.4.1 → 0.4.2
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 +3 -0
- package/.github/workflows/publish.yml +61 -0
- package/.github/workflows/setup-node/action.yml +22 -0
- package/.husky/pre-commit +1 -0
- package/.prettierignore +1 -0
- package/.prettierrc +20 -0
- package/.releaserc +18 -0
- package/.storybook/main.ts +44 -0
- package/.storybook/preview.tsx +37 -0
- package/chromatic.config.json +5 -0
- package/eslint.config.mjs +193 -0
- package/index.html +13 -0
- package/lib/client.ts +12 -0
- package/lib/configs/index.ts +2 -0
- package/lib/configs/tailwindConfigBase.ts +110 -0
- package/lib/configs/tailwindPresets/extendsPreset.ts +43 -0
- package/lib/configs/tailwindPresets/index.ts +2 -0
- package/lib/configs/tailwindPresets/resetPreset.ts +71 -0
- package/lib/hybrid.ts +25 -0
- package/lib/shared/constants/api.ts +2 -0
- package/lib/shared/constants/designSystem/colors.ts +121 -0
- package/lib/shared/constants/designSystem/index.ts +3 -0
- package/lib/shared/constants/designSystem/others.ts +30 -0
- package/lib/shared/constants/designSystem/typography.ts +88 -0
- package/lib/shared/constants/index.ts +2 -0
- package/lib/shared/hooks/index.ts +5 -0
- package/lib/shared/hooks/useBoolean.ts +12 -0
- package/lib/shared/hooks/useClickOutside.ts +22 -0
- package/lib/shared/hooks/useCombineRef.ts +23 -0
- package/lib/shared/hooks/useControlledForm.ts +16 -0
- package/lib/shared/hooks/useDebounce.ts +38 -0
- package/lib/shared/hooks/useMediaQuery.tsx +42 -0
- package/lib/shared/style.css +118 -0
- package/lib/shared/ui/Badge.tsx +20 -0
- package/lib/shared/ui/Breadcrumbs.tsx +57 -0
- package/lib/shared/ui/ButtonIcon.tsx +50 -0
- package/lib/shared/ui/CustomLink.tsx +76 -0
- package/lib/shared/ui/Document.tsx +51 -0
- package/lib/shared/ui/Heading.tsx +33 -0
- package/lib/shared/ui/Hint.tsx +72 -0
- package/lib/shared/ui/Loader.tsx +58 -0
- package/lib/shared/ui/PhoneView.tsx +23 -0
- package/lib/shared/ui/ProgressBar.tsx +43 -0
- package/lib/shared/ui/ResponsiveContainer.tsx +15 -0
- package/lib/shared/ui/Section.tsx +15 -0
- package/lib/shared/ui/Skeleton.tsx +9 -0
- package/lib/shared/ui/TabsSwitcher.tsx +87 -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 +117 -0
- package/lib/shared/ui/button/index.ts +1 -0
- package/lib/shared/ui/button/model/helpers.ts +16 -0
- package/lib/shared/ui/formControlElements/CheckboxControl.tsx +92 -0
- package/lib/shared/ui/formControlElements/FormControl.tsx +5 -0
- package/lib/shared/ui/formControlElements/InputControlMask.tsx +90 -0
- package/lib/shared/ui/formControlElements/RadioControl.tsx +130 -0
- package/lib/shared/ui/formControlElements/SwitchControl.tsx +79 -0
- package/lib/shared/ui/formControlElements/TextareaControl.tsx +96 -0
- package/lib/shared/ui/formControlElements/calendarControl/CalendarControl.tsx +178 -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/lib/shared/ui/formControlElements/calendarControl/index.ts +1 -0
- 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/comboboxControl/ComboboxControl.tsx +134 -0
- package/lib/shared/ui/formControlElements/comboboxControl/index.ts +1 -0
- package/lib/shared/ui/formControlElements/comboboxControl/model/selectClassnames.ts +51 -0
- package/lib/shared/ui/formControlElements/comboboxControl/model/types.ts +42 -0
- package/lib/shared/ui/formControlElements/comboboxControl/ui/ComboboxOption.tsx +38 -0
- package/lib/shared/ui/formControlElements/comboboxControl/ui/DropdownIndicator.tsx +23 -0
- package/lib/shared/ui/formControlElements/comboboxControl/ui/MultiValueRemove.tsx +16 -0
- package/lib/shared/ui/formControlElements/comboboxControl/ui/index.ts +3 -0
- package/lib/shared/ui/formControlElements/dadata/DadataInputControl.tsx +137 -0
- package/lib/shared/ui/formControlElements/dadata/index.ts +1 -0
- 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/lib/shared/ui/formControlElements/editorControl/EditorControl.tsx +82 -0
- package/lib/shared/ui/formControlElements/editorControl/components/conrols.tsx +136 -0
- package/lib/shared/ui/formControlElements/editorControl/components/menu.tsx +107 -0
- package/lib/shared/ui/formControlElements/editorControl/index.ts +60 -0
- package/lib/shared/ui/formControlElements/editorControl/ui/RemoveBlockButton.tsx +23 -0
- package/lib/shared/ui/formControlElements/editorControl/ui/ResetBlockType.tsx +17 -0
- package/lib/shared/ui/formControlElements/index.ts +14 -0
- package/lib/shared/ui/formControlElements/inputControl/InputControl.tsx +87 -0
- package/lib/shared/ui/formControlElements/inputControl/index.ts +1 -0
- package/lib/shared/ui/formControlElements/inputControl/model/hooks.tsx +26 -0
- package/lib/shared/ui/formControlElements/inputControlUploader/InputControlUploader.tsx +47 -0
- package/lib/shared/ui/formControlElements/inputControlUploader/index.ts +1 -0
- package/lib/shared/ui/formControlElements/inputControlUploader/model/helpers.ts +18 -0
- package/lib/shared/ui/formControlElements/inputControlUploader/model/hooks/useUploader.tsx +66 -0
- package/lib/shared/ui/formControlElements/inputControlUploader/model/index.ts +1 -0
- package/lib/shared/ui/formControlElements/inputControlUploader/model/types.ts +22 -0
- package/lib/shared/ui/formControlElements/inputControlUploader/ui/File.tsx +35 -0
- package/lib/shared/ui/formControlElements/inputControlUploader/ui/Filename.tsx +40 -0
- package/lib/shared/ui/formControlElements/inputControlUploader/ui/Files.tsx +30 -0
- package/lib/shared/ui/formControlElements/inputControlUploader/ui/Input.tsx +48 -0
- package/lib/shared/ui/formControlElements/inputControlUploader/ui/Uploader.tsx +58 -0
- package/lib/shared/ui/formControlElements/inputControlUploader/ui/index.ts +3 -0
- package/lib/shared/ui/formControlElements/inputCurrencyControl/InputCurrencyControl.tsx +88 -0
- package/lib/shared/ui/formControlElements/inputCurrencyControl/index.ts +1 -0
- package/lib/shared/ui/formControlElements/inputCurrencyControl/model/helpers.ts +46 -0
- package/lib/shared/ui/formControlElements/inputCurrencyControl/model/useInputCurrency.tsx +33 -0
- package/lib/shared/ui/formControlElements/inputCurrencyControl/ui/MenuTrigger.tsx +20 -0
- package/lib/shared/ui/formControlElements/inputCurrencyControl/ui/OptionList.tsx +29 -0
- package/lib/shared/ui/formControlElements/inputCurrencyControl/ui/index.ts +2 -0
- package/lib/shared/ui/formControlElements/inputSliderControl/InputSliderControl.tsx +144 -0
- package/lib/shared/ui/formControlElements/inputSliderControl/index.ts +1 -0
- package/lib/shared/ui/formControlElements/inputSliderControl/model/helpers/dates/getEndWordMonth.ts +14 -0
- package/lib/shared/ui/formControlElements/inputSliderControl/model/helpers/dates/getYearEnding.ts +13 -0
- package/lib/shared/ui/formControlElements/inputSliderControl/model/helpers/dates/index.ts +2 -0
- package/lib/shared/ui/formControlElements/inputSliderControl/model/helpers/formatNumber.ts +6 -0
- package/lib/shared/ui/formControlElements/inputSliderControl/model/helpers/getInputSliderSuffix.ts +20 -0
- package/lib/shared/ui/formControlElements/inputSliderControl/model/helpers/getStepByVariant.ts +29 -0
- package/lib/shared/ui/formControlElements/inputSliderControl/model/helpers/index.ts +4 -0
- package/lib/shared/ui/formControlElements/inputSliderControl/model/types.ts +1 -0
- package/lib/shared/ui/formControlElements/inputSliderControl/model/useSlider.ts +26 -0
- package/lib/shared/ui/formControlElements/inputSliderControl/ui/SliderControl.tsx +47 -0
- package/lib/shared/ui/formControlElements/inputSliderControl/ui/index.ts +1 -0
- 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/message-view-animation.ts +6 -0
- package/lib/shared/ui/formControlElements/model/props-types.ts +31 -0
- package/lib/shared/ui/formControlElements/ui/FieldAttachment.tsx +76 -0
- package/lib/shared/ui/formControlElements/ui/FieldContainer.tsx +37 -0
- package/lib/shared/ui/formControlElements/ui/FieldWrapper.tsx +33 -0
- package/lib/shared/ui/formControlElements/ui/Label.tsx +32 -0
- package/lib/shared/ui/formControlElements/ui/MessageView.tsx +41 -0
- package/lib/shared/ui/formControlElements/ui/index.ts +4 -0
- package/lib/shared/ui/icon/Icon.tsx +41 -0
- package/lib/shared/ui/icon/index.ts +2 -0
- package/lib/shared/ui/icon/sprite.gen.ts +177 -0
- package/lib/shared/ui/index.ts +68 -0
- package/lib/shared/ui/modal/Modal.tsx +68 -0
- package/lib/shared/ui/modal/index.ts +1 -0
- package/lib/shared/ui/modal/model/helpers.ts +13 -0
- package/lib/shared/ui/modal/ui/ModalHeader.tsx +33 -0
- package/lib/shared/ui/notification/Notification.tsx +31 -0
- package/lib/shared/ui/notification/index.ts +1 -0
- package/lib/shared/ui/notification/ui/CustomToast.tsx +42 -0
- package/lib/shared/ui/popover/Popover.tsx +74 -0
- package/lib/shared/ui/popover/index.ts +1 -0
- package/lib/shared/ui/providers/NotificationProvider.tsx +29 -0
- package/lib/shared/ui/providers/index.ts +1 -0
- package/lib/shared/ui/table/Table.tsx +144 -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 +74 -0
- package/lib/widgets/banner/index.ts +1 -0
- package/lib/widgets/banner/model/helpers.ts +159 -0
- package/lib/widgets/banner/money.png +0 -0
- package/lib/widgets/banner/saif.jpg +0 -0
- package/lib/widgets/banner/saifMob.jpg +0 -0
- package/lib/widgets/banner/seif.jpg +0 -0
- package/lib/widgets/banner/shield.jpg +0 -0
- package/lib/widgets/banner/shield.png +0 -0
- package/lib/widgets/banner/ui/BannerButtonsGroup.tsx +44 -0
- package/lib/widgets/banner/ui/banners/BannerImageFull.tsx +82 -0
- package/lib/widgets/banner/ui/banners/BannerWithSeparateImg.tsx +60 -0
- package/lib/widgets/banner/ui/banners/index.ts +1 -0
- package/lib/widgets/footer/Footer.tsx +95 -0
- package/lib/widgets/footer/index.ts +1 -0
- package/lib/widgets/footer/model/defaultValues.tsx +105 -0
- package/lib/widgets/footer/model/types.ts +19 -0
- package/lib/widgets/footer/ui/Copyright.tsx +15 -0
- package/lib/widgets/footer/ui/Ligal.tsx +50 -0
- package/lib/widgets/footer/ui/NavLinks.tsx +41 -0
- package/lib/widgets/footer/ui/PhonesBlock.tsx +34 -0
- package/lib/widgets/footer/ui/SocialLinks.tsx +30 -0
- package/lib/widgets/footer/ui/index.ts +5 -0
- package/lib/widgets/index.ts +5 -0
- package/lib/widgets/pageHeader/PageHeader.tsx +54 -0
- package/lib/widgets/pageHeader/index.ts +1 -0
- package/lib/widgets/stepper/Stepper.tsx +43 -0
- package/lib/widgets/stepper/index.ts +1 -0
- package/lib/widgets/stepper/ui/SingleStep.tsx +42 -0
- package/package.json +1 -4
- package/postcss.config.mjs +8 -0
- package/public/sprites/arrows.svg +1 -0
- package/public/sprites/brandLogos.svg +1 -0
- package/public/sprites/files.svg +1 -0
- package/public/sprites/general.svg +1 -0
- package/public/sprites/info.svg +1 -0
- package/public/sprites/social.svg +1 -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/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/Modal.stories.tsx +106 -0
- package/src/stories/primitives/Notification.stories.tsx +102 -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 +45 -0
- package/src/stories/primitives/formControl/CalendarControl.stories.tsx +45 -0
- package/src/stories/primitives/formControl/CheckboxControl.stories.tsx +64 -0
- package/src/stories/primitives/formControl/ComboboxControl.stories.tsx +67 -0
- package/src/stories/primitives/formControl/DadataInputControl.stories.tsx +79 -0
- package/src/stories/primitives/formControl/EditorControl.stories.tsx +31 -0
- package/src/stories/primitives/formControl/FormControlAllFields.stories.tsx +25 -0
- package/src/stories/primitives/formControl/InputControl.stories.tsx +84 -0
- package/src/stories/primitives/formControl/InputControlPassword.stories.tsx +38 -0
- package/src/stories/primitives/formControl/InputControlUploader.stories.tsx +44 -0
- package/src/stories/primitives/formControl/InputCurrencyControl.stories.tsx +73 -0
- package/src/stories/primitives/formControl/InputSliderControl.stories.tsx +62 -0
- package/src/stories/primitives/formControl/RadioContol.stories.tsx +61 -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 +67 -0
- package/src/stories/widgets/Advantages.stories.tsx +42 -0
- package/src/stories/widgets/Banner.stories.tsx +94 -0
- package/src/stories/widgets/Footer.stories.tsx +36 -0
- package/src/stories/widgets/PageHeader.stories.tsx +33 -0
- package/src/stories/widgets/Stepper.stories.tsx +24 -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 +19 -0
- package/src/storybookHelpers/reactHookForm/model/mocks.tsx +105 -0
- package/src/storybookHelpers/reactHookForm/model/renderFields.tsx +58 -0
- package/src/storybookHelpers/reactHookForm/model/types.ts +86 -0
- package/src/storybookHelpers/reactHookForm/ui/StorybookFieldsMapper.tsx +32 -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/border.svg +6 -0
- package/static/files/borderError.svg +6 -0
- package/static/files/documentFilled.svg +4 -0
- package/static/files/documentOutline.svg +4 -0
- package/static/files/upload.svg +3 -0
- package/static/general/calendar.svg +3 -0
- package/static/general/check.svg +6 -0
- package/static/general/close.svg +12 -0
- package/static/general/edit.svg +4 -0
- package/static/general/hiddenEye.svg +4 -0
- package/static/general/plus.svg +3 -0
- package/static/general/showEye.svg +4 -0
- package/static/info/warningCircle.svg +5 -0
- package/static/social/classmates.svg +3 -0
- package/static/social/telegram.svg +3 -0
- package/static/social/vk.svg +3 -0
- package/tailwind.config.ts +10 -0
- package/tsconfig.json +33 -0
- package/tsconfig.node.json +11 -0
- package/vite.config.ts +68 -0
- package/vitest.config.mjs +12 -0
- package/dist/scbt-ecom-ui-0.4.1.tgz +0 -0
package/lib/hybrid.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Components
|
|
2
|
+
export * from './shared/ui/Badge'
|
|
3
|
+
export * from './shared/ui/Section'
|
|
4
|
+
export * from './shared/ui/ResponsiveContainer'
|
|
5
|
+
export * from './shared/ui/icon'
|
|
6
|
+
export * from './shared/ui/table'
|
|
7
|
+
export * from './shared/ui/Breadcrumbs'
|
|
8
|
+
export * from './shared/ui/button'
|
|
9
|
+
export * from './shared/ui/ButtonIcon'
|
|
10
|
+
export * from './shared/ui/CustomLink'
|
|
11
|
+
export * from './shared/ui/Document'
|
|
12
|
+
export * from './shared/ui/Heading'
|
|
13
|
+
export * from './shared/ui/PhoneView'
|
|
14
|
+
export * from './shared/ui/Loader'
|
|
15
|
+
export * from './shared/ui/ProgressBar'
|
|
16
|
+
export * from './shared/ui/Skeleton'
|
|
17
|
+
export * from './shared/ui/notification'
|
|
18
|
+
|
|
19
|
+
// Utils
|
|
20
|
+
export * from './shared/utils'
|
|
21
|
+
// Validation
|
|
22
|
+
export * from './shared/validation'
|
|
23
|
+
// Constants
|
|
24
|
+
export * from './shared/constants'
|
|
25
|
+
export * from './configs'
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
const rootStyles = {
|
|
2
|
+
transparent: 'transparent',
|
|
3
|
+
current: 'currentColor',
|
|
4
|
+
inherit: 'inherit',
|
|
5
|
+
initial: 'initial'
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const allowedBackgroundColors = {
|
|
9
|
+
'blue-grey-100': '#f3f4f7',
|
|
10
|
+
'blue-grey-200': '#eaedf1',
|
|
11
|
+
'blue-grey-300': '#d4dbe2',
|
|
12
|
+
'blue-grey-500': '#a9b6c5',
|
|
13
|
+
footer: '#40465a',
|
|
14
|
+
negative: '#f42500',
|
|
15
|
+
'negative-light': '#ffd2ca',
|
|
16
|
+
positive: '#76bc21',
|
|
17
|
+
'positive-light': '#e4f6ce',
|
|
18
|
+
'primary-default': '#003790',
|
|
19
|
+
'primary-focus': '#2477ff',
|
|
20
|
+
'primary-hover': '#042e73',
|
|
21
|
+
'primary-light-default': '#f0f4f9',
|
|
22
|
+
'primary-tr-focus': '#0037901f',
|
|
23
|
+
'primary-tr-hover': '#00379014',
|
|
24
|
+
'primary-tr-pressed': '#00379033',
|
|
25
|
+
'secondary-default': '#fc5055',
|
|
26
|
+
'secondary-hover': '#f12f34',
|
|
27
|
+
warning: '#f49f00',
|
|
28
|
+
'warning-light': '#ffeecc',
|
|
29
|
+
white: '#ffffff',
|
|
30
|
+
'primary-disabled': '#809bc7',
|
|
31
|
+
'secondary-disabled': '#FFB7BF',
|
|
32
|
+
dark: '#000000',
|
|
33
|
+
purple: '#5f40bd',
|
|
34
|
+
'purple-hover': '#52399d',
|
|
35
|
+
overlay: '#0000004d',
|
|
36
|
+
...rootStyles
|
|
37
|
+
} as const
|
|
38
|
+
|
|
39
|
+
const allowedTextColors = {
|
|
40
|
+
dark: '#292929',
|
|
41
|
+
disabled: '#a9b6c5',
|
|
42
|
+
footer: '#c3c3c3',
|
|
43
|
+
negative: '#f42500',
|
|
44
|
+
positive: '#76bc21',
|
|
45
|
+
'primary-default': '#003790',
|
|
46
|
+
'primary-hover': '#042e73',
|
|
47
|
+
secondary: '#40465a',
|
|
48
|
+
tetriary: '#5a6e85',
|
|
49
|
+
warning: '#f49f00',
|
|
50
|
+
white: '#ffffff',
|
|
51
|
+
'primary-disabled': '#809bc7',
|
|
52
|
+
'blue-grey-600': '#94a4b7',
|
|
53
|
+
...rootStyles
|
|
54
|
+
} as const
|
|
55
|
+
|
|
56
|
+
const allowedBannersBackgroundColors = {
|
|
57
|
+
'barvcray-200': '#ebeef4',
|
|
58
|
+
'barvcray-300': '#dde1e8',
|
|
59
|
+
'greymint-200': '#deecee',
|
|
60
|
+
'lavender-100': '#f7f7ff',
|
|
61
|
+
'lavender-200': '#ecedfa',
|
|
62
|
+
'lavender-300': '#d0d3f1',
|
|
63
|
+
'lightblue-300': '#bed3ec',
|
|
64
|
+
'mint-200': '#e4f5ed',
|
|
65
|
+
'salmon-200': '#faecec',
|
|
66
|
+
'skyblue-100': '#f4f8fe',
|
|
67
|
+
'skyblue-200': '#e7f3ff',
|
|
68
|
+
'skyblue-300': '#d9edff',
|
|
69
|
+
...rootStyles
|
|
70
|
+
} as const
|
|
71
|
+
|
|
72
|
+
const allowedIconsColors = {
|
|
73
|
+
'accent-default': '#2477ff',
|
|
74
|
+
'accent-hover': '#0053da',
|
|
75
|
+
'blue-grey-100': '#f3f4f7',
|
|
76
|
+
'blue-grey-600': '#94a4b7',
|
|
77
|
+
'blue-grey-700': '#69809a',
|
|
78
|
+
'blue-grey-800': '#5a6e85',
|
|
79
|
+
'dark-default': '#292929',
|
|
80
|
+
'dark-hover': '#535353',
|
|
81
|
+
disabled: '#a9b6c5',
|
|
82
|
+
'negative-default': '#f42500',
|
|
83
|
+
'negative-hover': '#c31e00',
|
|
84
|
+
'positive-default': '#76bc21',
|
|
85
|
+
'positive-hover': '#598d19',
|
|
86
|
+
'primary-default': '#003790',
|
|
87
|
+
'primary-hover': '#042e73',
|
|
88
|
+
'secondary-dark-default': '#f12f34',
|
|
89
|
+
'secondary-dark-hover': '#c40309',
|
|
90
|
+
'secondary-default': '#fc5055',
|
|
91
|
+
'secondary-hover': '#f12f34',
|
|
92
|
+
'warning-default': '#f49f00',
|
|
93
|
+
'warning-hover': '#d68b00',
|
|
94
|
+
white: '#ffffff',
|
|
95
|
+
'primary-disabled': '#809bc7',
|
|
96
|
+
footer: '#C3C3C3',
|
|
97
|
+
...rootStyles
|
|
98
|
+
} as const
|
|
99
|
+
|
|
100
|
+
const allowedStrokeColors = {
|
|
101
|
+
'blue-grey-500': '#a9b6c5',
|
|
102
|
+
'blue-grey-700': '#69809a',
|
|
103
|
+
'blue-grey-800': '#5a6e85',
|
|
104
|
+
dark: '#292929',
|
|
105
|
+
negative: '#f42500',
|
|
106
|
+
positive: '#76bc21',
|
|
107
|
+
'primary-default': '#003790',
|
|
108
|
+
'primary-focus': '#2477ff',
|
|
109
|
+
'primary-hover': '#042e73',
|
|
110
|
+
'primary-light': '#f0f4f9',
|
|
111
|
+
'secondary-default': '#fc5055',
|
|
112
|
+
'secondary-hover': '#f12f34',
|
|
113
|
+
'warm-grey-200': '#e4e4e4',
|
|
114
|
+
'warm-grey-300': '#c3c3c3',
|
|
115
|
+
warning: '#f49f00',
|
|
116
|
+
white: '#ffffff',
|
|
117
|
+
'primary-disabled': '#809bc7',
|
|
118
|
+
...rootStyles
|
|
119
|
+
} as const
|
|
120
|
+
|
|
121
|
+
export { allowedStrokeColors, allowedBannersBackgroundColors, allowedIconsColors, allowedTextColors, allowedBackgroundColors }
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const allowedBorderRadius = {
|
|
2
|
+
none: '0',
|
|
3
|
+
sm: '4px',
|
|
4
|
+
md: '8px',
|
|
5
|
+
lg: '16px',
|
|
6
|
+
full: '9999px'
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const allowedBackgroundDeg = {
|
|
10
|
+
30: '30deg',
|
|
11
|
+
45: '45deg',
|
|
12
|
+
80: '80deg',
|
|
13
|
+
90: '90deg',
|
|
14
|
+
110: '110deg',
|
|
15
|
+
180: '180deg'
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const allowedZIndex = {
|
|
19
|
+
0: '0',
|
|
20
|
+
1: '1',
|
|
21
|
+
10: '10',
|
|
22
|
+
30: '30',
|
|
23
|
+
50: '50',
|
|
24
|
+
100: '100',
|
|
25
|
+
250: '250',
|
|
26
|
+
500: '500',
|
|
27
|
+
1000: '1000'
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { allowedBorderRadius, allowedBackgroundDeg, allowedZIndex }
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
const allowedFontSize = {
|
|
2
|
+
12: '12px',
|
|
3
|
+
14: '14px',
|
|
4
|
+
16: '16px',
|
|
5
|
+
18: '18px',
|
|
6
|
+
20: '20px',
|
|
7
|
+
24: '24px',
|
|
8
|
+
28: '28px',
|
|
9
|
+
32: '32px',
|
|
10
|
+
40: '40px'
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const allowedLineHeight = {
|
|
14
|
+
16: '16px',
|
|
15
|
+
20: '20px',
|
|
16
|
+
22: '22px',
|
|
17
|
+
24: '24px',
|
|
18
|
+
30: '30px',
|
|
19
|
+
32: '32px',
|
|
20
|
+
40: '40px',
|
|
21
|
+
48: '48px'
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const allowedTextStyles = {
|
|
25
|
+
/* # Headline */
|
|
26
|
+
'.mob-headline-bold-m': {
|
|
27
|
+
'@apply font-bold text-28 leading-32': ''
|
|
28
|
+
},
|
|
29
|
+
'.mob-headline-bold-s': {
|
|
30
|
+
'@apply font-bold text-24 leading-30': ''
|
|
31
|
+
},
|
|
32
|
+
/* # Title */
|
|
33
|
+
'.mob-title-bold-l': {
|
|
34
|
+
'@apply font-bold text-20 leading-24': ''
|
|
35
|
+
},
|
|
36
|
+
'.mob-title-bold-m': {
|
|
37
|
+
'@apply font-bold text-18 leading-22': ''
|
|
38
|
+
},
|
|
39
|
+
/* # Body */
|
|
40
|
+
'.mob-body-medium-l': {
|
|
41
|
+
'@apply font-medium text-16 leading-22': ''
|
|
42
|
+
},
|
|
43
|
+
'.mob-body-regular-l': {
|
|
44
|
+
'@apply font-normal text-16 leading-22': ''
|
|
45
|
+
},
|
|
46
|
+
'.mob-body-medium-m': {
|
|
47
|
+
'@apply font-medium text-14 leading-20': ''
|
|
48
|
+
},
|
|
49
|
+
'.mob-body-regular-m': {
|
|
50
|
+
'@apply font-normal text-14 leading-20': ''
|
|
51
|
+
},
|
|
52
|
+
'.mob-body-regular-s': {
|
|
53
|
+
'@apply font-normal text-12 leading-20': ''
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
/* -------- Desktop Typography -------- */
|
|
57
|
+
/* # Headline */
|
|
58
|
+
'.desk-headline-bold-l': {
|
|
59
|
+
'@apply font-bold text-40 leading-48': ''
|
|
60
|
+
},
|
|
61
|
+
'.desk-headline-bold-m': {
|
|
62
|
+
'@apply font-bold text-32 leading-40': ''
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
/* # Title */
|
|
66
|
+
'.desk-title-bold-l': {
|
|
67
|
+
'@apply font-bold text-24 leading-30': ''
|
|
68
|
+
},
|
|
69
|
+
'.desk-title-bold-s': {
|
|
70
|
+
'@apply font-bold text-18 leading-22': ''
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
/* # Body */
|
|
74
|
+
'.desk-body-medium-l': {
|
|
75
|
+
'@apply font-medium text-16 leading-22': ''
|
|
76
|
+
},
|
|
77
|
+
'.desk-body-regular-l': {
|
|
78
|
+
'@apply font-normal text-16 leading-22': ''
|
|
79
|
+
},
|
|
80
|
+
'.desk-body-regular-m': {
|
|
81
|
+
'@apply font-normal text-14 leading-20': ''
|
|
82
|
+
},
|
|
83
|
+
'.desk-body-regular-s': {
|
|
84
|
+
'@apply font-normal text-12 leading-16': ''
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export { allowedLineHeight, allowedFontSize, allowedTextStyles }
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { useBoolean } from './useBoolean'
|
|
2
|
+
export { useClickOutside } from './useClickOutside'
|
|
3
|
+
export { useControlledForm } from './useControlledForm'
|
|
4
|
+
export { useDebounceValue, debounce, useDebounceCallback } from './useDebounce'
|
|
5
|
+
export { useCombineRef } from './useCombineRef'
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
|
|
5
|
+
type UseBooleanReturn = [value: boolean, action: (val?: boolean) => void]
|
|
6
|
+
|
|
7
|
+
export const useBoolean = (initialValue = false): UseBooleanReturn => {
|
|
8
|
+
const [value, setValue] = React.useState(initialValue)
|
|
9
|
+
const action = (val?: boolean) => setValue((prevValue) => val ?? !prevValue)
|
|
10
|
+
|
|
11
|
+
return [value, action]
|
|
12
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { isClient } from '../utils'
|
|
5
|
+
|
|
6
|
+
export const useClickOutside = (ref: React.RefObject<HTMLElement>, callback: () => void) => {
|
|
7
|
+
const handleClickOutside = (event: MouseEvent) => {
|
|
8
|
+
if (ref.current && !ref.current.contains(event.target as Node)) {
|
|
9
|
+
callback()
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
React.useEffect(() => {
|
|
14
|
+
if (isClient) {
|
|
15
|
+
globalThis?.document?.addEventListener('mousedown', handleClickOutside)
|
|
16
|
+
return () => {
|
|
17
|
+
globalThis?.document.removeEventListener('mousedown', handleClickOutside)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
21
|
+
}, [ref, callback])
|
|
22
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type Ref, useCallback } from 'react'
|
|
2
|
+
import { type RefCallBack } from 'react-hook-form'
|
|
3
|
+
|
|
4
|
+
type TCombineRef<HTML> = (element: HTML) => void
|
|
5
|
+
|
|
6
|
+
export const useCombineRef = <HTML extends HTMLElement>(...refs: Array<Ref<HTML> | RefCallBack>) => {
|
|
7
|
+
const combinedRef: TCombineRef<HTML> = useCallback(
|
|
8
|
+
(element) => {
|
|
9
|
+
refs.forEach((ref) => {
|
|
10
|
+
if (!ref) return
|
|
11
|
+
if (typeof ref === 'function') {
|
|
12
|
+
ref(element)
|
|
13
|
+
} else {
|
|
14
|
+
// @ts-expect-error Mutable ref?
|
|
15
|
+
ref.current = element
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
},
|
|
19
|
+
[refs]
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
return combinedRef
|
|
23
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useForm, type UseFormProps } from 'react-hook-form'
|
|
4
|
+
import { zodResolver } from '@hookform/resolvers/zod'
|
|
5
|
+
import { type TypeOf, type ZodTypeAny } from 'zod'
|
|
6
|
+
|
|
7
|
+
interface UseControlledForm<T extends ZodTypeAny> extends UseFormProps<TypeOf<T>> {
|
|
8
|
+
schema: T
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const useControlledForm = <T extends ZodTypeAny>({ schema, ...formConfig }: UseControlledForm<T>) => {
|
|
12
|
+
return useForm({
|
|
13
|
+
...formConfig,
|
|
14
|
+
resolver: zodResolver(schema)
|
|
15
|
+
})
|
|
16
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
|
|
5
|
+
export const debounce = <Params extends unknown[]>(
|
|
6
|
+
callback: (...args: Params) => void,
|
|
7
|
+
delay: number
|
|
8
|
+
): ((...args: Params) => void) => {
|
|
9
|
+
let timer: ReturnType<typeof setTimeout>
|
|
10
|
+
|
|
11
|
+
return function (...args: Params) {
|
|
12
|
+
clearTimeout(timer)
|
|
13
|
+
timer = setTimeout(() => callback(...args), delay)
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const useDebounceCallback = <Params extends unknown[], Return>(callback: (...args: Params) => Return, delay: number) => {
|
|
18
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19
|
+
const debounced = React.useMemo(() => debounce(callback, delay), [delay])
|
|
20
|
+
|
|
21
|
+
return debounced
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const useDebounceValue = <Value>(value: Value, delay: number) => {
|
|
25
|
+
const previousValueRef = React.useRef(value)
|
|
26
|
+
const [debouncedValue, setDebounceValue] = React.useState(value)
|
|
27
|
+
|
|
28
|
+
const debouncedSetState = useDebounceCallback(setDebounceValue, delay)
|
|
29
|
+
|
|
30
|
+
React.useEffect(() => {
|
|
31
|
+
if (previousValueRef.current === value) return
|
|
32
|
+
debouncedSetState(value)
|
|
33
|
+
previousValueRef.current = value
|
|
34
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
35
|
+
}, [value])
|
|
36
|
+
|
|
37
|
+
return debouncedValue
|
|
38
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { useCallback, useSyncExternalStore } from 'react'
|
|
2
|
+
/**
|
|
3
|
+
* @name useMediaQuery
|
|
4
|
+
* @description - Hook that manages a media query
|
|
5
|
+
* @category Browser
|
|
6
|
+
*
|
|
7
|
+
* @returns {{ isMobile: boolean; isDesktop: boolean }} An object with isMobile and isDesktop properties
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const { isMobile, isDesktop } = useMediaQuery();
|
|
11
|
+
*/
|
|
12
|
+
const getServerSnapshot = () => false
|
|
13
|
+
export const useDevice = () => {
|
|
14
|
+
const isMobileQuery = '(max-width: 1187px)'
|
|
15
|
+
const isDesktopQuery = '(min-width: 1188px)'
|
|
16
|
+
const subscribeMobile = useCallback(
|
|
17
|
+
(callback: () => void) => {
|
|
18
|
+
const matchMedia = globalThis.matchMedia(isMobileQuery)
|
|
19
|
+
matchMedia.addEventListener('change', callback)
|
|
20
|
+
return () => {
|
|
21
|
+
matchMedia.removeEventListener('change', callback)
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
[isMobileQuery]
|
|
25
|
+
)
|
|
26
|
+
const subscribeDesktop = useCallback(
|
|
27
|
+
(callback: () => void) => {
|
|
28
|
+
const matchMedia = globalThis.matchMedia(isDesktopQuery)
|
|
29
|
+
matchMedia.addEventListener('change', callback)
|
|
30
|
+
return () => {
|
|
31
|
+
matchMedia.removeEventListener('change', callback)
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
[isDesktopQuery]
|
|
35
|
+
)
|
|
36
|
+
const getSnapshotMobile = () => globalThis.matchMedia(isMobileQuery).matches
|
|
37
|
+
const getSnapshotDesktop = () => globalThis.matchMedia(isDesktopQuery).matches
|
|
38
|
+
return {
|
|
39
|
+
isMobile: useSyncExternalStore(subscribeMobile, getSnapshotMobile, getServerSnapshot),
|
|
40
|
+
isDesktop: useSyncExternalStore(subscribeDesktop, getSnapshotDesktop, getServerSnapshot)
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');
|
|
2
|
+
|
|
3
|
+
@tailwind base;
|
|
4
|
+
@tailwind components;
|
|
5
|
+
@tailwind utilities;
|
|
6
|
+
|
|
7
|
+
@layer utilities {
|
|
8
|
+
.text-balance {
|
|
9
|
+
text-wrap: balance;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:root {
|
|
14
|
+
--ff-roboto: 'Roboto', sans-serif;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@layer components {
|
|
18
|
+
/* # Custom scroll */
|
|
19
|
+
.customScrollbar-y::-webkit-scrollbar {
|
|
20
|
+
width: 4px;
|
|
21
|
+
height: 4px;
|
|
22
|
+
}
|
|
23
|
+
.customScrollbar-y::-webkit-scrollbar-track {
|
|
24
|
+
border-radius: 8px;
|
|
25
|
+
background: #d4dbe2;
|
|
26
|
+
}
|
|
27
|
+
.customScrollbar-y::-webkit-scrollbar-thumb {
|
|
28
|
+
background: #a9b6c5;
|
|
29
|
+
border-radius: 8px;
|
|
30
|
+
}
|
|
31
|
+
.scrollHidden::-webkit-scrollbar {
|
|
32
|
+
width: 0;
|
|
33
|
+
height: 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.progressBar-apply {
|
|
37
|
+
background-image: repeating-linear-gradient(-33deg, #d4dbe2, #d4dbe2 5px, #f3f4f7 0, #f3f4f7 14px);
|
|
38
|
+
background-size: 2000% 2000%;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.skeleton-apply {
|
|
42
|
+
background: linear-gradient(80deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
|
|
43
|
+
background-size: 200% 100%;
|
|
44
|
+
animation: 1.5s shine linear infinite;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.rdp-vhidden {
|
|
48
|
+
@apply hidden;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.grid-desk-apply {
|
|
52
|
+
grid-template-areas:
|
|
53
|
+
'text image'
|
|
54
|
+
'buttons image'
|
|
55
|
+
'. image';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.grid-mob-apply {
|
|
59
|
+
grid-template-areas:
|
|
60
|
+
'text'
|
|
61
|
+
'image'
|
|
62
|
+
'buttons';
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.grid-desk-full-img-apply {
|
|
66
|
+
grid-template-areas:
|
|
67
|
+
'text .'
|
|
68
|
+
'buttons .'
|
|
69
|
+
'. .';
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.grid-mob-full-img-apply {
|
|
73
|
+
grid-template-areas:
|
|
74
|
+
'text'
|
|
75
|
+
'.'
|
|
76
|
+
'buttons';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.grid-text-apply {
|
|
80
|
+
grid-area: text;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.grid-buttons-apply {
|
|
84
|
+
grid-area: buttons;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.grid-image-apply {
|
|
88
|
+
grid-area: image;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.gradient-apply {
|
|
92
|
+
background: linear-gradient(97.94deg, #dae4f2 -14.21%, #afcffc 47.44%, #79aef8 107.86%);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
* {
|
|
97
|
+
box-sizing: border-box;
|
|
98
|
+
padding: 0;
|
|
99
|
+
margin: 0;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
body,
|
|
103
|
+
html {
|
|
104
|
+
font-family: var(--ff-roboto);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
input:-webkit-autofill,
|
|
108
|
+
input:-webkit-autofill:hover,
|
|
109
|
+
input:-webkit-autofill:focus,
|
|
110
|
+
input:-webkit-autofill:active {
|
|
111
|
+
transition: background-color 5000s ease-in-out 0s;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@keyframes shine {
|
|
115
|
+
to {
|
|
116
|
+
background-position-x: -200%;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactElement } from 'react'
|
|
2
|
+
import { cn } from '$/shared/utils'
|
|
3
|
+
|
|
4
|
+
export interface IBadgeProps {
|
|
5
|
+
children: ReactElement | string
|
|
6
|
+
className?: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const Badge = ({ children, className }: IBadgeProps) => {
|
|
10
|
+
return (
|
|
11
|
+
<span
|
|
12
|
+
className={cn(
|
|
13
|
+
'desk-body-regular-s flex min-h-6 min-w-6 items-center justify-center text-nowrap rounded-full bg-color-primary-default px-2 py-1 text-color-white',
|
|
14
|
+
className
|
|
15
|
+
)}
|
|
16
|
+
>
|
|
17
|
+
{children}
|
|
18
|
+
</span>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { cn } from '../utils'
|
|
2
|
+
import { Icon } from './icon/Icon'
|
|
3
|
+
|
|
4
|
+
export interface IBreadcrumbLink {
|
|
5
|
+
label: string
|
|
6
|
+
path: string
|
|
7
|
+
isDisabled?: boolean
|
|
8
|
+
}
|
|
9
|
+
interface IBreadcrumbLinkWithoutPath {
|
|
10
|
+
label: string
|
|
11
|
+
isDisabled?: boolean
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type TLinksList = [...IBreadcrumbLink[], IBreadcrumbLinkWithoutPath]
|
|
15
|
+
|
|
16
|
+
export interface IBreadcrumbsProps {
|
|
17
|
+
linksList: TLinksList
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const Breadcrumbs = ({ linksList }: IBreadcrumbsProps) => {
|
|
21
|
+
return (
|
|
22
|
+
<div aria-label='Breadcrumb' className='flex max-w-[840px] items-center gap-2'>
|
|
23
|
+
{linksList.map((link) => (
|
|
24
|
+
<>
|
|
25
|
+
{'path' in link ? (
|
|
26
|
+
<div
|
|
27
|
+
className={cn(
|
|
28
|
+
'flex items-center gap-1 rounded-sm border-2 border-solid border-transparent px-1 focus-within:border-primary-focus',
|
|
29
|
+
{ 'pointer-events-none !border-transparent': link?.isDisabled }
|
|
30
|
+
)}
|
|
31
|
+
>
|
|
32
|
+
<a
|
|
33
|
+
href={link.path}
|
|
34
|
+
target='_blank'
|
|
35
|
+
rel='noreferrer'
|
|
36
|
+
className={cn(
|
|
37
|
+
'desk-body-regular-m text-color-primary-default outline-none hover:text-color-primary-hover focus:text-color-primary-default',
|
|
38
|
+
{ '!text-color-disabled': link?.isDisabled }
|
|
39
|
+
)}
|
|
40
|
+
>
|
|
41
|
+
{link.label}
|
|
42
|
+
</a>
|
|
43
|
+
<Icon
|
|
44
|
+
name='arrows/arrowRight'
|
|
45
|
+
className={cn('size-4 text-icon-primary-default', { '!text-icon-disabled': link?.isDisabled })}
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
) : (
|
|
49
|
+
<div aria-current='page' className='desk-body-regular-m text-color-blue-grey-600'>
|
|
50
|
+
{link.label}
|
|
51
|
+
</div>
|
|
52
|
+
)}
|
|
53
|
+
</>
|
|
54
|
+
))}
|
|
55
|
+
</div>
|
|
56
|
+
)
|
|
57
|
+
}
|