@elabs-ai/components-ai 4.2.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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-AXMNJMMH.js +984 -0
  106. package/dist/chunk-AXMNJMMH.js.map +1 -0
  107. package/dist/chunk-BA3AEMOU.js +21 -0
  108. package/dist/chunk-BA3AEMOU.js.map +1 -0
  109. package/dist/chunk-BBHFOYML.js +336 -0
  110. package/dist/chunk-BBHFOYML.js.map +1 -0
  111. package/dist/chunk-BHUVISIY.js +221 -0
  112. package/dist/chunk-BHUVISIY.js.map +1 -0
  113. package/dist/chunk-BM2LWERA.js +100 -0
  114. package/dist/chunk-BM2LWERA.js.map +1 -0
  115. package/dist/chunk-CMOYXNPJ.js +211 -0
  116. package/dist/chunk-CMOYXNPJ.js.map +1 -0
  117. package/dist/chunk-CZP3RHC4.js +74 -0
  118. package/dist/chunk-CZP3RHC4.js.map +1 -0
  119. package/dist/chunk-DDG5JHQT.js +112 -0
  120. package/dist/chunk-DDG5JHQT.js.map +1 -0
  121. package/dist/chunk-DJODXO7I.js +38 -0
  122. package/dist/chunk-DJODXO7I.js.map +1 -0
  123. package/dist/chunk-DWJDJLPU.js +192 -0
  124. package/dist/chunk-DWJDJLPU.js.map +1 -0
  125. package/dist/chunk-DZW6LM22.js +45 -0
  126. package/dist/chunk-DZW6LM22.js.map +1 -0
  127. package/dist/chunk-ELGCZLZF.js +305 -0
  128. package/dist/chunk-ELGCZLZF.js.map +1 -0
  129. package/dist/chunk-EV3U6ZZB.js +209 -0
  130. package/dist/chunk-EV3U6ZZB.js.map +1 -0
  131. package/dist/chunk-EY7LVUKQ.js +87 -0
  132. package/dist/chunk-EY7LVUKQ.js.map +1 -0
  133. package/dist/chunk-F4C74F7M.js +230 -0
  134. package/dist/chunk-F4C74F7M.js.map +1 -0
  135. package/dist/chunk-FERYDFZA.js +108 -0
  136. package/dist/chunk-FERYDFZA.js.map +1 -0
  137. package/dist/chunk-FUIYG2DS.js +166 -0
  138. package/dist/chunk-FUIYG2DS.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-LMNSBOBG.js +19 -0
  156. package/dist/chunk-LMNSBOBG.js.map +1 -0
  157. package/dist/chunk-MBI7D6IL.js +42 -0
  158. package/dist/chunk-MBI7D6IL.js.map +1 -0
  159. package/dist/chunk-MLFMYCPH.js +192 -0
  160. package/dist/chunk-MLFMYCPH.js.map +1 -0
  161. package/dist/chunk-MOK66734.js +33 -0
  162. package/dist/chunk-MOK66734.js.map +1 -0
  163. package/dist/chunk-MXTAWPYM.js +196 -0
  164. package/dist/chunk-MXTAWPYM.js.map +1 -0
  165. package/dist/chunk-NCL2UZKI.js +96 -0
  166. package/dist/chunk-NCL2UZKI.js.map +1 -0
  167. package/dist/chunk-NET4YLRY.js +107 -0
  168. package/dist/chunk-NET4YLRY.js.map +1 -0
  169. package/dist/chunk-NIG67CFM.js +329 -0
  170. package/dist/chunk-NIG67CFM.js.map +1 -0
  171. package/dist/chunk-NMVNNO3L.js +10 -0
  172. package/dist/chunk-NMVNNO3L.js.map +1 -0
  173. package/dist/chunk-NP7VID4K.js +2 -0
  174. package/dist/chunk-NP7VID4K.js.map +1 -0
  175. package/dist/chunk-NPUCMAG2.js +382 -0
  176. package/dist/chunk-NPUCMAG2.js.map +1 -0
  177. package/dist/chunk-NSCLRHES.js +102 -0
  178. package/dist/chunk-NSCLRHES.js.map +1 -0
  179. package/dist/chunk-OEUXHVFW.js +86 -0
  180. package/dist/chunk-OEUXHVFW.js.map +1 -0
  181. package/dist/chunk-ONBHFIMZ.js +137 -0
  182. package/dist/chunk-ONBHFIMZ.js.map +1 -0
  183. package/dist/chunk-OPH2HHL2.js +228 -0
  184. package/dist/chunk-OPH2HHL2.js.map +1 -0
  185. package/dist/chunk-OQERHIQP.js +287 -0
  186. package/dist/chunk-OQERHIQP.js.map +1 -0
  187. package/dist/chunk-P6YJAZFG.js +103 -0
  188. package/dist/chunk-P6YJAZFG.js.map +1 -0
  189. package/dist/chunk-PG7ERDOD.js +65 -0
  190. package/dist/chunk-PG7ERDOD.js.map +1 -0
  191. package/dist/chunk-PIB5JBMA.js +90 -0
  192. package/dist/chunk-PIB5JBMA.js.map +1 -0
  193. package/dist/chunk-PQ5BPIWQ.js +22 -0
  194. package/dist/chunk-PQ5BPIWQ.js.map +1 -0
  195. package/dist/chunk-PQBF6ZIQ.js +55 -0
  196. package/dist/chunk-PQBF6ZIQ.js.map +1 -0
  197. package/dist/chunk-PTWCTSZL.js +173 -0
  198. package/dist/chunk-PTWCTSZL.js.map +1 -0
  199. package/dist/chunk-QJUNPVOS.js +101 -0
  200. package/dist/chunk-QJUNPVOS.js.map +1 -0
  201. package/dist/chunk-QUDZOTRV.js +43 -0
  202. package/dist/chunk-QUDZOTRV.js.map +1 -0
  203. package/dist/chunk-RB7G65JC.js +213 -0
  204. package/dist/chunk-RB7G65JC.js.map +1 -0
  205. package/dist/chunk-RPHAOR7P.js +45 -0
  206. package/dist/chunk-RPHAOR7P.js.map +1 -0
  207. package/dist/chunk-RTCSH2AN.js +331 -0
  208. package/dist/chunk-RTCSH2AN.js.map +1 -0
  209. package/dist/chunk-S3ISPW3A.js +28 -0
  210. package/dist/chunk-S3ISPW3A.js.map +1 -0
  211. package/dist/chunk-SEVN656N.js +36 -0
  212. package/dist/chunk-SEVN656N.js.map +1 -0
  213. package/dist/chunk-SKVG672B.js +64 -0
  214. package/dist/chunk-SKVG672B.js.map +1 -0
  215. package/dist/chunk-SPQIU7GA.js +236 -0
  216. package/dist/chunk-SPQIU7GA.js.map +1 -0
  217. package/dist/chunk-SSGJ6MEM.js +1076 -0
  218. package/dist/chunk-SSGJ6MEM.js.map +1 -0
  219. package/dist/chunk-SSKZ2AED.js +118 -0
  220. package/dist/chunk-SSKZ2AED.js.map +1 -0
  221. package/dist/chunk-T56JFGXI.js +561 -0
  222. package/dist/chunk-T56JFGXI.js.map +1 -0
  223. package/dist/chunk-TCB6O74A.js +137 -0
  224. package/dist/chunk-TCB6O74A.js.map +1 -0
  225. package/dist/chunk-TTEYPO6X.js +57 -0
  226. package/dist/chunk-TTEYPO6X.js.map +1 -0
  227. package/dist/chunk-TWPHAJNM.js +462 -0
  228. package/dist/chunk-TWPHAJNM.js.map +1 -0
  229. package/dist/chunk-TXJJLP4O.js +336 -0
  230. package/dist/chunk-TXJJLP4O.js.map +1 -0
  231. package/dist/chunk-TZ6TB7VM.js +245 -0
  232. package/dist/chunk-TZ6TB7VM.js.map +1 -0
  233. package/dist/chunk-UBLKJJ7K.js +278 -0
  234. package/dist/chunk-UBLKJJ7K.js.map +1 -0
  235. package/dist/chunk-UCJ6IUFS.js +52 -0
  236. package/dist/chunk-UCJ6IUFS.js.map +1 -0
  237. package/dist/chunk-UCKFJ3QF.js +197 -0
  238. package/dist/chunk-UCKFJ3QF.js.map +1 -0
  239. package/dist/chunk-UPXSLILN.js +20 -0
  240. package/dist/chunk-UPXSLILN.js.map +1 -0
  241. package/dist/chunk-V4DORGWJ.js +92 -0
  242. package/dist/chunk-V4DORGWJ.js.map +1 -0
  243. package/dist/chunk-V6E5DYZD.js +80 -0
  244. package/dist/chunk-V6E5DYZD.js.map +1 -0
  245. package/dist/chunk-VLLYKF3P.js +96 -0
  246. package/dist/chunk-VLLYKF3P.js.map +1 -0
  247. package/dist/chunk-VLNBTOH6.js +43 -0
  248. package/dist/chunk-VLNBTOH6.js.map +1 -0
  249. package/dist/chunk-WMDSMSPL.js +303 -0
  250. package/dist/chunk-WMDSMSPL.js.map +1 -0
  251. package/dist/chunk-WU5BLGTF.js +149 -0
  252. package/dist/chunk-WU5BLGTF.js.map +1 -0
  253. package/dist/chunk-WYTZVSGK.js +245 -0
  254. package/dist/chunk-WYTZVSGK.js.map +1 -0
  255. package/dist/chunk-X47QMM6K.js +187 -0
  256. package/dist/chunk-X47QMM6K.js.map +1 -0
  257. package/dist/chunk-XNBKO32Y.js +174 -0
  258. package/dist/chunk-XNBKO32Y.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 +5425 -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 +1006 -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,662 @@
