@js-empire/emperor-ui 1.3.6 → 1.3.8

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 (322) hide show
  1. package/dist/emperor-ui.js +4157 -158
  2. package/dist/index.d.ts +3 -2
  3. package/package.json +56 -10
  4. package/.cursor/rules/code-conventions.mdc +0 -50
  5. package/.husky/pre-commit +0 -4
  6. package/.prettierrc +0 -10
  7. package/.storybook/main.ts +0 -24
  8. package/.storybook/preview.ts +0 -19
  9. package/.storybook/vitest.setup.ts +0 -7
  10. package/.vscode/extensions.json +0 -1
  11. package/dist/emperor-ui.umd.cjs +0 -77
  12. package/dist/icons/emperor-ui-logo.ico +0 -0
  13. package/dist/images/avatar-female.jpg +0 -0
  14. package/dist/images/avatar-male.jpg +0 -0
  15. package/dist/images/emperor-ui-logo.png +0 -0
  16. package/dist/index-ABKcY4tX.js +0 -60607
  17. package/dist/index-CWu5fG3N.js +0 -6
  18. package/dist/index-DpemL3iQ.js +0 -291
  19. package/dist/src-UW24ZMRV-I8bMqcTI.js +0 -6
  20. package/eslint.config.js +0 -34
  21. package/index.html +0 -13
  22. package/public/icons/emperor-ui-logo.ico +0 -0
  23. package/public/images/avatar-female.jpg +0 -0
  24. package/public/images/avatar-male.jpg +0 -0
  25. package/public/images/emperor-ui-logo.png +0 -0
  26. package/src/animations/blink.ts +0 -26
  27. package/src/animations/floating.ts +0 -12
  28. package/src/animations/index.ts +0 -2
  29. package/src/components/atoms/brand/brand.stories.tsx +0 -27
  30. package/src/components/atoms/brand/brand.tsx +0 -56
  31. package/src/components/atoms/brand/index.ts +0 -1
  32. package/src/components/atoms/brand/styles/classes.ts +0 -9
  33. package/src/components/atoms/brand/styles/index.ts +0 -2
  34. package/src/components/atoms/brand/styles/styles.ts +0 -0
  35. package/src/components/atoms/color-picker/color-picker.tsx +0 -12
  36. package/src/components/atoms/color-picker/free-color-picker.tsx +0 -58
  37. package/src/components/atoms/color-picker/index.ts +0 -3
  38. package/src/components/atoms/color-picker/preset-color-picker.tsx +0 -66
  39. package/src/components/atoms/color-picker/stories/color-picker.stories.tsx +0 -63
  40. package/src/components/atoms/column/column.stories.tsx +0 -37
  41. package/src/components/atoms/column/column.tsx +0 -21
  42. package/src/components/atoms/column/index.ts +0 -1
  43. package/src/components/atoms/container/column.stories.tsx +0 -37
  44. package/src/components/atoms/container/container.tsx +0 -28
  45. package/src/components/atoms/container/index.ts +0 -1
  46. package/src/components/atoms/copy-button/copy-button.tsx +0 -73
  47. package/src/components/atoms/copy-button/index.ts +0 -1
  48. package/src/components/atoms/copy-button/stories/copy-button.stories.tsx +0 -21
  49. package/src/components/atoms/field/field.tsx +0 -81
  50. package/src/components/atoms/field/index.ts +0 -3
  51. package/src/components/atoms/field/styles/classes.ts +0 -9
  52. package/src/components/atoms/field/styles/index.ts +0 -1
  53. package/src/components/atoms/field/units/autocomplete-field.tsx +0 -49
  54. package/src/components/atoms/field/units/checkbox-field.tsx +0 -35
  55. package/src/components/atoms/field/units/index.ts +0 -7
  56. package/src/components/atoms/field/units/input-field.tsx +0 -35
  57. package/src/components/atoms/field/units/radio-field.tsx +0 -43
  58. package/src/components/atoms/field/units/select-field.tsx +0 -50
  59. package/src/components/atoms/field/units/switch-field.tsx +0 -35
  60. package/src/components/atoms/field/units/textarea-field.tsx +0 -37
  61. package/src/components/atoms/filter/filter.tsx +0 -93
  62. package/src/components/atoms/filter/index.ts +0 -3
  63. package/src/components/atoms/filter/stories/filter.stories.tsx +0 -238
  64. package/src/components/atoms/filter/styles/classes.ts +0 -20
  65. package/src/components/atoms/filter/styles/index.ts +0 -1
  66. package/src/components/atoms/filter/units/autocomplete-filter.tsx +0 -66
  67. package/src/components/atoms/filter/units/checkbox-filter.tsx +0 -42
  68. package/src/components/atoms/filter/units/checkbox-group-filter.tsx +0 -68
  69. package/src/components/atoms/filter/units/date-filter.tsx +0 -46
  70. package/src/components/atoms/filter/units/index.ts +0 -9
  71. package/src/components/atoms/filter/units/numeric-filter.tsx +0 -41
  72. package/src/components/atoms/filter/units/range-filter.tsx +0 -65
  73. package/src/components/atoms/filter/units/search-filter.tsx +0 -53
  74. package/src/components/atoms/filter/units/select-filter.tsx +0 -57
  75. package/src/components/atoms/filter/units/switch-filter.tsx +0 -35
  76. package/src/components/atoms/index.ts +0 -11
  77. package/src/components/atoms/portal/index.ts +0 -1
  78. package/src/components/atoms/portal/portal.stories.tsx +0 -43
  79. package/src/components/atoms/portal/portal.tsx +0 -25
  80. package/src/components/atoms/row/index.ts +0 -1
  81. package/src/components/atoms/row/row.stories.tsx +0 -37
  82. package/src/components/atoms/row/row.tsx +0 -26
  83. package/src/components/atoms/theme-switch/index.ts +0 -1
  84. package/src/components/atoms/theme-switch/styles/classes.ts +0 -16
  85. package/src/components/atoms/theme-switch/styles/index.ts +0 -1
  86. package/src/components/atoms/theme-switch/theme-switch.stories.tsx +0 -26
  87. package/src/components/atoms/theme-switch/theme-switch.tsx +0 -54
  88. package/src/components/atoms/uploader/components/avatar-label.tsx +0 -102
  89. package/src/components/atoms/uploader/components/index.ts +0 -8
  90. package/src/components/atoms/uploader/components/upload-file-error-box.tsx +0 -40
  91. package/src/components/atoms/uploader/components/upload-file-input.tsx +0 -36
  92. package/src/components/atoms/uploader/components/upload-file-label.tsx +0 -92
  93. package/src/components/atoms/uploader/components/upload-file-listing.tsx +0 -64
  94. package/src/components/atoms/uploader/components/uploader-title.tsx +0 -21
  95. package/src/components/atoms/uploader/components/uploader.tsx +0 -89
  96. package/src/components/atoms/uploader/components/view-image-modal.tsx +0 -41
  97. package/src/components/atoms/uploader/index.ts +0 -1
  98. package/src/components/atoms/uploader/stories/uploader.stories.tsx +0 -202
  99. package/src/components/index.ts +0 -4
  100. package/src/components/molecules/index.ts +0 -4
  101. package/src/components/molecules/item-card/components/actions/index.ts +0 -3
  102. package/src/components/molecules/item-card/components/actions/item-actions-buttons.tsx +0 -43
  103. package/src/components/molecules/item-card/components/actions/item-actions-dropdown.tsx +0 -57
  104. package/src/components/molecules/item-card/components/actions/item-actions-overlay.tsx +0 -50
  105. package/src/components/molecules/item-card/components/additions/index.ts +0 -2
  106. package/src/components/molecules/item-card/components/additions/item-banner.tsx +0 -22
  107. package/src/components/molecules/item-card/components/additions/loading-item.tsx +0 -88
  108. package/src/components/molecules/item-card/components/card/index.ts +0 -4
  109. package/src/components/molecules/item-card/components/card/item-card-body.tsx +0 -74
  110. package/src/components/molecules/item-card/components/card/item-card-footer.tsx +0 -79
  111. package/src/components/molecules/item-card/components/card/item-card-header.tsx +0 -69
  112. package/src/components/molecules/item-card/components/card/item-card.tsx +0 -123
  113. package/src/components/molecules/item-card/components/index.ts +0 -3
  114. package/src/components/molecules/item-card/index.ts +0 -2
  115. package/src/components/molecules/item-card/stories/item-card.stories.tsx +0 -218
  116. package/src/components/molecules/item-card/styles/classes.ts +0 -141
  117. package/src/components/molecules/item-card/styles/index.ts +0 -1
  118. package/src/components/molecules/nav-bar/index.ts +0 -3
  119. package/src/components/molecules/nav-bar/nav-bar-item.tsx +0 -64
  120. package/src/components/molecules/nav-bar/nav-bar.tsx +0 -57
  121. package/src/components/molecules/nav-bar/stories/hover-effect/nav-bar-hover-effect.stories.tsx +0 -52
  122. package/src/components/molecules/nav-bar/stories/nav-bar.stories.tsx +0 -50
  123. package/src/components/molecules/nav-bar/styles/classes.ts +0 -68
  124. package/src/components/molecules/nav-bar/styles/index.ts +0 -2
  125. package/src/components/molecules/nav-bar/styles/styles.ts +0 -85
  126. package/src/components/molecules/nav-bar/sub-items-box.tsx +0 -58
  127. package/src/components/molecules/scaffold/index.ts +0 -2
  128. package/src/components/molecules/scaffold/scaffold.stories.tsx +0 -21
  129. package/src/components/molecules/scaffold/scaffold.tsx +0 -23
  130. package/src/components/molecules/scaffold/styles/index.ts +0 -1
  131. package/src/components/molecules/scaffold/styles/scaffold-classes.ts +0 -10
  132. package/src/components/molecules/side-bar/compact-side-bar.tsx +0 -77
  133. package/src/components/molecules/side-bar/index.ts +0 -1
  134. package/src/components/molecules/side-bar/side-bar-drawer.tsx +0 -113
  135. package/src/components/molecules/side-bar/side-bar.stories.tsx +0 -111
  136. package/src/components/molecules/side-bar/side-bar.tsx +0 -31
  137. package/src/components/molecules/side-bar/styles/classes.ts +0 -28
  138. package/src/components/molecules/side-bar/styles/index.ts +0 -2
  139. package/src/components/molecules/side-bar/styles/styles.ts +0 -13
  140. package/src/components/organisms/deletion-confirmor/deletion-confirmor.tsx +0 -110
  141. package/src/components/organisms/deletion-confirmor/index.ts +0 -3
  142. package/src/components/organisms/deletion-confirmor/stories/components.tsx +0 -25
  143. package/src/components/organisms/deletion-confirmor/stories/deletion-confirmor.stories.tsx +0 -78
  144. package/src/components/organisms/deletion-confirmor/styles/classes.ts +0 -28
  145. package/src/components/organisms/deletion-confirmor/styles/index.ts +0 -2
  146. package/src/components/organisms/deletion-confirmor/styles/styles.ts +0 -4
  147. package/src/components/organisms/footer/copy-rights-box.tsx +0 -27
  148. package/src/components/organisms/footer/footer.tsx +0 -75
  149. package/src/components/organisms/footer/index.ts +0 -5
  150. package/src/components/organisms/footer/policies-box.tsx +0 -27
  151. package/src/components/organisms/footer/quick-links-box.tsx +0 -46
  152. package/src/components/organisms/footer/social-links-box.tsx +0 -33
  153. package/src/components/organisms/footer/stories/footer.stories.tsx +0 -61
  154. package/src/components/organisms/footer/styles/classes.ts +0 -71
  155. package/src/components/organisms/footer/styles/index.ts +0 -2
  156. package/src/components/organisms/footer/styles/styles.ts +0 -6
  157. package/src/components/organisms/form-builder/form-builder.stories.tsx +0 -144
  158. package/src/components/organisms/form-builder/form-builder.tsx +0 -75
  159. package/src/components/organisms/form-builder/index.ts +0 -1
  160. package/src/components/organisms/header/header.tsx +0 -87
  161. package/src/components/organisms/header/index.ts +0 -1
  162. package/src/components/organisms/header/segmented-header-content.tsx +0 -29
  163. package/src/components/organisms/header/stories/header.stories.tsx +0 -144
  164. package/src/components/organisms/header/styles/classes.ts +0 -22
  165. package/src/components/organisms/header/styles/index.ts +0 -2
  166. package/src/components/organisms/header/styles/styles.ts +0 -39
  167. package/src/components/organisms/index.ts +0 -6
  168. package/src/components/organisms/item-details/index.ts +0 -1
  169. package/src/components/organisms/item-details/item-details.tsx +0 -6
  170. package/src/components/organisms/listings/empty-listings.tsx +0 -80
  171. package/src/components/organisms/listings/index.ts +0 -3
  172. package/src/components/organisms/listings/listings.tsx +0 -96
  173. package/src/components/organisms/listings/stories/grid-listings.stories.tsx +0 -153
  174. package/src/components/organisms/listings/stories/list-listings.stories.tsx +0 -171
  175. package/src/components/organisms/listings/styles/classes.ts +0 -49
  176. package/src/components/organisms/listings/styles/index.ts +0 -2
  177. package/src/components/organisms/listings/styles/styles.ts +0 -6
  178. package/src/components/templates/index.ts +0 -1
  179. package/src/components/templates/landing-page/index.ts +0 -1
  180. package/src/components/templates/landing-page/landing-page.stories.tsx +0 -21
  181. package/src/components/templates/landing-page/landing-page.tsx +0 -57
  182. package/src/components/templates/landing-page/styles/classes.ts +0 -11
  183. package/src/components/templates/landing-page/styles/index.ts +0 -1
  184. package/src/constants/animations.ts +0 -14
  185. package/src/constants/card.tsx +0 -42
  186. package/src/constants/defaults.ts +0 -59
  187. package/src/constants/fake.ts +0 -5
  188. package/src/constants/footer.tsx +0 -157
  189. package/src/constants/index.ts +0 -6
  190. package/src/constants/uploader.ts +0 -33
  191. package/src/context/emperor-ui-context.ts +0 -6
  192. package/src/context/form-builder-context.tsx +0 -8
  193. package/src/context/index.ts +0 -4
  194. package/src/context/navigation-context.ts +0 -6
  195. package/src/context/uploader-context.ts +0 -6
  196. package/src/enums/index.ts +0 -2
  197. package/src/enums/placeholders.ts +0 -4
  198. package/src/enums/preserved-keys.ts +0 -3
  199. package/src/examples/index.ts +0 -1
  200. package/src/hooks/index.ts +0 -8
  201. package/src/hooks/use-emperor-ui.ts +0 -12
  202. package/src/hooks/use-filters.ts +0 -20
  203. package/src/hooks/use-form-builder-context.ts +0 -16
  204. package/src/hooks/use-navigation.ts +0 -12
  205. package/src/hooks/use-search-params-handler.tsx +0 -186
  206. package/src/hooks/use-uploader-context.ts +0 -14
  207. package/src/hooks/use-uploader.tsx +0 -164
  208. package/src/hooks/use-window-size.tsx +0 -53
  209. package/src/i18n/configs/i18n.ts +0 -7
  210. package/src/i18n/configs/index.ts +0 -1
  211. package/src/i18n/constants/index.ts +0 -1
  212. package/src/i18n/constants/locales.ts +0 -4
  213. package/src/i18n/index.ts +0 -5
  214. package/src/i18n/locales/ar.ts +0 -15
  215. package/src/i18n/locales/atoms/ar.ts +0 -18
  216. package/src/i18n/locales/atoms/en.ts +0 -18
  217. package/src/i18n/locales/atoms/index.ts +0 -2
  218. package/src/i18n/locales/common/ar.ts +0 -1
  219. package/src/i18n/locales/common/en.ts +0 -1
  220. package/src/i18n/locales/common/index.ts +0 -2
  221. package/src/i18n/locales/en.ts +0 -15
  222. package/src/i18n/locales/index.ts +0 -4
  223. package/src/i18n/locales/molecules/ar.ts +0 -1
  224. package/src/i18n/locales/molecules/en.ts +0 -1
  225. package/src/i18n/locales/molecules/index.ts +0 -2
  226. package/src/i18n/locales/organisms/ar.ts +0 -11
  227. package/src/i18n/locales/organisms/en.ts +0 -11
  228. package/src/i18n/locales/organisms/index.ts +0 -2
  229. package/src/i18n/locales/templates/ar.ts +0 -1
  230. package/src/i18n/locales/templates/en.ts +0 -1
  231. package/src/i18n/locales/templates/index.ts +0 -2
  232. package/src/i18n/locales/toasts/ar.ts +0 -1
  233. package/src/i18n/locales/toasts/en.ts +0 -1
  234. package/src/i18n/locales/toasts/index.ts +0 -2
  235. package/src/i18n/types/index.ts +0 -2
  236. package/src/i18n/types/locale.ts +0 -5
  237. package/src/i18n/types/toasts.ts +0 -3
  238. package/src/i18n/utils/get-locales.ts +0 -4
  239. package/src/i18n/utils/index.ts +0 -2
  240. package/src/i18n/utils/localize.ts +0 -15
  241. package/src/index.ts +0 -14
  242. package/src/mocks/constants.ts +0 -103
  243. package/src/mocks/deletion-confirmor.ts +0 -16
  244. package/src/mocks/header.tsx +0 -118
  245. package/src/mocks/index.ts +0 -6
  246. package/src/mocks/listings.tsx +0 -154
  247. package/src/mocks/locales/index.ts +0 -1
  248. package/src/mocks/locales/uploader.ts +0 -33
  249. package/src/mocks/types.ts +0 -64
  250. package/src/providers/config-provider.tsx +0 -72
  251. package/src/providers/emperor-ui-provider.tsx +0 -35
  252. package/src/providers/form-builder-provider-context.tsx +0 -18
  253. package/src/providers/index.ts +0 -6
  254. package/src/providers/navigation-provider.tsx +0 -42
  255. package/src/providers/theme-provider.tsx +0 -16
  256. package/src/providers/uploader-provider.tsx +0 -53
  257. package/src/styles/globals.css +0 -38
  258. package/src/styles/hero.ts +0 -3
  259. package/src/styles/index.css +0 -18
  260. package/src/types/components/atoms/brand.ts +0 -13
  261. package/src/types/components/atoms/color-picker/color-picker.ts +0 -21
  262. package/src/types/components/atoms/color-picker/index.ts +0 -1
  263. package/src/types/components/atoms/column.ts +0 -3
  264. package/src/types/components/atoms/container.ts +0 -3
  265. package/src/types/components/atoms/field/field.ts +0 -61
  266. package/src/types/components/atoms/field/index.ts +0 -1
  267. package/src/types/components/atoms/filter/filter.ts +0 -52
  268. package/src/types/components/atoms/filter/index.ts +0 -2
  269. package/src/types/components/atoms/filter/select-filter.ts +0 -8
  270. package/src/types/components/atoms/index.ts +0 -9
  271. package/src/types/components/atoms/portal.ts +0 -6
  272. package/src/types/components/atoms/row.ts +0 -3
  273. package/src/types/components/atoms/uploader.ts +0 -103
  274. package/src/types/components/index.ts +0 -4
  275. package/src/types/components/molecules/footer/footer.ts +0 -68
  276. package/src/types/components/molecules/footer/index.ts +0 -1
  277. package/src/types/components/molecules/header/header.ts +0 -51
  278. package/src/types/components/molecules/header/index.ts +0 -1
  279. package/src/types/components/molecules/index.ts +0 -9
  280. package/src/types/components/molecules/item-card/index.ts +0 -1
  281. package/src/types/components/molecules/item-card/item-card.ts +0 -69
  282. package/src/types/components/molecules/item-details/index.ts +0 -1
  283. package/src/types/components/molecules/item-details/item-details.ts +0 -9
  284. package/src/types/components/molecules/listings/index.ts +0 -1
  285. package/src/types/components/molecules/listings/listings.ts +0 -29
  286. package/src/types/components/molecules/nav-bar/index.ts +0 -1
  287. package/src/types/components/molecules/nav-bar/nav-bar.ts +0 -66
  288. package/src/types/components/molecules/scaffold/index.ts +0 -1
  289. package/src/types/components/molecules/scaffold/scaffold.ts +0 -9
  290. package/src/types/components/molecules/side-bar/index.ts +0 -1
  291. package/src/types/components/molecules/side-bar/side-bar.ts +0 -40
  292. package/src/types/components/molecules/theme-switch/index.ts +0 -1
  293. package/src/types/components/molecules/theme-switch/theme-switch.ts +0 -9
  294. package/src/types/components/organisms/deletion-confirmor/deletion-confirmor.ts +0 -22
  295. package/src/types/components/organisms/deletion-confirmor/index.ts +0 -1
  296. package/src/types/components/organisms/filters/filters.ts +0 -11
  297. package/src/types/components/organisms/filters/index.ts +0 -1
  298. package/src/types/components/organisms/form-builder/context.ts +0 -6
  299. package/src/types/components/organisms/form-builder/form-builder.ts +0 -39
  300. package/src/types/components/organisms/form-builder/index.ts +0 -2
  301. package/src/types/components/organisms/index.ts +0 -3
  302. package/src/types/components/templates/index.ts +0 -1
  303. package/src/types/components/templates/landing-page.ts +0 -10
  304. package/src/types/context/config.ts +0 -24
  305. package/src/types/context/index.ts +0 -4
  306. package/src/types/context/localization.ts +0 -24
  307. package/src/types/context/navigation.ts +0 -17
  308. package/src/types/context/theme.ts +0 -33
  309. package/src/types/index.ts +0 -3
  310. package/src/types/shared/components.ts +0 -13
  311. package/src/types/shared/index.ts +0 -1
  312. package/src/utils/cn.ts +0 -6
  313. package/src/utils/compress-images.ts +0 -36
  314. package/src/utils/index.ts +0 -5
  315. package/src/utils/locales.ts +0 -54
  316. package/src/utils/storybook.tsx +0 -15
  317. package/src/utils/uploader.ts +0 -170
  318. package/tsconfig.app.json +0 -37
  319. package/tsconfig.json +0 -7
  320. package/tsconfig.node.json +0 -25
  321. package/vite.config.ts +0 -47
  322. 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,33 +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 ALLOWED_SHEET_TYPES = [
20
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
21
- "application/vnd.ms-excel",
22
- "text/csv",
23
- ];
24
-
25
- export const ONE_MEGABYTE = 1024;
26
-
27
- export const fileTypesMapping: { [key: string]: string[] } = {
28
- image: [".jpg", ".jpeg", ".png"],
29
- doc: [".doc", ".docx"],
30
- pdf: [".pdf"],
31
- video: [".mp4"],
32
- sheet: [".xlsx", ".xlx", ".xls", ".csv"],
33
- };
@@ -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);