@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
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { useFormContext } from 'react-hook-form'
|
|
2
|
+
import { type Meta, type StoryObj } from '@storybook/react'
|
|
3
|
+
import { mockDefaultValues, mockSchema, StorybookFormProvider } from '@/storybookHelpers'
|
|
4
|
+
import { InputCurrencyControl } from '$/shared/ui'
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'CONTROLLED FORM UI/InputCurrencyControl',
|
|
8
|
+
component: InputCurrencyControl,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered'
|
|
11
|
+
},
|
|
12
|
+
decorators: [
|
|
13
|
+
(Story) => (
|
|
14
|
+
<StorybookFormProvider validationSchema={mockSchema} defaultValues={mockDefaultValues}>
|
|
15
|
+
<Story />
|
|
16
|
+
</StorybookFormProvider>
|
|
17
|
+
)
|
|
18
|
+
],
|
|
19
|
+
render: ({ ...args }) => {
|
|
20
|
+
const { control } = useFormContext()
|
|
21
|
+
const methods = { control }
|
|
22
|
+
return <InputCurrencyControl {...args} {...methods} />
|
|
23
|
+
},
|
|
24
|
+
tags: ['autodocs']
|
|
25
|
+
} satisfies Meta<typeof InputCurrencyControl>
|
|
26
|
+
|
|
27
|
+
export default meta
|
|
28
|
+
type Story = StoryObj<typeof InputCurrencyControl>
|
|
29
|
+
|
|
30
|
+
export const Rubles: Story = {
|
|
31
|
+
args: {
|
|
32
|
+
name: 'currency',
|
|
33
|
+
label: 'Выберите валюту',
|
|
34
|
+
size: 'md',
|
|
35
|
+
defaultCurrency: 'rubles'
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const Dollars: Story = {
|
|
40
|
+
args: {
|
|
41
|
+
name: 'currency',
|
|
42
|
+
label: 'Выберите валюту',
|
|
43
|
+
size: 'md',
|
|
44
|
+
defaultCurrency: 'dollars'
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const Euro: Story = {
|
|
49
|
+
args: {
|
|
50
|
+
name: 'currency',
|
|
51
|
+
label: 'Выберите валюту',
|
|
52
|
+
size: 'md',
|
|
53
|
+
defaultCurrency: 'euro'
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const Dirhams: Story = {
|
|
58
|
+
args: {
|
|
59
|
+
name: 'currency',
|
|
60
|
+
label: 'Выберите валюту',
|
|
61
|
+
size: 'md',
|
|
62
|
+
defaultCurrency: 'dirhams'
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const Yuan: Story = {
|
|
67
|
+
args: {
|
|
68
|
+
name: 'currency',
|
|
69
|
+
label: 'Выберите валюту',
|
|
70
|
+
size: 'md',
|
|
71
|
+
defaultCurrency: 'yuan'
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { useFormContext } from 'react-hook-form'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
3
|
+
import { mockDefaultValues, mockSchema, StorybookFormProvider } from '@/storybookHelpers'
|
|
4
|
+
import { Icon, InputSliderControl } from '$/shared/ui'
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'CONTROLLED FORM UI/InputSliderControl',
|
|
8
|
+
component: InputSliderControl,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered'
|
|
11
|
+
},
|
|
12
|
+
decorators: [
|
|
13
|
+
(Story) => (
|
|
14
|
+
<StorybookFormProvider validationSchema={mockSchema} defaultValues={mockDefaultValues}>
|
|
15
|
+
<Story />
|
|
16
|
+
</StorybookFormProvider>
|
|
17
|
+
)
|
|
18
|
+
],
|
|
19
|
+
render: ({ ...args }) => {
|
|
20
|
+
const { control } = useFormContext()
|
|
21
|
+
const methods = { control }
|
|
22
|
+
return <InputSliderControl {...args} {...methods} />
|
|
23
|
+
},
|
|
24
|
+
tags: ['autodocs']
|
|
25
|
+
} satisfies Meta<typeof InputSliderControl>
|
|
26
|
+
|
|
27
|
+
export default meta
|
|
28
|
+
type Story = StoryObj<typeof InputSliderControl>
|
|
29
|
+
|
|
30
|
+
export const Base: Story = {
|
|
31
|
+
args: {
|
|
32
|
+
name: 'term',
|
|
33
|
+
label: 'Сумма кредита',
|
|
34
|
+
size: 'md',
|
|
35
|
+
min: 30_000,
|
|
36
|
+
max: 5_000_000,
|
|
37
|
+
variant: 'credit'
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const WithYears: Story = {
|
|
42
|
+
args: {
|
|
43
|
+
name: 'term',
|
|
44
|
+
label: 'Срок кредита',
|
|
45
|
+
size: 'md',
|
|
46
|
+
min: 1,
|
|
47
|
+
max: 12,
|
|
48
|
+
variant: 'years'
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const WithIconSlider: Story = {
|
|
53
|
+
args: {
|
|
54
|
+
name: 'term',
|
|
55
|
+
label: 'Город',
|
|
56
|
+
icon: <Icon name='general/edit' className='size-[19px] text-icon-blue-grey-600 focus:text-icon-blue-grey-800' />,
|
|
57
|
+
size: 'md',
|
|
58
|
+
min: 1,
|
|
59
|
+
max: 12,
|
|
60
|
+
variant: 'years'
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { useFormContext } from 'react-hook-form'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
3
|
+
import { MOCK_RADIO_GROUP, mockDefaultValues, mockSchema, StorybookFormProvider } from '@/storybookHelpers'
|
|
4
|
+
import { RadioControl } from '$/shared/ui'
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'CONTROLLED FORM UI/RadioControl',
|
|
8
|
+
component: RadioControl,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered'
|
|
11
|
+
},
|
|
12
|
+
tags: ['autodocs'],
|
|
13
|
+
decorators: [
|
|
14
|
+
(Story) => (
|
|
15
|
+
<StorybookFormProvider validationSchema={mockSchema} defaultValues={mockDefaultValues}>
|
|
16
|
+
<Story />
|
|
17
|
+
</StorybookFormProvider>
|
|
18
|
+
)
|
|
19
|
+
],
|
|
20
|
+
render: ({ ...args }) => {
|
|
21
|
+
const { control } = useFormContext()
|
|
22
|
+
const methods = { control }
|
|
23
|
+
return <RadioControl {...args} {...methods} />
|
|
24
|
+
}
|
|
25
|
+
} satisfies Meta<typeof RadioControl>
|
|
26
|
+
|
|
27
|
+
export default meta
|
|
28
|
+
type Story = StoryObj<typeof RadioControl>
|
|
29
|
+
|
|
30
|
+
export const Base: Story = {
|
|
31
|
+
args: {
|
|
32
|
+
name: 'sex',
|
|
33
|
+
radioItemsGroup: MOCK_RADIO_GROUP
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const WithGroupName: Story = {
|
|
38
|
+
args: {
|
|
39
|
+
name: 'sex',
|
|
40
|
+
groupName: 'Выбери пол:',
|
|
41
|
+
radioItemsGroup: MOCK_RADIO_GROUP
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const WithHelperText: Story = {
|
|
46
|
+
args: {
|
|
47
|
+
name: 'sex',
|
|
48
|
+
helperText: 'Укажите свой пол, как в паспорте ',
|
|
49
|
+
radioItemsGroup: MOCK_RADIO_GROUP
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const WithHorizontalOrientation: Story = {
|
|
54
|
+
args: {
|
|
55
|
+
name: 'sex',
|
|
56
|
+
groupName: 'Выберите пол',
|
|
57
|
+
helperText: 'Укажите свой пол, как в паспорте ',
|
|
58
|
+
orientation: 'horizontal',
|
|
59
|
+
radioItemsGroup: MOCK_RADIO_GROUP
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useFormContext } from 'react-hook-form'
|
|
2
|
+
import { type Meta, type StoryObj } from '@storybook/react'
|
|
3
|
+
import { mockDefaultValues, mockSchema, StorybookFormProvider } from '@/storybookHelpers'
|
|
4
|
+
import { SwitchControl } from '$/shared/ui'
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'CONTROLLED FORM UI/SwitchControl',
|
|
8
|
+
component: SwitchControl,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered'
|
|
11
|
+
},
|
|
12
|
+
tags: ['autodocs'],
|
|
13
|
+
decorators: [
|
|
14
|
+
(Story) => (
|
|
15
|
+
<StorybookFormProvider validationSchema={mockSchema} defaultValues={mockDefaultValues}>
|
|
16
|
+
<Story />
|
|
17
|
+
</StorybookFormProvider>
|
|
18
|
+
)
|
|
19
|
+
],
|
|
20
|
+
render: ({ ...args }) => {
|
|
21
|
+
const { control } = useFormContext()
|
|
22
|
+
const methods = { control }
|
|
23
|
+
return <SwitchControl {...args} {...methods} />
|
|
24
|
+
}
|
|
25
|
+
} satisfies Meta<typeof SwitchControl>
|
|
26
|
+
|
|
27
|
+
export default meta
|
|
28
|
+
type Story = StoryObj<typeof SwitchControl>
|
|
29
|
+
|
|
30
|
+
export const Base: Story = {
|
|
31
|
+
args: {
|
|
32
|
+
name: 'percent',
|
|
33
|
+
label: 'Увеличенный процент'
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const Disabled: Story = {
|
|
38
|
+
args: {
|
|
39
|
+
name: 'percent',
|
|
40
|
+
label: 'Увеличенный процент',
|
|
41
|
+
disabled: true
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const WithHelperText: Story = {
|
|
46
|
+
args: {
|
|
47
|
+
name: 'percent',
|
|
48
|
+
label: 'Увеличенный процент',
|
|
49
|
+
helperText: 'На первые 30 дней'
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { useFormContext } from 'react-hook-form'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
3
|
+
import { mockDefaultValues, mockSchema, StorybookFormProvider } from '@/storybookHelpers'
|
|
4
|
+
import { TextareaControl } from '$/shared/ui'
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'CONTROLLED FORM UI/TextareaControl',
|
|
8
|
+
component: TextareaControl,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered'
|
|
11
|
+
},
|
|
12
|
+
decorators: [
|
|
13
|
+
(Story) => (
|
|
14
|
+
<StorybookFormProvider validationSchema={mockSchema} defaultValues={mockDefaultValues}>
|
|
15
|
+
<Story />
|
|
16
|
+
</StorybookFormProvider>
|
|
17
|
+
)
|
|
18
|
+
],
|
|
19
|
+
render: ({ ...args }) => {
|
|
20
|
+
const { control } = useFormContext()
|
|
21
|
+
const methods = { control }
|
|
22
|
+
return <TextareaControl {...args} {...methods} />
|
|
23
|
+
},
|
|
24
|
+
tags: ['autodocs']
|
|
25
|
+
} satisfies Meta<typeof TextareaControl>
|
|
26
|
+
|
|
27
|
+
export default meta
|
|
28
|
+
type Story = StoryObj<typeof TextareaControl>
|
|
29
|
+
|
|
30
|
+
export const Base: Story = {
|
|
31
|
+
args: {
|
|
32
|
+
name: 'description',
|
|
33
|
+
label: 'Описание к блоку',
|
|
34
|
+
size: 'md'
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const WithPlaceholder: Story = {
|
|
39
|
+
args: {
|
|
40
|
+
name: 'description',
|
|
41
|
+
label: 'Описание к блоку',
|
|
42
|
+
size: 'md',
|
|
43
|
+
placeholder: 'Введите описание'
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const Disabled: Story = {
|
|
48
|
+
args: {
|
|
49
|
+
name: 'description',
|
|
50
|
+
label: 'Описание к блоку',
|
|
51
|
+
size: 'md',
|
|
52
|
+
placeholder: 'Введите описание',
|
|
53
|
+
disabled: true
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { useFormContext } from 'react-hook-form'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
3
|
+
import { mockDefaultValues, mockSchema, StorybookFormProvider } from '@/storybookHelpers'
|
|
4
|
+
import { Icon, InputControlMask } from '$/shared/ui'
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'CONTROLLED FORM UI/InputControlMask',
|
|
8
|
+
component: InputControlMask,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered'
|
|
11
|
+
},
|
|
12
|
+
decorators: [
|
|
13
|
+
(Story) => (
|
|
14
|
+
<StorybookFormProvider validationSchema={mockSchema} defaultValues={mockDefaultValues}>
|
|
15
|
+
<Story />
|
|
16
|
+
</StorybookFormProvider>
|
|
17
|
+
)
|
|
18
|
+
],
|
|
19
|
+
render: ({ ...args }) => {
|
|
20
|
+
const { control } = useFormContext()
|
|
21
|
+
const methods = { control }
|
|
22
|
+
return <InputControlMask {...args} {...methods} />
|
|
23
|
+
},
|
|
24
|
+
tags: ['autodocs']
|
|
25
|
+
} satisfies Meta<typeof InputControlMask>
|
|
26
|
+
|
|
27
|
+
export default meta
|
|
28
|
+
type Story = StoryObj<typeof InputControlMask>
|
|
29
|
+
|
|
30
|
+
export const Base: Story = {
|
|
31
|
+
args: {
|
|
32
|
+
name: 'phone',
|
|
33
|
+
label: 'Номер телефона',
|
|
34
|
+
size: 'md',
|
|
35
|
+
format: '# (###) ###-##-##'
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const WithIcon: Story = {
|
|
40
|
+
args: {
|
|
41
|
+
name: 'phone',
|
|
42
|
+
label: 'Номер телефона',
|
|
43
|
+
format: '# (###) ###-##-##',
|
|
44
|
+
size: 'md',
|
|
45
|
+
icon: <Icon name='general/check' className='text-icon-positive-default' />
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const WithBadge: Story = {
|
|
50
|
+
args: {
|
|
51
|
+
name: 'phone',
|
|
52
|
+
label: 'Номер телефона',
|
|
53
|
+
format: '# (###) ###-##-##',
|
|
54
|
+
size: 'md',
|
|
55
|
+
badge: '+25%'
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const WithHelperText: Story = {
|
|
60
|
+
args: {
|
|
61
|
+
name: 'phone',
|
|
62
|
+
label: 'Номер телефона',
|
|
63
|
+
size: 'md',
|
|
64
|
+
format: '# (###) ###-##-##',
|
|
65
|
+
helperText: 'Введите номер телефона'
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react'
|
|
2
|
+
import { Advantages, type IAdvantage } from '$/widgets/Advantages'
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'WIDGETS/Advantages',
|
|
6
|
+
component: Advantages,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'centered'
|
|
10
|
+
},
|
|
11
|
+
decorators: [
|
|
12
|
+
(Story) => (
|
|
13
|
+
<div className='flex min-h-screen min-w-full items-center justify-center bg-color-blue-grey-300 px-6'>
|
|
14
|
+
<Story />
|
|
15
|
+
</div>
|
|
16
|
+
)
|
|
17
|
+
]
|
|
18
|
+
} satisfies Meta<typeof Advantages>
|
|
19
|
+
|
|
20
|
+
export default meta
|
|
21
|
+
|
|
22
|
+
type Story = StoryObj<typeof meta>
|
|
23
|
+
|
|
24
|
+
const mockThreeCards: IAdvantage[] = [
|
|
25
|
+
{ title: 'До 5 млн ₽', description: 'сумма кредита' },
|
|
26
|
+
{ title: 'До 5 лет', description: 'срок кредита' },
|
|
27
|
+
{ title: 'От 5 минут', description: 'быстрое одобрение' }
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
const mockFourCards: IAdvantage[] = [...mockThreeCards, { title: 'От 15 минут', description: 'сумма одобрение' }]
|
|
31
|
+
|
|
32
|
+
export const ThreeCards: Story = {
|
|
33
|
+
args: {
|
|
34
|
+
advantagesList: mockThreeCards
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const FourCards: Story = {
|
|
39
|
+
args: {
|
|
40
|
+
advantagesList: mockFourCards
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { Banner, PageHeader } from '$/widgets'
|
|
3
|
+
import {
|
|
4
|
+
mockBannerBase,
|
|
5
|
+
mockBannerBaseFullImage,
|
|
6
|
+
mockBannerBaseGradient,
|
|
7
|
+
mockBannerBaseGradientAdvantages,
|
|
8
|
+
mockBannerFullImageOnlyPrimaryButton,
|
|
9
|
+
mockBannerFullImageWithAdvantages,
|
|
10
|
+
mockBannerOnlyPrimaryButton,
|
|
11
|
+
mockWithAdvantages
|
|
12
|
+
} from '$/widgets/banner/model/helpers'
|
|
13
|
+
// test commit
|
|
14
|
+
const meta = {
|
|
15
|
+
title: 'WIDGETS/Banner',
|
|
16
|
+
component: Banner,
|
|
17
|
+
tags: ['autodocs']
|
|
18
|
+
} satisfies Meta<typeof Banner>
|
|
19
|
+
|
|
20
|
+
export default meta
|
|
21
|
+
|
|
22
|
+
type Story = StoryObj<typeof Banner>
|
|
23
|
+
|
|
24
|
+
export const Base: Story = {
|
|
25
|
+
render: () => (
|
|
26
|
+
<>
|
|
27
|
+
<PageHeader variant='withButton' />
|
|
28
|
+
<Banner {...mockBannerBase} />
|
|
29
|
+
</>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const OnlyPrimaryButton: Story = {
|
|
34
|
+
render: () => (
|
|
35
|
+
<>
|
|
36
|
+
<PageHeader variant='withButton' />
|
|
37
|
+
<Banner {...mockBannerOnlyPrimaryButton} />
|
|
38
|
+
</>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const WithAdvantages: Story = {
|
|
43
|
+
render: () => (
|
|
44
|
+
<>
|
|
45
|
+
<PageHeader variant='withButton' />
|
|
46
|
+
<Banner {...mockWithAdvantages} />
|
|
47
|
+
</>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const BaseFullImage: Story = {
|
|
52
|
+
render: () => (
|
|
53
|
+
<>
|
|
54
|
+
<PageHeader variant='withButton' />
|
|
55
|
+
<Banner {...mockBannerBaseFullImage} />
|
|
56
|
+
</>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export const FullImageOnlyPrimaryButton: Story = {
|
|
61
|
+
render: () => (
|
|
62
|
+
<>
|
|
63
|
+
<PageHeader variant='withButton' />
|
|
64
|
+
<Banner {...mockBannerFullImageOnlyPrimaryButton} />
|
|
65
|
+
</>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export const BaseFullImageWithAdvantages: Story = {
|
|
70
|
+
render: () => (
|
|
71
|
+
<>
|
|
72
|
+
<PageHeader variant='withButton' />
|
|
73
|
+
<Banner {...mockBannerFullImageWithAdvantages} />
|
|
74
|
+
</>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const BaseGradient: Story = {
|
|
79
|
+
render: () => (
|
|
80
|
+
<>
|
|
81
|
+
<PageHeader variant='withButton' />
|
|
82
|
+
<Banner {...mockBannerBaseGradient} />
|
|
83
|
+
</>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export const BaseGradientWithAdvantages: Story = {
|
|
88
|
+
render: () => (
|
|
89
|
+
<>
|
|
90
|
+
<PageHeader variant='withButton' />
|
|
91
|
+
<Banner {...mockBannerBaseGradientAdvantages} />
|
|
92
|
+
</>
|
|
93
|
+
)
|
|
94
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react'
|
|
2
|
+
import { Footer } from '$/widgets'
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'WIDGETS/Footer',
|
|
6
|
+
component: Footer,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
decorators: [(Story) => <div className='flex min-h-screen min-w-full items-center justify-center'>{Story()}</div>]
|
|
9
|
+
} satisfies Meta<typeof Footer>
|
|
10
|
+
|
|
11
|
+
export default meta
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof Footer>
|
|
14
|
+
|
|
15
|
+
export const Base: Story = {
|
|
16
|
+
args: {
|
|
17
|
+
withLigal: false,
|
|
18
|
+
withNavLinks: false,
|
|
19
|
+
withPhones: false,
|
|
20
|
+
withSiteMap: false
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const BaseWithLigal: Story = {
|
|
25
|
+
args: {
|
|
26
|
+
withNavLinks: false,
|
|
27
|
+
withPhones: false,
|
|
28
|
+
withSiteMap: false
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const Seo: Story = {
|
|
33
|
+
args: {
|
|
34
|
+
withLigal: false
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { PageHeader } from '$/widgets'
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'WIDGETS/PageHeader',
|
|
6
|
+
component: PageHeader,
|
|
7
|
+
tags: ['autodocs']
|
|
8
|
+
} satisfies Meta<typeof PageHeader>
|
|
9
|
+
|
|
10
|
+
export default meta
|
|
11
|
+
|
|
12
|
+
type Story = StoryObj<typeof meta>
|
|
13
|
+
|
|
14
|
+
export const WithPhone: Story = {
|
|
15
|
+
args: {
|
|
16
|
+
variant: 'withPhone',
|
|
17
|
+
phone: '8 800 000-00-00',
|
|
18
|
+
phoneText: 'Бесплатно по России'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const WithButton: Story = {
|
|
23
|
+
args: {
|
|
24
|
+
variant: 'withButton'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const WithOtherLogo: Story = {
|
|
29
|
+
args: {
|
|
30
|
+
variant: 'withButton',
|
|
31
|
+
logoType: 'business'
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react'
|
|
2
|
+
import { Stepper } from '$/widgets'
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'WIDGETS/Stepper',
|
|
6
|
+
component: Stepper,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
decorators: [(Story) => <div className='flex min-h-screen min-w-full items-center justify-center'>{Story()}</div>]
|
|
9
|
+
} satisfies Meta<typeof Stepper>
|
|
10
|
+
|
|
11
|
+
export default meta
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof Stepper>
|
|
14
|
+
|
|
15
|
+
export const Base: Story = {
|
|
16
|
+
args: {
|
|
17
|
+
heading: 'Как получить кредит',
|
|
18
|
+
stepsList: [
|
|
19
|
+
{ title: 'Заполните онлайн-заявку', description: 'Это займет несколько минут' },
|
|
20
|
+
{ title: 'Дождитесь одобрения', description: 'Рассмотрим заявку за 5 минут' },
|
|
21
|
+
{ title: 'Заберите деньги', description: 'Или закажите бесплатную доставку' }
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type IRadioGroupOption } from '$/shared/ui'
|
|
2
|
+
|
|
3
|
+
export const MOCK_RADIO_GROUP: IRadioGroupOption[] = [
|
|
4
|
+
{ label: 'Мужской', value: 'male' },
|
|
5
|
+
{ label: 'Женский', value: 'female' }
|
|
6
|
+
]
|
|
7
|
+
|
|
8
|
+
export const MOCK_SELECT_OPTIONS_REACT_SELECT = [
|
|
9
|
+
{ label: 'Кредит наличными', value: 'cash-credit' },
|
|
10
|
+
{ label: 'Автокредит', value: 'avto-credit' },
|
|
11
|
+
{ label: 'Депозит', value: 'depozit' },
|
|
12
|
+
{ label: 'Кредит на недвижимость', value: 'realty-credit' },
|
|
13
|
+
{ label: 'Кредит на обучение', value: 'education-credit' },
|
|
14
|
+
{ label: 'Кредит на бизнес', value: 'business-credit' },
|
|
15
|
+
{ label: 'Кредит на автомобиль', value: 'car-credit' },
|
|
16
|
+
{ label: 'Кредит на путешествие', value: 'travel-credit' },
|
|
17
|
+
{ label: 'Кредит на покупку земли', value: 'land-credit' },
|
|
18
|
+
{ label: 'Кредит на покупку квартиры', value: 'flat-credit' }
|
|
19
|
+
]
|