1
+ import type { Meta, StoryObj } from "@storybook/react-vite";
2
+ import { expect, userEvent, within } from "storybook/test";
3
+ import { useEffect, useState } from "react";
4
+ import { Badge, Button, Textarea } from "@elabs-ai/components-ui";
5
+
6
+ import { A2uiSurface, type A2uiAction, type A2uiActionContext } from "./a2ui-surface";
7
+ import { A2UI_CATALOG_SCHEMA } from "./core/catalog.generated";
8
+ import type { A2uiSurfaceSpec } from "./core/spec";
9
+ import { UI_CATALOG_BINDINGS, createA2uiCatalog, defineA2uiType } from "./ui-catalog";
10
+
11
+ /**
12
+ * `A2uiSurface` is Path C of the AI Output Contract — the SAFE generative-UI path
13
+ * (D2): the agent describes a screen as DATA, brand-ui validates it against the
14
+ * catalog (`brand-ui a2ui catalog`) and renders it with the real components.
15
+ * Nothing here is JSX from the model: every node names a catalog type, every prop
16
+ * is checked, and interaction is `on.<event>` → a host action the app resolves.
17
+ *
18
+ * These stories exercise the real behaviours — actions reaching the host, streaming
19
+ * build-up with pruning, the settled error report, an app-extended catalog and a
20
+ * live editor — not static snapshots.
21
+ */
22
+
23
+ /** A surface an agent would emit for "show me order 4711 and let me approve it". */
24
+ const ORDER: A2uiSurfaceSpec = {
25
+ a2ui: "1",
26
+ title: "Order 4711",
27
+ root: {
28
+ type: "Card",
29
+ children: [
30
+ {
31
+ type: "CardHeader",
32
+ children: [
33
+ { type: "CardTitle", children: ["Order 4711"] },
34
+ {
35
+ type: "CardDescription",
36
+ children: ["Placed today by Northwind Traders · awaiting approval"],
37
+ },
38
+ {
39
+ type: "CardAction",
40
+ children: [{ type: "StatusBadge", props: { status: "awaiting-approval" } }],
41
+ },
42
+ ],
43
+ },
44
+ {
45
+ type: "CardContent",
46
+ children: [
47
+ {
48
+ type: "Stack",
49
+ props: { gap: "lg" },
50
+ children: [
51
+ {
52
+ type: "Grid",
53
+ props: { columns: 3 },
54
+ children: [
55
+ {
56
+ type: "MetricCard",
57
+ props: {
58
+ label: "Total",
59
+ value: 1240,
60
+ valueFormat: "currency",
61
+ currency: "EUR",
62
+ },
63
+ },
64
+ { type: "MetricCard", props: { label: "Lines", value: 3 } },
65
+ {
66
+ type: "MetricCard",
67
+ props: {
68
+ label: "Margin",
69
+ value: 0.31,
70
+ valueFormat: "percent",
71
+ delta: "+2.1 pts",
72
+ deltaDirection: "up",
73
+ },
74
+ },
75
+ ],
76
+ },
77
+ {
78
+ type: "Table",
79
+ children: [
80
+ {
81
+ type: "TableHeader",
82
+ children: [
83
+ {
84
+ type: "TableRow",
85
+ children: [
86
+ { type: "TableHead", children: ["Item"] },
87
+ { type: "TableHead", children: ["Qty"] },
88
+ { type: "TableHead", children: ["Price"] },
89
+ ],
90
+ },
91
+ ],
92
+ },
93
+ {
94
+ type: "TableBody",
95
+ children: [
96
+ ["Chai", "10", "€ 180"],
97
+ ["Aniseed Syrup", "24", "€ 240"],
98
+ ["Ikura", "12", "€ 820"],
99
+ ].map((row) => ({
100
+ type: "TableRow",
101
+ children: row.map((cell) => ({ type: "TableCell", children: [cell] })),
102
+ })),
103
+ },
104
+ ],
105
+ },
106
+ {
107
+ type: "Alert",
108
+ props: { variant: "info" },
109
+ children: [
110
+ { type: "AlertTitle", children: ["Credit check passed"] },
111
+ {
112
+ type: "AlertDescription",
113
+ children: ["Northwind has a 30-day term and no open disputes."],
114
+ },
115
+ ],
116
+ },
117
+ ],
118
+ },
119
+ ],
120
+ },
121
+ {
122
+ type: "CardFooter",
123
+ children: [
124
+ {
125
+ type: "Stack",
126
+ props: { direction: "row", gap: "sm", justify: "end" },
127
+ children: [
128
+ {
129
+ type: "Button",
130
+ props: { variant: "outline" },
131
+ on: { click: { name: "open-order", payload: { id: 4711 } } },
132
+ children: ["Open in ERP"],
133
+ },
134
+ {
135
+ type: "Button",
136
+ on: { click: { name: "approve", payload: { id: 4711 } } },
137
+ children: ["Approve"],
138
+ },
139
+ ],
140
+ },
141
+ ],
142
+ },
143
+ ],
144
+ },
145
+ };
146
+
147
+ /** What a host app does with actions: here, a visible log. */
148
+ function ActionLog({ entries }: { entries: string[] }) {
149
+ return (
150
+ <div
151
+ data-testid="action-log"
152
+ aria-live="polite"
153
+ className="rounded-md bg-surface-muted p-3 text-caption text-muted-foreground"
154
+ >
155
+ {entries.length ? (
156
+ <ul className="space-y-1">
157
+ {entries.map((e) => (
158
+ <li key={e} className="font-mono">
159
+ {e}
160
+ </li>
161
+ ))}
162
+ </ul>
163
+ ) : (
164
+ "Actions the surface sends to the host appear here."
165
+ )}
166
+ </div>
167
+ );
168
+ }
169
+
170
+ function WithActions({ surface }: { surface: A2uiSurfaceSpec }) {
171
+ const [log, setLog] = useState<string[]>([]);
172
+ const onAction = (action: A2uiAction, ctx: A2uiActionContext) =>
173
+ setLog((l) => [
174
+ ...l,
175
+ `${l.length + 1}. ${ctx.event} → ${action.name} ${JSON.stringify(action.payload ?? "")}${ctx.value !== undefined ? ` (value: ${JSON.stringify(ctx.value)})` : ""}`,
176
+ ]);
177
+ return (
178
+ <div className="flex flex-col gap-4">
179
+ <A2uiSurface surface={surface} onAction={onAction} />
180
+ <ActionLog entries={log} />
181
+ </div>
182
+ );
183
+ }
184
+
185
+ const meta = {
186
+ title: "AI/A2UI Surface",
187
+ component: A2uiSurface,
188
+ tags: ["autodocs"],
189
+ parameters: { layout: "padded" },
190
+ } satisfies Meta<typeof A2uiSurface>;
191
+ export default meta;
192
+
193
+ type Story = StoryObj<typeof meta>;
194
+
195
+ /** The order card from the agent-output contract: data in, real components out, actions to the host. */
196
+ export const Default: Story = {
197
+ args: { surface: ORDER },
198
+ render: (args) => <WithActions surface={args.surface as A2uiSurfaceSpec} />,
199
+ play: async ({ canvasElement }) => {
200
+ const canvas = within(canvasElement);
201
+ await expect(canvas.getByRole("group", { name: "Order 4711" })).toBeInTheDocument();
202
+ await userEvent.click(canvas.getByRole("button", { name: "Approve" }));
203
+ await expect(canvas.getByTestId("action-log")).toHaveTextContent('click → approve {"id":4711}');
204
+ },
205
+ };
206
+
207
+ /** A form-like surface: inputs, a select, a switch — every change reaches `onAction` with its value. */
208
+ export const FormControls: Story = {
209
+ args: {
210
+ surface: {
211
+ a2ui: "1",
212
+ title: "Ship order 4711",
213
+ root: {
214
+ type: "Card",
215
+ children: [
216
+ {
217
+ type: "CardHeader",
218
+ children: [
219
+ { type: "CardTitle", children: ["Ship order 4711"] },
220
+ { type: "CardDescription", children: ["The agent asks for the details it lacks."] },
221
+ ],
222
+ },
223
+ {
224
+ type: "CardContent",
225
+ children: [
226
+ {
227
+ type: "Grid",
228
+ props: { columns: 2, gap: "lg" },
229
+ children: [
230
+ {
231
+ type: "Stack",
232
+ props: { gap: "xs" },
233
+ children: [
234
+ { type: "Label", props: { htmlFor: "carrier" }, children: ["Carrier"] },
235
+ {
236
+ type: "Select",
237
+ props: { defaultValue: "dhl" },
238
+ on: { change: { name: "set-carrier" } },
239
+ children: [
240
+ {
241
+ type: "SelectTrigger",
242
+ props: { id: "carrier" },
243
+ children: [
244
+ { type: "SelectValue", props: { placeholder: "Pick a carrier" } },
245
+ ],
246
+ },
247
+ {
248
+ type: "SelectContent",
249
+ children: [
250
+ {
251
+ type: "SelectItem",
252
+ props: { value: "dhl" },
253
+ children: ["DHL Express"],
254
+ },
255
+ { type: "SelectItem", props: { value: "ups" }, children: ["UPS"] },
256
+ {
257
+ type: "SelectItem",
258
+ props: { value: "post" },
259
+ children: ["Austrian Post"],
260
+ },
261
+ ],
262
+ },
263
+ ],
264
+ },
265
+ ],
266
+ },
267
+ {
268
+ type: "Stack",
269
+ props: { gap: "xs" },
270
+ children: [
271
+ {
272
+ type: "Label",
273
+ props: { htmlFor: "ref" },
274
+ children: ["Customer reference"],
275
+ },
276
+ {
277
+ type: "Input",
278
+ props: { id: "ref", placeholder: "PO number" },
279
+ on: { change: { name: "set-reference" } },
280
+ },
281
+ ],
282
+ },
283
+ {
284
+ type: "Stack",
285
+ props: { direction: "row", gap: "sm", align: "center" },
286
+ children: [
287
+ {
288
+ type: "Switch",
289
+ props: { id: "insured", defaultChecked: true },
290
+ on: { change: { name: "set-insured" } },
291
+ },
292
+ {
293
+ type: "Label",
294
+ props: { htmlFor: "insured" },
295
+ children: ["Insured shipment"],
296
+ },
297
+ ],
298
+ },
299
+ {
300
+ type: "Stack",
301
+ props: { gap: "xs" },
302
+ children: [
303
+ { type: "Label", children: ["Priority"] },
304
+ {
305
+ type: "RadioGroup",
306
+ props: { defaultValue: "standard", "aria-label": "Priority" },
307
+ on: { change: { name: "set-priority" } },
308
+ children: [
309
+ {
310
+ type: "Stack",
311
+ props: { direction: "row", gap: "sm", align: "center" },
312
+ children: [
313
+ { type: "RadioGroupItem", props: { value: "standard", id: "p-std" } },
314
+ {
315
+ type: "Label",
316
+ props: { htmlFor: "p-std" },
317
+ children: ["Standard"],
318
+ },
319
+ ],
320
+ },
321
+ {
322
+ type: "Stack",
323
+ props: { direction: "row", gap: "sm", align: "center" },
324
+ children: [
325
+ { type: "RadioGroupItem", props: { value: "express", id: "p-exp" } },
326
+ { type: "Label", props: { htmlFor: "p-exp" }, children: ["Express"] },
327
+ ],
328
+ },
329
+ ],
330
+ },
331
+ ],
332
+ },
333
+ ],
334
+ },
335
+ ],
336
+ },
337
+ {
338
+ type: "CardFooter",
339
+ children: [
340
+ {
341
+ type: "Stack",
342
+ props: { direction: "row", gap: "sm", justify: "end" },
343
+ children: [
344
+ {
345
+ type: "Button",
346
+ props: { variant: "ghost" },
347
+ on: { click: { name: "cancel" } },
348
+ children: ["Cancel"],
349
+ },
350
+ {
351
+ type: "Button",
352
+ on: { click: { name: "ship", payload: { id: 4711 } } },
353
+ children: ["Ship it"],
354
+ },
355
+ ],
356
+ },
357
+ ],
358
+ },
359
+ ],
360
+ },
361
+ },
362
+ },
363
+ render: (args) => <WithActions surface={args.surface as A2uiSurfaceSpec} />,
364
+ play: async ({ canvasElement }) => {
365
+ const canvas = within(canvasElement);
366
+ await userEvent.type(canvas.getByLabelText("Customer reference"), "PO-88");
367
+ await expect(canvas.getByTestId("action-log")).toHaveTextContent(
368
+ 'set-reference "" (value: "PO-88")',
369
+ );
370
+ await userEvent.click(canvas.getByRole("switch", { name: "Insured shipment" }));
371
+ await expect(canvas.getByTestId("action-log")).toHaveTextContent(
372
+ 'set-insured "" (value: false)',
373
+ );
374
+ },
375
+ };
376
+
377
+ /** Tabs, an accordion and a timeline — stateful compounds the agent composes from the catalog. */
378
+ export const Composition: Story = {
379
+ args: {
380
+ surface: {
381
+ a2ui: "1",
382
+ root: {
383
+ type: "Stack",
384
+ props: { gap: "lg" },
385
+ children: [
386
+ {
387
+ type: "SectionHeader",
388
+ props: {
389
+ eyebrow: "Deployment",
390
+ title: "api-gateway · v4.2.0",
391
+ description: "Rolled out to 3 of 4 regions.",
392
+ actions: { type: "Badge", props: { variant: "success" }, children: ["Healthy"] },
393
+ },
394
+ },
395
+ {
396
+ type: "Tabs",
397
+ props: { defaultValue: "status" },
398
+ on: { change: { name: "tab" } },
399
+ children: [
400
+ {
401
+ type: "TabsList",
402
+ children: [
403
+ { type: "TabsTrigger", props: { value: "status" }, children: ["Status"] },
404
+ { type: "TabsTrigger", props: { value: "details" }, children: ["Details"] },
405
+ ],
406
+ },
407
+ {
408
+ type: "TabsContent",
409
+ props: { value: "status" },
410
+ children: [
411
+ {
412
+ type: "Timeline",
413
+ props: {
414
+ items: [
415
+ { title: "eu-central-1", status: "done", timestamp: "09:12" },
416
+ { title: "eu-west-1", status: "done", timestamp: "09:18" },
417
+ { title: "us-east-1", status: "active", timestamp: "09:25" },
418
+ { title: "ap-southeast-2", status: "pending" },
419
+ ],
420
+ },
421
+ },
422
+ ],
423
+ },
424
+ {
425
+ type: "TabsContent",
426
+ props: { value: "details" },
427
+ children: [
428
+ {
429
+ type: "Descriptions",
430
+ props: { columns: 2 },
431
+ children: [
432
+ {
433
+ type: "DescriptionsItem",
434
+ props: { label: "Commit" },
435
+ children: ["be18099c"],
436
+ },
437
+ {
438
+ type: "DescriptionsItem",
439
+ props: { label: "Strategy" },
440
+ children: ["Canary 10% → 100%"],
441
+ },
442
+ {
443
+ type: "DescriptionsItem",
444
+ props: { label: "Error budget", numeric: true },
445
+ children: ["82%"],
446
+ },
447
+ {
448
+ type: "DescriptionsItem",
449
+ props: { label: "Owner" },
450
+ children: ["Platform team"],
451
+ },
452
+ ],
453
+ },
454
+ ],
455
+ },
456
+ ],
457
+ },
458
+ {
459
+ type: "Accordion",
460
+ props: { type: "single", collapsible: true },
461
+ children: [
462
+ {
463
+ type: "AccordionItem",
464
+ props: { value: "logs" },
465
+ children: [
466
+ { type: "AccordionTrigger", children: ["Why is us-east-1 still rolling?"] },
467
+ {
468
+ type: "AccordionContent",
469
+ children: [
470
+ {
471
+ type: "Text",
472
+ props: { tone: "muted" },
473
+ children: [
474
+ "The canary is holding at 10% until p99 latency stays under 300 ms for 10 minutes.",
475
+ ],
476
+ },
477
+ ],
478
+ },
479
+ ],
480
+ },
481
+ ],
482
+ },
483
+ { type: "Progress", props: { value: 75, "aria-label": "Rollout progress" } },
484
+ ],
485
+ },
486
+ },
487
+ },
488
+ play: async ({ canvasElement }) => {
489
+ const canvas = within(canvasElement);
490
+ await userEvent.click(canvas.getByRole("tab", { name: "Details" }));
491
+ await expect(await canvas.findByText("Canary 10% → 100%")).toBeInTheDocument();
492
+ },
493
+ };
494
+
495
+ const STREAM_TARGET = JSON.stringify(ORDER);
496
+
497
+ /** The surface arrives token by token; every node that already validates is drawn, the rest waits. */
498
+ function StreamingDemo({ speed = 24 }: { speed?: number }) {
499
+ const [shown, setShown] = useState(0);
500
+ const [running, setRunning] = useState(true);
501
+ useEffect(() => {
502
+ if (!running || shown >= STREAM_TARGET.length) return;
503
+ const id = window.setTimeout(
504
+ () => setShown((n) => Math.min(STREAM_TARGET.length, n + 7)),
505
+ speed,
506
+ );
507
+ return () => window.clearTimeout(id);
508
+ }, [running, shown, speed]);
509
+ const done = shown >= STREAM_TARGET.length;
510
+ return (
511
+ <div className="flex flex-col gap-4">
512
+ <div className="flex items-center gap-2">
513
+ <Button
514
+ size="sm"
515
+ variant="outline"
516
+ onClick={() => {
517
+ setShown(0);
518
+ setRunning(true);
519
+ }}
520
+ >
521
+ Replay
522
+ </Button>
523
+ <Button size="sm" variant="ghost" onClick={() => setRunning((r) => !r)} disabled={done}>
524
+ {running ? "Pause" : "Resume"}
525
+ </Button>
526
+ <Badge variant={done ? "success" : "secondary"}>
527
+ {done ? "settled" : `streaming ${shown}/${STREAM_TARGET.length}`}
528
+ </Badge>
529
+ </div>
530
+ <A2uiSurface surface={STREAM_TARGET.slice(0, shown)} isStreaming={!done} />
531
+ </div>
532
+ );
533
+ }
534
+
535
+ /** Streaming: partial JSON is completed, validated per node, and builds up behind a skeleton. */
536
+ export const Streaming: Story = {
537
+ args: { surface: "" },
538
+ render: () => <StreamingDemo />,
539
+ };
540
+
541
+ /** `loading`: nothing has arrived yet — the layout-shaped skeleton with a polite live region. */
542
+ export const Loading: Story = {
543
+ args: { surface: null, loading: true },
544
+ };
545
+
546
+ /** A settled surface that breaks the contract: every problem, with its path, in a `role="alert"`. */
547
+ export const Invalid: Story = {
548
+ args: {
549
+ surface: {
550
+ a2ui: "1",
551
+ root: {
552
+ type: "Stack",
553
+ children: [
554
+ { type: "Sparkline", props: { points: [1, 2, 3] } },
555
+ {
556
+ type: "Button",
557
+ props: { variant: "primary", className: "my-brand-card" },
558
+ children: ["Save"],
559
+ },
560
+ { type: "Progress", props: { value: 40 }, children: ["no children here"] },
561
+ { type: "Badge", on: { hover: { name: "peek" } }, children: ["Hover me"] },
562
+ ],
563
+ },
564
+ },
565
+ },
566
+ play: async ({ canvasElement }) => {
567
+ const canvas = within(canvasElement);
568
+ const alert = canvas.getByRole("alert");
569
+ await expect(alert).toHaveTextContent("root.children[0].type");
570
+ await expect(alert).toHaveTextContent("root.children[1].props.className");
571
+ await expect(canvas.queryByRole("button", { name: "Save" })).not.toBeInTheDocument();
572
+ },
573
+ };
574
+
575
+ /** A token-driven app component the agent may now name — the catalog is the app's to extend. */
576
+ function Sparkline({ points, label }: { points: number[]; label: string }) {
577
+ const max = Math.max(...points, 1);
578
+ return (
579
+ <figure className="rounded-lg border bg-card p-3 text-card-foreground">
580
+ <figcaption className="text-meta text-muted-foreground">{label}</figcaption>
581
+ <div
582
+ className="mt-2 flex h-12 items-end gap-1"
583
+ role="img"
584
+ aria-label={`${label}: ${points.join(", ")}`}
585
+ >
586
+ {points.map((p, i) => (
587
+ <span
588
+ key={`${label}-${i}`}
589
+ className="w-3 rounded-t-sm bg-primary"
590
+ style={{ height: `${Math.max(8, (p / max) * 100)}%` }}
591
+ />
592
+ ))}
593
+ </div>
594
+ </figure>
595
+ );
596
+ }
597
+
598
+ const extendedCatalog = createA2uiCatalog(
599
+ { ...UI_CATALOG_BINDINGS, Sparkline },
600
+ {
601
+ ...A2UI_CATALOG_SCHEMA,
602
+ Sparkline: defineA2uiType({
603
+ summary: "A tiny bar sparkline for a short numeric series.",
604
+ props: {
605
+ label: { type: "string", required: true },
606
+ points: { type: "array", required: true, description: "Numbers, oldest first." },
607
+ },
608
+ }),
609
+ },
610
+ );
611
+
612
+ /** An app-extended catalog: `Sparkline` is unknown to the shipped catalog but valid in this app's. */
613
+ export const ExtendedCatalog: Story = {
614
+ args: {
615
+ catalog: extendedCatalog,
616
+ surface: {
617
+ a2ui: "1",
618
+ root: {
619
+ type: "Grid",
620
+ props: { columns: 3 },
621
+ children: [
622
+ { type: "Sparkline", props: { label: "Sign-ups", points: [3, 5, 4, 8, 9, 12, 11] } },
623
+ { type: "Sparkline", props: { label: "Churn", points: [4, 4, 3, 3, 2, 2, 1] } },
624
+ {
625
+ type: "MetricCard",
626
+ props: {
627
+ label: "MRR",
628
+ value: 48200,
629
+ valueFormat: "currency",
630
+ currency: "USD",
631
+ delta: "+4.1%",
632
+ deltaDirection: "up",
633
+ },
634
+ },
635
+ ],
636
+ },
637
+ },
638
+ },
639
+ };
640
+
641
+ /** Edit the JSON, see the surface — the loop an agent runs against `brand-ui a2ui validate`. */
642
+ function LiveEditor() {
643
+ const [text, setText] = useState(JSON.stringify(ORDER, null, 2));
644
+ return (
645
+ <div className="grid gap-4 lg:grid-cols-2">
646
+ <Textarea
647
+ aria-label="Surface JSON"
648
+ className="min-h-[24rem] font-mono text-code"
649
+ value={text}
650
+ onChange={(e) => setText(e.target.value)}
651
+ spellCheck={false}
652
+ />
653
+ <A2uiSurface surface={text} />
654
+ </div>
655
+ );
656
+ }
657
+
658
+ /** Live editing: the surface re-validates on every keystroke; incomplete JSON keeps the last frame. */
659
+ export const LiveEdit: Story = {
660
+ args: { surface: "" },
661
+ render: () => <LiveEditor />,
662
+ };