@kortix/ui 0.0.0-bootstrap.0 → 0.14.3

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 (416) hide show
  1. package/README.md +153 -2
  2. package/dist/_vendor/kortix-shared.js +341 -0
  3. package/dist/chat/agent-picker.d.ts +8 -0
  4. package/dist/chat/agent-picker.js +18 -0
  5. package/dist/chat/composer.d.ts +31 -0
  6. package/dist/chat/composer.js +114 -0
  7. package/dist/chat/index.d.ts +22 -0
  8. package/dist/chat/index.js +22 -0
  9. package/dist/chat/markdown.d.ts +10 -0
  10. package/dist/chat/markdown.js +36 -0
  11. package/dist/chat/message-list.d.ts +25 -0
  12. package/dist/chat/message-list.js +73 -0
  13. package/dist/chat/message-view.d.ts +17 -0
  14. package/dist/chat/message-view.js +86 -0
  15. package/dist/chat/model-picker.d.ts +10 -0
  16. package/dist/chat/model-picker.js +68 -0
  17. package/dist/chat/permission-prompt.d.ts +10 -0
  18. package/dist/chat/permission-prompt.js +40 -0
  19. package/dist/chat/question-prompt.d.ts +8 -0
  20. package/dist/chat/question-prompt.js +60 -0
  21. package/dist/chat/send-failure.d.ts +9 -0
  22. package/dist/chat/send-failure.js +21 -0
  23. package/dist/chat/session-thread.d.ts +28 -0
  24. package/dist/chat/session-thread.js +47 -0
  25. package/dist/chat/streaming-markdown.d.ts +21 -0
  26. package/dist/chat/streaming-markdown.js +59 -0
  27. package/dist/chat/tool-call.d.ts +4 -0
  28. package/dist/chat/tool-call.js +150 -0
  29. package/dist/chat/user-message-parts.d.ts +6 -0
  30. package/dist/chat/user-message-parts.js +11 -0
  31. package/dist/components/ui/accordion.d.ts +7 -0
  32. package/dist/components/ui/accordion.js +18 -0
  33. package/dist/components/ui/alert-dialog.d.ts +19 -0
  34. package/dist/components/ui/alert-dialog.js +48 -0
  35. package/dist/components/ui/alert.d.ts +13 -0
  36. package/dist/components/ui/alert.js +67 -0
  37. package/dist/components/ui/avatar.d.ts +11 -0
  38. package/dist/components/ui/avatar.js +23 -0
  39. package/dist/components/ui/back-pill.d.ts +13 -0
  40. package/dist/components/ui/back-pill.js +18 -0
  41. package/dist/components/ui/badge.d.ts +10 -0
  42. package/dist/components/ui/badge.js +42 -0
  43. package/dist/components/ui/breadcrumb.d.ts +11 -0
  44. package/dist/components/ui/breadcrumb.js +28 -0
  45. package/dist/components/ui/bubble.d.ts +20 -0
  46. package/dist/components/ui/bubble.js +38 -0
  47. package/dist/components/ui/button-group.d.ts +9 -0
  48. package/dist/components/ui/button-group.js +32 -0
  49. package/dist/components/ui/button.d.ts +13 -0
  50. package/dist/components/ui/button.js +67 -0
  51. package/dist/components/ui/calendar.d.ts +4 -0
  52. package/dist/components/ui/calendar.js +39 -0
  53. package/dist/components/ui/card.d.ts +96 -0
  54. package/dist/components/ui/card.js +291 -0
  55. package/dist/components/ui/chain-of-thought.d.ts +75 -0
  56. package/dist/components/ui/chain-of-thought.js +66 -0
  57. package/dist/components/ui/chart.d.ts +65 -0
  58. package/dist/components/ui/chart.js +118 -0
  59. package/dist/components/ui/checkbox-group.d.ts +19 -0
  60. package/dist/components/ui/checkbox-group.js +41 -0
  61. package/dist/components/ui/checkbox.d.ts +14 -0
  62. package/dist/components/ui/checkbox.js +27 -0
  63. package/dist/components/ui/collapsible.d.ts +5 -0
  64. package/dist/components/ui/collapsible.js +14 -0
  65. package/dist/components/ui/command.d.ts +58 -0
  66. package/dist/components/ui/command.js +135 -0
  67. package/dist/components/ui/confirm-dialog.d.ts +19 -0
  68. package/dist/components/ui/confirm-dialog.js +30 -0
  69. package/dist/components/ui/context-menu.d.ts +45 -0
  70. package/dist/components/ui/context-menu.js +93 -0
  71. package/dist/components/ui/count-badge.d.ts +26 -0
  72. package/dist/components/ui/count-badge.js +26 -0
  73. package/dist/components/ui/data-grid.d.ts +24 -0
  74. package/dist/components/ui/data-grid.js +107 -0
  75. package/dist/components/ui/date-range-picker.d.ts +119 -0
  76. package/dist/components/ui/date-range-picker.js +190 -0
  77. package/dist/components/ui/definition-list.d.ts +15 -0
  78. package/dist/components/ui/definition-list.js +26 -0
  79. package/dist/components/ui/dialog.d.ts +29 -0
  80. package/dist/components/ui/dialog.js +52 -0
  81. package/dist/components/ui/disclosure.d.ts +121 -0
  82. package/dist/components/ui/disclosure.js +138 -0
  83. package/dist/components/ui/dot-matrix/dotm-3x3-10.d.ts +4 -0
  84. package/dist/components/ui/dot-matrix/dotm-3x3-10.js +29 -0
  85. package/dist/components/ui/dot-matrix/dotm-3x3-12.d.ts +4 -0
  86. package/dist/components/ui/dot-matrix/dotm-3x3-12.js +19 -0
  87. package/dist/components/ui/dot-matrix/dotm-3x3-13.d.ts +4 -0
  88. package/dist/components/ui/dot-matrix/dotm-3x3-13.js +19 -0
  89. package/dist/components/ui/dot-matrix/dotm-3x3-15.d.ts +4 -0
  90. package/dist/components/ui/dot-matrix/dotm-3x3-15.js +22 -0
  91. package/dist/components/ui/dot-matrix/dotm-3x3-16.d.ts +4 -0
  92. package/dist/components/ui/dot-matrix/dotm-3x3-16.js +5 -0
  93. package/dist/components/ui/dot-matrix/dotm-3x3-18.d.ts +4 -0
  94. package/dist/components/ui/dot-matrix/dotm-3x3-18.js +5 -0
  95. package/dist/components/ui/dot-matrix/dotm-3x3-19.d.ts +4 -0
  96. package/dist/components/ui/dot-matrix/dotm-3x3-19.js +5 -0
  97. package/dist/components/ui/dot-matrix/dotm-3x3-2.d.ts +4 -0
  98. package/dist/components/ui/dot-matrix/dotm-3x3-2.js +3 -0
  99. package/dist/components/ui/dot-matrix/dotm-3x3-20.d.ts +4 -0
  100. package/dist/components/ui/dot-matrix/dotm-3x3-20.js +5 -0
  101. package/dist/components/ui/dot-matrix/dotm-3x3-21.d.ts +4 -0
  102. package/dist/components/ui/dot-matrix/dotm-3x3-21.js +5 -0
  103. package/dist/components/ui/dot-matrix/dotm-3x3-3.d.ts +4 -0
  104. package/dist/components/ui/dot-matrix/dotm-3x3-3.js +3 -0
  105. package/dist/components/ui/dot-matrix/dotm-3x3-4.d.ts +4 -0
  106. package/dist/components/ui/dot-matrix/dotm-3x3-4.js +3 -0
  107. package/dist/components/ui/dot-matrix/dotm-3x3-5.d.ts +4 -0
  108. package/dist/components/ui/dot-matrix/dotm-3x3-5.js +3 -0
  109. package/dist/components/ui/dot-matrix/dotm-3x3-6.d.ts +4 -0
  110. package/dist/components/ui/dot-matrix/dotm-3x3-6.js +19 -0
  111. package/dist/components/ui/dot-matrix/dotm-3x3-7.d.ts +4 -0
  112. package/dist/components/ui/dot-matrix/dotm-3x3-7.js +19 -0
  113. package/dist/components/ui/dot-matrix/dotm-3x3-8.d.ts +4 -0
  114. package/dist/components/ui/dot-matrix/dotm-3x3-8.js +19 -0
  115. package/dist/components/ui/dot-matrix/dotm-3x3-9.d.ts +4 -0
  116. package/dist/components/ui/dot-matrix/dotm-3x3-9.js +23 -0
  117. package/dist/components/ui/dot-matrix/dotm-circular-1.d.ts +4 -0
  118. package/dist/components/ui/dot-matrix/dotm-circular-1.js +28 -0
  119. package/dist/components/ui/dot-matrix/dotm-circular-10.d.ts +4 -0
  120. package/dist/components/ui/dot-matrix/dotm-circular-10.js +40 -0
  121. package/dist/components/ui/dot-matrix/dotm-circular-11.d.ts +4 -0
  122. package/dist/components/ui/dot-matrix/dotm-circular-11.js +37 -0
  123. package/dist/components/ui/dot-matrix/dotm-circular-12.d.ts +4 -0
  124. package/dist/components/ui/dot-matrix/dotm-circular-12.js +42 -0
  125. package/dist/components/ui/dot-matrix/dotm-circular-14.d.ts +4 -0
  126. package/dist/components/ui/dot-matrix/dotm-circular-14.js +37 -0
  127. package/dist/components/ui/dot-matrix/dotm-circular-15.d.ts +4 -0
  128. package/dist/components/ui/dot-matrix/dotm-circular-15.js +49 -0
  129. package/dist/components/ui/dot-matrix/dotm-circular-17.d.ts +4 -0
  130. package/dist/components/ui/dot-matrix/dotm-circular-17.js +31 -0
  131. package/dist/components/ui/dot-matrix/dotm-circular-2.d.ts +4 -0
  132. package/dist/components/ui/dot-matrix/dotm-circular-2.js +37 -0
  133. package/dist/components/ui/dot-matrix/dotm-circular-3.d.ts +4 -0
  134. package/dist/components/ui/dot-matrix/dotm-circular-3.js +54 -0
  135. package/dist/components/ui/dot-matrix/dotm-circular-4.d.ts +4 -0
  136. package/dist/components/ui/dot-matrix/dotm-circular-4.js +35 -0
  137. package/dist/components/ui/dot-matrix/dotm-circular-5.d.ts +4 -0
  138. package/dist/components/ui/dot-matrix/dotm-circular-5.js +30 -0
  139. package/dist/components/ui/dot-matrix/dotm-circular-6.d.ts +4 -0
  140. package/dist/components/ui/dot-matrix/dotm-circular-6.js +37 -0
  141. package/dist/components/ui/dot-matrix/dotm-circular-7.d.ts +4 -0
  142. package/dist/components/ui/dot-matrix/dotm-circular-7.js +25 -0
  143. package/dist/components/ui/dot-matrix/dotm-circular-8.d.ts +4 -0
  144. package/dist/components/ui/dot-matrix/dotm-circular-8.js +26 -0
  145. package/dist/components/ui/dot-matrix/dotm-circular-9.d.ts +4 -0
  146. package/dist/components/ui/dot-matrix/dotm-circular-9.js +41 -0
  147. package/dist/components/ui/dot-matrix/dotm-square-1.d.ts +4 -0
  148. package/dist/components/ui/dot-matrix/dotm-square-1.js +27 -0
  149. package/dist/components/ui/dot-matrix/dotm-square-10.d.ts +4 -0
  150. package/dist/components/ui/dot-matrix/dotm-square-10.js +27 -0
  151. package/dist/components/ui/dot-matrix/dotm-square-11.d.ts +4 -0
  152. package/dist/components/ui/dot-matrix/dotm-square-11.js +25 -0
  153. package/dist/components/ui/dot-matrix/dotm-square-12.d.ts +4 -0
  154. package/dist/components/ui/dot-matrix/dotm-square-12.js +28 -0
  155. package/dist/components/ui/dot-matrix/dotm-square-13.d.ts +4 -0
  156. package/dist/components/ui/dot-matrix/dotm-square-13.js +45 -0
  157. package/dist/components/ui/dot-matrix/dotm-square-14.d.ts +4 -0
  158. package/dist/components/ui/dot-matrix/dotm-square-14.js +38 -0
  159. package/dist/components/ui/dot-matrix/dotm-square-15.d.ts +4 -0
  160. package/dist/components/ui/dot-matrix/dotm-square-15.js +31 -0
  161. package/dist/components/ui/dot-matrix/dotm-square-16.d.ts +4 -0
  162. package/dist/components/ui/dot-matrix/dotm-square-16.js +33 -0
  163. package/dist/components/ui/dot-matrix/dotm-square-17.d.ts +4 -0
  164. package/dist/components/ui/dot-matrix/dotm-square-17.js +27 -0
  165. package/dist/components/ui/dot-matrix/dotm-square-18.d.ts +4 -0
  166. package/dist/components/ui/dot-matrix/dotm-square-18.js +29 -0
  167. package/dist/components/ui/dot-matrix/dotm-square-19.d.ts +4 -0
  168. package/dist/components/ui/dot-matrix/dotm-square-19.js +74 -0
  169. package/dist/components/ui/dot-matrix/dotm-square-2.d.ts +4 -0
  170. package/dist/components/ui/dot-matrix/dotm-square-2.js +72 -0
  171. package/dist/components/ui/dot-matrix/dotm-square-20.d.ts +4 -0
  172. package/dist/components/ui/dot-matrix/dotm-square-20.js +79 -0
  173. package/dist/components/ui/dot-matrix/dotm-square-3.d.ts +4 -0
  174. package/dist/components/ui/dot-matrix/dotm-square-3.js +23 -0
  175. package/dist/components/ui/dot-matrix/dotm-square-4.d.ts +4 -0
  176. package/dist/components/ui/dot-matrix/dotm-square-4.js +41 -0
  177. package/dist/components/ui/dot-matrix/dotm-square-5.d.ts +4 -0
  178. package/dist/components/ui/dot-matrix/dotm-square-5.js +23 -0
  179. package/dist/components/ui/dot-matrix/dotm-square-6.d.ts +4 -0
  180. package/dist/components/ui/dot-matrix/dotm-square-6.js +20 -0
  181. package/dist/components/ui/dot-matrix/dotm-square-7.d.ts +4 -0
  182. package/dist/components/ui/dot-matrix/dotm-square-7.js +43 -0
  183. package/dist/components/ui/dot-matrix/dotm-square-8.d.ts +4 -0
  184. package/dist/components/ui/dot-matrix/dotm-square-8.js +57 -0
  185. package/dist/components/ui/dot-matrix/dotm-square-9.d.ts +4 -0
  186. package/dist/components/ui/dot-matrix/dotm-square-9.js +89 -0
  187. package/dist/components/ui/dot-matrix/session-dot-matrix.d.ts +46 -0
  188. package/dist/components/ui/dot-matrix/session-dot-matrix.js +153 -0
  189. package/dist/components/ui/drawer.d.ts +15 -0
  190. package/dist/components/ui/drawer.js +35 -0
  191. package/dist/components/ui/dropdown-menu.d.ts +49 -0
  192. package/dist/components/ui/dropdown-menu.js +113 -0
  193. package/dist/components/ui/emoji-picker.d.ts +15 -0
  194. package/dist/components/ui/emoji-picker.js +137 -0
  195. package/dist/components/ui/emoji-tint.d.ts +41 -0
  196. package/dist/components/ui/emoji-tint.js +131 -0
  197. package/dist/components/ui/empty.d.ts +11 -0
  198. package/dist/components/ui/empty.js +33 -0
  199. package/dist/components/ui/entity-avatar.d.ts +84 -0
  200. package/dist/components/ui/entity-avatar.js +106 -0
  201. package/dist/components/ui/faded-scroll-area.d.ts +8 -0
  202. package/dist/components/ui/faded-scroll-area.js +80 -0
  203. package/dist/components/ui/favicon-avatar.d.ts +32 -0
  204. package/dist/components/ui/favicon-avatar.js +18 -0
  205. package/dist/components/ui/field.d.ts +15 -0
  206. package/dist/components/ui/field.js +48 -0
  207. package/dist/components/ui/file-tree.d.ts +32 -0
  208. package/dist/components/ui/file-tree.js +30 -0
  209. package/dist/components/ui/glyph-face.d.ts +18 -0
  210. package/dist/components/ui/glyph-face.js +37 -0
  211. package/dist/components/ui/glyph-paths-source.d.ts +2 -0
  212. package/dist/components/ui/glyph-paths-source.js +40 -0
  213. package/dist/components/ui/glyph-paths.generated.d.ts +2 -0
  214. package/dist/components/ui/glyph-paths.generated.js +207 -0
  215. package/dist/components/ui/glyph-picker.d.ts +22 -0
  216. package/dist/components/ui/glyph-picker.js +118 -0
  217. package/dist/components/ui/glyph-registry.d.ts +36 -0
  218. package/dist/components/ui/glyph-registry.js +479 -0
  219. package/dist/components/ui/glyph-tint.d.ts +6 -0
  220. package/dist/components/ui/glyph-tint.js +93 -0
  221. package/dist/components/ui/hint.d.ts +14 -0
  222. package/dist/components/ui/hint.js +12 -0
  223. package/dist/components/ui/histogram-bars.d.ts +38 -0
  224. package/dist/components/ui/histogram-bars.js +93 -0
  225. package/dist/components/ui/hover-card.d.ts +28 -0
  226. package/dist/components/ui/hover-card.js +35 -0
  227. package/dist/components/ui/icon-provider.d.ts +23 -0
  228. package/dist/components/ui/icon-provider.js +30 -0
  229. package/dist/components/ui/info-banner.d.ts +14 -0
  230. package/dist/components/ui/info-banner.js +72 -0
  231. package/dist/components/ui/inline-meta.d.ts +6 -0
  232. package/dist/components/ui/inline-meta.js +8 -0
  233. package/dist/components/ui/input-group.d.ts +19 -0
  234. package/dist/components/ui/input-group.js +73 -0
  235. package/dist/components/ui/input.d.ts +26 -0
  236. package/dist/components/ui/input.js +23 -0
  237. package/dist/components/ui/item.d.ts +23 -0
  238. package/dist/components/ui/item.js +67 -0
  239. package/dist/components/ui/kbd.d.ts +3 -0
  240. package/dist/components/ui/kbd.js +20 -0
  241. package/dist/components/ui/kortix-asterisk.d.ts +6 -0
  242. package/dist/components/ui/kortix-asterisk.js +17 -0
  243. package/dist/components/ui/kortix-icons.d.ts +2 -0
  244. package/dist/components/ui/kortix-icons.js +17 -0
  245. package/dist/components/ui/kortix-loader.d.ts +76 -0
  246. package/dist/components/ui/kortix-loader.js +74 -0
  247. package/dist/components/ui/kortix-logo.d.ts +30 -0
  248. package/dist/components/ui/kortix-logo.js +47 -0
  249. package/dist/components/ui/label.d.ts +4 -0
  250. package/dist/components/ui/label.js +9 -0
  251. package/dist/components/ui/list.d.ts +15 -0
  252. package/dist/components/ui/list.js +25 -0
  253. package/dist/components/ui/loading.d.ts +19 -0
  254. package/dist/components/ui/loading.js +31 -0
  255. package/dist/components/ui/local-time.d.ts +34 -0
  256. package/dist/components/ui/local-time.js +60 -0
  257. package/dist/components/ui/map.d.ts +101 -0
  258. package/dist/components/ui/map.js +257 -0
  259. package/dist/components/ui/marker.d.ts +14 -0
  260. package/dist/components/ui/marker.js +28 -0
  261. package/dist/components/ui/menu-recipe.d.ts +102 -0
  262. package/dist/components/ui/menu-recipe.js +129 -0
  263. package/dist/components/ui/mermaid-render.d.ts +51 -0
  264. package/dist/components/ui/mermaid-render.js +65 -0
  265. package/dist/components/ui/mermaid-renderer.d.ts +13 -0
  266. package/dist/components/ui/mermaid-renderer.js +340 -0
  267. package/dist/components/ui/message.d.ts +15 -0
  268. package/dist/components/ui/message.js +26 -0
  269. package/dist/components/ui/modal.d.ts +104 -0
  270. package/dist/components/ui/modal.js +180 -0
  271. package/dist/components/ui/navigation-menu.d.ts +16 -0
  272. package/dist/components/ui/navigation-menu.js +35 -0
  273. package/dist/components/ui/page-search-bar.d.ts +11 -0
  274. package/dist/components/ui/page-search-bar.js +13 -0
  275. package/dist/components/ui/phone-input.d.ts +7 -0
  276. package/dist/components/ui/phone-input.js +59 -0
  277. package/dist/components/ui/pixel-kortix-mark.d.ts +13 -0
  278. package/dist/components/ui/pixel-kortix-mark.js +40 -0
  279. package/dist/components/ui/popover.d.ts +10 -0
  280. package/dist/components/ui/popover.js +38 -0
  281. package/dist/components/ui/portal.d.ts +5 -0
  282. package/dist/components/ui/portal.js +15 -0
  283. package/dist/components/ui/preview-image.d.ts +14 -0
  284. package/dist/components/ui/preview-image.js +58 -0
  285. package/dist/components/ui/progress-ring.d.ts +6 -0
  286. package/dist/components/ui/progress-ring.js +9 -0
  287. package/dist/components/ui/progress.d.ts +6 -0
  288. package/dist/components/ui/progress.js +8 -0
  289. package/dist/components/ui/radio-group.d.ts +12 -0
  290. package/dist/components/ui/radio-group.js +20 -0
  291. package/dist/components/ui/resizable.d.ts +24 -0
  292. package/dist/components/ui/resizable.js +16 -0
  293. package/dist/components/ui/scroll-area.d.ts +5 -0
  294. package/dist/components/ui/scroll-area.js +11 -0
  295. package/dist/components/ui/section-card.d.ts +37 -0
  296. package/dist/components/ui/section-card.js +14 -0
  297. package/dist/components/ui/section.d.ts +10 -0
  298. package/dist/components/ui/section.js +22 -0
  299. package/dist/components/ui/select.d.ts +25 -0
  300. package/dist/components/ui/select.js +59 -0
  301. package/dist/components/ui/separator.d.ts +4 -0
  302. package/dist/components/ui/separator.js +8 -0
  303. package/dist/components/ui/shader-safe.d.ts +48 -0
  304. package/dist/components/ui/shader-safe.js +74 -0
  305. package/dist/components/ui/sheet.d.ts +32 -0
  306. package/dist/components/ui/sheet.js +55 -0
  307. package/dist/components/ui/sidebar-context.d.ts +72 -0
  308. package/dist/components/ui/sidebar-context.js +36 -0
  309. package/dist/components/ui/sidebar-menu-primitives.d.ts +38 -0
  310. package/dist/components/ui/sidebar-menu-primitives.js +97 -0
  311. package/dist/components/ui/sidebar-panel.d.ts +36 -0
  312. package/dist/components/ui/sidebar-panel.js +265 -0
  313. package/dist/components/ui/sidebar-peek.d.ts +27 -0
  314. package/dist/components/ui/sidebar-peek.js +70 -0
  315. package/dist/components/ui/sidebar-width.d.ts +48 -0
  316. package/dist/components/ui/sidebar-width.js +62 -0
  317. package/dist/components/ui/sidebar.d.ts +18 -0
  318. package/dist/components/ui/sidebar.js +194 -0
  319. package/dist/components/ui/skeleton.d.ts +3 -0
  320. package/dist/components/ui/skeleton.js +6 -0
  321. package/dist/components/ui/slider-native.d.ts +7 -0
  322. package/dist/components/ui/slider-native.js +16 -0
  323. package/dist/components/ui/slider.d.ts +14 -0
  324. package/dist/components/ui/slider.js +48 -0
  325. package/dist/components/ui/sliding-tab-indicator.d.ts +61 -0
  326. package/dist/components/ui/sliding-tab-indicator.js +128 -0
  327. package/dist/components/ui/split-sheet.d.ts +61 -0
  328. package/dist/components/ui/split-sheet.js +239 -0
  329. package/dist/components/ui/spotlight-card.d.ts +8 -0
  330. package/dist/components/ui/spotlight-card.js +43 -0
  331. package/dist/components/ui/status-ring.d.ts +38 -0
  332. package/dist/components/ui/status-ring.js +38 -0
  333. package/dist/components/ui/status.d.ts +58 -0
  334. package/dist/components/ui/status.js +76 -0
  335. package/dist/components/ui/stepper.d.ts +28 -0
  336. package/dist/components/ui/stepper.js +73 -0
  337. package/dist/components/ui/switch.d.ts +8 -0
  338. package/dist/components/ui/switch.js +131 -0
  339. package/dist/components/ui/system-message.d.ts +23 -0
  340. package/dist/components/ui/system-message.js +51 -0
  341. package/dist/components/ui/table.d.ts +10 -0
  342. package/dist/components/ui/table.js +28 -0
  343. package/dist/components/ui/tabs.d.ts +73 -0
  344. package/dist/components/ui/tabs.js +207 -0
  345. package/dist/components/ui/tag.d.ts +7 -0
  346. package/dist/components/ui/tag.js +22 -0
  347. package/dist/components/ui/text-shimmer.d.ts +13 -0
  348. package/dist/components/ui/text-shimmer.js +91 -0
  349. package/dist/components/ui/textarea.d.ts +33 -0
  350. package/dist/components/ui/textarea.js +87 -0
  351. package/dist/components/ui/toast.d.ts +105 -0
  352. package/dist/components/ui/toast.js +233 -0
  353. package/dist/components/ui/toggle.d.ts +12 -0
  354. package/dist/components/ui/toggle.js +26 -0
  355. package/dist/components/ui/tooltip.d.ts +9 -0
  356. package/dist/components/ui/tooltip.js +16 -0
  357. package/dist/components/ui/trigger-variants.d.ts +14 -0
  358. package/dist/components/ui/trigger-variants.js +67 -0
  359. package/dist/components/ui/type-to-confirm-dialog.d.ts +88 -0
  360. package/dist/components/ui/type-to-confirm-dialog.js +101 -0
  361. package/dist/components/ui/typed-title-logic.d.ts +22 -0
  362. package/dist/components/ui/typed-title-logic.js +33 -0
  363. package/dist/components/ui/typed-title.d.ts +38 -0
  364. package/dist/components/ui/typed-title.js +66 -0
  365. package/dist/components/ui/typing-animation.d.ts +36 -0
  366. package/dist/components/ui/typing-animation.js +141 -0
  367. package/dist/components/ui/user-avatar.d.ts +47 -0
  368. package/dist/components/ui/user-avatar.js +46 -0
  369. package/dist/hooks/use-debounce.d.ts +4 -0
  370. package/dist/hooks/use-debounce.js +17 -0
  371. package/dist/hooks/use-is-dark.d.ts +2 -0
  372. package/dist/hooks/use-is-dark.js +27 -0
  373. package/dist/hooks/use-mobile.d.ts +2 -0
  374. package/dist/hooks/use-mobile.js +15 -0
  375. package/dist/hooks/use-proximity-hover.d.ts +52 -0
  376. package/dist/hooks/use-proximity-hover.js +232 -0
  377. package/dist/icons/close.d.ts +2 -0
  378. package/dist/icons/close.js +7 -0
  379. package/dist/icons/copy.d.ts +3 -0
  380. package/dist/icons/copy.js +6 -0
  381. package/dist/icons/sidebar-toggle.d.ts +13 -0
  382. package/dist/icons/sidebar-toggle.js +13 -0
  383. package/dist/index.d.ts +24 -0
  384. package/dist/index.js +33 -0
  385. package/dist/lib/dotmatrix-core.d.ts +113 -0
  386. package/dist/lib/dotmatrix-core.js +920 -0
  387. package/dist/lib/dotmatrix-hooks.d.ts +28 -0
  388. package/dist/lib/dotmatrix-hooks.js +151 -0
  389. package/dist/lib/favicon.d.ts +4 -0
  390. package/dist/lib/favicon.js +21 -0
  391. package/dist/lib/font-weight.d.ts +6 -0
  392. package/dist/lib/font-weight.js +6 -0
  393. package/dist/lib/icon-config.d.ts +33 -0
  394. package/dist/lib/icon-config.js +22 -0
  395. package/dist/lib/icon-context.d.ts +34 -0
  396. package/dist/lib/icon-context.js +81 -0
  397. package/dist/lib/portal-root.d.ts +8 -0
  398. package/dist/lib/portal-root.js +26 -0
  399. package/dist/lib/settle.d.ts +16 -0
  400. package/dist/lib/settle.js +29 -0
  401. package/dist/lib/springs.d.ts +31 -0
  402. package/dist/lib/springs.js +29 -0
  403. package/dist/lib/utils.d.ts +2 -0
  404. package/dist/lib/utils.js +5 -0
  405. package/dist/lib/z-stack.d.ts +55 -0
  406. package/dist/lib/z-stack.js +130 -0
  407. package/dist/providers/ui-provider.d.ts +141 -0
  408. package/dist/providers/ui-provider.js +93 -0
  409. package/dist/styles/dotmatrix-loader.css +1239 -0
  410. package/dist/styles/fonts.css +46 -0
  411. package/dist/styles/tailwind.css +10 -0
  412. package/dist/styles/theme.css +1019 -0
  413. package/dist/styles/tokens.css +146 -0
  414. package/dist/styles.css +2 -0
  415. package/package.json +874 -4
  416. package/skills/kortix-ui/SKILL.md +150 -0
