@js-empire/emperor-ui 1.3.6 → 1.3.8
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 +4157 -158
- package/dist/index.d.ts +3 -2
- package/package.json +56 -10
- 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/emperor-ui.umd.cjs +0 -77
- 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-ABKcY4tX.js +0 -60607
- package/dist/index-CWu5fG3N.js +0 -6
- package/dist/index-DpemL3iQ.js +0 -291
- package/dist/src-UW24ZMRV-I8bMqcTI.js +0 -6
- 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 -89
- 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 -202
- 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 -33
- 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 -14
- 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 -103
- 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 -170
- package/tsconfig.app.json +0 -37
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -25
- package/vite.config.ts +0 -47
- package/vitest.shims.d.ts +0 -1
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import { ColorPicker } from "@/components";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { getStorybookDecorators } from "@/utils";
|
|
5
|
-
|
|
6
|
-
const meta: Meta<typeof ColorPicker> = {
|
|
7
|
-
title: "Atoms/ColorPicker",
|
|
8
|
-
component: ColorPicker,
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: "centered",
|
|
11
|
-
},
|
|
12
|
-
tags: ["autodocs"],
|
|
13
|
-
decorators: getStorybookDecorators({
|
|
14
|
-
config: {
|
|
15
|
-
layout: {
|
|
16
|
-
withScaffold: false,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
}),
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default meta;
|
|
23
|
-
|
|
24
|
-
type Story = StoryObj<typeof meta>;
|
|
25
|
-
|
|
26
|
-
export const Default: Story = {
|
|
27
|
-
render: () => {
|
|
28
|
-
const [value, setValue] = useState("#000000");
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<section className="flex flex-col gap-4">
|
|
32
|
-
<ColorPicker
|
|
33
|
-
inputType="free"
|
|
34
|
-
value={value}
|
|
35
|
-
onChange={setValue}
|
|
36
|
-
defaultValue="#000000"
|
|
37
|
-
/>
|
|
38
|
-
|
|
39
|
-
<p className="text-xs text-gray-500">Value: {value}</p>
|
|
40
|
-
</section>
|
|
41
|
-
);
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const WithPresets: Story = {
|
|
46
|
-
render: () => {
|
|
47
|
-
const [value, setValue] = useState("#000000");
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<section className="flex flex-col gap-4">
|
|
51
|
-
<ColorPicker
|
|
52
|
-
inputType="preset"
|
|
53
|
-
presets={["#000000", "#FFFFFF", "#FF0000", "#00FF00", "#0000FF"]}
|
|
54
|
-
value={value}
|
|
55
|
-
onChange={setValue}
|
|
56
|
-
defaultValue="#000000"
|
|
57
|
-
/>
|
|
58
|
-
|
|
59
|
-
<p className="text-xs text-gray-500">Value: {value}</p>
|
|
60
|
-
</section>
|
|
61
|
-
);
|
|
62
|
-
},
|
|
63
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import { Column } from "@/components";
|
|
3
|
-
import type { ColumnProps } from "@/types";
|
|
4
|
-
import { getStorybookDecorators } from "@/utils";
|
|
5
|
-
|
|
6
|
-
const meta: Meta<typeof Column> = {
|
|
7
|
-
title: "Atoms/Column",
|
|
8
|
-
component: Column,
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: "centered",
|
|
11
|
-
},
|
|
12
|
-
tags: ["autodocs"],
|
|
13
|
-
decorators: getStorybookDecorators({
|
|
14
|
-
config: {
|
|
15
|
-
layout: {
|
|
16
|
-
withScaffold: false,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
}),
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default meta;
|
|
23
|
-
|
|
24
|
-
type Story = StoryObj<typeof meta>;
|
|
25
|
-
|
|
26
|
-
export const Default: Story = {
|
|
27
|
-
args: {},
|
|
28
|
-
render: (args: ColumnProps) => (
|
|
29
|
-
<Column {...args}>
|
|
30
|
-
{Array.from({ length: 5 }).map((_, index) => (
|
|
31
|
-
<div key={index} className="bg-blue-300 p-2 rounded-md">
|
|
32
|
-
Item {index + 1}
|
|
33
|
-
</div>
|
|
34
|
-
))}
|
|
35
|
-
</Column>
|
|
36
|
-
),
|
|
37
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ColumnProps } from "@/types";
|
|
2
|
-
import { cn } from "@/utils";
|
|
3
|
-
import { cva, VariantProps } from "class-variance-authority";
|
|
4
|
-
import { forwardRef, ComponentProps } from "react";
|
|
5
|
-
|
|
6
|
-
const columnStyles = cva(["flex flex-col gap-3"], {
|
|
7
|
-
variants: {},
|
|
8
|
-
defaultVariants: {},
|
|
9
|
-
compoundVariants: [],
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export const Column = forwardRef<
|
|
13
|
-
HTMLElement,
|
|
14
|
-
ComponentProps<"section"> & VariantProps<typeof columnStyles> & ColumnProps
|
|
15
|
-
>(({ className, children, ...props }, ref) => {
|
|
16
|
-
return (
|
|
17
|
-
<section ref={ref} className={cn(columnStyles({ className }))} {...props}>
|
|
18
|
-
{children}
|
|
19
|
-
</section>
|
|
20
|
-
);
|
|
21
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./column";
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import { Container } from "@/components";
|
|
3
|
-
import { getStorybookDecorators } from "@/utils";
|
|
4
|
-
import type { ContainerProps } from "@/types";
|
|
5
|
-
|
|
6
|
-
const meta: Meta<typeof Container> = {
|
|
7
|
-
title: "Atoms/Container",
|
|
8
|
-
component: Container,
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: "fullscreen",
|
|
11
|
-
},
|
|
12
|
-
tags: ["autodocs"],
|
|
13
|
-
decorators: getStorybookDecorators({
|
|
14
|
-
config: {
|
|
15
|
-
layout: {
|
|
16
|
-
withScaffold: false,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
}),
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default meta;
|
|
23
|
-
|
|
24
|
-
type Story = StoryObj<typeof meta>;
|
|
25
|
-
|
|
26
|
-
export const Default: Story = {
|
|
27
|
-
args: {
|
|
28
|
-
className: "h-screen flex items-center justify-center",
|
|
29
|
-
},
|
|
30
|
-
render: (args: ContainerProps) => (
|
|
31
|
-
<Container {...args}>
|
|
32
|
-
<div className="bg-blue-300 p-2 text-center rounded-md w-full h-fit">
|
|
33
|
-
Responsive contained content
|
|
34
|
-
</div>
|
|
35
|
-
</Container>
|
|
36
|
-
),
|
|
37
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { ContainerProps } from "@/types";
|
|
2
|
-
import { cn } from "@/utils";
|
|
3
|
-
import { cva, VariantProps } from "class-variance-authority";
|
|
4
|
-
import { forwardRef, ComponentProps } from "react";
|
|
5
|
-
|
|
6
|
-
const containerStyles = cva(["flex w-full container p-4 mx-auto"], {
|
|
7
|
-
variants: {},
|
|
8
|
-
defaultVariants: {},
|
|
9
|
-
compoundVariants: [],
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export const Container = forwardRef<
|
|
13
|
-
HTMLElement,
|
|
14
|
-
ComponentProps<"section"> &
|
|
15
|
-
VariantProps<typeof containerStyles> &
|
|
16
|
-
ContainerProps
|
|
17
|
-
>(({ className, children, ...props }, ref) => {
|
|
18
|
-
return (
|
|
19
|
-
<section
|
|
20
|
-
ref={ref}
|
|
21
|
-
data-slot="container"
|
|
22
|
-
className={cn(containerStyles({ className }))}
|
|
23
|
-
{...props}
|
|
24
|
-
>
|
|
25
|
-
{children}
|
|
26
|
-
</section>
|
|
27
|
-
);
|
|
28
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./container";
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { useState, useRef, useEffect } from "react";
|
|
4
|
-
import { Button } from "@heroui/button";
|
|
5
|
-
import { Spinner } from "@heroui/spinner";
|
|
6
|
-
import { Copy, Check } from "lucide-react";
|
|
7
|
-
import { motion, AnimatePresence } from "framer-motion";
|
|
8
|
-
|
|
9
|
-
type CopyState = "copy" | "loading" | "success";
|
|
10
|
-
|
|
11
|
-
export function CopyButton({ value }: { value: string }) {
|
|
12
|
-
const [state, setState] = useState<CopyState>("copy");
|
|
13
|
-
const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
14
|
-
|
|
15
|
-
const handleCopy = () => {
|
|
16
|
-
if (state !== "copy") return;
|
|
17
|
-
|
|
18
|
-
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
19
|
-
|
|
20
|
-
navigator.clipboard.writeText(value);
|
|
21
|
-
setState("loading");
|
|
22
|
-
|
|
23
|
-
timeoutRef.current = setTimeout(() => {
|
|
24
|
-
setState("success");
|
|
25
|
-
timeoutRef.current = setTimeout(() => setState("copy"), 2000);
|
|
26
|
-
}, 500);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
useEffect(
|
|
30
|
-
() => () => {
|
|
31
|
-
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
32
|
-
},
|
|
33
|
-
[],
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<Button
|
|
38
|
-
variant="light"
|
|
39
|
-
size="sm"
|
|
40
|
-
isIconOnly
|
|
41
|
-
onPress={handleCopy}
|
|
42
|
-
disabled={state !== "copy"}
|
|
43
|
-
startContent={
|
|
44
|
-
<span className="relative size-4">
|
|
45
|
-
<AnimatePresence mode="wait">
|
|
46
|
-
<motion.span
|
|
47
|
-
key={state}
|
|
48
|
-
initial={{ opacity: 0 }}
|
|
49
|
-
animate={{ opacity: 1 }}
|
|
50
|
-
exit={{ opacity: 0 }}
|
|
51
|
-
transition={{ duration: 0.2 }}
|
|
52
|
-
className="absolute inset-0 flex items-center justify-center"
|
|
53
|
-
>
|
|
54
|
-
{state === "copy" && <Copy className="size-4" />}
|
|
55
|
-
|
|
56
|
-
{state === "loading" && (
|
|
57
|
-
<Spinner
|
|
58
|
-
size="sm"
|
|
59
|
-
classNames={{
|
|
60
|
-
circle1: "border-b-current",
|
|
61
|
-
circle2: "border-current",
|
|
62
|
-
}}
|
|
63
|
-
/>
|
|
64
|
-
)}
|
|
65
|
-
|
|
66
|
-
{state === "success" && <Check className="size-4 text-success" />}
|
|
67
|
-
</motion.span>
|
|
68
|
-
</AnimatePresence>
|
|
69
|
-
</span>
|
|
70
|
-
}
|
|
71
|
-
/>
|
|
72
|
-
);
|
|
73
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./copy-button";
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import { CopyButton } from "@/components";
|
|
3
|
-
|
|
4
|
-
const meta: Meta<typeof CopyButton> = {
|
|
5
|
-
title: "Atoms/CopyButton",
|
|
6
|
-
component: CopyButton,
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: "centered",
|
|
9
|
-
},
|
|
10
|
-
tags: ["autodocs"],
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export default meta;
|
|
14
|
-
|
|
15
|
-
type Story = StoryObj<typeof meta>;
|
|
16
|
-
|
|
17
|
-
export const Default: Story = {
|
|
18
|
-
args: {
|
|
19
|
-
value: "Copied to clipboard successfully!",
|
|
20
|
-
},
|
|
21
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AutocompleteField,
|
|
3
|
-
CheckboxField,
|
|
4
|
-
InputField,
|
|
5
|
-
RadioField,
|
|
6
|
-
SelectField,
|
|
7
|
-
SwitchField,
|
|
8
|
-
TextareaField,
|
|
9
|
-
fieldClasses,
|
|
10
|
-
} from "@/components";
|
|
11
|
-
import type { FieldProps, FieldType } from "@/types";
|
|
12
|
-
import { cn } from "@/utils";
|
|
13
|
-
import type { FieldValues } from "react-hook-form";
|
|
14
|
-
import type { ReactNode } from "react";
|
|
15
|
-
|
|
16
|
-
export function Field<TSchema extends FieldValues>({
|
|
17
|
-
className,
|
|
18
|
-
classNames,
|
|
19
|
-
name,
|
|
20
|
-
type,
|
|
21
|
-
inputProps,
|
|
22
|
-
textareaProps,
|
|
23
|
-
checkboxProps,
|
|
24
|
-
selectProps,
|
|
25
|
-
selectItemProps,
|
|
26
|
-
autocompleteProps,
|
|
27
|
-
autocompleteItemProps,
|
|
28
|
-
switchProps,
|
|
29
|
-
radioGroupProps,
|
|
30
|
-
options,
|
|
31
|
-
children,
|
|
32
|
-
}: FieldProps<TSchema>) {
|
|
33
|
-
const components: Record<FieldType, ReactNode> = {
|
|
34
|
-
input: <InputField<TSchema> name={name} inputProps={inputProps} />,
|
|
35
|
-
textarea: (
|
|
36
|
-
<TextareaField<TSchema> name={name} textareaProps={textareaProps} />
|
|
37
|
-
),
|
|
38
|
-
checkbox: (
|
|
39
|
-
<CheckboxField<TSchema> name={name} checkboxProps={checkboxProps}>
|
|
40
|
-
{children}
|
|
41
|
-
</CheckboxField>
|
|
42
|
-
),
|
|
43
|
-
select: (
|
|
44
|
-
<SelectField<TSchema>
|
|
45
|
-
name={name}
|
|
46
|
-
options={options}
|
|
47
|
-
selectProps={selectProps}
|
|
48
|
-
selectItemProps={selectItemProps}
|
|
49
|
-
/>
|
|
50
|
-
),
|
|
51
|
-
autocomplete: (
|
|
52
|
-
<AutocompleteField<TSchema>
|
|
53
|
-
name={name}
|
|
54
|
-
options={options}
|
|
55
|
-
autocompleteProps={autocompleteProps}
|
|
56
|
-
autocompleteItemProps={autocompleteItemProps}
|
|
57
|
-
/>
|
|
58
|
-
),
|
|
59
|
-
switch: (
|
|
60
|
-
<SwitchField<TSchema> name={name} switchProps={switchProps}>
|
|
61
|
-
{children}
|
|
62
|
-
</SwitchField>
|
|
63
|
-
),
|
|
64
|
-
radio: (
|
|
65
|
-
<RadioField<TSchema>
|
|
66
|
-
name={name}
|
|
67
|
-
options={options}
|
|
68
|
-
radioGroupProps={radioGroupProps}
|
|
69
|
-
/>
|
|
70
|
-
),
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
return (
|
|
74
|
-
<div
|
|
75
|
-
data-slot="emperor-ui-field"
|
|
76
|
-
className={cn(fieldClasses({}), className, classNames?.base)}
|
|
77
|
-
>
|
|
78
|
-
{components[type]}
|
|
79
|
-
</div>
|
|
80
|
-
);
|
|
81
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./classes";
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import type { FieldProps } from "@/types";
|
|
4
|
-
import { Controller, type FieldValues } from "react-hook-form";
|
|
5
|
-
import { Autocomplete, AutocompleteItem } from "@heroui/autocomplete";
|
|
6
|
-
import { useEmperorUI, useFormBuilder } from "@/hooks";
|
|
7
|
-
|
|
8
|
-
export function AutocompleteField<TSchema extends FieldValues>({
|
|
9
|
-
autocompleteItemProps,
|
|
10
|
-
autocompleteProps,
|
|
11
|
-
options,
|
|
12
|
-
name,
|
|
13
|
-
}: Pick<
|
|
14
|
-
FieldProps<TSchema>,
|
|
15
|
-
"autocompleteItemProps" | "autocompleteProps" | "options" | "name"
|
|
16
|
-
>) {
|
|
17
|
-
const { config } = useEmperorUI();
|
|
18
|
-
|
|
19
|
-
const theme = config?.theme?.components?.autocomplete;
|
|
20
|
-
|
|
21
|
-
if (!options?.length) {
|
|
22
|
-
throw new Error("Field with type 'autocomplete' must include 'options'.");
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const { control } = useFormBuilder<TSchema>();
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<Controller
|
|
29
|
-
control={control}
|
|
30
|
-
name={name}
|
|
31
|
-
render={({ field }) => (
|
|
32
|
-
<Autocomplete
|
|
33
|
-
{...theme}
|
|
34
|
-
{...autocompleteProps}
|
|
35
|
-
selectedKey={field.value ? String(field.value) : null}
|
|
36
|
-
onSelectionChange={(selectedKey) =>
|
|
37
|
-
field.onChange(selectedKey ? String(selectedKey) : "")
|
|
38
|
-
}
|
|
39
|
-
>
|
|
40
|
-
{options.map((option) => (
|
|
41
|
-
<AutocompleteItem key={option.key} {...autocompleteItemProps}>
|
|
42
|
-
{option.label}
|
|
43
|
-
</AutocompleteItem>
|
|
44
|
-
))}
|
|
45
|
-
</Autocomplete>
|
|
46
|
-
)}
|
|
47
|
-
/>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import type { FieldProps } from "@/types";
|
|
4
|
-
import { Controller, type FieldValues } from "react-hook-form";
|
|
5
|
-
import { Checkbox } from "@heroui/checkbox";
|
|
6
|
-
import { useEmperorUI, useFormBuilder } from "@/hooks";
|
|
7
|
-
|
|
8
|
-
export function CheckboxField<TSchema extends FieldValues>({
|
|
9
|
-
checkboxProps,
|
|
10
|
-
name,
|
|
11
|
-
children,
|
|
12
|
-
}: Pick<FieldProps<TSchema>, "checkboxProps" | "name" | "children">) {
|
|
13
|
-
const { config } = useEmperorUI();
|
|
14
|
-
|
|
15
|
-
const theme = config?.theme?.components?.checkbox;
|
|
16
|
-
|
|
17
|
-
const { control } = useFormBuilder<TSchema>();
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<Controller
|
|
21
|
-
control={control}
|
|
22
|
-
name={name}
|
|
23
|
-
render={({ field: { value, onChange } }) => (
|
|
24
|
-
<Checkbox
|
|
25
|
-
{...theme}
|
|
26
|
-
{...checkboxProps}
|
|
27
|
-
isSelected={Boolean(value)}
|
|
28
|
-
onValueChange={onChange}
|
|
29
|
-
>
|
|
30
|
-
{children}
|
|
31
|
-
</Checkbox>
|
|
32
|
-
)}
|
|
33
|
-
/>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import type { FieldProps } from "@/types";
|
|
4
|
-
import { Controller, type FieldValues } from "react-hook-form";
|
|
5
|
-
import { Input } from "@heroui/input";
|
|
6
|
-
import { useEmperorUI, useFormBuilder } from "@/hooks";
|
|
7
|
-
|
|
8
|
-
export function InputField<TSchema extends FieldValues>({
|
|
9
|
-
inputProps,
|
|
10
|
-
name,
|
|
11
|
-
}: Pick<FieldProps<TSchema>, "inputProps" | "name">) {
|
|
12
|
-
const { config } = useEmperorUI();
|
|
13
|
-
|
|
14
|
-
const theme = config?.theme?.components?.input;
|
|
15
|
-
|
|
16
|
-
const { control } = useFormBuilder<TSchema>();
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<Controller
|
|
20
|
-
control={control}
|
|
21
|
-
name={name}
|
|
22
|
-
render={({ field, fieldState }) => (
|
|
23
|
-
<Input
|
|
24
|
-
{...theme}
|
|
25
|
-
{...inputProps}
|
|
26
|
-
value={field.value ? String(field.value) : ""}
|
|
27
|
-
onBlur={field.onBlur}
|
|
28
|
-
onValueChange={field.onChange}
|
|
29
|
-
isInvalid={inputProps?.isInvalid ?? Boolean(fieldState.error)}
|
|
30
|
-
errorMessage={inputProps?.errorMessage ?? fieldState.error?.message}
|
|
31
|
-
/>
|
|
32
|
-
)}
|
|
33
|
-
/>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import type { FieldProps } from "@/types";
|
|
4
|
-
import { Controller, type FieldValues } from "react-hook-form";
|
|
5
|
-
import { Radio, RadioGroup } from "@heroui/radio";
|
|
6
|
-
import { useEmperorUI, useFormBuilder } from "@/hooks";
|
|
7
|
-
|
|
8
|
-
export function RadioField<TSchema extends FieldValues>({
|
|
9
|
-
options,
|
|
10
|
-
radioGroupProps,
|
|
11
|
-
name,
|
|
12
|
-
}: Pick<FieldProps<TSchema>, "options" | "radioGroupProps" | "name">) {
|
|
13
|
-
const { config } = useEmperorUI();
|
|
14
|
-
|
|
15
|
-
const theme = config?.theme?.components?.radio;
|
|
16
|
-
|
|
17
|
-
const { control } = useFormBuilder<TSchema>();
|
|
18
|
-
|
|
19
|
-
if (!options?.length) {
|
|
20
|
-
throw new Error("Field with type 'radio' must include 'options'.");
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<Controller
|
|
25
|
-
control={control}
|
|
26
|
-
name={name}
|
|
27
|
-
render={({ field }) => (
|
|
28
|
-
<RadioGroup
|
|
29
|
-
{...theme}
|
|
30
|
-
{...radioGroupProps}
|
|
31
|
-
value={field.value ? String(field.value) : ""}
|
|
32
|
-
onValueChange={field.onChange}
|
|
33
|
-
>
|
|
34
|
-
{options.map((option) => (
|
|
35
|
-
<Radio key={option.key} value={option.key}>
|
|
36
|
-
{option.label}
|
|
37
|
-
</Radio>
|
|
38
|
-
))}
|
|
39
|
-
</RadioGroup>
|
|
40
|
-
)}
|
|
41
|
-
/>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import type { FieldProps } from "@/types";
|
|
4
|
-
import { Controller, type FieldValues } from "react-hook-form";
|
|
5
|
-
import { Select, SelectItem } from "@heroui/select";
|
|
6
|
-
import { useEmperorUI, useFormBuilder } from "@/hooks";
|
|
7
|
-
|
|
8
|
-
export function SelectField<TSchema extends FieldValues>({
|
|
9
|
-
options,
|
|
10
|
-
selectItemProps,
|
|
11
|
-
selectProps,
|
|
12
|
-
name,
|
|
13
|
-
}: Pick<
|
|
14
|
-
FieldProps<TSchema>,
|
|
15
|
-
"options" | "selectItemProps" | "selectProps" | "name"
|
|
16
|
-
>) {
|
|
17
|
-
const { config } = useEmperorUI();
|
|
18
|
-
|
|
19
|
-
const theme = config?.theme?.components?.select;
|
|
20
|
-
|
|
21
|
-
if (!options?.length) {
|
|
22
|
-
throw new Error("Field with type 'select' must include 'options'.");
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const { control } = useFormBuilder<TSchema>();
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<Controller
|
|
29
|
-
control={control}
|
|
30
|
-
name={name}
|
|
31
|
-
render={({ field }) => (
|
|
32
|
-
<Select
|
|
33
|
-
{...theme}
|
|
34
|
-
{...selectProps}
|
|
35
|
-
selectedKeys={field.value ? [String(field.value)] : []}
|
|
36
|
-
onSelectionChange={(keys) => {
|
|
37
|
-
const selectedKey = Array.from(keys)[0];
|
|
38
|
-
field.onChange(selectedKey ? String(selectedKey) : "");
|
|
39
|
-
}}
|
|
40
|
-
>
|
|
41
|
-
{options.map((option) => (
|
|
42
|
-
<SelectItem key={option.key} {...selectItemProps}>
|
|
43
|
-
{option.label}
|
|
44
|
-
</SelectItem>
|
|
45
|
-
))}
|
|
46
|
-
</Select>
|
|
47
|
-
)}
|
|
48
|
-
/>
|
|
49
|
-
);
|
|
50
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import type { FieldProps } from "@/types";
|
|
4
|
-
import { Controller, type FieldValues } from "react-hook-form";
|
|
5
|
-
import { Switch } from "@heroui/switch";
|
|
6
|
-
import { useEmperorUI, useFormBuilder } from "@/hooks";
|
|
7
|
-
|
|
8
|
-
export function SwitchField<TSchema extends FieldValues>({
|
|
9
|
-
switchProps,
|
|
10
|
-
name,
|
|
11
|
-
children,
|
|
12
|
-
}: Pick<FieldProps<TSchema>, "switchProps" | "name" | "children">) {
|
|
13
|
-
const { config } = useEmperorUI();
|
|
14
|
-
|
|
15
|
-
const theme = config?.theme?.components?.switch;
|
|
16
|
-
|
|
17
|
-
const { control } = useFormBuilder<TSchema>();
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<Controller
|
|
21
|
-
control={control}
|
|
22
|
-
name={name}
|
|
23
|
-
render={({ field }) => (
|
|
24
|
-
<Switch
|
|
25
|
-
{...theme}
|
|
26
|
-
{...switchProps}
|
|
27
|
-
isSelected={Boolean(field.value)}
|
|
28
|
-
onValueChange={field.onChange}
|
|
29
|
-
>
|
|
30
|
-
{children}
|
|
31
|
-
</Switch>
|
|
32
|
-
)}
|
|
33
|
-
/>
|
|
34
|
-
);
|
|
35
|
-
}
|