@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
@@ -1,66 +1,182 @@
1
- # 生成 UI(json-render / OpenUI)
1
+ # Generative UI (json-render / OpenUI)
2
2
 
3
- k8ordo UI は、LLM が k8ordo UI コンポーネントだけで UI を生成できる公式アダプタを同梱している。生成される UI はデザイントークンに固定され、ブランドから外れない。フレームワークは [json-render](https://json-render.dev) と [OpenUI](https://www.openui.com) の 2 つ。
3
+ `@k8ordo/ui` ships official adapters that let an LLM generate UI out of
4
+ `@k8ordo/ui` components only. The generated UI is pinned to the design tokens,
5
+ so it cannot drift off-brand. Two frameworks are supported:
6
+ [json-render](https://json-render.dev) and [OpenUI](https://www.openui.com).
4
7
 
5
- いずれも optional peer dependency なので、使うフレームワークだけインストールする。
8
+ Both are optional peer dependencies — install only the one you use.
6
9
 
7
10
  ```bash
8
11
  # json-render
9
12
  pnpm add @json-render/core @json-render/react zod
10
- # OpenUI
11
- pnpm add @openuidev/react-lang zod
12
- # OpenUI のサーバー安全な prompt エントリを使う場合は追加で:
13
- pnpm add @openuidev/lang-core
13
+ # OpenUI — both entries import lang-core directly, so install both packages
14
+ pnpm add @openuidev/react-lang @openuidev/lang-core zod
15
+ ```
16
+
17
+ `@openuidev/lang-core` is not optional for OpenUI: `@k8ordo/ui/openui` builds its
18
+ component library with it and `@k8ordo/ui/openui/prompt` is the React-free entry
19
+ on top of it. `@openuidev/react-lang` depends on it as well, but pnpm will not
20
+ let your app resolve a dependency of a dependency — declare it yourself.
21
+
22
+ Both frameworks are 0.x, where a minor bump is a breaking release, so
23
+ `@k8ordo/ui` declares a range that stops at the next minor. The peer table in
24
+ the package's README (`node_modules/@k8ordo/ui/README.md` when installed via
25
+ npm) lists the current range for each package. Pick a version inside it.
26
+
27
+ Within that range, resolve exactly **one copy** of each framework. The adapters
28
+ read the framework's own React context — `useStateField` for OpenUI,
29
+ `useBoundProp` for json-render — so if your app and `@k8ordo/ui` end up on two
30
+ different copies, the context objects are different objects: every schema check,
31
+ the types, and the build all pass, and the form views throw
32
+ `useOpenUI must be used within a <Renderer /> component.` at render time. With
33
+ pnpm this happens as soon as your version differs from the one `@k8ordo/ui`
34
+ resolves, even when both satisfy the range.
35
+
36
+ ## What the catalog covers
37
+
38
+ Both adapters register the same components, and the prompts they generate list
39
+ them. Most are the exported component of the same name. A few are shaped for a
40
+ model instead:
41
+
42
+ - **Icons** are one `Icon` entry whose `name` picks the glyph from a curated
43
+ set of icons that need nothing but a size. `ChevronIcon` has an entry of its
44
+ own, and `AlertIcon` is the `StatusIcon` entry.
45
+ - **Toasts** are a `Toast` entry, standing in for `ToastProvider` and
46
+ `useToast`: a self-contained widget whose `triggerLabel` button shows the
47
+ toast.
48
+ - **Overlays** (`Modal`, `Dialog`, `Drawer`, `Popover`, `Tooltip`,
49
+ `DropdownMenu`) are self-contained widgets too. Each declares its own trigger
50
+ with `triggerLabel` and handles opening and closing itself.
51
+ - **Compound components** (`Tabs`, `Accordion`, `Table`, `Breadcrumb`, …) are
52
+ one entry each, with their parts flattened into data such as
53
+ `tabs: [{ label, content }]`. `Carousel` is one container entry whose
54
+ children are its slides, one child per slide.
55
+ - **Kbd** takes `keys: string[]` and draws the whole shortcut, one key cap per
56
+ entry, where the component itself is one key.
57
+
58
+ Every other component the package exports is either in the catalog or in the
59
+ list below, and the package's tests keep it that way.
60
+
61
+ ## What the catalog leaves out
62
+
63
+ These exports are left out on purpose, so a model cannot place them:
64
+
65
+ - `ContextMenu` — it opens on a right-click, which nothing on screen invites,
66
+ so actions put in it would be hidden in a generated UI. It belongs on your
67
+ application's own content (a file, a row).
68
+ - `InView`, `Resize` — they report to a callback and draw nothing of their own,
69
+ and a spec has no code to receive the report.
70
+ - `UIProvider` — your application mounts it once, around the generated UI as
71
+ well.
72
+ - `PortalRootProvider`, `usePortalRoot` — wiring for your own `createPortal`
73
+ calls. The generated overlays open their own surfaces.
74
+ - `Conversation`, `Message`, `PromptInput`, `Reasoning`, `Suggestion`,
75
+ `ToolInvocation`, `Attachment`, and `Source` from `@k8ordo/ui/ai`, and
76
+ `Response` from
77
+ `@k8ordo/ui/ai/response` — the chat the generated UI is shown in. Your
78
+ application builds it from its message stream; a spec does not place it.
79
+ - `CodeBlock` from `@k8ordo/ui/code-block` — it highlights on the server, as an
80
+ async Server Component. The generated UI renders on the client, where it
81
+ cannot run, and placing it there would ship the highlighter to the browser.
82
+ `Code` (inline code) is in the catalog.
83
+ - `CommandPalette` — every item runs a function of your application, which a
84
+ spec cannot write, and it is chrome your application opens from a shortcut
85
+ rather than something placed in a reply. For actions inside the generated UI,
86
+ use `Button` or `DropdownMenu`.
87
+ - `ResizablePanels` — it divides a parent of fixed size into a workspace, the
88
+ frame an application draws around its content. The generated UI flows inside
89
+ a message and has no height to divide; to set things side by side, use
90
+ `Grid`.
91
+ - `Prose` — it typesets the bare HTML that Markdown renders to. A spec places
92
+ components, which keep their own look, so it would have nothing to typeset;
93
+ lay a flow out with `Stack`.
94
+ - `TableOfContents` — it points at the ids of the document's headings and
95
+ follows the scroll. The headings a spec places carry no id, so there would be
96
+ nothing to point at.
97
+
98
+ ## Prompt language
99
+
100
+ Everything the adapters hand the model — component descriptions, `uiRules`,
101
+ schema descriptions, and the repair prompt — is English, whatever your
102
+ application's locale. The model reads it; your users never see it. To pin the
103
+ language of the text the model writes into the UI, add a rule of your own:
104
+
105
+ ```tsx
106
+ // json-render
107
+ catalog.prompt({ customRules: [...uiRules, 'Write all UI text in Japanese.'] });
108
+ // OpenUI
109
+ prompt({ additionalRules: ['Write all UI text in Japanese.'] });
14
110
  ```
15
111
 
16
112
  ## json-render
17
113
 
18
- catalog(スキーマ・プロンプト)と registry(描画)が分かれており、catalog は**サーバー安全**。
114
+ The catalog (schemas and prompt) is separate from the registry (rendering), and
115
+ the catalog is **server-safe**.
19
116
 
20
- ### 1. サーバーでプロンプトを生成する
117
+ ### 1. Generate the prompt on the server
21
118
 
22
119
  ```tsx
23
120
  import { catalog, uiRules } from '@k8ordo/ui/json-render';
24
121
 
25
- // customRules は LLM が破りやすい横断制約を注入する
26
- // (Table のセル数を columns に一致 / href の形式 / Tabs・Accordion の content はテキストのみ)。
122
+ // customRules injects the cross-cutting constraints an LLM most often breaks
123
+ // (cell count matching columns in Table, href format, text-only content in
124
+ // Tabs and Accordion).
27
125
  const systemPrompt = catalog.prompt({ customRules: [...uiRules] });
28
126
  ```
29
127
 
30
- ### 2. クライアントで描画する
128
+ ### 2. Render on the client
31
129
 
32
- `JsonRenderUI` が `JSONUIProvider` + `Renderer` + registry を内部結線済みなので、spec を渡すだけでよい。フォーム値を回収するときは `onStateChange` を渡す。
130
+ `JsonRenderUI` already wires up `JSONUIProvider` + `Renderer` + registry
131
+ internally, so passing the spec is enough. Pass `onStateChange` when you need to
132
+ collect form values.
33
133
 
34
134
  ```tsx
35
135
  'use client';
136
+ import type { UISpec } from '@k8ordo/ui/json-render';
36
137
  import { JsonRenderUI } from '@k8ordo/ui/json-render/registry';
37
138
 
38
- export function GenUi({ spec }: { spec: unknown }) {
139
+ export function GenUi({ spec }: { spec: UISpec }) {
39
140
  return <JsonRenderUI spec={spec} />;
40
141
  }
41
142
  ```
42
143
 
43
- 高度な構成(独自の `navigate` / `handlers` / `validationFunctions`)が必要なら、低レベルの `registry` を `@json-render/react` の `JSONUIProvider` / `Renderer` に直接渡す。
144
+ Props:
44
145
 
45
- ### 3. LLM 出力を検証して描画 or 修復する
146
+ - `spec`: `Spec | null` (required; a `UISpec` is assignable to json-render's `Spec` without a cast, and `null` renders nothing)
147
+ - `loading`: boolean (passed to `Renderer`: set it while the spec is still streaming in, so children that have not arrived yet are skipped without a warning)
148
+ - `onStateChange`: `(changes: Array<{ path: string; value: unknown }>) => void` (called once per state update with every changed path and its new value)
46
149
 
47
- `validateGeneratedSpec` は機械修正 → 構造検証 → コンポーネントごとの props 検証を行い、失敗時はそのまま LLM に投げ返せる修復プロンプトを返す。`catalog.validate()` は現行の上流バージョンで正常 spec を誤って弾くため、こちらを使う。
150
+ For an advanced setup (your own `navigate`, `handlers`, or
151
+ `validationFunctions`), pass the low-level `registry` straight to
152
+ `@json-render/react`'s `JSONUIProvider` / `Renderer`.
153
+
154
+ ### 3. Validate LLM output, then render or repair it
155
+
156
+ `validateGeneratedSpec` applies mechanical fixes, validates the structure, then
157
+ validates props per component. On failure it returns the `issues` it found (each
158
+ a `message`, plus the `elementKey` of the offending element when there is one)
159
+ and a repair prompt built from them that you can send straight back to the LLM.
160
+ Use it instead of `catalog.validate()`, which rejects valid specs in the current
161
+ upstream version. The result and issue types are exported as
162
+ `ValidateGeneratedSpecResult` and `GeneratedSpecIssue`.
48
163
 
49
164
  ```tsx
50
165
  import { validateGeneratedSpec } from '@k8ordo/ui/json-render';
51
166
 
52
167
  const result = validateGeneratedSpec(JSON.parse(llmOutput));
53
168
  if (result.ok) {
54
- // result.fixes に自動修正の内容
169
+ // result.fixes lists what was auto-corrected
55
170
  return <JsonRenderUI spec={result.spec} />;
56
171
  }
57
- // 壊れていたら修復プロンプトで再生成させる
172
+ // If it is broken, regenerate with the repair prompt
58
173
  const retried = await llm(result.repairPrompt);
59
174
  ```
60
175
 
61
- ### 4. 型付き spec(任意)
176
+ ### 4. Typed specs (optional)
62
177
 
63
- `satisfies UISpec` で書くと、component 名・props の typo がコンパイルエラーになり、`as unknown as Spec` が不要になる。
178
+ Writing `satisfies UISpec` turns a typo in a component name or prop into a
179
+ compile error, and removes the need for `as unknown as Spec`.
64
180
 
65
181
  ```tsx
66
182
  import type { UISpec } from '@k8ordo/ui/json-render';
@@ -74,11 +190,14 @@ const spec = {
74
190
  } satisfies UISpec;
75
191
  ```
76
192
 
77
- `ComponentName` / `ComponentProps<K>` も export されており、特定コンポーネントの props 型を取り出せる。
193
+ `UISpecElement` (one element of a `UISpec`), `ComponentName`, and
194
+ `ComponentProps<K>` are exported as well, so you can pull out the props type of a
195
+ specific component.
78
196
 
79
197
  ## OpenUI
80
198
 
81
- 子要素を型付きサブコンポーネント(`z.array(Child.ref)`)で表すモデル。描画は `'use client'`。
199
+ A model where children are expressed as typed subcomponents
200
+ (`z.array(Child.ref)`). Rendering is `'use client'`.
82
201
 
83
202
  ```tsx
84
203
  'use client';
@@ -90,23 +209,33 @@ export function GenUi({ response }: { response: string }) {
90
209
  }
91
210
  ```
92
211
 
93
- システムプロンプトはサーバー安全な専用エントリで生成できる(json-render の `catalog.prompt()` と対称)。
212
+ The system prompt comes from a dedicated server-safe entry, mirroring
213
+ json-render's `catalog.prompt()`.
94
214
 
95
215
  ```tsx
96
216
  import { prompt } from '@k8ordo/ui/openui/prompt';
97
217
 
98
- const systemPrompt = prompt(); // React 非依存。RSC / API ルートから呼べる
218
+ const systemPrompt = prompt(); // No React dependency — callable from RSC or an API route
99
219
  ```
100
220
 
101
- OpenUI では `Stack` / `Grid` の直下に `Stack` / `Grid` / `Card` を置けない(自己参照スキーマ非対応)。入れ子レイアウトが必要なら `Card` の中に `Stack` / `Grid` を入れる。json-render は slots ベースで自由に入れ子にできる。
221
+ `prompt` takes an optional `PromptOptions` from `@openuidev/lang-core`
222
+ (`preamble`, `additionalRules`, `examples`, …) and passes it straight through to
223
+ the library's prompt generation.
102
224
 
103
- ## エクスポート早見表
225
+ Containers nest freely in OpenUI, as they do in json-render: `Stack`, `Grid`,
226
+ `Card`, `Form`, `Modal`, `Dialog`, `Drawer`, and `Popover` each list every
227
+ container among their children, so a `Card` can sit inside a `Stack` and a
228
+ `Stack` inside another `Stack`.
104
229
 
105
- | エクスポート | 区分 | 内容 |
106
- | --------------------------------- | -------------- | ------------------------------------------------------------------ |
107
- | `@k8ordo/ui/json-render` | サーバー安全 | `catalog`, `validateGeneratedSpec`, `uiRules`, 型(`UISpec` など) |
108
- | `@k8ordo/ui/json-render/registry` | `'use client'` | `JsonRenderUI`(事前結線), `registry`(低レベル) |
109
- | `@k8ordo/ui/openui` | `'use client'` | `library`(描画) |
110
- | `@k8ordo/ui/openui/prompt` | サーバー安全 | `prompt()`(プロンプト生成) |
230
+ ## Exports at a glance
111
231
 
112
- > いずれも `@k8ordo/ui/styles.css`(Tailwind CSS 4 のプロジェクトは代わりに `@k8ordo/ui/tailwind.css`)の読み込みと `UIProvider` でのラップが前提。
232
+ | Export | Kind | Contents |
233
+ | --------------------------------- | -------------- | ------------------------------------------------------------------ |
234
+ | `@k8ordo/ui/json-render` | server-safe | `catalog`, `validateGeneratedSpec`, `uiRules`, types (`UISpec`, …) |
235
+ | `@k8ordo/ui/json-render/registry` | `'use client'` | `JsonRenderUI` (pre-wired), `registry` (low level) |
236
+ | `@k8ordo/ui/openui` | `'use client'` | `library` (rendering) |
237
+ | `@k8ordo/ui/openui/prompt` | server-safe | `prompt(options?)` (prompt generation) |
238
+
239
+ > All of them assume you have loaded `@k8ordo/ui/styles.css` (or
240
+ > `@k8ordo/ui/tailwind.css` after Tailwind, in a Tailwind CSS 4 project) and
241
+ > wrapped the tree in `UIProvider`.
@@ -1,77 +1,106 @@
1
- # インタラクションデザイン
2
-
3
- k8ordo UI のインタラクションは「静かな変化」を原則とする。
4
-
5
- ## インタラクティブ状態
6
-
7
- 8つの状態を意識して設計する。
8
-
9
- | 状態 | スタイル |
10
- | -------- | ----------------------------------------------------- |
11
- | Default | 基本スタイル |
12
- | Hover | `hover:bg-bg-mute` — 穏やかな色変化 |
13
- | Focus | `focus-visible:ring-2 focus-visible:ring-border-info` |
14
- | Active | `active:bg-bg-emphasize` |
15
- | Disabled | `opacity-50 cursor-not-allowed` |
16
- | Loading | スピナーまたはスケルトン |
17
- | Selected | `bg-primary-bg-subtle` |
18
- | Error | `border-border-error` + `text-fg-error` |
19
-
20
- ## トランジション
21
-
22
- 控えめで自然な動き。
23
-
24
- | 用途 | 推奨設定 |
25
- | -------------------- | ------------------------------------------ |
26
- | ホバー色変化 | `transition-colors duration-150 ease-out` |
27
- | 透過度変化 | `transition-opacity duration-200 ease-out` |
28
- | サイズ変化を伴う場合 | `transition-all duration-150 ease-out` |
29
-
30
- ### タイミングの原則
31
-
32
- - **100ms**: 即時フィードバック(ボタンプレス)
33
- - **150–200ms**: 標準トランジション(ホバー、フォーカス)
34
- - **300ms**: 開閉アニメーション(Accordion, Drawer の限度)
35
- - **300ms を超えない** — 重く感じる
36
-
37
- ### アニメーションの選択
38
-
39
- ```tsx
40
- // Good: transition-colors(色だけ変わる)
41
- className = 'transition-colors hover:bg-bg-mute';
42
-
43
- // OK: transition-all(複数のプロパティが変わる場合のみ)
44
- className = 'transition-all hover:bg-bg-mute hover:scale-[1.02]';
45
-
46
- // Bad: bounce, spring 系のイージング
47
- className = 'animate-bounce';
1
+ # Interaction design
2
+
3
+ Interaction in `@k8ordo/ui` follows one principle: quiet change.
4
+
5
+ ## Interactive states
6
+
7
+ Design with these eight states in mind.
8
+
9
+ | State | Style |
10
+ | -------- | --------------------------------------------------------- |
11
+ | Default | The base style |
12
+ | Hover | `--color-bg-mute` — a gentle color shift |
13
+ | Focus | `box-shadow: var(--shadow-ring-info)` on `:focus-visible` |
14
+ | Active | `--color-bg-emphasize` |
15
+ | Disabled | `opacity: 0.5; cursor: not-allowed` |
16
+ | Loading | A spinner or a skeleton |
17
+ | Selected | `--color-primary-bg-subtle` |
18
+ | Error | `--color-border-error` + `--color-fg-error` |
19
+
20
+ ## Transitions
21
+
22
+ Restrained, natural motion.
23
+
24
+ | Purpose | Recommended setting |
25
+ | ------------------------------ | -------------------------------------------------------- |
26
+ | Hover color change | the colors over `--duration-fast` with `--easing-out` |
27
+ | Opacity change | `opacity` over `--duration-moderate` with `--easing-out` |
28
+ | When size changes are involved | the changing properties over `--duration-fast` |
29
+ | A page or a panel replaced | `<ViewTransition>` — the browser's cross-fade |
30
+
31
+ `--duration-fast` is 150ms, `--duration-moderate` 200ms and `--duration-slow`
32
+ 300ms. `--easing-out` and `--easing-in-out` are Tailwind's curves
33
+ (`cubic-bezier(0, 0, 0.2, 1)` and `cubic-bezier(0.4, 0, 0.2, 1)`), not the CSS
34
+ keywords of the same name. With `tailwind.css`: `transition-colors
35
+ duration-150 ease-out`.
36
+
37
+ ### Timing principles
38
+
39
+ - **100ms**: immediate feedback (a button press)
40
+ - **150–200ms**: the standard transition (hover, focus)
41
+ - **300ms**: open/close animation (the limit for Accordion, Drawer)
42
+ - **Never exceed 300ms** — it starts to feel heavy
43
+
44
+ ### Choosing an animation
45
+
46
+ ```css
47
+ /* Good: transition only the colors that change */
48
+ .item {
49
+ transition-property: color, background-color;
50
+ transition-duration: var(--duration-fast);
51
+ transition-timing-function: var(--easing-out);
52
+ }
53
+
54
+ @media (hover: hover) {
55
+ .item:hover {
56
+ background-color: var(--color-bg-mute);
57
+ }
58
+ }
59
+
60
+ /* OK: list every property when several change */
61
+ .card {
62
+ transition-property: background-color, scale;
63
+ transition-duration: var(--duration-fast);
64
+ transition-timing-function: var(--easing-out);
65
+ }
66
+
67
+ /* Bad: bounce or spring easing */
48
68
  ```
49
69
 
50
- ## フォーカス管理
70
+ ## Focus management
51
71
 
52
- - `focus-visible` を使う(`focus` ではなく)— マウスクリック時にリングが出ない
53
- - フォーカスリングは `ring-border-info` で統一
54
- - `outline-hidden` でデフォルトのアウトラインを消してから ring を適用
72
+ - Use `:focus-visible`, not `:focus` — no ring appears on a mouse click
73
+ - Keep the focus ring consistent with `--shadow-ring-info`
74
+ - Clear the default outline before applying the ring, and give it back under forced colors, where the ring (a shadow) disappears
75
+ - Keep focus on a button that is waiting on its own action: show the wait with `aria-busy` and `aria-disabled` and ignore presses, rather than setting `disabled`. Chromium moves focus to `body` when the focused element becomes disabled, so the keyboard user who pressed it loses their place. `Button` and `IconButton` do this for `onAction`
76
+ - For the same reason, a text field whose form's action is pending turns `readOnly`, not `disabled`, and ignores the keys that would change its value, so the user who pressed Enter in it keeps their place. `TextField`, `Textarea`, `PasswordInput`, `NumberField`, `DateField`, `DatePicker`, `ColorPicker`, `Combobox`, and `Autocomplete` do this. `readOnly` does not apply to a checkbox, radio, range, or select, yet Enter in one still submits the form through its submit button, so `Checkbox`, `Radio`, `Switch`, `Slider`, `RangeSlider`, and `Select` take `aria-disabled` instead and ignore what would change their value. A checkbox or radio cancels the click in the capture phase and stops it there: cancelled any later, React's change tracking has already recorded the toggle the browser then undoes, calls `onChange` for it, and misses the next real one. A range ignores the arrow, Home, End, and Page keys and the pointer; a select ignores those keys, Space, F4, typed characters, and the pointer
55
77
 
56
- ```tsx
57
- className =
58
- 'focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-border-info';
78
+ ```css
79
+ .control:focus-visible {
80
+ outline-style: none;
81
+ box-shadow: var(--shadow-ring-info);
82
+
83
+ @media (forced-colors: active) {
84
+ outline: 2px solid transparent;
85
+ outline-offset: 2px;
86
+ }
87
+ }
59
88
  ```
60
89
 
61
- ## フォームデザイン
90
+ ## Form design
62
91
 
63
- - ラベルは入力の上に配置(左配置は日本語で読みにくい)
64
- - エラーメッセージは入力の直下に `text-fg-error text-sm`
65
- - 必須マークは `*` でラベルの後ろに
66
- - バリデーションは送信時に行う(リアルタイムは控えめに)
67
- - `FormControl` コンポーネントでラベル・エラー表示を統一
92
+ - Put the label above the input (a left-aligned label reads badly in Japanese)
93
+ - Put the error message directly under the input, in `--color-fg-error` at `--font-size-sm`
94
+ - Mark required fields with `*` after the label
95
+ - Validate on submit; keep real-time validation to a minimum
96
+ - Use the `FormControl` component so labels and errors stay consistent
68
97
 
69
98
  ```tsx
70
99
  import { FormControl, TextField } from '@k8ordo/ui';
71
100
 
72
101
  <FormControl
73
- label="メールアドレス"
74
- errorText="入力してください"
102
+ label="Email address"
103
+ errorText="This field is required"
75
104
  required
76
105
  renderInput={(props) => (
77
106
  <TextField {...props} placeholder="example@mail.com" />
@@ -79,17 +108,18 @@ import { FormControl, TextField } from '@k8ordo/ui';
79
108
  />;
80
109
  ```
81
110
 
82
- ## アクセシビリティ
111
+ ## Accessibility
83
112
 
84
- - `aria-label` / `aria-describedby` を適切に設定
85
- - キーボードナビゲーションを確保(Tab, Enter, Escape, 矢印キー)
86
- - `prefers-reduced-motion` を考慮 — motion ライブラリが自動対応
87
- - カラーだけに頼らない状態表現(アイコンやテキストを併用)
113
+ - Set `aria-label` / `aria-describedby` where they belong
114
+ - Guarantee keyboard navigation (Tab, Enter, Escape, arrow keys)
115
+ - Respect `prefers-reduced-motion`. Under it the stylesheet turns off the open animation of Popover and what is built on it (DropdownMenu, ListBox, Tooltip), the Toast, Modal, and Drawer animations, the Tabs indicator slide, and every view transition; `Card`'s hover scale runs only under `prefers-reduced-motion: no-preference`. Skeleton's pulse, Spinner's spin, and the Accordion chevron, Switch thumb, and Progress bar transitions keep running. Put your own motion under `@media (prefers-reduced-motion: no-preference)`
116
+ - Never signal state with color alone; pair it with an icon or text
117
+ - The components follow `prefers-contrast: more` and stay legible under `forced-colors: active` (see [High contrast and forced colors](./color.md#high-contrast-and-forced-colors)); do the same in your own UI
88
118
 
89
- ## やってはいけないこと
119
+ ## What not to do
90
120
 
91
- - bounce / spring 系のイージング
92
- - 300ms を超えるアニメーション
93
- - ホバーに強い原色(`bg-primary-bg`)を使う
94
- - `cursor-pointer` をボタン以外に付ける(リンクにも不要)
95
- - ダブルクリック防止なしの送信ボタン
121
+ - Bounce or spring easing
122
+ - Animation longer than 300ms
123
+ - A strong primary color (`--color-primary-bg`) on hover
124
+ - `cursor: pointer` on anything that is not a button (links do not need it either)
125
+ - A submit button with no double-click guard