@oyolincc/create 0.3.0 → 0.5.0
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/package.json +2 -2
- package/templates/hono-fullstack/.codegraph/.gitignore +5 -0
- package/templates/hono-fullstack/README.md +22 -1
- package/templates/hono-fullstack/_gitignore +1 -0
- package/templates/hono-fullstack/apps/server/package.json +7 -2
- package/templates/hono-fullstack/apps/server/src/adapters/cloudflare/entry.ts +4 -30
- package/templates/hono-fullstack/apps/server/src/adapters/nodejs/bootstrap.ts +20 -12
- package/templates/hono-fullstack/apps/server/src/adapters/nodejs/entry.ts +7 -57
- package/templates/hono-fullstack/apps/server/src/app.ts +37 -21
- package/templates/hono-fullstack/apps/server/src/config.ts +1 -1
- package/templates/hono-fullstack/apps/server/src/di-container.ts +51 -0
- package/templates/hono-fullstack/apps/server/src/infra/logger/getter.ts +1 -1
- package/templates/hono-fullstack/apps/server/src/infra/logger/pino.ts +21 -34
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/errors.ts +22 -0
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/pass-through/runner.ts +28 -22
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/piscina/runner.ts +11 -34
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/{example → piscina}/worker-entry.ts +6 -2
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/types.ts +2 -16
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/utils/business-error.ts +10 -5
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/utils/message.ts +5 -17
- package/templates/hono-fullstack/apps/server/src/middlewares/cors.ts +16 -22
- package/templates/hono-fullstack/apps/server/src/middlewares/logger.ts +34 -0
- package/templates/hono-fullstack/apps/server/src/modules/example/module.ts +8 -0
- package/templates/hono-fullstack/apps/server/src/modules/example/queries.ts +8 -0
- package/templates/hono-fullstack/apps/server/src/modules/example/routes.ts +74 -68
- package/templates/hono-fullstack/apps/server/src/modules/example/service.test.ts +53 -0
- package/templates/hono-fullstack/apps/server/src/modules/example/service.ts +54 -0
- package/templates/hono-fullstack/apps/server/src/modules/example/types.ts +12 -0
- package/templates/hono-fullstack/apps/server/src/modules/example/work-task/tasks.test.ts +9 -35
- package/templates/hono-fullstack/apps/server/src/modules/example/work-task/tasks.ts +15 -46
- package/templates/hono-fullstack/apps/server/src/shared/errors/defs/index.ts +6 -1
- package/templates/hono-fullstack/apps/server/src/shared/errors/handler.ts +1 -1
- package/templates/hono-fullstack/apps/server/src/shared/network/openapi/index.ts +1 -1
- package/templates/hono-fullstack/apps/server/src/shared/types/app.ts +51 -0
- package/templates/hono-fullstack/apps/server/src/shared/types/db.ts +126 -0
- package/templates/hono-fullstack/apps/server/src/shared/utils/data-access/check.ts +19 -0
- package/templates/hono-fullstack/apps/server/src/shared/utils/data-access/model.ts +47 -0
- package/templates/hono-fullstack/apps/server/src/shared/utils/data-access/params.ts +105 -0
- package/templates/hono-fullstack/apps/server/src/shared/utils/data-access/query.test.ts +139 -0
- package/templates/hono-fullstack/apps/server/src/shared/utils/data-access/query.ts +236 -0
- package/templates/hono-fullstack/apps/server/vite.config.ts +2 -2
- package/templates/hono-fullstack/apps/server/wrangler.jsonc +1 -1
- package/templates/hono-fullstack/apps/stack/frontend/assets/styles.css +6 -0
- package/templates/hono-fullstack/apps/stack/frontend/components/general/ErrorMessage.tsx +3 -1
- package/templates/hono-fullstack/apps/stack/frontend/components/layouts/AppLayout.tsx +2 -1
- package/templates/hono-fullstack/apps/stack/frontend/components/layouts/Header.tsx +14 -2
- package/templates/hono-fullstack/apps/stack/frontend/components/layouts/Page.tsx +2 -1
- package/templates/hono-fullstack/apps/stack/frontend/components/layouts/PageContainer.tsx +4 -1
- package/templates/hono-fullstack/apps/stack/frontend/modules/example/api.ts +16 -9
- package/templates/hono-fullstack/apps/stack/frontend/modules/example/components/ExampleForm.tsx +25 -12
- package/templates/hono-fullstack/apps/stack/frontend/modules/example/components/ExampleList.tsx +13 -4
- package/templates/hono-fullstack/apps/stack/frontend/modules/example/hooks/api-hooks.ts +21 -8
- package/templates/hono-fullstack/apps/stack/frontend/routes/__root.tsx +1 -1
- package/templates/hono-fullstack/apps/stack/frontend/routes/index.tsx +35 -12
- package/templates/hono-fullstack/apps/stack/frontend/shared/network/query-hooks.ts +33 -0
- package/templates/hono-fullstack/apps/stack/package.json +9 -4
- package/templates/hono-fullstack/apps/stack/panda.config.ts +31 -0
- package/templates/hono-fullstack/apps/stack/tsconfig.json +1 -0
- package/templates/hono-fullstack/apps/stack/turbo.json +20 -0
- package/templates/hono-fullstack/apps/stack/vite.config.ts +48 -12
- package/templates/hono-fullstack/apps/stack/wrangler.jsonc +1 -1
- package/templates/hono-fullstack/envs/.env.example.sqlite-d1 +1 -0
- package/templates/hono-fullstack/libs/db/drizzle-kit/sqlite-d1.config.ts +29 -10
- package/templates/hono-fullstack/libs/db/package.json +1 -0
- package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/columns.ts +1 -1
- package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/modules/examples/examples.ts +6 -3
- package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/vo.ts +7 -1
- package/templates/hono-fullstack/libs/definition/README.md +81 -0
- package/templates/hono-fullstack/libs/definition/package.json +3 -1
- package/templates/hono-fullstack/libs/definition/src/constants/index.ts +1 -0
- package/templates/hono-fullstack/libs/definition/src/constants/pagination.ts +3 -0
- package/templates/hono-fullstack/libs/definition/src/modules/common-contracts.ts +24 -0
- package/templates/hono-fullstack/libs/definition/src/modules/example/contracts.ts +34 -0
- package/templates/hono-fullstack/libs/definition/src/modules/example/index.ts +1 -16
- package/templates/hono-fullstack/libs/definition/src/modules/index.ts +2 -0
- package/templates/hono-fullstack/libs/definition/src/modules/vo-generated-types.ts +12 -0
- package/templates/hono-fullstack/libs/ui/.storybook/main.ts +32 -0
- package/templates/hono-fullstack/libs/ui/.storybook/panda.config.ts +22 -0
- package/templates/hono-fullstack/libs/ui/.storybook/preview.tsx +79 -0
- package/templates/hono-fullstack/libs/ui/.storybook/styles.css +1 -0
- package/templates/hono-fullstack/libs/ui/.storybook/vite.config.ts +37 -0
- package/templates/hono-fullstack/libs/ui/components.json +15 -0
- package/templates/hono-fullstack/libs/ui/package.json +114 -0
- package/templates/hono-fullstack/libs/ui/panda.config.ts +41 -0
- package/templates/hono-fullstack/libs/ui/src/Tooltip.tsx +47 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/buttons/Button.tsx +80 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/buttons/CloseButton.tsx +15 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/buttons/IconButton.tsx +10 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/collections/Combobox.tsx +91 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/collections/Select.tsx +88 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/collections/TreeView.tsx +142 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Avatar.tsx +64 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Badge.tsx +7 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Card.tsx +23 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Clipboard.tsx +77 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Icon.tsx +9 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Table.tsx +51 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Tag.tsx +23 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Timeline.tsx +33 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/date-and-time/DatePicker.tsx +255 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/disclosure/Accordion.tsx +48 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/disclosure/Breadcrumb.tsx +50 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/disclosure/Collapsible.tsx +34 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/disclosure/Pagination.tsx +74 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/disclosure/Steps.tsx +91 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/disclosure/Tabs.tsx +37 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/feedback/Alert.tsx +52 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/feedback/Progress.tsx +41 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/feedback/ProgressCircle.tsx +40 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/feedback/Skeleton.tsx +37 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/feedback/Spinner.tsx +7 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/feedback/Toast.tsx +99 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Checkbox.tsx +95 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/ColorPicker.tsx +148 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Editable.tsx +44 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Field.tsx +36 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Fieldset.tsx +34 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/FileUpload.tsx +143 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Input.tsx +7 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/InputAddon.tsx +7 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/InputGroup.tsx +61 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/NativeSelect.tsx +81 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/NumberInput.tsx +63 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/PasswordInput.tsx +76 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/PinInput.tsx +36 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/RadioCard.tsx +96 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/RadioGroup.tsx +61 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/RatingGroup.tsx +106 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/SegmentGroup.tsx +68 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Slider.tsx +87 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Switch.tsx +74 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/TagsInput.tsx +77 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Textarea.tsx +7 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/index.ts +98 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/internal/AbsoluteCenter.tsx +7 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/internal/Loader.tsx +69 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/internal/Span.tsx +5 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/internal/create-layout.ts +18 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/layout/Float.tsx +7 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/layout/Grid.tsx +17 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/layout/Group.tsx +7 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/layout/ScrollArea.tsx +46 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/layout/Separator.tsx +26 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/layout/Stack.tsx +54 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/Dialog.tsx +69 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/Drawer.tsx +49 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/HoverCard.tsx +37 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/Menu.tsx +74 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/OverlayManager.test.ts +124 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/OverlayManager.tsx +189 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/Popover.tsx +57 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/Tooltip.tsx +37 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/typography/Heading.tsx +6 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/typography/Link.tsx +7 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/typography/LinkOverlay.tsx +21 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/typography/Text.tsx +6 -0
- package/templates/hono-fullstack/libs/ui/src/components/atoms/utilities/VisuallyHidden.tsx +13 -0
- package/templates/hono-fullstack/libs/ui/src/hooks.ts +242 -0
- package/templates/hono-fullstack/libs/ui/src/index.ts +19 -0
- package/templates/hono-fullstack/libs/ui/src/theme/animation-styles.ts +50 -0
- package/templates/hono-fullstack/libs/ui/src/theme/breakpoints.ts +7 -0
- package/templates/hono-fullstack/libs/ui/src/theme/conditions.ts +12 -0
- package/templates/hono-fullstack/libs/ui/src/theme/containers.ts +16 -0
- package/templates/hono-fullstack/libs/ui/src/theme/global-css.ts +12 -0
- package/templates/hono-fullstack/libs/ui/src/theme/keyframes.ts +157 -0
- package/templates/hono-fullstack/libs/ui/src/theme/layer-styles.ts +11 -0
- package/templates/hono-fullstack/libs/ui/src/theme/patterns/grid.ts +51 -0
- package/templates/hono-fullstack/libs/ui/src/theme/patterns/index.ts +60 -0
- package/templates/hono-fullstack/libs/ui/src/theme/patterns/stack.ts +46 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/absolute-center.ts +38 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/accordion.ts +68 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/alert.ts +83 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/avatar.ts +155 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/badge.ts +67 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/breadcrumb.ts +69 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/button.ts +149 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/card.ts +36 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/checkbox.ts +120 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/clipboard.ts +22 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/collapsible.ts +26 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/color-picker.ts +299 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/combobox.ts +141 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/date-picker.ts +302 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/dialog.ts +191 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/drawer.ts +170 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/editable.ts +64 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/field.ts +41 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/fieldset.ts +47 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/file-upload.ts +86 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/group.ts +78 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/heading.ts +24 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/hover-card.ts +47 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/icon.ts +25 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/index.ts +120 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/input-addon.ts +51 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/input-group.ts +77 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/input.ts +99 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/link.ts +36 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/menu.ts +114 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/native-select.ts +92 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/number-input.ts +91 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/pagination.ts +9 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/pin-input.ts +33 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/popover.ts +78 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/progress-circle.ts +50 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/progress.ts +112 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/radio-card.ts +223 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/radio-group.ts +78 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/rating-group.ts +98 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/scroll-area.ts +119 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/segment-group.ts +162 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/select.ts +157 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/separator.ts +25 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/skeleton.ts +65 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/slider.ts +164 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/spinner.ts +34 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/steps.ts +162 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/switch.ts +150 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/table.ts +150 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/tabs.ts +128 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/tag.ts +114 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/tags-input.ts +201 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/text.ts +7 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/textarea.ts +90 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/timeline.ts +137 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/toast.ts +52 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/tooltip.ts +44 -0
- package/templates/hono-fullstack/libs/ui/src/theme/recipes/tree-view.ts +200 -0
- package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/colors/amber.ts +91 -0
- package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/colors/gray.ts +103 -0
- package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/colors/green.ts +88 -0
- package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/colors/index.ts +14 -0
- package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/colors/lime.ts +91 -0
- package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/colors/red.ts +88 -0
- package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/index.ts +8 -0
- package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/shadows.ts +46 -0
- package/templates/hono-fullstack/libs/ui/src/theme/text-styles.ts +82 -0
- package/templates/hono-fullstack/libs/ui/src/theme/tokens/animations.ts +8 -0
- package/templates/hono-fullstack/libs/ui/src/theme/tokens/aspect-ratio.ts +6 -0
- package/templates/hono-fullstack/libs/ui/src/theme/tokens/borders.ts +5 -0
- package/templates/hono-fullstack/libs/ui/src/theme/tokens/colors.ts +35 -0
- package/templates/hono-fullstack/libs/ui/src/theme/tokens/durations.ts +11 -0
- package/templates/hono-fullstack/libs/ui/src/theme/tokens/easings.ts +9 -0
- package/templates/hono-fullstack/libs/ui/src/theme/tokens/index.ts +42 -0
- package/templates/hono-fullstack/libs/ui/src/theme/tokens/radii.ts +13 -0
- package/templates/hono-fullstack/libs/ui/src/theme/tokens/sizes.ts +27 -0
- package/templates/hono-fullstack/libs/ui/src/theme/tokens/spacing.ts +41 -0
- package/templates/hono-fullstack/libs/ui/src/theme/tokens/typography.ts +86 -0
- package/templates/hono-fullstack/libs/ui/src/theme/tokens/z-index.ts +43 -0
- package/templates/hono-fullstack/libs/ui/stories/README.md +107 -0
- package/templates/hono-fullstack/libs/ui/stories/actions/Button.stories.tsx +260 -0
- package/templates/hono-fullstack/libs/ui/stories/actions/Clipboard.stories.tsx +87 -0
- package/templates/hono-fullstack/libs/ui/stories/actions/IconButton.stories.tsx +33 -0
- package/templates/hono-fullstack/libs/ui/stories/collections/Combobox.stories.tsx +334 -0
- package/templates/hono-fullstack/libs/ui/stories/collections/Select.stories.tsx +342 -0
- package/templates/hono-fullstack/libs/ui/stories/collections/TreeView.stories.tsx +252 -0
- package/templates/hono-fullstack/libs/ui/stories/color/ColorPicker.stories.tsx +217 -0
- package/templates/hono-fullstack/libs/ui/stories/date/DatePicker.stories.tsx +302 -0
- package/templates/hono-fullstack/libs/ui/stories/disclosure/Accordion.stories.tsx +105 -0
- package/templates/hono-fullstack/libs/ui/stories/disclosure/Collapsible.stories.tsx +55 -0
- package/templates/hono-fullstack/libs/ui/stories/disclosure/Steps.stories.tsx +208 -0
- package/templates/hono-fullstack/libs/ui/stories/disclosure/Tabs.stories.tsx +176 -0
- package/templates/hono-fullstack/libs/ui/stories/display/Avatar.stories.tsx +108 -0
- package/templates/hono-fullstack/libs/ui/stories/display/Badge.stories.tsx +90 -0
- package/templates/hono-fullstack/libs/ui/stories/display/Card.stories.tsx +121 -0
- package/templates/hono-fullstack/libs/ui/stories/display/Heading.stories.tsx +62 -0
- package/templates/hono-fullstack/libs/ui/stories/display/Icon.stories.tsx +51 -0
- package/templates/hono-fullstack/libs/ui/stories/display/Table.stories.tsx +222 -0
- package/templates/hono-fullstack/libs/ui/stories/display/Tag.stories.tsx +168 -0
- package/templates/hono-fullstack/libs/ui/stories/display/Text.stories.tsx +32 -0
- package/templates/hono-fullstack/libs/ui/stories/display/Timeline.stories.tsx +241 -0
- package/templates/hono-fullstack/libs/ui/stories/feedback/Alert.stories.tsx +122 -0
- package/templates/hono-fullstack/libs/ui/stories/feedback/Progress.stories.tsx +163 -0
- package/templates/hono-fullstack/libs/ui/stories/feedback/ProgressCircle.stories.tsx +176 -0
- package/templates/hono-fullstack/libs/ui/stories/feedback/Skeleton.stories.tsx +75 -0
- package/templates/hono-fullstack/libs/ui/stories/feedback/Spinner.stories.tsx +49 -0
- package/templates/hono-fullstack/libs/ui/stories/feedback/Toast.stories.tsx +145 -0
- package/templates/hono-fullstack/libs/ui/stories/forms/Checkbox.stories.tsx +281 -0
- package/templates/hono-fullstack/libs/ui/stories/forms/Editable.stories.tsx +94 -0
- package/templates/hono-fullstack/libs/ui/stories/forms/Field.stories.tsx +72 -0
- package/templates/hono-fullstack/libs/ui/stories/forms/Fieldset.stories.tsx +109 -0
- package/templates/hono-fullstack/libs/ui/stories/forms/FileUpload.stories.tsx +115 -0
- package/templates/hono-fullstack/libs/ui/stories/forms/Form.stories.tsx +120 -0
- package/templates/hono-fullstack/libs/ui/stories/forms/Input.stories.tsx +155 -0
- package/templates/hono-fullstack/libs/ui/stories/forms/InputGroup.stories.tsx +79 -0
- package/templates/hono-fullstack/libs/ui/stories/forms/NativeSelect.stories.tsx +160 -0
- package/templates/hono-fullstack/libs/ui/stories/forms/NumberInput.stories.tsx +149 -0
- package/templates/hono-fullstack/libs/ui/stories/forms/PasswordInput.stories.tsx +141 -0
- package/templates/hono-fullstack/libs/ui/stories/forms/PinInput.stories.tsx +155 -0
- package/templates/hono-fullstack/libs/ui/stories/forms/RadioCard.stories.tsx +265 -0
- package/templates/hono-fullstack/libs/ui/stories/forms/RadioGroup.stories.tsx +109 -0
- package/templates/hono-fullstack/libs/ui/stories/forms/RatingGroup.stories.tsx +123 -0
- package/templates/hono-fullstack/libs/ui/stories/forms/SegmentGroup.stories.tsx +130 -0
- package/templates/hono-fullstack/libs/ui/stories/forms/Slider.stories.tsx +190 -0
- package/templates/hono-fullstack/libs/ui/stories/forms/Switch.stories.tsx +124 -0
- package/templates/hono-fullstack/libs/ui/stories/forms/TagsInput.stories.tsx +154 -0
- package/templates/hono-fullstack/libs/ui/stories/forms/Textarea.stories.tsx +148 -0
- package/templates/hono-fullstack/libs/ui/stories/layout/Grid.stories.tsx +60 -0
- package/templates/hono-fullstack/libs/ui/stories/layout/Positioning.stories.tsx +90 -0
- package/templates/hono-fullstack/libs/ui/stories/layout/ScrollArea.stories.tsx +68 -0
- package/templates/hono-fullstack/libs/ui/stories/layout/Stack.stories.tsx +87 -0
- package/templates/hono-fullstack/libs/ui/stories/navigation/Breadcrumb.stories.tsx +104 -0
- package/templates/hono-fullstack/libs/ui/stories/navigation/Link.stories.tsx +62 -0
- package/templates/hono-fullstack/libs/ui/stories/navigation/LinkBox.stories.tsx +45 -0
- package/templates/hono-fullstack/libs/ui/stories/navigation/Pagination.stories.tsx +74 -0
- package/templates/hono-fullstack/libs/ui/stories/overlays/Dialog.stories.tsx +255 -0
- package/templates/hono-fullstack/libs/ui/stories/overlays/Drawer.stories.tsx +114 -0
- package/templates/hono-fullstack/libs/ui/stories/overlays/HoverCard.stories.tsx +47 -0
- package/templates/hono-fullstack/libs/ui/stories/overlays/Menu.stories.tsx +133 -0
- package/templates/hono-fullstack/libs/ui/stories/overlays/OverlayManager.stories.tsx +206 -0
- package/templates/hono-fullstack/libs/ui/stories/overlays/Popover.stories.tsx +73 -0
- package/templates/hono-fullstack/libs/ui/stories/overlays/Tooltip.stories.tsx +114 -0
- package/templates/hono-fullstack/libs/ui/stories/tsconfig.json +14 -0
- package/templates/hono-fullstack/libs/ui/tsconfig.build.json +5 -0
- package/templates/hono-fullstack/libs/ui/tsconfig.json +13 -0
- package/templates/hono-fullstack/libs/ui/turbo.json +28 -0
- package/templates/hono-fullstack/libs/ui/vite.config.ts +33 -0
- package/templates/hono-fullstack/oyo.config.json +31 -1
- package/templates/hono-fullstack/package.json +1 -0
- package/templates/hono-fullstack/pnpm-workspace.yaml +20 -10
- package/templates/hono-fullstack/turbo.json +10 -0
- package/templates/hono-server/.codegraph/.gitignore +5 -0
- package/templates/hono-server/README.md +9 -1
- package/templates/hono-server/_gitignore +1 -0
- package/templates/hono-server/apps/server/package.json +7 -2
- package/templates/hono-server/apps/server/src/adapters/cloudflare/entry.ts +4 -30
- package/templates/hono-server/apps/server/src/adapters/nodejs/bootstrap.ts +20 -12
- package/templates/hono-server/apps/server/src/adapters/nodejs/entry.ts +7 -57
- package/templates/hono-server/apps/server/src/app.ts +37 -21
- package/templates/hono-server/apps/server/src/config.ts +1 -1
- package/templates/hono-server/apps/server/src/di-container.ts +51 -0
- package/templates/hono-server/apps/server/src/infra/logger/getter.ts +1 -1
- package/templates/hono-server/apps/server/src/infra/logger/pino.ts +21 -34
- package/templates/hono-server/apps/server/src/infra/work-runner/errors.ts +22 -0
- package/templates/hono-server/apps/server/src/infra/work-runner/pass-through/runner.ts +28 -22
- package/templates/hono-server/apps/server/src/infra/work-runner/piscina/runner.ts +11 -34
- package/templates/hono-server/apps/server/src/infra/work-runner/{example → piscina}/worker-entry.ts +6 -2
- package/templates/hono-server/apps/server/src/infra/work-runner/types.ts +2 -16
- package/templates/hono-server/apps/server/src/infra/work-runner/utils/business-error.ts +10 -5
- package/templates/hono-server/apps/server/src/infra/work-runner/utils/message.ts +5 -17
- package/templates/hono-server/apps/server/src/middlewares/cors.ts +16 -22
- package/templates/hono-server/apps/server/src/middlewares/logger.ts +34 -0
- package/templates/hono-server/apps/server/src/modules/example/module.ts +8 -0
- package/templates/hono-server/apps/server/src/modules/example/queries.ts +8 -0
- package/templates/hono-server/apps/server/src/modules/example/routes.ts +74 -68
- package/templates/hono-server/apps/server/src/modules/example/service.test.ts +53 -0
- package/templates/hono-server/apps/server/src/modules/example/service.ts +54 -0
- package/templates/hono-server/apps/server/src/modules/example/types.ts +12 -0
- package/templates/hono-server/apps/server/src/modules/example/work-task/tasks.test.ts +9 -35
- package/templates/hono-server/apps/server/src/modules/example/work-task/tasks.ts +15 -46
- package/templates/hono-server/apps/server/src/shared/errors/defs/index.ts +6 -1
- package/templates/hono-server/apps/server/src/shared/errors/handler.ts +1 -1
- package/templates/hono-server/apps/server/src/shared/network/openapi/index.ts +1 -1
- package/templates/hono-server/apps/server/src/shared/types/app.ts +51 -0
- package/templates/hono-server/apps/server/src/shared/types/db.ts +126 -0
- package/templates/hono-server/apps/server/src/shared/utils/data-access/check.ts +19 -0
- package/templates/hono-server/apps/server/src/shared/utils/data-access/model.ts +47 -0
- package/templates/hono-server/apps/server/src/shared/utils/data-access/params.ts +105 -0
- package/templates/hono-server/apps/server/src/shared/utils/data-access/query.test.ts +139 -0
- package/templates/hono-server/apps/server/src/shared/utils/data-access/query.ts +236 -0
- package/templates/hono-server/apps/server/vite.config.ts +2 -2
- package/templates/hono-server/apps/server/wrangler.jsonc +1 -1
- package/templates/hono-server/docker/README.md +1 -1
- package/templates/hono-server/envs/.env.example.sqlite-d1 +1 -0
- package/templates/hono-server/libs/db/drizzle-kit/sqlite-d1.config.ts +29 -10
- package/templates/hono-server/libs/db/package.json +1 -0
- package/templates/hono-server/libs/db/src/dialects/sqlite/schema/columns.ts +1 -1
- package/templates/hono-server/libs/db/src/dialects/sqlite/schema/modules/examples/examples.ts +6 -3
- package/templates/hono-server/libs/db/src/dialects/sqlite/schema/vo.ts +7 -1
- package/templates/hono-server/libs/definition/README.md +81 -0
- package/templates/hono-server/libs/definition/package.json +3 -1
- package/templates/hono-server/libs/definition/src/constants/index.ts +1 -0
- package/templates/hono-server/libs/definition/src/constants/pagination.ts +3 -0
- package/templates/hono-server/libs/definition/src/modules/common-contracts.ts +24 -0
- package/templates/hono-server/libs/definition/src/modules/example/contracts.ts +34 -0
- package/templates/hono-server/libs/definition/src/modules/example/index.ts +1 -16
- package/templates/hono-server/libs/definition/src/modules/index.ts +2 -0
- package/templates/hono-server/libs/definition/src/modules/vo-generated-types.ts +12 -0
- package/templates/hono-server/oyo.config.json +31 -1
- package/templates/hono-server/package.json +1 -0
- package/templates/hono-server/pnpm-workspace.yaml +9 -7
- package/templates/hono-server/turbo.json +10 -0
- package/templates/monorepo/.codegraph/.gitignore +5 -0
- package/templates/monorepo/_gitignore +1 -0
- package/templates/monorepo/oyo.config.json +7 -1
- package/templates/monorepo/pnpm-workspace.yaml +4 -4
- package/templates/monorepo/turbo.json +10 -0
- package/templates/hono-fullstack/apps/server/src/modules/example/contracts.ts +0 -9
- package/templates/hono-fullstack/apps/server/src/shared/app/types.ts +0 -44
- package/templates/hono-fullstack/apps/stack/frontend/styles.css +0 -23
- package/templates/hono-server/apps/server/src/modules/example/contracts.ts +0 -9
- package/templates/hono-server/apps/server/src/shared/app/types.ts +0 -44
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { ark } from '@ark-ui/react/factory'
|
|
3
|
+
import { useFieldContext } from '@ark-ui/react/field'
|
|
4
|
+
import { EyeIcon, EyeOffIcon } from 'lucide-react'
|
|
5
|
+
import { forwardRef, useId, useState, type ComponentProps, type ReactNode } from 'react'
|
|
6
|
+
import { styled } from 'styled-system/jsx'
|
|
7
|
+
import { IconButton } from '@/components/atoms/buttons/IconButton'
|
|
8
|
+
import { Input, type InputProps } from './Input'
|
|
9
|
+
|
|
10
|
+
const Root = styled(ark.div, { base: { position: 'relative', width: 'full' } })
|
|
11
|
+
|
|
12
|
+
export interface PasswordInputProps extends Omit<InputProps, 'type'> {
|
|
13
|
+
defaultVisible?: boolean
|
|
14
|
+
visible?: boolean
|
|
15
|
+
onVisibleChange?: (visible: boolean) => void
|
|
16
|
+
visibilityIcon?: { on: ReactNode; off: ReactNode }
|
|
17
|
+
rootProps?: ComponentProps<typeof Root>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const PasswordInput = forwardRef<HTMLInputElement, PasswordInputProps>(
|
|
21
|
+
function PasswordInput(
|
|
22
|
+
{
|
|
23
|
+
defaultVisible = false,
|
|
24
|
+
visible: visibleProp,
|
|
25
|
+
onVisibleChange,
|
|
26
|
+
visibilityIcon = { on: <EyeIcon />, off: <EyeOffIcon /> },
|
|
27
|
+
rootProps,
|
|
28
|
+
...props
|
|
29
|
+
},
|
|
30
|
+
ref,
|
|
31
|
+
) {
|
|
32
|
+
const [localVisible, setLocalVisible] = useState(defaultVisible)
|
|
33
|
+
const field = useFieldContext()
|
|
34
|
+
const generatedId = useId()
|
|
35
|
+
const id = props.id || field?.ids.control || generatedId
|
|
36
|
+
const visible = visibleProp !== undefined ? visibleProp : localVisible
|
|
37
|
+
const disabled = Boolean(props.disabled || field?.disabled)
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<Root {...rootProps}>
|
|
41
|
+
<Input
|
|
42
|
+
paddingInlineEnd="var(--input-height, 2.5em)"
|
|
43
|
+
{...props}
|
|
44
|
+
id={id}
|
|
45
|
+
disabled={disabled}
|
|
46
|
+
ref={ref}
|
|
47
|
+
type={visible ? 'text' : 'password'}
|
|
48
|
+
/>
|
|
49
|
+
<IconButton
|
|
50
|
+
type="button"
|
|
51
|
+
variant="plain"
|
|
52
|
+
size="sm"
|
|
53
|
+
disabled={disabled}
|
|
54
|
+
position="absolute"
|
|
55
|
+
insetInlineEnd="1"
|
|
56
|
+
top="50%"
|
|
57
|
+
transform="translateY(-50%)"
|
|
58
|
+
height="calc(100% - 8px)"
|
|
59
|
+
aspectRatio="square"
|
|
60
|
+
aria-label={visible ? 'Hide password' : 'Show password'}
|
|
61
|
+
aria-controls={id}
|
|
62
|
+
aria-pressed={visible}
|
|
63
|
+
onPointerDown={(event) => {
|
|
64
|
+
if (event.button === 0) event.preventDefault()
|
|
65
|
+
}}
|
|
66
|
+
onClick={() => {
|
|
67
|
+
const next = !visible
|
|
68
|
+
if (visibleProp === undefined) setLocalVisible(next)
|
|
69
|
+
onVisibleChange?.(next)
|
|
70
|
+
}}>
|
|
71
|
+
{visible ? visibilityIcon.off : visibilityIcon.on}
|
|
72
|
+
</IconButton>
|
|
73
|
+
</Root>
|
|
74
|
+
)
|
|
75
|
+
},
|
|
76
|
+
)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { PinInput } from '@ark-ui/react/pin-input'
|
|
3
|
+
import type { ComponentProps } from 'react'
|
|
4
|
+
import { createSlotRecipeContext } from 'styled-system/jsx'
|
|
5
|
+
import { pinInput, type PinInputVariantProps } from 'styled-system/recipes'
|
|
6
|
+
import type { StyledComponent } from 'styled-system/types'
|
|
7
|
+
|
|
8
|
+
const { withProvider, withContext } = createSlotRecipeContext(pinInput)
|
|
9
|
+
|
|
10
|
+
export type RootProps = ComponentProps<typeof Root>
|
|
11
|
+
// Preserve Ark’s boolean mask prop without comparing Panda’s large CSS property union.
|
|
12
|
+
export const Root = withProvider(PinInput.Root, 'root', {
|
|
13
|
+
forwardProps: ['mask'],
|
|
14
|
+
}) as unknown as StyledComponent<typeof PinInput.Root, PinInputVariantProps & { mask?: boolean }>
|
|
15
|
+
export const RootProvider: StyledComponent<typeof PinInput.RootProvider, PinInputVariantProps> =
|
|
16
|
+
withProvider(PinInput.RootProvider, 'root')
|
|
17
|
+
export const Control = withContext(PinInput.Control, 'control')
|
|
18
|
+
export const HiddenInput = PinInput.HiddenInput
|
|
19
|
+
export const Input = withContext(PinInput.Input, 'input')
|
|
20
|
+
export const Label = withContext(PinInput.Label, 'label')
|
|
21
|
+
|
|
22
|
+
export { PinInputContext as Context } from '@ark-ui/react/pin-input'
|
|
23
|
+
|
|
24
|
+
export { usePinInput, type UsePinInputProps, type UsePinInputReturn } from '@ark-ui/react/pin-input'
|
|
25
|
+
|
|
26
|
+
export type RootProviderProps = ComponentProps<typeof RootProvider>
|
|
27
|
+
export type ControlProps = ComponentProps<typeof Control>
|
|
28
|
+
export type HiddenInputProps = ComponentProps<typeof HiddenInput>
|
|
29
|
+
export type InputProps = ComponentProps<typeof Input>
|
|
30
|
+
export type LabelProps = ComponentProps<typeof Label>
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
usePinInputContext,
|
|
34
|
+
type PinInputValueChangeDetails as ValueChangeDetails,
|
|
35
|
+
type PinInputValueInvalidDetails as ValueInvalidDetails,
|
|
36
|
+
} from '@ark-ui/react/pin-input'
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { ark } from '@ark-ui/react/factory'
|
|
3
|
+
import { RadioGroup, useRadioGroupItemContext } from '@ark-ui/react/radio-group'
|
|
4
|
+
import { type ComponentProps, forwardRef, type ReactElement } from 'react'
|
|
5
|
+
import { createSlotRecipeContext } from 'styled-system/jsx'
|
|
6
|
+
import { radioCard, type RadioCardVariantProps } from 'styled-system/recipes'
|
|
7
|
+
import type { StyledComponent } from 'styled-system/types'
|
|
8
|
+
|
|
9
|
+
const { withProvider, withContext } = createSlotRecipeContext(radioCard)
|
|
10
|
+
|
|
11
|
+
export type RootProps = ComponentProps<typeof Root>
|
|
12
|
+
export const Root: StyledComponent<typeof RadioGroup.Root, RadioCardVariantProps> = withProvider(
|
|
13
|
+
RadioGroup.Root,
|
|
14
|
+
'root',
|
|
15
|
+
)
|
|
16
|
+
export const RootProvider: StyledComponent<typeof RadioGroup.RootProvider, RadioCardVariantProps> =
|
|
17
|
+
withProvider(RadioGroup.RootProvider, 'root')
|
|
18
|
+
export const Item = withContext(RadioGroup.Item, 'item')
|
|
19
|
+
const StyledItemControl: StyledComponent<typeof ark.div> = withContext(ark.div, 'itemControl')
|
|
20
|
+
export type ItemControlProps = ComponentProps<typeof StyledItemControl>
|
|
21
|
+
|
|
22
|
+
export const ItemControl = forwardRef<HTMLDivElement, ItemControlProps>(
|
|
23
|
+
function ItemControl(props, ref) {
|
|
24
|
+
const item = useRadioGroupItemContext()
|
|
25
|
+
return (
|
|
26
|
+
<StyledItemControl
|
|
27
|
+
data-scope="radio-card"
|
|
28
|
+
data-part="item-control"
|
|
29
|
+
data-state={item.checked ? 'checked' : 'unchecked'}
|
|
30
|
+
data-focus={item.focused ? '' : undefined}
|
|
31
|
+
data-disabled={item.disabled ? '' : undefined}
|
|
32
|
+
data-hover={item.hovered ? '' : undefined}
|
|
33
|
+
data-active={item.active ? '' : undefined}
|
|
34
|
+
data-invalid={item.invalid ? '' : undefined}
|
|
35
|
+
{...props}
|
|
36
|
+
ref={ref}
|
|
37
|
+
/>
|
|
38
|
+
)
|
|
39
|
+
},
|
|
40
|
+
)
|
|
41
|
+
export const ItemContent = withContext(ark.div, 'itemContent')
|
|
42
|
+
export const ItemDescription = withContext(ark.div, 'itemDescription')
|
|
43
|
+
export const ItemAddon = withContext(ark.div, 'itemAddon')
|
|
44
|
+
export const ItemText = withContext(RadioGroup.ItemText, 'itemText')
|
|
45
|
+
export const Label = withContext(RadioGroup.Label, 'label')
|
|
46
|
+
export const ItemHiddenInput = RadioGroup.ItemHiddenInput
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
RadioGroupContext as Context,
|
|
50
|
+
RadioGroupItemContext as ItemContext,
|
|
51
|
+
} from '@ark-ui/react/radio-group'
|
|
52
|
+
|
|
53
|
+
const StyledItemIndicator: StyledComponent<typeof ark.span> = withContext(ark.span, 'itemIndicator')
|
|
54
|
+
|
|
55
|
+
export interface ItemIndicatorProps extends ComponentProps<typeof StyledItemIndicator> {
|
|
56
|
+
checked?: ReactElement | undefined
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const ItemIndicator = forwardRef<HTMLSpanElement, ItemIndicatorProps>(function ItemIndicator(
|
|
60
|
+
{ checked, children, asChild, ...props },
|
|
61
|
+
ref,
|
|
62
|
+
) {
|
|
63
|
+
const item = useRadioGroupItemContext()
|
|
64
|
+
const customChecked = item.checked && checked !== undefined
|
|
65
|
+
return (
|
|
66
|
+
<StyledItemIndicator
|
|
67
|
+
data-scope="radio-card"
|
|
68
|
+
data-part="item-indicator"
|
|
69
|
+
data-state={item.checked ? 'checked' : 'unchecked'}
|
|
70
|
+
data-disabled={item.disabled ? '' : undefined}
|
|
71
|
+
data-invalid={item.invalid ? '' : undefined}
|
|
72
|
+
data-custom={customChecked || children !== undefined || asChild ? '' : undefined}
|
|
73
|
+
aria-hidden="true"
|
|
74
|
+
{...props}
|
|
75
|
+
ref={ref}
|
|
76
|
+
asChild={asChild || customChecked}>
|
|
77
|
+
{customChecked ? checked : children}
|
|
78
|
+
</StyledItemIndicator>
|
|
79
|
+
)
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
export {
|
|
83
|
+
useRadioGroup,
|
|
84
|
+
type UseRadioGroupProps,
|
|
85
|
+
type UseRadioGroupReturn,
|
|
86
|
+
type RadioGroupValueChangeDetails as ValueChangeDetails,
|
|
87
|
+
} from '@ark-ui/react/radio-group'
|
|
88
|
+
|
|
89
|
+
export type RootProviderProps = ComponentProps<typeof RootProvider>
|
|
90
|
+
export type ItemProps = ComponentProps<typeof Item>
|
|
91
|
+
export type ItemContentProps = ComponentProps<typeof ItemContent>
|
|
92
|
+
export type ItemDescriptionProps = ComponentProps<typeof ItemDescription>
|
|
93
|
+
export type ItemAddonProps = ComponentProps<typeof ItemAddon>
|
|
94
|
+
export type ItemTextProps = ComponentProps<typeof ItemText>
|
|
95
|
+
export type LabelProps = ComponentProps<typeof Label>
|
|
96
|
+
export type ItemHiddenInputProps = ComponentProps<typeof ItemHiddenInput>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { ark } from '@ark-ui/react/factory'
|
|
3
|
+
import { RadioGroup } from '@ark-ui/react/radio-group'
|
|
4
|
+
import { type ComponentProps, forwardRef } from 'react'
|
|
5
|
+
import { createSlotRecipeContext } from 'styled-system/jsx'
|
|
6
|
+
import { radioGroup, type RadioGroupVariantProps } from 'styled-system/recipes'
|
|
7
|
+
|
|
8
|
+
import type { StyledComponent } from 'styled-system/types'
|
|
9
|
+
|
|
10
|
+
const { withProvider, withContext } = createSlotRecipeContext(radioGroup)
|
|
11
|
+
|
|
12
|
+
export type RootProps = ComponentProps<typeof Root>
|
|
13
|
+
export type ItemProps = ComponentProps<typeof Item>
|
|
14
|
+
|
|
15
|
+
export const Root: StyledComponent<typeof RadioGroup.Root, RadioGroupVariantProps> = withProvider(
|
|
16
|
+
RadioGroup.Root,
|
|
17
|
+
'root',
|
|
18
|
+
)
|
|
19
|
+
export const RootProvider: StyledComponent<typeof RadioGroup.RootProvider, RadioGroupVariantProps> =
|
|
20
|
+
withProvider(RadioGroup.RootProvider, 'root')
|
|
21
|
+
export const Item = withContext(RadioGroup.Item, 'item')
|
|
22
|
+
export const ItemControl = withContext(RadioGroup.ItemControl, 'itemControl')
|
|
23
|
+
const StyledItemIndicator: StyledComponent<typeof ark.span> = withContext(ark.span, 'itemControl')
|
|
24
|
+
export type ItemIndicatorProps = ComponentProps<typeof StyledItemIndicator>
|
|
25
|
+
export const ItemIndicator = forwardRef<HTMLSpanElement, ItemIndicatorProps>(
|
|
26
|
+
function ItemIndicator(props, ref) {
|
|
27
|
+
return (
|
|
28
|
+
<RadioGroup.ItemControl asChild>
|
|
29
|
+
<StyledItemIndicator
|
|
30
|
+
data-custom={props.children !== undefined || props.asChild ? '' : undefined}
|
|
31
|
+
{...props}
|
|
32
|
+
ref={ref}
|
|
33
|
+
/>
|
|
34
|
+
</RadioGroup.ItemControl>
|
|
35
|
+
)
|
|
36
|
+
},
|
|
37
|
+
)
|
|
38
|
+
export const ItemText = withContext(RadioGroup.ItemText, 'itemText')
|
|
39
|
+
export const Label = withContext(RadioGroup.Label, 'label')
|
|
40
|
+
export const ItemHiddenInput = RadioGroup.ItemHiddenInput
|
|
41
|
+
|
|
42
|
+
export { RadioGroupContext as Context } from '@ark-ui/react/radio-group'
|
|
43
|
+
|
|
44
|
+
export {
|
|
45
|
+
useRadioGroup,
|
|
46
|
+
type UseRadioGroupProps,
|
|
47
|
+
type UseRadioGroupReturn,
|
|
48
|
+
} from '@ark-ui/react/radio-group'
|
|
49
|
+
|
|
50
|
+
export type RootProviderProps = ComponentProps<typeof RootProvider>
|
|
51
|
+
export type ItemControlProps = ComponentProps<typeof ItemControl>
|
|
52
|
+
export type ItemTextProps = ComponentProps<typeof ItemText>
|
|
53
|
+
export type LabelProps = ComponentProps<typeof Label>
|
|
54
|
+
export type ItemHiddenInputProps = ComponentProps<typeof ItemHiddenInput>
|
|
55
|
+
|
|
56
|
+
export {
|
|
57
|
+
useRadioGroupContext,
|
|
58
|
+
useRadioGroupItemContext,
|
|
59
|
+
RadioGroupItemContext as ItemContext,
|
|
60
|
+
type RadioGroupValueChangeDetails as ValueChangeDetails,
|
|
61
|
+
} from '@ark-ui/react/radio-group'
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import {
|
|
3
|
+
RatingGroup,
|
|
4
|
+
useRatingGroupContext,
|
|
5
|
+
useRatingGroupItemContext,
|
|
6
|
+
} from '@ark-ui/react/rating-group'
|
|
7
|
+
import { StarIcon } from 'lucide-react'
|
|
8
|
+
import {
|
|
9
|
+
type ComponentProps,
|
|
10
|
+
cloneElement,
|
|
11
|
+
forwardRef,
|
|
12
|
+
isValidElement,
|
|
13
|
+
type ReactElement,
|
|
14
|
+
} from 'react'
|
|
15
|
+
import { createSlotRecipeContext, type HTMLStyledProps } from 'styled-system/jsx'
|
|
16
|
+
import { ratingGroup, type RatingGroupVariantProps } from 'styled-system/recipes'
|
|
17
|
+
import type { StyledComponent } from 'styled-system/types'
|
|
18
|
+
|
|
19
|
+
const { withProvider, withContext } = createSlotRecipeContext(ratingGroup)
|
|
20
|
+
|
|
21
|
+
export type RootProps = ComponentProps<typeof Root>
|
|
22
|
+
export const Root: StyledComponent<typeof RatingGroup.Root, RatingGroupVariantProps> = withProvider(
|
|
23
|
+
RatingGroup.Root,
|
|
24
|
+
'root',
|
|
25
|
+
)
|
|
26
|
+
export const RootProvider: StyledComponent<
|
|
27
|
+
typeof RatingGroup.RootProvider,
|
|
28
|
+
RatingGroupVariantProps
|
|
29
|
+
> = withProvider(RatingGroup.RootProvider, 'root')
|
|
30
|
+
export const Item = withContext(RatingGroup.Item, 'item')
|
|
31
|
+
export const Label = withContext(RatingGroup.Label, 'label')
|
|
32
|
+
|
|
33
|
+
export const HiddenInput = RatingGroup.HiddenInput
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
RatingGroupContext as Context,
|
|
37
|
+
RatingGroupItemContext as ItemContext,
|
|
38
|
+
} from '@ark-ui/react/rating-group'
|
|
39
|
+
|
|
40
|
+
export interface ItemIndicatorProps extends HTMLStyledProps<'span'> {
|
|
41
|
+
icon?: ReactElement | undefined
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const StyledItemIndicator = withContext('span', 'itemIndicator')
|
|
45
|
+
|
|
46
|
+
const cloneIcon = (icon: ReactElement, type: string) => {
|
|
47
|
+
if (!isValidElement(icon)) return null
|
|
48
|
+
const props = { [`data-${type}`]: '', 'aria-hidden': true, fill: 'currentColor' }
|
|
49
|
+
return cloneElement(icon, props)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const ItemIndicator = forwardRef<HTMLSpanElement, ItemIndicatorProps>(
|
|
53
|
+
function ItemIndicator(props, ref) {
|
|
54
|
+
const { icon = <StarIcon />, ...rest } = props
|
|
55
|
+
const item = useRatingGroupItemContext()
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<StyledItemIndicator
|
|
59
|
+
ref={ref}
|
|
60
|
+
{...rest}
|
|
61
|
+
data-highlighted={item.highlighted ? '' : undefined}
|
|
62
|
+
data-checked={item.checked ? '' : undefined}
|
|
63
|
+
data-half={item.half ? '' : undefined}>
|
|
64
|
+
{cloneIcon(icon, 'bg')}
|
|
65
|
+
{cloneIcon(icon, 'fg')}
|
|
66
|
+
</StyledItemIndicator>
|
|
67
|
+
)
|
|
68
|
+
},
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
export interface ItemsProps extends Omit<ComponentProps<typeof Item>, 'index'> {
|
|
72
|
+
icon?: ReactElement | undefined
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const Items = (props: ItemsProps) => {
|
|
76
|
+
const { icon, ...rest } = props
|
|
77
|
+
const ratingGroup = useRatingGroupContext()
|
|
78
|
+
return ratingGroup.items.map((item) => (
|
|
79
|
+
<Item key={item} index={item} {...rest}>
|
|
80
|
+
<ItemIndicator icon={icon} />
|
|
81
|
+
</Item>
|
|
82
|
+
))
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export const Control = withContext(RatingGroup.Control, 'control', {
|
|
86
|
+
defaultProps: { children: <Items /> },
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
useRatingGroup,
|
|
91
|
+
type UseRatingGroupProps,
|
|
92
|
+
type UseRatingGroupReturn,
|
|
93
|
+
} from '@ark-ui/react/rating-group'
|
|
94
|
+
|
|
95
|
+
export type RootProviderProps = ComponentProps<typeof RootProvider>
|
|
96
|
+
export type ItemProps = ComponentProps<typeof Item>
|
|
97
|
+
export type LabelProps = ComponentProps<typeof Label>
|
|
98
|
+
export type HiddenInputProps = ComponentProps<typeof HiddenInput>
|
|
99
|
+
export type ControlProps = ComponentProps<typeof Control>
|
|
100
|
+
|
|
101
|
+
export {
|
|
102
|
+
useRatingGroupContext,
|
|
103
|
+
useRatingGroupItemContext,
|
|
104
|
+
type RatingGroupHoverChangeDetails as HoverChangeDetails,
|
|
105
|
+
type RatingGroupValueChangeDetails as ValueChangeDetails,
|
|
106
|
+
} from '@ark-ui/react/rating-group'
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { SegmentGroup } from '@ark-ui/react/segment-group'
|
|
3
|
+
import { type ComponentProps, type ReactNode } from 'react'
|
|
4
|
+
import { createSlotRecipeContext } from 'styled-system/jsx'
|
|
5
|
+
import { segmentGroup, type SegmentGroupVariantProps } from 'styled-system/recipes'
|
|
6
|
+
import type { StyledComponent } from 'styled-system/types'
|
|
7
|
+
|
|
8
|
+
const { withProvider, withContext } = createSlotRecipeContext(segmentGroup)
|
|
9
|
+
|
|
10
|
+
export type RootProps = ComponentProps<typeof Root>
|
|
11
|
+
|
|
12
|
+
export const Root: StyledComponent<typeof SegmentGroup.Root, SegmentGroupVariantProps> =
|
|
13
|
+
withProvider(SegmentGroup.Root, 'root', {
|
|
14
|
+
defaultProps: { orientation: 'horizontal' },
|
|
15
|
+
forwardProps: ['orientation'],
|
|
16
|
+
})
|
|
17
|
+
export const RootProvider: StyledComponent<
|
|
18
|
+
typeof SegmentGroup.RootProvider,
|
|
19
|
+
SegmentGroupVariantProps
|
|
20
|
+
> = withProvider(SegmentGroup.RootProvider, 'root')
|
|
21
|
+
export const Indicator = withContext(SegmentGroup.Indicator, 'indicator')
|
|
22
|
+
export const Item = withContext(SegmentGroup.Item, 'item')
|
|
23
|
+
export const ItemControl = withContext(SegmentGroup.ItemControl, 'itemControl')
|
|
24
|
+
export const ItemHiddenInput = SegmentGroup.ItemHiddenInput
|
|
25
|
+
export const ItemText = withContext(SegmentGroup.ItemText, 'itemText')
|
|
26
|
+
export const Label = withContext(SegmentGroup.Label, 'label')
|
|
27
|
+
|
|
28
|
+
export { SegmentGroupContext as Context } from '@ark-ui/react/segment-group'
|
|
29
|
+
|
|
30
|
+
interface Item {
|
|
31
|
+
value: string
|
|
32
|
+
label: ReactNode
|
|
33
|
+
disabled?: boolean | undefined
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type ItemProps = ComponentProps<typeof Item>
|
|
37
|
+
|
|
38
|
+
export interface ItemsProps extends Omit<ItemProps, 'value'> {
|
|
39
|
+
items: Array<string | Item>
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const Items = (props: ItemsProps) => {
|
|
43
|
+
const { items, ...itemProps } = props
|
|
44
|
+
const data = items.map((item) => (typeof item === 'string' ? { value: item, label: item } : item))
|
|
45
|
+
|
|
46
|
+
return data.map((item) => (
|
|
47
|
+
<Item key={item.value} value={item.value} disabled={item.disabled} {...itemProps}>
|
|
48
|
+
<ItemText>{item.label}</ItemText>
|
|
49
|
+
<ItemHiddenInput />
|
|
50
|
+
</Item>
|
|
51
|
+
))
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export type RootProviderProps = ComponentProps<typeof RootProvider>
|
|
55
|
+
export type IndicatorProps = ComponentProps<typeof Indicator>
|
|
56
|
+
export type ItemControlProps = ComponentProps<typeof ItemControl>
|
|
57
|
+
export type ItemHiddenInputProps = ComponentProps<typeof ItemHiddenInput>
|
|
58
|
+
export type ItemTextProps = ComponentProps<typeof ItemText>
|
|
59
|
+
export type LabelProps = ComponentProps<typeof Label>
|
|
60
|
+
|
|
61
|
+
export {
|
|
62
|
+
useSegmentGroup,
|
|
63
|
+
useSegmentGroupContext,
|
|
64
|
+
useSegmentGroupItemContext,
|
|
65
|
+
type UseSegmentGroupProps,
|
|
66
|
+
type UseSegmentGroupReturn,
|
|
67
|
+
type SegmentGroupValueChangeDetails as ValueChangeDetails,
|
|
68
|
+
} from '@ark-ui/react/segment-group'
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { ark } from '@ark-ui/react/factory'
|
|
3
|
+
import { Slider, useSliderContext } from '@ark-ui/react/slider'
|
|
4
|
+
import { type ComponentProps, forwardRef } from 'react'
|
|
5
|
+
import { createSlotRecipeContext } from 'styled-system/jsx'
|
|
6
|
+
import { slider, type SliderVariantProps } from 'styled-system/recipes'
|
|
7
|
+
import type { StyledComponent } from 'styled-system/types'
|
|
8
|
+
|
|
9
|
+
const { withProvider, withContext } = createSlotRecipeContext(slider)
|
|
10
|
+
|
|
11
|
+
export const Root: StyledComponent<typeof Slider.Root, SliderVariantProps> = withProvider(
|
|
12
|
+
Slider.Root,
|
|
13
|
+
'root',
|
|
14
|
+
{ forwardProps: ['orientation'] },
|
|
15
|
+
)
|
|
16
|
+
export const RootProvider: StyledComponent<typeof Slider.RootProvider, SliderVariantProps> =
|
|
17
|
+
withProvider(Slider.RootProvider, 'root')
|
|
18
|
+
export const Control = withContext(Slider.Control, 'control')
|
|
19
|
+
export const DraggingIndicator = withContext(Slider.DraggingIndicator, 'draggingIndicator')
|
|
20
|
+
export const Label = withContext(Slider.Label, 'label')
|
|
21
|
+
export const Marker = withContext(Slider.Marker, 'marker')
|
|
22
|
+
export const MarkerIndicator = withContext(ark.div, 'markerIndicator')
|
|
23
|
+
export const MarkerGroup = withContext(Slider.MarkerGroup, 'markerGroup')
|
|
24
|
+
export const Range = withContext(Slider.Range, 'range')
|
|
25
|
+
export const Thumb = withContext(Slider.Thumb, 'thumb')
|
|
26
|
+
export const Track = withContext(Slider.Track, 'track')
|
|
27
|
+
export const ValueText = withContext(Slider.ValueText, 'valueText')
|
|
28
|
+
export const HiddenInput = Slider.HiddenInput
|
|
29
|
+
|
|
30
|
+
export { SliderContext as Context } from '@ark-ui/react/slider'
|
|
31
|
+
|
|
32
|
+
export type RootProps = ComponentProps<typeof Root>
|
|
33
|
+
export type MarkerGroupProps = ComponentProps<typeof MarkerGroup>
|
|
34
|
+
export type ThumbProps = ComponentProps<typeof Thumb>
|
|
35
|
+
|
|
36
|
+
export interface MarksProps extends MarkerGroupProps {
|
|
37
|
+
marks?: Array<number | { value: number; label: React.ReactNode }> | undefined
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const Marks = forwardRef<HTMLDivElement, MarksProps>(function Marks(props, ref) {
|
|
41
|
+
const { marks, ...rest } = props
|
|
42
|
+
if (!marks?.length) return null
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<MarkerGroup ref={ref} {...rest}>
|
|
46
|
+
{marks.map((mark, index) => {
|
|
47
|
+
const value = typeof mark === 'number' ? mark : mark.value
|
|
48
|
+
const label = typeof mark === 'number' ? undefined : mark.label
|
|
49
|
+
return (
|
|
50
|
+
<Marker key={index} value={value}>
|
|
51
|
+
<MarkerIndicator />
|
|
52
|
+
{label != null && <span>{label}</span>}
|
|
53
|
+
</Marker>
|
|
54
|
+
)
|
|
55
|
+
})}
|
|
56
|
+
</MarkerGroup>
|
|
57
|
+
)
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
export const Thumbs = (props: Omit<ThumbProps, 'index'>) => {
|
|
61
|
+
const slider = useSliderContext()
|
|
62
|
+
return slider.value.map((_, index) => (
|
|
63
|
+
<Thumb key={index} index={index} {...props}>
|
|
64
|
+
<HiddenInput />
|
|
65
|
+
</Thumb>
|
|
66
|
+
))
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export { useSlider, type UseSliderProps, type UseSliderReturn } from '@ark-ui/react/slider'
|
|
70
|
+
|
|
71
|
+
export type RootProviderProps = ComponentProps<typeof RootProvider>
|
|
72
|
+
export type ControlProps = ComponentProps<typeof Control>
|
|
73
|
+
export type DraggingIndicatorProps = ComponentProps<typeof DraggingIndicator>
|
|
74
|
+
export type LabelProps = ComponentProps<typeof Label>
|
|
75
|
+
export type MarkerProps = ComponentProps<typeof Marker>
|
|
76
|
+
export type MarkerIndicatorProps = ComponentProps<typeof MarkerIndicator>
|
|
77
|
+
export type RangeProps = ComponentProps<typeof Range>
|
|
78
|
+
export type TrackProps = ComponentProps<typeof Track>
|
|
79
|
+
export type ValueTextProps = ComponentProps<typeof ValueText>
|
|
80
|
+
export type HiddenInputProps = ComponentProps<typeof HiddenInput>
|
|
81
|
+
export type ThumbsProps = ComponentProps<typeof Thumbs>
|
|
82
|
+
|
|
83
|
+
export {
|
|
84
|
+
useSliderContext,
|
|
85
|
+
type SliderFocusChangeDetails as FocusChangeDetails,
|
|
86
|
+
type SliderValueChangeDetails as ValueChangeDetails,
|
|
87
|
+
} from '@ark-ui/react/slider'
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { ark } from '@ark-ui/react/factory'
|
|
3
|
+
import { Switch, useSwitchContext } from '@ark-ui/react/switch'
|
|
4
|
+
import { type ComponentProps, forwardRef, type ReactNode } from 'react'
|
|
5
|
+
import { createSlotRecipeContext, styled } from 'styled-system/jsx'
|
|
6
|
+
import { switchRecipe, type SwitchRecipeVariantProps } from 'styled-system/recipes'
|
|
7
|
+
|
|
8
|
+
import type { StyledComponent } from 'styled-system/types'
|
|
9
|
+
|
|
10
|
+
const { withProvider, withContext } = createSlotRecipeContext(switchRecipe)
|
|
11
|
+
|
|
12
|
+
export type RootProps = ComponentProps<typeof Root>
|
|
13
|
+
export const Root: StyledComponent<typeof Switch.Root, SwitchRecipeVariantProps> = withProvider(
|
|
14
|
+
Switch.Root,
|
|
15
|
+
'root',
|
|
16
|
+
)
|
|
17
|
+
export const RootProvider: StyledComponent<typeof Switch.RootProvider, SwitchRecipeVariantProps> =
|
|
18
|
+
withProvider(Switch.RootProvider, 'root')
|
|
19
|
+
export const Label = withContext(Switch.Label, 'label')
|
|
20
|
+
export const Thumb = withContext(Switch.Thumb, 'thumb')
|
|
21
|
+
export const HiddenInput = Switch.HiddenInput
|
|
22
|
+
|
|
23
|
+
export const Control = withContext(Switch.Control, 'control', {
|
|
24
|
+
defaultProps: { children: <Thumb /> },
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
export { SwitchContext as Context } from '@ark-ui/react/switch'
|
|
28
|
+
|
|
29
|
+
export interface IndicatorProps extends ComponentProps<typeof StyledIndicator> {
|
|
30
|
+
fallback?: ReactNode | undefined
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const StyledIndicator = withContext(ark.span, 'indicator')
|
|
34
|
+
export const Indicator = forwardRef<HTMLSpanElement, IndicatorProps>(
|
|
35
|
+
function Indicator(props, ref) {
|
|
36
|
+
const { fallback, children, ...rest } = props
|
|
37
|
+
const api = useSwitchContext()
|
|
38
|
+
return (
|
|
39
|
+
<StyledIndicator ref={ref} data-checked={api.checked ? '' : undefined} {...rest}>
|
|
40
|
+
{api.checked ? children : fallback}
|
|
41
|
+
</StyledIndicator>
|
|
42
|
+
)
|
|
43
|
+
},
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
export interface ThumbIndicatorProps extends ComponentProps<typeof StyledThumbIndicator> {
|
|
47
|
+
fallback?: React.ReactNode | undefined
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const StyledThumbIndicator = styled(ark.span)
|
|
51
|
+
export const ThumbIndicator = forwardRef<HTMLSpanElement, ThumbIndicatorProps>(
|
|
52
|
+
function SwitchThumbIndicator(props, ref) {
|
|
53
|
+
const { fallback, children, ...rest } = props
|
|
54
|
+
const api = useSwitchContext()
|
|
55
|
+
return (
|
|
56
|
+
<StyledThumbIndicator ref={ref} data-checked={api.checked ? '' : undefined} {...rest}>
|
|
57
|
+
{api.checked ? children : fallback}
|
|
58
|
+
</StyledThumbIndicator>
|
|
59
|
+
)
|
|
60
|
+
},
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
export { useSwitch, type UseSwitchProps, type UseSwitchReturn } from '@ark-ui/react/switch'
|
|
64
|
+
|
|
65
|
+
export type RootProviderProps = ComponentProps<typeof RootProvider>
|
|
66
|
+
export type LabelProps = ComponentProps<typeof Label>
|
|
67
|
+
export type ThumbProps = ComponentProps<typeof Thumb>
|
|
68
|
+
export type HiddenInputProps = ComponentProps<typeof HiddenInput>
|
|
69
|
+
export type ControlProps = ComponentProps<typeof Control>
|
|
70
|
+
|
|
71
|
+
export {
|
|
72
|
+
useSwitchContext,
|
|
73
|
+
type SwitchCheckedChangeDetails as CheckedChangeDetails,
|
|
74
|
+
} from '@ark-ui/react/switch'
|