@js-empire/emperor-ui 1.3.5 → 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.
Files changed (318) hide show
  1. package/dist/emperor-ui.js +60624 -157
  2. package/dist/emperor-ui.umd.cjs +17 -17
  3. package/dist/index.d.ts +3 -0
  4. package/package.json +7 -3
  5. package/.cursor/rules/code-conventions.mdc +0 -50
  6. package/.husky/pre-commit +0 -4
  7. package/.prettierrc +0 -10
  8. package/.storybook/main.ts +0 -24
  9. package/.storybook/preview.ts +0 -19
  10. package/.storybook/vitest.setup.ts +0 -7
  11. package/.vscode/extensions.json +0 -1
  12. package/dist/index-31cOfB5-.js +0 -290
  13. package/dist/index-BwRbIPvN.js +0 -60566
  14. package/dist/index-DOyt37_Z.js +0 -5
  15. package/dist/src-UW24ZMRV-DMRqgyf4.js +0 -5
  16. package/eslint.config.js +0 -34
  17. package/index.html +0 -13
  18. package/public/icons/emperor-ui-logo.ico +0 -0
  19. package/public/images/avatar-female.jpg +0 -0
  20. package/public/images/avatar-male.jpg +0 -0
  21. package/public/images/emperor-ui-logo.png +0 -0
  22. package/src/animations/blink.ts +0 -26
  23. package/src/animations/floating.ts +0 -12
  24. package/src/animations/index.ts +0 -2
  25. package/src/components/atoms/brand/brand.stories.tsx +0 -27
  26. package/src/components/atoms/brand/brand.tsx +0 -56
  27. package/src/components/atoms/brand/index.ts +0 -1
  28. package/src/components/atoms/brand/styles/classes.ts +0 -9
  29. package/src/components/atoms/brand/styles/index.ts +0 -2
  30. package/src/components/atoms/brand/styles/styles.ts +0 -0
  31. package/src/components/atoms/color-picker/color-picker.tsx +0 -12
  32. package/src/components/atoms/color-picker/free-color-picker.tsx +0 -58
  33. package/src/components/atoms/color-picker/index.ts +0 -3
  34. package/src/components/atoms/color-picker/preset-color-picker.tsx +0 -66
  35. package/src/components/atoms/color-picker/stories/color-picker.stories.tsx +0 -63
  36. package/src/components/atoms/column/column.stories.tsx +0 -37
  37. package/src/components/atoms/column/column.tsx +0 -21
  38. package/src/components/atoms/column/index.ts +0 -1
  39. package/src/components/atoms/container/column.stories.tsx +0 -37
  40. package/src/components/atoms/container/container.tsx +0 -28
  41. package/src/components/atoms/container/index.ts +0 -1
  42. package/src/components/atoms/copy-button/copy-button.tsx +0 -73
  43. package/src/components/atoms/copy-button/index.ts +0 -1
  44. package/src/components/atoms/copy-button/stories/copy-button.stories.tsx +0 -21
  45. package/src/components/atoms/field/field.tsx +0 -81
  46. package/src/components/atoms/field/index.ts +0 -3
  47. package/src/components/atoms/field/styles/classes.ts +0 -9
  48. package/src/components/atoms/field/styles/index.ts +0 -1
  49. package/src/components/atoms/field/units/autocomplete-field.tsx +0 -49
  50. package/src/components/atoms/field/units/checkbox-field.tsx +0 -35
  51. package/src/components/atoms/field/units/index.ts +0 -7
  52. package/src/components/atoms/field/units/input-field.tsx +0 -35
  53. package/src/components/atoms/field/units/radio-field.tsx +0 -43
  54. package/src/components/atoms/field/units/select-field.tsx +0 -50
  55. package/src/components/atoms/field/units/switch-field.tsx +0 -35
  56. package/src/components/atoms/field/units/textarea-field.tsx +0 -37
  57. package/src/components/atoms/filter/filter.tsx +0 -93
  58. package/src/components/atoms/filter/index.ts +0 -3
  59. package/src/components/atoms/filter/stories/filter.stories.tsx +0 -238
  60. package/src/components/atoms/filter/styles/classes.ts +0 -20
  61. package/src/components/atoms/filter/styles/index.ts +0 -1
  62. package/src/components/atoms/filter/units/autocomplete-filter.tsx +0 -66
  63. package/src/components/atoms/filter/units/checkbox-filter.tsx +0 -42
  64. package/src/components/atoms/filter/units/checkbox-group-filter.tsx +0 -68
  65. package/src/components/atoms/filter/units/date-filter.tsx +0 -46
  66. package/src/components/atoms/filter/units/index.ts +0 -9
  67. package/src/components/atoms/filter/units/numeric-filter.tsx +0 -41
  68. package/src/components/atoms/filter/units/range-filter.tsx +0 -65
  69. package/src/components/atoms/filter/units/search-filter.tsx +0 -53
  70. package/src/components/atoms/filter/units/select-filter.tsx +0 -57
  71. package/src/components/atoms/filter/units/switch-filter.tsx +0 -35
  72. package/src/components/atoms/index.ts +0 -11
  73. package/src/components/atoms/portal/index.ts +0 -1
  74. package/src/components/atoms/portal/portal.stories.tsx +0 -43
  75. package/src/components/atoms/portal/portal.tsx +0 -25
  76. package/src/components/atoms/row/index.ts +0 -1
  77. package/src/components/atoms/row/row.stories.tsx +0 -37
  78. package/src/components/atoms/row/row.tsx +0 -26
  79. package/src/components/atoms/theme-switch/index.ts +0 -1
  80. package/src/components/atoms/theme-switch/styles/classes.ts +0 -16
  81. package/src/components/atoms/theme-switch/styles/index.ts +0 -1
  82. package/src/components/atoms/theme-switch/theme-switch.stories.tsx +0 -26
  83. package/src/components/atoms/theme-switch/theme-switch.tsx +0 -54
  84. package/src/components/atoms/uploader/components/avatar-label.tsx +0 -102
  85. package/src/components/atoms/uploader/components/index.ts +0 -8
  86. package/src/components/atoms/uploader/components/upload-file-error-box.tsx +0 -40
  87. package/src/components/atoms/uploader/components/upload-file-input.tsx +0 -36
  88. package/src/components/atoms/uploader/components/upload-file-label.tsx +0 -92
  89. package/src/components/atoms/uploader/components/upload-file-listing.tsx +0 -64
  90. package/src/components/atoms/uploader/components/uploader-title.tsx +0 -21
  91. package/src/components/atoms/uploader/components/uploader.tsx +0 -58
  92. package/src/components/atoms/uploader/components/view-image-modal.tsx +0 -41
  93. package/src/components/atoms/uploader/index.ts +0 -1
  94. package/src/components/atoms/uploader/stories/uploader.stories.tsx +0 -201
  95. package/src/components/index.ts +0 -4
  96. package/src/components/molecules/index.ts +0 -4
  97. package/src/components/molecules/item-card/components/actions/index.ts +0 -3
  98. package/src/components/molecules/item-card/components/actions/item-actions-buttons.tsx +0 -43
  99. package/src/components/molecules/item-card/components/actions/item-actions-dropdown.tsx +0 -57
  100. package/src/components/molecules/item-card/components/actions/item-actions-overlay.tsx +0 -50
  101. package/src/components/molecules/item-card/components/additions/index.ts +0 -2
  102. package/src/components/molecules/item-card/components/additions/item-banner.tsx +0 -22
  103. package/src/components/molecules/item-card/components/additions/loading-item.tsx +0 -88
  104. package/src/components/molecules/item-card/components/card/index.ts +0 -4
  105. package/src/components/molecules/item-card/components/card/item-card-body.tsx +0 -74
  106. package/src/components/molecules/item-card/components/card/item-card-footer.tsx +0 -79
  107. package/src/components/molecules/item-card/components/card/item-card-header.tsx +0 -69
  108. package/src/components/molecules/item-card/components/card/item-card.tsx +0 -123
  109. package/src/components/molecules/item-card/components/index.ts +0 -3
  110. package/src/components/molecules/item-card/index.ts +0 -2
  111. package/src/components/molecules/item-card/stories/item-card.stories.tsx +0 -218
  112. package/src/components/molecules/item-card/styles/classes.ts +0 -141
  113. package/src/components/molecules/item-card/styles/index.ts +0 -1
  114. package/src/components/molecules/nav-bar/index.ts +0 -3
  115. package/src/components/molecules/nav-bar/nav-bar-item.tsx +0 -64
  116. package/src/components/molecules/nav-bar/nav-bar.tsx +0 -57
  117. package/src/components/molecules/nav-bar/stories/hover-effect/nav-bar-hover-effect.stories.tsx +0 -52
  118. package/src/components/molecules/nav-bar/stories/nav-bar.stories.tsx +0 -50
  119. package/src/components/molecules/nav-bar/styles/classes.ts +0 -68
  120. package/src/components/molecules/nav-bar/styles/index.ts +0 -2
  121. package/src/components/molecules/nav-bar/styles/styles.ts +0 -85
  122. package/src/components/molecules/nav-bar/sub-items-box.tsx +0 -58
  123. package/src/components/molecules/scaffold/index.ts +0 -2
  124. package/src/components/molecules/scaffold/scaffold.stories.tsx +0 -21
  125. package/src/components/molecules/scaffold/scaffold.tsx +0 -23
  126. package/src/components/molecules/scaffold/styles/index.ts +0 -1
  127. package/src/components/molecules/scaffold/styles/scaffold-classes.ts +0 -10
  128. package/src/components/molecules/side-bar/compact-side-bar.tsx +0 -77
  129. package/src/components/molecules/side-bar/index.ts +0 -1
  130. package/src/components/molecules/side-bar/side-bar-drawer.tsx +0 -113
  131. package/src/components/molecules/side-bar/side-bar.stories.tsx +0 -111
  132. package/src/components/molecules/side-bar/side-bar.tsx +0 -31
  133. package/src/components/molecules/side-bar/styles/classes.ts +0 -28
  134. package/src/components/molecules/side-bar/styles/index.ts +0 -2
  135. package/src/components/molecules/side-bar/styles/styles.ts +0 -13
  136. package/src/components/organisms/deletion-confirmor/deletion-confirmor.tsx +0 -110
  137. package/src/components/organisms/deletion-confirmor/index.ts +0 -3
  138. package/src/components/organisms/deletion-confirmor/stories/components.tsx +0 -25
  139. package/src/components/organisms/deletion-confirmor/stories/deletion-confirmor.stories.tsx +0 -78
  140. package/src/components/organisms/deletion-confirmor/styles/classes.ts +0 -28
  141. package/src/components/organisms/deletion-confirmor/styles/index.ts +0 -2
  142. package/src/components/organisms/deletion-confirmor/styles/styles.ts +0 -4
  143. package/src/components/organisms/footer/copy-rights-box.tsx +0 -27
  144. package/src/components/organisms/footer/footer.tsx +0 -75
  145. package/src/components/organisms/footer/index.ts +0 -5
  146. package/src/components/organisms/footer/policies-box.tsx +0 -27
  147. package/src/components/organisms/footer/quick-links-box.tsx +0 -46
  148. package/src/components/organisms/footer/social-links-box.tsx +0 -33
  149. package/src/components/organisms/footer/stories/footer.stories.tsx +0 -61
  150. package/src/components/organisms/footer/styles/classes.ts +0 -71
  151. package/src/components/organisms/footer/styles/index.ts +0 -2
  152. package/src/components/organisms/footer/styles/styles.ts +0 -6
  153. package/src/components/organisms/form-builder/form-builder.stories.tsx +0 -144
  154. package/src/components/organisms/form-builder/form-builder.tsx +0 -75
  155. package/src/components/organisms/form-builder/index.ts +0 -1
  156. package/src/components/organisms/header/header.tsx +0 -87
  157. package/src/components/organisms/header/index.ts +0 -1
  158. package/src/components/organisms/header/segmented-header-content.tsx +0 -29
  159. package/src/components/organisms/header/stories/header.stories.tsx +0 -144
  160. package/src/components/organisms/header/styles/classes.ts +0 -22
  161. package/src/components/organisms/header/styles/index.ts +0 -2
  162. package/src/components/organisms/header/styles/styles.ts +0 -39
  163. package/src/components/organisms/index.ts +0 -6
  164. package/src/components/organisms/item-details/index.ts +0 -1
  165. package/src/components/organisms/item-details/item-details.tsx +0 -6
  166. package/src/components/organisms/listings/empty-listings.tsx +0 -80
  167. package/src/components/organisms/listings/index.ts +0 -3
  168. package/src/components/organisms/listings/listings.tsx +0 -96
  169. package/src/components/organisms/listings/stories/grid-listings.stories.tsx +0 -153
  170. package/src/components/organisms/listings/stories/list-listings.stories.tsx +0 -171
  171. package/src/components/organisms/listings/styles/classes.ts +0 -49
  172. package/src/components/organisms/listings/styles/index.ts +0 -2
  173. package/src/components/organisms/listings/styles/styles.ts +0 -6
  174. package/src/components/templates/index.ts +0 -1
  175. package/src/components/templates/landing-page/index.ts +0 -1
  176. package/src/components/templates/landing-page/landing-page.stories.tsx +0 -21
  177. package/src/components/templates/landing-page/landing-page.tsx +0 -57
  178. package/src/components/templates/landing-page/styles/classes.ts +0 -11
  179. package/src/components/templates/landing-page/styles/index.ts +0 -1
  180. package/src/constants/animations.ts +0 -14
  181. package/src/constants/card.tsx +0 -42
  182. package/src/constants/defaults.ts +0 -59
  183. package/src/constants/fake.ts +0 -5
  184. package/src/constants/footer.tsx +0 -157
  185. package/src/constants/index.ts +0 -6
  186. package/src/constants/uploader.ts +0 -27
  187. package/src/context/emperor-ui-context.ts +0 -6
  188. package/src/context/form-builder-context.tsx +0 -8
  189. package/src/context/index.ts +0 -4
  190. package/src/context/navigation-context.ts +0 -6
  191. package/src/context/uploader-context.ts +0 -6
  192. package/src/enums/index.ts +0 -2
  193. package/src/enums/placeholders.ts +0 -4
  194. package/src/enums/preserved-keys.ts +0 -3
  195. package/src/examples/index.ts +0 -1
  196. package/src/hooks/index.ts +0 -8
  197. package/src/hooks/use-emperor-ui.ts +0 -12
  198. package/src/hooks/use-filters.ts +0 -20
  199. package/src/hooks/use-form-builder-context.ts +0 -16
  200. package/src/hooks/use-navigation.ts +0 -12
  201. package/src/hooks/use-search-params-handler.tsx +0 -186
  202. package/src/hooks/use-uploader-context.ts +0 -14
  203. package/src/hooks/use-uploader.tsx +0 -164
  204. package/src/hooks/use-window-size.tsx +0 -53
  205. package/src/i18n/configs/i18n.ts +0 -7
  206. package/src/i18n/configs/index.ts +0 -1
  207. package/src/i18n/constants/index.ts +0 -1
  208. package/src/i18n/constants/locales.ts +0 -4
  209. package/src/i18n/index.ts +0 -5
  210. package/src/i18n/locales/ar.ts +0 -15
  211. package/src/i18n/locales/atoms/ar.ts +0 -18
  212. package/src/i18n/locales/atoms/en.ts +0 -18
  213. package/src/i18n/locales/atoms/index.ts +0 -2
  214. package/src/i18n/locales/common/ar.ts +0 -1
  215. package/src/i18n/locales/common/en.ts +0 -1
  216. package/src/i18n/locales/common/index.ts +0 -2
  217. package/src/i18n/locales/en.ts +0 -15
  218. package/src/i18n/locales/index.ts +0 -4
  219. package/src/i18n/locales/molecules/ar.ts +0 -1
  220. package/src/i18n/locales/molecules/en.ts +0 -1
  221. package/src/i18n/locales/molecules/index.ts +0 -2
  222. package/src/i18n/locales/organisms/ar.ts +0 -11
  223. package/src/i18n/locales/organisms/en.ts +0 -11
  224. package/src/i18n/locales/organisms/index.ts +0 -2
  225. package/src/i18n/locales/templates/ar.ts +0 -1
  226. package/src/i18n/locales/templates/en.ts +0 -1
  227. package/src/i18n/locales/templates/index.ts +0 -2
  228. package/src/i18n/locales/toasts/ar.ts +0 -1
  229. package/src/i18n/locales/toasts/en.ts +0 -1
  230. package/src/i18n/locales/toasts/index.ts +0 -2
  231. package/src/i18n/types/index.ts +0 -2
  232. package/src/i18n/types/locale.ts +0 -5
  233. package/src/i18n/types/toasts.ts +0 -3
  234. package/src/i18n/utils/get-locales.ts +0 -4
  235. package/src/i18n/utils/index.ts +0 -2
  236. package/src/i18n/utils/localize.ts +0 -15
  237. package/src/index.ts +0 -12
  238. package/src/mocks/constants.ts +0 -103
  239. package/src/mocks/deletion-confirmor.ts +0 -16
  240. package/src/mocks/header.tsx +0 -118
  241. package/src/mocks/index.ts +0 -6
  242. package/src/mocks/listings.tsx +0 -154
  243. package/src/mocks/locales/index.ts +0 -1
  244. package/src/mocks/locales/uploader.ts +0 -33
  245. package/src/mocks/types.ts +0 -64
  246. package/src/providers/config-provider.tsx +0 -72
  247. package/src/providers/emperor-ui-provider.tsx +0 -35
  248. package/src/providers/form-builder-provider-context.tsx +0 -18
  249. package/src/providers/index.ts +0 -6
  250. package/src/providers/navigation-provider.tsx +0 -42
  251. package/src/providers/theme-provider.tsx +0 -16
  252. package/src/providers/uploader-provider.tsx +0 -53
  253. package/src/styles/globals.css +0 -38
  254. package/src/styles/hero.ts +0 -3
  255. package/src/styles/index.css +0 -18
  256. package/src/types/components/atoms/brand.ts +0 -13
  257. package/src/types/components/atoms/color-picker/color-picker.ts +0 -21
  258. package/src/types/components/atoms/color-picker/index.ts +0 -1
  259. package/src/types/components/atoms/column.ts +0 -3
  260. package/src/types/components/atoms/container.ts +0 -3
  261. package/src/types/components/atoms/field/field.ts +0 -61
  262. package/src/types/components/atoms/field/index.ts +0 -1
  263. package/src/types/components/atoms/filter/filter.ts +0 -52
  264. package/src/types/components/atoms/filter/index.ts +0 -2
  265. package/src/types/components/atoms/filter/select-filter.ts +0 -8
  266. package/src/types/components/atoms/index.ts +0 -9
  267. package/src/types/components/atoms/portal.ts +0 -6
  268. package/src/types/components/atoms/row.ts +0 -3
  269. package/src/types/components/atoms/uploader.ts +0 -102
  270. package/src/types/components/index.ts +0 -4
  271. package/src/types/components/molecules/footer/footer.ts +0 -68
  272. package/src/types/components/molecules/footer/index.ts +0 -1
  273. package/src/types/components/molecules/header/header.ts +0 -51
  274. package/src/types/components/molecules/header/index.ts +0 -1
  275. package/src/types/components/molecules/index.ts +0 -9
  276. package/src/types/components/molecules/item-card/index.ts +0 -1
  277. package/src/types/components/molecules/item-card/item-card.ts +0 -69
  278. package/src/types/components/molecules/item-details/index.ts +0 -1
  279. package/src/types/components/molecules/item-details/item-details.ts +0 -9
  280. package/src/types/components/molecules/listings/index.ts +0 -1
  281. package/src/types/components/molecules/listings/listings.ts +0 -29
  282. package/src/types/components/molecules/nav-bar/index.ts +0 -1
  283. package/src/types/components/molecules/nav-bar/nav-bar.ts +0 -66
  284. package/src/types/components/molecules/scaffold/index.ts +0 -1
  285. package/src/types/components/molecules/scaffold/scaffold.ts +0 -9
  286. package/src/types/components/molecules/side-bar/index.ts +0 -1
  287. package/src/types/components/molecules/side-bar/side-bar.ts +0 -40
  288. package/src/types/components/molecules/theme-switch/index.ts +0 -1
  289. package/src/types/components/molecules/theme-switch/theme-switch.ts +0 -9
  290. package/src/types/components/organisms/deletion-confirmor/deletion-confirmor.ts +0 -22
  291. package/src/types/components/organisms/deletion-confirmor/index.ts +0 -1
  292. package/src/types/components/organisms/filters/filters.ts +0 -11
  293. package/src/types/components/organisms/filters/index.ts +0 -1
  294. package/src/types/components/organisms/form-builder/context.ts +0 -6
  295. package/src/types/components/organisms/form-builder/form-builder.ts +0 -39
  296. package/src/types/components/organisms/form-builder/index.ts +0 -2
  297. package/src/types/components/organisms/index.ts +0 -3
  298. package/src/types/components/templates/index.ts +0 -1
  299. package/src/types/components/templates/landing-page.ts +0 -10
  300. package/src/types/context/config.ts +0 -24
  301. package/src/types/context/index.ts +0 -4
  302. package/src/types/context/localization.ts +0 -24
  303. package/src/types/context/navigation.ts +0 -17
  304. package/src/types/context/theme.ts +0 -33
  305. package/src/types/index.ts +0 -3
  306. package/src/types/shared/components.ts +0 -13
  307. package/src/types/shared/index.ts +0 -1
  308. package/src/utils/cn.ts +0 -6
  309. package/src/utils/compress-images.ts +0 -36
  310. package/src/utils/index.ts +0 -5
  311. package/src/utils/locales.ts +0 -54
  312. package/src/utils/storybook.tsx +0 -15
  313. package/src/utils/uploader.ts +0 -167
  314. package/tsconfig.app.json +0 -37
  315. package/tsconfig.json +0 -7
  316. package/tsconfig.node.json +0 -25
  317. package/vite.config.ts +0 -44
  318. package/vitest.shims.d.ts +0 -1
