@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,137 +1,159 @@
1
- # スペーシング・レイアウト
1
+ # Spacing and layout
2
2
 
3
- k8ordo UI は「余白で語る」デザイン。詰め込まず、空間にゆとりを持たせる。
3
+ `@k8ordo/ui` is a design that lets the spacing speak. Do not pack things in;
4
+ leave room.
4
5
 
5
- ## スペーシングの原則
6
+ ## Spacing principles
6
7
 
7
- 4pt ベースのスペーシングシステム。Tailwind の標準スケールを使用。
8
+ A 4pt spacing system: one token, `--spacing` (0.25rem), multiplied by the step
9
+ you want — `calc(var(--spacing) * 6)` is 1.5rem. With `tailwind.css`, the
10
+ step is the utility's number (`p-6`, `gap-8`).
8
11
 
9
- ### コンポーネント内部パディング
12
+ ### Padding inside a component
10
13
 
11
- | 用途 | クラス | 値 |
12
- | -------------- | ------ | ---- |
13
- | コンパクト | `p-4` | 16px |
14
- | 標準 | `p-6` | 24px |
15
- | ゆったり | `p-8` | 32px |
16
- | 大きなカード内 | `p-10` | 40px |
14
+ | Use | Step | Value |
15
+ | ----------------- | ---- | ----- |
16
+ | Compact | 4 | 16px |
17
+ | Standard | 6 | 24px |
18
+ | Generous | 8 | 32px |
19
+ | Inside a big card | 10 | 40px |
17
20
 
18
- ### テキスト間の余白
21
+ ### Spacing between blocks of text
19
22
 
20
- | 関係性 | クラス | 用途 |
21
- | -------------- | ------- | ---------------------------- |
22
- | 近い要素 | `mt-2` | 説明テキスト、ヘルプテキスト |
23
- | 標準 | `mt-4` | 段落間、フォームフィールド間 |
24
- | セクション間 | `mt-8` | セクション区切り |
25
- | 大セクション間 | `mt-12` | ページレベルの区切り |
23
+ | Relationship | Step | Use |
24
+ | ---------------------- | ---- | --------------------------------------- |
25
+ | Closely related | 2 | Descriptions, help text |
26
+ | Standard | 4 | Between paragraphs, between form fields |
27
+ | Between sections | 8 | A section break |
28
+ | Between major sections | 12 | A page-level break |
26
29
 
27
- ### セクション間の余白
30
+ ### Spacing between sections
28
31
 
29
- | 関係性 | クラス | 用途 |
30
- | ------------ | ------------------- | -------------------------- |
31
- | カード間 | `gap-6` | 横並びカード(グリッド内) |
32
- | セクション間 | `gap-8` 〜 `gap-10` | 縦に並ぶセクション |
32
+ | Relationship | Step | Use |
33
+ | ---------------- | ------ | ------------------------------ |
34
+ | Between cards | 6 | Cards side by side (in a grid) |
35
+ | Between sections | 8 – 10 | Sections stacked vertically |
33
36
 
34
- ## 角丸
37
+ ## Border radius
35
38
 
36
- **「触れるものは柔らかく、読むものは端正に」**
39
+ **"Soft where you touch, precise where you read."**
37
40
 
38
- 要素の性格に応じて角丸を使い分ける。
41
+ Vary the radius with the element's role.
39
42
 
40
- ### 触れるもの(柔らかく)
43
+ ### Things you touch (soft)
41
44
 
42
- | 用途 | クラス | 値 |
43
- | ----------------------------- | -------------- | ------ |
44
- | Button | `rounded-full` | ピル型 |
45
- | Input, Textarea, Select | `rounded-xl` | 1rem |
46
- | Card, CheckboxCard, RadioCard | `rounded-xl` | 1rem |
45
+ | Use | Token | Value |
46
+ | ----------------------------- | --------------- | ----- |
47
+ | Button | `--radius-full` | Pill |
48
+ | Input, Textarea, Select | `--radius-xl` | 1rem |
49
+ | Card, CheckboxCard, RadioCard | `--radius-xl` | 1rem |
47
50
 
