@oyolincc/create 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (392) 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 +21 -8
  53. package/templates/hono-fullstack/apps/stack/frontend/routes/__root.tsx +1 -1
  54. package/templates/hono-fullstack/apps/stack/frontend/routes/index.tsx +35 -12
  55. package/templates/hono-fullstack/apps/stack/frontend/shared/network/query-hooks.ts +33 -0
  56. package/templates/hono-fullstack/apps/stack/package.json +9 -4
  57. package/templates/hono-fullstack/apps/stack/panda.config.ts +31 -0
  58. package/templates/hono-fullstack/apps/stack/tsconfig.json +1 -0
  59. package/templates/hono-fullstack/apps/stack/turbo.json +20 -0
  60. package/templates/hono-fullstack/apps/stack/vite.config.ts +48 -12
  61. package/templates/hono-fullstack/apps/stack/wrangler.jsonc +1 -1
  62. package/templates/hono-fullstack/envs/.env.example.sqlite-d1 +1 -0
  63. package/templates/hono-fullstack/libs/db/drizzle-kit/sqlite-d1.config.ts +29 -10
  64. package/templates/hono-fullstack/libs/db/package.json +1 -0
  65. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/columns.ts +1 -1
  66. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/modules/examples/examples.ts +6 -3
  67. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/vo.ts +7 -1
  68. package/templates/hono-fullstack/libs/definition/README.md +81 -0
  69. package/templates/hono-fullstack/libs/definition/package.json +3 -1
  70. package/templates/hono-fullstack/libs/definition/src/constants/index.ts +1 -0
  71. package/templates/hono-fullstack/libs/definition/src/constants/pagination.ts +3 -0
  72. package/templates/hono-fullstack/libs/definition/src/modules/common-contracts.ts +24 -0
  73. package/templates/hono-fullstack/libs/definition/src/modules/example/contracts.ts +34 -0
  74. package/templates/hono-fullstack/libs/definition/src/modules/example/index.ts +1 -16
  75. package/templates/hono-fullstack/libs/definition/src/modules/index.ts +2 -0
  76. package/templates/hono-fullstack/libs/definition/src/modules/vo-generated-types.ts +12 -0
  77. package/templates/hono-fullstack/libs/ui/.storybook/main.ts +32 -0
  78. package/templates/hono-fullstack/libs/ui/.storybook/panda.config.ts +22 -0
  79. package/templates/hono-fullstack/libs/ui/.storybook/preview.tsx +79 -0
  80. package/templates/hono-fullstack/libs/ui/.storybook/styles.css +1 -0
  81. package/templates/hono-fullstack/libs/ui/.storybook/vite.config.ts +37 -0
  82. package/templates/hono-fullstack/libs/ui/components.json +15 -0
  83. package/templates/hono-fullstack/libs/ui/package.json +114 -0
  84. package/templates/hono-fullstack/libs/ui/panda.config.ts +41 -0
  85. package/templates/hono-fullstack/libs/ui/src/Tooltip.tsx +47 -0
  86. package/templates/hono-fullstack/libs/ui/src/components/atoms/buttons/Button.tsx +80 -0
  87. package/templates/hono-fullstack/libs/ui/src/components/atoms/buttons/CloseButton.tsx +15 -0
  88. package/templates/hono-fullstack/libs/ui/src/components/atoms/buttons/IconButton.tsx +10 -0
  89. package/templates/hono-fullstack/libs/ui/src/components/atoms/collections/Combobox.tsx +91 -0
  90. package/templates/hono-fullstack/libs/ui/src/components/atoms/collections/Select.tsx +88 -0
  91. package/templates/hono-fullstack/libs/ui/src/components/atoms/collections/TreeView.tsx +142 -0
  92. package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Avatar.tsx +64 -0
  93. package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Badge.tsx +7 -0
  94. package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Card.tsx +23 -0
  95. package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Clipboard.tsx +77 -0
  96. package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Icon.tsx +9 -0
  97. package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Table.tsx +51 -0
  98. package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Tag.tsx +23 -0
  99. package/templates/hono-fullstack/libs/ui/src/components/atoms/data-display/Timeline.tsx +33 -0
  100. package/templates/hono-fullstack/libs/ui/src/components/atoms/date-and-time/DatePicker.tsx +255 -0
  101. package/templates/hono-fullstack/libs/ui/src/components/atoms/disclosure/Accordion.tsx +48 -0
  102. package/templates/hono-fullstack/libs/ui/src/components/atoms/disclosure/Breadcrumb.tsx +50 -0
  103. package/templates/hono-fullstack/libs/ui/src/components/atoms/disclosure/Collapsible.tsx +34 -0
  104. package/templates/hono-fullstack/libs/ui/src/components/atoms/disclosure/Pagination.tsx +74 -0
  105. package/templates/hono-fullstack/libs/ui/src/components/atoms/disclosure/Steps.tsx +91 -0
  106. package/templates/hono-fullstack/libs/ui/src/components/atoms/disclosure/Tabs.tsx +37 -0
  107. package/templates/hono-fullstack/libs/ui/src/components/atoms/feedback/Alert.tsx +52 -0
  108. package/templates/hono-fullstack/libs/ui/src/components/atoms/feedback/Progress.tsx +41 -0
  109. package/templates/hono-fullstack/libs/ui/src/components/atoms/feedback/ProgressCircle.tsx +40 -0
  110. package/templates/hono-fullstack/libs/ui/src/components/atoms/feedback/Skeleton.tsx +37 -0
  111. package/templates/hono-fullstack/libs/ui/src/components/atoms/feedback/Spinner.tsx +7 -0
  112. package/templates/hono-fullstack/libs/ui/src/components/atoms/feedback/Toast.tsx +99 -0
  113. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Checkbox.tsx +95 -0
  114. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/ColorPicker.tsx +148 -0
  115. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Editable.tsx +44 -0
  116. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Field.tsx +36 -0
  117. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Fieldset.tsx +34 -0
  118. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/FileUpload.tsx +143 -0
  119. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Input.tsx +7 -0
  120. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/InputAddon.tsx +7 -0
  121. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/InputGroup.tsx +61 -0
  122. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/NativeSelect.tsx +81 -0
  123. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/NumberInput.tsx +63 -0
  124. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/PasswordInput.tsx +76 -0
  125. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/PinInput.tsx +36 -0
  126. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/RadioCard.tsx +96 -0
  127. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/RadioGroup.tsx +61 -0
  128. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/RatingGroup.tsx +106 -0
  129. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/SegmentGroup.tsx +68 -0
  130. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Slider.tsx +87 -0
  131. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Switch.tsx +74 -0
  132. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/TagsInput.tsx +77 -0
  133. package/templates/hono-fullstack/libs/ui/src/components/atoms/forms/Textarea.tsx +7 -0
  134. package/templates/hono-fullstack/libs/ui/src/components/atoms/index.ts +98 -0
  135. package/templates/hono-fullstack/libs/ui/src/components/atoms/internal/AbsoluteCenter.tsx +7 -0
  136. package/templates/hono-fullstack/libs/ui/src/components/atoms/internal/Loader.tsx +69 -0
  137. package/templates/hono-fullstack/libs/ui/src/components/atoms/internal/Span.tsx +5 -0
  138. package/templates/hono-fullstack/libs/ui/src/components/atoms/internal/create-layout.ts +18 -0
  139. package/templates/hono-fullstack/libs/ui/src/components/atoms/layout/Float.tsx +7 -0
  140. package/templates/hono-fullstack/libs/ui/src/components/atoms/layout/Grid.tsx +17 -0
  141. package/templates/hono-fullstack/libs/ui/src/components/atoms/layout/Group.tsx +7 -0
  142. package/templates/hono-fullstack/libs/ui/src/components/atoms/layout/ScrollArea.tsx +46 -0
  143. package/templates/hono-fullstack/libs/ui/src/components/atoms/layout/Separator.tsx +26 -0
  144. package/templates/hono-fullstack/libs/ui/src/components/atoms/layout/Stack.tsx +54 -0
  145. package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/Dialog.tsx +69 -0
  146. package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/Drawer.tsx +49 -0
  147. package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/HoverCard.tsx +37 -0
  148. package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/Menu.tsx +74 -0
  149. package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/OverlayManager.test.ts +124 -0
  150. package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/OverlayManager.tsx +189 -0
  151. package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/Popover.tsx +57 -0
  152. package/templates/hono-fullstack/libs/ui/src/components/atoms/overlays/Tooltip.tsx +37 -0
  153. package/templates/hono-fullstack/libs/ui/src/components/atoms/typography/Heading.tsx +6 -0
  154. package/templates/hono-fullstack/libs/ui/src/components/atoms/typography/Link.tsx +7 -0
  155. package/templates/hono-fullstack/libs/ui/src/components/atoms/typography/LinkOverlay.tsx +21 -0
  156. package/templates/hono-fullstack/libs/ui/src/components/atoms/typography/Text.tsx +6 -0
  157. package/templates/hono-fullstack/libs/ui/src/components/atoms/utilities/VisuallyHidden.tsx +13 -0
  158. package/templates/hono-fullstack/libs/ui/src/hooks.ts +242 -0
  159. package/templates/hono-fullstack/libs/ui/src/index.ts +19 -0
  160. package/templates/hono-fullstack/libs/ui/src/theme/animation-styles.ts +50 -0
  161. package/templates/hono-fullstack/libs/ui/src/theme/breakpoints.ts +7 -0
  162. package/templates/hono-fullstack/libs/ui/src/theme/conditions.ts +12 -0
  163. package/templates/hono-fullstack/libs/ui/src/theme/containers.ts +16 -0
  164. package/templates/hono-fullstack/libs/ui/src/theme/global-css.ts +12 -0
  165. package/templates/hono-fullstack/libs/ui/src/theme/keyframes.ts +157 -0
  166. package/templates/hono-fullstack/libs/ui/src/theme/layer-styles.ts +11 -0
  167. package/templates/hono-fullstack/libs/ui/src/theme/patterns/grid.ts +51 -0
  168. package/templates/hono-fullstack/libs/ui/src/theme/patterns/index.ts +60 -0
  169. package/templates/hono-fullstack/libs/ui/src/theme/patterns/stack.ts +46 -0
  170. package/templates/hono-fullstack/libs/ui/src/theme/recipes/absolute-center.ts +38 -0
  171. package/templates/hono-fullstack/libs/ui/src/theme/recipes/accordion.ts +68 -0
  172. package/templates/hono-fullstack/libs/ui/src/theme/recipes/alert.ts +83 -0
  173. package/templates/hono-fullstack/libs/ui/src/theme/recipes/avatar.ts +155 -0
  174. package/templates/hono-fullstack/libs/ui/src/theme/recipes/badge.ts +67 -0
  175. package/templates/hono-fullstack/libs/ui/src/theme/recipes/breadcrumb.ts +69 -0
  176. package/templates/hono-fullstack/libs/ui/src/theme/recipes/button.ts +149 -0
  177. package/templates/hono-fullstack/libs/ui/src/theme/recipes/card.ts +36 -0
  178. package/templates/hono-fullstack/libs/ui/src/theme/recipes/checkbox.ts +120 -0
  179. package/templates/hono-fullstack/libs/ui/src/theme/recipes/clipboard.ts +22 -0
  180. package/templates/hono-fullstack/libs/ui/src/theme/recipes/collapsible.ts +26 -0
  181. package/templates/hono-fullstack/libs/ui/src/theme/recipes/color-picker.ts +299 -0
  182. package/templates/hono-fullstack/libs/ui/src/theme/recipes/combobox.ts +141 -0
  183. package/templates/hono-fullstack/libs/ui/src/theme/recipes/date-picker.ts +302 -0
  184. package/templates/hono-fullstack/libs/ui/src/theme/recipes/dialog.ts +191 -0
  185. package/templates/hono-fullstack/libs/ui/src/theme/recipes/drawer.ts +170 -0
  186. package/templates/hono-fullstack/libs/ui/src/theme/recipes/editable.ts +64 -0
  187. package/templates/hono-fullstack/libs/ui/src/theme/recipes/field.ts +41 -0
  188. package/templates/hono-fullstack/libs/ui/src/theme/recipes/fieldset.ts +47 -0
  189. package/templates/hono-fullstack/libs/ui/src/theme/recipes/file-upload.ts +86 -0
  190. package/templates/hono-fullstack/libs/ui/src/theme/recipes/group.ts +78 -0
  191. package/templates/hono-fullstack/libs/ui/src/theme/recipes/heading.ts +24 -0
  192. package/templates/hono-fullstack/libs/ui/src/theme/recipes/hover-card.ts +47 -0
  193. package/templates/hono-fullstack/libs/ui/src/theme/recipes/icon.ts +25 -0
  194. package/templates/hono-fullstack/libs/ui/src/theme/recipes/index.ts +120 -0
  195. package/templates/hono-fullstack/libs/ui/src/theme/recipes/input-addon.ts +51 -0
  196. package/templates/hono-fullstack/libs/ui/src/theme/recipes/input-group.ts +77 -0
  197. package/templates/hono-fullstack/libs/ui/src/theme/recipes/input.ts +99 -0
  198. package/templates/hono-fullstack/libs/ui/src/theme/recipes/link.ts +36 -0
  199. package/templates/hono-fullstack/libs/ui/src/theme/recipes/menu.ts +114 -0
  200. package/templates/hono-fullstack/libs/ui/src/theme/recipes/native-select.ts +92 -0
  201. package/templates/hono-fullstack/libs/ui/src/theme/recipes/number-input.ts +91 -0
  202. package/templates/hono-fullstack/libs/ui/src/theme/recipes/pagination.ts +9 -0
  203. package/templates/hono-fullstack/libs/ui/src/theme/recipes/pin-input.ts +33 -0
  204. package/templates/hono-fullstack/libs/ui/src/theme/recipes/popover.ts +78 -0
  205. package/templates/hono-fullstack/libs/ui/src/theme/recipes/progress-circle.ts +50 -0
  206. package/templates/hono-fullstack/libs/ui/src/theme/recipes/progress.ts +112 -0
  207. package/templates/hono-fullstack/libs/ui/src/theme/recipes/radio-card.ts +223 -0
  208. package/templates/hono-fullstack/libs/ui/src/theme/recipes/radio-group.ts +78 -0
  209. package/templates/hono-fullstack/libs/ui/src/theme/recipes/rating-group.ts +98 -0
  210. package/templates/hono-fullstack/libs/ui/src/theme/recipes/scroll-area.ts +119 -0
  211. package/templates/hono-fullstack/libs/ui/src/theme/recipes/segment-group.ts +162 -0
  212. package/templates/hono-fullstack/libs/ui/src/theme/recipes/select.ts +157 -0
  213. package/templates/hono-fullstack/libs/ui/src/theme/recipes/separator.ts +25 -0
  214. package/templates/hono-fullstack/libs/ui/src/theme/recipes/skeleton.ts +65 -0
  215. package/templates/hono-fullstack/libs/ui/src/theme/recipes/slider.ts +164 -0
  216. package/templates/hono-fullstack/libs/ui/src/theme/recipes/spinner.ts +34 -0
  217. package/templates/hono-fullstack/libs/ui/src/theme/recipes/steps.ts +162 -0
  218. package/templates/hono-fullstack/libs/ui/src/theme/recipes/switch.ts +150 -0
  219. package/templates/hono-fullstack/libs/ui/src/theme/recipes/table.ts +150 -0
  220. package/templates/hono-fullstack/libs/ui/src/theme/recipes/tabs.ts +128 -0
  221. package/templates/hono-fullstack/libs/ui/src/theme/recipes/tag.ts +114 -0
  222. package/templates/hono-fullstack/libs/ui/src/theme/recipes/tags-input.ts +201 -0
  223. package/templates/hono-fullstack/libs/ui/src/theme/recipes/text.ts +7 -0
  224. package/templates/hono-fullstack/libs/ui/src/theme/recipes/textarea.ts +90 -0
  225. package/templates/hono-fullstack/libs/ui/src/theme/recipes/timeline.ts +137 -0
  226. package/templates/hono-fullstack/libs/ui/src/theme/recipes/toast.ts +52 -0
  227. package/templates/hono-fullstack/libs/ui/src/theme/recipes/tooltip.ts +44 -0
  228. package/templates/hono-fullstack/libs/ui/src/theme/recipes/tree-view.ts +200 -0
  229. package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/colors/amber.ts +91 -0
  230. package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/colors/gray.ts +103 -0
  231. package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/colors/green.ts +88 -0
  232. package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/colors/index.ts +14 -0
  233. package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/colors/lime.ts +91 -0
  234. package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/colors/red.ts +88 -0
  235. package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/index.ts +8 -0
  236. package/templates/hono-fullstack/libs/ui/src/theme/semanticTokens/shadows.ts +46 -0
  237. package/templates/hono-fullstack/libs/ui/src/theme/text-styles.ts +82 -0
  238. package/templates/hono-fullstack/libs/ui/src/theme/tokens/animations.ts +8 -0
  239. package/templates/hono-fullstack/libs/ui/src/theme/tokens/aspect-ratio.ts +6 -0
  240. package/templates/hono-fullstack/libs/ui/src/theme/tokens/borders.ts +5 -0
  241. package/templates/hono-fullstack/libs/ui/src/theme/tokens/colors.ts +35 -0
  242. package/templates/hono-fullstack/libs/ui/src/theme/tokens/durations.ts +11 -0
  243. package/templates/hono-fullstack/libs/ui/src/theme/tokens/easings.ts +9 -0
  244. package/templates/hono-fullstack/libs/ui/src/theme/tokens/index.ts +42 -0
  245. package/templates/hono-fullstack/libs/ui/src/theme/tokens/radii.ts +13 -0
  246. package/templates/hono-fullstack/libs/ui/src/theme/tokens/sizes.ts +27 -0
  247. package/templates/hono-fullstack/libs/ui/src/theme/tokens/spacing.ts +41 -0
  248. package/templates/hono-fullstack/libs/ui/src/theme/tokens/typography.ts +86 -0
  249. package/templates/hono-fullstack/libs/ui/src/theme/tokens/z-index.ts +43 -0
  250. package/templates/hono-fullstack/libs/ui/stories/README.md +107 -0
  251. package/templates/hono-fullstack/libs/ui/stories/actions/Button.stories.tsx +260 -0
  252. package/templates/hono-fullstack/libs/ui/stories/actions/Clipboard.stories.tsx +87 -0
  253. package/templates/hono-fullstack/libs/ui/stories/actions/IconButton.stories.tsx +33 -0
  254. package/templates/hono-fullstack/libs/ui/stories/collections/Combobox.stories.tsx +334 -0
  255. package/templates/hono-fullstack/libs/ui/stories/collections/Select.stories.tsx +342 -0
  256. package/templates/hono-fullstack/libs/ui/stories/collections/TreeView.stories.tsx +252 -0
  257. package/templates/hono-fullstack/libs/ui/stories/color/ColorPicker.stories.tsx +217 -0
  258. package/templates/hono-fullstack/libs/ui/stories/date/DatePicker.stories.tsx +302 -0
  259. package/templates/hono-fullstack/libs/ui/stories/disclosure/Accordion.stories.tsx +105 -0
  260. package/templates/hono-fullstack/libs/ui/stories/disclosure/Collapsible.stories.tsx +55 -0
  261. package/templates/hono-fullstack/libs/ui/stories/disclosure/Steps.stories.tsx +208 -0
  262. package/templates/hono-fullstack/libs/ui/stories/disclosure/Tabs.stories.tsx +176 -0
  263. package/templates/hono-fullstack/libs/ui/stories/display/Avatar.stories.tsx +108 -0
  264. package/templates/hono-fullstack/libs/ui/stories/display/Badge.stories.tsx +90 -0
  265. package/templates/hono-fullstack/libs/ui/stories/display/Card.stories.tsx +121 -0
  266. package/templates/hono-fullstack/libs/ui/stories/display/Heading.stories.tsx +62 -0
  267. package/templates/hono-fullstack/libs/ui/stories/display/Icon.stories.tsx +51 -0
  268. package/templates/hono-fullstack/libs/ui/stories/display/Table.stories.tsx +222 -0
  269. package/templates/hono-fullstack/libs/ui/stories/display/Tag.stories.tsx +168 -0
  270. package/templates/hono-fullstack/libs/ui/stories/display/Text.stories.tsx +32 -0
  271. package/templates/hono-fullstack/libs/ui/stories/display/Timeline.stories.tsx +241 -0
  272. package/templates/hono-fullstack/libs/ui/stories/feedback/Alert.stories.tsx +122 -0
  273. package/templates/hono-fullstack/libs/ui/stories/feedback/Progress.stories.tsx +163 -0
  274. package/templates/hono-fullstack/libs/ui/stories/feedback/ProgressCircle.stories.tsx +176 -0
  275. package/templates/hono-fullstack/libs/ui/stories/feedback/Skeleton.stories.tsx +75 -0
  276. package/templates/hono-fullstack/libs/ui/stories/feedback/Spinner.stories.tsx +49 -0
  277. package/templates/hono-fullstack/libs/ui/stories/feedback/Toast.stories.tsx +145 -0
  278. package/templates/hono-fullstack/libs/ui/stories/forms/Checkbox.stories.tsx +281 -0
  279. package/templates/hono-fullstack/libs/ui/stories/forms/Editable.stories.tsx +94 -0
  280. package/templates/hono-fullstack/libs/ui/stories/forms/Field.stories.tsx +72 -0
  281. package/templates/hono-fullstack/libs/ui/stories/forms/Fieldset.stories.tsx +109 -0
  282. package/templates/hono-fullstack/libs/ui/stories/forms/FileUpload.stories.tsx +115 -0
  283. package/templates/hono-fullstack/libs/ui/stories/forms/Form.stories.tsx +120 -0
  284. package/templates/hono-fullstack/libs/ui/stories/forms/Input.stories.tsx +155 -0
  285. package/templates/hono-fullstack/libs/ui/stories/forms/InputGroup.stories.tsx +79 -0
  286. package/templates/hono-fullstack/libs/ui/stories/forms/NativeSelect.stories.tsx +160 -0
  287. package/templates/hono-fullstack/libs/ui/stories/forms/NumberInput.stories.tsx +149 -0
  288. package/templates/hono-fullstack/libs/ui/stories/forms/PasswordInput.stories.tsx +141 -0
  289. package/templates/hono-fullstack/libs/ui/stories/forms/PinInput.stories.tsx +155 -0
  290. package/templates/hono-fullstack/libs/ui/stories/forms/RadioCard.stories.tsx +265 -0
  291. package/templates/hono-fullstack/libs/ui/stories/forms/RadioGroup.stories.tsx +109 -0
  292. package/templates/hono-fullstack/libs/ui/stories/forms/RatingGroup.stories.tsx +123 -0
  293. package/templates/hono-fullstack/libs/ui/stories/forms/SegmentGroup.stories.tsx +130 -0
  294. package/templates/hono-fullstack/libs/ui/stories/forms/Slider.stories.tsx +190 -0
  295. package/templates/hono-fullstack/libs/ui/stories/forms/Switch.stories.tsx +124 -0
  296. package/templates/hono-fullstack/libs/ui/stories/forms/TagsInput.stories.tsx +154 -0
  297. package/templates/hono-fullstack/libs/ui/stories/forms/Textarea.stories.tsx +148 -0
  298. package/templates/hono-fullstack/libs/ui/stories/layout/Grid.stories.tsx +60 -0
  299. package/templates/hono-fullstack/libs/ui/stories/layout/Positioning.stories.tsx +90 -0
  300. package/templates/hono-fullstack/libs/ui/stories/layout/ScrollArea.stories.tsx +68 -0
  301. package/templates/hono-fullstack/libs/ui/stories/layout/Stack.stories.tsx +87 -0
  302. package/templates/hono-fullstack/libs/ui/stories/navigation/Breadcrumb.stories.tsx +104 -0
  303. package/templates/hono-fullstack/libs/ui/stories/navigation/Link.stories.tsx +62 -0
  304. package/templates/hono-fullstack/libs/ui/stories/navigation/LinkBox.stories.tsx +45 -0
  305. package/templates/hono-fullstack/libs/ui/stories/navigation/Pagination.stories.tsx +74 -0
  306. package/templates/hono-fullstack/libs/ui/stories/overlays/Dialog.stories.tsx +255 -0
  307. package/templates/hono-fullstack/libs/ui/stories/overlays/Drawer.stories.tsx +114 -0
  308. package/templates/hono-fullstack/libs/ui/stories/overlays/HoverCard.stories.tsx +47 -0
  309. package/templates/hono-fullstack/libs/ui/stories/overlays/Menu.stories.tsx +133 -0
  310. package/templates/hono-fullstack/libs/ui/stories/overlays/OverlayManager.stories.tsx +206 -0
  311. package/templates/hono-fullstack/libs/ui/stories/overlays/Popover.stories.tsx +73 -0
  312. package/templates/hono-fullstack/libs/ui/stories/overlays/Tooltip.stories.tsx +114 -0
  313. package/templates/hono-fullstack/libs/ui/stories/tsconfig.json +14 -0
  314. package/templates/hono-fullstack/libs/ui/tsconfig.build.json +5 -0
  315. package/templates/hono-fullstack/libs/ui/tsconfig.json +13 -0
  316. package/templates/hono-fullstack/libs/ui/turbo.json +28 -0
  317. package/templates/hono-fullstack/libs/ui/vite.config.ts +33 -0
  318. package/templates/hono-fullstack/oyo.config.json +31 -1
  319. package/templates/hono-fullstack/package.json +1 -0
  320. package/templates/hono-fullstack/pnpm-workspace.yaml +20 -10
  321. package/templates/hono-fullstack/turbo.json +10 -0
  322. package/templates/hono-server/.codegraph/.gitignore +5 -0
  323. package/templates/hono-server/README.md +9 -1
  324. package/templates/hono-server/_gitignore +1 -0
  325. package/templates/hono-server/apps/server/package.json +7 -2
  326. package/templates/hono-server/apps/server/src/adapters/cloudflare/entry.ts +4 -30
  327. package/templates/hono-server/apps/server/src/adapters/nodejs/bootstrap.ts +20 -12
  328. package/templates/hono-server/apps/server/src/adapters/nodejs/entry.ts +7 -57
  329. package/templates/hono-server/apps/server/src/app.ts +37 -21
  330. package/templates/hono-server/apps/server/src/config.ts +1 -1
  331. package/templates/hono-server/apps/server/src/di-container.ts +51 -0
  332. package/templates/hono-server/apps/server/src/infra/logger/getter.ts +1 -1
  333. package/templates/hono-server/apps/server/src/infra/logger/pino.ts +21 -34
  334. package/templates/hono-server/apps/server/src/infra/work-runner/errors.ts +22 -0
  335. package/templates/hono-server/apps/server/src/infra/work-runner/pass-through/runner.ts +28 -22
  336. package/templates/hono-server/apps/server/src/infra/work-runner/piscina/runner.ts +11 -34
  337. package/templates/hono-server/apps/server/src/infra/work-runner/{example → piscina}/worker-entry.ts +6 -2
  338. package/templates/hono-server/apps/server/src/infra/work-runner/types.ts +2 -16
  339. package/templates/hono-server/apps/server/src/infra/work-runner/utils/business-error.ts +10 -5
  340. package/templates/hono-server/apps/server/src/infra/work-runner/utils/message.ts +5 -17
  341. package/templates/hono-server/apps/server/src/middlewares/cors.ts +16 -22
  342. package/templates/hono-server/apps/server/src/middlewares/logger.ts +34 -0
  343. package/templates/hono-server/apps/server/src/modules/example/module.ts +8 -0
  344. package/templates/hono-server/apps/server/src/modules/example/queries.ts +8 -0
  345. package/templates/hono-server/apps/server/src/modules/example/routes.ts +74 -68
  346. package/templates/hono-server/apps/server/src/modules/example/service.test.ts +53 -0
  347. package/templates/hono-server/apps/server/src/modules/example/service.ts +54 -0
  348. package/templates/hono-server/apps/server/src/modules/example/types.ts +12 -0
  349. package/templates/hono-server/apps/server/src/modules/example/work-task/tasks.test.ts +9 -35
  350. package/templates/hono-server/apps/server/src/modules/example/work-task/tasks.ts +15 -46
  351. package/templates/hono-server/apps/server/src/shared/errors/defs/index.ts +6 -1
  352. package/templates/hono-server/apps/server/src/shared/errors/handler.ts +1 -1
  353. package/templates/hono-server/apps/server/src/shared/network/openapi/index.ts +1 -1
  354. package/templates/hono-server/apps/server/src/shared/types/app.ts +51 -0
  355. package/templates/hono-server/apps/server/src/shared/types/db.ts +126 -0
  356. package/templates/hono-server/apps/server/src/shared/utils/data-access/check.ts +19 -0
  357. package/templates/hono-server/apps/server/src/shared/utils/data-access/model.ts +47 -0
  358. package/templates/hono-server/apps/server/src/shared/utils/data-access/params.ts +105 -0
  359. package/templates/hono-server/apps/server/src/shared/utils/data-access/query.test.ts +139 -0
  360. package/templates/hono-server/apps/server/src/shared/utils/data-access/query.ts +236 -0
  361. package/templates/hono-server/apps/server/vite.config.ts +2 -2
  362. package/templates/hono-server/apps/server/wrangler.jsonc +1 -1
  363. package/templates/hono-server/docker/README.md +1 -1
  364. package/templates/hono-server/envs/.env.example.sqlite-d1 +1 -0
  365. package/templates/hono-server/libs/db/drizzle-kit/sqlite-d1.config.ts +29 -10
  366. package/templates/hono-server/libs/db/package.json +1 -0
  367. package/templates/hono-server/libs/db/src/dialects/sqlite/schema/columns.ts +1 -1
  368. package/templates/hono-server/libs/db/src/dialects/sqlite/schema/modules/examples/examples.ts +6 -3
  369. package/templates/hono-server/libs/db/src/dialects/sqlite/schema/vo.ts +7 -1
  370. package/templates/hono-server/libs/definition/README.md +81 -0
  371. package/templates/hono-server/libs/definition/package.json +3 -1
  372. package/templates/hono-server/libs/definition/src/constants/index.ts +1 -0
  373. package/templates/hono-server/libs/definition/src/constants/pagination.ts +3 -0
  374. package/templates/hono-server/libs/definition/src/modules/common-contracts.ts +24 -0
  375. package/templates/hono-server/libs/definition/src/modules/example/contracts.ts +34 -0
  376. package/templates/hono-server/libs/definition/src/modules/example/index.ts +1 -16
  377. package/templates/hono-server/libs/definition/src/modules/index.ts +2 -0
  378. package/templates/hono-server/libs/definition/src/modules/vo-generated-types.ts +12 -0
  379. package/templates/hono-server/oyo.config.json +31 -1
  380. package/templates/hono-server/package.json +1 -0
  381. package/templates/hono-server/pnpm-workspace.yaml +9 -7
  382. package/templates/hono-server/turbo.json +10 -0
  383. package/templates/monorepo/.codegraph/.gitignore +5 -0
  384. package/templates/monorepo/_gitignore +1 -0
  385. package/templates/monorepo/oyo.config.json +7 -1
  386. package/templates/monorepo/pnpm-workspace.yaml +4 -4
  387. package/templates/monorepo/turbo.json +10 -0
  388. package/templates/hono-fullstack/apps/server/src/modules/example/contracts.ts +0 -9
  389. package/templates/hono-fullstack/apps/server/src/shared/app/types.ts +0 -44
  390. package/templates/hono-fullstack/apps/stack/frontend/styles.css +0 -23
  391. package/templates/hono-server/apps/server/src/modules/example/contracts.ts +0 -9
  392. package/templates/hono-server/apps/server/src/shared/app/types.ts +0 -44
