@elabs-ai/components-ai 4.2.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (462) hide show
  1. package/README.md +1 -1
  2. package/dist/{_audio-player-media-chrome-T3XVXWRZ.js → _audio-player-media-chrome.js} +1 -1
  3. package/dist/_code-block-theme.js +12 -0
  4. package/dist/_code-block-theme.js.map +1 -0
  5. package/dist/{_flow-boundary-SHNWLQG5.js → _flow-boundary.js} +1 -1
  6. package/dist/_flow-boundary.js.map +1 -0
  7. package/dist/_flow-lazy.js +8 -0
  8. package/dist/_flow-lazy.js.map +1 -0
  9. package/dist/_lazy-boundary-conformance.js +2 -0
  10. package/dist/_lazy-boundary-conformance.js.map +1 -0
  11. package/dist/_lazy-cjk.js +13 -0
  12. package/dist/_lazy-cjk.js.map +1 -0
  13. package/dist/_lazy-engine-boundary.js +9 -0
  14. package/dist/_lazy-engine-boundary.js.map +1 -0
  15. package/dist/_lazy-math.js +13 -0
  16. package/dist/_lazy-math.js.map +1 -0
  17. package/dist/_lazy-mermaid.js +12 -0
  18. package/dist/_lazy-mermaid.js.map +1 -0
  19. package/dist/_mermaid-error-panel.js +9 -0
  20. package/dist/_mermaid-error-panel.js.map +1 -0
  21. package/dist/{_persona-rive-JEG44YHX.js → _persona-rive.js} +19 -24
  22. package/dist/_persona-rive.js.map +1 -0
  23. package/dist/_streamdown-i18n.js +21 -0
  24. package/dist/_streamdown-i18n.js.map +1 -0
  25. package/dist/_streamdown-safety.js +10 -0
  26. package/dist/_streamdown-safety.js.map +1 -0
  27. package/dist/_theme-scope-store.js +13 -0
  28. package/dist/_theme-scope-store.js.map +1 -0
  29. package/dist/a2ui/a2ui-surface.js +17 -0
  30. package/dist/a2ui/a2ui-surface.js.map +1 -0
  31. package/dist/a2ui/core/catalog.generated.js +10 -0
  32. package/dist/a2ui/core/catalog.generated.js.map +1 -0
  33. package/dist/a2ui/core/complete-json.js +10 -0
  34. package/dist/a2ui/core/complete-json.js.map +1 -0
  35. package/dist/a2ui/core/index.js +37 -0
  36. package/dist/a2ui/core/index.js.map +1 -0
  37. package/dist/a2ui/core/schema.js +11 -0
  38. package/dist/a2ui/core/schema.js.map +1 -0
  39. package/dist/a2ui/core/spec.js +10 -0
  40. package/dist/a2ui/core/spec.js.map +1 -0
  41. package/dist/a2ui/core/validate.js +16 -0
  42. package/dist/a2ui/core/validate.js.map +1 -0
  43. package/dist/a2ui/index.js +54 -0
  44. package/dist/a2ui/index.js.map +1 -0
  45. package/dist/a2ui/ui-catalog.js +18 -0
  46. package/dist/a2ui/ui-catalog.js.map +1 -0
  47. package/dist/agent-event.js +10 -0
  48. package/dist/agent-event.js.map +1 -0
  49. package/dist/agent-timeline.js +11 -0
  50. package/dist/agent-timeline.js.map +1 -0
  51. package/dist/agent.js +25 -0
  52. package/dist/agent.js.map +1 -0
  53. package/dist/artifact.js +23 -0
  54. package/dist/artifact.js.map +1 -0
  55. package/dist/asset-preview.js +22 -0
  56. package/dist/asset-preview.js.map +1 -0
  57. package/dist/attachments.js +33 -0
  58. package/dist/attachments.js.map +1 -0
  59. package/dist/audio-player.js +30 -0
  60. package/dist/audio-player.js.map +1 -0
  61. package/dist/audio-visualizer.js +9 -0
  62. package/dist/audio-visualizer.js.map +1 -0
  63. package/dist/canvas.js +10 -0
  64. package/dist/canvas.js.map +1 -0
  65. package/dist/chain-of-thought.js +22 -0
  66. package/dist/chain-of-thought.js.map +1 -0
  67. package/dist/chat-greeting.js +8 -0
  68. package/dist/chat-greeting.js.map +1 -0
  69. package/dist/chat-shell.js +9 -0
  70. package/dist/chat-shell.js.map +1 -0
  71. package/dist/checkpoint.js +13 -0
  72. package/dist/checkpoint.js.map +1 -0
  73. package/dist/chunk-2XOIG5TG.js +72 -0
  74. package/dist/chunk-2XOIG5TG.js.map +1 -0
  75. package/dist/chunk-34CQ2VHM.js +172 -0
  76. package/dist/chunk-34CQ2VHM.js.map +1 -0
  77. package/dist/chunk-3TDHPXZZ.js +60 -0
  78. package/dist/chunk-3TDHPXZZ.js.map +1 -0
  79. package/dist/chunk-3XNPMDZY.js +478 -0
  80. package/dist/chunk-3XNPMDZY.js.map +1 -0
  81. package/dist/chunk-3YPT3V7L.js +56 -0
  82. package/dist/chunk-3YPT3V7L.js.map +1 -0
  83. package/dist/chunk-475UEU2Q.js +87 -0
  84. package/dist/chunk-475UEU2Q.js.map +1 -0
  85. package/dist/chunk-4CBTII2I.js +95 -0
  86. package/dist/chunk-4CBTII2I.js.map +1 -0
  87. package/dist/chunk-4XRNIZMG.js +22 -0
  88. package/dist/chunk-4XRNIZMG.js.map +1 -0
  89. package/dist/chunk-5NNWUKK5.js +2 -0
  90. package/dist/chunk-5NNWUKK5.js.map +1 -0
  91. package/dist/chunk-5UOMU27Z.js +164 -0
  92. package/dist/chunk-5UOMU27Z.js.map +1 -0
  93. package/dist/chunk-5VGYZ62I.js +264 -0
  94. package/dist/chunk-5VGYZ62I.js.map +1 -0
  95. package/dist/chunk-6IQPH2OS.js +21 -0
  96. package/dist/chunk-6IQPH2OS.js.map +1 -0
  97. package/dist/chunk-6PB2MXCI.js +482 -0
  98. package/dist/chunk-6PB2MXCI.js.map +1 -0
  99. package/dist/chunk-7FD5CZEU.js +215 -0
  100. package/dist/chunk-7FD5CZEU.js.map +1 -0
  101. package/dist/chunk-7RL6KZDF.js +266 -0
  102. package/dist/chunk-7RL6KZDF.js.map +1 -0
  103. package/dist/chunk-ADOYAGGK.js +482 -0
  104. package/dist/chunk-ADOYAGGK.js.map +1 -0
  105. package/dist/chunk-BA3AEMOU.js +21 -0
  106. package/dist/chunk-BA3AEMOU.js.map +1 -0
  107. package/dist/chunk-BBHFOYML.js +336 -0
  108. package/dist/chunk-BBHFOYML.js.map +1 -0
  109. package/dist/chunk-BHUVISIY.js +221 -0
  110. package/dist/chunk-BHUVISIY.js.map +1 -0
  111. package/dist/chunk-BM2LWERA.js +100 -0
  112. package/dist/chunk-BM2LWERA.js.map +1 -0
  113. package/dist/chunk-CMOYXNPJ.js +211 -0
  114. package/dist/chunk-CMOYXNPJ.js.map +1 -0
  115. package/dist/chunk-CZP3RHC4.js +74 -0
  116. package/dist/chunk-CZP3RHC4.js.map +1 -0
  117. package/dist/chunk-DDG5JHQT.js +112 -0
  118. package/dist/chunk-DDG5JHQT.js.map +1 -0
  119. package/dist/chunk-DJODXO7I.js +38 -0
  120. package/dist/chunk-DJODXO7I.js.map +1 -0
  121. package/dist/chunk-DWJDJLPU.js +192 -0
  122. package/dist/chunk-DWJDJLPU.js.map +1 -0
  123. package/dist/chunk-DZW6LM22.js +45 -0
  124. package/dist/chunk-DZW6LM22.js.map +1 -0
  125. package/dist/chunk-ELGCZLZF.js +305 -0
  126. package/dist/chunk-ELGCZLZF.js.map +1 -0
  127. package/dist/chunk-EV3U6ZZB.js +209 -0
  128. package/dist/chunk-EV3U6ZZB.js.map +1 -0
  129. package/dist/chunk-EY7LVUKQ.js +87 -0
  130. package/dist/chunk-EY7LVUKQ.js.map +1 -0
  131. package/dist/chunk-F4C74F7M.js +230 -0
  132. package/dist/chunk-F4C74F7M.js.map +1 -0
  133. package/dist/chunk-FERYDFZA.js +108 -0
  134. package/dist/chunk-FERYDFZA.js.map +1 -0
  135. package/dist/chunk-FUIYG2DS.js +166 -0
  136. package/dist/chunk-FUIYG2DS.js.map +1 -0
  137. package/dist/chunk-GA7M34KU.js +236 -0
  138. package/dist/chunk-GA7M34KU.js.map +1 -0
  139. package/dist/chunk-GKYZT3LA.js +136 -0
  140. package/dist/chunk-GKYZT3LA.js.map +1 -0
  141. package/dist/chunk-H42LRUQ4.js +102 -0
  142. package/dist/chunk-H42LRUQ4.js.map +1 -0
  143. package/dist/chunk-HVXM2G5F.js +222 -0
  144. package/dist/chunk-HVXM2G5F.js.map +1 -0
  145. package/dist/chunk-I4RDAGVY.js +53 -0
  146. package/dist/chunk-I4RDAGVY.js.map +1 -0
  147. package/dist/chunk-IQJG4IDX.js +208 -0
  148. package/dist/chunk-IQJG4IDX.js.map +1 -0
  149. package/dist/chunk-IX2PXG4Y.js +144 -0
  150. package/dist/chunk-IX2PXG4Y.js.map +1 -0
  151. package/dist/chunk-IXICSOOP.js +287 -0
  152. package/dist/chunk-IXICSOOP.js.map +1 -0
  153. package/dist/chunk-JY5HSN4D.js +84 -0
  154. package/dist/chunk-JY5HSN4D.js.map +1 -0
  155. package/dist/chunk-L4SU3QJV.js +174 -0
  156. package/dist/chunk-L4SU3QJV.js.map +1 -0
  157. package/dist/chunk-LMNSBOBG.js +19 -0
  158. package/dist/chunk-LMNSBOBG.js.map +1 -0
  159. package/dist/chunk-MBI7D6IL.js +42 -0
  160. package/dist/chunk-MBI7D6IL.js.map +1 -0
  161. package/dist/chunk-MLFMYCPH.js +192 -0
  162. package/dist/chunk-MLFMYCPH.js.map +1 -0
  163. package/dist/chunk-MOK66734.js +33 -0
  164. package/dist/chunk-MOK66734.js.map +1 -0
  165. package/dist/chunk-MXTAWPYM.js +196 -0
  166. package/dist/chunk-MXTAWPYM.js.map +1 -0
  167. package/dist/chunk-NCL2UZKI.js +96 -0
  168. package/dist/chunk-NCL2UZKI.js.map +1 -0
  169. package/dist/chunk-NET4YLRY.js +107 -0
  170. package/dist/chunk-NET4YLRY.js.map +1 -0
  171. package/dist/chunk-NIG67CFM.js +329 -0
  172. package/dist/chunk-NIG67CFM.js.map +1 -0
  173. package/dist/chunk-NMVNNO3L.js +10 -0
  174. package/dist/chunk-NMVNNO3L.js.map +1 -0
  175. package/dist/chunk-NP7VID4K.js +2 -0
  176. package/dist/chunk-NP7VID4K.js.map +1 -0
  177. package/dist/chunk-NPUCMAG2.js +382 -0
  178. package/dist/chunk-NPUCMAG2.js.map +1 -0
  179. package/dist/chunk-NSCLRHES.js +102 -0
  180. package/dist/chunk-NSCLRHES.js.map +1 -0
  181. package/dist/chunk-OEUXHVFW.js +86 -0
  182. package/dist/chunk-OEUXHVFW.js.map +1 -0
  183. package/dist/chunk-ONBHFIMZ.js +137 -0
  184. package/dist/chunk-ONBHFIMZ.js.map +1 -0
  185. package/dist/chunk-OPH2HHL2.js +228 -0
  186. package/dist/chunk-OPH2HHL2.js.map +1 -0
  187. package/dist/chunk-OQERHIQP.js +287 -0
  188. package/dist/chunk-OQERHIQP.js.map +1 -0
  189. package/dist/chunk-P6YJAZFG.js +103 -0
  190. package/dist/chunk-P6YJAZFG.js.map +1 -0
  191. package/dist/chunk-PG7ERDOD.js +65 -0
  192. package/dist/chunk-PG7ERDOD.js.map +1 -0
  193. package/dist/chunk-PIB5JBMA.js +90 -0
  194. package/dist/chunk-PIB5JBMA.js.map +1 -0
  195. package/dist/chunk-PQ5BPIWQ.js +22 -0
  196. package/dist/chunk-PQ5BPIWQ.js.map +1 -0
  197. package/dist/chunk-PQBF6ZIQ.js +55 -0
  198. package/dist/chunk-PQBF6ZIQ.js.map +1 -0
  199. package/dist/chunk-PTWCTSZL.js +173 -0
  200. package/dist/chunk-PTWCTSZL.js.map +1 -0
  201. package/dist/chunk-QJUNPVOS.js +101 -0
  202. package/dist/chunk-QJUNPVOS.js.map +1 -0
  203. package/dist/chunk-QOBSEGCG.js +996 -0
  204. package/dist/chunk-QOBSEGCG.js.map +1 -0
  205. package/dist/chunk-QUDZOTRV.js +43 -0
  206. package/dist/chunk-QUDZOTRV.js.map +1 -0
  207. package/dist/chunk-RB7G65JC.js +213 -0
  208. package/dist/chunk-RB7G65JC.js.map +1 -0
  209. package/dist/chunk-RPHAOR7P.js +45 -0
  210. package/dist/chunk-RPHAOR7P.js.map +1 -0
  211. package/dist/chunk-RTCSH2AN.js +331 -0
  212. package/dist/chunk-RTCSH2AN.js.map +1 -0
  213. package/dist/chunk-S3ISPW3A.js +28 -0
  214. package/dist/chunk-S3ISPW3A.js.map +1 -0
  215. package/dist/chunk-SEVN656N.js +36 -0
  216. package/dist/chunk-SEVN656N.js.map +1 -0
  217. package/dist/chunk-SKVG672B.js +64 -0
  218. package/dist/chunk-SKVG672B.js.map +1 -0
  219. package/dist/chunk-SSGJ6MEM.js +1076 -0
  220. package/dist/chunk-SSGJ6MEM.js.map +1 -0
  221. package/dist/chunk-SSKZ2AED.js +118 -0
  222. package/dist/chunk-SSKZ2AED.js.map +1 -0
  223. package/dist/chunk-T56JFGXI.js +561 -0
  224. package/dist/chunk-T56JFGXI.js.map +1 -0
  225. package/dist/chunk-TCB6O74A.js +137 -0
  226. package/dist/chunk-TCB6O74A.js.map +1 -0
  227. package/dist/chunk-TTEYPO6X.js +57 -0
  228. package/dist/chunk-TTEYPO6X.js.map +1 -0
  229. package/dist/chunk-TWPHAJNM.js +462 -0
  230. package/dist/chunk-TWPHAJNM.js.map +1 -0
  231. package/dist/chunk-TXJJLP4O.js +336 -0
  232. package/dist/chunk-TXJJLP4O.js.map +1 -0
  233. package/dist/chunk-TZ6TB7VM.js +245 -0
  234. package/dist/chunk-TZ6TB7VM.js.map +1 -0
  235. package/dist/chunk-UBLKJJ7K.js +278 -0
  236. package/dist/chunk-UBLKJJ7K.js.map +1 -0
  237. package/dist/chunk-UCJ6IUFS.js +52 -0
  238. package/dist/chunk-UCJ6IUFS.js.map +1 -0
  239. package/dist/chunk-UCKFJ3QF.js +197 -0
  240. package/dist/chunk-UCKFJ3QF.js.map +1 -0
  241. package/dist/chunk-UPXSLILN.js +20 -0
  242. package/dist/chunk-UPXSLILN.js.map +1 -0
  243. package/dist/chunk-V4DORGWJ.js +92 -0
  244. package/dist/chunk-V4DORGWJ.js.map +1 -0
  245. package/dist/chunk-V6E5DYZD.js +80 -0
  246. package/dist/chunk-V6E5DYZD.js.map +1 -0
  247. package/dist/chunk-VLLYKF3P.js +96 -0
  248. package/dist/chunk-VLLYKF3P.js.map +1 -0
  249. package/dist/chunk-VLNBTOH6.js +43 -0
  250. package/dist/chunk-VLNBTOH6.js.map +1 -0
  251. package/dist/chunk-WMDSMSPL.js +303 -0
  252. package/dist/chunk-WMDSMSPL.js.map +1 -0
  253. package/dist/chunk-WU5BLGTF.js +149 -0
  254. package/dist/chunk-WU5BLGTF.js.map +1 -0
  255. package/dist/chunk-WYTZVSGK.js +245 -0
  256. package/dist/chunk-WYTZVSGK.js.map +1 -0
  257. package/dist/chunk-X47QMM6K.js +187 -0
  258. package/dist/chunk-X47QMM6K.js.map +1 -0
  259. package/dist/chunk-YHUSW7D2.js +40 -0
  260. package/dist/chunk-YHUSW7D2.js.map +1 -0
  261. package/dist/chunk-YSKD7UXX.js +126 -0
  262. package/dist/chunk-YSKD7UXX.js.map +1 -0
  263. package/dist/chunk-YYRDGWOU.js +72 -0
  264. package/dist/chunk-YYRDGWOU.js.map +1 -0
  265. package/dist/chunk-ZIGZMWM7.js +19 -0
  266. package/dist/chunk-ZIGZMWM7.js.map +1 -0
  267. package/dist/chunk-ZKRTUKNP.js +40 -0
  268. package/dist/chunk-ZKRTUKNP.js.map +1 -0
  269. package/dist/code-block.js +38 -0
  270. package/dist/code-block.js.map +1 -0
  271. package/dist/commit.js +51 -0
  272. package/dist/commit.js.map +1 -0
  273. package/dist/composer.js +15 -0
  274. package/dist/composer.js.map +1 -0
  275. package/dist/confirmation.js +53 -0
  276. package/dist/confirmation.js.map +1 -0
  277. package/dist/connection.js +8 -0
  278. package/dist/connection.js.map +1 -0
  279. package/dist/context-panel.js +25 -0
  280. package/dist/context-panel.js.map +1 -0
  281. package/dist/controls.js +10 -0
  282. package/dist/controls.js.map +1 -0
  283. package/dist/conversation.js +19 -0
  284. package/dist/conversation.js.map +1 -0
  285. package/dist/diff-view.js +15 -0
  286. package/dist/diff-view.js.map +1 -0
  287. package/dist/edge.js +10 -0
  288. package/dist/edge.js.map +1 -0
  289. package/dist/environment-variables.js +29 -0
  290. package/dist/environment-variables.js.map +1 -0
  291. package/dist/file-tree.js +23 -0
  292. package/dist/file-tree.js.map +1 -0
  293. package/dist/gallery.js +9 -0
  294. package/dist/gallery.js.map +1 -0
  295. package/dist/grouped-parts.js +21 -0
  296. package/dist/grouped-parts.js.map +1 -0
  297. package/dist/image.js +9 -0
  298. package/dist/image.js.map +1 -0
  299. package/dist/index.d.ts +366 -98
  300. package/dist/index.js +672 -13577
  301. package/dist/index.js.map +1 -1
  302. package/dist/inline-citation.js +39 -0
  303. package/dist/inline-citation.js.map +1 -0
  304. package/dist/jsx-preview.js +17 -0
  305. package/dist/jsx-preview.js.map +1 -0
  306. package/dist/markdown-view.js +17 -0
  307. package/dist/markdown-view.js.map +1 -0
  308. package/dist/message-compare.js +12 -0
  309. package/dist/message-compare.js.map +1 -0
  310. package/dist/message-edit.js +19 -0
  311. package/dist/message-edit.js.map +1 -0
  312. package/dist/message-feedback.js +11 -0
  313. package/dist/message-feedback.js.map +1 -0
  314. package/dist/message-form-spec.js +38 -0
  315. package/dist/message-form-spec.js.map +1 -0
  316. package/dist/message-form.js +26 -0
  317. package/dist/message-form.js.map +1 -0
  318. package/dist/message-table-spec.js +26 -0
  319. package/dist/message-table-spec.js.map +1 -0
  320. package/dist/message-table.js +12 -0
  321. package/dist/message-table.js.map +1 -0
  322. package/dist/message.js +51 -0
  323. package/dist/message.js.map +1 -0
  324. package/dist/mic-selector.js +27 -0
  325. package/dist/mic-selector.js.map +1 -0
  326. package/dist/model-provider-logo.js +13 -0
  327. package/dist/model-provider-logo.js.map +1 -0
  328. package/dist/motion-config.js +9 -0
  329. package/dist/motion-config.js.map +1 -0
  330. package/dist/node.js +22 -0
  331. package/dist/node.js.map +1 -0
  332. package/dist/open-in-chat.js +31 -0
  333. package/dist/open-in-chat.js.map +1 -0
  334. package/dist/package-info.js +25 -0
  335. package/dist/package-info.js.map +1 -0
  336. package/dist/panel.js +10 -0
  337. package/dist/panel.js.map +1 -0
  338. package/dist/part-groups.js +18 -0
  339. package/dist/part-groups.js.map +1 -0
  340. package/dist/permission-mode-select.js +9 -0
  341. package/dist/permission-mode-select.js.map +1 -0
  342. package/dist/persona-sources.js +8 -0
  343. package/dist/persona-sources.js.map +1 -0
  344. package/dist/persona.js +14 -0
  345. package/dist/persona.js.map +1 -0
  346. package/dist/plan.js +32 -0
  347. package/dist/plan.js.map +1 -0
  348. package/dist/prompt-input-effort.js +9 -0
  349. package/dist/prompt-input-effort.js.map +1 -0
  350. package/dist/prompt-input-mode.js +10 -0
  351. package/dist/prompt-input-mode.js.map +1 -0
  352. package/dist/prompt-input-slash.js +12 -0
  353. package/dist/prompt-input-slash.js.map +1 -0
  354. package/dist/prompt-input.js +89 -0
  355. package/dist/prompt-input.js.map +1 -0
  356. package/dist/queue.js +37 -0
  357. package/dist/queue.js.map +1 -0
  358. package/dist/reasoning.js +23 -0
  359. package/dist/reasoning.js.map +1 -0
  360. package/dist/sandbox.js +28 -0
  361. package/dist/sandbox.js.map +1 -0
  362. package/dist/schema-display.js +33 -0
  363. package/dist/schema-display.js.map +1 -0
  364. package/dist/selection-toolbar.js +11 -0
  365. package/dist/selection-toolbar.js.map +1 -0
  366. package/dist/session-header.js +9 -0
  367. package/dist/session-header.js.map +1 -0
  368. package/dist/session-status-bar.js +9 -0
  369. package/dist/session-status-bar.js.map +1 -0
  370. package/dist/shimmer.js +9 -0
  371. package/dist/shimmer.js.map +1 -0
  372. package/dist/snippet.js +17 -0
  373. package/dist/snippet.js.map +1 -0
  374. package/dist/sources.js +17 -0
  375. package/dist/sources.js.map +1 -0
  376. package/dist/speech-input.js +9 -0
  377. package/dist/speech-input.js.map +1 -0
  378. package/dist/stack-trace.js +27 -0
  379. package/dist/stack-trace.js.map +1 -0
  380. package/dist/suggestion.js +16 -0
  381. package/dist/suggestion.js.map +1 -0
  382. package/dist/task.js +18 -0
  383. package/dist/task.js.map +1 -0
  384. package/dist/test-results.js +43 -0
  385. package/dist/test-results.js.map +1 -0
  386. package/dist/token-usage.js +27 -0
  387. package/dist/token-usage.js.map +1 -0
  388. package/dist/tool-result-card.js +9 -0
  389. package/dist/tool-result-card.js.map +1 -0
  390. package/dist/tool.js +27 -0
  391. package/dist/tool.js.map +1 -0
  392. package/dist/toolbar.js +10 -0
  393. package/dist/toolbar.js.map +1 -0
  394. package/dist/transcription.js +11 -0
  395. package/dist/transcription.js.map +1 -0
  396. package/dist/turn-status.js +9 -0
  397. package/dist/turn-status.js.map +1 -0
  398. package/dist/use-audio-level.js +9 -0
  399. package/dist/use-audio-level.js.map +1 -0
  400. package/dist/voice-selector.js +47 -0
  401. package/dist/voice-selector.js.map +1 -0
  402. package/dist/web-preview.js +19 -0
  403. package/dist/web-preview.js.map +1 -0
  404. package/package.json +11 -9
  405. package/schemas/a2ui-surface.v1.schema.json +5434 -0
  406. package/src/_chat-shell-rail.tsx +3 -1
  407. package/src/_flow-boundary.tsx +2 -2
  408. package/src/_persona-rive.tsx +27 -41
  409. package/src/a2ui/a2ui-surface.stories.tsx +662 -0
  410. package/src/a2ui/a2ui-surface.test.tsx +201 -0
  411. package/src/a2ui/a2ui-surface.tsx +354 -0
  412. package/src/a2ui/catalog.source.json +772 -0
  413. package/src/a2ui/core/a2ui-core.test.ts +178 -0
  414. package/src/a2ui/core/catalog.generated.ts +1019 -0
  415. package/src/a2ui/core/complete-json.ts +81 -0
  416. package/src/a2ui/core/index.ts +10 -0
  417. package/src/a2ui/core/schema.ts +111 -0
  418. package/src/a2ui/core/spec.ts +148 -0
  419. package/src/a2ui/core/validate.ts +266 -0
  420. package/src/a2ui/index.ts +7 -0
  421. package/src/a2ui/ui-catalog.tsx +225 -0
  422. package/src/a2ui/wave1-chart-spec.test.ts +87 -0
  423. package/src/a2ui/wave2-chart-spec.test.ts +108 -0
  424. package/src/agentic-workspace.stories.tsx +6 -45
  425. package/src/chat-shell.test.tsx +40 -10
  426. package/src/chat-shell.tsx +90 -44
  427. package/src/chat.stories.tsx +47 -42
  428. package/src/composer.stories.tsx +4 -5
  429. package/src/composer.test.tsx +45 -0
  430. package/src/composer.tsx +104 -21
  431. package/src/context-panel.stories.tsx +1 -1
  432. package/src/context-panel.tsx +1 -1
  433. package/src/conversation.stories.tsx +1 -0
  434. package/src/conversation.test.tsx +16 -0
  435. package/src/conversation.tsx +16 -2
  436. package/src/diff-view.stories.tsx +79 -0
  437. package/src/diff-view.tsx +3 -2
  438. package/src/file-tree.tsx +24 -17
  439. package/src/gallery.stories.tsx +42 -0
  440. package/src/gallery.tsx +2 -2
  441. package/src/grouped-parts.stories.tsx +23 -0
  442. package/src/grouped-parts.tsx +1 -1
  443. package/src/index.ts +1 -0
  444. package/src/message-compare.stories.tsx +40 -0
  445. package/src/message-compare.tsx +2 -1
  446. package/src/message-form.tsx +1 -1
  447. package/src/message-table.stories.tsx +24 -0
  448. package/src/message-table.tsx +1 -1
  449. package/src/package-info.tsx +12 -9
  450. package/src/reasoning.stories.tsx +27 -0
  451. package/src/reasoning.tsx +1 -1
  452. package/src/session-header.stories.tsx +35 -1
  453. package/src/session-header.tsx +1 -1
  454. package/src/sources.stories.tsx +30 -0
  455. package/src/sources.tsx +4 -1
  456. package/src/templates-ai-assistant.stories.tsx +151 -87
  457. package/src/tool.stories.tsx +39 -0
  458. package/src/tool.tsx +3 -3
  459. package/src/toolbar.tsx +0 -10
  460. package/dist/_flow-boundary-SHNWLQG5.js.map +0 -1
  461. package/dist/_persona-rive-JEG44YHX.js.map +0 -1
  462. /package/dist/{_audio-player-media-chrome-T3XVXWRZ.js.map → _audio-player-media-chrome.js.map} +0 -0
