@kitn.ai/ui 0.17.0 → 0.18.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 (494) hide show
  1. package/README.md +28 -5
  2. package/dist/components/artifact.d.ts +39 -1
  3. package/dist/components/attachment-types.d.ts +12 -0
  4. package/dist/components/attachments.d.ts +2 -10
  5. package/dist/components/card.d.ts +27 -0
  6. package/dist/components/chain-of-thought.d.ts +78 -2
  7. package/dist/components/chat-scope-picker.d.ts +7 -0
  8. package/dist/components/chat-thread.d.ts +37 -12
  9. package/dist/components/choice-card.d.ts +26 -0
  10. package/dist/components/coachmark.d.ts +49 -0
  11. package/dist/components/composer-dom.d.ts +35 -0
  12. package/dist/components/composer-highlight.d.ts +48 -0
  13. package/dist/components/composer-history.d.ts +34 -0
  14. package/dist/components/composer.d.ts +86 -0
  15. package/dist/components/confirm-card.d.ts +17 -0
  16. package/dist/components/conversation-item.d.ts +9 -0
  17. package/dist/components/conversation-list.d.ts +36 -1
  18. package/dist/components/file-tree.d.ts +15 -0
  19. package/dist/components/form.d.ts +34 -0
  20. package/dist/components/markdown.d.ts +3 -0
  21. package/dist/components/message.d.ts +12 -0
  22. package/dist/components/model-switcher.d.ts +7 -0
  23. package/dist/components/prompt-input.d.ts +13 -4
  24. package/dist/components/prompt-suggestion.d.ts +9 -1
  25. package/dist/components/reasoning.d.ts +14 -1
  26. package/dist/components/response-compare.d.ts +14 -0
  27. package/dist/components/screen.d.ts +46 -0
  28. package/dist/components/tasks-card.d.ts +49 -1
  29. package/dist/components/toast.d.ts +12 -2
  30. package/dist/components/tool-types.d.ts +10 -0
  31. package/dist/components/tool.d.ts +8 -8
  32. package/dist/components/voice-input.d.ts +27 -0
  33. package/dist/components/voice-output.d.ts +33 -0
  34. package/dist/core-C8fzo39E.js +12 -0
  35. package/dist/custom-elements.json +8392 -1860
  36. package/dist/elements/agent-card.d.ts +1 -0
  37. package/dist/elements/agent-card.js +1 -0
  38. package/dist/elements/artifact.js +1 -1
  39. package/dist/elements/attachments.js +1 -1
  40. package/dist/elements/autoloader.js +1 -1
  41. package/dist/elements/avatar.d.ts +1 -0
  42. package/dist/elements/avatar.js +1 -0
  43. package/dist/elements/badge.d.ts +1 -0
  44. package/dist/elements/badge.js +1 -0
  45. package/dist/elements/button.d.ts +1 -0
  46. package/dist/elements/button.js +1 -0
  47. package/dist/elements/card.js +1 -1
  48. package/dist/elements/cards.js +1 -1
  49. package/dist/elements/chain-of-thought.js +1 -1
  50. package/dist/elements/chat-scope-picker.js +1 -1
  51. package/dist/elements/chat-types.d.ts +47 -0
  52. package/dist/elements/chat-workspace.js +1 -1
  53. package/dist/elements/chat.js +1 -1
  54. package/dist/elements/checkpoint.js +1 -1
  55. package/dist/elements/choice.js +1 -1
  56. package/dist/elements/chunks/Icon-DLLBeLG5.js +1 -0
  57. package/dist/elements/chunks/action-icons-UB4V5FNq.js +1 -0
  58. package/dist/elements/chunks/arrow-left-C-gwlUmx.js +1 -0
  59. package/dist/elements/chunks/attachments-CgbErf1r.js +1 -0
  60. package/dist/elements/chunks/badge-DTQpgB6N.js +1 -0
  61. package/dist/elements/chunks/button-XDUM6lXs.js +1 -0
  62. package/dist/elements/chunks/card-CBlFZ-7I.js +1 -0
  63. package/dist/elements/chunks/chat-thread-BIhmqwNL.js +1 -0
  64. package/dist/elements/chunks/check-hGUoVIKb.js +1 -0
  65. package/dist/elements/chunks/chevron-down-DDoaSUtO.js +1 -0
  66. package/dist/elements/chunks/chevron-right-CdGEUakB.js +1 -0
  67. package/dist/elements/chunks/circle-BKAZdmzb.js +1 -0
  68. package/dist/elements/chunks/circle-check-CmYG-y3I.js +1 -0
  69. package/dist/elements/chunks/circle-x-DewgAEym.js +1 -0
  70. package/dist/elements/chunks/cn-CU7UAWzk.js +1 -0
  71. package/dist/elements/chunks/code-block-DedwxwFI.js +1 -0
  72. package/dist/elements/chunks/collapsible-FfgmTHtM.js +1 -0
  73. package/dist/elements/chunks/composer-Cfbw5HKT.js +65 -0
  74. package/dist/elements/chunks/context-DwJmxlRE.js +1 -0
  75. package/dist/elements/chunks/conversation-list-DsCQMfPq.js +1 -0
  76. package/dist/elements/chunks/default-input-BuqsoENC.js +1 -0
  77. package/dist/elements/chunks/define-rGsaWsLL.js +1 -0
  78. package/dist/elements/chunks/disclosure-CwoAkpMH.js +1 -0
  79. package/dist/elements/chunks/download-DJ06G3Bz.js +1 -0
  80. package/dist/elements/chunks/dropdown-BFg8ri_R.js +1 -0
  81. package/dist/elements/chunks/ellipsis-dlN6YvGw.js +1 -0
  82. package/dist/elements/chunks/external-link-DBX2lc_R.js +1 -0
  83. package/dist/elements/chunks/file-text-HfwUx4F9.js +1 -0
  84. package/dist/elements/chunks/file-tree-C6Toj71u.js +1 -0
  85. package/dist/elements/chunks/folder-MYuqa9Xp.js +1 -0
  86. package/dist/elements/chunks/hover-card-gE7iyXdW.js +1 -0
  87. package/dist/elements/chunks/icon-Vqz4ivrY.js +1 -0
  88. package/dist/elements/chunks/{index-CTBEJeo6.js → index-BCRhi84a.js} +1 -1
  89. package/dist/elements/chunks/info-B_toFS0l.js +1 -0
  90. package/dist/elements/chunks/input-gzbHYZvQ.js +1 -0
  91. package/dist/elements/chunks/kbd-n49c4KZm.js +1 -0
  92. package/dist/elements/chunks/link-CKPs9yM0.js +1 -0
  93. package/dist/elements/chunks/loader-q6MamGus.js +1 -0
  94. package/dist/elements/chunks/{markdown-CMTGx9r8.js → markdown-DBrcqq4S.js} +9 -9
  95. package/dist/elements/chunks/message-CTqaYI0s.js +1 -0
  96. package/dist/elements/chunks/message-feedback-Cvzm03w0.js +1 -0
  97. package/dist/elements/chunks/message-square-CUg9eRCi.js +1 -0
  98. package/dist/elements/chunks/minimize-2-l2klxP6K.js +1 -0
  99. package/dist/elements/chunks/model-switcher-CmyjiHO1.js +1 -0
  100. package/dist/elements/chunks/overlay-C8sOYqjT.js +1 -0
  101. package/dist/elements/chunks/paperclip-42Ia7xHD.js +1 -0
  102. package/dist/elements/chunks/progress-bar-tzKMWAwO.js +1 -0
  103. package/dist/elements/chunks/prompt-suggestion-D3F6vP_A.js +1 -0
  104. package/dist/elements/chunks/reasoning-BJNmmyov.js +1 -0
  105. package/dist/elements/chunks/resizable-BRsk19qI.js +1 -0
  106. package/dist/elements/chunks/rotate-cw-BgcggLHC.js +1 -0
  107. package/dist/elements/chunks/scroll-area-CgGbFFbT.js +1 -0
  108. package/dist/elements/chunks/separator-8hM4GdHE.js +1 -0
  109. package/dist/elements/chunks/settings-CaUIYOg-.js +1 -0
  110. package/dist/elements/chunks/settings-group-CYjOVIZQ.js +1 -0
  111. package/dist/elements/chunks/share-BTYM3Ddt.js +1 -0
  112. package/dist/elements/chunks/skeleton-DsTYrPUe.js +1 -0
  113. package/dist/elements/chunks/slots-DkZ-Cmha.js +1 -0
  114. package/dist/elements/chunks/star-9R3LBQ9n.js +1 -0
  115. package/dist/elements/chunks/store-CYl5Y0_u.js +1 -0
  116. package/dist/elements/chunks/text-shimmer-CaYGv8Se.js +1 -0
  117. package/dist/elements/chunks/textarea-NEr2SLcD.js +1 -0
  118. package/dist/elements/chunks/thumbs-up-DZYZkFfc.js +1 -0
  119. package/dist/elements/chunks/toast-store-ClxVZRcc.js +1 -0
  120. package/dist/elements/chunks/tool-CHZOmoe9.js +1 -0
  121. package/dist/elements/chunks/tooltip-WpHElELC.js +1 -0
  122. package/dist/elements/chunks/triangle-alert-BlS80PUg.js +1 -0
  123. package/dist/elements/chunks/use-card-resolution-VSVoxDeJ.js +1 -0
  124. package/dist/elements/chunks/video-DxTPZqT8.js +1 -0
  125. package/dist/elements/chunks/x-C1qtndxn.js +1 -0
  126. package/dist/elements/coachmark.d.ts +1 -0
  127. package/dist/elements/coachmark.js +1 -0
  128. package/dist/elements/code-block.js +1 -1
  129. package/dist/elements/command.d.ts +1 -0
  130. package/dist/elements/command.js +1 -0
  131. package/dist/elements/compare.js +1 -1
  132. package/dist/elements/composer.d.ts +1 -0
  133. package/dist/elements/composer.js +1 -0
  134. package/dist/elements/confirm-card.js +1 -1
  135. package/dist/elements/context-meter.js +1 -1
  136. package/dist/elements/conversation-list.js +1 -1
  137. package/dist/elements/css.d.ts +1 -0
  138. package/dist/elements/default-input.d.ts +51 -0
  139. package/dist/elements/define.d.ts +53 -0
  140. package/dist/elements/dialog.d.ts +1 -0
  141. package/dist/elements/dialog.js +1 -0
  142. package/dist/elements/disclosure.d.ts +37 -0
  143. package/dist/elements/editable-label.d.ts +1 -0
  144. package/dist/elements/editable-label.js +1 -0
  145. package/dist/elements/embed.js +1 -1
  146. package/dist/elements/empty.js +1 -1
  147. package/dist/elements/feedback-bar.js +1 -1
  148. package/dist/elements/file-tree.js +1 -1
  149. package/dist/elements/file-upload.js +1 -1
  150. package/dist/elements/form.js +1 -1
  151. package/dist/elements/hover-card.d.ts +1 -0
  152. package/dist/elements/hover-card.js +1 -0
  153. package/dist/elements/icon.d.ts +1 -0
  154. package/dist/elements/icon.js +1 -0
  155. package/dist/elements/image.js +1 -1
  156. package/dist/elements/input.d.ts +1 -0
  157. package/dist/elements/input.js +1 -0
  158. package/dist/elements/kbd.d.ts +1 -0
  159. package/dist/elements/kbd.js +1 -0
  160. package/dist/elements/link-preview.js +1 -1
  161. package/dist/elements/loader.js +1 -1
  162. package/dist/elements/markdown.js +1 -1
  163. package/dist/elements/menu.d.ts +1 -0
  164. package/dist/elements/menu.js +1 -0
  165. package/dist/elements/message-skills.js +1 -1
  166. package/dist/elements/message.js +1 -1
  167. package/dist/elements/model-switcher.js +1 -1
  168. package/dist/elements/nav.d.ts +1 -0
  169. package/dist/elements/nav.js +1 -0
  170. package/dist/elements/notice.d.ts +1 -0
  171. package/dist/elements/notice.js +1 -0
  172. package/dist/elements/pane-group.d.ts +1 -0
  173. package/dist/elements/pane-group.js +1 -0
  174. package/dist/elements/pane.d.ts +1 -0
  175. package/dist/elements/pane.js +1 -0
  176. package/dist/elements/popover.js +1 -1
  177. package/dist/elements/progress-bar.d.ts +1 -0
  178. package/dist/elements/progress-bar.js +1 -0
  179. package/dist/elements/prompt-dock.d.ts +1 -0
  180. package/dist/elements/prompt-dock.js +1 -0
  181. package/dist/elements/prompt-input.js +1 -1
  182. package/dist/elements/prompt-suggestions.js +1 -1
  183. package/dist/elements/reasoning.js +1 -1
  184. package/dist/elements/register-impl.d.ts +0 -0
  185. package/dist/elements/register.d.ts +13 -0
  186. package/dist/elements/remote.d.ts +1 -0
  187. package/dist/elements/remote.js +1 -0
  188. package/dist/elements/resizable.js +1 -1
  189. package/dist/elements/response-stream.js +2 -2
  190. package/dist/elements/screen.d.ts +1 -0
  191. package/dist/elements/screen.js +1 -0
  192. package/dist/elements/scroll-area.d.ts +1 -0
  193. package/dist/elements/scroll-area.js +1 -0
  194. package/dist/elements/scroll-button.js +1 -1
  195. package/dist/elements/search.d.ts +1 -0
  196. package/dist/elements/search.js +1 -0
  197. package/dist/elements/segmented.d.ts +1 -0
  198. package/dist/elements/segmented.js +1 -0
  199. package/dist/elements/separator.d.ts +1 -0
  200. package/dist/elements/separator.js +1 -0
  201. package/dist/elements/setting-item.d.ts +1 -0
  202. package/dist/elements/setting-item.js +1 -0
  203. package/dist/elements/settings-group.d.ts +1 -0
  204. package/dist/elements/settings-group.js +1 -0
  205. package/dist/elements/skeleton.d.ts +1 -0
  206. package/dist/elements/skeleton.js +1 -0
  207. package/dist/elements/slots.d.ts +176 -0
  208. package/dist/elements/source.js +1 -1
  209. package/dist/elements/status.d.ts +1 -0
  210. package/dist/elements/status.js +1 -0
  211. package/dist/elements/switch.js +1 -1
  212. package/dist/elements/tabs.d.ts +1 -0
  213. package/dist/elements/tabs.js +1 -0
  214. package/dist/elements/tasks.js +1 -1
  215. package/dist/elements/text-shimmer.js +1 -1
  216. package/dist/elements/thinking-bar.js +1 -1
  217. package/dist/elements/toast.js +1 -1
  218. package/dist/elements/tool.js +1 -1
  219. package/dist/elements/tooltip.d.ts +1 -0
  220. package/dist/elements/tooltip.js +1 -0
  221. package/dist/elements/voice-input.js +1 -1
  222. package/dist/elements/voice-output.d.ts +1 -0
  223. package/dist/elements/voice-output.js +1 -0
  224. package/dist/elements.d.ts +733 -58
  225. package/dist/engine-javascript-C1x7zo1_.js +141 -0
  226. package/dist/index.d.ts +3 -2
  227. package/dist/index.js +8256 -5703
  228. package/dist/kai.es.js +1 -0
  229. package/dist/llms/llms-full.txt +1146 -64
  230. package/dist/llms/llms.txt +4 -4
  231. package/dist/mcp.es.js +62 -7
  232. package/dist/primitives/composer-model.d.ts +22 -0
  233. package/dist/primitives/composer-triggers.d.ts +19 -0
  234. package/dist/primitives/create-kai-chat.d.ts +38 -0
  235. package/dist/primitives/toast-store.d.ts +32 -2
  236. package/dist/primitives/use-speech-recognition.d.ts +26 -0
  237. package/dist/react/index.d.ts +1085 -97
  238. package/dist/react/runtime.d.ts +9 -2
  239. package/dist/react/use-kai-chat.d.ts +41 -0
  240. package/dist/react.js +572 -193
  241. package/dist/register-impl-CYWGkgbI.js +141 -0
  242. package/dist/schemas/tasks.schema.json +2 -2
  243. package/dist/state/index.d.ts +4 -0
  244. package/dist/state/messages.d.ts +11 -0
  245. package/dist/state/stream.d.ts +22 -0
  246. package/dist/state/suggestions.d.ts +4 -0
  247. package/dist/state.js +117 -0
  248. package/dist/theme.tokens.css +87 -0
  249. package/dist/types.d.ts +4 -0
  250. package/dist/ui/agent-card.d.ts +61 -0
  251. package/dist/ui/button.d.ts +5 -2
  252. package/dist/ui/card.d.ts +61 -0
  253. package/dist/ui/collapsible.d.ts +15 -1
  254. package/dist/ui/command.d.ts +33 -0
  255. package/dist/ui/dialog.d.ts +42 -0
  256. package/dist/ui/dropdown.d.ts +95 -1
  257. package/dist/ui/editable-label.d.ts +26 -0
  258. package/dist/ui/hover-card.d.ts +13 -1
  259. package/dist/ui/icon.d.ts +18 -0
  260. package/dist/ui/input.d.ts +33 -0
  261. package/dist/ui/kbd.d.ts +21 -0
  262. package/dist/ui/nav.d.ts +62 -0
  263. package/dist/ui/notice.d.ts +31 -0
  264. package/dist/ui/overlay.d.ts +12 -0
  265. package/dist/ui/pane-grid.d.ts +58 -0
  266. package/dist/ui/pane-group.d.ts +75 -0
  267. package/dist/ui/pane.d.ts +78 -0
  268. package/dist/ui/popover.d.ts +11 -1
  269. package/dist/ui/progress-bar.d.ts +23 -0
  270. package/dist/ui/prompt-dock.d.ts +96 -0
  271. package/dist/ui/resizable.d.ts +12 -0
  272. package/dist/ui/scroll-area.d.ts +4 -0
  273. package/dist/ui/segmented.d.ts +28 -0
  274. package/dist/ui/settings-group.d.ts +32 -0
  275. package/dist/ui/skeleton.d.ts +12 -0
  276. package/dist/ui/stat.d.ts +16 -0
  277. package/dist/ui/status.d.ts +13 -0
  278. package/dist/ui/switch.d.ts +8 -1
  279. package/dist/ui/tabs.d.ts +35 -0
  280. package/dist/ui/tooltip.d.ts +19 -1
  281. package/frameworks/react/index.tsx +1042 -157
  282. package/frameworks/react/runtime.tsx +30 -1
  283. package/frameworks/react/use-kai-chat.tsx +87 -0
  284. package/llms-full.txt +1146 -64
  285. package/llms.txt +4 -4
  286. package/package.json +23 -8
  287. package/src/agent-tooling/mcp/manifest.ts +14 -0
  288. package/src/agent-tooling/mcp/tools/debug.ts +10 -6
  289. package/src/agent-tooling/mcp/tools/reference.ts +32 -0
  290. package/src/agent-tooling/mcp/tools/scaffold.ts +30 -1
  291. package/src/components/artifact.tsx +98 -13
  292. package/src/components/attachment-types.ts +13 -0
  293. package/src/components/attachments.tsx +4 -14
  294. package/src/components/card.tsx +109 -15
  295. package/src/components/chain-of-thought.tsx +210 -1
  296. package/src/components/chat-scope-picker.tsx +13 -3
  297. package/src/components/chat-thread.tsx +225 -116
  298. package/src/components/choice-card.tsx +103 -11
  299. package/src/components/coachmark.tsx +245 -0
  300. package/src/components/component-meta.json +691 -102
  301. package/src/components/composer-dom.ts +159 -0
  302. package/src/components/composer-highlight.ts +242 -0
  303. package/src/components/composer-history.ts +82 -0
  304. package/src/components/composer.tsx +979 -0
  305. package/src/components/confirm-card.tsx +54 -1
  306. package/src/components/conversation-item.tsx +69 -7
  307. package/src/components/conversation-list.tsx +134 -37
  308. package/src/components/file-tree.tsx +197 -47
  309. package/src/components/form-widgets.tsx +9 -7
  310. package/src/components/form.tsx +140 -17
  311. package/src/components/image.tsx +3 -5
  312. package/src/components/link-preview.tsx +5 -4
  313. package/src/components/markdown.tsx +5 -2
  314. package/src/components/message.tsx +23 -4
  315. package/src/components/model-switcher.tsx +19 -4
  316. package/src/components/prompt-input.tsx +46 -75
  317. package/src/components/prompt-suggestion.tsx +48 -16
  318. package/src/components/reasoning.tsx +29 -6
  319. package/src/components/response-compare.tsx +31 -2
  320. package/src/components/screen.tsx +176 -0
  321. package/src/components/tasks-card.tsx +342 -21
  322. package/src/components/toast.tsx +119 -31
  323. package/src/components/tool-types.ts +10 -0
  324. package/src/components/tool.tsx +22 -16
  325. package/src/components/voice-input.tsx +102 -19
  326. package/src/components/voice-output.tsx +202 -0
  327. package/src/elements/agent-card.tsx +67 -0
  328. package/src/elements/artifact.tsx +53 -4
  329. package/src/elements/attachments.tsx +1 -0
  330. package/src/elements/avatar.tsx +33 -0
  331. package/src/elements/badge.tsx +32 -0
  332. package/src/elements/button.tsx +126 -0
  333. package/src/elements/card-media.jpg +0 -0
  334. package/src/elements/card.tsx +124 -31
  335. package/src/elements/cards.tsx +81 -7
  336. package/src/elements/chain-of-thought.tsx +77 -32
  337. package/src/elements/chat-scope-picker.tsx +35 -8
  338. package/src/elements/chat-types.ts +2 -2
  339. package/src/elements/chat-workspace.tsx +153 -41
  340. package/src/elements/chat.tsx +45 -23
  341. package/src/elements/choice.tsx +71 -19
  342. package/src/elements/coachmark.tsx +90 -0
  343. package/src/elements/command.tsx +209 -0
  344. package/src/elements/compare.tsx +24 -2
  345. package/src/elements/compiled.css +1 -1
  346. package/src/elements/composer.tsx +151 -0
  347. package/src/elements/confirm-card.tsx +36 -11
  348. package/src/elements/conversation-list.tsx +80 -11
  349. package/src/elements/default-input.tsx +75 -53
  350. package/src/elements/define.tsx +47 -6
  351. package/src/elements/dialog.tsx +98 -0
  352. package/src/elements/disclosure.ts +73 -0
  353. package/src/elements/editable-label.tsx +125 -0
  354. package/src/elements/element-manifest.json +129 -1
  355. package/src/elements/element-meta.json +5562 -1336
  356. package/src/elements/element-types.d.ts +732 -57
  357. package/src/elements/file-tree.tsx +12 -2
  358. package/src/elements/file-upload.tsx +1 -1
  359. package/src/elements/form.tsx +54 -11
  360. package/src/elements/hover-card.tsx +80 -0
  361. package/src/elements/icon-names.json +48 -0
  362. package/src/elements/icon.tsx +41 -0
  363. package/src/elements/input.tsx +203 -0
  364. package/src/elements/kbd.tsx +45 -0
  365. package/src/elements/menu.tsx +217 -0
  366. package/src/elements/message.tsx +58 -11
  367. package/src/elements/model-switcher.tsx +27 -1
  368. package/src/elements/nav.tsx +87 -0
  369. package/src/elements/notice.tsx +53 -0
  370. package/src/elements/pane-group.tsx +119 -0
  371. package/src/elements/pane.tsx +129 -0
  372. package/src/elements/popover.tsx +39 -17
  373. package/src/elements/progress-bar.tsx +39 -0
  374. package/src/elements/prompt-dock.tsx +81 -0
  375. package/src/elements/prompt-input.tsx +112 -63
  376. package/src/elements/prompt-suggestions.tsx +25 -9
  377. package/src/elements/reasoning.tsx +30 -9
  378. package/src/elements/register-impl.ts +38 -3
  379. package/src/elements/register.ts +11 -3
  380. package/src/elements/resizable.tsx +48 -11
  381. package/src/elements/screen.tsx +90 -0
  382. package/src/elements/scroll-area.tsx +33 -0
  383. package/src/elements/search.tsx +180 -0
  384. package/src/elements/segmented.tsx +135 -0
  385. package/src/elements/separator.tsx +36 -0
  386. package/src/elements/setting-item.tsx +50 -0
  387. package/src/elements/settings-group.tsx +37 -0
  388. package/src/elements/skeleton.tsx +45 -0
  389. package/src/elements/slots.ts +607 -0
  390. package/src/elements/source.tsx +13 -6
  391. package/src/elements/status.tsx +42 -0
  392. package/src/elements/switch.tsx +89 -14
  393. package/src/elements/tabs.tsx +95 -0
  394. package/src/elements/tasks.tsx +70 -14
  395. package/src/elements/toast.tsx +17 -2
  396. package/src/elements/tool.tsx +43 -9
  397. package/src/elements/tooltip.tsx +85 -0
  398. package/src/elements/video-poster.jpg +0 -0
  399. package/src/elements/voice-input.tsx +66 -16
  400. package/src/elements/voice-output.tsx +69 -0
  401. package/src/index.ts +5 -2
  402. package/src/primitives/card-schemas/tasks.schema.json +2 -2
  403. package/src/primitives/composer-model.ts +49 -0
  404. package/src/primitives/composer-triggers.ts +35 -0
  405. package/src/primitives/create-kai-chat.ts +66 -0
  406. package/src/primitives/toast-store.ts +43 -2
  407. package/src/primitives/use-speech-recognition.ts +135 -0
  408. package/src/state/index.ts +6 -0
  409. package/src/state/messages.ts +36 -0
  410. package/src/state/stream.ts +92 -0
  411. package/src/state/suggestions.ts +9 -0
  412. package/src/types.ts +4 -0
  413. package/src/ui/agent-card.tsx +212 -0
  414. package/src/ui/button.tsx +16 -5
  415. package/src/ui/card.tsx +245 -0
  416. package/src/ui/collapsible.tsx +30 -4
  417. package/src/ui/command.tsx +99 -0
  418. package/src/ui/dialog.tsx +217 -0
  419. package/src/ui/dropdown.tsx +375 -13
  420. package/src/ui/editable-label.tsx +112 -0
  421. package/src/ui/hover-card.tsx +28 -5
  422. package/src/ui/icon.tsx +110 -0
  423. package/src/ui/input.tsx +132 -0
  424. package/src/ui/kbd.tsx +118 -0
  425. package/src/ui/nav.tsx +282 -0
  426. package/src/ui/notice.tsx +84 -0
  427. package/src/ui/overlay.tsx +108 -2
  428. package/src/ui/pane-grid.tsx +116 -0
  429. package/src/ui/pane-group.tsx +280 -0
  430. package/src/ui/pane.tsx +193 -0
  431. package/src/ui/popover.tsx +16 -2
  432. package/src/ui/progress-bar.tsx +83 -0
  433. package/src/ui/prompt-dock.tsx +145 -0
  434. package/src/ui/resizable.tsx +69 -1
  435. package/src/ui/scroll-area.tsx +14 -3
  436. package/src/ui/segmented.tsx +109 -0
  437. package/src/ui/settings-group.tsx +67 -0
  438. package/src/ui/skeleton.tsx +62 -5
  439. package/src/ui/stat.tsx +41 -0
  440. package/src/ui/status.tsx +48 -0
  441. package/src/ui/switch.tsx +49 -23
  442. package/src/ui/tabs.tsx +168 -0
  443. package/src/ui/tooltip.tsx +52 -8
  444. package/theme.css +113 -0
  445. package/dist/components/slash-command.d.ts +0 -15
  446. package/dist/elements/chunks/Icon-D_Zmwmwh.js +0 -1
  447. package/dist/elements/chunks/action-icons-PVfIvcuG.js +0 -1
  448. package/dist/elements/chunks/attachments-Dp6vqtrc.js +0 -1
  449. package/dist/elements/chunks/button-CKyYD9G4.js +0 -1
  450. package/dist/elements/chunks/card-Cjho-PYk.js +0 -1
  451. package/dist/elements/chunks/chat-thread-RT808iPf.js +0 -1
  452. package/dist/elements/chunks/check-CDYaMYrM.js +0 -1
  453. package/dist/elements/chunks/chevron-down-3SBiq8HF.js +0 -1
  454. package/dist/elements/chunks/chevron-right-k2UFlIVK.js +0 -1
  455. package/dist/elements/chunks/cn-Dogu6PbV.js +0 -1
  456. package/dist/elements/chunks/code-block-BYUmfFSd.js +0 -1
  457. package/dist/elements/chunks/collapsible-BiNwdOn6.js +0 -1
  458. package/dist/elements/chunks/context-18g6oi4J.js +0 -1
  459. package/dist/elements/chunks/conversation-list-D9Y0NVdo.js +0 -1
  460. package/dist/elements/chunks/default-input-CSAoYYMd.js +0 -1
  461. package/dist/elements/chunks/download-D8K0Je8r.js +0 -1
  462. package/dist/elements/chunks/dropdown-bUs2iTia.js +0 -1
  463. package/dist/elements/chunks/external-link-6mA0wxab.js +0 -1
  464. package/dist/elements/chunks/file-text-DnaYk3Dm.js +0 -1
  465. package/dist/elements/chunks/file-tree-CgtRLlxK.js +0 -1
  466. package/dist/elements/chunks/hover-card-CIGw62gP.js +0 -1
  467. package/dist/elements/chunks/link-BlGSeoPy.js +0 -1
  468. package/dist/elements/chunks/loader-DvhR4qa0.js +0 -1
  469. package/dist/elements/chunks/message-CDZwXjhL.js +0 -1
  470. package/dist/elements/chunks/message-feedback-CYx81QiA.js +0 -1
  471. package/dist/elements/chunks/model-switcher-O_tUhoOT.js +0 -1
  472. package/dist/elements/chunks/overlay-DydXYMQW.js +0 -1
  473. package/dist/elements/chunks/prompt-suggestion-ldlWV5kd.js +0 -1
  474. package/dist/elements/chunks/reasoning-2PUnHlmr.js +0 -1
  475. package/dist/elements/chunks/resizable-B5WNbSeb.js +0 -1
  476. package/dist/elements/chunks/star-t9tI-P0q.js +0 -1
  477. package/dist/elements/chunks/store-C6rIooZz.js +0 -1
  478. package/dist/elements/chunks/text-shimmer-uh9V_KUh.js +0 -1
  479. package/dist/elements/chunks/textarea-3nm6Ia9U.js +0 -1
  480. package/dist/elements/chunks/thumbs-up-BBtguGld.js +0 -1
  481. package/dist/elements/chunks/toast-store-D8cL3fWl.js +0 -1
  482. package/dist/elements/chunks/tool-GJ3vwp1U.js +0 -1
  483. package/dist/elements/chunks/tooltip-DwKAz4XR.js +0 -1
  484. package/dist/elements/chunks/triangle-alert-Ct1zt2JL.js +0 -1
  485. package/dist/elements/chunks/use-card-resolution-D-_0Alzy.js +0 -1
  486. package/dist/elements/chunks/video-mVYiM99-.js +0 -1
  487. package/dist/elements/chunks/x-CzxL27Ch.js +0 -1
  488. package/dist/kitn-chat.es.js +0 -1
  489. package/dist/register-JyTglR6m.js +0 -1
  490. package/dist/register-impl-C6wlSsts.js +0 -77
  491. package/src/components/slash-command.tsx +0 -232
  492. package/src/elements/framework-usage.json +0 -588
  493. /package/dist/{kitn-chat-provider.d.ts → kai-provider.d.ts} +0 -0
  494. /package/dist/{kitn-chat-provider.es.js → kai-provider.es.js} +0 -0
