@js-empire/emperor-ui 1.3.6 → 1.3.7
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 +60623 -158
- package/package.json +7 -3
- 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/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,9 +0,0 @@
|
|
|
1
|
-
export type * from "./header";
|
|
2
|
-
export type * from "./listings";
|
|
3
|
-
export type * from "./nav-bar";
|
|
4
|
-
export type * from "./side-bar";
|
|
5
|
-
export type * from "./scaffold";
|
|
6
|
-
export type * from "./footer";
|
|
7
|
-
export type * from "./item-card";
|
|
8
|
-
export type * from "./item-details";
|
|
9
|
-
export type * from "./theme-switch";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type * from "./item-card";
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { SharedComponentProps } from "@/types";
|
|
2
|
-
import { ReactNode } from "react";
|
|
3
|
-
import { Variants } from "framer-motion";
|
|
4
|
-
import { ChipProps } from "@heroui/chip";
|
|
5
|
-
import { DropdownItemProps } from "@heroui/dropdown";
|
|
6
|
-
import type { ButtonProps } from "@heroui/button";
|
|
7
|
-
|
|
8
|
-
export type ItemCardClassnames = {
|
|
9
|
-
base?: string;
|
|
10
|
-
image?: string;
|
|
11
|
-
header?: string;
|
|
12
|
-
footer?: string;
|
|
13
|
-
imageWrapper?: string;
|
|
14
|
-
mainWrapper?: string;
|
|
15
|
-
banner?: string;
|
|
16
|
-
dropdown?: string;
|
|
17
|
-
body?: string;
|
|
18
|
-
title?: string;
|
|
19
|
-
price?: string;
|
|
20
|
-
description?: string;
|
|
21
|
-
chips?: string;
|
|
22
|
-
chip?: string;
|
|
23
|
-
actions?: string;
|
|
24
|
-
action?: string;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export type ItemCardAction = DropdownItemProps &
|
|
28
|
-
ButtonProps & {
|
|
29
|
-
key: string;
|
|
30
|
-
label: string;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export type ItemCardHoverEffect = "none" | "zoom" | "rotate";
|
|
34
|
-
|
|
35
|
-
export type ItemCardOrientation = "horizontal" | "vertical";
|
|
36
|
-
|
|
37
|
-
export type ItemCardActionsViewVariant =
|
|
38
|
-
| "dropdown"
|
|
39
|
-
| "buttons"
|
|
40
|
-
| "hover-overlay";
|
|
41
|
-
|
|
42
|
-
export type ItemChipProps = ChipProps & {
|
|
43
|
-
label: string;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export type ItemProps = {
|
|
47
|
-
key: string;
|
|
48
|
-
title?: ReactNode;
|
|
49
|
-
description?: ReactNode;
|
|
50
|
-
image?: {
|
|
51
|
-
src: string;
|
|
52
|
-
alt: string;
|
|
53
|
-
};
|
|
54
|
-
chips?: ItemChipProps[];
|
|
55
|
-
banner?: ReactNode;
|
|
56
|
-
price?: ReactNode;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export type ItemCardProps = SharedComponentProps & {
|
|
60
|
-
variants?: Variants;
|
|
61
|
-
isLoading?: boolean;
|
|
62
|
-
hoverEffect?: ItemCardHoverEffect;
|
|
63
|
-
classNames?: ItemCardClassnames;
|
|
64
|
-
item: ItemProps;
|
|
65
|
-
actions?: ItemCardAction[];
|
|
66
|
-
onActionClick?: (key: string) => void;
|
|
67
|
-
orientation?: ItemCardOrientation;
|
|
68
|
-
actionsViewVariant?: ItemCardActionsViewVariant;
|
|
69
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type * from "./item-details";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type * from "./listings";
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ItemCardAction,
|
|
3
|
-
ItemCardProps,
|
|
4
|
-
SharedComponentProps,
|
|
5
|
-
} from "@/types";
|
|
6
|
-
|
|
7
|
-
export type ListingsClassnames = {
|
|
8
|
-
base?: string;
|
|
9
|
-
item?: string;
|
|
10
|
-
pagination?: string;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export type ListingsLayout = "grid" | "list" | "carousel";
|
|
14
|
-
|
|
15
|
-
export type ListingsProps = SharedComponentProps & {
|
|
16
|
-
classNames?: ListingsClassnames;
|
|
17
|
-
layout?: ListingsLayout;
|
|
18
|
-
items: ItemCardProps[];
|
|
19
|
-
isLoading?: boolean;
|
|
20
|
-
actions?: ItemCardAction[];
|
|
21
|
-
onActionClick?: (key: string) => void;
|
|
22
|
-
pagination?: {
|
|
23
|
-
page: number;
|
|
24
|
-
setPage: (page: number) => void;
|
|
25
|
-
pageSize: number;
|
|
26
|
-
totalItemsCount: number;
|
|
27
|
-
pagesCount: number;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type * from "./nav-bar";
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ComponentRadius,
|
|
3
|
-
ComponentSize,
|
|
4
|
-
SharedComponentProps,
|
|
5
|
-
} from "@/types";
|
|
6
|
-
import type { ElementType } from "react";
|
|
7
|
-
|
|
8
|
-
export type NavBarClassnames = {
|
|
9
|
-
base?: string;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export type NavigationItem = {
|
|
13
|
-
id: string;
|
|
14
|
-
label?: string;
|
|
15
|
-
href?: string;
|
|
16
|
-
subItems?: NavigationItem[];
|
|
17
|
-
onClick?: () => void;
|
|
18
|
-
Icon?: ElementType;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export type NavBarHoverEffect =
|
|
22
|
-
| "default"
|
|
23
|
-
| "underline"
|
|
24
|
-
| "solid"
|
|
25
|
-
| "ghost"
|
|
26
|
-
| "bordered"
|
|
27
|
-
| "none";
|
|
28
|
-
|
|
29
|
-
export type NavBarVariant = "default" | "solid" | "bordered";
|
|
30
|
-
|
|
31
|
-
export type NavBarStylesProps = {
|
|
32
|
-
primaryColor?: string;
|
|
33
|
-
foregroundColor?: string;
|
|
34
|
-
variant?: NavBarVariant;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
38
|
-
export type NavBarMenuStylesProps = {};
|
|
39
|
-
|
|
40
|
-
export type NavBarItemStylesProps = {
|
|
41
|
-
foregroundColor?: string;
|
|
42
|
-
primaryColor?: string;
|
|
43
|
-
hoverEffect: NavBarHoverEffect;
|
|
44
|
-
isHovered?: boolean;
|
|
45
|
-
variant?: NavBarVariant;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export type NavBarProps = SharedComponentProps & {
|
|
49
|
-
items: NavigationItem[];
|
|
50
|
-
classNames?: NavBarClassnames;
|
|
51
|
-
hoverEffect?: NavBarHoverEffect;
|
|
52
|
-
radius?: ComponentRadius;
|
|
53
|
-
size?: ComponentSize;
|
|
54
|
-
variant?: NavBarVariant;
|
|
55
|
-
subItemsColumns?: number;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export type NavBarItemProps = {
|
|
59
|
-
item: NavigationItem;
|
|
60
|
-
variant: NavBarVariant;
|
|
61
|
-
hoverEffect: NavBarHoverEffect;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export type SubItemsBoxProps = {
|
|
65
|
-
subItemsColumns?: number;
|
|
66
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type * from "./scaffold";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type * from "./side-bar";
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { ButtonProps } from "@heroui/button";
|
|
2
|
-
import type { NavigationItem, SharedComponentProps } from "@/types";
|
|
3
|
-
import type { ReactNode } from "react";
|
|
4
|
-
|
|
5
|
-
export type SideBarVariant = "default" | "compact";
|
|
6
|
-
|
|
7
|
-
export type SideBarClassnames = {
|
|
8
|
-
base?: string;
|
|
9
|
-
trigger?: string;
|
|
10
|
-
title?: string;
|
|
11
|
-
menu?: string;
|
|
12
|
-
menuItem?: string;
|
|
13
|
-
actionsWrapper?: string;
|
|
14
|
-
actionItem?: string;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export type SideBarAction = ButtonProps & {
|
|
18
|
-
key: string;
|
|
19
|
-
label?: string;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type SideBarProps = SharedComponentProps & {
|
|
23
|
-
classNames?: SideBarClassnames;
|
|
24
|
-
variant?: SideBarVariant;
|
|
25
|
-
items: NavigationItem[];
|
|
26
|
-
actions?: SideBarAction[];
|
|
27
|
-
triggerProps?: Omit<ButtonProps, "content"> & { content?: ReactNode };
|
|
28
|
-
isOpen?: boolean;
|
|
29
|
-
onOpenChange?: (isOpen: boolean) => void;
|
|
30
|
-
header?: ReactNode;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export type SideBarItemStylesProps = {
|
|
34
|
-
foregroundColor?: string;
|
|
35
|
-
primaryColor?: string;
|
|
36
|
-
isHovered?: boolean;
|
|
37
|
-
variant?: SideBarVariant;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export type CompactSideBarProps = SideBarProps & {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./theme-switch";
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { ButtonProps } from "@heroui/button";
|
|
2
|
-
|
|
3
|
-
export type DeletionConfirmorClassnames = {
|
|
4
|
-
base?: string;
|
|
5
|
-
content?: string;
|
|
6
|
-
header?: string;
|
|
7
|
-
body?: string;
|
|
8
|
-
footer?: string;
|
|
9
|
-
confirmButton?: string;
|
|
10
|
-
declineButton?: string;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export type DeletionConfirmorProps = {
|
|
14
|
-
isOpen: boolean;
|
|
15
|
-
onClose: () => void;
|
|
16
|
-
title: string;
|
|
17
|
-
description: string;
|
|
18
|
-
className?: string;
|
|
19
|
-
classNames?: DeletionConfirmorClassnames;
|
|
20
|
-
confirmProps?: ButtonProps;
|
|
21
|
-
declineProps?: ButtonProps;
|
|
22
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./deletion-confirmor";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { SharedComponentProps } from "@/types";
|
|
2
|
-
import { ReactNode } from "react";
|
|
3
|
-
|
|
4
|
-
export type FiltersClassnames = {
|
|
5
|
-
base?: string;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export type FiltersProps = Omit<SharedComponentProps, "children"> & {
|
|
9
|
-
classNames?: FiltersClassnames;
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type * from "./filters";
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { SharedComponentProps } from "@/types";
|
|
2
|
-
import { ReactNode } from "react";
|
|
3
|
-
import type {
|
|
4
|
-
FieldErrors,
|
|
5
|
-
FieldValues,
|
|
6
|
-
UseFormProps,
|
|
7
|
-
UseFormReturn,
|
|
8
|
-
} from "react-hook-form";
|
|
9
|
-
import type { ZodType } from "zod";
|
|
10
|
-
import { z } from "zod";
|
|
11
|
-
|
|
12
|
-
export type FormBuilderSubmitArgs<TFieldValues extends FieldValues> = {
|
|
13
|
-
values: TFieldValues;
|
|
14
|
-
form: UseFormReturn<TFieldValues>;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export type FormBuilderSuccessArgs<TFieldValues extends FieldValues> = {
|
|
18
|
-
values: TFieldValues;
|
|
19
|
-
form: UseFormReturn<TFieldValues>;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type FormBuilderErrorArgs<TFieldValues extends FieldValues> = {
|
|
23
|
-
error?: unknown;
|
|
24
|
-
errors?: FieldErrors<TFieldValues>;
|
|
25
|
-
form: UseFormReturn<TFieldValues>;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export type FormBuilderProps<TSchema extends ZodType<any, any, any>> = Omit<
|
|
29
|
-
SharedComponentProps,
|
|
30
|
-
"children"
|
|
31
|
-
> & {
|
|
32
|
-
children: ReactNode;
|
|
33
|
-
formProps?: UseFormProps<z.infer<TSchema>>;
|
|
34
|
-
onSubmit: (values: z.infer<TSchema>) => Promise<unknown> | unknown;
|
|
35
|
-
onSuccess?: (values: z.infer<TSchema>) => void;
|
|
36
|
-
onError?: (error: unknown) => void;
|
|
37
|
-
/** Called whenever form values change. Use this to read values outside FormBuilder (e.g. in parent state). */
|
|
38
|
-
onValuesChange?: (values: Partial<z.infer<TSchema>>) => void;
|
|
39
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type * from "./landing-page";
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
|
-
import { EmperorUIInterLocalization } from "@/types";
|
|
3
|
-
import { ToastProps } from "@heroui/toast";
|
|
4
|
-
import { EmperorUITheme } from "@/types";
|
|
5
|
-
|
|
6
|
-
export type ConfigContextState = {
|
|
7
|
-
config: EmperorUIConfig;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export type ConfigProviderProps = {
|
|
11
|
-
children: ReactNode;
|
|
12
|
-
config?: EmperorUIConfig;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export type EmperorUILayout = {
|
|
16
|
-
withScaffold: boolean;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export type EmperorUIConfig = {
|
|
20
|
-
layout?: Partial<EmperorUILayout>;
|
|
21
|
-
interLocalization?: Partial<EmperorUIInterLocalization>;
|
|
22
|
-
toast?: ToastProps;
|
|
23
|
-
theme?: Partial<EmperorUITheme>;
|
|
24
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Locale } from "@/i18n";
|
|
2
|
-
|
|
3
|
-
export type AppDirection = "ltr" | "rtl";
|
|
4
|
-
|
|
5
|
-
export type EmperorUILang = "en" | "ar";
|
|
6
|
-
|
|
7
|
-
export type EmperorUILocales = Record<
|
|
8
|
-
EmperorUILang,
|
|
9
|
-
Partial<{
|
|
10
|
-
atoms?: {
|
|
11
|
-
uploader?: Partial<Locale["atoms"]["uploader"]>;
|
|
12
|
-
colorPicker?: Partial<Locale["atoms"]["colorPicker"]>;
|
|
13
|
-
};
|
|
14
|
-
}>
|
|
15
|
-
>;
|
|
16
|
-
|
|
17
|
-
export type EmperorUIInterLocalization = {
|
|
18
|
-
lang?: EmperorUILang;
|
|
19
|
-
languages?: EmperorUILang[];
|
|
20
|
-
defaultLanguage?: EmperorUILang;
|
|
21
|
-
isMultiLingual?: boolean;
|
|
22
|
-
dir?: AppDirection;
|
|
23
|
-
locales?: EmperorUILocales;
|
|
24
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { NavigationItem } from "@/types";
|
|
2
|
-
import { ReactNode } from "react";
|
|
3
|
-
|
|
4
|
-
export type NavigationContextState = {
|
|
5
|
-
hoveredItemId: string | null;
|
|
6
|
-
subItems: NavigationItem[];
|
|
7
|
-
isSubItemsBoxOpen: boolean;
|
|
8
|
-
subItemsBoxIsHovered: boolean;
|
|
9
|
-
setHoveredItemId: (id: string | null) => void;
|
|
10
|
-
setSubItems: (items: NavigationItem[]) => void;
|
|
11
|
-
setIsSubItemsBoxOpen: (isOpen: boolean) => void;
|
|
12
|
-
setSubItemsBoxIsHovered: (isHovered: boolean) => void;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export type NavigationProviderProps = {
|
|
16
|
-
children: ReactNode;
|
|
17
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { InputProps, TextAreaProps } from "@heroui/input";
|
|
2
|
-
import { ButtonProps } from "@heroui/button";
|
|
3
|
-
import { CardProps } from "@heroui/card";
|
|
4
|
-
import { DropdownProps } from "@heroui/dropdown";
|
|
5
|
-
import { ModalProps } from "@heroui/modal";
|
|
6
|
-
import { CheckboxGroupProps, CheckboxProps } from "@heroui/checkbox";
|
|
7
|
-
import { AutocompleteItemProps, AutocompleteProps } from "@heroui/autocomplete";
|
|
8
|
-
import { SelectProps, SelectItemProps } from "@heroui/select";
|
|
9
|
-
import { RadioGroupProps } from "@heroui/radio";
|
|
10
|
-
import { SwitchProps } from "@heroui/switch";
|
|
11
|
-
import { DatePickerProps } from "@heroui/date-picker";
|
|
12
|
-
import { SliderProps } from "@heroui/slider";
|
|
13
|
-
|
|
14
|
-
export type EmperorUITheme = {
|
|
15
|
-
components?: {
|
|
16
|
-
input?: InputProps;
|
|
17
|
-
textarea?: TextAreaProps;
|
|
18
|
-
button?: ButtonProps;
|
|
19
|
-
card?: CardProps;
|
|
20
|
-
dropdown?: DropdownProps;
|
|
21
|
-
modal?: ModalProps;
|
|
22
|
-
checkbox?: CheckboxProps;
|
|
23
|
-
checkboxGroup?: CheckboxGroupProps;
|
|
24
|
-
autocomplete?: Omit<AutocompleteProps, "children">;
|
|
25
|
-
autocompleteItem?: Omit<AutocompleteItemProps, "children">;
|
|
26
|
-
radio?: Omit<RadioGroupProps, "children">;
|
|
27
|
-
select?: Omit<SelectProps, "children">;
|
|
28
|
-
selectItem?: Omit<SelectItemProps, "children">;
|
|
29
|
-
switch?: SwitchProps;
|
|
30
|
-
datePicker?: DatePickerProps;
|
|
31
|
-
slider?: SliderProps;
|
|
32
|
-
};
|
|
33
|
-
};
|
package/src/types/index.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
export type SharedComponentProps = {
|
|
4
|
-
className?: string;
|
|
5
|
-
classNames?: {
|
|
6
|
-
base?: string;
|
|
7
|
-
};
|
|
8
|
-
children?: ReactNode;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export type ComponentSize = "xs" | "sm" | "base" | "md" | "lg" | "xl";
|
|
12
|
-
|
|
13
|
-
export type ComponentRadius = "none" | "sm" | "md" | "lg" | "full";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type * from "./components";
|
package/src/utils/cn.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { FileObject } from "@/types";
|
|
4
|
-
/**
|
|
5
|
-
* Compress an image to reduce its size
|
|
6
|
-
*
|
|
7
|
-
* ! NOTE: This function should ONLY run on CLIENT side
|
|
8
|
-
*/
|
|
9
|
-
import imageCompression from "browser-image-compression";
|
|
10
|
-
|
|
11
|
-
export async function compressImage(
|
|
12
|
-
fileObject: FileObject,
|
|
13
|
-
maxSizeMB?: number,
|
|
14
|
-
): Promise<FileObject | null> {
|
|
15
|
-
try {
|
|
16
|
-
if (!fileObject?.file) return null;
|
|
17
|
-
|
|
18
|
-
const blob = await imageCompression(fileObject?.file, {
|
|
19
|
-
maxSizeMB: maxSizeMB || 2,
|
|
20
|
-
useWebWorker: true, // Optimize performance
|
|
21
|
-
initialQuality: 0.8, // Adjust the compression quality (0.1 to 1)
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
const compressedFile = new File([blob], fileObject?.file?.name, {
|
|
25
|
-
type: blob.type,
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
return {
|
|
29
|
-
...fileObject,
|
|
30
|
-
file: compressedFile,
|
|
31
|
-
};
|
|
32
|
-
} catch (error) {
|
|
33
|
-
console.error("Image compression failed:", error);
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
}
|
package/src/utils/index.ts
DELETED
package/src/utils/locales.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Locale } from "@/i18n";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Checks if a value is a plain object (not array, null, or other object types).
|
|
5
|
-
*/
|
|
6
|
-
const isPlainObject = (value: unknown): value is Record<string, unknown> =>
|
|
7
|
-
typeof value === "object" && value !== null && !Array.isArray(value);
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Deep-merges config locales into default locales. Default values are used as base,
|
|
11
|
-
* and config values override only the keys they provide. Nested objects are merged
|
|
12
|
-
* recursively so unrelated keys at any level remain unchanged.
|
|
13
|
-
*/
|
|
14
|
-
export const mergeLocales = ({
|
|
15
|
-
defaultLocales,
|
|
16
|
-
configLocales,
|
|
17
|
-
}: {
|
|
18
|
-
defaultLocales: Locale;
|
|
19
|
-
configLocales?: Partial<Locale>;
|
|
20
|
-
}): Locale => {
|
|
21
|
-
const deepMerge = <T extends Record<string, unknown>>(
|
|
22
|
-
defaultObj: T,
|
|
23
|
-
configObj: Partial<T> | undefined,
|
|
24
|
-
): T => {
|
|
25
|
-
if (configObj == null || Object.keys(configObj).length === 0) {
|
|
26
|
-
return defaultObj;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const result = { ...defaultObj } as T;
|
|
30
|
-
|
|
31
|
-
for (const key of Object.keys(configObj) as (keyof T)[]) {
|
|
32
|
-
const configVal = configObj[key];
|
|
33
|
-
const defaultVal = defaultObj[key];
|
|
34
|
-
|
|
35
|
-
if (configVal === undefined) continue;
|
|
36
|
-
|
|
37
|
-
if (isPlainObject(configVal) && isPlainObject(defaultVal as unknown)) {
|
|
38
|
-
(result as Record<string, unknown>)[key as string] = deepMerge(
|
|
39
|
-
defaultVal as Record<string, unknown>,
|
|
40
|
-
configVal,
|
|
41
|
-
);
|
|
42
|
-
} else {
|
|
43
|
-
(result as Record<string, unknown>)[key as string] = configVal;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return result;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
return deepMerge(
|
|
51
|
-
defaultLocales as unknown as Record<string, unknown>,
|
|
52
|
-
configLocales as Partial<Record<string, unknown>>,
|
|
53
|
-
) as Locale;
|
|
54
|
-
};
|
package/src/utils/storybook.tsx
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { EmperorUIProvider } from "@/providers";
|
|
2
|
-
import { defaultEmperorUIConfig } from "@/constants";
|
|
3
|
-
import { EmperorUIConfig } from "@/types";
|
|
4
|
-
|
|
5
|
-
export const getStorybookDecorators = ({
|
|
6
|
-
config = defaultEmperorUIConfig,
|
|
7
|
-
}: {
|
|
8
|
-
config?: EmperorUIConfig;
|
|
9
|
-
}) => [
|
|
10
|
-
(Story: any) => (
|
|
11
|
-
<EmperorUIProvider config={config}>
|
|
12
|
-
<Story />
|
|
13
|
-
</EmperorUIProvider>
|
|
14
|
-
),
|
|
15
|
-
];
|