@k8ordo/ui 2.3.1 → 3.0.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 (287) hide show
  1. package/README.md +6 -5
  2. package/dist/components/ai/_internal/attachment-preview.mjs +3 -3
  3. package/dist/components/ai/_internal/collapsible.mjs +1 -1
  4. package/dist/components/ai/conversation/conversation.mjs +1 -1
  5. package/dist/components/ai/message/message.mjs +5 -3
  6. package/dist/components/ai/prompt-input/prompt-input.mjs +3 -3
  7. package/dist/components/ai/reasoning/reasoning.mjs +1 -1
  8. package/dist/components/ai/source/source.mjs +2 -2
  9. package/dist/components/ai/tool-invocation/tool-invocation.mjs +2 -1
  10. package/dist/components/buttons/copy-button/copy-button.mjs +3 -1
  11. package/dist/components/data-display/accordion/accordion-button.mjs +1 -1
  12. package/dist/components/data-display/carousel/carousel.mjs +1 -1
  13. package/dist/components/data-display/data-table/data-table.mjs +1 -1
  14. package/dist/components/data-display/tree/tree.mjs +1 -1
  15. package/dist/components/feedback/alert/alert.mjs +3 -2
  16. package/dist/components/feedback/callout/callout.mjs +1 -1
  17. package/dist/components/form/autocomplete/autocomplete.mjs +3 -3
  18. package/dist/components/form/calendar/calendar.mjs +1 -1
  19. package/dist/components/form/checkbox/checkbox.mjs +2 -1
  20. package/dist/components/form/checkbox-card/checkbox-card.mjs +1 -1
  21. package/dist/components/form/combobox/combobox.mjs +1 -1
  22. package/dist/components/form/date-picker/date-picker.mjs +2 -2
  23. package/dist/components/form/file-field/file-field.mjs +2 -2
  24. package/dist/components/form/number-field/number-field.mjs +1 -1
  25. package/dist/components/form/password-input/password-input.mjs +3 -2
  26. package/dist/components/form/select/select.mjs +1 -1
  27. package/dist/components/icons/alert.d.mts +6 -0
  28. package/dist/components/icons/alert.mjs +17 -0
  29. package/dist/components/icons/{vertical-writing.d.mts → arrow-down.d.mts} +1 -1
  30. package/dist/components/icons/arrow-down.mjs +8 -0
  31. package/dist/components/icons/arrow-left.d.mts +3 -0
  32. package/dist/components/icons/arrow-left.mjs +8 -0
  33. package/dist/components/icons/arrow-right.d.mts +3 -0
  34. package/dist/components/icons/arrow-right.mjs +8 -0
  35. package/dist/components/icons/{twitter.d.mts → arrow-up.d.mts} +1 -1
  36. package/dist/components/icons/arrow-up.mjs +8 -0
  37. package/dist/components/icons/{qiita.d.mts → bell.d.mts} +1 -1
  38. package/dist/components/icons/bell.mjs +8 -0
  39. package/dist/components/icons/{github-mark.d.mts → blend.d.mts} +1 -1
  40. package/dist/components/icons/blend.mjs +16 -0
  41. package/dist/components/icons/book-text.d.mts +3 -0
  42. package/dist/components/icons/book-text.mjs +8 -0
  43. package/dist/components/icons/bookmark.d.mts +3 -0
  44. package/dist/components/icons/bookmark.mjs +8 -0
  45. package/dist/components/icons/bot-message.d.mts +3 -0
  46. package/dist/components/icons/bot-message.mjs +8 -0
  47. package/dist/components/icons/bot.d.mts +3 -0
  48. package/dist/components/icons/bot.mjs +14 -0
  49. package/dist/components/icons/calendar.d.mts +3 -0
  50. package/dist/components/icons/calendar.mjs +14 -0
  51. package/dist/components/icons/check.d.mts +3 -0
  52. package/dist/components/icons/check.mjs +8 -0
  53. package/dist/components/icons/chevron-down.d.mts +3 -0
  54. package/dist/components/icons/chevron-down.mjs +8 -0
  55. package/dist/components/icons/chevron-left.d.mts +3 -0
  56. package/dist/components/icons/chevron-left.mjs +8 -0
  57. package/dist/components/icons/chevron-right.d.mts +3 -0
  58. package/dist/components/icons/chevron-right.mjs +8 -0
  59. package/dist/components/icons/chevron-up.d.mts +3 -0
  60. package/dist/components/icons/chevron-up.mjs +8 -0
  61. package/dist/components/icons/chevron.d.mts +6 -0
  62. package/dist/components/icons/chevron.mjs +17 -0
  63. package/dist/components/icons/chevrons-up-down.d.mts +3 -0
  64. package/dist/components/icons/chevrons-up-down.mjs +8 -0
  65. package/dist/components/icons/circle-alert.d.mts +3 -0
  66. package/dist/components/icons/circle-alert.mjs +12 -0
  67. package/dist/components/icons/circle-check.d.mts +3 -0
  68. package/dist/components/icons/circle-check.mjs +12 -0
  69. package/dist/components/icons/circle-help.d.mts +3 -0
  70. package/dist/components/icons/circle-help.mjs +12 -0
  71. package/dist/components/icons/circle-x.d.mts +3 -0
  72. package/dist/components/icons/circle-x.mjs +12 -0
  73. package/dist/components/icons/clock.d.mts +3 -0
  74. package/dist/components/icons/clock.mjs +12 -0
  75. package/dist/components/icons/code.d.mts +3 -0
  76. package/dist/components/icons/code.mjs +8 -0
  77. package/dist/components/icons/color-scale.mjs +18 -30
  78. package/dist/components/icons/contrast.d.mts +3 -0
  79. package/dist/components/icons/contrast.mjs +15 -0
  80. package/dist/components/icons/copy.d.mts +3 -0
  81. package/dist/components/icons/copy.mjs +14 -0
  82. package/dist/components/icons/download.d.mts +3 -0
  83. package/dist/components/icons/download.mjs +8 -0
  84. package/dist/components/icons/ellipsis-vertical.d.mts +3 -0
  85. package/dist/components/icons/ellipsis-vertical.mjs +27 -0
  86. package/dist/components/icons/ellipsis.d.mts +3 -0
  87. package/dist/components/icons/ellipsis.mjs +27 -0
  88. package/dist/components/icons/external-link.d.mts +3 -0
  89. package/dist/components/icons/external-link.mjs +8 -0
  90. package/dist/components/icons/eye-closed.d.mts +3 -0
  91. package/dist/components/icons/eye-closed.mjs +8 -0
  92. package/dist/components/icons/eye.d.mts +3 -0
  93. package/dist/components/icons/eye.mjs +12 -0
  94. package/dist/components/icons/file-text.d.mts +3 -0
  95. package/dist/components/icons/file-text.mjs +12 -0
  96. package/dist/components/icons/file.d.mts +3 -0
  97. package/dist/components/icons/file.mjs +8 -0
  98. package/dist/components/icons/filter.d.mts +3 -0
  99. package/dist/components/icons/filter.mjs +8 -0
  100. package/dist/components/icons/flask.d.mts +3 -0
  101. package/dist/components/icons/flask.mjs +8 -0
  102. package/dist/components/icons/folder-open.d.mts +3 -0
  103. package/dist/components/icons/folder-open.mjs +8 -0
  104. package/dist/components/icons/folder.d.mts +3 -0
  105. package/dist/components/icons/folder.mjs +8 -0
  106. package/dist/components/icons/git-fork.d.mts +3 -0
  107. package/dist/components/icons/git-fork.mjs +25 -0
  108. package/dist/components/icons/globe.d.mts +3 -0
  109. package/dist/components/icons/globe.mjs +12 -0
  110. package/dist/components/icons/grid.d.mts +3 -0
  111. package/dist/components/icons/grid.mjs +37 -0
  112. package/dist/components/icons/grip-vertical.d.mts +3 -0
  113. package/dist/components/icons/grip-vertical.mjs +45 -0
  114. package/dist/components/icons/heart.d.mts +3 -0
  115. package/dist/components/icons/heart.mjs +8 -0
  116. package/dist/components/icons/history.d.mts +3 -0
  117. package/dist/components/icons/history.mjs +8 -0
  118. package/dist/components/icons/home.d.mts +3 -0
  119. package/dist/components/icons/home.mjs +8 -0
  120. package/dist/components/icons/image.d.mts +3 -0
  121. package/dist/components/icons/image.mjs +22 -0
  122. package/dist/components/icons/index.d.mts +105 -9
  123. package/dist/components/icons/index.mjs +105 -8
  124. package/dist/components/icons/info.d.mts +3 -0
  125. package/dist/components/icons/info.mjs +12 -0
  126. package/dist/components/icons/lightbulb.d.mts +3 -0
  127. package/dist/components/icons/lightbulb.mjs +8 -0
  128. package/dist/components/icons/line-icon.d.mts +3 -0
  129. package/dist/components/icons/line-icon.mjs +17 -0
  130. package/dist/components/icons/link.d.mts +3 -0
  131. package/dist/components/icons/link.mjs +11 -0
  132. package/dist/components/icons/list.d.mts +3 -0
  133. package/dist/components/icons/list.mjs +8 -0
  134. package/dist/components/icons/lock-open.d.mts +3 -0
  135. package/dist/components/icons/lock-open.mjs +14 -0
  136. package/dist/components/icons/lock.d.mts +3 -0
  137. package/dist/components/icons/lock.mjs +14 -0
  138. package/dist/components/icons/log-in.d.mts +3 -0
  139. package/dist/components/icons/log-in.mjs +8 -0
  140. package/dist/components/icons/log-out.d.mts +3 -0
  141. package/dist/components/icons/log-out.mjs +8 -0
  142. package/dist/components/icons/mail.d.mts +3 -0
  143. package/dist/components/icons/mail.mjs +14 -0
  144. package/dist/components/icons/map-pin.d.mts +3 -0
  145. package/dist/components/icons/map-pin.mjs +12 -0
  146. package/dist/components/icons/maximize.d.mts +3 -0
  147. package/dist/components/icons/maximize.mjs +8 -0
  148. package/dist/components/icons/menu.d.mts +3 -0
  149. package/dist/components/icons/menu.mjs +8 -0
  150. package/dist/components/icons/message-circle.d.mts +3 -0
  151. package/dist/components/icons/message-circle.mjs +8 -0
  152. package/dist/components/icons/minimize.d.mts +3 -0
  153. package/dist/components/icons/minimize.mjs +8 -0
  154. package/dist/components/icons/minus.d.mts +3 -0
  155. package/dist/components/icons/minus.mjs +8 -0
  156. package/dist/components/icons/monitor.d.mts +3 -0
  157. package/dist/components/icons/monitor.mjs +14 -0
  158. package/dist/components/icons/moon.d.mts +3 -0
  159. package/dist/components/icons/moon.mjs +8 -0
  160. package/dist/components/icons/package.d.mts +3 -0
  161. package/dist/components/icons/package.mjs +8 -0
  162. package/dist/components/icons/paint-bucket.d.mts +3 -0
  163. package/dist/components/icons/paint-bucket.mjs +8 -0
  164. package/dist/components/icons/palette.d.mts +3 -0
  165. package/dist/components/icons/palette.mjs +8 -0
  166. package/dist/components/icons/panel-left.d.mts +3 -0
  167. package/dist/components/icons/panel-left.mjs +14 -0
  168. package/dist/components/icons/paperclip.d.mts +3 -0
  169. package/dist/components/icons/paperclip.mjs +11 -0
  170. package/dist/components/icons/pause.d.mts +3 -0
  171. package/dist/components/icons/pause.mjs +20 -0
  172. package/dist/components/icons/pencil.d.mts +3 -0
  173. package/dist/components/icons/pencil.mjs +8 -0
  174. package/dist/components/icons/pin.d.mts +3 -0
  175. package/dist/components/icons/pin.mjs +11 -0
  176. package/dist/components/icons/play.d.mts +3 -0
  177. package/dist/components/icons/play.mjs +8 -0
  178. package/dist/components/icons/plus.d.mts +3 -0
  179. package/dist/components/icons/plus.mjs +8 -0
  180. package/dist/components/icons/presentation.d.mts +3 -0
  181. package/dist/components/icons/presentation.mjs +8 -0
  182. package/dist/components/icons/redo.d.mts +3 -0
  183. package/dist/components/icons/redo.mjs +8 -0
  184. package/dist/components/icons/refresh.d.mts +3 -0
  185. package/dist/components/icons/refresh.mjs +8 -0
  186. package/dist/components/icons/rocket.d.mts +3 -0
  187. package/dist/components/icons/rocket.mjs +19 -0
  188. package/dist/components/icons/rss.d.mts +3 -0
  189. package/dist/components/icons/rss.mjs +13 -0
  190. package/dist/components/icons/search.d.mts +3 -0
  191. package/dist/components/icons/search.mjs +12 -0
  192. package/dist/components/icons/send.d.mts +3 -0
  193. package/dist/components/icons/send.mjs +8 -0
  194. package/dist/components/icons/settings.d.mts +3 -0
  195. package/dist/components/icons/settings.mjs +12 -0
  196. package/dist/components/icons/share.d.mts +3 -0
  197. package/dist/components/icons/share.mjs +25 -0
  198. package/dist/components/icons/shield-check.d.mts +3 -0
  199. package/dist/components/icons/shield-check.mjs +8 -0
  200. package/dist/components/icons/smile.d.mts +3 -0
  201. package/dist/components/icons/smile.mjs +12 -0
  202. package/dist/components/icons/sparkles.d.mts +3 -0
  203. package/dist/components/icons/sparkles.mjs +8 -0
  204. package/dist/components/icons/square.d.mts +3 -0
  205. package/dist/components/icons/square.mjs +14 -0
  206. package/dist/components/icons/squircle.d.mts +3 -0
  207. package/dist/components/icons/squircle.mjs +8 -0
  208. package/dist/components/icons/star.d.mts +3 -0
  209. package/dist/components/icons/star.mjs +8 -0
  210. package/dist/components/icons/sun.d.mts +3 -0
  211. package/dist/components/icons/sun.mjs +12 -0
  212. package/dist/components/icons/table.d.mts +3 -0
  213. package/dist/components/icons/table.mjs +14 -0
  214. package/dist/components/icons/tag.d.mts +3 -0
  215. package/dist/components/icons/tag.mjs +8 -0
  216. package/dist/components/icons/text-horizontal.d.mts +3 -0
  217. package/dist/components/icons/text-horizontal.mjs +8 -0
  218. package/dist/components/icons/text-vertical.d.mts +3 -0
  219. package/dist/components/icons/text-vertical.mjs +8 -0
  220. package/dist/components/icons/thumbs-down.d.mts +3 -0
  221. package/dist/components/icons/thumbs-down.mjs +8 -0
  222. package/dist/components/icons/thumbs-up.d.mts +3 -0
  223. package/dist/components/icons/thumbs-up.mjs +8 -0
  224. package/dist/components/icons/trash.d.mts +3 -0
  225. package/dist/components/icons/trash.mjs +8 -0
  226. package/dist/components/icons/triangle-alert.d.mts +3 -0
  227. package/dist/components/icons/triangle-alert.mjs +8 -0
  228. package/dist/components/icons/undo.d.mts +3 -0
  229. package/dist/components/icons/undo.mjs +8 -0
  230. package/dist/components/icons/upload.d.mts +3 -0
  231. package/dist/components/icons/upload.mjs +8 -0
  232. package/dist/components/icons/user.d.mts +3 -0
  233. package/dist/components/icons/user.mjs +12 -0
  234. package/dist/components/icons/users.d.mts +3 -0
  235. package/dist/components/icons/users.mjs +12 -0
  236. package/dist/components/icons/x.d.mts +3 -0
  237. package/dist/components/icons/x.mjs +8 -0
  238. package/dist/components/index.d.mts +1 -11
  239. package/dist/components/index.mjs +1 -9
  240. package/dist/components/navigation/anchor/anchor.mjs +1 -1
  241. package/dist/components/navigation/breadcrumb/breadcrumb.mjs +1 -1
  242. package/dist/components/navigation/pagination/pagination.mjs +1 -1
  243. package/dist/components/navigation/side-nav/side-nav.mjs +1 -1
  244. package/dist/components/navigation/stepper/stepper.mjs +1 -1
  245. package/dist/components/overlays/dialog/dialog.mjs +2 -2
  246. package/dist/components/overlays/drawer/drawer.mjs +2 -2
  247. package/dist/components/overlays/dropdown-menu/dropdown-menu.mjs +1 -1
  248. package/dist/components/overlays/dropdown-menu/sub-menu.mjs +1 -1
  249. package/dist/components/overlays/list-box/list-box.mjs +2 -1
  250. package/dist/index.d.mts +1 -10
  251. package/dist/index.mjs +1 -9
  252. package/dist/integrations/_shared/icon-map.d.mts +106 -0
  253. package/dist/integrations/_shared/icon-map.mjs +208 -0
  254. package/dist/integrations/_shared/icon-names.d.mts +1 -0
  255. package/dist/integrations/_shared/icon-names.mjs +106 -0
  256. package/dist/integrations/_shared/renderers.mjs +3 -59
  257. package/dist/integrations/_shared/schemas.d.mts +432 -177
  258. package/dist/integrations/_shared/schemas.mjs +2 -53
  259. package/dist/integrations/json-render/catalog.d.mts +344 -140
  260. package/dist/styles/index.css +0 -6
  261. package/dist/styles/tailwind.css +0 -3
  262. package/dist/styles/tokens.d.mts +1 -1
  263. package/dist/styles/tokens.mjs +1 -1
  264. package/docs/GUIDE.md +4 -3
  265. package/docs/props.generated.json +714 -216
  266. package/docs/references/ai-chat.md +7 -5
  267. package/docs/references/components.md +91 -28
  268. package/docs/references/generative-ui.md +6 -3
  269. package/package.json +29 -26
  270. package/dist/components/ai/_internal/icons.d.mts +0 -6
  271. package/dist/components/ai/_internal/icons.mjs +0 -13
  272. package/dist/components/icons/browsers.d.mts +0 -6
  273. package/dist/components/icons/browsers.mjs +0 -890
  274. package/dist/components/icons/github-mark.mjs +0 -18
  275. package/dist/components/icons/logo.css +0 -17
  276. package/dist/components/icons/logo.d.mts +0 -4
  277. package/dist/components/icons/logo.mjs +0 -29
  278. package/dist/components/icons/logo.module.mjs +0 -8
  279. package/dist/components/icons/lucide-imports.d.mts +0 -67
  280. package/dist/components/icons/lucide-imports.mjs +0 -67
  281. package/dist/components/icons/lucide.d.mts +0 -67
  282. package/dist/components/icons/lucide.mjs +0 -255
  283. package/dist/components/icons/qiita.mjs +0 -27
  284. package/dist/components/icons/twitter.css +0 -9
  285. package/dist/components/icons/twitter.mjs +0 -20
  286. package/dist/components/icons/twitter.module.mjs +0 -4
  287. package/dist/components/icons/vertical-writing.mjs +0 -25