48
- ### 読むもの(端正に)
51
+ ### Things you read (precise)
49
52
 
50
- | 用途 | クラス | 値 |
51
- | -------- | -------------- | ---------------------------- |
52
- | Alert | `rounded-lg` | 0.75rem |
53
- | Badge | `rounded-full` | ピル型(小さいので問題ない) |
54
- | Tabs | 現行のまま | |
55
- | Checkbox | `rounded-md` | 0.5rem |
53
+ | Use | Token | Value |
54
+ | -------- | --------------- | ------------------------------ |
55
+ | Alert | `--radius-lg` | 0.75rem |
56
+ | Callout | `--radius-lg` | 0.75rem |
57
+ | Badge | `--radius-full` | Pill (fine, since it is small) |
58
+ | Tabs | As-is | |
59
+ | Checkbox | `--radius-md` | 0.5rem |
56
60
 
57
- ### その他
61
+ ### Everything else
58
62
 
59
- | 用途 | クラス |
60
- | ---------------------------------- | -------------- |
61
- | Dialog, Modal | `rounded-lg` |
62
- | Avatar, IconButton, プログレスバー | `rounded-full` |
63
+ | Use | Token |
64
+ | -------------------------------- | --------------- |
65
+ | Dialog, Modal | `--radius-lg` |
66
+ | Avatar, IconButton, progress bar | `--radius-full` |
63
67
 
64
- ## シャドウ
68
+ With `tailwind.css` these are `rounded-full`, `rounded-xl`, … .
65
69
 
66
- ふんわり柔らかい影で奥行きを表現する。
70
+ ## Shadow
67
71
 
68
- | 用途 | スタイル |
69
- | ------------------------ | ------------------------------------------------------- |
70
- | Card(デフォルト) | `shadow-sm`(appearance="shadow" 時) |
71
- | Card(ボーダー) | `border border-border-mute`(appearance="bordered" 時) |
72
- | Modal / Dialog / Tooltip | `shadow-md` |
73
- | Dropdown / ListBox | `shadow-md` |
74
- | Button | なし |
72
+ Express depth with a soft, gentle shadow.
75
73
 
76
- `shadow-xl` 以上は使わない。
74
+ | Use | Style |
75
+ | ------------------------ | -------------------------------------------------------- |
76
+ | Card (default) | `--shadow-sm` (with `variant="shadow"`) |
77
+ | Card (outlined) | a 1px `--color-border-mute` border (`variant="outline"`) |
78
+ | Modal / Dialog / Tooltip | `--shadow-md` |
79
+ | Dropdown / ListBox | `--shadow-md` |
80
+ | Button | None |
77
81
 
78
- ## ページ構造
82
+ Never use `--shadow-xl` or heavier. The focus ring is a shadow too,
83
+ `--shadow-ring-info`; with a surface's own shadow, list the ring first:
84
+ `box-shadow: var(--shadow-ring-info), var(--shadow-xs)`.
79
85
 
80
- ### bg-subtle + 白カードの基本パターン
86
+ ## Page structure
81
87
 
82
- ページ背景を `bg-bg-subtle`(薄いグレー)にし、コンテンツを白いカードで浮かせる。
88
+ ### The bg-subtle plus white card pattern
89
+
90
+ Make the page background `--color-bg-subtle` (a light grey) and float the
91
+ content on white cards.
92
+
93
+ ```css
94
+ .page {
95
+ min-height: 100vh;
96
+ background-color: var(--color-bg-subtle);
97
+ }
98
+
99
+ .body {
100
+ padding: calc(var(--spacing) * 6);
101
+ }
102
+ ```
83
103
 
84
104
  ```tsx
85
- // Good: 灰色背景に白カードが浮く
86
- <div className="bg-bg-subtle min-h-screen">
87
- <Card appearance="shadow">
88
- <div className="p-8">コンテンツ</div>
105
+ // Good: a white card floating on a grey ground
106
+ <div className={styles.page}>
107
+ <Card variant="shadow">
108
+ <div className={styles.body}>Content</div>
89
109
  </Card>
90
110
  </div>
91
111
  ```
92
112
 
