@oyolincc/create 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. package/package.json +2 -2
  2. package/templates/hono-fullstack/.codegraph/.gitignore +5 -0
  3. package/templates/hono-fullstack/README.md +22 -1
  4. package/templates/hono-fullstack/_gitignore +1 -0
  5. package/templates/hono-fullstack/apps/server/package.json +7 -2
  6. package/templates/hono-fullstack/apps/server/src/adapters/cloudflare/entry.ts +4 -30
  7. package/templates/hono-fullstack/apps/server/src/adapters/nodejs/bootstrap.ts +20 -12
  8. package/templates/hono-fullstack/apps/server/src/adapters/nodejs/entry.ts +7 -57
  9. package/templates/hono-fullstack/apps/server/src/app.ts +37 -21
  10. package/templates/hono-fullstack/apps/server/src/config.ts +1 -1
  11. package/templates/hono-fullstack/apps/server/src/di-container.ts +51 -0
  12. package/templates/hono-fullstack/apps/server/src/infra/logger/getter.ts +1 -1
  13. package/templates/hono-fullstack/apps/server/src/infra/logger/pino.ts +21 -34
  14. package/templates/hono-fullstack/apps/server/src/infra/work-runner/errors.ts +22 -0
  15. package/templates/hono-fullstack/apps/server/src/infra/work-runner/pass-through/runner.ts +28 -22
  16. package/templates/hono-fullstack/apps/server/src/infra/work-runner/piscina/runner.ts +11 -34
  17. package/templates/hono-fullstack/apps/server/src/infra/work-runner/{example → piscina}/worker-entry.ts +6 -2
  18. package/templates/hono-fullstack/apps/server/src/infra/work-runner/types.ts +2 -16
  19. package/templates/hono-fullstack/apps/server/src/infra/work-runner/utils/business-error.ts +10 -5
  20. package/templates/hono-fullstack/apps/server/src/infra/work-runner/utils/message.ts +5 -17
  21. package/templates/hono-fullstack/apps/server/src/middlewares/cors.ts +16 -22
  22. package/templates/hono-fullstack/apps/server/src/middlewares/logger.ts +34 -0
  23. package/templates/hono-fullstack/apps/server/src/modules/example/module.ts +8 -0
  24. package/templates/hono-fullstack/apps/server/src/modules/example/queries.ts +8 -0
  25. package/templates/hono-fullstack/apps/server/src/modules/example/routes.ts +74 -68
  26. package/templates/hono-fullstack/apps/server/src/modules/example/service.test.ts +53 -0
  27. package/templates/hono-fullstack/apps/server/src/modules/example/service.ts +54 -0
  28. package/templates/hono-fullstack/apps/server/src/modules/example/types.ts +12 -0
  29. package/templates/hono-fullstack/apps/server/src/modules/example/work-task/tasks.test.ts +9 -35
  30. package/templates/hono-fullstack/apps/server/src/modules/example/work-task/tasks.ts +15 -46
  31. package/templates/hono-fullstack/apps/server/src/shared/errors/defs/index.ts +6 -1
  32. package/templates/hono-fullstack/apps/server/src/shared/errors/handler.ts +1 -1
  33. package/templates/hono-fullstack/apps/server/src/shared/network/openapi/index.ts +1 -1
  34. package/templates/hono-fullstack/apps/server/src/shared/types/app.ts +51 -0
  35. package/templates/hono-fullstack/apps/server/src/shared/types/db.ts +126 -0
  36. package/templates/hono-fullstack/apps/server/src/shared/utils/data-access/check.ts +19 -0
  37. package/templates/hono-fullstack/apps/server/src/shared/utils/data-access/model.ts +47 -0
  38. package/templates/hono-fullstack/apps/server/src/shared/utils/data-access/params.ts +105 -0
  39. package/templates/hono-fullstack/apps/server/src/shared/utils/data-access/query.test.ts +139 -0
  40. package/templates/hono-fullstack/apps/server/src/shared/utils/data-access/query.ts +236 -0
  41. package/templates/hono-fullstack/apps/server/vite.config.ts +2 -2
  42. package/templates/hono-fullstack/apps/server/wrangler.jsonc +1 -1
  43. package/templates/hono-fullstack/apps/stack/frontend/assets/styles.css +6 -0
  44. package/templates/hono-fullstack/apps/stack/frontend/components/general/ErrorMessage.tsx +3 -1
  45. package/templates/hono-fullstack/apps/stack/frontend/components/layouts/AppLayout.tsx +2 -1
  46. package/templates/hono-fullstack/apps/stack/frontend/components/layouts/Header.tsx +14 -2
  47. package/templates/hono-fullstack/apps/stack/frontend/components/layouts/Page.tsx +2 -1
  48. package/templates/hono-fullstack/apps/stack/frontend/components/layouts/PageContainer.tsx +4 -1
  49. package/templates/hono-fullstack/apps/stack/frontend/modules/example/api.ts +16 -9
  50. package/templates/hono-fullstack/apps/stack/frontend/modules/example/components/ExampleForm.tsx +25 -12
  51. package/templates/hono-fullstack/apps/stack/frontend/modules/example/components/ExampleList.tsx +13 -4
  52. package/templates/hono-fullstack/apps/stack/frontend/modules/example/hooks/api-hooks.ts +3 -3
  53. package/templates/hono-fullstack/apps/stack/frontend/routes/__root.tsx +1 -1
  54. package/templates/hono-fullstack/apps/stack/frontend/routes/index.tsx +16 -4
  55. package/templates/hono-fullstack/apps/stack/package.json +9 -4
  56. package/templates/hono-fullstack/apps/stack/panda.config.ts +31 -0
  57. package/templates/hono-fullstack/apps/stack/tsconfig.json +1 -0
  58. package/templates/hono-fullstack/apps/stack/turbo.json +20 -0
  59. package/templates/hono-fullstack/apps/stack/vite.config.ts +48 -12
  60. package/templates/hono-fullstack/apps/stack/wrangler.jsonc +1 -1
  61. package/templates/hono-fullstack/envs/.env.example.sqlite-d1 +1 -0
  62. package/templates/hono-fullstack/libs/db/drizzle-kit/sqlite-d1.config.ts +29 -10
  63. package/templates/hono-fullstack/libs/db/package.json +1 -0
  64. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/columns.ts +1 -1
  65. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/modules/examples/examples.ts +6 -3
  66. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/vo.ts +7 -1
  67. package/templates/hono-fullstack/libs/definition/README.md +81 -0
  68. package/templates/hono-fullstack/libs/definition/package.json +3 -1
  69. package/templates/hono-fullstack/libs/definition/src/constants/index.ts +1 -0
  70. package/templates/hono-fullstack/libs/definition/src/constants/pagination.ts +3 -0
  71. package/templates/hono-fullstack/libs/definition/src/modules/common-contracts.ts +24 -0
  72. package/templates/hono-fullstack/libs/definition/src/modules/example/contracts.ts +34 -0
  73. package/templates/hono-fullstack/libs/definition/src/modules/example/index.ts +1 -16
  74. package/templates/hono-fullstack/libs/definition/src/modules/index.ts +2 -0
  75. package/templates/hono-fullstack/libs/definition/src/modules/vo-generated-types.ts +12 -0
  76. package/templates/hono-fullstack/libs/ui/.storybook/main.ts +32 -0
  77. package/templates/hono-fullstack/libs/ui/.storybook/panda.config.ts +22 -0
  78. package/templates/hono-fullstack/libs/ui/.storybook/preview.tsx +79 -0
  79. package/templates/hono-fullstack/libs/ui/.storybook/styles.css +1 -0
  80. package/templates/hono-fullstack/libs/ui/.storybook/vite.config.ts +37 -0
  81. package/templates/hono-fullstack/libs/ui/components.json +15 -0
  82. package/templates/hono-fullstack/libs/ui/package.json +114 -0
  83. package/templates/hono-fullstack/libs/ui/panda.config.ts +41 -0
  84. package/templates/hono-fullstack/libs/ui/src/Tooltip.tsx +47 -0
  85. package/templates/hono-fullstack/libs/ui/src/components/atoms/buttons/Button.tsx +80 -0
  86. package/templates/hono-fullstack/libs/ui/src/components/atoms/buttons/CloseButton.tsx +15 -0
  87. package/templates/hono-fullstack/libs/ui/src/components/atoms/buttons/IconButton.tsx +10 -0
  88. package/templates/hono-fullstack/libs/ui/src/components/atoms/collections/Combobox.tsx +91 -0
  89. package/templates/hono-fullstack/libs/ui/src/components/atoms/collections/Select.tsx +88 -0
  90. package/templates/hono-fullstack/libs/ui/src/components/atoms/collections/TreeView.tsx +142 -0
  91. package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Avatar.tsx +64 -0
  92. package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Badge.tsx +7 -0
  93. package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Card.tsx +23 -0
  94. package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Clipboard.tsx +77 -0
  95. package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Icon.tsx +9 -0
  96. package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Table.tsx +51 -0
  97. package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Tag.tsx +23 -0
  98. package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Timeline.tsx +33 -0
  99. package/templates/hono-fullstack/libs/ui/src/components/atoms/date-and-time/DatePicker.tsx +255 -0
  100. package/templates/hono-fullstack/libs/ui/src/components/atoms/disclosure/Accordion.tsx +48 -0
  101. package/templates/hono-fullstack/libs/ui/src/components/atoms/disclosure/Breadcrumb.tsx +50 -0
  102. package/templates/hono-fullstack/libs/ui/src/components/atoms/disclosure/Collapsible.tsx +34 -0
  103. package/templates/hono-fullstack/libs/ui/src/components/atoms/disclosure/Pagination.tsx +74 -0
  104. package/templates/hono-fullstack/libs/ui/src/components/atoms/disclosure/Steps.tsx +91 -0
  105. package/templates/hono-fullstack/libs/ui/src/components/atoms/disclosure/Tabs.tsx +37 -0
  106. package/templates/hono-fullstack/libs/ui/src/components/atoms/feedback/Alert.tsx +52 -0
  107. package/templates/hono-fullstack/libs/ui/src/components/atoms/feedback/Progress.tsx +41 -0
  108. package/templates/hono-fullstack/libs/ui/src/components/atoms/feedback/ProgressCircle.tsx +40 -0
  109. package/templates/hono-fullstack/libs/ui/src/components/atoms/feedback/Skeleton.tsx +37 -0
  110. package/templates/hono-fullstack/libs/ui/src/components/atoms/feedback/Spinner.tsx +7 -0
  111. package/templates/hono-fullstack/libs/ui/src/components/atoms/feedback/Toast.tsx +99 -0
  112. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Checkbox.tsx +95 -0
  113. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/ColorPicker.tsx +148 -0
  114. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Editable.tsx +44 -0
  115. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Field.tsx +36 -0
  116. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Fieldset.tsx +34 -0
  117. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/FileUpload.tsx +143 -0
  118. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Input.tsx +7 -0
  119. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/InputAddon.tsx +7 -0
  120. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/InputGroup.tsx +61 -0
  121. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/NativeSelect.tsx +81 -0
  122. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/NumberInput.tsx +63 -0
  123. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/PasswordInput.tsx +76 -0
  124. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/PinInput.tsx +36 -0
  125. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/RadioCard.tsx +96 -0
  126. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/RadioGroup.tsx +61 -0
  127. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/RatingGroup.tsx +106 -0
  128. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/SegmentGroup.tsx +68 -0
  129. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Slider.tsx +87 -0
  130. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Switch.tsx +74 -0
  131. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/TagsInput.tsx +77 -0
  132. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Textarea.tsx +7 -0
  133. package/templates/hono-fullstack/libs/ui/src/components/atoms/index.ts +98 -0
  134. package/templates/hono-fullstack/libs/ui/src/components/atoms/internal/AbsoluteCenter.tsx +7 -0
  135. package/templates/hono-fullstack/libs/ui/src/components/atoms/internal/Loader.tsx +69 -0
  136. package/templates/hono-fullstack/libs/ui/src/components/atoms/internal/Span.tsx +5 -0
  137. package/templates/hono-fullstack/libs/ui/src/components/atoms/internal/create-layout.ts +18 -0
  138. package/templates/hono-fullstack/libs/ui/src/components/atoms/layout/Float.tsx +7 -0
  139. package/templates/hono-fullstack/libs/ui/src/components/atoms/layout/Grid.tsx +17 -0
  140. package/templates/hono-fullstack/libs/ui/src/components/atoms/layout/Group.tsx +7 -0
  141. package/templates/hono-fullstack/libs/ui/src/components/atoms/layout/ScrollArea.tsx +46 -0
  142. package/templates/hono-fullstack/libs/ui/src/components/atoms/layout/Separator.tsx +26 -0
  143. package/templates/hono-fullstack/libs/ui/src/components/atoms/layout/Stack.tsx +54 -0
  144. package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/Dialog.tsx +69 -0
  145. package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/Drawer.tsx +49 -0
  146. package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/HoverCard.tsx +37 -0
  147. package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/Menu.tsx +74 -0
  148. package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/OverlayManager.test.ts +124 -0
  149. package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/OverlayManager.tsx +189 -0
  150. package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/Popover.tsx +57 -0
  151. package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/Tooltip.tsx +37 -0
  152. package/templates/hono-fullstack/libs/ui/src/components/atoms/typography/Heading.tsx +6 -0
  153. package/templates/hono-fullstack/libs/ui/src/components/atoms/typography/Link.tsx +7 -0
  154. package/templates/hono-fullstack/libs/ui/src/components/atoms/typography/LinkOverlay.tsx +21 -0
  155. package/templates/hono-fullstack/libs/ui/src/components/atoms/typography/Text.tsx +6 -0
  156. package/templates/hono-fullstack/libs/ui/src/components/atoms/utilities/VisuallyHidden.tsx +13 -0
  157. package/templates/hono-fullstack/libs/ui/src/hooks.ts +242 -0
  158. package/templates/hono-fullstack/libs/ui/src/index.ts +19 -0
  159. package/templates/hono-fullstack/libs/ui/src/theme/animation-styles.ts +50 -0
  160. package/templates/hono-fullstack/libs/ui/src/theme/breakpoints.ts +7 -0
  161. package/templates/hono-fullstack/libs/ui/src/theme/conditions.ts +12 -0
  162. package/templates/hono-fullstack/libs/ui/src/theme/containers.ts +16 -0
  163. package/templates/hono-fullstack/libs/ui/src/theme/global-css.ts +12 -0
  164. package/templates/hono-fullstack/libs/ui/src/theme/keyframes.ts +157 -0
  165. package/templates/hono-fullstack/libs/ui/src/theme/layer-styles.ts +11 -0
  166. package/templates/hono-fullstack/libs/ui/src/theme/patterns/grid.ts +51 -0
  167. package/templates/hono-fullstack/libs/ui/src/theme/patterns/index.ts +60 -0
  168. package/templates/hono-fullstack/libs/ui/src/theme/patterns/stack.ts +46 -0
  169. package/templates/hono-fullstack/libs/ui/src/theme/recipes/absolute-center.ts +38 -0
  170. package/templates/hono-fullstack/libs/ui/src/theme/recipes/accordion.ts +68 -0
  171. package/templates/hono-fullstack/libs/ui/src/theme/recipes/alert.ts +83 -0
  172. package/templates/hono-fullstack/libs/ui/src/theme/recipes/avatar.ts +155 -0
  173. package/templates/hono-fullstack/libs/ui/src/theme/recipes/badge.ts +67 -0
  174. package/templates/hono-fullstack/libs/ui/src/theme/recipes/breadcrumb.ts +69 -0
  175. package/templates/hono-fullstack/libs/ui/src/theme/recipes/button.ts +149 -0
  176. package/templates/hono-fullstack/libs/ui/src/theme/recipes/card.ts +36 -0
  177. package/templates/hono-fullstack/libs/ui/src/theme/recipes/checkbox.ts +120 -0
  178. package/templates/hono-fullstack/libs/ui/src/theme/recipes/clipboard.ts +22 -0
  179. package/templates/hono-fullstack/libs/ui/src/theme/recipes/collapsible.ts +26 -0
  180. package/templates/hono-fullstack/libs/ui/src/theme/recipes/color-picker.ts +299 -0
  181. package/templates/hono-fullstack/libs/ui/src/theme/recipes/combobox.ts +141 -0
  182. package/templates/hono-fullstack/libs/ui/src/theme/recipes/date-picker.ts +302 -0
  183. package/templates/hono-fullstack/libs/ui/src/theme/recipes/dialog.ts +191 -0
  184. package/templates/hono-fullstack/libs/ui/src/theme/recipes/drawer.ts +170 -0
  185. package/templates/hono-fullstack/libs/ui/src/theme/recipes/editable.ts +64 -0
  186. package/templates/hono-fullstack/libs/ui/src/theme/recipes/field.ts +41 -0
  187. package/templates/hono-fullstack/libs/ui/src/theme/recipes/fieldset.ts +47 -0
  188. package/templates/hono-fullstack/libs/ui/src/theme/recipes/file-upload.ts +86 -0
  189. package/templates/hono-fullstack/libs/ui/src/theme/recipes/group.ts +78 -0
  190. package/templates/hono-fullstack/libs/ui/src/theme/recipes/heading.ts +24 -0
  191. package/templates/hono-fullstack/libs/ui/src/theme/recipes/hover-card.ts +47 -0
  192. package/templates/hono-fullstack/libs/ui/src/theme/recipes/icon.ts +25 -0
  193. package/templates/hono-fullstack/libs/ui/src/theme/recipes/index.ts +120 -0
  194. package/templates/hono-fullstack/libs/ui/src/theme/recipes/input-addon.ts +51 -0
  195. package/templates/hono-fullstack/libs/ui/src/theme/recipes/input-group.ts +77 -0
  196. package/templates/hono-fullstack/libs/ui/src/theme/recipes/input.ts +99 -0
  197. package/templates/hono-fullstack/libs/ui/src/theme/recipes/link.ts +36 -0
  198. package/templates/hono-fullstack/libs/ui/src/theme/recipes/menu.ts +114 -0
  199. package/templates/hono-fullstack/libs/ui/src/theme/recipes/native-select.ts +92 -0
  200. package/templates/hono-fullstack/libs/ui/src/theme/recipes/number-input.ts +91 -0
  201. package/templates/hono-fullstack/libs/ui/src/theme/recipes/pagination.ts +9 -0
  202. package/templates/hono-fullstack/libs/ui/src/theme/recipes/pin-input.ts +33 -0
  203. package/templates/hono-fullstack/libs/ui/src/theme/recipes/popover.ts +78 -0
  204. package/templates/hono-fullstack/libs/ui/src/theme/recipes/progress-circle.ts +50 -0
  205. package/templates/hono-fullstack/libs/ui/src/theme/recipes/progress.ts +112 -0
  206. package/templates/hono-fullstack/libs/ui/src/theme/recipes/radio-card.ts +223 -0
  207. package/templates/hono-fullstack/libs/ui/src/theme/recipes/radio-group.ts +78 -0
  208. package/templates/hono-fullstack/libs/ui/src/theme/recipes/rating-group.ts +98 -0
  209. package/templates/hono-fullstack/libs/ui/src/theme/recipes/scroll-area.ts +119 -0
  210. package/templates/hono-fullstack/libs/ui/src/theme/recipes/segment-group.ts +162 -0
  211. package/templates/hono-fullstack/libs/ui/src/theme/recipes/select.ts +157 -0
  212. package/templates/hono-fullstack/libs/ui/src/theme/recipes/separator.ts +25 -0
  213. package/templates/hono-fullstack/libs/ui/src/theme/recipes/skeleton.ts +65 -0
  214. package/templates/hono-fullstack/libs/ui/src/theme/recipes/slider.ts +164 -0
  215. package/templates/hono-fullstack/libs/ui/src/theme/recipes/spinner.ts +34 -0
  216. package/templates/hono-fullstack/libs/ui/src/theme/recipes/steps.ts +162 -0
  217. package/templates/hono-fullstack/libs/ui/src/theme/recipes/switch.ts +150 -0
  218. package/templates/hono-fullstack/libs/ui/src/theme/recipes/table.ts +150 -0
  219. package/templates/hono-fullstack/libs/ui/src/theme/recipes/tabs.ts +128 -0
  220. package/templates/hono-fullstack/libs/ui/src/theme/recipes/tag.ts +114 -0
  221. package/templates/hono-fullstack/libs/ui/src/theme/recipes/tags-input.ts +201 -0
  222. package/templates/hono-fullstack/libs/ui/src/theme/recipes/text.ts +7 -0
  223. package/templates/hono-fullstack/libs/ui/src/theme/recipes/textarea.ts +90 -0
  224. package/templates/hono-fullstack/libs/ui/src/theme/recipes/timeline.ts +137 -0
  225. package/templates/hono-fullstack/libs/ui/src/theme/recipes/toast.ts +52 -0
  226. package/templates/hono-fullstack/libs/ui/src/theme/recipes/tooltip.ts +44 -0
  227. package/templates/hono-fullstack/libs/ui/src/theme/recipes/tree-view.ts +200 -0
  228. package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/colors/amber.ts +91 -0
  229. package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/colors/gray.ts +103 -0
  230. package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/colors/green.ts +88 -0
  231. package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/colors/index.ts +14 -0
  232. package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/colors/lime.ts +91 -0
  233. package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/colors/red.ts +88 -0
  234. package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/index.ts +8 -0
  235. package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/shadows.ts +46 -0
  236. package/templates/hono-fullstack/libs/ui/src/theme/text-styles.ts +82 -0
  237. package/templates/hono-fullstack/libs/ui/src/theme/tokens/animations.ts +8 -0
  238. package/templates/hono-fullstack/libs/ui/src/theme/tokens/aspect-ratio.ts +6 -0
  239. package/templates/hono-fullstack/libs/ui/src/theme/tokens/borders.ts +5 -0
  240. package/templates/hono-fullstack/libs/ui/src/theme/tokens/colors.ts +35 -0
  241. package/templates/hono-fullstack/libs/ui/src/theme/tokens/durations.ts +11 -0
  242. package/templates/hono-fullstack/libs/ui/src/theme/tokens/easings.ts +9 -0
  243. package/templates/hono-fullstack/libs/ui/src/theme/tokens/index.ts +42 -0
  244. package/templates/hono-fullstack/libs/ui/src/theme/tokens/radii.ts +13 -0
  245. package/templates/hono-fullstack/libs/ui/src/theme/tokens/sizes.ts +27 -0
  246. package/templates/hono-fullstack/libs/ui/src/theme/tokens/spacing.ts +41 -0
  247. package/templates/hono-fullstack/libs/ui/src/theme/tokens/typography.ts +86 -0
  248. package/templates/hono-fullstack/libs/ui/src/theme/tokens/z-index.ts +43 -0
  249. package/templates/hono-fullstack/libs/ui/stories/README.md +107 -0
  250. package/templates/hono-fullstack/libs/ui/stories/actions/Button.stories.tsx +260 -0
  251. package/templates/hono-fullstack/libs/ui/stories/actions/Clipboard.stories.tsx +87 -0
  252. package/templates/hono-fullstack/libs/ui/stories/actions/IconButton.stories.tsx +33 -0
  253. package/templates/hono-fullstack/libs/ui/stories/collections/Combobox.stories.tsx +334 -0
  254. package/templates/hono-fullstack/libs/ui/stories/collections/Select.stories.tsx +342 -0
  255. package/templates/hono-fullstack/libs/ui/stories/collections/TreeView.stories.tsx +252 -0
  256. package/templates/hono-fullstack/libs/ui/stories/color/ColorPicker.stories.tsx +217 -0
  257. package/templates/hono-fullstack/libs/ui/stories/date/DatePicker.stories.tsx +302 -0
  258. package/templates/hono-fullstack/libs/ui/stories/disclosure/Accordion.stories.tsx +105 -0
  259. package/templates/hono-fullstack/libs/ui/stories/disclosure/Collapsible.stories.tsx +55 -0
  260. package/templates/hono-fullstack/libs/ui/stories/disclosure/Steps.stories.tsx +208 -0
  261. package/templates/hono-fullstack/libs/ui/stories/disclosure/Tabs.stories.tsx +176 -0
  262. package/templates/hono-fullstack/libs/ui/stories/display/Avatar.stories.tsx +108 -0
  263. package/templates/hono-fullstack/libs/ui/stories/display/Badge.stories.tsx +90 -0
  264. package/templates/hono-fullstack/libs/ui/stories/display/Card.stories.tsx +121 -0
  265. package/templates/hono-fullstack/libs/ui/stories/display/Heading.stories.tsx +62 -0
  266. package/templates/hono-fullstack/libs/ui/stories/display/Icon.stories.tsx +51 -0
  267. package/templates/hono-fullstack/libs/ui/stories/display/Table.stories.tsx +222 -0
  268. package/templates/hono-fullstack/libs/ui/stories/display/Tag.stories.tsx +168 -0
  269. package/templates/hono-fullstack/libs/ui/stories/display/Text.stories.tsx +32 -0
  270. package/templates/hono-fullstack/libs/ui/stories/display/Timeline.stories.tsx +241 -0
  271. package/templates/hono-fullstack/libs/ui/stories/feedback/Alert.stories.tsx +122 -0
  272. package/templates/hono-fullstack/libs/ui/stories/feedback/Progress.stories.tsx +163 -0
  273. package/templates/hono-fullstack/libs/ui/stories/feedback/ProgressCircle.stories.tsx +176 -0
  274. package/templates/hono-fullstack/libs/ui/stories/feedback/Skeleton.stories.tsx +75 -0
  275. package/templates/hono-fullstack/libs/ui/stories/feedback/Spinner.stories.tsx +49 -0
  276. package/templates/hono-fullstack/libs/ui/stories/feedback/Toast.stories.tsx +145 -0
  277. package/templates/hono-fullstack/libs/ui/stories/forms/Checkbox.stories.tsx +281 -0
  278. package/templates/hono-fullstack/libs/ui/stories/forms/Editable.stories.tsx +94 -0
  279. package/templates/hono-fullstack/libs/ui/stories/forms/Field.stories.tsx +72 -0
  280. package/templates/hono-fullstack/libs/ui/stories/forms/Fieldset.stories.tsx +109 -0
  281. package/templates/hono-fullstack/libs/ui/stories/forms/FileUpload.stories.tsx +115 -0
  282. package/templates/hono-fullstack/libs/ui/stories/forms/Form.stories.tsx +120 -0
  283. package/templates/hono-fullstack/libs/ui/stories/forms/Input.stories.tsx +155 -0
  284. package/templates/hono-fullstack/libs/ui/stories/forms/InputGroup.stories.tsx +79 -0
  285. package/templates/hono-fullstack/libs/ui/stories/forms/NativeSelect.stories.tsx +160 -0
  286. package/templates/hono-fullstack/libs/ui/stories/forms/NumberInput.stories.tsx +149 -0
  287. package/templates/hono-fullstack/libs/ui/stories/forms/PasswordInput.stories.tsx +141 -0
  288. package/templates/hono-fullstack/libs/ui/stories/forms/PinInput.stories.tsx +155 -0
  289. package/templates/hono-fullstack/libs/ui/stories/forms/RadioCard.stories.tsx +265 -0
  290. package/templates/hono-fullstack/libs/ui/stories/forms/RadioGroup.stories.tsx +109 -0
  291. package/templates/hono-fullstack/libs/ui/stories/forms/RatingGroup.stories.tsx +123 -0
  292. package/templates/hono-fullstack/libs/ui/stories/forms/SegmentGroup.stories.tsx +130 -0
  293. package/templates/hono-fullstack/libs/ui/stories/forms/Slider.stories.tsx +190 -0
  294. package/templates/hono-fullstack/libs/ui/stories/forms/Switch.stories.tsx +124 -0
  295. package/templates/hono-fullstack/libs/ui/stories/forms/TagsInput.stories.tsx +154 -0
  296. package/templates/hono-fullstack/libs/ui/stories/forms/Textarea.stories.tsx +148 -0
  297. package/templates/hono-fullstack/libs/ui/stories/layout/Grid.stories.tsx +60 -0
  298. package/templates/hono-fullstack/libs/ui/stories/layout/Positioning.stories.tsx +90 -0
  299. package/templates/hono-fullstack/libs/ui/stories/layout/ScrollArea.stories.tsx +68 -0
  300. package/templates/hono-fullstack/libs/ui/stories/layout/Stack.stories.tsx +87 -0
  301. package/templates/hono-fullstack/libs/ui/stories/navigation/Breadcrumb.stories.tsx +104 -0
  302. package/templates/hono-fullstack/libs/ui/stories/navigation/Link.stories.tsx +62 -0
  303. package/templates/hono-fullstack/libs/ui/stories/navigation/LinkBox.stories.tsx +45 -0
  304. package/templates/hono-fullstack/libs/ui/stories/navigation/Pagination.stories.tsx +74 -0
  305. package/templates/hono-fullstack/libs/ui/stories/overlays/Dialog.stories.tsx +255 -0
  306. package/templates/hono-fullstack/libs/ui/stories/overlays/Drawer.stories.tsx +114 -0
  307. package/templates/hono-fullstack/libs/ui/stories/overlays/HoverCard.stories.tsx +47 -0
  308. package/templates/hono-fullstack/libs/ui/stories/overlays/Menu.stories.tsx +133 -0
  309. package/templates/hono-fullstack/libs/ui/stories/overlays/OverlayManager.stories.tsx +206 -0
  310. package/templates/hono-fullstack/libs/ui/stories/overlays/Popover.stories.tsx +73 -0
  311. package/templates/hono-fullstack/libs/ui/stories/overlays/Tooltip.stories.tsx +114 -0
  312. package/templates/hono-fullstack/libs/ui/stories/tsconfig.json +14 -0
  313. package/templates/hono-fullstack/libs/ui/tsconfig.build.json +5 -0
  314. package/templates/hono-fullstack/libs/ui/tsconfig.json +13 -0
  315. package/templates/hono-fullstack/libs/ui/turbo.json +28 -0
  316. package/templates/hono-fullstack/libs/ui/vite.config.ts +33 -0
  317. package/templates/hono-fullstack/oyo.config.json +30 -4
  318. package/templates/hono-fullstack/package.json +1 -0
  319. package/templates/hono-fullstack/pnpm-workspace.yaml +20 -10
  320. package/templates/hono-fullstack/turbo.json +10 -0
  321. package/templates/hono-server/.codegraph/.gitignore +5 -0
  322. package/templates/hono-server/README.md +9 -1
  323. package/templates/hono-server/_gitignore +1 -0
  324. package/templates/hono-server/apps/server/package.json +7 -2
  325. package/templates/hono-server/apps/server/src/adapters/cloudflare/entry.ts +4 -30
  326. package/templates/hono-server/apps/server/src/adapters/nodejs/bootstrap.ts +20 -12
  327. package/templates/hono-server/apps/server/src/adapters/nodejs/entry.ts +7 -57
  328. package/templates/hono-server/apps/server/src/app.ts +37 -21
  329. package/templates/hono-server/apps/server/src/config.ts +1 -1
  330. package/templates/hono-server/apps/server/src/di-container.ts +51 -0
  331. package/templates/hono-server/apps/server/src/infra/logger/getter.ts +1 -1
  332. package/templates/hono-server/apps/server/src/infra/logger/pino.ts +21 -34
  333. package/templates/hono-server/apps/server/src/infra/work-runner/errors.ts +22 -0
  334. package/templates/hono-server/apps/server/src/infra/work-runner/pass-through/runner.ts +28 -22
  335. package/templates/hono-server/apps/server/src/infra/work-runner/piscina/runner.ts +11 -34
  336. package/templates/hono-server/apps/server/src/infra/work-runner/{example → piscina}/worker-entry.ts +6 -2
  337. package/templates/hono-server/apps/server/src/infra/work-runner/types.ts +2 -16
  338. package/templates/hono-server/apps/server/src/infra/work-runner/utils/business-error.ts +10 -5
  339. package/templates/hono-server/apps/server/src/infra/work-runner/utils/message.ts +5 -17
  340. package/templates/hono-server/apps/server/src/middlewares/cors.ts +16 -22
  341. package/templates/hono-server/apps/server/src/middlewares/logger.ts +34 -0
  342. package/templates/hono-server/apps/server/src/modules/example/module.ts +8 -0
  343. package/templates/hono-server/apps/server/src/modules/example/queries.ts +8 -0
  344. package/templates/hono-server/apps/server/src/modules/example/routes.ts +74 -68
  345. package/templates/hono-server/apps/server/src/modules/example/service.test.ts +53 -0
  346. package/templates/hono-server/apps/server/src/modules/example/service.ts +54 -0
  347. package/templates/hono-server/apps/server/src/modules/example/types.ts +12 -0
  348. package/templates/hono-server/apps/server/src/modules/example/work-task/tasks.test.ts +9 -35
  349. package/templates/hono-server/apps/server/src/modules/example/work-task/tasks.ts +15 -46
  350. package/templates/hono-server/apps/server/src/shared/errors/defs/index.ts +6 -1
  351. package/templates/hono-server/apps/server/src/shared/errors/handler.ts +1 -1
  352. package/templates/hono-server/apps/server/src/shared/network/openapi/index.ts +1 -1
  353. package/templates/hono-server/apps/server/src/shared/types/app.ts +51 -0
  354. package/templates/hono-server/apps/server/src/shared/types/db.ts +126 -0
  355. package/templates/hono-server/apps/server/src/shared/utils/data-access/check.ts +19 -0
  356. package/templates/hono-server/apps/server/src/shared/utils/data-access/model.ts +47 -0
  357. package/templates/hono-server/apps/server/src/shared/utils/data-access/params.ts +105 -0
  358. package/templates/hono-server/apps/server/src/shared/utils/data-access/query.test.ts +139 -0
  359. package/templates/hono-server/apps/server/src/shared/utils/data-access/query.ts +236 -0
  360. package/templates/hono-server/apps/server/vite.config.ts +2 -2
  361. package/templates/hono-server/apps/server/wrangler.jsonc +1 -1
  362. package/templates/hono-server/docker/README.md +1 -1
  363. package/templates/hono-server/envs/.env.example.sqlite-d1 +1 -0
  364. package/templates/hono-server/libs/db/drizzle-kit/sqlite-d1.config.ts +29 -10
  365. package/templates/hono-server/libs/db/package.json +1 -0
  366. package/templates/hono-server/libs/db/src/dialects/sqlite/schema/columns.ts +1 -1
  367. package/templates/hono-server/libs/db/src/dialects/sqlite/schema/modules/examples/examples.ts +6 -3
  368. package/templates/hono-server/libs/db/src/dialects/sqlite/schema/vo.ts +7 -1
  369. package/templates/hono-server/libs/definition/README.md +81 -0
  370. package/templates/hono-server/libs/definition/package.json +3 -1
  371. package/templates/hono-server/libs/definition/src/constants/index.ts +1 -0
  372. package/templates/hono-server/libs/definition/src/constants/pagination.ts +3 -0
  373. package/templates/hono-server/libs/definition/src/modules/common-contracts.ts +24 -0
  374. package/templates/hono-server/libs/definition/src/modules/example/contracts.ts +34 -0
  375. package/templates/hono-server/libs/definition/src/modules/example/index.ts +1 -16
  376. package/templates/hono-server/libs/definition/src/modules/index.ts +2 -0
  377. package/templates/hono-server/libs/definition/src/modules/vo-generated-types.ts +12 -0
  378. package/templates/hono-server/oyo.config.json +30 -4
  379. package/templates/hono-server/package.json +1 -0
  380. package/templates/hono-server/pnpm-workspace.yaml +9 -7
  381. package/templates/hono-server/turbo.json +10 -0
  382. package/templates/monorepo/.codegraph/.gitignore +5 -0
  383. package/templates/monorepo/_gitignore +1 -0
  384. package/templates/monorepo/oyo.config.json +6 -4
  385. package/templates/monorepo/pnpm-workspace.yaml +4 -4
  386. package/templates/monorepo/turbo.json +10 -0
  387. package/templates/hono-fullstack/apps/server/src/modules/example/contracts.ts +0 -9
  388. package/templates/hono-fullstack/apps/server/src/shared/app/types.ts +0 -44
  389. package/templates/hono-fullstack/apps/stack/frontend/styles.css +0 -23
  390. package/templates/hono-server/apps/server/src/modules/example/contracts.ts +0 -9
  391. package/templates/hono-server/apps/server/src/shared/app/types.ts +0 -44
