@js-empire/emperor-ui 1.3.5 → 1.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (318) hide show
  1. package/dist/emperor-ui.js +60624 -157
  2. package/dist/emperor-ui.umd.cjs +17 -17
  3. package/dist/index.d.ts +3 -0
  4. package/package.json +7 -3
  5. package/.cursor/rules/code-conventions.mdc +0 -50
  6. package/.husky/pre-commit +0 -4
  7. package/.prettierrc +0 -10
  8. package/.storybook/main.ts +0 -24
  9. package/.storybook/preview.ts +0 -19
  10. package/.storybook/vitest.setup.ts +0 -7
  11. package/.vscode/extensions.json +0 -1
  12. package/dist/index-31cOfB5-.js +0 -290
  13. package/dist/index-BwRbIPvN.js +0 -60566
  14. package/dist/index-DOyt37_Z.js +0 -5
  15. package/dist/src-UW24ZMRV-DMRqgyf4.js +0 -5
  16. package/eslint.config.js +0 -34
  17. package/index.html +0 -13
  18. package/public/icons/emperor-ui-logo.ico +0 -0
  19. package/public/images/avatar-female.jpg +0 -0
  20. package/public/images/avatar-male.jpg +0 -0
  21. package/public/images/emperor-ui-logo.png +0 -0
  22. package/src/animations/blink.ts +0 -26
  23. package/src/animations/floating.ts +0 -12
  24. package/src/animations/index.ts +0 -2
  25. package/src/components/atoms/brand/brand.stories.tsx +0 -27
  26. package/src/components/atoms/brand/brand.tsx +0 -56
  27. package/src/components/atoms/brand/index.ts +0 -1
  28. package/src/components/atoms/brand/styles/classes.ts +0 -9
  29. package/src/components/atoms/brand/styles/index.ts +0 -2
  30. package/src/components/atoms/brand/styles/styles.ts +0 -0
  31. package/src/components/atoms/color-picker/color-picker.tsx +0 -12
  32. package/src/components/atoms/color-picker/free-color-picker.tsx +0 -58
  33. package/src/components/atoms/color-picker/index.ts +0 -3
  34. package/src/components/atoms/color-picker/preset-color-picker.tsx +0 -66
  35. package/src/components/atoms/color-picker/stories/color-picker.stories.tsx +0 -63
  36. package/src/components/atoms/column/column.stories.tsx +0 -37
  37. package/src/components/atoms/column/column.tsx +0 -21
  38. package/src/components/atoms/column/index.ts +0 -1
  39. package/src/components/atoms/container/column.stories.tsx +0 -37
  40. package/src/components/atoms/container/container.tsx +0 -28
  41. package/src/components/atoms/container/index.ts +0 -1
  42. package/src/components/atoms/copy-button/copy-button.tsx +0 -73
  43. package/src/components/atoms/copy-button/index.ts +0 -1
  44. package/src/components/atoms/copy-button/stories/copy-button.stories.tsx +0 -21
  45. package/src/components/atoms/field/field.tsx +0 -81
  46. package/src/components/atoms/field/index.ts +0 -3
  47. package/src/components/atoms/field/styles/classes.ts +0 -9
  48. package/src/components/atoms/field/styles/index.ts +0 -1
  49. package/src/components/atoms/field/units/autocomplete-field.tsx +0 -49
  50. package/src/components/atoms/field/units/checkbox-field.tsx +0 -35
  51. package/src/components/atoms/field/units/index.ts +0 -7
  52. package/src/components/atoms/field/units/input-field.tsx +0 -35
  53. package/src/components/atoms/field/units/radio-field.tsx +0 -43
  54. package/src/components/atoms/field/units/select-field.tsx +0 -50
  55. package/src/components/atoms/field/units/switch-field.tsx +0 -35
  56. package/src/components/atoms/field/units/textarea-field.tsx +0 -37
  57. package/src/components/atoms/filter/filter.tsx +0 -93
  58. package/src/components/atoms/filter/index.ts +0 -3
  59. package/src/components/atoms/filter/stories/filter.stories.tsx +0 -238
  60. package/src/components/atoms/filter/styles/classes.ts +0 -20
  61. package/src/components/atoms/filter/styles/index.ts +0 -1
  62. package/src/components/atoms/filter/units/autocomplete-filter.tsx +0 -66
  63. package/src/components/atoms/filter/units/checkbox-filter.tsx +0 -42
  64. package/src/components/atoms/filter/units/checkbox-group-filter.tsx +0 -68
  65. package/src/components/atoms/filter/units/date-filter.tsx +0 -46
  66. package/src/components/atoms/filter/units/index.ts +0 -9
  67. package/src/components/atoms/filter/units/numeric-filter.tsx +0 -41
  68. package/src/components/atoms/filter/units/range-filter.tsx +0 -65
  69. package/src/components/atoms/filter/units/search-filter.tsx +0 -53
  70. package/src/components/atoms/filter/units/select-filter.tsx +0 -57
  71. package/src/components/atoms/filter/units/switch-filter.tsx +0 -35
  72. package/src/components/atoms/index.ts +0 -11
  73. package/src/components/atoms/portal/index.ts +0 -1
  74. package/src/components/atoms/portal/portal.stories.tsx +0 -43
  75. package/src/components/atoms/portal/portal.tsx +0 -25
  76. package/src/components/atoms/row/index.ts +0 -1
  77. package/src/components/atoms/row/row.stories.tsx +0 -37
  78. package/src/components/atoms/row/row.tsx +0 -26
  79. package/src/components/atoms/theme-switch/index.ts +0 -1
  80. package/src/components/atoms/theme-switch/styles/classes.ts +0 -16
  81. package/src/components/atoms/theme-switch/styles/index.ts +0 -1
  82. package/src/components/atoms/theme-switch/theme-switch.stories.tsx +0 -26
  83. package/src/components/atoms/theme-switch/theme-switch.tsx +0 -54
  84. package/src/components/atoms/uploader/components/avatar-label.tsx +0 -102
  85. package/src/components/atoms/uploader/components/index.ts +0 -8
  86. package/src/components/atoms/uploader/components/upload-file-error-box.tsx +0 -40
  87. package/src/components/atoms/uploader/components/upload-file-input.tsx +0 -36
  88. package/src/components/atoms/uploader/components/upload-file-label.tsx +0 -92
  89. package/src/components/atoms/uploader/components/upload-file-listing.tsx +0 -64
  90. package/src/components/atoms/uploader/components/uploader-title.tsx +0 -21
  91. package/src/components/atoms/uploader/components/uploader.tsx +0 -58
  92. package/src/components/atoms/uploader/components/view-image-modal.tsx +0 -41
  93. package/src/components/atoms/uploader/index.ts +0 -1
  94. package/src/components/atoms/uploader/stories/uploader.stories.tsx +0 -201
  95. package/src/components/index.ts +0 -4
  96. package/src/components/molecules/index.ts +0 -4
  97. package/src/components/molecules/item-card/components/actions/index.ts +0 -3
  98. package/src/components/molecules/item-card/components/actions/item-actions-buttons.tsx +0 -43
  99. package/src/components/molecules/item-card/components/actions/item-actions-dropdown.tsx +0 -57
  100. package/src/components/molecules/item-card/components/actions/item-actions-overlay.tsx +0 -50
  101. package/src/components/molecules/item-card/components/additions/index.ts +0 -2
  102. package/src/components/molecules/item-card/components/additions/item-banner.tsx +0 -22
  103. package/src/components/molecules/item-card/components/additions/loading-item.tsx +0 -88
  104. package/src/components/molecules/item-card/components/card/index.ts +0 -4
  105. package/src/components/molecules/item-card/components/card/item-card-body.tsx +0 -74
  106. package/src/components/molecules/item-card/components/card/item-card-footer.tsx +0 -79
  107. package/src/components/molecules/item-card/components/card/item-card-header.tsx +0 -69
  108. package/src/components/molecules/item-card/components/card/item-card.tsx +0 -123
  109. package/src/components/molecules/item-card/components/index.ts +0 -3
  110. package/src/components/molecules/item-card/index.ts +0 -2
  111. package/src/components/molecules/item-card/stories/item-card.stories.tsx +0 -218
  112. package/src/components/molecules/item-card/styles/classes.ts +0 -141
  113. package/src/components/molecules/item-card/styles/index.ts +0 -1
  114. package/src/components/molecules/nav-bar/index.ts +0 -3
  115. package/src/components/molecules/nav-bar/nav-bar-item.tsx +0 -64
  116. package/src/components/molecules/nav-bar/nav-bar.tsx +0 -57
  117. package/src/components/molecules/nav-bar/stories/hover-effect/nav-bar-hover-effect.stories.tsx +0 -52
  118. package/src/components/molecules/nav-bar/stories/nav-bar.stories.tsx +0 -50
  119. package/src/components/molecules/nav-bar/styles/classes.ts +0 -68
  120. package/src/components/molecules/nav-bar/styles/index.ts +0 -2
  121. package/src/components/molecules/nav-bar/styles/styles.ts +0 -85
  122. package/src/components/molecules/nav-bar/sub-items-box.tsx +0 -58
  123. package/src/components/molecules/scaffold/index.ts +0 -2
  124. package/src/components/molecules/scaffold/scaffold.stories.tsx +0 -21
  125. package/src/components/molecules/scaffold/scaffold.tsx +0 -23
  126. package/src/components/molecules/scaffold/styles/index.ts +0 -1
  127. package/src/components/molecules/scaffold/styles/scaffold-classes.ts +0 -10
  128. package/src/components/molecules/side-bar/compact-side-bar.tsx +0 -77
  129. package/src/components/molecules/side-bar/index.ts +0 -1
  130. package/src/components/molecules/side-bar/side-bar-drawer.tsx +0 -113
  131. package/src/components/molecules/side-bar/side-bar.stories.tsx +0 -111
  132. package/src/components/molecules/side-bar/side-bar.tsx +0 -31
  133. package/src/components/molecules/side-bar/styles/classes.ts +0 -28
  134. package/src/components/molecules/side-bar/styles/index.ts +0 -2
  135. package/src/components/molecules/side-bar/styles/styles.ts +0 -13
  136. package/src/components/organisms/deletion-confirmor/deletion-confirmor.tsx +0 -110
  137. package/src/components/organisms/deletion-confirmor/index.ts +0 -3
  138. package/src/components/organisms/deletion-confirmor/stories/components.tsx +0 -25
  139. package/src/components/organisms/deletion-confirmor/stories/deletion-confirmor.stories.tsx +0 -78
  140. package/src/components/organisms/deletion-confirmor/styles/classes.ts +0 -28
  141. package/src/components/organisms/deletion-confirmor/styles/index.ts +0 -2
  142. package/src/components/organisms/deletion-confirmor/styles/styles.ts +0 -4
  143. package/src/components/organisms/footer/copy-rights-box.tsx +0 -27
  144. package/src/components/organisms/footer/footer.tsx +0 -75
  145. package/src/components/organisms/footer/index.ts +0 -5
  146. package/src/components/organisms/footer/policies-box.tsx +0 -27
  147. package/src/components/organisms/footer/quick-links-box.tsx +0 -46
  148. package/src/components/organisms/footer/social-links-box.tsx +0 -33
  149. package/src/components/organisms/footer/stories/footer.stories.tsx +0 -61
  150. package/src/components/organisms/footer/styles/classes.ts +0 -71
  151. package/src/components/organisms/footer/styles/index.ts +0 -2
  152. package/src/components/organisms/footer/styles/styles.ts +0 -6
  153. package/src/components/organisms/form-builder/form-builder.stories.tsx +0 -144
  154. package/src/components/organisms/form-builder/form-builder.tsx +0 -75
  155. package/src/components/organisms/form-builder/index.ts +0 -1
  156. package/src/components/organisms/header/header.tsx +0 -87
  157. package/src/components/organisms/header/index.ts +0 -1
  158. package/src/components/organisms/header/segmented-header-content.tsx +0 -29
  159. package/src/components/organisms/header/stories/header.stories.tsx +0 -144
  160. package/src/components/organisms/header/styles/classes.ts +0 -22
  161. package/src/components/organisms/header/styles/index.ts +0 -2
  162. package/src/components/organisms/header/styles/styles.ts +0 -39
  163. package/src/components/organisms/index.ts +0 -6
  164. package/src/components/organisms/item-details/index.ts +0 -1
  165. package/src/components/organisms/item-details/item-details.tsx +0 -6
  166. package/src/components/organisms/listings/empty-listings.tsx +0 -80
  167. package/src/components/organisms/listings/index.ts +0 -3
  168. package/src/components/organisms/listings/listings.tsx +0 -96
  169. package/src/components/organisms/listings/stories/grid-listings.stories.tsx +0 -153
  170. package/src/components/organisms/listings/stories/list-listings.stories.tsx +0 -171
  171. package/src/components/organisms/listings/styles/classes.ts +0 -49
  172. package/src/components/organisms/listings/styles/index.ts +0 -2
  173. package/src/components/organisms/listings/styles/styles.ts +0 -6
  174. package/src/components/templates/index.ts +0 -1
  175. package/src/components/templates/landing-page/index.ts +0 -1
  176. package/src/components/templates/landing-page/landing-page.stories.tsx +0 -21
  177. package/src/components/templates/landing-page/landing-page.tsx +0 -57
  178. package/src/components/templates/landing-page/styles/classes.ts +0 -11
  179. package/src/components/templates/landing-page/styles/index.ts +0 -1
  180. package/src/constants/animations.ts +0 -14
  181. package/src/constants/card.tsx +0 -42
  182. package/src/constants/defaults.ts +0 -59
  183. package/src/constants/fake.ts +0 -5
  184. package/src/constants/footer.tsx +0 -157
  185. package/src/constants/index.ts +0 -6
  186. package/src/constants/uploader.ts +0 -27
  187. package/src/context/emperor-ui-context.ts +0 -6
  188. package/src/context/form-builder-context.tsx +0 -8
  189. package/src/context/index.ts +0 -4
  190. package/src/context/navigation-context.ts +0 -6
  191. package/src/context/uploader-context.ts +0 -6
  192. package/src/enums/index.ts +0 -2
  193. package/src/enums/placeholders.ts +0 -4
  194. package/src/enums/preserved-keys.ts +0 -3
  195. package/src/examples/index.ts +0 -1
  196. package/src/hooks/index.ts +0 -8
  197. package/src/hooks/use-emperor-ui.ts +0 -12
  198. package/src/hooks/use-filters.ts +0 -20
  199. package/src/hooks/use-form-builder-context.ts +0 -16
  200. package/src/hooks/use-navigation.ts +0 -12
  201. package/src/hooks/use-search-params-handler.tsx +0 -186
  202. package/src/hooks/use-uploader-context.ts +0 -14
  203. package/src/hooks/use-uploader.tsx +0 -164
  204. package/src/hooks/use-window-size.tsx +0 -53
  205. package/src/i18n/configs/i18n.ts +0 -7
  206. package/src/i18n/configs/index.ts +0 -1
  207. package/src/i18n/constants/index.ts +0 -1
  208. package/src/i18n/constants/locales.ts +0 -4
  209. package/src/i18n/index.ts +0 -5
  210. package/src/i18n/locales/ar.ts +0 -15
  211. package/src/i18n/locales/atoms/ar.ts +0 -18
  212. package/src/i18n/locales/atoms/en.ts +0 -18
  213. package/src/i18n/locales/atoms/index.ts +0 -2
  214. package/src/i18n/locales/common/ar.ts +0 -1
  215. package/src/i18n/locales/common/en.ts +0 -1
  216. package/src/i18n/locales/common/index.ts +0 -2
  217. package/src/i18n/locales/en.ts +0 -15
  218. package/src/i18n/locales/index.ts +0 -4
  219. package/src/i18n/locales/molecules/ar.ts +0 -1
  220. package/src/i18n/locales/molecules/en.ts +0 -1
  221. package/src/i18n/locales/molecules/index.ts +0 -2
  222. package/src/i18n/locales/organisms/ar.ts +0 -11
  223. package/src/i18n/locales/organisms/en.ts +0 -11
  224. package/src/i18n/locales/organisms/index.ts +0 -2
  225. package/src/i18n/locales/templates/ar.ts +0 -1
  226. package/src/i18n/locales/templates/en.ts +0 -1
  227. package/src/i18n/locales/templates/index.ts +0 -2
  228. package/src/i18n/locales/toasts/ar.ts +0 -1
  229. package/src/i18n/locales/toasts/en.ts +0 -1
  230. package/src/i18n/locales/toasts/index.ts +0 -2
  231. package/src/i18n/types/index.ts +0 -2
  232. package/src/i18n/types/locale.ts +0 -5
  233. package/src/i18n/types/toasts.ts +0 -3
  234. package/src/i18n/utils/get-locales.ts +0 -4
  235. package/src/i18n/utils/index.ts +0 -2
  236. package/src/i18n/utils/localize.ts +0 -15
  237. package/src/index.ts +0 -12
  238. package/src/mocks/constants.ts +0 -103
  239. package/src/mocks/deletion-confirmor.ts +0 -16
  240. package/src/mocks/header.tsx +0 -118
  241. package/src/mocks/index.ts +0 -6
  242. package/src/mocks/listings.tsx +0 -154
  243. package/src/mocks/locales/index.ts +0 -1
  244. package/src/mocks/locales/uploader.ts +0 -33
  245. package/src/mocks/types.ts +0 -64
  246. package/src/providers/config-provider.tsx +0 -72
  247. package/src/providers/emperor-ui-provider.tsx +0 -35
  248. package/src/providers/form-builder-provider-context.tsx +0 -18
  249. package/src/providers/index.ts +0 -6
  250. package/src/providers/navigation-provider.tsx +0 -42
  251. package/src/providers/theme-provider.tsx +0 -16
  252. package/src/providers/uploader-provider.tsx +0 -53
  253. package/src/styles/globals.css +0 -38
  254. package/src/styles/hero.ts +0 -3
  255. package/src/styles/index.css +0 -18
  256. package/src/types/components/atoms/brand.ts +0 -13
  257. package/src/types/components/atoms/color-picker/color-picker.ts +0 -21
  258. package/src/types/components/atoms/color-picker/index.ts +0 -1
  259. package/src/types/components/atoms/column.ts +0 -3
  260. package/src/types/components/atoms/container.ts +0 -3
  261. package/src/types/components/atoms/field/field.ts +0 -61
  262. package/src/types/components/atoms/field/index.ts +0 -1
  263. package/src/types/components/atoms/filter/filter.ts +0 -52
  264. package/src/types/components/atoms/filter/index.ts +0 -2
  265. package/src/types/components/atoms/filter/select-filter.ts +0 -8
  266. package/src/types/components/atoms/index.ts +0 -9
  267. package/src/types/components/atoms/portal.ts +0 -6
  268. package/src/types/components/atoms/row.ts +0 -3
  269. package/src/types/components/atoms/uploader.ts +0 -102
  270. package/src/types/components/index.ts +0 -4
  271. package/src/types/components/molecules/footer/footer.ts +0 -68
  272. package/src/types/components/molecules/footer/index.ts +0 -1
  273. package/src/types/components/molecules/header/header.ts +0 -51
  274. package/src/types/components/molecules/header/index.ts +0 -1
  275. package/src/types/components/molecules/index.ts +0 -9
  276. package/src/types/components/molecules/item-card/index.ts +0 -1
  277. package/src/types/components/molecules/item-card/item-card.ts +0 -69
  278. package/src/types/components/molecules/item-details/index.ts +0 -1
  279. package/src/types/components/molecules/item-details/item-details.ts +0 -9
  280. package/src/types/components/molecules/listings/index.ts +0 -1
  281. package/src/types/components/molecules/listings/listings.ts +0 -29
  282. package/src/types/components/molecules/nav-bar/index.ts +0 -1
  283. package/src/types/components/molecules/nav-bar/nav-bar.ts +0 -66
  284. package/src/types/components/molecules/scaffold/index.ts +0 -1
  285. package/src/types/components/molecules/scaffold/scaffold.ts +0 -9
  286. package/src/types/components/molecules/side-bar/index.ts +0 -1
  287. package/src/types/components/molecules/side-bar/side-bar.ts +0 -40
  288. package/src/types/components/molecules/theme-switch/index.ts +0 -1
  289. package/src/types/components/molecules/theme-switch/theme-switch.ts +0 -9
  290. package/src/types/components/organisms/deletion-confirmor/deletion-confirmor.ts +0 -22
  291. package/src/types/components/organisms/deletion-confirmor/index.ts +0 -1
  292. package/src/types/components/organisms/filters/filters.ts +0 -11
  293. package/src/types/components/organisms/filters/index.ts +0 -1
  294. package/src/types/components/organisms/form-builder/context.ts +0 -6
  295. package/src/types/components/organisms/form-builder/form-builder.ts +0 -39
  296. package/src/types/components/organisms/form-builder/index.ts +0 -2
  297. package/src/types/components/organisms/index.ts +0 -3
  298. package/src/types/components/templates/index.ts +0 -1
  299. package/src/types/components/templates/landing-page.ts +0 -10
  300. package/src/types/context/config.ts +0 -24
  301. package/src/types/context/index.ts +0 -4
  302. package/src/types/context/localization.ts +0 -24
  303. package/src/types/context/navigation.ts +0 -17
  304. package/src/types/context/theme.ts +0 -33
  305. package/src/types/index.ts +0 -3
  306. package/src/types/shared/components.ts +0 -13
  307. package/src/types/shared/index.ts +0 -1
  308. package/src/utils/cn.ts +0 -6
  309. package/src/utils/compress-images.ts +0 -36
  310. package/src/utils/index.ts +0 -5
  311. package/src/utils/locales.ts +0 -54
  312. package/src/utils/storybook.tsx +0 -15
  313. package/src/utils/uploader.ts +0 -167
  314. package/tsconfig.app.json +0 -37
  315. package/tsconfig.json +0 -7
  316. package/tsconfig.node.json +0 -25
  317. package/vite.config.ts +0 -44
  318. package/vitest.shims.d.ts +0 -1