93
- ### 余白で階層を作る
113
+ ### Build hierarchy out of spacing
94
114
 
95
- ```tsx
96
- // Good: 余白の差で関連度を示す
97
- <section className="mt-12">
98
- <Heading level="h2">セクション</Heading>
99
- <p className="mt-2">直接関連する説明</p>
100
- <div className="mt-8">やや離れたコンテンツ</div>
101
- </section>
102
-
103
- // Bad: すべて同じ余白
104
- <section className="mt-4">
105
- <Heading level="h2">セクション</Heading>
106
- <p className="mt-4">説明</p>
107
- <div className="mt-4">コンテンツ</div>
108
- </section>
115
+ Let the size of the gap show how related things are: 12 steps above a
116
+ section, 2 between a heading and the description that belongs to it, 8 before
117
+ content that sits a little apart. The same gap everywhere flattens the page.
118
+
119
+ ```css
120
+ .section {
121
+ margin-top: calc(var(--spacing) * 12);
122
+ }
123
+
124
+ .description {
125
+ margin-top: calc(var(--spacing) * 2);
126
+ }
127
+
128
+ .content {
129
+ margin-top: calc(var(--spacing) * 8);
130
+ }
109
131
  ```
110
132
 
111
- ### カードは万能ではない
133
+ ### A card is not the answer to everything
112
134
 
113
- すべてのコンテンツをカードに入れる必要はない。余白とセパレーターで十分なケースが多い。
135
+ Content does not have to go in a card. Spacing and a separator are often enough.
114
136
 
115
137
  ```tsx
116
138
  import { Separator } from '@k8ordo/ui';
117
139
 
118
- // Good: セパレーターで区切る
140
+ // Good: divide with a separator (.divider { padding-block: calc(var(--spacing) * 8); })
119
141
  <div>
120
- <section>コンテンツA</section>
121
- <div className="py-8">
142
+ <section>Content A</section>
143
+ <div className={styles.divider}>
122
144
  <Separator />
123
145
  </div>
124
- <section>コンテンツB</section>
146
+ <section>Content B</section>
125
147
  </div>
126
148
 
