@k8ordo/ui 1.0.0 → 2.1.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 (651) hide show
  1. package/README.md +206 -171
  2. package/dist/_virtual/_rolldown/runtime.mjs +13 -0
  3. package/dist/components/_internal/focus-ring.css +37 -0
  4. package/dist/components/_internal/focus-ring.module.mjs +9 -0
  5. package/dist/components/_internal/form-value.d.mts +33 -0
  6. package/dist/components/_internal/form-value.mjs +91 -0
  7. package/dist/components/_internal/high-contrast.css +18 -0
  8. package/dist/components/_internal/high-contrast.module.mjs +5 -0
  9. package/dist/components/_internal/ignore-changes.d.mts +20 -0
  10. package/dist/components/_internal/ignore-changes.mjs +37 -0
  11. package/dist/components/_internal/nav-link.css +78 -0
  12. package/dist/components/_internal/nav-link.d.mts +5 -0
  13. package/dist/components/_internal/nav-link.mjs +8 -0
  14. package/dist/components/_internal/nav-link.module.mjs +14 -0
  15. package/dist/components/_internal/sr-only.css +17 -0
  16. package/dist/components/_internal/sr-only.module.mjs +5 -0
  17. package/dist/components/_internal/status-tone.css +37 -0
  18. package/dist/components/_internal/status-tone.d.mts +20 -0
  19. package/dist/components/_internal/status-tone.mjs +22 -0
  20. package/dist/components/_internal/status-tone.module.mjs +14 -0
  21. package/dist/components/ai/_internal/attachment-preview.css +75 -0
  22. package/dist/components/ai/_internal/attachment-preview.d.mts +14 -0
  23. package/dist/components/ai/_internal/attachment-preview.mjs +50 -0
  24. package/dist/components/ai/_internal/attachment-preview.module.mjs +14 -0
  25. package/dist/components/ai/_internal/collapsible.css +62 -0
  26. package/dist/components/ai/_internal/collapsible.d.mts +4 -3
  27. package/dist/components/ai/_internal/collapsible.mjs +42 -33
  28. package/dist/components/ai/_internal/collapsible.module.mjs +12 -0
  29. package/dist/components/ai/_internal/icons.d.mts +7 -0
  30. package/dist/components/ai/_internal/icons.mjs +14 -0
  31. package/dist/components/ai/_internal/streaming-cursor.css +28 -0
  32. package/dist/components/ai/_internal/streaming-cursor.d.mts +2 -3
  33. package/dist/components/ai/_internal/streaming-cursor.mjs +2 -1
  34. package/dist/components/ai/_internal/streaming-cursor.module.mjs +8 -0
  35. package/dist/components/ai/attachment/attachment.css +17 -0
  36. package/dist/components/ai/attachment/attachment.d.mts +14 -0
  37. package/dist/components/ai/attachment/attachment.mjs +25 -0
  38. package/dist/components/ai/attachment/attachment.module.mjs +8 -0
  39. package/dist/components/ai/attachment/index.d.mts +13 -0
  40. package/dist/components/ai/attachment/index.mjs +8 -0
  41. package/dist/components/ai/conversation/conversation.css +71 -0
  42. package/dist/components/ai/conversation/conversation.d.mts +8 -11
  43. package/dist/components/ai/conversation/conversation.mjs +39 -40
  44. package/dist/components/ai/conversation/conversation.module.mjs +11 -0
  45. package/dist/components/ai/conversation/index.d.mts +15 -2
  46. package/dist/components/ai/conversation/index.mjs +8 -1
  47. package/dist/components/ai/index.d.mts +8 -10
  48. package/dist/components/ai/index.mjs +7 -5
  49. package/dist/components/ai/message/index.d.mts +39 -2
  50. package/dist/components/ai/message/index.mjs +12 -1
  51. package/dist/components/ai/message/message.css +71 -0
  52. package/dist/components/ai/message/message.d.mts +33 -5
  53. package/dist/components/ai/message/message.mjs +98 -12
  54. package/dist/components/ai/message/message.module.mjs +18 -0
  55. package/dist/components/ai/prompt-input/index.d.mts +31 -2
  56. package/dist/components/ai/prompt-input/index.mjs +10 -1
  57. package/dist/components/ai/prompt-input/prompt-input.css +101 -0
  58. package/dist/components/ai/prompt-input/prompt-input.d.mts +15 -8
  59. package/dist/components/ai/prompt-input/prompt-input.mjs +152 -42
  60. package/dist/components/ai/prompt-input/prompt-input.module.mjs +15 -0
  61. package/dist/components/ai/reasoning/reasoning.css +16 -0
  62. package/dist/components/ai/reasoning/reasoning.d.mts +2 -3
  63. package/dist/components/ai/reasoning/reasoning.mjs +5 -5
  64. package/dist/components/ai/reasoning/reasoning.module.mjs +8 -0
  65. package/dist/components/ai/response/response.css +453 -0
  66. package/dist/components/ai/response/response.d.mts +4 -6
  67. package/dist/components/ai/response/response.mjs +20 -15
  68. package/dist/components/ai/response/response.module.mjs +8 -0
  69. package/dist/components/ai/source/index.d.mts +12 -0
  70. package/dist/components/ai/source/index.mjs +8 -0
  71. package/dist/components/ai/source/source.css +54 -0
  72. package/dist/components/ai/source/source.d.mts +13 -0
  73. package/dist/components/ai/source/source.mjs +51 -0
  74. package/dist/components/ai/source/source.module.mjs +12 -0
  75. package/dist/components/ai/suggestion/index.d.mts +13 -2
  76. package/dist/components/ai/suggestion/index.mjs +7 -1
  77. package/dist/components/ai/suggestion/suggestion.css +32 -0
  78. package/dist/components/ai/suggestion/suggestion.d.mts +3 -6
  79. package/dist/components/ai/suggestion/suggestion.mjs +8 -11
  80. package/dist/components/ai/suggestion/suggestion.module.mjs +8 -0
  81. package/dist/components/ai/tool-invocation/approval-bar.css +26 -0
  82. package/dist/components/ai/tool-invocation/approval-bar.d.mts +11 -0
  83. package/dist/components/ai/tool-invocation/approval-bar.mjs +59 -0
  84. package/dist/components/ai/tool-invocation/approval-bar.module.mjs +9 -0
  85. package/dist/components/ai/tool-invocation/tool-invocation.css +55 -0
  86. package/dist/components/ai/tool-invocation/tool-invocation.d.mts +5 -5
  87. package/dist/components/ai/tool-invocation/tool-invocation.mjs +39 -18
  88. package/dist/components/ai/tool-invocation/tool-invocation.module.mjs +15 -0
  89. package/dist/components/ai/types.d.mts +21 -4
  90. package/dist/components/buttons/button/button.css +158 -0
  91. package/dist/components/buttons/button/button.d.mts +32 -9
  92. package/dist/components/buttons/button/button.mjs +46 -36
  93. package/dist/components/buttons/button/button.module.mjs +23 -0
  94. package/dist/components/buttons/button/index.d.mts +2 -2
  95. package/dist/components/buttons/copy-button/copy-button.css +15 -0
  96. package/dist/components/buttons/copy-button/copy-button.d.mts +10 -0
  97. package/dist/components/buttons/copy-button/copy-button.mjs +70 -0
  98. package/dist/components/buttons/copy-button/copy-button.module.mjs +8 -0
  99. package/dist/components/buttons/copy-button/index.d.mts +2 -0
  100. package/dist/components/buttons/copy-button/index.mjs +2 -0
  101. package/dist/components/buttons/icon-button/icon-button.css +81 -0
  102. package/dist/components/buttons/icon-button/icon-button.d.mts +39 -12
  103. package/dist/components/buttons/icon-button/icon-button.mjs +71 -58
  104. package/dist/components/buttons/icon-button/icon-button.module.mjs +15 -0
  105. package/dist/components/buttons/icon-button/index.d.mts +2 -2
  106. package/dist/components/buttons/toolbar/index.d.mts +14 -0
  107. package/dist/components/buttons/toolbar/index.mjs +9 -0
  108. package/dist/components/buttons/toolbar/toolbar.css +30 -0
  109. package/dist/components/buttons/toolbar/toolbar.d.mts +18 -0
  110. package/dist/components/buttons/toolbar/toolbar.mjs +111 -0
  111. package/dist/components/buttons/toolbar/toolbar.module.mjs +9 -0
  112. package/dist/components/data-display/accordion/accordion-button.css +48 -0
  113. package/dist/components/data-display/accordion/accordion-button.d.mts +2 -3
  114. package/dist/components/data-display/accordion/accordion-button.mjs +5 -4
  115. package/dist/components/data-display/accordion/accordion-button.module.mjs +9 -0
  116. package/dist/components/data-display/accordion/accordion-item.css +11 -0
  117. package/dist/components/data-display/accordion/accordion-item.d.mts +2 -3
  118. package/dist/components/data-display/accordion/accordion-item.mjs +2 -1
  119. package/dist/components/data-display/accordion/accordion-item.module.mjs +5 -0
  120. package/dist/components/data-display/accordion/accordion-panel.css +9 -0
  121. package/dist/components/data-display/accordion/accordion-panel.d.mts +2 -3
  122. package/dist/components/data-display/accordion/accordion-panel.mjs +2 -2
  123. package/dist/components/data-display/accordion/accordion-panel.module.mjs +5 -0
  124. package/dist/components/data-display/accordion/accordion.css +19 -0
  125. package/dist/components/data-display/accordion/accordion.d.mts +2 -3
  126. package/dist/components/data-display/accordion/accordion.mjs +2 -1
  127. package/dist/components/data-display/accordion/accordion.module.mjs +5 -0
  128. package/dist/components/data-display/accordion/context.d.mts +3 -3
  129. package/dist/components/data-display/accordion/index.d.mts +2 -3
  130. package/dist/components/data-display/avatar/avatar.css +95 -0
  131. package/dist/components/data-display/avatar/avatar.d.mts +2 -3
  132. package/dist/components/data-display/avatar/avatar.mjs +22 -6
  133. package/dist/components/data-display/avatar/avatar.module.mjs +18 -0
  134. package/dist/components/data-display/badge/badge.css +160 -0
  135. package/dist/components/data-display/badge/badge.d.mts +2 -3
  136. package/dist/components/data-display/badge/badge.mjs +30 -5
  137. package/dist/components/data-display/badge/badge.module.mjs +21 -0
  138. package/dist/components/data-display/card/card.css +44 -0
  139. package/dist/components/data-display/card/card.d.mts +2 -3
  140. package/dist/components/data-display/card/card.mjs +12 -2
  141. package/dist/components/data-display/card/card.module.mjs +12 -0
  142. package/dist/components/data-display/carousel/carousel.css +83 -0
  143. package/dist/components/data-display/carousel/carousel.d.mts +11 -0
  144. package/dist/components/data-display/carousel/carousel.mjs +186 -0
  145. package/dist/components/data-display/carousel/carousel.module.mjs +18 -0
  146. package/dist/components/data-display/carousel/index.d.mts +11 -0
  147. package/dist/components/data-display/carousel/index.mjs +8 -0
  148. package/dist/components/data-display/code/code.css +37 -0
  149. package/dist/components/data-display/code/code.d.mts +2 -3
  150. package/dist/components/data-display/code/code.mjs +7 -6
  151. package/dist/components/data-display/code/code.module.mjs +9 -0
  152. package/dist/components/data-display/code/find-all-colors.d.mts +2 -3
  153. package/dist/components/data-display/code/find-all-colors.mjs +0 -161
  154. package/dist/components/data-display/code-block/code-block.css +161 -0
  155. package/dist/components/data-display/code-block/code-block.d.mts +12 -0
  156. package/dist/components/data-display/code-block/code-block.mjs +44 -0
  157. package/dist/components/data-display/code-block/code-block.module.mjs +11 -0
  158. package/dist/components/data-display/code-block/highlight.d.mts +9 -0
  159. package/dist/components/data-display/code-block/highlight.mjs +54 -0
  160. package/dist/components/data-display/code-block/index.d.mts +2 -0
  161. package/dist/components/data-display/code-block/index.mjs +2 -0
  162. package/dist/components/data-display/data-table/data-table.css +74 -0
  163. package/dist/components/data-display/data-table/data-table.d.mts +31 -0
  164. package/dist/components/data-display/data-table/data-table.mjs +155 -0
  165. package/dist/components/data-display/data-table/data-table.module.mjs +14 -0
  166. package/dist/components/data-display/data-table/index.d.mts +2 -0
  167. package/dist/components/data-display/data-table/index.mjs +2 -0
  168. package/dist/components/data-display/heading/heading.css +99 -0
  169. package/dist/components/data-display/heading/heading.d.mts +2 -3
  170. package/dist/components/data-display/heading/heading.mjs +15 -14
  171. package/dist/components/data-display/heading/heading.module.mjs +20 -0
  172. package/dist/components/data-display/kbd/index.d.mts +2 -0
  173. package/dist/components/data-display/kbd/index.mjs +2 -0
  174. package/dist/components/data-display/kbd/kbd.css +21 -0
  175. package/dist/components/data-display/kbd/kbd.d.mts +8 -0
  176. package/dist/components/data-display/kbd/kbd.mjs +17 -0
  177. package/dist/components/data-display/kbd/kbd.module.mjs +5 -0
  178. package/dist/components/data-display/prose/index.d.mts +2 -0
  179. package/dist/components/data-display/prose/index.mjs +2 -0
  180. package/dist/components/data-display/prose/prose.css +253 -0
  181. package/dist/components/data-display/prose/prose.d.mts +5 -0
  182. package/dist/components/data-display/prose/prose.mjs +10 -0
  183. package/dist/components/data-display/prose/prose.module.mjs +5 -0
  184. package/dist/components/data-display/table/table.css +107 -0
  185. package/dist/components/data-display/table/table.d.mts +10 -9
  186. package/dist/components/data-display/table/table.mjs +26 -15
  187. package/dist/components/data-display/table/table.module.mjs +22 -0
  188. package/dist/components/data-display/tree/index.d.mts +2 -0
  189. package/dist/components/data-display/tree/index.mjs +2 -0
  190. package/dist/components/data-display/tree/tree.css +84 -0
  191. package/dist/components/data-display/tree/tree.d.mts +20 -0
  192. package/dist/components/data-display/tree/tree.mjs +151 -0
  193. package/dist/components/data-display/tree/tree.module.mjs +15 -0
  194. package/dist/components/feedback/alert/alert.css +42 -0
  195. package/dist/components/feedback/alert/alert.d.mts +3 -4
  196. package/dist/components/feedback/alert/alert.mjs +20 -23
  197. package/dist/components/feedback/alert/alert.module.mjs +14 -0
  198. package/dist/components/feedback/callout/callout.css +38 -0
  199. package/dist/components/feedback/callout/callout.d.mts +10 -0
  200. package/dist/components/feedback/callout/callout.mjs +38 -0
  201. package/dist/components/feedback/callout/callout.module.mjs +11 -0
  202. package/dist/components/feedback/callout/index.d.mts +2 -0
  203. package/dist/components/feedback/callout/index.mjs +2 -0
  204. package/dist/components/feedback/empty-state/empty-state.css +36 -0
  205. package/dist/components/feedback/empty-state/empty-state.d.mts +10 -0
  206. package/dist/components/feedback/empty-state/empty-state.mjs +27 -0
  207. package/dist/components/feedback/empty-state/empty-state.module.mjs +11 -0
  208. package/dist/components/feedback/empty-state/index.d.mts +2 -0
  209. package/dist/components/feedback/empty-state/index.mjs +2 -0
  210. package/dist/components/feedback/progress/progress.css +78 -0
  211. package/dist/components/feedback/progress/progress.d.mts +5 -5
  212. package/dist/components/feedback/progress/progress.mjs +17 -3
  213. package/dist/components/feedback/progress/progress.module.mjs +12 -0
  214. package/dist/components/feedback/skeleton/skeleton.css +64 -0
  215. package/dist/components/feedback/skeleton/skeleton.d.mts +2 -3
  216. package/dist/components/feedback/skeleton/skeleton.mjs +19 -2
  217. package/dist/components/feedback/skeleton/skeleton.module.mjs +17 -0
  218. package/dist/components/feedback/spinner/spinner.css +40 -0
  219. package/dist/components/feedback/spinner/spinner.d.mts +2 -3
  220. package/dist/components/feedback/spinner/spinner.mjs +13 -7
  221. package/dist/components/feedback/spinner/spinner.module.mjs +12 -0
  222. package/dist/components/feedback/toast/context.d.mts +8 -9
  223. package/dist/components/feedback/toast/provider.css +69 -0
  224. package/dist/components/feedback/toast/provider.d.mts +2 -3
  225. package/dist/components/feedback/toast/provider.mjs +17 -13
  226. package/dist/components/feedback/toast/provider.module.mjs +12 -0
  227. package/dist/components/feedback/toast/toast.d.mts +2 -3
  228. package/dist/components/form/autocomplete/autocomplete.css +154 -0
  229. package/dist/components/form/autocomplete/autocomplete.d.mts +2 -3
  230. package/dist/components/form/autocomplete/autocomplete.mjs +70 -46
  231. package/dist/components/form/autocomplete/autocomplete.module.mjs +21 -0
  232. package/dist/components/form/calendar/calendar.css +98 -0
  233. package/dist/components/form/calendar/calendar.d.mts +14 -0
  234. package/dist/components/form/calendar/calendar.mjs +182 -0
  235. package/dist/components/form/calendar/calendar.module.mjs +18 -0
  236. package/dist/components/form/calendar/index.d.mts +2 -0
  237. package/dist/components/form/calendar/index.mjs +2 -0
  238. package/dist/components/form/checkbox/checkbox.css +90 -0
  239. package/dist/components/form/checkbox/checkbox.d.mts +5 -3
  240. package/dist/components/form/checkbox/checkbox.mjs +30 -27
  241. package/dist/components/form/checkbox/checkbox.module.mjs +13 -0
  242. package/dist/components/form/checkbox-card/checkbox-card.css +138 -0
  243. package/dist/components/form/checkbox-card/checkbox-card.d.mts +3 -4
  244. package/dist/components/form/checkbox-card/checkbox-card.mjs +17 -23
  245. package/dist/components/form/checkbox-card/checkbox-card.module.mjs +17 -0
  246. package/dist/components/form/checkbox-group/checkbox-group.css +15 -0
  247. package/dist/components/form/checkbox-group/checkbox-group.d.mts +7 -5
  248. package/dist/components/form/checkbox-group/checkbox-group.mjs +12 -16
  249. package/dist/components/form/checkbox-group/checkbox-group.module.mjs +8 -0
  250. package/dist/components/form/checkbox-group/index.d.mts +5 -3
  251. package/dist/components/form/color-picker/color-picker.css +172 -0
  252. package/dist/components/form/color-picker/color-picker.d.mts +28 -0
  253. package/dist/components/form/color-picker/color-picker.mjs +239 -0
  254. package/dist/components/form/color-picker/color-picker.module.mjs +20 -0
  255. package/dist/components/form/color-picker/index.d.mts +2 -0
  256. package/dist/components/form/color-picker/index.mjs +2 -0
  257. package/dist/components/form/combobox/combobox.css +143 -0
  258. package/dist/components/form/combobox/combobox.d.mts +32 -0
  259. package/dist/components/form/combobox/combobox.mjs +278 -0
  260. package/dist/components/form/combobox/combobox.module.mjs +19 -0
  261. package/dist/components/form/combobox/index.d.mts +2 -0
  262. package/dist/components/form/combobox/index.mjs +2 -0
  263. package/dist/components/form/date-field/date-field.css +31 -0
  264. package/dist/components/form/date-field/date-field.d.mts +8 -0
  265. package/dist/components/form/date-field/date-field.mjs +20 -0
  266. package/dist/components/form/date-field/date-field.module.mjs +5 -0
  267. package/dist/components/form/date-field/index.d.mts +2 -0
  268. package/dist/components/form/date-field/index.mjs +2 -0
  269. package/dist/components/form/date-picker/date-picker.css +90 -0
  270. package/dist/components/form/date-picker/date-picker.d.mts +12 -0
  271. package/dist/components/form/date-picker/date-picker.mjs +77 -0
  272. package/dist/components/form/date-picker/date-picker.module.mjs +14 -0
  273. package/dist/components/form/date-picker/index.d.mts +2 -0
  274. package/dist/components/form/date-picker/index.mjs +2 -0
  275. package/dist/components/form/file-field/file-field.css +88 -0
  276. package/dist/components/form/file-field/file-field.d.mts +18 -19
  277. package/dist/components/form/file-field/file-field.mjs +130 -42
  278. package/dist/components/form/file-field/file-field.module.mjs +17 -0
  279. package/dist/components/form/file-field/index.d.mts +20 -2
  280. package/dist/components/form/file-field/index.mjs +9 -1
  281. package/dist/components/form/form/form.css +11 -0
  282. package/dist/components/form/form/form.d.mts +4 -4
  283. package/dist/components/form/form/form.mjs +2 -1
  284. package/dist/components/form/form/form.module.mjs +5 -0
  285. package/dist/components/form/form-control/form-control.css +43 -0
  286. package/dist/components/form/form-control/form-control.d.mts +2 -3
  287. package/dist/components/form/form-control/form-control.mjs +11 -10
  288. package/dist/components/form/form-control/form-control.module.mjs +12 -0
  289. package/dist/components/form/number-field/cast.d.mts +2 -3
  290. package/dist/components/form/number-field/cast.mjs +3 -22
  291. package/dist/components/form/number-field/number-field.css +122 -0
  292. package/dist/components/form/number-field/number-field.d.mts +10 -10
  293. package/dist/components/form/number-field/number-field.mjs +126 -54
  294. package/dist/components/form/number-field/number-field.module.mjs +10 -0
  295. package/dist/components/form/password-input/password-input.css +88 -0
  296. package/dist/components/form/password-input/password-input.d.mts +2 -3
  297. package/dist/components/form/password-input/password-input.mjs +15 -12
  298. package/dist/components/form/password-input/password-input.module.mjs +12 -0
  299. package/dist/components/form/radio/radio.css +89 -0
  300. package/dist/components/form/radio/radio.d.mts +4 -3
  301. package/dist/components/form/radio/radio.mjs +16 -19
  302. package/dist/components/form/radio/radio.module.mjs +16 -0
  303. package/dist/components/form/radio-card/radio-card.css +147 -0
  304. package/dist/components/form/radio-card/radio-card.d.mts +4 -4
  305. package/dist/components/form/radio-card/radio-card.mjs +17 -23
  306. package/dist/components/form/radio-card/radio-card.module.mjs +19 -0
  307. package/dist/components/form/range-slider/index.d.mts +2 -0
  308. package/dist/components/form/range-slider/index.mjs +2 -0
  309. package/dist/components/form/range-slider/range-slider.css +67 -0
  310. package/dist/components/form/range-slider/range-slider.d.mts +30 -0
  311. package/dist/components/form/range-slider/range-slider.mjs +135 -0
  312. package/dist/components/form/range-slider/range-slider.module.mjs +14 -0
  313. package/dist/components/form/select/select.css +74 -0
  314. package/dist/components/form/select/select.d.mts +2 -3
  315. package/dist/components/form/select/select.mjs +25 -8
  316. package/dist/components/form/select/select.module.mjs +12 -0
  317. package/dist/components/form/slider/range-input-class.css +97 -0
  318. package/dist/components/form/slider/range-input-class.d.mts +7 -0
  319. package/dist/components/form/slider/range-input-class.mjs +10 -0
  320. package/dist/components/form/slider/range-input-class.module.mjs +8 -0
  321. package/dist/components/form/slider/slider.css +55 -0
  322. package/dist/components/form/slider/slider.d.mts +6 -7
  323. package/dist/components/form/slider/slider.mjs +44 -11
  324. package/dist/components/form/slider/slider.module.mjs +12 -0
  325. package/dist/components/form/switch/switch.css +103 -0
  326. package/dist/components/form/switch/switch.d.mts +2 -3
  327. package/dist/components/form/switch/switch.mjs +14 -17
  328. package/dist/components/form/switch/switch.module.mjs +16 -0
  329. package/dist/components/form/text-field/text-field.css +41 -0
  330. package/dist/components/form/text-field/text-field.d.mts +4 -5
  331. package/dist/components/form/text-field/text-field.mjs +2 -3
  332. package/dist/components/form/text-field/text-field.module.mjs +5 -0
  333. package/dist/components/form/textarea/textarea.css +50 -0
  334. package/dist/components/form/textarea/textarea.d.mts +3 -3
  335. package/dist/components/form/textarea/textarea.mjs +6 -20
  336. package/dist/components/form/textarea/textarea.module.mjs +9 -0
  337. package/dist/components/icons/base.css +40 -0
  338. package/dist/components/icons/base.d.mts +4 -5
  339. package/dist/components/icons/base.mjs +10 -10
  340. package/dist/components/icons/base.module.mjs +13 -0
  341. package/dist/components/icons/browsers.d.mts +5 -6
  342. package/dist/components/icons/color-scale.d.mts +2 -3
  343. package/dist/components/icons/github-mark.d.mts +2 -3
  344. package/dist/components/icons/logo.css +17 -0
  345. package/dist/components/icons/logo.d.mts +3 -4
  346. package/dist/components/icons/logo.mjs +4 -3
  347. package/dist/components/icons/logo.module.mjs +9 -0
  348. package/dist/components/icons/lucide-deep.d.mts +3 -1
  349. package/dist/components/icons/lucide-imports.d.mts +3 -1
  350. package/dist/components/icons/lucide-imports.mjs +3 -1
  351. package/dist/components/icons/lucide.d.mts +60 -61
  352. package/dist/components/icons/qiita.d.mts +2 -3
  353. package/dist/components/icons/twitter.css +9 -0
  354. package/dist/components/icons/twitter.d.mts +2 -3
  355. package/dist/components/icons/twitter.mjs +2 -1
  356. package/dist/components/icons/twitter.module.mjs +5 -0
  357. package/dist/components/icons/vertical-writing.d.mts +2 -3
  358. package/dist/components/index.d.mts +62 -29
  359. package/dist/components/index.mjs +36 -14
  360. package/dist/components/layout/_shared/gap.css +25 -0
  361. package/dist/components/layout/_shared/gap.d.mts +8 -9
  362. package/dist/components/layout/_shared/gap.mjs +6 -5
  363. package/dist/components/layout/_shared/gap.module.mjs +11 -0
  364. package/dist/components/layout/_shared/padding.css +25 -0
  365. package/dist/components/layout/_shared/padding.d.mts +8 -9
  366. package/dist/components/layout/_shared/padding.mjs +6 -5
  367. package/dist/components/layout/_shared/padding.module.mjs +11 -0
  368. package/dist/components/layout/grid/grid.css +93 -0
  369. package/dist/components/layout/grid/grid.d.mts +5 -6
  370. package/dist/components/layout/grid/grid.mjs +21 -20
  371. package/dist/components/layout/grid/grid.module.mjs +25 -0
  372. package/dist/components/layout/resizable-panels/index.d.mts +18 -0
  373. package/dist/components/layout/resizable-panels/index.mjs +9 -0
  374. package/dist/components/layout/resizable-panels/resizable-panels.css +77 -0
  375. package/dist/components/layout/resizable-panels/resizable-panels.d.mts +21 -0
  376. package/dist/components/layout/resizable-panels/resizable-panels.mjs +164 -0
  377. package/dist/components/layout/resizable-panels/resizable-panels.module.mjs +16 -0
  378. package/dist/components/layout/separator/separator.css +37 -0
  379. package/dist/components/layout/separator/separator.d.mts +2 -3
  380. package/dist/components/layout/separator/separator.mjs +12 -9
  381. package/dist/components/layout/separator/separator.module.mjs +12 -0
  382. package/dist/components/layout/stack/stack.css +49 -0
  383. package/dist/components/layout/stack/stack.d.mts +3 -4
  384. package/dist/components/layout/stack/stack.mjs +11 -10
  385. package/dist/components/layout/stack/stack.module.mjs +17 -0
  386. package/dist/components/navigation/anchor/anchor.css +29 -0
  387. package/dist/components/navigation/anchor/anchor.d.mts +2 -3
  388. package/dist/components/navigation/anchor/anchor.mjs +5 -2
  389. package/dist/components/navigation/anchor/anchor.module.mjs +8 -0
  390. package/dist/components/navigation/breadcrumb/breadcrumb.css +72 -0
  391. package/dist/components/navigation/breadcrumb/breadcrumb.d.mts +5 -6
  392. package/dist/components/navigation/breadcrumb/breadcrumb.mjs +15 -9
  393. package/dist/components/navigation/breadcrumb/breadcrumb.module.mjs +14 -0
  394. package/dist/components/navigation/breadcrumb/index.d.mts +2 -3
  395. package/dist/components/navigation/pagination/pagination.css +36 -0
  396. package/dist/components/navigation/pagination/pagination.d.mts +2 -3
  397. package/dist/components/navigation/pagination/pagination.mjs +9 -8
  398. package/dist/components/navigation/pagination/pagination.module.mjs +11 -0
  399. package/dist/components/navigation/side-nav/index.d.mts +16 -0
  400. package/dist/components/navigation/side-nav/index.mjs +10 -0
  401. package/dist/components/navigation/side-nav/side-nav.css +73 -0
  402. package/dist/components/navigation/side-nav/side-nav.d.mts +31 -0
  403. package/dist/components/navigation/side-nav/side-nav.mjs +62 -0
  404. package/dist/components/navigation/side-nav/side-nav.module.mjs +11 -0
  405. package/dist/components/navigation/stepper/index.d.mts +2 -0
  406. package/dist/components/navigation/stepper/index.mjs +2 -0
  407. package/dist/components/navigation/stepper/stepper.css +151 -0
  408. package/dist/components/navigation/stepper/stepper.d.mts +19 -0
  409. package/dist/components/navigation/stepper/stepper.mjs +87 -0
  410. package/dist/components/navigation/stepper/stepper.module.mjs +29 -0
  411. package/dist/components/navigation/table-of-contents/index.d.mts +2 -0
  412. package/dist/components/navigation/table-of-contents/index.mjs +2 -0
  413. package/dist/components/navigation/table-of-contents/table-of-contents.css +17 -0
  414. package/dist/components/navigation/table-of-contents/table-of-contents.d.mts +12 -0
  415. package/dist/components/navigation/table-of-contents/table-of-contents.mjs +94 -0
  416. package/dist/components/navigation/table-of-contents/table-of-contents.module.mjs +8 -0
  417. package/dist/components/navigation/tabs/index.d.mts +19 -2
  418. package/dist/components/navigation/tabs/index.mjs +9 -1
  419. package/dist/components/navigation/tabs/tabs.css +70 -0
  420. package/dist/components/navigation/tabs/tabs.d.mts +16 -19
  421. package/dist/components/navigation/tabs/tabs.mjs +52 -49
  422. package/dist/components/navigation/tabs/tabs.module.mjs +12 -0
  423. package/dist/components/observers/fragment-instance.d.mts +1 -0
  424. package/dist/components/observers/in-view/in-view.d.mts +11 -0
  425. package/dist/components/observers/in-view/in-view.mjs +60 -0
  426. package/dist/components/observers/in-view/index.d.mts +2 -0
  427. package/dist/components/observers/in-view/index.mjs +2 -0
  428. package/dist/components/observers/resize/index.d.mts +2 -0
  429. package/dist/components/observers/resize/index.mjs +2 -0
  430. package/dist/components/observers/resize/resize.d.mts +7 -0
  431. package/dist/components/observers/resize/resize.mjs +25 -0
  432. package/dist/components/overlays/_internal/modal-dialog-context.d.mts +4 -5
  433. package/dist/components/overlays/_internal/use-can-hover.d.mts +2 -3
  434. package/dist/components/overlays/_internal/use-hover-intent.d.mts +3 -4
  435. package/dist/components/overlays/_internal/use-list-navigation.d.mts +17 -11
  436. package/dist/components/overlays/_internal/use-list-navigation.mjs +42 -26
  437. package/dist/components/overlays/command-palette/command-palette.css +91 -0
  438. package/dist/components/overlays/command-palette/command-palette.d.mts +24 -0
  439. package/dist/components/overlays/command-palette/command-palette.mjs +139 -0
  440. package/dist/components/overlays/command-palette/command-palette.module.mjs +14 -0
  441. package/dist/components/overlays/command-palette/index.d.mts +2 -0
  442. package/dist/components/overlays/command-palette/index.mjs +2 -0
  443. package/dist/components/overlays/context-menu/context-menu.d.mts +13 -0
  444. package/dist/components/overlays/context-menu/context-menu.mjs +79 -0
  445. package/dist/components/overlays/context-menu/index.d.mts +21 -0
  446. package/dist/components/overlays/context-menu/index.mjs +13 -0
  447. package/dist/components/overlays/dialog/dialog.css +31 -0
  448. package/dist/components/overlays/dialog/dialog.d.mts +12 -17
  449. package/dist/components/overlays/dialog/dialog.mjs +11 -13
  450. package/dist/components/overlays/dialog/dialog.module.mjs +10 -0
  451. package/dist/components/overlays/dialog/index.d.mts +17 -2
  452. package/dist/components/overlays/dialog/index.mjs +8 -1
  453. package/dist/components/overlays/drawer/drawer.css +48 -0
  454. package/dist/components/overlays/drawer/drawer.d.mts +2 -3
  455. package/dist/components/overlays/drawer/drawer.mjs +11 -10
  456. package/dist/components/overlays/drawer/drawer.module.mjs +13 -0
  457. package/dist/components/overlays/dropdown-menu/dropdown-menu.d.mts +19 -26
  458. package/dist/components/overlays/dropdown-menu/dropdown-menu.mjs +12 -20
  459. package/dist/components/overlays/dropdown-menu/hooks.d.mts +7 -7
  460. package/dist/components/overlays/dropdown-menu/hooks.mjs +3 -3
  461. package/dist/components/overlays/dropdown-menu/index.d.mts +30 -2
  462. package/dist/components/overlays/dropdown-menu/index.mjs +12 -1
  463. package/dist/components/overlays/dropdown-menu/shared.css +51 -0
  464. package/dist/components/overlays/dropdown-menu/shared.d.mts +3 -6
  465. package/dist/components/overlays/dropdown-menu/shared.mjs +4 -6
  466. package/dist/components/overlays/dropdown-menu/shared.module.mjs +8 -0
  467. package/dist/components/overlays/dropdown-menu/sub-menu.css +28 -0
  468. package/dist/components/overlays/dropdown-menu/sub-menu.d.mts +3 -6
  469. package/dist/components/overlays/dropdown-menu/sub-menu.mjs +16 -16
  470. package/dist/components/overlays/dropdown-menu/sub-menu.module.mjs +9 -0
  471. package/dist/components/overlays/dropdown-menu/use-safe-triangle.d.mts +2 -3
  472. package/dist/components/overlays/list-box/hooks.d.mts +6 -5
  473. package/dist/components/overlays/list-box/hooks.mjs +5 -4
  474. package/dist/components/overlays/list-box/index.d.mts +27 -2
  475. package/dist/components/overlays/list-box/index.mjs +9 -1
  476. package/dist/components/overlays/list-box/list-box.css +74 -0
  477. package/dist/components/overlays/list-box/list-box.d.mts +20 -23
  478. package/dist/components/overlays/list-box/list-box.mjs +17 -21
  479. package/dist/components/overlays/list-box/list-box.module.mjs +10 -0
  480. package/dist/components/overlays/modal/modal.css +119 -0
  481. package/dist/components/overlays/modal/modal.d.mts +2 -3
  482. package/dist/components/overlays/modal/modal.mjs +14 -11
  483. package/dist/components/overlays/modal/modal.module.mjs +11 -0
  484. package/dist/components/overlays/popover/anchor-positioning.d.mts +4 -5
  485. package/dist/components/overlays/popover/escape-stack.d.mts +2 -3
  486. package/dist/components/overlays/popover/hooks.d.mts +7 -8
  487. package/dist/components/overlays/popover/index.d.mts +25 -2
  488. package/dist/components/overlays/popover/index.mjs +8 -1
  489. package/dist/components/overlays/popover/popover.css +51 -0
  490. package/dist/components/overlays/popover/popover.d.mts +18 -20
  491. package/dist/components/overlays/popover/popover.mjs +13 -12
  492. package/dist/components/overlays/popover/popover.module.mjs +11 -0
  493. package/dist/components/overlays/tooltip/bridge.css +68 -0
  494. package/dist/components/overlays/tooltip/bridge.d.mts +2 -3
  495. package/dist/components/overlays/tooltip/bridge.mjs +7 -21
  496. package/dist/components/overlays/tooltip/bridge.module.mjs +11 -0
  497. package/dist/components/overlays/tooltip/index.d.mts +22 -2
  498. package/dist/components/overlays/tooltip/index.mjs +8 -1
  499. package/dist/components/overlays/tooltip/tooltip.css +15 -0
  500. package/dist/components/overlays/tooltip/tooltip.d.mts +19 -24
  501. package/dist/components/overlays/tooltip/tooltip.mjs +5 -9
  502. package/dist/components/overlays/tooltip/tooltip.module.mjs +5 -0
  503. package/dist/components/providers/index.d.mts +1 -2
  504. package/dist/components/providers/portal-root.d.mts +9 -7
  505. package/dist/components/providers/portal-root.mjs +7 -7
  506. package/dist/components/providers/ui-provider.d.mts +2 -6
  507. package/dist/components/providers/ui-provider.mjs +1 -5
  508. package/dist/helpers/chain.d.mts +2 -3
  509. package/dist/helpers/chain.mjs +0 -23
  510. package/dist/helpers/create-safe-context.d.mts +2 -3
  511. package/dist/helpers/create-safe-context.mjs +0 -17
  512. package/dist/helpers/index.d.mts +1 -2
  513. package/dist/helpers/index.mjs +2 -3
  514. package/dist/helpers/merge-props.d.mts +2 -3
  515. package/dist/helpers/merge-props.mjs +2 -37
  516. package/dist/helpers/merge-refs.d.mts +2 -3
  517. package/dist/helpers/merge-refs.mjs +0 -32
  518. package/dist/hooks/click-away/index.d.mts +2 -3
  519. package/dist/hooks/controllable-state/index.d.mts +2 -3
  520. package/dist/hooks/controllable-state/index.mjs +9 -11
  521. package/dist/hooks/index.d.mts +2 -23
  522. package/dist/hooks/index.mjs +2 -22
  523. package/dist/hooks/writing-mode/index.d.mts +15 -5
  524. package/dist/hooks/writing-mode/index.mjs +21 -14
  525. package/dist/i18n/current.d.mts +23 -0
  526. package/dist/i18n/current.mjs +43 -0
  527. package/dist/i18n/en.d.mts +2 -3
  528. package/dist/i18n/en.mjs +46 -0
  529. package/dist/i18n/index.d.mts +3 -2
  530. package/dist/i18n/index.mjs +4 -3
  531. package/dist/i18n/ja.d.mts +2 -3
  532. package/dist/i18n/ja.mjs +46 -0
  533. package/dist/i18n/messages.d.mts +81 -3
  534. package/dist/i18n/usage.d.mts +8 -0
  535. package/dist/i18n/usage.mjs +131 -0
  536. package/dist/index.d.mts +40 -47
  537. package/dist/index.mjs +36 -42
  538. package/dist/integrations/_shared/openui-defs.d.mts +3 -4
  539. package/dist/integrations/_shared/openui-defs.mjs +123 -54
  540. package/dist/integrations/_shared/renderers.css +50 -0
  541. package/dist/integrations/_shared/renderers.d.mts +71 -52
  542. package/dist/integrations/_shared/renderers.mjs +292 -34
  543. package/dist/integrations/_shared/renderers.module.mjs +14 -0
  544. package/dist/integrations/_shared/schemas.d.mts +388 -104
  545. package/dist/integrations/_shared/schemas.mjs +165 -27
  546. package/dist/integrations/ai-sdk/index.d.mts +2 -2
  547. package/dist/integrations/ai-sdk/map-parts.d.mts +25 -7
  548. package/dist/integrations/ai-sdk/map-parts.mjs +28 -3
  549. package/dist/integrations/json-render/catalog.d.mts +336 -18
  550. package/dist/integrations/json-render/catalog.mjs +120 -57
  551. package/dist/integrations/json-render/registry.d.mts +3 -4
  552. package/dist/integrations/json-render/registry.mjs +38 -4
  553. package/dist/integrations/openui/form-views.d.mts +23 -18
  554. package/dist/integrations/openui/form-views.mjs +27 -3
  555. package/dist/integrations/openui/library.d.mts +59 -7
  556. package/dist/integrations/openui/library.mjs +18 -3
  557. package/dist/integrations/openui/prompt.d.mts +2 -3
  558. package/dist/internal/accepts-file.d.mts +8 -0
  559. package/dist/internal/accepts-file.mjs +19 -0
  560. package/dist/internal/carries-files.d.mts +3 -0
  561. package/dist/internal/carries-files.mjs +4 -0
  562. package/dist/internal/clamp.d.mts +2 -3
  563. package/dist/internal/clamp.mjs +0 -11
  564. package/dist/internal/commit-input-value.d.mts +10 -0
  565. package/dist/internal/commit-input-value.mjs +15 -0
  566. package/dist/internal/dropped-files.d.mts +3 -0
  567. package/dist/internal/dropped-files.mjs +8 -0
  568. package/dist/{hooks/focus-trap/index.d.mts → internal/focus-trap.d.mts} +6 -7
  569. package/dist/{hooks/focus-trap/index.mjs → internal/focus-trap.mjs} +5 -5
  570. package/dist/internal/hex-color.d.mts +22 -0
  571. package/dist/internal/hex-color.mjs +53 -0
  572. package/dist/internal/iso-date.d.mts +39 -0
  573. package/dist/internal/iso-date.mjs +98 -0
  574. package/dist/internal/to-precision.d.mts +2 -3
  575. package/dist/internal/to-precision.mjs +0 -8
  576. package/dist/styles/index.css +513 -2534
  577. package/dist/styles/tailwind.css +217 -17
  578. package/dist/styles/tokens.d.mts +1 -2
  579. package/dist/styles/tokens.mjs +1 -2
  580. package/dist/types/variables.d.mts +7 -9
  581. package/docs/GUIDE.md +340 -158
  582. package/docs/llms.txt +18 -10
  583. package/docs/props.generated.json +2157 -292
  584. package/docs/references/ai-chat.md +396 -113
  585. package/docs/references/color.md +258 -113
  586. package/docs/references/components.md +1891 -461
  587. package/docs/references/generative-ui.md +163 -34
  588. package/docs/references/interaction-design.md +103 -73
  589. package/docs/references/spatial-design.md +112 -90
  590. package/docs/references/types.md +101 -0
  591. package/docs/references/typography.md +182 -73
  592. package/package.json +71 -70
  593. package/dist/components/_internal/focus-ring.d.mts +0 -8
  594. package/dist/components/_internal/focus-ring.mjs +0 -8
  595. package/dist/components/layout/scroll-linked/index.d.mts +0 -2
  596. package/dist/components/layout/scroll-linked/index.mjs +0 -2
  597. package/dist/components/layout/scroll-linked/scroll-linked.d.mts +0 -14
  598. package/dist/components/layout/scroll-linked/scroll-linked.mjs +0 -59
  599. package/dist/helpers/cn.d.mts +0 -5
  600. package/dist/helpers/cn.mjs +0 -27
  601. package/dist/hooks/breakpoint/index.d.mts +0 -5
  602. package/dist/hooks/breakpoint/index.mjs +0 -24
  603. package/dist/hooks/client/index.d.mts +0 -4
  604. package/dist/hooks/client/index.mjs +0 -6
  605. package/dist/hooks/clipboard/index.d.mts +0 -7
  606. package/dist/hooks/clipboard/index.mjs +0 -15
  607. package/dist/hooks/debounced-transition/index.d.mts +0 -5
  608. package/dist/hooks/debounced-transition/index.mjs +0 -49
  609. package/dist/hooks/deferred-debounce/index.d.mts +0 -4
  610. package/dist/hooks/deferred-debounce/index.mjs +0 -9
  611. package/dist/hooks/disclosure/index.d.mts +0 -10
  612. package/dist/hooks/disclosure/index.mjs +0 -20
  613. package/dist/hooks/hash/index.d.mts +0 -4
  614. package/dist/hooks/hash/index.mjs +0 -25
  615. package/dist/hooks/hover/index.d.mts +0 -12
  616. package/dist/hooks/hover/index.mjs +0 -19
  617. package/dist/hooks/intersection-observer/index.d.mts +0 -3
  618. package/dist/hooks/intersection-observer/index.mjs +0 -3
  619. package/dist/hooks/intersection-observer/use-in-view.d.mts +0 -11
  620. package/dist/hooks/intersection-observer/use-in-view.mjs +0 -18
  621. package/dist/hooks/intersection-observer/use-intersection-observer.d.mts +0 -11
  622. package/dist/hooks/intersection-observer/use-intersection-observer.mjs +0 -33
  623. package/dist/hooks/interval/index.d.mts +0 -4
  624. package/dist/hooks/interval/index.mjs +0 -19
  625. package/dist/hooks/local-storage/index.d.mts +0 -4
  626. package/dist/hooks/local-storage/index.mjs +0 -46
  627. package/dist/hooks/resize/index.d.mts +0 -8
  628. package/dist/hooks/resize/index.mjs +0 -24
  629. package/dist/hooks/scroll-direction/index.d.mts +0 -13
  630. package/dist/hooks/scroll-direction/index.mjs +0 -67
  631. package/dist/hooks/scroll-lock/index.d.mts +0 -9
  632. package/dist/hooks/scroll-lock/index.mjs +0 -59
  633. package/dist/hooks/session-storage/index.d.mts +0 -4
  634. package/dist/hooks/session-storage/index.mjs +0 -46
  635. package/dist/hooks/step/index.d.mts +0 -15
  636. package/dist/hooks/step/index.mjs +0 -39
  637. package/dist/hooks/timeout/index.d.mts +0 -4
  638. package/dist/hooks/timeout/index.mjs +0 -19
  639. package/dist/hooks/window-resize/index.d.mts +0 -11
  640. package/dist/hooks/window-resize/index.mjs +0 -21
  641. package/dist/hooks/window-size/index.d.mts +0 -8
  642. package/dist/hooks/window-size/index.mjs +0 -31
  643. package/dist/i18n/context.d.mts +0 -9
  644. package/dist/i18n/context.mjs +0 -19
  645. package/dist/styles/base.css +0 -315
  646. package/dist/styles/tokens.css +0 -380
  647. package/dist/styles/tokens.generated.d.mts +0 -840
  648. package/dist/styles/tokens.generated.mjs +0 -813
  649. package/dist/styles/utilities.css +0 -62
  650. package/docs/references/helpers.md +0 -120
  651. package/docs/references/hooks.md +0 -314
