@js-empire/emperor-ui 1.1.0 → 1.2.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/.storybook/vitest.setup.ts +3 -3
- package/.vscode/extensions.json +1 -3
- package/README.md +0 -21
- package/dist/emperor-ui.js +71 -0
- package/dist/emperor-ui.umd.cjs +49 -0
- package/dist/features-animation-D_Ss-HYx.js +1938 -0
- package/dist/globals.css +1 -0
- 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-C3mfrNCk.js +1630 -0
- package/dist/index-CZpTSGZs.js +5 -0
- package/dist/index-SRvFgjzo.js +26257 -0
- package/dist/index.d.ts +706 -0
- package/dist/src-UW24ZMRV-Ducut0ty.js +5 -0
- package/eslint.config.js +5 -14
- package/package.json +4 -4
- package/src/components/atoms/brand/brand.stories.tsx +3 -3
- package/src/components/atoms/brand/brand.tsx +3 -3
- package/src/components/atoms/column/column.stories.tsx +5 -4
- package/src/components/atoms/column/column.tsx +2 -2
- package/src/components/atoms/container/column.stories.tsx +5 -4
- package/src/components/atoms/container/container.tsx +2 -2
- package/src/components/atoms/portal/portal.stories.tsx +4 -4
- package/src/components/atoms/portal/portal.tsx +4 -2
- package/src/components/atoms/row/row.stories.tsx +5 -4
- package/src/components/atoms/row/row.tsx +2 -2
- package/src/components/atoms/uploader/avatar-label.tsx +2 -2
- package/src/components/atoms/uploader/stories/uploader.stories.tsx +127 -8
- package/src/components/atoms/uploader/upload-file-error-box.tsx +1 -1
- package/src/components/atoms/uploader/upload-file-input.tsx +2 -2
- package/src/components/atoms/uploader/upload-file-label.tsx +1 -1
- package/src/components/atoms/uploader/upload-file-listing.tsx +6 -4
- package/src/components/atoms/uploader/uploader.tsx +4 -4
- package/src/components/atoms/uploader/view-image-modal.tsx +6 -5
- package/src/components/molecules/filter/filter.tsx +2 -2
- package/src/components/molecules/item-card/item-card.tsx +2 -2
- package/src/components/molecules/nav-bar/nav-bar-item.tsx +3 -3
- package/src/components/molecules/nav-bar/nav-bar.tsx +4 -4
- package/src/components/molecules/nav-bar/stories/hover-effect/nav-bar-hover-effect.stories.tsx +4 -4
- package/src/components/molecules/nav-bar/stories/nav-bar.stories.tsx +4 -4
- package/src/components/molecules/nav-bar/styles/styles.ts +2 -1
- package/src/components/molecules/nav-bar/sub-items-box.tsx +2 -2
- package/src/components/molecules/scaffold/scaffold.stories.tsx +3 -3
- package/src/components/molecules/scaffold/scaffold.tsx +4 -4
- package/src/components/molecules/side-bar/compact-side-bar.tsx +5 -3
- package/src/components/molecules/side-bar/side-bar-drawer.tsx +3 -3
- package/src/components/molecules/side-bar/side-bar.stories.tsx +9 -8
- package/src/components/molecules/side-bar/side-bar.tsx +2 -2
- package/src/components/molecules/side-bar/styles/styles.ts +1 -1
- package/src/components/organisms/footer/copy-rights-box.tsx +27 -0
- package/src/components/organisms/footer/footer.tsx +69 -14
- package/src/components/organisms/footer/index.ts +4 -0
- package/src/components/organisms/footer/policies-box.tsx +26 -0
- package/src/components/organisms/footer/quick-links-box.tsx +45 -0
- package/src/components/organisms/footer/social-links-box.tsx +32 -0
- package/src/components/organisms/footer/stories/footer.stories.tsx +61 -0
- package/src/components/organisms/footer/styles/classes.ts +58 -2
- package/src/components/organisms/footer/styles/styles.ts +2 -5
- package/src/components/organisms/header/header.tsx +5 -5
- package/src/components/organisms/header/segmented-header-content.tsx +3 -3
- package/src/components/organisms/header/stories/header.stories.tsx +8 -7
- package/src/components/organisms/header/styles/styles.ts +1 -1
- package/src/components/organisms/index.ts +1 -1
- package/src/components/organisms/item-details/item-details.tsx +2 -2
- package/src/components/organisms/listings/listings.tsx +2 -2
- package/src/components/templates/landing-page/landing-page.stories.tsx +3 -3
- package/src/components/templates/landing-page/landing-page.tsx +5 -5
- package/src/constants/defaults.ts +1 -1
- package/src/constants/fake.ts +3 -0
- package/src/constants/footer.tsx +157 -0
- package/src/constants/index.ts +1 -0
- package/src/context/emperor-ui-context.ts +1 -1
- package/src/context/navigation-context.ts +1 -1
- package/src/context/uploader-context.ts +1 -1
- package/src/hooks/use-emperor-ui.ts +1 -1
- package/src/hooks/use-navigation.ts +1 -1
- package/src/hooks/use-uploader-context.ts +1 -1
- package/src/hooks/use-uploader.tsx +42 -106
- package/src/main.tsx +1 -1
- package/src/mocks/header.tsx +1 -1
- package/src/providers/config-provider.tsx +4 -4
- package/src/providers/emperor-ui-provider.tsx +2 -2
- package/src/providers/navigation-provider.tsx +3 -3
- package/src/providers/uploader-provider.tsx +2 -2
- package/src/types/components/atoms/brand.ts +1 -1
- package/src/types/components/atoms/column.ts +1 -1
- package/src/types/components/atoms/container.ts +1 -1
- package/src/types/components/atoms/portal.ts +1 -1
- package/src/types/components/atoms/row.ts +1 -1
- package/src/types/components/atoms/uploader.ts +4 -11
- package/src/types/components/molecules/filter/filter.ts +1 -1
- package/src/types/components/molecules/footer/footer.ts +60 -1
- package/src/types/components/molecules/header/header.ts +1 -1
- package/src/types/components/molecules/item-card/item-card.ts +1 -1
- package/src/types/components/molecules/item-details/item-details.ts +1 -1
- package/src/types/components/molecules/listings/listings.ts +1 -1
- package/src/types/components/molecules/nav-bar/nav-bar.ts +2 -1
- package/src/types/components/molecules/scaffold/scaffold.ts +1 -1
- package/src/types/components/molecules/side-bar/side-bar.ts +1 -1
- package/src/types/components/templates/landing-page.ts +1 -1
- package/src/types/context/navigation.ts +1 -1
- package/src/utils/compress-images.ts +1 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/storybook.tsx +3 -3
- package/src/utils/uploader.ts +148 -0
- package/tsconfig.app.json +1 -10
- package/vite.config.ts +1 -10
- package/vitest.shims.d.ts +1 -1
package/eslint.config.js
CHANGED
|
@@ -10,21 +10,13 @@ import { defineConfig, globalIgnores } from "eslint/config";
|
|
|
10
10
|
|
|
11
11
|
export default defineConfig([
|
|
12
12
|
globalIgnores(["dist"]),
|
|
13
|
+
js.configs.recommended,
|
|
14
|
+
...tseslint.configs.recommended,
|
|
15
|
+
reactHooks.configs.flat.recommended,
|
|
16
|
+
reactRefresh.configs.vite,
|
|
17
|
+
...storybook.configs["flat/recommended"],
|
|
13
18
|
{
|
|
14
19
|
files: ["**/*.{ts,tsx}"],
|
|
15
|
-
extends: [
|
|
16
|
-
js.configs.recommended,
|
|
17
|
-
tseslint.configs.recommended,
|
|
18
|
-
reactHooks.configs.flat.recommended,
|
|
19
|
-
reactRefresh.configs.vite,
|
|
20
|
-
"eslint:recommended",
|
|
21
|
-
"plugin:@typescript-eslint/recommended",
|
|
22
|
-
"plugin:react-hooks/recommended",
|
|
23
|
-
"plugin:storybook/recommended"
|
|
24
|
-
],
|
|
25
|
-
ignorePatterns: ["dist", ".eslintrc.cjs"],
|
|
26
|
-
parser: "@typescript-eslint/parser",
|
|
27
|
-
plugins: ["react-refresh"],
|
|
28
20
|
languageOptions: {
|
|
29
21
|
ecmaVersion: 2020,
|
|
30
22
|
globals: globals.browser,
|
|
@@ -40,4 +32,3 @@ export default defineConfig([
|
|
|
40
32
|
},
|
|
41
33
|
},
|
|
42
34
|
]);
|
|
43
|
-
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@js-empire/emperor-ui",
|
|
3
3
|
"description": "They provide the atoms, we provide the empire.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"author": "JS Empire - Mustafa Alhasanat",
|
|
6
6
|
"license": "ISC",
|
|
7
7
|
"type": "module",
|
|
@@ -44,6 +44,9 @@
|
|
|
44
44
|
"main"
|
|
45
45
|
]
|
|
46
46
|
},
|
|
47
|
+
"resolutions": {
|
|
48
|
+
"jackspeak": "2.1.1"
|
|
49
|
+
},
|
|
47
50
|
"dependencies": {
|
|
48
51
|
"@heroui/react": "^2.8.5",
|
|
49
52
|
"@heroui/theme": "^2.4.25",
|
|
@@ -90,8 +93,5 @@
|
|
|
90
93
|
"vite": "^7.2.4",
|
|
91
94
|
"vite-plugin-dts": "^4.5.4",
|
|
92
95
|
"vitest": "^4.0.15"
|
|
93
|
-
},
|
|
94
|
-
"resolutions": {
|
|
95
|
-
"jackspeak": "2.1.1"
|
|
96
96
|
}
|
|
97
97
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Brand } from "
|
|
3
|
-
import { getStorybookDecorators } from "
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Brand } from "@/components";
|
|
3
|
+
import { getStorybookDecorators } from "@/utils";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Brand> = {
|
|
6
6
|
title: "Atoms/Brand",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { BrandProps } from "
|
|
2
|
-
import { cn } from "
|
|
1
|
+
import type { BrandProps } from "@/types";
|
|
2
|
+
import { cn } from "@/utils";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
import { ComponentProps, forwardRef } from "react";
|
|
5
|
-
import { Row } from "
|
|
5
|
+
import { Row } from "@/components";
|
|
6
6
|
import { brandStyles } from "./styles";
|
|
7
7
|
import { Image } from "@heroui/react";
|
|
8
8
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Column } from "
|
|
3
|
-
import {
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Column } from "@/components";
|
|
3
|
+
import type { ColumnProps } from "@/types";
|
|
4
|
+
import { getStorybookDecorators } from "@/utils";
|
|
4
5
|
|
|
5
6
|
const meta: Meta<typeof Column> = {
|
|
6
7
|
title: "Atoms/Column",
|
|
@@ -24,7 +25,7 @@ type Story = StoryObj<typeof meta>;
|
|
|
24
25
|
|
|
25
26
|
export const Default: Story = {
|
|
26
27
|
args: {},
|
|
27
|
-
render: (args) => (
|
|
28
|
+
render: (args: ColumnProps) => (
|
|
28
29
|
<Column {...args}>
|
|
29
30
|
{Array.from({ length: 5 }).map((_, index) => (
|
|
30
31
|
<div key={index} className="bg-blue-300 p-2 rounded-md">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ColumnProps } from "
|
|
2
|
-
import { cn } from "
|
|
1
|
+
import type { ColumnProps } from "@/types";
|
|
2
|
+
import { cn } from "@/utils";
|
|
3
3
|
import { cva, VariantProps } from "class-variance-authority";
|
|
4
4
|
import { forwardRef, ComponentProps } from "react";
|
|
5
5
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Container } from "
|
|
3
|
-
import { getStorybookDecorators } from "
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Container } from "@/components";
|
|
3
|
+
import { getStorybookDecorators } from "@/utils";
|
|
4
|
+
import type { ContainerProps } from "@/types";
|
|
4
5
|
|
|
5
6
|
const meta: Meta<typeof Container> = {
|
|
6
7
|
title: "Atoms/Container",
|
|
@@ -26,7 +27,7 @@ export const Default: Story = {
|
|
|
26
27
|
args: {
|
|
27
28
|
className: "h-screen flex items-center justify-center",
|
|
28
29
|
},
|
|
29
|
-
render: (args) => (
|
|
30
|
+
render: (args: ContainerProps) => (
|
|
30
31
|
<Container {...args}>
|
|
31
32
|
<div className="bg-blue-300 p-2 text-center rounded-md w-full h-fit">
|
|
32
33
|
Responsive contained content
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ContainerProps } from "
|
|
2
|
-
import { cn } from "
|
|
1
|
+
import type { ContainerProps } from "@/types";
|
|
2
|
+
import { cn } from "@/utils";
|
|
3
3
|
import { cva, VariantProps } from "class-variance-authority";
|
|
4
4
|
import { forwardRef, ComponentProps } from "react";
|
|
5
5
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Portal } from "
|
|
3
|
-
import { getStorybookDecorators } from "
|
|
4
|
-
import { FAKE_PARAGRAPH } from "
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Portal } from "@/components";
|
|
3
|
+
import { getStorybookDecorators } from "@/utils";
|
|
4
|
+
import { FAKE_PARAGRAPH } from "@/constants";
|
|
5
5
|
|
|
6
6
|
const meta: Meta<typeof Portal> = {
|
|
7
7
|
title: "Atoms/Portal",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PortalProps } from "
|
|
1
|
+
import { PortalProps } from "@/types";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { createPortal } from "react-dom";
|
|
4
4
|
|
|
@@ -12,7 +12,9 @@ export function Portal({
|
|
|
12
12
|
useEffect(() => {
|
|
13
13
|
const element = document.getElementById(containerId);
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
setTimeout(() => {
|
|
16
|
+
setContainer(element);
|
|
17
|
+
}, 100);
|
|
16
18
|
}, [containerId]);
|
|
17
19
|
|
|
18
20
|
if (!container || !isVisible) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Row } from "
|
|
3
|
-
import { getStorybookDecorators } from "
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Row } from "@/components";
|
|
3
|
+
import { getStorybookDecorators } from "@/utils";
|
|
4
|
+
import type { RowProps } from "@/types";
|
|
4
5
|
|
|
5
6
|
const meta: Meta<typeof Row> = {
|
|
6
7
|
title: "Atoms/Row",
|
|
@@ -24,7 +25,7 @@ type Story = StoryObj<typeof meta>;
|
|
|
24
25
|
|
|
25
26
|
export const Default: Story = {
|
|
26
27
|
args: {},
|
|
27
|
-
render: (args) => (
|
|
28
|
+
render: (args: RowProps) => (
|
|
28
29
|
<Row {...args}>
|
|
29
30
|
{Array.from({ length: 5 }).map((_, index) => (
|
|
30
31
|
<div key={index} className="bg-blue-300 p-2 rounded-md">
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { Placeholders } from "
|
|
3
|
+
import { Placeholders } from "@/enums";
|
|
4
4
|
import { Avatar, Spinner, cn } from "@heroui/react";
|
|
5
|
-
import { useEmperorUI, useUploaderContext } from "
|
|
5
|
+
import { useEmperorUI, useUploaderContext } from "@/hooks";
|
|
6
6
|
import { useState } from "react";
|
|
7
7
|
|
|
8
8
|
export function AvatarLabel() {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Uploader } from "
|
|
3
|
-
import { getStorybookDecorators } from "
|
|
4
|
-
import { UploaderProps } from "
|
|
5
|
-
import { useUploader } from "
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Uploader } from "@/components";
|
|
3
|
+
import { getStorybookDecorators } from "@/utils";
|
|
4
|
+
import { UploaderProps } from "@/types";
|
|
5
|
+
import { useUploader } from "@/hooks";
|
|
6
|
+
import { useDisclosure } from "@heroui/react";
|
|
6
7
|
|
|
7
8
|
const meta: Meta<typeof Uploader> = {
|
|
8
9
|
title: "Atoms/Uploader",
|
|
@@ -30,12 +31,130 @@ export const Default: Story = {
|
|
|
30
31
|
const uploadProps = useUploader({
|
|
31
32
|
fileTypes: ["image"],
|
|
32
33
|
labelId: "image",
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
return <Uploader {...uploadProps} {...args} />;
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const MultiFiles: Story = {
|
|
41
|
+
args: {},
|
|
42
|
+
render: (args: UploaderProps) => {
|
|
43
|
+
const uploadProps = useUploader({
|
|
44
|
+
fileTypes: ["image"],
|
|
45
|
+
labelId: "image",
|
|
36
46
|
isMulti: true,
|
|
37
47
|
});
|
|
38
48
|
|
|
39
49
|
return <Uploader {...uploadProps} {...args} />;
|
|
40
50
|
},
|
|
41
51
|
};
|
|
52
|
+
|
|
53
|
+
export const WithMaxCount: Story = {
|
|
54
|
+
args: {},
|
|
55
|
+
render: (args: UploaderProps) => {
|
|
56
|
+
const uploadProps = useUploader({
|
|
57
|
+
fileTypes: ["image"],
|
|
58
|
+
labelId: "image",
|
|
59
|
+
isMulti: true,
|
|
60
|
+
maxCount: 2,
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
return <Uploader {...uploadProps} {...args} />;
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const Required: Story = {
|
|
68
|
+
args: {},
|
|
69
|
+
render: (args: UploaderProps) => {
|
|
70
|
+
const uploadProps = useUploader({
|
|
71
|
+
fileTypes: ["image"],
|
|
72
|
+
labelId: "image",
|
|
73
|
+
isRequired: true,
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
return <Uploader {...uploadProps} {...args} />;
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const HideListings: Story = {
|
|
81
|
+
args: {},
|
|
82
|
+
render: (args: UploaderProps) => {
|
|
83
|
+
const uploadProps = useUploader({
|
|
84
|
+
fileTypes: ["image"],
|
|
85
|
+
labelId: "image",
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
return <Uploader hideListing {...uploadProps} {...args} />;
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const ViewableImages: Story = {
|
|
93
|
+
args: {},
|
|
94
|
+
render: (args: UploaderProps) => {
|
|
95
|
+
const uploadProps = useUploader({
|
|
96
|
+
fileTypes: ["image"],
|
|
97
|
+
labelId: "image",
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const modalProps = useDisclosure();
|
|
101
|
+
|
|
102
|
+
return (
|
|
103
|
+
<Uploader
|
|
104
|
+
isFileViewable
|
|
105
|
+
modal={{
|
|
106
|
+
...modalProps,
|
|
107
|
+
}}
|
|
108
|
+
{...uploadProps}
|
|
109
|
+
{...args}
|
|
110
|
+
/>
|
|
111
|
+
);
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export const AllowDuplicates: Story = {
|
|
116
|
+
args: {},
|
|
117
|
+
render: (args: UploaderProps) => {
|
|
118
|
+
const uploadProps = useUploader({
|
|
119
|
+
fileTypes: ["image"],
|
|
120
|
+
labelId: "image",
|
|
121
|
+
preventDuplicates: false,
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
return <Uploader {...uploadProps} {...args} />;
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export const CompressFiles: Story = {
|
|
129
|
+
args: {},
|
|
130
|
+
render: (args: UploaderProps) => {
|
|
131
|
+
const uploadProps = useUploader({
|
|
132
|
+
fileTypes: ["image"],
|
|
133
|
+
labelId: "uncompressed-image",
|
|
134
|
+
compressFiles: false,
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
const compressedUploadProps = useUploader({
|
|
138
|
+
fileTypes: ["image"],
|
|
139
|
+
labelId: "compressed-image",
|
|
140
|
+
compressFiles: true,
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<div className="grid grid-cols-2 gap-4">
|
|
145
|
+
<h3 className="text-lg font-bold">Uncompressed</h3>
|
|
146
|
+
<h3 className="text-lg font-bold">Compressed</h3>
|
|
147
|
+
|
|
148
|
+
<Uploader {...uploadProps} {...args} />
|
|
149
|
+
<Uploader {...compressedUploadProps} {...args} />
|
|
150
|
+
|
|
151
|
+
<p className="text-sm text-gray-500">
|
|
152
|
+
File size: {uploadProps.files[0]?.file?.size || "---"}
|
|
153
|
+
</p>
|
|
154
|
+
<p className="text-sm text-gray-500">
|
|
155
|
+
File size: {compressedUploadProps.files[0]?.file?.size || "---"}
|
|
156
|
+
</p>
|
|
157
|
+
</div>
|
|
158
|
+
);
|
|
159
|
+
},
|
|
160
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { cn } from "@heroui/react";
|
|
4
|
-
import { useUploaderContext } from "
|
|
5
|
-
import { fileTypesMapping } from "
|
|
4
|
+
import { useUploaderContext } from "@/hooks";
|
|
5
|
+
import { fileTypesMapping } from "@/constants";
|
|
6
6
|
|
|
7
7
|
export function UploadFileInput() {
|
|
8
8
|
const {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { Spinner, cn } from "@heroui/react";
|
|
4
|
-
import { useEmperorUI, useUploaderContext } from "
|
|
4
|
+
import { useEmperorUI, useUploaderContext } from "@/hooks";
|
|
5
5
|
import { UploadCloud } from "lucide-react";
|
|
6
6
|
import { useState } from "react";
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { Button, cn } from "@heroui/react";
|
|
4
|
-
import { useUploaderContext } from "
|
|
4
|
+
import { useUploaderContext } from "@/hooks";
|
|
5
5
|
import { Eye, Trash2 } from "lucide-react";
|
|
6
6
|
|
|
7
7
|
export function UploadFileListing() {
|
|
@@ -21,7 +21,9 @@ export function UploadFileListing() {
|
|
|
21
21
|
classNames?.listing,
|
|
22
22
|
)}
|
|
23
23
|
>
|
|
24
|
-
<p className="w-full
|
|
24
|
+
<p className="w-full line-clamp-1 text-xs max-w-60">
|
|
25
|
+
{file?.file?.name}
|
|
26
|
+
</p>
|
|
25
27
|
|
|
26
28
|
<Button
|
|
27
29
|
isIconOnly
|
|
@@ -29,7 +31,7 @@ export function UploadFileListing() {
|
|
|
29
31
|
className="size-8 min-w-8 rounded-full"
|
|
30
32
|
color="danger"
|
|
31
33
|
onPress={() => handleClearFile(file?.file?.name)}
|
|
32
|
-
startContent={<Trash2 className="rounded-lg" />}
|
|
34
|
+
startContent={<Trash2 className="rounded-lg size-4" />}
|
|
33
35
|
/>
|
|
34
36
|
|
|
35
37
|
{isFileViewable && (
|
|
@@ -42,7 +44,7 @@ export function UploadFileListing() {
|
|
|
42
44
|
setSelectedFile?.(file);
|
|
43
45
|
modal?.onOpen?.();
|
|
44
46
|
}}
|
|
45
|
-
startContent={<Eye className="rounded-lg" />}
|
|
47
|
+
startContent={<Eye className="rounded-lg size-4" />}
|
|
46
48
|
/>
|
|
47
49
|
)}
|
|
48
50
|
</div>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { UploaderProps } from "
|
|
2
|
-
import { cn } from "
|
|
1
|
+
import type { UploaderProps } from "@/types";
|
|
2
|
+
import { cn } from "@/utils";
|
|
3
3
|
import { cva, VariantProps } from "class-variance-authority";
|
|
4
4
|
import { forwardRef, ComponentProps } from "react";
|
|
5
|
-
import { UploaderProvider } from "
|
|
5
|
+
import { UploaderProvider } from "@/providers";
|
|
6
6
|
import {
|
|
7
7
|
AvatarLabel,
|
|
8
8
|
UploadFileLabel,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
UploadFileListing,
|
|
11
11
|
UploadFileErrorBox,
|
|
12
12
|
UploadFileInput,
|
|
13
|
-
} from "
|
|
13
|
+
} from "@/components";
|
|
14
14
|
|
|
15
15
|
const uploaderStyles = cva(["w-full flex flex-col gap-2"], {
|
|
16
16
|
variants: {},
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { Image, Modal, ModalBody, ModalContent } from "@heroui/react";
|
|
4
|
-
import { useEmperorUI, useUploaderContext } from "
|
|
4
|
+
import { useEmperorUI, useUploaderContext } from "@/hooks";
|
|
5
5
|
|
|
6
6
|
export function ViewImageModal() {
|
|
7
7
|
const { config } = useEmperorUI();
|
|
8
|
-
const {
|
|
8
|
+
const { modal, selectedFile } = useUploaderContext();
|
|
9
9
|
|
|
10
10
|
const lang = config?.interLocalization?.lang || "en";
|
|
11
11
|
|
|
@@ -17,11 +17,12 @@ export function ViewImageModal() {
|
|
|
17
17
|
return (
|
|
18
18
|
<Modal
|
|
19
19
|
placement="center"
|
|
20
|
-
isOpen={isOpen}
|
|
20
|
+
isOpen={modal?.isOpen}
|
|
21
21
|
dir={lang === "ar" ? "rtl" : "ltr"}
|
|
22
|
-
onClose={onClose}
|
|
23
|
-
onOpenChange={onOpenChange}
|
|
22
|
+
onClose={modal?.onClose}
|
|
23
|
+
onOpenChange={modal?.onOpenChange}
|
|
24
24
|
size="xl"
|
|
25
|
+
{...modal}
|
|
25
26
|
>
|
|
26
27
|
<ModalContent className="px-5">
|
|
27
28
|
<ModalBody className="h-[60vh]">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FilterProps } from "
|
|
2
|
-
import { cn } from "
|
|
1
|
+
import type { FilterProps } from "@/types";
|
|
2
|
+
import { cn } from "@/utils";
|
|
3
3
|
|
|
4
4
|
export function Filter({ className }: FilterProps) {
|
|
5
5
|
return <div className={cn("", className)}>Filter Component</div>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ItemCardProps } from "
|
|
2
|
-
import { cn } from "
|
|
1
|
+
import type { ItemCardProps } from "@/types";
|
|
2
|
+
import { cn } from "@/utils";
|
|
3
3
|
|
|
4
4
|
export function ItemCard({ className }: ItemCardProps) {
|
|
5
5
|
return <div className={cn("", className)}>Item Card Component</div>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { cn } from "
|
|
1
|
+
import { cn } from "@/utils";
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
import { forwardRef, ComponentProps } from "react";
|
|
4
|
-
import type { NavBarItemProps } from "
|
|
4
|
+
import type { NavBarItemProps } from "@/types";
|
|
5
5
|
import { navBarItemClasses, navBarItemStyles } from "./styles";
|
|
6
|
-
import { useEmperorUI, useNavigation } from "
|
|
6
|
+
import { useEmperorUI, useNavigation } from "@/hooks";
|
|
7
7
|
|
|
8
8
|
export const NavBarItem = forwardRef<
|
|
9
9
|
HTMLLIElement,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { cn } from "
|
|
1
|
+
import { cn } from "@/utils";
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
import { forwardRef, ComponentProps } from "react";
|
|
4
|
-
import type { NavBarProps } from "
|
|
5
|
-
import { useEmperorUI } from "
|
|
4
|
+
import type { NavBarProps } from "@/types";
|
|
5
|
+
import { useEmperorUI } from "@/hooks";
|
|
6
6
|
import {
|
|
7
7
|
navBarClasses,
|
|
8
8
|
navBarMenuClasses,
|
|
9
9
|
navBarMenuStyles,
|
|
10
10
|
navBarStyles,
|
|
11
11
|
} from "./styles";
|
|
12
|
-
import { NavBarItem, SubItemsBox } from "
|
|
12
|
+
import { NavBarItem, SubItemsBox } from "@/components";
|
|
13
13
|
|
|
14
14
|
export const NavBar = forwardRef<
|
|
15
15
|
HTMLDivElement,
|
package/src/components/molecules/nav-bar/stories/hover-effect/nav-bar-hover-effect.stories.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { NavBar } from "
|
|
3
|
-
import { getStorybookDecorators } from "
|
|
4
|
-
import { MOCK_HEADER_ITEMS } from "
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { NavBar } from "@/components";
|
|
3
|
+
import { getStorybookDecorators } from "@/utils";
|
|
4
|
+
import { MOCK_HEADER_ITEMS } from "@/mocks";
|
|
5
5
|
|
|
6
6
|
const meta: Meta<typeof NavBar> = {
|
|
7
7
|
title: "Molecules/NavBar/HoverEffect",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { NavBar } from "
|
|
3
|
-
import { getStorybookDecorators } from "
|
|
4
|
-
import { MOCK_HEADER_ITEMS, MOCK_HEADER_ITEMS_WITH_SUB_ITEMS } from "
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { NavBar } from "@/components";
|
|
3
|
+
import { getStorybookDecorators } from "@/utils";
|
|
4
|
+
import { MOCK_HEADER_ITEMS, MOCK_HEADER_ITEMS_WITH_SUB_ITEMS } from "@/mocks";
|
|
5
5
|
|
|
6
6
|
const meta: Meta<typeof NavBar> = {
|
|
7
7
|
title: "Molecules/NavBar",
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
NavBarItemStylesProps,
|
|
3
3
|
NavBarMenuStylesProps,
|
|
4
4
|
NavBarStylesProps,
|
|
5
|
-
} from "
|
|
5
|
+
} from "@/types";
|
|
6
6
|
import { CSSProperties } from "react";
|
|
7
7
|
|
|
8
8
|
export const navBarStyles = ({
|
|
@@ -20,6 +20,7 @@ export const navBarStyles = ({
|
|
|
20
20
|
return {};
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
+
// eslint-disable-next-line no-empty-pattern
|
|
23
24
|
export const navBarMenuStyles = ({}: NavBarMenuStylesProps): CSSProperties => {
|
|
24
25
|
return {};
|
|
25
26
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn, Link } from "@heroui/react";
|
|
2
|
-
import { useNavigation } from "
|
|
3
|
-
import { SubItemsBoxProps } from "
|
|
2
|
+
import { useNavigation } from "@/hooks";
|
|
3
|
+
import { SubItemsBoxProps } from "@/types";
|
|
4
4
|
|
|
5
5
|
export const SubItemsBox = ({ subItemsColumns = 3 }: SubItemsBoxProps) => {
|
|
6
6
|
const {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Scaffold } from "
|
|
3
|
-
import { getStorybookDecorators } from "
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Scaffold } from "@/components";
|
|
3
|
+
import { getStorybookDecorators } from "@/utils";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Scaffold> = {
|
|
6
6
|
title: "Molecules/Scaffold",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useEmperorUI } from "
|
|
2
|
-
import type { ScaffoldProps } from "
|
|
3
|
-
import { cn } from "
|
|
1
|
+
import { useEmperorUI } from "@/hooks";
|
|
2
|
+
import type { ScaffoldProps } from "@/types";
|
|
3
|
+
import { cn } from "@/utils";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
5
|
import { forwardRef } from "react";
|
|
6
6
|
|
|
@@ -20,7 +20,7 @@ export const Scaffold = forwardRef<HTMLDivElement, ScaffoldProps>(
|
|
|
20
20
|
return (
|
|
21
21
|
<div
|
|
22
22
|
ref={ref}
|
|
23
|
-
dir={config?.dir}
|
|
23
|
+
dir={config?.interLocalization?.dir}
|
|
24
24
|
data-slot="scaffold"
|
|
25
25
|
className={cn(scaffoldStyles({ className }), className)}
|
|
26
26
|
style={{
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createPortal } from "react-dom";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
|
-
import { cn } from "
|
|
3
|
+
import { cn } from "@/utils";
|
|
4
4
|
import { Button, Divider, ScrollShadow } from "@heroui/react";
|
|
5
|
-
import { CompactSideBarProps } from "
|
|
5
|
+
import { CompactSideBarProps } from "@/types";
|
|
6
6
|
|
|
7
7
|
const CompactSideBarContent = ({
|
|
8
8
|
items = [],
|
|
@@ -62,7 +62,9 @@ export const CompactSideBar = (props: CompactSideBarProps) => {
|
|
|
62
62
|
|
|
63
63
|
useEffect(() => {
|
|
64
64
|
const element = document.getElementById("emperor-compact-sidebar");
|
|
65
|
-
|
|
65
|
+
setTimeout(() => {
|
|
66
|
+
setContainer(element);
|
|
67
|
+
}, 100);
|
|
66
68
|
}, []);
|
|
67
69
|
|
|
68
70
|
if (!container) {
|