bmdl-sdk 1.5.8 → 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 +36 -15
- 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.8.tgz +0 -0
- package/index.html +0 -12
- package/src/App.tsx +0 -187
- package/src/main.tsx +0 -15
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority'
|
|
2
|
+
|
|
3
|
+
import { twJoin } from '@/utils'
|
|
4
|
+
|
|
5
|
+
export const rootStyles = cva(
|
|
6
|
+
twJoin({
|
|
7
|
+
display:
|
|
8
|
+
'flex flex-grow-0 flex-shrink-0 size-9.5 items-center justify-center overflow-hidden',
|
|
9
|
+
text: 'text-gray',
|
|
10
|
+
visual: 'rounded-full outline-none',
|
|
11
|
+
hover: 'hover:bg-gray-200/32',
|
|
12
|
+
attrs: 'data-[state="open"]:bg-gray-200/32',
|
|
13
|
+
childs: '[&_svg]:size-5.5',
|
|
14
|
+
//
|
|
15
|
+
dark: {
|
|
16
|
+
text: 'dark:[&_svg]:text-dark-gray-600',
|
|
17
|
+
hover: 'dark:hover:bg-dark-gray-800/50',
|
|
18
|
+
attrs: ['dark:data-[state=open]:bg-dark-gray-800/50']
|
|
19
|
+
}
|
|
20
|
+
}),
|
|
21
|
+
{
|
|
22
|
+
variants: {
|
|
23
|
+
disabled: {
|
|
24
|
+
true: 'pointer-events-none'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
disabled: false
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useTranslations } from 'next-intl'
|
|
2
|
+
import { type ComponentProps } from 'react'
|
|
3
|
+
|
|
4
|
+
import { DropdownMenu } from 'radix-ui'
|
|
5
|
+
|
|
6
|
+
import { TbDotsVertical } from 'react-icons/tb'
|
|
7
|
+
|
|
8
|
+
import { Dropdown } from '@/components/atoms'
|
|
9
|
+
|
|
10
|
+
import { rootStyles } from './Actions.styles'
|
|
11
|
+
|
|
12
|
+
type ActionsProps = ComponentProps<typeof DropdownMenu.Content> & {
|
|
13
|
+
className?: string
|
|
14
|
+
disabled?: boolean
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function Actions({ sideOffset, disabled, className }: ActionsProps) {
|
|
18
|
+
const t = useTranslations()
|
|
19
|
+
//
|
|
20
|
+
return (
|
|
21
|
+
<Dropdown
|
|
22
|
+
trigger={
|
|
23
|
+
<button className={rootStyles({ disabled, className })}>
|
|
24
|
+
<TbDotsVertical />
|
|
25
|
+
</button>
|
|
26
|
+
}
|
|
27
|
+
sideOffset={sideOffset}
|
|
28
|
+
align='end'
|
|
29
|
+
className='overflow-y-hidden'
|
|
30
|
+
>
|
|
31
|
+
<Dropdown.Item asChild>
|
|
32
|
+
<button>{t('edit')}</button>
|
|
33
|
+
</Dropdown.Item>
|
|
34
|
+
<Dropdown.Item asChild>
|
|
35
|
+
<button>{t('update')}</button>
|
|
36
|
+
</Dropdown.Item>
|
|
37
|
+
<Dropdown.Divider />
|
|
38
|
+
<Dropdown.Item asChild className='text-danger'>
|
|
39
|
+
<button>{t('delete')}</button>
|
|
40
|
+
</Dropdown.Item>
|
|
41
|
+
</Dropdown>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { Actions }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Actions } from './Actions'
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { type VariantProps, cva } from 'class-variance-authority'
|
|
2
|
+
|
|
3
|
+
import { twJoin } from '@/utils'
|
|
4
|
+
|
|
5
|
+
export const rootStyles = cva(
|
|
6
|
+
twJoin({
|
|
7
|
+
position: 'relative',
|
|
8
|
+
display: 'flex shrink-0 overflow-hidden',
|
|
9
|
+
visual: 'rounded-full'
|
|
10
|
+
}),
|
|
11
|
+
{
|
|
12
|
+
variants: {
|
|
13
|
+
color: {
|
|
14
|
+
primary: '',
|
|
15
|
+
secondary: '',
|
|
16
|
+
custom: ''
|
|
17
|
+
},
|
|
18
|
+
variant: {
|
|
19
|
+
default: 'text-white',
|
|
20
|
+
label: ''
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
'2xs': 'size-6',
|
|
24
|
+
xs: 'size-6.5',
|
|
25
|
+
sm: 'size-8',
|
|
26
|
+
md: 'size-9.5',
|
|
27
|
+
lg: 'size-12',
|
|
28
|
+
xl: 'size-16',
|
|
29
|
+
'2xl': 'size-18'
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
compoundVariants: [
|
|
33
|
+
{
|
|
34
|
+
color: 'primary',
|
|
35
|
+
variant: 'default',
|
|
36
|
+
class: 'bg-primary'
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
color: 'secondary',
|
|
40
|
+
variant: 'default',
|
|
41
|
+
class: 'bg-secondary'
|
|
42
|
+
},
|
|
43
|
+
//
|
|
44
|
+
{
|
|
45
|
+
color: 'primary',
|
|
46
|
+
variant: 'label',
|
|
47
|
+
class: 'text-primary bg-primary/16'
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
color: 'secondary',
|
|
51
|
+
variant: 'label',
|
|
52
|
+
class: 'text-secondary bg-secondary/16'
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
defaultVariants: {
|
|
56
|
+
variant: 'default',
|
|
57
|
+
size: 'md',
|
|
58
|
+
color: 'primary'
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
export type RootStylesProps = VariantProps<typeof rootStyles>
|
|
64
|
+
|
|
65
|
+
// /////////////////////////
|
|
66
|
+
|
|
67
|
+
export const imageStyles = twJoin({
|
|
68
|
+
display: 'aspect-square size-full'
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
// /////////////////////////
|
|
72
|
+
|
|
73
|
+
export const fallbackStyles = cva(
|
|
74
|
+
twJoin({
|
|
75
|
+
display: 'flex size-full items-center justify-center',
|
|
76
|
+
text: 'font-semibold leading-none',
|
|
77
|
+
visual: 'rounded-full'
|
|
78
|
+
}),
|
|
79
|
+
{
|
|
80
|
+
variants: {
|
|
81
|
+
size: {
|
|
82
|
+
'2xs': 'text-xs',
|
|
83
|
+
xs: 'text-xs',
|
|
84
|
+
sm: 'text-sm',
|
|
85
|
+
md: 'text-base',
|
|
86
|
+
lg: 'text-lg',
|
|
87
|
+
xl: 'text-3xl',
|
|
88
|
+
'2xl': 'text-4xl'
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
defaultVariants: {
|
|
92
|
+
size: 'md'
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react'
|
|
2
|
+
|
|
3
|
+
import { Avatar as RadixAvatar } from 'radix-ui'
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
fallbackStyles,
|
|
7
|
+
imageStyles,
|
|
8
|
+
rootStyles,
|
|
9
|
+
type RootStylesProps
|
|
10
|
+
} from './Avatar.styles'
|
|
11
|
+
|
|
12
|
+
import { getInitials } from '@/utils'
|
|
13
|
+
|
|
14
|
+
type AvatarProps = ComponentProps<typeof RadixAvatar.Root> &
|
|
15
|
+
RootStylesProps & {
|
|
16
|
+
src?: string | null
|
|
17
|
+
alt: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function Avatar({
|
|
21
|
+
src,
|
|
22
|
+
alt,
|
|
23
|
+
color,
|
|
24
|
+
variant,
|
|
25
|
+
size,
|
|
26
|
+
className,
|
|
27
|
+
...props
|
|
28
|
+
}: AvatarProps) {
|
|
29
|
+
return (
|
|
30
|
+
<RadixAvatar.Root
|
|
31
|
+
className={rootStyles({ color, variant, size, className })}
|
|
32
|
+
{...props}
|
|
33
|
+
>
|
|
34
|
+
<RadixAvatar.Image
|
|
35
|
+
src={src || undefined}
|
|
36
|
+
alt={alt}
|
|
37
|
+
className={imageStyles}
|
|
38
|
+
/>
|
|
39
|
+
<RadixAvatar.Fallback className={fallbackStyles({ size })}>
|
|
40
|
+
{getInitials(alt)}
|
|
41
|
+
</RadixAvatar.Fallback>
|
|
42
|
+
</RadixAvatar.Root>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { Avatar }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Avatar } from './Avatar'
|
|
@@ -0,0 +1,93 @@
|
|
|
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-flex items-center justify-center shrink-0',
|
|
8
|
+
text: 'font-medium whitespace-nowrap leading-none! tracking-wide'
|
|
9
|
+
}),
|
|
10
|
+
{
|
|
11
|
+
variants: {
|
|
12
|
+
color: {
|
|
13
|
+
primary: '',
|
|
14
|
+
danger: ''
|
|
15
|
+
},
|
|
16
|
+
variant: {
|
|
17
|
+
default: 'text-white',
|
|
18
|
+
label: ''
|
|
19
|
+
},
|
|
20
|
+
size: {
|
|
21
|
+
xs: 'h-4 px-1.5 py-1 text-xs rounded-sm',
|
|
22
|
+
sm: 'h-4.5 px-2 py-1.5 text-sm rounded-sm',
|
|
23
|
+
md: 'h-6 px-2.5 py-1.5 text-sm rounded-md [&_svg]:size-4'
|
|
24
|
+
},
|
|
25
|
+
pill: {
|
|
26
|
+
true: 'rounded-full!'
|
|
27
|
+
},
|
|
28
|
+
icon: {
|
|
29
|
+
true: ''
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
compoundVariants: [
|
|
33
|
+
{
|
|
34
|
+
size: 'xs',
|
|
35
|
+
icon: true,
|
|
36
|
+
class: 'size-4 py-1'
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
size: 'sm',
|
|
40
|
+
icon: true,
|
|
41
|
+
class: 'size-4.5 py-1.5'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
size: 'md',
|
|
45
|
+
icon: true,
|
|
46
|
+
class: 'size-6 py-1.5'
|
|
47
|
+
},
|
|
48
|
+
//
|
|
49
|
+
{
|
|
50
|
+
color: 'primary',
|
|
51
|
+
variant: 'default',
|
|
52
|
+
class: twJoin({
|
|
53
|
+
visual: 'bg-primary shadow-primary-sm',
|
|
54
|
+
dark: 'dark:shadow-dark-sm'
|
|
55
|
+
})
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
color: 'primary',
|
|
59
|
+
variant: 'label',
|
|
60
|
+
class: twJoin({
|
|
61
|
+
text: 'text-primary',
|
|
62
|
+
visual: 'bg-primary/16'
|
|
63
|
+
})
|
|
64
|
+
},
|
|
65
|
+
//
|
|
66
|
+
{
|
|
67
|
+
color: 'danger',
|
|
68
|
+
variant: 'default',
|
|
69
|
+
class: twJoin({
|
|
70
|
+
visual: 'bg-danger shadow-danger-sm',
|
|
71
|
+
dark: 'dark:shadow-dark-sm'
|
|
72
|
+
})
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
color: 'danger',
|
|
76
|
+
variant: 'label',
|
|
77
|
+
class: twJoin({
|
|
78
|
+
text: 'text-danger',
|
|
79
|
+
visual: 'bg-danger/16'
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
defaultVariants: {
|
|
84
|
+
variant: 'default',
|
|
85
|
+
size: 'md',
|
|
86
|
+
color: 'primary',
|
|
87
|
+
pill: false,
|
|
88
|
+
icon: false
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
export type RootStylesProps = VariantProps<typeof rootStyles>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react'
|
|
2
|
+
|
|
3
|
+
import { rootStyles, type RootStylesProps } from './Badge.styles'
|
|
4
|
+
|
|
5
|
+
type BadgeProps = ComponentProps<'span'> & RootStylesProps
|
|
6
|
+
|
|
7
|
+
function Badge({
|
|
8
|
+
variant,
|
|
9
|
+
size,
|
|
10
|
+
pill,
|
|
11
|
+
icon,
|
|
12
|
+
color,
|
|
13
|
+
className,
|
|
14
|
+
...props
|
|
15
|
+
}: BadgeProps) {
|
|
16
|
+
return (
|
|
17
|
+
<span
|
|
18
|
+
className={rootStyles({
|
|
19
|
+
variant,
|
|
20
|
+
size,
|
|
21
|
+
pill,
|
|
22
|
+
icon,
|
|
23
|
+
color,
|
|
24
|
+
className
|
|
25
|
+
})}
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { Badge }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Badge } from './Badge'
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { type VariantProps, cva } from 'class-variance-authority'
|
|
2
|
+
|
|
3
|
+
import { twJoin } from '@/utils'
|
|
4
|
+
|
|
5
|
+
export const rootStyles = cva(
|
|
6
|
+
twJoin({
|
|
7
|
+
mouse: 'cursor-pointer',
|
|
8
|
+
display: 'inline-flex items-center justify-center shrink-0',
|
|
9
|
+
text: 'font-medium whitespace-nowrap leading-none! tracking-wide',
|
|
10
|
+
animation: 'transition-all',
|
|
11
|
+
disabled: [
|
|
12
|
+
'disabled:cursor-not-allowed!',
|
|
13
|
+
'disabled:select-none',
|
|
14
|
+
'disabled:opacity-65',
|
|
15
|
+
'disabled:shadow-none'
|
|
16
|
+
]
|
|
17
|
+
}),
|
|
18
|
+
{
|
|
19
|
+
variants: {
|
|
20
|
+
color: {
|
|
21
|
+
primary: '',
|
|
22
|
+
secondary: '',
|
|
23
|
+
success: '',
|
|
24
|
+
info: '',
|
|
25
|
+
custom: ''
|
|
26
|
+
},
|
|
27
|
+
variant: {
|
|
28
|
+
default: 'text-white focus-visible:outline-none',
|
|
29
|
+
outline: 'bg-transparent outline shadow-none',
|
|
30
|
+
label: 'focus-visible:outline-none'
|
|
31
|
+
},
|
|
32
|
+
size: {
|
|
33
|
+
xs: 'h-6 px-2.5 py-1 text-xs rounded-sm gap-1',
|
|
34
|
+
sm: 'h-7 px-3.5 py-1.5 text-sm rounded-sm gap-1',
|
|
35
|
+
md: 'h-9.5 px-5 py-2.5 text-base rounded-md gap-2 [&_svg]:size-4.5',
|
|
36
|
+
lg: 'h-12 px-6.5 py-[13px] text-lg rounded-lg',
|
|
37
|
+
icon: 'size-9.5 p-2 text-2xl rounded-md'
|
|
38
|
+
},
|
|
39
|
+
block: {
|
|
40
|
+
true: 'w-full'
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
compoundVariants: [
|
|
44
|
+
{
|
|
45
|
+
color: 'primary',
|
|
46
|
+
variant: 'default',
|
|
47
|
+
class: twJoin({
|
|
48
|
+
visual: 'bg-primary shadow-primary-sm',
|
|
49
|
+
hover: 'hover:not-disabled:text-white hover:bg-primary-600',
|
|
50
|
+
focus: 'focus-visible:not-disabled:bg-primary-600',
|
|
51
|
+
active: 'active:not-disabled:bg-primary-600',
|
|
52
|
+
dark: 'dark:shadow-dark-sm'
|
|
53
|
+
})
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
color: 'primary',
|
|
57
|
+
variant: 'outline',
|
|
58
|
+
class: twJoin({
|
|
59
|
+
text: 'text-primary',
|
|
60
|
+
visual: 'outline-primary',
|
|
61
|
+
hover: 'hover:not-disabled:bg-primary/8',
|
|
62
|
+
focus: 'focus-visible:not-disabled:bg-primary/8',
|
|
63
|
+
active: 'active:not-disabled:bg-primary/16'
|
|
64
|
+
})
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
color: 'primary',
|
|
68
|
+
variant: 'label',
|
|
69
|
+
class: twJoin({
|
|
70
|
+
text: 'text-primary',
|
|
71
|
+
visual: 'bg-primary/16',
|
|
72
|
+
hover: 'hover:not-disabled:bg-primary/24',
|
|
73
|
+
focus: 'focus-visible:not-disabled:bg-primary/24',
|
|
74
|
+
active: 'active:not-disabled:bg-primary/24'
|
|
75
|
+
})
|
|
76
|
+
},
|
|
77
|
+
//
|
|
78
|
+
{
|
|
79
|
+
color: 'secondary',
|
|
80
|
+
variant: 'default',
|
|
81
|
+
class: twJoin({
|
|
82
|
+
visual: 'bg-secondary shadow-sm',
|
|
83
|
+
hover: 'hover:not-disabled:text-white hover:bg-secondary-600',
|
|
84
|
+
focus: 'focus-visible:not-disabled:bg-secondary-600',
|
|
85
|
+
active: 'active:not-disabled:bg-secondary-600',
|
|
86
|
+
dark: 'dark:shadow-dark-sm'
|
|
87
|
+
})
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
color: 'secondary',
|
|
91
|
+
variant: 'outline',
|
|
92
|
+
class: twJoin({
|
|
93
|
+
text: 'text-secondary',
|
|
94
|
+
visual: 'outline-secondary',
|
|
95
|
+
hover: 'hover:not-disabled:bg-secondary/8',
|
|
96
|
+
focus: 'focus-visible:not-disabled:bg-secondary/8',
|
|
97
|
+
active: 'active:not-disabled:bg-secondary/16'
|
|
98
|
+
})
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
color: 'secondary',
|
|
102
|
+
variant: 'label',
|
|
103
|
+
class: twJoin({
|
|
104
|
+
text: 'text-secondary',
|
|
105
|
+
visual: 'bg-secondary/16',
|
|
106
|
+
hover: 'hover:not-disabled:not-disabled:bg-secondary/24',
|
|
107
|
+
focus: 'focus-visible:not-disabled:bg-secondary/24',
|
|
108
|
+
active: 'active:not-disabled:bg-secondary/24'
|
|
109
|
+
})
|
|
110
|
+
},
|
|
111
|
+
//
|
|
112
|
+
{
|
|
113
|
+
color: 'success',
|
|
114
|
+
variant: 'default',
|
|
115
|
+
class: twJoin({
|
|
116
|
+
visual: 'bg-success shadow-sm',
|
|
117
|
+
hover: 'hover:not-disabled:text-white hover:bg-success-600',
|
|
118
|
+
focus: 'focus-visible:not-disabled:bg-success-600',
|
|
119
|
+
active: 'active:not-disabled:bg-success-600',
|
|
120
|
+
dark: 'dark:shadow-dark-sm'
|
|
121
|
+
})
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
color: 'success',
|
|
125
|
+
variant: 'outline',
|
|
126
|
+
class: twJoin({
|
|
127
|
+
text: 'text-success',
|
|
128
|
+
visual: 'outline-success',
|
|
129
|
+
hover: 'hover:not-disabled:bg-success/8',
|
|
130
|
+
focus: 'focus-visible:not-disabled:bg-success/8',
|
|
131
|
+
active: 'active:not-disabled:bg-success/16'
|
|
132
|
+
})
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
color: 'success',
|
|
136
|
+
variant: 'label',
|
|
137
|
+
class: twJoin({
|
|
138
|
+
text: 'text-success',
|
|
139
|
+
visual: 'bg-success/16',
|
|
140
|
+
hover: 'hover:not-disabled:bg-success/24',
|
|
141
|
+
focus: 'focus-visible:not-disabled:bg-success/24',
|
|
142
|
+
active: 'active:not-disabled:bg-success/24'
|
|
143
|
+
})
|
|
144
|
+
},
|
|
145
|
+
//
|
|
146
|
+
{
|
|
147
|
+
color: 'info',
|
|
148
|
+
variant: 'default',
|
|
149
|
+
class: twJoin({
|
|
150
|
+
visual: 'bg-info shadow-sm',
|
|
151
|
+
hover: 'hover:not-disabled:text-white hover:bg-info-600',
|
|
152
|
+
focus: 'focus-visible:not-disabled:bg-info-600',
|
|
153
|
+
active: 'active:not-disabled:bg-info-600',
|
|
154
|
+
dark: 'dark:not-disabled:shadow-dark-sm'
|
|
155
|
+
})
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
color: 'info',
|
|
159
|
+
variant: 'outline',
|
|
160
|
+
class: twJoin({
|
|
161
|
+
text: 'text-info',
|
|
162
|
+
visual: 'outline-info',
|
|
163
|
+
hover: 'hover:not-disabled:bg-info/8',
|
|
164
|
+
focus: 'focus-visible:not-disabled:bg-info/8',
|
|
165
|
+
active: 'active:not-disabled:bg-info/16'
|
|
166
|
+
})
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
color: 'info',
|
|
170
|
+
variant: 'label',
|
|
171
|
+
class: twJoin({
|
|
172
|
+
text: 'text-info',
|
|
173
|
+
visual: 'bg-info/16',
|
|
174
|
+
hover: 'hover:not-disabled:bg-info/24',
|
|
175
|
+
focus: 'focus-visible:not-disabled:bg-info/24',
|
|
176
|
+
active: 'active:not-disabled:bg-info/24'
|
|
177
|
+
})
|
|
178
|
+
}
|
|
179
|
+
],
|
|
180
|
+
defaultVariants: {
|
|
181
|
+
variant: 'default',
|
|
182
|
+
size: 'md',
|
|
183
|
+
color: 'primary',
|
|
184
|
+
block: false
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
|
|
189
|
+
export type RootStylesProps = VariantProps<typeof rootStyles>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react'
|
|
2
|
+
|
|
3
|
+
import { Slot } from 'radix-ui'
|
|
4
|
+
|
|
5
|
+
import { type RootStylesProps, rootStyles } from './Button.styles'
|
|
6
|
+
|
|
7
|
+
type ButtonProps = ComponentProps<'button'> &
|
|
8
|
+
RootStylesProps & { asChild?: boolean }
|
|
9
|
+
|
|
10
|
+
function Button({
|
|
11
|
+
asChild = false,
|
|
12
|
+
variant,
|
|
13
|
+
size,
|
|
14
|
+
color,
|
|
15
|
+
block,
|
|
16
|
+
className,
|
|
17
|
+
...props
|
|
18
|
+
}: ButtonProps) {
|
|
19
|
+
const Comp = asChild ? Slot.Root : 'button'
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<Comp
|
|
23
|
+
className={rootStyles({ variant, size, color, block, className })}
|
|
24
|
+
{...props}
|
|
25
|
+
/>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { Button }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button } from './Button'
|