@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,206 @@
1
+ import {
2
+ Button,
3
+ CloseButton,
4
+ Dialog,
5
+ Drawer,
6
+ Input,
7
+ Portal,
8
+ Text,
9
+ createOverlay,
10
+ type CreateOverlayProps,
11
+ } from '@repo/ui'
12
+ import { useEffect, useId, useRef, useState } from 'react'
13
+ import { hstack } from 'styled-system/patterns'
14
+ import { css } from 'styled-system/css'
15
+
16
+ import type { Meta, StoryObj } from '@storybook/react-vite'
17
+ interface ConfirmProps extends CreateOverlayProps<boolean> {
18
+ title: string
19
+ description: string
20
+ finalFocusEl?: () => HTMLElement | null
21
+ onConfirm: () => void
22
+ onUpdate: () => void
23
+ onReopen: () => void
24
+ onRemove: () => void
25
+ }
26
+ function ConfirmOverlay(props: ConfirmProps) {
27
+ const { title, description, onConfirm, onUpdate, onReopen, onRemove } = props
28
+ const inputId = useId()
29
+ return (
30
+ <Dialog.Root
31
+ open={props.open}
32
+ onOpenChange={props.onOpenChange}
33
+ onExitComplete={props.onExitComplete}
34
+ finalFocusEl={props.finalFocusEl}>
35
+ <Portal>
36
+ <Dialog.Backdrop />
37
+ <Dialog.Positioner>
38
+ <Dialog.Content>
39
+ <Dialog.Header>
40
+ <Dialog.Title>{title}</Dialog.Title>
41
+ <Dialog.Description>{description}</Dialog.Description>
42
+ </Dialog.Header>
43
+ <Dialog.Body gap="3">
44
+ <label htmlFor={inputId}>本地备注</label>
45
+ <Input id={inputId} placeholder="更新标题会保留输入;同 ID 重开会重置" />
46
+ <div className={hstack({ gap: '2', flexWrap: 'wrap' })}>
47
+ <Button variant="outline" size="sm" onClick={onUpdate}>
48
+ 动态更新
49
+ </Button>
50
+ <Button variant="outline" size="sm" onClick={onReopen}>
51
+ 同 ID 重开
52
+ </Button>
53
+ <Button variant="outline" size="sm" onClick={onRemove}>
54
+ 直接移除
55
+ </Button>
56
+ </div>
57
+ </Dialog.Body>
58
+ <Dialog.Footer>
59
+ <Dialog.CloseTrigger asChild position="static">
60
+ <Button variant="outline">取消</Button>
61
+ </Dialog.CloseTrigger>
62
+ <Button onClick={onConfirm}>确认并返回 true</Button>
63
+ </Dialog.Footer>
64
+ <Dialog.CloseTrigger asChild>
65
+ <CloseButton />
66
+ </Dialog.CloseTrigger>
67
+ </Dialog.Content>
68
+ </Dialog.Positioner>
69
+ </Portal>
70
+ </Dialog.Root>
71
+ )
72
+ }
73
+ interface DrawerProps extends CreateOverlayProps {
74
+ finalFocusEl?: () => HTMLElement | null
75
+ onRemoveAll: () => void
76
+ }
77
+ function ManagedDrawer(props: DrawerProps) {
78
+ const { onRemoveAll } = props
79
+ const inputId = useId()
80
+ return (
81
+ <Drawer.Root
82
+ open={props.open}
83
+ onOpenChange={props.onOpenChange}
84
+ onExitComplete={props.onExitComplete}
85
+ finalFocusEl={props.finalFocusEl}
86
+ placement="end"
87
+ size="md">
88
+ <Portal>
89
+ <Drawer.Backdrop />
90
+ <Drawer.Positioner>
91
+ <Drawer.Content>
92
+ <Drawer.Header>
93
+ <Drawer.Title>命令式 Drawer</Drawer.Title>
94
+ <Drawer.Description>行为与配方复用现有 Drawer。</Drawer.Description>
95
+ </Drawer.Header>
96
+ <Drawer.Body gap="3">
97
+ <label htmlFor={inputId}>备注</label>
98
+ <Input id={inputId} placeholder="仅本地交互" />
99
+ </Drawer.Body>
100
+ <Drawer.Footer>
101
+ <Button variant="outline" onClick={onRemoveAll}>
102
+ 立即移除全部实例
103
+ </Button>
104
+ <Drawer.CloseTrigger asChild position="static">
105
+ <Button>关闭</Button>
106
+ </Drawer.CloseTrigger>
107
+ </Drawer.Footer>
108
+ <Drawer.CloseTrigger asChild>
109
+ <CloseButton />
110
+ </Drawer.CloseTrigger>
111
+ </Drawer.Content>
112
+ </Drawer.Positioner>
113
+ </Portal>
114
+ </Drawer.Root>
115
+ )
116
+ }
117
+ const meta = {
118
+ title: 'Overlays/OverlayManager',
119
+ parameters: {
120
+ controls: { disable: true },
121
+ docs: {
122
+ source: { type: 'code' },
123
+ description: { component: '命令式弹层的返回值、更新、同 ID 重开和生命周期清理。' },
124
+ },
125
+ },
126
+ } satisfies Meta
127
+ export default meta
128
+ type Story = StoryObj<typeof meta>
129
+ export const Lifecycle: Story = {
130
+ render: function Lifecycle() {
131
+ const [confirm] = useState(() => createOverlay<ConfirmProps, boolean>(ConfirmOverlay))
132
+ const [drawer] = useState(() => createOverlay<DrawerProps>(ManagedDrawer))
133
+ const [result, setResult] = useState('尚未打开')
134
+ const [lifecycle, setLifecycle] = useState('尚无回调')
135
+ const confirmTriggerRef = useRef<HTMLButtonElement>(null)
136
+ const drawerTriggerRef = useRef<HTMLButtonElement>(null)
137
+ const active = useRef(false)
138
+ const request = useRef(0)
139
+ useEffect(() => {
140
+ active.current = true
141
+ return () => {
142
+ active.current = false
143
+ confirm.removeAll()
144
+ drawer.removeAll()
145
+ }
146
+ }, [confirm, drawer])
147
+ async function openConfirm() {
148
+ const currentRequest = ++request.current
149
+ setResult('等待选择…')
150
+ const answer = await confirm.open('confirm', {
151
+ title: '确认操作',
152
+ description: 'Escape、关闭按钮或遮罩返回 undefined;确认返回 true。',
153
+ finalFocusEl: () => confirmTriggerRef.current,
154
+ onOpenChange: ({ open }) => setLifecycle(`onOpenChange:${open ? '打开' : '关闭'}`),
155
+ onExitComplete: () => setLifecycle('onExitComplete:退场完成'),
156
+ onConfirm: () => {
157
+ void confirm.close('confirm', true)
158
+ },
159
+ onUpdate: () =>
160
+ confirm.update('confirm', {
161
+ title: '标题已更新',
162
+ description: 'update 只更新属性,保留组件状态。',
163
+ }),
164
+ onReopen: () => {
165
+ void openConfirm()
166
+ },
167
+ onRemove: () => confirm.remove('confirm'),
168
+ })
169
+ if (!active.current || currentRequest !== request.current) return
170
+ setResult(`返回值:${String(answer)};等待退场…`)
171
+ await confirm.waitForExit('confirm')
172
+ if (active.current && currentRequest === request.current) {
173
+ setResult(`返回值:${String(answer)};退场完成`)
174
+ }
175
+ }
176
+ return (
177
+ <div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
178
+ <Text>createOverlay 创建管理器,在使用范围内挂载一次 Viewport;示例卸载时清理实例。</Text>
179
+ <div className={hstack({ gap: '3', flexWrap: 'wrap' })}>
180
+ <Button
181
+ ref={confirmTriggerRef}
182
+ onClick={() => {
183
+ void openConfirm()
184
+ }}>
185
+ 打开确认 Dialog
186
+ </Button>
187
+ <Button
188
+ ref={drawerTriggerRef}
189
+ variant="outline"
190
+ onClick={() => {
191
+ void drawer.open('drawer', {
192
+ finalFocusEl: () => drawerTriggerRef.current,
193
+ onRemoveAll: () => drawer.removeAll(),
194
+ })
195
+ }}>
196
+ 打开 Drawer
197
+ </Button>
198
+ </div>
199
+ <Text role="status">{result}</Text>
200
+ <Text role="status">{lifecycle}</Text>
201
+ <confirm.Viewport />
202
+ <drawer.Viewport />
203
+ </div>
204
+ )
205
+ },
206
+ }
@@ -0,0 +1,73 @@
1
+ import { Button, Input, Popover, Portal } from '@repo/ui'
2
+ import { useRef, useState, useId } from 'react'
3
+ import { css } from 'styled-system/css'
4
+
5
+ import type { Meta, StoryObj } from '@storybook/react-vite'
6
+
7
+ const meta = {
8
+ title: 'Overlays/Popover',
9
+ component: Popover.Root,
10
+ parameters: {
11
+ controls: { disable: true },
12
+ docs: {
13
+ source: { type: 'code' },
14
+ description: { component: '受控浮层、初始焦点、箭头和关闭行为。' },
15
+ },
16
+ },
17
+ } satisfies Meta<typeof Popover.Root>
18
+ export default meta
19
+ type Story = StoryObj<typeof meta>
20
+ export const ControlledStore: Story = {
21
+ render: function ControlledStore() {
22
+ const [popoverOpen, setPopoverOpen] = useState(false)
23
+ const inputRef = useRef<HTMLInputElement>(null)
24
+
25
+ const popover = Popover.usePopover({
26
+ open: popoverOpen,
27
+ onOpenChange: ({ open }) => setPopoverOpen(open),
28
+ initialFocusEl: () => inputRef.current,
29
+ positioning: { placement: 'bottom-start', gutter: 12 },
30
+ })
31
+
32
+ const storyId = useId()
33
+ return (
34
+ <div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
35
+ <div className={css({ display: 'grid', gap: '3' })}>
36
+ <h3 className={css({ textStyle: 'lg', fontWeight: 'semibold' })}>受控 Popover</h3>
37
+ <Popover.RootProvider value={popover}>
38
+ <Popover.Trigger asChild>
39
+ <Button variant="outline">打开编辑浮层</Button>
40
+ </Popover.Trigger>
41
+ <Portal>
42
+ <Popover.Positioner>
43
+ <Popover.Content>
44
+ <Popover.Arrow />
45
+ <Popover.Header>
46
+ <Popover.Title>编辑备注</Popover.Title>
47
+ <Popover.Description>
48
+ 打开后聚焦输入框,Escape 或外部点击可关闭。
49
+ </Popover.Description>
50
+ </Popover.Header>
51
+ <Popover.Body>
52
+ <label htmlFor={`${storyId}-overlay-note`}>备注</label>
53
+ <Input
54
+ id={`${storyId}-overlay-note`}
55
+ ref={inputRef}
56
+ placeholder="仅在本地编辑"
57
+ />
58
+ </Popover.Body>
59
+ <Popover.Footer>
60
+ <Popover.CloseTrigger asChild>
61
+ <Button size="sm">完成</Button>
62
+ </Popover.CloseTrigger>
63
+ </Popover.Footer>
64
+ </Popover.Content>
65
+ </Popover.Positioner>
66
+ </Portal>
67
+ </Popover.RootProvider>
68
+ <p role="status">Popover:{popoverOpen ? '已打开' : '已关闭'}</p>
69
+ </div>
70
+ </div>
71
+ )
72
+ },
73
+ }
@@ -0,0 +1,114 @@
1
+ import { Button, Portal, Tooltip as TooltipPrimitive, useTooltip } from '@repo/ui'
2
+ import { Tooltip } from '@repo/ui/tooltip'
3
+ import { useRef, 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: 'Overlays/Tooltip',
10
+ component: Tooltip,
11
+ args: { children: null, content: '说明文字' },
12
+ parameters: {
13
+ controls: { disable: true },
14
+ docs: {
15
+ source: { type: 'code' },
16
+ description: { component: '便捷与插槽 API、受控状态、Portal 和外部 store。' },
17
+ },
18
+ },
19
+ } satisfies Meta<typeof Tooltip>
20
+ export default meta
21
+ type Story = StoryObj<typeof meta>
22
+ export const ControlledAndPortal: Story = {
23
+ render: function ControlledAndPortal() {
24
+ const [open, setOpen] = useState(false)
25
+ const [clicks, setClicks] = useState(0)
26
+ const contentRef = useRef<HTMLDivElement>(null)
27
+ return (
28
+ <div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
29
+ <p>悬停或用 Tab 聚焦按钮应显示提示;Escape、失焦或点击可关闭。提示内仅放说明文字。</p>
30
+ <div className={css({ display: 'flex', flexWrap: 'wrap', gap: '4' })}>
31
+ <Tooltip
32
+ content="保存当前设置,不会离开页面。"
33
+ showArrow
34
+ positioning={{ placement: 'top' }}>
35
+ <Button type="button" onClick={() => setClicks((value) => value + 1)}>
36
+ 保存设置(提示带箭头)
37
+ </Button>
38
+ </Tooltip>
39
+ <Tooltip
40
+ ref={contentRef}
41
+ content="这是由外部状态控制的提示。"
42
+ open={open}
43
+ onOpenChange={(details) => setOpen(details.open)}
44
+ openDelay={0}
45
+ positioning={{ placement: 'bottom' }}>
46
+ <Button type="button" variant="outline">
47
+ 受控提示目标
48
+ </Button>
49
+ </Tooltip>
50
+ <Button type="button" variant="subtle" onClick={() => setOpen((value) => !value)}>
51
+ 切换受控提示
52
+ </Button>
53
+ <Tooltip content="禁用提示不应出现。" disabled>
54
+ <Button type="button" variant="outline">
55
+ 提示已禁用,按钮可操作
56
+ </Button>
57
+ </Tooltip>
58
+ <Tooltip content="此提示保留在当前 DOM 容器。" portalled={false} openDelay={0}>
59
+ <Button type="button" variant="surface">
60
+ 不使用 Portal
61
+ </Button>
62
+ </Tooltip>
63
+ </div>
64
+ <p role="status">
65
+ 保存执行 {clicks} 次;受控提示:{open ? '打开' : '关闭'}
66
+ </p>
67
+ </div>
68
+ )
69
+ },
70
+ }
71
+ export const PrimitiveAndStore: Story = {
72
+ render: function PrimitiveAndStore() {
73
+ const tooltip = useTooltip({ openDelay: 0 })
74
+
75
+ return (
76
+ <div className={css({ display: 'grid', gap: '4', maxWidth: '4xl' })}>
77
+ <div className={css({ display: 'flex', flexWrap: 'wrap', alignItems: 'center', gap: '4' })}>
78
+ <TooltipPrimitive.Root openDelay={0} positioning={{ placement: 'bottom' }}>
79
+ <TooltipPrimitive.Trigger asChild>
80
+ <Button type="button" variant="outline">
81
+ 自由组合提示
82
+ </Button>
83
+ </TooltipPrimitive.Trigger>
84
+ <Portal>
85
+ <TooltipPrimitive.Positioner>
86
+ <TooltipPrimitive.Content>
87
+ <TooltipPrimitive.Arrow>
88
+ <TooltipPrimitive.ArrowTip />
89
+ </TooltipPrimitive.Arrow>
90
+ 自由组合插槽,支持样式属性和 asChild。
91
+ </TooltipPrimitive.Content>
92
+ </TooltipPrimitive.Positioner>
93
+ </Portal>
94
+ </TooltipPrimitive.Root>
95
+ <TooltipPrimitive.RootProvider value={tooltip}>
96
+ <TooltipPrimitive.Trigger asChild>
97
+ <Button type="button" variant="surface">
98
+ store 提示目标
99
+ </Button>
100
+ </TooltipPrimitive.Trigger>
101
+ <Portal>
102
+ <TooltipPrimitive.Positioner>
103
+ <TooltipPrimitive.Content>通过外部 store 控制提示。</TooltipPrimitive.Content>
104
+ </TooltipPrimitive.Positioner>
105
+ </Portal>
106
+ </TooltipPrimitive.RootProvider>
107
+ <Button type="button" variant="subtle" onClick={() => tooltip.setOpen(!tooltip.open)}>
108
+ 切换 store 提示
109
+ </Button>
110
+ </div>
111
+ </div>
112
+ )
113
+ },
114
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "compilerOptions": {
4
+ "types": ["node", "vite-plus/client"],
5
+ "paths": {
6
+ "@/*": ["../src/*"],
7
+ "@repo/ui": ["../src/index.ts"],
8
+ "@repo/ui/tooltip": ["../src/Tooltip.tsx"],
9
+ "styled-system/*": ["../.storybook/styled-system/*"]
10
+ }
11
+ },
12
+ "include": ["./**/*.ts", "./**/*.tsx", "../.storybook/**/*.ts", "../.storybook/**/*.tsx"],
13
+ "exclude": ["../.storybook/styled-system"]
14
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "files": [],
4
+ "include": ["src/index.ts", "src/Tooltip.tsx"]
5
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "extends": "@oyolincc/dev-config/tsconfig.frontend.json",
3
+ "compilerOptions": {
4
+ "types": ["node"],
5
+ "jsx": "react-jsx",
6
+ "paths": {
7
+ "@/*": ["./src/*"],
8
+ "styled-system/*": ["./styled-system/*"]
9
+ }
10
+ },
11
+ "files": [],
12
+ "include": ["src", "styled-system", "./*.ts", "./*.mts"]
13
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "extends": ["//"],
3
+ "tasks": {
4
+ "build": {
5
+ "inputs": ["$TURBO_EXTENDS$"],
6
+ "outputs": ["dist/**", "styled-system/**"]
7
+ },
8
+ "build:codegen": {
9
+ "inputs": ["panda.config.ts", "src/theme/**", "tsconfig.json"],
10
+ "outputs": ["styled-system/**"]
11
+ },
12
+ "build:react": {
13
+ "dependsOn": ["build:codegen", "^build"],
14
+ "inputs": [
15
+ "$TURBO_DEFAULT$",
16
+ "!**/*.md",
17
+ "!src/theme/**",
18
+ "!panda.config.ts"
19
+ ],
20
+ "outputs": ["dist/react/**"]
21
+ },
22
+ "build:dev": {
23
+ "dependsOn": ["build:react"],
24
+ "inputs": ["package.json"],
25
+ "outputs": ["dist/panda/**"]
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,33 @@
1
+ import { defineConfig } from 'vite-plus'
2
+ import { packConfig } from '@oyolincc/dev-config'
3
+ import {
4
+ isUseClientDirectiveWarning,
5
+ type BundlerLog,
6
+ type BundlerLogHandler,
7
+ type BundlerLogLevel,
8
+ } from '@oyolincc/dev-config'
9
+
10
+ export default defineConfig({
11
+ pack: {
12
+ ...packConfig,
13
+ entry: ['src/index.ts', 'src/Tooltip.tsx'],
14
+ tsconfig: './tsconfig.build.json',
15
+ exports: false,
16
+ // Keep each component's RSC boundary in its own output module.
17
+ unbundle: true,
18
+ root: '.',
19
+ outDir: 'dist/react',
20
+ platform: 'neutral',
21
+ fixedExtension: true,
22
+ deps: {
23
+ onlyBundle: [],
24
+ },
25
+ inputOptions: {
26
+ onLog(level: BundlerLogLevel, log: BundlerLog, defaultHandler: BundlerLogHandler) {
27
+ // Unbundle preserves this directive in each emitted module.
28
+ if (level === 'warn' && isUseClientDirectiveWarning(log)) return
29
+ defaultHandler(level, log)
30
+ },
31
+ },
32
+ },
33
+ })
@@ -9,9 +9,35 @@
9
9
  },
10
10
  "codeGenerator": {
11
11
  "root": ".",
12
- "scope": "@repo",
13
- "author": "",
14
- "gitUrlBase": "",
15
- "license": "MIT"
12
+ "database": {
13
+ "entry": "./libs/db/dist/sqlite/schema.mjs",
14
+ "customTypes": {
15
+ "integer": "string"
16
+ }
17
+ },
18
+ "repo-package": {
19
+ "scope": "@repo",
20
+ "author": "",
21
+ "gitUrlBase": "",
22
+ "license": "MIT"
23
+ },
24
+ "contracts": {
25
+ "outputDir": "./libs/definition/src/modules",
26
+ "createOne": {
27
+ "excludePrimaryKey": true,
28
+ "excludeFields": ["createdAt", "updatedAt"]
29
+ },
30
+ "constantsSource": "./libs/definition/src/constants/index",
31
+ "models": {
32
+ "example": "./libs/definition/src/modules/example/contracts.ts"
33
+ },
34
+ "commonContracts": "./libs/definition/src/modules/common-contracts.ts"
35
+ },
36
+ "vo": {
37
+ "outputDir": "./libs/definition/src/modules",
38
+ "models": {
39
+ "vo-generated-types": "libs/definition/src/modules/vo-generated-types.ts"
40
+ }
41
+ }
16
42
  }
17
43
  }
@@ -4,6 +4,7 @@
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "prepare": "vp config",
7
+ "cf:typegen": "pnpm -C apps/server cf:typegen && pnpm -C apps/stack cf:typegen",
7
8
  "changeset": "vp exec changeset",
8
9
  "build": "turbo build",
9
10
  "build:libs": "turbo build --filter=!@repo/stack --filter=!@repo/server"
@@ -9,12 +9,12 @@ catalog:
9
9
  '@changesets/changelog-github': '0.5.0'
10
10
  '@changesets/cli': '2.27.12'
11
11
  '@cloudflare/vite-plugin': '1.62.5'
12
- '@oyolincc/cli': '2.1.3'
13
- '@oyolincc/dev-config': '0.1.1'
12
+ '@inferdi/inferdi': '^6.1.0'
13
+ '@oyolincc/cli': '2.1.5'
14
+ '@oyolincc/dev-config': '0.2.0'
14
15
  '@oyolincc/env-loader': '^0.2.0'
15
16
  '@rollup/pluginutils': '^5.4.0'
16
17
  '@types/node': '^24'
17
- '@vitejs/plugin-react': '^6.0.3'
18
18
  'concurrently': '^10.0.5'
19
19
  'dotenv': '17.2.3'
20
20
  'fast-glob': '^3.3.3'
@@ -22,8 +22,8 @@ catalog:
22
22
  'tsx': '4.21.0'
23
23
  'turbo': '^2.9.14'
24
24
  'typescript': '7.0.2'
25
- 'vite': 'npm:@voidzero-dev/vite-plus-core@1.0.0'
26
- 'vite-plus': '1.0.0'
25
+ 'vite': 'npm:@voidzero-dev/vite-plus-core@1.1.0'
26
+ 'vite-plus': '1.1.0'
27
27
  'wrangler': '4.147.0'
28
28
 
29
29
  catalogs:
@@ -38,19 +38,26 @@ catalogs:
38
38
  server:
39
39
  '@hono/node-server': '^2.1.0'
40
40
  '@hono/standard-validator': '^0.4.0'
41
+ '@hono/structured-logger': '^1.0.0'
41
42
  '@hono/swagger-ui': '^0.6.1'
42
43
  '@hono/vite-dev-server': '^0.26.1'
44
+ '@inferdi/hono': '^6.1.0'
43
45
  '@valibot/to-json-schema': '^1.7.1'
44
46
  'hono': '^4.13.1'
45
47
  'hono-openapi': '^1.3.3'
46
- 'hono-pino': '^0.10.3'
47
48
  'hono-problem-details': '^0.11.0'
48
49
  'pino': '^10.3.1'
49
50
  'pino-pretty': '^13.1.3'
50
51
  'pino-roll': '^4.0.0'
51
52
  'piscina': '^5.3.0'
52
53
  frontend:
53
- '@tailwindcss/vite': '^4.3.3'
54
+ '@ark-ui/react': '^5.39.3'
55
+ '@pandacss/dev': '2.2.0'
56
+ '@pandacss/preset-base': '2.2.0'
57
+ '@pandacss/preset-panda': '2.2.0'
58
+ '@pandacss/vite': '2.2.0'
59
+ '@storybook/addon-docs': '10.6.2'
60
+ '@storybook/react-vite': '10.6.2'
54
61
  '@tanstack/react-query': '^5.90.21'
55
62
  '@tanstack/react-query-devtools': '^5.102.8'
56
63
  '@tanstack/react-router': '^1.170.19'
@@ -59,15 +66,17 @@ catalogs:
59
66
  '@tanstack/router-cli': '^1.167.18'
60
67
  '@types/react': '19.2.17'
61
68
  '@types/react-dom': '19.2.3'
69
+ '@vitejs/plugin-react': '^6.0.3'
62
70
  'jotai': '^2.18.0'
71
+ 'lucide-react': '^1.55.0'
63
72
  'react': '19.2.7'
64
73
  'react-dom': '19.2.7'
65
- 'tailwindcss': '^4.3.3'
74
+ 'storybook': '10.6.2'
66
75
  db:
67
76
  '@types/better-sqlite3': '^7.6.13'
68
77
  'better-sqlite3': '^12.11.1'
69
- 'drizzle-kit': '1.0.0-rc.4'
70
- 'drizzle-orm': '1.0.0-rc.4'
78
+ 'drizzle-kit': '1.0.0-rc.5'
79
+ 'drizzle-orm': '1.0.0-rc.5'
71
80
 
72
81
  overrides:
73
82
  'vite@*': 'catalog:'
@@ -79,6 +88,7 @@ peerDependencyRules:
79
88
  'vite': '*'
80
89
 
81
90
  allowBuilds:
91
+ '@parcel/watcher': true
82
92
  'better-sqlite3': true
83
93
  'esbuild': true
84
94
  'workerd': true
@@ -1,5 +1,8 @@
1
1
  {
2
2
  "$schema": "https://turbo.build/schema.json",
3
+ "futureFlags": {
4
+ "watchUsingTaskInputs": true
5
+ },
3
6
  "tasks": {
4
7
  "dev": {
5
8
  "dependsOn": ["^build"],
@@ -20,15 +23,22 @@
20
23
  },
21
24
  "build": {
22
25
  "dependsOn": ["^build"],
26
+ "inputs": ["$TURBO_DEFAULT$", "!**/*.md"],
23
27
  "outputs": ["dist/**", ".output/**"]
24
28
  },
29
+ "build:dev": {
30
+ "dependsOn": ["^build:dev", "build"],
31
+ "inputs": ["package.json"]
32
+ },
25
33
  "build:node": {
26
34
  "dependsOn": ["^build"],
35
+ "inputs": ["$TURBO_DEFAULT$", "!**/*.md"],
27
36
  "env": ["DEPLOY_TARGET"],
28
37
  "outputs": ["dist/**", ".output/**"]
29
38
  },
30
39
  "build:cloudflare": {
31
40
  "dependsOn": ["^build"],
41
+ "inputs": ["$TURBO_DEFAULT$", "!**/*.md"],
32
42
  "env": ["DEPLOY_TARGET"],
33
43
  "outputs": ["dist/**", ".output/**"]
34
44
  }
@@ -0,0 +1,5 @@
1
+ # CodeGraph data files — local to each machine, not for committing.
2
+ # Ignore everything in .codegraph/ except this file itself, so transient
3
+ # files (the database, daemon.pid, sockets, logs) never show up in git.
4
+ *
5
+ !.gitignore