@@ -1,21 +1,49 @@
1
+ 'use client';
1
2
  // AUTO-GENERATED by scripts/gen-element-api.mjs — do not edit by hand.
2
3
  // Typed React wrappers for every kitn custom element. Usage:
3
4
  // import { Message } from '@kitn.ai/ui/react';
4
5
  // <Message message={msg} onMessageAction={(e) => …} />
5
- // The built bundle self-registers all kai-* custom elements the elements import is
6
- // injected at build time (see vite.config.react.ts output.banner), so consumers need
7
- // only this one import. It is kept OUT of this .tsx source so the React typecheck
8
- // (tsconfig.react.json) does not walk the Solid element source under react-jsx.
9
- import { createWebComponent, type WebComponentProps } from './runtime';
6
+ // Each wrapper lazy-registers ITS element on first client mount (a dynamic import
7
+ // of '@kitn.ai/ui/elements/<name>'), so a consumer ships only the elements they use
8
+ // not the register-all bundle. SSR-safe: registration fires only in a client effect.
9
+ // For eager all-registration call registerAll() or import '@kitn.ai/ui/elements'.
10
+ import { createWebComponent, registerAll, type WebComponentProps } from './runtime';
11
+ export { registerAll };
12
+ export { useKaiChat } from './use-kai-chat';
13
+ export type { UseKaiChatOptions, KaiChatController, ChatMessage } from './use-kai-chat';
14
+
15
+
16
+ export interface AgentCardProps extends WebComponentProps {
17
+ /** The agent's name — the primary label. Attribute: `name`. */
18
+ name?: string;
19
+ /** Selected / focused state: highlighted border + surface. Attribute: `active`. */
20
+ active?: boolean;
21
+ /** Raise a prominent "Needs you" pill plus a glowing amber edge — the attention-routing signal that pulls focus to this agent. Attribute: `needs-attention`. */
22
+ needsAttention?: boolean;
23
+ /** Run status — a JS PROPERTY (object), not an attribute. Shape: `{ tone, label?, pulse? }`, where `tone` is one of `working` | `idle` | `done` | `error` | `blocked` (maps to the kit's tool hues), `label` is an optional short string beside the dot, and `pulse` animates the dot. Set it with `el.status = { tone: 'working', label: 'Working', pulse: true }`. */
24
+ status?: { tone: "working" | "idle" | "done" | "error" | "blocked"; label?: string; pulse?: boolean };
25
+ /** The card was activated — clicked, or Enter / Space while focused. Promote this agent back to focus. */
26
+ onActivate?: (event: CustomEvent) => void;
27
+ /** The trailing "..." kebab was clicked. The consumer opens its own menu; the card only surfaces the affordance (the click does not also activate the card). */
28
+ onMenu?: (event: CustomEvent) => void;
29
+ }
10
30
 
31
+ export const AgentCard = /*#__PURE__*/ createWebComponent<AgentCardProps>(
32
+ 'kai-agent-card',
33
+ ["theme","name","active","needsAttention","status"],
34
+ { onActivate: 'kai-activate', onMenu: 'kai-menu' },
35
+ () => import('@kitn.ai/ui/elements/agent-card'),
36
+ );
11
37
 
