@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.
- package/README.md +1 -1
- package/dist/{_audio-player-media-chrome-T3XVXWRZ.js → _audio-player-media-chrome.js} +1 -1
- package/dist/_code-block-theme.js +12 -0
- package/dist/_code-block-theme.js.map +1 -0
- package/dist/{_flow-boundary-SHNWLQG5.js → _flow-boundary.js} +1 -1
- package/dist/_flow-boundary.js.map +1 -0
- package/dist/_flow-lazy.js +8 -0
- package/dist/_flow-lazy.js.map +1 -0
- package/dist/_lazy-boundary-conformance.js +2 -0
- package/dist/_lazy-boundary-conformance.js.map +1 -0
- package/dist/_lazy-cjk.js +13 -0
- package/dist/_lazy-cjk.js.map +1 -0
- package/dist/_lazy-engine-boundary.js +9 -0
- package/dist/_lazy-engine-boundary.js.map +1 -0
- package/dist/_lazy-math.js +13 -0
- package/dist/_lazy-math.js.map +1 -0
- package/dist/_lazy-mermaid.js +12 -0
- package/dist/_lazy-mermaid.js.map +1 -0
- package/dist/_mermaid-error-panel.js +9 -0
- package/dist/_mermaid-error-panel.js.map +1 -0
- package/dist/{_persona-rive-JEG44YHX.js → _persona-rive.js} +19 -24
- package/dist/_persona-rive.js.map +1 -0
- package/dist/_streamdown-i18n.js +21 -0
- package/dist/_streamdown-i18n.js.map +1 -0
- package/dist/_streamdown-safety.js +10 -0
- package/dist/_streamdown-safety.js.map +1 -0
- package/dist/_theme-scope-store.js +13 -0
- package/dist/_theme-scope-store.js.map +1 -0
- package/dist/a2ui/a2ui-surface.js +17 -0
- package/dist/a2ui/a2ui-surface.js.map +1 -0
- package/dist/a2ui/core/catalog.generated.js +10 -0
- package/dist/a2ui/core/catalog.generated.js.map +1 -0
- package/dist/a2ui/core/complete-json.js +10 -0
- package/dist/a2ui/core/complete-json.js.map +1 -0
- package/dist/a2ui/core/index.js +37 -0
- package/dist/a2ui/core/index.js.map +1 -0
- package/dist/a2ui/core/schema.js +11 -0
- package/dist/a2ui/core/schema.js.map +1 -0
- package/dist/a2ui/core/spec.js +10 -0
- package/dist/a2ui/core/spec.js.map +1 -0
- package/dist/a2ui/core/validate.js +16 -0
- package/dist/a2ui/core/validate.js.map +1 -0
- package/dist/a2ui/index.js +54 -0
- package/dist/a2ui/index.js.map +1 -0
- package/dist/a2ui/ui-catalog.js +18 -0
- package/dist/a2ui/ui-catalog.js.map +1 -0
- package/dist/agent-event.js +10 -0
- package/dist/agent-event.js.map +1 -0
- package/dist/agent-timeline.js +11 -0
- package/dist/agent-timeline.js.map +1 -0
- package/dist/agent.js +25 -0
- package/dist/agent.js.map +1 -0
- package/dist/artifact.js +23 -0
- package/dist/artifact.js.map +1 -0
- package/dist/asset-preview.js +22 -0
- package/dist/asset-preview.js.map +1 -0
- package/dist/attachments.js +33 -0
- package/dist/attachments.js.map +1 -0
- package/dist/audio-player.js +30 -0
- package/dist/audio-player.js.map +1 -0
- package/dist/audio-visualizer.js +9 -0
- package/dist/audio-visualizer.js.map +1 -0
- package/dist/canvas.js +10 -0
- package/dist/canvas.js.map +1 -0
- package/dist/chain-of-thought.js +22 -0
- package/dist/chain-of-thought.js.map +1 -0
- package/dist/chat-greeting.js +8 -0
- package/dist/chat-greeting.js.map +1 -0
- package/dist/chat-shell.js +9 -0
- package/dist/chat-shell.js.map +1 -0
- package/dist/checkpoint.js +13 -0
- package/dist/checkpoint.js.map +1 -0
- package/dist/chunk-2XOIG5TG.js +72 -0
- package/dist/chunk-2XOIG5TG.js.map +1 -0
- package/dist/chunk-34CQ2VHM.js +172 -0
- package/dist/chunk-34CQ2VHM.js.map +1 -0
- package/dist/chunk-3TDHPXZZ.js +60 -0
- package/dist/chunk-3TDHPXZZ.js.map +1 -0
- package/dist/chunk-3XNPMDZY.js +478 -0
- package/dist/chunk-3XNPMDZY.js.map +1 -0
- package/dist/chunk-3YPT3V7L.js +56 -0
- package/dist/chunk-3YPT3V7L.js.map +1 -0
- package/dist/chunk-475UEU2Q.js +87 -0
- package/dist/chunk-475UEU2Q.js.map +1 -0
- package/dist/chunk-4CBTII2I.js +95 -0
- package/dist/chunk-4CBTII2I.js.map +1 -0
- package/dist/chunk-4XRNIZMG.js +22 -0
- package/dist/chunk-4XRNIZMG.js.map +1 -0
- package/dist/chunk-5NNWUKK5.js +2 -0
- package/dist/chunk-5NNWUKK5.js.map +1 -0
- package/dist/chunk-5UOMU27Z.js +164 -0
- package/dist/chunk-5UOMU27Z.js.map +1 -0
- package/dist/chunk-5VGYZ62I.js +264 -0
- package/dist/chunk-5VGYZ62I.js.map +1 -0
- package/dist/chunk-6IQPH2OS.js +21 -0
- package/dist/chunk-6IQPH2OS.js.map +1 -0
- package/dist/chunk-6PB2MXCI.js +482 -0
- package/dist/chunk-6PB2MXCI.js.map +1 -0
- package/dist/chunk-7FD5CZEU.js +215 -0
- package/dist/chunk-7FD5CZEU.js.map +1 -0
- package/dist/chunk-7RL6KZDF.js +266 -0
- package/dist/chunk-7RL6KZDF.js.map +1 -0
- package/dist/chunk-ADOYAGGK.js +482 -0
- package/dist/chunk-ADOYAGGK.js.map +1 -0
- package/dist/chunk-AXMNJMMH.js +984 -0
- package/dist/chunk-AXMNJMMH.js.map +1 -0
- package/dist/chunk-BA3AEMOU.js +21 -0
- package/dist/chunk-BA3AEMOU.js.map +1 -0
- package/dist/chunk-BBHFOYML.js +336 -0
- package/dist/chunk-BBHFOYML.js.map +1 -0
- package/dist/chunk-BHUVISIY.js +221 -0
- package/dist/chunk-BHUVISIY.js.map +1 -0
- package/dist/chunk-BM2LWERA.js +100 -0
- package/dist/chunk-BM2LWERA.js.map +1 -0
- package/dist/chunk-CMOYXNPJ.js +211 -0
- package/dist/chunk-CMOYXNPJ.js.map +1 -0
- package/dist/chunk-CZP3RHC4.js +74 -0
- package/dist/chunk-CZP3RHC4.js.map +1 -0
- package/dist/chunk-DDG5JHQT.js +112 -0
- package/dist/chunk-DDG5JHQT.js.map +1 -0
- package/dist/chunk-DJODXO7I.js +38 -0
- package/dist/chunk-DJODXO7I.js.map +1 -0
- package/dist/chunk-DWJDJLPU.js +192 -0
- package/dist/chunk-DWJDJLPU.js.map +1 -0
- package/dist/chunk-DZW6LM22.js +45 -0
- package/dist/chunk-DZW6LM22.js.map +1 -0
- package/dist/chunk-ELGCZLZF.js +305 -0
- package/dist/chunk-ELGCZLZF.js.map +1 -0
- package/dist/chunk-EV3U6ZZB.js +209 -0
- package/dist/chunk-EV3U6ZZB.js.map +1 -0
- package/dist/chunk-EY7LVUKQ.js +87 -0
- package/dist/chunk-EY7LVUKQ.js.map +1 -0
- package/dist/chunk-F4C74F7M.js +230 -0
- package/dist/chunk-F4C74F7M.js.map +1 -0
- package/dist/chunk-FERYDFZA.js +108 -0
- package/dist/chunk-FERYDFZA.js.map +1 -0
- package/dist/chunk-FUIYG2DS.js +166 -0
- package/dist/chunk-FUIYG2DS.js.map +1 -0
- package/dist/chunk-GKYZT3LA.js +136 -0
- package/dist/chunk-GKYZT3LA.js.map +1 -0
- package/dist/chunk-H42LRUQ4.js +102 -0
- package/dist/chunk-H42LRUQ4.js.map +1 -0
- package/dist/chunk-HVXM2G5F.js +222 -0
- package/dist/chunk-HVXM2G5F.js.map +1 -0
- package/dist/chunk-I4RDAGVY.js +53 -0
- package/dist/chunk-I4RDAGVY.js.map +1 -0
- package/dist/chunk-IQJG4IDX.js +208 -0
- package/dist/chunk-IQJG4IDX.js.map +1 -0
- package/dist/chunk-IX2PXG4Y.js +144 -0
- package/dist/chunk-IX2PXG4Y.js.map +1 -0
- package/dist/chunk-IXICSOOP.js +287 -0
- package/dist/chunk-IXICSOOP.js.map +1 -0
- package/dist/chunk-JY5HSN4D.js +84 -0
- package/dist/chunk-JY5HSN4D.js.map +1 -0
- package/dist/chunk-LMNSBOBG.js +19 -0
- package/dist/chunk-LMNSBOBG.js.map +1 -0
- package/dist/chunk-MBI7D6IL.js +42 -0
- package/dist/chunk-MBI7D6IL.js.map +1 -0
- package/dist/chunk-MLFMYCPH.js +192 -0
- package/dist/chunk-MLFMYCPH.js.map +1 -0
- package/dist/chunk-MOK66734.js +33 -0
- package/dist/chunk-MOK66734.js.map +1 -0
- package/dist/chunk-MXTAWPYM.js +196 -0
- package/dist/chunk-MXTAWPYM.js.map +1 -0
- package/dist/chunk-NCL2UZKI.js +96 -0
- package/dist/chunk-NCL2UZKI.js.map +1 -0
- package/dist/chunk-NET4YLRY.js +107 -0
- package/dist/chunk-NET4YLRY.js.map +1 -0
- package/dist/chunk-NIG67CFM.js +329 -0
- package/dist/chunk-NIG67CFM.js.map +1 -0
- package/dist/chunk-NMVNNO3L.js +10 -0
- package/dist/chunk-NMVNNO3L.js.map +1 -0
- package/dist/chunk-NP7VID4K.js +2 -0
- package/dist/chunk-NP7VID4K.js.map +1 -0
- package/dist/chunk-NPUCMAG2.js +382 -0
- package/dist/chunk-NPUCMAG2.js.map +1 -0
- package/dist/chunk-NSCLRHES.js +102 -0
- package/dist/chunk-NSCLRHES.js.map +1 -0
- package/dist/chunk-OEUXHVFW.js +86 -0
- package/dist/chunk-OEUXHVFW.js.map +1 -0
- package/dist/chunk-ONBHFIMZ.js +137 -0
- package/dist/chunk-ONBHFIMZ.js.map +1 -0
- package/dist/chunk-OPH2HHL2.js +228 -0
- package/dist/chunk-OPH2HHL2.js.map +1 -0
- package/dist/chunk-OQERHIQP.js +287 -0
- package/dist/chunk-OQERHIQP.js.map +1 -0
- package/dist/chunk-P6YJAZFG.js +103 -0
- package/dist/chunk-P6YJAZFG.js.map +1 -0
- package/dist/chunk-PG7ERDOD.js +65 -0
- package/dist/chunk-PG7ERDOD.js.map +1 -0
- package/dist/chunk-PIB5JBMA.js +90 -0
- package/dist/chunk-PIB5JBMA.js.map +1 -0
- package/dist/chunk-PQ5BPIWQ.js +22 -0
- package/dist/chunk-PQ5BPIWQ.js.map +1 -0
- package/dist/chunk-PQBF6ZIQ.js +55 -0
- package/dist/chunk-PQBF6ZIQ.js.map +1 -0
- package/dist/chunk-PTWCTSZL.js +173 -0
- package/dist/chunk-PTWCTSZL.js.map +1 -0
- package/dist/chunk-QJUNPVOS.js +101 -0
- package/dist/chunk-QJUNPVOS.js.map +1 -0
- package/dist/chunk-QUDZOTRV.js +43 -0
- package/dist/chunk-QUDZOTRV.js.map +1 -0
- package/dist/chunk-RB7G65JC.js +213 -0
- package/dist/chunk-RB7G65JC.js.map +1 -0
- package/dist/chunk-RPHAOR7P.js +45 -0
- package/dist/chunk-RPHAOR7P.js.map +1 -0
- package/dist/chunk-RTCSH2AN.js +331 -0
- package/dist/chunk-RTCSH2AN.js.map +1 -0
- package/dist/chunk-S3ISPW3A.js +28 -0
- package/dist/chunk-S3ISPW3A.js.map +1 -0
- package/dist/chunk-SEVN656N.js +36 -0
- package/dist/chunk-SEVN656N.js.map +1 -0
- package/dist/chunk-SKVG672B.js +64 -0
- package/dist/chunk-SKVG672B.js.map +1 -0
- package/dist/chunk-SPQIU7GA.js +236 -0
- package/dist/chunk-SPQIU7GA.js.map +1 -0
- package/dist/chunk-SSGJ6MEM.js +1076 -0
- package/dist/chunk-SSGJ6MEM.js.map +1 -0
- package/dist/chunk-SSKZ2AED.js +118 -0
- package/dist/chunk-SSKZ2AED.js.map +1 -0
- package/dist/chunk-T56JFGXI.js +561 -0
- package/dist/chunk-T56JFGXI.js.map +1 -0
- package/dist/chunk-TCB6O74A.js +137 -0
- package/dist/chunk-TCB6O74A.js.map +1 -0
- package/dist/chunk-TTEYPO6X.js +57 -0
- package/dist/chunk-TTEYPO6X.js.map +1 -0
- package/dist/chunk-TWPHAJNM.js +462 -0
- package/dist/chunk-TWPHAJNM.js.map +1 -0
- package/dist/chunk-TXJJLP4O.js +336 -0
- package/dist/chunk-TXJJLP4O.js.map +1 -0
- package/dist/chunk-TZ6TB7VM.js +245 -0
- package/dist/chunk-TZ6TB7VM.js.map +1 -0
- package/dist/chunk-UBLKJJ7K.js +278 -0
- package/dist/chunk-UBLKJJ7K.js.map +1 -0
- package/dist/chunk-UCJ6IUFS.js +52 -0
- package/dist/chunk-UCJ6IUFS.js.map +1 -0
- package/dist/chunk-UCKFJ3QF.js +197 -0
- package/dist/chunk-UCKFJ3QF.js.map +1 -0
- package/dist/chunk-UPXSLILN.js +20 -0
- package/dist/chunk-UPXSLILN.js.map +1 -0
- package/dist/chunk-V4DORGWJ.js +92 -0
- package/dist/chunk-V4DORGWJ.js.map +1 -0
- package/dist/chunk-V6E5DYZD.js +80 -0
- package/dist/chunk-V6E5DYZD.js.map +1 -0
- package/dist/chunk-VLLYKF3P.js +96 -0
- package/dist/chunk-VLLYKF3P.js.map +1 -0
- package/dist/chunk-VLNBTOH6.js +43 -0
- package/dist/chunk-VLNBTOH6.js.map +1 -0
- package/dist/chunk-WMDSMSPL.js +303 -0
- package/dist/chunk-WMDSMSPL.js.map +1 -0
- package/dist/chunk-WU5BLGTF.js +149 -0
- package/dist/chunk-WU5BLGTF.js.map +1 -0
- package/dist/chunk-WYTZVSGK.js +245 -0
- package/dist/chunk-WYTZVSGK.js.map +1 -0
- package/dist/chunk-X47QMM6K.js +187 -0
- package/dist/chunk-X47QMM6K.js.map +1 -0
- package/dist/chunk-XNBKO32Y.js +174 -0
- package/dist/chunk-XNBKO32Y.js.map +1 -0
- package/dist/chunk-YHUSW7D2.js +40 -0
- package/dist/chunk-YHUSW7D2.js.map +1 -0
- package/dist/chunk-YSKD7UXX.js +126 -0
- package/dist/chunk-YSKD7UXX.js.map +1 -0
- package/dist/chunk-YYRDGWOU.js +72 -0
- package/dist/chunk-YYRDGWOU.js.map +1 -0
- package/dist/chunk-ZIGZMWM7.js +19 -0
- package/dist/chunk-ZIGZMWM7.js.map +1 -0
- package/dist/chunk-ZKRTUKNP.js +40 -0
- package/dist/chunk-ZKRTUKNP.js.map +1 -0
- package/dist/code-block.js +38 -0
- package/dist/code-block.js.map +1 -0
- package/dist/commit.js +51 -0
- package/dist/commit.js.map +1 -0
- package/dist/composer.js +15 -0
- package/dist/composer.js.map +1 -0
- package/dist/confirmation.js +53 -0
- package/dist/confirmation.js.map +1 -0
- package/dist/connection.js +8 -0
- package/dist/connection.js.map +1 -0
- package/dist/context-panel.js +25 -0
- package/dist/context-panel.js.map +1 -0
- package/dist/controls.js +10 -0
- package/dist/controls.js.map +1 -0
- package/dist/conversation.js +19 -0
- package/dist/conversation.js.map +1 -0
- package/dist/diff-view.js +15 -0
- package/dist/diff-view.js.map +1 -0
- package/dist/edge.js +10 -0
- package/dist/edge.js.map +1 -0
- package/dist/environment-variables.js +29 -0
- package/dist/environment-variables.js.map +1 -0
- package/dist/file-tree.js +23 -0
- package/dist/file-tree.js.map +1 -0
- package/dist/gallery.js +9 -0
- package/dist/gallery.js.map +1 -0
- package/dist/grouped-parts.js +21 -0
- package/dist/grouped-parts.js.map +1 -0
- package/dist/image.js +9 -0
- package/dist/image.js.map +1 -0
- package/dist/index.d.ts +366 -98
- package/dist/index.js +672 -13577
- package/dist/index.js.map +1 -1
- package/dist/inline-citation.js +39 -0
- package/dist/inline-citation.js.map +1 -0
- package/dist/jsx-preview.js +17 -0
- package/dist/jsx-preview.js.map +1 -0
- package/dist/markdown-view.js +17 -0
- package/dist/markdown-view.js.map +1 -0
- package/dist/message-compare.js +12 -0
- package/dist/message-compare.js.map +1 -0
- package/dist/message-edit.js +19 -0
- package/dist/message-edit.js.map +1 -0
- package/dist/message-feedback.js +11 -0
- package/dist/message-feedback.js.map +1 -0
- package/dist/message-form-spec.js +38 -0
- package/dist/message-form-spec.js.map +1 -0
- package/dist/message-form.js +26 -0
- package/dist/message-form.js.map +1 -0
- package/dist/message-table-spec.js +26 -0
- package/dist/message-table-spec.js.map +1 -0
- package/dist/message-table.js +12 -0
- package/dist/message-table.js.map +1 -0
- package/dist/message.js +51 -0
- package/dist/message.js.map +1 -0
- package/dist/mic-selector.js +27 -0
- package/dist/mic-selector.js.map +1 -0
- package/dist/model-provider-logo.js +13 -0
- package/dist/model-provider-logo.js.map +1 -0
- package/dist/motion-config.js +9 -0
- package/dist/motion-config.js.map +1 -0
- package/dist/node.js +22 -0
- package/dist/node.js.map +1 -0
- package/dist/open-in-chat.js +31 -0
- package/dist/open-in-chat.js.map +1 -0
- package/dist/package-info.js +25 -0
- package/dist/package-info.js.map +1 -0
- package/dist/panel.js +10 -0
- package/dist/panel.js.map +1 -0
- package/dist/part-groups.js +18 -0
- package/dist/part-groups.js.map +1 -0
- package/dist/permission-mode-select.js +9 -0
- package/dist/permission-mode-select.js.map +1 -0
- package/dist/persona-sources.js +8 -0
- package/dist/persona-sources.js.map +1 -0
- package/dist/persona.js +14 -0
- package/dist/persona.js.map +1 -0
- package/dist/plan.js +32 -0
- package/dist/plan.js.map +1 -0
- package/dist/prompt-input-effort.js +9 -0
- package/dist/prompt-input-effort.js.map +1 -0
- package/dist/prompt-input-mode.js +10 -0
- package/dist/prompt-input-mode.js.map +1 -0
- package/dist/prompt-input-slash.js +12 -0
- package/dist/prompt-input-slash.js.map +1 -0
- package/dist/prompt-input.js +89 -0
- package/dist/prompt-input.js.map +1 -0
- package/dist/queue.js +37 -0
- package/dist/queue.js.map +1 -0
- package/dist/reasoning.js +23 -0
- package/dist/reasoning.js.map +1 -0
- package/dist/sandbox.js +28 -0
- package/dist/sandbox.js.map +1 -0
- package/dist/schema-display.js +33 -0
- package/dist/schema-display.js.map +1 -0
- package/dist/selection-toolbar.js +11 -0
- package/dist/selection-toolbar.js.map +1 -0
- package/dist/session-header.js +9 -0
- package/dist/session-header.js.map +1 -0
- package/dist/session-status-bar.js +9 -0
- package/dist/session-status-bar.js.map +1 -0
- package/dist/shimmer.js +9 -0
- package/dist/shimmer.js.map +1 -0
- package/dist/snippet.js +17 -0
- package/dist/snippet.js.map +1 -0
- package/dist/sources.js +17 -0
- package/dist/sources.js.map +1 -0
- package/dist/speech-input.js +9 -0
- package/dist/speech-input.js.map +1 -0
- package/dist/stack-trace.js +27 -0
- package/dist/stack-trace.js.map +1 -0
- package/dist/suggestion.js +16 -0
- package/dist/suggestion.js.map +1 -0
- package/dist/task.js +18 -0
- package/dist/task.js.map +1 -0
- package/dist/test-results.js +43 -0
- package/dist/test-results.js.map +1 -0
- package/dist/token-usage.js +27 -0
- package/dist/token-usage.js.map +1 -0
- package/dist/tool-result-card.js +9 -0
- package/dist/tool-result-card.js.map +1 -0
- package/dist/tool.js +27 -0
- package/dist/tool.js.map +1 -0
- package/dist/toolbar.js +10 -0
- package/dist/toolbar.js.map +1 -0
- package/dist/transcription.js +11 -0
- package/dist/transcription.js.map +1 -0
- package/dist/turn-status.js +9 -0
- package/dist/turn-status.js.map +1 -0
- package/dist/use-audio-level.js +9 -0
- package/dist/use-audio-level.js.map +1 -0
- package/dist/voice-selector.js +47 -0
- package/dist/voice-selector.js.map +1 -0
- package/dist/web-preview.js +19 -0
- package/dist/web-preview.js.map +1 -0
- package/package.json +11 -9
- package/schemas/a2ui-surface.v1.schema.json +5425 -0
- package/src/_chat-shell-rail.tsx +3 -1
- package/src/_flow-boundary.tsx +2 -2
- package/src/_persona-rive.tsx +27 -41
- package/src/a2ui/a2ui-surface.stories.tsx +662 -0
- package/src/a2ui/a2ui-surface.test.tsx +201 -0
- package/src/a2ui/a2ui-surface.tsx +354 -0
- package/src/a2ui/catalog.source.json +772 -0
- package/src/a2ui/core/a2ui-core.test.ts +178 -0
- package/src/a2ui/core/catalog.generated.ts +1006 -0
- package/src/a2ui/core/complete-json.ts +81 -0
- package/src/a2ui/core/index.ts +10 -0
- package/src/a2ui/core/schema.ts +111 -0
- package/src/a2ui/core/spec.ts +148 -0
- package/src/a2ui/core/validate.ts +266 -0
- package/src/a2ui/index.ts +7 -0
- package/src/a2ui/ui-catalog.tsx +225 -0
- package/src/a2ui/wave1-chart-spec.test.ts +87 -0
- package/src/a2ui/wave2-chart-spec.test.ts +108 -0
- package/src/agentic-workspace.stories.tsx +6 -45
- package/src/chat-shell.test.tsx +40 -10
- package/src/chat-shell.tsx +90 -44
- package/src/chat.stories.tsx +47 -42
- package/src/composer.stories.tsx +4 -5
- package/src/composer.test.tsx +45 -0
- package/src/composer.tsx +104 -21
- package/src/context-panel.stories.tsx +1 -1
- package/src/context-panel.tsx +1 -1
- package/src/conversation.stories.tsx +1 -0
- package/src/conversation.test.tsx +16 -0
- package/src/conversation.tsx +16 -2
- package/src/diff-view.stories.tsx +79 -0
- package/src/diff-view.tsx +3 -2
- package/src/file-tree.tsx +24 -17
- package/src/gallery.stories.tsx +42 -0
- package/src/gallery.tsx +2 -2
- package/src/grouped-parts.stories.tsx +23 -0
- package/src/grouped-parts.tsx +1 -1
- package/src/index.ts +1 -0
- package/src/message-compare.stories.tsx +40 -0
- package/src/message-compare.tsx +2 -1
- package/src/message-form.tsx +1 -1
- package/src/message-table.stories.tsx +24 -0
- package/src/message-table.tsx +1 -1
- package/src/package-info.tsx +12 -9
- package/src/reasoning.stories.tsx +27 -0
- package/src/reasoning.tsx +1 -1
- package/src/session-header.stories.tsx +35 -1
- package/src/session-header.tsx +1 -1
- package/src/sources.stories.tsx +30 -0
- package/src/sources.tsx +4 -1
- package/src/templates-ai-assistant.stories.tsx +151 -87
- package/src/tool.stories.tsx +39 -0
- package/src/tool.tsx +3 -3
- package/src/toolbar.tsx +0 -10
- package/dist/_flow-boundary-SHNWLQG5.js.map +0 -1
- package/dist/_persona-rive-JEG44YHX.js.map +0 -1
- /package/dist/{_audio-player-media-chrome-T3XVXWRZ.js.map → _audio-player-media-chrome.js.map} +0 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ui-catalog.tsx — the shipped A2UI catalog: every non-builtin type in
|
|
5
|
+
* `catalog.source.json` bound to its `@elabs-ai/components-ui` component. The
|
|
6
|
+
* schema half (`A2UI_CATALOG_SCHEMA`, generated) says what an agent MAY emit; this
|
|
7
|
+
* half says what it renders AS. A test asserts the two key sets are identical, so
|
|
8
|
+
* a type cannot be validatable-but-unrenderable or the reverse.
|
|
9
|
+
*
|
|
10
|
+
* Apps extend it (`createA2uiCatalog`) with their own types — a chart from
|
|
11
|
+
* `@elabs-ai/components-charts`, a domain card — because `ai` may not import its
|
|
12
|
+
* sibling packages (one-way dependency graph) and an app composes freely.
|
|
13
|
+
*/
|
|
14
|
+
import {
|
|
15
|
+
Accordion,
|
|
16
|
+
AccordionContent,
|
|
17
|
+
AccordionItem,
|
|
18
|
+
AccordionTrigger,
|
|
19
|
+
Alert,
|
|
20
|
+
AlertDescription,
|
|
21
|
+
AlertTitle,
|
|
22
|
+
Avatar,
|
|
23
|
+
AvatarFallback,
|
|
24
|
+
Badge,
|
|
25
|
+
BentoGrid,
|
|
26
|
+
BentoGridItem,
|
|
27
|
+
Button,
|
|
28
|
+
ButtonGroup,
|
|
29
|
+
Card,
|
|
30
|
+
CardAction,
|
|
31
|
+
CardContent,
|
|
32
|
+
CardDescription,
|
|
33
|
+
CardFooter,
|
|
34
|
+
CardHeader,
|
|
35
|
+
CardTitle,
|
|
36
|
+
Checkbox,
|
|
37
|
+
Collapsible,
|
|
38
|
+
CollapsibleContent,
|
|
39
|
+
CollapsibleTrigger,
|
|
40
|
+
Descriptions,
|
|
41
|
+
DescriptionsItem,
|
|
42
|
+
EmptyState,
|
|
43
|
+
Heading,
|
|
44
|
+
Input,
|
|
45
|
+
Kbd,
|
|
46
|
+
Label,
|
|
47
|
+
MetricCard,
|
|
48
|
+
Progress,
|
|
49
|
+
RadioGroup,
|
|
50
|
+
RadioGroupItem,
|
|
51
|
+
SectionHeader,
|
|
52
|
+
Select,
|
|
53
|
+
SelectContent,
|
|
54
|
+
SelectItem,
|
|
55
|
+
SelectTrigger,
|
|
56
|
+
SelectValue,
|
|
57
|
+
Separator,
|
|
58
|
+
Slider,
|
|
59
|
+
StatePanel,
|
|
60
|
+
StatusBadge,
|
|
61
|
+
Switch,
|
|
62
|
+
Table,
|
|
63
|
+
TableBody,
|
|
64
|
+
TableCaption,
|
|
65
|
+
TableCell,
|
|
66
|
+
TableFooter,
|
|
67
|
+
TableHead,
|
|
68
|
+
TableHeader,
|
|
69
|
+
TableRow,
|
|
70
|
+
Tabs,
|
|
71
|
+
TabsContent,
|
|
72
|
+
TabsList,
|
|
73
|
+
TabsTrigger,
|
|
74
|
+
Text,
|
|
75
|
+
Textarea,
|
|
76
|
+
Timeline,
|
|
77
|
+
} from "@elabs-ai/components-ui";
|
|
78
|
+
import type { AlertTitleProps } from "@elabs-ai/components-ui";
|
|
79
|
+
import type { ComponentType } from "react";
|
|
80
|
+
|
|
81
|
+
import { A2UI_CATALOG_SCHEMA } from "./core/catalog.generated";
|
|
82
|
+
import type { A2uiCatalogSchema, A2uiCatalogTypeSchema } from "./core/spec";
|
|
83
|
+
|
|
84
|
+
/** One renderable catalog type: its schema plus the component that draws it. */
|
|
85
|
+
export interface A2uiCatalogEntry {
|
|
86
|
+
schema: A2uiCatalogTypeSchema;
|
|
87
|
+
/** Absent for builtins (`Stack`, `Grid`), which the surface draws itself. */
|
|
88
|
+
component?: ComponentType<Record<string, unknown>>;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export type A2uiCatalog = Record<string, A2uiCatalogEntry>;
|
|
92
|
+
|
|
93
|
+
// `ComponentType<Record<string, unknown>>` is the erased shape the renderer calls
|
|
94
|
+
// with validated, catalog-shaped props; each binding is a real ui component.
|
|
95
|
+
type AnyComponent = ComponentType<any>; // eslint-disable-line @typescript-eslint/no-explicit-any -- erased at the catalog boundary; props are validated against the schema
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* `AlertTitle` inside a surface, as a `<div>` rather than its default `<h5>`.
|
|
99
|
+
*
|
|
100
|
+
* A surface is rendered into a host page whose heading outline the agent cannot see, so a
|
|
101
|
+
* fixed `h5` fails axe's `heading-order` under any host with no `h4` above it — which is
|
|
102
|
+
* most of them. The alert's `role="alert"` announces the title either way, so the heading
|
|
103
|
+
* adds nothing here; `CardTitle` defaults to `div` for the same reason. A host writing real
|
|
104
|
+
* code composes `<AlertTitle as="h3">`, where the level is knowable.
|
|
105
|
+
*/
|
|
106
|
+
const SurfaceAlertTitle = (props: AlertTitleProps) => <AlertTitle {...props} as="div" />;
|
|
107
|
+
|
|
108
|
+
/** The `@elabs-ai/components-ui` bindings, one per non-builtin catalog type. */
|
|
109
|
+
export const UI_CATALOG_BINDINGS: Record<string, AnyComponent> = {
|
|
110
|
+
Accordion,
|
|
111
|
+
AccordionContent,
|
|
112
|
+
AccordionItem,
|
|
113
|
+
AccordionTrigger,
|
|
114
|
+
Alert,
|
|
115
|
+
AlertDescription,
|
|
116
|
+
AlertTitle: SurfaceAlertTitle,
|
|
117
|
+
Avatar,
|
|
118
|
+
AvatarFallback,
|
|
119
|
+
Badge,
|
|
120
|
+
BentoGrid,
|
|
121
|
+
BentoGridItem,
|
|
122
|
+
Button,
|
|
123
|
+
ButtonGroup,
|
|
124
|
+
Card,
|
|
125
|
+
CardAction,
|
|
126
|
+
CardContent,
|
|
127
|
+
CardDescription,
|
|
128
|
+
CardFooter,
|
|
129
|
+
CardHeader,
|
|
130
|
+
CardTitle,
|
|
131
|
+
Checkbox,
|
|
132
|
+
Collapsible,
|
|
133
|
+
CollapsibleContent,
|
|
134
|
+
CollapsibleTrigger,
|
|
135
|
+
Descriptions,
|
|
136
|
+
DescriptionsItem,
|
|
137
|
+
EmptyState,
|
|
138
|
+
Heading,
|
|
139
|
+
Input,
|
|
140
|
+
Kbd,
|
|
141
|
+
Label,
|
|
142
|
+
MetricCard,
|
|
143
|
+
Progress,
|
|
144
|
+
RadioGroup,
|
|
145
|
+
RadioGroupItem,
|
|
146
|
+
SectionHeader,
|
|
147
|
+
Select,
|
|
148
|
+
SelectContent,
|
|
149
|
+
SelectItem,
|
|
150
|
+
SelectTrigger,
|
|
151
|
+
SelectValue,
|
|
152
|
+
Separator,
|
|
153
|
+
Slider,
|
|
154
|
+
StatePanel,
|
|
155
|
+
StatusBadge,
|
|
156
|
+
Switch,
|
|
157
|
+
Table,
|
|
158
|
+
TableBody,
|
|
159
|
+
TableCaption,
|
|
160
|
+
TableCell,
|
|
161
|
+
TableFooter,
|
|
162
|
+
TableHead,
|
|
163
|
+
TableHeader,
|
|
164
|
+
TableRow,
|
|
165
|
+
Tabs,
|
|
166
|
+
TabsContent,
|
|
167
|
+
TabsList,
|
|
168
|
+
TabsTrigger,
|
|
169
|
+
Text,
|
|
170
|
+
Textarea,
|
|
171
|
+
Timeline,
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Build a catalog from component bindings + a schema. Every schema type that is
|
|
176
|
+
* not a builtin must have a binding; a binding without a schema is ignored (it
|
|
177
|
+
* would be unvalidatable). Extend the shipped one:
|
|
178
|
+
*
|
|
179
|
+
* ```ts
|
|
180
|
+
* const catalog = createA2uiCatalog(
|
|
181
|
+
* { ...UI_CATALOG_BINDINGS, RevenueChart },
|
|
182
|
+
* { ...A2UI_CATALOG_SCHEMA, RevenueChart: defineA2uiType({ props: { series: { type: "array", required: true } } }) },
|
|
183
|
+
* );
|
|
184
|
+
* ```
|
|
185
|
+
*/
|
|
186
|
+
export function createA2uiCatalog(
|
|
187
|
+
bindings: Record<string, AnyComponent>,
|
|
188
|
+
schema: A2uiCatalogSchema = A2UI_CATALOG_SCHEMA,
|
|
189
|
+
): A2uiCatalog {
|
|
190
|
+
const catalog: A2uiCatalog = {};
|
|
191
|
+
for (const [type, typeSchema] of Object.entries(schema)) {
|
|
192
|
+
if (typeSchema.builtin) {
|
|
193
|
+
catalog[type] = { schema: typeSchema };
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
const component = bindings[type];
|
|
197
|
+
if (!component) {
|
|
198
|
+
throw new Error(`createA2uiCatalog: catalog type "${type}" has no component binding`);
|
|
199
|
+
}
|
|
200
|
+
catalog[type] = { schema: typeSchema, component };
|
|
201
|
+
}
|
|
202
|
+
return catalog;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/** Author a schema entry for an app-provided type with sensible defaults. */
|
|
206
|
+
export function defineA2uiType(
|
|
207
|
+
partial: Partial<A2uiCatalogTypeSchema> & { source?: string },
|
|
208
|
+
): A2uiCatalogTypeSchema {
|
|
209
|
+
return {
|
|
210
|
+
children: partial.children ?? false,
|
|
211
|
+
props: partial.props ?? {},
|
|
212
|
+
events: partial.events ?? {},
|
|
213
|
+
source: partial.source ?? "app",
|
|
214
|
+
...(partial.summary ? { summary: partial.summary } : {}),
|
|
215
|
+
...(partial.builtin ? { builtin: true } : {}),
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/** The schema half of a catalog (what `validateA2uiSurface` takes). */
|
|
220
|
+
export function catalogSchema(catalog: A2uiCatalog): A2uiCatalogSchema {
|
|
221
|
+
return Object.fromEntries(Object.entries(catalog).map(([t, e]) => [t, e.schema]));
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/** The shipped catalog: builtins + every `@elabs-ai/components-ui` type above. */
|
|
225
|
+
export const uiCatalog: A2uiCatalog = createA2uiCatalog(UI_CATALOG_BINDINGS);
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { CHARTS_A2UI_CATALOG_SCHEMA } from "@elabs-ai/components-charts";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
|
|
4
|
+
import { A2UI_CATALOG_SCHEMA, type A2uiCatalogSchema, validateA2uiSurface } from "./core";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Proves the A2UI catalog's `AutoChart.spec` prop (an opaque `type: "object"`,
|
|
8
|
+
* `packages/ai/src/a2ui/catalog.source.json`) validates `ChartSpec` objects that use the
|
|
9
|
+
* wave-1 fields (`labels`, `annotations`, `nulls`, dumbbell `variant`, …) — an agent that
|
|
10
|
+
* reads the catalog's description can rely on emitting them (`.claude/scratch/datawrapper-parity`).
|
|
11
|
+
* `charts` is a devDependency of `ai` for exactly this kind of cross-catalog test (see
|
|
12
|
+
* `agentic-workspace.stories.tsx`); `ai` never imports `charts` at runtime (D6).
|
|
13
|
+
*
|
|
14
|
+
* `ChartsA2uiCatalogSchema` (charts) and `A2uiCatalogSchema` (ai) are structurally close
|
|
15
|
+
* but not identical (`default?: unknown` vs `default?: A2uiJson`) — the same gap the
|
|
16
|
+
* `createA2uiCatalog` docblock's merge example papers over as a comment, never
|
|
17
|
+
* type-checked. The runtime shapes agree; the cast documents the known type gap rather
|
|
18
|
+
* than widening either schema's `default` field.
|
|
19
|
+
*/
|
|
20
|
+
const CATALOG = {
|
|
21
|
+
...A2UI_CATALOG_SCHEMA,
|
|
22
|
+
...CHARTS_A2UI_CATALOG_SCHEMA,
|
|
23
|
+
} as unknown as A2uiCatalogSchema;
|
|
24
|
+
|
|
25
|
+
describe("A2UI catalog accepts wave-1 ChartSpec fields", () => {
|
|
26
|
+
it("validates line, pie and dumbbell specs using labels.series, annotations, nulls, labels.slices and variant: arrow", () => {
|
|
27
|
+
const r = validateA2uiSurface(
|
|
28
|
+
{
|
|
29
|
+
a2ui: "1",
|
|
30
|
+
root: {
|
|
31
|
+
type: "Stack",
|
|
32
|
+
children: [
|
|
33
|
+
{
|
|
34
|
+
type: "AutoChart",
|
|
35
|
+
props: {
|
|
36
|
+
spec: {
|
|
37
|
+
type: "line",
|
|
38
|
+
data: [
|
|
39
|
+
{ month: "Jan", revenue: 100 },
|
|
40
|
+
{ month: "Feb", revenue: null },
|
|
41
|
+
{ month: "Mar", revenue: 140 },
|
|
42
|
+
],
|
|
43
|
+
x: "month",
|
|
44
|
+
series: ["revenue"],
|
|
45
|
+
labels: { series: "end" },
|
|
46
|
+
annotations: [{ kind: "line", y: 120, label: "Target" }],
|
|
47
|
+
nulls: "connect",
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
type: "AutoChart",
|
|
53
|
+
props: {
|
|
54
|
+
spec: {
|
|
55
|
+
type: "pie",
|
|
56
|
+
data: [
|
|
57
|
+
{ channel: "Direct", share: 62 },
|
|
58
|
+
{ channel: "Referral", share: 38 },
|
|
59
|
+
],
|
|
60
|
+
x: "channel",
|
|
61
|
+
series: ["share"],
|
|
62
|
+
labels: { slices: { show: ["label", "percent"] } },
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
type: "AutoChart",
|
|
68
|
+
props: {
|
|
69
|
+
spec: {
|
|
70
|
+
type: "dumbbell",
|
|
71
|
+
data: [{ region: "West", fy24: 10, fy25: 15 }],
|
|
72
|
+
x: "region",
|
|
73
|
+
series: ["fy24"],
|
|
74
|
+
y2: "fy25",
|
|
75
|
+
variant: "arrow",
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
CATALOG,
|
|
83
|
+
);
|
|
84
|
+
expect(r.errors).toEqual([]);
|
|
85
|
+
expect(r.ok).toBe(true);
|
|
86
|
+
});
|
|
87
|
+
});
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { CHARTS_A2UI_CATALOG_SCHEMA } from "@elabs-ai/components-charts";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
|
|
4
|
+
import { A2UI_CATALOG_SCHEMA, type A2uiCatalogSchema, validateA2uiSurface } from "./core";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Proves the A2UI catalog's `AutoChart.spec` prop (an opaque `type: "object"`,
|
|
8
|
+
* `packages/ai/src/a2ui/catalog.source.json`) validates `ChartSpec` objects that use the
|
|
9
|
+
* wave-2 fields — frame chrome (`notes`/`source`), `tooltip`, `facet`, `type: "dual-axis"`
|
|
10
|
+
* with `series[].axis`, and waterfall `groupBy`/`dataFormat` — the same precedent as
|
|
11
|
+
* `wave1-chart-spec.test.ts` (`.claude/scratch/datawrapper-parity`). See that file's docblock
|
|
12
|
+
* for why `charts` is a devDependency of `ai` here and why the cast is needed.
|
|
13
|
+
*/
|
|
14
|
+
const CATALOG = {
|
|
15
|
+
...A2UI_CATALOG_SCHEMA,
|
|
16
|
+
...CHARTS_A2UI_CATALOG_SCHEMA,
|
|
17
|
+
} as unknown as A2uiCatalogSchema;
|
|
18
|
+
|
|
19
|
+
describe("A2UI catalog accepts wave-2 ChartSpec fields", () => {
|
|
20
|
+
it("validates frame chrome (notes/source), tooltip and facet.by on a line spec", () => {
|
|
21
|
+
const r = validateA2uiSurface(
|
|
22
|
+
{
|
|
23
|
+
a2ui: "1",
|
|
24
|
+
root: {
|
|
25
|
+
type: "AutoChart",
|
|
26
|
+
props: {
|
|
27
|
+
spec: {
|
|
28
|
+
type: "line",
|
|
29
|
+
data: [
|
|
30
|
+
{ region: "West", month: "Jan", revenue: 100 },
|
|
31
|
+
{ region: "West", month: "Feb", revenue: 120 },
|
|
32
|
+
{ region: "East", month: "Jan", revenue: 80 },
|
|
33
|
+
{ region: "East", month: "Feb", revenue: 90 },
|
|
34
|
+
],
|
|
35
|
+
x: "month",
|
|
36
|
+
series: ["revenue"],
|
|
37
|
+
notes: "Preliminary figures, subject to close.",
|
|
38
|
+
source: { name: "Finance", href: "https://example.com/finance" },
|
|
39
|
+
tooltip: { variant: "rows", focus: true },
|
|
40
|
+
facet: { by: "region", scales: { y: "shared" } },
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
CATALOG,
|
|
46
|
+
);
|
|
47
|
+
expect(r.errors).toEqual([]);
|
|
48
|
+
expect(r.ok).toBe(true);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("validates a type: dual-axis spec using series[].axis and series[].mark", () => {
|
|
52
|
+
const r = validateA2uiSurface(
|
|
53
|
+
{
|
|
54
|
+
a2ui: "1",
|
|
55
|
+
root: {
|
|
56
|
+
type: "AutoChart",
|
|
57
|
+
props: {
|
|
58
|
+
spec: {
|
|
59
|
+
type: "dual-axis",
|
|
60
|
+
data: [
|
|
61
|
+
{ month: "Jan", revenue: 100, margin: 0.2 },
|
|
62
|
+
{ month: "Feb", revenue: 120, margin: 0.25 },
|
|
63
|
+
],
|
|
64
|
+
x: "month",
|
|
65
|
+
series: [
|
|
66
|
+
{ key: "revenue", axis: "left", mark: "column" },
|
|
67
|
+
{ key: "margin", axis: "right", mark: "line" },
|
|
68
|
+
],
|
|
69
|
+
axes: { y2: { align: "ticks", zero: "auto" } },
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
CATALOG,
|
|
75
|
+
);
|
|
76
|
+
expect(r.errors).toEqual([]);
|
|
77
|
+
expect(r.ok).toBe(true);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it("validates a waterfall spec using groupBy (subtotals) and dataFormat", () => {
|
|
81
|
+
const r = validateA2uiSurface(
|
|
82
|
+
{
|
|
83
|
+
a2ui: "1",
|
|
84
|
+
root: {
|
|
85
|
+
type: "AutoChart",
|
|
86
|
+
props: {
|
|
87
|
+
spec: {
|
|
88
|
+
type: "waterfall",
|
|
89
|
+
data: [
|
|
90
|
+
{ step: "Starting cash", value: 1000, group: "Q1" },
|
|
91
|
+
{ step: "Sales", value: 400, group: "Q1" },
|
|
92
|
+
{ step: "Costs", value: -150, group: "Q1" },
|
|
93
|
+
],
|
|
94
|
+
x: "step",
|
|
95
|
+
series: ["value"],
|
|
96
|
+
groupBy: "group",
|
|
97
|
+
dataFormat: "differences",
|
|
98
|
+
zoomToDifferences: false,
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
CATALOG,
|
|
104
|
+
);
|
|
105
|
+
expect(r.errors).toEqual([]);
|
|
106
|
+
expect(r.ok).toBe(true);
|
|
107
|
+
});
|
|
108
|
+
});
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
import { useState } from "react";
|
|
2
2
|
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
3
|
import {
|
|
4
|
-
Avatar,
|
|
5
|
-
AvatarFallback,
|
|
6
4
|
Badge,
|
|
7
5
|
Button,
|
|
8
6
|
Collapsible,
|
|
9
7
|
CollapsibleContent,
|
|
10
8
|
CollapsibleTrigger,
|
|
11
|
-
DropdownMenu,
|
|
12
|
-
DropdownMenuContent,
|
|
13
|
-
DropdownMenuItem,
|
|
14
|
-
DropdownMenuLabel,
|
|
15
|
-
DropdownMenuSeparator,
|
|
16
|
-
DropdownMenuTrigger,
|
|
17
9
|
Separator,
|
|
18
10
|
Sidebar,
|
|
19
11
|
SidebarContent,
|
|
12
|
+
NavUser,
|
|
20
13
|
SidebarFooter,
|
|
21
14
|
SidebarGroup,
|
|
22
15
|
SidebarGroupAction,
|
|
@@ -52,18 +45,15 @@ import {
|
|
|
52
45
|
Boxes,
|
|
53
46
|
Calculator,
|
|
54
47
|
ChevronRight,
|
|
55
|
-
ChevronsUpDown,
|
|
56
48
|
Copy,
|
|
57
49
|
Database,
|
|
58
50
|
FolderKanban,
|
|
59
51
|
Globe,
|
|
60
52
|
History,
|
|
61
|
-
LogOut,
|
|
62
53
|
MessageSquarePlus,
|
|
63
54
|
PencilLine,
|
|
64
55
|
RefreshCw,
|
|
65
56
|
Search,
|
|
66
|
-
Settings,
|
|
67
57
|
Share2,
|
|
68
58
|
Sparkles,
|
|
69
59
|
ThumbsDown,
|
|
@@ -345,7 +335,7 @@ function WorkspaceSidebar({
|
|
|
345
335
|
<SidebarMenuButton
|
|
346
336
|
tooltip="New chat"
|
|
347
337
|
onClick={onNewChat}
|
|
348
|
-
className="bg-primary text-primary-foreground hover:bg-primary
|
|
338
|
+
className="bg-primary text-primary-foreground hover:bg-primary-hover hover:text-primary-foreground active:bg-primary-active active:text-primary-foreground"
|
|
349
339
|
>
|
|
350
340
|
<MessageSquarePlus />
|
|
351
341
|
<span>New chat</span>
|
|
@@ -479,38 +469,7 @@ function WorkspaceSidebar({
|
|
|
479
469
|
</SidebarContent>
|
|
480
470
|
|
|
481
471
|
<SidebarFooter>
|
|
482
|
-
<
|
|
483
|
-
<SidebarMenuItem>
|
|
484
|
-
<DropdownMenu>
|
|
485
|
-
<DropdownMenuTrigger asChild>
|
|
486
|
-
<SidebarMenuButton size="lg" tooltip="Account" className="group">
|
|
487
|
-
<Avatar className="size-7 rounded-md">
|
|
488
|
-
<AvatarFallback className="rounded-md text-meta">AR</AvatarFallback>
|
|
489
|
-
</Avatar>
|
|
490
|
-
<span className="grid flex-1 text-start leading-tight">
|
|
491
|
-
<span className="truncate text-body font-medium">Avery Rao</span>
|
|
492
|
-
<span className="truncate text-meta text-sidebar-muted-foreground group-hover:text-sidebar-accent-foreground">
|
|
493
|
-
avery@acme.co
|
|
494
|
-
</span>
|
|
495
|
-
</span>
|
|
496
|
-
<ChevronsUpDown className="ms-auto size-4" />
|
|
497
|
-
</SidebarMenuButton>
|
|
498
|
-
</DropdownMenuTrigger>
|
|
499
|
-
<DropdownMenuContent side="right" align="end" className="w-48">
|
|
500
|
-
<DropdownMenuLabel>Account</DropdownMenuLabel>
|
|
501
|
-
<DropdownMenuItem>
|
|
502
|
-
<Settings className="me-2 size-4" />
|
|
503
|
-
Settings
|
|
504
|
-
</DropdownMenuItem>
|
|
505
|
-
<DropdownMenuSeparator />
|
|
506
|
-
<DropdownMenuItem>
|
|
507
|
-
<LogOut className="me-2 size-4" />
|
|
508
|
-
Sign out
|
|
509
|
-
</DropdownMenuItem>
|
|
510
|
-
</DropdownMenuContent>
|
|
511
|
-
</DropdownMenu>
|
|
512
|
-
</SidebarMenuItem>
|
|
513
|
-
</SidebarMenu>
|
|
472
|
+
<NavUser user={{ name: "Avery Rao", email: "avery@acme.co" }} />
|
|
514
473
|
</SidebarFooter>
|
|
515
474
|
|
|
516
475
|
<SidebarRail />
|
|
@@ -974,7 +933,7 @@ function AgenticWorkspace({ defaultSidebarOpen = true }: { defaultSidebarOpen?:
|
|
|
974
933
|
<SidebarInset className="flex min-w-0 flex-col">
|
|
975
934
|
{/* Header bar — h-12 to align with the right ContextPanelHeader and
|
|
976
935
|
the library header convention (ChatShell/ContextPanel). */}
|
|
977
|
-
<header className="flex h-
|
|
936
|
+
<header className="flex h-header shrink-0 items-center gap-2 border-b bg-background px-3">
|
|
978
937
|
<SidebarTrigger className="-ms-1" />
|
|
979
938
|
<Separator orientation="vertical" className="me-1 h-5" />
|
|
980
939
|
<div className="flex min-w-0 items-center gap-1.5 text-body">
|
|
@@ -1083,9 +1042,11 @@ function AgenticWorkspace({ defaultSidebarOpen = true }: { defaultSidebarOpen?:
|
|
|
1083
1042
|
const meta = {
|
|
1084
1043
|
title: "Patterns/Scenarios/Agentic AI Workspace",
|
|
1085
1044
|
component: AgenticWorkspace,
|
|
1045
|
+
tags: ["autodocs"],
|
|
1086
1046
|
parameters: {
|
|
1087
1047
|
layout: "fullscreen",
|
|
1088
1048
|
docs: {
|
|
1049
|
+
subtitle: "For copilots and agentic products",
|
|
1089
1050
|
description: {
|
|
1090
1051
|
component:
|
|
1091
1052
|
"A full-page demo scenario composed from the @elabs-ai/components-* grammar: a double-sided application shell (collapsible left nav + the real ContextPanel right rail with animated collapse and asset drill-in) wrapping a complete agentic AI interaction — reasoning, a plan, the AgentTimeline execution rail, tools with JSON behind disclosure, a ToolResultCard chart headline, an ApprovalCard decision, a task summary, a checkpoint, and a grounded AgentMessage answer with an EvidenceChip and a SourceList.",
|
package/src/chat-shell.test.tsx
CHANGED
|
@@ -58,8 +58,8 @@ describe("ChatShell — slots", () => {
|
|
|
58
58
|
|
|
59
59
|
it("omits the header row entirely when no header is supplied", () => {
|
|
60
60
|
const { container } = render(<ChatShell>t</ChatShell>);
|
|
61
|
-
// An empty header would still occupy its fixed h-
|
|
62
|
-
expect(container.querySelector(".h-
|
|
61
|
+
// An empty header would still occupy its fixed h-header row.
|
|
62
|
+
expect(container.querySelector(".h-header")).toBeNull();
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
it("omits the aside rail entirely when no aside is supplied", () => {
|
|
@@ -91,16 +91,46 @@ describe("ChatShell — variants", () => {
|
|
|
91
91
|
expect(container.querySelector(".border-t")).toBeNull();
|
|
92
92
|
});
|
|
93
93
|
|
|
94
|
-
it("makes the
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
it("makes the edge scrims inert (aria-hidden AND pointer-events-none) in both variants", () => {
|
|
95
|
+
for (const variant of ["card", "bare"] as const) {
|
|
96
|
+
const { container, unmount } = render(<ChatShell variant={variant}>t</ChatShell>);
|
|
97
|
+
const scrims = container.querySelectorAll("[aria-hidden='true']");
|
|
98
|
+
expect(scrims).toHaveLength(2);
|
|
99
|
+
for (const scrim of scrims) expect(scrim).toHaveClass("pointer-events-none");
|
|
100
|
+
unmount();
|
|
101
|
+
}
|
|
99
102
|
});
|
|
103
|
+
});
|
|
100
104
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
105
|
+
describe("ChatShell — floating composer", () => {
|
|
106
|
+
it("floats the composer over the transcript instead of stacking a footer bar", () => {
|
|
107
|
+
const { container } = render(
|
|
108
|
+
<ChatShell composer={<textarea aria-label="Message" />}>
|
|
109
|
+
<p>transcript</p>
|
|
110
|
+
</ChatShell>,
|
|
111
|
+
);
|
|
112
|
+
const layer = container.querySelector("[data-slot='chat-shell-composer']");
|
|
113
|
+
expect(layer).toHaveClass("absolute", "bottom-0", "pb-4");
|
|
114
|
+
// The layer passes pointer events through to the transcript; only the
|
|
115
|
+
// composer column takes input.
|
|
116
|
+
expect(layer).toHaveClass("pointer-events-none");
|
|
117
|
+
expect(screen.getByRole("textbox", { name: "Message" }).parentElement).toHaveClass(
|
|
118
|
+
"pointer-events-auto",
|
|
119
|
+
"max-w-(--chat-composer-column)",
|
|
120
|
+
);
|
|
121
|
+
expect(container.querySelector(".border-t")).toBeNull();
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it("publishes the composer height so the transcript can scroll clear of it", () => {
|
|
125
|
+
const { container, rerender } = render(
|
|
126
|
+
<ChatShell composer={<textarea aria-label="Message" />}>t</ChatShell>,
|
|
127
|
+
);
|
|
128
|
+
const root = container.firstChild as HTMLElement;
|
|
129
|
+
// jsdom has no layout, so the measured height is 0 — the contract is that
|
|
130
|
+
// the variable is written at all.
|
|
131
|
+
expect(root.style.getPropertyValue("--chat-composer-inset")).toBe("0px");
|
|
132
|
+
rerender(<ChatShell>t</ChatShell>);
|
|
133
|
+
expect(root.style.getPropertyValue("--chat-composer-inset")).toBe("");
|
|
104
134
|
});
|
|
105
135
|
});
|
|
106
136
|
|