@@ -0,0 +1,100 @@
1
+ "use client";
2
+ import {
3
+ A2UI_COMMON_PROPS,
4
+ A2UI_VERSION
5
+ } from "./chunk-4XRNIZMG.js";
6
+
7
+ // src/a2ui/core/schema.ts
8
+ var A2UI_SURFACE_SCHEMA_ID = "https://github.com/mreimitz/elabs-components/packages/ai/schemas/a2ui-surface.v1.schema.json";
9
+ function propSchema(p) {
10
+ const base = {};
11
+ if (p.description) base.description = p.description;
12
+ if (p.default !== void 0) base.default = p.default;
13
+ if (p.enum) return { ...base, enum: p.enum };
14
+ switch (p.type) {
15
+ case "string":
16
+ case "number":
17
+ case "boolean":
18
+ case "array":
19
+ case "object":
20
+ return { ...base, type: p.type };
21
+ case "node":
22
+ return {
23
+ ...base,
24
+ anyOf: [
25
+ { type: "string" },
26
+ { type: "number" },
27
+ { $ref: "#/$defs/element" },
28
+ { type: "array", items: { $ref: "#/$defs/node" } }
29
+ ]
30
+ };
31
+ default:
32
+ return base;
33
+ }
34
+ }
35
+ function elementSchema(type, entry) {
36
+ const props = entry.builtin ? entry.props : { ...A2UI_COMMON_PROPS, ...entry.props };
37
+ const required = Object.entries(entry.props).filter(([, p]) => p.required).map(([name]) => name);
38
+ const properties = {
39
+ type: { const: type },
40
+ id: { type: "string" },
41
+ props: {
42
+ type: "object",
43
+ properties: Object.fromEntries(Object.entries(props).map(([n, p]) => [n, propSchema(p)])),
44
+ ...required.length ? { required } : {},
45
+ additionalProperties: false
46
+ },
47
+ on: {
48
+ type: "object",
49
+ properties: Object.fromEntries(
50
+ Object.keys(entry.events).map((ev) => [ev, { $ref: "#/$defs/action" }])
51
+ ),
52
+ additionalProperties: false
53
+ }
54
+ };
55
+ if (entry.children) properties.children = { type: "array", items: { $ref: "#/$defs/node" } };
56
+ return {
57
+ type: "object",
58
+ ...entry.summary ? { description: entry.summary } : {},
59
+ properties,
60
+ required: required.length ? ["type", "props"] : ["type"],
61
+ additionalProperties: false
62
+ };
63
+ }
64
+ function buildA2uiSurfaceSchema(catalog) {
65
+ const types = Object.keys(catalog).sort();
66
+ return {
67
+ $schema: "https://json-schema.org/draft/2020-12/schema",
68
+ $id: A2UI_SURFACE_SCHEMA_ID,
69
+ title: "A2UI surface v1 (brand-ui)",
70
+ description: "An agent-designed screen as data: a tree of brand-ui catalog nodes. Every `type` is a catalog entry, props are checked per type, and `on` binds catalog events to host actions. Text is a plain string child.",
71
+ type: "object",
72
+ properties: {
73
+ a2ui: { const: A2UI_VERSION },
74
+ title: { type: "string", description: "Accessible name of the surface region." },
75
+ root: { $ref: "#/$defs/node" }
76
+ },
77
+ required: ["a2ui", "root"],
78
+ additionalProperties: false,
79
+ $defs: {
80
+ action: {
81
+ type: "object",
82
+ properties: {
83
+ name: { type: "string", minLength: 1, description: "The host-side verb." },
84
+ payload: { description: "Free JSON attached to the action." }
85
+ },
86
+ required: ["name"],
87
+ additionalProperties: false
88
+ },
89
+ node: { anyOf: [{ type: "string" }, { $ref: "#/$defs/element" }] },
90
+ element: { oneOf: types.map((t) => ({ $ref: `#/$defs/${t}` })) },
91
+ ...Object.fromEntries(types.map((t) => [t, elementSchema(t, catalog[t])]))
92
+ }
93
+ };
94
+ }
95
+
96
+ export {
97
+ A2UI_SURFACE_SCHEMA_ID,
98
+ buildA2uiSurfaceSchema
99
+ };
100
+ //# sourceMappingURL=chunk-BM2LWERA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/a2ui/core/schema.ts"],"sourcesContent":["/**\n * schema.ts — the A2UI surface as a JSON Schema (draft 2020-12), built from the\n * catalog so editors, structured-output modes and JSON-Schema validators see the\n * SAME contract `validateA2uiSurface` enforces. Published as\n * `@elabs-ai/components-ai/a2ui/schema.json` and printed by `brand-ui a2ui schema`.\n */\nimport {\n A2UI_COMMON_PROPS,\n A2UI_VERSION,\n type A2uiCatalogSchema,\n type A2uiCatalogTypeSchema,\n type A2uiPropSchema,\n} from \"./spec\";\n\nexport const A2UI_SURFACE_SCHEMA_ID =\n \"https://github.com/mreimitz/elabs-components/packages/ai/schemas/a2ui-surface.v1.schema.json\";\n\ntype JsonSchema = Record<string, unknown>;\n\nfunction propSchema(p: A2uiPropSchema): JsonSchema {\n const base: JsonSchema = {};\n if (p.description) base.description = p.description;\n if (p.default !== undefined) base.default = p.default;\n if (p.enum) return { ...base, enum: p.enum };\n switch (p.type) {\n case \"string\":\n case \"number\":\n case \"boolean\":\n case \"array\":\n case \"object\":\n return { ...base, type: p.type };\n case \"node\":\n return {\n ...base,\n anyOf: [\n { type: \"string\" },\n { type: \"number\" },\n { $ref: \"#/$defs/element\" },\n { type: \"array\", items: { $ref: \"#/$defs/node\" } },\n ],\n };\n default:\n return base;\n }\n}\n\nfunction elementSchema(type: string, entry: A2uiCatalogTypeSchema): JsonSchema {\n const props = entry.builtin ? entry.props : { ...A2UI_COMMON_PROPS, ...entry.props };\n const required = Object.entries(entry.props)\n .filter(([, p]) => p.required)\n .map(([name]) => name);\n const properties: JsonSchema = {\n type: { const: type },\n id: { type: \"string\" },\n props: {\n type: \"object\",\n properties: Object.fromEntries(Object.entries(props).map(([n, p]) => [n, propSchema(p)])),\n ...(required.length ? { required } : {}),\n additionalProperties: false,\n },\n on: {\n type: \"object\",\n properties: Object.fromEntries(\n Object.keys(entry.events).map((ev) => [ev, { $ref: \"#/$defs/action\" }]),\n ),\n additionalProperties: false,\n },\n };\n if (entry.children) properties.children = { type: \"array\", items: { $ref: \"#/$defs/node\" } };\n return {\n type: \"object\",\n ...(entry.summary ? { description: entry.summary } : {}),\n properties,\n required: required.length ? [\"type\", \"props\"] : [\"type\"],\n additionalProperties: false,\n };\n}\n\n/** Build the JSON Schema document for `catalog`. Deterministic: sorted types. */\nexport function buildA2uiSurfaceSchema(catalog: A2uiCatalogSchema): JsonSchema {\n const types = Object.keys(catalog).sort();\n return {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n $id: A2UI_SURFACE_SCHEMA_ID,\n title: \"A2UI surface v1 (brand-ui)\",\n description:\n \"An agent-designed screen as data: a tree of brand-ui catalog nodes. Every `type` is a catalog entry, props are checked per type, and `on` binds catalog events to host actions. Text is a plain string child.\",\n type: \"object\",\n properties: {\n a2ui: { const: A2UI_VERSION },\n title: { type: \"string\", description: \"Accessible name of the surface region.\" },\n root: { $ref: \"#/$defs/node\" },\n },\n required: [\"a2ui\", \"root\"],\n additionalProperties: false,\n $defs: {\n action: {\n type: \"object\",\n properties: {\n name: { type: \"string\", minLength: 1, description: \"The host-side verb.\" },\n payload: { description: \"Free JSON attached to the action.\" },\n },\n required: [\"name\"],\n additionalProperties: false,\n },\n node: { anyOf: [{ type: \"string\" }, { $ref: \"#/$defs/element\" }] },\n element: { oneOf: types.map((t) => ({ $ref: `#/$defs/${t}` })) },\n ...Object.fromEntries(types.map((t) => [t, elementSchema(t, catalog[t]!)])),\n },\n };\n}\n"],"mappings":";;;;;;;A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E,MAAM,kBAAkB,CAAC,EAAE;AAAA,MACjE,SAAS,EAAE,OAAO,MAAM,IAAI,CAAC,OAAO,EAAE,MAAM,WAAW,CAAC,GAAG,EAAE,EAAE;AAAA,MAC/D,GAAG,OAAO,YAAY,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,cAAc,GAAG,QAAQ,CAAC,CAAE,CAAC,CAAC,CAAC;AAAA,IAC5E;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,211 @@
1
+ "use client";
2
+
3
+ // src/inline-citation.tsx
4
+ import { Badge } from "@elabs-ai/components-ui";
5
+ import { Carousel, CarouselContent, CarouselItem } from "@elabs-ai/components-ui";
6
+ import { HoverCard, HoverCardContent, HoverCardTrigger } from "@elabs-ai/components-ui";
7
+ import { cn } from "@elabs-ai/components-ui/lib/cn";
8
+ import { useLocale } from "@elabs-ai/components-ui";
9
+ import { ArrowLeftIcon, ArrowRightIcon, BadgeCheckIcon } from "lucide-react";
10
+ import { createContext, useCallback, useContext, useEffect, useState } from "react";
11
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
+ var InlineCitation = ({ className, ...props }) => /* @__PURE__ */ jsx("span", { className: cn("group inline items-center gap-1", className), ...props });
13
+ var InlineCitationText = ({ className, ...props }) => /* @__PURE__ */ jsx("span", { className: cn("transition-colors group-hover:bg-accent", className), ...props });
14
+ var InlineCitationCard = (props) => /* @__PURE__ */ jsx(HoverCard, { closeDelay: 0, openDelay: 0, ...props });
15
+ var hostnameOrRaw = (value) => {
16
+ try {
17
+ return new URL(value).hostname || value;
18
+ } catch {
19
+ return value;
20
+ }
21
+ };
22
+ var inlineCitationSourceLabel = (source) => {
23
+ if (typeof source === "string") {
24
+ return hostnameOrRaw(source);
25
+ }
26
+ return source.label || (source.url ? hostnameOrRaw(source.url) : source.id || "unknown");
27
+ };
28
+ var InlineCitationCardTrigger = ({
29
+ sources,
30
+ className,
31
+ ...props
32
+ }) => /* @__PURE__ */ jsx(HoverCardTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
33
+ Badge,
34
+ {
35
+ className: cn(
36
+ "ms-1 rounded-full border-success/40 bg-success/10 text-success-text",
37
+ className
38
+ ),
39
+ variant: "outline",
40
+ ...props,
41
+ children: [
42
+ /* @__PURE__ */ jsx(BadgeCheckIcon, { "aria-hidden": "true", className: "size-3" }),
43
+ sources[0] ? /* @__PURE__ */ jsxs(Fragment, { children: [
44
+ inlineCitationSourceLabel(sources[0]),
45
+ " ",
46
+ sources.length > 1 && `+${sources.length - 1}`
47
+ ] }) : "unknown"
48
+ ]
49
+ }
50
+ ) });
51
+ var EvidenceChip = InlineCitationCardTrigger;
52
+ var InlineCitationCardBody = ({ className, ...props }) => /* @__PURE__ */ jsx(HoverCardContent, { className: cn("relative w-80 p-0", className), ...props });
53
+ var CarouselApiContext = createContext(void 0);
54
+ var useCarouselApi = () => {
55
+ const context = useContext(CarouselApiContext);
56
+ return context;
57
+ };
58
+ var InlineCitationCarousel = ({
59
+ className,
60
+ children,
61
+ ...props
62
+ }) => {
63
+ const [api, setApi] = useState();
64
+ return /* @__PURE__ */ jsx(CarouselApiContext.Provider, { value: api, children: /* @__PURE__ */ jsx(Carousel, { className: cn("w-full", className), setApi, ...props, children }) });
65
+ };
66
+ var InlineCitationCarouselContent = (props) => /* @__PURE__ */ jsx(CarouselContent, { ...props });
67
+ var InlineCitationCarouselItem = ({
68
+ className,
69
+ ...props
70
+ }) => /* @__PURE__ */ jsx(CarouselItem, { className: cn("w-full space-y-2 p-4 ps-8", className), ...props });
71
+ var InlineCitationCarouselHeader = ({
72
+ className,
73
+ ...props
74
+ }) => /* @__PURE__ */ jsx(
75
+ "div",
76
+ {
77
+ className: cn(
78
+ "flex items-center justify-between gap-2 rounded-t-md bg-secondary p-2",
79
+ className
80
+ ),
81
+ ...props
82
+ }
83
+ );
84
+ var InlineCitationCarouselIndex = ({
85
+ children,
86
+ className,
87
+ ...props
88
+ }) => {
89
+ const api = useCarouselApi();
90
+ const [current, setCurrent] = useState(0);
91
+ const [count, setCount] = useState(0);
92
+ const syncState = useCallback(() => {
93
+ if (!api) {
94
+ return;
95
+ }
96
+ setCount(api.scrollSnapList().length);
97
+ setCurrent(api.selectedScrollSnap() + 1);
98
+ }, [api]);
99
+ useEffect(() => {
100
+ if (!api) {
101
+ return;
102
+ }
103
+ syncState();
104
+ api.on("select", syncState);
105
+ return () => {
106
+ api.off("select", syncState);
107
+ };
108
+ }, [api, syncState]);
109
+ return /* @__PURE__ */ jsx(
110
+ "div",
111
+ {
112
+ className: cn(
113
+ "flex flex-1 items-center justify-end px-3 py-1 text-muted-foreground text-meta",
114
+ className
115
+ ),
116
+ ...props,
117
+ children: children ?? `${current}/${count}`
118
+ }
119
+ );
120
+ };
121
+ var InlineCitationCarouselPrev = ({
122
+ className,
123
+ ...props
124
+ }) => {
125
+ const { t } = useLocale();
126
+ const api = useCarouselApi();
127
+ const handleClick = useCallback(() => {
128
+ if (api) {
129
+ api.scrollPrev();
130
+ }
131
+ }, [api]);
132
+ return /* @__PURE__ */ jsx(
133
+ "button",
134
+ {
135
+ "aria-label": t("previous"),
136
+ className: cn("shrink-0", className),
137
+ onClick: handleClick,
138
+ type: "button",
139
+ ...props,
140
+ children: /* @__PURE__ */ jsx(ArrowLeftIcon, { className: "size-4 text-muted-foreground", "data-rtl-flip": true })
141
+ }
142
+ );
143
+ };
144
+ var InlineCitationCarouselNext = ({
145
+ className,
146
+ ...props
147
+ }) => {
148
+ const { t } = useLocale();
149
+ const api = useCarouselApi();
150
+ const handleClick = useCallback(() => {
151
+ if (api) {
152
+ api.scrollNext();
153
+ }
154
+ }, [api]);
155
+ return /* @__PURE__ */ jsx(
156
+ "button",
157
+ {
158
+ "aria-label": t("next"),
159
+ className: cn("shrink-0", className),
160
+ onClick: handleClick,
161
+ type: "button",
162
+ ...props,
163
+ children: /* @__PURE__ */ jsx(ArrowRightIcon, { className: "size-4 text-muted-foreground", "data-rtl-flip": true })
164
+ }
165
+ );
166
+ };
167
+ var InlineCitationSource = ({
168
+ title,
169
+ url,
170
+ description,
171
+ className,
172
+ children,
173
+ ...props
174
+ }) => /* @__PURE__ */ jsxs("div", { className: cn("space-y-1", className), ...props, children: [
175
+ title && /* @__PURE__ */ jsx("h4", { className: "truncate font-medium text-body leading-tight", children: title }),
176
+ url && /* @__PURE__ */ jsx("p", { className: "truncate break-all text-muted-foreground text-meta", children: url }),
177
+ description && /* @__PURE__ */ jsx("p", { className: "line-clamp-3 text-muted-foreground text-body leading-relaxed", children: description }),
178
+ children
179
+ ] });
180
+ var InlineCitationQuote = ({
181
+ children,
182
+ className,
183
+ ...props
184
+ }) => /* @__PURE__ */ jsx(
185
+ "blockquote",
186
+ {
187
+ className: cn("border-muted border-s-2 ps-3 text-muted-foreground text-body italic", className),
188
+ ...props,
189
+ children
190
+ }
191
+ );
192
+
193
+ export {
194
+ InlineCitation,
195
+ InlineCitationText,
196
+ InlineCitationCard,
197
+ inlineCitationSourceLabel,
198
+ InlineCitationCardTrigger,
199
+ EvidenceChip,
200
+ InlineCitationCardBody,
201
+ InlineCitationCarousel,
202
+ InlineCitationCarouselContent,
203
+ InlineCitationCarouselItem,
204
+ InlineCitationCarouselHeader,
205
+ InlineCitationCarouselIndex,
206
+ InlineCitationCarouselPrev,
207
+ InlineCitationCarouselNext,
208
+ InlineCitationSource,
209
+ InlineCitationQuote
210
+ };
211
+ //# sourceMappingURL=chunk-CMOYXNPJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/inline-citation.tsx"],"sourcesContent":["\"use client\";\n\nimport { Badge } from \"@elabs-ai/components-ui\";\nimport type { CarouselApi } from \"@elabs-ai/components-ui\";\nimport { Carousel, CarouselContent, CarouselItem } from \"@elabs-ai/components-ui\";\nimport { HoverCard, HoverCardContent, HoverCardTrigger } from \"@elabs-ai/components-ui\";\nimport { cn } from \"@elabs-ai/components-ui/lib/cn\";\nimport { useLocale } from \"@elabs-ai/components-ui\";\nimport { ArrowLeftIcon, ArrowRightIcon, BadgeCheckIcon } from \"lucide-react\";\nimport type { ComponentProps } from \"react\";\nimport { createContext, useCallback, useContext, useEffect, useState } from \"react\";\n\nexport type InlineCitationProps = ComponentProps<\"span\">;\n\nexport const InlineCitation = ({ className, ...props }: InlineCitationProps) => (\n <span className={cn(\"group inline items-center gap-1\", className)} {...props} />\n);\n\nexport type InlineCitationTextProps = ComponentProps<\"span\">;\n\nexport const InlineCitationText = ({ className, ...props }: InlineCitationTextProps) => (\n <span className={cn(\"transition-colors group-hover:bg-accent\", className)} {...props} />\n);\n\nexport type InlineCitationCardProps = ComponentProps<typeof HoverCard>;\n\nexport const InlineCitationCard = (props: InlineCitationCardProps) => (\n <HoverCard closeDelay={0} openDelay={0} {...props} />\n);\n\n/**\n * A cited source: a bare string — a URL, or any opaque id / human label — or a\n * labelled object.\n *\n * Non-URL sources are first-class. An agent citing a warehouse table, a document\n * id, an uploaded file or a wiki page has no hostname to show, and must not have\n * to synthesize a fake URL to satisfy the chip.\n */\nexport type InlineCitationSourceRef =\n | string\n | {\n /** Opaque identifier, shown when there is no `label` and no `url`. */\n id?: string;\n /** Human-readable label — wins over any hostname derived from `url`. */\n label?: string;\n /** Optional link; its hostname is the fallback label. */\n url?: string;\n };\n\n/** The URL's hostname when `value` parses as one, else `value` itself. Never throws. */\nconst hostnameOrRaw = (value: string): string => {\n try {\n return new URL(value).hostname || value;\n } catch {\n return value;\n }\n};\n\n/**\n * The chip label for a source ref. Exported so consumers can render the same\n * label elsewhere (a footnote list, a tooltip) without re-deriving the rules.\n */\nexport const inlineCitationSourceLabel = (source: InlineCitationSourceRef): string => {\n if (typeof source === \"string\") {\n return hostnameOrRaw(source);\n }\n // `||` not `??` — an upstream field that is present but EMPTY (`label: \"\"`)\n // must still fall through, or the chip renders with no label at all.\n return source.label || (source.url ? hostnameOrRaw(source.url) : source.id || \"unknown\");\n};\n\nexport type InlineCitationCardTriggerProps = ComponentProps<typeof Badge> & {\n sources: InlineCitationSourceRef[];\n};\n\nexport const InlineCitationCardTrigger = ({\n sources,\n className,\n ...props\n}: InlineCitationCardTriggerProps) => (\n <HoverCardTrigger asChild>\n <Badge\n // The 08 §C.1 evidence channel: the green wash marks \"grounded\" — green\n // is reserved for evidence/answer/favourable (research 11 §B.4).\n className={cn(\n \"ms-1 rounded-full border-success/40 bg-success/10 text-success-text\",\n className,\n )}\n variant=\"outline\"\n {...props}\n >\n <BadgeCheckIcon aria-hidden=\"true\" className=\"size-3\" />\n {sources[0] ? (\n <>\n {inlineCitationSourceLabel(sources[0])} {sources.length > 1 && `+${sources.length - 1}`}\n </>\n ) : (\n \"unknown\"\n )}\n </Badge>\n </HoverCardTrigger>\n);\n\nexport type EvidenceChipProps = InlineCitationCardTriggerProps;\n\n/**\n * EvidenceChip — the named front door for the inline evidence interaction\n * (research 11 §B.4): the re-skinned `InlineCitationCardTrigger` (green\n * \"grounded\" wash). Use inside an `InlineCitationCard` (HoverCard) — it reuses\n * the citation carousel wholesale; it is not a new primitive.\n */\nexport const EvidenceChip = InlineCitationCardTrigger;\n\nexport type InlineCitationCardBodyProps = ComponentProps<\"div\">;\n\nexport const InlineCitationCardBody = ({ className, ...props }: InlineCitationCardBodyProps) => (\n <HoverCardContent className={cn(\"relative w-80 p-0\", className)} {...props} />\n);\n\nconst CarouselApiContext = createContext<CarouselApi | undefined>(undefined);\n\nconst useCarouselApi = () => {\n const context = useContext(CarouselApiContext);\n return context;\n};\n\nexport type InlineCitationCarouselProps = ComponentProps<typeof Carousel>;\n\nexport const InlineCitationCarousel = ({\n className,\n children,\n ...props\n}: InlineCitationCarouselProps) => {\n const [api, setApi] = useState<CarouselApi>();\n\n return (\n <CarouselApiContext.Provider value={api}>\n <Carousel className={cn(\"w-full\", className)} setApi={setApi} {...props}>\n {children}\n </Carousel>\n </CarouselApiContext.Provider>\n );\n};\n\nexport type InlineCitationCarouselContentProps = ComponentProps<\"div\">;\n\nexport const InlineCitationCarouselContent = (props: InlineCitationCarouselContentProps) => (\n <CarouselContent {...props} />\n);\n\nexport type InlineCitationCarouselItemProps = ComponentProps<\"div\">;\n\nexport const InlineCitationCarouselItem = ({\n className,\n ...props\n}: InlineCitationCarouselItemProps) => (\n <CarouselItem className={cn(\"w-full space-y-2 p-4 ps-8\", className)} {...props} />\n);\n\nexport type InlineCitationCarouselHeaderProps = ComponentProps<\"div\">;\n\nexport const InlineCitationCarouselHeader = ({\n className,\n ...props\n}: InlineCitationCarouselHeaderProps) => (\n <div\n className={cn(\n \"flex items-center justify-between gap-2 rounded-t-md bg-secondary p-2\",\n className,\n )}\n {...props}\n />\n);\n\nexport type InlineCitationCarouselIndexProps = ComponentProps<\"div\">;\n\nexport const InlineCitationCarouselIndex = ({\n children,\n className,\n ...props\n}: InlineCitationCarouselIndexProps) => {\n const api = useCarouselApi();\n const [current, setCurrent] = useState(0);\n const [count, setCount] = useState(0);\n\n const syncState = useCallback(() => {\n if (!api) {\n return;\n }\n setCount(api.scrollSnapList().length);\n setCurrent(api.selectedScrollSnap() + 1);\n }, [api]);\n\n useEffect(() => {\n if (!api) {\n return;\n }\n\n syncState();\n\n api.on(\"select\", syncState);\n\n return () => {\n api.off(\"select\", syncState);\n };\n }, [api, syncState]);\n\n return (\n <div\n className={cn(\n \"flex flex-1 items-center justify-end px-3 py-1 text-muted-foreground text-meta\",\n className,\n )}\n {...props}\n >\n {children ?? `${current}/${count}`}\n </div>\n );\n};\n\nexport type InlineCitationCarouselPrevProps = ComponentProps<\"button\">;\n\nexport const InlineCitationCarouselPrev = ({\n className,\n ...props\n}: InlineCitationCarouselPrevProps) => {\n const { t } = useLocale();\n const api = useCarouselApi();\n\n const handleClick = useCallback(() => {\n if (api) {\n api.scrollPrev();\n }\n }, [api]);\n\n return (\n <button\n aria-label={t(\"previous\")}\n className={cn(\"shrink-0\", className)}\n onClick={handleClick}\n type=\"button\"\n {...props}\n >\n <ArrowLeftIcon className=\"size-4 text-muted-foreground\" data-rtl-flip />\n </button>\n );\n};\n\nexport type InlineCitationCarouselNextProps = ComponentProps<\"button\">;\n\nexport const InlineCitationCarouselNext = ({\n className,\n ...props\n}: InlineCitationCarouselNextProps) => {\n const { t } = useLocale();\n const api = useCarouselApi();\n\n const handleClick = useCallback(() => {\n if (api) {\n api.scrollNext();\n }\n }, [api]);\n\n return (\n <button\n aria-label={t(\"next\")}\n className={cn(\"shrink-0\", className)}\n onClick={handleClick}\n type=\"button\"\n {...props}\n >\n <ArrowRightIcon className=\"size-4 text-muted-foreground\" data-rtl-flip />\n </button>\n );\n};\n\nexport type InlineCitationSourceProps = ComponentProps<\"div\"> & {\n title?: string;\n url?: string;\n description?: string;\n};\n\nexport const InlineCitationSource = ({\n title,\n url,\n description,\n className,\n children,\n ...props\n}: InlineCitationSourceProps) => (\n <div className={cn(\"space-y-1\", className)} {...props}>\n {title && <h4 className=\"truncate font-medium text-body leading-tight\">{title}</h4>}\n {url && <p className=\"truncate break-all text-muted-foreground text-meta\">{url}</p>}\n {description && (\n <p className=\"line-clamp-3 text-muted-foreground text-body leading-relaxed\">{description}</p>\n )}\n {children}\n </div>\n);\n\nexport type InlineCitationQuoteProps = ComponentProps<\"blockquote\">;\n\nexport const InlineCitationQuote = ({\n children,\n className,\n ...props\n}: InlineCitationQuoteProps) => (\n <blockquote\n className={cn(\"border-muted border-s-2 ps-3 text-muted-foreground text-body italic\", className)}\n {...props}\n >\n {children}\n </blockquote>\n);\n"],"mappings":";;;AAEA,SAAS,aAAa;AAEtB,SAAS,UAAU,iBAAiB,oBAAoB;AACxD,SAAS,WAAW,kBAAkB,wBAAwB;AAC9D,SAAS,UAAU;AACnB,SAAS,iBAAiB;AAC1B,SAAS,eAAe,gBAAgB,sBAAsB;AAE9D,SAAS,eAAe,aAAa,YAAY,WAAW,gBAAgB;AAK1E,SA8EM,UA9EN,KA8EM,YA9EN;AADK,IAAM,iBAAiB,CAAC,EAAE,WAAW,GAAG,MAAM,MACnD,oBAAC,UAAK,WAAW,GAAG,mCAAmC,SAAS,GAAI,GAAG,OAAO;AAKzE,IAAM,qBAAqB,CAAC,EAA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,oBAAC,OAAE,WAAU,sDAAsD,eAAI;AAAA,EAC9E,eACC,oBAAC,OAAE,WAAU,gEAAgE,uBAAY;AAAA,EAE1F;AAAA,GACH;AAKK,IAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA;AAAA,IACC,WAAW,GAAG,uEAAuE,SAAS;AAAA,IAC7F,GAAG;AAAA,IAEH;AAAA;AACH;","names":[]}
@@ -0,0 +1,74 @@
1
+ "use client";
2
+ import {
3
+ CodeBlock
4
+ } from "./chunk-TWPHAJNM.js";
5
+
6
+ // src/agent.tsx
7
+ import {
8
+ Accordion,
9
+ AccordionContent,
10
+ AccordionItem,
11
+ AccordionTrigger
12
+ } from "@elabs-ai/components-ui";
13
+ import { Badge } from "@elabs-ai/components-ui";
14
+ import { useLocale } from "@elabs-ai/components-ui";
15
+ import { cn } from "@elabs-ai/components-ui/lib/cn";
16
+ import { BotIcon } from "lucide-react";
17
+ import { memo } from "react";
18
+ import { jsx, jsxs } from "react/jsx-runtime";
19
+ var Agent = memo(({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("not-prose w-full rounded-md border", className), ...props }));
20
+ var AgentHeader = memo(({ className, name, model, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("flex w-full items-center justify-between gap-4 p-3", className), ...props, children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
21
+ /* @__PURE__ */ jsx(BotIcon, { className: "size-4 text-muted-foreground" }),
22
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-body", children: name }),
23
+ model && /* @__PURE__ */ jsx(Badge, { className: "font-mono text-meta", variant: "secondary", children: model })
24
+ ] }) }));
25
+ var AgentContent = memo(({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("space-y-4 p-4 pt-0", className), ...props }));
26
+ var AgentInstructions = memo(
27
+ ({ className, children, ...props }) => {
28
+ const { t } = useLocale();
29
+ return /* @__PURE__ */ jsxs("div", { className: cn("space-y-2", className), ...props, children: [
30
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-muted-foreground text-body", children: t("ai.agent.instructions") }),
31
+ /* @__PURE__ */ jsx("div", { className: "rounded-md bg-muted/50 p-3 text-muted-foreground text-body", children: /* @__PURE__ */ jsx("p", { children }) })
32
+ ] });
33
+ }
34
+ );
35
+ var AgentTools = memo(({ className, ...props }) => {
36
+ const { t } = useLocale();
37
+ return /* @__PURE__ */ jsxs("div", { className: cn("space-y-2", className), children: [
38
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-muted-foreground text-body", children: t("ai.agent.tools") }),
39
+ /* @__PURE__ */ jsx(Accordion, { className: "rounded-md border", ...props })
40
+ ] });
41
+ });
42
+ var AgentTool = memo(({ className, tool, value, ...props }) => {
43
+ const schema = "jsonSchema" in tool && tool.jsonSchema ? tool.jsonSchema : tool.inputSchema;
44
+ const description = typeof tool.description === "string" ? tool.description : void 0;
45
+ return /* @__PURE__ */ jsxs(AccordionItem, { className: cn("border-b last:border-b-0", className), value, ...props, children: [
46
+ /* @__PURE__ */ jsx(AccordionTrigger, { className: "px-3 py-2 text-body hover:no-underline", children: description ?? "No description" }),
47
+ /* @__PURE__ */ jsx(AccordionContent, { className: "px-3 pb-3", children: /* @__PURE__ */ jsx("div", { className: "rounded-md bg-muted/50", children: /* @__PURE__ */ jsx(CodeBlock, { code: JSON.stringify(schema, null, 2), language: "json" }) }) })
48
+ ] });
49
+ });
50
+ var AgentOutput = memo(({ className, schema, ...props }) => {
51
+ const { t } = useLocale();
52
+ return /* @__PURE__ */ jsxs("div", { className: cn("space-y-2", className), ...props, children: [
53
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-muted-foreground text-body", children: t("ai.agent.outputSchema") }),
54
+ /* @__PURE__ */ jsx("div", { className: "rounded-md bg-muted/50", children: /* @__PURE__ */ jsx(CodeBlock, { code: schema, language: "typescript" }) })
55
+ ] });
56
+ });
57
+ Agent.displayName = "Agent";
58
+ AgentHeader.displayName = "AgentHeader";
59
+ AgentContent.displayName = "AgentContent";
60
+ AgentInstructions.displayName = "AgentInstructions";
61
+ AgentTools.displayName = "AgentTools";
62
+ AgentTool.displayName = "AgentTool";
63
+ AgentOutput.displayName = "AgentOutput";
64
+
65
+ export {
66
+ Agent,
67
+ AgentHeader,
68
+ AgentContent,
69
+ AgentInstructions,
70
+ AgentTools,
71
+ AgentTool,
72
+ AgentOutput
73
+ };
74
+ //# sourceMappingURL=chunk-CZP3RHC4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/agent.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from \"@elabs-ai/components-ui\";\nimport { Badge } from \"@elabs-ai/components-ui\";\nimport { useLocale } from \"@elabs-ai/components-ui\";\nimport { cn } from \"@elabs-ai/components-ui/lib/cn\";\nimport type { Tool } from \"ai\";\nimport { BotIcon } from \"lucide-react\";\nimport type { ComponentProps } from \"react\";\nimport { memo } from \"react\";\n\nimport { CodeBlock } from \"./code-block\";\n\nexport type AgentProps = ComponentProps<\"div\">;\n\nexport const Agent = memo(({ className, ...props }: AgentProps) => (\n <div className={cn(\"not-prose w-full rounded-md border\", className)} {...props} />\n));\n\nexport type AgentHeaderProps = ComponentProps<\"div\"> & {\n name: string;\n model?: string;\n};\n\nexport const AgentHeader = memo(({ className, name, model, ...props }: AgentHeaderProps) => (\n <div className={cn(\"flex w-full items-center justify-between gap-4 p-3\", className)} {...props}>\n <div className=\"flex items-center gap-2\">\n <BotIcon className=\"size-4 text-muted-foreground\" />\n <span className=\"font-medium text-body\">{name}</span>\n {model && (\n <Badge className=\"font-mono text-meta\" variant=\"secondary\">\n {model}\n </Badge>\n )}\n </div>\n </div>\n));\n\nexport type AgentContentProps = ComponentProps<\"div\">;\n\nexport const AgentContent = memo(({ className, ...props }: AgentContentProps) => (\n <div className={cn(\"space-y-4 p-4 pt-0\", className)} {...props} />\n));\n\nexport type AgentInstructionsProps = ComponentProps<\"div\"> & {\n children: string;\n};\n\nexport const AgentInstructions = memo(\n ({ className, children, ...props }: AgentInstructionsProps) => {\n const { t } = useLocale();\n return (\n <div className={cn(\"space-y-2\", className)} {...props}>\n <span className=\"font-medium text-muted-foreground text-body\">\n {t(\"ai.agent.instructions\")}\n </span>\n <div className=\"rounded-md bg-muted/50 p-3 text-muted-foreground text-body\">\n <p>{children}</p>\n </div>\n </div>\n );\n },\n);\n\nexport type AgentToolsProps = ComponentProps<typeof Accordion>;\n\nexport const AgentTools = memo(({ className, ...props }: AgentToolsProps) => {\n const { t } = useLocale();\n return (\n <div className={cn(\"space-y-2\", className)}>\n <span className=\"font-medium text-muted-foreground text-body\">{t(\"ai.agent.tools\")}</span>\n <Accordion className=\"rounded-md border\" {...props} />\n </div>\n );\n});\n\nexport type AgentToolProps = ComponentProps<typeof AccordionItem> & {\n tool: Tool;\n};\n\nexport const AgentTool = memo(({ className, tool, value, ...props }: AgentToolProps) => {\n const schema = \"jsonSchema\" in tool && tool.jsonSchema ? tool.jsonSchema : tool.inputSchema;\n // `tool.description` may be a fixed string OR (ai@7+) a function of the live\n // call context (`(options) => string`) for a per-call dynamic description.\n // AgentTool renders a static list, so it has no call context to invoke that\n // function with — show it only when it is already a plain string.\n const description = typeof tool.description === \"string\" ? tool.description : undefined;\n\n return (\n <AccordionItem className={cn(\"border-b last:border-b-0\", className)} value={value} {...props}>\n <AccordionTrigger className=\"px-3 py-2 text-body hover:no-underline\">\n {description ?? \"No description\"}\n </AccordionTrigger>\n <AccordionContent className=\"px-3 pb-3\">\n <div className=\"rounded-md bg-muted/50\">\n <CodeBlock code={JSON.stringify(schema, null, 2)} language=\"json\" />\n </div>\n </AccordionContent>\n </AccordionItem>\n );\n});\n\nexport type AgentOutputProps = ComponentProps<\"div\"> & {\n schema: string;\n};\n\nexport const AgentOutput = memo(({ className, schema, ...props }: AgentOutputProps) => {\n const { t } = useLocale();\n return (\n <div className={cn(\"space-y-2\", className)} {...props}>\n <span className=\"font-medium text-muted-foreground text-body\">\n {t(\"ai.agent.outputSchema\")}\n </span>\n <div className=\"rounded-md bg-muted/50\">\n <CodeBlock code={schema} language=\"typescript\" />\n </div>\n </div>\n );\n});\n\nAgent.displayName = \"Agent\";\nAgentHeader.displayName = \"AgentHeader\";\nAgentContent.displayName = \"AgentContent\";\nAgentInstructions.displayName = \"AgentInstructions\";\nAgentTools.displayName = \"AgentTools\";\nAgentTool.displayName = \"AgentTool\";\nAgentOutput.displayName = \"AgentOutput\";\n"],"mappings":";;;;;;AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,aAAa;AACtB,SAAS,iBAAiB;AAC1B,SAAS,UAAU;AAEnB,SAAS,eAAe;AAExB,SAAS,YAAY;AAOnB,cAUE,YAVF;AADK,IAAM,QAAQ,KAAK,CAAC,EAAE,WAAW,GAAG,MAAM,MAC/C,oBAAC,SAAI,WAAW,GAAG,sCAAsC,SAAS,GAAI,GAAG,OAAO,CACjF;AAOM,IAAM,cAAc,KAAK,CAAC,EAAE,WAAW,MAAM,OAAO,GAAG,MAAM,MAClE,oBAAC,SAAI,WAAW,GAAG,sDAAsD,SAAS,GAAI,GAAG,OACvF,+BAAC,SAAI,WAAU,2BACb;AAAA,sBAAC,WAAQ,WAAU,gCAA+B;AAAA,EAClD,oBAAC,UAAK,WAAU,yBAAyB,gBAAK;AAAA,EAC7C,SACC,oBAAC,SAAM,WAAU,uBAAsB,SAAQ,aAC5C,iBACH;AAAA,GAEJ,GACF,CACD;AAIM,IAAM,eAAe,KAAK,CAAC,EAAE,WAAW,GAAG,MAAM,MACtD,oBAAC,SAAI,WAAW,GAAG,sBAAsB,SAAS,GAAI,GAAG,OAAO,CACjE;AAMM,IAAM,oBAAoB;AAAA,EAC/B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,MAA8B;AAC7D,UAAM,EAAE,EAAE,IAAI,UAAU;AACxB,WACE,qBAAC,SAAI,WAAW,GAAG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Q,UAAS,cAAa,GACjD;AAAA,KACF;AAEJ,CAAC;AAED,MAAM,cAAc;AACpB,YAAY,cAAc;AAC1B,aAAa,cAAc;AAC3B,kBAAkB,cAAc;AAChC,WAAW,cAAc;AACzB,UAAU,cAAc;AACxB,YAAY,cAAc;","names":[]}
@@ -0,0 +1,112 @@
1
+ "use client";
2
+
3
+ // src/artifact.tsx
4
+ import { Button, Skeleton, useLocale } from "@elabs-ai/components-ui";
5
+ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@elabs-ai/components-ui";
6
+ import { cn } from "@elabs-ai/components-ui/lib/cn";
7
+ import { XIcon } from "lucide-react";
8
+ import { createContext, use, useMemo } from "react";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
+ var ArtifactContext = createContext({ loading: false });
11
+ var Artifact = ({ className, loading = false, children, ...props }) => {
12
+ const contextValue = useMemo(() => ({ loading }), [loading]);
13
+ return /* @__PURE__ */ jsx(ArtifactContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
14
+ "div",
15
+ {
16
+ className: cn(
17
+ "flex flex-col overflow-hidden rounded-lg border bg-background shadow-sm",
18
+ className
19
+ ),
20
+ ...props,
21
+ children
22
+ }
23
+ ) });
24
+ };
25
+ var ArtifactHeader = ({ className, ...props }) => /* @__PURE__ */ jsx(
26
+ "div",
27
+ {
28
+ className: cn("flex items-center justify-between border-b bg-muted/50 px-4 py-3", className),
29
+ ...props
30
+ }
31
+ );
32
+ var ArtifactClose = ({
33
+ className,
34
+ children,
35
+ size = "sm",
36
+ variant = "ghost",
37
+ ...props
38
+ }) => {
39
+ const { t } = useLocale();
40
+ return /* @__PURE__ */ jsxs(
41
+ Button,
42
+ {
43
+ className: cn("size-8 p-0 text-muted-foreground hover:text-foreground", className),
44
+ size,
45
+ type: "button",
46
+ variant,
47
+ ...props,
48
+ children: [
49
+ children ?? /* @__PURE__ */ jsx(XIcon, { className: "size-4" }),
50
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: t("close") })
51
+ ]
52
+ }
53
+ );
54
+ };
55
+ var ArtifactTitle = ({ className, ...props }) => /* @__PURE__ */ jsx("p", { className: cn("font-medium text-foreground text-body", className), ...props });
56
+ var ArtifactDescription = ({ className, ...props }) => /* @__PURE__ */ jsx("p", { className: cn("text-muted-foreground text-body", className), ...props });
57
+ var ArtifactActions = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("flex items-center gap-1", className), ...props });
58
+ var ArtifactAction = ({
59
+ tooltip,
60
+ label,
61
+ icon: Icon,
62
+ children,
63
+ className,
64
+ size = "sm",
65
+ variant = "ghost",
66
+ ...props
67
+ }) => {
68
+ const button = /* @__PURE__ */ jsxs(
69
+ Button,
70
+ {
71
+ className: cn("size-8 p-0 text-muted-foreground hover:text-foreground", className),
72
+ size,
73
+ type: "button",
74
+ variant,
75
+ ...props,
76
+ children: [
77
+ Icon ? /* @__PURE__ */ jsx(Icon, { className: "size-4" }) : children,
78
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: label || tooltip })
79
+ ]
80
+ }
81
+ );
82
+ if (tooltip) {
83
+ return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
84
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: button }),
85
+ /* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: tooltip }) })
86
+ ] }) });
87
+ }
88
+ return button;
89
+ };
90
+ var ArtifactContent = ({ className, children, ...props }) => {
91
+ const { loading } = use(ArtifactContext);
92
+ const { t } = useLocale();
93
+ return /* @__PURE__ */ jsx("div", { className: cn("flex-1 overflow-auto p-4", className), ...props, children: loading ? /* @__PURE__ */ jsxs("div", { className: "space-y-2", role: "status", "aria-live": "polite", children: [
94
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: t("loading") }),
95
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-3/4" }),
96
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-full" }),
97
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-5/6" }),
98
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-1/2" })
99
+ ] }) : children });
100
+ };
101
+
102
+ export {
103
+ Artifact,
104
+ ArtifactHeader,
105
+ ArtifactClose,
106
+ ArtifactTitle,
107
+ ArtifactDescription,
108
+ ArtifactActions,
109
+ ArtifactAction,
110
+ ArtifactContent
111
+ };
112
+ //# sourceMappingURL=chunk-DDG5JHQT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/artifact.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button, Skeleton, useLocale } from \"@elabs-ai/components-ui\";\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"@elabs-ai/components-ui\";\nimport { cn } from \"@elabs-ai/components-ui/lib/cn\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { XIcon } from \"lucide-react\";\nimport type { ComponentProps, HTMLAttributes } from \"react\";\nimport { createContext, use, useMemo } from \"react\";\n\n/**\n * Shared `loading` state (composition-patterns — lifted into the provider):\n * `Artifact` is the ONLY place that knows whether the body has arrived;\n * `ArtifactContent` reads the interface and renders its skeleton, while\n * `ArtifactHeader`/`ArtifactTitle` (ordinary children of `Artifact`) keep\n * rendering normally, untouched by the not-ready state.\n */\nconst ArtifactContext = createContext<{ loading: boolean }>({ loading: false });\n\nexport type ArtifactProps = HTMLAttributes<HTMLDivElement> & {\n /**\n * The artifact body has not arrived yet (loading-states.md loading signal).\n * ArtifactContent renders a layout-shaped skeleton instead of its\n * children; ArtifactHeader/ArtifactTitle keep rendering as passed.\n * @default false\n */\n loading?: boolean;\n};\n\nexport const Artifact = ({ className, loading = false, children, ...props }: ArtifactProps) => {\n const contextValue = useMemo(() => ({ loading }), [loading]);\n\n return (\n <ArtifactContext.Provider value={contextValue}>\n <div\n // KEEP this border (#194, research 08 §G.5): it is redundant on light\n // (the #187 page-ground recess + shadow already lift the frame), but under\n // high decoration the shadow is zeroed and the border becomes the\n // SOLE structural cue — the canonical \"redundant-on-light, sole-cue-under-\n // decoration\" KEEP example. Do not drop it in a border-noise pass.\n className={cn(\n \"flex flex-col overflow-hidden rounded-lg border bg-background shadow-sm\",\n className,\n )}\n {...props}\n >\n {children}\n </div>\n </ArtifactContext.Provider>\n );\n};\n\nexport type ArtifactHeaderProps = HTMLAttributes<HTMLDivElement>;\n\nexport const ArtifactHeader = ({ className, ...props }: ArtifactHeaderProps) => (\n <div\n className={cn(\"flex items-center justify-between border-b bg-muted/50 px-4 py-3\", className)}\n {...props}\n />\n);\n\nexport type ArtifactCloseProps = ComponentProps<typeof Button>;\n\nexport const ArtifactClose = ({\n className,\n children,\n size = \"sm\",\n variant = \"ghost\",\n ...props\n}: ArtifactCloseProps) => {\n const { t } = useLocale();\n return (\n <Button\n className={cn(\"size-8 p-0 text-muted-foreground hover:text-foreground\", className)}\n size={size}\n type=\"button\"\n variant={variant}\n {...props}\n >\n {children ?? <XIcon className=\"size-4\" />}\n <span className=\"sr-only\">{t(\"close\")}</span>\n </Button>\n );\n};\n\nexport type ArtifactTitleProps = HTMLAttributes<HTMLParagraphElement>;\n\nexport const ArtifactTitle = ({ className, ...props }: ArtifactTitleProps) => (\n <p className={cn(\"font-medium text-foreground text-body\", className)} {...props} />\n);\n\nexport type ArtifactDescriptionProps = HTMLAttributes<HTMLParagraphElement>;\n\nexport const ArtifactDescription = ({ className, ...props }: ArtifactDescriptionProps) => (\n <p className={cn(\"text-muted-foreground text-body\", className)} {...props} />\n);\n\nexport type ArtifactActionsProps = HTMLAttributes<HTMLDivElement>;\n\nexport const ArtifactActions = ({ className, ...props }: ArtifactActionsProps) => (\n <div className={cn(\"flex items-center gap-1\", className)} {...props} />\n);\n\nexport type ArtifactActionProps = ComponentProps<typeof Button> & {\n tooltip?: string;\n label?: string;\n icon?: LucideIcon;\n};\n\nexport const ArtifactAction = ({\n tooltip,\n label,\n icon: Icon,\n children,\n className,\n size = \"sm\",\n variant = \"ghost\",\n ...props\n}: ArtifactActionProps) => {\n const button = (\n <Button\n className={cn(\"size-8 p-0 text-muted-foreground hover:text-foreground\", className)}\n size={size}\n type=\"button\"\n variant={variant}\n {...props}\n >\n {Icon ? <Icon className=\"size-4\" /> : children}\n <span className=\"sr-only\">{label || tooltip}</span>\n </Button>\n );\n\n if (tooltip) {\n return (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent>\n <p>{tooltip}</p>\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n }\n\n return button;\n};\n\nexport type ArtifactContentProps = HTMLAttributes<HTMLDivElement>;\n\nexport const ArtifactContent = ({ className, children, ...props }: ArtifactContentProps) => {\n const { loading } = use(ArtifactContext);\n const { t } = useLocale();\n\n return (\n <div className={cn(\"flex-1 overflow-auto p-4\", className)} {...props}>\n {loading ? (\n <div className=\"space-y-2\" role=\"status\" aria-live=\"polite\">\n <span className=\"sr-only\">{t(\"loading\")}</span>\n <Skeleton className=\"h-4 w-3/4\" />\n <Skeleton className=\"h-4 w-full\" />\n <Skeleton className=\"h-4 w-5/6\" />\n <Skeleton className=\"h-4 w-1/2\" />\n </div>\n ) : (\n children\n )}\n </div>\n );\n};\n"],"mappings":";;;AAEA,SAAS,QAAQ,UAAU,iBAAiB;AAC5C,SAAS,SAAS,gBAAgB,iBAAiB,sBAAsB;AACzE,SAAS,UAAU;AAEnB,SAAS,aAAa;AAEtB,SAAS,eAAe,KAAK,eAAe;AA0BtC,cAsCF,YAtCE;AAjBN,IAAM,kBAAkB,cAAoC,EAAE,SAAS,MAAM,CAAC;AAYvE,IAAM,WAAW,CAAC,EAAE,WAAW,UAAU,OAAO,UAAU,GAAG,MAAM,MAAqB;AAC7F,QAAM,eAAe,QAAQ,OAAO,EAAE,QAAQ,IAAI,CAAC,OAAO,CAAC;AAE3D,SACE,oBAAC,gBAAgB,UAAhB,EAAyB,OAAO,cAC/B;AAAA,IAAC;AAAA;AAAA,MA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;AAAA,MACA,MAAK;AAAA,MACL;AAAA,MACC,GAAG;AAAA,MAEH;AAAA,eAAO,oBAAC,QAAK,WAAU,UAAS,IAAK;AAAA,QACtC,oBAAC,UAAK,WAAU,WAAW,mBAAS,SAAQ;AAAA;AAAA;AAAA,EAC9C;AAGF,MAAI,SAAS;AACX,WACE,oBAAC,mBACC,+BAAC,WACC;AAAA,0BAAC,kBAAe,SAAO,MAAE,kBAAO;AAAA,MAChC,oBAAC,kBACC,8BAAC,OAAG,mBAAQ,GACd;AAAA,OACF,GACF;AAAA,EAEJ;AAEA,SAAO;AACT;AAIO,IAAM,kBAAkB,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,MAA4B;AAC1F,QAAM,EAAE,QAAQ,IAAI,IAAI,eAAe;AACvC,QAAM,EAAE,EAAE,IAAI,UAAU;AAExB,SACE,oBAAC,SAAI,WAAW,GAAG,4BAA4B,SAAS,GAAI,GAAG,OAC5D,oBACC,qBAAC,SAAI,WAAU,aAAY,MAAK,UAAS,aAAU,UACjD;AAAA,wBAAC,UAAK,WAAU,WAAW,YAAE,SAAS,GAAE;AAAA,IACxC,oBAAC,YAAS,WAAU,aAAY;AAAA,IAChC,oBAAC,YAAS,WAAU,cAAa;AAAA,IACjC,oBAAC,YAAS,WAAU,aAAY;AAAA,IAChC,oBAAC,YAAS,WAAU,aAAY;AAAA,KAClC,IAEA,UAEJ;AAEJ;","names":[]}
@@ -0,0 +1,38 @@
1
+ "use client";
2
+
3
+ // src/checkpoint.tsx
4
+ import { Button } from "@elabs-ai/components-ui";
5
+ import { Separator } from "@elabs-ai/components-ui";
6
+ import { Tooltip, TooltipContent, TooltipTrigger } from "@elabs-ai/components-ui";
7
+ import { cn } from "@elabs-ai/components-ui/lib/cn";
8
+ import { BookmarkIcon } from "lucide-react";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
+ var Checkpoint = ({ className, children, ...props }) => /* @__PURE__ */ jsxs(
11
+ "div",
12
+ {
13
+ className: cn("flex items-center gap-0.5 overflow-hidden text-muted-foreground", className),
14
+ ...props,
15
+ children: [
16
+ children,
17
+ /* @__PURE__ */ jsx(Separator, {})
18
+ ]
19
+ }
20
+ );
21
+ var CheckpointIcon = ({ className, children, ...props }) => children ?? /* @__PURE__ */ jsx(BookmarkIcon, { className: cn("size-4 shrink-0", className), ...props });
22
+ var CheckpointTrigger = ({
23
+ children,
24
+ variant = "ghost",
25
+ size = "sm",
26
+ tooltip,
27
+ ...props
28
+ }) => tooltip ? /* @__PURE__ */ jsxs(Tooltip, { children: [
29
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size, type: "button", variant, ...props, children }) }),
30
+ /* @__PURE__ */ jsx(TooltipContent, { align: "start", side: "bottom", children: tooltip })
31
+ ] }) : /* @__PURE__ */ jsx(Button, { size, type: "button", variant, ...props, children });
32
+
33
+ export {
34
+ Checkpoint,
35
+ CheckpointIcon,
36
+ CheckpointTrigger
37
+ };
38
+ //# sourceMappingURL=chunk-DJODXO7I.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/checkpoint.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button } from \"@elabs-ai/components-ui\";\nimport { Separator } from \"@elabs-ai/components-ui\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@elabs-ai/components-ui\";\nimport { cn } from \"@elabs-ai/components-ui/lib/cn\";\nimport type { LucideProps } from \"lucide-react\";\nimport { BookmarkIcon } from \"lucide-react\";\nimport type { ComponentProps, HTMLAttributes } from \"react\";\n\nexport type CheckpointProps = HTMLAttributes<HTMLDivElement>;\n\nexport const Checkpoint = ({ className, children, ...props }: CheckpointProps) => (\n <div\n className={cn(\"flex items-center gap-0.5 overflow-hidden text-muted-foreground\", className)}\n {...props}\n >\n {children}\n <Separator />\n </div>\n);\n\nexport type CheckpointIconProps = LucideProps;\n\nexport const CheckpointIcon = ({ className, children, ...props }: CheckpointIconProps) =>\n children ?? <BookmarkIcon className={cn(\"size-4 shrink-0\", className)} {...props} />;\n\nexport type CheckpointTriggerProps = ComponentProps<typeof Button> & {\n tooltip?: string;\n};\n\nexport const CheckpointTrigger = ({\n children,\n variant = \"ghost\",\n size = \"sm\",\n tooltip,\n ...props\n}: CheckpointTriggerProps) =>\n tooltip ? (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button size={size} type=\"button\" variant={variant} {...props}>\n {children}\n </Button>\n </TooltipTrigger>\n <TooltipContent align=\"start\" side=\"bottom\">\n {tooltip}\n </TooltipContent>\n </Tooltip>\n ) : (\n <Button size={size} type=\"button\" variant={variant} {...props}>\n {children}\n </Button>\n );\n"],"mappings":";;;AAEA,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,SAAS,SAAS,gBAAgB,sBAAsB;AACxD,SAAS,UAAU;AAEnB,SAAS,oBAAoB;AAM3B,SAKE,KALF;AADK,IAAM,aAAa,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,MACzD;AAAA,EAAC;AAAA;AAAA,IACC,WAAW,GAAG,mEAAmE,SAAS;AAAA,IACzF,GAAG;AAAA,IAEH;AAAA;AAAA,MACD,oBAAC,aAAU;AAAA;AAAA;AACb;AAKK,IAAM,iBAAiB,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,MAC7D,YAAY,oBAAC,gBAAa,WAAW,GAAG,mBAAmB,SAAS,GAAI,GAAG,OAAO;AAM7E,IAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA,UAAU;AAAA,EACV,OAAO;AAAA,EACP;AAAA,EACA,GAAG;AACL,MACE,UACE,qBAAC,WACC;AAAA,sBAAC,kBAAe,SAAO,MACrB,8BAAC,UAAO,MAAY,MAAK,UAAS,SAAmB,GAAG,OACrD,UACH,GACF;AAAA,EACA,oBAAC,kBAAe,OAAM,SAAQ,MAAK,UAChC,mBACH;AAAA,GACF,IAEA,oBAAC,UAAO,MAAY,MAAK,UAAS,SAAmB,GAAG,OACrD,UACH;","names":[]}