@js-empire/emperor-ui 1.3.5 → 1.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (318) hide show
  1. package/dist/emperor-ui.js +60624 -157
  2. package/dist/emperor-ui.umd.cjs +17 -17
  3. package/dist/index.d.ts +3 -0
  4. package/package.json +7 -3
  5. package/.cursor/rules/code-conventions.mdc +0 -50
  6. package/.husky/pre-commit +0 -4
  7. package/.prettierrc +0 -10
  8. package/.storybook/main.ts +0 -24
  9. package/.storybook/preview.ts +0 -19
  10. package/.storybook/vitest.setup.ts +0 -7
  11. package/.vscode/extensions.json +0 -1
  12. package/dist/index-31cOfB5-.js +0 -290
  13. package/dist/index-BwRbIPvN.js +0 -60566
  14. package/dist/index-DOyt37_Z.js +0 -5
  15. package/dist/src-UW24ZMRV-DMRqgyf4.js +0 -5
  16. package/eslint.config.js +0 -34
  17. package/index.html +0 -13
  18. package/public/icons/emperor-ui-logo.ico +0 -0
  19. package/public/images/avatar-female.jpg +0 -0
  20. package/public/images/avatar-male.jpg +0 -0
  21. package/public/images/emperor-ui-logo.png +0 -0
  22. package/src/animations/blink.ts +0 -26
  23. package/src/animations/floating.ts +0 -12
  24. package/src/animations/index.ts +0 -2
  25. package/src/components/atoms/brand/brand.stories.tsx +0 -27
  26. package/src/components/atoms/brand/brand.tsx +0 -56
  27. package/src/components/atoms/brand/index.ts +0 -1
  28. package/src/components/atoms/brand/styles/classes.ts +0 -9
  29. package/src/components/atoms/brand/styles/index.ts +0 -2
  30. package/src/components/atoms/brand/styles/styles.ts +0 -0
  31. package/src/components/atoms/color-picker/color-picker.tsx +0 -12
  32. package/src/components/atoms/color-picker/free-color-picker.tsx +0 -58
  33. package/src/components/atoms/color-picker/index.ts +0 -3
  34. package/src/components/atoms/color-picker/preset-color-picker.tsx +0 -66
  35. package/src/components/atoms/color-picker/stories/color-picker.stories.tsx +0 -63
  36. package/src/components/atoms/column/column.stories.tsx +0 -37
  37. package/src/components/atoms/column/column.tsx +0 -21
  38. package/src/components/atoms/column/index.ts +0 -1
  39. package/src/components/atoms/container/column.stories.tsx +0 -37
  40. package/src/components/atoms/container/container.tsx +0 -28
  41. package/src/components/atoms/container/index.ts +0 -1
  42. package/src/components/atoms/copy-button/copy-button.tsx +0 -73
  43. package/src/components/atoms/copy-button/index.ts +0 -1
  44. package/src/components/atoms/copy-button/stories/copy-button.stories.tsx +0 -21
  45. package/src/components/atoms/field/field.tsx +0 -81
  46. package/src/components/atoms/field/index.ts +0 -3
  47. package/src/components/atoms/field/styles/classes.ts +0 -9
  48. package/src/components/atoms/field/styles/index.ts +0 -1
  49. package/src/components/atoms/field/units/autocomplete-field.tsx +0 -49
  50. package/src/components/atoms/field/units/checkbox-field.tsx +0 -35
  51. package/src/components/atoms/field/units/index.ts +0 -7
  52. package/src/components/atoms/field/units/input-field.tsx +0 -35
  53. package/src/components/atoms/field/units/radio-field.tsx +0 -43
  54. package/src/components/atoms/field/units/select-field.tsx +0 -50
  55. package/src/components/atoms/field/units/switch-field.tsx +0 -35
  56. package/src/components/atoms/field/units/textarea-field.tsx +0 -37
  57. package/src/components/atoms/filter/filter.tsx +0 -93
  58. package/src/components/atoms/filter/index.ts +0 -3
  59. package/src/components/atoms/filter/stories/filter.stories.tsx +0 -238
  60. package/src/components/atoms/filter/styles/classes.ts +0 -20
  61. package/src/components/atoms/filter/styles/index.ts +0 -1
  62. package/src/components/atoms/filter/units/autocomplete-filter.tsx +0 -66
  63. package/src/components/atoms/filter/units/checkbox-filter.tsx +0 -42
  64. package/src/components/atoms/filter/units/checkbox-group-filter.tsx +0 -68
  65. package/src/components/atoms/filter/units/date-filter.tsx +0 -46
  66. package/src/components/atoms/filter/units/index.ts +0 -9
  67. package/src/components/atoms/filter/units/numeric-filter.tsx +0 -41
  68. package/src/components/atoms/filter/units/range-filter.tsx +0 -65
  69. package/src/components/atoms/filter/units/search-filter.tsx +0 -53
  70. package/src/components/atoms/filter/units/select-filter.tsx +0 -57
  71. package/src/components/atoms/filter/units/switch-filter.tsx +0 -35
  72. package/src/components/atoms/index.ts +0 -11
  73. package/src/components/atoms/portal/index.ts +0 -1
  74. package/src/components/atoms/portal/portal.stories.tsx +0 -43
  75. package/src/components/atoms/portal/portal.tsx +0 -25
  76. package/src/components/atoms/row/index.ts +0 -1
  77. package/src/components/atoms/row/row.stories.tsx +0 -37
  78. package/src/components/atoms/row/row.tsx +0 -26
  79. package/src/components/atoms/theme-switch/index.ts +0 -1
  80. package/src/components/atoms/theme-switch/styles/classes.ts +0 -16
  81. package/src/components/atoms/theme-switch/styles/index.ts +0 -1
  82. package/src/components/atoms/theme-switch/theme-switch.stories.tsx +0 -26
  83. package/src/components/atoms/theme-switch/theme-switch.tsx +0 -54
  84. package/src/components/atoms/uploader/components/avatar-label.tsx +0 -102
  85. package/src/components/atoms/uploader/components/index.ts +0 -8
  86. package/src/components/atoms/uploader/components/upload-file-error-box.tsx +0 -40
  87. package/src/components/atoms/uploader/components/upload-file-input.tsx +0 -36
  88. package/src/components/atoms/uploader/components/upload-file-label.tsx +0 -92
  89. package/src/components/atoms/uploader/components/upload-file-listing.tsx +0 -64
  90. package/src/components/atoms/uploader/components/uploader-title.tsx +0 -21
  91. package/src/components/atoms/uploader/components/uploader.tsx +0 -58
  92. package/src/components/atoms/uploader/components/view-image-modal.tsx +0 -41
  93. package/src/components/atoms/uploader/index.ts +0 -1
  94. package/src/components/atoms/uploader/stories/uploader.stories.tsx +0 -201
  95. package/src/components/index.ts +0 -4
  96. package/src/components/molecules/index.ts +0 -4
  97. package/src/components/molecules/item-card/components/actions/index.ts +0 -3
  98. package/src/components/molecules/item-card/components/actions/item-actions-buttons.tsx +0 -43
  99. package/src/components/molecules/item-card/components/actions/item-actions-dropdown.tsx +0 -57
  100. package/src/components/molecules/item-card/components/actions/item-actions-overlay.tsx +0 -50
  101. package/src/components/molecules/item-card/components/additions/index.ts +0 -2
  102. package/src/components/molecules/item-card/components/additions/item-banner.tsx +0 -22
  103. package/src/components/molecules/item-card/components/additions/loading-item.tsx +0 -88
  104. package/src/components/molecules/item-card/components/card/index.ts +0 -4
  105. package/src/components/molecules/item-card/components/card/item-card-body.tsx +0 -74
  106. package/src/components/molecules/item-card/components/card/item-card-footer.tsx +0 -79
  107. package/src/components/molecules/item-card/components/card/item-card-header.tsx +0 -69
  108. package/src/components/molecules/item-card/components/card/item-card.tsx +0 -123
  109. package/src/components/molecules/item-card/components/index.ts +0 -3
  110. package/src/components/molecules/item-card/index.ts +0 -2
  111. package/src/components/molecules/item-card/stories/item-card.stories.tsx +0 -218
  112. package/src/components/molecules/item-card/styles/classes.ts +0 -141
  113. package/src/components/molecules/item-card/styles/index.ts +0 -1
  114. package/src/components/molecules/nav-bar/index.ts +0 -3
  115. package/src/components/molecules/nav-bar/nav-bar-item.tsx +0 -64
  116. package/src/components/molecules/nav-bar/nav-bar.tsx +0 -57
  117. package/src/components/molecules/nav-bar/stories/hover-effect/nav-bar-hover-effect.stories.tsx +0 -52
  118. package/src/components/molecules/nav-bar/stories/nav-bar.stories.tsx +0 -50
  119. package/src/components/molecules/nav-bar/styles/classes.ts +0 -68
  120. package/src/components/molecules/nav-bar/styles/index.ts +0 -2
  121. package/src/components/molecules/nav-bar/styles/styles.ts +0 -85
  122. package/src/components/molecules/nav-bar/sub-items-box.tsx +0 -58
  123. package/src/components/molecules/scaffold/index.ts +0 -2
  124. package/src/components/molecules/scaffold/scaffold.stories.tsx +0 -21
  125. package/src/components/molecules/scaffold/scaffold.tsx +0 -23
  126. package/src/components/molecules/scaffold/styles/index.ts +0 -1
  127. package/src/components/molecules/scaffold/styles/scaffold-classes.ts +0 -10
  128. package/src/components/molecules/side-bar/compact-side-bar.tsx +0 -77
  129. package/src/components/molecules/side-bar/index.ts +0 -1
  130. package/src/components/molecules/side-bar/side-bar-drawer.tsx +0 -113
  131. package/src/components/molecules/side-bar/side-bar.stories.tsx +0 -111
  132. package/src/components/molecules/side-bar/side-bar.tsx +0 -31
  133. package/src/components/molecules/side-bar/styles/classes.ts +0 -28
  134. package/src/components/molecules/side-bar/styles/index.ts +0 -2
  135. package/src/components/molecules/side-bar/styles/styles.ts +0 -13
  136. package/src/components/organisms/deletion-confirmor/deletion-confirmor.tsx +0 -110
  137. package/src/components/organisms/deletion-confirmor/index.ts +0 -3
  138. package/src/components/organisms/deletion-confirmor/stories/components.tsx +0 -25
  139. package/src/components/organisms/deletion-confirmor/stories/deletion-confirmor.stories.tsx +0 -78
  140. package/src/components/organisms/deletion-confirmor/styles/classes.ts +0 -28
  141. package/src/components/organisms/deletion-confirmor/styles/index.ts +0 -2
  142. package/src/components/organisms/deletion-confirmor/styles/styles.ts +0 -4
  143. package/src/components/organisms/footer/copy-rights-box.tsx +0 -27
  144. package/src/components/organisms/footer/footer.tsx +0 -75
  145. package/src/components/organisms/footer/index.ts +0 -5
  146. package/src/components/organisms/footer/policies-box.tsx +0 -27
  147. package/src/components/organisms/footer/quick-links-box.tsx +0 -46
  148. package/src/components/organisms/footer/social-links-box.tsx +0 -33
  149. package/src/components/organisms/footer/stories/footer.stories.tsx +0 -61
  150. package/src/components/organisms/footer/styles/classes.ts +0 -71
  151. package/src/components/organisms/footer/styles/index.ts +0 -2
  152. package/src/components/organisms/footer/styles/styles.ts +0 -6
  153. package/src/components/organisms/form-builder/form-builder.stories.tsx +0 -144
  154. package/src/components/organisms/form-builder/form-builder.tsx +0 -75
  155. package/src/components/organisms/form-builder/index.ts +0 -1
  156. package/src/components/organisms/header/header.tsx +0 -87
  157. package/src/components/organisms/header/index.ts +0 -1
  158. package/src/components/organisms/header/segmented-header-content.tsx +0 -29
  159. package/src/components/organisms/header/stories/header.stories.tsx +0 -144
  160. package/src/components/organisms/header/styles/classes.ts +0 -22
  161. package/src/components/organisms/header/styles/index.ts +0 -2
  162. package/src/components/organisms/header/styles/styles.ts +0 -39
  163. package/src/components/organisms/index.ts +0 -6
  164. package/src/components/organisms/item-details/index.ts +0 -1
  165. package/src/components/organisms/item-details/item-details.tsx +0 -6
  166. package/src/components/organisms/listings/empty-listings.tsx +0 -80
  167. package/src/components/organisms/listings/index.ts +0 -3
  168. package/src/components/organisms/listings/listings.tsx +0 -96
  169. package/src/components/organisms/listings/stories/grid-listings.stories.tsx +0 -153
  170. package/src/components/organisms/listings/stories/list-listings.stories.tsx +0 -171
  171. package/src/components/organisms/listings/styles/classes.ts +0 -49
  172. package/src/components/organisms/listings/styles/index.ts +0 -2
  173. package/src/components/organisms/listings/styles/styles.ts +0 -6
  174. package/src/components/templates/index.ts +0 -1
  175. package/src/components/templates/landing-page/index.ts +0 -1
  176. package/src/components/templates/landing-page/landing-page.stories.tsx +0 -21
  177. package/src/components/templates/landing-page/landing-page.tsx +0 -57
  178. package/src/components/templates/landing-page/styles/classes.ts +0 -11
  179. package/src/components/templates/landing-page/styles/index.ts +0 -1
  180. package/src/constants/animations.ts +0 -14
  181. package/src/constants/card.tsx +0 -42
  182. package/src/constants/defaults.ts +0 -59
  183. package/src/constants/fake.ts +0 -5
  184. package/src/constants/footer.tsx +0 -157
  185. package/src/constants/index.ts +0 -6
  186. package/src/constants/uploader.ts +0 -27
  187. package/src/context/emperor-ui-context.ts +0 -6
  188. package/src/context/form-builder-context.tsx +0 -8
  189. package/src/context/index.ts +0 -4
  190. package/src/context/navigation-context.ts +0 -6
  191. package/src/context/uploader-context.ts +0 -6
  192. package/src/enums/index.ts +0 -2
  193. package/src/enums/placeholders.ts +0 -4
  194. package/src/enums/preserved-keys.ts +0 -3
  195. package/src/examples/index.ts +0 -1
  196. package/src/hooks/index.ts +0 -8
  197. package/src/hooks/use-emperor-ui.ts +0 -12
  198. package/src/hooks/use-filters.ts +0 -20
  199. package/src/hooks/use-form-builder-context.ts +0 -16
  200. package/src/hooks/use-navigation.ts +0 -12
  201. package/src/hooks/use-search-params-handler.tsx +0 -186
  202. package/src/hooks/use-uploader-context.ts +0 -14
  203. package/src/hooks/use-uploader.tsx +0 -164
  204. package/src/hooks/use-window-size.tsx +0 -53
  205. package/src/i18n/configs/i18n.ts +0 -7
  206. package/src/i18n/configs/index.ts +0 -1
  207. package/src/i18n/constants/index.ts +0 -1
  208. package/src/i18n/constants/locales.ts +0 -4
  209. package/src/i18n/index.ts +0 -5
  210. package/src/i18n/locales/ar.ts +0 -15
  211. package/src/i18n/locales/atoms/ar.ts +0 -18
  212. package/src/i18n/locales/atoms/en.ts +0 -18
  213. package/src/i18n/locales/atoms/index.ts +0 -2
  214. package/src/i18n/locales/common/ar.ts +0 -1
  215. package/src/i18n/locales/common/en.ts +0 -1
  216. package/src/i18n/locales/common/index.ts +0 -2
  217. package/src/i18n/locales/en.ts +0 -15
  218. package/src/i18n/locales/index.ts +0 -4
  219. package/src/i18n/locales/molecules/ar.ts +0 -1
  220. package/src/i18n/locales/molecules/en.ts +0 -1
  221. package/src/i18n/locales/molecules/index.ts +0 -2
  222. package/src/i18n/locales/organisms/ar.ts +0 -11
  223. package/src/i18n/locales/organisms/en.ts +0 -11
  224. package/src/i18n/locales/organisms/index.ts +0 -2
  225. package/src/i18n/locales/templates/ar.ts +0 -1
  226. package/src/i18n/locales/templates/en.ts +0 -1
  227. package/src/i18n/locales/templates/index.ts +0 -2
  228. package/src/i18n/locales/toasts/ar.ts +0 -1
  229. package/src/i18n/locales/toasts/en.ts +0 -1
  230. package/src/i18n/locales/toasts/index.ts +0 -2
  231. package/src/i18n/types/index.ts +0 -2
  232. package/src/i18n/types/locale.ts +0 -5
  233. package/src/i18n/types/toasts.ts +0 -3
  234. package/src/i18n/utils/get-locales.ts +0 -4
  235. package/src/i18n/utils/index.ts +0 -2
  236. package/src/i18n/utils/localize.ts +0 -15
  237. package/src/index.ts +0 -12
  238. package/src/mocks/constants.ts +0 -103
  239. package/src/mocks/deletion-confirmor.ts +0 -16
  240. package/src/mocks/header.tsx +0 -118
  241. package/src/mocks/index.ts +0 -6
  242. package/src/mocks/listings.tsx +0 -154
  243. package/src/mocks/locales/index.ts +0 -1
  244. package/src/mocks/locales/uploader.ts +0 -33
  245. package/src/mocks/types.ts +0 -64
  246. package/src/providers/config-provider.tsx +0 -72
  247. package/src/providers/emperor-ui-provider.tsx +0 -35
  248. package/src/providers/form-builder-provider-context.tsx +0 -18
  249. package/src/providers/index.ts +0 -6
  250. package/src/providers/navigation-provider.tsx +0 -42
  251. package/src/providers/theme-provider.tsx +0 -16
  252. package/src/providers/uploader-provider.tsx +0 -53
  253. package/src/styles/globals.css +0 -38
  254. package/src/styles/hero.ts +0 -3
  255. package/src/styles/index.css +0 -18
  256. package/src/types/components/atoms/brand.ts +0 -13
  257. package/src/types/components/atoms/color-picker/color-picker.ts +0 -21
  258. package/src/types/components/atoms/color-picker/index.ts +0 -1
  259. package/src/types/components/atoms/column.ts +0 -3
  260. package/src/types/components/atoms/container.ts +0 -3
  261. package/src/types/components/atoms/field/field.ts +0 -61
  262. package/src/types/components/atoms/field/index.ts +0 -1
  263. package/src/types/components/atoms/filter/filter.ts +0 -52
  264. package/src/types/components/atoms/filter/index.ts +0 -2
  265. package/src/types/components/atoms/filter/select-filter.ts +0 -8
  266. package/src/types/components/atoms/index.ts +0 -9
  267. package/src/types/components/atoms/portal.ts +0 -6
  268. package/src/types/components/atoms/row.ts +0 -3
  269. package/src/types/components/atoms/uploader.ts +0 -102
  270. package/src/types/components/index.ts +0 -4
  271. package/src/types/components/molecules/footer/footer.ts +0 -68
  272. package/src/types/components/molecules/footer/index.ts +0 -1
  273. package/src/types/components/molecules/header/header.ts +0 -51
  274. package/src/types/components/molecules/header/index.ts +0 -1
  275. package/src/types/components/molecules/index.ts +0 -9
  276. package/src/types/components/molecules/item-card/index.ts +0 -1
  277. package/src/types/components/molecules/item-card/item-card.ts +0 -69
  278. package/src/types/components/molecules/item-details/index.ts +0 -1
  279. package/src/types/components/molecules/item-details/item-details.ts +0 -9
  280. package/src/types/components/molecules/listings/index.ts +0 -1
  281. package/src/types/components/molecules/listings/listings.ts +0 -29
  282. package/src/types/components/molecules/nav-bar/index.ts +0 -1
  283. package/src/types/components/molecules/nav-bar/nav-bar.ts +0 -66
  284. package/src/types/components/molecules/scaffold/index.ts +0 -1
  285. package/src/types/components/molecules/scaffold/scaffold.ts +0 -9
  286. package/src/types/components/molecules/side-bar/index.ts +0 -1
  287. package/src/types/components/molecules/side-bar/side-bar.ts +0 -40
  288. package/src/types/components/molecules/theme-switch/index.ts +0 -1
  289. package/src/types/components/molecules/theme-switch/theme-switch.ts +0 -9
  290. package/src/types/components/organisms/deletion-confirmor/deletion-confirmor.ts +0 -22
  291. package/src/types/components/organisms/deletion-confirmor/index.ts +0 -1
  292. package/src/types/components/organisms/filters/filters.ts +0 -11
  293. package/src/types/components/organisms/filters/index.ts +0 -1
  294. package/src/types/components/organisms/form-builder/context.ts +0 -6
  295. package/src/types/components/organisms/form-builder/form-builder.ts +0 -39
  296. package/src/types/components/organisms/form-builder/index.ts +0 -2
  297. package/src/types/components/organisms/index.ts +0 -3
  298. package/src/types/components/templates/index.ts +0 -1
  299. package/src/types/components/templates/landing-page.ts +0 -10
  300. package/src/types/context/config.ts +0 -24
  301. package/src/types/context/index.ts +0 -4
  302. package/src/types/context/localization.ts +0 -24
  303. package/src/types/context/navigation.ts +0 -17
  304. package/src/types/context/theme.ts +0 -33
  305. package/src/types/index.ts +0 -3
  306. package/src/types/shared/components.ts +0 -13
  307. package/src/types/shared/index.ts +0 -1
  308. package/src/utils/cn.ts +0 -6
  309. package/src/utils/compress-images.ts +0 -36
  310. package/src/utils/index.ts +0 -5
  311. package/src/utils/locales.ts +0 -54
  312. package/src/utils/storybook.tsx +0 -15
  313. package/src/utils/uploader.ts +0 -167
  314. package/tsconfig.app.json +0 -37
  315. package/tsconfig.json +0 -7
  316. package/tsconfig.node.json +0 -25
  317. package/vite.config.ts +0 -44
  318. package/vitest.shims.d.ts +0 -1
