@scbt-ecom/ui 0.4.0 → 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/.env
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
name: publish-to-github-pages
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- master
|
|
6
|
+
|
|
7
|
+
concurrency:
|
|
8
|
+
group: 'pages'
|
|
9
|
+
cancel-in-progress: false
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
permissions:
|
|
15
|
+
contents: write # to be able to publish a GitHub release
|
|
16
|
+
issues: write # to be able to comment on released issues
|
|
17
|
+
pull-requests: write # to be able to comment on released pull requests
|
|
18
|
+
id-token: write # to enable use of OIDC for npm provenance
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout 🛎️
|
|
21
|
+
uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- name: Setup Node.js ⚙️ - Cache dependencies ⚡ - Install dependencies 🔧
|
|
24
|
+
uses: ./.github/workflows/setup-node
|
|
25
|
+
|
|
26
|
+
- name: Lint Code
|
|
27
|
+
run: npm run lint
|
|
28
|
+
|
|
29
|
+
- name: Setup Pages ⚙️
|
|
30
|
+
uses: actions/configure-pages@v4
|
|
31
|
+
|
|
32
|
+
- name: Build 🏗️
|
|
33
|
+
run: npm run build-storybook
|
|
34
|
+
|
|
35
|
+
- name: Upload artifact 📡
|
|
36
|
+
uses: actions/upload-pages-artifact@v3
|
|
37
|
+
with:
|
|
38
|
+
path: ./storybook-static
|
|
39
|
+
|
|
40
|
+
- name: Publish with Semantic Release 🚀
|
|
41
|
+
env:
|
|
42
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
43
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
44
|
+
run: npx semantic-release
|
|
45
|
+
|
|
46
|
+
deploy:
|
|
47
|
+
permissions:
|
|
48
|
+
contents: read
|
|
49
|
+
pages: write
|
|
50
|
+
id-token: write
|
|
51
|
+
environment:
|
|
52
|
+
name: github-pages
|
|
53
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
54
|
+
|
|
55
|
+
runs-on: ubuntu-latest
|
|
56
|
+
needs: build
|
|
57
|
+
|
|
58
|
+
steps:
|
|
59
|
+
- name: Publish to GitHub Pages 🚀
|
|
60
|
+
id: deployment
|
|
61
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: setup-node
|
|
2
|
+
description: 'Setup Node.js ⚙️ - Cache dependencies ⚡ - Install dependencies 🔧'
|
|
3
|
+
runs:
|
|
4
|
+
using: 'composite'
|
|
5
|
+
steps:
|
|
6
|
+
- name: Setup Node.js ⚙️
|
|
7
|
+
uses: actions/setup-node@v4
|
|
8
|
+
with:
|
|
9
|
+
node-version: 20
|
|
10
|
+
registry-url: 'https://registry.npmjs.org'
|
|
11
|
+
|
|
12
|
+
- name: Cache dependencies ⚡
|
|
13
|
+
id: cache_dependencies
|
|
14
|
+
uses: actions/cache@v4
|
|
15
|
+
with:
|
|
16
|
+
path: node_modules
|
|
17
|
+
key: node-modules-${{ hashFiles('package-lock.json') }}
|
|
18
|
+
|
|
19
|
+
- name: Install dependencies 🔧
|
|
20
|
+
shell: bash
|
|
21
|
+
if: steps.cache_dependencies.outputs.cache-hit != 'true'
|
|
22
|
+
run: npm install --package-lock=false
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
npm run pre-deploy
|
package/.prettierignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.github
|
package/.prettierrc
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"arrowParens": "always",
|
|
3
|
+
"bracketSpacing": true,
|
|
4
|
+
"embeddedLanguageFormatting": "auto",
|
|
5
|
+
"htmlWhitespaceSensitivity": "css",
|
|
6
|
+
"jsxBracketSameLine": false,
|
|
7
|
+
"jsxSingleQuote": true,
|
|
8
|
+
"proseWrap": "preserve",
|
|
9
|
+
"quoteProps": "as-needed",
|
|
10
|
+
"requirePragma": false,
|
|
11
|
+
"singleQuote": true,
|
|
12
|
+
"trailingComma": "none",
|
|
13
|
+
"vueIndentScriptAndStyle": false,
|
|
14
|
+
"printWidth": 130,
|
|
15
|
+
"tabWidth": 2,
|
|
16
|
+
"rangeStart": 0,
|
|
17
|
+
"endOfLine": "auto",
|
|
18
|
+
"semi": false,
|
|
19
|
+
"plugins": ["prettier-plugin-tailwindcss"]
|
|
20
|
+
}
|
package/.releaserc
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"repositoryUrl": "https://github.com/scbt-ecom/ui.git",
|
|
3
|
+
"branches": [
|
|
4
|
+
"master"
|
|
5
|
+
],
|
|
6
|
+
"plugins": [
|
|
7
|
+
"@semantic-release/commit-analyzer",
|
|
8
|
+
"@semantic-release/release-notes-generator",
|
|
9
|
+
"@semantic-release/npm",
|
|
10
|
+
[
|
|
11
|
+
"@semantic-release/github",
|
|
12
|
+
{
|
|
13
|
+
"successComment": false,
|
|
14
|
+
"failCommentCondition": false
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { StorybookConfig } from '@storybook/react-vite'
|
|
2
|
+
import { mergeConfig } from 'vite'
|
|
3
|
+
import { resolve } from 'path'
|
|
4
|
+
|
|
5
|
+
const config: StorybookConfig = {
|
|
6
|
+
stories: ['../src/**/*.stories.@(js|jsx|mjs|ts|tsx|mdx)'],
|
|
7
|
+
|
|
8
|
+
addons: [
|
|
9
|
+
'@storybook/addon-onboarding',
|
|
10
|
+
'@storybook/addon-links',
|
|
11
|
+
'@storybook/addon-essentials',
|
|
12
|
+
'@chromatic-com/storybook',
|
|
13
|
+
'@storybook/addon-interactions',
|
|
14
|
+
'@storybook/addon-coverage',
|
|
15
|
+
'@storybook/addon-console',
|
|
16
|
+
'@storybook/addon-viewport'
|
|
17
|
+
],
|
|
18
|
+
core: {
|
|
19
|
+
builder: '@storybook/builder-vite'
|
|
20
|
+
},
|
|
21
|
+
framework: {
|
|
22
|
+
name: '@storybook/react-vite',
|
|
23
|
+
options: {
|
|
24
|
+
strictMode: true
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
// staticDirs: ['../public'],
|
|
28
|
+
docs: {
|
|
29
|
+
autodocs: 'tag'
|
|
30
|
+
},
|
|
31
|
+
viteFinal: (config) =>
|
|
32
|
+
mergeConfig(config, {
|
|
33
|
+
resolve: {
|
|
34
|
+
alias: {
|
|
35
|
+
'@': resolve(__dirname, '../src'),
|
|
36
|
+
$: resolve(__dirname, '../lib')
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}),
|
|
40
|
+
typescript: {
|
|
41
|
+
reactDocgen: 'react-docgen-typescript'
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export default config
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { RootProvider } from '../src/app/providers'
|
|
2
|
+
import '../lib/shared/style.css'
|
|
3
|
+
import { STORYBOOK_VIEWPORTS } from '../src/configs/storybook.config'
|
|
4
|
+
import type { Preview } from '@storybook/react'
|
|
5
|
+
import { withConsole } from '@storybook/addon-console'
|
|
6
|
+
import React from 'react'
|
|
7
|
+
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport'
|
|
8
|
+
|
|
9
|
+
const preview: Preview = {
|
|
10
|
+
decorators: [
|
|
11
|
+
(storyFn, context) => withConsole()(storyFn)(context),
|
|
12
|
+
(Story) => (
|
|
13
|
+
<RootProvider>
|
|
14
|
+
<Story />
|
|
15
|
+
</RootProvider>
|
|
16
|
+
)
|
|
17
|
+
],
|
|
18
|
+
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: 'fullscreen',
|
|
21
|
+
viewport: {
|
|
22
|
+
viewports: {
|
|
23
|
+
...STORYBOOK_VIEWPORTS,
|
|
24
|
+
...INITIAL_VIEWPORTS
|
|
25
|
+
},
|
|
26
|
+
defaultViewport: 'fullscreen'
|
|
27
|
+
},
|
|
28
|
+
controls: {
|
|
29
|
+
matchers: {
|
|
30
|
+
color: /(background|color)$/i,
|
|
31
|
+
date: /Date$/i
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default preview
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import eslintReact from 'eslint-plugin-react'
|
|
2
|
+
import simpleImportSort from 'eslint-plugin-simple-import-sort'
|
|
3
|
+
import jsxA11Y from 'eslint-plugin-jsx-a11y'
|
|
4
|
+
import unusedImports from 'eslint-plugin-unused-imports'
|
|
5
|
+
import promise from 'eslint-plugin-promise'
|
|
6
|
+
import prettier from 'eslint-plugin-prettier'
|
|
7
|
+
import globals from 'globals'
|
|
8
|
+
import tsParser from '@typescript-eslint/parser'
|
|
9
|
+
import js from '@eslint/js'
|
|
10
|
+
import tseslint from 'typescript-eslint'
|
|
11
|
+
import eslintReactHooks from 'eslint-plugin-react-hooks'
|
|
12
|
+
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
13
|
+
import importPlugin from 'eslint-plugin-import'
|
|
14
|
+
import storybook from 'eslint-plugin-storybook'
|
|
15
|
+
|
|
16
|
+
/** @type {import('eslint').Linter.Config[]} */
|
|
17
|
+
export default tseslint.config(
|
|
18
|
+
js.configs.recommended,
|
|
19
|
+
...tseslint.configs.recommended,
|
|
20
|
+
...storybook.configs['flat/recommended'],
|
|
21
|
+
{
|
|
22
|
+
ignores: [
|
|
23
|
+
'node_modules',
|
|
24
|
+
'**/dist',
|
|
25
|
+
'**/eslint.config.mjs',
|
|
26
|
+
'**/vite.config.ts',
|
|
27
|
+
'**/vitest.config.mjs',
|
|
28
|
+
'**/tailwind.config.ts',
|
|
29
|
+
'**/postcss.config.mjs',
|
|
30
|
+
'**/storybook-static',
|
|
31
|
+
'lib/hybrid.ts',
|
|
32
|
+
'.storybook'
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
plugins: {
|
|
37
|
+
react: eslintReact,
|
|
38
|
+
'react-refresh': reactRefresh,
|
|
39
|
+
'react-hooks': eslintReactHooks,
|
|
40
|
+
'react-refresh': reactRefresh,
|
|
41
|
+
'unused-imports': unusedImports,
|
|
42
|
+
'simple-import-sort': simpleImportSort,
|
|
43
|
+
import: importPlugin,
|
|
44
|
+
'@typescript-eslint': tseslint.plugin,
|
|
45
|
+
prettier: prettier,
|
|
46
|
+
promise: promise,
|
|
47
|
+
'jsx-a11y': jsxA11Y
|
|
48
|
+
},
|
|
49
|
+
files: ['**/*.{ts,tsx,js,jsx,mjs,cjs}'],
|
|
50
|
+
languageOptions: {
|
|
51
|
+
globals: {
|
|
52
|
+
...globals.browser,
|
|
53
|
+
...globals.node,
|
|
54
|
+
...globals.es2022
|
|
55
|
+
},
|
|
56
|
+
parserOptions: {
|
|
57
|
+
project: ['./tsconfig.json', './tsconfig.node.json']
|
|
58
|
+
},
|
|
59
|
+
parser: tsParser,
|
|
60
|
+
ecmaVersion: 2022,
|
|
61
|
+
sourceType: 'module'
|
|
62
|
+
},
|
|
63
|
+
settings: {
|
|
64
|
+
'jsx-a11y': {
|
|
65
|
+
polymorphicPropName: 'component'
|
|
66
|
+
},
|
|
67
|
+
react: {
|
|
68
|
+
version: 'detect'
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
rules: {
|
|
72
|
+
...eslintReactHooks.configs.recommended.rules,
|
|
73
|
+
...eslintReact.configs.recommended.rules,
|
|
74
|
+
'react/react-in-jsx-scope': 'off',
|
|
75
|
+
'react/display-name': 'off',
|
|
76
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
77
|
+
'@typescript-eslint/no-empty-object-type': 'off',
|
|
78
|
+
'promise/prefer-await-to-then': 'error',
|
|
79
|
+
'react/self-closing-comp': 'off',
|
|
80
|
+
'react/jsx-closing-tag-location': 'off',
|
|
81
|
+
'import/prefer-default-export': 'off',
|
|
82
|
+
'react/function-component-definition': 'off',
|
|
83
|
+
'arrow-body-style': 'off',
|
|
84
|
+
'react/destructuring-assignment': 'off',
|
|
85
|
+
'operator-linebreak': 'off',
|
|
86
|
+
'jsx-a11y/no-static-element-interactions': 'off',
|
|
87
|
+
'jsx-a11y/click-events-have-key-events': 'off',
|
|
88
|
+
'react/jsx-curly-newline': 'off',
|
|
89
|
+
'jsx-a11y/control-has-associated-label': 'off',
|
|
90
|
+
'import/no-extraneous-dependencies': 'off',
|
|
91
|
+
'react/require-default-props': 'off',
|
|
92
|
+
'react/jsx-props-no-spreading': 'off',
|
|
93
|
+
'react/button-has-type': 'off',
|
|
94
|
+
'@typescript-eslint/semi': 'off',
|
|
95
|
+
'linebreak-style': 'off',
|
|
96
|
+
'function-paren-newline': 'off',
|
|
97
|
+
'object-curly-newline': 'off',
|
|
98
|
+
'prefer-arrow-callback': 'off',
|
|
99
|
+
'no-case-declarations': 'off',
|
|
100
|
+
'@typescript-eslint/comma-dangle': 'off',
|
|
101
|
+
'import/no-default-export': 'error',
|
|
102
|
+
'max-len': 'off',
|
|
103
|
+
'jsx-quotes': [2, 'prefer-single'],
|
|
104
|
+
'import/extensions': 'off',
|
|
105
|
+
'consistent-return': 'off',
|
|
106
|
+
'react/jsx-no-useless-fragment': 'off',
|
|
107
|
+
'implicit-arrow-linebreak': 'off',
|
|
108
|
+
'react/jsx-one-expression-per-line': 'off',
|
|
109
|
+
'unused-imports/no-unused-imports': 'error',
|
|
110
|
+
'@typescript-eslint/indent': 'off',
|
|
111
|
+
'react/jsx-curly-brace-presence': [
|
|
112
|
+
'error',
|
|
113
|
+
{
|
|
114
|
+
props: 'never',
|
|
115
|
+
children: 'never'
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
'no-console': [
|
|
119
|
+
'error',
|
|
120
|
+
{
|
|
121
|
+
allow: ['warn', 'error']
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
'@typescript-eslint/consistent-type-exports': [
|
|
125
|
+
'error',
|
|
126
|
+
{
|
|
127
|
+
fixMixedExportsWithInlineTypeSpecifier: true
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
'@typescript-eslint/consistent-type-imports': [
|
|
131
|
+
'error',
|
|
132
|
+
{
|
|
133
|
+
prefer: 'type-imports',
|
|
134
|
+
disallowTypeAnnotations: false,
|
|
135
|
+
fixStyle: 'inline-type-imports'
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
'unused-imports/no-unused-vars': [
|
|
139
|
+
'error',
|
|
140
|
+
{
|
|
141
|
+
vars: 'all',
|
|
142
|
+
varsIgnorePattern: '^_',
|
|
143
|
+
args: 'after-used',
|
|
144
|
+
argsIgnorePattern: '^_'
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
'simple-import-sort/imports': [
|
|
148
|
+
'error',
|
|
149
|
+
{
|
|
150
|
+
groups: [['^react', '^', '^\u0000', '^@/app', '^@/widgets', '^$/shared', '^../', '^./']]
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
'react-refresh/only-export-components': [
|
|
154
|
+
'warn',
|
|
155
|
+
{
|
|
156
|
+
allowConstantExport: true
|
|
157
|
+
}
|
|
158
|
+
],
|
|
159
|
+
'prettier/prettier': [
|
|
160
|
+
'error',
|
|
161
|
+
{
|
|
162
|
+
endOfLine: 'auto',
|
|
163
|
+
usePrettierrc: true
|
|
164
|
+
}
|
|
165
|
+
],
|
|
166
|
+
'@typescript-eslint/naming-convention': [
|
|
167
|
+
'error',
|
|
168
|
+
{
|
|
169
|
+
selector: 'typeLike',
|
|
170
|
+
format: ['PascalCase']
|
|
171
|
+
}
|
|
172
|
+
],
|
|
173
|
+
'no-restricted-imports': [
|
|
174
|
+
'error',
|
|
175
|
+
{
|
|
176
|
+
paths: [
|
|
177
|
+
{
|
|
178
|
+
name: '$/hybrid',
|
|
179
|
+
message: 'Импорт из $/hybrid запрещен.'
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
files: ['**/*.stories.@(ts|tsx)'],
|
|
188
|
+
rules: {
|
|
189
|
+
'import/no-default-export': 'off',
|
|
190
|
+
'react-hooks/rules-of-hooks': 'off'
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
)
|
package/index.html
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>UI-KIT</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
package/lib/client.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Styles
|
|
2
|
+
import './shared/style.css'
|
|
3
|
+
// Components
|
|
4
|
+
export * from './shared/ui/accordion'
|
|
5
|
+
export * from './shared/ui/formControlElements'
|
|
6
|
+
export * from './shared/ui/TabsSwitcher'
|
|
7
|
+
export * from './shared/ui/modal'
|
|
8
|
+
export * from './shared/ui/providers'
|
|
9
|
+
export * from './shared/ui/popover'
|
|
10
|
+
|
|
11
|
+
// Hooks
|
|
12
|
+
export * from './shared/hooks'
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { Config } from 'tailwindcss'
|
|
2
|
+
import plugin from 'tailwindcss/plugin'
|
|
3
|
+
import tailwindAnimation from 'tailwindcss-animate'
|
|
4
|
+
import {
|
|
5
|
+
allowedBackgroundColors,
|
|
6
|
+
allowedBackgroundDeg,
|
|
7
|
+
allowedBannersBackgroundColors,
|
|
8
|
+
allowedBorderRadius,
|
|
9
|
+
allowedFontSize,
|
|
10
|
+
allowedIconsColors,
|
|
11
|
+
allowedLineHeight,
|
|
12
|
+
allowedStrokeColors,
|
|
13
|
+
allowedTextColors,
|
|
14
|
+
allowedTextStyles
|
|
15
|
+
} from '../shared/constants'
|
|
16
|
+
|
|
17
|
+
export const tailwindConfigBase: Omit<Config, 'content'> = {
|
|
18
|
+
theme: {
|
|
19
|
+
screens: {
|
|
20
|
+
mobile: { max: '1187px' },
|
|
21
|
+
desktop: '1188px'
|
|
22
|
+
},
|
|
23
|
+
backgroundColor: {
|
|
24
|
+
color: allowedBackgroundColors,
|
|
25
|
+
banner: allowedBannersBackgroundColors,
|
|
26
|
+
icon: allowedIconsColors
|
|
27
|
+
},
|
|
28
|
+
textColor: {
|
|
29
|
+
icon: allowedIconsColors,
|
|
30
|
+
color: allowedTextColors
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
fill: allowedIconsColors,
|
|
34
|
+
stroke: allowedIconsColors,
|
|
35
|
+
borderColor: allowedStrokeColors,
|
|
36
|
+
outlineColor: allowedStrokeColors,
|
|
37
|
+
borderRadius: allowedBorderRadius,
|
|
38
|
+
fontFamily: { roboto: ['var(--ff-roboto)', 'sans-serif'] },
|
|
39
|
+
fontSize: allowedFontSize,
|
|
40
|
+
lineHeight: allowedLineHeight,
|
|
41
|
+
gradientColorStops: allowedBackgroundColors,
|
|
42
|
+
boxShadow: {
|
|
43
|
+
sm: '0 8px 20px 0 rgba(0, 0, 0, 0.08)',
|
|
44
|
+
md: '0 12px 20px 0 rgba(0, 33, 87, 0.10)',
|
|
45
|
+
lg: '0 16px 24px 0 rgba(0, 33, 87, 0.16)'
|
|
46
|
+
},
|
|
47
|
+
extend: {
|
|
48
|
+
bgGradientDeg: allowedBackgroundDeg,
|
|
49
|
+
width: {
|
|
50
|
+
'popper-content': 'var(--radix-popover-content-available-width)',
|
|
51
|
+
'popper-trigger': 'var(--radix-popover-trigger-width)',
|
|
52
|
+
'autocomplete-input': 'var(--input-width)',
|
|
53
|
+
'select-trigger': 'var(--button-width)'
|
|
54
|
+
},
|
|
55
|
+
transitionDuration: {
|
|
56
|
+
DEFAULT: '0.3s',
|
|
57
|
+
12: '0.12s',
|
|
58
|
+
15: '0.15s',
|
|
59
|
+
2: '2s'
|
|
60
|
+
},
|
|
61
|
+
transitionTimingFunction: {
|
|
62
|
+
DEFAULT: 'ease-in-out'
|
|
63
|
+
},
|
|
64
|
+
keyframes: {
|
|
65
|
+
slideDown: {
|
|
66
|
+
from: { height: '0px' },
|
|
67
|
+
to: { height: 'var(--radix-accordion-content-height)' }
|
|
68
|
+
},
|
|
69
|
+
slideUp: {
|
|
70
|
+
from: { height: 'var(--radix-accordion-content-height)' },
|
|
71
|
+
to: { height: '0px' }
|
|
72
|
+
},
|
|
73
|
+
'scale-in': {
|
|
74
|
+
from: { opacity: '0', scale: '0' },
|
|
75
|
+
to: { opacity: '1', scale: '1' }
|
|
76
|
+
},
|
|
77
|
+
'progress-loader': {
|
|
78
|
+
'100%': {
|
|
79
|
+
backgroundPosition: '100% 100%'
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
animation: {
|
|
84
|
+
slideDown: 'slideDown 0.3s cubic-bezier(0.87, 0, 0.13, 1)',
|
|
85
|
+
slideUp: 'slideUp 0.3s cubic-bezier(0.87, 0, 0.13, 1)',
|
|
86
|
+
'scale-in': 'scale-in 0.3s ease-in-out',
|
|
87
|
+
'progress-loader': 'progress-loader 250s linear infinite'
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
plugins: [
|
|
92
|
+
// eslint-disable-next-line global-require
|
|
93
|
+
tailwindAnimation,
|
|
94
|
+
plugin(({ addComponents }) => {
|
|
95
|
+
addComponents(allowedTextStyles)
|
|
96
|
+
}),
|
|
97
|
+
plugin(function ({ matchUtilities, theme }) {
|
|
98
|
+
matchUtilities(
|
|
99
|
+
{
|
|
100
|
+
'bg-deg-gradient': (angle) => ({
|
|
101
|
+
'background-image': `linear-gradient(${angle}, var(--tw-gradient-stops))`
|
|
102
|
+
})
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
values: Object.assign(theme('bgGradientDeg', {}), {})
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
})
|
|
109
|
+
]
|
|
110
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Config } from 'tailwindcss'
|
|
2
|
+
|
|
3
|
+
export const extendsPreset: Omit<Config, 'content'> = {
|
|
4
|
+
theme: {
|
|
5
|
+
extend: {
|
|
6
|
+
transitionDuration: {
|
|
7
|
+
DEFAULT: '0.3s',
|
|
8
|
+
12: '0.12s',
|
|
9
|
+
15: '0.15s',
|
|
10
|
+
2: '2s',
|
|
11
|
+
333: '333s'
|
|
12
|
+
},
|
|
13
|
+
transitionTimingFunction: {
|
|
14
|
+
DEFAULT: 'ease-in-out'
|
|
15
|
+
},
|
|
16
|
+
keyframes: {
|
|
17
|
+
slideDown: {
|
|
18
|
+
from: { height: '0px' },
|
|
19
|
+
to: { height: 'var(--radix-accordion-content-height)' }
|
|
20
|
+
},
|
|
21
|
+
slideUp: {
|
|
22
|
+
from: { height: 'var(--radix-accordion-content-height)' },
|
|
23
|
+
to: { height: '0px' }
|
|
24
|
+
},
|
|
25
|
+
'scale-in': {
|
|
26
|
+
from: { opacity: '0', scale: '0' },
|
|
27
|
+
to: { opacity: '1', scale: '1' }
|
|
28
|
+
},
|
|
29
|
+
'progress-loader': {
|
|
30
|
+
'100%': {
|
|
31
|
+
backgroundPosition: '100% 100%'
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
animation: {
|
|
36
|
+
slideDown: 'slideDown 0.3s cubic-bezier(0.87, 0, 0.13, 1)',
|
|
37
|
+
slideUp: 'slideUp 0.3s cubic-bezier(0.87, 0, 0.13, 1)',
|
|
38
|
+
'scale-in': 'scale-in 0.3s ease-in-out',
|
|
39
|
+
'progress-loader': 'progress-loader 250s linear infinite'
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Тут через алиасы не импортируй, иначе не будет работать
|
|
2
|
+
import type { Config } from 'tailwindcss'
|
|
3
|
+
import plugin from 'tailwindcss/plugin'
|
|
4
|
+
import tailwindAnimation from 'tailwindcss-animate'
|
|
5
|
+
import {
|
|
6
|
+
allowedBackgroundColors,
|
|
7
|
+
allowedBackgroundDeg,
|
|
8
|
+
allowedBannersBackgroundColors,
|
|
9
|
+
allowedBorderRadius,
|
|
10
|
+
allowedFontSize,
|
|
11
|
+
allowedIconsColors,
|
|
12
|
+
allowedLineHeight,
|
|
13
|
+
allowedStrokeColors,
|
|
14
|
+
allowedTextColors,
|
|
15
|
+
allowedTextStyles,
|
|
16
|
+
allowedZIndex
|
|
17
|
+
} from '../../shared/constants'
|
|
18
|
+
|
|
19
|
+
export const resetPreset: Omit<Config, 'content'> = {
|
|
20
|
+
theme: {
|
|
21
|
+
screens: {
|
|
22
|
+
mobile: { max: '1187px' },
|
|
23
|
+
desktop: '1188px'
|
|
24
|
+
},
|
|
25
|
+
backgroundColor: {
|
|
26
|
+
color: allowedBackgroundColors,
|
|
27
|
+
banner: allowedBannersBackgroundColors,
|
|
28
|
+
icon: allowedIconsColors
|
|
29
|
+
},
|
|
30
|
+
textColor: {
|
|
31
|
+
icon: allowedIconsColors,
|
|
32
|
+
color: allowedTextColors
|
|
33
|
+
},
|
|
34
|
+
fill: allowedIconsColors,
|
|
35
|
+
stroke: allowedIconsColors,
|
|
36
|
+
borderColor: allowedStrokeColors,
|
|
37
|
+
outlineColor: allowedStrokeColors,
|
|
38
|
+
borderRadius: allowedBorderRadius,
|
|
39
|
+
fontFamily: { roboto: ['var(--ff-roboto)', 'sans-serif'] },
|
|
40
|
+
fontSize: allowedFontSize,
|
|
41
|
+
lineHeight: allowedLineHeight,
|
|
42
|
+
gradientColorStops: allowedBackgroundColors,
|
|
43
|
+
boxShadow: {
|
|
44
|
+
sm: '0 8px 20px 0 rgba(0, 0, 0, 0.08)',
|
|
45
|
+
md: '0 12px 20px 0 rgba(0, 33, 87, 0.10)',
|
|
46
|
+
lg: '0 16px 24px 0 rgba(0, 33, 87, 0.16)'
|
|
47
|
+
},
|
|
48
|
+
zIndex: allowedZIndex,
|
|
49
|
+
extend: {
|
|
50
|
+
bgGradientDeg: allowedBackgroundDeg
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
plugins: [
|
|
54
|
+
tailwindAnimation,
|
|
55
|
+
plugin(({ addComponents }) => {
|
|
56
|
+
addComponents(allowedTextStyles)
|
|
57
|
+
}),
|
|
58
|
+
plugin(function ({ matchUtilities, theme }) {
|
|
59
|
+
matchUtilities(
|
|
60
|
+
{
|
|
61
|
+
'bg-deg-gradient': (angle) => ({
|
|
62
|
+
'background-image': `linear-gradient(${angle}, var(--tw-gradient-stops))`
|
|
63
|
+
})
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
values: Object.assign(theme('bgGradientDeg', {}), {})
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
})
|
|
70
|
+
]
|
|
71
|
+
}
|