@@ -61,8 +61,9 @@ The "default" shown for `label`, `sendLabel`, and similar props below is the bui
61
61
  ```tsx
62
62
  'use client';
63
63
  import { useChat } from '@ai-sdk/react';
64
- import { Avatar, AssistantIcon } from '@k8ordo/ui';
64
+ import { Avatar } from '@k8ordo/ui';
65
65
  import { Conversation, Message, PromptInput } from '@k8ordo/ui/ai';
66
+ import { BotMessageIcon } from '@k8ordo/ui/icons';
66
67
  import type { UIMessage } from 'ai';
67
68
 
68
69
  const textOf = (m: UIMessage) =>
@@ -88,7 +89,7 @@ export function Chat() {
88
89
  m.role === 'user' ? undefined : (
89
90
  <Avatar
90
91
  color="primary"
91
- icon={<AssistantIcon />}
92
+ icon={<BotMessageIcon />}
92
93
  name="AI"
93
94
  size="sm"
94
95
  />
@@ -152,7 +153,7 @@ import { Message } from '@k8ordo/ui/ai';
152
153
  <Message.Content>Hello</Message.Content>
153
154
  </Message.Root>
154
155
 
155
- <Message.Root avatar={<Avatar icon={<AssistantIcon />} name="AI" size="sm" />} from="assistant">
156
+ <Message.Root avatar={<Avatar icon={<BotMessageIcon />} name="AI" size="sm" />} from="assistant">
156
157
  <Message.Content isStreaming>Text still streaming…</Message.Content>
157
158
  </Message.Root>
158
159
  ```
