@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,75 @@
|
|
|
1
|
+
import type { FooterProps } from "@/types";
|
|
2
|
+
import { cn } from "@/utils";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
import { ComponentProps, forwardRef } from "react";
|
|
5
|
+
import { contentClasses, footerClasses, footerStyles } from "./styles";
|
|
6
|
+
import {
|
|
7
|
+
PoliciesBox,
|
|
8
|
+
QuickLinksBox,
|
|
9
|
+
SocialLinksBox,
|
|
10
|
+
CopyRightsBox,
|
|
11
|
+
} from "@/components";
|
|
12
|
+
import { Divider } from "@heroui/divider";
|
|
13
|
+
|
|
14
|
+
export const Footer = forwardRef<
|
|
15
|
+
HTMLElement,
|
|
16
|
+
ComponentProps<"footer"> & VariantProps<typeof footerClasses> & FooterProps
|
|
17
|
+
>(
|
|
18
|
+
(
|
|
19
|
+
{
|
|
20
|
+
className,
|
|
21
|
+
classNames,
|
|
22
|
+
policies,
|
|
23
|
+
copyRights,
|
|
24
|
+
socialLinks,
|
|
25
|
+
contacts,
|
|
26
|
+
quickLinks,
|
|
27
|
+
variant = "default",
|
|
28
|
+
children,
|
|
29
|
+
...props
|
|
30
|
+
},
|
|
31
|
+
ref,
|
|
32
|
+
) => {
|
|
33
|
+
return (
|
|
34
|
+
<footer
|
|
35
|
+
ref={ref}
|
|
36
|
+
data-slot="emperor-ui-footer"
|
|
37
|
+
className={cn(
|
|
38
|
+
footerClasses({
|
|
39
|
+
variant,
|
|
40
|
+
className: cn(className, classNames?.base),
|
|
41
|
+
}),
|
|
42
|
+
)}
|
|
43
|
+
style={footerStyles({})}
|
|
44
|
+
{...props}
|
|
45
|
+
>
|
|
46
|
+
<div
|
|
47
|
+
data-slot="emperor-footer-content"
|
|
48
|
+
className={cn(
|
|
49
|
+
contentClasses({
|
|
50
|
+
className: cn(className, classNames?.content),
|
|
51
|
+
}),
|
|
52
|
+
)}
|
|
53
|
+
>
|
|
54
|
+
{children}
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<QuickLinksBox quickLinks={quickLinks} classNames={classNames} />
|
|
58
|
+
|
|
59
|
+
<Divider className="col-span-full bg-background/30" />
|
|
60
|
+
|
|
61
|
+
<div
|
|
62
|
+
className={cn(
|
|
63
|
+
"col-span-full flex flex-col gap-4 justify-between items-center w-full",
|
|
64
|
+
"md:flex-row",
|
|
65
|
+
)}
|
|
66
|
+
>
|
|
67
|
+
<SocialLinksBox socialLinks={socialLinks} classNames={classNames} />
|
|
68
|
+
<PoliciesBox policies={policies} classNames={classNames} />
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<CopyRightsBox copyRights={copyRights} classNames={classNames} />
|
|
72
|
+
</footer>
|
|
73
|
+
);
|
|
74
|
+
},
|
|
75
|
+
);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { cn } from "@/utils";
|
|
2
|
+
import { Link } from "@heroui/link";
|
|
3
|
+
import { FooterProps } from "@/types";
|
|
4
|
+
import { policiesClasses } from "./styles";
|
|
5
|
+
|
|
6
|
+
export function PoliciesBox({ policies, classNames }: FooterProps) {
|
|
7
|
+
return (
|
|
8
|
+
<section
|
|
9
|
+
data-slot="emperor-footer-policies"
|
|
10
|
+
className={cn(
|
|
11
|
+
policiesClasses({
|
|
12
|
+
className: cn(classNames?.policiesWrapper),
|
|
13
|
+
}),
|
|
14
|
+
)}
|
|
15
|
+
>
|
|
16
|
+
{policies?.map((policy) => (
|
|
17
|
+
<Link
|
|
18
|
+
key={policy.href}
|
|
19
|
+
href={policy.href}
|
|
20
|
+
className={cn(classNames?.policy)}
|
|
21
|
+
>
|
|
22
|
+
{policy.label}
|
|
23
|
+
</Link>
|
|
24
|
+
))}
|
|
25
|
+
</section>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { cn } from "@/utils";
|
|
2
|
+
import { Link } from "@heroui/link";
|
|
3
|
+
import { FooterProps } from "@/types";
|
|
4
|
+
import { quickLinksClasses } from "./styles";
|
|
5
|
+
|
|
6
|
+
export function QuickLinksBox({ quickLinks, classNames }: FooterProps) {
|
|
7
|
+
return (
|
|
8
|
+
<section
|
|
9
|
+
data-slot="emperor-footer-quick-links"
|
|
10
|
+
className={cn(
|
|
11
|
+
quickLinksClasses({
|
|
12
|
+
className: cn(classNames?.quickLinksWrapper),
|
|
13
|
+
}),
|
|
14
|
+
)}
|
|
15
|
+
>
|
|
16
|
+
{quickLinks?.map(({ links, title }) => (
|
|
17
|
+
<div
|
|
18
|
+
key={title}
|
|
19
|
+
className={cn("flex flex-col gap-4", classNames?.quickLinksItem)}
|
|
20
|
+
>
|
|
21
|
+
<h3
|
|
22
|
+
className={cn("text-lg font-semibold", classNames?.quickLinksTitle)}
|
|
23
|
+
>
|
|
24
|
+
{title}
|
|
25
|
+
</h3>
|
|
26
|
+
|
|
27
|
+
<ul className={cn("flex flex-col gap-2", classNames?.quickLinksList)}>
|
|
28
|
+
{links?.map(({ href, label, isExternal }) => (
|
|
29
|
+
<Link
|
|
30
|
+
key={href}
|
|
31
|
+
href={href}
|
|
32
|
+
target={isExternal ? "_blank" : "_self"}
|
|
33
|
+
className={cn(
|
|
34
|
+
" text-gray-400 hover:text-white transition-all duration-300 ease-in-out",
|
|
35
|
+
classNames?.quickLinksLink,
|
|
36
|
+
)}
|
|
37
|
+
>
|
|
38
|
+
{label}
|
|
39
|
+
</Link>
|
|
40
|
+
))}
|
|
41
|
+
</ul>
|
|
42
|
+
</div>
|
|
43
|
+
))}
|
|
44
|
+
</section>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cn } from "@/utils";
|
|
2
|
+
import { Link } from "@heroui/link";
|
|
3
|
+
import { FooterProps } from "@/types";
|
|
4
|
+
import { socialLinksClasses } from "./styles";
|
|
5
|
+
|
|
6
|
+
export function SocialLinksBox({ socialLinks, classNames }: FooterProps) {
|
|
7
|
+
return (
|
|
8
|
+
<section
|
|
9
|
+
data-slot="emperor-footer-social-links"
|
|
10
|
+
className={cn(
|
|
11
|
+
socialLinksClasses({
|
|
12
|
+
className: cn(classNames?.socialLinksWrapper),
|
|
13
|
+
}),
|
|
14
|
+
)}
|
|
15
|
+
>
|
|
16
|
+
{socialLinks?.map(({ href, icon, label }) => (
|
|
17
|
+
<Link
|
|
18
|
+
key={href}
|
|
19
|
+
href={href}
|
|
20
|
+
className={cn(
|
|
21
|
+
"flex items-center gap-2 text-sm text-gray-400 hover:text-white transition-all duration-300 ease-in-out",
|
|
22
|
+
classNames?.socialLink,
|
|
23
|
+
)}
|
|
24
|
+
target="_blank"
|
|
25
|
+
rel="noopener noreferrer"
|
|
26
|
+
>
|
|
27
|
+
{icon}
|
|
28
|
+
{label}
|
|
29
|
+
</Link>
|
|
30
|
+
))}
|
|
31
|
+
</section>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Brand, Footer } from "@/components";
|
|
3
|
+
import { getStorybookDecorators } from "@/utils";
|
|
4
|
+
import { FooterProps } from "@/types";
|
|
5
|
+
import {
|
|
6
|
+
FAKE_PARAGRAPH,
|
|
7
|
+
FAKE_SENTENCE,
|
|
8
|
+
quickLinks,
|
|
9
|
+
policies,
|
|
10
|
+
copyRights,
|
|
11
|
+
contacts,
|
|
12
|
+
socialLinks,
|
|
13
|
+
} from "@/constants";
|
|
14
|
+
import { Button } from "@heroui/button";
|
|
15
|
+
|
|
16
|
+
const meta: Meta<typeof Footer> = {
|
|
17
|
+
title: "Organisms/Footer",
|
|
18
|
+
component: Footer,
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: "fullscreen",
|
|
21
|
+
},
|
|
22
|
+
tags: ["autodocs"],
|
|
23
|
+
decorators: getStorybookDecorators({}),
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default meta;
|
|
27
|
+
|
|
28
|
+
type Story = StoryObj<typeof meta>;
|
|
29
|
+
|
|
30
|
+
export const Default: Story = {
|
|
31
|
+
args: {
|
|
32
|
+
quickLinks,
|
|
33
|
+
policies,
|
|
34
|
+
copyRights,
|
|
35
|
+
contacts,
|
|
36
|
+
socialLinks,
|
|
37
|
+
},
|
|
38
|
+
render: (args: FooterProps) => {
|
|
39
|
+
return (
|
|
40
|
+
<div className="flex flex-col gap-6">
|
|
41
|
+
<main className="w-full container mx-auto p-5 flex flex-col gap-6">
|
|
42
|
+
<p>{FAKE_PARAGRAPH}</p>
|
|
43
|
+
</main>
|
|
44
|
+
|
|
45
|
+
<Footer
|
|
46
|
+
classNames={{
|
|
47
|
+
content: "p-5 gap-8 items-center md:items-start",
|
|
48
|
+
}}
|
|
49
|
+
{...args}
|
|
50
|
+
>
|
|
51
|
+
<Brand />
|
|
52
|
+
<p className="text-center md:text-left">{FAKE_SENTENCE}</p>
|
|
53
|
+
|
|
54
|
+
<Button color="primary" className="w-fit">
|
|
55
|
+
Join now
|
|
56
|
+
</Button>
|
|
57
|
+
</Footer>
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
},
|
|
61
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
|
|
3
|
+
export const footerClasses = cva(
|
|
4
|
+
[
|
|
5
|
+
"w-full grid md:grid-cols-[1fr_2fr] gap-4 p-5 min-h-80",
|
|
6
|
+
"bg-foreground text-background",
|
|
7
|
+
],
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: [],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
defaultVariants: {},
|
|
15
|
+
compoundVariants: [],
|
|
16
|
+
},
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export const contentClasses = cva(["flex flex-col gap-4"], {
|
|
20
|
+
variants: {},
|
|
21
|
+
defaultVariants: {},
|
|
22
|
+
compoundVariants: [],
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const policiesClasses = cva(
|
|
26
|
+
[
|
|
27
|
+
"col-span-full w-fit flex flex-col items-center gap-4 p-5 text-center",
|
|
28
|
+
"md:flex-row",
|
|
29
|
+
],
|
|
30
|
+
{
|
|
31
|
+
variants: {},
|
|
32
|
+
defaultVariants: {},
|
|
33
|
+
compoundVariants: [],
|
|
34
|
+
},
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
export const socialLinksClasses = cva(
|
|
38
|
+
["w-fit flex p-5 gap-4 items-center flex-wrap"],
|
|
39
|
+
{
|
|
40
|
+
variants: {},
|
|
41
|
+
defaultVariants: {},
|
|
42
|
+
compoundVariants: [],
|
|
43
|
+
},
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
export const copyRightsClasses = cva(
|
|
47
|
+
["col-span-full w-fit flex p-2 mx-auto text-center"],
|
|
48
|
+
{
|
|
49
|
+
variants: {},
|
|
50
|
+
defaultVariants: {},
|
|
51
|
+
compoundVariants: [],
|
|
52
|
+
},
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
export const contactsClasses = cva([""], {
|
|
56
|
+
variants: {},
|
|
57
|
+
defaultVariants: {},
|
|
58
|
+
compoundVariants: [],
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export const quickLinksClasses = cva(
|
|
62
|
+
[
|
|
63
|
+
"grid gap-4 p-5 w-fit mx-auto",
|
|
64
|
+
"sm:w-full sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",
|
|
65
|
+
],
|
|
66
|
+
{
|
|
67
|
+
variants: {},
|
|
68
|
+
defaultVariants: {},
|
|
69
|
+
compoundVariants: [],
|
|
70
|
+
},
|
|
71
|
+
);
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Field, FormBuilder } from "@/components";
|
|
3
|
+
import { getStorybookDecorators } from "@/utils";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
6
|
+
import { useState } from "react";
|
|
7
|
+
|
|
8
|
+
const meta: Meta<typeof FormBuilder> = {
|
|
9
|
+
title: "Organisms/Form Builder",
|
|
10
|
+
component: FormBuilder,
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: "centered",
|
|
13
|
+
},
|
|
14
|
+
tags: ["autodocs"],
|
|
15
|
+
decorators: getStorybookDecorators({
|
|
16
|
+
config: {
|
|
17
|
+
layout: {
|
|
18
|
+
withScaffold: false,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
}),
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default meta;
|
|
25
|
+
|
|
26
|
+
type Story = StoryObj<typeof meta>;
|
|
27
|
+
|
|
28
|
+
const schema = z.object({
|
|
29
|
+
fullName: z.string({ error: "Full name is required" }),
|
|
30
|
+
description: z.string({ error: "Description is required" }),
|
|
31
|
+
status: z.enum(["active", "inactive"], { error: "Status is required" }),
|
|
32
|
+
isActive: z.boolean({ error: "Is active is required" }),
|
|
33
|
+
isAvailable: z.boolean({ error: "Is available is required" }),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
type SchemaValues = z.infer<typeof schema>;
|
|
37
|
+
|
|
38
|
+
export const Default: Story = {
|
|
39
|
+
render: () => {
|
|
40
|
+
const [formValues, setFormValues] = useState<Partial<SchemaValues>>({});
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div className="w-full max-w-2xl flex flex-col gap-5">
|
|
44
|
+
<h3 className="font-bold text-lg">Form Builder</h3>
|
|
45
|
+
|
|
46
|
+
<FormBuilder<typeof schema>
|
|
47
|
+
className="grid grid-cols-2 gap-5 p-4 rounded-md border"
|
|
48
|
+
formProps={{
|
|
49
|
+
mode: "all",
|
|
50
|
+
resolver: zodResolver(schema),
|
|
51
|
+
}}
|
|
52
|
+
onValuesChange={setFormValues}
|
|
53
|
+
onSubmit={() => {
|
|
54
|
+
alert("Form submitted");
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
57
|
+
<Field
|
|
58
|
+
type="input"
|
|
59
|
+
name="fullName"
|
|
60
|
+
inputProps={{
|
|
61
|
+
label: "Full Name",
|
|
62
|
+
placeholder: "Type your name",
|
|
63
|
+
}}
|
|
64
|
+
/>
|
|
65
|
+
|
|
66
|
+
<Field
|
|
67
|
+
type="select"
|
|
68
|
+
name="status"
|
|
69
|
+
options={[
|
|
70
|
+
{ key: "active", label: "Active" },
|
|
71
|
+
{ key: "inactive", label: "Inactive" },
|
|
72
|
+
]}
|
|
73
|
+
selectProps={{
|
|
74
|
+
label: "Status",
|
|
75
|
+
}}
|
|
76
|
+
/>
|
|
77
|
+
|
|
78
|
+
<Field
|
|
79
|
+
type="autocomplete"
|
|
80
|
+
name="tags"
|
|
81
|
+
options={[
|
|
82
|
+
{ key: "tag1", label: "Tag 1" },
|
|
83
|
+
{ key: "tag2", label: "Tag 2" },
|
|
84
|
+
{ key: "tag3", label: "Tag 3" },
|
|
85
|
+
]}
|
|
86
|
+
autocompleteProps={{
|
|
87
|
+
label: "Tags",
|
|
88
|
+
placeholder: "Type your tags",
|
|
89
|
+
}}
|
|
90
|
+
/>
|
|
91
|
+
|
|
92
|
+
<Field type="checkbox" name="isActive">
|
|
93
|
+
Is Active?
|
|
94
|
+
</Field>
|
|
95
|
+
|
|
96
|
+
<Field type="switch" name="isAvailable">
|
|
97
|
+
Is Available?
|
|
98
|
+
</Field>
|
|
99
|
+
|
|
100
|
+
<Field
|
|
101
|
+
type="textarea"
|
|
102
|
+
name="description"
|
|
103
|
+
className="col-span-2"
|
|
104
|
+
textareaProps={{
|
|
105
|
+
label: "Description",
|
|
106
|
+
placeholder: "Type your description",
|
|
107
|
+
}}
|
|
108
|
+
/>
|
|
109
|
+
</FormBuilder>
|
|
110
|
+
|
|
111
|
+
<section className="flex flex-col gap-2 rounded-md border p-4">
|
|
112
|
+
<h3 className="font-bold text-lg">Summary: </h3>
|
|
113
|
+
|
|
114
|
+
<p className="flex items-center gap-2">
|
|
115
|
+
<span className="font-medium">Full Name:</span>
|
|
116
|
+
<span className="text-gray-500">{formValues.fullName ?? "—"}</span>
|
|
117
|
+
</p>
|
|
118
|
+
<p className="flex items-center gap-2">
|
|
119
|
+
<span className="font-medium">Description:</span>
|
|
120
|
+
<span className="text-gray-500">
|
|
121
|
+
{formValues.description ?? "—"}
|
|
122
|
+
</span>
|
|
123
|
+
</p>
|
|
124
|
+
<p className="flex items-center gap-2">
|
|
125
|
+
<span className="font-medium">Status:</span>
|
|
126
|
+
<span className="text-gray-500">{formValues.status ?? "—"}</span>
|
|
127
|
+
</p>
|
|
128
|
+
<p className="flex items-center gap-2">
|
|
129
|
+
<span className="font-medium">Is Active:</span>
|
|
130
|
+
<span className="text-gray-500">
|
|
131
|
+
{formValues.isActive ? "Selected" : "Not Selected"}
|
|
132
|
+
</span>
|
|
133
|
+
</p>
|
|
134
|
+
<p className="flex items-center gap-2">
|
|
135
|
+
<span className="font-medium">Is Available:</span>
|
|
136
|
+
<span className="text-gray-500">
|
|
137
|
+
{formValues.isAvailable ? "Selected" : "Not Selected"}
|
|
138
|
+
</span>
|
|
139
|
+
</p>
|
|
140
|
+
</section>
|
|
141
|
+
</div>
|
|
142
|
+
);
|
|
143
|
+
},
|
|
144
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Field } from "@/components";
|
|
4
|
+
import { FormBuilderProvider } from "@/providers";
|
|
5
|
+
import type { FormBuilderProps } from "@/types";
|
|
6
|
+
import { cn } from "@/utils";
|
|
7
|
+
import {
|
|
8
|
+
Children,
|
|
9
|
+
cloneElement,
|
|
10
|
+
isValidElement,
|
|
11
|
+
useMemo,
|
|
12
|
+
type ReactElement,
|
|
13
|
+
} from "react";
|
|
14
|
+
import { useEffect } from "react";
|
|
15
|
+
import { useForm, useWatch } from "react-hook-form";
|
|
16
|
+
import type { ZodType } from "zod";
|
|
17
|
+
import { z } from "zod";
|
|
18
|
+
|
|
19
|
+
export function FormBuilder<TSchema extends ZodType<any, any, any>>({
|
|
20
|
+
children,
|
|
21
|
+
className,
|
|
22
|
+
classNames,
|
|
23
|
+
formProps,
|
|
24
|
+
onSubmit,
|
|
25
|
+
onSuccess,
|
|
26
|
+
onError,
|
|
27
|
+
onValuesChange,
|
|
28
|
+
}: FormBuilderProps<TSchema>) {
|
|
29
|
+
const { control, handleSubmit } = useForm<z.infer<TSchema>>(formProps);
|
|
30
|
+
|
|
31
|
+
const emptyValues = useMemo(() => ({}), []);
|
|
32
|
+
const formValues = useWatch({ control }) ?? emptyValues;
|
|
33
|
+
|
|
34
|
+
const allChildren = Children.toArray(children);
|
|
35
|
+
|
|
36
|
+
allChildren.forEach((child) => {
|
|
37
|
+
if (!isValidElement(child) || child.type !== Field) {
|
|
38
|
+
throw new Error(
|
|
39
|
+
"FormBuilder accepts only 'Field' components as children.",
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const formFields = allChildren.map((child) =>
|
|
45
|
+
cloneElement(child as ReactElement),
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
onValuesChange?.(formValues);
|
|
50
|
+
}, [formValues, onValuesChange]);
|
|
51
|
+
|
|
52
|
+
const handleValidSubmit = async (values: z.infer<TSchema>) => {
|
|
53
|
+
try {
|
|
54
|
+
await onSubmit(values);
|
|
55
|
+
onSuccess?.(values);
|
|
56
|
+
} catch (error) {
|
|
57
|
+
onError?.(error);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<FormBuilderProvider<z.infer<TSchema>> value={{ control, formValues }}>
|
|
63
|
+
<form
|
|
64
|
+
className={cn(className, classNames?.base)}
|
|
65
|
+
onSubmit={handleSubmit(handleValidSubmit, (errors) =>
|
|
66
|
+
onError?.({
|
|
67
|
+
errors,
|
|
68
|
+
}),
|
|
69
|
+
)}
|
|
70
|
+
>
|
|
71
|
+
{formFields}
|
|
72
|
+
</form>
|
|
73
|
+
</FormBuilderProvider>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./form-builder";
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { HeaderProps, NavBarHoverEffect, NavBarVariant } from "@/types";
|
|
2
|
+
import { cn } from "@/utils";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
import { ComponentProps, forwardRef } from "react";
|
|
5
|
+
import { Brand, NavBar, SideBar } from "@/components";
|
|
6
|
+
import { headerClasses, headerStyles } from "./styles";
|
|
7
|
+
import { useDisclosure } from "@heroui/modal";
|
|
8
|
+
import { MOCK_HEADER_ITEMS, MOCK_HEADER_ACTIONS } from "@/mocks";
|
|
9
|
+
import { SegmentedHeaderContent } from "./segmented-header-content";
|
|
10
|
+
|
|
11
|
+
export const Header = forwardRef<
|
|
12
|
+
HTMLElement,
|
|
13
|
+
ComponentProps<"header"> & VariantProps<typeof headerClasses> & HeaderProps
|
|
14
|
+
>(
|
|
15
|
+
(
|
|
16
|
+
{ className, variant = "default", glassEffect, children, ...props },
|
|
17
|
+
ref,
|
|
18
|
+
) => {
|
|
19
|
+
const { isOpen, onOpenChange } = useDisclosure();
|
|
20
|
+
|
|
21
|
+
const content = children || (
|
|
22
|
+
<>
|
|
23
|
+
<SideBar
|
|
24
|
+
items={MOCK_HEADER_ITEMS}
|
|
25
|
+
actions={MOCK_HEADER_ACTIONS}
|
|
26
|
+
isOpen={isOpen}
|
|
27
|
+
onOpenChange={onOpenChange}
|
|
28
|
+
header={<Brand className="text-white" />}
|
|
29
|
+
triggerProps={{
|
|
30
|
+
startContent: (
|
|
31
|
+
<Brand
|
|
32
|
+
className="text-white"
|
|
33
|
+
classNames={{
|
|
34
|
+
logo: "size-6",
|
|
35
|
+
}}
|
|
36
|
+
/>
|
|
37
|
+
),
|
|
38
|
+
isIconOnly: false,
|
|
39
|
+
variant: "light",
|
|
40
|
+
}}
|
|
41
|
+
/>
|
|
42
|
+
|
|
43
|
+
<NavBar
|
|
44
|
+
className="hidden md:flex mx-auto"
|
|
45
|
+
items={MOCK_HEADER_ITEMS}
|
|
46
|
+
hoverEffect={
|
|
47
|
+
{
|
|
48
|
+
default: "default",
|
|
49
|
+
floating: "underline",
|
|
50
|
+
light: "underline",
|
|
51
|
+
"segmented-floating": "default",
|
|
52
|
+
}[variant] as NavBarHoverEffect
|
|
53
|
+
}
|
|
54
|
+
variant={
|
|
55
|
+
{
|
|
56
|
+
default: "default",
|
|
57
|
+
floating: "default",
|
|
58
|
+
light: "default",
|
|
59
|
+
"segmented-floating": "default",
|
|
60
|
+
}[variant] as NavBarVariant
|
|
61
|
+
}
|
|
62
|
+
/>
|
|
63
|
+
</>
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<header
|
|
68
|
+
ref={ref}
|
|
69
|
+
data-slot="emperor-header"
|
|
70
|
+
className={cn(headerClasses({ variant, className }))}
|
|
71
|
+
style={headerStyles({
|
|
72
|
+
variant,
|
|
73
|
+
glassEffect,
|
|
74
|
+
})}
|
|
75
|
+
{...props}
|
|
76
|
+
>
|
|
77
|
+
{variant === "segmented-floating" ? (
|
|
78
|
+
<SegmentedHeaderContent glassEffect={glassEffect}>
|
|
79
|
+
{content}
|
|
80
|
+
</SegmentedHeaderContent>
|
|
81
|
+
) : (
|
|
82
|
+
content
|
|
83
|
+
)}
|
|
84
|
+
</header>
|
|
85
|
+
);
|
|
86
|
+
},
|
|
87
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./header";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SegmentedHeaderContentProps } from "@/types";
|
|
2
|
+
import { Children } from "react";
|
|
3
|
+
import { Row } from "@/components";
|
|
4
|
+
import { getGlassEffectStyles } from "./styles/styles";
|
|
5
|
+
|
|
6
|
+
export const SegmentedHeaderContent = ({
|
|
7
|
+
children,
|
|
8
|
+
glassEffect,
|
|
9
|
+
}: SegmentedHeaderContentProps) => {
|
|
10
|
+
return (
|
|
11
|
+
<Row className="w-full min-h-12 justify-between">
|
|
12
|
+
{Children.toArray(children).map((child, index) => (
|
|
13
|
+
<Row
|
|
14
|
+
className="rounded-full min-h-12 px-5"
|
|
15
|
+
key={index}
|
|
16
|
+
style={{
|
|
17
|
+
...(glassEffect
|
|
18
|
+
? getGlassEffectStyles({
|
|
19
|
+
glassEffect,
|
|
20
|
+
})
|
|
21
|
+
: {}),
|
|
22
|
+
}}
|
|
23
|
+
>
|
|
24
|
+
{child}
|
|
25
|
+
</Row>
|
|
26
|
+
))}
|
|
27
|
+
</Row>
|
|
28
|
+
);
|
|
29
|
+
};
|