package/docs/GUIDE.md CHANGED
@@ -1,18 +1,17 @@
1
- # k8ordo UI Design Guide
1
+ # @k8ordo/ui Design Guide
2
2
 
3
- `@k8ordo/ui` デザインシステムを使って UI を作るためのガイド。
3
+ How to build UI with the `@k8ordo/ui` design system.
4
4
 
5
- ## セットアップ
5
+ ## Setup
6
6
 
7
7
  ```bash
8
8
  npm install @k8ordo/ui
9
9
  ```
10
10
 
11
11
  ```tsx
12
- // 1. スタイルシートを読み込む(エントリポイントで1回)
12
+ // 1. Load the stylesheet (once, at your entry point)
13
13
  import '@k8ordo/ui/styles.css';
14
-
15
- // 2. Provider でアプリを囲む
14
+ // 2. Wrap the app in the provider
16
15
  import { UIProvider } from '@k8ordo/ui';
17
16
 
18
17
  function App() {
@@ -23,205 +22,325 @@ function App() {
23
22
  );
24
23
  }
25
24
 
26
- // 3. コンポーネントを使う
25
+ // 3. Use components
27
26
  import { Button, Card } from '@k8ordo/ui';
28
27
  ```
29
28
 
30
- ### スタイルシートの選び方
29
+ ### How the styles arrive
30
+
31
+ `@k8ordo/ui` is written in CSS Modules, and its styles come in two parts:
31
32
 
