@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,90 @@
|
|
|
1
|
+
import { Badge, Heading, Float, Stack, Text, VisuallyHidden } from '@repo/ui'
|
|
2
|
+
|
|
3
|
+
import { css } from 'styled-system/css'
|
|
4
|
+
import { grid, hstack } from 'styled-system/patterns'
|
|
5
|
+
|
|
6
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
7
|
+
|
|
8
|
+
const meta = {
|
|
9
|
+
title: 'Layout/Positioning',
|
|
10
|
+
parameters: {
|
|
11
|
+
controls: { disable: true },
|
|
12
|
+
docs: {
|
|
13
|
+
source: { type: 'code' },
|
|
14
|
+
description: { component: '原生 CSS 居中、比例容器和 Float 定位。' },
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
} satisfies Meta
|
|
18
|
+
export default meta
|
|
19
|
+
type Story = StoryObj<typeof meta>
|
|
20
|
+
export const Centered: Story = {
|
|
21
|
+
render: function Centered() {
|
|
22
|
+
return (
|
|
23
|
+
<div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
|
|
24
|
+
<div
|
|
25
|
+
className={css({
|
|
26
|
+
position: 'relative',
|
|
27
|
+
height: '24',
|
|
28
|
+
borderWidth: '1px',
|
|
29
|
+
borderRadius: 'sm',
|
|
30
|
+
})}>
|
|
31
|
+
<div
|
|
32
|
+
className={css({
|
|
33
|
+
position: 'absolute',
|
|
34
|
+
inset: '0',
|
|
35
|
+
display: 'grid',
|
|
36
|
+
placeItems: 'center',
|
|
37
|
+
})}>
|
|
38
|
+
<Badge>原生元素居中</Badge>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
)
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
export const FloatAndAspectRatio: Story = {
|
|
46
|
+
render: function FloatAndAspectRatio() {
|
|
47
|
+
return (
|
|
48
|
+
<div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
|
|
49
|
+
<Stack gap="4">
|
|
50
|
+
<Heading as="h3" size="lg">
|
|
51
|
+
原生样式与 Float
|
|
52
|
+
</Heading>
|
|
53
|
+
<div className={hstack({ flexWrap: 'wrap', gap: '3', maxWidth: 'sm' })}>
|
|
54
|
+
{['设计', '组件', 'Panda CSS', 'Ark UI', '响应式', '可定制'].map((label) => (
|
|
55
|
+
<Badge key={label}>{label}</Badge>
|
|
56
|
+
))}
|
|
57
|
+
</div>
|
|
58
|
+
<div className={grid({ columns: { base: 1, md: 2 }, gap: '6' })}>
|
|
59
|
+
<div
|
|
60
|
+
className={css({
|
|
61
|
+
aspectRatio: '16 / 9',
|
|
62
|
+
display: 'grid',
|
|
63
|
+
placeItems: 'center',
|
|
64
|
+
bg: 'gray.subtle.bg',
|
|
65
|
+
borderRadius: 'sm',
|
|
66
|
+
})}>
|
|
67
|
+
16:9 内容容器
|
|
68
|
+
</div>
|
|
69
|
+
<div
|
|
70
|
+
className={css({
|
|
71
|
+
position: 'relative',
|
|
72
|
+
minHeight: '40',
|
|
73
|
+
display: 'grid',
|
|
74
|
+
placeItems: 'center',
|
|
75
|
+
borderWidth: '1px',
|
|
76
|
+
borderRadius: 'sm',
|
|
77
|
+
})}>
|
|
78
|
+
<Text>原生元素居中</Text>
|
|
79
|
+
<Float placement="top-end" offset="2">
|
|
80
|
+
<Badge variant="solid">
|
|
81
|
+
3<VisuallyHidden>条通知</VisuallyHidden>
|
|
82
|
+
</Badge>
|
|
83
|
+
</Float>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</Stack>
|
|
87
|
+
</div>
|
|
88
|
+
)
|
|
89
|
+
},
|
|
90
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Button, ScrollArea } from '@repo/ui'
|
|
2
|
+
import { css } from 'styled-system/css'
|
|
3
|
+
|
|
4
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Layout/ScrollArea',
|
|
8
|
+
component: ScrollArea.Root,
|
|
9
|
+
parameters: {
|
|
10
|
+
controls: { disable: true },
|
|
11
|
+
docs: {
|
|
12
|
+
source: { type: 'code' },
|
|
13
|
+
description: { component: '双向滚动、滚动条和 store 滚动命令。' },
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
} satisfies Meta<typeof ScrollArea.Root>
|
|
17
|
+
export default meta
|
|
18
|
+
type Story = StoryObj<typeof meta>
|
|
19
|
+
export const BidirectionalStore: Story = {
|
|
20
|
+
render: function BidirectionalStore() {
|
|
21
|
+
const scrollArea = ScrollArea.useScrollArea()
|
|
22
|
+
return (
|
|
23
|
+
<div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
|
|
24
|
+
<p>双向滚动:滚轮、触控板、键盘和拖动滚动条均使用 Ark 的原生行为。</p>
|
|
25
|
+
<ScrollArea.RootProvider
|
|
26
|
+
value={scrollArea}
|
|
27
|
+
scrollbar="visible"
|
|
28
|
+
size="sm"
|
|
29
|
+
height="64"
|
|
30
|
+
maxWidth="xl"
|
|
31
|
+
borderWidth="1px"
|
|
32
|
+
borderRadius="md">
|
|
33
|
+
<ScrollArea.Viewport role="region" aria-label="可滚动的示例列表" tabIndex={0}>
|
|
34
|
+
<ScrollArea.Content padding="4" minWidth="2xl">
|
|
35
|
+
<ol className={css({ display: 'grid', gap: '3' })}>
|
|
36
|
+
{Array.from({ length: 20 }, (_, index) => (
|
|
37
|
+
<li
|
|
38
|
+
key={index}
|
|
39
|
+
className={css({ display: 'flex', justifyContent: 'space-between' })}>
|
|
40
|
+
<span>第 {index + 1} 条示例内容</span>
|
|
41
|
+
<span>右侧内容用于展示横向滚动</span>
|
|
42
|
+
</li>
|
|
43
|
+
))}
|
|
44
|
+
</ol>
|
|
45
|
+
</ScrollArea.Content>
|
|
46
|
+
</ScrollArea.Viewport>
|
|
47
|
+
<ScrollArea.Scrollbar orientation="vertical" />
|
|
48
|
+
<ScrollArea.Scrollbar orientation="horizontal" />
|
|
49
|
+
<ScrollArea.Corner />
|
|
50
|
+
</ScrollArea.RootProvider>
|
|
51
|
+
<div className={css({ display: 'flex', gap: '3', flexWrap: 'wrap' })}>
|
|
52
|
+
<Button
|
|
53
|
+
type="button"
|
|
54
|
+
variant="outline"
|
|
55
|
+
onClick={() => scrollArea.scrollToEdge({ edge: 'top' })}>
|
|
56
|
+
回到顶部
|
|
57
|
+
</Button>
|
|
58
|
+
<Button
|
|
59
|
+
type="button"
|
|
60
|
+
variant="outline"
|
|
61
|
+
onClick={() => scrollArea.scrollToEdge({ edge: 'bottom' })}>
|
|
62
|
+
滚动到底部
|
|
63
|
+
</Button>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
)
|
|
67
|
+
},
|
|
68
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Badge, Button, Group, Heading, HStack, Separator, Stack, Text, VStack } from '@repo/ui'
|
|
2
|
+
import { css } from 'styled-system/css'
|
|
3
|
+
import { hstack, vstack } from 'styled-system/patterns'
|
|
4
|
+
|
|
5
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Layout/Stack',
|
|
9
|
+
component: Stack,
|
|
10
|
+
parameters: {
|
|
11
|
+
controls: { disable: true },
|
|
12
|
+
docs: {
|
|
13
|
+
source: { type: 'code' },
|
|
14
|
+
description: { component: '布局 patterns、组合、分隔符和响应式方向。' },
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
} satisfies Meta<typeof Stack>
|
|
18
|
+
export default meta
|
|
19
|
+
type Story = StoryObj<typeof meta>
|
|
20
|
+
export const PatternsAndGroup: Story = {
|
|
21
|
+
render: function PatternsAndGroup() {
|
|
22
|
+
return (
|
|
23
|
+
<div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
|
|
24
|
+
<div className={vstack({ alignItems: 'stretch', gap: '4' })}>
|
|
25
|
+
<Heading as="h3" size="lg">
|
|
26
|
+
Patterns 与组合
|
|
27
|
+
</Heading>
|
|
28
|
+
<div
|
|
29
|
+
className={hstack({
|
|
30
|
+
flexWrap: 'wrap',
|
|
31
|
+
gap: '3',
|
|
32
|
+
p: '4',
|
|
33
|
+
bg: 'gray.subtle.bg',
|
|
34
|
+
borderRadius: 'sm',
|
|
35
|
+
})}>
|
|
36
|
+
<Text fontWeight="semibold" flex="1">
|
|
37
|
+
弹性工具栏
|
|
38
|
+
</Text>
|
|
39
|
+
<Group attached>
|
|
40
|
+
<Button variant="outline">查看</Button>
|
|
41
|
+
<Button variant="outline">编辑</Button>
|
|
42
|
+
</Group>
|
|
43
|
+
</div>
|
|
44
|
+
<HStack gap="4">
|
|
45
|
+
<Badge>HStack</Badge>
|
|
46
|
+
<Text>默认水平居中对齐</Text>
|
|
47
|
+
</HStack>
|
|
48
|
+
<VStack align="stretch" gap="2">
|
|
49
|
+
<Badge alignSelf="start">VStack</Badge>
|
|
50
|
+
<Text>组件入口支持 asChild 和 separator;patterns 适合普通元素。</Text>
|
|
51
|
+
</VStack>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
)
|
|
55
|
+
},
|
|
56
|
+
}
|
|
57
|
+
export const ResponsiveSeparators: Story = {
|
|
58
|
+
render: function ResponsiveSeparators() {
|
|
59
|
+
return (
|
|
60
|
+
<div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
|
|
61
|
+
<Stack gap="4">
|
|
62
|
+
<Heading as="h3" size="lg">
|
|
63
|
+
响应式 Stack 与 Separator
|
|
64
|
+
</Heading>
|
|
65
|
+
<Stack
|
|
66
|
+
direction={{ base: 'column', md: 'row' }}
|
|
67
|
+
gap="6"
|
|
68
|
+
separator={<Separator variant="dashed" />}>
|
|
69
|
+
<div className={css({ p: '3' })}>第一项</div>
|
|
70
|
+
<div className={css({ p: '3' })}>第二项</div>
|
|
71
|
+
<div className={css({ p: '3' })}>第三项</div>
|
|
72
|
+
</Stack>
|
|
73
|
+
<HStack gap={{ base: '2', md: '4' }} separator={<Separator size="md" />}>
|
|
74
|
+
<Text>水平</Text>
|
|
75
|
+
<Text>分隔</Text>
|
|
76
|
+
</HStack>
|
|
77
|
+
<Separator variant="dotted" size="lg" />
|
|
78
|
+
<div className={hstack({ gap: '3', h: '10' })}>
|
|
79
|
+
<Text>显式垂直分隔</Text>
|
|
80
|
+
<Separator orientation="vertical" />
|
|
81
|
+
<Text>另一侧</Text>
|
|
82
|
+
</div>
|
|
83
|
+
</Stack>
|
|
84
|
+
</div>
|
|
85
|
+
)
|
|
86
|
+
},
|
|
87
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { Breadcrumb, Heading } from '@repo/ui'
|
|
2
|
+
|
|
3
|
+
import { css } from 'styled-system/css'
|
|
4
|
+
import { useId } from 'react'
|
|
5
|
+
|
|
6
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
7
|
+
|
|
8
|
+
const meta = {
|
|
9
|
+
title: 'Navigation/Breadcrumb',
|
|
10
|
+
component: Breadcrumb.Root,
|
|
11
|
+
parameters: {
|
|
12
|
+
controls: { disable: true },
|
|
13
|
+
docs: {
|
|
14
|
+
source: { type: 'code' },
|
|
15
|
+
description: { component: '链接组合、自定义分隔、省略和当前页。' },
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
} satisfies Meta<typeof Breadcrumb.Root>
|
|
19
|
+
export default meta
|
|
20
|
+
type Story = StoryObj<typeof meta>
|
|
21
|
+
export const Composition: Story = {
|
|
22
|
+
render: function Composition() {
|
|
23
|
+
const storyId = useId()
|
|
24
|
+
return (
|
|
25
|
+
<div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
|
|
26
|
+
<Breadcrumb.Root aria-label="组件导航路径">
|
|
27
|
+
<Breadcrumb.List>
|
|
28
|
+
<Breadcrumb.Item>
|
|
29
|
+
<Breadcrumb.Link asChild>
|
|
30
|
+
<a href={`#${storyId}-breadcrumb-target`}>UI 首页</a>
|
|
31
|
+
</Breadcrumb.Link>
|
|
32
|
+
</Breadcrumb.Item>
|
|
33
|
+
<Breadcrumb.Separator />
|
|
34
|
+
<Breadcrumb.Item>
|
|
35
|
+
<Breadcrumb.Link asChild>
|
|
36
|
+
<a href={`#${storyId}-breadcrumb-target`}>表格与标签</a>
|
|
37
|
+
</Breadcrumb.Link>
|
|
38
|
+
</Breadcrumb.Item>
|
|
39
|
+
<Breadcrumb.Separator />
|
|
40
|
+
<Breadcrumb.Item>
|
|
41
|
+
<Breadcrumb.CurrentLink>折叠与导航</Breadcrumb.CurrentLink>
|
|
42
|
+
</Breadcrumb.Item>
|
|
43
|
+
</Breadcrumb.List>
|
|
44
|
+
</Breadcrumb.Root>
|
|
45
|
+
<Breadcrumb.Root variant="underline" size="sm" aria-label="自定义分隔与省略路径">
|
|
46
|
+
<Breadcrumb.List>
|
|
47
|
+
<Breadcrumb.Item>
|
|
48
|
+
<Breadcrumb.Link href={`#${storyId}-breadcrumb-target`}>首页</Breadcrumb.Link>
|
|
49
|
+
</Breadcrumb.Item>
|
|
50
|
+
<Breadcrumb.Separator>/</Breadcrumb.Separator>
|
|
51
|
+
<Breadcrumb.Ellipsis />
|
|
52
|
+
<Breadcrumb.Separator>/</Breadcrumb.Separator>
|
|
53
|
+
<Breadcrumb.Item>
|
|
54
|
+
<Breadcrumb.CurrentLink>当前页面</Breadcrumb.CurrentLink>
|
|
55
|
+
</Breadcrumb.Item>
|
|
56
|
+
</Breadcrumb.List>
|
|
57
|
+
</Breadcrumb.Root>
|
|
58
|
+
<div id={`${storyId}-breadcrumb-target`}>链接目标</div>
|
|
59
|
+
</div>
|
|
60
|
+
)
|
|
61
|
+
},
|
|
62
|
+
}
|
|
63
|
+
export const Customization: Story = {
|
|
64
|
+
render: function Customization() {
|
|
65
|
+
const storyId = useId()
|
|
66
|
+
return (
|
|
67
|
+
<div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
|
|
68
|
+
<div id={`${storyId}-breadcrumb-target`}>链接目标</div>
|
|
69
|
+
<Heading size="md">分维度定制</Heading>
|
|
70
|
+
<Breadcrumb.Root size="unstyled" aria-label="自定尺寸路径">
|
|
71
|
+
<Breadcrumb.List gap="1.5" textStyle="sm">
|
|
72
|
+
<Breadcrumb.Item>
|
|
73
|
+
<Breadcrumb.Link href={`#${storyId}-breadcrumb-target`} gap="1">
|
|
74
|
+
首页
|
|
75
|
+
</Breadcrumb.Link>
|
|
76
|
+
</Breadcrumb.Item>
|
|
77
|
+
<Breadcrumb.Separator />
|
|
78
|
+
<Breadcrumb.Item>
|
|
79
|
+
<Breadcrumb.CurrentLink>自定尺寸</Breadcrumb.CurrentLink>
|
|
80
|
+
</Breadcrumb.Item>
|
|
81
|
+
</Breadcrumb.List>
|
|
82
|
+
</Breadcrumb.Root>
|
|
83
|
+
<Breadcrumb.Root variant="unstyled" aria-label="自定外观路径">
|
|
84
|
+
<Breadcrumb.List>
|
|
85
|
+
<Breadcrumb.Item color="lime.11">
|
|
86
|
+
<Breadcrumb.Link
|
|
87
|
+
href={`#${storyId}-breadcrumb-target`}
|
|
88
|
+
focusRing="outside"
|
|
89
|
+
css={{ _hover: { textDecoration: 'underline' } }}>
|
|
90
|
+
首页
|
|
91
|
+
</Breadcrumb.Link>
|
|
92
|
+
</Breadcrumb.Item>
|
|
93
|
+
<Breadcrumb.Separator color="lime.7">/</Breadcrumb.Separator>
|
|
94
|
+
<Breadcrumb.Item>
|
|
95
|
+
<Breadcrumb.CurrentLink color="lime.11" fontWeight="semibold">
|
|
96
|
+
自定外观
|
|
97
|
+
</Breadcrumb.CurrentLink>
|
|
98
|
+
</Breadcrumb.Item>
|
|
99
|
+
</Breadcrumb.List>
|
|
100
|
+
</Breadcrumb.Root>
|
|
101
|
+
</div>
|
|
102
|
+
)
|
|
103
|
+
},
|
|
104
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Link } from '@repo/ui'
|
|
2
|
+
import { useId } from 'react'
|
|
3
|
+
import { css } from 'styled-system/css'
|
|
4
|
+
|
|
5
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Navigation/Link',
|
|
9
|
+
component: Link,
|
|
10
|
+
parameters: {
|
|
11
|
+
controls: { disable: true },
|
|
12
|
+
docs: {
|
|
13
|
+
source: { type: 'code' },
|
|
14
|
+
description: { component: '链接外观、asChild 和键盘焦点。' },
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
} satisfies Meta<typeof Link>
|
|
18
|
+
export default meta
|
|
19
|
+
type Story = StoryObj<typeof meta>
|
|
20
|
+
export const Variants: Story = {
|
|
21
|
+
tags: ['!dev'],
|
|
22
|
+
render: function Variants() {
|
|
23
|
+
const storyId = useId()
|
|
24
|
+
return (
|
|
25
|
+
<div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
|
|
26
|
+
<p id={`${storyId}-feedback-heading`}>链接目标</p>
|
|
27
|
+
<div className={css({ display: 'flex', flexWrap: 'wrap', gap: '4' })}>
|
|
28
|
+
<Link href={`#${storyId}-feedback-heading`}>Underline 链接</Link>
|
|
29
|
+
<Link variant="plain" href={`#${storyId}-feedback-heading`}>
|
|
30
|
+
Plain 链接
|
|
31
|
+
</Link>
|
|
32
|
+
<Link asChild>
|
|
33
|
+
<a href={`#${storyId}-feedback-heading`}>asChild 链接</a>
|
|
34
|
+
</Link>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
)
|
|
38
|
+
},
|
|
39
|
+
}
|
|
40
|
+
export const CustomAppearance: Story = {
|
|
41
|
+
render: function CustomAppearance() {
|
|
42
|
+
const storyId = useId()
|
|
43
|
+
return (
|
|
44
|
+
<div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
|
|
45
|
+
<p id={`${storyId}-feedback-heading`}>链接目标</p>
|
|
46
|
+
<Link
|
|
47
|
+
variant="unstyled"
|
|
48
|
+
href={`#${storyId}-feedback-heading`}
|
|
49
|
+
alignSelf="start"
|
|
50
|
+
bg="gray.3"
|
|
51
|
+
color="lime.11"
|
|
52
|
+
borderRadius="md"
|
|
53
|
+
px="2"
|
|
54
|
+
py="1"
|
|
55
|
+
focusVisibleRing="outside"
|
|
56
|
+
css={{ _hover: { bg: 'lime.3' } }}>
|
|
57
|
+
自定外观的链接,保留导航行为
|
|
58
|
+
</Link>
|
|
59
|
+
</div>
|
|
60
|
+
)
|
|
61
|
+
},
|
|
62
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Heading, Link, LinkBox, LinkOverlay, Stack, Text } from '@repo/ui'
|
|
2
|
+
import { css } from 'styled-system/css'
|
|
3
|
+
|
|
4
|
+
import { useId } from 'react'
|
|
5
|
+
|
|
6
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
7
|
+
|
|
8
|
+
const meta = {
|
|
9
|
+
title: 'Navigation/LinkBox',
|
|
10
|
+
component: LinkBox,
|
|
11
|
+
parameters: {
|
|
12
|
+
controls: { disable: true },
|
|
13
|
+
docs: {
|
|
14
|
+
source: { type: 'code' },
|
|
15
|
+
description: { component: '整卡链接与独立次级链接。' },
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
} satisfies Meta<typeof LinkBox>
|
|
19
|
+
export default meta
|
|
20
|
+
type Story = StoryObj<typeof meta>
|
|
21
|
+
export const OverlayAndSecondaryLink: Story = {
|
|
22
|
+
render: function OverlayAndSecondaryLink() {
|
|
23
|
+
const storyId = useId()
|
|
24
|
+
return (
|
|
25
|
+
<div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
|
|
26
|
+
<Stack gap="4">
|
|
27
|
+
<Heading as="h3" size="lg">
|
|
28
|
+
整卡链接
|
|
29
|
+
</Heading>
|
|
30
|
+
<LinkBox as="article" p="6" borderWidth="1px" borderRadius="sm">
|
|
31
|
+
<Heading as="h3" size="md">
|
|
32
|
+
<LinkOverlay href={`#${storyId}-layout-link-target`}>
|
|
33
|
+
点击整张卡片跳至页尾
|
|
34
|
+
</LinkOverlay>
|
|
35
|
+
</Heading>
|
|
36
|
+
<Text my="3">标题链接覆盖卡片,次级链接保留独立交互。</Text>
|
|
37
|
+
<Link href={`#${storyId}-layout-secondary-target`}>独立的次级链接</Link>
|
|
38
|
+
</LinkBox>
|
|
39
|
+
<Text id={`${storyId}-layout-link-target`}>卡片链接目标</Text>
|
|
40
|
+
<Text id={`${storyId}-layout-secondary-target`}>次级链接目标</Text>
|
|
41
|
+
</Stack>
|
|
42
|
+
</div>
|
|
43
|
+
)
|
|
44
|
+
},
|
|
45
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Button, Pagination } from '@repo/ui'
|
|
2
|
+
import { useState } from 'react'
|
|
3
|
+
import { css } from 'styled-system/css'
|
|
4
|
+
|
|
5
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Navigation/Pagination',
|
|
9
|
+
component: Pagination.Root,
|
|
10
|
+
parameters: {
|
|
11
|
+
controls: { disable: true },
|
|
12
|
+
docs: {
|
|
13
|
+
source: { type: 'code' },
|
|
14
|
+
description: { component: '分页、首尾跳转和外部状态控制。' },
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
} satisfies Meta<typeof Pagination.Root>
|
|
18
|
+
export default meta
|
|
19
|
+
type Story = StoryObj<typeof meta>
|
|
20
|
+
export const Controlled: Story = {
|
|
21
|
+
render: function Controlled() {
|
|
22
|
+
const [page, setPage] = useState(1)
|
|
23
|
+
return (
|
|
24
|
+
<div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
|
|
25
|
+
<div className={css({ display: 'grid', gap: '3' })}>
|
|
26
|
+
<h3 className={css({ textStyle: 'lg', fontWeight: 'semibold' })}>受控分页</h3>
|
|
27
|
+
<Pagination.Root
|
|
28
|
+
count={200}
|
|
29
|
+
pageSize={10}
|
|
30
|
+
page={page}
|
|
31
|
+
onPageChange={(details) => setPage(details.page)}
|
|
32
|
+
aria-label="示例数据分页"
|
|
33
|
+
display="flex"
|
|
34
|
+
gap="2"
|
|
35
|
+
flexWrap="wrap">
|
|
36
|
+
<Pagination.PrevTrigger asChild>
|
|
37
|
+
<Button type="button" variant="outline">
|
|
38
|
+
上一页
|
|
39
|
+
</Button>
|
|
40
|
+
</Pagination.PrevTrigger>
|
|
41
|
+
<Pagination.Items
|
|
42
|
+
render={({ value, selected }) => (
|
|
43
|
+
<Button type="button" variant={selected ? 'solid' : 'outline'}>
|
|
44
|
+
{value}
|
|
45
|
+
</Button>
|
|
46
|
+
)}
|
|
47
|
+
ellipsis={
|
|
48
|
+
<span className={css({ display: 'inline-flex', alignItems: 'center', px: '2' })}>
|
|
49
|
+
…
|
|
50
|
+
</span>
|
|
51
|
+
}
|
|
52
|
+
/>
|
|
53
|
+
<Pagination.NextTrigger asChild>
|
|
54
|
+
<Button type="button" variant="outline">
|
|
55
|
+
下一页
|
|
56
|
+
</Button>
|
|
57
|
+
</Pagination.NextTrigger>
|
|
58
|
+
</Pagination.Root>
|
|
59
|
+
<p role="status">
|
|
60
|
+
第 {page} / 20 页;当前范围 {(page - 1) * 10 + 1}–{page * 10} / 200 条。
|
|
61
|
+
</p>
|
|
62
|
+
<div className={css({ display: 'flex', gap: '3', flexWrap: 'wrap' })}>
|
|
63
|
+
<Button type="button" variant="outline" onClick={() => setPage(1)}>
|
|
64
|
+
外部回到首页
|
|
65
|
+
</Button>
|
|
66
|
+
<Button type="button" variant="outline" onClick={() => setPage(20)}>
|
|
67
|
+
外部跳到末页
|
|
68
|
+
</Button>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
)
|
|
73
|
+
},
|
|
74
|
+
}
|