@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.
Files changed (157) hide show
  1. package/.cursor/rules/code-conventions.mdc +50 -0
  2. package/README.md +222 -31
  3. package/dist/emperor-ui.js +119 -71
  4. package/dist/emperor-ui.umd.cjs +27 -13
  5. package/dist/globals.css +1 -1
  6. package/dist/index-BXtdEByK.js +5 -0
  7. package/dist/index-CDB93OLO.js +55965 -0
  8. package/dist/index-CYORMghp.js +290 -0
  9. package/dist/index.d.ts +334 -33
  10. package/dist/src-UW24ZMRV-C1Pn8-w8.js +5 -0
  11. package/package.json +32 -2
  12. package/src/animations/blink.ts +26 -0
  13. package/src/animations/floating.ts +12 -0
  14. package/src/animations/index.ts +2 -0
  15. package/src/components/atoms/brand/brand.tsx +1 -1
  16. package/src/components/atoms/color-picker/color-picker.tsx +13 -0
  17. package/src/components/atoms/color-picker/free-color-picker.tsx +60 -0
  18. package/src/components/atoms/color-picker/index.ts +3 -0
  19. package/src/components/atoms/color-picker/preset-color-picker.tsx +64 -0
  20. package/src/components/atoms/color-picker/stories/color-picker.stories.tsx +49 -0
  21. package/src/components/atoms/color-picker/styles/color-picker.css +23 -0
  22. package/src/components/atoms/copy-button/copy-button.tsx +73 -0
  23. package/src/components/atoms/copy-button/index.ts +1 -0
  24. package/src/components/atoms/copy-button/stories/copy-button.stories.tsx +21 -0
  25. package/src/components/atoms/field/field.stories.tsx +27 -0
  26. package/src/components/atoms/field/field.tsx +11 -0
  27. package/src/components/atoms/field/index.ts +1 -0
  28. package/src/components/atoms/field/styles/classes.ts +9 -0
  29. package/src/components/atoms/field/styles/index.ts +1 -0
  30. package/src/components/atoms/filter/filter.tsx +92 -0
  31. package/src/components/atoms/filter/index.ts +3 -0
  32. package/src/components/atoms/filter/stories/filter.stories.tsx +97 -0
  33. package/src/components/atoms/filter/styles/classes.ts +20 -0
  34. package/src/components/atoms/filter/styles/index.ts +1 -0
  35. package/src/components/atoms/filter/units/autocomplete-filter.tsx +39 -0
  36. package/src/components/atoms/filter/units/checkbox-filter.tsx +32 -0
  37. package/src/components/atoms/filter/units/checkbox-group-filter.tsx +37 -0
  38. package/src/components/atoms/filter/units/date-filter.tsx +50 -0
  39. package/src/components/atoms/filter/units/index.ts +9 -0
  40. package/src/components/atoms/filter/units/numeric-filter.tsx +36 -0
  41. package/src/components/atoms/filter/units/range-filter.tsx +36 -0
  42. package/src/components/atoms/filter/units/search-filter.tsx +52 -0
  43. package/src/components/atoms/filter/units/select-filter.tsx +49 -0
  44. package/src/components/atoms/filter/units/switch-filter.tsx +33 -0
  45. package/src/components/atoms/index.ts +5 -0
  46. package/src/components/atoms/theme-switch/index.ts +1 -0
  47. package/src/components/atoms/theme-switch/styles/classes.ts +16 -0
  48. package/src/components/atoms/theme-switch/styles/index.ts +1 -0
  49. package/src/components/atoms/theme-switch/theme-switch.stories.tsx +26 -0
  50. package/src/components/atoms/theme-switch/theme-switch.tsx +54 -0
  51. package/src/components/atoms/uploader/avatar-label.tsx +3 -1
  52. package/src/components/atoms/uploader/stories/uploader.stories.tsx +1 -1
  53. package/src/components/atoms/uploader/upload-file-error-box.tsx +1 -1
  54. package/src/components/atoms/uploader/upload-file-input.tsx +1 -1
  55. package/src/components/atoms/uploader/upload-file-label.tsx +2 -1
  56. package/src/components/atoms/uploader/upload-file-listing.tsx +2 -1
  57. package/src/components/atoms/uploader/view-image-modal.tsx +2 -1
  58. package/src/components/molecules/index.ts +0 -1
  59. package/src/components/molecules/item-card/index.ts +6 -0
  60. package/src/components/molecules/item-card/item-actions-dropdown.tsx +57 -0
  61. package/src/components/molecules/item-card/item-banner.tsx +22 -0
  62. package/src/components/molecules/item-card/item-card-body.tsx +68 -0
  63. package/src/components/molecules/item-card/item-card-footer.tsx +55 -0
  64. package/src/components/molecules/item-card/item-card-header.tsx +61 -0
  65. package/src/components/molecules/item-card/item-card.tsx +83 -3
  66. package/src/components/molecules/item-card/loading-item.tsx +88 -0
  67. package/src/components/molecules/item-card/stories/item-card.stories.tsx +182 -0
  68. package/src/components/molecules/item-card/styles/classes.ts +138 -0
  69. package/src/components/molecules/item-card/styles/index.ts +1 -0
  70. package/src/components/molecules/nav-bar/sub-items-box.tsx +2 -1
  71. package/src/components/molecules/scaffold/index.ts +1 -0
  72. package/src/components/molecules/scaffold/scaffold.tsx +4 -17
  73. package/src/components/molecules/scaffold/styles/index.ts +1 -0
  74. package/src/components/molecules/scaffold/styles/scaffold-classes.ts +10 -0
  75. package/src/components/molecules/side-bar/compact-side-bar.tsx +3 -1
  76. package/src/components/molecules/side-bar/side-bar-drawer.tsx +6 -17
  77. package/src/components/molecules/side-bar/side-bar.stories.tsx +1 -1
  78. package/src/components/organisms/filters/filters.stories.tsx +32 -0
  79. package/src/components/organisms/filters/filters.tsx +36 -0
  80. package/src/components/organisms/filters/index.ts +1 -0
  81. package/src/components/organisms/filters/styles/classes.ts +9 -0
  82. package/src/components/organisms/filters/styles/index.ts +1 -0
  83. package/src/components/organisms/footer/copy-rights-box.tsx +1 -1
  84. package/src/components/organisms/footer/footer.tsx +1 -1
  85. package/src/components/organisms/footer/policies-box.tsx +2 -1
  86. package/src/components/organisms/footer/quick-links-box.tsx +2 -1
  87. package/src/components/organisms/footer/social-links-box.tsx +2 -1
  88. package/src/components/organisms/footer/stories/footer.stories.tsx +1 -1
  89. package/src/components/organisms/header/header.tsx +1 -8
  90. package/src/components/organisms/index.ts +1 -0
  91. package/src/components/organisms/listings/empty-listings.tsx +80 -0
  92. package/src/components/organisms/listings/index.ts +2 -0
  93. package/src/components/organisms/listings/listings.tsx +90 -9
  94. package/src/components/organisms/listings/stories/grid-listings.stories.tsx +153 -0
  95. package/src/components/organisms/listings/stories/list-listings.stories.tsx +171 -0
  96. package/src/components/organisms/listings/styles/classes.ts +41 -3
  97. package/src/constants/animations.ts +14 -0
  98. package/src/constants/card.tsx +26 -0
  99. package/src/constants/defaults.ts +1 -16
  100. package/src/constants/index.ts +2 -0
  101. package/src/hooks/index.ts +3 -0
  102. package/src/hooks/use-filters.ts +20 -0
  103. package/src/hooks/use-search-params-handler.tsx +186 -0
  104. package/src/hooks/use-uploader.tsx +1 -1
  105. package/src/hooks/use-window-size.tsx +53 -0
  106. package/src/i18n/locales/atoms/ar.ts +3 -0
  107. package/src/i18n/locales/atoms/en.ts +3 -0
  108. package/src/i18n/locales/organisms/ar.ts +7 -1
  109. package/src/i18n/locales/organisms/en.ts +7 -1
  110. package/src/mocks/constants.ts +103 -0
  111. package/src/mocks/index.ts +2 -0
  112. package/src/mocks/listings.tsx +154 -0
  113. package/src/mocks/types.ts +64 -0
  114. package/src/providers/config-provider.tsx +0 -8
  115. package/src/providers/emperor-ui-provider.tsx +16 -5
  116. package/src/providers/index.ts +1 -0
  117. package/src/providers/theme-provider.tsx +16 -0
  118. package/src/providers/uploader-provider.tsx +1 -1
  119. package/src/styles/hero.ts +1 -1
  120. package/src/styles/index.css +23 -0
  121. package/src/types/components/atoms/color-picker/color-picker.ts +12 -0
  122. package/src/types/components/atoms/color-picker/index.ts +1 -0
  123. package/src/types/components/atoms/field/field.ts +9 -0
  124. package/src/types/components/atoms/field/index.ts +1 -0
  125. package/src/types/components/atoms/filter/filter.ts +43 -0
  126. package/src/types/components/atoms/filter/index.ts +2 -0
  127. package/src/types/components/atoms/filter/select-filter.ts +8 -0
  128. package/src/types/components/atoms/index.ts +3 -0
  129. package/src/types/components/atoms/uploader.ts +1 -1
  130. package/src/types/components/index.ts +1 -0
  131. package/src/types/components/molecules/index.ts +1 -1
  132. package/src/types/components/molecules/item-card/item-card.ts +50 -0
  133. package/src/types/components/molecules/listings/listings.ts +21 -5
  134. package/src/types/components/molecules/side-bar/side-bar.ts +1 -1
  135. package/src/types/components/molecules/theme-switch/index.ts +1 -0
  136. package/src/types/components/molecules/theme-switch/theme-switch.ts +9 -0
  137. package/src/types/components/organisms/filters/filters.ts +11 -0
  138. package/src/types/components/organisms/filters/index.ts +1 -0
  139. package/src/types/components/organisms/index.ts +1 -0
  140. package/src/types/context/config.ts +3 -4
  141. package/src/types/context/index.ts +0 -1
  142. package/src/types/context/localization.ts +1 -0
  143. package/src/types/shared/components.ts +3 -0
  144. package/src/utils/uploader.ts +1 -1
  145. package/dist/features-animation-w9dWMd15.js +0 -1938
  146. package/dist/index-BY47HgaP.js +0 -26533
  147. package/dist/index-CN4cJ1N7.js +0 -1630
  148. package/dist/index-Cr1mc-d4.js +0 -5
  149. package/dist/src-UW24ZMRV-nsR4cpiy.js +0 -5
  150. package/src/components/molecules/filter/filter.tsx +0 -6
  151. package/src/components/molecules/filter/index.ts +0 -1
  152. package/src/components/organisms/listings/stories/listings.stories.tsx +0 -30
  153. package/src/main.tsx +0 -3
  154. package/src/mocks/listings.ts +0 -200
  155. package/src/types/components/molecules/filter/filter.ts +0 -9
  156. package/src/types/components/molecules/filter/index.ts +0 -1
  157. package/src/types/context/theme.ts +0 -17
@@ -1,5 +0,0 @@
1
- import { d as a } from "./features-animation-w9dWMd15.js";
2
- var o = a;
3
- export {
4
- o as default
5
- };
@@ -1,5 +0,0 @@
1
- import { d as a } from "./features-animation-w9dWMd15.js";
2
- var r = a;
3
- export {
4
- r as default
5
- };
@@ -1,6 +0,0 @@
1
- import type { FilterProps } from "@/types";
2
- import { cn } from "@/utils";
3
-
4
- export function Filter({ className }: FilterProps) {
5
- return <div className={cn("", className)}>Filter Component</div>;
6
- }
@@ -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
@@ -1,3 +0,0 @@
1
- export function Main() {
2
- return <div></div>;
3
- }
@@ -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,9 +0,0 @@
1
- import type { SharedComponentProps } from "@/types";
2
-
3
- export type FilterClassnames = {
4
- base?: string;
5
- };
6
-
7
- export type FilterProps = SharedComponentProps & {
8
- classNames?: FilterClassnames;
9
- };
@@ -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
- };