@@ -494,7 +495,7 @@ Render each part as its own row under `Message.Root` — the children stack in a
494
495
  ```tsx
495
496
  'use client';
496
497
  import { useChat } from '@ai-sdk/react';
497
- import { Avatar, AssistantIcon } from '@k8ordo/ui';
498
+ import { Avatar } from '@k8ordo/ui';
498
499
  import {
499
500
  Attachment,
500
501
  Message,
@@ -504,6 +505,7 @@ import {
504
505
  } from '@k8ordo/ui/ai';
505
506
  import { mapMessageParts } from '@k8ordo/ui/ai-sdk';
506
507
  import { Response } from '@k8ordo/ui/ai/response';
508
+ import { BotMessageIcon } from '@k8ordo/ui/icons';
507
509
  import { validateGeneratedSpec } from '@k8ordo/ui/json-render';
508
510
  import { JsonRenderUI } from '@k8ordo/ui/json-render/registry';
509
511
  import { lastAssistantMessageIsCompleteWithApprovalResponses } from 'ai';
@@ -524,7 +526,7 @@ function ChatMessage({ message, chat }: { message: UIMessage; chat: Chat }) {
524
526
  <Message.Root
525
527
  avatar={
526
528
  isUser ? undefined : (
527
- <Avatar icon={<AssistantIcon />} name="AI" size="sm" />
529
+ <Avatar icon={<BotMessageIcon />} name="AI" size="sm" />
528
530
  )
529
531
  }
530
532
  from={isUser ? 'user' : 'assistant'}
@@ -10,8 +10,10 @@ import '@k8ordo/ui/styles.css';
10
10
  import { UIProvider } from '@k8ordo/ui';
11
11
  // Components (all from the root entry)
12
12
  import { Button, Card, TextField } from '@k8ordo/ui';
13
- // Except CodeBlock, which highlights on the server and has its own entry
13
+ // And CodeBlock, which highlights on the server and has its own entry
14
14
  import { CodeBlock } from '@k8ordo/ui/code-block';
15
+ // Except the icons, which have their own entry
16
+ import { CheckIcon } from '@k8ordo/ui/icons';
15
17
  ```
