@js-empire/emperor-ui 1.3.11 → 1.3.13

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 (585) hide show
  1. package/.cursor/rules/code-conventions.mdc +50 -0
  2. package/.husky/pre-commit +4 -0
  3. package/.prettierrc +10 -0
  4. package/.storybook/main.ts +24 -0
  5. package/.storybook/preview.ts +19 -0
  6. package/.storybook/vitest.setup.ts +7 -0
  7. package/.vscode/extensions.json +1 -0
  8. package/dist/emperor-ui.js +158 -4236
  9. package/dist/emperor-ui.umd.cjs +52 -1
  10. package/dist/icons/emperor-ui-logo.ico +0 -0
  11. package/dist/images/avatar-female.jpg +0 -0
  12. package/dist/images/avatar-male.jpg +0 -0
  13. package/dist/images/emperor-ui-logo.png +0 -0
  14. package/dist/index-4OxAyqvp.js +5 -0
  15. package/dist/index-CHrqdTZ9.js +290 -0
  16. package/dist/index-DXWNWGH3.js +57021 -0
  17. package/dist/index.d.ts +1357 -0
  18. package/dist/src-UW24ZMRV-DQtCWsbT.js +5 -0
  19. package/eslint.config.js +34 -0
  20. package/index.html +13 -0
  21. package/package.json +10 -57
  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 +26 -0
  27. package/src/animations/floating.ts +12 -0
  28. package/src/animations/index.ts +2 -0
  29. package/src/components/atoms/brand/brand.stories.tsx +29 -0
  30. package/src/components/atoms/brand/brand.tsx +56 -0
  31. package/src/components/atoms/brand/index.ts +1 -0
  32. package/src/components/atoms/brand/styles/classes.ts +9 -0
  33. package/src/components/atoms/brand/styles/index.ts +2 -0
  34. package/src/components/atoms/brand/styles/styles.ts +0 -0
  35. package/src/components/atoms/color-picker/color-picker.tsx +12 -0
  36. package/src/components/atoms/color-picker/free-color-picker.tsx +58 -0
  37. package/src/components/atoms/color-picker/index.ts +3 -0
  38. package/src/components/atoms/color-picker/preset-color-picker.tsx +66 -0
  39. package/src/components/atoms/color-picker/stories/color-picker.stories.tsx +63 -0
  40. package/src/components/atoms/column/column.stories.tsx +37 -0
  41. package/src/components/atoms/column/column.tsx +21 -0
  42. package/src/components/atoms/column/index.ts +1 -0
  43. package/src/components/atoms/container/column.stories.tsx +37 -0
  44. package/src/components/atoms/container/container.tsx +28 -0
  45. package/src/components/atoms/container/index.ts +1 -0
  46. package/src/components/atoms/copy-button/copy-button.tsx +73 -0
  47. package/src/components/atoms/copy-button/index.ts +1 -0
  48. package/src/components/atoms/copy-button/stories/copy-button.stories.tsx +21 -0
  49. package/src/components/atoms/field/field.tsx +81 -0
  50. package/src/components/atoms/field/index.ts +3 -0
  51. package/src/components/atoms/field/styles/classes.ts +9 -0
  52. package/src/components/atoms/field/styles/index.ts +1 -0
  53. package/src/components/atoms/field/units/autocomplete-field.tsx +49 -0
  54. package/src/components/atoms/field/units/checkbox-field.tsx +35 -0
  55. package/src/components/atoms/field/units/index.ts +7 -0
  56. package/src/components/atoms/field/units/input-field.tsx +35 -0
  57. package/src/components/atoms/field/units/radio-field.tsx +43 -0
  58. package/src/components/atoms/field/units/select-field.tsx +50 -0
  59. package/src/components/atoms/field/units/switch-field.tsx +35 -0
  60. package/src/components/atoms/field/units/textarea-field.tsx +37 -0
  61. package/src/components/atoms/filter/filter.tsx +93 -0
  62. package/src/components/atoms/filter/index.ts +3 -0
  63. package/src/components/atoms/filter/stories/filter.stories.tsx +238 -0
  64. package/src/components/atoms/filter/styles/classes.ts +20 -0
  65. package/src/components/atoms/filter/styles/index.ts +1 -0
  66. package/src/components/atoms/filter/units/autocomplete-filter.tsx +66 -0
  67. package/src/components/atoms/filter/units/checkbox-filter.tsx +42 -0
  68. package/src/components/atoms/filter/units/checkbox-group-filter.tsx +68 -0
  69. package/src/components/atoms/filter/units/date-filter.tsx +46 -0
  70. package/src/components/atoms/filter/units/index.ts +9 -0
  71. package/src/components/atoms/filter/units/numeric-filter.tsx +41 -0
  72. package/src/components/atoms/filter/units/range-filter.tsx +65 -0
  73. package/src/components/atoms/filter/units/search-filter.tsx +53 -0
  74. package/src/components/atoms/filter/units/select-filter.tsx +57 -0
  75. package/src/components/atoms/filter/units/switch-filter.tsx +35 -0
  76. package/src/components/atoms/index.ts +11 -0
  77. package/src/components/atoms/portal/index.ts +1 -0
  78. package/src/components/atoms/portal/portal.stories.tsx +43 -0
  79. package/src/components/atoms/portal/portal.tsx +25 -0
  80. package/src/components/atoms/row/index.ts +1 -0
  81. package/src/components/atoms/row/row.stories.tsx +37 -0
  82. package/src/components/atoms/row/row.tsx +26 -0
  83. package/src/components/atoms/theme-switch/index.ts +1 -0
  84. package/src/components/atoms/theme-switch/styles/classes.ts +16 -0
  85. package/src/components/atoms/theme-switch/styles/index.ts +1 -0
  86. package/src/components/atoms/theme-switch/theme-switch.stories.tsx +26 -0
  87. package/src/components/atoms/theme-switch/theme-switch.tsx +54 -0
  88. package/src/components/atoms/uploader/components/avatar-label.tsx +102 -0
  89. package/src/components/atoms/uploader/components/index.ts +8 -0
  90. package/src/components/atoms/uploader/components/upload-file-error-box.tsx +40 -0
  91. package/src/components/atoms/uploader/components/upload-file-input.tsx +36 -0
  92. package/src/components/atoms/uploader/components/upload-file-label.tsx +92 -0
  93. package/src/components/atoms/uploader/components/upload-file-listing.tsx +64 -0
  94. package/src/components/atoms/uploader/components/uploader-title.tsx +21 -0
  95. package/src/components/atoms/uploader/components/uploader.tsx +89 -0
  96. package/src/components/atoms/uploader/components/view-image-modal.tsx +41 -0
  97. package/src/components/atoms/uploader/index.ts +1 -0
  98. package/src/components/atoms/uploader/stories/uploader.stories.tsx +202 -0
  99. package/src/components/index.ts +4 -0
  100. package/src/components/molecules/index.ts +4 -0
  101. package/src/components/molecules/item-card/components/actions/index.ts +3 -0
  102. package/src/components/molecules/item-card/components/actions/item-actions-buttons.tsx +43 -0
  103. package/src/components/molecules/item-card/components/actions/item-actions-dropdown.tsx +57 -0
  104. package/src/components/molecules/item-card/components/actions/item-actions-overlay.tsx +50 -0
  105. package/src/components/molecules/item-card/components/additions/index.ts +2 -0
  106. package/src/components/molecules/item-card/components/additions/item-banner.tsx +22 -0
  107. package/src/components/molecules/item-card/components/additions/loading-item.tsx +88 -0
  108. package/src/components/molecules/item-card/components/card/index.ts +4 -0
  109. package/src/components/molecules/item-card/components/card/item-card-body.tsx +74 -0
  110. package/src/components/molecules/item-card/components/card/item-card-footer.tsx +79 -0
  111. package/src/components/molecules/item-card/components/card/item-card-header.tsx +69 -0
  112. package/src/components/molecules/item-card/components/card/item-card.tsx +123 -0
  113. package/src/components/molecules/item-card/components/index.ts +3 -0
  114. package/src/components/molecules/item-card/index.ts +2 -0
  115. package/src/components/molecules/item-card/stories/item-card.stories.tsx +218 -0
  116. package/src/components/molecules/item-card/styles/classes.ts +141 -0
  117. package/src/components/molecules/item-card/styles/index.ts +1 -0
  118. package/src/components/molecules/nav-bar/index.ts +3 -0
  119. package/src/components/molecules/nav-bar/nav-bar-item.tsx +64 -0
  120. package/src/components/molecules/nav-bar/nav-bar.tsx +57 -0
  121. package/src/components/molecules/nav-bar/stories/hover-effect/nav-bar-hover-effect.stories.tsx +52 -0
  122. package/src/components/molecules/nav-bar/stories/nav-bar.stories.tsx +50 -0
  123. package/src/components/molecules/nav-bar/styles/classes.ts +68 -0
  124. package/src/components/molecules/nav-bar/styles/index.ts +2 -0
  125. package/src/components/molecules/nav-bar/styles/styles.ts +85 -0
  126. package/src/components/molecules/nav-bar/sub-items-box.tsx +58 -0
  127. package/src/components/molecules/scaffold/index.ts +2 -0
  128. package/src/components/molecules/scaffold/scaffold.stories.tsx +21 -0
  129. package/src/components/molecules/scaffold/scaffold.tsx +23 -0
  130. package/src/components/molecules/scaffold/styles/index.ts +1 -0
  131. package/src/components/molecules/scaffold/styles/scaffold-classes.ts +10 -0
  132. package/src/components/molecules/side-bar/compact-side-bar.tsx +77 -0
  133. package/src/components/molecules/side-bar/index.ts +1 -0
  134. package/src/components/molecules/side-bar/side-bar-drawer.tsx +113 -0
  135. package/src/components/molecules/side-bar/side-bar.stories.tsx +111 -0
  136. package/src/components/molecules/side-bar/side-bar.tsx +31 -0
  137. package/src/components/molecules/side-bar/styles/classes.ts +28 -0
  138. package/src/components/molecules/side-bar/styles/index.ts +2 -0
  139. package/src/components/molecules/side-bar/styles/styles.ts +13 -0
  140. package/src/components/organisms/deletion-confirmor/deletion-confirmor.tsx +110 -0
  141. package/src/components/organisms/deletion-confirmor/index.ts +3 -0
  142. package/src/components/organisms/deletion-confirmor/stories/components.tsx +25 -0
  143. package/src/components/organisms/deletion-confirmor/stories/deletion-confirmor.stories.tsx +78 -0
  144. package/src/components/organisms/deletion-confirmor/styles/classes.ts +28 -0
  145. package/src/components/organisms/deletion-confirmor/styles/index.ts +2 -0
  146. package/src/components/organisms/deletion-confirmor/styles/styles.ts +4 -0
  147. package/src/components/organisms/footer/copy-rights-box.tsx +27 -0
  148. package/src/components/organisms/footer/footer.tsx +75 -0
  149. package/src/components/organisms/footer/index.ts +5 -0
  150. package/src/components/organisms/footer/policies-box.tsx +27 -0
  151. package/src/components/organisms/footer/quick-links-box.tsx +46 -0
  152. package/src/components/organisms/footer/social-links-box.tsx +33 -0
  153. package/src/components/organisms/footer/stories/footer.stories.tsx +61 -0
  154. package/src/components/organisms/footer/styles/classes.ts +71 -0
  155. package/src/components/organisms/footer/styles/index.ts +2 -0
  156. package/src/components/organisms/footer/styles/styles.ts +6 -0
  157. package/src/components/organisms/form-builder/form-builder.stories.tsx +144 -0
  158. package/src/components/organisms/form-builder/form-builder.tsx +75 -0
  159. package/src/components/organisms/form-builder/index.ts +1 -0
  160. package/src/components/organisms/header/header.tsx +87 -0
  161. package/src/components/organisms/header/index.ts +1 -0
  162. package/src/components/organisms/header/segmented-header-content.tsx +29 -0
  163. package/src/components/organisms/header/stories/header.stories.tsx +144 -0
  164. package/src/components/organisms/header/styles/classes.ts +22 -0
  165. package/src/components/organisms/header/styles/index.ts +2 -0
  166. package/src/components/organisms/header/styles/styles.ts +39 -0
  167. package/src/components/organisms/index.ts +6 -0
  168. package/src/components/organisms/item-details/index.ts +1 -0
  169. package/src/components/organisms/item-details/item-details.tsx +6 -0
  170. package/src/components/organisms/listings/empty-listings.tsx +80 -0
  171. package/src/components/organisms/listings/index.ts +3 -0
  172. package/src/components/organisms/listings/listings.tsx +96 -0
  173. package/src/components/organisms/listings/stories/grid-listings.stories.tsx +153 -0
  174. package/src/components/organisms/listings/stories/list-listings.stories.tsx +171 -0
  175. package/src/components/organisms/listings/styles/classes.ts +49 -0
  176. package/src/components/organisms/listings/styles/index.ts +2 -0
  177. package/src/components/organisms/listings/styles/styles.ts +6 -0
  178. package/src/components/templates/index.ts +1 -0
  179. package/src/components/templates/landing-page/index.ts +1 -0
  180. package/src/components/templates/landing-page/landing-page.stories.tsx +21 -0
  181. package/src/components/templates/landing-page/landing-page.tsx +57 -0
  182. package/src/components/templates/landing-page/styles/classes.ts +11 -0
  183. package/src/components/templates/landing-page/styles/index.ts +1 -0
  184. package/src/constants/animations.ts +14 -0
  185. package/src/constants/card.tsx +42 -0
  186. package/src/constants/defaults.ts +59 -0
  187. package/src/constants/fake.ts +5 -0
  188. package/src/constants/footer.tsx +157 -0
  189. package/src/constants/index.ts +6 -0
  190. package/src/constants/uploader.ts +33 -0
  191. package/src/context/emperor-ui-context.ts +6 -0
  192. package/src/context/form-builder-context.tsx +8 -0
  193. package/src/context/index.ts +4 -0
  194. package/src/context/navigation-context.ts +6 -0
  195. package/src/context/uploader-context.ts +6 -0
  196. package/src/enums/index.ts +2 -0
  197. package/src/enums/placeholders.ts +5 -0
  198. package/src/enums/preserved-keys.ts +3 -0
  199. package/src/examples/index.ts +1 -0
  200. package/src/hooks/index.ts +8 -0
  201. package/src/hooks/use-emperor-ui.ts +12 -0
  202. package/src/hooks/use-filters.ts +20 -0
  203. package/src/hooks/use-form-builder-context.ts +16 -0
  204. package/src/hooks/use-navigation.ts +12 -0
  205. package/src/hooks/use-search-params-handler.tsx +186 -0
  206. package/src/hooks/use-uploader-context.ts +14 -0
  207. package/src/hooks/use-uploader.tsx +164 -0
  208. package/src/hooks/use-window-size.tsx +53 -0
  209. package/src/i18n/configs/i18n.ts +7 -0
  210. package/src/i18n/configs/index.ts +1 -0
  211. package/src/i18n/constants/index.ts +1 -0
  212. package/src/i18n/constants/locales.ts +4 -0
  213. package/src/i18n/index.ts +5 -0
  214. package/src/i18n/locales/ar.ts +15 -0
  215. package/src/i18n/locales/atoms/ar.ts +18 -0
  216. package/src/i18n/locales/atoms/en.ts +18 -0
  217. package/src/i18n/locales/atoms/index.ts +2 -0
  218. package/src/i18n/locales/common/ar.ts +1 -0
  219. package/src/i18n/locales/common/en.ts +1 -0
  220. package/src/i18n/locales/common/index.ts +2 -0
  221. package/src/i18n/locales/en.ts +15 -0
  222. package/src/i18n/locales/index.ts +4 -0
  223. package/src/i18n/locales/molecules/ar.ts +1 -0
  224. package/src/i18n/locales/molecules/en.ts +1 -0
  225. package/src/i18n/locales/molecules/index.ts +2 -0
  226. package/src/i18n/locales/organisms/ar.ts +11 -0
  227. package/src/i18n/locales/organisms/en.ts +11 -0
  228. package/src/i18n/locales/organisms/index.ts +2 -0
  229. package/src/i18n/locales/templates/ar.ts +1 -0
  230. package/src/i18n/locales/templates/en.ts +1 -0
  231. package/src/i18n/locales/templates/index.ts +2 -0
  232. package/src/i18n/locales/toasts/ar.ts +1 -0
  233. package/src/i18n/locales/toasts/en.ts +1 -0
  234. package/src/i18n/locales/toasts/index.ts +2 -0
  235. package/src/i18n/types/index.ts +2 -0
  236. package/{dist/src/i18n/types/locale.d.ts → src/i18n/types/locale.ts} +3 -1
  237. package/{dist/src/i18n/types/toasts.d.ts → src/i18n/types/toasts.ts} +2 -1
  238. package/src/i18n/utils/get-locales.ts +4 -0
  239. package/src/i18n/utils/index.ts +2 -0
  240. package/src/i18n/utils/localize.ts +15 -0
  241. package/src/index.ts +14 -0
  242. package/src/mocks/constants.ts +103 -0
  243. package/src/mocks/deletion-confirmor.ts +16 -0
  244. package/src/mocks/header.tsx +118 -0
  245. package/src/mocks/index.ts +6 -0
  246. package/src/mocks/listings.tsx +154 -0
  247. package/src/mocks/locales/index.ts +1 -0
  248. package/src/mocks/locales/uploader.ts +33 -0
  249. package/src/mocks/types.ts +64 -0
  250. package/src/providers/config-provider.tsx +72 -0
  251. package/src/providers/emperor-ui-provider.tsx +35 -0
  252. package/src/providers/form-builder-provider-context.tsx +18 -0
  253. package/src/providers/index.ts +6 -0
  254. package/src/providers/navigation-provider.tsx +42 -0
  255. package/src/providers/theme-provider.tsx +16 -0
  256. package/src/providers/uploader-provider.tsx +53 -0
  257. package/src/styles/globals.css +38 -0
  258. package/src/styles/hero.ts +3 -0
  259. package/src/styles/index.css +18 -0
  260. package/src/types/components/atoms/brand.ts +13 -0
  261. package/src/types/components/atoms/color-picker/color-picker.ts +21 -0
  262. package/src/types/components/atoms/color-picker/index.ts +1 -0
  263. package/src/types/components/atoms/column.ts +3 -0
  264. package/{dist/src/types/components/atoms/container.d.ts → src/types/components/atoms/container.ts} +2 -1
  265. package/src/types/components/atoms/field/field.ts +61 -0
  266. package/src/types/components/atoms/field/index.ts +1 -0
  267. package/src/types/components/atoms/filter/filter.ts +52 -0
  268. package/src/types/components/atoms/filter/index.ts +2 -0
  269. package/{dist/src/types/components/atoms/filter/select-filter.d.ts → src/types/components/atoms/filter/select-filter.ts} +4 -3
  270. package/src/types/components/atoms/index.ts +9 -0
  271. package/src/types/components/atoms/portal.ts +6 -0
  272. package/src/types/components/atoms/row.ts +3 -0
  273. package/src/types/components/atoms/uploader.ts +103 -0
  274. package/src/types/components/index.ts +4 -0
  275. package/src/types/components/molecules/footer/footer.ts +68 -0
  276. package/src/types/components/molecules/footer/index.ts +1 -0
  277. package/src/types/components/molecules/header/header.ts +51 -0
  278. package/src/types/components/molecules/header/index.ts +1 -0
  279. package/src/types/components/molecules/index.ts +9 -0
  280. package/src/types/components/molecules/item-card/index.ts +1 -0
  281. package/src/types/components/molecules/item-card/item-card.ts +69 -0
  282. package/src/types/components/molecules/item-details/index.ts +1 -0
  283. package/src/types/components/molecules/item-details/item-details.ts +9 -0
  284. package/src/types/components/molecules/listings/index.ts +1 -0
  285. package/src/types/components/molecules/listings/listings.ts +29 -0
  286. package/src/types/components/molecules/nav-bar/index.ts +1 -0
  287. package/src/types/components/molecules/nav-bar/nav-bar.ts +66 -0
  288. package/src/types/components/molecules/scaffold/index.ts +1 -0
  289. package/src/types/components/molecules/scaffold/scaffold.ts +9 -0
  290. package/src/types/components/molecules/side-bar/index.ts +1 -0
  291. package/src/types/components/molecules/side-bar/side-bar.ts +40 -0
  292. package/src/types/components/molecules/theme-switch/index.ts +1 -0
  293. package/src/types/components/molecules/theme-switch/theme-switch.ts +9 -0
  294. package/src/types/components/organisms/deletion-confirmor/deletion-confirmor.ts +22 -0
  295. package/src/types/components/organisms/deletion-confirmor/index.ts +1 -0
  296. package/src/types/components/organisms/filters/filters.ts +11 -0
  297. package/src/types/components/organisms/filters/index.ts +1 -0
  298. package/src/types/components/organisms/form-builder/context.ts +6 -0
  299. package/src/types/components/organisms/form-builder/form-builder.ts +39 -0
  300. package/src/types/components/organisms/form-builder/index.ts +2 -0
  301. package/src/types/components/organisms/index.ts +3 -0
  302. package/src/types/components/templates/index.ts +1 -0
  303. package/src/types/components/templates/landing-page.ts +10 -0
  304. package/src/types/context/config.ts +24 -0
  305. package/src/types/context/index.ts +4 -0
  306. package/src/types/context/localization.ts +24 -0
  307. package/src/types/context/navigation.ts +17 -0
  308. package/src/types/context/theme.ts +33 -0
  309. package/src/types/index.ts +3 -0
  310. package/{dist/src/types/shared/components.d.ts → src/types/shared/components.ts} +9 -6
  311. package/src/types/shared/index.ts +1 -0
  312. package/src/utils/cn.ts +6 -0
  313. package/src/utils/compress-images.ts +36 -0
  314. package/src/utils/index.ts +5 -0
  315. package/src/utils/locales.ts +54 -0
  316. package/src/utils/storybook.tsx +15 -0
  317. package/src/utils/uploader.ts +170 -0
  318. package/tsconfig.app.json +37 -0
  319. package/tsconfig.json +7 -0
  320. package/tsconfig.node.json +25 -0
  321. package/vite.config.ts +44 -0
  322. package/vitest.shims.d.ts +1 -0
  323. package/dist/src/animations/blink.d.ts +0 -7
  324. package/dist/src/animations/floating.d.ts +0 -2
  325. package/dist/src/animations/index.d.ts +0 -2
  326. package/dist/src/components/atoms/brand/brand.d.ts +0 -14
  327. package/dist/src/components/atoms/brand/index.d.ts +0 -1
  328. package/dist/src/components/atoms/brand/styles/classes.d.ts +0 -3
  329. package/dist/src/components/atoms/brand/styles/index.d.ts +0 -2
  330. package/dist/src/components/atoms/brand/styles/styles.d.ts +0 -1
  331. package/dist/src/components/atoms/color-picker/color-picker.d.ts +0 -2
  332. package/dist/src/components/atoms/color-picker/free-color-picker.d.ts +0 -2
  333. package/dist/src/components/atoms/color-picker/index.d.ts +0 -3
  334. package/dist/src/components/atoms/color-picker/preset-color-picker.d.ts +0 -2
  335. package/dist/src/components/atoms/column/column.d.ts +0 -2
  336. package/dist/src/components/atoms/column/index.d.ts +0 -1
  337. package/dist/src/components/atoms/container/container.d.ts +0 -2
  338. package/dist/src/components/atoms/container/index.d.ts +0 -1
  339. package/dist/src/components/atoms/copy-button/copy-button.d.ts +0 -3
  340. package/dist/src/components/atoms/copy-button/index.d.ts +0 -1
  341. package/dist/src/components/atoms/field/field.d.ts +0 -3
  342. package/dist/src/components/atoms/field/index.d.ts +0 -3
  343. package/dist/src/components/atoms/field/styles/classes.d.ts +0 -3
  344. package/dist/src/components/atoms/field/styles/index.d.ts +0 -1
  345. package/dist/src/components/atoms/field/units/autocomplete-field.d.ts +0 -3
  346. package/dist/src/components/atoms/field/units/checkbox-field.d.ts +0 -3
  347. package/dist/src/components/atoms/field/units/index.d.ts +0 -7
  348. package/dist/src/components/atoms/field/units/input-field.d.ts +0 -3
  349. package/dist/src/components/atoms/field/units/radio-field.d.ts +0 -3
  350. package/dist/src/components/atoms/field/units/select-field.d.ts +0 -3
  351. package/dist/src/components/atoms/field/units/switch-field.d.ts +0 -3
  352. package/dist/src/components/atoms/field/units/textarea-field.d.ts +0 -3
  353. package/dist/src/components/atoms/filter/filter.d.ts +0 -2
  354. package/dist/src/components/atoms/filter/index.d.ts +0 -3
  355. package/dist/src/components/atoms/filter/styles/classes.d.ts +0 -3
  356. package/dist/src/components/atoms/filter/styles/index.d.ts +0 -1
  357. package/dist/src/components/atoms/filter/units/autocomplete-filter.d.ts +0 -2
  358. package/dist/src/components/atoms/filter/units/checkbox-filter.d.ts +0 -2
  359. package/dist/src/components/atoms/filter/units/checkbox-group-filter.d.ts +0 -2
  360. package/dist/src/components/atoms/filter/units/date-filter.d.ts +0 -2
  361. package/dist/src/components/atoms/filter/units/index.d.ts +0 -9
  362. package/dist/src/components/atoms/filter/units/numeric-filter.d.ts +0 -2
  363. package/dist/src/components/atoms/filter/units/range-filter.d.ts +0 -2
  364. package/dist/src/components/atoms/filter/units/search-filter.d.ts +0 -2
  365. package/dist/src/components/atoms/filter/units/select-filter.d.ts +0 -2
  366. package/dist/src/components/atoms/filter/units/switch-filter.d.ts +0 -2
  367. package/dist/src/components/atoms/index.d.ts +0 -11
  368. package/dist/src/components/atoms/portal/index.d.ts +0 -1
  369. package/dist/src/components/atoms/portal/portal.d.ts +0 -2
  370. package/dist/src/components/atoms/row/index.d.ts +0 -1
  371. package/dist/src/components/atoms/row/row.d.ts +0 -2
  372. package/dist/src/components/atoms/theme-switch/index.d.ts +0 -1
  373. package/dist/src/components/atoms/theme-switch/styles/classes.d.ts +0 -3
  374. package/dist/src/components/atoms/theme-switch/styles/index.d.ts +0 -1
  375. package/dist/src/components/atoms/theme-switch/theme-switch.d.ts +0 -2
  376. package/dist/src/components/atoms/uploader/components/avatar-label.d.ts +0 -1
  377. package/dist/src/components/atoms/uploader/components/index.d.ts +0 -8
  378. package/dist/src/components/atoms/uploader/components/upload-file-error-box.d.ts +0 -1
  379. package/dist/src/components/atoms/uploader/components/upload-file-input.d.ts +0 -1
  380. package/dist/src/components/atoms/uploader/components/upload-file-label.d.ts +0 -1
  381. package/dist/src/components/atoms/uploader/components/upload-file-listing.d.ts +0 -1
  382. package/dist/src/components/atoms/uploader/components/uploader-title.d.ts +0 -2
  383. package/dist/src/components/atoms/uploader/components/uploader.d.ts +0 -19
  384. package/dist/src/components/atoms/uploader/components/view-image-modal.d.ts +0 -1
  385. package/dist/src/components/atoms/uploader/index.d.ts +0 -1
  386. package/dist/src/components/index.d.ts +0 -4
  387. package/dist/src/components/molecules/index.d.ts +0 -4
  388. package/dist/src/components/molecules/item-card/components/actions/index.d.ts +0 -3
  389. package/dist/src/components/molecules/item-card/components/actions/item-actions-buttons.d.ts +0 -6
  390. package/dist/src/components/molecules/item-card/components/actions/item-actions-dropdown.d.ts +0 -2
  391. package/dist/src/components/molecules/item-card/components/actions/item-actions-overlay.d.ts +0 -4
  392. package/dist/src/components/molecules/item-card/components/additions/index.d.ts +0 -2
  393. package/dist/src/components/molecules/item-card/components/additions/item-banner.d.ts +0 -2
  394. package/dist/src/components/molecules/item-card/components/additions/loading-item.d.ts +0 -2
  395. package/dist/src/components/molecules/item-card/components/card/index.d.ts +0 -4
  396. package/dist/src/components/molecules/item-card/components/card/item-card-body.d.ts +0 -2
  397. package/dist/src/components/molecules/item-card/components/card/item-card-footer.d.ts +0 -2
  398. package/dist/src/components/molecules/item-card/components/card/item-card-header.d.ts +0 -2
  399. package/dist/src/components/molecules/item-card/components/card/item-card.d.ts +0 -2
  400. package/dist/src/components/molecules/item-card/components/index.d.ts +0 -3
  401. package/dist/src/components/molecules/item-card/index.d.ts +0 -2
  402. package/dist/src/components/molecules/item-card/styles/classes.d.ts +0 -33
  403. package/dist/src/components/molecules/item-card/styles/index.d.ts +0 -1
  404. package/dist/src/components/molecules/nav-bar/index.d.ts +0 -3
  405. package/dist/src/components/molecules/nav-bar/nav-bar-item.d.ts +0 -6
  406. package/dist/src/components/molecules/nav-bar/nav-bar.d.ts +0 -13
  407. package/dist/src/components/molecules/nav-bar/styles/classes.d.ts +0 -11
  408. package/dist/src/components/molecules/nav-bar/styles/index.d.ts +0 -2
  409. package/dist/src/components/molecules/nav-bar/styles/styles.d.ts +0 -5
  410. package/dist/src/components/molecules/nav-bar/sub-items-box.d.ts +0 -2
  411. package/dist/src/components/molecules/scaffold/index.d.ts +0 -2
  412. package/dist/src/components/molecules/scaffold/scaffold.d.ts +0 -3
  413. package/dist/src/components/molecules/scaffold/styles/index.d.ts +0 -1
  414. package/dist/src/components/molecules/scaffold/styles/scaffold-classes.d.ts +0 -1
  415. package/dist/src/components/molecules/side-bar/compact-side-bar.d.ts +0 -2
  416. package/dist/src/components/molecules/side-bar/index.d.ts +0 -1
  417. package/dist/src/components/molecules/side-bar/side-bar-drawer.d.ts +0 -2
  418. package/dist/src/components/molecules/side-bar/side-bar.d.ts +0 -15
  419. package/dist/src/components/molecules/side-bar/styles/classes.d.ts +0 -6
  420. package/dist/src/components/molecules/side-bar/styles/index.d.ts +0 -2
  421. package/dist/src/components/molecules/side-bar/styles/styles.d.ts +0 -3
  422. package/dist/src/components/organisms/deletion-confirmor/deletion-confirmor.d.ts +0 -2
  423. package/dist/src/components/organisms/deletion-confirmor/index.d.ts +0 -3
  424. package/dist/src/components/organisms/deletion-confirmor/stories/components.d.ts +0 -2
  425. package/dist/src/components/organisms/deletion-confirmor/styles/classes.d.ts +0 -4
  426. package/dist/src/components/organisms/deletion-confirmor/styles/index.d.ts +0 -2
  427. package/dist/src/components/organisms/deletion-confirmor/styles/styles.d.ts +0 -2
  428. package/dist/src/components/organisms/footer/copy-rights-box.d.ts +0 -2
  429. package/dist/src/components/organisms/footer/footer.d.ts +0 -11
  430. package/dist/src/components/organisms/footer/index.d.ts +0 -5
  431. package/dist/src/components/organisms/footer/policies-box.d.ts +0 -2
  432. package/dist/src/components/organisms/footer/quick-links-box.d.ts +0 -2
  433. package/dist/src/components/organisms/footer/social-links-box.d.ts +0 -2
  434. package/dist/src/components/organisms/footer/styles/classes.d.ts +0 -9
  435. package/dist/src/components/organisms/footer/styles/index.d.ts +0 -2
  436. package/dist/src/components/organisms/footer/styles/styles.d.ts +0 -2
  437. package/dist/src/components/organisms/form-builder/form-builder.d.ts +0 -3
  438. package/dist/src/components/organisms/form-builder/index.d.ts +0 -1
  439. package/dist/src/components/organisms/header/header.d.ts +0 -8
  440. package/dist/src/components/organisms/header/index.d.ts +0 -1
  441. package/dist/src/components/organisms/header/segmented-header-content.d.ts +0 -2
  442. package/dist/src/components/organisms/header/styles/classes.d.ts +0 -3
  443. package/dist/src/components/organisms/header/styles/index.d.ts +0 -2
  444. package/dist/src/components/organisms/header/styles/styles.d.ts +0 -6
  445. package/dist/src/components/organisms/index.d.ts +0 -6
  446. package/dist/src/components/organisms/item-details/index.d.ts +0 -1
  447. package/dist/src/components/organisms/item-details/item-details.d.ts +0 -2
  448. package/dist/src/components/organisms/listings/empty-listings.d.ts +0 -9
  449. package/dist/src/components/organisms/listings/index.d.ts +0 -3
  450. package/dist/src/components/organisms/listings/listings.d.ts +0 -2
  451. package/dist/src/components/organisms/listings/styles/classes.d.ts +0 -10
  452. package/dist/src/components/organisms/listings/styles/index.d.ts +0 -2
  453. package/dist/src/components/organisms/listings/styles/styles.d.ts +0 -2
  454. package/dist/src/components/templates/index.d.ts +0 -1
  455. package/dist/src/components/templates/landing-page/index.d.ts +0 -1
  456. package/dist/src/components/templates/landing-page/landing-page.d.ts +0 -10
  457. package/dist/src/components/templates/landing-page/styles/classes.d.ts +0 -3
  458. package/dist/src/components/templates/landing-page/styles/index.d.ts +0 -1
  459. package/dist/src/constants/animations.d.ts +0 -5
  460. package/dist/src/constants/card.d.ts +0 -3
  461. package/dist/src/constants/defaults.d.ts +0 -2
  462. package/dist/src/constants/fake.d.ts +0 -2
  463. package/dist/src/constants/footer.d.ts +0 -6
  464. package/dist/src/constants/index.d.ts +0 -6
  465. package/dist/src/constants/uploader.d.ts +0 -8
  466. package/dist/src/context/emperor-ui-context.d.ts +0 -2
  467. package/dist/src/context/form-builder-context.d.ts +0 -3
  468. package/dist/src/context/index.d.ts +0 -4
  469. package/dist/src/context/navigation-context.d.ts +0 -2
  470. package/dist/src/context/uploader-context.d.ts +0 -2
  471. package/dist/src/enums/index.d.ts +0 -2
  472. package/dist/src/enums/placeholders.d.ts +0 -5
  473. package/dist/src/enums/preserved-keys.d.ts +0 -3
  474. package/dist/src/examples/index.d.ts +0 -1
  475. package/dist/src/hooks/index.d.ts +0 -8
  476. package/dist/src/hooks/use-emperor-ui.d.ts +0 -1
  477. package/dist/src/hooks/use-filters.d.ts +0 -4
  478. package/dist/src/hooks/use-form-builder-context.d.ts +0 -3
  479. package/dist/src/hooks/use-navigation.d.ts +0 -1
  480. package/dist/src/hooks/use-search-params-handler.d.ts +0 -17
  481. package/dist/src/hooks/use-uploader-context.d.ts +0 -1
  482. package/dist/src/hooks/use-uploader.d.ts +0 -2
  483. package/dist/src/hooks/use-window-size.d.ts +0 -7
  484. package/dist/src/i18n/configs/i18n.d.ts +0 -6
  485. package/dist/src/i18n/configs/index.d.ts +0 -1
  486. package/dist/src/i18n/constants/index.d.ts +0 -1
  487. package/dist/src/i18n/constants/locales.d.ts +0 -4
  488. package/dist/src/i18n/index.d.ts +0 -5
  489. package/dist/src/i18n/locales/ar.d.ts +0 -32
  490. package/dist/src/i18n/locales/atoms/ar.d.ts +0 -16
  491. package/dist/src/i18n/locales/atoms/en.d.ts +0 -16
  492. package/dist/src/i18n/locales/atoms/index.d.ts +0 -2
  493. package/dist/src/i18n/locales/common/ar.d.ts +0 -1
  494. package/dist/src/i18n/locales/common/en.d.ts +0 -1
  495. package/dist/src/i18n/locales/common/index.d.ts +0 -2
  496. package/dist/src/i18n/locales/en.d.ts +0 -32
  497. package/dist/src/i18n/locales/index.d.ts +0 -4
  498. package/dist/src/i18n/locales/molecules/ar.d.ts +0 -1
  499. package/dist/src/i18n/locales/molecules/en.d.ts +0 -1
  500. package/dist/src/i18n/locales/molecules/index.d.ts +0 -2
  501. package/dist/src/i18n/locales/organisms/ar.d.ts +0 -10
  502. package/dist/src/i18n/locales/organisms/en.d.ts +0 -10
  503. package/dist/src/i18n/locales/organisms/index.d.ts +0 -2
  504. package/dist/src/i18n/locales/templates/ar.d.ts +0 -1
  505. package/dist/src/i18n/locales/templates/en.d.ts +0 -1
  506. package/dist/src/i18n/locales/templates/index.d.ts +0 -2
  507. package/dist/src/i18n/locales/toasts/ar.d.ts +0 -1
  508. package/dist/src/i18n/locales/toasts/en.d.ts +0 -1
  509. package/dist/src/i18n/locales/toasts/index.d.ts +0 -2
  510. package/dist/src/i18n/types/index.d.ts +0 -2
  511. package/dist/src/i18n/utils/get-locales.d.ts +0 -2
  512. package/dist/src/i18n/utils/index.d.ts +0 -2
  513. package/dist/src/i18n/utils/localize.d.ts +0 -6
  514. package/dist/src/index.d.ts +0 -10
  515. package/dist/src/mocks/constants.d.ts +0 -10
  516. package/dist/src/mocks/deletion-confirmor.d.ts +0 -7
  517. package/dist/src/mocks/header.d.ts +0 -5
  518. package/dist/src/mocks/index.d.ts +0 -6
  519. package/dist/src/mocks/listings.d.ts +0 -14
  520. package/dist/src/mocks/locales/index.d.ts +0 -1
  521. package/dist/src/mocks/locales/uploader.d.ts +0 -2
  522. package/dist/src/mocks/types.d.ts +0 -28
  523. package/dist/src/providers/config-provider.d.ts +0 -2
  524. package/dist/src/providers/emperor-ui-provider.d.ts +0 -4
  525. package/dist/src/providers/form-builder-provider-context.d.ts +0 -7
  526. package/dist/src/providers/index.d.ts +0 -6
  527. package/dist/src/providers/navigation-provider.d.ts +0 -2
  528. package/dist/src/providers/theme-provider.d.ts +0 -5
  529. package/dist/src/providers/uploader-provider.d.ts +0 -2
  530. package/dist/src/styles/hero.d.ts +0 -2
  531. package/dist/src/types/components/atoms/brand.d.ts +0 -12
  532. package/dist/src/types/components/atoms/color-picker/color-picker.d.ts +0 -10
  533. package/dist/src/types/components/atoms/color-picker/index.d.ts +0 -1
  534. package/dist/src/types/components/atoms/column.d.ts +0 -2
  535. package/dist/src/types/components/atoms/field/field.d.ts +0 -36
  536. package/dist/src/types/components/atoms/field/index.d.ts +0 -1
  537. package/dist/src/types/components/atoms/filter/filter.d.ts +0 -35
  538. package/dist/src/types/components/atoms/filter/index.d.ts +0 -2
  539. package/dist/src/types/components/atoms/index.d.ts +0 -9
  540. package/dist/src/types/components/atoms/portal.d.ts +0 -5
  541. package/dist/src/types/components/atoms/row.d.ts +0 -2
  542. package/dist/src/types/components/atoms/uploader.d.ts +0 -84
  543. package/dist/src/types/components/index.d.ts +0 -4
  544. package/dist/src/types/components/molecules/footer/footer.d.ts +0 -60
  545. package/dist/src/types/components/molecules/footer/index.d.ts +0 -1
  546. package/dist/src/types/components/molecules/header/header.d.ts +0 -38
  547. package/dist/src/types/components/molecules/header/index.d.ts +0 -1
  548. package/dist/src/types/components/molecules/index.d.ts +0 -9
  549. package/dist/src/types/components/molecules/item-card/index.d.ts +0 -1
  550. package/dist/src/types/components/molecules/item-card/item-card.d.ts +0 -57
  551. package/dist/src/types/components/molecules/item-details/index.d.ts +0 -1
  552. package/dist/src/types/components/molecules/item-details/item-details.d.ts +0 -7
  553. package/dist/src/types/components/molecules/listings/index.d.ts +0 -1
  554. package/dist/src/types/components/molecules/listings/listings.d.ts +0 -22
  555. package/dist/src/types/components/molecules/nav-bar/index.d.ts +0 -1
  556. package/dist/src/types/components/molecules/nav-bar/nav-bar.d.ts +0 -45
  557. package/dist/src/types/components/molecules/scaffold/index.d.ts +0 -1
  558. package/dist/src/types/components/molecules/scaffold/scaffold.d.ts +0 -7
  559. package/dist/src/types/components/molecules/side-bar/index.d.ts +0 -1
  560. package/dist/src/types/components/molecules/side-bar/side-bar.d.ts +0 -36
  561. package/dist/src/types/components/molecules/theme-switch/index.d.ts +0 -1
  562. package/dist/src/types/components/molecules/theme-switch/theme-switch.d.ts +0 -7
  563. package/dist/src/types/components/organisms/deletion-confirmor/deletion-confirmor.d.ts +0 -20
  564. package/dist/src/types/components/organisms/deletion-confirmor/index.d.ts +0 -1
  565. package/dist/src/types/components/organisms/filters/filters.d.ts +0 -9
  566. package/dist/src/types/components/organisms/filters/index.d.ts +0 -1
  567. package/dist/src/types/components/organisms/form-builder/context.d.ts +0 -5
  568. package/dist/src/types/components/organisms/form-builder/form-builder.d.ts +0 -26
  569. package/dist/src/types/components/organisms/form-builder/index.d.ts +0 -2
  570. package/dist/src/types/components/organisms/index.d.ts +0 -3
  571. package/dist/src/types/components/templates/index.d.ts +0 -1
  572. package/dist/src/types/components/templates/landing-page.d.ts +0 -8
  573. package/dist/src/types/context/config.d.ts +0 -19
  574. package/dist/src/types/context/index.d.ts +0 -4
  575. package/dist/src/types/context/localization.d.ts +0 -17
  576. package/dist/src/types/context/navigation.d.ts +0 -15
  577. package/dist/src/types/context/theme.d.ts +0 -32
  578. package/dist/src/types/index.d.ts +0 -3
  579. package/dist/src/types/shared/index.d.ts +0 -1
  580. package/dist/src/utils/cn.d.ts +0 -2
  581. package/dist/src/utils/compress-images.d.ts +0 -2
  582. package/dist/src/utils/index.d.ts +0 -5
  583. package/dist/src/utils/locales.d.ts +0 -10
  584. package/dist/src/utils/storybook.d.ts +0 -4
  585. package/dist/src/utils/uploader.d.ts +0 -40
