@oyolincc/create 0.4.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 +3 -3
- package/templates/hono-fullstack/apps/stack/frontend/routes/__root.tsx +1 -1
- package/templates/hono-fullstack/apps/stack/frontend/routes/index.tsx +16 -4
- 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 +30 -4
- 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 +30 -4
- 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 +6 -4
- 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,148 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { ColorPicker } from '@ark-ui/react/color-picker'
|
|
3
|
+
import { ark } from '@ark-ui/react/factory'
|
|
4
|
+
import { CheckIcon, PipetteIcon } from 'lucide-react'
|
|
5
|
+
import type { ComponentProps, Provider, JSX } from 'react'
|
|
6
|
+
import type { StyledComponent } from 'styled-system/types'
|
|
7
|
+
import { createSlotRecipeContext } from 'styled-system/jsx'
|
|
8
|
+
import { colorPicker, type ColorPickerVariantProps } from 'styled-system/recipes'
|
|
9
|
+
|
|
10
|
+
const {
|
|
11
|
+
withProvider,
|
|
12
|
+
withContext,
|
|
13
|
+
PropsProvider: ColorPropsProvider,
|
|
14
|
+
} = createSlotRecipeContext(colorPicker)
|
|
15
|
+
|
|
16
|
+
export type RootProps = ComponentProps<typeof Root>
|
|
17
|
+
export const Root: StyledComponent<typeof ColorPicker.Root, ColorPickerVariantProps> = withProvider(
|
|
18
|
+
ColorPicker.Root,
|
|
19
|
+
'root',
|
|
20
|
+
)
|
|
21
|
+
export const RootProvider: StyledComponent<
|
|
22
|
+
typeof ColorPicker.RootProvider,
|
|
23
|
+
ColorPickerVariantProps
|
|
24
|
+
> = withProvider(ColorPicker.RootProvider, 'root')
|
|
25
|
+
export const AreaBackground = withContext(ColorPicker.AreaBackground, 'areaBackground')
|
|
26
|
+
export const AreaThumb = withContext(ColorPicker.AreaThumb, 'areaThumb')
|
|
27
|
+
export const ChannelInput = withContext(ColorPicker.ChannelInput, 'channelInput')
|
|
28
|
+
export const ChannelSliderLabel = withContext(ColorPicker.ChannelSliderLabel, 'channelSliderLabel')
|
|
29
|
+
export const ChannelSliderThumb = withContext(ColorPicker.ChannelSliderThumb, 'channelSliderThumb')
|
|
30
|
+
export const ChannelSliderTrack = withContext(ColorPicker.ChannelSliderTrack, 'channelSliderTrack')
|
|
31
|
+
export const ChannelSliderValueText = withContext(
|
|
32
|
+
ColorPicker.ChannelSliderValueText,
|
|
33
|
+
'channelSliderValueText',
|
|
34
|
+
)
|
|
35
|
+
export const Content = withContext(ColorPicker.Content, 'content')
|
|
36
|
+
export const Control = withContext(ColorPicker.Control, 'control')
|
|
37
|
+
export const EyeDropperTrigger = withContext(ColorPicker.EyeDropperTrigger, 'eyeDropperTrigger')
|
|
38
|
+
export const FormatSelect = withContext(ColorPicker.FormatSelect, 'formatSelect')
|
|
39
|
+
export const FormatTrigger = withContext(ColorPicker.FormatTrigger, 'formatTrigger')
|
|
40
|
+
export const HiddenInput = ColorPicker.HiddenInput
|
|
41
|
+
export const Label = withContext(ColorPicker.Label, 'label')
|
|
42
|
+
export const Positioner = withContext(ColorPicker.Positioner, 'positioner')
|
|
43
|
+
export const Swatch = withContext(ColorPicker.Swatch, 'swatch')
|
|
44
|
+
export const SwatchGroup = withContext(ColorPicker.SwatchGroup, 'swatchGroup')
|
|
45
|
+
export const SwatchIndicator = withContext(ColorPicker.SwatchIndicator, 'swatchIndicator', {
|
|
46
|
+
defaultProps: { children: <CheckIcon /> },
|
|
47
|
+
})
|
|
48
|
+
export const SwatchTrigger = withContext(ColorPicker.SwatchTrigger, 'swatchTrigger')
|
|
49
|
+
export const TransparencyGrid = withContext(ColorPicker.TransparencyGrid, 'transparencyGrid')
|
|
50
|
+
export const ValueSwatch = withContext(ColorPicker.ValueSwatch, 'swatch')
|
|
51
|
+
export const ValueText = withContext(ColorPicker.ValueText, 'valueText')
|
|
52
|
+
export const View = withContext(ColorPicker.View, 'view')
|
|
53
|
+
|
|
54
|
+
export { ColorPickerContext as Context } from '@ark-ui/react/color-picker'
|
|
55
|
+
export const Area = withContext(ColorPicker.Area, 'area', {
|
|
56
|
+
defaultProps: {
|
|
57
|
+
children: (
|
|
58
|
+
<>
|
|
59
|
+
<AreaBackground />
|
|
60
|
+
<AreaThumb />
|
|
61
|
+
</>
|
|
62
|
+
),
|
|
63
|
+
},
|
|
64
|
+
})
|
|
65
|
+
export const ChannelSlider = withContext(ColorPicker.ChannelSlider, 'channelSlider', {
|
|
66
|
+
defaultProps: {
|
|
67
|
+
children: (
|
|
68
|
+
<>
|
|
69
|
+
<TransparencyGrid size="0.6rem" />
|
|
70
|
+
<ChannelSliderTrack />
|
|
71
|
+
<ChannelSliderThumb />
|
|
72
|
+
</>
|
|
73
|
+
),
|
|
74
|
+
},
|
|
75
|
+
})
|
|
76
|
+
export const Trigger = withContext(ColorPicker.Trigger, 'trigger', {
|
|
77
|
+
defaultProps: { children: <ValueSwatch /> },
|
|
78
|
+
})
|
|
79
|
+
export const Input = withContext(ColorPicker.ChannelInput, 'channelInput', {
|
|
80
|
+
defaultProps: { channel: 'hex' },
|
|
81
|
+
}) as (props: InputProps) => JSX.Element
|
|
82
|
+
export const EyeDropper = withContext(ColorPicker.EyeDropperTrigger, 'eyeDropperTrigger', {
|
|
83
|
+
defaultProps: { children: <PipetteIcon />, 'aria-label': 'Pick color from screen' },
|
|
84
|
+
})
|
|
85
|
+
export const Sliders = withContext(ark.div, 'sliders', {
|
|
86
|
+
defaultProps: {
|
|
87
|
+
children: (
|
|
88
|
+
<>
|
|
89
|
+
<ChannelSlider channel="hue" />
|
|
90
|
+
<ChannelSlider channel="alpha" />
|
|
91
|
+
</>
|
|
92
|
+
),
|
|
93
|
+
},
|
|
94
|
+
})
|
|
95
|
+
export const ChannelText = withContext(ark.span, 'channelText')
|
|
96
|
+
export const PropsProvider = ColorPropsProvider as Provider<Partial<RootProps>>
|
|
97
|
+
export type RootProviderProps = ComponentProps<typeof RootProvider>
|
|
98
|
+
export type AreaProps = ComponentProps<typeof Area>
|
|
99
|
+
export type AreaBackgroundProps = ComponentProps<typeof AreaBackground>
|
|
100
|
+
export type AreaThumbProps = ComponentProps<typeof AreaThumb>
|
|
101
|
+
export type ChannelInputProps = ComponentProps<typeof ChannelInput>
|
|
102
|
+
export type ChannelSliderProps = ComponentProps<typeof ChannelSlider>
|
|
103
|
+
export type ChannelSliderLabelProps = ComponentProps<typeof ChannelSliderLabel>
|
|
104
|
+
export type ChannelSliderThumbProps = ComponentProps<typeof ChannelSliderThumb>
|
|
105
|
+
export type ChannelSliderTrackProps = ComponentProps<typeof ChannelSliderTrack>
|
|
106
|
+
export type ChannelSliderValueTextProps = ComponentProps<typeof ChannelSliderValueText>
|
|
107
|
+
export type ContentProps = ComponentProps<typeof Content>
|
|
108
|
+
export type ControlProps = ComponentProps<typeof Control>
|
|
109
|
+
export type EyeDropperTriggerProps = ComponentProps<typeof EyeDropperTrigger>
|
|
110
|
+
export type FormatSelectProps = ComponentProps<typeof FormatSelect>
|
|
111
|
+
export type FormatTriggerProps = ComponentProps<typeof FormatTrigger>
|
|
112
|
+
export type HiddenInputProps = ComponentProps<typeof HiddenInput>
|
|
113
|
+
export type LabelProps = ComponentProps<typeof Label>
|
|
114
|
+
export type PositionerProps = ComponentProps<typeof Positioner>
|
|
115
|
+
export type SwatchProps = ComponentProps<typeof Swatch>
|
|
116
|
+
export type SwatchGroupProps = ComponentProps<typeof SwatchGroup>
|
|
117
|
+
export type SwatchIndicatorProps = ComponentProps<typeof SwatchIndicator>
|
|
118
|
+
export type SwatchTriggerProps = ComponentProps<typeof SwatchTrigger>
|
|
119
|
+
export type TransparencyGridProps = ComponentProps<typeof TransparencyGrid>
|
|
120
|
+
export type TriggerProps = ComponentProps<typeof Trigger>
|
|
121
|
+
export type ValueSwatchProps = ComponentProps<typeof ValueSwatch>
|
|
122
|
+
export type ValueTextProps = ComponentProps<typeof ValueText>
|
|
123
|
+
export type ViewProps = ComponentProps<typeof View>
|
|
124
|
+
export interface InputProps extends Omit<ChannelInputProps, 'channel'> {}
|
|
125
|
+
export type EyeDropperProps = ComponentProps<typeof EyeDropper>
|
|
126
|
+
export type SlidersProps = ComponentProps<typeof Sliders>
|
|
127
|
+
export type ChannelTextProps = ComponentProps<typeof ChannelText>
|
|
128
|
+
export {
|
|
129
|
+
useColorPicker,
|
|
130
|
+
useColorPickerContext,
|
|
131
|
+
type UseColorPickerProps,
|
|
132
|
+
type UseColorPickerReturn,
|
|
133
|
+
type ColorPickerValueChangeDetails as ValueChangeDetails,
|
|
134
|
+
type ColorPickerColorFormat as ColorFormat,
|
|
135
|
+
type ColorPickerFormatChangeDetails as FormatChangeDetails,
|
|
136
|
+
type ColorPickerOpenChangeDetails as OpenChangeDetails,
|
|
137
|
+
} from '@ark-ui/react/color-picker'
|
|
138
|
+
const formatMap = {
|
|
139
|
+
rgba: ['red', 'green', 'blue', 'alpha'],
|
|
140
|
+
hsla: ['hue', 'saturation', 'lightness', 'alpha'],
|
|
141
|
+
hsba: ['hue', 'saturation', 'brightness', 'alpha'],
|
|
142
|
+
hexa: ['hex', 'alpha'],
|
|
143
|
+
} as const
|
|
144
|
+
export function getColorChannels<T extends keyof typeof formatMap>(
|
|
145
|
+
format: T,
|
|
146
|
+
): (typeof formatMap)[T] {
|
|
147
|
+
return formatMap[format]
|
|
148
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { Editable } from '@ark-ui/react/editable'
|
|
3
|
+
import type { ComponentProps } from 'react'
|
|
4
|
+
import { createSlotRecipeContext } from 'styled-system/jsx'
|
|
5
|
+
import { editable, type EditableVariantProps } from 'styled-system/recipes'
|
|
6
|
+
import type { StyledComponent } from 'styled-system/types'
|
|
7
|
+
|
|
8
|
+
const { withProvider, withContext } = createSlotRecipeContext(editable)
|
|
9
|
+
|
|
10
|
+
export type RootProps = ComponentProps<typeof Root>
|
|
11
|
+
export const Root: StyledComponent<typeof Editable.Root, EditableVariantProps> = withProvider(
|
|
12
|
+
Editable.Root,
|
|
13
|
+
'root',
|
|
14
|
+
)
|
|
15
|
+
export const RootProvider: StyledComponent<typeof Editable.RootProvider, EditableVariantProps> =
|
|
16
|
+
withProvider(Editable.RootProvider, 'root')
|
|
17
|
+
export const Area = withContext(Editable.Area, 'area')
|
|
18
|
+
export const CancelTrigger = withContext(Editable.CancelTrigger, 'cancelTrigger')
|
|
19
|
+
export const Control = withContext(Editable.Control, 'control')
|
|
20
|
+
export const EditTrigger = withContext(Editable.EditTrigger, 'editTrigger')
|
|
21
|
+
export const Input = withContext(Editable.Input, 'input')
|
|
22
|
+
export const Label = withContext(Editable.Label, 'label')
|
|
23
|
+
export const Preview = withContext(Editable.Preview, 'preview')
|
|
24
|
+
export const SubmitTrigger = withContext(Editable.SubmitTrigger, 'submitTrigger')
|
|
25
|
+
|
|
26
|
+
export { EditableContext as Context } from '@ark-ui/react/editable'
|
|
27
|
+
|
|
28
|
+
export { useEditable, type UseEditableProps, type UseEditableReturn } from '@ark-ui/react/editable'
|
|
29
|
+
|
|
30
|
+
export type RootProviderProps = ComponentProps<typeof RootProvider>
|
|
31
|
+
export type AreaProps = ComponentProps<typeof Area>
|
|
32
|
+
export type CancelTriggerProps = ComponentProps<typeof CancelTrigger>
|
|
33
|
+
export type ControlProps = ComponentProps<typeof Control>
|
|
34
|
+
export type EditTriggerProps = ComponentProps<typeof EditTrigger>
|
|
35
|
+
export type InputProps = ComponentProps<typeof Input>
|
|
36
|
+
export type LabelProps = ComponentProps<typeof Label>
|
|
37
|
+
export type PreviewProps = ComponentProps<typeof Preview>
|
|
38
|
+
export type SubmitTriggerProps = ComponentProps<typeof SubmitTrigger>
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
useEditableContext,
|
|
42
|
+
type EditableEditChangeDetails as EditChangeDetails,
|
|
43
|
+
type EditableValueChangeDetails as ValueChangeDetails,
|
|
44
|
+
} from '@ark-ui/react/editable'
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { Field } from '@ark-ui/react/field'
|
|
3
|
+
import type { ComponentProps } from 'react'
|
|
4
|
+
import { createSlotRecipeContext, styled } from 'styled-system/jsx'
|
|
5
|
+
import { field, input } from 'styled-system/recipes'
|
|
6
|
+
import type { StyledComponent } from 'styled-system/types'
|
|
7
|
+
|
|
8
|
+
const { withProvider, withContext } = createSlotRecipeContext(field)
|
|
9
|
+
|
|
10
|
+
export type RootProps = ComponentProps<typeof Root>
|
|
11
|
+
export const Root: StyledComponent<typeof Field.Root> = withProvider(Field.Root, 'root')
|
|
12
|
+
export const RootProvider: StyledComponent<typeof Field.RootProvider> = withProvider(
|
|
13
|
+
Field.RootProvider,
|
|
14
|
+
'root',
|
|
15
|
+
)
|
|
16
|
+
export const Input = styled(Field.Input, input)
|
|
17
|
+
export const ErrorText = withContext(Field.ErrorText, 'errorText')
|
|
18
|
+
export const HelperText = withContext(Field.HelperText, 'helperText')
|
|
19
|
+
export const Label = withContext(Field.Label, 'label')
|
|
20
|
+
export const RequiredIndicator = withContext(Field.RequiredIndicator, 'requiredIndicator')
|
|
21
|
+
|
|
22
|
+
export { FieldContext as Context } from '@ark-ui/react/field'
|
|
23
|
+
|
|
24
|
+
export type RootProviderProps = ComponentProps<typeof RootProvider>
|
|
25
|
+
export type InputProps = ComponentProps<typeof Input>
|
|
26
|
+
export type ErrorTextProps = ComponentProps<typeof ErrorText>
|
|
27
|
+
export type HelperTextProps = ComponentProps<typeof HelperText>
|
|
28
|
+
export type LabelProps = ComponentProps<typeof Label>
|
|
29
|
+
export type RequiredIndicatorProps = ComponentProps<typeof RequiredIndicator>
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
useField,
|
|
33
|
+
useFieldContext,
|
|
34
|
+
type UseFieldProps,
|
|
35
|
+
type UseFieldReturn,
|
|
36
|
+
} from '@ark-ui/react/field'
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { ark } from '@ark-ui/react/factory'
|
|
3
|
+
import { Fieldset } from '@ark-ui/react/fieldset'
|
|
4
|
+
import type { ComponentProps } from 'react'
|
|
5
|
+
import { createSlotRecipeContext } from 'styled-system/jsx'
|
|
6
|
+
import { fieldset } from 'styled-system/recipes'
|
|
7
|
+
import type { StyledComponent } from 'styled-system/types'
|
|
8
|
+
|
|
9
|
+
const { withProvider, withContext } = createSlotRecipeContext(fieldset)
|
|
10
|
+
|
|
11
|
+
export type RootProps = ComponentProps<typeof Root>
|
|
12
|
+
export const Root: StyledComponent<typeof Fieldset.Root> = withProvider(Fieldset.Root, 'root')
|
|
13
|
+
export const RootProvider: StyledComponent<typeof Fieldset.RootProvider> = withProvider(
|
|
14
|
+
Fieldset.RootProvider,
|
|
15
|
+
'root',
|
|
16
|
+
)
|
|
17
|
+
export const Legend = withContext(Fieldset.Legend, 'legend')
|
|
18
|
+
export const HelperText = withContext(Fieldset.HelperText, 'helperText')
|
|
19
|
+
export const ErrorText = withContext(Fieldset.ErrorText, 'errorText')
|
|
20
|
+
export const Content = withContext(ark.div, 'content')
|
|
21
|
+
export const Control = withContext(ark.div, 'control')
|
|
22
|
+
|
|
23
|
+
export { FieldsetContext as Context } from '@ark-ui/react/fieldset'
|
|
24
|
+
|
|
25
|
+
export { useFieldset, type UseFieldsetProps, type UseFieldsetReturn } from '@ark-ui/react/fieldset'
|
|
26
|
+
|
|
27
|
+
export type RootProviderProps = ComponentProps<typeof RootProvider>
|
|
28
|
+
export type LegendProps = ComponentProps<typeof Legend>
|
|
29
|
+
export type HelperTextProps = ComponentProps<typeof HelperText>
|
|
30
|
+
export type ErrorTextProps = ComponentProps<typeof ErrorText>
|
|
31
|
+
export type ContentProps = ComponentProps<typeof Content>
|
|
32
|
+
export type ControlProps = ComponentProps<typeof Control>
|
|
33
|
+
|
|
34
|
+
export { useFieldsetContext } from '@ark-ui/react/fieldset'
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { FileUpload, useFileUploadContext } from '@ark-ui/react/file-upload'
|
|
3
|
+
import { FileIcon, XIcon } from 'lucide-react'
|
|
4
|
+
import { type ComponentProps, forwardRef } from 'react'
|
|
5
|
+
import {
|
|
6
|
+
createSlotRecipeContext,
|
|
7
|
+
type HTMLStyledProps,
|
|
8
|
+
PandaStack as Stack,
|
|
9
|
+
} from 'styled-system/jsx'
|
|
10
|
+
import { fileUpload, type FileUploadVariantProps } from 'styled-system/recipes'
|
|
11
|
+
import type { StyledComponent } from 'styled-system/types'
|
|
12
|
+
import { Span } from '@/components/atoms/internal/Span'
|
|
13
|
+
|
|
14
|
+
const { withProvider, withContext } = createSlotRecipeContext(fileUpload)
|
|
15
|
+
|
|
16
|
+
export type RootProps = ComponentProps<typeof Root>
|
|
17
|
+
export type ItemProps = ComponentProps<typeof Item>
|
|
18
|
+
|
|
19
|
+
export const Root: StyledComponent<typeof FileUpload.Root, FileUploadVariantProps> = withProvider(
|
|
20
|
+
FileUpload.Root,
|
|
21
|
+
'root',
|
|
22
|
+
)
|
|
23
|
+
export const RootProvider: StyledComponent<typeof FileUpload.RootProvider, FileUploadVariantProps> =
|
|
24
|
+
withProvider(FileUpload.RootProvider, 'root')
|
|
25
|
+
export const ClearTrigger = withContext(FileUpload.ClearTrigger, 'clearTrigger')
|
|
26
|
+
export const Dropzone = withContext(FileUpload.Dropzone, 'dropzone')
|
|
27
|
+
export const HiddenInput = FileUpload.HiddenInput
|
|
28
|
+
export const Item = withContext(FileUpload.Item, 'item')
|
|
29
|
+
export const ItemDeleteTrigger = withContext(FileUpload.ItemDeleteTrigger, 'itemDeleteTrigger', {
|
|
30
|
+
defaultProps: { children: <XIcon /> },
|
|
31
|
+
})
|
|
32
|
+
export const ItemGroup = withContext(FileUpload.ItemGroup, 'itemGroup')
|
|
33
|
+
export const ItemName = withContext(FileUpload.ItemName, 'itemName')
|
|
34
|
+
export const ItemPreview = withContext(FileUpload.ItemPreview, 'itemPreview', {
|
|
35
|
+
defaultProps: {
|
|
36
|
+
children: <FileIcon />,
|
|
37
|
+
},
|
|
38
|
+
})
|
|
39
|
+
export const ItemPreviewImage = withContext(FileUpload.ItemPreviewImage, 'itemPreviewImage')
|
|
40
|
+
export const ItemSizeText = withContext(FileUpload.ItemSizeText, 'itemSizeText')
|
|
41
|
+
export const Label = withContext(FileUpload.Label, 'label')
|
|
42
|
+
export const Trigger = withContext(FileUpload.Trigger, 'trigger')
|
|
43
|
+
|
|
44
|
+
export { FileUploadContext as Context } from '@ark-ui/react/file-upload'
|
|
45
|
+
|
|
46
|
+
interface ItemsBaseProps {
|
|
47
|
+
showSize?: boolean | undefined
|
|
48
|
+
clearable?: boolean | undefined
|
|
49
|
+
files?: File[] | undefined
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface ItemsProps extends Omit<ItemProps, 'file'>, ItemsBaseProps {}
|
|
53
|
+
|
|
54
|
+
export const Items = (props: ItemsProps) => {
|
|
55
|
+
const { showSize = true, clearable = true, files, ...rest } = props
|
|
56
|
+
const fileUpload = useFileUploadContext()
|
|
57
|
+
const acceptedFiles = files || fileUpload.acceptedFiles
|
|
58
|
+
|
|
59
|
+
return acceptedFiles.map((file, index) => (
|
|
60
|
+
<Item file={file} key={`${file.name}-${file.size}-${file.lastModified}-${index}`} {...rest}>
|
|
61
|
+
<ItemPreview />
|
|
62
|
+
<Stack gap="0.5" flex="1">
|
|
63
|
+
<ItemName />
|
|
64
|
+
{showSize && <ItemSizeText />}
|
|
65
|
+
</Stack>
|
|
66
|
+
|
|
67
|
+
{clearable && <ItemDeleteTrigger />}
|
|
68
|
+
</Item>
|
|
69
|
+
))
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface ListProps extends ComponentProps<typeof ItemGroup>, ItemsBaseProps {}
|
|
73
|
+
|
|
74
|
+
export const List = forwardRef<HTMLUListElement, ListProps>(function FileUploadList(props, ref) {
|
|
75
|
+
const { showSize = true, clearable = true, files, ...rest } = props
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<ItemGroup ref={ref} {...rest}>
|
|
79
|
+
<Items showSize={showSize} clearable={clearable} files={files} />
|
|
80
|
+
</ItemGroup>
|
|
81
|
+
)
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
export interface FileTextProps extends HTMLStyledProps<'span'> {
|
|
85
|
+
fallback?: string | undefined
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const FileText = forwardRef<HTMLSpanElement, FileTextProps>(
|
|
89
|
+
function FileUploadFileText(props, ref) {
|
|
90
|
+
const { fallback = 'Select file(s)', ...rest } = props
|
|
91
|
+
|
|
92
|
+
const fileUpload = useFileUploadContext()
|
|
93
|
+
|
|
94
|
+
const acceptedFiles = fileUpload.acceptedFiles
|
|
95
|
+
|
|
96
|
+
const fileText =
|
|
97
|
+
acceptedFiles.length === 1
|
|
98
|
+
? acceptedFiles[0].name
|
|
99
|
+
: acceptedFiles.length > 1
|
|
100
|
+
? `${acceptedFiles.length} files`
|
|
101
|
+
: fallback
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<Span
|
|
105
|
+
ref={ref}
|
|
106
|
+
data-placeholder={acceptedFiles.length === 0 ? '' : undefined}
|
|
107
|
+
data-scope="file-upload"
|
|
108
|
+
data-part="file-text"
|
|
109
|
+
{...rest}>
|
|
110
|
+
{fileText}
|
|
111
|
+
</Span>
|
|
112
|
+
)
|
|
113
|
+
},
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
export {
|
|
117
|
+
useFileUpload,
|
|
118
|
+
useFileUploadContext,
|
|
119
|
+
type UseFileUploadProps,
|
|
120
|
+
type UseFileUploadReturn,
|
|
121
|
+
type FileUploadFileChangeDetails,
|
|
122
|
+
type FileUploadFileRejectDetails,
|
|
123
|
+
} from '@ark-ui/react/file-upload'
|
|
124
|
+
|
|
125
|
+
export type RootProviderProps = ComponentProps<typeof RootProvider>
|
|
126
|
+
export type ClearTriggerProps = ComponentProps<typeof ClearTrigger>
|
|
127
|
+
export type DropzoneProps = ComponentProps<typeof Dropzone>
|
|
128
|
+
export type HiddenInputProps = ComponentProps<typeof HiddenInput>
|
|
129
|
+
export type ItemDeleteTriggerProps = ComponentProps<typeof ItemDeleteTrigger>
|
|
130
|
+
export type ItemGroupProps = ComponentProps<typeof ItemGroup>
|
|
131
|
+
export type ItemNameProps = ComponentProps<typeof ItemName>
|
|
132
|
+
export type ItemPreviewProps = ComponentProps<typeof ItemPreview>
|
|
133
|
+
export type ItemPreviewImageProps = ComponentProps<typeof ItemPreviewImage>
|
|
134
|
+
export type ItemSizeTextProps = ComponentProps<typeof ItemSizeText>
|
|
135
|
+
export type LabelProps = ComponentProps<typeof Label>
|
|
136
|
+
export type TriggerProps = ComponentProps<typeof Trigger>
|
|
137
|
+
|
|
138
|
+
export {
|
|
139
|
+
type FileUploadFileAcceptDetails as FileAcceptDetails,
|
|
140
|
+
type FileUploadFileChangeDetails as FileChangeDetails,
|
|
141
|
+
type FileUploadFileRejectDetails as FileRejectDetails,
|
|
142
|
+
type FileUploadFileValidateDetails as FileValidateDetails,
|
|
143
|
+
} from '@ark-ui/react/file-upload'
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Field } from '@ark-ui/react/field'
|
|
2
|
+
import type { ComponentProps } from 'react'
|
|
3
|
+
import { styled } from 'styled-system/jsx'
|
|
4
|
+
import { input } from 'styled-system/recipes'
|
|
5
|
+
|
|
6
|
+
export type InputProps = ComponentProps<typeof Input>
|
|
7
|
+
export const Input = styled(Field.Input, input)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ark } from '@ark-ui/react/factory'
|
|
2
|
+
import type { ComponentProps } from 'react'
|
|
3
|
+
import { styled } from 'styled-system/jsx'
|
|
4
|
+
import { inputAddon } from 'styled-system/recipes'
|
|
5
|
+
|
|
6
|
+
export type InputAddonProps = ComponentProps<typeof InputAddon>
|
|
7
|
+
export const InputAddon = styled(ark.div, inputAddon)
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { ark } from '@ark-ui/react/factory'
|
|
3
|
+
import { type ComponentProps, forwardRef, type ReactNode } from 'react'
|
|
4
|
+
import { createSlotRecipeContext } from 'styled-system/jsx'
|
|
5
|
+
import { inputGroup, type InputGroupVariantProps } from 'styled-system/recipes'
|
|
6
|
+
import type { StyledComponent } from 'styled-system/types'
|
|
7
|
+
|
|
8
|
+
const { withProvider, withContext } = createSlotRecipeContext(inputGroup)
|
|
9
|
+
|
|
10
|
+
type RootProps = ComponentProps<typeof Root>
|
|
11
|
+
const Root: StyledComponent<typeof ark.div, InputGroupVariantProps> = withProvider(ark.div, 'root')
|
|
12
|
+
const Element = withContext(ark.div, 'element')
|
|
13
|
+
|
|
14
|
+
export interface InputGroupProps extends RootProps {
|
|
15
|
+
startElement?: ReactNode | undefined
|
|
16
|
+
endElement?: ReactNode | undefined
|
|
17
|
+
startElementProps?: ComponentProps<typeof Element> | undefined
|
|
18
|
+
endElementProps?: ComponentProps<typeof Element> | undefined
|
|
19
|
+
/** CSS length subtracted from the default start padding, e.g. "-2rem" for a wider element. */
|
|
20
|
+
startOffset?: string | undefined
|
|
21
|
+
/** CSS length subtracted from the default end padding. */
|
|
22
|
+
endOffset?: string | undefined
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const InputGroup = forwardRef<HTMLDivElement, InputGroupProps>(
|
|
26
|
+
function InputGroup(props, ref) {
|
|
27
|
+
const {
|
|
28
|
+
startElement,
|
|
29
|
+
endElement,
|
|
30
|
+
startElementProps,
|
|
31
|
+
endElementProps,
|
|
32
|
+
startOffset,
|
|
33
|
+
endOffset,
|
|
34
|
+
children,
|
|
35
|
+
...rest
|
|
36
|
+
} = props
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<Root
|
|
40
|
+
ref={ref}
|
|
41
|
+
{...rest}
|
|
42
|
+
style={{
|
|
43
|
+
...(startOffset !== undefined && { '--input-group-start-offset': startOffset }),
|
|
44
|
+
...(endOffset !== undefined && { '--input-group-end-offset': endOffset }),
|
|
45
|
+
...rest.style,
|
|
46
|
+
}}>
|
|
47
|
+
{startElement != null && (
|
|
48
|
+
<Element insetInlineStart="0" top="0" {...startElementProps}>
|
|
49
|
+
{startElement}
|
|
50
|
+
</Element>
|
|
51
|
+
)}
|
|
52
|
+
{children}
|
|
53
|
+
{endElement != null && (
|
|
54
|
+
<Element insetInlineEnd="0" top="0" {...endElementProps}>
|
|
55
|
+
{endElement}
|
|
56
|
+
</Element>
|
|
57
|
+
)}
|
|
58
|
+
</Root>
|
|
59
|
+
)
|
|
60
|
+
},
|
|
61
|
+
)
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { ark } from '@ark-ui/react/factory'
|
|
3
|
+
import { Field as ArkField, useFieldContext } from '@ark-ui/react/field'
|
|
4
|
+
import { ChevronDownIcon } from 'lucide-react'
|
|
5
|
+
import { createContext, forwardRef, useContext, type ComponentProps } from 'react'
|
|
6
|
+
import { createSlotRecipeContext } from 'styled-system/jsx'
|
|
7
|
+
import { nativeSelect, type NativeSelectVariantProps } from 'styled-system/recipes'
|
|
8
|
+
import type { StyledComponent } from 'styled-system/types'
|
|
9
|
+
|
|
10
|
+
const { withProvider, withContext } = createSlotRecipeContext(nativeSelect)
|
|
11
|
+
const StateContext = createContext({ disabled: false, invalid: false })
|
|
12
|
+
const StyledRoot: StyledComponent<typeof ark.div, NativeSelectVariantProps> = withProvider(
|
|
13
|
+
ark.div,
|
|
14
|
+
'root',
|
|
15
|
+
)
|
|
16
|
+
const StyledField = withContext(ArkField.Select, 'field')
|
|
17
|
+
const StyledIndicator: StyledComponent<typeof ark.div> = withContext(ark.div, 'indicator')
|
|
18
|
+
|
|
19
|
+
export interface RootProps extends ComponentProps<typeof StyledRoot> {
|
|
20
|
+
disabled?: boolean
|
|
21
|
+
invalid?: boolean
|
|
22
|
+
}
|
|
23
|
+
export const Root = forwardRef<HTMLDivElement, RootProps>(function Root(
|
|
24
|
+
{ disabled, invalid, ...props },
|
|
25
|
+
ref,
|
|
26
|
+
) {
|
|
27
|
+
const field = useFieldContext()
|
|
28
|
+
const state = {
|
|
29
|
+
disabled: Boolean(disabled || field?.disabled),
|
|
30
|
+
invalid: Boolean(invalid || field?.invalid),
|
|
31
|
+
}
|
|
32
|
+
return (
|
|
33
|
+
<StateContext.Provider value={state}>
|
|
34
|
+
<StyledRoot
|
|
35
|
+
{...props}
|
|
36
|
+
data-disabled={state.disabled ? '' : undefined}
|
|
37
|
+
data-invalid={state.invalid ? '' : undefined}
|
|
38
|
+
ref={ref}
|
|
39
|
+
/>
|
|
40
|
+
</StateContext.Provider>
|
|
41
|
+
)
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
export interface FieldProps extends Omit<ComponentProps<typeof StyledField>, 'size'> {
|
|
45
|
+
placeholder?: string
|
|
46
|
+
}
|
|
47
|
+
export const Field = forwardRef<HTMLSelectElement, FieldProps>(function Field(
|
|
48
|
+
{ placeholder, children, ...props },
|
|
49
|
+
ref,
|
|
50
|
+
) {
|
|
51
|
+
const { disabled, invalid } = useContext(StateContext)
|
|
52
|
+
return (
|
|
53
|
+
<StyledField
|
|
54
|
+
data-invalid={invalid ? '' : undefined}
|
|
55
|
+
aria-invalid={invalid || undefined}
|
|
56
|
+
{...props}
|
|
57
|
+
disabled={Boolean(disabled || props.disabled)}
|
|
58
|
+
ref={ref}>
|
|
59
|
+
{placeholder != null && <option value="">{placeholder}</option>}
|
|
60
|
+
{children}
|
|
61
|
+
</StyledField>
|
|
62
|
+
)
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
export interface IndicatorProps extends ComponentProps<typeof StyledIndicator> {}
|
|
66
|
+
export const Indicator = forwardRef<HTMLDivElement, IndicatorProps>(function Indicator(
|
|
67
|
+
{ children, ...props },
|
|
68
|
+
ref,
|
|
69
|
+
) {
|
|
70
|
+
const { disabled, invalid } = useContext(StateContext)
|
|
71
|
+
return (
|
|
72
|
+
<StyledIndicator
|
|
73
|
+
{...props}
|
|
74
|
+
ref={ref}
|
|
75
|
+
aria-hidden="true"
|
|
76
|
+
data-disabled={disabled ? '' : undefined}
|
|
77
|
+
data-invalid={invalid ? '' : undefined}>
|
|
78
|
+
{children == null ? <ChevronDownIcon /> : children}
|
|
79
|
+
</StyledIndicator>
|
|
80
|
+
)
|
|
81
|
+
})
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { NumberInput } from '@ark-ui/react/number-input'
|
|
3
|
+
import { ChevronDownIcon, ChevronUpIcon } from 'lucide-react'
|
|
4
|
+
import type { ComponentProps } from 'react'
|
|
5
|
+
import { createSlotRecipeContext } from 'styled-system/jsx'
|
|
6
|
+
import { numberInput, type NumberInputVariantProps } from 'styled-system/recipes'
|
|
7
|
+
import type { StyledComponent } from 'styled-system/types'
|
|
8
|
+
|
|
9
|
+
const { withProvider, withContext } = createSlotRecipeContext(numberInput)
|
|
10
|
+
|
|
11
|
+
export type RootProps = ComponentProps<typeof Root>
|
|
12
|
+
export const Root: StyledComponent<typeof NumberInput.Root, NumberInputVariantProps> = withProvider(
|
|
13
|
+
NumberInput.Root,
|
|
14
|
+
'root',
|
|
15
|
+
)
|
|
16
|
+
export const RootProvider: StyledComponent<
|
|
17
|
+
typeof NumberInput.RootProvider,
|
|
18
|
+
NumberInputVariantProps
|
|
19
|
+
> = withProvider(NumberInput.RootProvider, 'root')
|
|
20
|
+
export const DecrementTrigger = withContext(NumberInput.DecrementTrigger, 'decrementTrigger', {
|
|
21
|
+
defaultProps: { children: <ChevronDownIcon /> },
|
|
22
|
+
})
|
|
23
|
+
export const IncrementTrigger = withContext(NumberInput.IncrementTrigger, 'incrementTrigger', {
|
|
24
|
+
defaultProps: { children: <ChevronUpIcon /> },
|
|
25
|
+
})
|
|
26
|
+
export const Input = withContext(NumberInput.Input, 'input')
|
|
27
|
+
export const Label = withContext(NumberInput.Label, 'label')
|
|
28
|
+
export const Scrubber = withContext(NumberInput.Scrubber, 'scrubber')
|
|
29
|
+
export const ValueText = withContext(NumberInput.ValueText, 'valueText')
|
|
30
|
+
export const Control = withContext(NumberInput.Control, 'control', {
|
|
31
|
+
defaultProps: {
|
|
32
|
+
children: (
|
|
33
|
+
<>
|
|
34
|
+
<IncrementTrigger />
|
|
35
|
+
<DecrementTrigger />
|
|
36
|
+
</>
|
|
37
|
+
),
|
|
38
|
+
},
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
export { NumberInputContext as Context } from '@ark-ui/react/number-input'
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
useNumberInput,
|
|
45
|
+
type UseNumberInputProps,
|
|
46
|
+
type UseNumberInputReturn,
|
|
47
|
+
} from '@ark-ui/react/number-input'
|
|
48
|
+
|
|
49
|
+
export type RootProviderProps = ComponentProps<typeof RootProvider>
|
|
50
|
+
export type DecrementTriggerProps = ComponentProps<typeof DecrementTrigger>
|
|
51
|
+
export type IncrementTriggerProps = ComponentProps<typeof IncrementTrigger>
|
|
52
|
+
export type InputProps = ComponentProps<typeof Input>
|
|
53
|
+
export type LabelProps = ComponentProps<typeof Label>
|
|
54
|
+
export type ScrubberProps = ComponentProps<typeof Scrubber>
|
|
55
|
+
export type ValueTextProps = ComponentProps<typeof ValueText>
|
|
56
|
+
export type ControlProps = ComponentProps<typeof Control>
|
|
57
|
+
|
|
58
|
+
export {
|
|
59
|
+
useNumberInputContext,
|
|
60
|
+
type NumberInputFocusChangeDetails as FocusChangeDetails,
|
|
61
|
+
type NumberInputValueChangeDetails as ValueChangeDetails,
|
|
62
|
+
type NumberInputValueInvalidDetails as ValueInvalidDetails,
|
|
63
|
+
} from '@ark-ui/react/number-input'
|