@@ -0,0 +1,46 @@
1
+ import { defineSemanticTokens } from '@pandacss/dev'
2
+
3
+ export const shadows = defineSemanticTokens.shadows({
4
+ xs: {
5
+ value: {
6
+ _light: '0px 1px 2px {colors.gray.a6}, 0px 0px 1px {colors.gray.a7}',
7
+ _dark: '0px 1px 1px {colors.black.a8}, 0px 0px 1px inset {colors.gray.a8}',
8
+ },
9
+ },
10
+ sm: {
11
+ value: {
12
+ _light: '0px 2px 4px {colors.gray.a4}, 0px 0px 1px {colors.gray.a4}',
13
+ _dark: '0px 2px 4px {colors.black.a8}, 0px 0px 1px inset {colors.gray.a8}',
14
+ },
15
+ },
16
+ md: {
17
+ value: {
18
+ _light: '0px 4px 8px {colors.gray.a4}, 0px 0px 1px {colors.gray.a4}',
19
+ _dark: '0px 4px 8px {colors.black.a8}, 0px 0px 1px inset {colors.gray.a8}',
20
+ },
21
+ },
22
+ lg: {
23
+ value: {
24
+ _light: '0px 8px 16px {colors.gray.a4}, 0px 0px 1px {colors.gray.a4}',
25
+ _dark: '0px 8px 16px {colors.black.a8}, 0px 0px 1px inset {colors.gray.a8}',
26
+ },
27
+ },
28
+ xl: {
29
+ value: {
30
+ _light: '0px 16px 24px {colors.gray.a4}, 0px 0px 1px {colors.gray.a4}',
31
+ _dark: '0px 16px 24px {colors.black.a8}, 0px 0px 1px inset {colors.gray.a8}',
32
+ },
33
+ },
34
+ '2xl': {
35
+ value: {
36
+ _light: '0px 24px 40px {colors.gray.a4}, 0px 0px 1px {colors.gray.a4}',
37
+ _dark: '0px 24px 40px {colors.black.a8}, 0px 0px 1px inset {colors.gray.a8}',
38
+ },
39
+ },
40
+ inset: {
41
+ value: {
42
+ _light: 'inset 8px 0 12px -8px {colors.gray.a4}',
43
+ _dark: 'inset 8px 0 12px -8px {colors.black.a6}',
44
+ },
45
+ },
46
+ })
@@ -0,0 +1,82 @@
1
+ import { defineTextStyles } from '@pandacss/dev'
2
+
3
+ export const textStyles = defineTextStyles({
4
+ xs: {
5
+ value: {
6
+ fontSize: '{fontSizes.xs}',
7
+ lineHeight: '{lineHeights.xs}',
8
+ },
9
+ },
10
+ sm: {
11
+ value: {
12
+ fontSize: '{fontSizes.sm}',
13
+ lineHeight: '{lineHeights.sm}',
14
+ },
15
+ },
16
+ md: {
17
+ value: {
18
+ fontSize: '{fontSizes.md}',
19
+ lineHeight: '{lineHeights.md}',
20
+ },
21
+ },
22
+ lg: {
23
+ value: {
24
+ fontSize: '{fontSizes.lg}',
25
+ lineHeight: '{lineHeights.lg}',
26
+ },
27
+ },
28
+ xl: {
29
+ value: {
30
+ fontSize: '{fontSizes.xl}',
31
+ lineHeight: '{lineHeights.xl}',
32
+ },
33
+ },
34
+ '2xl': {
35
+ value: {
36
+ fontSize: '{fontSizes.2xl}',
37
+ lineHeight: '{lineHeights.2xl}',
38
+ },
39
+ },
40
+ '3xl': {
41
+ value: {
42
+ fontSize: '{fontSizes.3xl}',
43
+ lineHeight: '{lineHeights.3xl}',
44
+ },
45
+ },
46
+ '4xl': {
47
+ value: {
48
+ fontSize: '{fontSizes.4xl}',
49
+ lineHeight: '{lineHeights.4xl}',
50
+ },
51
+ },
52
+ '5xl': {
53
+ value: {
54
+ fontSize: '{fontSizes.5xl}',
55
+ lineHeight: '{lineHeights.5xl}',
56
+ },
57
+ },
58
+ '6xl': {
59
+ value: {
60
+ fontSize: '{fontSizes.6xl}',
61
+ lineHeight: '{lineHeights.6xl}',
62
+ },
63
+ },
64
+ '7xl': {
65
+ value: {
66
+ fontSize: '{fontSizes.7xl}',
67
+ lineHeight: '{lineHeights.7xl}',
68
+ },
69
+ },
70
+ '8xl': {
71
+ value: {
72
+ fontSize: '{fontSizes.8xl}',
73
+ lineHeight: '{lineHeights.8xl}',
74
+ },
75
+ },
76
+ '9xl': {
77
+ value: {
78
+ fontSize: '{fontSizes.9xl}',
79
+ lineHeight: '{lineHeights.9xl}',
80
+ },
81
+ },
82
+ })
@@ -0,0 +1,8 @@
1
+ import { defineTokens } from '@pandacss/dev'
2
+
3
+ export const animations = defineTokens.animations({
4
+ spin: { value: 'spin 1s linear infinite' },
5
+ ping: { value: 'ping 1s {easings.out} infinite' },
6
+ pulse: { value: 'pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite' },
7
+ bounce: { value: 'bounce 1s infinite' },
8
+ })
@@ -0,0 +1,6 @@
1
+ import { defineTokens } from '@pandacss/dev'
2
+
3
+ export const aspectRatios = defineTokens.aspectRatios({
4
+ square: { value: '1 / 1' },
5
+ auto: { value: 'auto' },
6
+ })
@@ -0,0 +1,5 @@
1
+ import { defineTokens } from '@pandacss/dev'
2
+
3
+ export const borders = defineTokens.borders({
4
+ none: { value: 'none' },
5
+ })
@@ -0,0 +1,35 @@
1
+ import { defineTokens } from '@pandacss/dev'
2
+
3
+ const black = defineTokens.colors({
4
+ DEFAULT: { value: '#000000' },
5
+ a1: { value: 'rgba(0, 0, 0, 0.05)' },
6
+ a2: { value: 'rgba(0, 0, 0, 0.1)' },
7
+ a3: { value: 'rgba(0, 0, 0, 0.15)' },
8
+ a4: { value: 'rgba(0, 0, 0, 0.2)' },
9
+ a5: { value: 'rgba(0, 0, 0, 0.3)' },
10
+ a6: { value: 'rgba(0, 0, 0, 0.4)' },
11
+ a7: { value: 'rgba(0, 0, 0, 0.5)' },
12
+ a8: { value: 'rgba(0, 0, 0, 0.6)' },
13
+ a9: { value: 'rgba(0, 0, 0, 0.7)' },
14
+ a10: { value: 'rgba(0, 0, 0, 0.8)' },
15
+ a11: { value: 'rgba(0, 0, 0, 0.9)' },
16
+ a12: { value: 'rgba(0, 0, 0, 0.95)' },
17
+ })
18
+
19
+ const white = defineTokens.colors({
20
+ DEFAULT: { value: '#ffffff' },
21
+ a1: { value: 'rgba(255, 255, 255, 0.05)' },
22
+ a2: { value: 'rgba(255, 255, 255, 0.1)' },
23
+ a3: { value: 'rgba(255, 255, 255, 0.15)' },
24
+ a4: { value: 'rgba(255, 255, 255, 0.2)' },
25
+ a5: { value: 'rgba(255, 255, 255, 0.3)' },
26
+ a6: { value: 'rgba(255, 255, 255, 0.4)' },
27
+ a7: { value: 'rgba(255, 255, 255, 0.5)' },
28
+ a8: { value: 'rgba(255, 255, 255, 0.6)' },
29
+ a9: { value: 'rgba(255, 255, 255, 0.7)' },
30
+ a10: { value: 'rgba(255, 255, 255, 0.8)' },
31
+ a11: { value: 'rgba(255, 255, 255, 0.9)' },
32
+ a12: { value: 'rgba(255, 255, 255, 0.95)' },
33
+ })
34
+
35
+ export const colors = { black, white }
@@ -0,0 +1,11 @@
1
+ import { defineTokens } from '@pandacss/dev'
2
+
3
+ export const durations = defineTokens.durations({
4
+ fastest: { value: '50ms' },
5
+ faster: { value: '100ms' },
6
+ fast: { value: '150ms' },
7
+ normal: { value: '200ms' },
8
+ slow: { value: '250ms' },
9
+ slower: { value: '300ms' },
10
+ slowest: { value: '400ms' },
11
+ })
@@ -0,0 +1,9 @@
1
+ import { defineTokens } from '@pandacss/dev'
2
+
3
+ export const easings = defineTokens.easings({
4
+ default: { value: 'cubic-bezier(0.4, 0, 0.2, 1)' },
5
+ linear: { value: 'linear' },
6
+ in: { value: 'cubic-bezier(0.4, 0, 1, 1)' },
7
+ out: { value: 'cubic-bezier(0, 0, 0.2, 1)' },
8
+ 'in-out': { value: '{easings.default}' },
9
+ })
@@ -0,0 +1,42 @@
1
+ import { defineTokens } from '@pandacss/dev'
2
+ import { fonts, fontSizes, fontWeights, letterSpacings, lineHeights } from './typography'
3
+ import { durations } from './durations'
4
+ import { zIndex } from './z-index'
5
+ import { borders } from './borders'
6
+ import { easings } from './easings'
7
+ import { radii } from './radii'
8
+ import { aspectRatios } from './aspect-ratio'
9
+ import { sizes } from './sizes'
10
+ import { spacing } from './spacing'
11
+ import { colors } from './colors'
12
+ import { animations } from './animations'
13
+
14
+ export const tokens = defineTokens({
15
+ /* 样式相关 */
16
+ aspectRatios,
17
+ animations,
18
+ durations,
19
+ easings,
20
+ colors,
21
+ zIndex,
22
+ borders,
23
+ radii,
24
+ blurs: {
25
+ xs: { value: '4px' },
26
+ sm: { value: '8px' },
27
+ md: { value: '12px' },
28
+ lg: { value: '16px' },
29
+ xl: { value: '24px' },
30
+ '2xl': { value: '40px' },
31
+ '3xl': { value: '64px' },
32
+ },
33
+ /* 尺寸 */
34
+ sizes,
35
+ spacing,
36
+ /* 排版相关 */
37
+ fonts,
38
+ fontSizes,
39
+ fontWeights,
40
+ lineHeights,
41
+ letterSpacings,
42
+ })
@@ -0,0 +1,13 @@
1
+ import { defineTokens } from '@pandacss/dev'
2
+
3
+ export const radii = defineTokens.radii({
4
+ xs: { value: '0.125rem' },
5
+ sm: { value: '0.25rem' },
6
+ md: { value: '0.375rem' },
7
+ lg: { value: '0.5rem' },
8
+ xl: { value: '0.75rem' },
9
+ '2xl': { value: '1rem' },
10
+ '3xl': { value: '1.5rem' },
11
+ '4xl': { value: '2rem' },
12
+ full: { value: '9999px' },
13
+ })
@@ -0,0 +1,27 @@
1
+ import { defineTokens } from '@pandacss/dev'
2
+ import { spacing } from './spacing'
3
+
4
+ const largeSizes = defineTokens.sizes({
5
+ xs: { value: '20rem' },
6
+ sm: { value: '24rem' },
7
+ md: { value: '28rem' },
8
+ lg: { value: '32rem' },
9
+ xl: { value: '36rem' },
10
+ '2xl': { value: '42rem' },
11
+ '3xl': { value: '48rem' },
12
+ '4xl': { value: '56rem' },
13
+ '5xl': { value: '64rem' },
14
+ '6xl': { value: '72rem' },
15
+ '7xl': { value: '80rem' },
16
+ '8xl': { value: '90rem' },
17
+ prose: { value: '60ch' },
18
+ })
19
+
20
+ export const sizes = defineTokens.sizes({
21
+ ...Object.fromEntries(Object.keys(spacing).map((key) => [key, { value: `{spacing.${key}}` }])),
22
+ ...largeSizes,
23
+ full: { value: '100%' },
24
+ min: { value: 'min-content' },
25
+ max: { value: 'max-content' },
26
+ fit: { value: 'fit-content' },
27
+ })
@@ -0,0 +1,41 @@
1
+ import { defineTokens } from '@pandacss/dev'
2
+
3
+ export const spacing = defineTokens.spacing({
4
+ 0: { value: '0rem' },
5
+ 0.5: { value: '0.125rem' },
6
+ 1: { value: '0.25rem' },
7
+ 1.5: { value: '0.375rem' },
8
+ 2: { value: '0.5rem' },
9
+ 2.5: { value: '0.625rem' },
10
+ 3: { value: '0.75rem' },
11
+ 3.5: { value: '0.875rem' },
12
+ 4: { value: '1rem' },
13
+ 4.5: { value: '1.125rem' },
14
+ 5: { value: '1.25rem' },
15
+ 5.5: { value: '1.375rem' },
16
+ 6: { value: '1.5rem' },
17
+ 7: { value: '1.75rem' },
18
+ 8: { value: '2rem' },
19
+ 9: { value: '2.25rem' },
20
+ 10: { value: '2.5rem' },
21
+ 11: { value: '2.75rem' },
22
+ 12: { value: '3rem' },
23
+ 14: { value: '3.5rem' },
24
+ 16: { value: '4rem' },
25
+ 20: { value: '5rem' },
26
+ 24: { value: '6rem' },
27
+ 28: { value: '7rem' },
28
+ 32: { value: '8rem' },
29
+ 36: { value: '9rem' },
30
+ 40: { value: '10rem' },
31
+ 44: { value: '11rem' },
32
+ 48: { value: '12rem' },
33
+ 52: { value: '13rem' },
34
+ 56: { value: '14rem' },
35
+ 60: { value: '15rem' },
36
+ 64: { value: '16rem' },
37
+ 72: { value: '18rem' },
38
+ 80: { value: '20rem' },
39
+ 96: { value: '24rem' },
40
+ px: { value: '1px' },
41
+ })
@@ -0,0 +1,86 @@
1
+ /* 来自 @pandacss/preset-panda */
2
+ import { defineTokens } from '@pandacss/dev'
3
+
4
+ export const fontSizes = defineTokens.fontSizes({
5
+ '2xs': { value: '0.5rem' },
6
+ xs: { value: '0.75rem' },
7
+ sm: { value: '0.875rem' },
8
+ md: { value: '1rem' },
9
+ lg: { value: '1.125rem' },
10
+ xl: { value: '1.25rem' },
11
+ '2xl': { value: '1.5rem' },
12
+ '3xl': { value: '1.875rem' },
13
+ '4xl': { value: '2.25rem' },
14
+ '5xl': { value: '3rem' },
15
+ '6xl': { value: '3.75rem' },
16
+ '7xl': { value: '4.5rem' },
17
+ '8xl': { value: '6rem' },
18
+ '9xl': { value: '8rem' },
19
+ })
20
+
21
+ export const fontWeights = defineTokens.fontWeights({
22
+ thin: { value: '100' },
23
+ extralight: { value: '200' },
24
+ light: { value: '300' },
25
+ normal: { value: '400' },
26
+ medium: { value: '500' },
27
+ semibold: { value: '600' },
28
+ bold: { value: '700' },
29
+ extrabold: { value: '800' },
30
+ black: { value: '900' },
31
+ })
32
+
33
+ export const letterSpacings = defineTokens.letterSpacings({
34
+ tighter: { value: '-0.05em' },
35
+ tight: { value: '-0.025em' },
36
+ normal: { value: '0em' },
37
+ wide: { value: '0.025em' },
38
+ wider: { value: '0.05em' },
39
+ widest: { value: '0.1em' },
40
+ })
41
+
42
+ export const lineHeights = defineTokens.lineHeights({
43
+ none: { value: '1' },
44
+ xs: { value: 'calc(1 / 0.75)' },
45
+ sm: { value: 'calc(1.25 / 0.875)' },
46
+ md: { value: 'calc(1.5 / 1)' },
47
+ lg: { value: 'calc(1.75 / 1.125)' },
48
+ xl: { value: 'calc(1.75 / 1.25)' },
49
+ '2xl': { value: 'calc(2 / 1.5)' },
50
+ '3xl': { value: 'calc(2.25 / 1.875)' },
51
+ '4xl': { value: 'calc(2.5 / 2.25)' },
52
+ '5xl': { value: '{lineHeights.none}' },
53
+ '6xl': { value: '{lineHeights.none}' },
54
+ '7xl': { value: '{lineHeights.none}' },
55
+ '8xl': { value: '{lineHeights.none}' },
56
+ '9xl': { value: '{lineHeights.none}' },
57
+ })
58
+
59
+ export const fonts = defineTokens.fonts({
60
+ sans: {
61
+ value: [
62
+ 'ui-sans-serif',
63
+ 'system-ui',
64
+ 'sans-serif',
65
+ '"Apple Color Emoji"',
66
+ '"Segoe UI Emoji"',
67
+ '"Segoe UI Symbol"',
68
+ '"Noto Color Emoji"',
69
+ ],
70
+ },
71
+ serif: {
72
+ value: ['ui-serif', 'Georgia', 'Cambria', '"Times New Roman"', 'Times', 'serif'],
73
+ },
74
+ mono: {
75
+ value: [
76
+ 'ui-monospace',
77
+ 'SFMono-Regular',
78
+ 'Menlo',
79
+ 'Monaco',
80
+ 'Consolas',
81
+ '"Liberation Mono"',
82
+ '"Courier New"',
83
+ 'monospace',
84
+ ],
85
+ },
86
+ })
@@ -0,0 +1,43 @@
1
+ import { defineTokens } from '@pandacss/dev'
2
+
3
+ export const zIndex = defineTokens.zIndex({
4
+ hide: {
5
+ value: -1,
6
+ },
7
+ base: {
8
+ value: 0,
9
+ },
10
+ docked: {
11
+ value: 10,
12
+ },
13
+ dropdown: {
14
+ value: 1000,
15
+ },
16
+ sticky: {
17
+ value: 1100,
18
+ },
19
+ banner: {
20
+ value: 1200,
21
+ },
22
+ overlay: {
23
+ value: 1300,
24
+ },
25
+ modal: {
26
+ value: 1400,
27
+ },
28
+ popover: {
29
+ value: 1500,
30
+ },
31
+ skipLink: {
32
+ value: 1600,
33
+ },
34
+ toast: {
35
+ value: 1700,
36
+ },
37
+ tooltip: {
38
+ value: 1800,
39
+ },
40
+ max: {
41
+ value: 99999999,
42
+ },
43
+ })
@@ -0,0 +1,107 @@
1
+ # UI 组件预览
2
+
3
+ 从仓库根目录运行:
4
+
5
+ ```bash
6
+ vp run @repo/ui#storybook
7
+ vp run @repo/ui#storybook:check
8
+ vp run @repo/ui#storybook:build
9
+ ```
10
+
11
+ 开发页面默认使用端口 6006;静态构建输出到 `libs/ui/storybook-static/`。
12
+
13
+ Storybook 直接调试 UI 源码,不需要先构建 UI 包。预览使用独立 Vite 配置;
14
+ Panda 配置复用 UI 的主题和配方,向 `.storybook/styled-system/` 生成专用运行时。
15
+ Docs 容器按需加载,独立 Story 不提前加载文档界面;开发服务仅预热 UI 公共源码入口,
16
+ 减少首次转换的瀑布等待。预热不减少请求数量。UI 与 Panda 生成代码保留源码模块和热更新,
17
+ 不强制预构建为大包;第三方依赖由 Storybook 的 Vite builder 自动发现并缓存预构建结果。
18
+
19
+ Storybook 和 Stack 保持 Panda 默认的源码转换策略(`transform: false`),
20
+ 不为减少开发请求数量额外开启源码改写。是否启用转换,应依据实际加载、热更新或产物收益验证。
21
+ Stack 通过 `designSystem` 自动注册样式入口,不将 `@repo/ui` 根入口配置为 `importMap.jsx`,
22
+ 防止 Stack 等 UI 组件被当成 Panda 原生 pattern 内联而丢失 `separator`、`asChild` 等行为。
23
+ 修改 Vite 配置后需重启开发服务。
24
+
25
+ `storybook:check` 会生成这份运行时并检查 stories 与配置,不改写原有生成目录。
26
+ Controls 在运行时选择参数,因此预览专用 Panda 配置预生成所有配方变体,
27
+ 以及面板提供的 gray、lime、red、green 配色;增加配色选项时需同步这份列表。
28
+
29
+ 每个组件族维护一个 CSF 3 文件。纯视觉变体采用汇总 story,独立交互场景单独组织。
30
+ 示例从 `@repo/ui` 或其公开子入口导入组件,用 args 提供可调整参数。
31
+
32
+ 交互示例直接保留完整的插槽组合;仅在组件族内复用日历视图、树节点等重复结构,
33
+ 不抽取跨组件的通用演示组件,也不依赖 Stack 路由。
34
+ Playground 使用 Controls 调整参数;受控示例在具名 render 函数内维护 React 状态,
35
+ store 示例使用 UI 包导出的 hook 和 RootProvider。固定配置的行为示例关闭 Controls,
36
+ 避免出现调整参数却不生效的面板。Ark 的值变化等轻量参数通过 `fn()` 接入 Actions。
37
+ 原生点击、输入事件先提取类型、按钮文字或输入值,再用 `action()` 记录;不要将完整的
38
+ React 事件(包含 DOM 与 Window 引用)传入记录链路,避免 Docs 交互被同步序列化阻塞。
39
+
40
+ Variants、Loading、Sizes、Colors 使用 `tags: ['!dev']`,仅在 Docs 中展示,减少侧栏入口。
41
+ Playground 和受控、store 等行为场景保留独立入口,便于隔离调试。Docs 与独立入口复用同一份 story。
42
+ 组件主题工具栏同步预览组件及 Docs 内容区的背景、文字和参数表;侧栏等管理界面沿用 Storybook 设置。
43
+ Button 的链接示例保留真实 anchor 语义,拦截默认导航并滚动到示例内的状态文本,避免离开工作台。
44
+ 含 hook / ref 的示例展示原始 render 源码(`docs.source.type: 'code'`),
45
+ 保留可复制的状态逻辑,并避开 Storybook 动态序列化 ref 时的 React 19 兼容性提示。
46
+ Portal 使用默认容器,渲染到预览 iframe 的 document;主题也施加在同一 document 上。
47
+ 需要 DOM id 的交互用 `useId`,避免同一 Docs 页中的示例互相干扰。
48
+
49
+ ## 迁移清单
50
+
51
+ 原文件均位于 `apps/stack/frontend/routes/ui/`。迁移以功能场景为单位,
52
+ 不保留原页面的导航、主题开关及验收标题;主题统一由工具栏控制。
53
+
54
+ | 原验收内容 | Storybook | 进度 |
55
+ | --------------------------------------------------------------------- | --------------------------------------------------------------- | ------ |
56
+ | `-ButtonPreview.tsx` 配方、尺寸、配色 | `Actions/Button`:Playground、Variants、Sizes、Colors | 已迁移 |
57
+ | 同上:加载、ref 聚焦、计数、禁用、asChild 链接 | Loading、Interactions | 已迁移 |
58
+ | 同上:按维度自定义、IconButton、CloseButton、ButtonGroup | Customization、Group | 已迁移 |
59
+ | `-DialogPreview.tsx` 非受控、焦点、阻止关闭、确认、内部滚动、自定尺寸 | `Overlays/Dialog`:Playground、Controlled、CustomSize | 已迁移 |
60
+ | `-SelectPreview.tsx` 单选、多选、禁用、原生表单、自定义尺寸和外观 | `Collections/Select`:Playground、ControlledForm、Customization | 已迁移 |
61
+ | `api.tsx` 的 Dialog / Select hook、RootProvider、泛型事件 | 对应组件族的 Store | 已迁移 |
62
+ | `api.tsx` 的 Combobox API | `Collections/Combobox`:Store | 已迁移 |
63
+ | 其余 28 个 `-…Preview.tsx` | 按下表拆入对应组件族 | 已迁移 |
64
+
65
+ 第三步的实际文件归属如下;表中的组件名对应目录内的 `组件名.stories.tsx`。
66
+ 混合页面按组件族拆分;`Forms/Form` 单独保留跨字段提交、重置和外部控制场景。
67
+
68
+ | 原 Preview 文件(省略 `-` 和 `Preview.tsx`) | stories 文件 |
69
+ | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
70
+ | Forms | `forms/`:Form、Input、Textarea、Switch、RadioGroup |
71
+ | Field | `forms/Field` |
72
+ | Checkbox | `forms/Checkbox` |
73
+ | Radio | `forms/`:RadioCard、RadioGroup |
74
+ | AdvancedForms | `forms/`:NumberInput、PinInput、Slider、RatingGroup、SegmentGroup |
75
+ | ComposedForms | `forms/`:Editable、TagsInput、RadioCard、Fieldset、InputGroup |
76
+ | NativePassword | `forms/`:PasswordInput、NativeSelect |
77
+ | FileUpload | `forms/FileUpload` |
78
+ | Combobox | `collections/Combobox` |
79
+ | TreeView | `collections/TreeView` |
80
+ | DatePicker | `date/DatePicker` |
81
+ | ColorPicker | `color/ColorPicker` |
82
+ | Overlay | `overlays/`:Menu、Popover、HoverCard、Drawer |
83
+ | OverlayManager | `overlays/OverlayManager` |
84
+ | Tooltip | `overlays/Tooltip` |
85
+ | Toast | `feedback/Toast` |
86
+ | Feedback | `feedback/`:Alert、Progress、ProgressCircle;`display/`:Avatar、Text;`navigation/Link` |
87
+ | Disclosure | `disclosure/`:Accordion、Collapsible;`navigation/Pagination` |
88
+ | Tabs | `disclosure/Tabs` |
89
+ | Steps | `disclosure/Steps` |
90
+ | Display | `display/`:Badge、Card;`feedback/Skeleton` |
91
+ | TableTag | `display/`:Table、Tag |
92
+ | Timeline | `display/Timeline` |
93
+ | Layout | `layout/`:Stack、Grid、Positioning;`navigation/LinkBox` |
94
+ | ScrollArea | `layout/ScrollArea` |
95
+ | Breadcrumb | `navigation/Breadcrumb` |
96
+ | Clipboard | `actions/Clipboard` |
97
+ | Convenience | `actions/IconButton`;`forms/Checkbox`;`display/`:Heading、Icon;`feedback/Spinner`;`layout/Positioning` |
98
+
99
+ 基础组件提供 Playground 调整配方和常用参数,事件记录到 Actions;
100
+ 表单与 store 场景使用独立状态,保留提交结果和交互反馈。
101
+ 跨组件的大表单拆分后,数值、验证码、评分等各自保留 FormData 示例。
102
+ 文件选择不上传文件,树形异步加载使用本地 Promise,头像使用内嵌 SVG。
103
+ Toast 与命令式弹层在示例卸载时清理实例。
104
+ PasswordInput 的 JSX 默认图标暂不支持自动参数提取,因此该 story 使用显式 argTypes。
105
+
106
+ 当前共 62 个组件族文件、163 个功能示例和 62 个自动文档入口。
107
+ 组件预览统一使用 Storybook,不依赖 Stack 路由。