@js-empire/emperor-ui 1.2.3 → 1.2.5
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/.cursor/rules/code-conventions.mdc +50 -0
- package/README.md +222 -31
- package/dist/emperor-ui.js +119 -71
- package/dist/emperor-ui.umd.cjs +27 -13
- package/dist/globals.css +1 -1
- package/dist/index-BXtdEByK.js +5 -0
- package/dist/index-CDB93OLO.js +55965 -0
- package/dist/index-CYORMghp.js +290 -0
- package/dist/index.d.ts +334 -33
- package/dist/src-UW24ZMRV-C1Pn8-w8.js +5 -0
- package/package.json +32 -2
- package/src/animations/blink.ts +26 -0
- package/src/animations/floating.ts +12 -0
- package/src/animations/index.ts +2 -0
- package/src/components/atoms/brand/brand.tsx +1 -1
- package/src/components/atoms/color-picker/color-picker.tsx +13 -0
- package/src/components/atoms/color-picker/free-color-picker.tsx +60 -0
- package/src/components/atoms/color-picker/index.ts +3 -0
- package/src/components/atoms/color-picker/preset-color-picker.tsx +64 -0
- package/src/components/atoms/color-picker/stories/color-picker.stories.tsx +49 -0
- package/src/components/atoms/color-picker/styles/color-picker.css +23 -0
- package/src/components/atoms/copy-button/copy-button.tsx +73 -0
- package/src/components/atoms/copy-button/index.ts +1 -0
- package/src/components/atoms/copy-button/stories/copy-button.stories.tsx +21 -0
- package/src/components/atoms/field/field.stories.tsx +27 -0
- package/src/components/atoms/field/field.tsx +11 -0
- package/src/components/atoms/field/index.ts +1 -0
- package/src/components/atoms/field/styles/classes.ts +9 -0
- package/src/components/atoms/field/styles/index.ts +1 -0
- package/src/components/atoms/filter/filter.tsx +92 -0
- package/src/components/atoms/filter/index.ts +3 -0
- package/src/components/atoms/filter/stories/filter.stories.tsx +97 -0
- package/src/components/atoms/filter/styles/classes.ts +20 -0
- package/src/components/atoms/filter/styles/index.ts +1 -0
- package/src/components/atoms/filter/units/autocomplete-filter.tsx +39 -0
- package/src/components/atoms/filter/units/checkbox-filter.tsx +32 -0
- package/src/components/atoms/filter/units/checkbox-group-filter.tsx +37 -0
- package/src/components/atoms/filter/units/date-filter.tsx +50 -0
- package/src/components/atoms/filter/units/index.ts +9 -0
- package/src/components/atoms/filter/units/numeric-filter.tsx +36 -0
- package/src/components/atoms/filter/units/range-filter.tsx +36 -0
- package/src/components/atoms/filter/units/search-filter.tsx +52 -0
- package/src/components/atoms/filter/units/select-filter.tsx +49 -0
- package/src/components/atoms/filter/units/switch-filter.tsx +33 -0
- package/src/components/atoms/index.ts +5 -0
- package/src/components/atoms/theme-switch/index.ts +1 -0
- package/src/components/atoms/theme-switch/styles/classes.ts +16 -0
- package/src/components/atoms/theme-switch/styles/index.ts +1 -0
- package/src/components/atoms/theme-switch/theme-switch.stories.tsx +26 -0
- package/src/components/atoms/theme-switch/theme-switch.tsx +54 -0
- package/src/components/atoms/uploader/avatar-label.tsx +3 -1
- package/src/components/atoms/uploader/stories/uploader.stories.tsx +1 -1
- package/src/components/atoms/uploader/upload-file-error-box.tsx +1 -1
- package/src/components/atoms/uploader/upload-file-input.tsx +1 -1
- package/src/components/atoms/uploader/upload-file-label.tsx +2 -1
- package/src/components/atoms/uploader/upload-file-listing.tsx +2 -1
- package/src/components/atoms/uploader/view-image-modal.tsx +2 -1
- package/src/components/molecules/index.ts +0 -1
- package/src/components/molecules/item-card/index.ts +6 -0
- package/src/components/molecules/item-card/item-actions-dropdown.tsx +57 -0
- package/src/components/molecules/item-card/item-banner.tsx +22 -0
- package/src/components/molecules/item-card/item-card-body.tsx +68 -0
- package/src/components/molecules/item-card/item-card-footer.tsx +55 -0
- package/src/components/molecules/item-card/item-card-header.tsx +61 -0
- package/src/components/molecules/item-card/item-card.tsx +83 -3
- package/src/components/molecules/item-card/loading-item.tsx +88 -0
- package/src/components/molecules/item-card/stories/item-card.stories.tsx +182 -0
- package/src/components/molecules/item-card/styles/classes.ts +138 -0
- package/src/components/molecules/item-card/styles/index.ts +1 -0
- package/src/components/molecules/nav-bar/sub-items-box.tsx +2 -1
- package/src/components/molecules/scaffold/index.ts +1 -0
- package/src/components/molecules/scaffold/scaffold.tsx +4 -17
- package/src/components/molecules/scaffold/styles/index.ts +1 -0
- package/src/components/molecules/scaffold/styles/scaffold-classes.ts +10 -0
- package/src/components/molecules/side-bar/compact-side-bar.tsx +3 -1
- package/src/components/molecules/side-bar/side-bar-drawer.tsx +6 -17
- package/src/components/molecules/side-bar/side-bar.stories.tsx +1 -1
- package/src/components/organisms/filters/filters.stories.tsx +32 -0
- package/src/components/organisms/filters/filters.tsx +36 -0
- package/src/components/organisms/filters/index.ts +1 -0
- package/src/components/organisms/filters/styles/classes.ts +9 -0
- package/src/components/organisms/filters/styles/index.ts +1 -0
- package/src/components/organisms/footer/copy-rights-box.tsx +1 -1
- package/src/components/organisms/footer/footer.tsx +1 -1
- package/src/components/organisms/footer/policies-box.tsx +2 -1
- package/src/components/organisms/footer/quick-links-box.tsx +2 -1
- package/src/components/organisms/footer/social-links-box.tsx +2 -1
- package/src/components/organisms/footer/stories/footer.stories.tsx +1 -1
- package/src/components/organisms/header/header.tsx +1 -8
- package/src/components/organisms/index.ts +1 -0
- package/src/components/organisms/listings/empty-listings.tsx +80 -0
- package/src/components/organisms/listings/index.ts +2 -0
- package/src/components/organisms/listings/listings.tsx +90 -9
- package/src/components/organisms/listings/stories/grid-listings.stories.tsx +153 -0
- package/src/components/organisms/listings/stories/list-listings.stories.tsx +171 -0
- package/src/components/organisms/listings/styles/classes.ts +41 -3
- package/src/constants/animations.ts +14 -0
- package/src/constants/card.tsx +26 -0
- package/src/constants/defaults.ts +1 -16
- package/src/constants/index.ts +2 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/use-filters.ts +20 -0
- package/src/hooks/use-search-params-handler.tsx +186 -0
- package/src/hooks/use-uploader.tsx +1 -1
- package/src/hooks/use-window-size.tsx +53 -0
- package/src/i18n/locales/atoms/ar.ts +3 -0
- package/src/i18n/locales/atoms/en.ts +3 -0
- package/src/i18n/locales/organisms/ar.ts +7 -1
- package/src/i18n/locales/organisms/en.ts +7 -1
- package/src/mocks/constants.ts +103 -0
- package/src/mocks/index.ts +2 -0
- package/src/mocks/listings.tsx +154 -0
- package/src/mocks/types.ts +64 -0
- package/src/providers/config-provider.tsx +0 -8
- package/src/providers/emperor-ui-provider.tsx +16 -5
- package/src/providers/index.ts +1 -0
- package/src/providers/theme-provider.tsx +16 -0
- package/src/providers/uploader-provider.tsx +1 -1
- package/src/styles/hero.ts +1 -1
- package/src/styles/index.css +23 -0
- package/src/types/components/atoms/color-picker/color-picker.ts +12 -0
- package/src/types/components/atoms/color-picker/index.ts +1 -0
- package/src/types/components/atoms/field/field.ts +9 -0
- package/src/types/components/atoms/field/index.ts +1 -0
- package/src/types/components/atoms/filter/filter.ts +43 -0
- package/src/types/components/atoms/filter/index.ts +2 -0
- package/src/types/components/atoms/filter/select-filter.ts +8 -0
- package/src/types/components/atoms/index.ts +3 -0
- package/src/types/components/atoms/uploader.ts +1 -1
- package/src/types/components/index.ts +1 -0
- package/src/types/components/molecules/index.ts +1 -1
- package/src/types/components/molecules/item-card/item-card.ts +50 -0
- package/src/types/components/molecules/listings/listings.ts +21 -5
- package/src/types/components/molecules/side-bar/side-bar.ts +1 -1
- package/src/types/components/molecules/theme-switch/index.ts +1 -0
- package/src/types/components/molecules/theme-switch/theme-switch.ts +9 -0
- package/src/types/components/organisms/filters/filters.ts +11 -0
- package/src/types/components/organisms/filters/index.ts +1 -0
- package/src/types/components/organisms/index.ts +1 -0
- package/src/types/context/config.ts +3 -4
- package/src/types/context/index.ts +0 -1
- package/src/types/context/localization.ts +1 -0
- package/src/types/shared/components.ts +3 -0
- package/src/utils/uploader.ts +1 -1
- package/dist/features-animation-w9dWMd15.js +0 -1938
- package/dist/index-BY47HgaP.js +0 -26533
- package/dist/index-CN4cJ1N7.js +0 -1630
- package/dist/index-Cr1mc-d4.js +0 -5
- package/dist/src-UW24ZMRV-nsR4cpiy.js +0 -5
- package/src/components/molecules/filter/filter.tsx +0 -6
- package/src/components/molecules/filter/index.ts +0 -1
- package/src/components/organisms/listings/stories/listings.stories.tsx +0 -30
- package/src/main.tsx +0 -3
- package/src/mocks/listings.ts +0 -200
- package/src/types/components/molecules/filter/filter.ts +0 -9
- package/src/types/components/molecules/filter/index.ts +0 -1
- package/src/types/context/theme.ts +0 -17
package/dist/index-Cr1mc-d4.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./filter";
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import { Listings } from "@/components";
|
|
3
|
-
import { getStorybookDecorators } from "@/utils";
|
|
4
|
-
import { getListings, MockItemType } from "@/mocks";
|
|
5
|
-
|
|
6
|
-
const meta: Meta<typeof Listings> = {
|
|
7
|
-
title: "Organisms/Listings",
|
|
8
|
-
component: Listings,
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: "fullscreen",
|
|
11
|
-
},
|
|
12
|
-
tags: ["autodocs"],
|
|
13
|
-
decorators: getStorybookDecorators({}),
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default meta;
|
|
17
|
-
|
|
18
|
-
type Story = StoryObj<typeof meta>;
|
|
19
|
-
|
|
20
|
-
export const Default: Story = {
|
|
21
|
-
args: {},
|
|
22
|
-
render: (args) => {
|
|
23
|
-
const items = getListings({
|
|
24
|
-
page: 1,
|
|
25
|
-
pageSize: 10,
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
return <Listings<MockItemType> {...args} items={items} />;
|
|
29
|
-
},
|
|
30
|
-
};
|
package/src/main.tsx
DELETED
package/src/mocks/listings.ts
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
export type MockItemType = {
|
|
2
|
-
id: number;
|
|
3
|
-
title: string;
|
|
4
|
-
description: string;
|
|
5
|
-
image: string;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const MOCK_LISTINGS: MockItemType[] = [
|
|
9
|
-
{
|
|
10
|
-
id: 1,
|
|
11
|
-
title: "Listing 1",
|
|
12
|
-
description: "Description 1",
|
|
13
|
-
image: "https://via.placeholder.com/150",
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
id: 2,
|
|
17
|
-
title: "Listing 2",
|
|
18
|
-
description: "Description 2",
|
|
19
|
-
image: "https://via.placeholder.com/150",
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
id: 3,
|
|
23
|
-
title: "Listing 3",
|
|
24
|
-
description: "Description 3",
|
|
25
|
-
image: "https://via.placeholder.com/150",
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
{
|
|
29
|
-
id: 4,
|
|
30
|
-
title: "Listing 4",
|
|
31
|
-
description: "Description 4",
|
|
32
|
-
image: "https://via.placeholder.com/150",
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
id: 5,
|
|
36
|
-
title: "Listing 5",
|
|
37
|
-
description: "Description 5",
|
|
38
|
-
image: "https://via.placeholder.com/150",
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
id: 6,
|
|
42
|
-
title: "Listing 6",
|
|
43
|
-
description: "Description 6",
|
|
44
|
-
image: "https://via.placeholder.com/150",
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
id: 7,
|
|
48
|
-
title: "Listing 7",
|
|
49
|
-
description: "Description 7",
|
|
50
|
-
image: "https://via.placeholder.com/150",
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
id: 8,
|
|
54
|
-
title: "Listing 8",
|
|
55
|
-
description: "Description 8",
|
|
56
|
-
image: "https://via.placeholder.com/150",
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
id: 9,
|
|
60
|
-
title: "Listing 9",
|
|
61
|
-
description: "Description 9",
|
|
62
|
-
image: "https://via.placeholder.com/150",
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
id: 10,
|
|
66
|
-
title: "Listing 10",
|
|
67
|
-
description: "Description 10",
|
|
68
|
-
image: "https://via.placeholder.com/150",
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
id: 11,
|
|
72
|
-
title: "Listing 11",
|
|
73
|
-
description: "Description 11",
|
|
74
|
-
image: "https://via.placeholder.com/150",
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
id: 12,
|
|
78
|
-
title: "Listing 12",
|
|
79
|
-
description: "Description 12",
|
|
80
|
-
image: "https://via.placeholder.com/150",
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
id: 13,
|
|
84
|
-
title: "Listing 13",
|
|
85
|
-
description: "Description 13",
|
|
86
|
-
image: "https://via.placeholder.com/150",
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
id: 14,
|
|
90
|
-
title: "Listing 14",
|
|
91
|
-
description: "Description 14",
|
|
92
|
-
image: "https://via.placeholder.com/150",
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
id: 15,
|
|
96
|
-
title: "Listing 15",
|
|
97
|
-
description: "Description 15",
|
|
98
|
-
image: "https://via.placeholder.com/150",
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
id: 16,
|
|
102
|
-
title: "Listing 16",
|
|
103
|
-
description: "Description 16",
|
|
104
|
-
image: "https://via.placeholder.com/150",
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
id: 17,
|
|
108
|
-
title: "Listing 17",
|
|
109
|
-
description: "Description 17",
|
|
110
|
-
image: "https://via.placeholder.com/150",
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
id: 18,
|
|
114
|
-
title: "Listing 18",
|
|
115
|
-
description: "Description 18",
|
|
116
|
-
image: "https://via.placeholder.com/150",
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
id: 19,
|
|
120
|
-
title: "Listing 19",
|
|
121
|
-
description: "Description 19",
|
|
122
|
-
image: "https://via.placeholder.com/150",
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
id: 20,
|
|
126
|
-
title: "Listing 20",
|
|
127
|
-
description: "Description 20",
|
|
128
|
-
image: "https://via.placeholder.com/150",
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
id: 21,
|
|
132
|
-
title: "Listing 21",
|
|
133
|
-
description: "Description 21",
|
|
134
|
-
image: "https://via.placeholder.com/150",
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
id: 22,
|
|
138
|
-
title: "Listing 22",
|
|
139
|
-
description: "Description 22",
|
|
140
|
-
image: "https://via.placeholder.com/150",
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
id: 23,
|
|
144
|
-
title: "Listing 23",
|
|
145
|
-
description: "Description 23",
|
|
146
|
-
image: "https://via.placeholder.com/150",
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
id: 24,
|
|
150
|
-
title: "Listing 24",
|
|
151
|
-
description: "Description 24",
|
|
152
|
-
image: "https://via.placeholder.com/150",
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
id: 25,
|
|
156
|
-
title: "Listing 25",
|
|
157
|
-
description: "Description 25",
|
|
158
|
-
image: "https://via.placeholder.com/150",
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
id: 26,
|
|
162
|
-
title: "Listing 26",
|
|
163
|
-
description: "Description 26",
|
|
164
|
-
image: "https://via.placeholder.com/150",
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
id: 27,
|
|
168
|
-
title: "Listing 27",
|
|
169
|
-
description: "Description 27",
|
|
170
|
-
image: "https://via.placeholder.com/150",
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
id: 28,
|
|
174
|
-
title: "Listing 28",
|
|
175
|
-
description: "Description 28",
|
|
176
|
-
image: "https://via.placeholder.com/150",
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
id: 29,
|
|
180
|
-
title: "Listing 29",
|
|
181
|
-
description: "Description 29",
|
|
182
|
-
image: "https://via.placeholder.com/150",
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
id: 30,
|
|
186
|
-
title: "Listing 30",
|
|
187
|
-
description: "Description 30",
|
|
188
|
-
image: "https://via.placeholder.com/150",
|
|
189
|
-
},
|
|
190
|
-
];
|
|
191
|
-
|
|
192
|
-
export const getListings = ({
|
|
193
|
-
page = 1,
|
|
194
|
-
pageSize = 10,
|
|
195
|
-
}: {
|
|
196
|
-
page?: number;
|
|
197
|
-
pageSize?: number;
|
|
198
|
-
}) => {
|
|
199
|
-
return MOCK_LISTINGS.slice((page - 1) * pageSize, page * pageSize);
|
|
200
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type * from "./filter";
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export type ColorMode = "light" | "dark";
|
|
2
|
-
|
|
3
|
-
export type ColorsPalette = {
|
|
4
|
-
primary: string;
|
|
5
|
-
secondary: string;
|
|
6
|
-
success: string;
|
|
7
|
-
danger: string;
|
|
8
|
-
warning: string;
|
|
9
|
-
info: string;
|
|
10
|
-
background: string;
|
|
11
|
-
foreground: string;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export type EmperorUITheme = {
|
|
15
|
-
mode: ColorMode;
|
|
16
|
-
colors: Partial<ColorsPalette>;
|
|
17
|
-
};
|