16
18
 
17
19
  Every component can be rendered from a Server Component, compound ones
@@ -144,7 +146,7 @@ An icon-only button. Styling is controlled by the `color` prop.
144
146
  import { IconButton } from '@k8ordo/ui';
145
147
 
146
148
  <IconButton label="Close" color="transparent" size="md">
147
- <CloseIcon />
149
+ <XIcon />
148
150
  </IconButton>;
149
151
  ```
150
152
 
@@ -588,6 +590,35 @@ Form components are used together with `FormControl`'s `renderInput` pattern. Ev
588
590
 
589
591
  An uncontrolled field keeps its value in the DOM, so a form reset — `form.reset()`, a reset button, or React resetting the form after an action — puts it back to its `defaultValue`, and a `defaultValue` that changes after mount (the values a failed submission echoes back) is where the next reset goes. A value a component changes in code (a stepper, a chosen option, a removed file) is announced with an `input` event, so a form library listening on the `<form>` hears it like typing.
590
592
 
593
+ **A controlled field does not hear what was typed before hydration.** A
594
+ field in server-rendered HTML takes input before React attaches. React
595
+ keeps what the visitor typed in the element and calls no `onChange` for it,
596
+ so the state behind `value` stays at what the server rendered until the
597
+ next keystroke: a search box shows `rea` while the list below it is still
598
+ unfiltered. An uncontrolled field has no such gap, since its value is read
599
+ from the element. For a controlled one, compare the element with the state
600
+ when it attaches, through `ref`:
601
+
602
+ ```tsx
603
+ const typedBeforeHydration =
604
+ (value: string, onTyped: (typed: string) => void) =>
605
+ (input: HTMLInputElement | null) => {
606
+ if (input !== null && input.value !== value) onTyped(input.value);
607
+ };
608
+
609
+ <TextField
610
+ onChange={(event) => setQuery(event.target.value)}
611
+ ref={typedBeforeHydration(query, setQuery)}
612
+ value={query}
613
+ />;
614
+ ```
615
+
616
+ This is React's behavior, the same for a plain `<input>`, and for a
617
+ checkbox's `checked` as for a text field's `value`. The components carry
618
+ no workaround of their own: React has a fix behind an experimental flag
619
+ (a change event replayed at hydration), and a second one here would call
620
+ `onChange` twice once it ships.
621
+
591
622
  Every field takes the attributes `@k8ordo/form`'s `formFields` derives as they are — spread `field.input` after `FormControl`'s props. Its guide's "Working with @k8ordo/ui" section has one example per component.
592
623
 
593
624
  ### Form
@@ -1489,7 +1520,7 @@ import { Avatar } from '@k8ordo/ui';
1489
1520
 
1490
1521
  <Avatar src="/avatar.jpg" alt="User name" size="md" />
1491
1522
  <Avatar name="Ada Lovelace" fallback="A" size="lg" />
1492
- <Avatar color="primary" icon={<AssistantIcon />} name="AI" size="sm" />
1523
+ <Avatar color="primary" icon={<BotMessageIcon />} name="AI" size="sm" />
1493
1524
  ```