127
- // 過剰: すべてカードに入れる
128
- <Card>コンテンツA</Card>
129
- <Card>コンテンツB</Card>
149
+ // Excessive: everything in a card
150
+ <Card>Content A</Card>
151
+ <Card>Content B</Card>
130
152
  ```
131
153
 
132
- ## やってはいけないこと
154
+ ## What not to do
133
155
 
134
- - `gap-1` や `p-1` のような極端に狭いスペーシング
135
- - コンテンツの詰め込み(情報密度より余白を優先)
136
- - ネストされたカード(Card in Card)
137
- - 12 を超える z-index 値
156
+ - Extremely tight spacing such as one step (`calc(var(--spacing) * 1)`)
157
+ - Cramming content in (space wins over information density)
158
+ - Nested cards (Card in Card)
159
+ - A z-index of your own: stack with `--z-index-raised` (inside a component), `--z-index-overlay`, `--z-index-modal` and `--z-index-toast`
@@ -0,0 +1,101 @@
1
+ # Types
2
+
3
+ The shared types `@k8ordo/ui` exports for typing component props.
4
+
5
+ ```tsx
6
+ import type {
7
+ Direction,
8
+ DrawerSide,
9
+ ModalSide,
10
+ Option,
11
+ Placement,
12
+ Status,
13
+ } from '@k8ordo/ui';
14
+ ```
15
+
16
+ ## Status
17
+
18
+ ```tsx
19
+ type Status = 'success' | 'info' | 'warning' | 'error';
20
+ ```
21
+
22
+ Used for the status of `Alert`, `Callout`, `Toast`, and `AlertIcon`. `Badge` takes its own `tone`, which also allows `'neutral'`.
23
+
24
+ ## Direction
25
+
26
+ ```tsx
27
+ type Direction = 'up' | 'down' | 'right' | 'left';
28
+ ```
29
+
30
+ Used to point ChevronIcon and similar icons.
31
+
32
+ ## Placement
33
+
34
+ ```tsx
35
+ type Placement =
36
+ | 'top'
37
+ | 'top-start'
38
+ | 'top-end'
39
+ | 'bottom'
40
+ | 'bottom-start'
41
+ | 'bottom-end'
42
+ | 'left'
43
+ | 'left-start'
44
+ | 'left-end'
45
+ | 'right'
46
+ | 'right-start'
47
+ | 'right-end';
48
+ ```
49
+
50
+ Placement relative to an anchor element, for Popover, Tooltip, DropdownMenu,
51
+ and ListBox (the `placement` prop), and for IconButton's tooltip
52
+ (`tooltipPlacement`).
53
+
54
+ ## ModalSide
55
+
56
+ ```tsx
57
+ type ModalSide = 'center' | 'bottom' | 'left' | 'right';
58
+ ```
59
+
60
+ Which viewport edge a Modal sticks to (the `side` prop). It is a different
61
+ idea from `Placement`, which is relative to an anchor, so the prop name differs
62
+ too.
63
+
64
+ ## DrawerSide
65
+
66
+ ```tsx
67
+ type DrawerSide = Extract<ModalSide, 'left' | 'right'>;
68
+ ```
69
+
70
+ The subset of `ModalSide` a Drawer accepts: a drawer always slides in from an
71
+ edge, so `center` is excluded.
72
+
73
+ ## Option
74
+
75
+ ```tsx
76
+ type Option = Readonly<{ value: string; label: string }>;
77
+ ```
78
+
79
+ Used for the choices in Radio, Select, Autocomplete, and similar components.
80
+
81
+ ## Component prop types
82
+
83
+ The root also exports types that belong to one component, for typing your own
84
+ code around it:
85
+
86
+ | Type | What it types |
87
+ | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
88
+ | `StackProps` / `GridProps` | Every prop of `Stack` / `Grid`, for a component that wraps one |
89
+ | `GapSize` / `PaddingSize` | The `none`–`xl` scale of `gap` (Stack, Grid) and `padding` (Stack) |
90
+ | `ButtonRenderItemProps` / `IconButtonRenderItemProps` | What `renderItem` receives on `Button` / `IconButton` |
91
+ | `IconButtonTriggerProps` | `Partial<TooltipTriggerProps>`: the tooltip wiring in `IconButtonRenderItemProps`' `triggerProps` |
92
+ | `PopoverTriggerProps` / `PopoverContentProps` / `TooltipTriggerProps` | What `renderItem` receives on `Popover.Trigger` / `Popover.Content` / `Tooltip.Trigger` |
93
+ | `ToolbarItemProps` | What `renderItem` receives on `Toolbar.Item`: `ref`, `tabIndex`, `onFocus` |
94
+ | `CommandPaletteItem` | A command in `CommandPalette`: `id`, `label`, `onSelect`, plus `group`, `keywords`, `shortcut` |
95
+ | `AlertAction` / `ToastAction` / `ToastOptions` | `Alert`'s `action`, and the `action` and `duration` a toast takes |
96
+ | `ColorPickerSwatch` | A preset in `ColorPicker`'s `swatches`: `value` (`#rrggbb`) and `label`, the color's name |
97
+ | `ComboboxSearch` | `Combobox`'s `search`: `(query, { signal }) => Promise<readonly Option[]>` |
98
+ | `CheckboxCardOption` / `RadioCardOption` | A choice in `CheckboxCard` / `RadioCard`: `value` and `label`, plus `description`, `visual`, `disabled` |
99
+ | `StepperStep` | A step in `Stepper`: `label`, plus `description` |
100
+ | `CellAlign` | A table cell's `align`: `'left'`, `'center'`, or `'right'` |
101
+ | `BaseIconProps` / `IconRenderProps` | An icon's `size`, and the props an icon puts on its `<svg>` |
@@ -1,110 +1,219 @@
1
- # タイポグラフィ
1
+ # Typography
2
2
 
3
- k8ordo UI のタイポグラフィは「読みやすさ」と「静けさ」を両立する。
3
+ Typography in `@k8ordo/ui` aims for readability and quiet at the same time.
4
4
 
5
- ## フォントファミリー
5
+ ## Font family
6
6
 