package/dist/index.d.ts CHANGED
@@ -60,6 +60,8 @@ export declare const ALLOWED_IMAGES_TYPES: string[];
60
60
 
61
61
  export declare const ALLOWED_PDF_TYPES: string[];
62
62
 
63
+ export declare const ALLOWED_SHEET_TYPES: string[];
64
+
63
65
  export declare type AppDirection = "ltr" | "rtl";
64
66
 
65
67
  declare const ar: {
@@ -1224,6 +1226,7 @@ export declare type UploaderContextState = {
1224
1226
  fileTypes: FileType[];
1225
1227
  onInputChange: SharedOnInputChangeType;
1226
1228
  handleClearFile: (fileName?: string) => void;
1229
+ setFiles?: Dispatch<SetStateAction<FileObject[]>>;
1227
1230
  modal?: Omit<ModalProps, "children"> & {
1228
1231
  onOpen?: () => void;
1229
1232
  };
package/package.json CHANGED
@@ -1,19 +1,23 @@
1
1
  {
2
2
  "name": "@js-empire/emperor-ui",
3
3
  "description": "They provide the atoms, we provide the empire.",
4
- "version": "1.3.5",
4
+ "version": "1.3.7",
5
5
  "author": "JS Empire - Mustafa Alhasanat",
6
6
  "license": "ISC",
7
7
  "type": "module",
8
- "main": "dist/emperor-ui-umd.cjs",
8
+ "main": "dist/emperor-ui.umd.cjs",
9
9
  "module": "dist/emperor-ui.js",
10
10
  "types": "dist/index.d.ts",
11
+ "files": [
12
+ "dist",
13
+ "README.md"
14
+ ],
11
15
  "keywords": [],
12
16
  "exports": {
13
17
  ".": {
14
18
  "types": "./dist/index.d.ts",
15
19
  "import": "./dist/emperor-ui.js",
16
- "require": "./dist/emperor-ui-umd.cjs"
20
+ "require": "./dist/emperor-ui.umd.cjs"
17
21
  },
18
22
  "./globals.css": "./dist/globals.css"
19
23
  },
@@ -1,50 +0,0 @@
1
- ---
2
- name: code-conventions
3
- description: This rule is for Cursor to follow code conventions we have.
4
- ---
5
-
6
- # Overview
7
-
8
- Whenever you write a code, follow these rules:
9
-
10
- ## Conventions
11
-
12
- Follow all the codebase conventions like how functions and variables are written, where to place everything, ...etc. Follow the SOLID coding principles in all code.
13
-
14
- ## Imports & Exports
15
-
16
- Every module (or directory) should have an "index.ts" file that exports all the files and sub modules inside it using ('export \* from "./file-or-dir-name";'), where every file should export all its functions and variables to be exported. Never use relative imports but rather use the absolute ones for better readability and easier importation.
17
-
18
- ## Utilities
19
-
20
- All types, constants, enums, hooks, utility functions, and configs should be defined in their relative packages or modules. Utility functions should always have a short description (function annotation or documentation) that summarizes what is does and what it needs.
21
-
22
- ## Complexity
23
-
24
- Try to always find the easiest, simplest, and most efficient solution with the least amount of code rather than the most complex one.
25
-
26
- ## File Size
27
-
28
- Every file should never be more than 300 lines of code. Whenever a code exceeds 250 to 300 lines, try to optimize it or split it into multiple files following the codebase conventions.
29
-
30
- ## Single Responsibility
31
-
32
- Each function should only have one purpose and each component file should only exports one component.
33
-
34
- ## Naming
35
-
36
- The exported component must have the same name as its file's name. Follow these rules for naming:
37
-
38
- - Files: kebab-case
39
- - Directories: kebab-case
40
- - Types & Interfaces: PascalCase
41
- - Constants: PascalCase
42
- - Hooks: useCamelCase
43
- - Pages and Layouts' Components: PascalCase
44
- - Enums:
45
- - Enum name: PascalCase
46
- - Enum key: UPPER_SNAKE_CASE
47
-
48
- ## Parameters
49
-
50
- All parameters across the project should be implemented as one object that has the parameters in it so we can modify them easily in the future, like this: `({ param1, param2 = false }:{ param1: string, param2?: boolean })`. Never define them as multiple parameters like this: `(param1: string, param2?: boolean)`. That applies to functions, arrow functions, components, hooks, and anything takes parameters.
package/.husky/pre-commit DELETED
@@ -1,4 +0,0 @@
1
- pnpm run format
2
- git add .
3
- pnpm run lint
4
- pnpm run build
package/.prettierrc DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "semi": true,
3
- "singleQuote": false,
4
- "printWidth": 80,
5
- "tabWidth": 2,
6
- "useTabs": false,
7
- "endOfLine": "lf",
8
- "bracketSpacing": true,
9
- "trailingComma": "all"
10
- }
@@ -1,24 +0,0 @@
1
- import type { StorybookConfig } from "@storybook/react-vite";
2
- import path from "path";
3
- import tsconfigPaths from "vite-tsconfig-paths";
4
-
5
- const config: StorybookConfig = {
6
- stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
7
- addons: [],
8
- framework: {
9
- name: "@storybook/react-vite",
10
- options: {},
11
- },
12
- viteFinal: async (config) => {
13
- config.plugins?.push(
14
- /** @see https://github.com/aleclarson/vite-tsconfig-paths */
15
- tsconfigPaths({
16
- projects: [path.resolve("..", "tsconfig.json")],
17
- }),
18
- );
19
-
20
- return config;
21
- },
22
- };
23
-
24
- export default config;
@@ -1,19 +0,0 @@
1
- import type { Preview } from "@storybook/react-vite";
2
- import "../src/styles/globals.css";
3
-
4
- const preview: Preview = {
5
- parameters: {
6
- controls: {
7
- matchers: {
8
- color: /(background|color)$/i,
9
- date: /Date$/i,
10
- },
11
- },
12
-
13
- a11y: {
14
- test: "todo",
15
- },
16
- },
17
- };
18
-
19
- export default preview;
@@ -1,7 +0,0 @@
1
- import * as a11yAddonAnnotations from "@storybook/addon-a11y/preview";
2
- import { setProjectAnnotations } from "@storybook/react-vite";
3
- import * as projectAnnotations from "./preview";
4
-
5
- // This is an important step to apply the right configuration when testing your stories.
6
- // More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations
7
- setProjectAnnotations([a11yAddonAnnotations, projectAnnotations]);
@@ -1 +0,0 @@
1
- {}
@@ -1,290 +0,0 @@
1
- import { l as a, a as s, d as e } from "./index-BwRbIPvN.js";
2
- import { A as n, b as c, D as l, c as d, e as m, F as u, f as b, H as p, g, J as x, K as V, L as f, h as T, M as y, i as D, j as A, k as S, m as v, N as P, n as E, o as M, P as h, p as C, q as B, S as O, r as I, s as G, V as L, t as N, u as R, v as F, w as k, x as j, y as w, z, B as q, C as K, E as H, G as W, I as U, O as Z, Q as J, R as Q, T as X, U as Y, W as _, X as $, Y as aa, Z as sa, _ as ea, $ as ia, a0 as ta, a1 as oa, a2 as ra, a3 as na, a4 as ca, a5 as la, a6 as da, a7 as ma, a8 as ua, a9 as ba, aa as pa, ab as ga, ac as xa, ad as Va, ae as fa, af as Ta, ag as ya, ah as Da, ai as Aa, aj as Sa, ak as va, al as Pa, am as Ea, an as Ma, ao as ha, ap as Ca, aq as Ba, ar as Oa, as as Ia, at as Ga, au as La, av as Na, aw as Ra, ax as Fa, ay as ka, az as ja, aA as wa, aB as za, aC as qa, aD as Ka, aE as Ha, aF as Wa, aG as Ua, aH as Za, aI as Ja, aJ as Qa, aK as Xa, aL as Ya, aM as _a, aN as $a, aO as as, aP as ss, aQ as es, aR as is, aS as ts, aT as os, aU as rs, aV as ns, aW as cs, aX as ls, aY as ds, aZ as ms, a_ as us, a$ as bs, b0 as ps, b1 as gs, b2 as xs, b3 as Vs, b4 as fs, b5 as Ts, b6 as ys, b7 as Ds, b8 as As, b9 as Ss, ba as vs, bb as Ps, bc as Es, bd as Ms, be as hs, bf as Cs, bg as Bs, bh as Os, bi as Is, bj as Gs, bk as Ls, bl as Ns, bm as Rs, bn as Fs, bo as ks, bp as js, bq as ws, br as zs, bs as qs, bt as Ks, bu as Hs, bv as Ws, bw as Us, bx as Zs, by as Js, bz as Qs, bA as Xs, bB as Ys, bC as _s, bD as $s, bE as ae, bF as se, bG as ee, bH as ie, bI as te, bJ as oe, bK as re, bL as ne, bM as ce, bN as le, bO as de, bP as me, bQ as ue, bR as be, bS as pe, bT as ge, bU as xe, bV as Ve, bW as fe, bX as Te, bY as ye, bZ as De, b_ as Ae, b$ as Se, c0 as ve, c1 as Pe, c2 as Ee, c3 as Me, c4 as he, c5 as Ce, c6 as Be, c7 as Oe, c8 as Ie, c9 as Ge, ca as Le, cb as Ne, cc as Re, cd as Fe, ce as ke, cf as je, cg as we, ch as ze, ci as qe, cj as Ke, ck as He, cl as We, cm as Ue, cn as Ze, co as Je, cp as Qe, cq as Xe, cr as Ye, cs as _e, ct as $e, cu as ai, cv as si, cw as ei, cx as ii, cy as ti, cz as oi, cA as ri, cB as ni, cC as ci, cD as li, cE as di, cF as mi, cG as ui, cH as bi, cI as pi, cJ as gi, cK as xi, cL as Vi, cM as fi, cN as Ti, cO as yi, cP as Di, cQ as Ai, cR as Si, cS as vi, cT as Pi, cU as Ei, cV as Mi, cW as hi, cX as Ci, cY as Bi, cZ as Oi, c_ as Ii, c$ as Gi, d0 as Li, d1 as Ni, d2 as Ri, d3 as Fi, d4 as ki, d5 as ji, d6 as wi, d7 as zi, d8 as qi, d9 as Ki, da as Hi, db as Wi, dc as Ui, dd as Zi, de as Ji, df as Qi, dg as Xi, dh as Yi, di as _i, dj as $i, dk as at, dl as st, dm as et, dn as it, dp as tt, dq as ot, dr as rt, ds as nt, dt as ct, du as lt, dv as dt, dw as mt, dx as ut, dy as bt, dz as pt, dA as gt } from "./index-BwRbIPvN.js";
3
- const t = {
4
- ...e,
5
- ...s,
6
- ...a
7
- };
8
- export {
9
- n as AnimatePresence,
10
- c as AsyncMotionValueAnimation,
11
- l as DOMKeyframesResolver,
12
- d as DOMVisualElement,
13
- m as DocumentProjectionNode,
14
- u as Feature,
15
- b as FlatTree,
16
- p as HTMLProjectionNode,
17
- g as HTMLVisualElement,
18
- x as JSAnimation,
19
- V as KeyframeResolver,
20
- f as LayoutGroupContext,
21
- T as LazyMotion,
22
- y as MotionConfig,
23
- D as MotionConfigContext,
24
- A as MotionContext,
25
- S as MotionGlobalConfig,
26
- v as MotionValue,
27
- P as NativeAnimation,
28
- E as NativeAnimationExtended,
29
- M as NodeStack,
30
- h as PopChild,
31
- C as PresenceChild,
32
- B as PresenceContext,
33
- O as SVGVisualElement,
34
- I as SubscriptionManager,
35
- G as SwitchLayoutGroupContext,
36
- L as VisualElement,
37
- N as acceleratedValues,
38
- R as addDomEvent,
39
- F as addPointerEvent,
40
- k as addPointerInfo,
41
- j as addUniqueItem,
42
- w as addValueToWillChange,
43
- z as alpha,
44
- q as analyseComplexValue,
45
- K as animateMotionValue,
46
- H as animateSingleValue,
47
- W as animateTarget,
48
- U as animateVariant,
49
- Z as animateVisualElement,
50
- J as animations,
51
- Q as anticipate,
52
- X as applyAxisDelta,
53
- Y as applyBoxDelta,
54
- _ as applyGeneratorOptions,
55
- $ as applyPointDelta,
56
- aa as applyTreeDeltas,
57
- sa as aspectRatio,
58
- ea as axisDeltaEquals,
59
- ia as axisEquals,
60
- ta as axisEqualsRounded,
61
- oa as backIn,
62
- ra as backInOut,
63
- na as backOut,
64
- ca as boxEquals,
65
- la as boxEqualsRounded,
66
- da as buildHTMLStyles,
67
- ma as buildProjectionTransform,
68
- ua as buildSVGAttrs,
69
- ba as buildSVGPath,
70
- pa as buildTransform,
71
- ga as calcAxisDelta,
72
- xa as calcBoxDelta,
73
- Va as calcChildStagger,
74
- fa as calcGeneratorDuration,
75
- Ta as calcLength,
76
- ya as calcRelativeAxis,
77
- Da as calcRelativeAxisPosition,
78
- Aa as calcRelativeBox,
79
- Sa as calcRelativePosition,
80
- va as camelCaseAttributes,
81
- Pa as camelToDash,
82
- Ea as cancelFrame,
83
- Ma as checkVariantsDidChange,
84
- ha as circIn,
85
- Ca as circInOut,
86
- Ba as circOut,
87
- Oa as clamp,
88
- Ia as cleanDirtyNodes,
89
- Ga as color,
90
- La as compareByDepth,
91
- Na as complex,
92
- Ra as containsCSSVariable,
93
- Fa as convertBoundingBoxToBox,
94
- ka as convertBoxToBoundingBox,
95
- ja as convertOffsetToTimes,
96
- wa as copyAxisDeltaInto,
97
- za as copyAxisInto,
98
- qa as copyBoxInto,
99
- Ka as correctBorderRadius,
100
- Ha as correctBoxShadow,
101
- Wa as createAnimationState,
102
- Ua as createAxis,
103
- Za as createAxisDelta,
104
- Ja as createBox,
105
- Qa as createDelta,
106
- Xa as createGeneratorEasing,
107
- Ya as createProjectionNode,
108
- _a as createRenderBatcher,
109
- $a as cubicBezier,
110
- as as cubicBezierAsString,
111
- ss as defaultEasing,
112
- es as defaultOffset,
113
- is as defaultTransformValue,
114
- ts as defaultValueTypes,
115
- os as degrees,
116
- rs as delay,
117
- ns as dimensionValueTypes,
118
- cs as distance,
119
- ls as distance2D,
120
- e as domAnimation,
121
- t as domMax,
122
- ds as eachAxis,
123
- ms as easeIn,
124
- us as easeInOut,
125
- bs as easeOut,
126
- ps as easingDefinitionToFunction,
127
- gs as fillOffset,
128
- xs as fillWildcards,
129
- Vs as filterProps,
130
- fs as findDimensionValueType,
131
- Ts as findValueType,
132
- ys as flushKeyframeResolvers,
133
- Ds as frame,
134
- As as frameData,
135
- Ss as frameSteps,
136
- vs as generateLinearEasing,
137
- Ps as getAnimatableNone,
138
- Es as getDefaultTransition,
139
- Ms as getDefaultValueType,
140
- hs as getFeatureDefinitions,
141
- Cs as getFinalKeyframe,
142
- Bs as getMixer,
143
- Os as getOptimisedAppearId,
144
- Is as getValueAsType,
145
- Gs as getValueTransition,
146
- Ls as getVariableValue,
147
- Ns as getVariantContext,
148
- Rs as globalProjectionState,
149
- Fs as has2DTranslate,
150
- ks as hasReducedMotionListener,
151
- js as hasScale,
152
- ws as hasTransform,
153
- zs as hex,
154
- qs as hover,
155
- Ks as hsla,
156
- Hs as hslaToRgba,
157
- Ws as inertia,
158
- Us as initPrefersReducedMotion,
159
- Zs as interpolate,
160
- Js as invariant,
161
- Qs as invisibleValues,
162
- Xs as isAnimationControls,
163
- Ys as isBezierDefinition,
164
- _s as isBrowser,
165
- $s as isCSSVariableName,
166
- ae as isCSSVariableToken,
167
- se as isControllingVariants,
168
- ee as isDeltaZero,
169
- ie as isDragActive,
170
- te as isDragging,
171
- oe as isEasingArray,
172
- re as isElementKeyboardAccessible,
173
- ne as isElementTextInput,
174
- ce as isForcedMotionValue,
175
- le as isGenerator,
176
- de as isHTMLElement,
177
- me as isKeyframesTarget,
178
- ue as isMotionValue,
179
- be as isNear,
180
- pe as isNodeOrChild,
181
- ge as isNumericalString,
182
- xe as isObject,
183
- Ve as isPrimaryPointer,
184
- fe as isSVGElement,
185
- Te as isSVGSVGElement,
186
- ye as isSVGTag,
187
- De as isTransitionDefined,
188
- Ae as isValidMotionProp,
189
- Se as isVariantLabel,
190
- ve as isVariantNode,
191
- Pe as isWillChangeMotionValue,
192
- Ee as isZeroValueString,
193
- Me as keyframes,
194
- he as m,
195
- Ce as makeAnimationInstant,
196
- Be as makeUseVisualState,
197
- Oe as mapEasingToNativeEasing,
198
- Ie as maxGeneratorDuration,
199
- Ge as measurePageBox,
200
- Le as measureViewportBox,
201
- Ne as memo,
202
- Re as microtask,
203
- Fe as millisecondsToSeconds,
204
- ke as mirrorEasing,
205
- je as mix,
206
- we as mixArray,
207
- ze as mixColor,
208
- qe as mixComplex,
209
- Ke as mixImmediate,
210
- He as mixLinearColor,
211
- We as mixNumber,
212
- Ue as mixObject,
213
- Ze as mixValues,
214
- Je as mixVisibility,
215
- Qe as motion,
216
- Xe as motionValue,
217
- Ye as noop,
218
- _e as number,
219
- $e as numberValueTypes,
220
- ai as optimizedAppearDataAttribute,
221
- si as optimizedAppearDataId,
222
- ei as parseCSSVariable,
223
- ii as parseValueFromTransform,
224
- ti as percent,
225
- oi as pipe,
226
- ri as pixelsToPercent,
227
- ni as positionalKeys,
228
- ci as prefersReducedMotion,
229
- li as press,
230
- di as progress,
231
- mi as progressPercentage,
232
- ui as propagateDirtyNodes,
233
- bi as px,
234
- pi as readTransformValue,
235
- gi as removeAxisDelta,
236
- xi as removeAxisTransforms,
237
- Vi as removeBoxTransforms,
238
- fi as removeItem,
239
- Ti as removePointDelta,
240
- yi as renderHTML,
241
- Di as renderSVG,
242
- Ai as resize,
243
- Si as resolveElements,
244
- vi as resolveMotionValue,
245
- Pi as resolveTransition,
246
- Ei as resolveVariant,
247
- Mi as resolveVariantFromProps,
248
- hi as reverseEasing,
249
- Ci as rgbUnit,
250
- Bi as rgba,
251
- Oi as rootProjectionNode,
252
- Ii as scale,
253
- Gi as scaleCorrectors,
254
- Li as scalePoint,
255
- Ni as scrapeHTMLMotionValuesFromProps,
256
- Ri as scrapeSVGMotionValuesFromProps,
257
- Fi as secondsToMilliseconds,
258
- ki as setDragLock,
259
- ji as setFeatureDefinitions,
260
- wi as setStyle,
261
- zi as setTarget,
262
- qi as spring,
263
- Ki as startWaapiAnimation,
264
- Hi as supportedWaapiEasing,
265
- Wi as supportsBrowserAnimation,
266
- Ui as supportsFlags,
267
- Zi as supportsLinearEasing,
268
- Ji as supportsScrollTimeline,
269
- Qi as testValueType,
270
- Xi as time,
271
- Yi as transformAxis,
272
- _i as transformBox,
273
- $i as transformBoxPoints,
274
- at as transformPropOrder,
275
- st as transformProps,
276
- et as transformValueTypes,
277
- it as translateAxis,
278
- tt as updateMotionValuesFromProps,
279
- ot as useComposedRefs,
280
- rt as useIsomorphicLayoutEffect,
281
- nt as usePresence,
282
- ct as variantPriorityOrder,
283
- lt as variantProps,
284
- dt as velocityPerSecond,
285
- mt as vh,
286
- ut as visualElementStore,
287
- bt as vw,
288
- pt as warnOnce,
289
- gt as warning
290
- };