1494
1525
 
1495
1526
  Props:
@@ -1998,7 +2029,8 @@ an optional description and icon, and an optional action. Inside a table, use
1998
2029
  `Table.EmptyState`, which puts the same content in a row spanning the columns.
1999
2030
 
2000
2031
  ```tsx
2001
- import { Button, EmptyState, TableIcon } from '@k8ordo/ui';
2032
+ import { Button, EmptyState } from '@k8ordo/ui';
2033
+ import { TableIcon } from '@k8ordo/ui/icons';
2002
2034
 
2003
2035
  <EmptyState
2004
2036
  action={<Button onClick={clearFilters}>Clear filters</Button>}
@@ -2692,18 +2724,24 @@ Props:
2692
2724
 
2693
2725
  ## Icons
2694
2726
 
2695
- Decorative icons, all from the root entry. Each renders an `<svg>` with
2696
- `aria-hidden` and `focusable="false"`, so the accessible name belongs to the
2697
- control around it — an `IconButton`'s `label`, for example.
2727
+ Decorative icons, from `@k8ordo/ui/icons` (the root entry does not export
2728
+ them). Each renders an `<svg>` with `aria-hidden` and `focusable="false"`, so
2729
+ the accessible name belongs to the control around it — an `IconButton`'s
2730
+ `label`, for example. They are drawn as lines in `currentColor`, so an icon
2731
+ takes the text color of where it sits.
2698
2732
 
2699
2733
  ```tsx