@@ -1,171 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react-vite";
2
- import { Listings } from "@/components";
3
- import { getStorybookDecorators } from "@/utils";
4
- import { getListings, MOCK_LISTINGS } from "@/mocks";
5
- import type { MockItemType } from "@/mocks";
6
- import { useMemo, useState } from "react";
7
- import { useEffect } from "react";
8
- import { ListingsProps } from "@/types";
9
- import { usePagination } from "@heroui/pagination";
10
-
11
- const meta: Meta<typeof Listings> = {
12
- title: "Organisms/Listings/List",
13
- component: Listings,
14
- parameters: {
15
- layout: "centered",
16
- },
17
- tags: ["autodocs"],
18
- decorators: getStorybookDecorators({
19
- config: {
20
- layout: {
21
- withScaffold: false,
22
- },
23
- },
24
- }),
25
- };
26
-
27
- export default meta;
28
-
29
- type Story = StoryObj<typeof meta>;
30
-
31
- export const Default: Story = {
32
- args: {
33
- layout: "list",
34
- },
35
- render: (args: ListingsProps) => {
36
- return (
37
- <main className="w-screen container mx-auto p-5">
38
- <Listings
39
- {...args}
40
- items={MOCK_LISTINGS.map((item) => ({
41
- item: {
42
- key: String(item.id),
43
- title: item?.title,
44
- description: item.description,
45
- image: { src: item?.image, alt: item?.title },
46
- },
47
- }))}
48
- />
49
- </main>
50
- );
51
- },
52
- };
53
-
54
- export const WithLoading: Story = {
55
- args: {
56
- layout: "list",
57
- },
58
- render: (args: ListingsProps) => {
59
- const [items, setItems] = useState<MockItemType[]>([]);
60
- const [isLoading, setIsLoading] = useState(true);
61
-
62
- useEffect(() => {
63
- (async () => {
64
- const { items } = await getListings({});
65
-
66
- setItems(items);
67
- setIsLoading(false);
68
- })();
69
- }, []);
70
-
71
- return (
72
- <Listings
73
- {...args}
74
- isLoading={isLoading}
75
- items={items.map((item) => ({
76
- item: {
77
- key: String(item.id),
78
- title: item?.title,
79
- description: item.description,
80
- image: { src: item?.image, alt: item?.title },
81
- },
82
- }))}
83
- />
84
- );
85
- },
86
- };
87
-
88
- export const WithActions: Story = {
89
- args: {
90
- layout: "list",
91
- items: MOCK_LISTINGS.map((item) => ({
92
- item: {
93
- key: String(item.id),
94
- title: item?.title,
95
- description: item.description,
96
- image: { src: item?.image, alt: item?.title },
97
- },
98
- actions: [
99
- { key: "view", label: "View details" },
100
- { key: "edit", label: "Edit" },
101
- { key: "delete", label: "Delete" },
102
- ],
103
- })),
104
- },
105
- };
106
-
107
- export const WithPagination: Story = {
108
- args: {
109
- layout: "list",
110
- },
111
- render: (args: ListingsProps) => {
112
- const [items, setItems] = useState<MockItemType[]>([]);
113
- const [isLoading, setIsLoading] = useState(true);
114
-
115
- const pageSize = 6;
116
- const totalItemsCount = MOCK_LISTINGS.length;
117
- const pagesCount = useMemo(
118
- () => Math.ceil(totalItemsCount / pageSize),
119
- [totalItemsCount, pageSize],
120
- );
121
-
122
- const { activePage: page, setPage } = usePagination({
123
- total: pagesCount,
124
- initialPage: 1,
125
- });
126
-
127
- useEffect(() => {
128
- (async () => {
129
- setIsLoading(true);
130
-
131
- const { items } = await getListings({
132
- page,
133
- pageSize,
134
- });
135
-
136
- setItems(items);
137
- setIsLoading(false);
138
- })();
139
- }, [page]);
140
-
141
- return (
142
- <Listings
143
- {...args}
144
- isLoading={isLoading}
145
- items={items.map((item) => ({
146
- item: {
147
- key: String(item.id),
148
- title: item?.title,
149
- description: item.description,
150
- image: { src: item?.image, alt: item?.title },
151
- banner: item?.isBestSeller ? "Best Seller" : undefined,
152
- chips: item?.categories || [],
153
- },
154
- }))}
155
- pagination={{
156
- page,
157
- setPage,
158
- pageSize,
159
- totalItemsCount,
160
- pagesCount,
161
- }}
162
- />
163
- );
164
- },
165
- };
166
-
167
- export const EmptyListings: Story = {
168
- args: {
169
- items: [],
170
- },
171
- };
@@ -1,49 +0,0 @@
1
- import { cva } from "class-variance-authority";
2
-
3
- export const listingsClasses = cva(["w-full p-4 gap-4 relative"], {
4
- variants: {
5
- layout: {
6
- grid: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
7
- list: "flex flex-col gap-4",
8
- carousel: "flex flex-col gap-4",
9
- },
10
- },
11
- defaultVariants: {},
12
- compoundVariants: [],
13
- });
14
-
15
- export const listingsItemClasses = cva([""], {
16
- variants: {
17
- layout: {
18
- grid: "size-full",
19
- list: "w-full h-fit",
20
- carousel: "",
21
- },
22
- },
23
- defaultVariants: {},
24
- compoundVariants: [],
25
- });
26
-
27
- export const listingsPaginationClasses = cva(["mx-auto my-5 col-span-full"], {
28
- variants: {
29
- layout: {
30
- grid: "",
31
- list: "",
32
- carousel: "",
33
- },
34
- },
35
- defaultVariants: {},
36
- compoundVariants: [],
37
- });
38
-
39
- export const emptyListingsClasses = cva(
40
- [
41
- "flex flex-col items-center justify-center min-h-[280px] w-full py-12 px-4",
42
- "text-center",
43
- ],
44
- {
45
- variants: {},
46
- defaultVariants: {},
47
- compoundVariants: [],
48
- },
49
- );
@@ -1,2 +0,0 @@
1
- export * from "./classes";
2
- export * from "./styles";
@@ -1,6 +0,0 @@
1
- import { CSSProperties } from "react";
2
-
3
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type, no-empty-pattern
4
- export const listingsStyles = ({}: {}): CSSProperties => {
5
- return {};
6
- };
@@ -1 +0,0 @@
1
- export * from "./landing-page";
@@ -1 +0,0 @@
1
- export * from "./landing-page";
@@ -1,21 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react-vite";
2
- import { LandingPage } from "@/components";
3
- import { getStorybookDecorators } from "@/utils";
4
-
5
- const meta: Meta<typeof LandingPage> = {
6
- title: "Templates/LandingPage",
7
- component: LandingPage,
8
- parameters: {
9
- layout: "fullscreen",
10
- },
11
- tags: ["autodocs"],
12
- decorators: getStorybookDecorators({}),
13
- };
14
-
15
- export default meta;
16
-
17
- type Story = StoryObj<typeof meta>;
18
-
19
- export const Default: Story = {
20
- args: {},
21
- };
@@ -1,57 +0,0 @@
1
- import { forwardRef, ComponentProps } from "react";
2
- import { VariantProps } from "class-variance-authority";
3
- import { cn } from "@/utils";
4
- import { LandingPageProps } from "@/types";
5
- import { landingPageClasses } from "./styles";
6
- import { Brand, Header, NavBar } from "@/components";
7
- import { MOCK_HEADER_ITEMS_WITH_SUB_ITEMS } from "@/mocks";
8
- import { FAKE_PARAGRAPH } from "@/constants";
9
-
10
- const GLASS_EFFECT_CONFIG = {
11
- enabled: true,
12
- blur: 10,
13
- backgroundColor: "#006fed",
14
- foregroundColor: "#fff",
15
- opacity: 40,
16
- };
17
-
18
- /**
19
- * This component is not for general use nor it is reusable, it is intended to be used as a demo page.
20
- */
21
- export const LandingPage = forwardRef<
22
- HTMLDivElement,
23
- ComponentProps<"main"> &
24
- VariantProps<typeof landingPageClasses> &
25
- LandingPageProps
26
- >(({ className, variant = "default", children, ...props }, ref) => {
27
- return (
28
- <main
29
- ref={ref}
30
- data-slot="emperor-landing-page"
31
- className={cn(landingPageClasses({ className }))}
32
- {...props}
33
- >
34
- <Header variant="floating" glassEffect={GLASS_EFFECT_CONFIG}>
35
- <Brand />
36
-
37
- <NavBar
38
- items={MOCK_HEADER_ITEMS_WITH_SUB_ITEMS}
39
- hoverEffect="none"
40
- variant="default"
41
- className="hidden md:flex"
42
- subItemsColumns={4}
43
- />
44
- </Header>
45
-
46
- <main className="w-full container mx-auto p-5 pt-24 flex flex-col gap-6">
47
- <p>{FAKE_PARAGRAPH}</p>
48
- <p>{FAKE_PARAGRAPH}</p>
49
- <p>{FAKE_PARAGRAPH}</p>
50
- <p>{FAKE_PARAGRAPH}</p>
51
- <p>{FAKE_PARAGRAPH}</p>
52
- </main>
53
-
54
- {children}
55
- </main>
56
- );
57
- });
@@ -1,11 +0,0 @@
1
- import { cva } from "class-variance-authority";
2
-
3
- export const landingPageClasses = cva(["flex flex-col w-full"], {
4
- variants: {
5
- variant: {
6
- default: [],
7
- },
8
- },
9
- defaultVariants: {},
10
- compoundVariants: [],
11
- });
@@ -1 +0,0 @@
1
- export * from "./classes";
@@ -1,14 +0,0 @@
1
- /* eslint-disable no-empty-pattern */
2
- import { ItemCardHoverEffect } from "@/types";
3
- import { MotionProps } from "framer-motion";
4
-
5
- export const getCardMotion = ({}: {
6
- hoverEffect: ItemCardHoverEffect;
7
- }): MotionProps => ({
8
- initial: { opacity: 0, y: 12 },
9
- animate: { opacity: 1, y: 0 },
10
- transition: { duration: 0.3, ease: "easeOut" as const },
11
- whileHover: {
12
- y: -4,
13
- },
14
- });
@@ -1,42 +0,0 @@
1
- /* eslint-disable react-refresh/only-export-components */
2
- import { Eye, Pencil, Trash2 } from "lucide-react";
3
- import { ItemCardAction } from "@/types";
4
-
5
- export const ITEM_CARD_ACTIONS: ItemCardAction[] = [
6
- {
7
- key: "view",
8
- label: "View details",
9
- color: "primary",
10
- variant: "flat",
11
- size: "sm",
12
- startContent: <Eye className="size-4" />,
13
- },
14
- {
15
- key: "edit",
16
- label: "Edit",
17
- color: "secondary",
18
- variant: "flat",
19
- size: "sm",
20
- startContent: <Pencil className="size-4" />,
21
- },
22
- {
23
- key: "delete",
24
- label: "Delete",
25
- color: "danger",
26
- variant: "flat",
27
- size: "sm",
28
- startContent: <Trash2 className="size-4" />,
29
- },
30
- ];
31
-
32
- export const ITEM_CARD_ACTIONS_OVERLAY: ItemCardAction[] =
33
- ITEM_CARD_ACTIONS.map((action) => ({
34
- ...action,
35
- variant: "solid",
36
- size: "lg",
37
- startContent: {
38
- view: <Eye className="size-5" />,
39
- edit: <Pencil className="size-5" />,
40
- delete: <Trash2 className="size-5" />,
41
- }[action?.key],
42
- }));
@@ -1,59 +0,0 @@
1
- import { en, ar } from "@/i18n";
2
- import type { EmperorUIConfig } from "@/types";
3
-
4
- export const defaultEmperorUIConfig: EmperorUIConfig = {
5
- layout: {
6
- withScaffold: true,
7
- },
8
- interLocalization: {
9
- lang: "en",
10
- languages: ["en", "ar"],
11
- defaultLanguage: "en",
12
- dir: "ltr",
13
- isMultiLingual: false,
14
- locales: {
15
- en,
16
- ar,
17
- },
18
- },
19
- theme: {
20
- components: {
21
- input: {
22
- variant: "faded",
23
- labelPlacement: "outside",
24
- size: "sm",
25
- },
26
- textarea: {
27
- variant: "faded",
28
- labelPlacement: "outside",
29
- size: "sm",
30
- },
31
- button: {
32
- variant: "faded",
33
- size: "sm",
34
- },
35
- select: {
36
- variant: "faded",
37
- labelPlacement: "outside",
38
- placeholder: "Select an option",
39
- size: "sm",
40
- },
41
- selectItem: {
42
- variant: "faded",
43
- },
44
- autocomplete: {
45
- variant: "faded",
46
- labelPlacement: "outside",
47
- size: "sm",
48
- },
49
- autocompleteItem: {
50
- variant: "faded",
51
- },
52
- datePicker: {
53
- variant: "faded",
54
- labelPlacement: "outside",
55
- size: "sm",
56
- },
57
- },
58
- },
59
- };
@@ -1,5 +0,0 @@
1
- export const FAKE_SENTENCE =
2
- "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor.";
3
-
4
- export const FAKE_PARAGRAPH =
5
- "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc,";
@@ -1,157 +0,0 @@
1
- import {
2
- CopyRights,
3
- Contacts,
4
- QuickLink,
5
- QuickLinkCollection,
6
- SocialLink,
7
- } from "@/types";
8
-
9
- import {
10
- FacebookIcon,
11
- InstagramIcon,
12
- LinkedinIcon,
13
- TwitterIcon,
14
- YoutubeIcon,
15
- } from "lucide-react";
16
-
17
- export const quickLinks: QuickLinkCollection[] = [
18
- {
19
- title: "Products",
20
- links: [
21
- {
22
- label: "Product 1",
23
- href: "/product-1",
24
- },
25
- {
26
- label: "Product 2",
27
- href: "/product-2",
28
- },
29
- {
30
- label: "Product 3",
31
- href: "/product-3",
32
- },
33
- ],
34
- },
35
- {
36
- title: "Services",
37
- links: [
38
- {
39
- label: "Service 1",
40
- href: "/service-1",
41
- },
42
- {
43
- label: "Service 2",
44
- href: "/service-2",
45
- },
46
- {
47
- label: "Service 3",
48
- href: "/service-3",
49
- },
50
- {
51
- label: "Service 4",
52
- href: "/service-4",
53
- },
54
- ],
55
- },
56
- {
57
- title: "Resources",
58
- links: [
59
- {
60
- label: "Resource 1",
61
- href: "/resource-1",
62
- },
63
- ],
64
- },
65
- {
66
- title: "Company",
67
- links: [
68
- {
69
- label: "About Us",
70
- href: "/about-us",
71
- },
72
- {
73
- label: "Careers",
74
- href: "/careers",
75
- },
76
- {
77
- label: "Blog",
78
- href: "/blog",
79
- },
80
- ],
81
- },
82
- {
83
- title: "Support",
84
- links: [
85
- {
86
- label: "Contact Us",
87
- href: "/contact-us",
88
- },
89
- ],
90
- },
91
- ];
92
-
93
- export const policies: QuickLink[] = [
94
- {
95
- label: "Privacy Policy",
96
- href: "/privacy-policy",
97
- },
98
- {
99
- label: "Terms of Service",
100
- href: "/terms-of-service",
101
- },
102
- {
103
- label: "Cookie Policy",
104
- href: "/cookie-policy",
105
- },
106
- ];
107
-
108
- export const copyRights: CopyRights = {
109
- year: 2026,
110
- text: "All rights reserved - Emperor UI",
111
- };
112
-
113
- export const contacts: Contacts = {
114
- mobile: "+964 770 000 0000",
115
- email: "contact@emperorui.com",
116
- website: "https://jsempire.com",
117
- workingHours: "Monday - Friday: 9:00 AM - 5:00 PM",
118
- addresses: [
119
- {
120
- country: "Jordan",
121
- street: "Amman, Jordan",
122
- city: "Amman",
123
- state: "Amman",
124
- zip: "11111",
125
- },
126
- {
127
- country: "Saudi Arabia",
128
- street: "Riyadh, Saudi Arabia",
129
- city: "Riyadh",
130
- state: "Riyadh",
131
- zip: "11111",
132
- },
133
- ],
134
- };
135
-
136
- export const socialLinks: SocialLink[] = [
137
- {
138
- href: "https://facebook.com",
139
- icon: <FacebookIcon />,
140
- },
141
- {
142
- href: "https://twitter.com",
143
- icon: <TwitterIcon />,
144
- },
145
- {
146
- href: "https://instagram.com",
147
- icon: <InstagramIcon />,
148
- },
149
- {
150
- href: "https://linkedin.com",
151
- icon: <LinkedinIcon />,
152
- },
153
- {
154
- href: "https://youtube.com",
155
- icon: <YoutubeIcon />,
156
- },
157
- ];
@@ -1,6 +0,0 @@
1
- export * from "./defaults";
2
- export * from "./fake";
3
- export * from "./uploader";
4
- export * from "./footer";
5
- export * from "./animations";
6
- export * from "./card";
@@ -1,27 +0,0 @@
1
- export const ALLOWED_IMAGES_TYPES = [
2
- "image/jpeg",
3
- "image/jpg",
4
- "image/png",
5
- "image/webp",
6
- "image/gif",
7
- "image/bmp",
8
- "image/svg+xml",
9
- "image/tiff",
10
- "image/x-icon",
11
- ];
12
-
13
- export const ALLOWED_PDF_TYPES = ["application/pdf"];
14
-
15
- export const ALLOWED_DOC_TYPES = [
16
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
17
- ];
18
-
19
- export const ONE_MEGABYTE = 1024;
20
-
21
- export const fileTypesMapping: { [key: string]: string[] } = {
22
- image: [".jpg", ".jpeg", ".png"],
23
- doc: [".doc", ".docx"],
24
- pdf: [".pdf"],
25
- video: [".mp4"],
26
- sheet: [".xlsx", ".xlx"],
27
- };
@@ -1,6 +0,0 @@
1
- import type { ConfigContextState } from "@/types";
2
- import { createContext } from "react";
3
-
4
- export const EmperorUIContext = createContext<ConfigContextState | undefined>(
5
- undefined,
6
- );
@@ -1,8 +0,0 @@
1
- "use client";
2
-
3
- import { createContext } from "react";
4
- import { FormBuilderValue } from "@/types";
5
- import { FieldValues } from "react-hook-form";
6
-
7
- export const FormBuilderContext =
8
- createContext<FormBuilderValue<FieldValues> | null>(null);
@@ -1,4 +0,0 @@
1
- export * from "./emperor-ui-context";
2
- export * from "./navigation-context";
3
- export * from "./uploader-context";
4
- export * from "./form-builder-context";
@@ -1,6 +0,0 @@
1
- import type { NavigationContextState } from "@/types";
2
- import { createContext } from "react";
3
-
4
- export const NavigationContext = createContext<
5
- NavigationContextState | undefined
6
- >(undefined);
@@ -1,6 +0,0 @@
1
- import type { UploaderContextState } from "@/types";
2
- import { createContext } from "react";
3
-
4
- export const UploaderContext = createContext<UploaderContextState | undefined>(
5
- undefined,
6
- );