7
- 日本語最適化のフォントスタック。
7
+ A font stack tuned for Japanese: Noto Sans JP and M PLUS 2.
8
+
9
+ The library ships no font files and sets no font of its own: until your app
10
+ sets one, text stays on the reset's system stack, `--font-family-sans`
11
+ (Roboto included). Load the fonts yourself (fontsource, `next/font`, …), declare
12
+ them as tokens, and set the body:
8
13
 
9
14
  ```css
10
- font-family: 'Noto Sans JP', 'M PLUS 2', sans-serif;
15
+ :root {
16
+ --font-family-noto-sans-jp: 'Noto Sans JP', sans-serif;
17
+ --font-family-m-plus-2: 'M PLUS 2', sans-serif;
18
+ }
19
+
20
+ body {
21
+ font-family: var(--font-family-noto-sans-jp);
22
+ }
11
23
  ```
12
24
 
13
- - **Inter / Roboto / Open Sans は使わない** — AI が生成した感が出る
14
- - 日本語テキストが主体のため、和文フォントを優先
25
+ - `--font-family-sans` and `--font-family-mono` are the reset's stacks, which `body` and `code` / `kbd` / `pre` use until your app sets its own
26
+ - With `tailwind.css`, `--font-family-noto-sans-jp` and `--font-family-m-plus-2` back the `font-noto-sans-jp` and `font-m-plus-2` utilities. They are the only font-family utilities; the theme removes `font-sans`, `font-serif`, and `font-mono`
27
+ - **Do not use Inter / Roboto / Open Sans** — they read as AI-generated
28
+ - Japanese text dominates, so Japanese faces come first
29
+
30
+ ## Font size scale
31
+
32
+ Each size has a line height to go with it, `--line-height-<size>`
33
+ (`--font-size-sm` with `--line-height-sm`). With `tailwind.css`, `text-<size>`
34
+ sets both.
35
+
36
+ | Token | Value | Use |
37
+ | ----------------------- | -------- | ----------------------- |
38
+ | `--font-size-xs` | 0.75rem | Annotations, captions |
39
+ | `--font-size-sm` | 0.875rem | Supporting text, labels |
40
+ | `--font-size-md` | 1rem | Body text (default) |
41
+ | `--font-size-lg` | 1.125rem | Subheadings |
42
+ | `--font-size-xl` | 1.25rem | Headings |
43
+ | `--font-size-2xl` | 1.5rem | Large headings |
44
+ | `--font-size-3xl` | 1.875rem | Page titles |
45
+ | `--font-size-emphasize` | 3rem | Emphasis display |
46
+ | `--font-size-highlight` | 6rem | Highlight display |
15
47
 
16
- ## フォントサイズスケール
48
+ Three sizes follow the text they sit in, in `em`: `--font-size-code` (0.875em,
49
+ code in running text), `--font-size-kbd` (0.8125em) and `--font-size-callout`
50
+ (0.9em, the notes of a `CodeBlock`). `--spacing-em` (0.25em) is the spacing step
51
+ that goes with them.
17
52
 
18
- | Tailwind クラス | 値 | 用途 |
19
- | ---------------- | -------- | -------------------- |
20
- | `text-xs` | 0.75rem | 注釈、キャプション |
21
- | `text-sm` | 0.875rem | 補足テキスト、ラベル |
22
- | `text-md` | 1rem | 本文(デフォルト) |
23
- | `text-lg` | 1.125rem | 小見出し |
24
- | `text-xl` | 1.25rem | 見出し |
25
- | `text-2xl` | 1.5rem | 大見出し |
26
- | `text-3xl` | 1.875rem | ページタイトル |
27
- | `text-emphasize` | 3rem | 強調表示 |
28
- | `text-highlight` | 6rem | ハイライト表示 |
53
+ ## Font weight
29
54
 
30
- ## フォントウェイト
55
+ Use weight sparingly. Heavy type undermines the quiet.
31
56
 
