@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,77 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Popover } from './Popover'
|
|
@@ -0,0 +1,143 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Table } from './Table'
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const deepCompare = <A, B>(dataA: A, dataB: B): boolean => JSON.stringify(dataA) === JSON.stringify(dataB)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const isClient = typeof window !== 'undefined' && window.document !== undefined
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
})
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
})
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Advantages, type IAdvantage } from '../Advantages'
|
|
2
|
+
import money from './money.png'
|
|
3
|
+
import { BannerButtonsGroup, type IBannerButtonsGroupClasses } from './ui/BannerButtonsGroup'
|
|
4
|
+
import { Heading, type IButtonProps, ResponsiveContainer } from '$/shared/ui'
|
|
5
|
+
import { cn } from '$/shared/utils'
|
|
6
|
+
|
|
7
|
+
interface IBannerClasses extends IBannerButtonsGroupClasses {
|
|
8
|
+
section: string
|
|
9
|
+
container: string
|
|
10
|
+
wrapper: string
|
|
11
|
+
content: string
|
|
12
|
+
textBlock: string
|
|
13
|
+
title: string
|
|
14
|
+
subtitle: string
|
|
15
|
+
imageContainer: string
|
|
16
|
+
image: string
|
|
17
|
+
advantages: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type TButtonsConfig = {
|
|
21
|
+
primary: IButtonProps
|
|
22
|
+
secondary?: IButtonProps
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface IBannerProps {
|
|
26
|
+
headTitle: string
|
|
27
|
+
subtitle: string
|
|
28
|
+
buttonsConfig: TButtonsConfig
|
|
29
|
+
advantagesList?: IAdvantage[]
|
|
30
|
+
classes?: Partial<IBannerClasses>
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const Banner = ({ headTitle, subtitle, buttonsConfig, advantagesList, classes }: IBannerProps) => {
|
|
34
|
+
return (
|
|
35
|
+
<section className={cn('h-[456px] bg-banner-skyblue-300 relative', classes?.section)}>
|
|
36
|
+
<ResponsiveContainer className={cn(classes?.container)}>
|
|
37
|
+
<div className={cn('flex flex-col desktop:flex-row desktop:justify-between', classes?.wrapper)}>
|
|
38
|
+
<div className={cn('relative z-10 flex flex-col gap-10 pt-6 desktop:pt-20', classes?.content)}>
|
|
39
|
+
<div className={cn('flex flex-col gap-4', classes?.textBlock)}>
|
|
40
|
+
<Heading as='h1' className={cn('text-color-dark', classes?.title)}>
|
|
41
|
+
{headTitle}
|
|
42
|
+
</Heading>
|
|
43
|
+
<p className={cn('desk-body-regular-l text-color-dark', classes?.subtitle)}>{subtitle}</p>
|
|
44
|
+
</div>
|
|
45
|
+
<BannerButtonsGroup buttonsConfig={buttonsConfig} classes={classes} />
|
|
46
|
+
</div>
|
|
47
|
+
<div
|
|
48
|
+
className={cn(
|
|
49
|
+
'w-full h-[410px] mobile:absolute mobile:left-1/2 mobile:bottom-0 mobile:-translate-x-1/2 desktop:w-[550px] desktop:h-full',
|
|
50
|
+
classes?.imageContainer
|
|
51
|
+
)}
|
|
52
|
+
>
|
|
53
|
+
<img src={money} alt='money' className={cn('w-full h-full object-contain', classes?.image)} />
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
<div className={cn('absolute bottom-[-400px] desktop:bottom-[-50px]', classes?.advantages)}>
|
|
57
|
+
{advantagesList && advantagesList?.length > 0 && <Advantages advantagesList={advantagesList} />}
|
|
58
|
+
</div>
|
|
59
|
+
</ResponsiveContainer>
|
|
60
|
+
</section>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Banner } from './Banner'
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import toast from 'react-hot-toast'
|
|
2
|
+
import { type IBannerProps } from '../Banner'
|
|
3
|
+
|
|
4
|
+
export const mockBannerBase: IBannerProps = {
|
|
5
|
+
headTitle: 'Кредит на любые цели',
|
|
6
|
+
subtitle: 'до 5 млн рублей',
|
|
7
|
+
buttonsConfig: {
|
|
8
|
+
primary: {
|
|
9
|
+
onClick: () => toast.success('@click on primary btn'),
|
|
10
|
+
children: 'Primary'
|
|
11
|
+
},
|
|
12
|
+
secondary: {
|
|
13
|
+
onClick: () => toast.success('@click on secondary btn'),
|
|
14
|
+
children: 'Secondary'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export const mockBannerOnlyPrimaryButton: IBannerProps = {
|
|
19
|
+
headTitle: 'Кредит на любые цели',
|
|
20
|
+
subtitle: 'до 5 млн рублей',
|
|
21
|
+
buttonsConfig: {
|
|
22
|
+
primary: {
|
|
23
|
+
onClick: () => toast.success('@click on primary btn'),
|
|
24
|
+
children: 'Primary'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const mockWithAdvantages: IBannerProps = {
|
|
30
|
+
headTitle: 'Кредит на любые цели',
|
|
31
|
+
subtitle: 'до 5 млн рублей',
|
|
32
|
+
buttonsConfig: {
|
|
33
|
+
primary: {
|
|
34
|
+
onClick: () => toast.success('@click on primary btn'),
|
|
35
|
+
children: 'Primary'
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
advantagesList: [
|
|
39
|
+
{ title: 'До 5 млн ₽', description: 'сумма кредита' },
|
|
40
|
+
{ title: 'До 5 лет', description: 'срок кредита' },
|
|
41
|
+
{ title: 'От 5 минут', description: 'быстрое одобрение' },
|
|
42
|
+
{ title: 'От 20 минут', description: 'сумма одобрения' }
|
|
43
|
+
]
|
|
44
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type TButtonsConfig } from '../Banner'
|
|
2
|
+
import { Button } from '$/shared/ui'
|
|
3
|
+
import { cn } from '$/shared/utils'
|
|
4
|
+
|
|
5
|
+
export interface IBannerButtonsGroupClasses {
|
|
6
|
+
group: string
|
|
7
|
+
primary: string
|
|
8
|
+
secondary: string
|
|
9
|
+
}
|
|
10
|
+
interface IBannerButtonsGroupProps {
|
|
11
|
+
buttonsConfig: TButtonsConfig
|
|
12
|
+
classes?: Partial<IBannerButtonsGroupClasses>
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const BannerButtonsGroup = ({ buttonsConfig, classes }: IBannerButtonsGroupProps) => {
|
|
16
|
+
const withSecondaryBtn = buttonsConfig?.secondary && buttonsConfig.secondary.children
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div className={cn('w-max mobile:absolute bottom-0', { 'flex items-center gap-4': withSecondaryBtn }, classes?.group)}>
|
|
20
|
+
<Button intent='primary' {...buttonsConfig.primary} className={cn(classes?.primary)}>
|
|
21
|
+
{buttonsConfig.primary.children}
|
|
22
|
+
</Button>
|
|
23
|
+
{withSecondaryBtn && (
|
|
24
|
+
<Button intent='secondary' {...buttonsConfig?.secondary} className={cn(classes?.secondary)}>
|
|
25
|
+
{buttonsConfig?.secondary?.children}
|
|
26
|
+
</Button>
|
|
27
|
+
)}
|
|
28
|
+
</div>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { PageHeader, type TPageHeaderProps } from './pageHeader'
|
|
2
|
-
export { Banner } from './banner'
|
|
3
|
-
export { Advantages, type IAdvantage, type IAdvantagesProps } from './Advantages'
|
|
1
|
+
export { PageHeader, type TPageHeaderProps } from './pageHeader'
|
|
2
|
+
export { Banner } from './banner'
|
|
3
|
+
export { Advantages, type IAdvantage, type IAdvantagesProps } from './Advantages'
|