@js-empire/emperor-ui 1.3.5 → 1.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/emperor-ui.js +60624 -157
- package/dist/emperor-ui.umd.cjs +17 -17
- package/dist/index.d.ts +3 -0
- package/package.json +7 -3
- package/.cursor/rules/code-conventions.mdc +0 -50
- package/.husky/pre-commit +0 -4
- package/.prettierrc +0 -10
- package/.storybook/main.ts +0 -24
- package/.storybook/preview.ts +0 -19
- package/.storybook/vitest.setup.ts +0 -7
- package/.vscode/extensions.json +0 -1
- package/dist/index-31cOfB5-.js +0 -290
- package/dist/index-BwRbIPvN.js +0 -60566
- package/dist/index-DOyt37_Z.js +0 -5
- package/dist/src-UW24ZMRV-DMRqgyf4.js +0 -5
- package/eslint.config.js +0 -34
- package/index.html +0 -13
- 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 +0 -26
- package/src/animations/floating.ts +0 -12
- package/src/animations/index.ts +0 -2
- package/src/components/atoms/brand/brand.stories.tsx +0 -27
- package/src/components/atoms/brand/brand.tsx +0 -56
- package/src/components/atoms/brand/index.ts +0 -1
- package/src/components/atoms/brand/styles/classes.ts +0 -9
- package/src/components/atoms/brand/styles/index.ts +0 -2
- package/src/components/atoms/brand/styles/styles.ts +0 -0
- package/src/components/atoms/color-picker/color-picker.tsx +0 -12
- package/src/components/atoms/color-picker/free-color-picker.tsx +0 -58
- package/src/components/atoms/color-picker/index.ts +0 -3
- package/src/components/atoms/color-picker/preset-color-picker.tsx +0 -66
- package/src/components/atoms/color-picker/stories/color-picker.stories.tsx +0 -63
- package/src/components/atoms/column/column.stories.tsx +0 -37
- package/src/components/atoms/column/column.tsx +0 -21
- package/src/components/atoms/column/index.ts +0 -1
- package/src/components/atoms/container/column.stories.tsx +0 -37
- package/src/components/atoms/container/container.tsx +0 -28
- package/src/components/atoms/container/index.ts +0 -1
- package/src/components/atoms/copy-button/copy-button.tsx +0 -73
- package/src/components/atoms/copy-button/index.ts +0 -1
- package/src/components/atoms/copy-button/stories/copy-button.stories.tsx +0 -21
- package/src/components/atoms/field/field.tsx +0 -81
- package/src/components/atoms/field/index.ts +0 -3
- package/src/components/atoms/field/styles/classes.ts +0 -9
- package/src/components/atoms/field/styles/index.ts +0 -1
- package/src/components/atoms/field/units/autocomplete-field.tsx +0 -49
- package/src/components/atoms/field/units/checkbox-field.tsx +0 -35
- package/src/components/atoms/field/units/index.ts +0 -7
- package/src/components/atoms/field/units/input-field.tsx +0 -35
- package/src/components/atoms/field/units/radio-field.tsx +0 -43
- package/src/components/atoms/field/units/select-field.tsx +0 -50
- package/src/components/atoms/field/units/switch-field.tsx +0 -35
- package/src/components/atoms/field/units/textarea-field.tsx +0 -37
- package/src/components/atoms/filter/filter.tsx +0 -93
- package/src/components/atoms/filter/index.ts +0 -3
- package/src/components/atoms/filter/stories/filter.stories.tsx +0 -238
- package/src/components/atoms/filter/styles/classes.ts +0 -20
- package/src/components/atoms/filter/styles/index.ts +0 -1
- package/src/components/atoms/filter/units/autocomplete-filter.tsx +0 -66
- package/src/components/atoms/filter/units/checkbox-filter.tsx +0 -42
- package/src/components/atoms/filter/units/checkbox-group-filter.tsx +0 -68
- package/src/components/atoms/filter/units/date-filter.tsx +0 -46
- package/src/components/atoms/filter/units/index.ts +0 -9
- package/src/components/atoms/filter/units/numeric-filter.tsx +0 -41
- package/src/components/atoms/filter/units/range-filter.tsx +0 -65
- package/src/components/atoms/filter/units/search-filter.tsx +0 -53
- package/src/components/atoms/filter/units/select-filter.tsx +0 -57
- package/src/components/atoms/filter/units/switch-filter.tsx +0 -35
- package/src/components/atoms/index.ts +0 -11
- package/src/components/atoms/portal/index.ts +0 -1
- package/src/components/atoms/portal/portal.stories.tsx +0 -43
- package/src/components/atoms/portal/portal.tsx +0 -25
- package/src/components/atoms/row/index.ts +0 -1
- package/src/components/atoms/row/row.stories.tsx +0 -37
- package/src/components/atoms/row/row.tsx +0 -26
- package/src/components/atoms/theme-switch/index.ts +0 -1
- package/src/components/atoms/theme-switch/styles/classes.ts +0 -16
- package/src/components/atoms/theme-switch/styles/index.ts +0 -1
- package/src/components/atoms/theme-switch/theme-switch.stories.tsx +0 -26
- package/src/components/atoms/theme-switch/theme-switch.tsx +0 -54
- package/src/components/atoms/uploader/components/avatar-label.tsx +0 -102
- package/src/components/atoms/uploader/components/index.ts +0 -8
- package/src/components/atoms/uploader/components/upload-file-error-box.tsx +0 -40
- package/src/components/atoms/uploader/components/upload-file-input.tsx +0 -36
- package/src/components/atoms/uploader/components/upload-file-label.tsx +0 -92
- package/src/components/atoms/uploader/components/upload-file-listing.tsx +0 -64
- package/src/components/atoms/uploader/components/uploader-title.tsx +0 -21
- package/src/components/atoms/uploader/components/uploader.tsx +0 -58
- package/src/components/atoms/uploader/components/view-image-modal.tsx +0 -41
- package/src/components/atoms/uploader/index.ts +0 -1
- package/src/components/atoms/uploader/stories/uploader.stories.tsx +0 -201
- package/src/components/index.ts +0 -4
- package/src/components/molecules/index.ts +0 -4
- package/src/components/molecules/item-card/components/actions/index.ts +0 -3
- package/src/components/molecules/item-card/components/actions/item-actions-buttons.tsx +0 -43
- package/src/components/molecules/item-card/components/actions/item-actions-dropdown.tsx +0 -57
- package/src/components/molecules/item-card/components/actions/item-actions-overlay.tsx +0 -50
- package/src/components/molecules/item-card/components/additions/index.ts +0 -2
- package/src/components/molecules/item-card/components/additions/item-banner.tsx +0 -22
- package/src/components/molecules/item-card/components/additions/loading-item.tsx +0 -88
- package/src/components/molecules/item-card/components/card/index.ts +0 -4
- package/src/components/molecules/item-card/components/card/item-card-body.tsx +0 -74
- package/src/components/molecules/item-card/components/card/item-card-footer.tsx +0 -79
- package/src/components/molecules/item-card/components/card/item-card-header.tsx +0 -69
- package/src/components/molecules/item-card/components/card/item-card.tsx +0 -123
- package/src/components/molecules/item-card/components/index.ts +0 -3
- package/src/components/molecules/item-card/index.ts +0 -2
- package/src/components/molecules/item-card/stories/item-card.stories.tsx +0 -218
- package/src/components/molecules/item-card/styles/classes.ts +0 -141
- package/src/components/molecules/item-card/styles/index.ts +0 -1
- package/src/components/molecules/nav-bar/index.ts +0 -3
- package/src/components/molecules/nav-bar/nav-bar-item.tsx +0 -64
- package/src/components/molecules/nav-bar/nav-bar.tsx +0 -57
- package/src/components/molecules/nav-bar/stories/hover-effect/nav-bar-hover-effect.stories.tsx +0 -52
- package/src/components/molecules/nav-bar/stories/nav-bar.stories.tsx +0 -50
- package/src/components/molecules/nav-bar/styles/classes.ts +0 -68
- package/src/components/molecules/nav-bar/styles/index.ts +0 -2
- package/src/components/molecules/nav-bar/styles/styles.ts +0 -85
- package/src/components/molecules/nav-bar/sub-items-box.tsx +0 -58
- package/src/components/molecules/scaffold/index.ts +0 -2
- package/src/components/molecules/scaffold/scaffold.stories.tsx +0 -21
- package/src/components/molecules/scaffold/scaffold.tsx +0 -23
- package/src/components/molecules/scaffold/styles/index.ts +0 -1
- package/src/components/molecules/scaffold/styles/scaffold-classes.ts +0 -10
- package/src/components/molecules/side-bar/compact-side-bar.tsx +0 -77
- package/src/components/molecules/side-bar/index.ts +0 -1
- package/src/components/molecules/side-bar/side-bar-drawer.tsx +0 -113
- package/src/components/molecules/side-bar/side-bar.stories.tsx +0 -111
- package/src/components/molecules/side-bar/side-bar.tsx +0 -31
- package/src/components/molecules/side-bar/styles/classes.ts +0 -28
- package/src/components/molecules/side-bar/styles/index.ts +0 -2
- package/src/components/molecules/side-bar/styles/styles.ts +0 -13
- package/src/components/organisms/deletion-confirmor/deletion-confirmor.tsx +0 -110
- package/src/components/organisms/deletion-confirmor/index.ts +0 -3
- package/src/components/organisms/deletion-confirmor/stories/components.tsx +0 -25
- package/src/components/organisms/deletion-confirmor/stories/deletion-confirmor.stories.tsx +0 -78
- package/src/components/organisms/deletion-confirmor/styles/classes.ts +0 -28
- package/src/components/organisms/deletion-confirmor/styles/index.ts +0 -2
- package/src/components/organisms/deletion-confirmor/styles/styles.ts +0 -4
- package/src/components/organisms/footer/copy-rights-box.tsx +0 -27
- package/src/components/organisms/footer/footer.tsx +0 -75
- package/src/components/organisms/footer/index.ts +0 -5
- package/src/components/organisms/footer/policies-box.tsx +0 -27
- package/src/components/organisms/footer/quick-links-box.tsx +0 -46
- package/src/components/organisms/footer/social-links-box.tsx +0 -33
- package/src/components/organisms/footer/stories/footer.stories.tsx +0 -61
- package/src/components/organisms/footer/styles/classes.ts +0 -71
- package/src/components/organisms/footer/styles/index.ts +0 -2
- package/src/components/organisms/footer/styles/styles.ts +0 -6
- package/src/components/organisms/form-builder/form-builder.stories.tsx +0 -144
- package/src/components/organisms/form-builder/form-builder.tsx +0 -75
- package/src/components/organisms/form-builder/index.ts +0 -1
- package/src/components/organisms/header/header.tsx +0 -87
- package/src/components/organisms/header/index.ts +0 -1
- package/src/components/organisms/header/segmented-header-content.tsx +0 -29
- package/src/components/organisms/header/stories/header.stories.tsx +0 -144
- package/src/components/organisms/header/styles/classes.ts +0 -22
- package/src/components/organisms/header/styles/index.ts +0 -2
- package/src/components/organisms/header/styles/styles.ts +0 -39
- package/src/components/organisms/index.ts +0 -6
- package/src/components/organisms/item-details/index.ts +0 -1
- package/src/components/organisms/item-details/item-details.tsx +0 -6
- package/src/components/organisms/listings/empty-listings.tsx +0 -80
- package/src/components/organisms/listings/index.ts +0 -3
- package/src/components/organisms/listings/listings.tsx +0 -96
- package/src/components/organisms/listings/stories/grid-listings.stories.tsx +0 -153
- package/src/components/organisms/listings/stories/list-listings.stories.tsx +0 -171
- package/src/components/organisms/listings/styles/classes.ts +0 -49
- package/src/components/organisms/listings/styles/index.ts +0 -2
- package/src/components/organisms/listings/styles/styles.ts +0 -6
- package/src/components/templates/index.ts +0 -1
- package/src/components/templates/landing-page/index.ts +0 -1
- package/src/components/templates/landing-page/landing-page.stories.tsx +0 -21
- package/src/components/templates/landing-page/landing-page.tsx +0 -57
- package/src/components/templates/landing-page/styles/classes.ts +0 -11
- package/src/components/templates/landing-page/styles/index.ts +0 -1
- package/src/constants/animations.ts +0 -14
- package/src/constants/card.tsx +0 -42
- package/src/constants/defaults.ts +0 -59
- package/src/constants/fake.ts +0 -5
- package/src/constants/footer.tsx +0 -157
- package/src/constants/index.ts +0 -6
- package/src/constants/uploader.ts +0 -27
- package/src/context/emperor-ui-context.ts +0 -6
- package/src/context/form-builder-context.tsx +0 -8
- package/src/context/index.ts +0 -4
- package/src/context/navigation-context.ts +0 -6
- package/src/context/uploader-context.ts +0 -6
- package/src/enums/index.ts +0 -2
- package/src/enums/placeholders.ts +0 -4
- package/src/enums/preserved-keys.ts +0 -3
- package/src/examples/index.ts +0 -1
- package/src/hooks/index.ts +0 -8
- package/src/hooks/use-emperor-ui.ts +0 -12
- package/src/hooks/use-filters.ts +0 -20
- package/src/hooks/use-form-builder-context.ts +0 -16
- package/src/hooks/use-navigation.ts +0 -12
- package/src/hooks/use-search-params-handler.tsx +0 -186
- package/src/hooks/use-uploader-context.ts +0 -14
- package/src/hooks/use-uploader.tsx +0 -164
- package/src/hooks/use-window-size.tsx +0 -53
- package/src/i18n/configs/i18n.ts +0 -7
- package/src/i18n/configs/index.ts +0 -1
- package/src/i18n/constants/index.ts +0 -1
- package/src/i18n/constants/locales.ts +0 -4
- package/src/i18n/index.ts +0 -5
- package/src/i18n/locales/ar.ts +0 -15
- package/src/i18n/locales/atoms/ar.ts +0 -18
- package/src/i18n/locales/atoms/en.ts +0 -18
- package/src/i18n/locales/atoms/index.ts +0 -2
- package/src/i18n/locales/common/ar.ts +0 -1
- package/src/i18n/locales/common/en.ts +0 -1
- package/src/i18n/locales/common/index.ts +0 -2
- package/src/i18n/locales/en.ts +0 -15
- package/src/i18n/locales/index.ts +0 -4
- package/src/i18n/locales/molecules/ar.ts +0 -1
- package/src/i18n/locales/molecules/en.ts +0 -1
- package/src/i18n/locales/molecules/index.ts +0 -2
- package/src/i18n/locales/organisms/ar.ts +0 -11
- package/src/i18n/locales/organisms/en.ts +0 -11
- package/src/i18n/locales/organisms/index.ts +0 -2
- package/src/i18n/locales/templates/ar.ts +0 -1
- package/src/i18n/locales/templates/en.ts +0 -1
- package/src/i18n/locales/templates/index.ts +0 -2
- package/src/i18n/locales/toasts/ar.ts +0 -1
- package/src/i18n/locales/toasts/en.ts +0 -1
- package/src/i18n/locales/toasts/index.ts +0 -2
- package/src/i18n/types/index.ts +0 -2
- package/src/i18n/types/locale.ts +0 -5
- package/src/i18n/types/toasts.ts +0 -3
- package/src/i18n/utils/get-locales.ts +0 -4
- package/src/i18n/utils/index.ts +0 -2
- package/src/i18n/utils/localize.ts +0 -15
- package/src/index.ts +0 -12
- package/src/mocks/constants.ts +0 -103
- package/src/mocks/deletion-confirmor.ts +0 -16
- package/src/mocks/header.tsx +0 -118
- package/src/mocks/index.ts +0 -6
- package/src/mocks/listings.tsx +0 -154
- package/src/mocks/locales/index.ts +0 -1
- package/src/mocks/locales/uploader.ts +0 -33
- package/src/mocks/types.ts +0 -64
- package/src/providers/config-provider.tsx +0 -72
- package/src/providers/emperor-ui-provider.tsx +0 -35
- package/src/providers/form-builder-provider-context.tsx +0 -18
- package/src/providers/index.ts +0 -6
- package/src/providers/navigation-provider.tsx +0 -42
- package/src/providers/theme-provider.tsx +0 -16
- package/src/providers/uploader-provider.tsx +0 -53
- package/src/styles/globals.css +0 -38
- package/src/styles/hero.ts +0 -3
- package/src/styles/index.css +0 -18
- package/src/types/components/atoms/brand.ts +0 -13
- package/src/types/components/atoms/color-picker/color-picker.ts +0 -21
- package/src/types/components/atoms/color-picker/index.ts +0 -1
- package/src/types/components/atoms/column.ts +0 -3
- package/src/types/components/atoms/container.ts +0 -3
- package/src/types/components/atoms/field/field.ts +0 -61
- package/src/types/components/atoms/field/index.ts +0 -1
- package/src/types/components/atoms/filter/filter.ts +0 -52
- package/src/types/components/atoms/filter/index.ts +0 -2
- package/src/types/components/atoms/filter/select-filter.ts +0 -8
- package/src/types/components/atoms/index.ts +0 -9
- package/src/types/components/atoms/portal.ts +0 -6
- package/src/types/components/atoms/row.ts +0 -3
- package/src/types/components/atoms/uploader.ts +0 -102
- package/src/types/components/index.ts +0 -4
- package/src/types/components/molecules/footer/footer.ts +0 -68
- package/src/types/components/molecules/footer/index.ts +0 -1
- package/src/types/components/molecules/header/header.ts +0 -51
- package/src/types/components/molecules/header/index.ts +0 -1
- package/src/types/components/molecules/index.ts +0 -9
- package/src/types/components/molecules/item-card/index.ts +0 -1
- package/src/types/components/molecules/item-card/item-card.ts +0 -69
- package/src/types/components/molecules/item-details/index.ts +0 -1
- package/src/types/components/molecules/item-details/item-details.ts +0 -9
- package/src/types/components/molecules/listings/index.ts +0 -1
- package/src/types/components/molecules/listings/listings.ts +0 -29
- package/src/types/components/molecules/nav-bar/index.ts +0 -1
- package/src/types/components/molecules/nav-bar/nav-bar.ts +0 -66
- package/src/types/components/molecules/scaffold/index.ts +0 -1
- package/src/types/components/molecules/scaffold/scaffold.ts +0 -9
- package/src/types/components/molecules/side-bar/index.ts +0 -1
- package/src/types/components/molecules/side-bar/side-bar.ts +0 -40
- package/src/types/components/molecules/theme-switch/index.ts +0 -1
- package/src/types/components/molecules/theme-switch/theme-switch.ts +0 -9
- package/src/types/components/organisms/deletion-confirmor/deletion-confirmor.ts +0 -22
- package/src/types/components/organisms/deletion-confirmor/index.ts +0 -1
- package/src/types/components/organisms/filters/filters.ts +0 -11
- package/src/types/components/organisms/filters/index.ts +0 -1
- package/src/types/components/organisms/form-builder/context.ts +0 -6
- package/src/types/components/organisms/form-builder/form-builder.ts +0 -39
- package/src/types/components/organisms/form-builder/index.ts +0 -2
- package/src/types/components/organisms/index.ts +0 -3
- package/src/types/components/templates/index.ts +0 -1
- package/src/types/components/templates/landing-page.ts +0 -10
- package/src/types/context/config.ts +0 -24
- package/src/types/context/index.ts +0 -4
- package/src/types/context/localization.ts +0 -24
- package/src/types/context/navigation.ts +0 -17
- package/src/types/context/theme.ts +0 -33
- package/src/types/index.ts +0 -3
- package/src/types/shared/components.ts +0 -13
- package/src/types/shared/index.ts +0 -1
- package/src/utils/cn.ts +0 -6
- package/src/utils/compress-images.ts +0 -36
- package/src/utils/index.ts +0 -5
- package/src/utils/locales.ts +0 -54
- package/src/utils/storybook.tsx +0 -15
- package/src/utils/uploader.ts +0 -167
- package/tsconfig.app.json +0 -37
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -25
- package/vite.config.ts +0 -44
- package/vitest.shims.d.ts +0 -1
|
@@ -1,27 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,71 +0,0 @@
|
|
|
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
|
-
);
|
|
@@ -1,144 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,75 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./form-builder";
|
|
@@ -1,87 +0,0 @@
|
|
|
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
|
-
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./header";
|
|
@@ -1,29 +0,0 @@
|
|
|
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
|
-
};
|