2700
- import { AlertIcon, ChevronIcon, CloseIcon } from '@k8ordo/ui';
2734
+ import { AlertIcon, ChevronIcon, XIcon } from '@k8ordo/ui/icons';
2701
2735
 
2702
- <CloseIcon />
2736
+ <XIcon />
2703
2737
  <ChevronIcon direction="down" size="sm" />
2704
2738
  <AlertIcon status="warning" />
2705
2739
  ```
2706
2740
 
2741
+ An icon is named for what it draws, not for what it means in one application:
2742
+ `BookmarkIcon`, not "subscribe"; `EyeIcon`, not "show". Each one is a module of
2743
+ its own, so a bundler ships only the icons a page draws.
2744
+
2707
2745
  Every icon takes one optional prop and nothing else:
2708
2746
 
2709
2747
  - `size`: `'xs'` | `'sm'` | `'md'` | `'lg'` | `'xl'` | `'2xl'` | `'3xl'` (default: `'md'`)
@@ -2715,28 +2753,53 @@ Two of them also require a prop that picks the glyph:
2715
2753
 
2716
2754
  <!-- generated:icons -->
2717
2755
 
2718
- The icons: `AccessibilityIcon`, `AIIcon`, `AlertIcon`, `AssistantIcon`,
2719
- `AtomIcon`, `BadIcon`, `BlogIcon`, `BoringIcon`, `CheckIcon`, `ChevronIcon`,
2720
- `ChromeIcon`, `CloseIcon`, `CodeXmlIcon`, `ColorContrastIcon`, `ColorInfoIcon`,
2721
- `ColorScaleIcon`, `CopyIcon`, `DarkModeIcon`, `DifficultIcon`, `EasyIcon`,
2722
- `EdgeIcon`, `ExternalLinkIcon`, `FirefoxIcon`, `FlaskIcon`, `ForkIcon`,
2723
- `FormIcon`, `FullscreenIcon`, `GitHubIcon`, `GoodIcon`, `HistoryIcon`,
2724
- `HorizontalWritingIcon`, `InformativeIcon`, `InterestingIcon`, `LightModeIcon`,
2725
- `LinkIcon`, `ListIcon`, `LocationIcon`, `LockIcon`, `LockOpenIcon`, `LogoIcon`,
2726
- `MailIcon`, `MinusIcon`, `MixedColorIcon`, `NavigationMenuIcon`, `NewsIcon`,
2727
- `PackageIcon`, `PaletteIcon`, `PlusIcon`, `PrepareIcon`, `PublishDateIcon`,
2728
- `QiitaIcon`, `RefreshIcon`, `RSSIcon`, `SafariIcon`, `SendIcon`, `ShallowIcon`,
2729
- `ShieldCheckIcon`, `SlideIcon`, `SparklesIcon`, `SquircleIcon`, `SubscribeIcon`,
2730
- `TableIcon`, `TagIcon`, `TwitterIcon`, `UpdateDateIcon`, `VerticalWritingIcon`,
2731
- `ViewIcon`, `ViewOffIcon`.
2756
+ The icons: `AlertIcon`, `ArrowDownIcon`, `ArrowLeftIcon`, `ArrowRightIcon`,
2757
+ `ArrowUpIcon`, `BellIcon`, `BlendIcon`, `BookmarkIcon`, `BookTextIcon`,
2758
+ `BotIcon`, `BotMessageIcon`, `CalendarIcon`, `CheckIcon`, `ChevronDownIcon`,
2759
+ `ChevronIcon`, `ChevronLeftIcon`, `ChevronRightIcon`, `ChevronsUpDownIcon`,
2760
+ `ChevronUpIcon`, `CircleAlertIcon`, `CircleCheckIcon`, `CircleHelpIcon`,
2761
+ `CircleXIcon`, `ClockIcon`, `CodeIcon`, `ColorScaleIcon`, `ContrastIcon`,
2762
+ `CopyIcon`, `DownloadIcon`, `EllipsisIcon`, `EllipsisVerticalIcon`,
2763
+ `ExternalLinkIcon`, `EyeClosedIcon`, `EyeIcon`, `FileIcon`, `FileTextIcon`,
2764
+ `FilterIcon`, `FlaskIcon`, `FolderIcon`, `FolderOpenIcon`, `GitForkIcon`,
2765
+ `GlobeIcon`, `GridIcon`, `GripVerticalIcon`, `HeartIcon`, `HistoryIcon`,
2766
+ `HomeIcon`, `ImageIcon`, `InfoIcon`, `LightbulbIcon`, `LinkIcon`, `ListIcon`,
2767
+ `LockIcon`, `LockOpenIcon`, `LogInIcon`, `LogOutIcon`, `MailIcon`, `MapPinIcon`,
2768
+ `MaximizeIcon`, `MenuIcon`, `MessageCircleIcon`, `MinimizeIcon`, `MinusIcon`,
2769
+ `MonitorIcon`, `MoonIcon`, `PackageIcon`, `PaintBucketIcon`, `PaletteIcon`,
2770
+ `PanelLeftIcon`, `PaperclipIcon`, `PauseIcon`, `PencilIcon`, `PinIcon`,
2771
+ `PlayIcon`, `PlusIcon`, `PresentationIcon`, `RedoIcon`, `RefreshIcon`,
2772
+ `RocketIcon`, `RssIcon`, `SearchIcon`, `SendIcon`, `SettingsIcon`, `ShareIcon`,
2773
+ `ShieldCheckIcon`, `SmileIcon`, `SparklesIcon`, `SquareIcon`, `SquircleIcon`,
2774
+ `StarIcon`, `SunIcon`, `TableIcon`, `TagIcon`, `TextHorizontalIcon`,
2775
+ `TextVerticalIcon`, `ThumbsDownIcon`, `ThumbsUpIcon`, `TrashIcon`,
2776
+ `TriangleAlertIcon`, `UndoIcon`, `UploadIcon`, `UserIcon`, `UsersIcon`, `XIcon`.
2732
2777
 
2733
2778
  <!-- /generated:icons -->
2734
2779
 
2735
- `Logo` is the mark `LogoIcon` draws, as a bare `<svg>` without the sizing: it
2736
- takes `className`, `aria-hidden`, and `focusable` (`Partial<IconRenderProps>`)
2737
- instead of `size`. The types `BaseIconProps` (`{ size }`) and
2738
- `IconRenderProps` (`{ className: string; 'aria-hidden': true; focusable: 'false' }`)
2739
- are exported as well.
2780
+ There are no logos here: a brand mark belongs to the application that shows
2781
+ it. Draw one, or any icon this set lacks, on `BaseIcon`, which gives an `<svg>`
2782
+ of your own the same sizes and the same decorative attributes:
2783
+
2784
+ ```tsx
2785
+ import { BaseIcon } from '@k8ordo/ui/icons';
2786
+ import type { BaseIconProps } from '@k8ordo/ui/icons';
2787
+
2788
+ export const BrandIcon = ({ size = 'md' }: Partial<BaseIconProps>) => (
2789
+ <BaseIcon
2790
+ renderItem={(props) => (
2791
+ <svg {...props} fill="currentColor" viewBox="0 0 16 16">
2792
+ <path d="…" />
2793
+ </svg>
2794
+ )}
2795
+ size={size}
2796
+ />
2797
+ );
2798
+ ```
2799
+
2800
+ `renderItem` receives `IconRenderProps`
2801
+ (`{ className: string; 'aria-hidden': true; focusable: 'false' }`); the types
2802
+ `BaseIconProps` (`{ size }`) and `IconRenderProps` are exported as well.
2740
2803
 
2741
2804
  ## Providers
2742
2805
 
@@ -40,9 +40,10 @@ Both adapters register the same components, and the prompts they generate list
40
40
  them. Most are the exported component of the same name. A few are shaped for a
41
41
  model instead:
42
42
 
43
- - **Icons** are one `Icon` entry whose `name` picks the glyph from a curated
44
- set of icons that need nothing but a size. `ChevronIcon` has an entry of its
45
- own, and `AlertIcon` is the `StatusIcon` entry.
43
+ - **Icons** are one `Icon` entry whose `name` picks the glyph. Every icon in
44
+ `@k8ordo/ui/icons` that needs nothing but a size is there, under its name in
45
+ kebab-case without the suffix: `eye-closed` is `EyeClosedIcon`. `ChevronIcon`
46
+ has an entry of its own, and `AlertIcon` is the `StatusIcon` entry.
46
47
  - **Toasts** are a `Toast` entry, standing in for `ToastProvider` and
47
48
  `useToast`: a self-contained widget whose `triggerLabel` button shows the
48
49
  toast.
@@ -92,6 +93,8 @@ These exports are left out on purpose, so a model cannot place them:
92
93
  - `Prose` — it typesets the bare HTML that Markdown renders to. A spec places
93
94
  components, which keep their own look, so it would have nothing to typeset;
94
95
  lay a flow out with `Stack`.
96
+ - `BaseIcon` — the base your own icons are drawn on. It has no glyph of its
97
+ own, and a spec picks a glyph by `name`.
95
98
  - `TableOfContents` — it points at the ids of the document's headings and
96
99
  follows the scroll. The headings a spec places carry no id, so there would be
97
100
  nothing to point at.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k8ordo/ui",
3
- "version": "2.3.1",
3
+ "version": "3.0.0",
4
4
  "description": "k8o's React UI library with built-in generative UI adapters (json-render & OpenUI) for LLM-driven, on-brand interfaces",
5
5
  "keywords": [
6
6
  "ai",
@@ -67,6 +67,10 @@
67
67
  "types": "./dist/components/ai/response/index.d.mts",
68
68
  "default": "./dist/components/ai/response/index.mjs"
69
69
  },
70
+ "./icons": {
71
+ "types": "./dist/components/icons/index.d.mts",
72
+ "default": "./dist/components/icons/index.mjs"
73
+ },
70
74
  "./code-block": {
71
75
  "types": "./dist/components/data-display/code-block/index.d.mts",
72
76
  "default": "./dist/components/data-display/code-block/index.mjs"
@@ -88,9 +92,8 @@
88
92
  },
89
93
  "dependencies": {
90
94
  "clsx": "2.1.1",
91
- "lucide-react": "1.65.0",
92
95
  "server-only": "0.0.1",
93
- "shiki": "4.5.0"
96
+ "shiki": "4.6.0"
94
97
  },
95
98
  "devDependencies": {
96
99
  "@arethetypeswrong/cli": "0.18.5",
@@ -98,29 +101,29 @@
98
101
  "@better-css-modules/core": "0.4.1",
99
102
  "@better-css-modules/vite": "0.4.1",
100
103
  "@chromatic-com/storybook": "5.6.0",
101
- "@json-render/core": "0.21.3",
102
- "@json-render/react": "0.21.3",
103
- "@k8ordo/form": "^2.3.1",
104
- "@k8ordo/i18n": "^2.3.1",
105
- "@openuidev/lang-core": "1.0.2",
106
- "@openuidev/react-lang": "1.0.2",
107
- "@storybook/addon-a11y": "10.6.5",
108
- "@storybook/addon-docs": "10.6.5",
109
- "@storybook/addon-mcp": "10.6.5",
110
- "@storybook/addon-vitest": "10.6.5",
111
- "@storybook/react-vite": "10.6.5",
104
+ "@json-render/core": "0.22.0",
105
+ "@json-render/react": "0.22.0",
106
+ "@k8ordo/form": "^3.0.0",
107
+ "@k8ordo/i18n": "^3.0.0",
108
+ "@openuidev/lang-core": "1.1.0",
109
+ "@openuidev/react-lang": "1.1.0",
110
+ "@storybook/addon-a11y": "10.6.6",
111
+ "@storybook/addon-docs": "10.6.6",
112
+ "@storybook/addon-mcp": "10.6.6",
113
+ "@storybook/addon-vitest": "10.6.6",
114
+ "@storybook/react-vite": "10.6.6",
112
115
  "@types/react": "19.3.0",
113
116
  "@types/react-dom": "19.3.0",
114
- "@vitejs/plugin-react": "6.1.2",
115
- "@vitest/browser-playwright": "5.0.5",
116
- "@vitest/coverage-v8": "5.0.5",
117
- "@vitest/ui": "5.0.5",
118
- "ai": "7.0.157",
117
+ "@vitejs/plugin-react": "6.2.1",
118
+ "@vitest/browser-playwright": "5.1.0",
119
+ "@vitest/coverage-v8": "5.1.0",
120
+ "@vitest/ui": "5.1.0",
121
+ "ai": "7.0.163",
119
122
  "postcss": "8.5.32",
120
123
  "publint": "0.3.25",
121
124
  "react": "19.3.1",
122
125
  "react-dom": "19.3.1",
123
- "storybook": "10.6.5",
126
+ "storybook": "10.6.6",
124
127
  "storybook-addon-determinism": "0.2.1",
125
128
  "storybook-addon-mock-date": "3.2.1",
126
129
  "storybook-addon-vrt": "0.4.2",
@@ -128,14 +131,14 @@
128
131
  "typescript": "7.0.2",
129
132
  "vite": "npm:@voidzero-dev/vite-plus-core@1.4.0",
130
133
  "vite-plus": "1.4.0",
131
- "vitest": "5.0.5",
134
+ "vitest": "5.1.0",
132
135
  "vitest-browser-react": "2.3.0",
133
136
  "zod": "4.6.7"
134
137
  },
135
138
  "peerDependencies": {
136
- "@json-render/core": ">=0.21.0 <0.22.0",
137
- "@json-render/react": ">=0.21.0 <0.22.0",
138
- "@k8ordo/i18n": "^2.3.1",
139
+ "@json-render/core": ">=0.22.0 <0.23.0",
140
+ "@json-render/react": ">=0.22.0 <0.23.0",
141
+ "@k8ordo/i18n": "^3.0.0",
139
142
  "@openuidev/lang-core": "^1.0.0",
140
143
  "@openuidev/react-lang": "^1.0.0",
141
144
  "@types/react": ">=19.3.0",
@@ -181,8 +184,8 @@
181
184
  },
182
185
  "scripts": {
183
186
  "build": "vp pack && node scripts/build-tokens.ts",
184
- "generate:props": "node scripts/extract-props.ts && node scripts/generate-component-docs.ts",
185
- "check:props": "node scripts/extract-props.ts --check && node scripts/generate-component-docs.ts --check",
187
+ "generate:props": "node scripts/generate-icons.ts && node scripts/extract-props.ts && node scripts/generate-component-docs.ts",
188
+ "check:props": "node scripts/generate-icons.ts --check && node scripts/extract-props.ts --check && node scripts/generate-component-docs.ts --check",
186
189
  "check:dist": "node scripts/check-dist-tests.ts",
187
190
  "check:package": "publint && attw --pack . --profile esm-only --exclude-entrypoints ./styles.css ./tailwind.css && pnpm check:dist",
188
191
  "storybook": "storybook dev -p 6006 --no-open",
@@ -1,6 +0,0 @@
1
- import { BaseIconProps } from "../../icons/base.mjs";
2
- import { FC } from "react";
3
- type IconProps = Partial<BaseIconProps>;
4
- export declare const AttachIcon: FC<IconProps>;
5
- export declare const FileIcon: FC<IconProps>;
6
- export {};
@@ -1,13 +0,0 @@
1
- import { BaseIcon } from "../../icons/base.mjs";
2
- import { File, Paperclip } from "../../icons/lucide-imports.mjs";
3
- import { jsx } from "react/jsx-runtime";
4
- // src/components/ai/_internal/icons.tsx
5
- const AttachIcon = ({ size = "md" }) => /* @__PURE__ */ jsx(BaseIcon, {
6
- renderItem: (props) => /* @__PURE__ */ jsx(Paperclip, { ...props }),
7
- size
8
- });
9
- const FileIcon = ({ size = "md" }) => /* @__PURE__ */ jsx(BaseIcon, {
10
- renderItem: (props) => /* @__PURE__ */ jsx(File, { ...props }),
11
- size
12
- });
13
- export { AttachIcon, FileIcon };
@@ -1,6 +0,0 @@
1
- import { BaseIconProps } from "./base.mjs";
2
- import { FC } from "react";
3
- export declare const ChromeIcon: FC<Partial<BaseIconProps>>;
4
- export declare const EdgeIcon: FC<Partial<BaseIconProps>>;
5
- export declare const FirefoxIcon: FC<Partial<BaseIconProps>>;
6
- export declare const SafariIcon: FC<Partial<BaseIconProps>>;