@@ -0,0 +1,88 @@
1
+ "use client";
2
+
3
+ import { cn } from "@/utils";
4
+ import { Card, CardBody, CardFooter, CardHeader } from "@heroui/card";
5
+ import { Skeleton } from "@heroui/skeleton";
6
+ import { motion } from "framer-motion";
7
+ import {
8
+ itemMainWrapperClasses,
9
+ itemCardMotionClasses,
10
+ itemImageWrapperClasses,
11
+ itemHeaderClasses,
12
+ itemBodyClasses,
13
+ itemFooterClasses,
14
+ itemChipsClasses,
15
+ } from "@/components";
16
+ import { getCardMotion } from "@/constants";
17
+ import type { ItemCardProps } from "@/types";
18
+
19
+ export function LoadingItem({
20
+ className,
21
+ classNames,
22
+ hoverEffect = "none",
23
+ orientation = "vertical",
24
+ }: Pick<
25
+ ItemCardProps,
26
+ "className" | "classNames" | "hoverEffect" | "orientation"
27
+ >) {
28
+ return (
29
+ <motion.div
30
+ {...getCardMotion({ hoverEffect })}
31
+ data-slot="emperor-ui-item-card"
32
+ className={cn(
33
+ itemCardMotionClasses({ orientation }),
34
+ classNames?.base,
35
+ className,
36
+ )}
37
+ >
38
+ <Card
39
+ shadow="sm"
40
+ data-slot="emperor-ui-item-card-main-wrapper"
41
+ className={cn(
42
+ itemMainWrapperClasses({ orientation }),
43
+ classNames?.mainWrapper,
44
+ )}
45
+ >
46
+ <CardHeader
47
+ data-slot="emperor-ui-item-card-header"
48
+ className={cn(itemHeaderClasses({ orientation }), classNames?.header)}
49
+ >
50
+ <Skeleton
51
+ className={cn(
52
+ itemImageWrapperClasses({ orientation }),
53
+ classNames?.imageWrapper,
54
+ )}
55
+ />
56
+ </CardHeader>
57
+
58
+ <CardBody
59
+ data-slot="emperor-ui-item-card-body"
60
+ className={cn(itemBodyClasses({ orientation }), classNames?.body)}
61
+ >
62
+ <div className="flex items-start justify-between gap-2">
63
+ <Skeleton className="h-5 flex-1 rounded-lg" />
64
+ <Skeleton className="size-8 shrink-0 rounded-lg" />
65
+ </div>
66
+
67
+ <Skeleton className="h-4 w-4/5 rounded-lg" />
68
+ <Skeleton className="h-4 w-full rounded-lg" />
69
+ </CardBody>
70
+
71
+ <CardFooter
72
+ data-slot="emperor-ui-item-card-footer"
73
+ className={cn(itemFooterClasses({ orientation }), classNames?.footer)}
74
+ >
75
+ <menu
76
+ data-slot="emperor-ui-item-card-chips"
77
+ className={cn(itemChipsClasses({ orientation }), classNames?.chips)}
78
+ >
79
+ {" "}
80
+ <Skeleton className="h-6 w-16 rounded-full" />
81
+ <Skeleton className="h-6 w-20 rounded-full" />
82
+ <Skeleton className="h-6 w-14 rounded-full" />
83
+ </menu>
84
+ </CardFooter>
85
+ </Card>
86
+ </motion.div>
87
+ );
88
+ }
@@ -0,0 +1,4 @@
1
+ export * from "./item-card";
2
+ export * from "./item-card-header";
3
+ export * from "./item-card-body";
4
+ export * from "./item-card-footer";
@@ -0,0 +1,74 @@
1
+ "use client";
2
+
3
+ import type { ItemCardProps } from "@/types";
4
+ import { cn } from "@/utils";
5
+ import {
6
+ itemBodyClasses,
7
+ itemDescriptionClasses,
8
+ itemPriceClasses,
9
+ itemTitleClasses,
10
+ ItemActionsDropdown,
11
+ } from "@/components";
12
+ import { CardBody } from "@heroui/card";
13
+
14
+ export function ItemCardBody({
15
+ item,
16
+ orientation,
17
+ classNames,
18
+ actions,
19
+ onActionClick,
20
+ actionsViewVariant = "dropdown",
21
+ }: Pick<
22
+ ItemCardProps,
23
+ | "item"
24
+ | "orientation"
25
+ | "classNames"
26
+ | "actions"
27
+ | "onActionClick"
28
+ | "actionsViewVariant"
29
+ >) {
30
+ return (
31
+ <CardBody
32
+ data-slot="emperor-ui-item-card-body"
33
+ className={cn(itemBodyClasses({ orientation }), classNames?.body)}
34
+ >
35
+ {item?.title && (
36
+ <h3
37
+ data-slot="emperor-ui-item-card-title"
38
+ className={cn(itemTitleClasses({ orientation }), classNames?.title)}
39
+ >
40
+ {item?.title}
41
+ </h3>
42
+ )}
43
+
44
+ {item?.description && (
45
+ <p
46
+ data-slot="emperor-ui-item-card-description"
47
+ className={cn(
48
+ itemDescriptionClasses({ orientation }),
49
+ classNames?.description,
50
+ )}
51
+ >
52
+ {item?.description}
53
+ </p>
54
+ )}
55
+
56
+ {item?.price && (
57
+ <p
58
+ data-slot="emperor-ui-item-card-price"
59
+ className={cn(itemPriceClasses({ orientation }), classNames?.price)}
60
+ >
61
+ {item?.price}
62
+ </p>
63
+ )}
64
+
65
+ {orientation === "horizontal" && actionsViewVariant === "dropdown" && (
66
+ <ItemActionsDropdown
67
+ actions={actions}
68
+ classNames={classNames}
69
+ onActionClick={onActionClick}
70
+ />
71
+ )}
72
+ </CardBody>
73
+ );
74
+ }
@@ -0,0 +1,79 @@
1
+ "use client";
2
+
3
+ import type { ItemCardProps } from "@/types";
4
+ import { cn } from "@/utils";
5
+ import {
6
+ ItemActionsButtons,
7
+ itemFooterClasses,
8
+ itemChipsClasses,
9
+ } from "@/components";
10
+ import { CardFooter } from "@heroui/card";
11
+ import { Chip } from "@heroui/chip";
12
+
13
+ export function ItemCardFooter({
14
+ item,
15
+ orientation,
16
+ classNames,
17
+ actions,
18
+ onActionClick,
19
+ actionsViewVariant = "dropdown",
20
+ }: Pick<
21
+ ItemCardProps,
22
+ | "item"
23
+ | "orientation"
24
+ | "classNames"
25
+ | "actions"
26
+ | "onActionClick"
27
+ | "actionsViewVariant"
28
+ >) {
29
+ return (
30
+ <CardFooter
31
+ data-slot="emperor-ui-item-card-footer"
32
+ className={cn(itemFooterClasses({ orientation }), classNames?.footer)}
33
+ >
34
+ {item?.chips && item?.chips?.length > 0 && (
35
+ <menu
36
+ data-slot="emperor-ui-item-card-chips"
37
+ className={cn(itemChipsClasses({ orientation }), classNames?.chips)}
38
+ >
39
+ {item?.chips?.map(
40
+ (
41
+ {
42
+ label,
43
+ className: chipClassName,
44
+ classNames: chipClassNames,
45
+ ...props
46
+ },
47
+ index,
48
+ ) => (
49
+ <Chip
50
+ key={index}
51
+ data-slot="emperor-ui-item-card-chip"
52
+ className={cn(chipClassName, classNames?.chip)}
53
+ classNames={{
54
+ content: "text-xs mx-1",
55
+ ...chipClassNames,
56
+ }}
57
+ size="sm"
58
+ variant="flat"
59
+ color="primary"
60
+ {...props}
61
+ >
62
+ {label}
63
+ </Chip>
64
+ ),
65
+ )}
66
+ </menu>
67
+ )}
68
+
69
+ {actionsViewVariant === "buttons" && actions && actions?.length > 0 && (
70
+ <ItemActionsButtons
71
+ actions={actions}
72
+ classNames={classNames}
73
+ onActionClick={onActionClick}
74
+ className="ml-auto"
75
+ />
76
+ )}
77
+ </CardFooter>
78
+ );
79
+ }
@@ -0,0 +1,69 @@
1
+ "use client";
2
+
3
+ import { CardHeader } from "@heroui/card";
4
+ import { cn } from "@/utils";
5
+ import {
6
+ itemHeaderClasses,
7
+ ItemActionsDropdown,
8
+ itemImageWrapperClasses,
9
+ ItemBanner,
10
+ } from "@/components";
11
+ import { Image } from "@heroui/image";
12
+ import type { ItemCardProps } from "@/types";
13
+
14
+ export function ItemCardHeader({
15
+ item,
16
+ orientation,
17
+ classNames,
18
+ actions,
19
+ onActionClick,
20
+ actionsViewVariant = "dropdown",
21
+ }: Pick<
22
+ ItemCardProps,
23
+ | "item"
24
+ | "orientation"
25
+ | "classNames"
26
+ | "actions"
27
+ | "onActionClick"
28
+ | "actionsViewVariant"
29
+ >) {
30
+ return (
31
+ <CardHeader
32
+ data-slot="emperor-ui-item-card-header"
33
+ className={cn(itemHeaderClasses({ orientation }), classNames?.header)}
34
+ >
35
+ {item?.image && (
36
+ <div
37
+ data-slot="emperor-ui-item-card-image-wrapper"
38
+ className={cn(
39
+ itemImageWrapperClasses({ orientation }),
40
+ classNames?.imageWrapper,
41
+ )}
42
+ >
43
+ <Image
44
+ data-slot="emperor-ui-item-card-image"
45
+ src={item?.image?.src}
46
+ alt={item?.image?.alt}
47
+ className={cn("size-full object-cover", classNames?.image)}
48
+ radius="none"
49
+ removeWrapper
50
+ />
51
+ </div>
52
+ )}
53
+
54
+ <ItemBanner
55
+ item={item}
56
+ orientation={orientation}
57
+ classNames={classNames}
58
+ />
59
+
60
+ {orientation === "vertical" && actionsViewVariant === "dropdown" && (
61
+ <ItemActionsDropdown
62
+ actions={actions}
63
+ classNames={classNames}
64
+ onActionClick={onActionClick}
65
+ />
66
+ )}
67
+ </CardHeader>
68
+ );
69
+ }
@@ -0,0 +1,123 @@
1
+ "use client";
2
+
3
+ import type {
4
+ ItemCardActionsViewVariant,
5
+ ItemCardOrientation,
6
+ ItemCardProps,
7
+ } from "@/types";
8
+ import { cn } from "@/utils";
9
+ import { Card } from "@heroui/card";
10
+ import { motion } from "framer-motion";
11
+ import {
12
+ itemMainWrapperClasses,
13
+ itemCardMotionClasses,
14
+ ItemActionsOverlay,
15
+ } from "@/components";
16
+ import { getCardMotion } from "@/constants";
17
+ import {
18
+ LoadingItem,
19
+ ItemCardHeader,
20
+ ItemCardBody,
21
+ ItemCardFooter,
22
+ } from "@/components";
23
+ import { useWindowSize } from "@/hooks";
24
+
25
+ export function ItemCard({
26
+ variants,
27
+ isLoading = false,
28
+ className,
29
+ classNames,
30
+ item,
31
+ actions = [],
32
+ hoverEffect = "none",
33
+ onActionClick,
34
+ orientation: defaultOrientation = "vertical",
35
+ actionsViewVariant = "dropdown",
36
+ }: ItemCardProps) {
37
+ const { isExtraSmallDevice } = useWindowSize();
38
+
39
+ const orientation: ItemCardOrientation = isExtraSmallDevice
40
+ ? "vertical"
41
+ : defaultOrientation;
42
+
43
+ if (isLoading)
44
+ return (
45
+ <LoadingItem
46
+ className={className}
47
+ classNames={classNames}
48
+ orientation={orientation}
49
+ />
50
+ );
51
+
52
+ const hasActions = actions && actions.length > 0;
53
+
54
+ const isDropdownVariant: boolean =
55
+ (actionsViewVariant as ItemCardActionsViewVariant) === "dropdown";
56
+
57
+ const isHoverOverlayVariant: boolean =
58
+ (actionsViewVariant as ItemCardActionsViewVariant) === "hover-overlay";
59
+
60
+ return (
61
+ <motion.div
62
+ data-slot="emperor-ui-item-card"
63
+ className={cn(
64
+ itemCardMotionClasses({ orientation }),
65
+ "group",
66
+ classNames?.base,
67
+ className,
68
+ )}
69
+ variants={variants}
70
+ {...getCardMotion({ hoverEffect })}
71
+ >
72
+ <Card
73
+ shadow="sm"
74
+ data-slot="emperor-ui-item-card-main-wrapper"
75
+ className={cn(
76
+ itemMainWrapperClasses({ orientation }),
77
+ "relative overflow-hidden",
78
+ classNames?.mainWrapper,
79
+ )}
80
+ >
81
+ <ItemCardHeader
82
+ item={item}
83
+ orientation={orientation}
84
+ classNames={classNames}
85
+ actions={actions}
86
+ onActionClick={onActionClick}
87
+ actionsViewVariant={
88
+ isDropdownVariant ? "dropdown" : actionsViewVariant
89
+ }
90
+ />
91
+
92
+ <ItemCardBody
93
+ item={item}
94
+ orientation={orientation}
95
+ classNames={classNames}
96
+ actions={actions}
97
+ onActionClick={onActionClick}
98
+ actionsViewVariant={
99
+ isDropdownVariant ? "dropdown" : actionsViewVariant
100
+ }
101
+ />
102
+
103
+ <ItemCardFooter
104
+ item={item}
105
+ orientation={orientation}
106
+ classNames={classNames}
107
+ actions={actions}
108
+ onActionClick={onActionClick}
109
+ actionsViewVariant={actionsViewVariant}
110
+ />
111
+
112
+ {isHoverOverlayVariant && hasActions && (
113
+ <ItemActionsOverlay
114
+ actions={actions}
115
+ classNames={classNames}
116
+ onActionClick={onActionClick}
117
+ orientation={orientation}
118
+ />
119
+ )}
120
+ </Card>
121
+ </motion.div>
122
+ );
123
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./additions";
2
+ export * from "./card";
3
+ export * from "./actions";
@@ -0,0 +1,2 @@
1
+ export * from "./components";
2
+ export * from "./styles";
@@ -0,0 +1,218 @@
1
+ import type { Meta, StoryObj } from "@storybook/react-vite";
2
+ import type { MockItemType } from "@/mocks";
3
+ import { ItemCard } from "@/components";
4
+ import { getStorybookDecorators } from "@/utils";
5
+ import { getListing, MOCK_LISTINGS } from "@/mocks";
6
+ import { useEffect, useState } from "react";
7
+ import { ItemCardProps } from "@/types";
8
+ import { ITEM_CARD_ACTIONS } from "@/constants";
9
+
10
+ const meta: Meta<typeof ItemCard> = {
11
+ title: "Molecules/Item Card",
12
+ component: ItemCard,
13
+ parameters: {
14
+ layout: "centered",
15
+ },
16
+ tags: ["autodocs"],
17
+ decorators: getStorybookDecorators({
18
+ config: {
19
+ layout: {
20
+ withScaffold: false,
21
+ },
22
+ },
23
+ }),
24
+ };
25
+
26
+ export default meta;
27
+
28
+ type Story = StoryObj<typeof meta>;
29
+
30
+ export const Default: Story = {
31
+ args: {
32
+ item: {
33
+ key: String(MOCK_LISTINGS[0]?.id),
34
+ title: MOCK_LISTINGS[0]?.title,
35
+ description: MOCK_LISTINGS[0]?.description,
36
+ image: {
37
+ src: MOCK_LISTINGS[0]?.image || "",
38
+ alt: MOCK_LISTINGS[0]?.title || "",
39
+ },
40
+ },
41
+ },
42
+ };
43
+
44
+ export const WithLoading: Story = {
45
+ args: {},
46
+ render: () => {
47
+ const [item, setItem] = useState<MockItemType | null | undefined>(null);
48
+ const [isLoading, setIsLoading] = useState(true);
49
+
50
+ useEffect(() => {
51
+ (async () => {
52
+ const { item } = await getListing();
53
+
54
+ setItem(item);
55
+ setIsLoading(false);
56
+ })();
57
+ }, []);
58
+
59
+ return (
60
+ <ItemCard
61
+ isLoading={isLoading}
62
+ item={{
63
+ key: String(item?.id),
64
+ title: item?.title,
65
+ description: item?.description,
66
+ image: { src: item?.image || "", alt: item?.title || "" },
67
+ }}
68
+ />
69
+ );
70
+ },
71
+ };
72
+
73
+ export const WithHorizontalLoading: Story = {
74
+ args: {
75
+ orientation: "horizontal",
76
+ },
77
+ render: (args: ItemCardProps) => {
78
+ const [item, setItem] = useState<MockItemType | null | undefined>(null);
79
+ const [isLoading, setIsLoading] = useState(true);
80
+
81
+ useEffect(() => {
82
+ (async () => {
83
+ const { item } = await getListing();
84
+
85
+ setItem(item);
86
+ setIsLoading(false);
87
+ })();
88
+ }, []);
89
+
90
+ return (
91
+ <ItemCard
92
+ {...args}
93
+ isLoading={isLoading}
94
+ item={{
95
+ key: String(item?.id),
96
+ title: item?.title,
97
+ description: item?.description,
98
+ image: { src: item?.image || "", alt: item?.title || "" },
99
+ }}
100
+ />
101
+ );
102
+ },
103
+ };
104
+
105
+ export const WithDropdownActions: Story = {
106
+ args: {
107
+ item: {
108
+ key: String(MOCK_LISTINGS[0]?.id),
109
+ title: MOCK_LISTINGS[0]?.title,
110
+ description: MOCK_LISTINGS[0]?.description,
111
+ image: {
112
+ src: MOCK_LISTINGS[0]?.image || "",
113
+ alt: MOCK_LISTINGS[0]?.title || "",
114
+ },
115
+ },
116
+ actions: ITEM_CARD_ACTIONS,
117
+ },
118
+ };
119
+
120
+ export const WithButtonsActions: Story = {
121
+ args: {
122
+ item: {
123
+ key: String(MOCK_LISTINGS[0]?.id),
124
+ title: MOCK_LISTINGS[0]?.title,
125
+ description: MOCK_LISTINGS[0]?.description,
126
+ image: {
127
+ src: MOCK_LISTINGS[0]?.image || "",
128
+ alt: MOCK_LISTINGS[0]?.title || "",
129
+ },
130
+ },
131
+ actions: ITEM_CARD_ACTIONS,
132
+ actionsViewVariant: "buttons",
133
+ },
134
+ };
135
+
136
+ export const WithHoverOverlayActions: Story = {
137
+ args: {
138
+ item: {
139
+ key: String(MOCK_LISTINGS[0]?.id),
140
+ title: MOCK_LISTINGS[0]?.title,
141
+ description: MOCK_LISTINGS[0]?.description,
142
+ image: {
143
+ src: MOCK_LISTINGS[0]?.image || "",
144
+ alt: MOCK_LISTINGS[0]?.title || "",
145
+ },
146
+ },
147
+ actions: ITEM_CARD_ACTIONS?.map((action) => ({
148
+ ...action,
149
+ variant: "solid",
150
+ size: "lg",
151
+ })),
152
+ actionsViewVariant: "hover-overlay",
153
+ },
154
+ };
155
+
156
+ export const WithChips: Story = {
157
+ args: {
158
+ item: {
159
+ key: String(MOCK_LISTINGS[2]?.id),
160
+ title: MOCK_LISTINGS[2]?.title,
161
+ description: MOCK_LISTINGS[2]?.description,
162
+ image: {
163
+ src: MOCK_LISTINGS[2]?.image || "",
164
+ alt: MOCK_LISTINGS[2]?.title || "",
165
+ },
166
+ chips: MOCK_LISTINGS[2]?.categories,
167
+ },
168
+ },
169
+ };
170
+
171
+ export const WithBanner: Story = {
172
+ args: {
173
+ item: {
174
+ key: String(MOCK_LISTINGS[0]?.id),
175
+ title: MOCK_LISTINGS[0]?.title,
176
+ description: MOCK_LISTINGS[0]?.description,
177
+ image: {
178
+ src: MOCK_LISTINGS[0]?.image || "",
179
+ alt: MOCK_LISTINGS[0]?.title || "",
180
+ },
181
+ banner: MOCK_LISTINGS[0]?.isBestSeller ? "Best Seller" : undefined,
182
+ },
183
+ },
184
+ };
185
+
186
+ export const WithPrice: Story = {
187
+ args: {
188
+ item: {
189
+ key: String(MOCK_LISTINGS[0]?.id),
190
+ title: MOCK_LISTINGS[0]?.title,
191
+ description: MOCK_LISTINGS[0]?.description,
192
+ price: `$ ${MOCK_LISTINGS[0]?.price}`,
193
+ image: {
194
+ src: MOCK_LISTINGS[0]?.image || "",
195
+ alt: MOCK_LISTINGS[0]?.title || "",
196
+ },
197
+ },
198
+ },
199
+ };
200
+
201
+ export const Horizontal: Story = {
202
+ args: {
203
+ orientation: "horizontal",
204
+ actions: ITEM_CARD_ACTIONS,
205
+ item: {
206
+ key: String(MOCK_LISTINGS[0]?.id),
207
+ title: MOCK_LISTINGS[0]?.title,
208
+ description: MOCK_LISTINGS[0]?.description,
209
+ image: {
210
+ src: MOCK_LISTINGS[0]?.image || "",
211
+ alt: MOCK_LISTINGS[0]?.title || "",
212
+ },
213
+ banner: MOCK_LISTINGS[0]?.isBestSeller ? "Best Seller" : undefined,
214
+ chips: MOCK_LISTINGS[0]?.categories,
215
+ price: `$ ${MOCK_LISTINGS[0]?.price}`,
216
+ },
217
+ },
218
+ };