32
- ウェイトは控えめに使う。太字の多用は「静けさ」を損なう。
57
+ | Token | Value | Use |
58
+ | ---------------------- | ----- | ------------------------------------- |
59
+ | (none) | 400 | Body text (the inherited default) |
60
+ | `--font-weight-medium` | 450 | Emphasized text (restrained emphasis) |
61
+ | `--font-weight-bold` | 700 | Headings, button labels |
33
62
 
34
- | Tailwind クラス | 値 | 用途 |
35
- | --------------- | --- | ---------------------------- |
36
- | `font-normal` | 400 | 本文 |
37
- | `font-medium` | 450 | 強調テキスト(控えめな強調) |
38
- | `font-bold` | 700 | 見出し、ボタンラベル |
63
+ - There are only these two weight tokens. With `tailwind.css`, `font-medium` and `font-bold` are the only weight utilities
64
+ - Note that `--font-weight-medium` is 450 here — lighter than the usual 500
39
65
 
40
- - `font-semibold` (600) や `font-extrabold` (800) は使わない
41
- - `font-medium` が 450 であることに注意(一般的な 500 より軽い)
66
+ ## Line height
42
67
 
43
- ## 行間
68
+ Japanese text needs more leading than Latin text.
44
69
 
45
- 日本語テキストは欧文より広い行間が必要。
70
+ | Token | Value | Use |
71
+ | ----------------------- | ----- | ------------------------------- |
72
+ | `--line-height-none` | 1 | Special cases (highlight, …) |
73
+ | `--line-height-tight` | 1.25 | Headings |
74
+ | `--line-height-snug` | 1.375 | Subheadings |
75
+ | `--line-height-normal` | 1.5 | Inside lists; the default |
76
+ | `--line-height-relaxed` | 1.625 | Body text (recommended) |
77
+ | `--line-height-loose` | 2 | When wide leading is called for |
46
78
 
47
- | Tailwind クラス | 値 | 用途 |
48
- | ----------------- | ----- | ------------------------ |
49
- | `leading-none` | 1 | 特殊用途(highlight 等) |
50
- | `leading-tight` | 1.25 | 見出し |
51
- | `leading-snug` | 1.375 | 小見出し |
52
- | `leading-normal` | 1.5 | リスト内、デフォルト |
53
- | `leading-relaxed` | 1.625 | 本文(推奨) |
54
- | `leading-loose` | 2 | 広い行間が必要な場合 |
79
+ With `tailwind.css` these are `leading-none` … `leading-loose`.
55
80
 
56
- ## 字間
81
+ ## Letter spacing
57
82
 
58
- | Tailwind クラス | 値 | 用途 |
59
- | ----------------- | ------- | ---------------- |
60
- | `tracking-none` | 0em | デフォルト |
61
- | `tracking-normal` | 0.025em | 少し広げたい場合 |
83
+ | Token | Value | Use |
84
+ | ------------------------- | ------- | --------------------------- |
85
+ | `--letter-spacing-none` | 0em | Default |
86
+ | `--letter-spacing-normal` | 0.025em | When a little air is wanted |
62
87
 
63
- ## Heading コンポーネント
88
+ With `tailwind.css` these are `tracking-none` and `tracking-normal`.
64
89
 
65
- 見出しには `Heading` コンポーネントを使う。
90
+ ## The Heading component
91
+
92
+ Use the `Heading` component for headings.
66
93
 
67
94
  ```tsx
68
95
  import { Heading } from '@k8ordo/ui';
69
96
 
70
- <Heading level="h1">ページタイトル</Heading>
71
- <Heading level="h2">セクション見出し</Heading>
72
- <Heading level="h3">サブセクション</Heading>
97
+ <Heading level="h1">Page title</Heading>
98
+ <Heading level="h2">Section heading</Heading>
99
+ <Heading level="h3">Subsection</Heading>
73
100
  ```
74
101
 
75
- ## 縦書きモード
102
+ ## Long-form text (Prose)
76
103
 
77
- 縦書き表示には専用のユーティリティと variant を用意している。
104
+ The base styles reset headings, lists, margins, and emphasis, which is right for
105
+ an interface and wrong for an article. `Prose` puts the typesetting of body text
106
+ back inside it, for Markdown or MDX rendered to HTML:
78
107
 