@@ -1,5 +0,0 @@
1
- import { d as a } from "./index-BwRbIPvN.js";
2
- var o = a;
3
- export {
4
- o as default
5
- };
@@ -1,5 +0,0 @@
1
- import { d as a } from "./index-BwRbIPvN.js";
2
- var r = a;
3
- export {
4
- r as default
5
- };
package/eslint.config.js DELETED
@@ -1,34 +0,0 @@
1
- // For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
2
- import storybook from "eslint-plugin-storybook";
3
-
4
- import js from "@eslint/js";
5
- import globals from "globals";
6
- import reactHooks from "eslint-plugin-react-hooks";
7
- import reactRefresh from "eslint-plugin-react-refresh";
8
- import tseslint from "typescript-eslint";
9
- import { defineConfig, globalIgnores } from "eslint/config";
10
-
11
- export default defineConfig([
12
- globalIgnores(["dist"]),
13
- js.configs.recommended,
14
- ...tseslint.configs.recommended,
15
- reactHooks.configs.flat.recommended,
16
- reactRefresh.configs.vite,
17
- ...storybook.configs["flat/recommended"],
18
- {
19
- files: ["**/*.{ts,tsx}"],
20
- languageOptions: {
21
- ecmaVersion: 2020,
22
- globals: globals.browser,
23
- },
24
- rules: {
25
- "react-refresh/only-export-components": [
26
- "warn",
27
- { allowConstantExport: true },
28
- ],
29
- "@typescript-eslint/no-unused-vars": "off",
30
- "@typescript-eslint/ban-types": "off",
31
- "@typescript-eslint/no-explicit-any": "off",
32
- },
33
- },
34
- ]);
package/index.html DELETED
@@ -1,13 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>emperor-ui</title>
8
- </head>
9
- <body>
10
- <div id="root"></div>
11
- <script type="module" src="/src/main.tsx"></script>
12
- </body>
13
- </html>
Binary file
Binary file
Binary file
Binary file
@@ -1,26 +0,0 @@
1
- import { Variants } from "framer-motion";
2
-
3
- /**
4
- * ? In order to work, the parent container must have the blinkContainer variants
5
- * ? and each of the children must have the blinkItem variants
6
- */
7
-
8
- export const blinkContainer: Variants = {
9
- hidden: { opacity: 0 },
10
- visible: {
11
- opacity: 1,
12
- transition: {
13
- staggerChildren: 0.12,
14
- delayChildren: 0.08,
15
- },
16
- },
17
- };
18
-
19
- export const blinkItem: Variants = {
20
- hidden: { opacity: 0, y: 16 },
21
- visible: {
22
- opacity: 1,
23
- y: 0,
24
- transition: { duration: 0.4, ease: "easeOut" },
25
- },
26
- };
@@ -1,12 +0,0 @@
1
- import { Variants } from "framer-motion";
2
-
3
- export const floating: Variants = {
4
- animate: {
5
- y: [0, -6, 0],
6
- transition: {
7
- duration: 3,
8
- repeat: Infinity,
9
- ease: "easeInOut",
10
- },
11
- },
12
- };
@@ -1,2 +0,0 @@
1
- export * from "./floating";
2
- export * from "./blink";
@@ -1,27 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react-vite";
2
- import { Brand } from "@/components";
3
- import { getStorybookDecorators } from "@/utils";
4
-
5
- const meta: Meta<typeof Brand> = {
6
- title: "Atoms/Brand",
7
- component: Brand,
8
- parameters: {
9
- layout: "centered",
10
- },
11
- tags: ["autodocs"],
12
- decorators: getStorybookDecorators({
13
- config: {
14
- layout: {
15
- withScaffold: false,
16
- },
17
- },
18
- }),
19
- };
20
-
21
- export default meta;
22
-
23
- type Story = StoryObj<typeof meta>;
24
-
25
- export const Default: Story = {
26
- args: {},
27
- };
@@ -1,56 +0,0 @@
1
- import type { BrandProps } from "@/types";
2
- import { cn } from "@/utils";
3
- import { VariantProps } from "class-variance-authority";
4
- import { ComponentProps, forwardRef } from "react";
5
- import { Row } from "@/components";
6
- import { brandStyles } from "./styles";
7
- import { Image } from "@heroui/image";
8
-
9
- export const Brand = forwardRef<
10
- HTMLElement,
11
- ComponentProps<"div"> & VariantProps<typeof brandStyles> & BrandProps
12
- >(
13
- (
14
- {
15
- className,
16
- variant,
17
- src = "/images/emperor-ui-logo.png",
18
- alt = "Emperor UI",
19
- name = "Emperor UI",
20
- isIconOnly = false,
21
- classNames,
22
- ...props
23
- },
24
- ref,
25
- ) => {
26
- return (
27
- <Row
28
- ref={ref}
29
- data-slot="emperor-brand"
30
- className={cn(
31
- brandStyles({ variant, className: cn(className, classNames?.base) }),
32
- )}
33
- {...props}
34
- >
35
- {src && (
36
- <Image
37
- data-slot="emperor-brand-logo"
38
- src={src}
39
- alt={alt}
40
- radius="md"
41
- className={cn("min-w-7 min-h-7 size-7", classNames?.logo)}
42
- />
43
- )}
44
-
45
- {name && !isIconOnly && (
46
- <p
47
- data-slot="emperor-brand-name"
48
- className={cn("font-semibold text-lg", classNames?.name)}
49
- >
50
- {name}
51
- </p>
52
- )}
53
- </Row>
54
- );
55
- },
56
- );
@@ -1 +0,0 @@
1
- export * from "./brand";
@@ -1,9 +0,0 @@
1
- import { cva } from "class-variance-authority";
2
-
3
- export const brandStyles = cva([""], {
4
- variants: {
5
- variant: {},
6
- },
7
- defaultVariants: {},
8
- compoundVariants: [],
9
- });
@@ -1,2 +0,0 @@
1
- export * from "./classes";
2
- export * from "./styles";
File without changes
@@ -1,12 +0,0 @@
1
- "use client";
2
-
3
- import type { ColorPickerProps } from "@/types";
4
- import { FreeColorPicker, PresetColorPicker } from "@/components";
5
-
6
- export function ColorPicker({ ...props }: ColorPickerProps) {
7
- if (props?.inputType === "preset") {
8
- return <PresetColorPicker {...props} />;
9
- }
10
-
11
- return <FreeColorPicker {...props} />;
12
- }
@@ -1,58 +0,0 @@
1
- "use client";
2
-
3
- import { useMemo } from "react";
4
- import { Input } from "@heroui/input";
5
- import { cn } from "@/utils";
6
- import type { ColorPickerProps } from "@/types";
7
- import { CopyButton } from "@/components";
8
- import { useEmperorUI } from "@/hooks";
9
-
10
- export function FreeColorPicker({
11
- className,
12
- classNames,
13
- value = "#000000",
14
- onChange,
15
- defaultValue,
16
- inputType = "free",
17
- ...props
18
- }: ColorPickerProps) {
19
- const { config } = useEmperorUI();
20
-
21
- const locales = config?.interLocalization?.locales;
22
- const lang = config?.interLocalization?.lang;
23
- const locale = locales?.[lang ?? "en"];
24
- const errorMessage = locale?.atoms?.colorPicker?.invalidColorFormat;
25
-
26
- const isInvalid = useMemo(() => {
27
- if (!value) return true;
28
- const HEX_COLOR_REGEX = /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;
29
-
30
- return !HEX_COLOR_REGEX.test(value);
31
- }, [value]);
32
-
33
- return (
34
- <Input
35
- labelPlacement="outside"
36
- variant="faded"
37
- className={cn(className)}
38
- classNames={{ label: "font-bold", input: "h-12", ...classNames }}
39
- defaultValue={defaultValue}
40
- value={value}
41
- onValueChange={onChange}
42
- isInvalid={isInvalid}
43
- errorMessage={isInvalid ? errorMessage : undefined}
44
- endContent={<CopyButton value={value} />}
45
- startContent={
46
- <input
47
- type="color"
48
- className="color-swatch"
49
- value={value}
50
- onChange={(e) => {
51
- onChange?.(e.target.value as string);
52
- }}
53
- />
54
- }
55
- {...props}
56
- />
57
- );
58
- }
@@ -1,3 +0,0 @@
1
- export * from "./color-picker";
2
- export * from "./free-color-picker";
3
- export * from "./preset-color-picker";
@@ -1,66 +0,0 @@
1
- "use client";
2
-
3
- import { cn } from "@/utils";
4
- import type { ColorPickerProps } from "@/types";
5
- import { Select, SelectItem } from "@heroui/select";
6
- import { CopyButton } from "@/components";
7
-
8
- export function PresetColorPicker({
9
- className,
10
- classNames,
11
- value = "#000000",
12
- onChange,
13
- defaultValue,
14
- inputType,
15
- presets = [],
16
- ...props
17
- }: ColorPickerProps) {
18
- if (inputType === "preset" && (!presets || presets?.length === 0))
19
- throw new Error(
20
- "Presets array is required in the ColorPicker when the input type is 'preset'.",
21
- );
22
-
23
- return (
24
- <Select
25
- labelPlacement="outside"
26
- variant="faded"
27
- className={cn(className)}
28
- classNames={{
29
- label: "font-bold",
30
- input: "h-12",
31
- trigger: "min-w-52",
32
- ...classNames,
33
- }}
34
- selectedKeys={value ? [value] : undefined}
35
- defaultSelectedKeys={defaultValue ? [defaultValue] : undefined}
36
- onSelectionChange={(value) => onChange?.(value?.currentKey ?? "")}
37
- endContent={<CopyButton value={value} />}
38
- renderValue={() => {
39
- return (
40
- <div className="flex items-center gap-2 text-gray-600">
41
- <div
42
- style={{ backgroundColor: value }}
43
- className="size-4 rounded-full border border-gray-300"
44
- />
45
- {value}
46
- </div>
47
- );
48
- }}
49
- {...props}
50
- >
51
- {Array.from(new Set(presets))?.map((preset) => (
52
- <SelectItem
53
- key={preset}
54
- startContent={
55
- <div
56
- style={{ backgroundColor: preset }}
57
- className="size-4 rounded-full border border-gray-300"
58
- />
59
- }
60
- >
61
- {preset}
62
- </SelectItem>
63
- ))}
64
- </Select>
65
- );
66
- }
@@ -1,63 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react-vite";
2
- import { ColorPicker } from "@/components";
3
- import { useState } from "react";
4
- import { getStorybookDecorators } from "@/utils";
5
-
6
- const meta: Meta<typeof ColorPicker> = {
7
- title: "Atoms/ColorPicker",
8
- component: ColorPicker,
9
- parameters: {
10
- layout: "centered",
11
- },
12
- tags: ["autodocs"],
13
- decorators: getStorybookDecorators({
14
- config: {
15
- layout: {
16
- withScaffold: false,
17
- },
18
- },
19
- }),
20
- };
21
-
22
- export default meta;
23
-
24
- type Story = StoryObj<typeof meta>;
25
-
26
- export const Default: Story = {
27
- render: () => {
28
- const [value, setValue] = useState("#000000");
29
-
30
- return (
31
- <section className="flex flex-col gap-4">
32
- <ColorPicker
33
- inputType="free"
34
- value={value}
35
- onChange={setValue}
36
- defaultValue="#000000"
37
- />
38
-
39
- <p className="text-xs text-gray-500">Value: {value}</p>
40
- </section>
41
- );
42
- },
43
- };
44
-
45
- export const WithPresets: Story = {
46
- render: () => {
47
- const [value, setValue] = useState("#000000");
48
-
49
- return (
50
- <section className="flex flex-col gap-4">
51
- <ColorPicker
52
- inputType="preset"
53
- presets={["#000000", "#FFFFFF", "#FF0000", "#00FF00", "#0000FF"]}
54
- value={value}
55
- onChange={setValue}
56
- defaultValue="#000000"
57
- />
58
-
59
- <p className="text-xs text-gray-500">Value: {value}</p>
60
- </section>
61
- );
62
- },
63
- };
@@ -1,37 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react-vite";
2
- import { Column } from "@/components";
3
- import type { ColumnProps } from "@/types";
4
- import { getStorybookDecorators } from "@/utils";
5
-
6
- const meta: Meta<typeof Column> = {
7
- title: "Atoms/Column",
8
- component: Column,
9
- parameters: {
10
- layout: "centered",
11
- },
12
- tags: ["autodocs"],
13
- decorators: getStorybookDecorators({
14
- config: {
15
- layout: {
16
- withScaffold: false,
17
- },
18
- },
19
- }),
20
- };
21
-
22
- export default meta;
23
-
24
- type Story = StoryObj<typeof meta>;
25
-
26
- export const Default: Story = {
27
- args: {},
28
- render: (args: ColumnProps) => (
29
- <Column {...args}>
30
- {Array.from({ length: 5 }).map((_, index) => (
31
- <div key={index} className="bg-blue-300 p-2 rounded-md">
32
- Item {index + 1}
33
- </div>
34
- ))}
35
- </Column>
36
- ),
37
- };
@@ -1,21 +0,0 @@
1
- import type { ColumnProps } from "@/types";
2
- import { cn } from "@/utils";
3
- import { cva, VariantProps } from "class-variance-authority";
4
- import { forwardRef, ComponentProps } from "react";
5
-
6
- const columnStyles = cva(["flex flex-col gap-3"], {
7
- variants: {},
8
- defaultVariants: {},
9
- compoundVariants: [],
10
- });
11
-
12
- export const Column = forwardRef<
13
- HTMLElement,
14
- ComponentProps<"section"> & VariantProps<typeof columnStyles> & ColumnProps
15
- >(({ className, children, ...props }, ref) => {
16
- return (
17
- <section ref={ref} className={cn(columnStyles({ className }))} {...props}>
18
- {children}
19
- </section>
20
- );
21
- });
@@ -1 +0,0 @@
1
- export * from "./column";
@@ -1,37 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react-vite";
2
- import { Container } from "@/components";
3
- import { getStorybookDecorators } from "@/utils";
4
- import type { ContainerProps } from "@/types";
5
-
6
- const meta: Meta<typeof Container> = {
7
- title: "Atoms/Container",
8
- component: Container,
9
- parameters: {
10
- layout: "fullscreen",
11
- },
12
- tags: ["autodocs"],
13
- decorators: getStorybookDecorators({
14
- config: {
15
- layout: {
16
- withScaffold: false,
17
- },
18
- },
19
- }),
20
- };
21
-
22
- export default meta;
23
-
24
- type Story = StoryObj<typeof meta>;
25
-
26
- export const Default: Story = {
27
- args: {
28
- className: "h-screen flex items-center justify-center",
29
- },
30
- render: (args: ContainerProps) => (
31
- <Container {...args}>
32
- <div className="bg-blue-300 p-2 text-center rounded-md w-full h-fit">
33
- Responsive contained content
34
- </div>
35
- </Container>
36
- ),
37
- };
@@ -1,28 +0,0 @@
1
- import type { ContainerProps } from "@/types";
2
- import { cn } from "@/utils";
3
- import { cva, VariantProps } from "class-variance-authority";
4
- import { forwardRef, ComponentProps } from "react";
5
-
6
- const containerStyles = cva(["flex w-full container p-4 mx-auto"], {
7
- variants: {},
8
- defaultVariants: {},
9
- compoundVariants: [],
10
- });
11
-
12
- export const Container = forwardRef<
13
- HTMLElement,
14
- ComponentProps<"section"> &
15
- VariantProps<typeof containerStyles> &
16
- ContainerProps
17
- >(({ className, children, ...props }, ref) => {
18
- return (
19
- <section
20
- ref={ref}
21
- data-slot="container"
22
- className={cn(containerStyles({ className }))}
23
- {...props}
24
- >
25
- {children}
26
- </section>
27
- );
28
- });
@@ -1 +0,0 @@
1
- export * from "./container";
@@ -1,73 +0,0 @@
1
- "use client";
2
-
3
- import { useState, useRef, useEffect } from "react";
4
- import { Button } from "@heroui/button";
5
- import { Spinner } from "@heroui/spinner";
6
- import { Copy, Check } from "lucide-react";
7
- import { motion, AnimatePresence } from "framer-motion";
8
-
9
- type CopyState = "copy" | "loading" | "success";
10
-
11
- export function CopyButton({ value }: { value: string }) {
12
- const [state, setState] = useState<CopyState>("copy");
13
- const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
14
-
15
- const handleCopy = () => {
16
- if (state !== "copy") return;
17
-
18
- if (timeoutRef.current) clearTimeout(timeoutRef.current);
19
-
20
- navigator.clipboard.writeText(value);
21
- setState("loading");
22
-
23
- timeoutRef.current = setTimeout(() => {
24
- setState("success");
25
- timeoutRef.current = setTimeout(() => setState("copy"), 2000);
26
- }, 500);
27
- };
28
-
29
- useEffect(
30
- () => () => {
31
- if (timeoutRef.current) clearTimeout(timeoutRef.current);
32
- },
33
- [],
34
- );
35
-
36
- return (
37
- <Button
38
- variant="light"
39
- size="sm"
40
- isIconOnly
41
- onPress={handleCopy}
42
- disabled={state !== "copy"}
43
- startContent={
44
- <span className="relative size-4">
45
- <AnimatePresence mode="wait">
46
- <motion.span
47
- key={state}
48
- initial={{ opacity: 0 }}
49
- animate={{ opacity: 1 }}
50
- exit={{ opacity: 0 }}
51
- transition={{ duration: 0.2 }}
52
- className="absolute inset-0 flex items-center justify-center"
53
- >
54
- {state === "copy" && <Copy className="size-4" />}
55
-
56
- {state === "loading" && (
57
- <Spinner
58
- size="sm"
59
- classNames={{
60
- circle1: "border-b-current",
61
- circle2: "border-current",
62
- }}
63
- />
64
- )}
65
-
66
- {state === "success" && <Check className="size-4 text-success" />}
67
- </motion.span>
68
- </AnimatePresence>
69
- </span>
70
- }
71
- />
72
- );
73
- }
@@ -1 +0,0 @@
1
- export * from "./copy-button";
@@ -1,21 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react-vite";
2
- import { CopyButton } from "@/components";
3
-
4
- const meta: Meta<typeof CopyButton> = {
5
- title: "Atoms/CopyButton",
6
- component: CopyButton,
7
- parameters: {
8
- layout: "centered",
9
- },
10
- tags: ["autodocs"],
11
- };
12
-
13
- export default meta;
14
-
15
- type Story = StoryObj<typeof meta>;
16
-
17
- export const Default: Story = {
18
- args: {
19
- value: "Copied to clipboard successfully!",
20
- },
21
- };