@oyolincc/create 0.4.0 → 0.5.1
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/{monorepo/.agents/skills/grilling → hono-fullstack/.agents/skills/ask-grilling}/SKILL.md +1 -1
- package/templates/hono-fullstack/.agents/skills/build-api-and-interface-design/SKILL.md +369 -0
- package/templates/hono-fullstack/.agents/skills/build-context-engineering/SKILL.md +353 -0
- package/templates/hono-fullstack/.agents/skills/build-incremental-implementation/SKILL.md +249 -0
- package/templates/hono-fullstack/.agents/skills/build-observability-and-instrumentation/SKILL.md +239 -0
- package/templates/hono-fullstack/.agents/skills/plan-planning-and-task-breakdown/SKILL.md +257 -0
- package/templates/{monorepo/.agents/skills/prototype → hono-fullstack/.agents/skills/plan-prototype}/LOGIC.md +1 -1
- package/templates/{monorepo/.agents/skills/prototype → hono-fullstack/.agents/skills/plan-prototype}/SKILL.md +2 -2
- package/templates/hono-fullstack/.agents/skills/{prototype → plan-prototype}/UI.md +2 -2
- package/templates/{monorepo/.agents/skills/research → hono-fullstack/.agents/skills/plan-research}/SKILL.md +2 -2
- package/templates/hono-fullstack/.agents/skills/plan-using-agent-skills/SKILL.md +185 -0
- package/templates/{monorepo/.agents/skills/wayfinder → hono-fullstack/.agents/skills/plan-wayfinder}/SKILL.md +43 -29
- package/templates/hono-fullstack/.agents/skills/review-code-review-and-quality/SKILL.md +400 -0
- package/templates/hono-fullstack/.agents/skills/review-doubt-driven-development/SKILL.md +244 -0
- package/templates/hono-fullstack/.agents/skills/review-security-and-hardening/SKILL.md +216 -0
- package/templates/hono-fullstack/.agents/skills/review-security-and-hardening/references/hardening-patterns.md +331 -0
- package/templates/hono-fullstack/.agents/skills/ship-ci-cd-and-automation/SKILL.md +393 -0
- package/templates/hono-fullstack/.agents/skills/ship-deprecation-and-migration/SKILL.md +252 -0
- package/templates/hono-fullstack/.agents/skills/ship-documentation-and-adrs/SKILL.md +298 -0
- package/templates/hono-fullstack/.agents/skills/ship-git-workflow-and-versioning/SKILL.md +355 -0
- package/templates/hono-fullstack/.agents/skills/ship-shipping-and-launch/SKILL.md +336 -0
- package/templates/hono-fullstack/.agents/skills/simplify-code-simplification/SKILL.md +332 -0
- package/templates/hono-fullstack/.agents/skills/simplify-performance-optimization/SKILL.md +268 -0
- package/templates/hono-fullstack/.agents/skills/simplify-performance-optimization/references/optimization-patterns.md +250 -0
- package/templates/hono-fullstack/.agents/skills/spec-constraint-driven-development/SKILL.md +318 -0
- package/templates/hono-fullstack/.agents/skills/spec-constraint-driven-development/references/floor-guard.md +182 -0
- package/templates/hono-fullstack/.agents/skills/spec-constraint-driven-development/scripts/quality-gate.mjs +45 -0
- package/templates/hono-fullstack/.agents/skills/spec-driven-development/SKILL.md +261 -0
- package/templates/hono-fullstack/.agents/skills/test-browser-testing-with-devtools/SKILL.md +319 -0
- package/templates/hono-fullstack/.agents/skills/test-debugging-and-error-recovery/SKILL.md +300 -0
- package/templates/hono-fullstack/.agents/skills/test-driven-development/SKILL.md +400 -0
- package/templates/hono-fullstack/.codegraph/.gitignore +5 -0
- package/templates/hono-fullstack/AGENTS.md +9 -20
- 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-server/apps/server/src/infra/work-runner/example → hono-fullstack/apps/server/src/infra/work-runner/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/.agents/skills/{grilling → ask-grilling}/SKILL.md +1 -1
- package/templates/hono-server/.agents/skills/build-api-and-interface-design/SKILL.md +369 -0
- package/templates/hono-server/.agents/skills/build-context-engineering/SKILL.md +353 -0
- package/templates/hono-server/.agents/skills/build-incremental-implementation/SKILL.md +249 -0
- package/templates/hono-server/.agents/skills/build-observability-and-instrumentation/SKILL.md +239 -0
- package/templates/hono-server/.agents/skills/plan-planning-and-task-breakdown/SKILL.md +257 -0
- package/templates/hono-server/.agents/skills/{prototype → plan-prototype}/LOGIC.md +1 -1
- package/templates/hono-server/.agents/skills/{prototype → plan-prototype}/SKILL.md +2 -2
- package/templates/{monorepo/.agents/skills/prototype → hono-server/.agents/skills/plan-prototype}/UI.md +2 -2
- package/templates/{hono-fullstack/.agents/skills/research → hono-server/.agents/skills/plan-research}/SKILL.md +2 -2
- package/templates/hono-server/.agents/skills/plan-using-agent-skills/SKILL.md +185 -0
- package/templates/{hono-fullstack/.agents/skills/wayfinder → hono-server/.agents/skills/plan-wayfinder}/SKILL.md +43 -29
- package/templates/hono-server/.agents/skills/review-code-review-and-quality/SKILL.md +400 -0
- package/templates/hono-server/.agents/skills/review-doubt-driven-development/SKILL.md +244 -0
- package/templates/hono-server/.agents/skills/review-security-and-hardening/SKILL.md +216 -0
- package/templates/hono-server/.agents/skills/review-security-and-hardening/references/hardening-patterns.md +331 -0
- package/templates/hono-server/.agents/skills/ship-ci-cd-and-automation/SKILL.md +393 -0
- package/templates/hono-server/.agents/skills/ship-deprecation-and-migration/SKILL.md +252 -0
- package/templates/hono-server/.agents/skills/ship-documentation-and-adrs/SKILL.md +298 -0
- package/templates/hono-server/.agents/skills/ship-git-workflow-and-versioning/SKILL.md +355 -0
- package/templates/hono-server/.agents/skills/ship-shipping-and-launch/SKILL.md +336 -0
- package/templates/hono-server/.agents/skills/simplify-code-simplification/SKILL.md +332 -0
- package/templates/hono-server/.agents/skills/simplify-performance-optimization/SKILL.md +268 -0
- package/templates/hono-server/.agents/skills/simplify-performance-optimization/references/optimization-patterns.md +250 -0
- package/templates/hono-server/.agents/skills/spec-constraint-driven-development/SKILL.md +318 -0
- package/templates/hono-server/.agents/skills/spec-constraint-driven-development/references/floor-guard.md +182 -0
- package/templates/hono-server/.agents/skills/spec-constraint-driven-development/scripts/quality-gate.mjs +45 -0
- package/templates/hono-server/.agents/skills/spec-driven-development/SKILL.md +261 -0
- package/templates/hono-server/.agents/skills/test-browser-testing-with-devtools/SKILL.md +319 -0
- package/templates/hono-server/.agents/skills/test-debugging-and-error-recovery/SKILL.md +300 -0
- package/templates/hono-server/.agents/skills/test-driven-development/SKILL.md +400 -0
- package/templates/hono-server/.codegraph/.gitignore +5 -0
- package/templates/hono-server/AGENTS.md +9 -20
- 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-fullstack/apps/server/src/infra/work-runner/example → hono-server/apps/server/src/infra/work-runner/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/{hono-fullstack/.agents/skills/grilling → monorepo/.agents/skills/ask-grilling}/SKILL.md +1 -1
- package/templates/monorepo/.agents/skills/build-api-and-interface-design/SKILL.md +369 -0
- package/templates/monorepo/.agents/skills/build-context-engineering/SKILL.md +353 -0
- package/templates/monorepo/.agents/skills/build-incremental-implementation/SKILL.md +249 -0
- package/templates/monorepo/.agents/skills/build-observability-and-instrumentation/SKILL.md +239 -0
- package/templates/monorepo/.agents/skills/plan-planning-and-task-breakdown/SKILL.md +257 -0
- package/templates/{hono-fullstack/.agents/skills/prototype → monorepo/.agents/skills/plan-prototype}/LOGIC.md +1 -1
- package/templates/{hono-fullstack/.agents/skills/prototype → monorepo/.agents/skills/plan-prototype}/SKILL.md +2 -2
- package/templates/{hono-server/.agents/skills/prototype → monorepo/.agents/skills/plan-prototype}/UI.md +2 -2
- package/templates/{hono-server/.agents/skills/research → monorepo/.agents/skills/plan-research}/SKILL.md +2 -2
- package/templates/monorepo/.agents/skills/plan-using-agent-skills/SKILL.md +185 -0
- package/templates/{hono-server/.agents/skills/wayfinder → monorepo/.agents/skills/plan-wayfinder}/SKILL.md +43 -29
- package/templates/monorepo/.agents/skills/review-code-review-and-quality/SKILL.md +400 -0
- package/templates/monorepo/.agents/skills/review-doubt-driven-development/SKILL.md +244 -0
- package/templates/monorepo/.agents/skills/review-security-and-hardening/SKILL.md +216 -0
- package/templates/monorepo/.agents/skills/review-security-and-hardening/references/hardening-patterns.md +331 -0
- package/templates/monorepo/.agents/skills/ship-ci-cd-and-automation/SKILL.md +393 -0
- package/templates/monorepo/.agents/skills/ship-deprecation-and-migration/SKILL.md +252 -0
- package/templates/monorepo/.agents/skills/ship-documentation-and-adrs/SKILL.md +298 -0
- package/templates/monorepo/.agents/skills/ship-git-workflow-and-versioning/SKILL.md +355 -0
- package/templates/monorepo/.agents/skills/ship-shipping-and-launch/SKILL.md +336 -0
- package/templates/monorepo/.agents/skills/simplify-code-simplification/SKILL.md +332 -0
- package/templates/monorepo/.agents/skills/simplify-performance-optimization/SKILL.md +268 -0
- package/templates/monorepo/.agents/skills/simplify-performance-optimization/references/optimization-patterns.md +250 -0
- package/templates/monorepo/.agents/skills/spec-constraint-driven-development/SKILL.md +318 -0
- package/templates/monorepo/.agents/skills/spec-constraint-driven-development/references/floor-guard.md +182 -0
- package/templates/monorepo/.agents/skills/spec-constraint-driven-development/scripts/quality-gate.mjs +45 -0
- package/templates/monorepo/.agents/skills/spec-driven-development/SKILL.md +261 -0
- package/templates/monorepo/.agents/skills/test-browser-testing-with-devtools/SKILL.md +319 -0
- package/templates/monorepo/.agents/skills/test-debugging-and-error-recovery/SKILL.md +300 -0
- package/templates/monorepo/.agents/skills/test-driven-development/SKILL.md +400 -0
- package/templates/monorepo/.codegraph/.gitignore +5 -0
- package/templates/monorepo/AGENTS.md +9 -20
- 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/.agents/skills/ask-matt/PHASE-BOUNDARIES.md +0 -55
- package/templates/hono-fullstack/.agents/skills/ask-matt/SKILL.md +0 -90
- package/templates/hono-fullstack/.agents/skills/ask-matt/agents/openai.yaml +0 -5
- package/templates/hono-fullstack/.agents/skills/code-review/SKILL.md +0 -87
- package/templates/hono-fullstack/.agents/skills/code-review/agents/openai.yaml +0 -3
- package/templates/hono-fullstack/.agents/skills/codebase-design/DEEPENING.md +0 -37
- package/templates/hono-fullstack/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +0 -44
- package/templates/hono-fullstack/.agents/skills/codebase-design/SKILL.md +0 -114
- package/templates/hono-fullstack/.agents/skills/codebase-design/agents/openai.yaml +0 -3
- package/templates/hono-fullstack/.agents/skills/confirm-requirements/SKILL.md +0 -25
- package/templates/hono-fullstack/.agents/skills/diagnosing-bugs/SKILL.md +0 -140
- package/templates/hono-fullstack/.agents/skills/diagnosing-bugs/agents/openai.yaml +0 -3
- package/templates/hono-fullstack/.agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +0 -44
- package/templates/hono-fullstack/.agents/skills/domain-modeling/ADR-FORMAT.md +0 -47
- package/templates/hono-fullstack/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +0 -60
- package/templates/hono-fullstack/.agents/skills/domain-modeling/SKILL.md +0 -74
- package/templates/hono-fullstack/.agents/skills/domain-modeling/agents/openai.yaml +0 -3
- package/templates/hono-fullstack/.agents/skills/grill-me/SKILL.md +0 -7
- package/templates/hono-fullstack/.agents/skills/grill-me/agents/openai.yaml +0 -5
- package/templates/hono-fullstack/.agents/skills/implement/SKILL.md +0 -15
- package/templates/hono-fullstack/.agents/skills/implement/agents/openai.yaml +0 -5
- package/templates/hono-fullstack/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +0 -123
- package/templates/hono-fullstack/.agents/skills/improve-codebase-architecture/SKILL.md +0 -71
- package/templates/hono-fullstack/.agents/skills/improve-codebase-architecture/agents/openai.yaml +0 -5
- package/templates/hono-fullstack/.agents/skills/resolving-merge-conflicts/SKILL.md +0 -14
- package/templates/hono-fullstack/.agents/skills/resolving-merge-conflicts/agents/openai.yaml +0 -3
- package/templates/hono-fullstack/.agents/skills/scoped-code-review/SKILL.md +0 -113
- package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/SKILL.md +0 -116
- package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/agents/openai.yaml +0 -5
- package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/domain.md +0 -51
- package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +0 -45
- package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +0 -46
- package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +0 -30
- package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/triage-labels.md +0 -15
- package/templates/hono-fullstack/.agents/skills/tdd/SKILL.md +0 -38
- package/templates/hono-fullstack/.agents/skills/tdd/agents/openai.yaml +0 -3
- package/templates/hono-fullstack/.agents/skills/tdd/mocking.md +0 -59
- package/templates/hono-fullstack/.agents/skills/tdd/tests.md +0 -77
- package/templates/hono-fullstack/.agents/skills/teach/GLOSSARY-FORMAT.md +0 -35
- package/templates/hono-fullstack/.agents/skills/teach/LEARNING-RECORD-FORMAT.md +0 -46
- package/templates/hono-fullstack/.agents/skills/teach/MISSION-FORMAT.md +0 -31
- package/templates/hono-fullstack/.agents/skills/teach/RESOURCES-FORMAT.md +0 -32
- package/templates/hono-fullstack/.agents/skills/teach/SKILL.md +0 -140
- package/templates/hono-fullstack/.agents/skills/teach/agents/openai.yaml +0 -5
- package/templates/hono-fullstack/.agents/skills/to-questionnaire/SKILL.md +0 -53
- package/templates/hono-fullstack/.agents/skills/to-questionnaire/agents/openai.yaml +0 -5
- package/templates/hono-fullstack/.agents/skills/triage/AGENT-BRIEF.md +0 -207
- package/templates/hono-fullstack/.agents/skills/triage/OUT-OF-SCOPE.md +0 -105
- package/templates/hono-fullstack/.agents/skills/triage/SKILL.md +0 -112
- package/templates/hono-fullstack/.agents/skills/triage/agents/openai.yaml +0 -5
- package/templates/hono-fullstack/.agents/skills/wait-what/SKILL.md +0 -7
- package/templates/hono-fullstack/.agents/skills/wait-what/agents/openai.yaml +0 -5
- package/templates/hono-fullstack/.agents/skills/wizard/SKILL.md +0 -44
- package/templates/hono-fullstack/.agents/skills/wizard/agents/openai.yaml +0 -3
- package/templates/hono-fullstack/.agents/skills/wizard/template.sh +0 -204
- package/templates/hono-fullstack/.agents/skills/writing-for-agents/SKILL-MECHANICS.md +0 -22
- package/templates/hono-fullstack/.agents/skills/writing-for-agents/SKILL.md +0 -81
- package/templates/hono-fullstack/.agents/skills/writing-for-agents/agents/openai.yaml +0 -3
- 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-fullstack/docs/agents/domain.md +0 -41
- package/templates/hono-fullstack/docs/agents/issue-tracker.md +0 -30
- package/templates/hono-fullstack/docs/agents/triage-labels.md +0 -15
- package/templates/hono-server/.agents/skills/ask-matt/PHASE-BOUNDARIES.md +0 -55
- package/templates/hono-server/.agents/skills/ask-matt/SKILL.md +0 -90
- package/templates/hono-server/.agents/skills/ask-matt/agents/openai.yaml +0 -5
- package/templates/hono-server/.agents/skills/code-review/SKILL.md +0 -87
- package/templates/hono-server/.agents/skills/code-review/agents/openai.yaml +0 -3
- package/templates/hono-server/.agents/skills/codebase-design/DEEPENING.md +0 -37
- package/templates/hono-server/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +0 -44
- package/templates/hono-server/.agents/skills/codebase-design/SKILL.md +0 -114
- package/templates/hono-server/.agents/skills/codebase-design/agents/openai.yaml +0 -3
- package/templates/hono-server/.agents/skills/confirm-requirements/SKILL.md +0 -25
- package/templates/hono-server/.agents/skills/diagnosing-bugs/SKILL.md +0 -140
- package/templates/hono-server/.agents/skills/diagnosing-bugs/agents/openai.yaml +0 -3
- package/templates/hono-server/.agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +0 -44
- package/templates/hono-server/.agents/skills/domain-modeling/ADR-FORMAT.md +0 -47
- package/templates/hono-server/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +0 -60
- package/templates/hono-server/.agents/skills/domain-modeling/SKILL.md +0 -74
- package/templates/hono-server/.agents/skills/domain-modeling/agents/openai.yaml +0 -3
- package/templates/hono-server/.agents/skills/grill-me/SKILL.md +0 -7
- package/templates/hono-server/.agents/skills/grill-me/agents/openai.yaml +0 -5
- package/templates/hono-server/.agents/skills/implement/SKILL.md +0 -15
- package/templates/hono-server/.agents/skills/implement/agents/openai.yaml +0 -5
- package/templates/hono-server/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +0 -123
- package/templates/hono-server/.agents/skills/improve-codebase-architecture/SKILL.md +0 -71
- package/templates/hono-server/.agents/skills/improve-codebase-architecture/agents/openai.yaml +0 -5
- package/templates/hono-server/.agents/skills/resolving-merge-conflicts/SKILL.md +0 -14
- package/templates/hono-server/.agents/skills/resolving-merge-conflicts/agents/openai.yaml +0 -3
- package/templates/hono-server/.agents/skills/scoped-code-review/SKILL.md +0 -113
- package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/SKILL.md +0 -116
- package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/agents/openai.yaml +0 -5
- package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/domain.md +0 -51
- package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +0 -45
- package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +0 -46
- package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +0 -30
- package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/triage-labels.md +0 -15
- package/templates/hono-server/.agents/skills/tdd/SKILL.md +0 -38
- package/templates/hono-server/.agents/skills/tdd/agents/openai.yaml +0 -3
- package/templates/hono-server/.agents/skills/tdd/mocking.md +0 -59
- package/templates/hono-server/.agents/skills/tdd/tests.md +0 -77
- package/templates/hono-server/.agents/skills/teach/GLOSSARY-FORMAT.md +0 -35
- package/templates/hono-server/.agents/skills/teach/LEARNING-RECORD-FORMAT.md +0 -46
- package/templates/hono-server/.agents/skills/teach/MISSION-FORMAT.md +0 -31
- package/templates/hono-server/.agents/skills/teach/RESOURCES-FORMAT.md +0 -32
- package/templates/hono-server/.agents/skills/teach/SKILL.md +0 -140
- package/templates/hono-server/.agents/skills/teach/agents/openai.yaml +0 -5
- package/templates/hono-server/.agents/skills/to-questionnaire/SKILL.md +0 -53
- package/templates/hono-server/.agents/skills/to-questionnaire/agents/openai.yaml +0 -5
- package/templates/hono-server/.agents/skills/triage/AGENT-BRIEF.md +0 -207
- package/templates/hono-server/.agents/skills/triage/OUT-OF-SCOPE.md +0 -105
- package/templates/hono-server/.agents/skills/triage/SKILL.md +0 -112
- package/templates/hono-server/.agents/skills/triage/agents/openai.yaml +0 -5
- package/templates/hono-server/.agents/skills/wait-what/SKILL.md +0 -7
- package/templates/hono-server/.agents/skills/wait-what/agents/openai.yaml +0 -5
- package/templates/hono-server/.agents/skills/wizard/SKILL.md +0 -44
- package/templates/hono-server/.agents/skills/wizard/agents/openai.yaml +0 -3
- package/templates/hono-server/.agents/skills/wizard/template.sh +0 -204
- package/templates/hono-server/.agents/skills/writing-for-agents/SKILL-MECHANICS.md +0 -22
- package/templates/hono-server/.agents/skills/writing-for-agents/SKILL.md +0 -81
- package/templates/hono-server/.agents/skills/writing-for-agents/agents/openai.yaml +0 -3
- 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
- package/templates/hono-server/docs/agents/domain.md +0 -41
- package/templates/hono-server/docs/agents/issue-tracker.md +0 -30
- package/templates/hono-server/docs/agents/triage-labels.md +0 -15
- package/templates/monorepo/.agents/skills/ask-matt/PHASE-BOUNDARIES.md +0 -55
- package/templates/monorepo/.agents/skills/ask-matt/SKILL.md +0 -90
- package/templates/monorepo/.agents/skills/ask-matt/agents/openai.yaml +0 -5
- package/templates/monorepo/.agents/skills/code-review/SKILL.md +0 -87
- package/templates/monorepo/.agents/skills/code-review/agents/openai.yaml +0 -3
- package/templates/monorepo/.agents/skills/codebase-design/DEEPENING.md +0 -37
- package/templates/monorepo/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +0 -44
- package/templates/monorepo/.agents/skills/codebase-design/SKILL.md +0 -114
- package/templates/monorepo/.agents/skills/codebase-design/agents/openai.yaml +0 -3
- package/templates/monorepo/.agents/skills/confirm-requirements/SKILL.md +0 -25
- package/templates/monorepo/.agents/skills/diagnosing-bugs/SKILL.md +0 -140
- package/templates/monorepo/.agents/skills/diagnosing-bugs/agents/openai.yaml +0 -3
- package/templates/monorepo/.agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +0 -44
- package/templates/monorepo/.agents/skills/domain-modeling/ADR-FORMAT.md +0 -47
- package/templates/monorepo/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +0 -60
- package/templates/monorepo/.agents/skills/domain-modeling/SKILL.md +0 -74
- package/templates/monorepo/.agents/skills/domain-modeling/agents/openai.yaml +0 -3
- package/templates/monorepo/.agents/skills/grill-me/SKILL.md +0 -7
- package/templates/monorepo/.agents/skills/grill-me/agents/openai.yaml +0 -5
- package/templates/monorepo/.agents/skills/implement/SKILL.md +0 -15
- package/templates/monorepo/.agents/skills/implement/agents/openai.yaml +0 -5
- package/templates/monorepo/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +0 -123
- package/templates/monorepo/.agents/skills/improve-codebase-architecture/SKILL.md +0 -71
- package/templates/monorepo/.agents/skills/improve-codebase-architecture/agents/openai.yaml +0 -5
- package/templates/monorepo/.agents/skills/resolving-merge-conflicts/SKILL.md +0 -14
- package/templates/monorepo/.agents/skills/resolving-merge-conflicts/agents/openai.yaml +0 -3
- package/templates/monorepo/.agents/skills/scoped-code-review/SKILL.md +0 -113
- package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/SKILL.md +0 -116
- package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/agents/openai.yaml +0 -5
- package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/domain.md +0 -51
- package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +0 -45
- package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +0 -46
- package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +0 -30
- package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/triage-labels.md +0 -15
- package/templates/monorepo/.agents/skills/tdd/SKILL.md +0 -38
- package/templates/monorepo/.agents/skills/tdd/agents/openai.yaml +0 -3
- package/templates/monorepo/.agents/skills/tdd/mocking.md +0 -59
- package/templates/monorepo/.agents/skills/tdd/tests.md +0 -77
- package/templates/monorepo/.agents/skills/teach/GLOSSARY-FORMAT.md +0 -35
- package/templates/monorepo/.agents/skills/teach/LEARNING-RECORD-FORMAT.md +0 -46
- package/templates/monorepo/.agents/skills/teach/MISSION-FORMAT.md +0 -31
- package/templates/monorepo/.agents/skills/teach/RESOURCES-FORMAT.md +0 -32
- package/templates/monorepo/.agents/skills/teach/SKILL.md +0 -140
- package/templates/monorepo/.agents/skills/teach/agents/openai.yaml +0 -5
- package/templates/monorepo/.agents/skills/to-questionnaire/SKILL.md +0 -53
- package/templates/monorepo/.agents/skills/to-questionnaire/agents/openai.yaml +0 -5
- package/templates/monorepo/.agents/skills/triage/AGENT-BRIEF.md +0 -207
- package/templates/monorepo/.agents/skills/triage/OUT-OF-SCOPE.md +0 -105
- package/templates/monorepo/.agents/skills/triage/SKILL.md +0 -112
- package/templates/monorepo/.agents/skills/triage/agents/openai.yaml +0 -5
- package/templates/monorepo/.agents/skills/wait-what/SKILL.md +0 -7
- package/templates/monorepo/.agents/skills/wait-what/agents/openai.yaml +0 -5
- package/templates/monorepo/.agents/skills/wizard/SKILL.md +0 -44
- package/templates/monorepo/.agents/skills/wizard/agents/openai.yaml +0 -3
- package/templates/monorepo/.agents/skills/wizard/template.sh +0 -204
- package/templates/monorepo/.agents/skills/writing-for-agents/SKILL-MECHANICS.md +0 -22
- package/templates/monorepo/.agents/skills/writing-for-agents/SKILL.md +0 -81
- package/templates/monorepo/.agents/skills/writing-for-agents/agents/openai.yaml +0 -3
- package/templates/monorepo/docs/agents/domain.md +0 -41
- package/templates/monorepo/docs/agents/issue-tracker.md +0 -30
- package/templates/monorepo/docs/agents/triage-labels.md +0 -15
- /package/templates/hono-fullstack/.agents/skills/{grilling → ask-grilling}/agents/openai.yaml +0 -0
- /package/templates/hono-fullstack/.agents/skills/{prototype → plan-prototype}/agents/openai.yaml +0 -0
- /package/templates/hono-fullstack/.agents/skills/{research → plan-research}/agents/openai.yaml +0 -0
- /package/templates/hono-fullstack/.agents/skills/{wayfinder → plan-wayfinder}/agents/openai.yaml +0 -0
- /package/templates/hono-server/.agents/skills/{grilling → ask-grilling}/agents/openai.yaml +0 -0
- /package/templates/hono-server/.agents/skills/{prototype → plan-prototype}/agents/openai.yaml +0 -0
- /package/templates/hono-server/.agents/skills/{research → plan-research}/agents/openai.yaml +0 -0
- /package/templates/hono-server/.agents/skills/{wayfinder → plan-wayfinder}/agents/openai.yaml +0 -0
- /package/templates/monorepo/.agents/skills/{grilling → ask-grilling}/agents/openai.yaml +0 -0
- /package/templates/monorepo/.agents/skills/{prototype → plan-prototype}/agents/openai.yaml +0 -0
- /package/templates/monorepo/.agents/skills/{research → plan-research}/agents/openai.yaml +0 -0
- /package/templates/monorepo/.agents/skills/{wayfinder → plan-wayfinder}/agents/openai.yaml +0 -0
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { Button, RadioCard, useRadioGroup } 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 plans = [
|
|
8
|
+
{ value: 'basic', label: '基础版', description: '适合个人使用', addon: '免费', disabled: false },
|
|
9
|
+
{
|
|
10
|
+
value: 'team',
|
|
11
|
+
label: '团队版',
|
|
12
|
+
description: '支持共享配置与团队管理',
|
|
13
|
+
addon: '每月 ¥99',
|
|
14
|
+
disabled: false,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
value: 'enterprise',
|
|
18
|
+
label: '企业版',
|
|
19
|
+
description: '即将开放',
|
|
20
|
+
addon: '暂不可选',
|
|
21
|
+
disabled: true,
|
|
22
|
+
},
|
|
23
|
+
]
|
|
24
|
+
const meta = {
|
|
25
|
+
title: 'Forms/RadioCard',
|
|
26
|
+
component: RadioCard.Root,
|
|
27
|
+
parameters: {
|
|
28
|
+
controls: { disable: true },
|
|
29
|
+
docs: {
|
|
30
|
+
source: { type: 'code' },
|
|
31
|
+
description: { component: '卡片单选、附加区域、只读与外部 store。' },
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
} satisfies Meta<typeof RadioCard.Root>
|
|
35
|
+
export default meta
|
|
36
|
+
type Story = StoryObj<typeof meta>
|
|
37
|
+
export const ControlledForm: Story = {
|
|
38
|
+
render: function ControlledForm() {
|
|
39
|
+
const [plan, setPlan] = useState<string | null>('standard')
|
|
40
|
+
|
|
41
|
+
const [submittedForm, setSubmittedForm] = useState('尚未提交')
|
|
42
|
+
return (
|
|
43
|
+
<div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
|
|
44
|
+
<form
|
|
45
|
+
noValidate
|
|
46
|
+
onSubmit={(event) => {
|
|
47
|
+
event.preventDefault()
|
|
48
|
+
setSubmittedForm(
|
|
49
|
+
JSON.stringify(Array.from(new FormData(event.currentTarget).entries())),
|
|
50
|
+
)
|
|
51
|
+
}}
|
|
52
|
+
onReset={() => {
|
|
53
|
+
setPlan('standard')
|
|
54
|
+
setSubmittedForm('已重置')
|
|
55
|
+
}}
|
|
56
|
+
className={css({ display: 'grid', gap: '4' })}>
|
|
57
|
+
<div className={css({ display: 'grid', gap: '3' })}>
|
|
58
|
+
<h3 className={css({ textStyle: 'lg', fontWeight: 'semibold' })}>卡片式单选</h3>
|
|
59
|
+
<RadioCard.Root
|
|
60
|
+
name="plan"
|
|
61
|
+
value={plan}
|
|
62
|
+
onValueChange={({ value }) => setPlan(value)}
|
|
63
|
+
variant="subtle">
|
|
64
|
+
<RadioCard.Label>选择套餐</RadioCard.Label>
|
|
65
|
+
<RadioCard.Item value="standard">
|
|
66
|
+
<RadioCard.ItemHiddenInput />
|
|
67
|
+
<RadioCard.ItemControl>
|
|
68
|
+
<RadioCard.ItemContent>
|
|
69
|
+
<RadioCard.ItemText>标准版</RadioCard.ItemText>
|
|
70
|
+
<RadioCard.ItemDescription>适合个人使用</RadioCard.ItemDescription>
|
|
71
|
+
</RadioCard.ItemContent>
|
|
72
|
+
<RadioCard.ItemIndicator />
|
|
73
|
+
</RadioCard.ItemControl>
|
|
74
|
+
</RadioCard.Item>
|
|
75
|
+
<RadioCard.Item value="professional">
|
|
76
|
+
<RadioCard.ItemHiddenInput />
|
|
77
|
+
<RadioCard.ItemControl>
|
|
78
|
+
<RadioCard.ItemContent>
|
|
79
|
+
<RadioCard.ItemText>专业版</RadioCard.ItemText>
|
|
80
|
+
<RadioCard.ItemDescription>适合团队协作</RadioCard.ItemDescription>
|
|
81
|
+
</RadioCard.ItemContent>
|
|
82
|
+
<RadioCard.ItemIndicator />
|
|
83
|
+
</RadioCard.ItemControl>
|
|
84
|
+
<RadioCard.ItemAddon>包含团队管理与共享配置</RadioCard.ItemAddon>
|
|
85
|
+
</RadioCard.Item>
|
|
86
|
+
<RadioCard.Item value="unavailable" disabled>
|
|
87
|
+
<RadioCard.ItemHiddenInput />
|
|
88
|
+
<RadioCard.ItemControl>
|
|
89
|
+
<RadioCard.ItemContent>
|
|
90
|
+
<RadioCard.ItemText>暂不可选(禁用)</RadioCard.ItemText>
|
|
91
|
+
<RadioCard.ItemDescription>即将开放</RadioCard.ItemDescription>
|
|
92
|
+
</RadioCard.ItemContent>
|
|
93
|
+
<RadioCard.ItemIndicator />
|
|
94
|
+
</RadioCard.ItemControl>
|
|
95
|
+
</RadioCard.Item>
|
|
96
|
+
</RadioCard.Root>
|
|
97
|
+
<RadioCard.Root defaultValue="selected" variant="solid" readOnly>
|
|
98
|
+
<RadioCard.Label>Solid 只读配方</RadioCard.Label>
|
|
99
|
+
<RadioCard.Item value="selected">
|
|
100
|
+
<RadioCard.ItemHiddenInput />
|
|
101
|
+
<RadioCard.ItemControl>
|
|
102
|
+
<RadioCard.ItemText>已选项</RadioCard.ItemText>
|
|
103
|
+
<RadioCard.ItemIndicator />
|
|
104
|
+
</RadioCard.ItemControl>
|
|
105
|
+
</RadioCard.Item>
|
|
106
|
+
</RadioCard.Root>
|
|
107
|
+
<p role="status">套餐:{plan || '未选择'}</p>
|
|
108
|
+
</div>
|
|
109
|
+
<div className={css({ display: 'flex', gap: '3' })}>
|
|
110
|
+
<Button type="submit">读取本地 FormData</Button>
|
|
111
|
+
<Button type="reset" variant="outline">
|
|
112
|
+
重置
|
|
113
|
+
</Button>
|
|
114
|
+
</div>
|
|
115
|
+
<pre role="status" className={css({ whiteSpace: 'pre-wrap', overflowWrap: 'anywhere' })}>
|
|
116
|
+
{submittedForm}
|
|
117
|
+
</pre>
|
|
118
|
+
</form>
|
|
119
|
+
</div>
|
|
120
|
+
)
|
|
121
|
+
},
|
|
122
|
+
}
|
|
123
|
+
export const Store: Story = {
|
|
124
|
+
render: function Store() {
|
|
125
|
+
const radio = useRadioGroup({ name: 'radio-card-store', defaultValue: 'basic' })
|
|
126
|
+
|
|
127
|
+
return (
|
|
128
|
+
<div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
|
|
129
|
+
<p>
|
|
130
|
+
ItemControl 是卡片内容容器;ItemIndicator 是独立标记。使用 Tab
|
|
131
|
+
与方向键检查选择和禁用状态。
|
|
132
|
+
</p>
|
|
133
|
+
|
|
134
|
+
<RadioCard.RootProvider value={radio} variant="surface" size="sm">
|
|
135
|
+
<RadioCard.Label>小尺寸 Surface:内容、描述与附加区</RadioCard.Label>
|
|
136
|
+
{plans.map((plan) => (
|
|
137
|
+
<RadioCard.Item key={plan.value} value={plan.value} disabled={plan.disabled}>
|
|
138
|
+
<RadioCard.ItemHiddenInput aria-describedby={`radio-api-${plan.value}-description`} />
|
|
139
|
+
<RadioCard.ItemControl>
|
|
140
|
+
<RadioCard.ItemContent>
|
|
141
|
+
<RadioCard.ItemText>{plan.label}</RadioCard.ItemText>
|
|
142
|
+
<RadioCard.ItemDescription id={`radio-api-${plan.value}-description`}>
|
|
143
|
+
{plan.description}
|
|
144
|
+
</RadioCard.ItemDescription>
|
|
145
|
+
</RadioCard.ItemContent>
|
|
146
|
+
<RadioCard.ItemIndicator />
|
|
147
|
+
</RadioCard.ItemControl>
|
|
148
|
+
<RadioCard.ItemAddon>{plan.addon}</RadioCard.ItemAddon>
|
|
149
|
+
</RadioCard.Item>
|
|
150
|
+
))}
|
|
151
|
+
</RadioCard.RootProvider>
|
|
152
|
+
<div className={css({ display: 'flex', gap: '2', flexWrap: 'wrap' })}>
|
|
153
|
+
<Button variant="outline" onClick={() => radio.setValue('team')}>
|
|
154
|
+
通过 store 选择团队版
|
|
155
|
+
</Button>
|
|
156
|
+
<Button variant="outline" onClick={() => radio.setValue('basic')}>
|
|
157
|
+
恢复基础版
|
|
158
|
+
</Button>
|
|
159
|
+
</div>
|
|
160
|
+
<p role="status">当前值:{radio.value || '未选择'}</p>
|
|
161
|
+
</div>
|
|
162
|
+
)
|
|
163
|
+
},
|
|
164
|
+
}
|
|
165
|
+
export const States: Story = {
|
|
166
|
+
render: function States() {
|
|
167
|
+
return (
|
|
168
|
+
<div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
|
|
169
|
+
<RadioCard.Root
|
|
170
|
+
defaultValue="centered"
|
|
171
|
+
variant="outline"
|
|
172
|
+
size="lg"
|
|
173
|
+
orientation="vertical"
|
|
174
|
+
align="center"
|
|
175
|
+
justify="center">
|
|
176
|
+
<RadioCard.Label>大尺寸 Outline:纵向居中与自定义选中图标</RadioCard.Label>
|
|
177
|
+
<RadioCard.Item value="centered">
|
|
178
|
+
<RadioCard.ItemHiddenInput />
|
|
179
|
+
<RadioCard.ItemControl>
|
|
180
|
+
<RadioCard.ItemIndicator checked={<span>✓</span>} />
|
|
181
|
+
<RadioCard.ItemContent>
|
|
182
|
+
<RadioCard.ItemText>纵向展示</RadioCard.ItemText>
|
|
183
|
+
<RadioCard.ItemDescription>orientation 控制卡片内部布局</RadioCard.ItemDescription>
|
|
184
|
+
</RadioCard.ItemContent>
|
|
185
|
+
</RadioCard.ItemControl>
|
|
186
|
+
</RadioCard.Item>
|
|
187
|
+
<RadioCard.Item value="alternative">
|
|
188
|
+
<RadioCard.ItemHiddenInput />
|
|
189
|
+
<RadioCard.ItemControl>
|
|
190
|
+
<RadioCard.ItemIndicator checked={<span>✓</span>} />
|
|
191
|
+
<RadioCard.ItemContent>
|
|
192
|
+
<RadioCard.ItemText>另一个选项</RadioCard.ItemText>
|
|
193
|
+
<RadioCard.ItemDescription>未选中时使用默认空心标记</RadioCard.ItemDescription>
|
|
194
|
+
</RadioCard.ItemContent>
|
|
195
|
+
</RadioCard.ItemControl>
|
|
196
|
+
</RadioCard.Item>
|
|
197
|
+
</RadioCard.Root>
|
|
198
|
+
|
|
199
|
+
<RadioCard.Root defaultValue="readonly" variant="solid" size="md" readOnly>
|
|
200
|
+
<RadioCard.Label>Solid:只读、自定义 children 与 asChild</RadioCard.Label>
|
|
201
|
+
<RadioCard.Item value="readonly">
|
|
202
|
+
<RadioCard.ItemHiddenInput />
|
|
203
|
+
<RadioCard.ItemControl>
|
|
204
|
+
<RadioCard.ItemContent>
|
|
205
|
+
<RadioCard.ItemText>只读选项</RadioCard.ItemText>
|
|
206
|
+
<RadioCard.ItemDescription>文字颜色继承选中卡片的前景色</RadioCard.ItemDescription>
|
|
207
|
+
</RadioCard.ItemContent>
|
|
208
|
+
<RadioCard.ItemIndicator asChild>
|
|
209
|
+
<span>✓</span>
|
|
210
|
+
</RadioCard.ItemIndicator>
|
|
211
|
+
</RadioCard.ItemControl>
|
|
212
|
+
</RadioCard.Item>
|
|
213
|
+
</RadioCard.Root>
|
|
214
|
+
</div>
|
|
215
|
+
)
|
|
216
|
+
},
|
|
217
|
+
}
|
|
218
|
+
export const Customization: Story = {
|
|
219
|
+
render: function Customization() {
|
|
220
|
+
return (
|
|
221
|
+
<div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
|
|
222
|
+
<div className={css({ display: 'grid', gap: '4' })}>
|
|
223
|
+
<h3 className={css({ textStyle: 'lg', fontWeight: 'semibold' })}>
|
|
224
|
+
RadioCard:尺寸与外观独立自定义
|
|
225
|
+
</h3>
|
|
226
|
+
<RadioCard.Root size="unstyled" name="custom-card-size" defaultValue="custom" gap="4">
|
|
227
|
+
<RadioCard.Label textStyle="lg">RadioCard:自定尺寸,保留 outline</RadioCard.Label>
|
|
228
|
+
<RadioCard.Item value="custom">
|
|
229
|
+
<RadioCard.ItemHiddenInput />
|
|
230
|
+
<RadioCard.ItemControl p="6" gap="4">
|
|
231
|
+
<RadioCard.ItemContent gap="2">
|
|
232
|
+
<RadioCard.ItemText textStyle="xl">活动套餐</RadioCard.ItemText>
|
|
233
|
+
<RadioCard.ItemDescription textStyle="md">
|
|
234
|
+
内容、描述和附加区都由页面定义尺寸。
|
|
235
|
+
</RadioCard.ItemDescription>
|
|
236
|
+
</RadioCard.ItemContent>
|
|
237
|
+
<RadioCard.ItemIndicator boxSize="32px" _after={{ boxSize: '12px' }} />
|
|
238
|
+
</RadioCard.ItemControl>
|
|
239
|
+
<RadioCard.ItemAddon px="6" py="3">
|
|
240
|
+
附加说明
|
|
241
|
+
</RadioCard.ItemAddon>
|
|
242
|
+
</RadioCard.Item>
|
|
243
|
+
</RadioCard.Root>
|
|
244
|
+
<RadioCard.Root variant="unstyled" name="custom-card-appearance" defaultValue="brand">
|
|
245
|
+
<RadioCard.Label>RadioCard:自定外观,保留 md 尺寸与默认对齐</RadioCard.Label>
|
|
246
|
+
<RadioCard.Item
|
|
247
|
+
value="brand"
|
|
248
|
+
bg="gray.3"
|
|
249
|
+
borderRadius="xl"
|
|
250
|
+
_checked={{ bg: 'lime.3' }}
|
|
251
|
+
focusVisibleRing="outside">
|
|
252
|
+
<RadioCard.ItemHiddenInput />
|
|
253
|
+
<RadioCard.ItemControl>
|
|
254
|
+
<RadioCard.ItemContent>
|
|
255
|
+
<RadioCard.ItemText>品牌卡片</RadioCard.ItemText>
|
|
256
|
+
</RadioCard.ItemContent>
|
|
257
|
+
<RadioCard.ItemIndicator checked={<span>✓</span>} />
|
|
258
|
+
</RadioCard.ItemControl>
|
|
259
|
+
</RadioCard.Item>
|
|
260
|
+
</RadioCard.Root>
|
|
261
|
+
</div>
|
|
262
|
+
</div>
|
|
263
|
+
)
|
|
264
|
+
},
|
|
265
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { Button, RadioGroup } from '@repo/ui'
|
|
2
|
+
import { useState, useRef } 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: 'Forms/RadioGroup',
|
|
9
|
+
component: RadioGroup.Root,
|
|
10
|
+
parameters: {
|
|
11
|
+
controls: { disable: true },
|
|
12
|
+
docs: {
|
|
13
|
+
source: { type: 'code' },
|
|
14
|
+
description: { component: '键盘单选、禁用项跳过和指示器兼容用法。' },
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
} satisfies Meta<typeof RadioGroup.Root>
|
|
18
|
+
export default meta
|
|
19
|
+
type Story = StoryObj<typeof meta>
|
|
20
|
+
export const Controlled: Story = {
|
|
21
|
+
render: function Controlled() {
|
|
22
|
+
const [frequency, setFrequency] = useState<string | null>('daily')
|
|
23
|
+
|
|
24
|
+
const [submittedForm, setSubmittedForm] = useState('尚未提交')
|
|
25
|
+
return (
|
|
26
|
+
<div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
|
|
27
|
+
<form
|
|
28
|
+
noValidate
|
|
29
|
+
onSubmit={(event) => {
|
|
30
|
+
event.preventDefault()
|
|
31
|
+
setSubmittedForm(
|
|
32
|
+
JSON.stringify(Array.from(new FormData(event.currentTarget).entries())),
|
|
33
|
+
)
|
|
34
|
+
}}
|
|
35
|
+
onReset={() => {
|
|
36
|
+
setFrequency('daily')
|
|
37
|
+
setSubmittedForm('已重置')
|
|
38
|
+
}}
|
|
39
|
+
className={css({ display: 'grid', gap: '4' })}>
|
|
40
|
+
<RadioGroup.Root
|
|
41
|
+
name="frequency"
|
|
42
|
+
value={frequency}
|
|
43
|
+
onValueChange={(details) => setFrequency(details.value)}
|
|
44
|
+
size="md">
|
|
45
|
+
<RadioGroup.Label>通知频率</RadioGroup.Label>
|
|
46
|
+
<RadioGroup.Item value="immediate">
|
|
47
|
+
<RadioGroup.ItemHiddenInput />
|
|
48
|
+
<RadioGroup.ItemIndicator />
|
|
49
|
+
<RadioGroup.ItemText>立即通知</RadioGroup.ItemText>
|
|
50
|
+
</RadioGroup.Item>
|
|
51
|
+
<RadioGroup.Item value="disabled" disabled>
|
|
52
|
+
<RadioGroup.ItemHiddenInput />
|
|
53
|
+
<RadioGroup.ItemIndicator />
|
|
54
|
+
<RadioGroup.ItemText>禁用选项</RadioGroup.ItemText>
|
|
55
|
+
</RadioGroup.Item>
|
|
56
|
+
<RadioGroup.Item value="daily">
|
|
57
|
+
<RadioGroup.ItemHiddenInput />
|
|
58
|
+
<RadioGroup.ItemIndicator />
|
|
59
|
+
<RadioGroup.ItemText>每日摘要</RadioGroup.ItemText>
|
|
60
|
+
</RadioGroup.Item>
|
|
61
|
+
</RadioGroup.Root>
|
|
62
|
+
<RadioGroup.Root size="unstyled" name="custom-radio" defaultValue="daily" gap="4">
|
|
63
|
+
<RadioGroup.Label>自定单选尺寸,方向键切换</RadioGroup.Label>
|
|
64
|
+
{['daily', 'weekly'].map((value) => (
|
|
65
|
+
<RadioGroup.Item key={value} value={value} gap="4">
|
|
66
|
+
<RadioGroup.ItemHiddenInput />
|
|
67
|
+
<RadioGroup.ItemIndicator boxSize="32px" _after={{ boxSize: '12px' }} />
|
|
68
|
+
<RadioGroup.ItemText textStyle="lg">
|
|
69
|
+
{value === 'daily' ? '每日' : '每周'}
|
|
70
|
+
</RadioGroup.ItemText>
|
|
71
|
+
</RadioGroup.Item>
|
|
72
|
+
))}
|
|
73
|
+
</RadioGroup.Root>
|
|
74
|
+
<div className={css({ display: 'flex', gap: '3' })}>
|
|
75
|
+
<Button type="submit">读取本地 FormData</Button>
|
|
76
|
+
<Button type="reset" variant="outline">
|
|
77
|
+
重置
|
|
78
|
+
</Button>
|
|
79
|
+
</div>
|
|
80
|
+
<pre role="status" className={css({ whiteSpace: 'pre-wrap', overflowWrap: 'anywhere' })}>
|
|
81
|
+
{submittedForm}
|
|
82
|
+
</pre>
|
|
83
|
+
</form>
|
|
84
|
+
</div>
|
|
85
|
+
)
|
|
86
|
+
},
|
|
87
|
+
}
|
|
88
|
+
export const IndicatorCompatibility: Story = {
|
|
89
|
+
render: function IndicatorCompatibility() {
|
|
90
|
+
const indicatorRef = useRef<HTMLSpanElement>(null)
|
|
91
|
+
return (
|
|
92
|
+
<div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
|
|
93
|
+
<RadioGroup.Root defaultValue="new" size="sm">
|
|
94
|
+
<RadioGroup.Label>普通 Radio:新增 ItemIndicator,保留 ItemControl</RadioGroup.Label>
|
|
95
|
+
<RadioGroup.Item value="new">
|
|
96
|
+
<RadioGroup.ItemHiddenInput />
|
|
97
|
+
<RadioGroup.ItemIndicator ref={indicatorRef} />
|
|
98
|
+
<RadioGroup.ItemText>Chakra 风格 ItemIndicator</RadioGroup.ItemText>
|
|
99
|
+
</RadioGroup.Item>
|
|
100
|
+
<RadioGroup.Item value="existing">
|
|
101
|
+
<RadioGroup.ItemHiddenInput />
|
|
102
|
+
<RadioGroup.ItemControl />
|
|
103
|
+
<RadioGroup.ItemText>已有 ItemControl 用法</RadioGroup.ItemText>
|
|
104
|
+
</RadioGroup.Item>
|
|
105
|
+
</RadioGroup.Root>
|
|
106
|
+
</div>
|
|
107
|
+
)
|
|
108
|
+
},
|
|
109
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { fn } from 'storybook/test'
|
|
2
|
+
import { Button, RatingGroup } from '@repo/ui'
|
|
3
|
+
import { useState } from 'react'
|
|
4
|
+
import { css } from 'styled-system/css'
|
|
5
|
+
|
|
6
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
7
|
+
|
|
8
|
+
const meta = {
|
|
9
|
+
title: 'Forms/RatingGroup',
|
|
10
|
+
component: RatingGroup.Root,
|
|
11
|
+
args: {
|
|
12
|
+
size: 'md',
|
|
13
|
+
count: 5,
|
|
14
|
+
allowHalf: true,
|
|
15
|
+
disabled: false,
|
|
16
|
+
readOnly: false,
|
|
17
|
+
onValueChange: fn(),
|
|
18
|
+
},
|
|
19
|
+
argTypes: {
|
|
20
|
+
size: { control: 'select', options: ['lg', 'md', 'sm', 'unstyled', 'xl', 'xs'] },
|
|
21
|
+
count: { control: 'number' },
|
|
22
|
+
allowHalf: { control: 'boolean' },
|
|
23
|
+
disabled: { control: 'boolean' },
|
|
24
|
+
readOnly: { control: 'boolean' },
|
|
25
|
+
onValueChange: { control: false },
|
|
26
|
+
},
|
|
27
|
+
parameters: {
|
|
28
|
+
controls: { disable: true },
|
|
29
|
+
docs: {
|
|
30
|
+
source: { type: 'code' },
|
|
31
|
+
description: { component: '评分、半星、只读与尺寸定制。' },
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
} satisfies Meta<typeof RatingGroup.Root>
|
|
35
|
+
export default meta
|
|
36
|
+
type Story = StoryObj<typeof meta>
|
|
37
|
+
export const Playground: Story = {
|
|
38
|
+
parameters: {
|
|
39
|
+
controls: { disable: false, include: ['size', 'count', 'allowHalf', 'disabled', 'readOnly'] },
|
|
40
|
+
docs: { source: { type: 'dynamic' } },
|
|
41
|
+
},
|
|
42
|
+
render: (args) => (
|
|
43
|
+
<div className={css({ maxWidth: '2xl' })}>
|
|
44
|
+
<RatingGroup.Root {...args} defaultValue={3.5}>
|
|
45
|
+
<RatingGroup.Label>评分</RatingGroup.Label>
|
|
46
|
+
<RatingGroup.Control />
|
|
47
|
+
<RatingGroup.HiddenInput />
|
|
48
|
+
</RatingGroup.Root>
|
|
49
|
+
</div>
|
|
50
|
+
),
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const HalfRating: Story = {
|
|
54
|
+
render: function HalfRating() {
|
|
55
|
+
const [rating, setRating] = useState(3.5)
|
|
56
|
+
|
|
57
|
+
const [submittedForm, setSubmittedForm] = useState('尚未提交')
|
|
58
|
+
return (
|
|
59
|
+
<div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
|
|
60
|
+
<form
|
|
61
|
+
noValidate
|
|
62
|
+
onSubmit={(event) => {
|
|
63
|
+
event.preventDefault()
|
|
64
|
+
setSubmittedForm(
|
|
65
|
+
JSON.stringify(Array.from(new FormData(event.currentTarget).entries())),
|
|
66
|
+
)
|
|
67
|
+
}}
|
|
68
|
+
onReset={() => {
|
|
69
|
+
setRating(3.5)
|
|
70
|
+
setSubmittedForm('已重置')
|
|
71
|
+
}}
|
|
72
|
+
className={css({ display: 'grid', gap: '4' })}>
|
|
73
|
+
<div className={css({ display: 'grid', gap: '3' })}>
|
|
74
|
+
<h3 className={css({ textStyle: 'lg', fontWeight: 'semibold' })}>评分与半星</h3>
|
|
75
|
+
<RatingGroup.Root
|
|
76
|
+
name="rating"
|
|
77
|
+
count={5}
|
|
78
|
+
allowHalf
|
|
79
|
+
value={rating}
|
|
80
|
+
onValueChange={({ value }) => setRating(value)}>
|
|
81
|
+
<RatingGroup.Label>体验评分</RatingGroup.Label>
|
|
82
|
+
<RatingGroup.Control />
|
|
83
|
+
<RatingGroup.HiddenInput />
|
|
84
|
+
</RatingGroup.Root>
|
|
85
|
+
<RatingGroup.Root defaultValue={4} readOnly size="sm">
|
|
86
|
+
<RatingGroup.Label>只读评分</RatingGroup.Label>
|
|
87
|
+
<RatingGroup.Control />
|
|
88
|
+
</RatingGroup.Root>
|
|
89
|
+
<p role="status">当前评分:{rating}</p>
|
|
90
|
+
</div>
|
|
91
|
+
<div className={css({ display: 'flex', gap: '3' })}>
|
|
92
|
+
<Button type="submit">读取本地 FormData</Button>
|
|
93
|
+
<Button type="reset" variant="outline">
|
|
94
|
+
重置
|
|
95
|
+
</Button>
|
|
96
|
+
</div>
|
|
97
|
+
<pre role="status" className={css({ whiteSpace: 'pre-wrap', overflowWrap: 'anywhere' })}>
|
|
98
|
+
{submittedForm}
|
|
99
|
+
</pre>
|
|
100
|
+
</form>
|
|
101
|
+
</div>
|
|
102
|
+
)
|
|
103
|
+
},
|
|
104
|
+
}
|
|
105
|
+
export const CustomSize: Story = {
|
|
106
|
+
render: function CustomSize() {
|
|
107
|
+
return (
|
|
108
|
+
<div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
|
|
109
|
+
<RatingGroup.Root size="unstyled" name="custom-rating" defaultValue={3.5} allowHalf gap="4">
|
|
110
|
+
<RatingGroup.Label>32px 半星评分</RatingGroup.Label>
|
|
111
|
+
<RatingGroup.Control gap="3">
|
|
112
|
+
{[1, 2, 3, 4, 5].map((index) => (
|
|
113
|
+
<RatingGroup.Item key={index} index={index}>
|
|
114
|
+
<RatingGroup.ItemIndicator width="32px" height="32px" />
|
|
115
|
+
</RatingGroup.Item>
|
|
116
|
+
))}
|
|
117
|
+
</RatingGroup.Control>
|
|
118
|
+
<RatingGroup.HiddenInput />
|
|
119
|
+
</RatingGroup.Root>
|
|
120
|
+
</div>
|
|
121
|
+
)
|
|
122
|
+
},
|
|
123
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { fn } from 'storybook/test'
|
|
2
|
+
import { Button, SegmentGroup } from '@repo/ui'
|
|
3
|
+
import { useState } from 'react'
|
|
4
|
+
import { css } from 'styled-system/css'
|
|
5
|
+
|
|
6
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
7
|
+
|
|
8
|
+
const meta = {
|
|
9
|
+
title: 'Forms/SegmentGroup',
|
|
10
|
+
component: SegmentGroup.Root,
|
|
11
|
+
args: { fitted: false, size: 'md', disabled: false, onValueChange: fn() },
|
|
12
|
+
argTypes: {
|
|
13
|
+
fitted: { control: 'boolean' },
|
|
14
|
+
size: { control: 'select', options: ['lg', 'md', 'sm', 'unstyled', 'xl', 'xs'] },
|
|
15
|
+
disabled: { control: 'boolean' },
|
|
16
|
+
onValueChange: { control: false },
|
|
17
|
+
},
|
|
18
|
+
parameters: {
|
|
19
|
+
controls: { disable: true },
|
|
20
|
+
docs: {
|
|
21
|
+
source: { type: 'code' },
|
|
22
|
+
description: { component: '分段单选、禁用项及水平与垂直布局。' },
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
} satisfies Meta<typeof SegmentGroup.Root>
|
|
26
|
+
export default meta
|
|
27
|
+
type Story = StoryObj<typeof meta>
|
|
28
|
+
export const Playground: Story = {
|
|
29
|
+
parameters: {
|
|
30
|
+
controls: { disable: false, include: ['fitted', 'size', 'disabled'] },
|
|
31
|
+
docs: { source: { type: 'dynamic' } },
|
|
32
|
+
},
|
|
33
|
+
render: (args) => (
|
|
34
|
+
<div className={css({ maxWidth: '2xl' })}>
|
|
35
|
+
<SegmentGroup.Root {...args} defaultValue="week">
|
|
36
|
+
<SegmentGroup.Label className={css({ srOnly: true })}>统计周期</SegmentGroup.Label>
|
|
37
|
+
<SegmentGroup.Indicator />
|
|
38
|
+
<SegmentGroup.Items
|
|
39
|
+
items={[
|
|
40
|
+
{ value: 'day', label: '每日' },
|
|
41
|
+
{ value: 'week', label: '每周' },
|
|
42
|
+
{ value: 'year', label: '每年(禁用)', disabled: true },
|
|
43
|
+
]}
|
|
44
|
+
/>
|
|
45
|
+
</SegmentGroup.Root>
|
|
46
|
+
</div>
|
|
47
|
+
),
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const ControlledForm: Story = {
|
|
51
|
+
render: function ControlledForm() {
|
|
52
|
+
const [period, setPeriod] = useState<string | null>('week')
|
|
53
|
+
|
|
54
|
+
const [submittedForm, setSubmittedForm] = useState('尚未提交')
|
|
55
|
+
return (
|
|
56
|
+
<div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
|
|
57
|
+
<form
|
|
58
|
+
noValidate
|
|
59
|
+
onSubmit={(event) => {
|
|
60
|
+
event.preventDefault()
|
|
61
|
+
setSubmittedForm(
|
|
62
|
+
JSON.stringify(Array.from(new FormData(event.currentTarget).entries())),
|
|
63
|
+
)
|
|
64
|
+
}}
|
|
65
|
+
onReset={() => {
|
|
66
|
+
setPeriod('week')
|
|
67
|
+
setSubmittedForm('已重置')
|
|
68
|
+
}}
|
|
69
|
+
className={css({ display: 'grid', gap: '4' })}>
|
|
70
|
+
<div className={css({ display: 'grid', gap: '3' })}>
|
|
71
|
+
<h3 className={css({ textStyle: 'lg', fontWeight: 'semibold' })}>分段单选</h3>
|
|
72
|
+
<SegmentGroup.Root
|
|
73
|
+
name="period"
|
|
74
|
+
value={period}
|
|
75
|
+
onValueChange={({ value }) => setPeriod(value)}
|
|
76
|
+
fitted>
|
|
77
|
+
<SegmentGroup.Label className={css({ srOnly: true })}>统计周期</SegmentGroup.Label>
|
|
78
|
+
<SegmentGroup.Indicator />
|
|
79
|
+
<SegmentGroup.Items
|
|
80
|
+
items={[
|
|
81
|
+
{ value: 'day', label: '每日' },
|
|
82
|
+
{ value: 'week', label: '每周' },
|
|
83
|
+
{ value: 'month', label: '每月' },
|
|
84
|
+
{ value: 'year', label: '每年(禁用)', disabled: true },
|
|
85
|
+
]}
|
|
86
|
+
/>
|
|
87
|
+
</SegmentGroup.Root>
|
|
88
|
+
<SegmentGroup.Root orientation="vertical" defaultValue="list" width="40" size="sm">
|
|
89
|
+
<SegmentGroup.Label className={css({ srOnly: true })}>显示方式</SegmentGroup.Label>
|
|
90
|
+
<SegmentGroup.Indicator />
|
|
91
|
+
<SegmentGroup.Items items={['list', 'grid']} />
|
|
92
|
+
</SegmentGroup.Root>
|
|
93
|
+
<p role="status">周期:{period || '未选择'}</p>
|
|
94
|
+
</div>
|
|
95
|
+
<div className={css({ display: 'flex', gap: '3' })}>
|
|
96
|
+
<Button type="submit">读取本地 FormData</Button>
|
|
97
|
+
<Button type="reset" variant="outline">
|
|
98
|
+
重置
|
|
99
|
+
</Button>
|
|
100
|
+
</div>
|
|
101
|
+
<pre role="status" className={css({ whiteSpace: 'pre-wrap', overflowWrap: 'anywhere' })}>
|
|
102
|
+
{submittedForm}
|
|
103
|
+
</pre>
|
|
104
|
+
</form>
|
|
105
|
+
</div>
|
|
106
|
+
)
|
|
107
|
+
},
|
|
108
|
+
}
|
|
109
|
+
export const CustomSize: Story = {
|
|
110
|
+
render: function CustomSize() {
|
|
111
|
+
return (
|
|
112
|
+
<div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
|
|
113
|
+
<SegmentGroup.Root size="unstyled" name="custom-period" defaultValue="week" fitted>
|
|
114
|
+
<SegmentGroup.Label className={css({ srOnly: true })}>自定分段尺寸</SegmentGroup.Label>
|
|
115
|
+
<SegmentGroup.Indicator />
|
|
116
|
+
<SegmentGroup.Items
|
|
117
|
+
h="56px"
|
|
118
|
+
px="6"
|
|
119
|
+
gap="4"
|
|
120
|
+
textStyle="lg"
|
|
121
|
+
items={[
|
|
122
|
+
{ value: 'day', label: '每日' },
|
|
123
|
+
{ value: 'week', label: '每周' },
|
|
124
|
+
]}
|
|
125
|
+
/>
|
|
126
|
+
</SegmentGroup.Root>
|
|
127
|
+
</div>
|
|
128
|
+
)
|
|
129
|
+
},
|
|
130
|
+
}
|