32
- CSS のエントリは2つある。プロジェクトの CSS 環境で選ぶ:
33
+ - **`styles.css`** — import it once. It declares the cascade layers, the design
34
+ tokens (custom properties on `:root` and their modes), a reset (the same
35
+ rules as Tailwind CSS 4's preflight), and the page-wide defaults.
36
+ - **Each component's own CSS** — imported by the component's JavaScript, so a
37
+ page loads the CSS of the components it uses and nothing else. Any bundler
38
+ that handles a CSS import from a package does this for you (Vite, Next.js,
39
+ webpack, Rspack, …).
33
40
 
34
- - **`styles.css`(既定)** — ビルド済み CSS。Tailwind を持たないプロジェクト(CSS Modules・素の CSS)はこちら。import 1行で完結し、Tailwind のセットアップは不要。ライブラリのルールはすべて `@layer` 内にあるため、レイヤー外にある利用側の CSS がカスケードで優先される(唯一の例外は preflight の `[hidden] { display: none !important }`)。デザイントークンは `:root` / `.dark` の CSS カスタムプロパティとしてそのまま参照できる(`var(--fg-mute)` など)。
35
- - **`tailwind.css`** — Tailwind ソース版。Tailwind CSS 4 を使うプロジェクトはこちらを import すると、デザイントークン(`bg-bg-base` など)を自分のマークアップの Tailwind クラスとしても使える。内部で `@import 'tailwindcss'` を含むため、プロジェクトの CSS は次の1行でよい:
41
+ Every rule of the library sits in a cascade layer. `styles.css` declares the
42
+ order first:
36
43
 
37
44
  ```css
38
- @import '@k8ordo/ui/tailwind.css';
45
+ @layer properties, theme, base, components, utilities;
39
46
  ```
40
47
 
41
- どちらのエントリも文書全体にベーススタイルを適用する点に注意。Tailwind の preflight(見出し・リスト・余白のリセット等)に加え、ライブラリの base レイヤーが `b` / `strong` の太字や `i` / `em` の斜体を解除し、`body` のタイポグラフィ既定(`font-size` / `overflow-wrap: anywhere` / `scrollbar-gutter: stable` など)を設定する。既存アプリに後付けする場合はコンポーネント以外の見た目にも影響する。
42
-
43
- 例外がもう1つ: `@k8ordo/ui/ai/response`(`Response`)だけは streamdown のクラスを利用側の Tailwind ビルドで生成する必要があるため、ビルド済み `styles.css` では表示が完成しない。`Response` を使うなら `tailwind.css` + `@source` 設定([ai-chat](references/ai-chat.md))が前提。
48
+ The reset and the defaults are in `base` and the components in `components`.
49
+ These are Tailwind CSS 4's layers in Tailwind's order, so in a Tailwind project
50
+ your utilities win over the components; without Tailwind, any CSS of yours that
51
+ is not in a layer wins, and so does a layer you declare after `components`. The
52
+ one rule that does not yield is the reset's
53
+ `[hidden] { display: none !important }`.
54
+
55
+ The CSS is written for what browsers ship today: `@scope`, container style
56
+ queries, `light-dark()`, `:dir()`, nesting. Keep your bundler's CSS target
57
+ recent (in Vite, `build.cssTarget`): an older target makes Lightning CSS
58
+ rewrite `:dir(rtl)` into `:lang()` selectors, which no longer follow `dir`.
59
+
60
+ Components take no `className`. To change how one looks, change the tokens, or
61
+ render your own element through its `renderItem` / `renderAnchor`, which hands
62
+ you the component's `className` to keep or to add to.
63
+
64
+ ### Tokens
65
+
66
+ The tokens are custom properties declared at `:root`, named by category:
67
+ `--color-*`, `--spacing` (and `--spacing-em`), `--radius-*`, `--shadow-*`,
68
+ `--font-family-*`, `--font-size-*`, `--font-weight-*`, `--line-height-*`,
69
+ `--letter-spacing-*`, `--z-index-*`, `--duration-*`, `--easing-*` and
70
+ `--breakpoint-*`. Read them in your own CSS (`color: var(--color-fg-mute)`,
71
+ `padding: calc(var(--spacing) * 6)`). The palette they are built from
72
+ (`--gray-500`, …) is not part of the API.
73
+
74
+ They are declared outside any layer, so to override one, declare it after
75
+ `styles.css` is loaded: between unlayered rules of equal specificity, source
76
+ order decides. `@k8ordo/ui/tokens` exports the same tokens as data, a DTCG
77
+ resolver document (Resolver Module 2025.10), with each mode (`.dark`,
78
+ `prefers-contrast: more`) as a modifier.
79
+
80
+ [better-css-modules](https://github.com/k35o/better-css-modules) holds CSS
81
+ Modules to these tokens: list `@k8ordo/ui/styles.css` in its `globalCss`, and
82
+ its `check` reports a raw value, a misspelt token, or a palette color in your
83
+ own modules.
84
+
85
+ ### Tailwind CSS 4
86
+
87
+ In a Tailwind CSS 4 project, import `tailwind.css` after Tailwind, instead of
88
+ `styles.css`. It brings in `styles.css` and a theme whose utilities read the
89
+ tokens: `bg-bg-base` is `var(--color-bg-base)`, `text-md` is
90
+ `var(--font-size-md)` with its line height, `p-6` is `calc(var(--spacing) * 6)`.
91
+ It does not import Tailwind itself, so `@k8ordo/ui` does not depend on
92
+ `tailwindcss`; your project's own Tailwind comes first:
44
93
 
45
- ### 文言の言語(i18n)
94
+ ```css
95
+ @import 'tailwindcss';
96
+ @import '@k8ordo/ui/tailwind.css';
97
+ ```
46
98
 
47
- コンポーネントが内部で持つ文言(「閉じる」「必須」「読み込み中」など)は**既定で日本語**。Provider を置かなくても、`messages` を渡さなくても日本語で動くので、日本語のアプリでは何も設定しなくてよい。
99
+ It also defines the `dark:`, `light:` and `vertical:` variants and the
100
+ `grid-cols-auto-fill-*`, `writing-*` and `z-overlay` / `z-modal` / `z-toast`
101
+ utilities. The components do not need Tailwind; it is only for your own markup.
102
+
103
+ ### Page-wide styles
104
+
105
+ Note that `styles.css` applies base styles document-wide. On top of the reset
106
+ (headings, lists, and margins), it unsets bold on `b` / `strong` and italics on
107
+ `i` / `em`, and sets `body` typography defaults (`font-size`,
108
+ `overflow-wrap: anywhere`, `scrollbar-gutter: stable`, …). Adding it to an
109
+ existing app restyles more than the library's own components. Wrap rendered
110
+ Markdown or MDX in `Prose` to get the typesetting of body text back inside it —
111
+ see [Typography](references/typography.md#long-form-text-prose).
112
+
113
+ ### Dark mode
114
+
115
+ The tokens switch on a `dark` class: `:root` holds the light values and `.dark`
116
+ the dark ones, so everything under an element with the class is dark. The
117
+ library never adds the class itself. In a k8ordo application
118
+ `@k8ordo/color-scheme` does, resolving the visitor's choice and the system
119
+ preference into `dark` on `<html>` before the first paint; anything else that
120
+ toggles the class works the same.
121
+
122
+ The base layer sets the CSS `color-scheme` property to match — `light` on
123
+ `:root`, `dark` under `.dark` — so the browser's own rendering (scrollbars, form
124
+ controls, a `<dialog>`'s default colors) follows the tokens rather than the OS.
125
+ Your own CSS follows the same way when it reads the tokens. With
126
+ `tailwind.css`, the `dark:` variant applies under `.dark` and `light:`
127
+ everywhere else.
128
+
129
+ ### Wording language (i18n)
130
+
131
+ The wording components own internally ("close", "required", "loading", …) is
132
+ read in `@k8ordo/i18n`'s current locale. There is no provider to configure and
133
+ nothing to pass: `@k8ordo/i18n` is a peer dependency, installed with this
134
+ package.
135
+
136
+ - **With a locale set.** Once the application defines its set with
137
+ `defineLocales`, the components speak the locale its messages do — the one
138
+ the URL names, or the set's default.
139
+ - **Without one.** An application that defines no set (a Next.js or plain
140
+ Vite app that does not use `@k8ordo/i18n`) gets **English**, whatever its
141
+ URL starts with — so the server's HTML and the browser agree.
142
+
143
+ ```ts
144
+ // src/i18n.ts — a Japanese-only app defines a set of one
145
+ import { defineLocales } from '@k8ordo/i18n';
146
+
147
+ export const locales = defineLocales({
148
+ ja: { timeZone: 'Asia/Tokyo', dir: 'ltr' },
149
+ });
150
+ ```
48
151
 
49
- 英語にするときは `@k8ordo/ui/i18n` の `en` を渡す。
152
+ The module that defines the set has to be loaded in the browser too, not
153
+ only by the server render: where no set is defined the components speak
154
+ English, and would disagree with the HTML. In a k8ordo app a client component
155
+ that links (`bindParams`) or switches language already imports it; elsewhere,
156
+ import it from a client module the root renders.
50
157
 
51
- ```tsx
52
- import { UIProvider } from '@k8ordo/ui';
53
- import { en } from '@k8ordo/ui/i18n';
158
+ `ja` and `en` ship with the library. Any other locale is registered next to
159
+ the set, and a regional tag without a dictionary of its own (`en-US`) reads
160
+ its language's (`en`); a locale nothing has text for throws, naming how to
161
+ register it:
54
162
 
55
- <UIProvider messages={en}>
56
- <App />
57
- </UIProvider>;
58
- ```
163
+ ```ts
164
+ import { en, ja, registerMessages } from '@k8ordo/ui/i18n';
165
+ import type { Messages } from '@k8ordo/ui/i18n';
59
166
 
60
- 一部だけ差し替えたいときは辞書をスプレッドして上書きする。
167
+ const fr: Messages = { close: 'Fermer' /* …every key */ };
168
+ registerMessages('fr', fr);
61
169
 
62
- ```tsx
63
- <UIProvider messages={{ ...en, close: 'Dismiss' }}>
64
- <App />
65
- </UIProvider>
170
+ // A registered dictionary wins over a built-in one
171
+ registerMessages('en', { ...en, close: 'Dismiss' });
66
172
  ```
67
173
 
68
- 優先順位は **コンポーネントの prop > Provider の辞書 > 既定(日本語)**。`Spinner` の `label` のように個別の文言 prop を持つコンポーネントでは、その prop が辞書より優先される。
174
+ Resolution order is **component prop > registered dictionary > built-in
175
+ dictionary**. For a component with a wording prop of its own, such as
176
+ `Spinner`'s `label`, that prop wins.
69
177
 
70
- > [キー一覧・詳細](references/components.md)(「i18n(文言辞書)」の節)
178
+ `getMessages()` from `@k8ordo/ui/i18n` returns the wording in effect for your
179
+ own elements (a `renderItem`, a component beside the library). It is not a
180
+ hook, so it works in a Server Component — which is also why `Spinner`,
181
+ `Breadcrumb`, `Code`, `Alert`, `Callout`, `Reasoning`, and `ToolInvocation`
182
+ are Server Components.
71
183
 
72
- ## デザインの方向性
184
+ > [Full key list and details](references/components.md) (the "i18n (message dictionary)" section)
73
185
 
74
- ### コアコンセプト
186
+ ## Design direction
75
187
 
76
- **「触れるものは柔らかく、読むものは端正に」**
188
+ ### Core concept
77
189
 
78
- - **空間と形が主役**: 色ではなく、余白のゆとりと形の柔らかさがこのデザインの個性
79
- - **要素の性格で使い分ける**: 触れる要素(フォーム、ボタン)は柔らかく、情報を示す要素(Alert、Badge)は端正に
80
- - **余白で語る**: 詰め込まず、空間にゆとりを持たせる
81
- - **静かな変化**: アニメーションは控えめに、繊細なフィードバック
82
- - **穏やかな色**: OKLCH ベースのパレット、セマンティックトークンで抑えたトーンに
190
+ **"Soft where you touch, precise where you read."**
191
+ (触れるものは柔らかく、読むものは端正に)
83
192
 
84
- すべてを同じトーンにしない。要素の性格ごとに柔らかさを変える。
193
+ - **Space and shape lead**: the character of this design comes from generous spacing and soft shapes, not from color
194
+ - **Vary by the element's role**: things you touch (forms, buttons) are soft; things that inform (Alert, Badge) are precise
195
+ - **Let the spacing speak**: do not pack things in; leave room
196
+ - **Quiet motion**: restrained animation, subtle feedback
197
+ - **Calm color**: an OKLCH-based palette kept low-key through semantic tokens
85
198
 
86
- | 要素 | 方向性 |
87
- | --------------------------------------- | -------------------------------------------------------- |
88
- | フォーム(TextField, Textarea, Button) | 柔らかい(大きな角丸、ピル型ボタン、ゆったりパディング) |
89
- | カード・コンテナ | 柔らかい(`rounded-xl`〜`rounded-2xl`、ふんわり影) |
90
- | Alert, Badge | 端正(情報の明確さを優先) |
91
- | Tabs, Breadcrumb | シャープ(構造を示す要素は端正に) |
199
+ Do not give everything the same tone. Soften in proportion to the element's role.
92
200
 
93
- ### トーン
201
+ | Element | Direction |
202
+ | ----------------------------------- | ---------------------------------------------------- |
203
+ | Forms (TextField, Textarea, Button) | Soft (large radii, pill buttons, generous padding) |
204
+ | Cards and containers | Soft (`--radius-xl`–`--radius-2xl`, gentle shadow) |
205
+ | Alert, Badge | Precise (clarity of information comes first) |
206
+ | Tabs, Breadcrumb | Sharp (elements that express structure stay precise) |
94
207
 
95
- 柔らかな余白と静かな洗練。空間と形の柔らかさで魅せる。
208
+ ### Tone
96
209
 
97
- ## 美学ガイドライン
210
+ Soft spacing and quiet refinement. The appeal is in space and shape.
98
211
 
99
- ### ページ構造
212
+ ## Aesthetic guidelines
213
+
214
+ ### Page structure
100
215
 
101
216
  **DO:**
102
217
 
103
- - ページ背景は `bg-bg-subtle`(薄いグレー)
104
- - コンテンツは白いカードで浮かせる
105
- - カード間に十分な余白(`gap-6`〜`gap-10`)
218
+ - Use `--color-bg-subtle` (a light grey) for the page background
219
+ - Float content on white cards
220
+ - Leave enough room between cards (6–10 steps of `--spacing`)
106
221
 
107
222
  **DON'T:**
108
223
 
109
- - 純白背景にカードをフラットに置く
110
- - すべてを Card に入れる
111
- - Card を入れ子にする(Card in Card)
224
+ - Lay flat cards on a pure white background
225
+ - Put everything in a Card
226
+ - Nest cards (Card in Card)
112
227
 
113
- ### タイポグラフィ
228
+ ### Typography
114
229
 
115
230
  **DO:**
116
231
 
117
- - 日本語フォント(Noto Sans JP, M PLUS 2)を使う
118
- - フォントウェイトは 3種類まで(`font-normal`, `font-medium`, `font-bold`)
119
- - `font-medium` が 450(一般的な 500 より軽い)であることを活かした繊細な強調
232
+ - Use the Japanese fonts (Noto Sans JP, M PLUS 2), which your app loads and sets — the library sets no font of its own, so text stays on the reset's system stack until your app sets one
233
+ - Keep to three weights: 400 (the inherited default), `--font-weight-medium`, `--font-weight-bold`
234
+ - Lean on `--font-weight-medium` being 450 — lighter than the usual 500 — for delicate emphasis
120
235
 
121
236
  **DON'T:**
122
237
 
123
- - Inter / Roboto / Open Sans を使う
124
- - 4種類以上のフォントサイズを1画面で使う
125
- - テキストにグラデーションをかける
238
+ - Use Inter / Roboto / Open Sans
239
+ - Use four or more font sizes on one screen
240
+ - Apply gradients to text
126
241
 
127
- > [タイポグラフィ詳細](references/typography.md)
242
+ > [Typography details](references/typography.md)
128
243
 
129
- ### カラー
244
+ ### Color
130
245
 
131
246
  **DO:**
132
247
 
133
- - 60-30-10 ルール(ニュートラル60%, サポート30%, アクセント10%)
134
- - セマンティックカラートークンを使う(`bg-bg-subtle`, `text-fg-mute` 等)
135
- - ダークモードを独立したトーンで設計する
136
- - 色は穏やかに、空間と形で魅せる
248
+ - Follow the 60-30-10 rule (60% neutral, 30% supporting, 10% accent)
249
+ - Use semantic color tokens (`--color-bg-subtle`, `--color-fg-mute`, …)
250
+ - Design dark mode as its own tone, not a derivative
251
+ - Keep color calm; let space and shape carry the design
137
252
 
138
253
  **DON'T:**
139
254
 
140
- - グラデーション背景
141
- - ホバーに `bg-primary-bg` — `bg-bg-mute` を使う
142
- - 透明度(`/90`)で状態表現 — 専用トークンを使う
143
- - 鮮やかな色を広範囲に使う
144
- - 生のパレット色(`bg-teal-500`)— セマンティックトークン(`bg-primary-bg`)を使う
255
+ - Use gradient backgrounds
256
+ - Use `--color-primary-bg` on hover — use `--color-bg-mute`
257
+ - Express state with opacity — use the dedicated token
258
+ - Spread vivid color over large areas
259
+ - Use raw palette colors (`--teal-500`) — use semantic tokens (`--color-primary-bg`)
145
260
 
146
- > [カラー詳細](references/color.md)
261
+ > [Color details](references/color.md)
147
262
 
148
- ### スペーシング
263
+ ### Spacing
149
264
 
150
265
  **DO:**
151
266
 
152
- - `p-8` を標準パディングとする(フォーム・カード内)
153
- - 余白の差で関連度を表す(`mt-2` 近い、`mt-4` 標準、`mt-8` セクション間)
154
- - Separator でセクションを区切る
267
+ - Treat 6 steps of `--spacing` (`calc(var(--spacing) * 6)`) as the standard padding (inside forms and cards), 4 when compact and 8 when generous
268
+ - Express relatedness through the size of the gap (2 steps close, 4 standard, 8 between sections)
269
+ - Separate sections with Separator
155
270
 
156
271
  **DON'T:**
157
272
 
158
- - すべてを Card に入れる
159
- - Card を入れ子にする(Card in Card)
160
- - `gap-1` のような極端に狭いスペーシング
273
+ - Put everything in a Card
274
+ - Nest cards (Card in Card)
275
+ - Use extremely tight spacing such as one step
161
276
 
162
- > [スペーシング詳細](references/spatial-design.md)
277
+ > [Spacing details](references/spatial-design.md)
163
278
 
164
- ### インタラクション
279
+ ### Interaction
165
280
 
166
281
  **DO:**
167
282
 
168
- - `transition-colors` を基本にする
169
- - `focus-visible:ring-2 focus-visible:ring-border-info` でフォーカス表現
170
- - `hover:bg-bg-mute` で穏やかなホバー
283
+ - Start from a color transition over `--duration-fast` with `--easing-out`
284
+ - Express focus with `box-shadow: var(--shadow-ring-info)` on `:focus-visible`
285
+ - Keep hover gentle with `--color-bg-mute`
171
286
 
172
287
  **DON'T:**
173
288
 
174
- - bounce / spring 系のイージング
175
- - 300ms を超えるアニメーション
176
- - ホバーに強い原色を使う
289
+ - Use bounce or spring easing
290
+ - Animate for longer than 300ms
291
+ - Use a strong primary color on hover
177
292
 
178
- > [インタラクション詳細](references/interaction-design.md)
293
+ > [Interaction details](references/interaction-design.md)
179
294
 
180
- ## コンポーネント使用の原則
295
+ ## Component usage principles
181
296
 
182
297
  ### Button
183
298
 
184
- `color` と `variant` で統一されたスタイル。ピル型(`rounded-full`)。
299
+ Styling is unified through `color` and `variant`. Pill-shaped (`--radius-full`).
185
300
 
186
301
  ```tsx
187
302
  import { Button } from '@k8ordo/ui';
188
303
 
189
- // プライマリアクション
190
- <Button color="primary" variant="solid">保存する</Button>
304
+ // Primary action
305
+ <Button color="primary" variant="solid">Save</Button>
191
306
 
192
- // セカンダリアクション
193
- <Button color="base" variant="outline">キャンセル</Button>
307
+ // Secondary action
308
+ <Button color="base" variant="outline">Cancel</Button>
194
309
 
195
- // テキストのみ
196
- <Button variant="skeleton">詳細を見る</Button>
310
+ // Text only
311
+ <Button variant="skeleton">View details</Button>
197
312
 
198
- // リンクとしてレンダーする(renderItem prop)
313
+ // Render as a link (renderItem prop). The bag holds everything the <button>
314
+ // would have received, so drop the two <button>-only members and spread the
315
+ // rest: className, children, ref, onClick, aria-disabled, aria-busy, and any
316
+ // attribute passed to Button all ride along.
199
317
  <Button
200
318
  color="base"
201
- renderItem={({ className, children }) => (
202
- <a className={className} href="/settings">{children}</a>
319
+ renderItem={({ children, disabled: _disabled, type: _type, ...props }) => (
320
+ <a href="/settings" {...props}>{children}</a>
203
321
  )}
204
322
  >
205
- 設定へ
323
+ Settings
206
324
  </Button>
207
325
  ```
208
326
 
209
327
  ### IconButton
210
328
 
211
- `color` prop でスタイルを制御(`variant` ではない)。`label` は必須。
329
+ Styling is controlled by `color` (not `variant`). `label` is required.
212
330
 
213
331
  ```tsx
214
332
  import { IconButton } from '@k8ordo/ui';
215
333
 
216
- <IconButton color="transparent" label="コピー"><CopyIcon /></IconButton>
217
- <IconButton color="primary" label="送信"><SendIcon /></IconButton>
334
+ <IconButton color="transparent" label="Copy"><CopyIcon /></IconButton>
335
+ <IconButton color="primary" label="Send"><SendIcon /></IconButton>
218
336
 
219
- // リンクとしてレンダーする(renderItem prop)
337
+ // Render as a link (renderItem prop). triggerProps holds the tooltip wiring
338
+ // and the merged ref; spread it alongside the rest.
220
339
  <IconButton
221
340
  color="base"
222
- label="ホーム"
223
- renderItem={({ className, children, 'aria-label': ariaLabel, triggerProps }) => (
224
- <a aria-label={ariaLabel} className={className} href="/home" {...triggerProps}>
341
+ label="Home"
342
+ renderItem={({ children, disabled: _disabled, triggerProps, type: _type, ...props }) => (
343
+ <a href="/home" {...props} {...triggerProps}>
225
344
  {children}
226
345
  </a>
227
346
  )}
@@ -230,27 +349,48 @@ import { IconButton } from '@k8ordo/ui';
230
349
  </IconButton>
231
350
  ```
232
351
 
352
+ ### CopyButton
353
+
354
+ For copying text, reach for `CopyButton` rather than an `IconButton` and your own
355
+ clipboard code: it writes to the clipboard, shows a check, and announces the
356
+ result to screen readers.
357
+
358
+ ```tsx
359
+ import { CopyButton } from '@k8ordo/ui';
360
+
361
+ <CopyButton value={code} label="Copy code" iconOnly size="sm" />
362
+ <CopyButton value={() => window.location.href} label="Copy link" />
363
+ ```
364
+
233
365
  ### Card
234
366
 
235
- シャドウで浮かせるのが基本。ページ背景 `bg-subtle` の上に白カード。
367
+ Floating on a shadow is the default: a white card over a `--color-bg-subtle`
368
+ page. The card has no padding of its own.
369
+
370
+ ```css
371
+ /* card.module.css */
372
+ .body {
373
+ padding: calc(var(--spacing) * 6);
374
+ }
375
+ ```
236
376
 
237
377
  ```tsx
238
378
  import { Card } from '@k8ordo/ui';
239
379
 
240
- // 静的カード(シャドウで浮かせる)
380
+ // Static card (floated with a shadow)
241
381
  <Card variant="shadow">
242
- <div className="p-8">カードのコンテンツ</div>
382
+ <div className={styles.body}>Card content</div>
243
383
  </Card>
244
384
 
245
- // クリック可能なカード(interactive でホバー時にスケールアップ)
385
+ // Clickable card (interactive scales it up on hover)
246
386
  <Card variant="shadow" interactive>
247
- <div className="p-8">コンテンツ</div>
387
+ <div className={styles.body}>Content</div>
248
388
  </Card>
249
389
  ```
250
390
 
251
- ### フォーム
391
+ ### Forms
252
392
 
253
- `FormControl` + 各フォームコンポーネントの `renderInput` パターン。
393
+ `FormControl` plus each form component's `renderInput` pattern.
254
394
 
255
395
  ```tsx
256
396
  import {
@@ -261,14 +401,14 @@ import {
261
401
  TextField,
262
402
  } from '@k8ordo/ui';
263
403
 
264
- <FormControl label="メール" required renderInput={(props) => (
404
+ <FormControl label="Email" required renderInput={(props) => (
265
405
  <TextField {...props} placeholder="example@mail.com" />
266
406
  )} />
267
407
 
268
- <FormControl label="カテゴリ" renderInput={(props) => (
408
+ <FormControl label="Category" renderInput={(props) => (
269
409
  <Select
270
410
  {...props}
271
- options={[{ value: '1', label: 'オプション1' }]}
411
+ options={[{ value: '1', label: 'Option 1' }]}
272
412
  value={value}
273
413
  onChange={onChange}
274
414
  />
@@ -277,48 +417,90 @@ import {
277
417
  <FileField.Root accept="image/*" multiple>
278
418
  <FileField.Trigger
279
419
  renderItem={({ onClick, disabled }) => (
280
- <Button disabled={disabled} onClick={onClick}>ファイルを選択</Button>
420
+ <Button disabled={disabled} onClick={onClick}>Choose files</Button>
281
421
  )}
282
422
  />
283
423
  <FileField.ItemList />
284
424
  </FileField.Root>
285
425
  ```
286
426
 
287
- ## アンチパターン: 「AI スロップ」を避ける
288
-
289
- AI が生成したと一目でわかるUIの特徴を避ける。
427
+ With `@k8ordo/form`, spread what `form.field(name).input` derives onto the
428
+ field after `FormControl`'s props — `type`, `required`, the length and range
429
+ bounds, and the echoed `defaultValue` all go in as they are, whichever field
430
+ renders them. Uncontrolled fields keep their value in the DOM, so the form's
431
+ reset, `isDirty`, and error clearing hear every change, including ones a
432
+ component makes in code. The pairing per component is in `@k8ordo/form`'s
433
+ guide (`node_modules/@k8ordo/form/docs/GUIDE.md`, "Working with @k8ordo/ui").
290
434
 
291
- | アンチパターン | k8ordo UI での代替 |
292
- | ------------------------------ | -------------------------------------------------- |
293
- | パープルグラデーション | Teal/Cyan のフラットカラー |
294
- | Card in Card(入れ子カード) | Separator + 余白で区切り |
295
- | グレー背景にグレーテキスト | `text-fg-base` / `text-fg-mute` のコントラスト確保 |
296
- | bounce / spring アニメーション | `transition-colors duration-150 ease-out` |
297
- | Inter フォント | Noto Sans JP / M PLUS 2 |
298
- | 過剰な glassmorphism | border + subtle な背景色 |
299
- | 情報の詰め込み | 余白を活かした疎な配置 |
300
-
301
- ### AI スロップテスト
302
-
303
- > このUIを誰かに見せて「AIが作った」と言ったら、すぐに信じるだろうか?
304
- > もし「はい」なら、それが問題だ。
305
-
306
- ## 実装の原則
307
-
308
- - **既存コンポーネントを使う**: カスタムUIの前にまず k8ordo UI コンポーネントを探す
309
- - **セマンティックトークンを使う**: 生のカラー値(`bg-teal-500`)ではなくトークン(`bg-primary-bg`)
310
- - **空間と形で魅せる**: 色の華やかさではなく、余白と角丸の柔らかさで個性を出す
311
- - **ダークモードを忘れない**: セマンティックトークンを使えば自動対応
312
- - **アクセシビリティ**: `aria-label`, キーボードナビゲーション, カラーだけに頼らない状態表現
313
-
314
- ## 詳細リファレンス
435
+ ```tsx
436
+ const title = form.field('title');
437
+
438
+ <FormControl
439
+ errorText={title.error}
440
+ invalid={title.invalid}
441
+ label="Title"
442
+ required={title.required}
443
+ renderInput={(props) => <TextField {...props} {...title.input} />}
444
+ />;
445
+ ```
315
446
 
316
- - タイポグラフィ: [references/typography.md](references/typography.md)
317
- - カラーシステム: [references/color.md](references/color.md)
318
- - スペーシング・レイアウト: [references/spatial-design.md](references/spatial-design.md)
319
- - インタラクション: [references/interaction-design.md](references/interaction-design.md)
320
- - コンポーネント一覧: [references/components.md](references/components.md)
321
- - Hooks: [references/hooks.md](references/hooks.md)
322
- - ヘルパー・型: [references/helpers.md](references/helpers.md)
323
- - AI チャット(Conversation / Message / PromptInput など): [references/ai-chat.md](references/ai-chat.md)
324
- - 生成 UI(json-render / OpenUI で LLM に UI を生成させる): [references/generative-ui.md](references/generative-ui.md)
447
+ ## Anti-patterns: avoiding "AI slop"
448
+
449
+ Avoid the traits that make a UI recognizably AI-generated at a glance.
450
+
451
+ | Anti-pattern | The @k8ordo/ui alternative |
452
+ | -------------------------- | --------------------------------------------------------- |
453
+ | Purple gradients | Flat teal/cyan color |
454
+ | Card in Card | A Separator and spacing instead |
455
+ | Grey text on a grey ground | Hold contrast with `--color-fg-base` / `--color-fg-mute` |
456
+ | Bounce / spring animation | A color transition over `--duration-fast`, `--easing-out` |
457
+ | The Inter typeface | Noto Sans JP / M PLUS 2 |
458
+ | Heavy glassmorphism | A border plus a subtle background color |
459
+ | Cramming information in | Sparse placement that lets the space breathe |
460
+
461
+ ### The AI slop test
462
+
463
+ > Show this UI to someone and tell them an AI made it. Would they believe it
464
+ > immediately? If yes, that is the problem.
465
+
466
+ ## Implementation principles
467
+
468
+ - **Use the existing components**: look for a @k8ordo/ui component before building custom UI
469
+ - **Render from Server Components**: every component, compound ones included (`Dialog.Root`, `Tabs.Root`, …), can be placed in a Server Component; only the interactive parts are client modules
470
+ - **Keep placed state in `@k8ordo/state`**: state that lives in the URL, a history entry, localStorage, or memory is `defineLocalState` and friends, not a hook from this package
471
+ - **Browser-only rendering is React's**: a component that can only render in a browser calls `use(browser())` (`browser` from `react-dom`) under a `<Suspense>`; there is no `useClient` here and no "mounted" flag
472
+ - **Use semantic tokens**: tokens (`--color-primary-bg`), never raw color values or the palette (`--teal-500`)
473
+ - **Let space and shape carry it**: character comes from spacing and soft radii, not from vivid color
474
+ - **Do not forget dark mode**: semantic tokens handle it for you
475
+ - **High contrast is handled too**: the tokens follow `prefers-contrast: more` and the components stay legible under `forced-colors: active`; for your own UI, see [High contrast and forced colors](references/color.md#high-contrast-and-forced-colors)
476
+ - **Accessibility**: `aria-label`, keyboard navigation, and state that does not rely on color alone
477
+
478
+ ## Testing
479
+
480
+ Run component tests in a real browser — Vitest browser mode or Playwright —
481
+ the way this library tests itself. Every interactive component is built
482
+ directly on APIs a browser has and jsdom does not: `ResizeObserver`,
483
+ `IntersectionObserver`, `matchMedia`, `HTMLDialogElement`'s `showModal` /
484
+ `close`, and the Popover API. None of them is called through a support check,
485
+ so under jsdom `Tooltip`, `IconButton` (unless `tooltipDisabled`), `Tabs`,
486
+ `Autocomplete`, `Combobox`, `Toolbar`, `ResizablePanels`, `InView`, `Resize`,
487
+ and `Conversation` throw as soon as they mount; `Modal`, `CommandPalette`,
488
+ `Drawer`, `Popover`, `DropdownMenu`, `ContextMenu`, `ListBox`, and `DatePicker`
489
+ throw the moment they open (a `DropdownMenu` holding a `SubMenu` already at
490
+ mount); and a `clearable` `FileField.ItemList` throws once it lists a file.
491
+
492
+ This is not a gap to be stubbed around. A synthetic DOM (jsdom, happy-dom) has
493
+ no layout engine, so even with stubs in place a passing assertion about focus,
494
+ placement, or visibility there means very little — the thing you wanted to
495
+ check is the thing it cannot model.
496
+
497
+ ## Detailed reference
498
+
499
+ - Typography: [references/typography.md](references/typography.md)
500
+ - Color system: [references/color.md](references/color.md)
501
+ - Spacing and layout: [references/spatial-design.md](references/spatial-design.md)
502
+ - Interaction: [references/interaction-design.md](references/interaction-design.md)
503
+ - Component catalog: [references/components.md](references/components.md)
504
+ - Types: [references/types.md](references/types.md)
505
+ - AI chat (Conversation / Message / PromptInput, …): [references/ai-chat.md](references/ai-chat.md)
506
+ - Generative UI (having an LLM generate UI via json-render / OpenUI): [references/generative-ui.md](references/generative-ui.md)