package/README.md CHANGED
@@ -1,5 +1,156 @@
1
1
  # @kortix/ui
2
2
 
3
- Placeholder. The first real version of `@kortix/ui` is published by the Kortix release pipeline (GitHub Actions, Trusted Publishing) with the next platform release, in lockstep with `@kortix/sdk`.
3
+ The shared React component library for `apps/web`, Kortix Apps, the
4
+ white-label demo and SDK hosts. Components are Tailwind v4 class strings themed
5
+ by CSS variables. Every `apps/web/src/components/ui/<name>` file lives here as
6
+ `src/components/ui/<name>.tsx`; `apps/web` keeps a one-line re-export shim at
7
+ each old path.
4
8
 
5
- Docs: https://kortix.com/docs/sdk/ui
9
+ Install: not on npm yet. Inside kortix-ai/suna: `"@kortix/ui": "workspace:*"`.
10
+ After the first npm release: `npm i @kortix/ui`.
11
+ `react` and `react-dom` 18 or later are peers.
12
+
13
+ - Public docs: `apps/web/content/docs/sdk/ui.mdx` (https://kortix.com/docs/sdk/ui).
14
+ - Agent skill: `skills/kortix-ui/SKILL.md`. Kortix sessions load the same file
15
+ from `packages/starter/templates/managed/skills/kortix-ui/SKILL.md`
16
+ (`kortix-ui` is in `KORTIX_MANAGED_SKILL_NAMES`, so the sandbox bake ships it).
17
+ `src/skill.test.ts` fails when the copies differ or when the skill's
18
+ Components table misses an export of `src/index.ts` or `src/chat/index.ts`.
19
+ - Live catalog: the `/design-system` route of `apps/web`.
20
+
21
+ ## Use it
22
+
23
+ Tailwind host (apps/web, a Vite App with Tailwind):
24
+
25
+ ```css
26
+ @import 'tailwindcss';
27
+ @import '@kortix/ui/tailwind.css';
28
+ ```
29
+
30
+ Install the plugins `tailwind.css` loads (optional peers, so a host without
31
+ Tailwind never installs Tailwind):
32
+ `npm i tw-animate-css tailwind-scrollbar tailwind-scrollbar-hide`.
33
+
34
+ `tailwind.css` imports `tw-animate-css`, `tokens.css` (the `:root` / `.dark`
35
+ values), `theme.css` (dark variant, base rules, `@theme` keys, utilities,
36
+ keyframes, `@source` over the package) and the `tailwind-scrollbar` plugins.
37
+ A host that brings its own token values imports the parts one by one. Every
38
+ line except `tokens.css` is required: without `tw-animate-css` and the plugins,
39
+ overlay animations and `scrollbar-hide` drop out with no build error.
40
+
41
+ ```css
42
+ @import 'tailwindcss';
43
+ @import 'tw-animate-css';
44
+ @import '@kortix/ui/tokens.css'; /* optional */
45
+ @import '@kortix/ui/theme.css';
46
+ @plugin 'tailwind-scrollbar';
47
+ @plugin 'tailwind-scrollbar-hide';
48
+ ```
49
+
50
+ `tokens.css` sets `--spacing: 0.23rem`, 8% tighter than Tailwind's `0.25rem`.
51
+ The host's own spacing utilities follow it (`p-4` is 14.72px). To keep stock
52
+ Tailwind spacing, set `--spacing: 0.25rem` after the import; the components
53
+ then render 8% larger.
54
+
55
+ `theme.css` holds the base rules every host needs: `body` paints
56
+ `--background` / `--foreground`, `*` borders default to `--border`,
57
+ `color-scheme` follows `.dark`, `::selection` reads `--selection`, and
58
+ interactive elements get the pointer cursor.
59
+
60
+ Host without Tailwind: `import '@kortix/ui/styles.css'`. It is
61
+ `dist/styles.css`, committed and rebuilt by `pnpm --filter @kortix/ui
62
+ build:styles` after any change under `src/`. `src/exports.test.ts` fails when
63
+ the committed file drifts from a fresh build.
64
+
65
+ Kortix-owned surfaces only (brand D8a): `@import '@kortix/ui/fonts.css';`
66
+ after `theme.css` loads Roobert and sets `--font-roobert` /
67
+ `--font-roobert-mono`. A white-label host never imports it.
68
+
69
+ Mount the adapters once at the root:
70
+
71
+ ```tsx
72
+ import { UiProvider } from '@kortix/ui';
73
+ <UiProvider strings={{ confirm: t('confirm'), chat: { send: t('send') } }} link={NextLink}>{app}</UiProvider>
74
+ ```
75
+
76
+ `strings` takes any subset of `UiStrings`: `confirm`, `cancel`, `close`,
77
+ `commandPaletteTitle`, `commandPaletteDescription`, and `chat` (every string
78
+ of `@kortix/ui/chat`; `defaultChatStrings` lists the keys). Without
79
+ `UiProvider`, components render English copy and a plain `<a>`.
80
+ `MermaidRenderer`'s controls are English only.
81
+ Dark mode is the `dark` class on `<html>` (`useIsDark()` reads it).
82
+
83
+ Import components by subpath: `import { Button } from '@kortix/ui/button'`.
84
+ The root `@kortix/ui` barrel holds only light core primitives. Toasts need one
85
+ `<Toaster />` from `@kortix/ui/toast` at the root; `IconProvider`
86
+ (`@kortix/ui/icon-provider`) sets the house icon weight.
87
+
88
+ ## Chat
89
+
90
+ Every part of `@kortix/ui/chat` needs `@kortix/sdk` and `@tanstack/react-query`
91
+ 5 (`@kortix/sdk/react` imports it; it is an optional peer, so npm does not
92
+ warn when it is missing and the bundler fails instead):
93
+ `npm i @kortix/ui @kortix/sdk @tanstack/react-query`, plus one
94
+ `QueryClientProvider`.
95
+
96
+ ```tsx
97
+ import { useSession } from '@kortix/sdk/react';
98
+ import { SessionThread } from '@kortix/ui/chat';
99
+
100
+ <SessionThread session={useSession(projectId, sessionId)} />
101
+ ```
102
+
103
+ `src/chat/index.ts` lists every part (`MessageList`, `MessageView`, `Composer`,
104
+ the prompts, the pickers) for a host that composes its own layout. A fully
105
+ custom transcript uses `renderParts` from `@kortix/sdk/react`.
106
+
107
+ ## White-label
108
+
109
+ Override the CSS variables from `tokens.css` in your own `:root` / `.dark`.
110
+ Never fork a component. Roobert (`--font-roobert`) is Kortix-owned surfaces
111
+ only; every other host renders the system stack (`--font-sans-system`).
112
+
113
+ | Variable | What follows it |
114
+ | --- | --- |
115
+ | `--kortix-blue` | The accent: checked `Switch` / `Checkbox` / `RadioGroup`, `brand` and `blue` `Button` variants, info `Badge`, `InfoBanner`, `Alert`, status, toast |
116
+ | `--ring` | Focus rings; `--kortix-base`, `--sidebar-ring` and `--sidebar-primary` (sidebar selection) follow it |
117
+ | `--sidebar-primary-foreground` | Text on the sidebar selection |
118
+ | `--foreground`, `--background` | Text, the page, the default `Button` (`bg-foreground text-background`) |
119
+ | `--primary`, `--primary-foreground` | `Progress`, `Slider`, `Calendar` selection, menu row tint, default selection |
120
+ | `--kortix-green`, `--kortix-orange`, `--destructive` | Success, warning, error tones |
121
+ | `--radius`, `--font-sans-system` | Radius, font stack |
122
+
123
+ `apps/whitelabel-demo/src/app/globals.css` is the reference: it sets
124
+ `--kortix-blue` and `--ring` to its brand.
125
+
126
+ ## Known issues
127
+
128
+ - React 19: npm prints `ERESOLVE overriding peer dependency` for `cmdk@0.2.1`
129
+ (React 18 peer) and nests `@radix-ui/react-dialog@1.0.0` under it. The install
130
+ succeeds. A host with `strict-peer-dependencies` must allow it. `cmdk` 1.x
131
+ changes the selection model `command.tsx` is tuned to, and `apps/web` imports
132
+ `cmdk` directly, so the upgrade is its own change.
133
+
134
+ ## Rules
135
+
136
+ - Values: the `kortix-brand` skill (`.agents/skills/kortix-brand/SKILL.md`).
137
+ The generator is `.agents/skills/kortix-brand/scripts/generate-tokens.ts`.
138
+ - Components: the `kortix-design-system` skill.
139
+ - Imports inside the package are relative. Never import `apps/web` code.
140
+ - Edit a component here, never its `apps/web` shim. A shim is only
141
+ `export * from '@kortix/ui/<name>'` (plus `'use client'` and the default
142
+ re-export when the component has them).
143
+ - `package.json` `exports` is generated: `pnpm --filter @kortix/ui gen-exports`.
144
+ `src/exports.test.ts` fails on drift and on an export target that does not exist.
145
+ - `src/styles/tokens.css`, `src/styles/fonts.css` and the `theme` region of
146
+ `src/styles/theme.css` are generated. `dist/styles.css` is built. Never edit them by hand.
147
+
148
+ ## Checks
149
+
150
+ ```sh
151
+ pnpm --filter @kortix/ui typecheck
152
+ pnpm --filter @kortix/ui test src/exports.test.ts # exports map, targets, dist/styles.css drift
153
+ pnpm --filter @kortix/ui test src/skill.test.ts # skill names every barrel export; managed copy identical
154
+ bun .agents/skills/kortix-brand/scripts/generate-tokens.ts --check
155
+ .agents/skills/kortix-brand/scripts/audit.sh packages/ui/src
156
+ ```
@@ -0,0 +1,341 @@
1
+ // ../shared/src/utils/chalk-colors.ts
2
+ function hashLabel(seed) {
3
+ let hash = 0;
4
+ for (let i = 0; i < seed.length; i++) {
5
+ hash = hash * 31 + seed.charCodeAt(i) | 0;
6
+ }
7
+ return Math.abs(hash);
8
+ }
9
+ function chalkColors(label) {
10
+ const hash = hashLabel(label || "?");
11
+ const hue = hash % 360;
12
+ const sat = 35 + hash % 12;
13
+ const lift = (hash >> 3) % 10;
14
+ return {
15
+ background: `hsl(${hue} ${sat}% ${77 + lift}%)`,
16
+ foreground: `hsl(${hue} ${Math.min(sat + 10, 82)}% 27%)`,
17
+ border: `hsl(${hue} ${sat}% ${65 + lift}%)`
18
+ };
19
+ }
20
+ var AVATAR_FILLS = [
21
+ "hsl(220 8% 50%)",
22
+ "hsl(4 46% 53%)",
23
+ "hsl(24 60% 46%)",
24
+ "hsl(46 62% 37%)",
25
+ "hsl(84 42% 37%)",
26
+ "hsl(212 46% 50%)",
27
+ "hsl(275 34% 56%)",
28
+ "hsl(318 40% 52%)"
29
+ ];
30
+ var AVATAR_INK = "hsl(0 0% 100%)";
31
+ function avatarFill(seed) {
32
+ return AVATAR_FILLS[hashLabel(seed.trim().toLowerCase() || "?") % AVATAR_FILLS.length];
33
+ }
34
+
35
+ // ../shared/src/project-glyphs.ts
36
+ var PROJECT_GLYPH_GROUPS = [
37
+ {
38
+ label: "Objects",
39
+ names: [
40
+ "Trash",
41
+ "ShoppingCart",
42
+ "Package",
43
+ "Briefcase",
44
+ "Gift",
45
+ "Lightbulb",
46
+ "Wrench",
47
+ "Hammer",
48
+ "Key",
49
+ "Lock",
50
+ "Umbrella",
51
+ "Trophy"
52
+ ]
53
+ },
54
+ {
55
+ label: "Shapes",
56
+ names: [
57
+ "Circle",
58
+ "Square",
59
+ "Triangle",
60
+ "Diamond",
61
+ "Hexagon",
62
+ "Star",
63
+ "Heart",
64
+ "Lightning",
65
+ "Spade",
66
+ "Club",
67
+ "Cube",
68
+ "Polygon"
69
+ ]
70
+ },
71
+ {
72
+ label: "Files",
73
+ names: [
74
+ "File",
75
+ "FileText",
76
+ "Folder",
77
+ "FolderOpen",
78
+ "Note",
79
+ "Book",
80
+ "Newspaper",
81
+ "Paperclip",
82
+ "Archive",
83
+ "Notebook",
84
+ "Files",
85
+ "FolderPlus"
86
+ ]
87
+ },
88
+ {
89
+ label: "Actions",
90
+ names: [
91
+ "Plus",
92
+ "Minus",
93
+ "Copy",
94
+ "Check",
95
+ "X",
96
+ "Pencil",
97
+ "Bookmark",
98
+ "Eraser",
99
+ "Scissors",
100
+ "LinkSimple",
101
+ "ShareNetwork",
102
+ "Clipboard"
103
+ ]
104
+ },
105
+ {
106
+ label: "Arrows",
107
+ names: [
108
+ "ArrowUp",
109
+ "ArrowDown",
110
+ "ArrowLeft",
111
+ "ArrowRight",
112
+ "ArrowsClockwise",
113
+ "ArrowSquareOut",
114
+ "TrendUp",
115
+ "TrendDown",
116
+ "ArrowsLeftRight",
117
+ "ArrowUUpLeft",
118
+ "ArrowsOut",
119
+ "ArrowsIn"
120
+ ]
121
+ },
122
+ {
123
+ label: "Tech",
124
+ names: [
125
+ "Code",
126
+ "Terminal",
127
+ "Database",
128
+ "Cloud",
129
+ "Cpu",
130
+ "Bug",
131
+ "GitBranch",
132
+ "Rocket",
133
+ "Monitor",
134
+ "DeviceMobile",
135
+ "Keyboard",
136
+ "Robot"
137
+ ]
138
+ },
139
+ {
140
+ label: "Nature",
141
+ names: [
142
+ "Leaf",
143
+ "Tree",
144
+ "Sun",
145
+ "Moon",
146
+ "Drop",
147
+ "Fire",
148
+ "Mountains",
149
+ "Planet",
150
+ "Flower",
151
+ "Cactus",
152
+ "Snowflake",
153
+ "Rainbow"
154
+ ]
155
+ },
156
+ {
157
+ label: "Symbols",
158
+ names: [
159
+ "Hash",
160
+ "At",
161
+ "Percent",
162
+ "Asterisk",
163
+ "Question",
164
+ "Warning",
165
+ "Info",
166
+ "Bell",
167
+ "Crown",
168
+ "Flag",
169
+ "Medal",
170
+ "Sparkle"
171
+ ]
172
+ },
173
+ {
174
+ label: "Food",
175
+ names: [
176
+ "Carrot",
177
+ "Pizza",
178
+ "Hamburger",
179
+ "IceCream",
180
+ "Coffee",
181
+ "BeerStein",
182
+ "Cookie",
183
+ "Cake",
184
+ "Egg",
185
+ "Bread",
186
+ "Wine",
187
+ "Martini"
188
+ ]
189
+ },
190
+ {
191
+ label: "Animals",
192
+ names: [
193
+ "Dog",
194
+ "Cat",
195
+ "Bird",
196
+ "Butterfly",
197
+ "Rabbit",
198
+ "Horse",
199
+ "Cow",
200
+ "PawPrint",
201
+ "Fish",
202
+ "Shrimp",
203
+ "Feather",
204
+ "Bone"
205
+ ]
206
+ },
207
+ {
208
+ label: "Transport",
209
+ names: [
210
+ "Car",
211
+ "Bus",
212
+ "Truck",
213
+ "Train",
214
+ "Airplane",
215
+ "Bicycle",
216
+ "Motorcycle",
217
+ "Boat",
218
+ "Scooter",
219
+ "Taxi",
220
+ "Van",
221
+ "Jeep"
222
+ ]
223
+ },
224
+ {
225
+ label: "People",
226
+ names: [
227
+ "User",
228
+ "Users",
229
+ "Smiley",
230
+ "SmileyMeh",
231
+ "SmileySad",
232
+ "Ghost",
233
+ "Alien",
234
+ "Baby",
235
+ "PersonSimpleRun",
236
+ "Hand",
237
+ "ThumbsUp",
238
+ "Eye"
239
+ ]
240
+ },
241
+ {
242
+ label: "Music",
243
+ names: [
244
+ "MusicNote",
245
+ "MusicNotes",
246
+ "Guitar",
247
+ "Microphone",
248
+ "SpeakerHigh",
249
+ "Radio",
250
+ "Playlist",
251
+ "Metronome",
252
+ "Waveform",
253
+ "Disc",
254
+ "Headphones",
255
+ "Equalizer"
256
+ ]
257
+ },
258
+ {
259
+ label: "Sport",
260
+ names: [
261
+ "Basketball",
262
+ "Football",
263
+ "SoccerBall",
264
+ "Baseball",
265
+ "TennisBall",
266
+ "Barbell",
267
+ "Target",
268
+ "Golf",
269
+ "Volleyball",
270
+ "PingPong",
271
+ "Racquet",
272
+ "PersonSimpleSwim"
273
+ ]
274
+ },
275
+ {
276
+ label: "Money",
277
+ names: [
278
+ "CurrencyDollar",
279
+ "Wallet",
280
+ "CreditCard",
281
+ "PiggyBank",
282
+ "Coins",
283
+ "Receipt",
284
+ "Bank",
285
+ "ChartLine",
286
+ "Tag",
287
+ "ChartBar",
288
+ "ChartPie",
289
+ "Handshake"
290
+ ]
291
+ },
292
+ {
293
+ label: "Care",
294
+ names: [
295
+ "CloudRain",
296
+ "CloudSnow",
297
+ "CloudLightning",
298
+ "Wind",
299
+ "Thermometer",
300
+ "Sunglasses",
301
+ "Heartbeat",
302
+ "Pill",
303
+ "FirstAid",
304
+ "Syringe",
305
+ "Bandaids",
306
+ "Stethoscope"
307
+ ]
308
+ },
309
+ {
310
+ label: "Numbers",
311
+ names: [
312
+ "NumberCircleZero",
313
+ "NumberCircleOne",
314
+ "NumberCircleTwo",
315
+ "NumberCircleThree",
316
+ "NumberCircleFour",
317
+ "NumberCircleFive",
318
+ "NumberCircleSix",
319
+ "NumberCircleSeven",
320
+ "NumberCircleEight",
321
+ "NumberCircleNine"
322
+ ]
323
+ }
324
+ ];
325
+ var PROJECT_GLYPH_NAMES = PROJECT_GLYPH_GROUPS.flatMap(
326
+ (group) => group.names
327
+ );
328
+ var PROJECT_GLYPH_COLORS = [
329
+ "grey",
330
+ "red",
331
+ "orange",
332
+ "yellow",
333
+ "lime",
334
+ "blue",
335
+ "purple",
336
+ "magenta"
337
+ ];
338
+ new Set(PROJECT_GLYPH_NAMES);
339
+ new Set(PROJECT_GLYPH_COLORS);
340
+
341
+ export { AVATAR_INK, PROJECT_GLYPH_COLORS, PROJECT_GLYPH_NAMES, avatarFill, chalkColors };
@@ -0,0 +1,8 @@
1
+ import type { Agent } from '@kortix/sdk';
2
+ export declare function AgentPicker({ agents, value, onChange, defaultName, }: {
3
+ agents: readonly Agent[];
4
+ value: string | null;
5
+ onChange: (name: string | null) => void;
6
+ /** The project's configured default agent, shown when nothing is picked. */
7
+ defaultName?: string | null;
8
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,18 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * Agent picker, controlled, over `session.agents`. `value` is the agent name,
5
+ * or null for the project's default agent. Send passes the pick as `options.agent`.
6
+ */
7
+ import { CaretUpDownIcon, CheckIcon, RobotIcon } from '@phosphor-icons/react';
8
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from '../components/ui/dropdown-menu.js';
9
+ import { MENU_INDICATOR, MENU_INDICATOR_ICON } from '../components/ui/menu-recipe.js';
10
+ import { useUiStrings } from '../providers/ui-provider.js';
11
+ const TRIGGER = 'text-muted-foreground hover:text-foreground h-7 max-w-40 min-w-0 gap-1 px-2 text-xs';
12
+ export function AgentPicker({ agents, value, onChange, defaultName, }) {
13
+ const t = useUiStrings().chat;
14
+ if (agents.length === 0)
15
+ return null;
16
+ const check = (on) => (_jsx("span", { className: MENU_INDICATOR, children: on && _jsx(CheckIcon, { className: MENU_INDICATOR_ICON }) }));
17
+ return (_jsxs(DropdownMenu, { children: [_jsxs(DropdownMenuTrigger, { variant: "transparent", className: TRIGGER, "aria-label": t.agent, children: [_jsx(RobotIcon, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "truncate capitalize", children: value ?? defaultName ?? t.defaultAgent }), _jsx(CaretUpDownIcon, { className: "size-3 shrink-0" })] }), _jsxs(DropdownMenuContent, { align: "start", className: "w-60", children: [_jsxs(DropdownMenuItem, { onSelect: () => onChange(null), children: [_jsx("span", { className: "flex-1 capitalize", children: defaultName ? t.defaultAgentNamed(defaultName) : t.defaultAgent }), check(!value)] }), agents.map((a) => (_jsxs(DropdownMenuItem, { onSelect: () => onChange(a.name), className: "items-start", children: [_jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate capitalize", children: a.name }), a.description && _jsx("span", { className: "text-muted-foreground block truncate text-xs", children: a.description })] }), check(value === a.name)] }, a.name)))] })] }));
18
+ }
@@ -0,0 +1,31 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type ChatErrorHandler } from './permission-prompt.js';
3
+ export type ComposerCommand = {
4
+ name: string;
5
+ description?: string | null;
6
+ };
7
+ /** The "/token" being typed (no space yet), lower-cased, or null. */
8
+ export declare function slashQuery(value: string): string | null;
9
+ /** A "/name args" line whose name is a known command, else null (send it as text). */
10
+ export declare function parseCommand(text: string, commands: readonly ComposerCommand[]): {
11
+ name: string;
12
+ args: string;
13
+ } | null;
14
+ export declare function Composer({ onSend, onStop, busy, canStop, disabled, placeholder, toolbar, footer, commands, onCommand, onError, }: {
15
+ onSend: (text: string) => void;
16
+ onStop: () => void;
17
+ busy: boolean;
18
+ /** False hides Stop (a shared session where this viewer may not stop the turn). */
19
+ canStop?: boolean;
20
+ disabled?: boolean;
21
+ /** Default: `strings.chat.placeholder`. */
22
+ placeholder?: string;
23
+ toolbar?: ReactNode;
24
+ /** Rendered under the input card. */
25
+ footer?: ReactNode;
26
+ commands?: readonly ComposerCommand[];
27
+ /** Runs a slash command. A rejection restores the typed line and reports the error. */
28
+ onCommand?: (name: string, args: string) => void | Promise<void>;
29
+ /** Reports a refused command (for a toast). Without it the composer shows the error inline. */
30
+ onError?: ChatErrorHandler;
31
+ }): import("react").JSX.Element;
@@ -0,0 +1,114 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * The chat input card. Enter sends, Shift+Enter adds a line. Typing "/" opens
5
+ * the project's command menu (`session.commands`); a sent "/cmd args" line
6
+ * whose name is a known command runs `onCommand` instead of a text prompt.
7
+ * A refused command is never silent: the typed line comes back into the
8
+ * input and the error goes to `onError`, or shows inline when there is none.
9
+ * While the agent is busy the send button becomes Stop.
10
+ *
11
+ * `toolbar` sits in the card's control row (model and agent pickers).
12
+ * `footer` sits under the card: read-only facts about the session, which
13
+ * would read as send-time options inside the control row.
14
+ */
15
+ import { ArrowUpIcon, StopIcon, WarningCircleIcon } from '@phosphor-icons/react';
16
+ import { useMemo, useRef, useState } from 'react';
17
+ import { Button } from '../components/ui/button.js';
18
+ import { InfoBanner } from '../components/ui/info-banner.js';
19
+ import { FLOATING_PANEL_SURFACE, menuRow } from '../components/ui/menu-recipe.js';
20
+ import { Textarea } from '../components/ui/textarea.js';
21
+ import { cn } from '../lib/utils.js';
22
+ import { useUiStrings } from '../providers/ui-provider.js';
23
+ import { errorMessage } from './permission-prompt.js';
24
+ /** The "/token" being typed (no space yet), lower-cased, or null. */
25
+ export function slashQuery(value) {
26
+ const m = value.match(/^\/(\S*)$/);
27
+ return m ? m[1].toLowerCase() : null;
28
+ }
29
+ /** A "/name args" line whose name is a known command, else null (send it as text). */
30
+ export function parseCommand(text, commands) {
31
+ const m = text.match(/^\/(\S+)(?:\s+([\s\S]*))?$/);
32
+ if (!m || !commands.some((c) => c.name === m[1]))
33
+ return null;
34
+ return { name: m[1], args: (m[2] ?? '').trim() };
35
+ }
36
+ export function Composer({ onSend, onStop, busy, canStop = true, disabled, placeholder, toolbar, footer, commands, onCommand, onError, }) {
37
+ const t = useUiStrings().chat;
38
+ const [value, setValue] = useState('');
39
+ const [dismissed, setDismissed] = useState(false);
40
+ const [highlight, setHighlight] = useState(0);
41
+ const [commandError, setCommandError] = useState(null);
42
+ const ref = useRef(null);
43
+ const query = slashQuery(value);
44
+ const matches = useMemo(() => {
45
+ if (query === null || !commands?.length || !onCommand)
46
+ return [];
47
+ return commands.filter((c) => c.name.toLowerCase().includes(query)).slice(0, 8);
48
+ }, [query, commands, onCommand]);
49
+ const menuOpen = matches.length > 0 && !dismissed;
50
+ const setText = (next) => {
51
+ setValue(next);
52
+ setDismissed(false);
53
+ setHighlight(0);
54
+ };
55
+ const pickCommand = (name) => {
56
+ setText(`/${name} `);
57
+ ref.current?.focus();
58
+ };
59
+ const runCommand = async (text, name, args) => {
60
+ try {
61
+ await onCommand?.(name, args);
62
+ }
63
+ catch (err) {
64
+ // Give the line back unless the user already typed a new one.
65
+ setValue((current) => (current === '' ? text : current));
66
+ const message = errorMessage(err, t.commandFailed);
67
+ if (onError)
68
+ onError(message, err);
69
+ else
70
+ setCommandError(message);
71
+ }
72
+ };
73
+ const submit = () => {
74
+ const text = value.trim();
75
+ if (!text || disabled)
76
+ return;
77
+ setCommandError(null);
78
+ const command = onCommand ? parseCommand(text, commands ?? []) : null;
79
+ // Clear at once: a command's request can last the whole turn.
80
+ setText('');
81
+ if (command)
82
+ void runCommand(text, command.name, command.args);
83
+ else
84
+ onSend(text);
85
+ };
86
+ return (_jsxs("div", { "data-slot": "composer", className: "relative", children: [commandError && (_jsx(InfoBanner, { tone: "destructive", icon: WarningCircleIcon, title: t.commandFailed, className: "mb-2", role: "alert", children: commandError })), menuOpen && (_jsxs("div", { role: "listbox", "aria-label": t.commands, className: cn(FLOATING_PANEL_SURFACE, 'absolute bottom-full left-0 z-20 mb-2 w-72 overflow-hidden'), children: [_jsx("div", { className: "border-border text-muted-foreground border-b px-3 py-1.5 text-xs", children: t.commands }), _jsx("div", { className: "scrollbar-thin max-h-64 overflow-y-auto p-1", children: matches.map((c, i) => (_jsxs("button", { type: "button", role: "option", "aria-selected": i === highlight, "data-highlighted": i === highlight ? '' : undefined, onMouseEnter: () => setHighlight(i), onClick: () => pickCommand(c.name), className: menuRow('sm', 'default', 'items-start text-left'), children: [_jsx("span", { className: "text-muted-foreground w-4 shrink-0 text-center font-mono", children: "/" }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate", children: c.name }), c.description && (_jsx("span", { className: "text-muted-foreground block truncate text-xs", children: c.description }))] })] }, c.name))) })] })), _jsxs("div", { className: cn('border-border bg-popover focus-within:border-ring rounded-lg border transition-colors motion-reduce:transition-none', disabled && 'opacity-70'), children: [_jsx(Textarea, { ref: ref, rows: 1, minHeight: 35, maxHeight: 200, value: value, disabled: disabled, placeholder: placeholder ?? t.placeholder, "aria-label": t.message, onChange: (e) => setText(e.target.value), onKeyDown: (e) => {
87
+ if (e.nativeEvent.isComposing)
88
+ return;
89
+ if (menuOpen) {
90
+ if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
91
+ e.preventDefault();
92
+ const step = e.key === 'ArrowDown' ? 1 : -1;
93
+ setHighlight((h) => Math.min(Math.max(h + step, 0), matches.length - 1));
94
+ return;
95
+ }
96
+ if (e.key === 'Enter' || e.key === 'Tab') {
97
+ e.preventDefault();
98
+ pickCommand((matches[highlight] ?? matches[0]).name);
99
+ return;
100
+ }
101
+ if (e.key === 'Escape') {
102
+ e.preventDefault();
103
+ setDismissed(true);
104
+ return;
105
+ }
106
+ }
107
+ if (e.key === 'Enter' && !e.shiftKey) {
108
+ e.preventDefault();
109
+ // No new turn while the agent is busy: the visible control is Stop.
110
+ if (!busy)
111
+ submit();
112
+ }
113
+ }, className: "scrollbar-thin border-0 bg-transparent px-3.5 pt-3 leading-relaxed focus:ring-0" }), _jsxs("div", { className: "flex items-center justify-between gap-2 px-2 pt-1 pb-2", children: [_jsx("div", { className: "min-w-0", children: toolbar }), busy && canStop ? (_jsx(Button, { size: "icon-base", variant: "secondary", onClick: onStop, "aria-label": t.stop, className: "rounded-full", children: _jsx(StopIcon, { weight: "fill", className: "size-3.5" }) })) : (_jsx(Button, { size: "icon-base", onClick: submit, disabled: busy || !value.trim() || disabled, "aria-label": t.send, className: "rounded-full", children: _jsx(ArrowUpIcon, { className: "size-4" }) }))] })] }), footer] }));
114
+ }