bmdl-sdk 1.5.9 → 2.0.1
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/.prettierrc +37 -0
- package/bin/dev.js +10 -8
- package/bin/init.js +2 -1
- package/bmdl-sdk-2.0.1.tgz +0 -0
- package/global.d.ts +9 -0
- package/next.config.ts +35 -0
- package/package.json +35 -8
- package/postcss.config.mjs +5 -0
- package/public/favicon.ico +0 -0
- package/public/images/bg/404.bg.dark.png +0 -0
- package/public/images/bg/404.bg.png +0 -0
- package/public/images/bg/maintenance.bg.dark.png +0 -0
- package/public/images/bg/maintenance.bg.png +0 -0
- package/public/images/bg/not-authorized.bg.dark.png +0 -0
- package/public/images/bg/not-authorized.bg.png +0 -0
- package/public/images/bg/redirect.bg.dark.png +0 -0
- package/public/images/bg/redirect.bg.png +0 -0
- package/public/images/cover/email-verify.cover.dark.png +0 -0
- package/public/images/cover/email-verify.cover.png +0 -0
- package/public/images/cover/login.cover.dark.png +0 -0
- package/public/images/cover/login.cover.png +0 -0
- package/public/images/cover/password-forgot.cover.dark.png +0 -0
- package/public/images/cover/password-forgot.cover.png +0 -0
- package/public/images/cover/password-reset.cover.dark.png +0 -0
- package/public/images/cover/password-reset.cover.png +0 -0
- package/public/images/cover/register.cover.dark.png +0 -0
- package/public/images/cover/register.cover.png +0 -0
- package/public/images/cover/two-factor-verify.cover.dark.png +0 -0
- package/public/images/cover/two-factor-verify.cover.png +0 -0
- package/public/images/lang/en.png +0 -0
- package/public/images/lang/ru.png +0 -0
- package/public/locales/en/datasets.json +92 -0
- package/public/locales/en/errors.json +402 -0
- package/public/locales/en/general.json +139 -0
- package/public/locales/ru/datasets.json +92 -0
- package/public/locales/ru/errors.json +406 -0
- package/public/locales/ru/general.json +139 -0
- package/src/app/datasets/page.tsx +25 -0
- package/src/app/layout.tsx +45 -0
- package/src/app/not-found.tsx +34 -0
- package/src/app/page.tsx +24 -0
- package/src/components/atoms/Actions/Actions.styles.ts +31 -0
- package/src/components/atoms/Actions/Actions.tsx +45 -0
- package/src/components/atoms/Actions/index.ts +1 -0
- package/src/components/atoms/Avatar/Avatar.styles.ts +95 -0
- package/src/components/atoms/Avatar/Avatar.tsx +46 -0
- package/src/components/atoms/Avatar/index.ts +1 -0
- package/src/components/atoms/Badge/Badge.styles.ts +93 -0
- package/src/components/atoms/Badge/Badge.tsx +31 -0
- package/src/components/atoms/Badge/index.ts +1 -0
- package/src/components/atoms/Button/Button.styles.ts +189 -0
- package/src/components/atoms/Button/Button.tsx +29 -0
- package/src/components/atoms/Button/index.ts +1 -0
- package/src/components/atoms/Calendar/Calendar.styles.ts +227 -0
- package/src/components/atoms/Calendar/Calendar.tsx +96 -0
- package/src/components/atoms/Calendar/index.ts +1 -0
- package/src/components/atoms/Checkbox/Checkbox.styles.ts +37 -0
- package/src/components/atoms/Checkbox/Checkbox.tsx +26 -0
- package/src/components/atoms/Checkbox/index.ts +1 -0
- package/src/components/atoms/Date/Date.styles.ts +6 -0
- package/src/components/atoms/Date/Date.tsx +27 -0
- package/src/components/atoms/Date/index.ts +1 -0
- package/src/components/atoms/DatePicker/DatePicker.styles.ts +53 -0
- package/src/components/atoms/DatePicker/DatePicker.tsx +114 -0
- package/src/components/atoms/DatePicker/DatePicker.utils.tsx +49 -0
- package/src/components/atoms/DatePicker/index.ts +1 -0
- package/src/components/atoms/Dialog/Dialog.styles.ts +71 -0
- package/src/components/atoms/Dialog/Dialog.tsx +55 -0
- package/src/components/atoms/Dialog/index.ts +1 -0
- package/src/components/atoms/Dropdown/Divider/Divider.styles.ts +8 -0
- package/src/components/atoms/Dropdown/Divider/Divider.tsx +14 -0
- package/src/components/atoms/Dropdown/Divider/index.ts +1 -0
- package/src/components/atoms/Dropdown/Dropdown.styles.ts +31 -0
- package/src/components/atoms/Dropdown/Dropdown.tsx +48 -0
- package/src/components/atoms/Dropdown/Item/Item.styles.ts +12 -0
- package/src/components/atoms/Dropdown/Item/Item.tsx +18 -0
- package/src/components/atoms/Dropdown/Item/index.ts +1 -0
- package/src/components/atoms/Dropdown/index.ts +1 -0
- package/src/components/atoms/Form/Form.styles.ts +23 -0
- package/src/components/atoms/Form/Form.tsx +21 -0
- package/src/components/atoms/Form/Item/Item.styles.ts +23 -0
- package/src/components/atoms/Form/Item/Item.tsx +11 -0
- package/src/components/atoms/Form/Item/index.ts +1 -0
- package/src/components/atoms/Form/Label/Label.tsx +11 -0
- package/src/components/atoms/Form/Label/index.ts +1 -0
- package/src/components/atoms/Form/Message/Message.tsx +29 -0
- package/src/components/atoms/Form/Message/index.ts +1 -0
- package/src/components/atoms/Form/index.ts +1 -0
- package/src/components/atoms/Input/Email/Email.tsx +11 -0
- package/src/components/atoms/Input/Email/index.ts +1 -0
- package/src/components/atoms/Input/Input.styles.ts +77 -0
- package/src/components/atoms/Input/Input.tsx +29 -0
- package/src/components/atoms/Input/Number/Number.tsx +12 -0
- package/src/components/atoms/Input/Number/index.ts +1 -0
- package/src/components/atoms/Input/OTP/OTP.styles.ts +30 -0
- package/src/components/atoms/Input/OTP/OTP.tsx +23 -0
- package/src/components/atoms/Input/OTP/index.ts +1 -0
- package/src/components/atoms/Input/Password/Password.tsx +11 -0
- package/src/components/atoms/Input/Password/index.ts +1 -0
- package/src/components/atoms/Input/Search/Search.tsx +12 -0
- package/src/components/atoms/Input/Search/index.ts +1 -0
- package/src/components/atoms/Input/index.ts +1 -0
- package/src/components/atoms/Label/Label.styles.ts +29 -0
- package/src/components/atoms/Label/Label.tsx +18 -0
- package/src/components/atoms/Label/index.ts +1 -0
- package/src/components/atoms/Logo/Logo.styles.ts +16 -0
- package/src/components/atoms/Logo/Logo.tsx +20 -0
- package/src/components/atoms/Logo/index.ts +1 -0
- package/src/components/atoms/Pagination/Pagination.styles.ts +77 -0
- package/src/components/atoms/Pagination/Pagination.tsx +131 -0
- package/src/components/atoms/Pagination/index.ts +1 -0
- package/src/components/atoms/Popover/Popover.styles.ts +28 -0
- package/src/components/atoms/Popover/Popover.tsx +46 -0
- package/src/components/atoms/Popover/index.ts +1 -0
- package/src/components/atoms/Radio/Item/Item.styles.ts +35 -0
- package/src/components/atoms/Radio/Item/Item.tsx +18 -0
- package/src/components/atoms/Radio/Item/index.ts +1 -0
- package/src/components/atoms/Radio/Radio.styles.ts +25 -0
- package/src/components/atoms/Radio/Radio.tsx +21 -0
- package/src/components/atoms/Radio/index.ts +1 -0
- package/src/components/atoms/RangeNumber/RangeNumber.tsx +33 -0
- package/src/components/atoms/RangeNumber/index.ts +1 -0
- package/src/components/atoms/Select/Item/Item.styles.ts +22 -0
- package/src/components/atoms/Select/Item/Item.tsx +17 -0
- package/src/components/atoms/Select/Item/index.ts +1 -0
- package/src/components/atoms/Select/Select.styles.ts +149 -0
- package/src/components/atoms/Select/Select.tsx +68 -0
- package/src/components/atoms/Select/index.ts +1 -0
- package/src/components/atoms/Separator/Separator.styles.ts +13 -0
- package/src/components/atoms/Separator/Separator.tsx +20 -0
- package/src/components/atoms/Separator/index.ts +1 -0
- package/src/components/atoms/Sheet/Sheet.styles.ts +100 -0
- package/src/components/atoms/Sheet/Sheet.tsx +53 -0
- package/src/components/atoms/Sheet/index.ts +1 -0
- package/src/components/atoms/Skeleton/Skeleton.styles.ts +30 -0
- package/src/components/atoms/Skeleton/Skeleton.tsx +11 -0
- package/src/components/atoms/Skeleton/index.ts +1 -0
- package/src/components/atoms/Spin/Spin.styles.ts +17 -0
- package/src/components/atoms/Spin/Spin.tsx +19 -0
- package/src/components/atoms/Spin/index.ts +1 -0
- package/src/components/atoms/Switch/Switch.styles.ts +34 -0
- package/src/components/atoms/Switch/Switch.tsx +20 -0
- package/src/components/atoms/Switch/index.ts +1 -0
- package/src/components/atoms/Table/FilterContent/FilterContent.styles.ts +33 -0
- package/src/components/atoms/Table/FilterContent/FilterContent.tsx +300 -0
- package/src/components/atoms/Table/FilterContent/index.ts +1 -0
- package/src/components/atoms/Table/FilterIcon/FilterIcon.tsx +16 -0
- package/src/components/atoms/Table/FilterIcon/index.ts +1 -0
- package/src/components/atoms/Table/SortIcon/SortIcon.tsx +32 -0
- package/src/components/atoms/Table/SortIcon/index.ts +1 -0
- package/src/components/atoms/Table/Table.styles.ts +178 -0
- package/src/components/atoms/Table/Table.tsx +484 -0
- package/src/components/atoms/Table/Table.utils.tsx +19 -0
- package/src/components/atoms/Table/index.ts +1 -0
- package/src/components/atoms/Tabs/Tabs.tsx +15 -0
- package/src/components/atoms/Tabs/index.ts +1 -0
- package/src/components/atoms/Textarea/Textarea.styles.ts +64 -0
- package/src/components/atoms/Textarea/Textarea.tsx +15 -0
- package/src/components/atoms/Textarea/index.ts +1 -0
- package/src/components/atoms/Toast/Toast.styles.ts +35 -0
- package/src/components/atoms/Toast/Toast.tsx +85 -0
- package/src/components/atoms/Toast/Toast.utils.tsx +43 -0
- package/src/components/atoms/Toast/index.ts +1 -0
- package/src/components/atoms/Tooltip/Tooltip.styles.ts +33 -0
- package/src/components/atoms/Tooltip/Tooltip.tsx +32 -0
- package/src/components/atoms/Tooltip/index.ts +1 -0
- package/src/components/atoms/Typography/Display/Display.styles.ts +26 -0
- package/src/components/atoms/Typography/Display/Display.tsx +11 -0
- package/src/components/atoms/Typography/Display/index.ts +1 -0
- package/src/components/atoms/Typography/Link/Link.styles.ts +32 -0
- package/src/components/atoms/Typography/Link/Link.tsx +25 -0
- package/src/components/atoms/Typography/Link/index.ts +1 -0
- package/src/components/atoms/Typography/Paragraph/Paragraph.styles.ts +32 -0
- package/src/components/atoms/Typography/Paragraph/Paragraph.tsx +11 -0
- package/src/components/atoms/Typography/Paragraph/index.ts +1 -0
- package/src/components/atoms/Typography/Text/Text.styles.ts +39 -0
- package/src/components/atoms/Typography/Text/Text.tsx +25 -0
- package/src/components/atoms/Typography/Text/index.ts +1 -0
- package/src/components/atoms/Typography/Title/Title.styles.ts +28 -0
- package/src/components/atoms/Typography/Title/Title.tsx +15 -0
- package/src/components/atoms/Typography/Title/index.ts +1 -0
- package/src/components/atoms/Typography/Typography.tsx +21 -0
- package/src/components/atoms/Typography/index.ts +1 -0
- package/src/components/atoms/icons/AvanpostIcon.tsx +31 -0
- package/src/components/atoms/icons/CheckIcon.tsx +22 -0
- package/src/components/atoms/icons/EmptyIcon.tsx +56 -0
- package/src/components/atoms/icons/LogoIcon.tsx +141 -0
- package/src/components/atoms/icons/NumberTypeIcon.tsx +25 -0
- package/src/components/atoms/icons/SidebarCloseIcon.tsx +75 -0
- package/src/components/atoms/icons/index.ts +6 -0
- package/src/components/atoms/index.ts +31 -0
- package/src/components/molecules/DataTable/CreationModal/CreationModal.tsx +31 -0
- package/src/components/molecules/DataTable/CreationModal/index.ts +1 -0
- package/src/components/molecules/DataTable/DataTable.styles.ts +23 -0
- package/src/components/molecules/DataTable/DataTable.tsx +167 -0
- package/src/components/molecules/DataTable/Name/Name.tsx +20 -0
- package/src/components/molecules/DataTable/Name/index.ts +1 -0
- package/src/components/molecules/DataTable/Skeleton/Skeleton.tsx +27 -0
- package/src/components/molecules/DataTable/Skeleton/index.ts +6 -0
- package/src/components/molecules/DataTable/index.ts +8 -0
- package/src/components/molecules/Header/Button/Button.styles.ts +24 -0
- package/src/components/molecules/Header/Button/Button.tsx +20 -0
- package/src/components/molecules/Header/Button/index.ts +1 -0
- package/src/components/molecules/Header/Header.styles.ts +16 -0
- package/src/components/molecules/Header/Header.tsx +20 -0
- package/src/components/molecules/Header/Navigate/Navigate.tsx +40 -0
- package/src/components/molecules/Header/Navigate/index.ts +1 -0
- package/src/components/molecules/Header/SelectLang/SelectLang.tsx +47 -0
- package/src/components/molecules/Header/SelectLang/index.ts +2 -0
- package/src/components/molecules/Header/SelectTheme/SelectTheme.tsx +43 -0
- package/src/components/molecules/Header/SelectTheme/index.ts +1 -0
- package/src/components/molecules/Header/index.ts +2 -0
- package/src/components/molecules/ProjectIcon/ProjectIcon.styles.ts +23 -0
- package/src/components/molecules/ProjectIcon/ProjectIcon.tsx +37 -0
- package/src/components/molecules/ProjectIcon/index.ts +1 -0
- package/src/components/molecules/Sidebar/Item/Item.styles.ts +52 -0
- package/src/components/molecules/Sidebar/Item/Item.tsx +30 -0
- package/src/components/molecules/Sidebar/Item/index.ts +1 -0
- package/src/components/molecules/Sidebar/Sidebar.styles.ts +97 -0
- package/src/components/molecules/Sidebar/Sidebar.tsx +122 -0
- package/src/components/molecules/Sidebar/Sidebar.utils.tsx +36 -0
- package/src/components/molecules/Sidebar/Trigger/Trigger.tsx +23 -0
- package/src/components/molecules/Sidebar/Trigger/index.ts +1 -0
- package/src/components/molecules/Sidebar/index.ts +1 -0
- package/src/components/molecules/Widget/Content/Content.tsx +80 -0
- package/src/components/molecules/Widget/Content/index.ts +1 -0
- package/src/components/molecules/Widget/Toolbox/Toolbox.tsx +0 -0
- package/src/components/molecules/Widget/Toolbox/index.ts +0 -0
- package/src/components/molecules/Widget/Widget.tsx +26 -0
- package/src/components/molecules/Widget/Widget.utils.tsx +31 -0
- package/src/components/molecules/Widget/index.ts +2 -0
- package/src/components/molecules/index.ts +6 -0
- package/src/components/organisms/ComponentWidget/ComponentWidget.tsx +9 -0
- package/src/components/organisms/ComponentWidget/index.ts +2 -0
- package/src/components/organisms/DatasetsTable/Creation/Creation.tsx +105 -0
- package/src/components/organisms/DatasetsTable/Creation/Navigate/Navigate.tsx +59 -0
- package/src/components/organisms/DatasetsTable/Creation/Navigate/index.ts +1 -0
- package/src/components/organisms/DatasetsTable/Creation/Step/Step.styles.ts +12 -0
- package/src/components/organisms/DatasetsTable/Creation/Step/Step.tsx +43 -0
- package/src/components/organisms/DatasetsTable/Creation/Step/index.ts +1 -0
- package/src/components/organisms/DatasetsTable/Creation/Steps/Step1/Step1.styles.ts +41 -0
- package/src/components/organisms/DatasetsTable/Creation/Steps/Step1/Step1.tsx +67 -0
- package/src/components/organisms/DatasetsTable/Creation/Steps/Step1/index.ts +1 -0
- package/src/components/organisms/DatasetsTable/Creation/Steps/Step2/SelectSource/SelectSource.tsx +252 -0
- package/src/components/organisms/DatasetsTable/Creation/Steps/Step2/SelectSource/index.ts +1 -0
- package/src/components/organisms/DatasetsTable/Creation/Steps/Step2/Step2.tsx +11 -0
- package/src/components/organisms/DatasetsTable/Creation/Steps/Step2/UploadFile/UploadFile.tsx +112 -0
- package/src/components/organisms/DatasetsTable/Creation/Steps/Step2/UploadFile/index.ts +1 -0
- package/src/components/organisms/DatasetsTable/Creation/Steps/Step2/index.ts +1 -0
- package/src/components/organisms/DatasetsTable/Creation/Steps/Step3/Step3.tsx +145 -0
- package/src/components/organisms/DatasetsTable/Creation/Steps/Step3/index.ts +1 -0
- package/src/components/organisms/DatasetsTable/Creation/Steps/Step4/Step4.tsx +120 -0
- package/src/components/organisms/DatasetsTable/Creation/Steps/Step4/index.ts +1 -0
- package/src/components/organisms/DatasetsTable/Creation/Steps/index.ts +4 -0
- package/src/components/organisms/DatasetsTable/Creation/index.ts +1 -0
- package/src/components/organisms/DatasetsTable/DatasetsTable.tsx +81 -0
- package/src/components/organisms/DatasetsTable/DatasetsTable.utils.tsx +125 -0
- package/src/components/organisms/DatasetsTable/Source/Source.styles.ts +7 -0
- package/src/components/organisms/DatasetsTable/Source/Source.tsx +39 -0
- package/src/components/organisms/DatasetsTable/Source/Source.utils.tsx +45 -0
- package/src/components/organisms/DatasetsTable/Source/index.ts +1 -0
- package/src/components/organisms/DatasetsTable/Status/Status.styles.ts +25 -0
- package/src/components/organisms/DatasetsTable/Status/Status.tsx +29 -0
- package/src/components/organisms/DatasetsTable/Status/Status.utils.tsx +29 -0
- package/src/components/organisms/DatasetsTable/Status/index.ts +1 -0
- package/src/components/organisms/DatasetsTable/Type/Type.styles.ts +7 -0
- package/src/components/organisms/DatasetsTable/Type/Type.tsx +32 -0
- package/src/components/organisms/DatasetsTable/Type/Type.utils.tsx +14 -0
- package/src/components/organisms/DatasetsTable/Type/index.ts +1 -0
- package/src/components/organisms/DatasetsTable/index.ts +1 -0
- package/src/components/organisms/index.ts +3 -0
- package/src/components/templates/DefaultLayout/DefaultLayout.styles.ts +26 -0
- package/src/components/templates/DefaultLayout/DefaultLayout.tsx +41 -0
- package/src/components/templates/DefaultLayout/index.ts +1 -0
- package/src/components/templates/PageLayout/PageLayout.styles.ts +25 -0
- package/src/components/templates/PageLayout/PageLayout.tsx +28 -0
- package/src/components/templates/PageLayout/index.ts +1 -0
- package/src/components/templates/index.ts +3 -0
- package/src/config/i18n.config.ts +46 -0
- package/src/constants/index.ts +10 -0
- package/src/contexts/CreateComponentContext/CreateComponentContext.tsx +17 -0
- package/src/contexts/CreateComponentContext/index.ts +4 -0
- package/src/contexts/CreateDatasetContext/CreateDatasetContext.tsx +25 -0
- package/src/contexts/CreateDatasetContext/index.ts +4 -0
- package/src/contexts/ProjectContext/ProjectContext.tsx +32 -0
- package/src/contexts/ProjectContext/index.ts +1 -0
- package/src/contexts/SidebarContext/SidebarContext.tsx +10 -0
- package/src/contexts/SidebarContext/index.ts +1 -0
- package/src/contexts/index.ts +10 -0
- package/src/hooks/index.ts +9 -0
- package/src/hooks/useCreateComponent.ts +15 -0
- package/src/hooks/useCreateDataset.ts +15 -0
- package/src/hooks/useDebounce.ts +17 -0
- package/src/hooks/useDebounced.ts +31 -0
- package/src/hooks/useIsMobile.ts +27 -0
- package/src/hooks/useSidebar.ts +15 -0
- package/src/hooks/useStickyHeader.ts +35 -0
- package/src/hooks/useWindowSize.ts +27 -0
- package/src/providers/CreateComponentProvider/CreateComponentProvider.tsx +53 -0
- package/src/providers/CreateComponentProvider/index.ts +1 -0
- package/src/providers/CreateDatasetProvider/CreateDatasetProvider.tsx +73 -0
- package/src/providers/CreateDatasetProvider/index.ts +1 -0
- package/src/providers/LangProvider/LangProvider.tsx +15 -0
- package/src/providers/LangProvider/index.ts +1 -0
- package/src/providers/ProjectProvider/ProjectProvider.tsx +110 -0
- package/src/providers/ProjectProvider/index.ts +1 -0
- package/src/providers/SidebarProvider/SidebarProvider.tsx +51 -0
- package/src/providers/SidebarProvider/index.ts +1 -0
- package/src/providers/ThemeProvider/ThemeProvider.tsx +20 -0
- package/src/providers/ThemeProvider/index.ts +1 -0
- package/src/providers/index.ts +6 -0
- package/src/store/index.ts +2 -0
- package/src/store/sidebar/sidebar.store.ts +17 -0
- package/src/store/sidebar/sidebar.type.ts +4 -0
- package/src/styles/globals.css +202 -0
- package/src/types/component.type.ts +13 -0
- package/src/types/dataset.type.ts +25 -0
- package/src/types/file.type.ts +13 -0
- package/src/types/general.type.ts +86 -0
- package/src/types/index.ts +9 -0
- package/src/types/layer.type.ts +7 -0
- package/src/types/project.type.ts +15 -0
- package/src/types/user.type.ts +6 -0
- package/src/types/widget.type.ts +12 -0
- package/src/utils/bm.util.ts +150 -0
- package/src/utils/bytes.util.ts +110 -0
- package/src/utils/date.util.ts +49 -0
- package/src/utils/dynamicMessage.util.ts +9 -0
- package/src/utils/getInitials.util.ts +10 -0
- package/src/utils/hideEmail.util.ts +14 -0
- package/src/utils/index.ts +12 -0
- package/src/utils/pagination.util.ts +144 -0
- package/src/utils/twJoin.util.ts +49 -0
- package/src/utils/twMerge.util.ts +6 -0
- package/src/utils/upload.util.ts +26 -0
- package/src/utils/url.util.ts +29 -0
- package/tsconfig.json +40 -6
- package/bmdl-sdk-1.5.9.tgz +0 -0
- package/index.html +0 -12
- package/src/App.tsx +0 -187
- package/src/main.tsx +0 -15
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority'
|
|
2
|
+
|
|
3
|
+
import { twJoin } from '@/utils'
|
|
4
|
+
|
|
5
|
+
export const overlayStyles = cva(
|
|
6
|
+
twJoin({
|
|
7
|
+
position: 'fixed z-50 inset-0',
|
|
8
|
+
visual: 'bg-black/15',
|
|
9
|
+
attrs: [
|
|
10
|
+
'data-[state=open]:animate-in',
|
|
11
|
+
'data-[state=open]:fade-in-0',
|
|
12
|
+
'data-[state=closed]:animate-out',
|
|
13
|
+
'data-[state=closed]:fade-out-0'
|
|
14
|
+
]
|
|
15
|
+
}),
|
|
16
|
+
{
|
|
17
|
+
variants: {
|
|
18
|
+
blur: {
|
|
19
|
+
true: 'backdrop-blur-xs'
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
blur: false
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
// /////////////////////////
|
|
29
|
+
|
|
30
|
+
export const contentStyles = twJoin({
|
|
31
|
+
position: 'fixed z-50 top-1/2 left-1/2',
|
|
32
|
+
display: 'flex flex-col p-6',
|
|
33
|
+
visual: 'bg-white rounded-md shadow-lg',
|
|
34
|
+
transform: '-translate-x-1/2 -translate-y-1/2',
|
|
35
|
+
animation: 'duration-200',
|
|
36
|
+
attrs: [
|
|
37
|
+
'data-[state=open]:animate-in',
|
|
38
|
+
'data-[state=open]:fade-in-0',
|
|
39
|
+
'data-[state=open]:zoom-in-95',
|
|
40
|
+
//
|
|
41
|
+
'data-[state=closed]:animate-out',
|
|
42
|
+
'data-[state=closed]:fade-out-0',
|
|
43
|
+
'data-[state=closed]:zoom-out-95'
|
|
44
|
+
],
|
|
45
|
+
//
|
|
46
|
+
dark: {
|
|
47
|
+
visual: 'dark:bg-dark-gray-900 dark:shadow-dark-lg'
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
// /////////////////////////
|
|
52
|
+
|
|
53
|
+
export const closeStyles = twJoin({
|
|
54
|
+
position: 'absolute top-0 right-0',
|
|
55
|
+
display: 'size-8 p-1.5 -mt-3 -mr-3',
|
|
56
|
+
visual: 'bg-white rounded-md shadow-sm outline-none',
|
|
57
|
+
animation: 'transition-[all_.23s_ease_.1s]',
|
|
58
|
+
childs: {
|
|
59
|
+
mouse: '[&_svg]:pointer-events-none',
|
|
60
|
+
display: '[&_svg]:size-5',
|
|
61
|
+
text: '[&_svg]:text-gray'
|
|
62
|
+
},
|
|
63
|
+
hover: 'hover:translate-y-1.5 hover:-translate-x-1.5',
|
|
64
|
+
//
|
|
65
|
+
dark: {
|
|
66
|
+
visual: 'dark:bg-dark-gray-900 dark:shadow-dark-sm',
|
|
67
|
+
childs: {
|
|
68
|
+
text: 'dark:[&_svg]:text-dark-gray-600'
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
})
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import clsx from 'clsx'
|
|
2
|
+
import { useTranslations } from 'next-intl'
|
|
3
|
+
import { type ComponentProps, type ReactNode } from 'react'
|
|
4
|
+
|
|
5
|
+
import { Dialog as RadixDialog } from 'radix-ui'
|
|
6
|
+
|
|
7
|
+
import { IoClose } from 'react-icons/io5'
|
|
8
|
+
|
|
9
|
+
import { closeStyles, contentStyles, overlayStyles } from './Dialog.styles'
|
|
10
|
+
|
|
11
|
+
type DialogProps = ComponentProps<typeof RadixDialog.Root> &
|
|
12
|
+
ComponentProps<typeof RadixDialog.Content> & {
|
|
13
|
+
title?: ReactNode
|
|
14
|
+
blur?: boolean
|
|
15
|
+
onCancel?: () => void
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function Dialog({
|
|
19
|
+
title,
|
|
20
|
+
children,
|
|
21
|
+
onCancel,
|
|
22
|
+
onEscapeKeyDown,
|
|
23
|
+
blur,
|
|
24
|
+
className,
|
|
25
|
+
...props
|
|
26
|
+
}: DialogProps) {
|
|
27
|
+
const t = useTranslations('')
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<RadixDialog.Root {...props}>
|
|
31
|
+
<RadixDialog.Portal>
|
|
32
|
+
<RadixDialog.Overlay className={overlayStyles({ blur })} />
|
|
33
|
+
<RadixDialog.Content
|
|
34
|
+
onEscapeKeyDown={onEscapeKeyDown}
|
|
35
|
+
onPointerDownOutside={onCancel}
|
|
36
|
+
className={clsx(contentStyles, className)}
|
|
37
|
+
>
|
|
38
|
+
<RadixDialog.Title asChild>
|
|
39
|
+
<div className='w-full'>{title}</div>
|
|
40
|
+
</RadixDialog.Title>
|
|
41
|
+
{children}
|
|
42
|
+
<RadixDialog.Close
|
|
43
|
+
onClick={onCancel}
|
|
44
|
+
aria-label={t('close')}
|
|
45
|
+
className={closeStyles}
|
|
46
|
+
>
|
|
47
|
+
<IoClose />
|
|
48
|
+
</RadixDialog.Close>
|
|
49
|
+
</RadixDialog.Content>
|
|
50
|
+
</RadixDialog.Portal>
|
|
51
|
+
</RadixDialog.Root>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export { Dialog }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Dialog } from './Dialog'
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import clsx from 'clsx'
|
|
2
|
+
import { type ComponentProps } from 'react'
|
|
3
|
+
|
|
4
|
+
import { DropdownMenu } from 'radix-ui'
|
|
5
|
+
|
|
6
|
+
import { rootStyles } from './Divider.styles'
|
|
7
|
+
|
|
8
|
+
type DividerProps = ComponentProps<typeof DropdownMenu.Separator>
|
|
9
|
+
|
|
10
|
+
function Divider({ className }: DividerProps) {
|
|
11
|
+
return <DropdownMenu.Separator className={clsx(rootStyles, className)} />
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { Divider }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Divider } from './Divider'
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { twJoin } from '@/utils'
|
|
2
|
+
|
|
3
|
+
export const contentStyles = twJoin({
|
|
4
|
+
position: 'relative z-50',
|
|
5
|
+
display: 'min-w-15 overflow-x-hidden overflow-y-auto p-2',
|
|
6
|
+
text: 'text-gray-900',
|
|
7
|
+
visual: 'bg-white rounded-md shadow-lg',
|
|
8
|
+
attrs: [
|
|
9
|
+
'data-[state=open]:animate-in',
|
|
10
|
+
'data-[state=open]:fade-in-0',
|
|
11
|
+
'data-[state=open]:zoom-in-95',
|
|
12
|
+
//
|
|
13
|
+
'data-[state=closed]:animate-out',
|
|
14
|
+
'data-[state=closed]:fade-out-0',
|
|
15
|
+
'data-[state=closed]:zoom-out-95',
|
|
16
|
+
//
|
|
17
|
+
'data-[side=top]:slide-in-from-bottom-2',
|
|
18
|
+
'data-[side=right]:slide-in-from-left-2',
|
|
19
|
+
'data-[side=bottom]:slide-in-from-top-2',
|
|
20
|
+
'data-[side=left]:slide-in-from-right-2'
|
|
21
|
+
],
|
|
22
|
+
vars: [
|
|
23
|
+
'max-h-(--radix-dropdown-menu-content-available-height)',
|
|
24
|
+
'origin-(--radix-dropdown-menu-content-transform-origin)'
|
|
25
|
+
],
|
|
26
|
+
//
|
|
27
|
+
dark: {
|
|
28
|
+
text: 'dark:text-dark-gray-300',
|
|
29
|
+
visual: 'dark:bg-dark-gray-900 dark:shadow-dark-lg'
|
|
30
|
+
}
|
|
31
|
+
})
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import clsx from 'clsx'
|
|
2
|
+
import { type ComponentProps, type ReactNode } from 'react'
|
|
3
|
+
|
|
4
|
+
import { DropdownMenu } from 'radix-ui'
|
|
5
|
+
|
|
6
|
+
import { contentStyles } from './Dropdown.styles'
|
|
7
|
+
|
|
8
|
+
import { Divider } from './Divider'
|
|
9
|
+
import { Item } from './Item'
|
|
10
|
+
|
|
11
|
+
type DropdownProps = ComponentProps<typeof DropdownMenu.Root> &
|
|
12
|
+
ComponentProps<typeof DropdownMenu.Content> & {
|
|
13
|
+
trigger: ReactNode
|
|
14
|
+
arrow?: boolean
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function Dropdown({
|
|
18
|
+
trigger,
|
|
19
|
+
arrow = true,
|
|
20
|
+
sideOffset,
|
|
21
|
+
alignOffset,
|
|
22
|
+
align,
|
|
23
|
+
children,
|
|
24
|
+
className,
|
|
25
|
+
...props
|
|
26
|
+
}: DropdownProps) {
|
|
27
|
+
return (
|
|
28
|
+
<DropdownMenu.Root {...props}>
|
|
29
|
+
<DropdownMenu.Trigger asChild>{trigger}</DropdownMenu.Trigger>
|
|
30
|
+
<DropdownMenu.Portal>
|
|
31
|
+
<DropdownMenu.Content
|
|
32
|
+
align={align}
|
|
33
|
+
sideOffset={sideOffset}
|
|
34
|
+
alignOffset={alignOffset}
|
|
35
|
+
className={clsx(contentStyles, className)}
|
|
36
|
+
>
|
|
37
|
+
{children}
|
|
38
|
+
{arrow && <DropdownMenu.Arrow />}
|
|
39
|
+
</DropdownMenu.Content>
|
|
40
|
+
</DropdownMenu.Portal>
|
|
41
|
+
</DropdownMenu.Root>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
Dropdown.Item = Item
|
|
46
|
+
Dropdown.Divider = Divider
|
|
47
|
+
|
|
48
|
+
export { Dropdown }
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { twJoin } from '@/utils'
|
|
2
|
+
|
|
3
|
+
export const rootStyles = twJoin({
|
|
4
|
+
display: 'flex items-center w-full px-4 py-2 mt-1 first:mt-0',
|
|
5
|
+
text: 'text-base',
|
|
6
|
+
visual: 'rounded-md outline-none',
|
|
7
|
+
animation: 'transition-(color,bg) duration-300',
|
|
8
|
+
hover: 'hover:bg-gray-100',
|
|
9
|
+
childs: '[&_svg]:size-6 [&_svg]:mr-2.5',
|
|
10
|
+
//
|
|
11
|
+
dark: 'dark:hover:bg-dark-gray-800/50'
|
|
12
|
+
})
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import clsx from 'clsx'
|
|
2
|
+
import { type ComponentProps } from 'react'
|
|
3
|
+
|
|
4
|
+
import { DropdownMenu } from 'radix-ui'
|
|
5
|
+
|
|
6
|
+
import { rootStyles } from './Item.styles'
|
|
7
|
+
|
|
8
|
+
type ItemProps = ComponentProps<typeof DropdownMenu.Item>
|
|
9
|
+
|
|
10
|
+
function Item({ children, className, ...props }: ItemProps) {
|
|
11
|
+
return (
|
|
12
|
+
<DropdownMenu.Item className={clsx(rootStyles, className)} {...props}>
|
|
13
|
+
{children}
|
|
14
|
+
</DropdownMenu.Item>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { Item }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Item } from './Item'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Dropdown } from './Dropdown'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type VariantProps, cva } from 'class-variance-authority'
|
|
2
|
+
|
|
3
|
+
import { twJoin } from '@/utils'
|
|
4
|
+
|
|
5
|
+
export const rootStyles = cva(
|
|
6
|
+
twJoin({
|
|
7
|
+
tw: 'group/form-item',
|
|
8
|
+
display: 'flex gap-4'
|
|
9
|
+
}),
|
|
10
|
+
{
|
|
11
|
+
variants: {
|
|
12
|
+
layout: {
|
|
13
|
+
horizontal: '',
|
|
14
|
+
vertical: 'form-vertical flex-col'
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: {
|
|
18
|
+
layout: 'horizontal'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
export type RootStylesProps = VariantProps<typeof rootStyles>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { type ComponentProps } from 'react'
|
|
4
|
+
|
|
5
|
+
import { type RootStylesProps, rootStyles } from './Form.styles'
|
|
6
|
+
|
|
7
|
+
import { FormItem } from './Item'
|
|
8
|
+
import { FormLabel } from './Label'
|
|
9
|
+
import { FormMessage } from './Message'
|
|
10
|
+
|
|
11
|
+
type FormProps = ComponentProps<'form'> & RootStylesProps
|
|
12
|
+
|
|
13
|
+
function Form({ layout, className, ...props }: FormProps) {
|
|
14
|
+
return <form className={rootStyles({ layout, className })} {...props} />
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
Form.Item = FormItem
|
|
18
|
+
Form.Label = FormLabel
|
|
19
|
+
Form.Message = FormMessage
|
|
20
|
+
|
|
21
|
+
export { Form }
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type VariantProps, cva } from 'class-variance-authority'
|
|
2
|
+
|
|
3
|
+
import { twJoin } from '@/utils'
|
|
4
|
+
|
|
5
|
+
export const rootStyles = cva(
|
|
6
|
+
twJoin({
|
|
7
|
+
tw: [
|
|
8
|
+
'group-[.form-horizontal]/form-item:flex-row',
|
|
9
|
+
'group-[.form-vertical]/form-item:flex-col'
|
|
10
|
+
],
|
|
11
|
+
display: 'flex gap-1'
|
|
12
|
+
}),
|
|
13
|
+
{
|
|
14
|
+
variants: {
|
|
15
|
+
layout: {
|
|
16
|
+
horizontal: 'flex-row!',
|
|
17
|
+
vertical: 'flex-col!'
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
export type RootStylesProps = VariantProps<typeof rootStyles>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react'
|
|
2
|
+
|
|
3
|
+
import { type RootStylesProps, rootStyles } from './Item.styles'
|
|
4
|
+
|
|
5
|
+
type ItemProps = ComponentProps<'div'> & RootStylesProps
|
|
6
|
+
|
|
7
|
+
function FormItem({ layout, className, ...props }: ItemProps) {
|
|
8
|
+
return <div className={rootStyles({ layout, className })} {...props} />
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { FormItem }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FormItem } from './Item'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react'
|
|
2
|
+
|
|
3
|
+
import { Label } from '../../Label'
|
|
4
|
+
|
|
5
|
+
type FormLabelProps = ComponentProps<typeof Label>
|
|
6
|
+
|
|
7
|
+
function FormLabel({ className, ...props }: FormLabelProps) {
|
|
8
|
+
return <Label {...props} />
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { FormLabel }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FormLabel } from './Label'
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useTranslations } from 'next-intl'
|
|
2
|
+
import { type ComponentProps } from 'react'
|
|
3
|
+
import { type FieldError } from 'react-hook-form'
|
|
4
|
+
|
|
5
|
+
import { Typography } from '../../Typography'
|
|
6
|
+
|
|
7
|
+
const { Text } = Typography
|
|
8
|
+
|
|
9
|
+
type FormMessageProps = ComponentProps<'p'> & {
|
|
10
|
+
error?: FieldError
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function FormMessage({ error, ...props }: FormMessageProps) {
|
|
14
|
+
const te = useTranslations('errors')
|
|
15
|
+
//
|
|
16
|
+
const body = error ? te(String(error?.message ?? '')) : props.children
|
|
17
|
+
|
|
18
|
+
if (!body) {
|
|
19
|
+
return null
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<Text size={'sm'} className='text-danger!'>
|
|
24
|
+
{body}
|
|
25
|
+
</Text>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { FormMessage }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FormMessage } from './Message'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Form } from './Form'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Email } from './Email'
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
2
|
+
|
|
3
|
+
import { twJoin } from '@/utils'
|
|
4
|
+
|
|
5
|
+
export const rootStyles = cva(
|
|
6
|
+
twJoin({
|
|
7
|
+
tw: [
|
|
8
|
+
'group-has-[[data-state="open"]]/input:border-primary',
|
|
9
|
+
'group-has-[[data-state="open"]]/input:shadow-primary-sm',
|
|
10
|
+
'hover:group-has-[[data-state="open"]]/input:border-primary'
|
|
11
|
+
],
|
|
12
|
+
display: 'flex w-full min-w-0 ',
|
|
13
|
+
text: 'text-base text-gray-800',
|
|
14
|
+
visual: 'border-divider border bg-white outline-none',
|
|
15
|
+
animation: 'transition duration-300',
|
|
16
|
+
placeholder: 'placeholder:text-gray-400',
|
|
17
|
+
hover: 'hover:border-gray hover:focus-visible:border-primary',
|
|
18
|
+
focus: 'focus-visible:border-primary focus-visible:shadow-primary-sm',
|
|
19
|
+
disabled: {
|
|
20
|
+
mouse: 'disabled:cursor-not-allowed',
|
|
21
|
+
text: 'disabled:text-secondary',
|
|
22
|
+
visual: 'disabled:bg-gray-100'
|
|
23
|
+
},
|
|
24
|
+
attrs: {
|
|
25
|
+
visual: 'aria-[invalid=true]:border-danger',
|
|
26
|
+
hover: 'aria-[invalid=true]:hover:border-danger',
|
|
27
|
+
focus: 'aria-[invalid=true]:focus-visible:border-danger aria-[invalid=true]:focus-visible:shadow-none'
|
|
28
|
+
},
|
|
29
|
+
//
|
|
30
|
+
dark: {
|
|
31
|
+
text: 'dark:text-dark-gray-300',
|
|
32
|
+
visual: 'dark:border-dark-divider dark:bg-dark-gray-900',
|
|
33
|
+
disabled: {
|
|
34
|
+
text: 'dark:disabled:text-secondary',
|
|
35
|
+
visual: 'dark:disabled:bg-secondary/16'
|
|
36
|
+
},
|
|
37
|
+
placeholder: 'dark:placeholder:text-dark-gray-700',
|
|
38
|
+
hover: 'dark:hover:border-dark-gray',
|
|
39
|
+
focus: 'dark:focus-visible:shadow-dark-sm'
|
|
40
|
+
}
|
|
41
|
+
}),
|
|
42
|
+
{
|
|
43
|
+
variants: {
|
|
44
|
+
sizes: {
|
|
45
|
+
sm: twJoin({
|
|
46
|
+
display: 'h-7 py-2 px-2.5',
|
|
47
|
+
text: 'text-sm',
|
|
48
|
+
visual: 'rounded-sm',
|
|
49
|
+
focus: {
|
|
50
|
+
display: 'focus-visible:pl-3.5'
|
|
51
|
+
}
|
|
52
|
+
}),
|
|
53
|
+
md: twJoin({
|
|
54
|
+
display: 'h-9.5 py-2 px-3.5',
|
|
55
|
+
text: 'text-base',
|
|
56
|
+
visual: 'rounded-md',
|
|
57
|
+
focus: {
|
|
58
|
+
display: 'focus-visible:pl-4.5'
|
|
59
|
+
}
|
|
60
|
+
}),
|
|
61
|
+
lg: twJoin({
|
|
62
|
+
display: 'h-12 py-3 px-4',
|
|
63
|
+
text: 'text-lg',
|
|
64
|
+
visual: 'rounded-lg',
|
|
65
|
+
focus: {
|
|
66
|
+
display: 'focus-visible:pl-5.5'
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
defaultVariants: {
|
|
72
|
+
sizes: 'md'
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
export type RootStylesProps = VariantProps<typeof rootStyles>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react'
|
|
2
|
+
|
|
3
|
+
import { type RootStylesProps, rootStyles } from './Input.styles'
|
|
4
|
+
|
|
5
|
+
import { Email } from './Email'
|
|
6
|
+
import { Number } from './Number'
|
|
7
|
+
import { OTP } from './OTP'
|
|
8
|
+
import { Password } from './Password'
|
|
9
|
+
import { Search } from './Search'
|
|
10
|
+
|
|
11
|
+
type InputProps = ComponentProps<'input'> & RootStylesProps
|
|
12
|
+
|
|
13
|
+
function Input({ type = 'text', sizes, className, ...props }: InputProps) {
|
|
14
|
+
return (
|
|
15
|
+
<input
|
|
16
|
+
type={type}
|
|
17
|
+
className={rootStyles({ sizes, className })}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
Input.Email = Email
|
|
24
|
+
Input.Password = Password
|
|
25
|
+
Input.Search = Search
|
|
26
|
+
Input.OTP = OTP
|
|
27
|
+
Input.Number = Number
|
|
28
|
+
|
|
29
|
+
export { Input }
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react'
|
|
2
|
+
|
|
3
|
+
import { Input } from '../Input'
|
|
4
|
+
import { RootStylesProps } from '../Input/Input.styles'
|
|
5
|
+
|
|
6
|
+
type NumberProps = ComponentProps<'input'> & RootStylesProps
|
|
7
|
+
|
|
8
|
+
function Number({ ...props }: NumberProps) {
|
|
9
|
+
return <Input type='number' {...props} />
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { Number }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Number } from './Number'
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { twJoin } from '@/utils'
|
|
2
|
+
|
|
3
|
+
export const rootStyles = twJoin({
|
|
4
|
+
display: 'select-none flex w-full items-center justify-between'
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
// /////////////////////////
|
|
8
|
+
|
|
9
|
+
export const inputStyles = twJoin({
|
|
10
|
+
mouse: '[&::selection]:bg-transparent',
|
|
11
|
+
position: 'relative',
|
|
12
|
+
display: 'flex h-12 w-14 items-center justify-center',
|
|
13
|
+
text: 'text-base text-gray-800 text-center',
|
|
14
|
+
visual: 'border-divider rounded-lg border bg-white outline-none',
|
|
15
|
+
animation: 'transition-all',
|
|
16
|
+
hover: 'hover:border-gray hover:focus-visible:border-primary',
|
|
17
|
+
focus: 'focus-visible:border-primary focus-visible:shadow-primary-sm',
|
|
18
|
+
//
|
|
19
|
+
dark: {
|
|
20
|
+
text: 'dark:text-dark-gray-300',
|
|
21
|
+
visual: 'dark:border-dark-divider dark:bg-dark-gray-900',
|
|
22
|
+
hover: 'dark:hover:border-dark-gray',
|
|
23
|
+
focus: 'dark:focus-visible:shadow-dark-sm',
|
|
24
|
+
attrs: [
|
|
25
|
+
'data-[active=true]:z-10',
|
|
26
|
+
'data-[active=true]:border-primary',
|
|
27
|
+
'data-[active=true]:shadow-primary-sm'
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
})
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import clsx from 'clsx'
|
|
2
|
+
import { type ComponentProps } from 'react'
|
|
3
|
+
|
|
4
|
+
import { unstable_OneTimePasswordField as RadixOTP } from 'radix-ui'
|
|
5
|
+
|
|
6
|
+
import { inputStyles, rootStyles } from './OTP.styles'
|
|
7
|
+
|
|
8
|
+
type OTPProps = ComponentProps<typeof RadixOTP.Root> & {
|
|
9
|
+
length?: number
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function OTP({ length = 6, className, value, ...props }: OTPProps) {
|
|
13
|
+
return (
|
|
14
|
+
<RadixOTP.Root className={clsx(rootStyles, className)} {...props}>
|
|
15
|
+
{Array.from({ length }).map((_, index) => {
|
|
16
|
+
return <RadixOTP.Input key={index} className={inputStyles} />
|
|
17
|
+
})}
|
|
18
|
+
<RadixOTP.HiddenInput />
|
|
19
|
+
</RadixOTP.Root>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { OTP }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { OTP } from './OTP'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Password } from './Password'
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react'
|
|
2
|
+
|
|
3
|
+
import { Input } from '../Input'
|
|
4
|
+
import { RootStylesProps } from '../Input/Input.styles'
|
|
5
|
+
|
|
6
|
+
type SearchProps = ComponentProps<'input'> & RootStylesProps
|
|
7
|
+
|
|
8
|
+
function Search({ ...props }: SearchProps) {
|
|
9
|
+
return <Input type='search' {...props} />
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { Search }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Search } from './Search'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Input } from './Input'
|