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