bmdl-sdk 1.5.9 → 2.0.0
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 +5 -4
- package/bin/init.js +2 -1
- package/bmdl-sdk-2.0.0.tgz +0 -0
- package/global.d.ts +9 -0
- package/next.config.ts +27 -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 +107 -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/templates/App.tsx +1 -1
- package/templates/config.ts +1 -1
- package/templates/dataOptions.ts +1 -1
- package/templates/viewOptions.ts +1 -1
- 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,149 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority'
|
|
2
|
+
|
|
3
|
+
import { twJoin } from '@/utils'
|
|
4
|
+
|
|
5
|
+
export const triggerStyles = cva(
|
|
6
|
+
twJoin({
|
|
7
|
+
display: 'flex justify-between items-center overflow-hidden',
|
|
8
|
+
text: 'text-gray whitespace-nowrap',
|
|
9
|
+
visual: 'border border-divider bg-white',
|
|
10
|
+
animation: 'transition duration-300',
|
|
11
|
+
hover: {
|
|
12
|
+
visual: 'hover:border-gray',
|
|
13
|
+
focus: {
|
|
14
|
+
visual: 'hover:focus-visible:border-primary'
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
focus: 'focus-visible:outline-none focus-visible:border-primary focus-visible:shadow-sm',
|
|
18
|
+
disabled: {
|
|
19
|
+
mouse: 'disabled:cursor-not-allowed!',
|
|
20
|
+
text: 'disabled:text-secondary',
|
|
21
|
+
visual: 'disabled:bg-gray-100',
|
|
22
|
+
attrs: 'disabled:[&_svg]:text-secondary'
|
|
23
|
+
},
|
|
24
|
+
attrs: 'data-[state=open]:border-primary data-[state=open]:shadow-sm',
|
|
25
|
+
childs: [
|
|
26
|
+
'[&_span]:first:mr-2',
|
|
27
|
+
'[&_span]:first:flex',
|
|
28
|
+
'[&_span]:first:items-center',
|
|
29
|
+
'[&_span]:first:gap-x-2',
|
|
30
|
+
'[&_span]:first:[&_svg]:size-5',
|
|
31
|
+
'[&_svg]:text-gray-800'
|
|
32
|
+
],
|
|
33
|
+
//
|
|
34
|
+
dark: {
|
|
35
|
+
text: 'dark:text-dark-gray-600',
|
|
36
|
+
visual: 'dark:border-dark-divider dark:bg-dark-gray-900',
|
|
37
|
+
disabled: {
|
|
38
|
+
text: 'dark:disabled:text-secondary',
|
|
39
|
+
visual: 'dark:disabled:bg-secondary/16'
|
|
40
|
+
},
|
|
41
|
+
hover: {
|
|
42
|
+
visual: 'dark:hover:border-dark-gray',
|
|
43
|
+
focus: {
|
|
44
|
+
visual: 'dark:focus-visible:shadow-dark-sm'
|
|
45
|
+
},
|
|
46
|
+
childs: ['dark:[&_svg]:text-dark-gray-300']
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}),
|
|
50
|
+
{
|
|
51
|
+
variants: {
|
|
52
|
+
size: {
|
|
53
|
+
sm: twJoin({
|
|
54
|
+
display: 'h-7 py-2 px-2.5',
|
|
55
|
+
text: 'text-sm',
|
|
56
|
+
visual: 'rounded-sm',
|
|
57
|
+
childs: '[&_svg]:size-4'
|
|
58
|
+
}),
|
|
59
|
+
md: twJoin({
|
|
60
|
+
display: 'h-9.5 py-2 px-3.5',
|
|
61
|
+
text: 'text-base',
|
|
62
|
+
visual: 'rounded-md',
|
|
63
|
+
childs: '[&_svg]:size-5'
|
|
64
|
+
}),
|
|
65
|
+
lg: twJoin({
|
|
66
|
+
display: 'h-12 py-3 px-4',
|
|
67
|
+
text: 'text-lg',
|
|
68
|
+
visual: 'rounded-lg',
|
|
69
|
+
childs: '[&_svg]:size-6'
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
defaultVariants: {
|
|
74
|
+
size: 'md'
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
// /////////////////////////
|
|
80
|
+
|
|
81
|
+
export const viewportStyles = cva('p-1', {
|
|
82
|
+
variants: {
|
|
83
|
+
position: {
|
|
84
|
+
popper: twJoin({
|
|
85
|
+
display: 'w-full scroll-my-1',
|
|
86
|
+
vars: [
|
|
87
|
+
'h-[var(--radix-select-trigger-height)]',
|
|
88
|
+
'min-w-[var(--radix-select-trigger-width)]'
|
|
89
|
+
]
|
|
90
|
+
}),
|
|
91
|
+
'item-aligned': ''
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
defaultVariants: {
|
|
95
|
+
position: 'popper'
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
// /////////////////////////
|
|
100
|
+
|
|
101
|
+
export const contentStyles = cva(
|
|
102
|
+
twJoin({
|
|
103
|
+
position: 'relative z-50',
|
|
104
|
+
display: 'min-w-[8rem] overflow-x-hidden overflow-y-auto',
|
|
105
|
+
text: 'text-gray-900',
|
|
106
|
+
visual: 'bg-white rounded-md shadow-lg',
|
|
107
|
+
attrs: [
|
|
108
|
+
'data-[state=open]:animate-in',
|
|
109
|
+
'data-[state=open]:fade-in-0',
|
|
110
|
+
'data-[state=open]:zoom-in-95',
|
|
111
|
+
//
|
|
112
|
+
'data-[state=closed]:animate-out',
|
|
113
|
+
'data-[state=closed]:fade-out-0',
|
|
114
|
+
'data-[state=closed]:zoom-out-95',
|
|
115
|
+
//
|
|
116
|
+
'data-[side=top]:slide-in-from-bottom-2',
|
|
117
|
+
'data-[side=right]:slide-in-from-left-2',
|
|
118
|
+
'data-[side=bottom]:slide-in-from-top-2',
|
|
119
|
+
'data-[side=left]:slide-in-from-right-2'
|
|
120
|
+
],
|
|
121
|
+
vars: [
|
|
122
|
+
'max-h-(--radix-select-content-available-height)',
|
|
123
|
+
'origin-(--radix-select-content-transform-origin)'
|
|
124
|
+
],
|
|
125
|
+
//
|
|
126
|
+
dark: {
|
|
127
|
+
text: 'dark:text-dark-gray-300',
|
|
128
|
+
visual: 'dark:bg-tooltip dark:shadow-dark-lg'
|
|
129
|
+
}
|
|
130
|
+
}),
|
|
131
|
+
{
|
|
132
|
+
variants: {
|
|
133
|
+
position: {
|
|
134
|
+
popper: twJoin({
|
|
135
|
+
attrs: [
|
|
136
|
+
'data-[side=top]:-translate-y-1',
|
|
137
|
+
'data-[side=right]:translate-x-1',
|
|
138
|
+
'data-[side=bottom]:translate-y-1',
|
|
139
|
+
'data-[side=left]:-translate-x-1'
|
|
140
|
+
]
|
|
141
|
+
}),
|
|
142
|
+
'item-aligned': ''
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
defaultVariants: {
|
|
146
|
+
position: 'popper'
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
)
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactNode } from 'react'
|
|
2
|
+
|
|
3
|
+
import { Select as RadixSelect } from 'radix-ui'
|
|
4
|
+
|
|
5
|
+
import { TbChevronDown } from 'react-icons/tb'
|
|
6
|
+
|
|
7
|
+
import { contentStyles, triggerStyles, viewportStyles } from './Select.styles'
|
|
8
|
+
|
|
9
|
+
import { Item } from './Item'
|
|
10
|
+
|
|
11
|
+
type SelectProps = ComponentProps<typeof RadixSelect.Root> &
|
|
12
|
+
ComponentProps<typeof RadixSelect.Value> &
|
|
13
|
+
ComponentProps<typeof RadixSelect.Content> & {
|
|
14
|
+
trigger?: ReactNode
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function Select({
|
|
18
|
+
trigger,
|
|
19
|
+
placeholder,
|
|
20
|
+
children,
|
|
21
|
+
align,
|
|
22
|
+
position = 'popper',
|
|
23
|
+
sideOffset,
|
|
24
|
+
className,
|
|
25
|
+
...props
|
|
26
|
+
}: SelectProps) {
|
|
27
|
+
return (
|
|
28
|
+
<RadixSelect.Root {...props}>
|
|
29
|
+
<RadixSelect.Trigger
|
|
30
|
+
asChild={!!trigger}
|
|
31
|
+
className={!trigger ? triggerStyles({ className }) : ''}
|
|
32
|
+
>
|
|
33
|
+
{trigger ? (
|
|
34
|
+
trigger
|
|
35
|
+
) : (
|
|
36
|
+
<>
|
|
37
|
+
<RadixSelect.Value placeholder={placeholder} />
|
|
38
|
+
<RadixSelect.Icon>
|
|
39
|
+
<TbChevronDown />
|
|
40
|
+
</RadixSelect.Icon>
|
|
41
|
+
</>
|
|
42
|
+
)}
|
|
43
|
+
</RadixSelect.Trigger>
|
|
44
|
+
<RadixSelect.Portal>
|
|
45
|
+
<RadixSelect.Content
|
|
46
|
+
align={align}
|
|
47
|
+
position={position}
|
|
48
|
+
sideOffset={sideOffset}
|
|
49
|
+
className={contentStyles({ position, className })}
|
|
50
|
+
>
|
|
51
|
+
<RadixSelect.ScrollUpButton />
|
|
52
|
+
<RadixSelect.Viewport
|
|
53
|
+
className={viewportStyles({ position })}
|
|
54
|
+
>
|
|
55
|
+
{children}
|
|
56
|
+
</RadixSelect.Viewport>
|
|
57
|
+
<RadixSelect.ScrollDownButton />
|
|
58
|
+
<RadixSelect.Arrow />
|
|
59
|
+
</RadixSelect.Content>
|
|
60
|
+
</RadixSelect.Portal>
|
|
61
|
+
</RadixSelect.Root>
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
Select.Item = Item
|
|
66
|
+
Select.Value = RadixSelect.Value
|
|
67
|
+
|
|
68
|
+
export { Select }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Select } from './Select'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { twJoin } from '@/utils'
|
|
2
|
+
|
|
3
|
+
export const rootStyles = twJoin({
|
|
4
|
+
visual: 'bg-divider',
|
|
5
|
+
attrs: [
|
|
6
|
+
'data-[orientation="horizontal"]:h-px',
|
|
7
|
+
'data-[orientation="vertical"]:w-px data-[orientation="vertical"]:h-full'
|
|
8
|
+
],
|
|
9
|
+
//
|
|
10
|
+
dark: {
|
|
11
|
+
visual: 'dark:bg-dark-divider'
|
|
12
|
+
}
|
|
13
|
+
})
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import clsx from 'clsx'
|
|
2
|
+
import { type ComponentProps } from 'react'
|
|
3
|
+
|
|
4
|
+
import { Separator as SeparatorRadix } from 'radix-ui'
|
|
5
|
+
|
|
6
|
+
import { rootStyles } from './Separator.styles'
|
|
7
|
+
|
|
8
|
+
type AvatarProps = ComponentProps<typeof SeparatorRadix.Root>
|
|
9
|
+
|
|
10
|
+
function Separator({ orientation, decorative, className }: AvatarProps) {
|
|
11
|
+
return (
|
|
12
|
+
<SeparatorRadix.Root
|
|
13
|
+
orientation={orientation}
|
|
14
|
+
decorative={decorative}
|
|
15
|
+
className={clsx(rootStyles, className)}
|
|
16
|
+
/>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { Separator }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Separator } from './Separator'
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { VariantProps, cva } from 'class-variance-authority'
|
|
2
|
+
|
|
3
|
+
import { twJoin } from '@/utils'
|
|
4
|
+
|
|
5
|
+
export const overlayStyles = twJoin({
|
|
6
|
+
position: 'fixed inset-0 z-50',
|
|
7
|
+
visual: 'bg-black/50',
|
|
8
|
+
attrs: [
|
|
9
|
+
'data-[state=open]:animate-in',
|
|
10
|
+
'data-[state=open]:fade-in-0',
|
|
11
|
+
//
|
|
12
|
+
'data-[state=closed]:animate-out',
|
|
13
|
+
'data-[state=closed]:fade-out-0'
|
|
14
|
+
]
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
// /////////////////////////
|
|
18
|
+
|
|
19
|
+
export const contentStyles = cva(
|
|
20
|
+
twJoin({
|
|
21
|
+
position: 'fixed z-50',
|
|
22
|
+
display: 'flex flex-col gap-4',
|
|
23
|
+
visual: 'bg-white shadow-lg border-divider',
|
|
24
|
+
animation: 'transition ease-in-out',
|
|
25
|
+
attrs: [
|
|
26
|
+
'data-[state=open]:animate-in',
|
|
27
|
+
'data-[state=open]:duration-500',
|
|
28
|
+
//
|
|
29
|
+
'data-[state=closed]:animate-out',
|
|
30
|
+
'data-[state=closed]:duration-300'
|
|
31
|
+
],
|
|
32
|
+
//
|
|
33
|
+
dark: 'dark:bg-dark-gray-900 dark:shadow-dark-lg dark:border-dark-divider'
|
|
34
|
+
}),
|
|
35
|
+
{
|
|
36
|
+
variants: {
|
|
37
|
+
side: {
|
|
38
|
+
right: twJoin({
|
|
39
|
+
position: 'inset-y-0 right-0',
|
|
40
|
+
display: 'w-3/4 h-full sm:max-w-sm',
|
|
41
|
+
visual: 'border-l',
|
|
42
|
+
attrs: [
|
|
43
|
+
'data-[state=open]:slide-in-from-right',
|
|
44
|
+
'data-[state=closed]:slide-out-to-right'
|
|
45
|
+
]
|
|
46
|
+
}),
|
|
47
|
+
left: twJoin({
|
|
48
|
+
position: 'inset-y-0 left-0',
|
|
49
|
+
display: 'w-3/4 h-full sm:max-w-sm',
|
|
50
|
+
visual: 'border-r',
|
|
51
|
+
attrs: [
|
|
52
|
+
'data-[state=open]:slide-in-from-left',
|
|
53
|
+
'data-[state=closed]:slide-out-to-left'
|
|
54
|
+
]
|
|
55
|
+
}),
|
|
56
|
+
top: twJoin({
|
|
57
|
+
position: 'inset-x-0 top-0',
|
|
58
|
+
display: 'h-auto',
|
|
59
|
+
visual: 'border-b',
|
|
60
|
+
attrs: [
|
|
61
|
+
'data-[state=open]:slide-in-from-top',
|
|
62
|
+
'data-[state=closed]:slide-out-to-top'
|
|
63
|
+
]
|
|
64
|
+
}),
|
|
65
|
+
bottom: twJoin({
|
|
66
|
+
position: 'inset-x-0 bottom-0',
|
|
67
|
+
display: 'h-auto',
|
|
68
|
+
visual: 'border-t',
|
|
69
|
+
attrs: [
|
|
70
|
+
'data-[state=open]:slide-in-from-bottom',
|
|
71
|
+
'data-[state=closed]:slide-out-to-bottom'
|
|
72
|
+
]
|
|
73
|
+
})
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
defaultVariants: {
|
|
77
|
+
side: 'left'
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
export type ContentStylesProps = VariantProps<typeof contentStyles>
|
|
83
|
+
|
|
84
|
+
// /////////////////////////
|
|
85
|
+
|
|
86
|
+
export const headerStyles = twJoin({
|
|
87
|
+
display: 'hidden'
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
// /////////////////////////
|
|
91
|
+
|
|
92
|
+
export const closeStyles = twJoin({
|
|
93
|
+
position: 'absolute top-4 right-4',
|
|
94
|
+
display: 'opacity-70',
|
|
95
|
+
visual: 'rounded-xs',
|
|
96
|
+
animation: 'transition-opacity',
|
|
97
|
+
hover: 'hover:opacity-100',
|
|
98
|
+
disabled: 'disabled:pointer-events-none',
|
|
99
|
+
attrs: 'data-[state=open]:bg-secondary'
|
|
100
|
+
})
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as SheetRadix from '@radix-ui/react-dialog'
|
|
2
|
+
import { type ComponentProps } from 'react'
|
|
3
|
+
|
|
4
|
+
import { IoClose } from 'react-icons/io5'
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
type ContentStylesProps,
|
|
8
|
+
closeStyles,
|
|
9
|
+
contentStyles,
|
|
10
|
+
headerStyles,
|
|
11
|
+
overlayStyles
|
|
12
|
+
} from './Sheet.styles'
|
|
13
|
+
|
|
14
|
+
type SheetProps = ComponentProps<typeof SheetRadix.Root> &
|
|
15
|
+
ContentStylesProps & {
|
|
16
|
+
title?: string
|
|
17
|
+
description?: string
|
|
18
|
+
closeButton?: boolean
|
|
19
|
+
className?: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function Sheet({
|
|
23
|
+
title,
|
|
24
|
+
description,
|
|
25
|
+
closeButton,
|
|
26
|
+
children,
|
|
27
|
+
side,
|
|
28
|
+
className,
|
|
29
|
+
...props
|
|
30
|
+
}: SheetProps) {
|
|
31
|
+
return (
|
|
32
|
+
<SheetRadix.Root {...props}>
|
|
33
|
+
<SheetRadix.Portal>
|
|
34
|
+
<SheetRadix.Overlay className={overlayStyles} />
|
|
35
|
+
<SheetRadix.Content
|
|
36
|
+
className={contentStyles({ side, className })}
|
|
37
|
+
>
|
|
38
|
+
<div className={headerStyles}>
|
|
39
|
+
<SheetRadix.Title>{title}</SheetRadix.Title>
|
|
40
|
+
</div>
|
|
41
|
+
{children}
|
|
42
|
+
{closeButton && (
|
|
43
|
+
<SheetRadix.Close className={closeStyles}>
|
|
44
|
+
<IoClose />
|
|
45
|
+
</SheetRadix.Close>
|
|
46
|
+
)}
|
|
47
|
+
</SheetRadix.Content>
|
|
48
|
+
</SheetRadix.Portal>
|
|
49
|
+
</SheetRadix.Root>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { Sheet }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Sheet } from './Sheet'
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
2
|
+
|
|
3
|
+
import { twJoin } from '@/utils'
|
|
4
|
+
|
|
5
|
+
export const rootStyles = cva(
|
|
6
|
+
twJoin({
|
|
7
|
+
display: 'inline-block',
|
|
8
|
+
visual: 'bg-gray-200',
|
|
9
|
+
animation: 'animate-pulse',
|
|
10
|
+
//
|
|
11
|
+
dark: 'dark:bg-dark-gray-800'
|
|
12
|
+
}),
|
|
13
|
+
{
|
|
14
|
+
variants: {
|
|
15
|
+
circle: {
|
|
16
|
+
true: 'rounded-full!'
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
sm: 'rounded-sm',
|
|
20
|
+
md: 'rounded-md'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
circle: false,
|
|
25
|
+
size: 'md'
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
export type RootStylesProps = VariantProps<typeof rootStyles>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react'
|
|
2
|
+
|
|
3
|
+
import { rootStyles, type RootStylesProps } from './Skeleton.styles'
|
|
4
|
+
|
|
5
|
+
type SkeletonProps = ComponentProps<'div'> & RootStylesProps
|
|
6
|
+
|
|
7
|
+
function Skeleton({ circle, size, className }: SkeletonProps) {
|
|
8
|
+
return <span className={rootStyles({ circle, size, className })} />
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { Skeleton }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Skeleton } from './Skeleton'
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { twJoin } from '@/utils'
|
|
2
|
+
|
|
3
|
+
export const rootStyles = twJoin({
|
|
4
|
+
display: 'size-full inline-flex items-center justify-center p-2',
|
|
5
|
+
text: 'text-gray',
|
|
6
|
+
//
|
|
7
|
+
dark: {
|
|
8
|
+
text: 'dark:text-dark-gray-800'
|
|
9
|
+
}
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
// /////////////////////////
|
|
13
|
+
|
|
14
|
+
export const iconStyles = twJoin({
|
|
15
|
+
text: 'leading-none',
|
|
16
|
+
animation: 'animate-spin'
|
|
17
|
+
})
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import clsx from 'clsx'
|
|
2
|
+
|
|
3
|
+
import { TbLoader2 } from 'react-icons/tb'
|
|
4
|
+
|
|
5
|
+
import { iconStyles, rootStyles } from './Spin.styles'
|
|
6
|
+
|
|
7
|
+
type SpinProps = {
|
|
8
|
+
className?: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function Spin({ className }: SpinProps) {
|
|
12
|
+
return (
|
|
13
|
+
<span className={clsx(rootStyles, className)}>
|
|
14
|
+
<TbLoader2 className={iconStyles} />
|
|
15
|
+
</span>
|
|
16
|
+
)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { Spin }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Spin } from './Spin'
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { VariantProps, cva } from 'class-variance-authority'
|
|
2
|
+
|
|
3
|
+
import { twJoin } from '@/utils'
|
|
4
|
+
|
|
5
|
+
export const rootStyles = cva(
|
|
6
|
+
twJoin({
|
|
7
|
+
tw: 'peer',
|
|
8
|
+
display: 'w-7.5 h-4.5 p-0.5 mr-0.5',
|
|
9
|
+
visual: 'border border-divider rounded-full',
|
|
10
|
+
attrs: 'data-[state="checked"]:shadow-sm'
|
|
11
|
+
}),
|
|
12
|
+
{
|
|
13
|
+
variants: {
|
|
14
|
+
color: {
|
|
15
|
+
primary:
|
|
16
|
+
'data-[state="checked"]:bg-primary data-[state="checked"]:border-primary'
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
color: 'primary'
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
export type RootStylesProps = VariantProps<typeof rootStyles>
|
|
26
|
+
|
|
27
|
+
// /////////////////////////
|
|
28
|
+
|
|
29
|
+
export const thumbStyles = twJoin({
|
|
30
|
+
display: 'block size-3',
|
|
31
|
+
visual: 'bg-divider rounded-full',
|
|
32
|
+
animation: 'transition-all',
|
|
33
|
+
attrs: 'data-[state="checked"]:translate-x-full data-[state="checked"]:bg-white'
|
|
34
|
+
})
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react'
|
|
2
|
+
|
|
3
|
+
import { Switch as RadixSwitch } from 'radix-ui'
|
|
4
|
+
|
|
5
|
+
import { type RootStylesProps, rootStyles, thumbStyles } from './Switch.styles'
|
|
6
|
+
|
|
7
|
+
type SwitchProps = ComponentProps<typeof RadixSwitch.Root> & RootStylesProps
|
|
8
|
+
|
|
9
|
+
function Switch({ color, className, ...props }: SwitchProps) {
|
|
10
|
+
return (
|
|
11
|
+
<RadixSwitch.Root
|
|
12
|
+
className={rootStyles({ color, className })}
|
|
13
|
+
{...props}
|
|
14
|
+
>
|
|
15
|
+
<RadixSwitch.Thumb className={thumbStyles} />
|
|
16
|
+
</RadixSwitch.Root>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { Switch }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Switch } from './Switch'
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { twJoin } from '@/utils'
|
|
2
|
+
|
|
3
|
+
export const filterContentStyles = twJoin({
|
|
4
|
+
display: 'min-w-48 -mx-2 mb-2 pb-2',
|
|
5
|
+
visual: 'border-b border-divider',
|
|
6
|
+
childs: '[&_svg]:size-4.5',
|
|
7
|
+
//
|
|
8
|
+
dark: {
|
|
9
|
+
visual: 'dark:border-dark-divider'
|
|
10
|
+
}
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
// /////////////////////////
|
|
14
|
+
|
|
15
|
+
export const filterButtonStyles = twJoin({
|
|
16
|
+
display: 'flex w-full items-center px-2 py-1 mt-0.5 first:mt-0',
|
|
17
|
+
visual: 'rounded-sm',
|
|
18
|
+
hover: 'hover:bg-gray-100',
|
|
19
|
+
attrs: [
|
|
20
|
+
'data-[state=checked]:bg-primary/16',
|
|
21
|
+
'data-[state=checked]:[&_span]:text-primary'
|
|
22
|
+
],
|
|
23
|
+
//
|
|
24
|
+
dark: {
|
|
25
|
+
hover: 'dark:[&[data-state="unchecked"]]:hover:bg-dark-gray-800/50'
|
|
26
|
+
}
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
// /////////////////////////
|
|
30
|
+
|
|
31
|
+
export const filterButtonTextStyles = twJoin({
|
|
32
|
+
display: 'inline-flex items-center gap-1.5'
|
|
33
|
+
})
|