@@ -0,0 +1,114 @@
1
+ {
2
+ "name": "@repo/ui",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "description": "@repo/ui",
6
+ "files": [
7
+ "dist/react",
8
+ "dist/panda",
9
+ "styled-system"
10
+ ],
11
+ "type": "module",
12
+ "sideEffects": [
13
+ "**/*.css"
14
+ ],
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/react/src/index.d.mts",
18
+ "import": "./dist/react/src/index.mjs",
19
+ "default": "./dist/react/src/index.mjs"
20
+ },
21
+ "./tooltip": {
22
+ "types": "./dist/react/src/Tooltip.d.mts",
23
+ "import": "./dist/react/src/Tooltip.mjs",
24
+ "default": "./dist/react/src/Tooltip.mjs"
25
+ },
26
+ "./panda/*": "./dist/panda/*",
27
+ "./css": {
28
+ "types": "./styled-system/css/index.d.ts",
29
+ "default": "./styled-system/css/index.js"
30
+ },
31
+ "./css/*": {
32
+ "types": "./styled-system/css/*.d.ts",
33
+ "default": "./styled-system/css/*.js"
34
+ },
35
+ "./recipes": {
36
+ "types": "./styled-system/recipes/index.d.ts",
37
+ "default": "./styled-system/recipes/index.js"
38
+ },
39
+ "./recipes/*": {
40
+ "types": "./styled-system/recipes/*.d.ts",
41
+ "default": "./styled-system/recipes/*.js"
42
+ },
43
+ "./patterns": {
44
+ "types": "./styled-system/patterns/index.d.ts",
45
+ "default": "./styled-system/patterns/index.js"
46
+ },
47
+ "./patterns/*": {
48
+ "types": "./styled-system/patterns/*.d.ts",
49
+ "default": "./styled-system/patterns/*.js"
50
+ },
51
+ "./jsx": {
52
+ "types": "./styled-system/jsx/index.d.ts",
53
+ "default": "./styled-system/jsx/index.js"
54
+ },
55
+ "./jsx/*": {
56
+ "types": "./styled-system/jsx/*.d.ts",
57
+ "default": "./styled-system/jsx/*.js"
58
+ },
59
+ "./tokens": {
60
+ "types": "./styled-system/tokens/index.d.ts",
61
+ "default": "./styled-system/tokens/index.js"
62
+ },
63
+ "./helpers": {
64
+ "types": "./styled-system/helpers.d.ts",
65
+ "default": "./styled-system/helpers.js"
66
+ },
67
+ "./types": {
68
+ "types": "./styled-system/types/index.d.ts"
69
+ }
70
+ },
71
+ "publishConfig": {
72
+ "access": "public"
73
+ },
74
+ "scripts": {
75
+ "build": "panda codegen --clean && vp pack && panda lib --files './react/**/*.{js,mjs}'",
76
+ "build:codegen": "panda codegen --clean",
77
+ "build:react": "vp pack",
78
+ "build:dev": "panda lib --files './react/**/*.{js,mjs}'",
79
+ "dev": "panda codegen && vp pack --watch",
80
+ "dev:codegen": "panda codegen --watch",
81
+ "dev:panda": "panda codegen && panda lib --watch --files './react/**/*.{js,mjs}'",
82
+ "test": "vp test",
83
+ "check": "vp check",
84
+ "storybook": "storybook dev --port 6006 --no-open",
85
+ "storybook:check": "panda codegen --config .storybook/panda.config.ts && tsc --project stories/tsconfig.json --noEmit --incremental false",
86
+ "storybook:build": "vp run storybook:check && storybook build --output-dir storybook-static",
87
+ "prepublishOnly": "vp run build"
88
+ },
89
+ "dependencies": {
90
+ "@ark-ui/react": "catalog:frontend",
91
+ "lucide-react": "catalog:frontend"
92
+ },
93
+ "devDependencies": {
94
+ "@oyolincc/dev-config": "catalog:",
95
+ "@pandacss/dev": "catalog:frontend",
96
+ "@pandacss/preset-base": "catalog:frontend",
97
+ "@pandacss/vite": "catalog:frontend",
98
+ "@storybook/addon-docs": "catalog:frontend",
99
+ "@storybook/react-vite": "catalog:frontend",
100
+ "@types/node": "catalog:",
101
+ "@types/react": "catalog:frontend",
102
+ "@types/react-dom": "catalog:frontend",
103
+ "react": "catalog:frontend",
104
+ "react-dom": "catalog:frontend",
105
+ "storybook": "catalog:frontend",
106
+ "typescript": "catalog:",
107
+ "vite-plus": "catalog:"
108
+ },
109
+ "peerDependencies": {
110
+ "@pandacss/dev": "^2.0.0",
111
+ "react": ">=18",
112
+ "react-dom": ">=18"
113
+ }
114
+ }
@@ -0,0 +1,41 @@
1
+ import { animationStyles } from '@/theme/animation-styles'
2
+ import { breakpoints } from '@/theme/breakpoints'
3
+ import { textStyles } from '@/theme/text-styles'
4
+ import { layerStyles } from '@/theme/layer-styles'
5
+ import { keyframes } from '@/theme/keyframes'
6
+ import { globalCss } from '@/theme/global-css'
7
+ import { conditions } from '@/theme/conditions'
8
+ import { slotRecipes, recipes } from '@/theme/recipes'
9
+ import { defineConfig } from '@pandacss/dev'
10
+ import { patterns } from './src/theme/patterns'
11
+ import { containers } from './src/theme/containers'
12
+ import { tokens } from '@/theme/tokens'
13
+ import { semanticTokens } from '@/theme/semanticTokens'
14
+
15
+ export default defineConfig({
16
+ presets: ['@pandacss/preset-base'],
17
+ jsxFramework: 'react',
18
+ separator: '-',
19
+ include: ['./src/**/*.{js,jsx,ts,tsx}'],
20
+ exclude: [],
21
+ // strictTokens: true,
22
+ // strictPropertyValues: true,
23
+
24
+ theme: {
25
+ tokens,
26
+ semanticTokens,
27
+ animationStyles,
28
+ breakpoints,
29
+ recipes,
30
+ slotRecipes,
31
+ keyframes,
32
+ layerStyles,
33
+ textStyles,
34
+ containers,
35
+ },
36
+
37
+ patterns: { extend: patterns },
38
+ outdir: 'styled-system',
39
+ globalCss,
40
+ conditions,
41
+ })
@@ -0,0 +1,47 @@
1
+ 'use client'
2
+ import { Portal } from '@ark-ui/react/portal'
3
+ import { forwardRef } from 'react'
4
+ import * as TooltipParts from './components/atoms/overlays/Tooltip'
5
+
6
+ export interface TooltipProps extends Omit<TooltipParts.RootProps, 'content'> {
7
+ showArrow?: boolean
8
+ portalled?: boolean
9
+ portalRef?: React.RefObject<HTMLElement | null>
10
+ children: React.ReactNode | undefined
11
+ content: React.ReactNode | string
12
+ contentProps?: TooltipParts.ContentProps
13
+ disabled?: boolean
14
+ }
15
+
16
+ export const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(function Tooltip(props, ref) {
17
+ const {
18
+ showArrow,
19
+ children,
20
+ disabled,
21
+ portalled = true,
22
+ content,
23
+ contentProps,
24
+ portalRef,
25
+ ...rootProps
26
+ } = props
27
+
28
+ if (disabled) return children
29
+
30
+ return (
31
+ <TooltipParts.Root {...rootProps}>
32
+ <TooltipParts.Trigger asChild>{children}</TooltipParts.Trigger>
33
+ <Portal disabled={!portalled} container={portalRef}>
34
+ <TooltipParts.Positioner>
35
+ <TooltipParts.Content ref={ref} {...contentProps}>
36
+ {showArrow && (
37
+ <TooltipParts.Arrow>
38
+ <TooltipParts.ArrowTip />
39
+ </TooltipParts.Arrow>
40
+ )}
41
+ {content}
42
+ </TooltipParts.Content>
43
+ </TooltipParts.Positioner>
44
+ </Portal>
45
+ </TooltipParts.Root>
46
+ )
47
+ })
@@ -0,0 +1,80 @@
1
+ 'use client'
2
+ import { ark } from '@ark-ui/react/factory'
3
+ import { createContext, mergeProps } from '@ark-ui/react/utils'
4
+ import { type ComponentProps, forwardRef, useMemo } from 'react'
5
+ import { styled } from 'styled-system/jsx'
6
+ import { type ButtonVariantProps, button } from 'styled-system/recipes'
7
+ import { Group, type GroupProps } from '@/components/atoms/layout/Group'
8
+ import { Loader } from '@/components/atoms/internal/Loader'
9
+
10
+ interface ButtonLoadingProps {
11
+ /**
12
+ * If `true`, the button will show a loading spinner.
13
+ * @default false
14
+ */
15
+ loading?: boolean | undefined
16
+ /**
17
+ * The text to show while loading.
18
+ */
19
+ loadingText?: React.ReactNode | undefined
20
+ /**
21
+ * The spinner to show while loading.
22
+ */
23
+ spinner?: React.ReactNode | undefined
24
+ /**
25
+ * The placement of the spinner
26
+ * @default "start"
27
+ */
28
+ spinnerPlacement?: 'start' | 'end' | undefined
29
+ }
30
+
31
+ type BaseButtonProps = ComponentProps<typeof BaseButton>
32
+ const BaseButton = styled(ark.button, button)
33
+
34
+ export interface ButtonProps extends BaseButtonProps, ButtonLoadingProps {}
35
+
36
+ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(props, ref) {
37
+ const propsContext = useButtonPropsContext()
38
+ const buttonProps = useMemo(
39
+ () => mergeProps<ButtonProps>(propsContext, props),
40
+ [propsContext, props],
41
+ )
42
+
43
+ const { loading, loadingText, children, spinner, spinnerPlacement, ...rest } = buttonProps
44
+ return (
45
+ <BaseButton
46
+ type="button"
47
+ ref={ref}
48
+ {...rest}
49
+ data-loading={loading ? '' : undefined}
50
+ disabled={loading || rest.disabled}>
51
+ {!props.asChild && loading ? (
52
+ <Loader spinner={spinner} text={loadingText} spinnerPlacement={spinnerPlacement}>
53
+ {children}
54
+ </Loader>
55
+ ) : (
56
+ children
57
+ )}
58
+ </BaseButton>
59
+ )
60
+ })
61
+
62
+ export interface ButtonGroupProps extends GroupProps, ButtonVariantProps {}
63
+
64
+ export const ButtonGroup = forwardRef<HTMLDivElement, ButtonGroupProps>(
65
+ function ButtonGroup(props, ref) {
66
+ const [variantProps, otherProps] = useMemo(() => button.splitVariantProps(props), [props])
67
+ return (
68
+ <ButtonPropsProvider value={variantProps}>
69
+ <Group ref={ref} {...otherProps} />
70
+ </ButtonPropsProvider>
71
+ )
72
+ },
73
+ )
74
+
75
+ const [ButtonPropsProvider, useButtonPropsContext] = createContext<ButtonVariantProps>({
76
+ name: 'ButtonPropsContext',
77
+ hookName: 'useButtonPropsContext',
78
+ providerName: '<PropsProvider />',
79
+ strict: false,
80
+ })
@@ -0,0 +1,15 @@
1
+ import { XIcon } from 'lucide-react'
2
+ import { forwardRef } from 'react'
3
+ import { IconButton, type IconButtonProps } from './IconButton'
4
+
5
+ export type CloseButtonProps = IconButtonProps
6
+
7
+ export const CloseButton = forwardRef<HTMLButtonElement, CloseButtonProps>(
8
+ function CloseButton(props, ref) {
9
+ return (
10
+ <IconButton variant="plain" colorPalette="gray" aria-label="Close" ref={ref} {...props}>
11
+ {props.children ?? <XIcon />}
12
+ </IconButton>
13
+ )
14
+ },
15
+ )
@@ -0,0 +1,10 @@
1
+ import { forwardRef } from 'react'
2
+ import { Button, type ButtonProps } from './Button'
3
+
4
+ export interface IconButtonProps extends ButtonProps {}
5
+
6
+ export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(
7
+ function IconButton(props, ref) {
8
+ return <Button px="0" py="0" ref={ref} {...props} />
9
+ },
10
+ )
@@ -0,0 +1,91 @@
1
+ 'use client'
2
+ import type { Assign } from '@ark-ui/react'
3
+ import type { CollectionItem } from '@ark-ui/react/collection'
4
+ import {
5
+ Combobox,
6
+ type ComboboxRootProps,
7
+ type ComboboxRootProviderProps,
8
+ } from '@ark-ui/react/combobox'
9
+ import { ark } from '@ark-ui/react/factory'
10
+ import { CheckIcon, ChevronsUpDownIcon, XIcon } from 'lucide-react'
11
+ import { type ComponentProps, type RefAttributes } from 'react'
12
+ import { createSlotRecipeContext, type HTMLStyledProps } from 'styled-system/jsx'
13
+ import { type ComboboxVariantProps, combobox } from 'styled-system/recipes'
14
+
15
+ const { withProvider, withContext } = createSlotRecipeContext(combobox)
16
+
17
+ type StyleProps = HTMLStyledProps<'div'> & ComboboxVariantProps
18
+
19
+ export type RootProps<T extends CollectionItem = CollectionItem> = Assign<
20
+ ComboboxRootProps<T>,
21
+ StyleProps
22
+ > &
23
+ RefAttributes<HTMLDivElement>
24
+ export type RootProviderProps<T extends CollectionItem = CollectionItem> = Assign<
25
+ ComboboxRootProviderProps<T>,
26
+ StyleProps
27
+ > &
28
+ RefAttributes<HTMLDivElement>
29
+
30
+ export const Root = withProvider(Combobox.Root, 'root', {
31
+ defaultProps: { positioning: { sameWidth: false } },
32
+ }) as Combobox.RootComponent<StyleProps>
33
+
34
+ export const RootProvider = withProvider(
35
+ Combobox.RootProvider,
36
+ 'root',
37
+ ) as Combobox.RootProviderComponent<StyleProps>
38
+
39
+ export const ClearTrigger = withContext(Combobox.ClearTrigger, 'clearTrigger', {
40
+ defaultProps: { children: <XIcon /> },
41
+ })
42
+ export const Content = withContext(Combobox.Content, 'content')
43
+ export const Control = withContext(Combobox.Control, 'control')
44
+ export const Empty = withContext(Combobox.Empty, 'empty')
45
+ export const IndicatorGroup = withContext(ark.div, 'indicatorGroup')
46
+ export const Input = withContext(Combobox.Input, 'input')
47
+ export const Item = withContext(Combobox.Item, 'item')
48
+ export const ItemGroup = withContext(Combobox.ItemGroup, 'itemGroup')
49
+ export const ItemGroupLabel = withContext(Combobox.ItemGroupLabel, 'itemGroupLabel')
50
+ export const ItemText = withContext(Combobox.ItemText, 'itemText')
51
+ export const Label = withContext(Combobox.Label, 'label')
52
+ export const List = withContext(Combobox.List, 'list')
53
+ export const Positioner = withContext(Combobox.Positioner, 'positioner')
54
+ export const Trigger = withContext(Combobox.Trigger, 'trigger', {
55
+ defaultProps: { children: <ChevronsUpDownIcon /> },
56
+ })
57
+
58
+ export { ComboboxContext as Context } from '@ark-ui/react/combobox'
59
+
60
+ export const ItemIndicator = withContext(Combobox.ItemIndicator, 'itemIndicator', {
61
+ defaultProps: { children: <CheckIcon /> },
62
+ })
63
+
64
+ export type ClearTriggerProps = ComponentProps<typeof ClearTrigger>
65
+ export type ContentProps = ComponentProps<typeof Content>
66
+ export type ControlProps = ComponentProps<typeof Control>
67
+ export type EmptyProps = ComponentProps<typeof Empty>
68
+ export type IndicatorGroupProps = ComponentProps<typeof IndicatorGroup>
69
+ export type InputProps = ComponentProps<typeof Input>
70
+ export type ItemProps = ComponentProps<typeof Item>
71
+ export type ItemGroupProps = ComponentProps<typeof ItemGroup>
72
+ export type ItemGroupLabelProps = ComponentProps<typeof ItemGroupLabel>
73
+ export type ItemTextProps = ComponentProps<typeof ItemText>
74
+ export type LabelProps = ComponentProps<typeof Label>
75
+ export type ListProps = ComponentProps<typeof List>
76
+ export type PositionerProps = ComponentProps<typeof Positioner>
77
+ export type TriggerProps = ComponentProps<typeof Trigger>
78
+ export type ItemIndicatorProps = ComponentProps<typeof ItemIndicator>
79
+
80
+ export {
81
+ useCombobox,
82
+ useComboboxContext,
83
+ useComboboxItemContext,
84
+ type UseComboboxProps,
85
+ type UseComboboxReturn,
86
+ type ComboboxHighlightChangeDetails as HighlightChangeDetails,
87
+ type ComboboxInputValueChangeDetails as InputValueChangeDetails,
88
+ type ComboboxOpenChangeDetails as OpenChangeDetails,
89
+ type ComboboxSelectionDetails as SelectionDetails,
90
+ type ComboboxValueChangeDetails as ValueChangeDetails,
91
+ } from '@ark-ui/react/combobox'
@@ -0,0 +1,88 @@
1
+ 'use client'
2
+ import type { Assign } from '@ark-ui/react'
3
+ import type { CollectionItem } from '@ark-ui/react/collection'
4
+ import { ark } from '@ark-ui/react/factory'
5
+ import { Select, type SelectRootProps, type SelectRootProviderProps } from '@ark-ui/react/select'
6
+ import { CheckIcon, ChevronsUpDownIcon } from 'lucide-react'
7
+ import { type ComponentProps, type RefAttributes } from 'react'
8
+ import { createSlotRecipeContext } from 'styled-system/jsx'
9
+ import { type SelectVariantProps, select } from 'styled-system/recipes'
10
+ import type { HTMLStyledProps } from 'styled-system/types'
11
+
12
+ const { withProvider, withContext } = createSlotRecipeContext(select)
13
+
14
+ type StyleProps = SelectVariantProps & HTMLStyledProps<'div'>
15
+
16
+ export type RootProps<T extends CollectionItem = CollectionItem> = Assign<
17
+ SelectRootProps<T>,
18
+ StyleProps
19
+ > &
20
+ RefAttributes<HTMLDivElement>
21
+ export type RootProviderProps<T extends CollectionItem = CollectionItem> = Assign<
22
+ SelectRootProviderProps<T>,
23
+ StyleProps
24
+ > &
25
+ RefAttributes<HTMLDivElement>
26
+
27
+ export const Root = withProvider(Select.Root, 'root') as Select.RootComponent<StyleProps>
28
+ export const RootProvider = withProvider(
29
+ Select.RootProvider,
30
+ 'root',
31
+ ) as Select.RootProviderComponent<StyleProps>
32
+
33
+ export const ClearTrigger = withContext(Select.ClearTrigger, 'clearTrigger')
34
+ export const Content = withContext(Select.Content, 'content')
35
+ export const Control = withContext(Select.Control, 'control')
36
+ export const IndicatorGroup = withContext(ark.div, 'indicatorGroup')
37
+ export const Item = withContext(Select.Item, 'item')
38
+ export const ItemGroup = withContext(Select.ItemGroup, 'itemGroup')
39
+ export const ItemGroupLabel = withContext(Select.ItemGroupLabel, 'itemGroupLabel')
40
+ export const ItemText = withContext(Select.ItemText, 'itemText')
41
+ export const Label = withContext(Select.Label, 'label')
42
+ export const List = withContext(Select.List, 'list')
43
+ export const Positioner = withContext(Select.Positioner, 'positioner')
44
+ export const Trigger = withContext(Select.Trigger, 'trigger')
45
+ export const ValueText = withContext(Select.ValueText, 'valueText')
46
+ export const Indicator = withContext(Select.Indicator, 'indicator', {
47
+ defaultProps: { children: <ChevronsUpDownIcon /> },
48
+ })
49
+ export const HiddenSelect = Select.HiddenSelect
50
+
51
+ export {
52
+ SelectContext as Context,
53
+ SelectItemContext as ItemContext,
54
+ type SelectValueChangeDetails as ValueChangeDetails,
55
+ } from '@ark-ui/react/select'
56
+
57
+ export const ItemIndicator = withContext(Select.ItemIndicator, 'itemIndicator', {
58
+ defaultProps: { children: <CheckIcon /> },
59
+ })
60
+
61
+ export type ClearTriggerProps = ComponentProps<typeof ClearTrigger>
62
+ export type ContentProps = ComponentProps<typeof Content>
63
+ export type ControlProps = ComponentProps<typeof Control>
64
+ export type IndicatorGroupProps = ComponentProps<typeof IndicatorGroup>
65
+ export type ItemProps = ComponentProps<typeof Item>
66
+ export type ItemGroupProps = ComponentProps<typeof ItemGroup>
67
+ export type ItemGroupLabelProps = ComponentProps<typeof ItemGroupLabel>
68
+ export type ItemTextProps = ComponentProps<typeof ItemText>
69
+ export type LabelProps = ComponentProps<typeof Label>
70
+ export type ListProps = ComponentProps<typeof List>
71
+ export type PositionerProps = ComponentProps<typeof Positioner>
72
+ export type TriggerProps = ComponentProps<typeof Trigger>
73
+ export type ValueTextProps = ComponentProps<typeof ValueText>
74
+ export type IndicatorProps = ComponentProps<typeof Indicator>
75
+ export type HiddenSelectProps = ComponentProps<typeof HiddenSelect>
76
+ export type ItemIndicatorProps = ComponentProps<typeof ItemIndicator>
77
+
78
+ export {
79
+ useSelect,
80
+ useSelectContext,
81
+ useSelectItemContext,
82
+ type UseSelectProps,
83
+ type UseSelectReturn,
84
+ type SelectHighlightChangeDetails as HighlightChangeDetails,
85
+ type SelectOpenChangeDetails as OpenChangeDetails,
86
+ type SelectScrollToIndexDetails as ScrollToIndexDetails,
87
+ type SelectSelectionDetails as SelectionDetails,
88
+ } from '@ark-ui/react/select'
@@ -0,0 +1,142 @@
1
+ 'use client'
2
+ import { TreeView, useTreeViewContext } from '@ark-ui/react/tree-view'
3
+ import type { TreeNode } from '@ark-ui/react/collection'
4
+ import { CheckIcon, ChevronRightIcon, MinusIcon } from 'lucide-react'
5
+ import type { ComponentProps, JSX, Provider, ReactElement, ReactNode, RefAttributes } from 'react'
6
+ import { createSlotRecipeContext } from 'styled-system/jsx'
7
+ import { treeView, type TreeViewVariantProps } from 'styled-system/recipes'
8
+ import type { AsProps, JsxHTMLProps, JsxStyleProps, UnstyledProps } from 'styled-system/types'
9
+
10
+ const {
11
+ withProvider,
12
+ withContext,
13
+ PropsProvider: TreePropsProvider,
14
+ } = createSlotRecipeContext(treeView)
15
+
16
+ export type RootProps<T extends TreeNode = TreeNode> = JsxHTMLProps<
17
+ TreeView.RootProps<T> & RefAttributes<HTMLDivElement> & AsProps & UnstyledProps,
18
+ JsxStyleProps & TreeViewVariantProps
19
+ >
20
+ export type RootProviderProps<T extends TreeNode = TreeNode> = JsxHTMLProps<
21
+ TreeView.RootProviderProps<T> & RefAttributes<HTMLDivElement> & AsProps & UnstyledProps,
22
+ JsxStyleProps & TreeViewVariantProps
23
+ >
24
+ export const Root = withProvider(TreeView.Root, 'root') as <T extends TreeNode>(
25
+ props: RootProps<T>,
26
+ ) => JSX.Element
27
+ export const RootProvider = withProvider(TreeView.RootProvider, 'root') as <T extends TreeNode>(
28
+ props: RootProviderProps<T>,
29
+ ) => JSX.Element
30
+ export const PropsProvider = TreePropsProvider as Provider<Partial<RootProps>>
31
+ export const Branch = withContext(TreeView.Branch, 'branch')
32
+ export const BranchContent = withContext(TreeView.BranchContent, 'branchContent')
33
+ export const BranchControl = withContext(TreeView.BranchControl, 'branchControl')
34
+ export const BranchTrigger = withContext(TreeView.BranchTrigger, 'branchTrigger')
35
+ export const BranchText = withContext(TreeView.BranchText, 'branchText')
36
+ export const BranchIndentGuide = withContext(TreeView.BranchIndentGuide, 'branchIndentGuide')
37
+ export const Item = withContext(TreeView.Item, 'item')
38
+ export const ItemText = withContext(TreeView.ItemText, 'itemText')
39
+ export const Label = withContext(TreeView.Label, 'label')
40
+ export const Tree = withContext(TreeView.Tree, 'tree')
41
+ export const NodeRenameInput = withContext(TreeView.NodeRenameInput, 'nodeRenameInput')
42
+ export const BranchIndicator = withContext(TreeView.BranchIndicator, 'branchIndicator', {
43
+ defaultProps: { children: <ChevronRightIcon /> },
44
+ })
45
+ export const ItemIndicator = withContext(TreeView.ItemIndicator, 'itemIndicator', {
46
+ defaultProps: { children: <CheckIcon /> },
47
+ })
48
+ export const NodeCheckbox = withContext(TreeView.NodeCheckbox, 'nodeCheckbox', {
49
+ defaultProps: {
50
+ children: (
51
+ <TreeView.NodeCheckboxIndicator indeterminate={<MinusIcon />}>
52
+ <CheckIcon />
53
+ </TreeView.NodeCheckboxIndicator>
54
+ ),
55
+ },
56
+ })
57
+
58
+ export interface NodeRenderProps<T = TreeNode> {
59
+ node: T
60
+ indexPath: number[]
61
+ nodeState: TreeView.NodeState
62
+ }
63
+ export interface NodeProps<T = TreeNode> {
64
+ render: (props: NodeRenderProps<T>) => ReactNode
65
+ renderBranch?: (props: NodeRenderProps<T>) => ReactNode
66
+ indentGuide?: ReactElement
67
+ branchProps?: BranchProps
68
+ branchContentProps?: BranchContentProps
69
+ }
70
+ export function Node<T extends TreeNode = TreeNode>({
71
+ render,
72
+ renderBranch,
73
+ indentGuide,
74
+ branchProps,
75
+ branchContentProps,
76
+ }: NodeProps<T>): ReactNode {
77
+ const tree = useTreeViewContext()
78
+ const renderNode = (node: T, indexPath: number[]): ReactNode => (
79
+ <TreeView.NodeProvider
80
+ key={tree.collection.getNodeValue(node)}
81
+ node={node}
82
+ indexPath={indexPath}>
83
+ <TreeView.NodeContext>
84
+ {(nodeState) => {
85
+ const props = { node, indexPath, nodeState }
86
+ if (!nodeState.isBranch) return render(props)
87
+ return (
88
+ <Branch {...branchProps}>
89
+ {(renderBranch || render)(props)}
90
+ <BranchContent {...branchContentProps}>
91
+ {indentGuide}
92
+ {tree.collection
93
+ .getNodeChildren(node)
94
+ .map((child: T, index: number) => renderNode(child, [...indexPath, index]))}
95
+ </BranchContent>
96
+ </Branch>
97
+ )
98
+ }}
99
+ </TreeView.NodeContext>
100
+ </TreeView.NodeProvider>
101
+ )
102
+ return tree.collection
103
+ .getNodeChildren(tree.collection.rootNode)
104
+ .map((node: T, index: number) => renderNode(node, [index]))
105
+ }
106
+ export type BranchProps = ComponentProps<typeof Branch>
107
+ export type BranchContentProps = ComponentProps<typeof BranchContent>
108
+ export type BranchControlProps = ComponentProps<typeof BranchControl>
109
+ export type BranchTriggerProps = ComponentProps<typeof BranchTrigger>
110
+ export type BranchTextProps = ComponentProps<typeof BranchText>
111
+ export type BranchIndentGuideProps = ComponentProps<typeof BranchIndentGuide>
112
+ export type ItemProps = ComponentProps<typeof Item>
113
+ export type ItemTextProps = ComponentProps<typeof ItemText>
114
+ export type LabelProps = ComponentProps<typeof Label>
115
+ export type TreeProps = ComponentProps<typeof Tree>
116
+ export type NodeRenameInputProps = ComponentProps<typeof NodeRenameInput>
117
+ export type BranchIndicatorProps = ComponentProps<typeof BranchIndicator>
118
+ export type ItemIndicatorProps = ComponentProps<typeof ItemIndicator>
119
+ export type NodeCheckboxProps = ComponentProps<typeof NodeCheckbox>
120
+ export {
121
+ TreeViewContext as Context,
122
+ TreeViewNodeContext as NodeContext,
123
+ TreeViewNodeProvider as NodeProvider,
124
+ TreeViewNodeCheckboxIndicator as NodeCheckboxIndicator,
125
+ useTreeView,
126
+ useTreeViewContext,
127
+ useTreeViewNodeContext,
128
+ type UseTreeViewProps,
129
+ type UseTreeViewReturn,
130
+ } from '@ark-ui/react/tree-view'
131
+ export type {
132
+ TreeViewExpandedChangeDetails as ExpandedChangeDetails,
133
+ TreeViewSelectionChangeDetails as SelectionChangeDetails,
134
+ TreeViewCheckedChangeDetails as CheckedChangeDetails,
135
+ TreeViewFocusChangeDetails as FocusChangeDetails,
136
+ TreeViewLoadChildrenDetails as LoadChildrenDetails,
137
+ TreeViewLoadChildrenCompleteDetails as LoadChildrenCompleteDetails,
138
+ TreeViewLoadChildrenErrorDetails as LoadChildrenErrorDetails,
139
+ TreeViewRenameStartDetails as RenameStartDetails,
140
+ TreeViewRenameCompleteDetails as RenameCompleteDetails,
141
+ TreeViewNodeState as NodeState,
142
+ } from '@ark-ui/react/tree-view'