12
38
  export interface ArtifactProps extends WebComponentProps {
13
39
  /** URL the preview iframe frames. Consumer-controlled. */
14
40
  src?: string;
15
41
  /** Files for the Code tab tree + each file's preview `url`. Set as a JS property (array). */
16
- files: { path: string; url?: undefined | string; code?: undefined | string; language?: undefined | string; type?: undefined | "html" | "pdf" | "image" | "other" }[];
17
- /** Active tab: `preview` (default) or `code`. */
42
+ files: { path: string; url?: undefined | string; code?: undefined | string; language?: undefined | string; type?: undefined | "html" | "pdf" | "image" | "other"; additions?: undefined | number; deletions?: undefined | number; status?: undefined | "added" | "modified" | "deleted" | "renamed" | "untracked" }[];
43
+ /** Controlled active tab: `preview` or `code`. When set, the artifact follows it (re-asserted on change). Leave unset for an uncontrolled tab (see `defaultTab`). */
18
44
  tab?: "preview" | "code";
45
+ /** Uncontrolled INITIAL tab (used only when `tab` is unset). Default `preview`. Seeds the starting tab; the user can then switch freely without the consumer re-asserting a controlled `tab`. */
46
+ defaultTab?: "preview" | "code";
19
47
  /** Selected file path — syncs the tree highlight, Code source, and preview. */
20
48
  activeFile?: string;
21
49
  /** iframe `sandbox` override. Secure default `allow-scripts allow-forms` (NOT `allow-same-origin`). */
@@ -42,6 +70,8 @@ export interface ArtifactProps extends WebComponentProps {
42
70
  standalone?: boolean;
43
71
  /** Show the address but make it read-only (visible, nav-tracking, non-editable). */
44
72
  readonlyPath?: boolean;
73
+ /** Friendly address shown in the path field instead of the real current url (read-only, non-navigable). Use when the framed url is not consumer-facing (e.g. a `data:` blob) so a clean address shows instead of leaking it. Scalar string: set as the `display-url` attribute or the `displayUrl` property. */
74
+ displayUrl?: string;
45
75
  /** Fired when a file is selected. `detail.path`. */
46
76
  onFileSelect?: (event: CustomEvent<{ path: string }>) => void;
47
77
  /** Artifact's own maximize button toggled (consumer-observable; non-bubbling). */
@@ -52,10 +82,11 @@ export interface ArtifactProps extends WebComponentProps {
52
82
  onTabChange?: (event: CustomEvent<{ tab: "preview" | "code" }>) => void;
53
83
  }
54
84
 
55
- export const Artifact = createWebComponent<ArtifactProps>(
85
+ export const Artifact = /*#__PURE__*/ createWebComponent<ArtifactProps>(
56
86
  'kai-artifact',
57
- ["theme","src","files","tab","activeFile","sandbox","iframeTitle","maximized","expandable","openInTab","noNav","noReload","noHome","noPathField","noTabs","standalone","readonlyPath"],
87
+ ["theme","src","files","tab","defaultTab","activeFile","sandbox","iframeTitle","maximized","expandable","openInTab","noNav","noReload","noHome","noPathField","noTabs","standalone","readonlyPath","displayUrl"],
58
88
  { onFileSelect: 'kai-file-select', onMaximizeChange: 'kai-maximize-change', onNavigate: 'kai-navigate', onTabChange: 'kai-tab-change' },
89
+ () => import('@kitn.ai/ui/elements/artifact'),
59
90
  );
60
91
 
61
92
  export interface AttachmentsProps extends WebComponentProps {
@@ -75,27 +106,103 @@ export interface AttachmentsProps extends WebComponentProps {
75
106
  onRemove?: (event: CustomEvent<{ id: string }>) => void;
76
107
  }
77
108
 
78
- export const Attachments = createWebComponent<AttachmentsProps>(
109
+ export const Attachments = /*#__PURE__*/ createWebComponent<AttachmentsProps>(
79
110
  'kai-attachments',
80
111
  ["theme","items","variant","hoverCard","removable","showMediaType","emptyText"],
81
112
  { onRemove: 'kai-remove' },
113
+ () => import('@kitn.ai/ui/elements/attachments'),
114
+ );
115
+
116
+ export interface AvatarProps extends WebComponentProps {
117
+ /** Image URL/data-URI. When absent, the `fallback` initials show instead. */
118
+ src?: string;
119
+ /** Alt text for the image. Defaults to `fallback`. */
120
+ alt?: string;
121
+ /** Short text shown when there's no image — usually initials (e.g. "JD", "AI"). */
122
+ fallback?: string;
123
+ /** Size token: `sm` | `md` (default) | `lg`. */
124
+ size?: "sm" | "md" | "lg";
125
+ }
126
+
127
+ export const Avatar = /*#__PURE__*/ createWebComponent<AvatarProps>(
128
+ 'kai-avatar',
129
+ ["theme","src","alt","fallback","size"],
130
+ { },
131
+ () => import('@kitn.ai/ui/elements/avatar'),
132
+ );
133
+
134
+ export interface BadgeProps extends WebComponentProps {
135
+ /** `default` (muted pill) · `count` (compact number badge) · `citation` (filled primary, for inline citation markers). Defaults to `default`. */
136
+ variant?: "default" | "count" | "citation";
137
+ }
138
+
139
+ export const Badge = /*#__PURE__*/ createWebComponent<BadgeProps>(
140
+ 'kai-badge',
141
+ ["theme","variant"],
142
+ { },
143
+ () => import('@kitn.ai/ui/elements/badge'),
144
+ );
145
+
146
+ export interface ButtonProps extends WebComponentProps {
147
+ /** Visual style. `default` (filled), `subtle` (muted text, hover tint — the toolbar icon look), `ghost` (transparent, hover fill), `outline`, or `destructive`. Defaults to `default`. */
148
+ variant?: "default" | "subtle" | "ghost" | "outline" | "destructive";
149
+ /** Size token. `icon` / `icon-sm` are square (for icon-only buttons); `sm` / `md` / `lg` size text buttons. Defaults to `md`. */
150
+ size?: "sm" | "md" | "lg" | "icon" | "icon-sm";
151
+ /** Leading icon: a named icon (e.g. `"mic"`, `"plus"`), an image URL/data-URI, or plain text. Renders before any slotted label. */
152
+ icon?: string;
153
+ /** Trailing icon, after the label (e.g. `"chevron-down"` for a menu affordance). */
154
+ iconTrailing?: string;
155
+ /** Accessible name. REQUIRED for icon-only buttons (no visible text); ignored when you slot visible text, which already names the button. */
156
+ label?: string;
157
+ /** Disable the button (non-interactive, dimmed). */
158
+ disabled?: boolean;
159
+ /** Stretch the button to the full width of its container (a block button) — e.g. a card CTA or a stacked action. Attribute: `full`. */
160
+ full?: boolean;
161
+ /** Justify the button's content: `start`, `center` (default), or `end`. Combine with `full` for a full-width, left-aligned button. */
162
+ align?: "start" | "center" | "end";
163
+ /** Native button `type`. Defaults to `button` (so it never submits a form). */
164
+ type?: "button" | "submit" | "reset";
165
+ /** The button was activated (pointer or keyboard). Carries no detail. The native `click` also bubbles (composed) for consumers who prefer it. */
166
+ onClick?: (event: CustomEvent) => void;
167
+ }
168
+
169
+ export const Button = /*#__PURE__*/ createWebComponent<ButtonProps>(
170
+ 'kai-button',
171
+ ["theme","variant","size","icon","iconTrailing","label","disabled","full","align","type"],
172
+ { onClick: 'kai-click' },
173
+ () => import('@kitn.ai/ui/elements/button'),
82
174
  );
83
175
 
84
176
  export interface CardProps extends WebComponentProps {
85
- /** Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`. */
86
- heading?: string;
87
- /** Supporting text under the heading. Attribute: `description`. */
88
- description?: string;
89
- /** When set, the card renders its inline error state instead of the body. Attribute: `error-message`. */
90
- errorMessage?: string;
91
- /** Compact spacing for dense lists. Attribute: `dense`. */
177
+ /** Surface treatment: `outlined` (default) | `filled` | `plain` | `accent`. Attribute: `appearance`. */
178
+ appearance?: "outlined" | "filled" | "plain" | "accent";
179
+ /** `vertical` (default, media on top) | `horizontal` (media at the start) | `responsive` (horizontal when the card's container is wide enough, else vertical — a container query on the card's own width). Attribute: `orientation`. */
180
+ orientation?: "vertical" | "horizontal" | "responsive";
181
+ /** The card width below which a `responsive` card collapses to vertical and the footer actions stack. A CSS length; default `28rem`. Attribute: `collapse`. */
182
+ collapse?: string;
183
+ /** Tighter spacing for dense lists. Attribute: `dense`. */
92
184
  dense?: boolean;
185
+ /** Show a close (×) that hides the card and emits `kai-dismiss`. Attribute: `dismissible`. Off by default. */
186
+ dismissible?: boolean;
187
+ /** Render the whole card as a link. Attribute: `href`. Wins over `clickable`. */
188
+ href?: string;
189
+ /** `target` for the `href` anchor. Attribute: `target`. */
190
+ target?: string;
191
+ /** `rel` for the `href` anchor. Attribute: `rel`. */
192
+ rel?: string;
193
+ /** Make the whole card a button (`role="button"`, Enter/Space, hover affordance) that emits `kai-card-click`. Attribute: `clickable`. Ignored when `href` is set. */
194
+ clickable?: boolean;
195
+ /** A `clickable`/`href` card was activated (click, or Enter/Space). */
196
+ onCardClick?: (event: CustomEvent) => void;
197
+ /** The card was dismissed via its × (it also hides itself). */
198
+ onDismiss?: (event: CustomEvent) => void;
93
199
  }
94
200
 
95
- export const Card = createWebComponent<CardProps>(
201
+ export const Card = /*#__PURE__*/ createWebComponent<CardProps>(
96
202
  'kai-card',
97
- ["theme","heading","description","errorMessage","dense"],
98
- { },
203
+ ["theme","appearance","orientation","collapse","dense","dismissible","href","target","rel","clickable"],
204
+ { onCardClick: 'kai-card-click', onDismiss: 'kai-dismiss' },
205
+ () => import('@kitn.ai/ui/elements/card'),
99
206
  );
100
207
 
101
208
  export interface CardsProps extends WebComponentProps {
@@ -105,30 +212,42 @@ export interface CardsProps extends WebComponentProps {
105
212
  types?: Record<string, string>;
106
213
  /** Optional CardPolicy handling child events. Property: `el.policy`. */
107
214
  policy?: { onSubmit?: (cardId: string, data: unknown) => void; onAction?: (cardId: string, action: string, payload?: unknown) => void; onSendPrompt?: (text: string, opts: { mode: "compose" | "send"; context?: unknown; }) => void; onOpen?: (url: string, target: "tab" | "artifact") => void; onState?: (cardId: string, patch: unknown) => void; onDismiss?: (cardId: string) => void; onReopen?: (cardId: string) => void; onError?: (cardId: string, message: string) => void; maxSendPromptMode?: "compose" | "send" };
215
+ /** A child card transitioned to a resolved/deferred state (an action was chosen, a form/tasks submission landed, or it was dismissed) — re-emitted off the host as a non-bubbling convenience event so a consumer can observe resolution centrally without diffing the cards array. `detail` = `{ cardId, resolution }`. (A `reopen` un-resolves a card and has no `CardResolution`, so it does NOT fire this — observe reopen via the underlying bubbling `kai-card` event.) */
216
+ onCardResolved?: (event: CustomEvent<{ cardId: string; resolution: { kind: "action"; action: string; payload?: unknown; at?: undefined | string } | { kind: "submit"; data: unknown; at?: undefined | string } | { kind: "dismissed"; at?: undefined | string } | { kind: "expired"; reason?: undefined | string; at?: undefined | string } }>) => void;
108
217
  }
109
218
 
110
- export const Cards = createWebComponent<CardsProps>(
219
+ export const Cards = /*#__PURE__*/ createWebComponent<CardsProps>(
111
220
  'kai-cards',
112
221
  ["theme","cards","types","policy"],
113
- { },
222
+ { onCardResolved: 'kai-card-resolved' },
223
+ () => import('@kitn.ai/ui/elements/cards'),
114
224
  );
115
225
 
116
226
  export interface ChainOfThoughtProps extends WebComponentProps {
117
- /** The reasoning steps. Set as a JS property. Compound sub-parts collapse to this one data model (Route 1). */
118
- steps: { label: string; content?: undefined | string }[];
227
+ /** The reasoning steps. Set as a JS property. Compound sub-parts collapse to this one data model (Route 1). Each `{ label, content?, id? }`. */
228
+ steps: { label: string; content?: undefined | string; id?: undefined | string }[];
229
+ /** Open mode: `'multiple'` (default — any number of steps open at once) or `'single'` (at most one open; opening a step closes the others). */
230
+ type?: "single" | "multiple";
231
+ /** Controlled open step key(s). When set, it WINS over user interaction (the consumer owns the open set). String in `single` mode, string[] in `multiple` mode. Set as a JS property. */
232
+ value?: string | string[];
233
+ /** Uncontrolled INITIAL open step key(s) — seeds which steps render expanded. Ignored once `value` is provided. Set as a JS property. */
234
+ defaultValue?: string | string[];
235
+ /** The open set changed — by user click OR an expand()/collapse()/toggle() call. `value` is a string in `single` mode, a string[] in `multiple` mode. (Maps Radix Accordion's onValueChange.) */
236
+ onValueChange?: (event: CustomEvent<{ value: string | string[] }>) => void;
119
237
  }
120
238
 
121
- export const ChainOfThought = createWebComponent<ChainOfThoughtProps>(
239
+ export const ChainOfThought = /*#__PURE__*/ createWebComponent<ChainOfThoughtProps>(
122
240
  'kai-chain-of-thought',
123
- ["theme","steps"],
124
- { },
241
+ ["theme","steps","type","value","defaultValue"],
242
+ { onValueChange: 'kai-value-change' },
243
+ () => import('@kitn.ai/ui/elements/chain-of-thought'),
125
244
  );
126
245
 
127
246
  export interface ChatProps extends WebComponentProps {
128
247
  /** The full message thread to render, newest last. Each entry carries its role, content, and optional reasoning/tools/attachments/actions. Set as a JS property (`el.messages = [...]`). */
129
248
  messages: { id: string; role: "user" | "assistant"; content: string; reasoning?: undefined | { text: string; label?: undefined | string }; tools?: undefined | { type: string; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: undefined | Record<string, unknown>; output?: undefined | Record<string, unknown>; toolCallId?: undefined | string; errorText?: undefined | string }[]; attachments?: undefined | { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[]; actions?: undefined | ("copy" | "like" | "dislike" | "regenerate" | "edit" | { id: string; label: string; icon?: undefined | string; tooltip?: undefined | string })[]; avatar?: undefined | { src?: undefined | string; fallback?: undefined | string; alt?: undefined | string }; feedback?: undefined | "like" | "dislike" }[];
130
- /** Controlled value of the input. When set, the host owns the input text and must update it on `kai-value-change`; leave unset for uncontrolled behavior. */
131
- value?: string;
249
+ /** Value of the input. A **string** is controlled (the host owns the text and updates it on `kai-value-change`). A **ComposerDoc** is a one-time seed that pre-populates pills; the user then edits freely. Leave unset for uncontrolled. */
250
+ value?: string | ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: string; promptText?: string; data?: Record<string, unknown> } })[];
132
251
  /** Placeholder text shown in the empty input. */
133
252
  placeholder?: string;
134
253
  /** When true, shows the loading/streaming state and disables submit (use while awaiting the assistant's reply). */
@@ -140,7 +259,7 @@ export interface ChatProps extends WebComponentProps {
140
259
  /** Keep suggestions visible after the conversation starts. By default suggestions are conversation starters and hide once `messages` is non-empty; set this to keep them always shown. Default false. */
141
260
  persistSuggestions?: boolean;
142
261
  /** Body/prose font scale for rendered markdown (`'xs' | 'sm' | 'base' | 'lg'`). Defaults to `'sm'`. */
143
- proseSize?: "xs" | "sm" | "base" | "lg";
262
+ proseSize?: "sm" | "lg" | "xs" | "base";
144
263
  /** Shiki theme name for syntax-highlighted code blocks (e.g. `'github-dark-dimmed'`). */
145
264
  codeTheme?: string;
146
265
  /** Enable Shiki syntax highlighting in code blocks. Turn off to render plain `<pre>` blocks (lighter, no highlighter load). Default true. */
@@ -159,26 +278,36 @@ export interface ChatProps extends WebComponentProps {
159
278
  headerStart?: boolean;
160
279
  /** Whether the host has `slot="header-end"` content (right of the controls). */
161
280
  headerEnd?: boolean;
281
+ /** REPLACE — full custom header in place of the built-in title/model/context bar. */
282
+ headerFull?: boolean;
283
+ /** INJECT — left sidebar column (e.g. a conversation list / your own nav). */
284
+ sidebar?: boolean;
285
+ /** REPLACE — custom zero-state rendered in the message area while the thread is empty (replaces the empty message list only; the composer and its suggestions still render). */
286
+ empty?: boolean;
287
+ /** REPLACE — full custom composer in place of the built-in prompt input. The projected content wires its own submit (the data-flow boundary). */
288
+ composer?: boolean;
289
+ /** INJECT — accessory row just above the composer (e.g. extra actions). */
290
+ composerActions?: boolean;
291
+ /** INJECT — footer row below the composer (disclaimers, token meter, …). */
292
+ footer?: boolean;
162
293
  /** Show a Search (Globe) button in the input toolbar; fires a `search` event. */
163
294
  search?: boolean;
164
295
  /** Show a Voice (Mic) button in the input toolbar; fires a `voice` event. */
165
296
  voice?: boolean;
166
- /** Slash commandswhen set, typing `/` in the input opens the command palette and fires `kai-slash-select`. Set as a JS property. */
167
- slashCommands?: { id: string; label: string; description?: string; category?: string }[];
168
- /** Command ids to highlight as active in the palette. */
169
- slashActiveIds?: string[];
170
- /** Single-line palette rows. */
171
- slashCompact?: boolean;
297
+ /** Rich entity triggers each `{ char, kind, items }` opens a caret-anchored menu that inserts an atomic pill (`/` skills, `@` agents/plugins). Set as a JS property; forwarded to the input. */
298
+ triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
299
+ /** Default icon per entity kind (kind image src) for pills/menu items. */
300
+ kindIcons?: Record<string, string>;
172
301
  /** Whether each message's action bar is always visible (`'always'`, default) or only revealed on hover of that message row (`'hover'`). */
173
302
  actionsReveal?: "always" | "hover";
303
+ /** The staged attachments changed (file added or removed). Carries the full current list so a consumer can react in real time. */
304
+ onAttachmentsChange?: (event: CustomEvent<{ attachments: { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[] }>) => void;
174
305
  /** An action button on a message was clicked. `action` is the built-in name or custom id. `state` is present only for the toggleable feedback votes: `'on'` when a like/dislike is set, `'off'` when re-tapped to clear. */
175
306
  onMessageAction?: (event: CustomEvent<{ messageId: string; action: string; state?: undefined | "on" | "off" }>) => void;
176
307
  /** The header model switcher changed. */
177
308
  onModelChange?: (event: CustomEvent<{ modelId: string }>) => void;
178
309
  /** The Search button was clicked. */
179
310
  onSearch?: (event: CustomEvent<Record<string, never>>) => void;
180
- /** A slash command was chosen from the palette. */
181
- onSlashSelect?: (event: CustomEvent<{ command: { id: string; label: string; description?: undefined | string; category?: undefined | string } }>) => void;
182
311
  /** User submitted a message. */
183
312
  onSubmit?: (event: CustomEvent<{ value: string; attachments: { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[] }>) => void;
184
313
  /** A suggestion chip was clicked (only in `suggestion-mode="fill"`). */
@@ -189,10 +318,11 @@ export interface ChatProps extends WebComponentProps {
189
318
  onVoice?: (event: CustomEvent<Record<string, never>>) => void;
190
319
  }
191
320
 
192
- export const Chat = createWebComponent<ChatProps>(
321
+ export const Chat = /*#__PURE__*/ createWebComponent<ChatProps>(
193
322
  'kai-chat',
194
- ["theme","messages","value","placeholder","loading","suggestions","suggestionMode","persistSuggestions","proseSize","codeTheme","codeHighlight","chatTitle","models","currentModel","context","scrollButton","headerStart","headerEnd","search","voice","slashCommands","slashActiveIds","slashCompact","actionsReveal"],
195
- { onMessageAction: 'kai-message-action', onModelChange: 'kai-model-change', onSearch: 'kai-search', onSlashSelect: 'kai-slash-select', onSubmit: 'kai-submit', onSuggestionClick: 'kai-suggestion-click', onValueChange: 'kai-value-change', onVoice: 'kai-voice' },
323
+ ["theme","messages","value","placeholder","loading","suggestions","suggestionMode","persistSuggestions","proseSize","codeTheme","codeHighlight","chatTitle","models","currentModel","context","scrollButton","headerStart","headerEnd","headerFull","sidebar","empty","composer","composerActions","footer","search","voice","triggers","kindIcons","actionsReveal"],
324
+ { onAttachmentsChange: 'kai-attachments-change', onMessageAction: 'kai-message-action', onModelChange: 'kai-model-change', onSearch: 'kai-search', onSubmit: 'kai-submit', onSuggestionClick: 'kai-suggestion-click', onValueChange: 'kai-value-change', onVoice: 'kai-voice' },
325
+ () => import('@kitn.ai/ui/elements/chat'),
196
326
  );
197
327
 
198
328
  export interface CheckpointProps extends WebComponentProps {
@@ -201,17 +331,18 @@ export interface CheckpointProps extends WebComponentProps {
201
331
  /** Tooltip on hover. */
202
332
  tooltip?: string;
203
333
  /** Visual button style. */
204
- variant?: "ghost" | "default" | "outline";
334
+ variant?: "default" | "ghost" | "outline";
205
335
  /** Button size (use an `icon*` size for an icon-only checkpoint). */
206
- size?: "sm" | "lg" | "md" | "icon" | "icon-sm";
336
+ size?: "sm" | "md" | "lg" | "icon" | "icon-sm";
207
337
  /** The checkpoint was clicked. */
208
338
  onSelect?: (event: CustomEvent) => void;
209
339
  }
210
340
 
211
- export const Checkpoint = createWebComponent<CheckpointProps>(
341
+ export const Checkpoint = /*#__PURE__*/ createWebComponent<CheckpointProps>(
212
342
  'kai-checkpoint',
213
343
  ["theme","label","tooltip","variant","size"],
214
344
  { onSelect: 'kai-select' },
345
+ () => import('@kitn.ai/ui/elements/checkpoint'),
215
346
  );
216
347
 
217
348
  export interface ChoiceProps extends WebComponentProps {
@@ -223,12 +354,49 @@ export interface ChoiceProps extends WebComponentProps {
223
354
  heading?: string;
224
355
  /** Set when the user resolved this card; renders the read-only view. Property: `el.resolution = { kind:'action', action:'…' }`. */
225
356
  resolution?: Record<string, unknown>;
357
+ /** Controlled selection — the selected option id. When set, the consumer owns the current pick (RadioGroup `value`). Attribute: `value`. */
358
+ value?: string;
359
+ /** Option id to pre-select on mount (uncontrolled seed). Attribute: `default-value`. */
360
+ defaultValue?: string;
361
+ /** Disable the whole radiogroup + Submit (e.g. while the agent is busy). Attribute: `disabled`. */
362
+ disabled?: boolean;
363
+ /** The selection changed BEFORE submit (a row click or the `select()` method). Distinct from the terminal `action` verb on the `kai-card` contract event. */
364
+ onValueChange?: (event: CustomEvent<{ value: string }>) => void;
226
365
  }
227
366
 
228
- export const Choice = createWebComponent<ChoiceProps>(
367
+ export const Choice = /*#__PURE__*/ createWebComponent<ChoiceProps>(
229
368
  'kai-choice',
230
- ["theme","data","cardId","heading","resolution"],
231
- { },
369
+ ["theme","data","cardId","heading","resolution","value","defaultValue","disabled"],
370
+ { onValueChange: 'kai-value-change' },
371
+ () => import('@kitn.ai/ui/elements/choice'),
372
+ );
373
+
374
+ export interface CoachmarkProps extends WebComponentProps {
375
+ /** Drive/observe open state (Shoelace-style: settable + reflected to the `open` attribute; the element still self-manages). Set `el.open = true`, or `<kai-coachmark open>`; listen for `kai-open-change`. */
376
+ open?: boolean;
377
+ /** Initial open state on mount (uncontrolled seed). */
378
+ defaultOpen?: boolean;
379
+ /** The bold title. Named `headline` because `title` collides with the global `HTMLElement.title` attribute (it throws at registration). */
380
+ headline?: string;
381
+ /** A small badge pill beside the headline (e.g. "New"). */
382
+ badge?: string;
383
+ /** Floating placement relative to the anchor (default `bottom`). */
384
+ placement?: string;
385
+ /** Color tone: `primary` (default, theme accent), `info` (blue), `success` (green), `warning` (amber), or `error` (red) — reusing the kit's tool hues. */
386
+ tone?: "error" | "primary" | "info" | "success" | "warning";
387
+ /** Render the arrow that points at the anchor (default `true`). Set `arrow="false"` for a plain bubble with no pointer. */
388
+ arrow?: boolean;
389
+ /** The × dismiss button was pressed. The consumer records that this hint was seen so it won't show again. */
390
+ onDismiss?: (event: CustomEvent<Record<string, never>>) => void;
391
+ /** The coachmark opened or closed (a method, the ×, or a driven `open`). */
392
+ onOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
393
+ }
394
+
395
+ export const Coachmark = /*#__PURE__*/ createWebComponent<CoachmarkProps>(
396
+ 'kai-coachmark',
397
+ ["theme","open","defaultOpen","headline","badge","placement","tone","arrow"],
398
+ { onDismiss: 'kai-dismiss', onOpenChange: 'kai-open-change' },
399
+ () => import('@kitn.ai/ui/elements/coachmark'),
232
400
  );
233
401
 
234
402
  export interface CodeBlockProps extends WebComponentProps {
@@ -241,13 +409,36 @@ export interface CodeBlockProps extends WebComponentProps {
241
409
  /** Disable syntax highlighting (renders plain text, no Shiki). */
242
410
  codeHighlight?: boolean;
243
411
  /** Code text sizing. */
244
- proseSize?: "xs" | "sm" | "base" | "lg";
412
+ proseSize?: "sm" | "lg" | "xs" | "base";
245
413
  }
246
414
 
247
- export const CodeBlock = createWebComponent<CodeBlockProps>(
415
+ export const CodeBlock = /*#__PURE__*/ createWebComponent<CodeBlockProps>(
248
416
  'kai-code-block',
249
417
  ["theme","code","language","codeTheme","codeHighlight","proseSize"],
250
418
  { },
419
+ () => import('@kitn.ai/ui/elements/code-block'),
420
+ );
421
+
422
+ export interface CommandProps extends WebComponentProps {
423
+ /** Flat list of items. Set as a JS property — not an HTML attribute. */
424
+ items?: { id: string; label: string; icon?: string; description?: string; shortcut?: string; group?: string }[];
425
+ /** Placeholder text for the search input. */
426
+ placeholder?: string;
427
+ /** Label shown when no items match the current query. */
428
+ emptyLabel?: string;
429
+ /** Fired when the highlighted/active item changes — via Arrow keys or when filtering re-clamps the active row. `id` is the newly active item's id, or `undefined` when no item is active (e.g. the filtered list is empty). Lets a host preview the active item without committing a selection. */
430
+ onActiveChange?: (event: CustomEvent<{ id: undefined | string }>) => void;
431
+ /** Fired on every keystroke in the search input. */
432
+ onQueryChange?: (event: CustomEvent<{ value: string }>) => void;
433
+ /** Fired when the user selects an item (click or Enter). */
434
+ onSelect?: (event: CustomEvent<{ id: string }>) => void;
435
+ }
436
+
437
+ export const Command = /*#__PURE__*/ createWebComponent<CommandProps>(
438
+ 'kai-command',
439
+ ["theme","items","placeholder","emptyLabel"],
440
+ { onActiveChange: 'kai-active-change', onQueryChange: 'kai-query-change', onSelect: 'kai-select' },
441
+ () => import('@kitn.ai/ui/elements/command'),
251
442
  );
252
443
 
253
444
  export interface CompareProps extends WebComponentProps {
@@ -260,7 +451,7 @@ export interface CompareProps extends WebComponentProps {
260
451
  /** Layout: `'auto'` (default — columns when wide, tabs when narrow, by CONTAINER width) | `'columns'` (side-by-side) | `'tabs'` (pills to switch). Attribute: `layout`. */
261
452
  layout?: "auto" | "columns" | "tabs";
262
453
  /** Prose/text size for the rendered candidates. Attribute: `prose-size`. */
263
- proseSize?: "xs" | "sm" | "base" | "lg";
454
+ proseSize?: "sm" | "lg" | "xs" | "base";
264
455
  /** Shiki theme for code blocks in the candidates. Attribute: `code-theme`. */
265
456
  codeTheme?: string;
266
457
  /** Whether code blocks are syntax-highlighted. Attribute: `code-highlight`. */
@@ -273,10 +464,55 @@ export interface CompareProps extends WebComponentProps {
273
464
  onReady?: (event: CustomEvent<{ compareId: string }>) => void;
274
465
  }
275
466
 
276
- export const Compare = createWebComponent<CompareProps>(
467
+ export const Compare = /*#__PURE__*/ createWebComponent<CompareProps>(
277
468
  'kai-compare',
278
469
  ["theme","data","compareId","selection","layout","proseSize","codeTheme","codeHighlight"],
279
470
  { onCompareSelect: 'kai-compare-select', onError: 'kai-error', onReady: 'kai-ready' },
471
+ () => import('@kitn.ai/ui/elements/compare'),
472
+ );
473
+
474
+ export interface ComposerProps extends WebComponentProps {
475
+ /** Controlled value — string or a full ComposerDoc (set as JS property). */
476
+ value?: string | ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: string; promptText?: string; data?: Record<string, unknown> } })[];
477
+ /** Placeholder text shown when the composer is empty. */
478
+ placeholder?: string;
479
+ /** Disable the composer entirely (non-interactive). */
480
+ disabled?: boolean;
481
+ /** Show a loading/streaming state and block submit. */
482
+ loading?: boolean;
483
+ /** Maximum height in px before the content scrolls. Default 240. */
484
+ maxHeight?: string | number;
485
+ /** Whether pressing Enter (without Shift) submits. Default true. */
486
+ submitOnEnter?: boolean;
487
+ /** Trigger definitions — set as a JS property. */
488
+ triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
489
+ /** Keyword highlight rules — set as a JS property. */
490
+ highlights?: (string | { pattern: string; flags?: string; class?: string })[];
491
+ /** Default icon per entity kind (kind → image URL/data-URI) for items without their own `icon`. Overrides the built-in agent/plugin glyphs. JS property. */
492
+ kindIcons?: Record<string, string>;
493
+ /** The composer lost focus. */
494
+ onBlur?: (event: CustomEvent<{ originalEvent: FocusEvent }>) => void;
495
+ /** An entity pill was inserted into the composer. */
496
+ onEntityAdd?: (event: CustomEvent<{ entity: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> } }>) => void;
497
+ /** An entity pill was deleted from the composer. */
498
+ onEntityRemove?: (event: CustomEvent<{ entity: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> } }>) => void;
499
+ /** The composer gained focus. `focus`/`blur` are NOT composed natively, so they don't escape the shadow root — these re-expose them on the host. (For `keydown`/`paste`/`focusin`/`focusout`, listen NATIVELY on `<kai-composer>`: they're composed and already cross the shadow boundary.) */
500
+ onFocus?: (event: CustomEvent<{ originalEvent: FocusEvent }>) => void;
501
+ /** The user submitted the composer (Enter or programmatic submit). */
502
+ onSubmit?: (event: CustomEvent<{ doc: ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> } })[]; text: string; entities: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> }[] }>) => void;
503
+ /** A trigger character was detected at the caret (e.g. `/` or `@`). */
504
+ onTrigger?: (event: CustomEvent<{ char: string; query: string; rect: DOMRect }>) => void;
505
+ /** The active trigger was dismissed (Escape, space, or outside click). */
506
+ onTriggerClose?: (event: CustomEvent<Record<string, never>>) => void;
507
+ /** The content changed (fires on every input event). */
508
+ onValueChange?: (event: CustomEvent<{ doc: ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> } })[]; text: string; entities: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> }[] }>) => void;
509
+ }
510
+
511
+ export const Composer = /*#__PURE__*/ createWebComponent<ComposerProps>(
512
+ 'kai-composer',
513
+ ["theme","value","placeholder","disabled","loading","maxHeight","submitOnEnter","triggers","highlights","kindIcons"],
514
+ { onBlur: 'kai-blur', onEntityAdd: 'kai-entity-add', onEntityRemove: 'kai-entity-remove', onFocus: 'kai-focus', onSubmit: 'kai-submit', onTrigger: 'kai-trigger', onTriggerClose: 'kai-trigger-close', onValueChange: 'kai-value-change' },
515
+ () => import('@kitn.ai/ui/elements/composer'),
280
516
  );
281
517
 
282
518
  export interface ConfirmProps extends WebComponentProps {
@@ -292,10 +528,11 @@ export interface ConfirmProps extends WebComponentProps {
292
528
  resolution?: Record<string, unknown>;
293
529
  }
294
530
 
295
- export const Confirm = createWebComponent<ConfirmProps>(
531
+ export const Confirm = /*#__PURE__*/ createWebComponent<ConfirmProps>(
296
532
  'kai-confirm',
297
533
  ["theme","data","cardId","heading","autofocus","resolution"],
298
534
  { },
535
+ () => import('@kitn.ai/ui/elements/confirm-card'),
299
536
  );
300
537
 
301
538
  export interface ContextProps extends WebComponentProps {
@@ -309,31 +546,79 @@ export interface ContextProps extends WebComponentProps {
309
546
  onThresholdChange?: (event: CustomEvent<{ level: "ok" | "warn" | "danger" }>) => void;
310
547
  }
311
548
 
312
- export const Context = createWebComponent<ContextProps>(
549
+ export const Context = /*#__PURE__*/ createWebComponent<ContextProps>(
313
550
  'kai-context',
314
551
  ["theme","context","warnThreshold","dangerThreshold"],
315
552
  { onThresholdChange: 'kai-threshold-change' },
553
+ () => import('@kitn.ai/ui/elements/context-meter'),
316
554
  );
317
555
 
318
556
  export interface ConversationsProps extends WebComponentProps {
319
557
  /** Pre-bucketed conversation groups (e.g. "Today", "Yesterday"), each with its own conversations. Use this when you want to control the grouping/headers yourself; otherwise pass a flat `conversations` array. Set as a JS property. */
320
558
  groups: { id: string; userId?: undefined | string; teamId?: undefined | string; name: string; sortOrder: number; createdAt: string }[];
321
559
  /** A flat list of conversation summaries; the component buckets them by recency for you. Ignored when `groups` is provided. Set as a JS property. */
322
- conversations: { id: string; title: string; groupId?: undefined | string; scope: { type: "document" | "collection"; documentId?: undefined | string; filters?: undefined | { tags?: undefined | string[]; authors?: undefined | string[]; contentType?: undefined | "transcript" | "markdown"; dateRange?: undefined | { from: string; to: string } } }; messageCount: number; lastMessageAt: string; updatedAt: string }[];
560
+ conversations: { id: string; title: string; groupId?: undefined | string; scope: { type: "document" | "collection"; documentId?: undefined | string; filters?: undefined | { tags?: undefined | string[]; authors?: undefined | string[]; contentType?: undefined | "transcript" | "markdown"; dateRange?: undefined | { from: string; to: string } } }; messageCount: number; lastMessageAt: string; updatedAt: string; trailing?: undefined | string }[];
323
561
  /** The id of the currently-open conversation, highlighted in the list. */
324
562
  activeId?: string;
563
+ /** Controlled collapsed state. Set as a JS property (`el.collapsed = true`) to drive the rail from your app, updating it in response to `kai-collapse-toggle`. Omit for uncontrolled (the element manages it). Collapsed shrinks the rail to a floating reopen button. */
564
+ collapsed?: boolean;
565
+ /** Initial collapsed state when uncontrolled (default false). Use the `default-collapsed` attribute to start collapsed in plain HTML. */
566
+ defaultCollapsed?: boolean;
567
+ /** The rail was collapsed or expanded (via the toggle, the reopen button, or a `collapse()`/`expand()`/`toggle()` call). */
568
+ onCollapseToggle?: (event: CustomEvent<{ collapsed: boolean }>) => void;
325
569
  /** A conversation was selected. */
326
570
  onConversationSelect?: (event: CustomEvent<{ id: string }>) => void;
327
571
  /** The "New chat" button was clicked. */
328
572
  onNewChat?: (event: CustomEvent<Record<string, never>>) => void;
573
+ /** The built-in search box query changed (typing, or a programmatic `clear()` which fires it with `''`). Lets a consumer mirror or server-side the filter. */
574
+ onSearch?: (event: CustomEvent<{ query: string }>) => void;
329
575
  /** The sidebar toggle was clicked. */
330
576
  onToggleSidebar?: (event: CustomEvent<Record<string, never>>) => void;
331
577
  }
332
578
 
333
- export const Conversations = createWebComponent<ConversationsProps>(
579
+ export const Conversations = /*#__PURE__*/ createWebComponent<ConversationsProps>(
334
580
  'kai-conversations',
335
- ["theme","groups","conversations","activeId"],
336
- { onConversationSelect: 'kai-conversation-select', onNewChat: 'kai-new-chat', onToggleSidebar: 'kai-toggle-sidebar' },
581
+ ["theme","groups","conversations","activeId","collapsed","defaultCollapsed"],
582
+ { onCollapseToggle: 'kai-collapse-toggle', onConversationSelect: 'kai-conversation-select', onNewChat: 'kai-new-chat', onSearch: 'kai-search', onToggleSidebar: 'kai-toggle-sidebar' },
583
+ () => import('@kitn.ai/ui/elements/conversation-list'),
584
+ );
585
+
586
+ export interface DialogProps extends WebComponentProps {
587
+ /** Drive/observe open state (Shoelace-style: settable + reflected to the `open` attribute; the element still self-manages on Escape/backdrop). Set `el.open = true`, or `<kai-dialog open>`; listen for `kai-open-change`. */
588
+ open?: boolean;
589
+ /** Initial open state on mount (uncontrolled seed). */
590
+ defaultOpen?: boolean;
591
+ /** The dialog opened or closed (Escape, backdrop click, a driven `open`, or a method). */
592
+ onOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
593
+ }
594
+
595
+ export const Dialog = /*#__PURE__*/ createWebComponent<DialogProps>(
596
+ 'kai-dialog',
597
+ ["theme","open","defaultOpen"],
598
+ { onOpenChange: 'kai-open-change' },
599
+ () => import('@kitn.ai/ui/elements/dialog'),
600
+ );
601
+
602
+ export interface EditableLabelProps extends WebComponentProps {
603
+ /** The label text — settable and reflected to the `value` attribute. Read `el.value` for live state. */
604
+ value?: string;
605
+ /** Controlled edit state. `el.editing = true` opens the field; reflected to the `editing` attribute. */
606
+ editing?: boolean;
607
+ /** Placeholder shown while editing / when the value is empty. */
608
+ placeholder?: string;
609
+ /** Disable entering edit mode. */
610
+ disabled?: boolean;
611
+ /** Edit was cancelled (Esc); the text is restored. */
612
+ onCancel?: (event: CustomEvent<Record<string, never>>) => void;
613
+ /** Committed a changed value (Enter / blur). */
614
+ onRename?: (event: CustomEvent<{ value: string }>) => void;
615
+ }
616
+
617
+ export const EditableLabel = /*#__PURE__*/ createWebComponent<EditableLabelProps>(
618
+ 'kai-editable-label',
619
+ ["theme","value","editing","placeholder","disabled"],
620
+ { onCancel: 'kai-cancel', onRename: 'kai-rename' },
621
+ () => import('@kitn.ai/ui/elements/editable-label'),
337
622
  );
338
623
 
339
624
  export interface EmbedProps extends WebComponentProps {
@@ -343,10 +628,11 @@ export interface EmbedProps extends WebComponentProps {
343
628
  data?: { provider: "youtube" | "vimeo" | "generic"; id?: string; url?: string; title?: string; poster?: string; start?: number; aspectRatio?: "16:9" | "4:3" | "1:1" | "9:16" };
344
629
  }
345
630
 
346
- export const Embed = createWebComponent<EmbedProps>(
631
+ export const Embed = /*#__PURE__*/ createWebComponent<EmbedProps>(
347
632
  'kai-embed',
348
633
  ["theme","cardId","data"],
349
634
  { },
635
+ () => import('@kitn.ai/ui/elements/embed'),
350
636
  );
351
637
 
352
638
  export interface EmptyProps extends WebComponentProps {
@@ -356,10 +642,11 @@ export interface EmptyProps extends WebComponentProps {
356
642
  description?: string;
357
643
  }
358
644
 
359
- export const Empty = createWebComponent<EmptyProps>(
645
+ export const Empty = /*#__PURE__*/ createWebComponent<EmptyProps>(
360
646
  'kai-empty',
361
647
  ["theme","emptyTitle","description"],
362
648
  { },
649
+ () => import('@kitn.ai/ui/elements/empty'),
363
650
  );
364
651
 
365
652
  export interface FeedbackBarProps extends WebComponentProps {
@@ -385,27 +672,31 @@ export interface FeedbackBarProps extends WebComponentProps {
385
672
  onFeedbackDetail?: (event: CustomEvent<{ value: "helpful" | "not-helpful"; category?: undefined | string; comment?: undefined | string }>) => void;
386
673
  }
387
674
 
388
- export const FeedbackBar = createWebComponent<FeedbackBarProps>(
675
+ export const FeedbackBar = /*#__PURE__*/ createWebComponent<FeedbackBarProps>(
389
676
  'kai-feedback-bar',
390
677
  ["theme","barTitle","collectDetail","categories","detailTitle","detailPlaceholder","submitLabel","thanksMessage"],
391
678
  { onClose: 'kai-close', onFeedback: 'kai-feedback', onFeedbackDetail: 'kai-feedback-detail' },
679
+ () => import('@kitn.ai/ui/elements/feedback-bar'),
392
680
  );
393
681
 
394
682
  export interface FileTreeProps extends WebComponentProps {
395
- /** The files to render. Set as a JS property (array of `{ path, url?, code?, language?, type? }`). */
396
- files: { path: string; url?: undefined | string; code?: undefined | string; language?: undefined | string; type?: undefined | "html" | "pdf" | "image" | "other" }[];
683
+ /** The files to render. Set as a JS property (array of `{ path, url?, code?, language?, type?, additions?, deletions?, status? }`). */
684
+ files: { path: string; url?: undefined | string; code?: undefined | string; language?: undefined | string; type?: undefined | "html" | "pdf" | "image" | "other"; additions?: undefined | number; deletions?: undefined | number; status?: undefined | "added" | "modified" | "deleted" | "renamed" | "untracked" }[];
397
685
  /** Selected file path — highlighted in the tree. */
398
686
  activeFile?: string;
399
687
  /** Folder paths expanded initially. Omit to start with all folders open. */
400
688
  defaultExpanded?: string[];
689
+ /** Show a changed-files summary header (file count + summed `+/-` + Collapse-all). Attribute: `summary`. Off by default. */
690
+ summary?: boolean;
401
691
  /** Fired when a file is selected. `detail.path` = the file's path. */
402
692
  onSelect?: (event: CustomEvent<{ path: string }>) => void;
403
693
  }
404
694
 
405
- export const FileTree = createWebComponent<FileTreeProps>(
695
+ export const FileTree = /*#__PURE__*/ createWebComponent<FileTreeProps>(
406
696
  'kai-file-tree',
407
- ["theme","files","activeFile","defaultExpanded"],
697
+ ["theme","files","activeFile","defaultExpanded","summary"],
408
698
  { onSelect: 'kai-select' },
699
+ () => import('@kitn.ai/ui/elements/file-tree'),
409
700
  );
410
701
 
411
702
  export interface FileUploadProps extends WebComponentProps {
@@ -421,10 +712,11 @@ export interface FileUploadProps extends WebComponentProps {
421
712
  onFilesAdded?: (event: CustomEvent<{ files: File[] }>) => void;
422
713
  }
423
714
 
424
- export const FileUpload = createWebComponent<FileUploadProps>(
715
+ export const FileUpload = /*#__PURE__*/ createWebComponent<FileUploadProps>(
425
716
  'kai-file-upload',
426
717
  ["theme","multiple","accept","disabled","label"],
427
718
  { onFilesAdded: 'kai-files-added' },
719
+ () => import('@kitn.ai/ui/elements/file-upload'),
428
720
  );
429
721
 
430
722
  export interface FormProps extends WebComponentProps {
@@ -436,12 +728,59 @@ export interface FormProps extends WebComponentProps {
436
728
  heading?: string;
437
729
  /** Set when the user resolved this card; renders the read-only view. Property: `el.resolution = { kind:'submit', data:{…} }`. */
438
730
  resolution?: Record<string, unknown>;
731
+ /** Controlled field values (JS property). When set, it wins over local edits. */
732
+ values?: Record<string, unknown>;
733
+ /** Initial values overlaying the schema defaults (uncontrolled seed; JS property). */
734
+ defaultValues?: Record<string, unknown>;
735
+ /** Disable all fields + submit. Attribute: `disabled`. */
736
+ disabled?: boolean;
737
+ /** The form's values changed on input — current coerced values + validity. */
738
+ onValuesChange?: (event: CustomEvent<{ values: Record<string, unknown>; valid: boolean }>) => void;
439
739
  }
440
740
 
441
- export const Form = createWebComponent<FormProps>(
741
+ export const Form = /*#__PURE__*/ createWebComponent<FormProps>(
442
742
  'kai-form',
443
- ["theme","data","cardId","heading","resolution"],
743
+ ["theme","data","cardId","heading","resolution","values","defaultValues","disabled"],
744
+ { onValuesChange: 'kai-values-change' },
745
+ () => import('@kitn.ai/ui/elements/form'),
746
+ );
747
+
748
+ export interface HoverCardProps extends WebComponentProps {
749
+ /** Delay (ms) before the card opens on hover. Defaults to 0 (focus opens it immediately too). */
750
+ openDelay?: number;
751
+ /** Delay (ms) before it closes after the pointer leaves. Defaults to 300. */
752
+ closeDelay?: number;
753
+ /** Preferred placement: `'top' | 'bottom' | 'left' | 'right'` (+ optional `-start`/`-end`). Defaults to `'bottom'`; flips to stay in view. */
754
+ placement?: string;
755
+ /** Drive/observe open state (Shoelace-style: settable + reflected to the `open` attribute, the element still self-manages on hover). Set `el.open = true`, or `<kai-hover-card open>`; listen for `kai-open-change`. */
756
+ open?: boolean;
757
+ /** Initial open state on mount (uncontrolled seed). */
758
+ defaultOpen?: boolean;
759
+ /** Suppress the hover behavior entirely without unmounting. */
760
+ disabled?: boolean;
761
+ /** The card opened or closed (by hover/focus, outside-click, or a method). */
762
+ onOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
763
+ }
764
+
765
+ export const HoverCard = /*#__PURE__*/ createWebComponent<HoverCardProps>(
766
+ 'kai-hover-card',
767
+ ["theme","openDelay","closeDelay","placement","open","defaultOpen","disabled"],
768
+ { onOpenChange: 'kai-open-change' },
769
+ () => import('@kitn.ai/ui/elements/hover-card'),
770
+ );
771
+
772
+ export interface IconProps extends WebComponentProps {
773
+ /** A curated icon name (e.g. `"mic"`, `"globe"`), an image URL/data-URI, or plain text. */
774
+ name?: string;
775
+ /** Size token: `sm` | `md` (default) | `lg`. */
776
+ size?: "sm" | "md" | "lg";
777
+ }
778
+
779
+ export const Icon = /*#__PURE__*/ createWebComponent<IconProps>(
780
+ 'kai-icon',
781
+ ["theme","name","size"],
444
782
  { },
783
+ () => import('@kitn.ai/ui/elements/icon'),
445
784
  );
446
785
 
447
786
  export interface ImageProps extends WebComponentProps {
@@ -455,10 +794,69 @@ export interface ImageProps extends WebComponentProps {
455
794
  mediaType?: string;
456
795
  }
457
796
 
458
- export const Image = createWebComponent<ImageProps>(
797
+ export const Image = /*#__PURE__*/ createWebComponent<ImageProps>(
459
798
  'kai-image',
460
799
  ["theme","base64","bytes","alt","mediaType"],
461
800
  { },
801
+ () => import('@kitn.ai/ui/elements/image'),
802
+ );
803
+
804
+ export interface InputProps extends WebComponentProps {
805
+ /** Native input type: `text` (default) · `email` · `url` · `search` · `tel` · `password` · `number`. Single-line only. */
806
+ type?: string;
807
+ /** Controlled value — settable and reflected to the `value` attribute. `el.value = 'hi'` drives it (no event); typing updates it and fires `kai-input`. Read `el.value` for live state. */
808
+ value?: string;
809
+ /** Placeholder shown when empty. */
810
+ placeholder?: string;
811
+ /** Field label, linked to the input. */
812
+ label?: string;
813
+ /** Helper text below the control. */
814
+ hint?: string;
815
+ /** Error text; flips the field invalid (`aria-invalid` + destructive border). */
816
+ error?: string;
817
+ /** Control density: `sm` or `md`. Defaults to `md`. */
818
+ size?: "sm" | "md";
819
+ /** Disable interaction. */
820
+ disabled?: boolean;
821
+ /** Make the input read-only. */
822
+ readonly?: boolean;
823
+ /** Mark the input required. */
824
+ required?: boolean;
825
+ /** Force the invalid state without an `error` string. */
826
+ invalid?: boolean;
827
+ /** Form-control name. */
828
+ name?: string;
829
+ /** Autofill hint forwarded to the inner input (e.g. `email`, `current-password`). */
830
+ autocomplete?: string;
831
+ /** Virtual-keyboard hint forwarded to the inner input (e.g. `numeric`, `email`). */
832
+ inputmode?: string;
833
+ /** The value was committed (blur). */
834
+ onChange?: (event: CustomEvent<{ value: string }>) => void;
835
+ /** The value changed per keystroke. */
836
+ onInput?: (event: CustomEvent<{ value: string }>) => void;
837
+ }
838
+
839
+ export const Input = /*#__PURE__*/ createWebComponent<InputProps>(
840
+ 'kai-input',
841
+ ["theme","type","value","placeholder","label","hint","error","size","disabled","readonly","required","invalid","name","autocomplete","inputmode"],
842
+ { onChange: 'kai-change', onInput: 'kai-input' },
843
+ () => import('@kitn.ai/ui/elements/input'),
844
+ );
845
+
846
+ export interface KbdProps extends WebComponentProps {
847
+ /** Shortcut spec — tokens joined by `+` (e.g. `Mod+Shift+K`). Omit it to show default-slot content instead. Display only; the element does not bind keys. */
848
+ keys?: string;
849
+ /** `mac` uses ⌘/⌥, `other` uses Ctrl. `auto` (default) sniffs the OS. */
850
+ platform?: "other" | "auto" | "mac";
851
+ /** Cap size: `sm` or `md`. Defaults to `md`. */
852
+ size?: "sm" | "md";
853
+ }
854
+
855
+ export const Kbd = /*#__PURE__*/ createWebComponent<KbdProps>(
856
+ 'kai-kbd',
857
+ ["theme","keys","platform","size"],
858
+ { },
859
+ () => import('@kitn.ai/ui/elements/kbd'),
462
860
  );
463
861
 
464
862
  export interface LinkPreviewProps extends WebComponentProps {
@@ -468,42 +866,77 @@ export interface LinkPreviewProps extends WebComponentProps {
468
866
  data?: { url: string; title?: string; description?: string; image?: string; imageAlt?: string; favicon?: string; domain?: string; siteName?: string };
469
867
  }
470
868
 
471
- export const LinkPreview = createWebComponent<LinkPreviewProps>(
869
+ export const LinkPreview = /*#__PURE__*/ createWebComponent<LinkPreviewProps>(
472
870
  'kai-link-preview',
473
871
  ["theme","cardId","data"],
474
872
  { },
873
+ () => import('@kitn.ai/ui/elements/link-preview'),
475
874
  );
476
875
 
477
876
  export interface LoaderProps extends WebComponentProps {
478
877
  /** The animation style: `'circular' | 'classic' | 'pulse' | 'pulse-dot' | 'dots' | 'typing' | 'wave' | 'bars' | 'terminal' | 'text-blink' | 'text-shimmer' | 'loading-dots'`. Defaults to `'circular'`. */
479
878
  variant?: "circular" | "classic" | "pulse" | "pulse-dot" | "dots" | "typing" | "wave" | "bars" | "terminal" | "text-blink" | "text-shimmer" | "loading-dots";
480
879
  /** Loader size: `'sm' | 'md' | 'lg'`. Defaults to `'md'`. */
481
- size?: "sm" | "lg" | "md";
880
+ size?: "sm" | "md" | "lg";
482
881
  /** Label for the text-based variants. */
483
882
  text?: string;
484
883
  }
485
884
 
486
- export const Loader = createWebComponent<LoaderProps>(
885
+ export const Loader = /*#__PURE__*/ createWebComponent<LoaderProps>(
487
886
  'kai-loader',
488
887
  ["theme","variant","size","text"],
489
888
  { },
889
+ () => import('@kitn.ai/ui/elements/loader'),
490
890
  );
491
891
 
492
892
  export interface MarkdownProps extends WebComponentProps {
493
893
  /** The markdown source to render. */
494
894
  content: string;
495
895
  /** Text/markdown sizing. */
496
- proseSize?: "xs" | "sm" | "base" | "lg";
896
+ proseSize?: "sm" | "lg" | "xs" | "base";
497
897
  /** Shiki theme for fenced code blocks. */
498
898
  codeTheme?: string;
499
899
  /** Disable syntax highlighting (no Shiki loads). */
500
900
  codeHighlight?: boolean;
501
901
  }
502
902
 
503
- export const Markdown = createWebComponent<MarkdownProps>(
903
+ export const Markdown = /*#__PURE__*/ createWebComponent<MarkdownProps>(
504
904
  'kai-markdown',
505
905
  ["theme","content","proseSize","codeTheme","codeHighlight"],
506
906
  { },
907
+ () => import('@kitn.ai/ui/elements/markdown'),
908
+ );
909
+
910
+ export interface MenuProps extends WebComponentProps {
911
+ /** Tree of menu items. Set as a JS property — not an HTML attribute. */
912
+ items?: { id?: string; label?: string; icon?: string; shortcut?: string; checked?: boolean; radioGroup?: string; disabled?: boolean; separator?: boolean; heading?: boolean; items?: Record<string, unknown>[] }[];
913
+ /** Optional placement hint (unused by the underlying Dropdown which always positions bottom-start, kept for future extension). */
914
+ placement?: string;
915
+ /** Built-in trigger: leading icon (a named icon like `"plus"`, an image URL/data-URI, or text). Use this instead of slotting `slot="trigger"` for the common case — a slotted trigger overrides it. */
916
+ triggerIcon?: string;
917
+ /** Built-in trigger: a text label (e.g. `"High"`). */
918
+ triggerLabel?: string;
919
+ /** Built-in trigger: a trailing icon (e.g. `"chevron-down"` for a select look). */
920
+ triggerIconTrailing?: string;
921
+ /** Accessible name for an icon-only trigger (no visible label). */
922
+ label?: string;
923
+ /** Drive/observe open state (Shoelace-style: settable + reflected to the `open` attribute, the menu still self-manages on click/keyboard). Set `el.open = true`, or `<kai-menu open>`; listen for `kai-open-change`. */
924
+ open?: boolean;
925
+ /** Initial open state on mount (uncontrolled seed). */
926
+ defaultOpen?: boolean;
927
+ /** Disable the trigger — click/keyboard and `show()` no longer open the menu. */
928
+ disabled?: boolean;
929
+ /** The menu opened or closed (by click, keyboard, Escape, outside-click, or a method). */
930
+ onOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
931
+ /** Fired when the user selects a leaf item. - Plain items: `{ id }`. - Checkbox items: `{ id, checked }` where `checked` is the NEW state. - Radio items: `{ id, radioGroup }` — the consumer marks `id` as the selected one in `radioGroup` and clears the others. */
932
+ onSelect?: (event: CustomEvent<{ id: string; checked?: undefined | boolean; radioGroup?: undefined | string }>) => void;
933
+ }
934
+
935
+ export const Menu = /*#__PURE__*/ createWebComponent<MenuProps>(
936
+ 'kai-menu',
937
+ ["theme","items","placement","triggerIcon","triggerLabel","triggerIconTrailing","label","open","defaultOpen","disabled"],
938
+ { onOpenChange: 'kai-open-change', onSelect: 'kai-select' },
939
+ () => import('@kitn.ai/ui/elements/menu'),
507
940
  );
508
941
 
509
942
  export interface MessageProps extends WebComponentProps {
@@ -516,7 +949,7 @@ export interface MessageProps extends WebComponentProps {
516
949
  /** Force markdown on/off. Defaults to on for assistant, off for user. */
517
950
  markdown?: boolean;
518
951
  /** Text/markdown sizing for the message body. */
519
- proseSize?: "xs" | "sm" | "base" | "lg";
952
+ proseSize?: "sm" | "lg" | "xs" | "base";
520
953
  /** Shiki theme name used for fenced code blocks in the content. */
521
954
  codeTheme?: string;
522
955
  /** Disable syntax highlighting for code blocks (no Shiki loads). */
@@ -527,14 +960,17 @@ export interface MessageProps extends WebComponentProps {
527
960
  avatarSrc?: string;
528
961
  /** Convenience avatar fallback text (used when `message.avatar` is not set). */
529
962
  avatarFallback?: string;
963
+ /** Avatar rail mode. `'none'` omits the avatar rail entirely so the body spans the full row (predictable layout when you never show avatars). Any other value keeps the default behaviour: the built-in avatar when one resolves, or your `slot="avatar"` content when projected (which REPLACES the built-in). */
964
+ avatar?: string;
530
965
  /** An action button was clicked. `action` is the built-in name or custom id. `state` is present only for the toggleable feedback votes: `'on'` when a like/dislike is set, `'off'` when re-tapped to clear. */
531
966
  onMessageAction?: (event: CustomEvent<{ messageId: string; action: string; state?: undefined | "on" | "off" }>) => void;
532
967
  }
533
968
 
534
- export const Message = createWebComponent<MessageProps>(
969
+ export const Message = /*#__PURE__*/ createWebComponent<MessageProps>(
535
970
  'kai-message',
536
- ["theme","message","role","content","markdown","proseSize","codeTheme","codeHighlight","actionsReveal","avatarSrc","avatarFallback"],
971
+ ["theme","message","role","content","markdown","proseSize","codeTheme","codeHighlight","actionsReveal","avatarSrc","avatarFallback","avatar"],
537
972
  { onMessageAction: 'kai-message-action' },
973
+ () => import('@kitn.ai/ui/elements/message'),
538
974
  );
539
975
 
540
976
  export interface ModelSwitcherProps extends WebComponentProps {
@@ -542,14 +978,119 @@ export interface ModelSwitcherProps extends WebComponentProps {
542
978
  models: { id: string; name: string; provider?: undefined | string; description?: undefined | string; group?: undefined | string }[];
543
979
  /** The currently-selected model id. Defaults to the first model. */
544
980
  currentModel?: string;
981
+ /** Drive/observe the dropdown's open state (Shoelace-style: settable + reflected to the `open` attribute, the dropdown still self-manages on click/keyboard). Set `el.open = true`, or `<kai-model-switcher open>`; listen for `kai-open-change`. */
982
+ open?: boolean;
983
+ /** Initial open state on mount (uncontrolled seed). */
984
+ defaultOpen?: boolean;
985
+ /** Disable the trigger — click/keyboard and `show()` no longer open the dropdown. */
986
+ disabled?: boolean;
545
987
  /** A model was selected. */
546
988
  onModelChange?: (event: CustomEvent<{ modelId: string }>) => void;
989
+ /** The model dropdown opened or closed (by click, keyboard, Escape, outside-click, or a method). */
990
+ onOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
547
991
  }
548
992
 
549
- export const ModelSwitcher = createWebComponent<ModelSwitcherProps>(
993
+ export const ModelSwitcher = /*#__PURE__*/ createWebComponent<ModelSwitcherProps>(
550
994
  'kai-model-switcher',
551
- ["theme","models","currentModel"],
552
- { onModelChange: 'kai-model-change' },
995
+ ["theme","models","currentModel","open","defaultOpen","disabled"],
996
+ { onModelChange: 'kai-model-change', onOpenChange: 'kai-open-change' },
997
+ () => import('@kitn.ai/ui/elements/model-switcher'),
998
+ );
999
+
1000
+ export interface NavProps extends WebComponentProps {
1001
+ /** The nav items. Set as a JS property (array, not an attribute). Each item may carry `children` (a collapsible group), a `status` dot, and trailing `meta` text. */
1002
+ items?: { id: string; label?: string; icon?: string; badge?: string; trailing?: string; disabled?: boolean; children?: Record<string, unknown>[]; status?: { tone: "error" | "primary" | "info" | "success" | "warning" | "neutral"; label?: string; pulse?: boolean }; meta?: string; action?: { icon: string; label: string }; closable?: boolean }[];
1003
+ /** Active item id (controlled). */
1004
+ value?: string;
1005
+ /** Initial active id when uncontrolled. */
1006
+ defaultValue?: string;
1007
+ /** Ids of group items collapsed on first render (groups default to expanded). Set as a JS property (array). */
1008
+ defaultCollapsed?: string[];
1009
+ /** A row's trailing `action` button was activated (not a select). `value` is the item id; `action` echoes the item's `{ icon, label }`. */
1010
+ onNavItemAction?: (event: CustomEvent<{ value: string; action?: undefined | { icon: string; label: string } }>) => void;
1011
+ /** A `closable` row's trailing close button was activated (not a select). `value` is the item id. */
1012
+ onNavItemClose?: (event: CustomEvent<{ value: string }>) => void;
1013
+ /** A nav item was activated. */
1014
+ onNavSelect?: (event: CustomEvent<{ id: string }>) => void;
1015
+ }
1016
+
1017
+ export const Nav = /*#__PURE__*/ createWebComponent<NavProps>(
1018
+ 'kai-nav',
1019
+ ["theme","items","value","defaultValue","defaultCollapsed"],
1020
+ { onNavItemAction: 'kai-nav-item-action', onNavItemClose: 'kai-nav-item-close', onNavSelect: 'kai-nav-select' },
1021
+ () => import('@kitn.ai/ui/elements/nav'),
1022
+ );
1023
+
1024
+ export interface NoticeProps extends WebComponentProps {
1025
+ /** `neutral` (default) · `info` · `warning` · `error` · `success`. Drives the leading icon's color and the a11y role (`alert` for errors, else `status`). */
1026
+ severity?: "error" | "info" | "success" | "warning" | "neutral";
1027
+ /** Leading icon: omit for the severity default, `"none"` to hide it, or a named icon to override. */
1028
+ icon?: string;
1029
+ /** Show a dismiss (×) that hides the notice and emits `kai-dismiss`. */
1030
+ dismissible?: boolean;
1031
+ /** The notice was dismissed via its × (it also hides itself). */
1032
+ onDismiss?: (event: CustomEvent) => void;
1033
+ }
1034
+
1035
+ export const Notice = /*#__PURE__*/ createWebComponent<NoticeProps>(
1036
+ 'kai-notice',
1037
+ ["theme","severity","icon","dismissible"],
1038
+ { onDismiss: 'kai-dismiss' },
1039
+ () => import('@kitn.ai/ui/elements/notice'),
1040
+ );
1041
+
1042
+ export interface PaneProps extends WebComponentProps {
1043
+ /** The pane title (the agent / window name). Named `headline` because `title` collides with the global `HTMLElement.title` attribute (it throws at registration). Attribute: `headline`. */
1044
+ headline?: string;
1045
+ /** A role / label shown under the title (e.g. "Reviewer", "claude-sonnet"). Attribute: `subtitle`. */
1046
+ subtitle?: string;
1047
+ /** Show the restore glyph instead of maximize, and signal the maximized view-state. Drive it yourself in response to `kai-maximize`. Attribute: `maximized`. */
1048
+ maximized?: boolean;
1049
+ /** Highlight the frame with a ring/border to mark the ACTIVE pane. Attribute: `focused`. */
1050
+ focused?: boolean;
1051
+ /** Show a split-pane window control that fires `kai-split`. Off by default. Attribute: `show-split`. */
1052
+ showSplit?: boolean;
1053
+ /** Show a dock-to-side window control that fires `kai-dock`. Off by default. Attribute: `show-dock`. */
1054
+ showDock?: boolean;
1055
+ /** A tone-colored status dot (+ optional label) in the header. An object `{ tone, label?, pulse? }` set as a JS PROPERTY (not an attribute). */
1056
+ status?: { tone: "working" | "idle" | "done" | "error" | "blocked"; label?: string; pulse?: boolean };
1057
+ /** The close (×) control was clicked. */
1058
+ onClose?: (event: CustomEvent) => void;
1059
+ /** The dock control was clicked (only present when `show-dock`). */
1060
+ onDock?: (event: CustomEvent) => void;
1061
+ /** The maximize/restore control was clicked. `detail.maximized` is the intended NEXT state — drive the `maximized` prop yourself from it. */
1062
+ onMaximize?: (event: CustomEvent<{ maximized: boolean }>) => void;
1063
+ /** The split control was clicked (only present when `show-split`). */
1064
+ onSplit?: (event: CustomEvent) => void;
1065
+ }
1066
+
1067
+ export const Pane = /*#__PURE__*/ createWebComponent<PaneProps>(
1068
+ 'kai-pane',
1069
+ ["theme","headline","subtitle","maximized","focused","showSplit","showDock","status"],
1070
+ { onClose: 'kai-close', onDock: 'kai-dock', onMaximize: 'kai-maximize', onSplit: 'kai-split' },
1071
+ () => import('@kitn.ai/ui/elements/pane'),
1072
+ );
1073
+
1074
+ export interface PaneGroupProps extends WebComponentProps {
1075
+ /** The tabs to render. An array of `{ id, name, status?, needsAttention?, number? }` set as a JS PROPERTY (not an HTML attribute). */
1076
+ tabs?: { id: string; name: string; status?: { tone: "working" | "idle" | "done" | "error" | "blocked"; label?: string; pulse?: boolean }; needsAttention?: boolean; number?: number }[];
1077
+ /** The active tab id (controlled, and reflected to the `active` ATTRIBUTE so `::part`/`[active]` selectors and the per-tab named slot follow it). Set it as the `active` attribute or drive it from `kai-tab-change`; omit for uncontrolled (the first tab). */
1078
+ active?: string;
1079
+ /** Highlight the frame as the ACTIVE group in a multi-group layout. Attribute: `focused`. */
1080
+ focused?: boolean;
1081
+ /** A tab was selected (click, Enter/Space, or arrow-key move). `detail.id` is the tab's id. */
1082
+ onTabChange?: (event: CustomEvent<{ id: string }>) => void;
1083
+ /** A tab's close (×) was clicked. Drop the tab from `tabs` yourself. */
1084
+ onTabClose?: (event: CustomEvent<{ id: string }>) => void;
1085
+ /** A tab's "…" overflow was clicked. Open your own menu from `detail.id`. */
1086
+ onTabMenu?: (event: CustomEvent<{ id: string }>) => void;
1087
+ }
1088
+
1089
+ export const PaneGroup = /*#__PURE__*/ createWebComponent<PaneGroupProps>(
1090
+ 'kai-pane-group',
1091
+ ["theme","tabs","active","focused"],
1092
+ { onTabChange: 'kai-tab-change', onTabClose: 'kai-tab-close', onTabMenu: 'kai-tab-menu' },
1093
+ () => import('@kitn.ai/ui/elements/pane-group'),
553
1094
  );
554
1095
 
555
1096
  export interface PopoverProps extends WebComponentProps {
@@ -557,21 +1098,58 @@ export interface PopoverProps extends WebComponentProps {
557
1098
  placement?: "top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end";
558
1099
  /** Gap in px between the trigger and the panel. */
559
1100
  gutter?: number;
560
- /** Controlled open state. Set as a JS property (`el.open = true`) to drive the popover from your app; omit for the default click-to-toggle behaviour. */
1101
+ /** Drive/observe open state (Shoelace-style: settable + reflected to the `open` attribute, the element still self-manages on click). Set `el.open = true`, or `<kai-popover open>`; listen for `kai-open-change`. */
561
1102
  open?: boolean;
562
- /** The popover wants to open or close (click, Escape, or outside-click). */
1103
+ /** Initial open state on mount (uncontrolled seed). */
1104
+ defaultOpen?: boolean;
1105
+ /** Turn the popover off while keeping the trigger mounted (clicks and `show()` no longer open it). */
1106
+ disabled?: boolean;
1107
+ /** The popover opened or closed (click, Escape, outside-click, or a method). */
563
1108
  onOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
564
1109
  }
565
1110
 
566
- export const Popover = createWebComponent<PopoverProps>(
1111
+ export const Popover = /*#__PURE__*/ createWebComponent<PopoverProps>(
567
1112
  'kai-popover',
568
- ["theme","placement","gutter","open"],
1113
+ ["theme","placement","gutter","open","defaultOpen","disabled"],
569
1114
  { onOpenChange: 'kai-open-change' },
1115
+ () => import('@kitn.ai/ui/elements/popover'),
1116
+ );
1117
+
1118
+ export interface ProgressBarProps extends WebComponentProps {
1119
+ /** Current progress value (0..max). Attribute: `value`. */
1120
+ value?: number;
1121
+ /** The value `value` runs to (default 100). Attribute: `max`. */
1122
+ max?: number;
1123
+ /** Optional caption above the track. Attribute: `label`. */
1124
+ label?: string;
1125
+ /** Fill color: `primary` (default), `success`, `warning`, `error`, `info`. Attribute: `tone`. */
1126
+ tone?: string;
1127
+ }
1128
+
1129
+ export const ProgressBar = /*#__PURE__*/ createWebComponent<ProgressBarProps>(
1130
+ 'kai-progress-bar',
1131
+ ["theme","value","max","label","tone"],
1132
+ { },
1133
+ () => import('@kitn.ai/ui/elements/progress-bar'),
1134
+ );
1135
+
1136
+ export interface PromptDockProps extends WebComponentProps {
1137
+ /** How the tray frames the input — the SPATIAL inset axis: `inset` (default, the classic recessed frame on every side) | `edge` (top/bottom inset only; the input sits flush left/right so the lips span the full width) | `none` (no inset; the lips attach directly as a plain stack). Attribute: `frame`. */
1138
+ frame?: "none" | "inset" | "edge";
1139
+ /** How the tray surface looks — the VISUAL axis, orthogonal to `frame`: `soft` (default, sunken surface + border + radius) | `outlined` (transparent + border + radius) | `filled` (sunken, no border, + radius) | `plain` (bare). Attribute: `appearance`. */
1140
+ appearance?: "outlined" | "filled" | "plain" | "soft";
1141
+ }
1142
+
1143
+ export const PromptDock = /*#__PURE__*/ createWebComponent<PromptDockProps>(
1144
+ 'kai-prompt-dock',
1145
+ ["theme","frame","appearance"],
1146
+ { },
1147
+ () => import('@kitn.ai/ui/elements/prompt-dock'),
570
1148
  );
571
1149
 
572
1150
  export interface PromptInputProps extends WebComponentProps {
573
- /** Controlled value of the input. When set, the host owns the text and must update it on `kai-value-change`; leave unset for uncontrolled behavior. */
574
- value?: string;
1151
+ /** Value of the input, as a JS property. A **string** is the controlled text mirror (the host owns it and updates on `kai-value-change`). A **ComposerDoc** (array of text/entity segments) is a one-time **seed** that pre-populates pills (skills/agents/plugins); the user then edits freely. Leave unset for uncontrolled behavior. `kai-submit`/`kai-value-change` always emit `value` as the flattened string (back-compat) plus the structured `doc` + `entities`. */
1152
+ value?: string | ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: string; promptText?: string; data?: Record<string, unknown> } })[];
575
1153
  /** Placeholder text shown in the empty input. */
576
1154
  placeholder?: string;
577
1155
  /** Disable the input and submit button entirely (non-interactive). */
@@ -582,42 +1160,45 @@ export interface PromptInputProps extends WebComponentProps {
582
1160
  suggestions?: string[];
583
1161
  /** What clicking a suggestion does: `'submit'` (default) sends it immediately as if typed and submitted; `'fill'` just places it in the input. */
584
1162
  suggestionMode?: "submit" | "fill";
585
- /** Slash commands — when set, typing `/` opens the command palette. Set as a JS property. */
586
- slashCommands?: { id: string; label: string; description?: string; category?: string }[];
587
- /** Command ids to highlight as active. */
588
- slashActiveIds?: string[];
589
- /** Single-line palette rows. */
590
- slashCompact?: boolean;
591
1163
  /** Show a Search (Globe) button in the left toolbar; clicking it fires a `search` event. */
592
1164
  search?: boolean;
593
1165
  /** Show a Voice (Mic) button in the left toolbar; clicking it fires a `voice` event. */
594
1166
  voice?: boolean;
595
1167
  /** When set and `loading` is true, the send button is replaced by a Stop button (square icon, "Stop" aria-label). Clicking it fires `kai-stop`. */
596
1168
  stoppable?: boolean;
1169
+ /** Send-button visibility. `'always'` (default) always shows it; `'auto'` shows it only when there's text/attachments (an empty composer hides it — Enter still submits). To hide it entirely (Enter-only), it's pure CSS: `::part(send){display:none}` — no prop needed. Restyle via `::part(send)`. The Stop button (`stoppable` + `loading`) is unaffected. */
1170
+ submit?: "always" | "auto";
1171
+ /** When `false`, hides the built-in paperclip attach button even though the element otherwise supports attachments. Use this when a `+` menu in `toolbar-start` already exposes "Add files", to avoid a duplicate control. Defaults to `true`. */
1172
+ attach?: boolean;
597
1173
  /** Attachments to seed the input with (so a consumer can pre-populate staged files without an upload). Set as a JS property; the element then manages its own attachment state from there (add via the paperclip, remove per chip). */
598
1174
  attachments?: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }[];
1175
+ /** Rich entity triggers — each `{ char, kind, items }` opens a caret-anchored menu that inserts an atomic pill. Convention: `/` → skills, `@` → agents (plugins are the grouping/provenance of those items). Set as a JS property. */
1176
+ triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
1177
+ /** Default icon per entity kind (kind → image URL/data-URI) for pills/menu items without their own `icon`. Overrides the built-in agent/plugin glyphs. JS property. */
1178
+ kindIcons?: Record<string, string>;
1179
+ /** The staged attachments changed — a file was added (via the paperclip) or removed (per-chip ×). Carries the full current list so a consumer can react in real time (validate, show upload progress, toggle the send button). */
1180
+ onAttachmentsChange?: (event: CustomEvent<{ attachments: { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[] }>) => void;
599
1181
  /** The Search (Globe) toolbar button was clicked. */
600
1182
  onSearch?: (event: CustomEvent<Record<string, never>>) => void;
601
- /** A slash command was chosen from the palette. */
602
- onSlashSelect?: (event: CustomEvent<{ command: { id: string; label: string; description?: undefined | string; category?: undefined | string } }>) => void;
603
1183
  /** The Stop button was clicked while `stoppable` and `loading` are both true. */
604
1184
  onStop?: (event: CustomEvent<Record<string, never>>) => void;
605
- /** The user submitted the prompt (Enter or send button) with its attachments. */
606
- onSubmit?: (event: CustomEvent<{ value: string; attachments: { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[] }>) => void;
1185
+ /** The user submitted the prompt (Enter or send button). `value` is the flattened text (back-compat); `doc` is the structured document and `entities` the inserted pills (skills/agents) for downstream expansion. */
1186
+ onSubmit?: (event: CustomEvent<{ value: string; doc: ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> } })[]; entities: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> }[]; attachments: { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[] }>) => void;
607
1187
  /** A suggestion was clicked while `suggestion-mode="fill"`. */
608
1188
  onSuggestionClick?: (event: CustomEvent<{ value: string }>) => void;
609
1189
  /** A custom `<kai-action>` toolbar button was clicked. `action` is the `id` of the `<kai-action>` element that was clicked. */
610
1190
  onToolbarAction?: (event: CustomEvent<{ action: string }>) => void;
611
- /** The input text changed (fires on every keystroke). */
612
- onValueChange?: (event: CustomEvent<{ value: string }>) => void;
1191
+ /** The input changed (fires on every edit). Carries the flattened `value` plus the structured `doc` + `entities`. */
1192
+ onValueChange?: (event: CustomEvent<{ value: string; doc: ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> } })[]; entities: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> }[] }>) => void;
613
1193
  /** The Voice (Mic) toolbar button was clicked. */
614
1194
  onVoice?: (event: CustomEvent<Record<string, never>>) => void;
615
1195
  }
616
1196
 
617
- export const PromptInput = createWebComponent<PromptInputProps>(
1197
+ export const PromptInput = /*#__PURE__*/ createWebComponent<PromptInputProps>(
618
1198
  'kai-prompt-input',
619
- ["theme","value","placeholder","disabled","loading","suggestions","suggestionMode","slashCommands","slashActiveIds","slashCompact","search","voice","stoppable","attachments"],
620
- { onSearch: 'kai-search', onSlashSelect: 'kai-slash-select', onStop: 'kai-stop', onSubmit: 'kai-submit', onSuggestionClick: 'kai-suggestion-click', onToolbarAction: 'kai-toolbar-action', onValueChange: 'kai-value-change', onVoice: 'kai-voice' },
1199
+ ["theme","value","placeholder","disabled","loading","suggestions","suggestionMode","search","voice","stoppable","submit","attach","attachments","triggers","kindIcons"],
1200
+ { onAttachmentsChange: 'kai-attachments-change', onSearch: 'kai-search', onStop: 'kai-stop', onSubmit: 'kai-submit', onSuggestionClick: 'kai-suggestion-click', onToolbarAction: 'kai-toolbar-action', onValueChange: 'kai-value-change', onVoice: 'kai-voice' },
1201
+ () => import('@kitn.ai/ui/elements/prompt-input'),
621
1202
  );
622
1203
 
623
1204
  export interface ReasoningProps extends WebComponentProps {
@@ -625,20 +1206,25 @@ export interface ReasoningProps extends WebComponentProps {
625
1206
  text: string;
626
1207
  /** Trigger label. */
627
1208
  label?: string;
628
- /** Controlled open state set as a property (`el.open = true`). Omit for uncontrolled (the trigger toggles it). */
1209
+ /** Drive/observe open state (Shoelace-style: settable + reflected to the `open` attribute; the element still self-manages on trigger click + while streaming). Set `el.open = true`; listen for `kai-open-change`. */
629
1210
  open?: boolean;
1211
+ /** Initial open state on mount (uncontrolled seed). */
1212
+ defaultOpen?: boolean;
630
1213
  /** While true, auto-expands (and re-collapses when it flips false). */
631
1214
  streaming?: boolean;
632
1215
  /** Render `text` as markdown. */
633
1216
  markdown?: boolean;
634
- /** Open state changed (via the trigger or streaming auto-open). */
1217
+ /** Gate the disclosure trigger — programmatic `show()/hide()/toggle()` still work, but the trigger click no longer toggles. */
1218
+ disabled?: boolean;
1219
+ /** The reasoning block expanded or collapsed (via the trigger, streaming auto-open, or a method). */
635
1220
  onOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
636
1221
  }
637
1222
 
638
- export const Reasoning = createWebComponent<ReasoningProps>(
1223
+ export const Reasoning = /*#__PURE__*/ createWebComponent<ReasoningProps>(
639
1224
  'kai-reasoning',
640
- ["theme","text","label","open","streaming","markdown"],
1225
+ ["theme","text","label","open","defaultOpen","streaming","markdown","disabled"],
641
1226
  { onOpenChange: 'kai-open-change' },
1227
+ () => import('@kitn.ai/ui/elements/reasoning'),
642
1228
  );
643
1229
 
644
1230
  export interface RemoteProps extends WebComponentProps {
@@ -652,15 +1238,16 @@ export interface RemoteProps extends WebComponentProps {
652
1238
  policy?: Record<string, unknown>;
653
1239
  }
654
1240
 
655
- export const Remote = createWebComponent<RemoteProps>(
1241
+ export const Remote = /*#__PURE__*/ createWebComponent<RemoteProps>(
656
1242
  'kai-remote',
657
1243
  ["theme","src","providerOrigin","envelope","policy"],
658
1244
  { },
1245
+ () => import('@kitn.ai/ui/elements/remote'),
659
1246
  );
660
1247
 
661
1248
  export interface ResizableProps extends WebComponentProps {
662
1249
  /** Layout axis: `horizontal` (row, default) or `vertical` (column). */
663
- orientation?: "horizontal" | "vertical";
1250
+ orientation?: "vertical" | "horizontal";
664
1251
  /** Which item index is maximized (null = none). Declarative source of truth. */
665
1252
  maximizedIndex?: null | number;
666
1253
  /** Fired on drag-end / keyboard resize / visibility change. `detail.sizes` = panel sizes in percent. */
@@ -669,10 +1256,11 @@ export interface ResizableProps extends WebComponentProps {
669
1256
  onMaximizeChange?: (event: CustomEvent<{ maximized: boolean; index: null | number }>) => void;
670
1257
  }
671
1258
 
672
- export const Resizable = createWebComponent<ResizableProps>(
1259
+ export const Resizable = /*#__PURE__*/ createWebComponent<ResizableProps>(
673
1260
  'kai-resizable',
674
1261
  ["theme","orientation","maximizedIndex"],
675
1262
  { onChange: 'kai-change', onMaximizeChange: 'kai-maximize-change' },
1263
+ () => import('@kitn.ai/ui/elements/resizable'),
676
1264
  );
677
1265
 
678
1266
  export interface ResizableItemProps extends WebComponentProps {
@@ -686,14 +1274,17 @@ export interface ResizableItemProps extends WebComponentProps {
686
1274
  locked?: boolean;
687
1275
  /** Hide this panel; its divider is dropped and the rest reflow. */
688
1276
  hidden?: boolean;
1277
+ /** Collapse this panel — same layout effect as `hidden` (divider dropped, the rest reflow), but it WORKS as a bare boolean from framework JSX. A plain `<kai-resizable-item collapsed>` in React/Solid/Vue/Svelte collapses the panel at the first render; `hidden` does not, because a JSX boolean sets neither the `hidden` attribute nor the IDL property on a custom element, so the parent never sees it. The facade reflects `collapsed` to a `collapsed` attribute the parent reads. Prefer this over `hidden` for declarative collapse. */
1278
+ collapsed?: boolean;
689
1279
  onChange?: (event: CustomEvent<unknown>) => void;
690
1280
  onMaximizeChange?: (event: CustomEvent<unknown>) => void;
691
1281
  }
692
1282
 
693
- export const ResizableItem = createWebComponent<ResizableItemProps>(
1283
+ export const ResizableItem = /*#__PURE__*/ createWebComponent<ResizableItemProps>(
694
1284
  'kai-resizable-item',
695
- ["theme","size","min","max","locked","hidden"],
1285
+ ["theme","size","min","max","locked","hidden","collapsed"],
696
1286
  { onChange: 'kai-change', onMaximizeChange: 'kai-maximize-change' },
1287
+ () => import('@kitn.ai/ui/elements/resizable'),
697
1288
  );
698
1289
 
699
1290
  export interface ResponseStreamProps extends WebComponentProps {
@@ -709,10 +1300,11 @@ export interface ResponseStreamProps extends WebComponentProps {
709
1300
  onComplete?: (event: CustomEvent) => void;
710
1301
  }
711
1302
 
712
- export const ResponseStream = createWebComponent<ResponseStreamProps>(
1303
+ export const ResponseStream = /*#__PURE__*/ createWebComponent<ResponseStreamProps>(
713
1304
  'kai-response-stream',
714
1305
  ["theme","text","mode","speed","as"],
715
1306
  { onComplete: 'kai-complete' },
1307
+ () => import('@kitn.ai/ui/elements/response-stream'),
716
1308
  );
717
1309
 
718
1310
  export interface ScopePickerProps extends WebComponentProps {
@@ -722,31 +1314,181 @@ export interface ScopePickerProps extends WebComponentProps {
722
1314
  availableTags: string[];
723
1315
  /** The label shown on the trigger for the active scope. */
724
1316
  currentLabel?: string;
1317
+ /** Drive/observe the dropdown's open state (Shoelace-style: settable + reflected to the `open` attribute, the dropdown still self-manages on click/keyboard). Set `el.open = true`, or `<kai-scope-picker open>`; listen for `kai-open-change`. */
1318
+ open?: boolean;
1319
+ /** Initial open state on mount (uncontrolled seed). */
1320
+ defaultOpen?: boolean;
1321
+ /** Disable the trigger — click/keyboard and `show()` no longer open the dropdown. */
1322
+ disabled?: boolean;
1323
+ /** The scope dropdown opened or closed (by click, keyboard, Escape, outside-click, or a method). */
1324
+ onOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
725
1325
  /** A scope was chosen (`undefined` filters = "All Content"). */
726
1326
  onScopeChange?: (event: CustomEvent<{ filters: undefined | { tags?: undefined | string[]; authors?: undefined | string[]; contentType?: undefined | "transcript" | "markdown"; dateRange?: undefined | { from: string; to: string } } }>) => void;
727
1327
  }
728
1328
 
729
- export const ScopePicker = createWebComponent<ScopePickerProps>(
1329
+ export const ScopePicker = /*#__PURE__*/ createWebComponent<ScopePickerProps>(
730
1330
  'kai-scope-picker',
731
- ["theme","availableAuthors","availableTags","currentLabel"],
732
- { onScopeChange: 'kai-scope-change' },
1331
+ ["theme","availableAuthors","availableTags","currentLabel","open","defaultOpen","disabled"],
1332
+ { onOpenChange: 'kai-open-change', onScopeChange: 'kai-scope-change' },
1333
+ () => import('@kitn.ai/ui/elements/chat-scope-picker'),
1334
+ );
1335
+
1336
+ export interface ScreenProps extends WebComponentProps {
1337
+ /** Drive/observe open state (Shoelace-style: settable + reflected to the `open` attribute; the element still self-manages). Set `el.open = true`, or `<kai-screen open>`; listen for `kai-open-change`. */
1338
+ open?: boolean;
1339
+ /** Initial open state on mount (uncontrolled seed). */
1340
+ defaultOpen?: boolean;
1341
+ /** Header title text. A projected `title` slot overrides it. (Named `headline` because `title` collides with the global `HTMLElement.title` attribute.) */
1342
+ headline?: string;
1343
+ /** Show the back button (default true). */
1344
+ back?: boolean;
1345
+ /** Opt out of marking sibling elements inert/aria-hidden while open (for unusual layouts). */
1346
+ noInert?: boolean;
1347
+ /** Back navigation intent: the back button or Escape. The consumer flips their own routing in response (the screen knows nothing about the trigger). */
1348
+ onBack?: (event: CustomEvent<Record<string, never>>) => void;
1349
+ /** The screen opened or closed (a method, `Escape` close, or driven `open`). */
1350
+ onOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
1351
+ }
1352
+
1353
+ export const Screen = /*#__PURE__*/ createWebComponent<ScreenProps>(
1354
+ 'kai-screen',
1355
+ ["theme","open","defaultOpen","headline","back","noInert"],
1356
+ { onBack: 'kai-back', onOpenChange: 'kai-open-change' },
1357
+ () => import('@kitn.ai/ui/elements/screen'),
1358
+ );
1359
+
1360
+ export interface ScrollAreaProps extends WebComponentProps {
1361
+ /** Which axis scrolls. `vertical` (default) · `horizontal` · `both`. The cross axis is clamped so content can't overflow it. */
1362
+ orientation?: "vertical" | "horizontal" | "both";
1363
+ }
1364
+
1365
+ export const ScrollArea = /*#__PURE__*/ createWebComponent<ScrollAreaProps>(
1366
+ 'kai-scroll-area',
1367
+ ["theme","orientation"],
1368
+ { },
1369
+ () => import('@kitn.ai/ui/elements/scroll-area'),
733
1370
  );
734
1371
 
735
1372
  export interface ScrollButtonProps extends WebComponentProps {
736
1373
  /** CSS id of the scroll container to control. When omitted the element walks up the DOM (outside its own shadow root) to find the nearest scrollable ancestor. Mirrors the `for` convention of `<label for="...">`. */
737
1374
  for?: string;
738
1375
  /** Button visual variant: `'outline' | 'ghost' | 'default'`. Defaults to `'outline'`. */
739
- variant?: "ghost" | "default" | "outline";
1376
+ variant?: "default" | "ghost" | "outline";
740
1377
  /** Button size token. Defaults to `'icon'` (square). */
741
- size?: "sm" | "lg" | "md" | "icon" | "icon-sm";
1378
+ size?: "sm" | "md" | "lg" | "icon" | "icon-sm";
742
1379
  /** Emitted when the user clicks the button and `scrollToBottom()` is called. Carries no detail — consumers use it to know a manual scroll occurred. */
743
1380
  onScroll?: (event: CustomEvent) => void;
744
1381
  }
745
1382
 
746
- export const ScrollButton = createWebComponent<ScrollButtonProps>(
1383
+ export const ScrollButton = /*#__PURE__*/ createWebComponent<ScrollButtonProps>(
747
1384
  'kai-scroll-button',
748
1385
  ["theme","for","variant","size"],
749
1386
  { onScroll: 'kai-scroll' },
1387
+ () => import('@kitn.ai/ui/elements/scroll-button'),
1388
+ );
1389
+
1390
+ export interface SearchProps extends WebComponentProps {
1391
+ /** Controlled query — settable and reflected to the `value` attribute. Read `el.value` for live state. */
1392
+ value?: string;
1393
+ /** Placeholder. Defaults to `Search…`. */
1394
+ placeholder?: string;
1395
+ /** Leading icon-NAME string (a curated name, URL, or text), resolved to a glyph the same way `kai-button`'s `icon` is. Defaults to `search`. */
1396
+ icon?: string;
1397
+ /** Debounce window for `kai-search`, in ms. Defaults to `200`. */
1398
+ debounce?: number;
1399
+ /** Show a spinner in place of the leading icon while results load. */
1400
+ loading?: boolean;
1401
+ /** Optional shortcut hint shown (as a `kai-kbd`) while the field is empty, e.g. `Mod+K`. Display only; it does not bind the key. */
1402
+ shortcut?: string;
1403
+ /** The field committed (blur). */
1404
+ onChange?: (event: CustomEvent<{ value: string }>) => void;
1405
+ /** The query changed (debounced live, and on clear). */
1406
+ onSearch?: (event: CustomEvent<{ value: string }>) => void;
1407
+ /** Enter was pressed. */
1408
+ onSubmit?: (event: CustomEvent<{ value: string }>) => void;
1409
+ }
1410
+
1411
+ export const Search = /*#__PURE__*/ createWebComponent<SearchProps>(
1412
+ 'kai-search',
1413
+ ["theme","value","placeholder","icon","debounce","loading","shortcut"],
1414
+ { onChange: 'kai-change', onSearch: 'kai-search', onSubmit: 'kai-submit' },
1415
+ () => import('@kitn.ai/ui/elements/search'),
1416
+ );
1417
+
1418
+ export interface SegmentedProps extends WebComponentProps {
1419
+ /** The selectable segments, left to right. Set as a JS property (array). */
1420
+ options: { value: string; label: string; icon?: undefined | string }[];
1421
+ /** Controlled selected `value` — settable and reflected to the `value` attribute. `el.value = 'preview'` drives it; choosing a segment updates it and fires `kai-change`. Read `el.value` for live state. */
1422
+ value?: string;
1423
+ /** Control density: `sm` or `md`. Defaults to `md`. */
1424
+ size?: "sm" | "md";
1425
+ /** A segment was chosen. */
1426
+ onChange?: (event: CustomEvent<{ value: string }>) => void;
1427
+ }
1428
+
1429
+ export const Segmented = /*#__PURE__*/ createWebComponent<SegmentedProps>(
1430
+ 'kai-segmented',
1431
+ ["theme","options","value","size"],
1432
+ { onChange: 'kai-change' },
1433
+ () => import('@kitn.ai/ui/elements/segmented'),
1434
+ );
1435
+
1436
+ export interface SeparatorProps extends WebComponentProps {
1437
+ /** `horizontal` (default, block + full-width) or `vertical` (a rule inside a flex/grid row — it stretches to the row height). */
1438
+ orientation?: "vertical" | "horizontal";
1439
+ }
1440
+
1441
+ export const Separator = /*#__PURE__*/ createWebComponent<SeparatorProps>(
1442
+ 'kai-separator',
1443
+ ["theme","orientation"],
1444
+ { },
1445
+ () => import('@kitn.ai/ui/elements/separator'),
1446
+ );
1447
+
1448
+ export interface SettingItemProps extends WebComponentProps {
1449
+ /** Row label (primary text). Attribute: `label`. */
1450
+ label?: string;
1451
+ /** Optional secondary description under the label. Attribute: `description`. */
1452
+ description?: string;
1453
+ }
1454
+
1455
+ export const SettingItem = /*#__PURE__*/ createWebComponent<SettingItemProps>(
1456
+ 'kai-setting-item',
1457
+ ["theme","label","description"],
1458
+ { },
1459
+ () => import('@kitn.ai/ui/elements/setting-item'),
1460
+ );
1461
+
1462
+ export interface SettingsGroupProps extends WebComponentProps {
1463
+ /** Small section heading shown above the card. Attribute: `heading`. */
1464
+ heading?: string;
1465
+ /** Optional muted description under the heading. Attribute: `description`. */
1466
+ description?: string;
1467
+ }
1468
+
1469
+ export const SettingsGroup = /*#__PURE__*/ createWebComponent<SettingsGroupProps>(
1470
+ 'kai-settings-group',
1471
+ ["theme","heading","description"],
1472
+ { },
1473
+ () => import('@kitn.ai/ui/elements/settings-group'),
1474
+ );
1475
+
1476
+ export interface SkeletonProps extends WebComponentProps {
1477
+ /** `text` (one or more lines), `rect` (a block), or `circle` (round). Defaults to `text`. */
1478
+ variant?: "text" | "rect" | "circle";
1479
+ /** CSS width (e.g. `'12rem'`, `'60%'`). Defaults to full width (responsive); for `circle` it is the diameter. */
1480
+ width?: string;
1481
+ /** CSS height. Defaults per variant (a text line height; circle = width). */
1482
+ height?: string;
1483
+ /** `text` only: number of lines; the last is shorter. Defaults to 1. */
1484
+ lines?: number;
1485
+ }
1486
+
1487
+ export const Skeleton = /*#__PURE__*/ createWebComponent<SkeletonProps>(
1488
+ 'kai-skeleton',
1489
+ ["theme","variant","width","height","lines"],
1490
+ { },
1491
+ () => import('@kitn.ai/ui/elements/skeleton'),
750
1492
  );
751
1493
 
752
1494
  export interface SkillsProps extends WebComponentProps {
@@ -754,10 +1496,11 @@ export interface SkillsProps extends WebComponentProps {
754
1496
  skills: { id: string; name: string }[];
755
1497
  }
756
1498
 
757
- export const Skills = createWebComponent<SkillsProps>(
1499
+ export const Skills = /*#__PURE__*/ createWebComponent<SkillsProps>(
758
1500
  'kai-skills',
759
1501
  ["theme","skills"],
760
1502
  { },
1503
+ () => import('@kitn.ai/ui/elements/message-skills'),
761
1504
  );
762
1505
 
763
1506
  export interface SourceProps extends WebComponentProps {
@@ -773,10 +1516,11 @@ export interface SourceProps extends WebComponentProps {
773
1516
  showFavicon?: boolean;
774
1517
  }
775
1518
 
776
- export const Source = createWebComponent<SourceProps>(
1519
+ export const Source = /*#__PURE__*/ createWebComponent<SourceProps>(
777
1520
  'kai-source',
778
1521
  ["theme","href","label","headline","description","showFavicon"],
779
1522
  { },
1523
+ () => import('@kitn.ai/ui/elements/source'),
780
1524
  );
781
1525
 
782
1526
  export interface SourcesProps extends WebComponentProps {
@@ -788,19 +1532,40 @@ export interface SourcesProps extends WebComponentProps {
788
1532
  numbered?: boolean;
789
1533
  }
790
1534
 
791
- export const Sources = createWebComponent<SourcesProps>(
1535
+ export const Sources = /*#__PURE__*/ createWebComponent<SourcesProps>(
792
1536
  'kai-sources',
793
1537
  ["theme","sources","showFavicon","numbered"],
794
1538
  { },
1539
+ () => import('@kitn.ai/ui/elements/source'),
1540
+ );
1541
+
1542
+ export interface StatusProps extends WebComponentProps {
1543
+ /** Presence/notification state → color. `new` (default) maps to the blue hue. */
1544
+ status?: "new" | "online" | "busy" | "away" | "offline";
1545
+ /** Animated ping ring (off by default; respects prefers-reduced-motion). */
1546
+ pulse?: boolean;
1547
+ /** Accessible name. Without it the dot is decorative. */
1548
+ label?: string;
1549
+ /** `sm` (default) or `md`. */
1550
+ size?: "sm" | "md";
1551
+ }
1552
+
1553
+ export const Status = /*#__PURE__*/ createWebComponent<StatusProps>(
1554
+ 'kai-status',
1555
+ ["theme","status","pulse","label","size"],
1556
+ { },
1557
+ () => import('@kitn.ai/ui/elements/status'),
795
1558
  );
796
1559
 
797
1560
  export interface SuggestionsProps extends WebComponentProps {
798
1561
  /** The suggestions. Strings, or `{ label, value }` when the displayed text and the emitted value differ. Set as a JS property. */
799
- suggestions: (string | { label: string; value?: undefined | string })[];
1562
+ suggestions: (string | { label: string; value?: undefined | string; icon?: undefined | string })[];
800
1563
  /** Chip style: `'outline'` (default), `'ghost'`, or `'default'` (filled). */
801
- variant?: "ghost" | "default" | "outline";
802
- /** Size preset for each chip. Defaults to the pill default (`'lg'`); pass `'sm'` for smaller pills (or `'md'`). */
803
- size?: "sm" | "lg" | "md" | "icon" | "icon-sm";
1564
+ variant?: "default" | "ghost" | "outline";
1565
+ /** Row height for `layout="list"`: `'md'` (default) or `'lg'` for taller rows. Chips are unaffected. */
1566
+ size?: "md" | "lg";
1567
+ /** Layout: `'chips'` (default) renders a wrapping row of rounded pills; `'list'` renders a vertical, full-width "Ideas for you" list — each row is left-aligned with a leading `icon`, a label, and a hover background. */
1568
+ layout?: "list" | "chips";
804
1569
  /** Full-width left-aligned rows instead of pills. */
805
1570
  block?: boolean;
806
1571
  /** Substring to highlight within each suggestion. */
@@ -809,27 +1574,59 @@ export interface SuggestionsProps extends WebComponentProps {
809
1574
  onSelect?: (event: CustomEvent<{ value: string }>) => void;
810
1575
  }
811
1576
 
812
- export const Suggestions = createWebComponent<SuggestionsProps>(
1577
+ export const Suggestions = /*#__PURE__*/ createWebComponent<SuggestionsProps>(
813
1578
  'kai-suggestions',
814
- ["theme","suggestions","variant","size","block","highlight"],
1579
+ ["theme","suggestions","variant","size","layout","block","highlight"],
815
1580
  { onSelect: 'kai-select' },
1581
+ () => import('@kitn.ai/ui/elements/prompt-suggestions'),
816
1582
  );
817
1583
 
818
1584
  export interface SwitchProps extends WebComponentProps {
819
- /** Initial checked state. Bare attribute (`<kai-switch checked>`) turns it on. */
1585
+ /** Controlled checked state settable and reflected to the `checked` attribute. `el.checked = true` (or `<kai-switch checked>`) drives it; the toggle UI updates it and fires `kai-change`. Read `el.checked` for live state. */
820
1586
  checked?: boolean;
1587
+ /** Initial checked state on mount (uncontrolled seed). Bare attribute (`<kai-switch default-checked>`) turns it on. */
1588
+ defaultChecked?: boolean;
821
1589
  /** Disable interaction. */
822
1590
  disabled?: boolean;
823
1591
  /** Accessible label. */
824
1592
  label?: string;
1593
+ /** Form-control name (paired with `value`). */
1594
+ name?: string;
1595
+ /** Submitted value when checked (paired with `name`). Defaults to `'on'`. */
1596
+ value?: string;
825
1597
  /** The toggle changed. */
826
1598
  onChange?: (event: CustomEvent<{ checked: boolean }>) => void;
827
1599
  }
828
1600
 
829
- export const Switch = createWebComponent<SwitchProps>(
1601
+ export const Switch = /*#__PURE__*/ createWebComponent<SwitchProps>(
830
1602
  'kai-switch',
831
- ["theme","checked","disabled","label"],
1603
+ ["theme","checked","defaultChecked","disabled","label","name","value"],
832
1604
  { onChange: 'kai-change' },
1605
+ () => import('@kitn.ai/ui/elements/switch'),
1606
+ );
1607
+
1608
+ export interface TabsProps extends WebComponentProps {
1609
+ /** Tabs to render. Set as a JS property, not an HTML attribute. */
1610
+ items?: { id: string; label?: string; icon?: string; disabled?: boolean }[];
1611
+ /** Controlled selected id. Set as a JS property (or the `value` attribute); drive it from your app in response to `kai-tab-change`. Omit for uncontrolled. */
1612
+ value?: string;
1613
+ /** Initial selected id when uncontrolled (use the `default-value` attribute in plain HTML). */
1614
+ defaultValue?: string;
1615
+ /** `segmented` (default, a pill group) or `underline` (an underlined row). */
1616
+ variant?: "segmented" | "underline";
1617
+ /** Stretch the strip to full width, each tab sharing the space equally. */
1618
+ block?: boolean;
1619
+ /** Disable the whole strip. */
1620
+ disabled?: boolean;
1621
+ /** A tab was selected (click, Enter/Space, or arrow-key move). `value` is the item's id. */
1622
+ onTabChange?: (event: CustomEvent<{ value: string }>) => void;
1623
+ }
1624
+
1625
+ export const Tabs = /*#__PURE__*/ createWebComponent<TabsProps>(
1626
+ 'kai-tabs',
1627
+ ["theme","items","value","defaultValue","variant","block","disabled"],
1628
+ { onTabChange: 'kai-tab-change' },
1629
+ () => import('@kitn.ai/ui/elements/tabs'),
833
1630
  );
834
1631
 
835
1632
  export interface TasksProps extends WebComponentProps {
@@ -841,12 +1638,23 @@ export interface TasksProps extends WebComponentProps {
841
1638
  heading?: string;
842
1639
  /** Set when the user resolved this card; renders the read-only view. Property: `el.resolution = { kind:'submit', data:{ selected:[…] } }`. */
843
1640
  resolution?: Record<string, unknown>;
1641
+ /** Controlled selection (task ids; JS property). When set, it wins over local state. */
1642
+ value?: string[];
1643
+ /** Uncontrolled initial selection (task ids; JS property), overlaying per-task `checked`. */
1644
+ defaultValue?: string[];
1645
+ /** Freeze the whole list + Confirm. Attribute: `disabled`. */
1646
+ disabled?: boolean;
1647
+ /** Display-only: rows can't be toggled and show the default cursor (no pointer, hover, or focus affordances). Keeps the look as-is. Attribute: `readonly`. */
1648
+ readonly?: boolean;
1649
+ /** The selection changed on a toggle — the selected ids in input order. */
1650
+ onValueChange?: (event: CustomEvent<{ value: string[] }>) => void;
844
1651
  }
845
1652
 
846
- export const Tasks = createWebComponent<TasksProps>(
1653
+ export const Tasks = /*#__PURE__*/ createWebComponent<TasksProps>(
847
1654
  'kai-tasks',
848
- ["theme","data","cardId","heading","resolution"],
849
- { },
1655
+ ["theme","data","cardId","heading","resolution","value","defaultValue","disabled","readonly"],
1656
+ { onValueChange: 'kai-value-change' },
1657
+ () => import('@kitn.ai/ui/elements/tasks'),
850
1658
  );
851
1659
 
852
1660
  export interface TextShimmerProps extends WebComponentProps {
@@ -860,10 +1668,11 @@ export interface TextShimmerProps extends WebComponentProps {
860
1668
  spread?: number;
861
1669
  }
862
1670
 
863
- export const TextShimmer = createWebComponent<TextShimmerProps>(
1671
+ export const TextShimmer = /*#__PURE__*/ createWebComponent<TextShimmerProps>(
864
1672
  'kai-text-shimmer',
865
1673
  ["theme","text","as","duration","spread"],
866
1674
  { },
1675
+ () => import('@kitn.ai/ui/elements/text-shimmer'),
867
1676
  );
868
1677
 
869
1678
  export interface ThinkingBarProps extends WebComponentProps {
@@ -877,21 +1686,26 @@ export interface ThinkingBarProps extends WebComponentProps {
877
1686
  onStop?: (event: CustomEvent) => void;
878
1687
  }
879
1688
 
880
- export const ThinkingBar = createWebComponent<ThinkingBarProps>(
1689
+ export const ThinkingBar = /*#__PURE__*/ createWebComponent<ThinkingBarProps>(
881
1690
  'kai-thinking-bar',
882
1691
  ["theme","text","stoppable","stopLabel"],
883
1692
  { onStop: 'kai-stop' },
1693
+ () => import('@kitn.ai/ui/elements/thinking-bar'),
884
1694
  );
885
1695
 
886
1696
  export interface ToastRegionProps extends WebComponentProps {
887
1697
  /** The toasts to render. Newest is shown on top. Set as a JS property (array); pass a new array reference to update. */
888
- toasts: { id: string; message: string; variant?: undefined | "neutral" | "success"; action?: undefined | { label: string; onAction: () => void | false }; duration?: undefined | number; dismissible?: undefined | boolean; target?: undefined | HTMLElement }[];
1698
+ toasts: { id: string; message: string; variant?: undefined | "error" | "info" | "success" | "warning" | "neutral"; appearance?: undefined | "pill" | "card"; inverse?: undefined | boolean; description?: undefined | string; action?: undefined | { label: string; onAction: () => void | false }; duration?: undefined | number; dismissible?: undefined | boolean; target?: undefined | HTMLElement }[];
889
1699
  /** Stack anchor: `'top-center'` (default), `'top-right'`, `'bottom-center'`, … */
890
1700
  position?: "top-center" | "top-right" | "top-left" | "bottom-center" | "bottom-right" | "bottom-left";
891
1701
  /** Max simultaneously-visible toasts; the rest queue. Defaults to `3`. */
892
1702
  max?: number;
893
1703
  /** Stacking: 'expanded' (default, full column) | 'collapsed' (Sonner-style pile that expands on hover/focus). Attribute: stack. */
894
1704
  stack?: "expanded" | "collapsed";
1705
+ /** Default appearance for this region's toasts: `'pill'` (default, compact) | `'card'` (richer, with a description line). A per-toast `appearance` wins. Attribute: `appearance`. */
1706
+ appearance?: "pill" | "card";
1707
+ /** Default high-contrast inverse treatment for this region's toasts. A per-toast `inverse` wins. Off by default. Attribute: `inverse`. */
1708
+ inverse?: boolean;
895
1709
  /** Container element to anchor this region to (JS property). Set by the store for a scoped region; unset = the global viewport region. */
896
1710
  target?: HTMLElement;
897
1711
  /** A toast's action button was pressed. */
@@ -900,23 +1714,57 @@ export interface ToastRegionProps extends WebComponentProps {
900
1714
  onDismiss?: (event: CustomEvent<{ id: string; reason: "action" | "timeout" | "close" }>) => void;
901
1715
  }
902
1716
 
903
- export const ToastRegion = createWebComponent<ToastRegionProps>(
1717
+ export const ToastRegion = /*#__PURE__*/ createWebComponent<ToastRegionProps>(
904
1718
  'kai-toast-region',
905
- ["theme","toasts","position","max","stack","target"],
1719
+ ["theme","toasts","position","max","stack","appearance","inverse","target"],
906
1720
  { onAction: 'kai-action', onDismiss: 'kai-dismiss' },
1721
+ () => import('@kitn.ai/ui/elements/toast'),
907
1722
  );
908
1723
 
909
1724
  export interface ToolProps extends WebComponentProps {
910
1725
  /** The tool-call to display. Set as a JS property. */
911
1726
  tool?: { type: string; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: Record<string, unknown>; output?: Record<string, unknown>; toolCallId?: string; errorText?: string };
912
- /** Start expanded. */
1727
+ /** Drive/observe open state (Shoelace-style: settable + reflected to the `open` attribute; the element still self-manages on trigger click). Set `el.open = true`, or `<kai-tool open>`; listen for `kai-open-change`. */
913
1728
  open?: boolean;
1729
+ /** Initial open state on mount (uncontrolled seed). */
1730
+ defaultOpen?: boolean;
1731
+ /** Gate the disclosure trigger — programmatic `show()/hide()/toggle()` still work, but the trigger click no longer toggles. */
1732
+ disabled?: boolean;
1733
+ /** The panel expanded or collapsed (by trigger click or a method). */
1734
+ onOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
914
1735
  }
915
1736
 
916
- export const Tool = createWebComponent<ToolProps>(
1737
+ export const Tool = /*#__PURE__*/ createWebComponent<ToolProps>(
917
1738
  'kai-tool',
918
- ["theme","tool","open"],
919
- { },
1739
+ ["theme","tool","open","defaultOpen","disabled"],
1740
+ { onOpenChange: 'kai-open-change' },
1741
+ () => import('@kitn.ai/ui/elements/tool'),
1742
+ );
1743
+
1744
+ export interface TooltipProps extends WebComponentProps {
1745
+ /** The hint text shown on hover/focus of the slotted trigger. */
1746
+ content?: string;
1747
+ /** Delay (ms) before the tooltip appears on hover. Defaults to 600. Focus shows it immediately regardless. */
1748
+ openDelay?: number;
1749
+ /** Delay (ms) before it hides after the pointer leaves. Defaults to 0 (hides immediately). */
1750
+ closeDelay?: number;
1751
+ /** Preferred placement: `'top' | 'bottom' | 'left' | 'right'` (+ optional `-start`/`-end`). Defaults to `'top'`; flips to stay in view. */
1752
+ placement?: string;
1753
+ /** Drive/observe open state (Shoelace-style: settable + reflected to the `open` attribute, the element still self-manages on hover/focus). Set `el.open = true`, or `<kai-tooltip open>`; listen for `kai-open-change`. */
1754
+ open?: boolean;
1755
+ /** Initial open state on mount (uncontrolled seed). */
1756
+ defaultOpen?: boolean;
1757
+ /** Turn the tooltip off while keeping the trigger mounted (hover/focus and `show()` no longer open it). */
1758
+ disabled?: boolean;
1759
+ /** The tooltip opened or closed (by hover/focus, outside-click, or a method). */
1760
+ onOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
1761
+ }
1762
+
1763
+ export const Tooltip = /*#__PURE__*/ createWebComponent<TooltipProps>(
1764
+ 'kai-tooltip',
1765
+ ["theme","content","openDelay","closeDelay","placement","open","defaultOpen","disabled"],
1766
+ { onOpenChange: 'kai-open-change' },
1767
+ () => import('@kitn.ai/ui/elements/tooltip'),
920
1768
  );
921
1769
 
922
1770
  export interface VoiceInputProps extends WebComponentProps {
@@ -924,23 +1772,54 @@ export interface VoiceInputProps extends WebComponentProps {
924
1772
  transcribe?: (audio: Blob) => Promise<string>;
925
1773
  /** Disable the mic button (non-interactive). */
926
1774
  disabled?: boolean;
927
- /** Raw audio captured (before transcription) for hosts that prefer to handle transcription themselves instead of via the `transcribe` property. */
1775
+ /** BCP-47 language tag for the native `SpeechRecognition` path (e.g. `en-US`). Attribute: `recognition-lang` (the plain `lang` attribute is reserved by `HTMLElement` and can't be a custom-element property). No effect when `transcribe` is set or the browser lacks SpeechRecognition. */
1776
+ recognitionLang?: string;
1777
+ /** Emit live partial transcripts (`kai-transcript-interim`) during native recognition. Attribute: `interim`. No-op on the transcribe/fallback paths. */
1778
+ interim?: boolean;
1779
+ /** Raw audio captured (before transcription) — for hosts that prefer to handle transcription themselves instead of via the `transcribe` property. Also the unsupported-fallback signal: no `transcribe`, no SpeechRecognition, so only the blob is produced (no text). */
928
1780
  onAudioCaptured?: (event: CustomEvent<{ blob: Blob }>) => void;
929
- /** Transcription completed (the `transcribe` property resolved). */
1781
+ /** Recording started or stopped — lets the host drive its own UI (waveform, push-to-talk indicator) in sync with the mic. Fires on real transitions only (manual click and programmatic start()/stop()), never on mount. */
1782
+ onRecordingChange?: (event: CustomEvent<{ recording: boolean }>) => void;
1783
+ /** Live partial transcript during native recognition (only when `interim` is set). Fires repeatedly before the final `kai-transcription`. */
1784
+ onTranscriptInterim?: (event: CustomEvent<{ text: string }>) => void;
1785
+ /** Final transcript — the `transcribe` property resolved, OR native `SpeechRecognition` produced final text (no `transcribe` set). */
930
1786
  onTranscription?: (event: CustomEvent<{ text: string }>) => void;
931
1787
  }
932
1788
 
933
- export const VoiceInput = createWebComponent<VoiceInputProps>(
1789
+ export const VoiceInput = /*#__PURE__*/ createWebComponent<VoiceInputProps>(
934
1790
  'kai-voice-input',
935
- ["theme","transcribe","disabled"],
936
- { onAudioCaptured: 'kai-audio-captured', onTranscription: 'kai-transcription' },
1791
+ ["theme","transcribe","disabled","recognitionLang","interim"],
1792
+ { onAudioCaptured: 'kai-audio-captured', onRecordingChange: 'kai-recording-change', onTranscriptInterim: 'kai-transcript-interim', onTranscription: 'kai-transcription' },
1793
+ () => import('@kitn.ai/ui/elements/voice-input'),
1794
+ );
1795
+
1796
+ export interface VoiceOutputProps extends WebComponentProps {
1797
+ /** The utterance to read aloud. */
1798
+ text?: string;
1799
+ /** Speak automatically when `text` is set/changed. */
1800
+ autoplay?: boolean;
1801
+ /** TTS model seam the host supplies — given text, returns an audio `Blob` to play. This is a **function-valued property** (`el.synthesize = async text => blob`); when set, the native `speechSynthesis` path is bypassed. Mirrors `<kai-voice-input>`'s `transcribe`. A value-returning callback can't be modelled as a fire-and-forget event, hence a property. */
1802
+ synthesize?: (text: string) => Promise<Blob>;
1803
+ /** Disable the button (non-interactive). */
1804
+ disabled?: boolean;
1805
+ /** Playback started or stopped — drive your own UI in sync. Fires on real transitions only (manual click and programmatic speak()/stop()), never on mount. */
1806
+ onSpeakingChange?: (event: CustomEvent<{ speaking: boolean }>) => void;
1807
+ /** The model path (`synthesize`) resolved audio — the raw `Blob` before playback. */
1808
+ onSynthesized?: (event: CustomEvent<{ blob: Blob }>) => void;
1809
+ }
1810
+
1811
+ export const VoiceOutput = /*#__PURE__*/ createWebComponent<VoiceOutputProps>(
1812
+ 'kai-voice-output',
1813
+ ["theme","text","autoplay","synthesize","disabled"],
1814
+ { onSpeakingChange: 'kai-speaking-change', onSynthesized: 'kai-synthesized' },
1815
+ () => import('@kitn.ai/ui/elements/voice-output'),
937
1816
  );
938
1817
 
939
1818
  export interface WorkspaceProps extends WebComponentProps {
940
1819
  /** Pre-bucketed conversation groups for the sidebar. Set as a JS property. */
941
1820
  groups: { id: string; userId?: undefined | string; teamId?: undefined | string; name: string; sortOrder: number; createdAt: string }[];
942
1821
  /** Flat conversation list (auto-bucketed if `groups` is empty). Set as a JS property. */
943
- conversations: { id: string; title: string; groupId?: undefined | string; scope: { type: "document" | "collection"; documentId?: undefined | string; filters?: undefined | { tags?: undefined | string[]; authors?: undefined | string[]; contentType?: undefined | "transcript" | "markdown"; dateRange?: undefined | { from: string; to: string } } }; messageCount: number; lastMessageAt: string; updatedAt: string }[];
1822
+ conversations: { id: string; title: string; groupId?: undefined | string; scope: { type: "document" | "collection"; documentId?: undefined | string; filters?: undefined | { tags?: undefined | string[]; authors?: undefined | string[]; contentType?: undefined | "transcript" | "markdown"; dateRange?: undefined | { from: string; to: string } } }; messageCount: number; lastMessageAt: string; updatedAt: string; trailing?: undefined | string }[];
944
1823
  /** Id of the open conversation, highlighted in the sidebar. */
945
1824
  activeId?: string;
946
1825
  /** The active conversation's message thread, newest last. Set as a JS property. */
@@ -950,7 +1829,7 @@ export interface WorkspaceProps extends WebComponentProps {
950
1829
  loading?: boolean;
951
1830
  suggestions?: string[];
952
1831
  suggestionMode?: "submit" | "fill";
953
- proseSize?: "xs" | "sm" | "base" | "lg";
1832
+ proseSize?: "sm" | "lg" | "xs" | "base";
954
1833
  codeTheme?: string;
955
1834
  codeHighlight?: boolean;
956
1835
  chatTitle?: string;
@@ -960,12 +1839,13 @@ export interface WorkspaceProps extends WebComponentProps {
960
1839
  scrollButton?: boolean;
961
1840
  search?: boolean;
962
1841
  voice?: boolean;
963
- slashCommands?: { id: string; label: string; description?: string; category?: string }[];
964
- slashActiveIds?: string[];
965
- slashCompact?: boolean;
966
- /** Sidebar default width as a percent of the workspace (default 22). */
1842
+ /** Rich entity triggers (`/` skills, `@` agents/plugins) forwarded to the input. */
1843
+ triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
1844
+ /** Default icon per entity kind (kind → image src) forwarded to the input. */
1845
+ kindIcons?: Record<string, string>;
1846
+ /** Sidebar default width as a percent of the workspace (default 26). */
967
1847
  sidebarWidth?: number;
968
- /** Sidebar min width in px (default 200). */
1848
+ /** Sidebar min width in px (default 240). */
969
1849
  sidebarMinWidth?: number;
970
1850
  /** Sidebar max width in px (default 420). */
971
1851
  sidebarMaxWidth?: number;
@@ -973,6 +1853,12 @@ export interface WorkspaceProps extends WebComponentProps {
973
1853
  sidebarCollapsed?: boolean;
974
1854
  /** Initial collapsed state when uncontrolled (default false). Use the `default-sidebar-collapsed` attribute to start collapsed in plain HTML. */
975
1855
  defaultSidebarCollapsed?: boolean;
1856
+ /** Auto-collapse the rail when the workspace's own width drops below this many px, and re-expand when it grows back above. Uncontrolled only (it never fights an app-driven `sidebarCollapsed`); omit to disable. Fires `kai-sidebar-toggle`. Attribute: `collapse-below`. */
1857
+ collapseBelow?: number;
1858
+ /** Render Recents as dense single-line rows (a leading dot + title, no count). */
1859
+ compact?: boolean;
1860
+ /** Suppress the built-in ConversationList so the `sidebar-header` slot owns the whole rail flex region (for apps that supply their own rail nav). Default false. Attribute: `no-conversations`. */
1861
+ noConversations?: boolean;
976
1862
  /** A conversation was selected in the sidebar. */
977
1863
  onConversationSelect?: (event: CustomEvent<{ id: string }>) => void;
978
1864
  /** An action button on a message was clicked. `state` is present only for the toggleable feedback votes: `'on'` when a like/dislike is set, `'off'` when re-tapped to clear. */
@@ -985,8 +1871,6 @@ export interface WorkspaceProps extends WebComponentProps {
985
1871
  onSearch?: (event: CustomEvent<Record<string, never>>) => void;
986
1872
  /** The sidebar was collapsed or expanded. */
987
1873
  onSidebarToggle?: (event: CustomEvent<{ collapsed: boolean }>) => void;
988
- /** A slash command was chosen from the palette. */
989
- onSlashSelect?: (event: CustomEvent<{ command: { id: string; label: string; description?: undefined | string; category?: undefined | string } }>) => void;
990
1874
  /** User submitted a message. */
991
1875
  onSubmit?: (event: CustomEvent<{ value: string; attachments: { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[] }>) => void;
992
1876
  /** A suggestion chip was clicked (only in `suggestion-mode="fill"`). */
@@ -997,8 +1881,9 @@ export interface WorkspaceProps extends WebComponentProps {
997
1881
  onVoice?: (event: CustomEvent<Record<string, never>>) => void;
998
1882
  }
999
1883
 
1000
- export const Workspace = createWebComponent<WorkspaceProps>(
1884
+ export const Workspace = /*#__PURE__*/ createWebComponent<WorkspaceProps>(
1001
1885
  'kai-workspace',
1002
- ["theme","groups","conversations","activeId","messages","value","placeholder","loading","suggestions","suggestionMode","proseSize","codeTheme","codeHighlight","chatTitle","models","currentModel","context","scrollButton","search","voice","slashCommands","slashActiveIds","slashCompact","sidebarWidth","sidebarMinWidth","sidebarMaxWidth","sidebarCollapsed","defaultSidebarCollapsed"],
1003
- { onConversationSelect: 'kai-conversation-select', onMessageAction: 'kai-message-action', onModelChange: 'kai-model-change', onNewChat: 'kai-new-chat', onSearch: 'kai-search', onSidebarToggle: 'kai-sidebar-toggle', onSlashSelect: 'kai-slash-select', onSubmit: 'kai-submit', onSuggestionClick: 'kai-suggestion-click', onValueChange: 'kai-value-change', onVoice: 'kai-voice' },
1886
+ ["theme","groups","conversations","activeId","messages","value","placeholder","loading","suggestions","suggestionMode","proseSize","codeTheme","codeHighlight","chatTitle","models","currentModel","context","scrollButton","search","voice","triggers","kindIcons","sidebarWidth","sidebarMinWidth","sidebarMaxWidth","sidebarCollapsed","defaultSidebarCollapsed","collapseBelow","compact","noConversations"],
1887
+ { onConversationSelect: 'kai-conversation-select', onMessageAction: 'kai-message-action', onModelChange: 'kai-model-change', onNewChat: 'kai-new-chat', onSearch: 'kai-search', onSidebarToggle: 'kai-sidebar-toggle', onSubmit: 'kai-submit', onSuggestionClick: 'kai-suggestion-click', onValueChange: 'kai-value-change', onVoice: 'kai-voice' },
1888
+ () => import('@kitn.ai/ui/elements/chat-workspace'),
1004
1889
  );