@js-empire/emperor-ui 1.3.6 → 1.3.8
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/dist/emperor-ui.js +4157 -158
- package/dist/index.d.ts +3 -2
- package/package.json +56 -10
- package/.cursor/rules/code-conventions.mdc +0 -50
- package/.husky/pre-commit +0 -4
- package/.prettierrc +0 -10
- package/.storybook/main.ts +0 -24
- package/.storybook/preview.ts +0 -19
- package/.storybook/vitest.setup.ts +0 -7
- package/.vscode/extensions.json +0 -1
- package/dist/emperor-ui.umd.cjs +0 -77
- package/dist/icons/emperor-ui-logo.ico +0 -0
- package/dist/images/avatar-female.jpg +0 -0
- package/dist/images/avatar-male.jpg +0 -0
- package/dist/images/emperor-ui-logo.png +0 -0
- package/dist/index-ABKcY4tX.js +0 -60607
- package/dist/index-CWu5fG3N.js +0 -6
- package/dist/index-DpemL3iQ.js +0 -291
- package/dist/src-UW24ZMRV-I8bMqcTI.js +0 -6
- package/eslint.config.js +0 -34
- package/index.html +0 -13
- package/public/icons/emperor-ui-logo.ico +0 -0
- package/public/images/avatar-female.jpg +0 -0
- package/public/images/avatar-male.jpg +0 -0
- package/public/images/emperor-ui-logo.png +0 -0
- package/src/animations/blink.ts +0 -26
- package/src/animations/floating.ts +0 -12
- package/src/animations/index.ts +0 -2
- package/src/components/atoms/brand/brand.stories.tsx +0 -27
- package/src/components/atoms/brand/brand.tsx +0 -56
- package/src/components/atoms/brand/index.ts +0 -1
- package/src/components/atoms/brand/styles/classes.ts +0 -9
- package/src/components/atoms/brand/styles/index.ts +0 -2
- package/src/components/atoms/brand/styles/styles.ts +0 -0
- package/src/components/atoms/color-picker/color-picker.tsx +0 -12
- package/src/components/atoms/color-picker/free-color-picker.tsx +0 -58
- package/src/components/atoms/color-picker/index.ts +0 -3
- package/src/components/atoms/color-picker/preset-color-picker.tsx +0 -66
- package/src/components/atoms/color-picker/stories/color-picker.stories.tsx +0 -63
- package/src/components/atoms/column/column.stories.tsx +0 -37
- package/src/components/atoms/column/column.tsx +0 -21
- package/src/components/atoms/column/index.ts +0 -1
- package/src/components/atoms/container/column.stories.tsx +0 -37
- package/src/components/atoms/container/container.tsx +0 -28
- package/src/components/atoms/container/index.ts +0 -1
- package/src/components/atoms/copy-button/copy-button.tsx +0 -73
- package/src/components/atoms/copy-button/index.ts +0 -1
- package/src/components/atoms/copy-button/stories/copy-button.stories.tsx +0 -21
- package/src/components/atoms/field/field.tsx +0 -81
- package/src/components/atoms/field/index.ts +0 -3
- package/src/components/atoms/field/styles/classes.ts +0 -9
- package/src/components/atoms/field/styles/index.ts +0 -1
- package/src/components/atoms/field/units/autocomplete-field.tsx +0 -49
- package/src/components/atoms/field/units/checkbox-field.tsx +0 -35
- package/src/components/atoms/field/units/index.ts +0 -7
- package/src/components/atoms/field/units/input-field.tsx +0 -35
- package/src/components/atoms/field/units/radio-field.tsx +0 -43
- package/src/components/atoms/field/units/select-field.tsx +0 -50
- package/src/components/atoms/field/units/switch-field.tsx +0 -35
- package/src/components/atoms/field/units/textarea-field.tsx +0 -37
- package/src/components/atoms/filter/filter.tsx +0 -93
- package/src/components/atoms/filter/index.ts +0 -3
- package/src/components/atoms/filter/stories/filter.stories.tsx +0 -238
- package/src/components/atoms/filter/styles/classes.ts +0 -20
- package/src/components/atoms/filter/styles/index.ts +0 -1
- package/src/components/atoms/filter/units/autocomplete-filter.tsx +0 -66
- package/src/components/atoms/filter/units/checkbox-filter.tsx +0 -42
- package/src/components/atoms/filter/units/checkbox-group-filter.tsx +0 -68
- package/src/components/atoms/filter/units/date-filter.tsx +0 -46
- package/src/components/atoms/filter/units/index.ts +0 -9
- package/src/components/atoms/filter/units/numeric-filter.tsx +0 -41
- package/src/components/atoms/filter/units/range-filter.tsx +0 -65
- package/src/components/atoms/filter/units/search-filter.tsx +0 -53
- package/src/components/atoms/filter/units/select-filter.tsx +0 -57
- package/src/components/atoms/filter/units/switch-filter.tsx +0 -35
- package/src/components/atoms/index.ts +0 -11
- package/src/components/atoms/portal/index.ts +0 -1
- package/src/components/atoms/portal/portal.stories.tsx +0 -43
- package/src/components/atoms/portal/portal.tsx +0 -25
- package/src/components/atoms/row/index.ts +0 -1
- package/src/components/atoms/row/row.stories.tsx +0 -37
- package/src/components/atoms/row/row.tsx +0 -26
- package/src/components/atoms/theme-switch/index.ts +0 -1
- package/src/components/atoms/theme-switch/styles/classes.ts +0 -16
- package/src/components/atoms/theme-switch/styles/index.ts +0 -1
- package/src/components/atoms/theme-switch/theme-switch.stories.tsx +0 -26
- package/src/components/atoms/theme-switch/theme-switch.tsx +0 -54
- package/src/components/atoms/uploader/components/avatar-label.tsx +0 -102
- package/src/components/atoms/uploader/components/index.ts +0 -8
- package/src/components/atoms/uploader/components/upload-file-error-box.tsx +0 -40
- package/src/components/atoms/uploader/components/upload-file-input.tsx +0 -36
- package/src/components/atoms/uploader/components/upload-file-label.tsx +0 -92
- package/src/components/atoms/uploader/components/upload-file-listing.tsx +0 -64
- package/src/components/atoms/uploader/components/uploader-title.tsx +0 -21
- package/src/components/atoms/uploader/components/uploader.tsx +0 -89
- package/src/components/atoms/uploader/components/view-image-modal.tsx +0 -41
- package/src/components/atoms/uploader/index.ts +0 -1
- package/src/components/atoms/uploader/stories/uploader.stories.tsx +0 -202
- package/src/components/index.ts +0 -4
- package/src/components/molecules/index.ts +0 -4
- package/src/components/molecules/item-card/components/actions/index.ts +0 -3
- package/src/components/molecules/item-card/components/actions/item-actions-buttons.tsx +0 -43
- package/src/components/molecules/item-card/components/actions/item-actions-dropdown.tsx +0 -57
- package/src/components/molecules/item-card/components/actions/item-actions-overlay.tsx +0 -50
- package/src/components/molecules/item-card/components/additions/index.ts +0 -2
- package/src/components/molecules/item-card/components/additions/item-banner.tsx +0 -22
- package/src/components/molecules/item-card/components/additions/loading-item.tsx +0 -88
- package/src/components/molecules/item-card/components/card/index.ts +0 -4
- package/src/components/molecules/item-card/components/card/item-card-body.tsx +0 -74
- package/src/components/molecules/item-card/components/card/item-card-footer.tsx +0 -79
- package/src/components/molecules/item-card/components/card/item-card-header.tsx +0 -69
- package/src/components/molecules/item-card/components/card/item-card.tsx +0 -123
- package/src/components/molecules/item-card/components/index.ts +0 -3
- package/src/components/molecules/item-card/index.ts +0 -2
- package/src/components/molecules/item-card/stories/item-card.stories.tsx +0 -218
- package/src/components/molecules/item-card/styles/classes.ts +0 -141
- package/src/components/molecules/item-card/styles/index.ts +0 -1
- package/src/components/molecules/nav-bar/index.ts +0 -3
- package/src/components/molecules/nav-bar/nav-bar-item.tsx +0 -64
- package/src/components/molecules/nav-bar/nav-bar.tsx +0 -57
- package/src/components/molecules/nav-bar/stories/hover-effect/nav-bar-hover-effect.stories.tsx +0 -52
- package/src/components/molecules/nav-bar/stories/nav-bar.stories.tsx +0 -50
- package/src/components/molecules/nav-bar/styles/classes.ts +0 -68
- package/src/components/molecules/nav-bar/styles/index.ts +0 -2
- package/src/components/molecules/nav-bar/styles/styles.ts +0 -85
- package/src/components/molecules/nav-bar/sub-items-box.tsx +0 -58
- package/src/components/molecules/scaffold/index.ts +0 -2
- package/src/components/molecules/scaffold/scaffold.stories.tsx +0 -21
- package/src/components/molecules/scaffold/scaffold.tsx +0 -23
- package/src/components/molecules/scaffold/styles/index.ts +0 -1
- package/src/components/molecules/scaffold/styles/scaffold-classes.ts +0 -10
- package/src/components/molecules/side-bar/compact-side-bar.tsx +0 -77
- package/src/components/molecules/side-bar/index.ts +0 -1
- package/src/components/molecules/side-bar/side-bar-drawer.tsx +0 -113
- package/src/components/molecules/side-bar/side-bar.stories.tsx +0 -111
- package/src/components/molecules/side-bar/side-bar.tsx +0 -31
- package/src/components/molecules/side-bar/styles/classes.ts +0 -28
- package/src/components/molecules/side-bar/styles/index.ts +0 -2
- package/src/components/molecules/side-bar/styles/styles.ts +0 -13
- package/src/components/organisms/deletion-confirmor/deletion-confirmor.tsx +0 -110
- package/src/components/organisms/deletion-confirmor/index.ts +0 -3
- package/src/components/organisms/deletion-confirmor/stories/components.tsx +0 -25
- package/src/components/organisms/deletion-confirmor/stories/deletion-confirmor.stories.tsx +0 -78
- package/src/components/organisms/deletion-confirmor/styles/classes.ts +0 -28
- package/src/components/organisms/deletion-confirmor/styles/index.ts +0 -2
- package/src/components/organisms/deletion-confirmor/styles/styles.ts +0 -4
- package/src/components/organisms/footer/copy-rights-box.tsx +0 -27
- package/src/components/organisms/footer/footer.tsx +0 -75
- package/src/components/organisms/footer/index.ts +0 -5
- package/src/components/organisms/footer/policies-box.tsx +0 -27
- package/src/components/organisms/footer/quick-links-box.tsx +0 -46
- package/src/components/organisms/footer/social-links-box.tsx +0 -33
- package/src/components/organisms/footer/stories/footer.stories.tsx +0 -61
- package/src/components/organisms/footer/styles/classes.ts +0 -71
- package/src/components/organisms/footer/styles/index.ts +0 -2
- package/src/components/organisms/footer/styles/styles.ts +0 -6
- package/src/components/organisms/form-builder/form-builder.stories.tsx +0 -144
- package/src/components/organisms/form-builder/form-builder.tsx +0 -75
- package/src/components/organisms/form-builder/index.ts +0 -1
- package/src/components/organisms/header/header.tsx +0 -87
- package/src/components/organisms/header/index.ts +0 -1
- package/src/components/organisms/header/segmented-header-content.tsx +0 -29
- package/src/components/organisms/header/stories/header.stories.tsx +0 -144
- package/src/components/organisms/header/styles/classes.ts +0 -22
- package/src/components/organisms/header/styles/index.ts +0 -2
- package/src/components/organisms/header/styles/styles.ts +0 -39
- package/src/components/organisms/index.ts +0 -6
- package/src/components/organisms/item-details/index.ts +0 -1
- package/src/components/organisms/item-details/item-details.tsx +0 -6
- package/src/components/organisms/listings/empty-listings.tsx +0 -80
- package/src/components/organisms/listings/index.ts +0 -3
- package/src/components/organisms/listings/listings.tsx +0 -96
- package/src/components/organisms/listings/stories/grid-listings.stories.tsx +0 -153
- package/src/components/organisms/listings/stories/list-listings.stories.tsx +0 -171
- package/src/components/organisms/listings/styles/classes.ts +0 -49
- package/src/components/organisms/listings/styles/index.ts +0 -2
- package/src/components/organisms/listings/styles/styles.ts +0 -6
- package/src/components/templates/index.ts +0 -1
- package/src/components/templates/landing-page/index.ts +0 -1
- package/src/components/templates/landing-page/landing-page.stories.tsx +0 -21
- package/src/components/templates/landing-page/landing-page.tsx +0 -57
- package/src/components/templates/landing-page/styles/classes.ts +0 -11
- package/src/components/templates/landing-page/styles/index.ts +0 -1
- package/src/constants/animations.ts +0 -14
- package/src/constants/card.tsx +0 -42
- package/src/constants/defaults.ts +0 -59
- package/src/constants/fake.ts +0 -5
- package/src/constants/footer.tsx +0 -157
- package/src/constants/index.ts +0 -6
- package/src/constants/uploader.ts +0 -33
- package/src/context/emperor-ui-context.ts +0 -6
- package/src/context/form-builder-context.tsx +0 -8
- package/src/context/index.ts +0 -4
- package/src/context/navigation-context.ts +0 -6
- package/src/context/uploader-context.ts +0 -6
- package/src/enums/index.ts +0 -2
- package/src/enums/placeholders.ts +0 -4
- package/src/enums/preserved-keys.ts +0 -3
- package/src/examples/index.ts +0 -1
- package/src/hooks/index.ts +0 -8
- package/src/hooks/use-emperor-ui.ts +0 -12
- package/src/hooks/use-filters.ts +0 -20
- package/src/hooks/use-form-builder-context.ts +0 -16
- package/src/hooks/use-navigation.ts +0 -12
- package/src/hooks/use-search-params-handler.tsx +0 -186
- package/src/hooks/use-uploader-context.ts +0 -14
- package/src/hooks/use-uploader.tsx +0 -164
- package/src/hooks/use-window-size.tsx +0 -53
- package/src/i18n/configs/i18n.ts +0 -7
- package/src/i18n/configs/index.ts +0 -1
- package/src/i18n/constants/index.ts +0 -1
- package/src/i18n/constants/locales.ts +0 -4
- package/src/i18n/index.ts +0 -5
- package/src/i18n/locales/ar.ts +0 -15
- package/src/i18n/locales/atoms/ar.ts +0 -18
- package/src/i18n/locales/atoms/en.ts +0 -18
- package/src/i18n/locales/atoms/index.ts +0 -2
- package/src/i18n/locales/common/ar.ts +0 -1
- package/src/i18n/locales/common/en.ts +0 -1
- package/src/i18n/locales/common/index.ts +0 -2
- package/src/i18n/locales/en.ts +0 -15
- package/src/i18n/locales/index.ts +0 -4
- package/src/i18n/locales/molecules/ar.ts +0 -1
- package/src/i18n/locales/molecules/en.ts +0 -1
- package/src/i18n/locales/molecules/index.ts +0 -2
- package/src/i18n/locales/organisms/ar.ts +0 -11
- package/src/i18n/locales/organisms/en.ts +0 -11
- package/src/i18n/locales/organisms/index.ts +0 -2
- package/src/i18n/locales/templates/ar.ts +0 -1
- package/src/i18n/locales/templates/en.ts +0 -1
- package/src/i18n/locales/templates/index.ts +0 -2
- package/src/i18n/locales/toasts/ar.ts +0 -1
- package/src/i18n/locales/toasts/en.ts +0 -1
- package/src/i18n/locales/toasts/index.ts +0 -2
- package/src/i18n/types/index.ts +0 -2
- package/src/i18n/types/locale.ts +0 -5
- package/src/i18n/types/toasts.ts +0 -3
- package/src/i18n/utils/get-locales.ts +0 -4
- package/src/i18n/utils/index.ts +0 -2
- package/src/i18n/utils/localize.ts +0 -15
- package/src/index.ts +0 -14
- package/src/mocks/constants.ts +0 -103
- package/src/mocks/deletion-confirmor.ts +0 -16
- package/src/mocks/header.tsx +0 -118
- package/src/mocks/index.ts +0 -6
- package/src/mocks/listings.tsx +0 -154
- package/src/mocks/locales/index.ts +0 -1
- package/src/mocks/locales/uploader.ts +0 -33
- package/src/mocks/types.ts +0 -64
- package/src/providers/config-provider.tsx +0 -72
- package/src/providers/emperor-ui-provider.tsx +0 -35
- package/src/providers/form-builder-provider-context.tsx +0 -18
- package/src/providers/index.ts +0 -6
- package/src/providers/navigation-provider.tsx +0 -42
- package/src/providers/theme-provider.tsx +0 -16
- package/src/providers/uploader-provider.tsx +0 -53
- package/src/styles/globals.css +0 -38
- package/src/styles/hero.ts +0 -3
- package/src/styles/index.css +0 -18
- package/src/types/components/atoms/brand.ts +0 -13
- package/src/types/components/atoms/color-picker/color-picker.ts +0 -21
- package/src/types/components/atoms/color-picker/index.ts +0 -1
- package/src/types/components/atoms/column.ts +0 -3
- package/src/types/components/atoms/container.ts +0 -3
- package/src/types/components/atoms/field/field.ts +0 -61
- package/src/types/components/atoms/field/index.ts +0 -1
- package/src/types/components/atoms/filter/filter.ts +0 -52
- package/src/types/components/atoms/filter/index.ts +0 -2
- package/src/types/components/atoms/filter/select-filter.ts +0 -8
- package/src/types/components/atoms/index.ts +0 -9
- package/src/types/components/atoms/portal.ts +0 -6
- package/src/types/components/atoms/row.ts +0 -3
- package/src/types/components/atoms/uploader.ts +0 -103
- package/src/types/components/index.ts +0 -4
- package/src/types/components/molecules/footer/footer.ts +0 -68
- package/src/types/components/molecules/footer/index.ts +0 -1
- package/src/types/components/molecules/header/header.ts +0 -51
- package/src/types/components/molecules/header/index.ts +0 -1
- package/src/types/components/molecules/index.ts +0 -9
- package/src/types/components/molecules/item-card/index.ts +0 -1
- package/src/types/components/molecules/item-card/item-card.ts +0 -69
- package/src/types/components/molecules/item-details/index.ts +0 -1
- package/src/types/components/molecules/item-details/item-details.ts +0 -9
- package/src/types/components/molecules/listings/index.ts +0 -1
- package/src/types/components/molecules/listings/listings.ts +0 -29
- package/src/types/components/molecules/nav-bar/index.ts +0 -1
- package/src/types/components/molecules/nav-bar/nav-bar.ts +0 -66
- package/src/types/components/molecules/scaffold/index.ts +0 -1
- package/src/types/components/molecules/scaffold/scaffold.ts +0 -9
- package/src/types/components/molecules/side-bar/index.ts +0 -1
- package/src/types/components/molecules/side-bar/side-bar.ts +0 -40
- package/src/types/components/molecules/theme-switch/index.ts +0 -1
- package/src/types/components/molecules/theme-switch/theme-switch.ts +0 -9
- package/src/types/components/organisms/deletion-confirmor/deletion-confirmor.ts +0 -22
- package/src/types/components/organisms/deletion-confirmor/index.ts +0 -1
- package/src/types/components/organisms/filters/filters.ts +0 -11
- package/src/types/components/organisms/filters/index.ts +0 -1
- package/src/types/components/organisms/form-builder/context.ts +0 -6
- package/src/types/components/organisms/form-builder/form-builder.ts +0 -39
- package/src/types/components/organisms/form-builder/index.ts +0 -2
- package/src/types/components/organisms/index.ts +0 -3
- package/src/types/components/templates/index.ts +0 -1
- package/src/types/components/templates/landing-page.ts +0 -10
- package/src/types/context/config.ts +0 -24
- package/src/types/context/index.ts +0 -4
- package/src/types/context/localization.ts +0 -24
- package/src/types/context/navigation.ts +0 -17
- package/src/types/context/theme.ts +0 -33
- package/src/types/index.ts +0 -3
- package/src/types/shared/components.ts +0 -13
- package/src/types/shared/index.ts +0 -1
- package/src/utils/cn.ts +0 -6
- package/src/utils/compress-images.ts +0 -36
- package/src/utils/index.ts +0 -5
- package/src/utils/locales.ts +0 -54
- package/src/utils/storybook.tsx +0 -15
- package/src/utils/uploader.ts +0 -170
- package/tsconfig.app.json +0 -37
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -25
- package/vite.config.ts +0 -47
- package/vitest.shims.d.ts +0 -1
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { createPortal } from "react-dom";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import { cn } from "@/utils";
|
|
4
|
-
import { Button } from "@heroui/button";
|
|
5
|
-
import { Divider } from "@heroui/divider";
|
|
6
|
-
import { ScrollShadow } from "@heroui/scroll-shadow";
|
|
7
|
-
import { CompactSideBarProps } from "@/types";
|
|
8
|
-
|
|
9
|
-
const CompactSideBarContent = ({
|
|
10
|
-
items = [],
|
|
11
|
-
isOpen,
|
|
12
|
-
onOpenChange,
|
|
13
|
-
triggerProps,
|
|
14
|
-
}: CompactSideBarProps) => {
|
|
15
|
-
const { content, ...restTriggerProps } = triggerProps || {};
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<div
|
|
19
|
-
className={cn(
|
|
20
|
-
"flex flex-col gap-4 p-2",
|
|
21
|
-
"h-[calc(100vh-16px)] bg-gray-200 m-2 rounded-lg overflow-hidden",
|
|
22
|
-
"transition-width ease-in-out duration-300",
|
|
23
|
-
isOpen ? "w-[20vw]" : "w-[48px]",
|
|
24
|
-
)}
|
|
25
|
-
>
|
|
26
|
-
<div className="w-fit flex flex-col">
|
|
27
|
-
<Button
|
|
28
|
-
variant="light"
|
|
29
|
-
size="sm"
|
|
30
|
-
onPress={() => onOpenChange?.(true)}
|
|
31
|
-
className={cn("min-w-7 w-fit px-0.5")}
|
|
32
|
-
{...restTriggerProps}
|
|
33
|
-
>
|
|
34
|
-
{content}
|
|
35
|
-
</Button>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
<Divider />
|
|
39
|
-
|
|
40
|
-
<ScrollShadow
|
|
41
|
-
as="ul"
|
|
42
|
-
hideScrollBar
|
|
43
|
-
className="max-h-[70vh] flex flex-col gap-4 p-0 overflow-y-auto"
|
|
44
|
-
>
|
|
45
|
-
{items?.map(({ id, Icon, label }) => (
|
|
46
|
-
<li
|
|
47
|
-
key={id}
|
|
48
|
-
className="w-fit flex items-center justify-center gap-3 ms-1.5 cursor-pointer"
|
|
49
|
-
>
|
|
50
|
-
{Icon && <Icon className="size-5" />}
|
|
51
|
-
|
|
52
|
-
{label && isOpen && (
|
|
53
|
-
<p className={cn("text-sm font-semibold")}>{label}</p>
|
|
54
|
-
)}
|
|
55
|
-
</li>
|
|
56
|
-
))}
|
|
57
|
-
</ScrollShadow>
|
|
58
|
-
</div>
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export const CompactSideBar = (props: CompactSideBarProps) => {
|
|
63
|
-
const [container, setContainer] = useState<HTMLElement | null>(null);
|
|
64
|
-
|
|
65
|
-
useEffect(() => {
|
|
66
|
-
const element = document.getElementById("emperor-compact-sidebar");
|
|
67
|
-
setTimeout(() => {
|
|
68
|
-
setContainer(element);
|
|
69
|
-
}, 100);
|
|
70
|
-
}, []);
|
|
71
|
-
|
|
72
|
-
if (!container) {
|
|
73
|
-
return null;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return createPortal(<CompactSideBarContent {...props} />, container);
|
|
77
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./side-bar";
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { useEmperorUI } from "@/hooks";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import {
|
|
4
|
-
Drawer,
|
|
5
|
-
DrawerHeader,
|
|
6
|
-
DrawerBody,
|
|
7
|
-
DrawerContent,
|
|
8
|
-
DrawerFooter,
|
|
9
|
-
} from "@heroui/drawer";
|
|
10
|
-
import { Button } from "@heroui/button";
|
|
11
|
-
import { ScrollShadow } from "@heroui/scroll-shadow";
|
|
12
|
-
import { Divider } from "@heroui/divider";
|
|
13
|
-
import { SideBarProps } from "@/types";
|
|
14
|
-
import { cn } from "@/utils";
|
|
15
|
-
import { sideBarItemClasses, sideBarItemStyles } from "./styles";
|
|
16
|
-
|
|
17
|
-
export const SideBarDrawer = ({
|
|
18
|
-
isOpen,
|
|
19
|
-
onOpenChange,
|
|
20
|
-
triggerProps,
|
|
21
|
-
classNames,
|
|
22
|
-
header,
|
|
23
|
-
items = [],
|
|
24
|
-
actions = [],
|
|
25
|
-
variant = "default",
|
|
26
|
-
}: SideBarProps) => {
|
|
27
|
-
const { config } = useEmperorUI();
|
|
28
|
-
const [hoveredItem, setHoveredItem] = useState<string | null>(null);
|
|
29
|
-
const { content, ...restTriggerProps } = triggerProps || {};
|
|
30
|
-
|
|
31
|
-
const dir = config?.interLocalization?.dir;
|
|
32
|
-
|
|
33
|
-
const isRTL = dir === "rtl";
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<>
|
|
37
|
-
<Button
|
|
38
|
-
variant="ghost"
|
|
39
|
-
isIconOnly
|
|
40
|
-
size="sm"
|
|
41
|
-
onPress={() => onOpenChange?.(true)}
|
|
42
|
-
className={cn(classNames?.trigger)}
|
|
43
|
-
{...restTriggerProps}
|
|
44
|
-
>
|
|
45
|
-
{content}
|
|
46
|
-
</Button>
|
|
47
|
-
|
|
48
|
-
<Drawer
|
|
49
|
-
isOpen={isOpen}
|
|
50
|
-
onOpenChange={onOpenChange}
|
|
51
|
-
placement={isRTL ? "right" : "left"}
|
|
52
|
-
size="sm"
|
|
53
|
-
dir={dir}
|
|
54
|
-
className="p-0"
|
|
55
|
-
>
|
|
56
|
-
<DrawerContent className="p-0">
|
|
57
|
-
<DrawerHeader className={cn("text-xl font-bold", classNames?.title)}>
|
|
58
|
-
{header}
|
|
59
|
-
</DrawerHeader>
|
|
60
|
-
|
|
61
|
-
<DrawerBody className={cn("p-0 mt-4 h-fit")}>
|
|
62
|
-
<ScrollShadow
|
|
63
|
-
as="ul"
|
|
64
|
-
hideScrollBar
|
|
65
|
-
data-slot="emperor-side-bar-menu"
|
|
66
|
-
className={cn("max-h-[60vh] overflow-y-auto", classNames?.menu)}
|
|
67
|
-
>
|
|
68
|
-
{items?.map(({ id, label, href, Icon }) => (
|
|
69
|
-
<li
|
|
70
|
-
key={href}
|
|
71
|
-
data-slot="emperor-side-bar-item"
|
|
72
|
-
style={sideBarItemStyles({
|
|
73
|
-
isHovered: hoveredItem === id,
|
|
74
|
-
variant,
|
|
75
|
-
})}
|
|
76
|
-
className={cn(
|
|
77
|
-
sideBarItemClasses({ variant }),
|
|
78
|
-
classNames?.menuItem,
|
|
79
|
-
)}
|
|
80
|
-
onMouseEnter={() => setHoveredItem(id)}
|
|
81
|
-
onMouseLeave={() => setHoveredItem(null)}
|
|
82
|
-
>
|
|
83
|
-
{Icon && <Icon className="size-4" />}
|
|
84
|
-
{label && <p>{label}</p>}
|
|
85
|
-
</li>
|
|
86
|
-
))}
|
|
87
|
-
</ScrollShadow>
|
|
88
|
-
</DrawerBody>
|
|
89
|
-
|
|
90
|
-
{actions && actions?.length > 0 && (
|
|
91
|
-
<>
|
|
92
|
-
<Divider className="m-auto w-11/12" />
|
|
93
|
-
|
|
94
|
-
<DrawerFooter className={cn(classNames?.actionsWrapper)}>
|
|
95
|
-
{actions?.map(({ key, label, ...props }) => (
|
|
96
|
-
<Button
|
|
97
|
-
key={key}
|
|
98
|
-
variant="ghost"
|
|
99
|
-
size="sm"
|
|
100
|
-
className={cn(classNames?.actionItem)}
|
|
101
|
-
{...props}
|
|
102
|
-
>
|
|
103
|
-
{label}
|
|
104
|
-
</Button>
|
|
105
|
-
))}
|
|
106
|
-
</DrawerFooter>
|
|
107
|
-
</>
|
|
108
|
-
)}
|
|
109
|
-
</DrawerContent>
|
|
110
|
-
</Drawer>
|
|
111
|
-
</>
|
|
112
|
-
);
|
|
113
|
-
};
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import { Brand, SideBar } from "@/components";
|
|
3
|
-
import { getStorybookDecorators } from "@/utils";
|
|
4
|
-
import { MenuIcon } from "lucide-react";
|
|
5
|
-
import { useDisclosure } from "@heroui/modal";
|
|
6
|
-
import { MOCK_HEADER_ACTIONS, MOCK_HEADER_ITEMS } from "@/mocks";
|
|
7
|
-
import { SideBarProps } from "@/types";
|
|
8
|
-
|
|
9
|
-
const meta: Meta<typeof SideBar> = {
|
|
10
|
-
title: "Molecules/SideBar",
|
|
11
|
-
component: SideBar,
|
|
12
|
-
parameters: {
|
|
13
|
-
layout: "fullscreen",
|
|
14
|
-
},
|
|
15
|
-
tags: ["autodocs"],
|
|
16
|
-
decorators: getStorybookDecorators({
|
|
17
|
-
config: {
|
|
18
|
-
layout: {
|
|
19
|
-
withScaffold: false,
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
}),
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default meta;
|
|
26
|
-
|
|
27
|
-
type Story = StoryObj<typeof meta>;
|
|
28
|
-
|
|
29
|
-
export const Default: Story = {
|
|
30
|
-
args: {
|
|
31
|
-
header: <Brand className="text-white" />,
|
|
32
|
-
triggerProps: {
|
|
33
|
-
className: "m-5",
|
|
34
|
-
startContent: <MenuIcon className="size-4" />,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
render: (args: SideBarProps) => {
|
|
38
|
-
const { isOpen, onOpenChange } = useDisclosure();
|
|
39
|
-
|
|
40
|
-
return <SideBar {...args} isOpen={isOpen} onOpenChange={onOpenChange} />;
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const WithItems: Story = {
|
|
45
|
-
args: {
|
|
46
|
-
header: <Brand className="text-white" />,
|
|
47
|
-
triggerProps: {
|
|
48
|
-
className: "m-5",
|
|
49
|
-
startContent: <MenuIcon className="size-4" />,
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
render: (args: SideBarProps) => {
|
|
53
|
-
const { isOpen, onOpenChange } = useDisclosure();
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<SideBar
|
|
57
|
-
{...args}
|
|
58
|
-
isOpen={isOpen}
|
|
59
|
-
onOpenChange={onOpenChange}
|
|
60
|
-
items={MOCK_HEADER_ITEMS}
|
|
61
|
-
/>
|
|
62
|
-
);
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const WithActions: Story = {
|
|
67
|
-
args: {
|
|
68
|
-
header: <Brand className="text-white" />,
|
|
69
|
-
triggerProps: {
|
|
70
|
-
className: "m-5",
|
|
71
|
-
startContent: <MenuIcon className="size-4" />,
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
render: (args: SideBarProps) => {
|
|
75
|
-
const { isOpen, onOpenChange } = useDisclosure();
|
|
76
|
-
|
|
77
|
-
return (
|
|
78
|
-
<SideBar
|
|
79
|
-
{...args}
|
|
80
|
-
isOpen={isOpen}
|
|
81
|
-
onOpenChange={onOpenChange}
|
|
82
|
-
items={MOCK_HEADER_ITEMS}
|
|
83
|
-
actions={MOCK_HEADER_ACTIONS}
|
|
84
|
-
/>
|
|
85
|
-
);
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
export const Compact: Story = {
|
|
90
|
-
args: {
|
|
91
|
-
variant: "compact",
|
|
92
|
-
},
|
|
93
|
-
render: (args: SideBarProps) => {
|
|
94
|
-
const { isOpen, onOpenChange } = useDisclosure();
|
|
95
|
-
|
|
96
|
-
return (
|
|
97
|
-
<SideBar
|
|
98
|
-
{...args}
|
|
99
|
-
isOpen={isOpen}
|
|
100
|
-
onOpenChange={onOpenChange}
|
|
101
|
-
items={MOCK_HEADER_ITEMS}
|
|
102
|
-
actions={MOCK_HEADER_ACTIONS}
|
|
103
|
-
triggerProps={{
|
|
104
|
-
content: (
|
|
105
|
-
<Brand classNames={{ logo: "size-7" }} isIconOnly={!isOpen} />
|
|
106
|
-
),
|
|
107
|
-
}}
|
|
108
|
-
/>
|
|
109
|
-
);
|
|
110
|
-
},
|
|
111
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { cn } from "@/utils";
|
|
2
|
-
import { VariantProps } from "class-variance-authority";
|
|
3
|
-
import { forwardRef, ComponentProps } from "react";
|
|
4
|
-
import { sideBarClasses } from "./styles";
|
|
5
|
-
import type { SideBarProps } from "@/types";
|
|
6
|
-
import { SideBarDrawer } from "./side-bar-drawer";
|
|
7
|
-
import { CompactSideBar } from "./compact-side-bar";
|
|
8
|
-
|
|
9
|
-
export const SideBar = forwardRef<
|
|
10
|
-
HTMLDivElement,
|
|
11
|
-
ComponentProps<"div"> & VariantProps<typeof sideBarClasses> & SideBarProps
|
|
12
|
-
>((props, ref) => {
|
|
13
|
-
const { variant = "default", className, classNames } = props;
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<div
|
|
17
|
-
ref={ref}
|
|
18
|
-
data-slot="emperor-side-bar"
|
|
19
|
-
className={cn(
|
|
20
|
-
sideBarClasses({
|
|
21
|
-
variant,
|
|
22
|
-
className: cn(className, classNames?.base),
|
|
23
|
-
}),
|
|
24
|
-
)}
|
|
25
|
-
{...props}
|
|
26
|
-
>
|
|
27
|
-
{variant === "default" && <SideBarDrawer {...props} />}
|
|
28
|
-
{variant === "compact" && <CompactSideBar {...props} />}
|
|
29
|
-
</div>
|
|
30
|
-
);
|
|
31
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { cva } from "class-variance-authority";
|
|
2
|
-
|
|
3
|
-
export const sideBarClasses = cva([""], {
|
|
4
|
-
variants: {
|
|
5
|
-
variant: {
|
|
6
|
-
default: [],
|
|
7
|
-
compact: [],
|
|
8
|
-
},
|
|
9
|
-
},
|
|
10
|
-
defaultVariants: {},
|
|
11
|
-
compoundVariants: [],
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export const sideBarItemClasses = cva(
|
|
15
|
-
[
|
|
16
|
-
"w-full cursor-pointer px-6 py-2 transition-all font-semibold text-sm flex items-center gap-2",
|
|
17
|
-
],
|
|
18
|
-
{
|
|
19
|
-
variants: {
|
|
20
|
-
variant: {
|
|
21
|
-
default: [],
|
|
22
|
-
compact: [],
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
defaultVariants: {},
|
|
26
|
-
compoundVariants: [],
|
|
27
|
-
},
|
|
28
|
-
);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SideBarItemStylesProps } from "@/types";
|
|
2
|
-
import { CSSProperties } from "react";
|
|
3
|
-
|
|
4
|
-
export const sideBarItemStyles = ({
|
|
5
|
-
foregroundColor,
|
|
6
|
-
primaryColor,
|
|
7
|
-
isHovered,
|
|
8
|
-
}: SideBarItemStylesProps): CSSProperties => {
|
|
9
|
-
return {
|
|
10
|
-
color: isHovered ? foregroundColor : "inherit",
|
|
11
|
-
backgroundColor: isHovered ? primaryColor : "transparent",
|
|
12
|
-
};
|
|
13
|
-
};
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Button } from "@heroui/button";
|
|
4
|
-
import {
|
|
5
|
-
Modal,
|
|
6
|
-
ModalBody,
|
|
7
|
-
ModalContent,
|
|
8
|
-
ModalFooter,
|
|
9
|
-
ModalHeader,
|
|
10
|
-
} from "@heroui/modal";
|
|
11
|
-
import { Trash2 } from "lucide-react";
|
|
12
|
-
import { Locale } from "@/i18n";
|
|
13
|
-
import { useEmperorUI } from "@/hooks";
|
|
14
|
-
import { cn } from "@/utils";
|
|
15
|
-
import type { DeletionConfirmorProps } from "@/types";
|
|
16
|
-
import {
|
|
17
|
-
deletionConfirmorBodyClasses,
|
|
18
|
-
deletionConfirmorContentClasses,
|
|
19
|
-
deletionConfirmorFooterClasses,
|
|
20
|
-
deletionConfirmorHeaderClasses,
|
|
21
|
-
} from "./styles";
|
|
22
|
-
|
|
23
|
-
export function DeletionConfirmor({
|
|
24
|
-
isOpen,
|
|
25
|
-
onClose,
|
|
26
|
-
title,
|
|
27
|
-
description,
|
|
28
|
-
className,
|
|
29
|
-
classNames,
|
|
30
|
-
confirmProps,
|
|
31
|
-
declineProps,
|
|
32
|
-
}: DeletionConfirmorProps) {
|
|
33
|
-
const { config } = useEmperorUI();
|
|
34
|
-
|
|
35
|
-
const lang = config?.interLocalization?.lang ?? "en";
|
|
36
|
-
const locale = config?.interLocalization?.locales?.[lang] as
|
|
37
|
-
| Locale
|
|
38
|
-
| undefined;
|
|
39
|
-
const deletionConfirmorLocale = locale?.organisms?.deletionConfirmor;
|
|
40
|
-
|
|
41
|
-
const handleDecline = (e?: unknown) => {
|
|
42
|
-
if (typeof declineProps?.onPress === "function") {
|
|
43
|
-
(declineProps.onPress as (e?: unknown) => void)(e);
|
|
44
|
-
}
|
|
45
|
-
onClose();
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<Modal
|
|
50
|
-
placement="center"
|
|
51
|
-
isOpen={isOpen}
|
|
52
|
-
onClose={onClose}
|
|
53
|
-
onOpenChange={(open) => {
|
|
54
|
-
if (!open) onClose();
|
|
55
|
-
}}
|
|
56
|
-
dir={lang === "ar" ? "rtl" : "ltr"}
|
|
57
|
-
classNames={
|
|
58
|
-
className || classNames?.base
|
|
59
|
-
? { base: cn(className, classNames?.base) }
|
|
60
|
-
: undefined
|
|
61
|
-
}
|
|
62
|
-
>
|
|
63
|
-
<ModalContent
|
|
64
|
-
className={cn(deletionConfirmorContentClasses(), classNames?.content)}
|
|
65
|
-
>
|
|
66
|
-
<ModalHeader
|
|
67
|
-
className={cn(deletionConfirmorHeaderClasses(), classNames?.header)}
|
|
68
|
-
>
|
|
69
|
-
{title}
|
|
70
|
-
</ModalHeader>
|
|
71
|
-
|
|
72
|
-
<ModalBody
|
|
73
|
-
className={cn(deletionConfirmorBodyClasses(), classNames?.body)}
|
|
74
|
-
>
|
|
75
|
-
{description}
|
|
76
|
-
</ModalBody>
|
|
77
|
-
|
|
78
|
-
<ModalFooter
|
|
79
|
-
className={cn(deletionConfirmorFooterClasses(), classNames?.footer)}
|
|
80
|
-
>
|
|
81
|
-
<Button
|
|
82
|
-
variant="flat"
|
|
83
|
-
size="sm"
|
|
84
|
-
{...declineProps}
|
|
85
|
-
onPress={handleDecline}
|
|
86
|
-
className={cn(declineProps?.className, classNames?.declineButton)}
|
|
87
|
-
>
|
|
88
|
-
{declineProps?.children ?? deletionConfirmorLocale?.decline}
|
|
89
|
-
</Button>
|
|
90
|
-
|
|
91
|
-
<Button
|
|
92
|
-
color="danger"
|
|
93
|
-
size="sm"
|
|
94
|
-
startContent={
|
|
95
|
-
confirmProps?.isLoading
|
|
96
|
-
? undefined
|
|
97
|
-
: (confirmProps?.startContent ?? (
|
|
98
|
-
<Trash2 className="size-4" aria-hidden />
|
|
99
|
-
))
|
|
100
|
-
}
|
|
101
|
-
{...confirmProps}
|
|
102
|
-
className={cn(confirmProps?.className, classNames?.confirmButton)}
|
|
103
|
-
>
|
|
104
|
-
{confirmProps?.children ?? deletionConfirmorLocale?.confirm}
|
|
105
|
-
</Button>
|
|
106
|
-
</ModalFooter>
|
|
107
|
-
</ModalContent>
|
|
108
|
-
</Modal>
|
|
109
|
-
);
|
|
110
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Button } from "@heroui/button";
|
|
2
|
-
import { DeletionConfirmorProps } from "@/types";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { DeletionConfirmor } from "@/components";
|
|
5
|
-
|
|
6
|
-
export const DeletionConfirmorWithTrigger = (args: DeletionConfirmorProps) => {
|
|
7
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
8
|
-
|
|
9
|
-
return (
|
|
10
|
-
<div className="flex flex-col gap-4">
|
|
11
|
-
<Button color="danger" onPress={() => setIsOpen(true)}>
|
|
12
|
-
Delete item
|
|
13
|
-
</Button>
|
|
14
|
-
|
|
15
|
-
<DeletionConfirmor
|
|
16
|
-
confirmProps={{
|
|
17
|
-
onPress: () => setIsOpen(false),
|
|
18
|
-
}}
|
|
19
|
-
{...args}
|
|
20
|
-
isOpen={isOpen}
|
|
21
|
-
onClose={() => setIsOpen(false)}
|
|
22
|
-
/>
|
|
23
|
-
</div>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import { DeletionConfirmor, DeletionConfirmorWithTrigger } from "@/components";
|
|
3
|
-
import { getStorybookDecorators } from "@/utils";
|
|
4
|
-
import { DeletionConfirmorProps } from "@/types";
|
|
5
|
-
import { mockAwaitingDelete } from "@/mocks";
|
|
6
|
-
import { Button } from "@heroui/button";
|
|
7
|
-
import { useState } from "react";
|
|
8
|
-
|
|
9
|
-
const meta: Meta<typeof DeletionConfirmor> = {
|
|
10
|
-
title: "Organisms/DeletionConfirmor",
|
|
11
|
-
component: DeletionConfirmor,
|
|
12
|
-
parameters: {
|
|
13
|
-
layout: "centered",
|
|
14
|
-
},
|
|
15
|
-
tags: ["autodocs"],
|
|
16
|
-
decorators: getStorybookDecorators({
|
|
17
|
-
config: {
|
|
18
|
-
layout: {
|
|
19
|
-
withScaffold: false,
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
}),
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default meta;
|
|
26
|
-
|
|
27
|
-
type Story = StoryObj<typeof meta>;
|
|
28
|
-
|
|
29
|
-
export const Default: Story = {
|
|
30
|
-
args: {
|
|
31
|
-
title: "Delete item?",
|
|
32
|
-
description:
|
|
33
|
-
"This action cannot be undone. This will permanently delete the item.",
|
|
34
|
-
},
|
|
35
|
-
render: (args: DeletionConfirmorProps) => {
|
|
36
|
-
return <DeletionConfirmorWithTrigger {...args} />;
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const WithConfirmLoading: Story = {
|
|
41
|
-
args: {
|
|
42
|
-
title: "Delete item?",
|
|
43
|
-
description:
|
|
44
|
-
"This action cannot be undone. The confirm button will show a loading state for 2 seconds.",
|
|
45
|
-
},
|
|
46
|
-
render: (args: DeletionConfirmorProps) => {
|
|
47
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
48
|
-
const [isConfirmLoading, setIsConfirmLoading] = useState(false);
|
|
49
|
-
|
|
50
|
-
const handleConfirm = async () => {
|
|
51
|
-
setIsConfirmLoading(true);
|
|
52
|
-
|
|
53
|
-
await mockAwaitingDelete(() => {
|
|
54
|
-
setIsOpen(false);
|
|
55
|
-
setIsConfirmLoading(false);
|
|
56
|
-
})();
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
return (
|
|
60
|
-
<div className="flex flex-col gap-4">
|
|
61
|
-
<Button color="danger" onPress={() => setIsOpen(true)}>
|
|
62
|
-
Delete item
|
|
63
|
-
</Button>
|
|
64
|
-
|
|
65
|
-
<DeletionConfirmor
|
|
66
|
-
{...args}
|
|
67
|
-
isOpen={isOpen}
|
|
68
|
-
onClose={() => setIsOpen(false)}
|
|
69
|
-
confirmProps={{
|
|
70
|
-
...args.confirmProps,
|
|
71
|
-
isLoading: isConfirmLoading,
|
|
72
|
-
onPress: handleConfirm,
|
|
73
|
-
}}
|
|
74
|
-
/>
|
|
75
|
-
</div>
|
|
76
|
-
);
|
|
77
|
-
},
|
|
78
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { cva } from "class-variance-authority";
|
|
2
|
-
|
|
3
|
-
export const deletionConfirmorContentClasses = cva(["p-0"], {
|
|
4
|
-
variants: {},
|
|
5
|
-
defaultVariants: {},
|
|
6
|
-
compoundVariants: [],
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export const deletionConfirmorHeaderClasses = cva([], {
|
|
10
|
-
variants: {},
|
|
11
|
-
defaultVariants: {},
|
|
12
|
-
compoundVariants: [],
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
export const deletionConfirmorBodyClasses = cva([], {
|
|
16
|
-
variants: {},
|
|
17
|
-
defaultVariants: {},
|
|
18
|
-
compoundVariants: [],
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
export const deletionConfirmorFooterClasses = cva(
|
|
22
|
-
["flex gap-2 justify-end flex-wrap"],
|
|
23
|
-
{
|
|
24
|
-
variants: {},
|
|
25
|
-
defaultVariants: {},
|
|
26
|
-
compoundVariants: [],
|
|
27
|
-
},
|
|
28
|
-
);
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { cn } from "@/utils";
|
|
2
|
-
import { FooterProps } from "@/types";
|
|
3
|
-
import { copyRightsClasses } from "./styles";
|
|
4
|
-
|
|
5
|
-
export function CopyRightsBox({ copyRights, classNames }: FooterProps) {
|
|
6
|
-
return (
|
|
7
|
-
<section
|
|
8
|
-
data-slot="emperor-footer-policies"
|
|
9
|
-
className={cn(
|
|
10
|
-
copyRightsClasses({
|
|
11
|
-
className: cn(classNames?.copyRightsWrapper),
|
|
12
|
-
}),
|
|
13
|
-
)}
|
|
14
|
-
>
|
|
15
|
-
<p
|
|
16
|
-
className={cn(
|
|
17
|
-
"flex items-center gap-1 text-sm text-gray-400 text-center",
|
|
18
|
-
classNames?.copyRightsText,
|
|
19
|
-
)}
|
|
20
|
-
>
|
|
21
|
-
<span>©</span>
|
|
22
|
-
<span>{copyRights?.year}</span>
|
|
23
|
-
<span>{copyRights?.text}</span>
|
|
24
|
-
</p>
|
|
25
|
-
</section>
|
|
26
|
-
);
|
|
27
|
-
}
|