79
- ### ユーティリティ
108
+ ```tsx
109
+ import { Prose } from '@k8ordo/ui';
80
110
 
81
- | Tailwind クラス | 用途 |
82
- | --------------- | ----------------------------------------------------------------------------------------------------------- |
83
- | `writing-h` | 横書き (`writing-mode: horizontal-tb`) に戻す。縦書きツリー内の図表・コードブロック・置換要素などで使う。 |
84
- | `writing-v` | 縦書き (`writing-mode: vertical-rl`) を適用し、`text-orientation: mixed` などの推奨初期値も一括で設定する。 |
111
+ <article>
112
+ <Prose>{content}</Prose>
113
+ </article>;
114
+ ```
85
115
 
86
- ### `vertical:` variant
116
+ What it sets, tuned for Japanese:
117
+
118
+ - Body text on `--line-height-loose` (2) with `--letter-spacing-normal`:
119
+ Japanese needs more leading than Latin text.
120
+ - `1rem` between blocks, `3rem` above an `h2`, `2rem` above `h3`–`h6`, and
121
+ `0.75rem` between a heading and what follows it.
122
+ - Headings in `--font-weight-bold`, `--line-height-snug`, with
123
+ `text-wrap: balance` and proportional kana (`font-feature-settings: 'palt'`).
124
+ - `strong` in `--font-weight-bold`. `em` as emphasis dots (傍点, `text-emphasis: filled
125
+ sesame`) where the text is Japanese (`:lang(ja)`), and italic elsewhere.
126
+ - Links, inline code, `kbd`, and `pre` drawn like `Anchor`, `Code`, `Kbd`, and a
127
+ code block; lists with their markers back; quotes, tables, rules, images,
128
+ and GFM footnotes and task lists (the footnotes' `sr-only` heading is
129
+ read but not shown).
130
+ - Under `.writing-v`, each paragraph's first line is indented one character,
131
+ as a book is set.
132
+
133
+ **Only bare elements are typeset.** The element rules stop at any element with a
134
+ `class` — which is every `@k8ordo/ui` component — so a component placed in the
135
+ text keeps its own look (an `Alert`'s list does not get bullets). The spacing
136
+ between blocks still applies to it. The classes remark-gfm puts on footnotes
137
+ and task lists (`footnotes`, `contains-task-list`, `task-list-item`,
138
+ `data-footnote-backref`, `sr-only`) are the exception: they are treated as part
139
+ of the text.
140
+ Map an MDX element to a component when you want it to look like the component,
141
+ and leave it bare when you want it to look like text.
142
+
143
+ ## Vertical writing mode
144
+
145
+ `styles.css` ships three classes for the writing mode. They are the public
146
+ markers the components read, not utilities: put them on the element that
147
+ should turn.
148
+
149
+ | Class | Use |
150
+ | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
151
+ | `writing-h` | Return to horizontal (`writing-mode: horizontal-tb`). Use it for figures, code blocks, and replaced elements inside a vertical tree. |
152
+ | `writing-v` | Apply vertical writing (`writing-mode: vertical-rl`) together with the recommended defaults such as `text-orientation: mixed`. |
153
+ | `writing-sideways-rl` | Turn a block sideways (`writing-mode: sideways-rl`): it lays out like horizontal text rotated 90° clockwise, Japanese glyphs included. `Table` turns itself this way in vertical text. |
154
+
155
+ ### Styling for vertical text
156
+
157
+ `writing-v` and `writing-h` also set the custom property `--writing`
158
+ (`vertical` or `horizontal`; `:root` holds `horizontal`), and it inherits. Read
159
+ it with a style query to change your own styles in vertical text:
87
160
 
88
- `.writing-v` 子孫で活性化し、`.writing-h` 子孫では無効化する Tailwind variant。横書きデフォルトに対する上書きを宣言的に書ける。
161
+ ```css
162
+ .paragraph {
163
+ margin-block: calc(var(--spacing) * 4);
89
164
 
90
- ```tsx
91
- <div className="writing-v">
92
- <p className="my-4 vertical:my-0">
93
- {/* 横書き時のみ縦マージン、縦書きでは外す */}
94
- </p>
95
- </div>
165
+ @container style(--writing: vertical) {
166
+ margin-block: 0;
167
+ }
168
+ }
96
169
  ```
97
170
 
98
- ### 注意点
171
+ A style query asks the element's parent, so it does not see a `writing-v` on
172
+ the element itself: style that element through a class of its own. Prefer
173
+ logical properties (`margin-block`, `inline-size`) first; they often make the
174
+ override unnecessary.
175
+
176
+ With `tailwind.css`, the `vertical:` variant does the same for utilities: it
177
+ applies inside a `.writing-v` subtree and not inside `.writing-h`
178
+ (`className="my-4 vertical:my-0"`).
179
+
180
+ ### Switching at runtime
99
181
 
100
- - 画像・iframe などの置換要素は `vertical-rl` で大きさが想定通りにならないことがある。`<img className="vertical:writing-h" />` のように要素自体は横書きに戻す。
101
- - `-webkit-line-clamp` (`line-clamp-*`) は Safari で `writing-mode` と干渉する。縦書きでは `block-size` 上限 + `overflow: hidden` に置き換える。
102
- - KaTeX など内部で水平レイアウトを前提とするライブラリは、必要箇所だけ `writing-h` を上書きする。
182
+ There is no JavaScript API for the writing mode. Keep the mode in your own
183
+ state, and put `writing-v` on the container that should turn vertical:
103
184
 
104
- ## やってはいけないこと
185
+ ```tsx
186
+ const [mode, setMode] = useState<'horizontal' | 'vertical'>('horizontal');
187
+
188
+ <article className={mode === 'vertical' ? 'writing-v' : undefined}>
189
+ <p className={styles.paragraph}>…</p>
190
+ <pre className="writing-h">…</pre>
191
+ </article>;
192
+ ```
105
193
 
106
- - 3種類以上のフォントウェイトを1画面で使う
107
- - `text-3xl` より大きいサイズを通常テキストに使う(`text-emphasize` / `text-highlight` は特殊用途)
108
- - `uppercase` や `tracking-widest` を日本語テキストに適用する
109
- - テキストにグラデーションをかける
110
- - フォントサイズだけで階層を作る(余白も活用する)
194
+ - Components follow a `.writing-v` ancestor on their own, with no props.
195
+ `Tabs` (arrow keys and `aria-orientation`) and `Autocomplete` (the width of
196
+ its list) also follow a class toggled while they are on screen. `Popover`,
197
+ `Tooltip`, `DropdownMenu`, and `ListBox` read the writing mode each time
198
+ they open, so a change made while one is open shows the next time it opens.
199
+ - When your own JavaScript has to branch — hiding a side rail in vertical
200
+ mode, say — branch on the state you toggle, not on the DOM.
201
+ - To read the mode of an element you do not control, call
202
+ `getComputedStyle(element).writingMode` at the moment you need it. There is
203
+ no event to subscribe to, and a `ResizeObserver` does not stand in for one:
204
+ an element that shrinks to fit its content keeps its logical size when the
205
+ writing mode flips, so the observer never fires.
206
+
207
+ ### Caveats
208
+
209
+ - Replaced elements such as images and iframes may not size as expected under `vertical-rl`. Return the element itself to horizontal, as in `<img className="writing-h" />`.
210
+ - `-webkit-line-clamp` conflicts with `writing-mode` in Safari. In vertical mode, replace it with a `block-size` cap plus `overflow: hidden`.
211
+ - Libraries that assume horizontal layout internally, such as KaTeX, need `writing-h` applied only where required.
212
+
213
+ ## What not to do
214
+
215
+ - Reach past the three weights (400, `--font-weight-medium`, `--font-weight-bold`) with an arbitrary value (`font-weight: 600`, …)
216
+ - Use anything larger than `--font-size-3xl` for ordinary text (`--font-size-emphasize` and `--font-size-highlight` are for special cases)
217
+ - Apply `text-transform: uppercase` or wide letter spacing to Japanese text
218
+ - Apply a gradient to text
219
+ - Build hierarchy from font size alone — use spacing as well