@kortix/ui 0.0.0-stage → 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 +155 -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 +881 -4
  416. package/skills/kortix-ui/SKILL.md +150 -0
@@ -0,0 +1,91 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cn } from '../../lib/utils.js';
4
+ import React from 'react';
5
+ /**
6
+ * The sweep, as native CSS `@keyframes` rather than a per-frame Motion
7
+ * (`motion/react`) animation.
8
+ *
9
+ * `backgroundPosition` is not compositor-animatable — every frame forces a
10
+ * style recalc and a `bg-clip-text` repaint either way, JS-driven or not.
11
+ * The cost this removes is the JS side of it: the old version drove the
12
+ * sweep with `animate={{ backgroundPosition }}` + `repeat: Infinity`, which
13
+ * is a `requestAnimationFrame` loop running Motion's interpolation and a
14
+ * React-visible style write on every single frame, for as long as the
15
+ * shimmer stays mounted. A running burst mounts several at once (the
16
+ * summary line, every running group row, every live "Thinking" row, the
17
+ * chat's own busy line) — that is several rAF loops competing with the
18
+ * turn's own SSE-driven re-renders for the same main-thread frame budget,
19
+ * forever, while nothing about the text is even changing.
20
+ *
21
+ * A CSS animation is scheduled by the browser's style/animation engine, not
22
+ * by application JS: no rAF callback, no Motion interpolation, no
23
+ * React-visible write, on every frame this component is visible. Steady
24
+ * state (nothing streaming, a burst just sitting open) goes from N
25
+ * `requestAnimationFrame` callbacks per shimmer per frame to zero JS.
26
+ *
27
+ * `kx-shimmer-sweep-hold` reproduces the old `repeatDelay: 0.5` pause
28
+ * between loops (infinite case) as an 80/20 split of the animation's own
29
+ * duration — the sweep finishes at the 80% mark, then holds until 100%.
30
+ * Driving `animation-duration` at `duration / 0.8` puts the sweep itself at
31
+ * exactly `duration` seconds (80% of `duration / 0.8` is `duration`), and
32
+ * the hold scales proportionally with it (`duration * 0.25`). For the
33
+ * default `duration={2}` every caller but two uses, that hold is 0.5s —
34
+ * an exact match. CSS keyframe percentages cannot express a duration-
35
+ * independent flat 0.5s without a separate stylesheet per `duration` value,
36
+ * and a hold that scales with sweep speed reads the same as a fixed one at
37
+ * the 1s/2.2s durations this component is actually called with.
38
+ * `kx-shimmer-sweep` (no hold) backs the finite-`repeat` case, matching the
39
+ * old transition's `repeatDelay: 0` there.
40
+ *
41
+ * These keyframes are scoped to this file via an inline `<style>` — the
42
+ * same technique `components/ui/chart.tsx` already uses for component-local
43
+ * CSS — because `globals.css` is out of scope for this change and this
44
+ * codebase has no CSS Modules precedent (`bun test` has no loader for
45
+ * `.css` imports, so a `.module.css` file would break every test that
46
+ * imports this component). The tag is a static string, so every instance
47
+ * renders the identical bytes; the DOM tolerates duplicate `<style>`
48
+ * content fine, and it costs a one-time parse per mount, not a per-frame
49
+ * cost — nothing like the loop it replaces.
50
+ */
51
+ const SHIMMER_STYLE = `
52
+ @keyframes kx-shimmer-sweep {
53
+ from { background-position: 100% center; }
54
+ to { background-position: 0% center; }
55
+ }
56
+ @keyframes kx-shimmer-sweep-hold {
57
+ 0% { background-position: 100% center; }
58
+ 80% { background-position: 0% center; }
59
+ 100% { background-position: 0% center; }
60
+ }
61
+ @media (prefers-reduced-motion: reduce) {
62
+ [data-kx-text-shimmer] {
63
+ animation: none !important;
64
+ background-image: none !important;
65
+ color: var(--base-color) !important;
66
+ -webkit-text-fill-color: var(--base-color) !important;
67
+ }
68
+ }
69
+ `;
70
+ function TextShimmerComponent({ children, as: Component = 'span', className, duration = 2, spread = 2, repeat = Infinity, }) {
71
+ const dynamicSpread = children.length * spread;
72
+ const infinite = repeat === Infinity;
73
+ // `React.ElementType` resolves too broadly for JSX to infer a concrete
74
+ // props type from (TS collapses `children`/`style` to `never`) — the old
75
+ // code sidestepped this by handing `Component` to `m.create`, which returns
76
+ // a properly-typed Motion component. There is no Motion component to ask
77
+ // for that anymore, so the tag itself is cast to accept the fixed, known
78
+ // set of props this file actually passes it.
79
+ const Tag = Component;
80
+ return (_jsxs(Tag, { "data-kx-text-shimmer": "", className: cn('relative inline-block bg-[length:250%_100%,auto] bg-clip-text', 'text-transparent [--base-color:#a1a1aa] [--base-gradient-color:#000]', '[background-repeat:no-repeat,padding-box] [--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--base-gradient-color),#0000_calc(50%+var(--spread)))]', 'text-sm dark:[--base-color:#71717a] dark:[--base-gradient-color:#ffffff] dark:[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--base-gradient-color),#0000_calc(50%+var(--spread)))]', className), style: {
81
+ '--spread': `${dynamicSpread}px`,
82
+ backgroundImage: `var(--bg), linear-gradient(var(--base-color), var(--base-color))`,
83
+ backgroundPosition: '100% center',
84
+ animationName: infinite ? 'kx-shimmer-sweep-hold' : 'kx-shimmer-sweep',
85
+ animationDuration: `${infinite ? duration / 0.8 : duration}s`,
86
+ animationTimingFunction: 'linear',
87
+ animationIterationCount: infinite ? 'infinite' : repeat,
88
+ animationFillMode: infinite ? 'none' : 'forwards',
89
+ }, children: [children, _jsx("style", { children: SHIMMER_STYLE })] }));
90
+ }
91
+ export const TextShimmer = React.memo(TextShimmerComponent);
@@ -0,0 +1,33 @@
1
+ import * as React from 'react';
2
+ interface UseAutosizeTextAreaProps {
3
+ textAreaRef: React.MutableRefObject<HTMLTextAreaElement | null>;
4
+ minHeight?: number;
5
+ maxHeight?: number;
6
+ triggerAutoSize: string;
7
+ }
8
+ export declare const useAutosizeTextArea: ({ textAreaRef, triggerAutoSize, maxHeight, minHeight, }: UseAutosizeTextAreaProps) => void;
9
+ export type AutosizeTextAreaRef = {
10
+ textArea: HTMLTextAreaElement;
11
+ maxHeight: number;
12
+ minHeight: number;
13
+ focus: () => void;
14
+ };
15
+ export type AutosizeTextAreaProps = {
16
+ maxHeight?: number;
17
+ minHeight?: number;
18
+ /**
19
+ * @deprecated Every textarea renders the same surface as `Input`. Kept so
20
+ * existing callers compile; the value is ignored.
21
+ */
22
+ variant?: 'default' | 'secondary' | 'outline' | 'accent';
23
+ } & React.TextareaHTMLAttributes<HTMLTextAreaElement>;
24
+ export declare const Textarea: React.ForwardRefExoticComponent<{
25
+ maxHeight?: number;
26
+ minHeight?: number;
27
+ /**
28
+ * @deprecated Every textarea renders the same surface as `Input`. Kept so
29
+ * existing callers compile; the value is ignored.
30
+ */
31
+ variant?: "default" | "secondary" | "outline" | "accent";
32
+ } & React.TextareaHTMLAttributes<HTMLTextAreaElement> & React.RefAttributes<AutosizeTextAreaRef>>;
33
+ export {};
@@ -0,0 +1,87 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { inputFocusClasses, inputInvalidClasses, inputSurfaceClasses, inputTransitionClasses, } from './input.js';
4
+ import { cn } from '../../lib/utils.js';
5
+ import * as React from 'react';
6
+ import { useImperativeHandle } from 'react';
7
+ export const useAutosizeTextArea = ({ textAreaRef, triggerAutoSize, maxHeight = Number.MAX_SAFE_INTEGER, minHeight = 0, }) => {
8
+ const [init, setInit] = React.useState(true);
9
+ const [currentHeight, setCurrentHeight] = React.useState(minHeight);
10
+ const previousContentRef = React.useRef(triggerAutoSize);
11
+ const resizeTimeoutRef = React.useRef(null);
12
+ React.useEffect(() => {
13
+ const offsetBorder = 6;
14
+ const textAreaElement = textAreaRef.current;
15
+ if (!textAreaElement)
16
+ return;
17
+ if (init) {
18
+ textAreaElement.style.minHeight = `${minHeight + offsetBorder}px`;
19
+ if (maxHeight > minHeight) {
20
+ textAreaElement.style.maxHeight = `${maxHeight}px`;
21
+ }
22
+ setInit(false);
23
+ }
24
+ if (resizeTimeoutRef.current) {
25
+ clearTimeout(resizeTimeoutRef.current);
26
+ }
27
+ resizeTimeoutRef.current = setTimeout(() => {
28
+ const contentLengthChanged = Math.abs(previousContentRef.current.length - triggerAutoSize.length) > 5;
29
+ const contentIsEmpty = triggerAutoSize.trim() === '';
30
+ if (!contentLengthChanged && !contentIsEmpty && !init) {
31
+ return;
32
+ }
33
+ const scrollTop = textAreaElement.scrollTop;
34
+ textAreaElement.style.height = `${minHeight + offsetBorder}px`;
35
+ const isEmpty = triggerAutoSize.trim() === '';
36
+ const scrollHeight = textAreaElement.scrollHeight;
37
+ let newHeight;
38
+ if (isEmpty) {
39
+ newHeight = minHeight + offsetBorder;
40
+ }
41
+ else if (scrollHeight > maxHeight) {
42
+ newHeight = maxHeight;
43
+ }
44
+ else {
45
+ newHeight = scrollHeight + offsetBorder;
46
+ }
47
+ if (Math.abs(newHeight - currentHeight) > 10) {
48
+ textAreaElement.style.height = `${newHeight}px`;
49
+ setCurrentHeight(newHeight);
50
+ }
51
+ else {
52
+ textAreaElement.style.height = `${currentHeight}px`;
53
+ }
54
+ textAreaElement.scrollTop = scrollTop;
55
+ previousContentRef.current = triggerAutoSize;
56
+ }, 100);
57
+ return () => {
58
+ if (resizeTimeoutRef.current) {
59
+ clearTimeout(resizeTimeoutRef.current);
60
+ }
61
+ };
62
+ }, [textAreaRef.current, triggerAutoSize, minHeight, maxHeight, currentHeight, init]);
63
+ };
64
+ export const Textarea = React.forwardRef(({ maxHeight = Number.MAX_SAFE_INTEGER, minHeight = 52, className, onChange, value, variant: _variant, ...props }, ref) => {
65
+ const textAreaRef = React.useRef(null);
66
+ const [triggerAutoSize, setTriggerAutoSize] = React.useState('');
67
+ useAutosizeTextArea({
68
+ textAreaRef,
69
+ triggerAutoSize: triggerAutoSize,
70
+ maxHeight,
71
+ minHeight,
72
+ });
73
+ useImperativeHandle(ref, () => ({
74
+ textArea: textAreaRef.current,
75
+ focus: () => textAreaRef?.current?.focus(),
76
+ maxHeight,
77
+ minHeight,
78
+ }));
79
+ React.useEffect(() => {
80
+ setTriggerAutoSize(value || '');
81
+ }, [props?.defaultValue, value]);
82
+ return (_jsx("textarea", { ...props, value: value, ref: textAreaRef, className: cn(inputSurfaceClasses, inputFocusClasses, inputInvalidClasses, inputTransitionClasses, 'text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex w-full resize-none px-3 py-2 text-sm font-medium disabled:cursor-not-allowed disabled:opacity-50', className), onChange: (e) => {
83
+ setTriggerAutoSize(e.target.value);
84
+ onChange?.(e);
85
+ } }));
86
+ });
87
+ Textarea.displayName = 'Textarea';
@@ -0,0 +1,105 @@
1
+ import * as React from 'react';
2
+ /** The toast host. Mount it once at the app root; every toast below renders into it. */
3
+ export { Toaster } from 'sonner';
4
+ /** A text-link action under the toast body. A click dismisses the toast first. */
5
+ export type ToastAction = {
6
+ label: string;
7
+ onClick: () => void;
8
+ };
9
+ type ToastOptions = {
10
+ description?: string;
11
+ duration?: number;
12
+ id?: string | number;
13
+ position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | 'top-center' | 'bottom-center';
14
+ /** Text links under the body, joined by a dot. */
15
+ actions?: ToastAction[];
16
+ /**
17
+ * The thing the toast is about. Its name is the line under the title; its
18
+ * icon (a trigger's clock, say) becomes the leading tile, with the status
19
+ * glyph as a badge on its corner.
20
+ */
21
+ entity?: {
22
+ icon?: React.ReactNode;
23
+ label: string;
24
+ };
25
+ /** Muted text after the actions, on the same line. */
26
+ meta?: string;
27
+ /** One line, no close button, as wide as its text. For "Copied"-style confirmations. */
28
+ compact?: boolean;
29
+ /** Legacy: a free-form node under the body. Prefer `actions`. */
30
+ button?: React.ReactNode;
31
+ };
32
+ type LoadingToastOptions<T = unknown> = ToastOptions & {
33
+ success?: string | ((data: T) => string);
34
+ error?: string | ((error: unknown) => string);
35
+ showErrorToast?: boolean;
36
+ };
37
+ export type ToastVariant = 'success' | 'progress' | 'error' | 'info' | 'warning';
38
+ /** The leading glyph of each variant. `loadingToast` uses `progress`. */
39
+ export declare const toastIcon: (variant: ToastVariant) => React.ReactNode;
40
+ /** The small muted × every dismissible toast carries. */
41
+ export declare function ToastClose({ onDismiss, className }: {
42
+ onDismiss: () => void;
43
+ className?: string;
44
+ }): React.JSX.Element;
45
+ /**
46
+ * Where the badge's colour reaches on the icon. Paper board "04 · Badge glow",
47
+ * V1 rim reflection, pushed further on request: the colour holds solid to
48
+ * 7.2px from the badge's centre and fades out by 16px, so it climbs the
49
+ * clock's right side and runs along its bottom. Centred on the badge: an 11px badge at -right-0.75 /
50
+ * -bottom-0.75 sits on the icon's diagonal at 85% / 85%, the board's 18.5/24.
51
+ * The badge is 0.72x the clock's radius, as on the board, so it leaves the
52
+ * rim it lights visible.
53
+ */
54
+ export declare const REFLECTION_MASK = "radial-gradient(circle 16px at 85% 85%, #000 45%, transparent 100%)";
55
+ /**
56
+ * The toast card itself. `renderToast` mounts it through sonner; the session
57
+ * notifications mount it through `customToast`.
58
+ */
59
+ export declare function ToastCard({ message, icon, variant, options, onDismiss, }: {
60
+ message: string;
61
+ icon: React.ReactNode;
62
+ /** The status, for the colour an entity icon reflects from its badge. */
63
+ variant?: ToastVariant;
64
+ options?: Pick<ToastOptions, 'description' | 'button' | 'actions' | 'entity' | 'meta' | 'compact'>;
65
+ onDismiss: () => void;
66
+ }): React.JSX.Element;
67
+ export declare const successToast: (message: string, options?: ToastOptions) => void;
68
+ /** Show or update a loading toast; pass `id` to update an existing toast in place. */
69
+ export declare const progressToast: (message: string, options?: ToastOptions) => string | number;
70
+ export declare const loadingToast: <T>(message: string, promiseInput: Promise<T> | (() => Promise<T>), options?: LoadingToastOptions<T>) => Promise<T>;
71
+ /**
72
+ * Sets the host's rule for error messages that `errorToast` drops without a
73
+ * toast (apps/web drops request-deadline noise). Default: none is dropped.
74
+ * Call it once at module load, before the first toast.
75
+ */
76
+ export declare function setSilentErrorToastFilter(filter: (message: string) => boolean): void;
77
+ export declare const errorToast: (message: string, options?: ToastOptions) => void;
78
+ export declare const infoToast: (message: string, options?: ToastOptions) => void;
79
+ export declare const warningToast: (message: string, options?: ToastOptions) => void;
80
+ /**
81
+ * One-line toast with an Undo key. `undoLabel` is the caller's translated
82
+ * "Undo"; `icon` is an optional muted glyph naming what happened.
83
+ */
84
+ export declare const undoToast: (message: string, options: Pick<ToastOptions, "id" | "position" | "duration"> & {
85
+ undoLabel: string;
86
+ onUndo: () => void;
87
+ icon?: React.ReactNode;
88
+ }) => string | number;
89
+ /**
90
+ * Mount a caller-drawn card through the same toast surface — for notifications
91
+ * whose shape is their own (the session cards). `render` gets the dismiss.
92
+ */
93
+ export declare const customToast: (render: (dismiss: () => void) => React.ReactElement, options: Pick<ToastOptions, "id" | "position" | "duration"> & {
94
+ onClose?: () => void;
95
+ }) => string | number;
96
+ /**
97
+ * Dismiss a toast by the `id` it was created with.
98
+ *
99
+ * Exists so feature code can retract a PERSISTENT toast when the condition it
100
+ * reports goes away — a `duration: Infinity` notice with an action button has to
101
+ * be revocable, or it outlives the problem and offers to fix something already
102
+ * fixed. Wrapped here rather than importing sonner in a feature: this module is
103
+ * the toast surface.
104
+ */
105
+ export declare const dismissToast: (id: string | number) => void;
@@ -0,0 +1,233 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button } from './button.js';
3
+ import Loading from './loading.js';
4
+ import { Close } from '../../icons/close.js';
5
+ import { cn } from '../../lib/utils.js';
6
+ import { WarningCircleIcon } from '@phosphor-icons/react';
7
+ import * as React from 'react';
8
+ import { toast } from 'sonner';
9
+ /** The toast host. Mount it once at the app root; every toast below renders into it. */
10
+ export { Toaster } from 'sonner';
11
+ const getErrorMessage = (error) => {
12
+ if (error instanceof Error)
13
+ return error.message;
14
+ if (typeof error === 'string')
15
+ return error;
16
+ return 'An error occurred';
17
+ };
18
+ const DEFAULT_DURATION = 3000;
19
+ const UNDO_DURATION = 5000;
20
+ const DEFAULT_POSITION = 'bottom-right';
21
+ /** The card every toast sits on: one shape, the smooth `ring-sm` shadow, no border. */
22
+ const CARD = 'bg-background text-foreground smooth-shadow-ring-sm rounded-lg';
23
+ /**
24
+ * Build the data object for `toast.custom`.
25
+ *
26
+ * sonner hands the generated id to our render callback (so the close button can
27
+ * call `toast.dismiss(id)`), but it then spreads `data` over that id. Passing
28
+ * `id: undefined` clobbers it and sonner mints a *different* real id, leaving the
29
+ * close button pointing at a toast that no longer matches — so it never dismisses.
30
+ * Only include `id` when it is actually defined.
31
+ */
32
+ const toastData = (options, duration, isMobile) => ({
33
+ ...(options?.id != null ? { id: options.id } : {}),
34
+ duration,
35
+ position: isMobile ? 'top-center' : options?.position || DEFAULT_POSITION,
36
+ });
37
+ /** A 16px filled status disc. The mark inside is drawn in the card's own color. */
38
+ function Disc({ className, children }) {
39
+ return (
40
+ // overflow-visible: the disc fills the box edge to edge, and size-4 is a
41
+ // fractional 14.72px, so a clipping svg shaves its antialiased rim.
42
+ _jsxs("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: cn('size-4 shrink-0 overflow-visible', className), children: [_jsx("circle", { cx: "8", cy: "8", r: "8", fill: "currentColor" }), _jsx("g", { className: "text-background", stroke: "currentColor", fill: "currentColor", children: children })] }));
43
+ }
44
+ /** The leading glyph of each variant. `loadingToast` uses `progress`. */
45
+ export const toastIcon = (variant) => {
46
+ switch (variant) {
47
+ case 'success':
48
+ return (_jsx(Disc, { className: "text-kortix-green", children: _jsx("path", { d: "M4.8 8.2l2.1 2.1 4.3-4.6", strokeWidth: "1.6", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }) }));
49
+ case 'progress':
50
+ return _jsx(Loading, { variant: "spokes", className: "size-4 shrink-0 overflow-visible" });
51
+ case 'error':
52
+ return (_jsx(Disc, { className: "text-kortix-red", children: _jsx("path", { d: "M5.6 5.6l4.8 4.8M10.4 5.6l-4.8 4.8", strokeWidth: "1.6", strokeLinecap: "round" }) }));
53
+ case 'info':
54
+ return (_jsxs(Disc, { className: "text-foreground", children: [_jsx("circle", { cx: "8", cy: "4.9", r: "0.95", stroke: "none" }), _jsx("path", { d: "M8 7.4v4", strokeWidth: "1.6", strokeLinecap: "round" })] }));
55
+ case 'warning':
56
+ return (_jsx(WarningCircleIcon, { weight: "fill", "aria-hidden": "true", className: "text-kortix-orange size-4 shrink-0 overflow-visible" }));
57
+ }
58
+ };
59
+ /** The small muted × every dismissible toast carries. */
60
+ export function ToastClose({ onDismiss, className }) {
61
+ return (_jsx("button", { type: "button", onClick: onDismiss, "aria-label": "Close notification", className: cn('text-muted-foreground hover:text-foreground flex size-5 shrink-0 items-center justify-center rounded-sm transition-colors', className), children: _jsx(Close, { className: "size-3", "aria-hidden": "true" }) }));
62
+ }
63
+ /** Text links joined by a dot, then optional muted meta. */
64
+ function ToastActions({ actions, meta, onDismiss, }) {
65
+ if (!actions?.length && !meta)
66
+ return null;
67
+ // xs ghost buttons, pulled left by their own padding so the first label
68
+ // lines up with the title.
69
+ return (_jsxs("div", { className: "-ml-2.5 flex items-center gap-0.5 text-xs leading-5", children: [(actions ?? []).map((action) => (_jsx(Button, { type: "button", variant: "blue-ghost", size: "xs", className: "hover:bg-kortix-blue/15 h-5.5 rounded-sm px-2 text-xs font-medium", onClick: () => {
70
+ onDismiss();
71
+ action.onClick();
72
+ }, children: action.label }, action.label))), meta && _jsx("span", { className: "text-muted-foreground px-2.5", children: meta })] }));
73
+ }
74
+ /** The status colour the badge reflects onto the subject icon. `progress` reflects nothing. */
75
+ const REFLECTION_TONE = {
76
+ success: 'text-kortix-green',
77
+ error: 'text-kortix-red',
78
+ warning: 'text-kortix-orange',
79
+ info: 'text-foreground',
80
+ };
81
+ /**
82
+ * Where the badge's colour reaches on the icon. Paper board "04 · Badge glow",
83
+ * V1 rim reflection, pushed further on request: the colour holds solid to
84
+ * 7.2px from the badge's centre and fades out by 16px, so it climbs the
85
+ * clock's right side and runs along its bottom. Centred on the badge: an 11px badge at -right-0.75 /
86
+ * -bottom-0.75 sits on the icon's diagonal at 85% / 85%, the board's 18.5/24.
87
+ * The badge is 0.72x the clock's radius, as on the board, so it leaves the
88
+ * rim it lights visible.
89
+ */
90
+ export const REFLECTION_MASK = 'radial-gradient(circle 16px at 85% 85%, #000 45%, transparent 100%)';
91
+ /**
92
+ * The subject's icon, bare, with the status glyph badged on its bottom-right
93
+ * corner. The icon is drawn twice: muted, then in the status colour under a
94
+ * radial mask centred on the badge, so its rim picks up the badge's colour
95
+ * where they meet and fades back to grey (V1 rim reflection).
96
+ */
97
+ function EntityTile({ icon, status, variant, }) {
98
+ const tone = variant ? REFLECTION_TONE[variant] : undefined;
99
+ return (_jsxs("div", { className: "relative mt-0.5 size-5 shrink-0", children: [_jsx("div", { className: "text-muted-foreground flex size-5 items-center justify-center [&_svg]:size-5", children: icon }), tone && (_jsx("div", { "aria-hidden": "true", className: cn('absolute inset-0 flex size-5 items-center justify-center [&_svg]:size-5', tone), style: { maskImage: REFLECTION_MASK, WebkitMaskImage: REFLECTION_MASK }, children: icon })), _jsx("span", { className: "bg-background absolute -right-0.75 -bottom-0.75 flex size-3 items-center justify-center rounded-full [&_svg]:size-2.5", children: status })] }));
100
+ }
101
+ /**
102
+ * The toast card itself. `renderToast` mounts it through sonner; the session
103
+ * notifications mount it through `customToast`.
104
+ */
105
+ export function ToastCard({ message, icon, variant, options, onDismiss, }) {
106
+ if (options?.compact) {
107
+ return (_jsxs("div", { className: cn(CARD, 'flex w-fit items-center gap-2 px-3 py-2'), children: [icon, _jsx("span", { className: "text-xs leading-5 font-medium", children: message })] }));
108
+ }
109
+ return (_jsxs("div", { className: cn(CARD, 'flex w-full items-start gap-2.5 py-3 pr-2.5 pl-4 sm:w-[var(--width)]'), children: [options?.entity?.icon ? (_jsx(EntityTile, { icon: options.entity.icon, status: icon, variant: variant })) : (_jsx("div", { className: "flex h-5 w-4 shrink-0 items-center justify-center", children: icon })), _jsxs("div", { className: "flex min-w-0 grow flex-col gap-1.5", children: [_jsx("p", { className: "text-xs leading-5 font-medium", children: message }), options?.entity && (_jsx("p", { className: "-mt-1 truncate text-xs leading-5", children: options.entity.label })), options?.description && (_jsx("p", { className: cn('text-muted-foreground text-xs leading-5',
110
+ // Without an entity line it reads as the title's second line.
111
+ !options.entity && '-mt-1'), children: options.description })), _jsx(ToastActions, { actions: options?.actions, meta: options?.meta, onDismiss: onDismiss }), options?.button && _jsx("div", { className: "self-start", children: options.button })] }), _jsx(ToastClose, { onDismiss: onDismiss })] }));
112
+ }
113
+ const isEditable = (target) => target instanceof HTMLElement &&
114
+ (target.isContentEditable || ['INPUT', 'TEXTAREA', 'SELECT'].includes(target.tagName));
115
+ /**
116
+ * The one-line undo toast: icon, message, an Undo key and ×. While it is on
117
+ * screen, ⌘Z / Ctrl+Z outside a text field undoes too.
118
+ */
119
+ function UndoToastCard({ message, icon, undoLabel, onUndo, onDismiss, }) {
120
+ const undo = () => {
121
+ onDismiss();
122
+ onUndo();
123
+ };
124
+ const undoRef = React.useRef(undo);
125
+ React.useEffect(() => {
126
+ undoRef.current = undo;
127
+ });
128
+ React.useEffect(() => {
129
+ const onKey = (event) => {
130
+ if (event.key.toLowerCase() !== 'z' || event.shiftKey)
131
+ return;
132
+ if (!(event.metaKey || event.ctrlKey) || isEditable(event.target))
133
+ return;
134
+ event.preventDefault();
135
+ undoRef.current();
136
+ };
137
+ window.addEventListener('keydown', onKey);
138
+ return () => window.removeEventListener('keydown', onKey);
139
+ }, []);
140
+ // The same card and text-link action as every other toast ("Open session").
141
+ return (_jsx(ToastCard, { message: message, icon: icon ? _jsx("span", { className: "text-muted-foreground flex", children: icon }) : null, options: { actions: [{ label: undoLabel, onClick: onUndo }] }, onDismiss: onDismiss }));
142
+ }
143
+ /**
144
+ * Render one toast and return the id `toast.custom` minted.
145
+ *
146
+ * The six factories share this one DOM shape; only the leading icon and the
147
+ * resolved duration differ. `isMobile` is read here so every factory gets the
148
+ * same bottom-right-to-top-center switch. The duration arrives already
149
+ * resolved, so each factory keeps its own `||` / `??` rule.
150
+ */
151
+ const renderToast = (message, variant, options, duration) => {
152
+ const isMobile = window.innerWidth <= 768;
153
+ return toast.custom((t) => (_jsx(ToastCard, { message: message, icon: toastIcon(variant), variant: variant, options: options, onDismiss: () => toast.dismiss(t) })), toastData(options, duration, isMobile));
154
+ };
155
+ export const successToast = (message, options) => {
156
+ renderToast(message, 'success', options, options?.duration || DEFAULT_DURATION);
157
+ };
158
+ /** Show or update a loading toast; pass `id` to update an existing toast in place. */
159
+ export const progressToast = (message, options) => {
160
+ return renderToast(message, 'progress', options, options?.duration ?? Infinity);
161
+ };
162
+ export const loadingToast = (message, promiseInput, options) => {
163
+ const promise = typeof promiseInput === 'function' ? promiseInput() : promiseInput;
164
+ const toastId = renderToast(message, 'progress', options, Infinity);
165
+ return promise.then((data) => {
166
+ toast.dismiss(toastId);
167
+ const successMessage = typeof options?.success === 'function'
168
+ ? options.success(data)
169
+ : (options?.success ?? 'Completed');
170
+ successToast(successMessage, options);
171
+ return data;
172
+ }, (error) => {
173
+ toast.dismiss(toastId);
174
+ if (options?.showErrorToast) {
175
+ const errorMessage = typeof options?.error === 'function'
176
+ ? options.error(error)
177
+ : (options?.error ?? getErrorMessage(error));
178
+ errorToast(errorMessage, options);
179
+ }
180
+ throw error;
181
+ });
182
+ };
183
+ let isSilentErrorMessage = () => false;
184
+ /**
185
+ * Sets the host's rule for error messages that `errorToast` drops without a
186
+ * toast (apps/web drops request-deadline noise). Default: none is dropped.
187
+ * Call it once at module load, before the first toast.
188
+ */
189
+ export function setSilentErrorToastFilter(filter) {
190
+ isSilentErrorMessage = filter;
191
+ }
192
+ export const errorToast = (message, options) => {
193
+ if (isSilentErrorMessage(message))
194
+ return;
195
+ renderToast(message, 'error', options, options?.duration || DEFAULT_DURATION);
196
+ };
197
+ export const infoToast = (message, options) => {
198
+ renderToast(message, 'info', options, options?.duration || DEFAULT_DURATION);
199
+ };
200
+ export const warningToast = (message, options) => {
201
+ renderToast(message, 'warning', options, options?.duration || DEFAULT_DURATION);
202
+ };
203
+ /**
204
+ * One-line toast with an Undo key. `undoLabel` is the caller's translated
205
+ * "Undo"; `icon` is an optional muted glyph naming what happened.
206
+ */
207
+ export const undoToast = (message, options) => {
208
+ const isMobile = window.innerWidth <= 768;
209
+ return toast.custom((t) => (_jsx(UndoToastCard, { message: message, icon: options.icon, undoLabel: options.undoLabel, onUndo: options.onUndo, onDismiss: () => toast.dismiss(t) })), toastData(options, options.duration ?? UNDO_DURATION, isMobile));
210
+ };
211
+ /**
212
+ * Mount a caller-drawn card through the same toast surface — for notifications
213
+ * whose shape is their own (the session cards). `render` gets the dismiss.
214
+ */
215
+ export const customToast = (render, options) => {
216
+ const isMobile = window.innerWidth <= 768;
217
+ return toast.custom((t) => render(() => toast.dismiss(t)), {
218
+ ...toastData(options, options.duration ?? DEFAULT_DURATION, isMobile),
219
+ ...(options.onClose ? { onDismiss: options.onClose, onAutoClose: options.onClose } : {}),
220
+ });
221
+ };
222
+ /**
223
+ * Dismiss a toast by the `id` it was created with.
224
+ *
225
+ * Exists so feature code can retract a PERSISTENT toast when the condition it
226
+ * reports goes away — a `duration: Infinity` notice with an action button has to
227
+ * be revocable, or it outlives the problem and offers to fix something already
228
+ * fixed. Wrapped here rather than importing sonner in a feature: this module is
229
+ * the toast surface.
230
+ */
231
+ export const dismissToast = (id) => {
232
+ toast.dismiss(id);
233
+ };
@@ -0,0 +1,12 @@
1
+ import * as TogglePrimitive from '@radix-ui/react-toggle';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ import * as React from 'react';
4
+ declare const toggleVariants: (props?: ({
5
+ variant?: "default" | "outline" | "secondary" | null | undefined;
6
+ size?: "default" | "sm" | "lg" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ declare const Toggle: React.ForwardRefExoticComponent<Omit<TogglePrimitive.ToggleProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
9
+ variant?: "default" | "outline" | "secondary" | null | undefined;
10
+ size?: "default" | "sm" | "lg" | null | undefined;
11
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
12
+ export { Toggle, toggleVariants };
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as TogglePrimitive from '@radix-ui/react-toggle';
3
+ import { cva } from 'class-variance-authority';
4
+ import * as React from 'react';
5
+ import { cn } from '../../lib/utils.js';
6
+ const toggleVariants = cva('inline-flex items-center justify-center gap-2 rounded-md bg-transparent text-sm font-medium text-muted-foreground transition-colors hover:bg-foreground/[0.06] hover:text-foreground focus-visible:outline-none focus-visible:ring-kortix-base focus-visible:ring-[0.6px] disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-primary/10 data-[state=on]:text-primary data-[state=on]:hover:bg-primary/[0.14] [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', {
7
+ variants: {
8
+ variant: {
9
+ default: '',
10
+ outline: 'border border-border data-[state=on]:border-primary/25',
11
+ secondary: 'bg-foreground/[0.05] text-foreground/70 hover:bg-foreground/[0.08] hover:text-foreground',
12
+ },
13
+ size: {
14
+ default: 'h-9 px-3 ',
15
+ sm: 'h-8 px-3',
16
+ lg: 'h-10 px-2.5 min-w-10',
17
+ },
18
+ },
19
+ defaultVariants: {
20
+ variant: 'default',
21
+ size: 'default',
22
+ },
23
+ });
24
+ const Toggle = React.forwardRef(({ className, variant, size, ...props }, ref) => (_jsx(TogglePrimitive.Root, { ref: ref, className: cn(toggleVariants({ variant, size, className })), ...props })));
25
+ Toggle.displayName = TogglePrimitive.Root.displayName;
26
+ export { Toggle, toggleVariants };
@@ -0,0 +1,9 @@
1
+ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
2
+ import * as React from 'react';
3
+ declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
4
+ /** @deprecated In feature code use `Hint` (`@kortix/ui/hint`). `Tooltip` is the primitive `Hint` builds on. */
5
+ declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
6
+ declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
7
+ /** @deprecated In feature code use `Hint` (`@kortix/ui/hint`). */
8
+ declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
3
+ import * as React from 'react';
4
+ import { cn } from '../../lib/utils.js';
5
+ const TooltipProvider = TooltipPrimitive.Provider;
6
+ /** @deprecated In feature code use `Hint` (`@kortix/ui/hint`). `Tooltip` is the primitive `Hint` builds on. */
7
+ const Tooltip = TooltipPrimitive.Root;
8
+ const TooltipTrigger = TooltipPrimitive.Trigger;
9
+ /** @deprecated In feature code use `Hint` (`@kortix/ui/hint`). */
10
+ const TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(TooltipPrimitive.Portal, { children: _jsx(TooltipPrimitive.Content, { ref: ref, "data-slot": "tooltip-content", sideOffset: sideOffset,
11
+ // No enter/exit animation, the same as the dropdown, select and popover
12
+ // panels: the tooltip paints on the frame it mounts and unmounts on the
13
+ // frame it closes. The hover delay lives on `TooltipProvider`, not here.
14
+ className: cn('bg-foreground text-background ring-foreground/5 z-[9999] overflow-hidden rounded-sm p-1 px-2 text-[13px] ring-[1px]', className), ...props }) })));
15
+ TooltipContent.displayName = TooltipPrimitive.Content.displayName;
16
+ export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
@@ -0,0 +1,14 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ export declare const triggerVariants: (props?: ({
3
+ variant?: "outline" | "secondary" | "transparent" | null | undefined;
4
+ size?: "sm" | "lg" | "md" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ export type TriggerVariantProps = VariantProps<typeof triggerVariants>;
7
+ /** Caret sizing per trigger size — matches the text step of each size. */
8
+ export declare const TRIGGER_ICON_SIZE: {
9
+ readonly sm: "size-4";
10
+ readonly md: "size-4";
11
+ readonly lg: "size-4.5";
12
+ };
13
+ /** The caret classes: muted, shrink-proof, and flipped while the overlay is open. */
14
+ export declare const TRIGGER_CARET_CLASS: string;