@ds-mo/ui 14.18.1 → 14.19.1
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/dist/.package-ready.json +1 -1
- package/dist/agent-patterns.json +1 -1
- package/dist/agent.json +16 -9
- package/dist/angular/ds-pagination.d.ts +1 -1
- package/dist/angular/ds-pagination.js +3 -3
- package/dist/components/ds-agent-activity.js +1 -1
- package/dist/components/ds-agent-questionnaire.js +1 -1
- package/dist/components/ds-agent-response.js +1 -1
- package/dist/components/ds-agent-source-list.js +1 -1
- package/dist/components/ds-agent-tool-call.js +1 -1
- package/dist/components/ds-attachment-list.js +1 -1
- package/dist/components/ds-avatar.js +1 -1
- package/dist/components/ds-badge.js +1 -1
- package/dist/components/ds-banner.js +1 -1
- package/dist/components/ds-banner.js.map +1 -1
- package/dist/components/ds-bar-action.js +1 -1
- package/dist/components/ds-bar-action.js.map +1 -1
- package/dist/components/ds-bar-nav.js +1 -1
- package/dist/components/ds-bar-title.js +1 -1
- package/dist/components/ds-bar-workflow.js +1 -1
- package/dist/components/ds-bar-workflow.js.map +1 -1
- package/dist/components/ds-breadcrumb.js +1 -1
- package/dist/components/ds-button-filled.js +1 -1
- package/dist/components/ds-button-unfilled.js +1 -1
- package/dist/components/ds-card-chart.js +1 -1
- package/dist/components/ds-card-chart.js.map +1 -1
- package/dist/components/ds-card-overview.js +1 -1
- package/dist/components/ds-card-overview.js.map +1 -1
- package/dist/components/ds-card-setting.js +1 -1
- package/dist/components/ds-card-setting.js.map +1 -1
- package/dist/components/ds-chart-legend.js +1 -1
- package/dist/components/ds-chart-legend.js.map +1 -1
- package/dist/components/ds-chart.js +1 -1
- package/dist/components/ds-chart.js.map +1 -1
- package/dist/components/ds-checkbox.js +1 -1
- package/dist/components/ds-chip.js +1 -1
- package/dist/components/ds-chip.js.map +1 -1
- package/dist/components/ds-code-block.js +1 -1
- package/dist/components/ds-conversation-list-item.js +1 -1
- package/dist/components/ds-conversation-list-item.js.map +1 -1
- package/dist/components/ds-conversation-list-section.js +1 -1
- package/dist/components/ds-conversation-list.js +1 -1
- package/dist/components/ds-conversation-list.js.map +1 -1
- package/dist/components/ds-divider.js +1 -1
- package/dist/components/ds-empty-state.js +1 -1
- package/dist/components/ds-field.js +1 -1
- package/dist/components/ds-filter-menu.js +1 -1
- package/dist/components/ds-icon.js +1 -1
- package/dist/components/ds-input.js +1 -1
- package/dist/components/ds-loader.js +1 -1
- package/dist/components/ds-markdown.js +1 -1
- package/dist/components/ds-menu.js +1 -1
- package/dist/components/ds-message-actions.js +1 -1
- package/dist/components/ds-message-bubble.js +1 -1
- package/dist/components/ds-message-bubble.js.map +1 -1
- package/dist/components/ds-message-composer.js +1 -1
- package/dist/components/ds-message-composer.js.map +1 -1
- package/dist/components/ds-message-scroller.js +1 -1
- package/dist/components/ds-message-scroller.js.map +1 -1
- package/dist/components/ds-message.js +1 -1
- package/dist/components/ds-mobile-bar-nav.js +1 -1
- package/dist/components/ds-mobile-header.js +1 -1
- package/dist/components/ds-mobile-section-switcher.js +1 -1
- package/dist/components/ds-mobile-sheet-nav.js +1 -1
- package/dist/components/ds-modal.js +1 -1
- package/dist/components/ds-pagination.js +1 -1
- package/dist/components/ds-panel-nav.js +1 -1
- package/dist/components/ds-panel-sub-nav.js +1 -1
- package/dist/components/ds-panel-sub-nav.js.map +1 -1
- package/dist/components/ds-panel-tool-header.js +1 -1
- package/dist/components/ds-panel-tool-search.js +1 -1
- package/dist/components/ds-panel-tool-search.js.map +1 -1
- package/dist/components/ds-panel-tools.js +1 -1
- package/dist/components/ds-paper-texture.js +1 -1
- package/dist/components/ds-radio.js +1 -1
- package/dist/components/ds-scroll-overlay.js +1 -1
- package/dist/components/ds-scroll-overlay.js.map +1 -1
- package/dist/components/ds-select.js +1 -1
- package/dist/components/ds-shell-app.js +1 -1
- package/dist/components/ds-shell-app.js.map +1 -1
- package/dist/components/ds-shell-page.js +1 -1
- package/dist/components/ds-shell-tools.js +1 -1
- package/dist/components/ds-skeleton.js +1 -1
- package/dist/components/ds-slider.js +1 -1
- package/dist/components/ds-slider.js.map +1 -1
- package/dist/components/ds-swatch-picker.js +1 -1
- package/dist/components/ds-switch.js +1 -1
- package/dist/components/ds-tab-group.js +1 -1
- package/dist/components/ds-table-filter.js +1 -1
- package/dist/components/ds-table-saved-views.js +1 -1
- package/dist/components/ds-table-sort.js +1 -1
- package/dist/components/ds-table-sort.js.map +1 -1
- package/dist/components/ds-table-toolbar.js +1 -1
- package/dist/components/ds-table.js +1 -1
- package/dist/components/ds-table.js.map +1 -1
- package/dist/components/ds-tag.js +1 -1
- package/dist/components/ds-text.js +1 -1
- package/dist/components/ds-toast.js +1 -1
- package/dist/components/ds-toast.js.map +1 -1
- package/dist/components/ds-tooltip-chart.js +1 -1
- package/dist/components/ds-tooltip.js +1 -1
- package/dist/components/ds-typing-indicator.js +1 -1
- package/dist/components/p-0XTyQNRG.js +2 -0
- package/dist/components/{p-JPTkZ3Ji.js.map → p-0XTyQNRG.js.map} +1 -1
- package/dist/components/{p-DFQ9mcbK.js → p-1YHFQeI7.js} +1 -1
- package/dist/components/p-1YHFQeI7.js.map +1 -0
- package/dist/components/p-B-HsfQOK.js +2 -0
- package/dist/components/p-B-HsfQOK.js.map +1 -0
- package/dist/components/p-B4wTnsUL.js +2 -0
- package/dist/components/p-B4wTnsUL.js.map +1 -0
- package/dist/components/p-B6WQre5D.js +2 -0
- package/dist/components/p-B6WQre5D.js.map +1 -0
- package/dist/components/{p-B1JRCDHS.js → p-BHhmB9-4.js} +2 -2
- package/dist/components/{p-B1JRCDHS.js.map → p-BHhmB9-4.js.map} +1 -1
- package/dist/components/{p-CqQFowZd.js → p-BNq9fr9S.js} +2 -2
- package/dist/components/p-BNq9fr9S.js.map +1 -0
- package/dist/components/{p-BKp__CQX.js → p-BWwiCvep.js} +2 -2
- package/dist/components/p-BWwiCvep.js.map +1 -0
- package/dist/components/{p-BBG6Sswb.js → p-BYFS2qWb.js} +2 -2
- package/dist/components/{p-BBG6Sswb.js.map → p-BYFS2qWb.js.map} +1 -1
- package/dist/components/{p-uI6z53BE.js → p-Bb4KnRy0.js} +2 -2
- package/dist/components/{p-HB_cf_aR.js → p-BeA6Jv-3.js} +2 -2
- package/dist/components/{p-HB_cf_aR.js.map → p-BeA6Jv-3.js.map} +1 -1
- package/dist/components/{p-1Hu9jlju.js → p-Bf7PZJPT.js} +2 -2
- package/dist/components/{p-Bbb9A3NV.js → p-BjRD57w3.js} +2 -2
- package/dist/components/p-BjRD57w3.js.map +1 -0
- package/dist/components/{p-CKVHrOEp.js → p-BmlGeaY8.js} +2 -2
- package/dist/components/p-BmlGeaY8.js.map +1 -0
- package/dist/components/{p-CLVxgTme.js → p-BubgDQlb.js} +2 -2
- package/dist/components/p-BubgDQlb.js.map +1 -0
- package/dist/components/{p-BNkU9dcc.js → p-Bv6FSDPR.js} +2 -2
- package/dist/components/{p-BNkU9dcc.js.map → p-Bv6FSDPR.js.map} +1 -1
- package/dist/components/p-Bx1IHqJb.js +2 -0
- package/dist/components/p-Bx1IHqJb.js.map +1 -0
- package/dist/components/{p-D3fMaUJ3.js → p-Bx5BSd6F.js} +2 -2
- package/dist/components/p-Bx5BSd6F.js.map +1 -0
- package/dist/components/{p-B8q-6a03.js → p-C0qN3PSb.js} +1 -1
- package/dist/components/{p-B8q-6a03.js.map → p-C0qN3PSb.js.map} +1 -1
- package/dist/components/{p-H5T258T-.js → p-CFsLF-ts.js} +2 -2
- package/dist/components/p-CFsLF-ts.js.map +1 -0
- package/dist/components/p-CKtJ6FHM.js +2 -0
- package/dist/components/p-CKtJ6FHM.js.map +1 -0
- package/dist/components/p-CRSwNbPk.js +2 -0
- package/dist/components/p-CRSwNbPk.js.map +1 -0
- package/dist/components/{p-BFfLvMZd.js → p-Cea7rROU.js} +2 -2
- package/dist/components/{p-BFfLvMZd.js.map → p-Cea7rROU.js.map} +1 -1
- package/dist/components/{p-B0Byw6OX.js → p-CgGcgMjs.js} +1 -1
- package/dist/components/{p-B0Byw6OX.js.map → p-CgGcgMjs.js.map} +1 -1
- package/dist/components/{p-C-Y7gYgz.js → p-ChfVRPHw.js} +2 -2
- package/dist/components/p-ChfVRPHw.js.map +1 -0
- package/dist/components/{p-CJq3n5kA.js → p-Ck1hgD6g.js} +2 -2
- package/dist/components/p-Ck1hgD6g.js.map +1 -0
- package/dist/components/{p-BMc0DE59.js → p-CochmPyg.js} +1 -1
- package/dist/components/p-CochmPyg.js.map +1 -0
- package/dist/components/{p-iMuFgSoM.js → p-Cp5Hr7Vz.js} +2 -2
- package/dist/components/p-Cp5Hr7Vz.js.map +1 -0
- package/dist/components/p-CpUXubax.js +2 -0
- package/dist/components/{p-DtndC9f1.js.map → p-CpUXubax.js.map} +1 -1
- package/dist/components/p-Crz606uD.js +2 -0
- package/dist/components/p-Crz606uD.js.map +1 -0
- package/dist/components/p-Cxr0IQjC.js.map +1 -1
- package/dist/components/p-D-MWvpg6.js +2 -0
- package/dist/components/p-D-MWvpg6.js.map +1 -0
- package/dist/components/{p-Bu3dOjpW.js → p-D7v6Na7U.js} +2 -2
- package/dist/components/{p-Bu3dOjpW.js.map → p-D7v6Na7U.js.map} +1 -1
- package/dist/components/{p-C6DNhlES.js → p-DA5H_Iq_.js} +1 -1
- package/dist/components/p-DA5H_Iq_.js.map +1 -0
- package/dist/components/p-DBYCwq9L.js +2 -0
- package/dist/components/{p-BXN-e7vF.js.map → p-DBYCwq9L.js.map} +1 -1
- package/dist/components/{p-CY4YFAT3.js → p-DCbKsABt.js} +1 -1
- package/dist/components/p-DCbKsABt.js.map +1 -0
- package/dist/components/{p-C6R5Lft0.js → p-DFC0sRM-.js} +2 -2
- package/dist/components/p-DFC0sRM-.js.map +1 -0
- package/dist/components/{p-CsBICYmt.js → p-DGkn8FwV.js} +2 -2
- package/dist/components/p-DGkn8FwV.js.map +1 -0
- package/dist/components/p-DIqT1m2r.js +2 -0
- package/dist/components/p-DIqT1m2r.js.map +1 -0
- package/dist/components/p-DKt_8s-U.js +2 -0
- package/dist/components/p-DKt_8s-U.js.map +1 -0
- package/dist/components/p-DOUk4KoT.js.map +1 -1
- package/dist/components/p-DQBT1Jkf.js +2 -0
- package/dist/components/p-DQBT1Jkf.js.map +1 -0
- package/dist/components/p-DW5Ita-P.js +2 -0
- package/dist/components/{p-DUdOmSFR.js.map → p-DW5Ita-P.js.map} +1 -1
- package/dist/components/{p-DNpLDbWY.js → p-DZ58Sg5a.js} +1 -1
- package/dist/components/p-DZ58Sg5a.js.map +1 -0
- package/dist/components/{p-DDgeXGbB.js → p-DZv2g9Pe.js} +2 -2
- package/dist/components/p-DZv2g9Pe.js.map +1 -0
- package/dist/components/{p-BknXYAEc.js → p-DdH7b4JF.js} +2 -2
- package/dist/components/p-DdH7b4JF.js.map +1 -0
- package/dist/components/{p-DBue3ISk.js → p-Demfba7T.js} +2 -2
- package/dist/components/p-Demfba7T.js.map +1 -0
- package/dist/components/p-Djxw2FjZ.js +2 -0
- package/dist/components/{p-CwjVgUqy.js.map → p-Djxw2FjZ.js.map} +1 -1
- package/dist/components/p-DmWoFSGs.js +2 -0
- package/dist/components/p-DmWoFSGs.js.map +1 -0
- package/dist/components/p-Do8wbFff.js +2 -0
- package/dist/components/p-Do8wbFff.js.map +1 -0
- package/dist/components/p-Drnyq8z7.js +2 -0
- package/dist/components/p-Drnyq8z7.js.map +1 -0
- package/dist/components/p-DsgEY6mZ.js +2 -0
- package/dist/components/p-DsgEY6mZ.js.map +1 -0
- package/dist/components/p-Is1lFmwp.js +2 -0
- package/dist/components/p-Is1lFmwp.js.map +1 -0
- package/dist/components/{p-BUDAwJVV.js → p-caLOcQUK.js} +2 -2
- package/dist/components/p-caLOcQUK.js.map +1 -0
- package/dist/components/{p-D1eEgwcP.js → p-etg-Uk1u.js} +1 -1
- package/dist/components/{p-D1eEgwcP.js.map → p-etg-Uk1u.js.map} +1 -1
- package/dist/components/{p-C9gC4haA.js → p-fRDzpfi9.js} +2 -2
- package/dist/components/p-fRDzpfi9.js.map +1 -0
- package/dist/components/{p-C-vRkDyn.js → p-rCeztgVn.js} +1 -1
- package/dist/components/{p-C-vRkDyn.js.map → p-rCeztgVn.js.map} +1 -1
- package/dist/components/{p-B_jZIC9R.js → p-vrotWZxt.js} +2 -2
- package/dist/components/{p-B_jZIC9R.js.map → p-vrotWZxt.js.map} +1 -1
- package/dist/docs/components.json +35 -6
- package/dist/lib/shell/index.d.ts +2 -2
- package/dist/lib/shell/index.js +8 -6
- package/dist/lib/shell/index.js.map +2 -2
- package/dist/lib/toast/index.js +1 -4
- package/dist/lib/toast/index.js.map +2 -2
- package/dist/lib/utils/index.d.ts +1 -1
- package/dist/lib/utils/index.js +104 -22
- package/dist/lib/utils/index.js.map +2 -2
- package/dist/mcp/cli.js +70 -31
- package/dist/mcp-data/registry/agent-activity.json +1 -1
- package/dist/mcp-data/registry/agent-questionnaire.json +3 -3
- package/dist/mcp-data/registry/agent-source-list.json +2 -2
- package/dist/mcp-data/registry/agent-tool-call.json +2 -2
- package/dist/mcp-data/registry/attachment-list.json +1 -1
- package/dist/mcp-data/registry/badge.json +1 -1
- package/dist/mcp-data/registry/banner.json +2 -2
- package/dist/mcp-data/registry/bar-action.json +1 -1
- package/dist/mcp-data/registry/bar-nav.json +3 -3
- package/dist/mcp-data/registry/bar-workflow.json +1 -1
- package/dist/mcp-data/registry/breadcrumb.json +1 -1
- package/dist/mcp-data/registry/button-filled.json +1 -1
- package/dist/mcp-data/registry/button-unfilled.json +1 -1
- package/dist/mcp-data/registry/card-chart.json +2 -2
- package/dist/mcp-data/registry/card-overview.json +3 -3
- package/dist/mcp-data/registry/card-setting.json +1 -1
- package/dist/mcp-data/registry/chart-legend.json +1 -1
- package/dist/mcp-data/registry/chart.json +1 -1
- package/dist/mcp-data/registry/checkbox.json +1 -1
- package/dist/mcp-data/registry/chip.json +1 -1
- package/dist/mcp-data/registry/code-block.json +1 -1
- package/dist/mcp-data/registry/conversation-list-item.json +1 -1
- package/dist/mcp-data/registry/conversation-list.json +2 -2
- package/dist/mcp-data/registry/divider.json +1 -1
- package/dist/mcp-data/registry/empty-state.json +1 -1
- package/dist/mcp-data/registry/field.json +1 -1
- package/dist/mcp-data/registry/filter-menu.json +1 -1
- package/dist/mcp-data/registry/icon.json +2 -2
- package/dist/mcp-data/registry/input.json +2 -2
- package/dist/mcp-data/registry/loader.json +1 -1
- package/dist/mcp-data/registry/menu.json +3 -3
- package/dist/mcp-data/registry/message-bubble.json +1 -1
- package/dist/mcp-data/registry/message-composer.json +2 -2
- package/dist/mcp-data/registry/message-scroller.json +3 -3
- package/dist/mcp-data/registry/mobile-bar-nav.json +1 -1
- package/dist/mcp-data/registry/mobile-header.json +2 -2
- package/dist/mcp-data/registry/mobile-section-switcher.json +2 -2
- package/dist/mcp-data/registry/mobile-sheet-nav.json +1 -1
- package/dist/mcp-data/registry/modal.json +2 -2
- package/dist/mcp-data/registry/pagination.json +32 -11
- package/dist/mcp-data/registry/panel-nav.json +2 -2
- package/dist/mcp-data/registry/panel-sub-nav.json +1 -1
- package/dist/mcp-data/registry/panel-tool-header.json +1 -1
- package/dist/mcp-data/registry/panel-tool-search.json +1 -1
- package/dist/mcp-data/registry/panel-tools.json +2 -2
- package/dist/mcp-data/registry/radio.json +1 -1
- package/dist/mcp-data/registry/registry.json +15 -8
- package/dist/mcp-data/registry/select.json +1 -1
- package/dist/mcp-data/registry/shell-app.json +2 -2
- package/dist/mcp-data/registry/shell-page.json +1 -1
- package/dist/mcp-data/registry/shell-tools.json +1 -1
- package/dist/mcp-data/registry/skeleton.json +2 -2
- package/dist/mcp-data/registry/slider.json +2 -2
- package/dist/mcp-data/registry/swatch-picker.json +3 -3
- package/dist/mcp-data/registry/switch.json +2 -2
- package/dist/mcp-data/registry/tab-group.json +2 -2
- package/dist/mcp-data/registry/table-sort.json +1 -1
- package/dist/mcp-data/registry/table.json +18 -18
- package/dist/mcp-data/registry/tag.json +2 -2
- package/dist/mcp-data/registry/text.json +4 -4
- package/dist/mcp-data/registry/toast.json +2 -2
- package/dist/mcp-data/registry/tooltip-chart.json +2 -2
- package/dist/mcp-data/registry/tooltip.json +2 -2
- package/dist/styles/prose.css +42 -38
- package/dist/styles/table.css +39 -67
- package/dist/types/components/CardSetting/index.d.ts +1 -1
- package/dist/types/components/Pagination/Pagination.d.ts +2 -0
- package/dist/types/components/Pagination/pagination-types.d.ts +2 -0
- package/dist/types/components/TooltipChart/index.d.ts +1 -1
- package/dist/types/components.d.ts +11 -0
- package/dist/types/shell/index.d.ts +2 -2
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/vue/ds-pagination.js +1 -0
- package/package.json +11 -1
- package/dist/components/p-B00PEE6t.js +0 -2
- package/dist/components/p-B00PEE6t.js.map +0 -1
- package/dist/components/p-BCOl1x0_.js +0 -2
- package/dist/components/p-BCOl1x0_.js.map +0 -1
- package/dist/components/p-BHVOiWz5.js +0 -2
- package/dist/components/p-BHVOiWz5.js.map +0 -1
- package/dist/components/p-BKp__CQX.js.map +0 -1
- package/dist/components/p-BMc0DE59.js.map +0 -1
- package/dist/components/p-BPG0r_mC.js +0 -2
- package/dist/components/p-BPG0r_mC.js.map +0 -1
- package/dist/components/p-BUDAwJVV.js.map +0 -1
- package/dist/components/p-BXN-e7vF.js +0 -2
- package/dist/components/p-Bbb9A3NV.js.map +0 -1
- package/dist/components/p-Bece5KH3.js +0 -2
- package/dist/components/p-Bece5KH3.js.map +0 -1
- package/dist/components/p-BhYS_Ump.js +0 -2
- package/dist/components/p-BhYS_Ump.js.map +0 -1
- package/dist/components/p-Bkh7scMQ.js +0 -2
- package/dist/components/p-Bkh7scMQ.js.map +0 -1
- package/dist/components/p-BknXYAEc.js.map +0 -1
- package/dist/components/p-C-Y7gYgz.js.map +0 -1
- package/dist/components/p-C6DNhlES.js.map +0 -1
- package/dist/components/p-C6R5Lft0.js.map +0 -1
- package/dist/components/p-C9gC4haA.js.map +0 -1
- package/dist/components/p-CAnnQL1F.js +0 -2
- package/dist/components/p-CAnnQL1F.js.map +0 -1
- package/dist/components/p-CE2IKOsy.js +0 -2
- package/dist/components/p-CE2IKOsy.js.map +0 -1
- package/dist/components/p-CJq3n5kA.js.map +0 -1
- package/dist/components/p-CKVHrOEp.js.map +0 -1
- package/dist/components/p-CLVxgTme.js.map +0 -1
- package/dist/components/p-CY4YFAT3.js.map +0 -1
- package/dist/components/p-Cg0kimXZ.js +0 -2
- package/dist/components/p-Cg0kimXZ.js.map +0 -1
- package/dist/components/p-CqQFowZd.js.map +0 -1
- package/dist/components/p-CsBICYmt.js.map +0 -1
- package/dist/components/p-CwjVgUqy.js +0 -2
- package/dist/components/p-D123Jvp-.js +0 -2
- package/dist/components/p-D123Jvp-.js.map +0 -1
- package/dist/components/p-D3fMaUJ3.js.map +0 -1
- package/dist/components/p-D7R4yE2C.js +0 -2
- package/dist/components/p-D7R4yE2C.js.map +0 -1
- package/dist/components/p-D7haeL5y.js +0 -2
- package/dist/components/p-D7haeL5y.js.map +0 -1
- package/dist/components/p-DAvh38E4.js +0 -2
- package/dist/components/p-DAvh38E4.js.map +0 -1
- package/dist/components/p-DBue3ISk.js.map +0 -1
- package/dist/components/p-DDgeXGbB.js.map +0 -1
- package/dist/components/p-DFQ9mcbK.js.map +0 -1
- package/dist/components/p-DNpLDbWY.js.map +0 -1
- package/dist/components/p-DUdOmSFR.js +0 -2
- package/dist/components/p-DtndC9f1.js +0 -2
- package/dist/components/p-H5T258T-.js.map +0 -1
- package/dist/components/p-JPTkZ3Ji.js +0 -2
- package/dist/components/p-LK-jpxwq.js +0 -2
- package/dist/components/p-LK-jpxwq.js.map +0 -1
- package/dist/components/p-ag6Io-kL.js +0 -2
- package/dist/components/p-ag6Io-kL.js.map +0 -1
- package/dist/components/p-iMuFgSoM.js.map +0 -1
- /package/dist/components/{p-uI6z53BE.js.map → p-Bb4KnRy0.js.map} +0 -0
- /package/dist/components/{p-1Hu9jlju.js.map → p-Bf7PZJPT.js.map} +0 -0
package/dist/mcp/cli.js
CHANGED
|
@@ -29226,20 +29226,28 @@ ${examples.join("\n\n")}`);
|
|
|
29226
29226
|
const type = (definition.resolvedType ?? definition.type).replaceAll("|", "\\|");
|
|
29227
29227
|
return `| \`${name}\` | \`${type}\` | ${required2}${defaultValue}${description} |`;
|
|
29228
29228
|
});
|
|
29229
|
-
sections.push(
|
|
29229
|
+
sections.push(
|
|
29230
|
+
`## Props
|
|
29230
29231
|
|
|
29231
29232
|
| Prop | Type | Notes |
|
|
29232
29233
|
|------|------|-------|
|
|
29233
|
-
${rows.join("\n")}`
|
|
29234
|
+
${rows.join("\n")}`
|
|
29235
|
+
);
|
|
29234
29236
|
}
|
|
29235
29237
|
if (component.registryDependencies?.length) {
|
|
29236
|
-
sections.push(
|
|
29238
|
+
sections.push(
|
|
29239
|
+
`## Component Dependencies
|
|
29237
29240
|
|
|
29238
|
-
${component.registryDependencies.map((dependency) => `- \`${dependency}\``).join("\n")}`
|
|
29241
|
+
${component.registryDependencies.map((dependency) => `- \`${dependency}\``).join("\n")}`
|
|
29242
|
+
);
|
|
29239
29243
|
}
|
|
29240
29244
|
if (consumption.peerDependencies) {
|
|
29241
|
-
const required2 = consumption.peerDependencies.required.map(
|
|
29242
|
-
|
|
29245
|
+
const required2 = consumption.peerDependencies.required.map(
|
|
29246
|
+
(dependency) => `- ${dependency} (required)`
|
|
29247
|
+
);
|
|
29248
|
+
const optional2 = (consumption.peerDependencies.optional ?? []).map(
|
|
29249
|
+
(dependency) => `- ${dependency} (optional)`
|
|
29250
|
+
);
|
|
29243
29251
|
sections.push(`## Peer Dependencies
|
|
29244
29252
|
|
|
29245
29253
|
${[...required2, ...optional2].join("\n")}`);
|
|
@@ -29256,11 +29264,14 @@ ${meta3.intent.accessibility.map((item) => `- ${item}`).join("\n")}`
|
|
|
29256
29264
|
|
|
29257
29265
|
${intent.join("\n\n")}`);
|
|
29258
29266
|
if (meta3.intent.patterns?.length) {
|
|
29259
|
-
sections.push(
|
|
29267
|
+
sections.push(
|
|
29268
|
+
`## Composition Patterns
|
|
29260
29269
|
|
|
29261
|
-
${meta3.intent.patterns.map((pattern) => `- \`${pattern}\` \u2014 retrieve it with \`get_pattern\` for executable framework recipes.`).join("\n")}`
|
|
29270
|
+
${meta3.intent.patterns.map((pattern) => `- \`${pattern}\` \u2014 retrieve it with \`get_pattern\` for executable framework recipes.`).join("\n")}`
|
|
29271
|
+
);
|
|
29262
29272
|
}
|
|
29263
|
-
if (consumption.complexPropertyNote)
|
|
29273
|
+
if (consumption.complexPropertyNote)
|
|
29274
|
+
sections.push(`## Framework Note
|
|
29264
29275
|
|
|
29265
29276
|
${consumption.complexPropertyNote}`);
|
|
29266
29277
|
if (meta3.storybook) sections.push(`## Storybook
|
|
@@ -29277,7 +29288,9 @@ function formatComponentSourceHeader(component) {
|
|
|
29277
29288
|
}
|
|
29278
29289
|
function formatPatternList(patterns) {
|
|
29279
29290
|
return patterns.map((pattern) => {
|
|
29280
|
-
const recipeCount = Object.values(pattern.implementations ?? {}).flatMap(
|
|
29291
|
+
const recipeCount = Object.values(pattern.implementations ?? {}).flatMap(
|
|
29292
|
+
(implementation) => implementation.recipes ?? []
|
|
29293
|
+
).length;
|
|
29281
29294
|
return `- **${pattern.id.replace(/^pattern:/, "")}** (\`${pattern.id}\`) \u2014 ${recipeCount} framework recipe${recipeCount === 1 ? "" : "s"}
|
|
29282
29295
|
${pattern.summary}`;
|
|
29283
29296
|
}).join("\n\n");
|
|
@@ -29293,13 +29306,17 @@ function formatPatternDetail(pattern, requestedFramework) {
|
|
|
29293
29306
|
${pattern.summary}`];
|
|
29294
29307
|
sections.push(formatGuidance("Use When", pattern.useWhen));
|
|
29295
29308
|
sections.push(formatGuidance("Avoid When", pattern.avoidWhen));
|
|
29296
|
-
sections.push(
|
|
29309
|
+
sections.push(
|
|
29310
|
+
`## Components
|
|
29297
29311
|
|
|
29298
|
-
${pattern.components.map((entry) => `- \`${entry.component}\` (${entry.required ? "required" : "optional"}): ${entry.role}`).join("\n")}`
|
|
29312
|
+
${pattern.components.map((entry) => `- \`${entry.component}\` (${entry.required ? "required" : "optional"}): ${entry.role}`).join("\n")}`
|
|
29313
|
+
);
|
|
29299
29314
|
sections.push(formatGuidance("State Ownership", pattern.stateOwnership));
|
|
29300
29315
|
sections.push(formatGuidance("Accessibility", pattern.accessibility));
|
|
29301
29316
|
sections.push(formatGuidance("Responsive Behavior", pattern.responsiveBehavior));
|
|
29302
|
-
const implementations = Object.entries(pattern.implementations).filter(
|
|
29317
|
+
const implementations = Object.entries(pattern.implementations).filter(
|
|
29318
|
+
([framework]) => !requestedFramework || framework === requestedFramework
|
|
29319
|
+
);
|
|
29303
29320
|
for (const [framework, implementation] of implementations) {
|
|
29304
29321
|
const recipes = implementation.recipes ?? [];
|
|
29305
29322
|
if (!recipes.length) continue;
|
|
@@ -29368,11 +29385,13 @@ var SETUP_GUIDE_OUTPUT_SCHEMA = external_exports.object({
|
|
|
29368
29385
|
var COMPONENT_SOURCE_OUTPUT_SCHEMA = external_exports.object({
|
|
29369
29386
|
name: external_exports.string(),
|
|
29370
29387
|
title: external_exports.string(),
|
|
29371
|
-
files: external_exports.array(
|
|
29372
|
-
|
|
29373
|
-
|
|
29374
|
-
|
|
29375
|
-
|
|
29388
|
+
files: external_exports.array(
|
|
29389
|
+
external_exports.object({
|
|
29390
|
+
path: external_exports.string(),
|
|
29391
|
+
language: external_exports.enum(["css", "tsx"]),
|
|
29392
|
+
content: external_exports.string()
|
|
29393
|
+
})
|
|
29394
|
+
)
|
|
29376
29395
|
});
|
|
29377
29396
|
var PATTERN_SUMMARY_SCHEMA = external_exports.object({
|
|
29378
29397
|
id: external_exports.string(),
|
|
@@ -29396,7 +29415,9 @@ function ensureRegistry() {
|
|
|
29396
29415
|
const registryPath = path.join(REGISTRY_DIR, "registry.json");
|
|
29397
29416
|
if (!fs.existsSync(registryPath)) {
|
|
29398
29417
|
if (!IS_SOURCE_CHECKOUT) {
|
|
29399
|
-
throw new Error(
|
|
29418
|
+
throw new Error(
|
|
29419
|
+
"The published @ds-mo/ui MCP registry snapshot is missing. Reinstall the package."
|
|
29420
|
+
);
|
|
29400
29421
|
}
|
|
29401
29422
|
try {
|
|
29402
29423
|
execSync("node scripts/build-registry.mjs", { cwd: SOURCE_ROOT, stdio: "pipe" });
|
|
@@ -29431,7 +29452,9 @@ function loadPatterns() {
|
|
|
29431
29452
|
return patternPaths().map((patternPath) => JSON.parse(fs.readFileSync(patternPath, "utf8")));
|
|
29432
29453
|
}
|
|
29433
29454
|
if (!fs.existsSync(PATTERN_MANIFEST)) {
|
|
29434
|
-
throw new Error(
|
|
29455
|
+
throw new Error(
|
|
29456
|
+
"The published @ds-mo/ui MCP pattern snapshot is missing. Reinstall the package."
|
|
29457
|
+
);
|
|
29435
29458
|
}
|
|
29436
29459
|
return JSON.parse(fs.readFileSync(PATTERN_MANIFEST, "utf8")).entries;
|
|
29437
29460
|
}
|
|
@@ -29590,7 +29613,9 @@ function createServer() {
|
|
|
29590
29613
|
}
|
|
29591
29614
|
if (items.length === 0) {
|
|
29592
29615
|
return {
|
|
29593
|
-
content: [
|
|
29616
|
+
content: [
|
|
29617
|
+
{ type: "text", text: `No components found${search ? ` matching "${search}"` : ""}.` }
|
|
29618
|
+
],
|
|
29594
29619
|
structuredContent: {
|
|
29595
29620
|
count: 0,
|
|
29596
29621
|
query: search ?? null,
|
|
@@ -29617,7 +29642,9 @@ ${formatComponentList(items)}`;
|
|
|
29617
29642
|
title: "Get Component",
|
|
29618
29643
|
description: "Get detailed information about a specific @ds-mo/ui component including props API, import statements, setup instructions, peer dependencies, and full source code for reference.",
|
|
29619
29644
|
inputSchema: external_exports.object({
|
|
29620
|
-
name: external_exports.string().describe(
|
|
29645
|
+
name: external_exports.string().describe(
|
|
29646
|
+
'Component name in kebab-case (e.g., "button", "tab-group", "toggle-button") or PascalCase (e.g., "Button", "TabGroup").'
|
|
29647
|
+
)
|
|
29621
29648
|
}),
|
|
29622
29649
|
outputSchema: COMPONENT_OUTPUT_SCHEMA,
|
|
29623
29650
|
annotations: READ_ONLY_TOOL_ANNOTATIONS
|
|
@@ -29719,16 +29746,23 @@ ${sections.join("\n\n")}` }],
|
|
|
29719
29746
|
let patterns = loadPatterns();
|
|
29720
29747
|
if (search) {
|
|
29721
29748
|
const query = search.toLowerCase();
|
|
29722
|
-
patterns = patterns.filter(
|
|
29723
|
-
pattern
|
|
29724
|
-
|
|
29725
|
-
|
|
29726
|
-
|
|
29727
|
-
|
|
29749
|
+
patterns = patterns.filter(
|
|
29750
|
+
(pattern) => [
|
|
29751
|
+
pattern.id,
|
|
29752
|
+
pattern.summary,
|
|
29753
|
+
...pattern.useWhen ?? [],
|
|
29754
|
+
...pattern.avoidWhen ?? []
|
|
29755
|
+
].some((value) => value.toLowerCase().includes(query))
|
|
29756
|
+
);
|
|
29728
29757
|
}
|
|
29729
29758
|
if (!patterns.length) {
|
|
29730
29759
|
return {
|
|
29731
|
-
content: [
|
|
29760
|
+
content: [
|
|
29761
|
+
{
|
|
29762
|
+
type: "text",
|
|
29763
|
+
text: `No composition patterns found${search ? ` matching "${search}"` : ""}.`
|
|
29764
|
+
}
|
|
29765
|
+
],
|
|
29732
29766
|
structuredContent: {
|
|
29733
29767
|
count: 0,
|
|
29734
29768
|
query: search ?? null,
|
|
@@ -29737,9 +29771,14 @@ ${sections.join("\n\n")}` }],
|
|
|
29737
29771
|
};
|
|
29738
29772
|
}
|
|
29739
29773
|
return {
|
|
29740
|
-
content: [
|
|
29774
|
+
content: [
|
|
29775
|
+
{
|
|
29776
|
+
type: "text",
|
|
29777
|
+
text: `# @ds-mo/ui \u2014 ${patterns.length} composition pattern${patterns.length === 1 ? "" : "s"}
|
|
29741
29778
|
|
|
29742
|
-
${formatPatternList(patterns)}`
|
|
29779
|
+
${formatPatternList(patterns)}`
|
|
29780
|
+
}
|
|
29781
|
+
],
|
|
29743
29782
|
structuredContent: {
|
|
29744
29783
|
count: patterns.length,
|
|
29745
29784
|
query: search ?? null,
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
},
|
|
157
157
|
{
|
|
158
158
|
"path": "src/wc/components/AgentActivity/AgentActivity.tsx",
|
|
159
|
-
"content": "import { Component, Prop, State, Watch, h, Host } from '@stencil/core';\nimport type { AgentActivityItem } from '../conversation-types';\n\n@Component({\n tag: 'ds-agent-activity',\n styleUrl: 'AgentActivity.css',\n scoped: true,\n})\nexport class AgentActivity {\n @Prop() items: AgentActivityItem[] = [];\n @Prop() heading: string = 'Activity';\n @Prop() open: boolean = false;\n\n @State() private expanded: boolean = false;\n\n componentWillLoad() {\n this.expanded = this.open;\n }\n\n @Watch('open')\n handleOpenChange(open: boolean) {\n this.expanded = open;\n }\n\n private get currentItem(): AgentActivityItem | undefined {\n return (\n this.items.find(item => item.state === 'active') ??\n this.items.find(item => item.state === 'error') ??\n [...this.items].reverse().find(item => item.state === 'complete') ??\n this.items.find(item => item.state === 'pending')\n );\n }\n\n private handleToggle = (event: Event) => {\n this.expanded = (event.currentTarget as HTMLDetailsElement).open;\n };\n\n private stateLabel(item: AgentActivityItem): string {\n if (item.state === 'active') return 'In progress';\n if (item.state === 'complete') return 'Complete';\n if (item.state === 'error') return 'Error';\n return 'Pending';\n }\n\n render() {\n return (\n <Host>\n <details class=\"agent-activity\" open={this.open} onToggle={this.handleToggle}>\n <summary>\n <ds-icon name=\"ChevronRight\" size=\"xs\" color=\"inherit\" />\n <ds-text\n class=\"agent-activity__summary-label\"\n variant=\"text-body-small\"\n shimmer={!this.expanded && this.currentItem?.state === 'active'}\n >\n {this.expanded ? this.heading : this.currentItem?.label ?? this.heading}\n </ds-text>\n </summary>\n <ol>\n {this.items.map(item => (\n <li class={`agent-activity__item agent-activity__item--${item.state}`}>\n <span class=\"agent-activity__marker\" aria-hidden=\"true\">\n {item.state === 'active' ? (\n <ds-loader size=\"xs\" color=\"inherit\" />\n ) : item.state === 'pending' ? (\n <span class=\"agent-activity__pending-dot\" />\n ) : (\n <ds-icon\n name={item.state === 'error' ? 'ErrorTriangle' : 'Check'}\n size=\"xs\"\n color=\"inherit\"\n />\n )}\n </span>\n <span>\n <ds-text variant=\"text-body-small\" shimmer={item.state === 'active'}>\n {item.label}\n </ds-text>\n {item.detail ? (\n <ds-text variant=\"text-caption\" color=\"secondary\">\n {item.detail}\n </ds-text>\n ) : null}\n <span class=\"agent-activity__state ds-visually-hidden\"
|
|
159
|
+
"content": "import { Component, Prop, State, Watch, h, Host } from '@stencil/core';\nimport type { AgentActivityItem } from '../conversation-types';\n\n@Component({\n tag: 'ds-agent-activity',\n styleUrl: 'AgentActivity.css',\n scoped: true,\n})\nexport class AgentActivity {\n @Prop() items: AgentActivityItem[] = [];\n @Prop() heading: string = 'Activity';\n @Prop() open: boolean = false;\n\n @State() private expanded: boolean = false;\n\n componentWillLoad() {\n this.expanded = this.open;\n }\n\n @Watch('open')\n handleOpenChange(open: boolean) {\n this.expanded = open;\n }\n\n private get currentItem(): AgentActivityItem | undefined {\n return (\n this.items.find(item => item.state === 'active') ??\n this.items.find(item => item.state === 'error') ??\n [...this.items].reverse().find(item => item.state === 'complete') ??\n this.items.find(item => item.state === 'pending')\n );\n }\n\n private handleToggle = (event: Event) => {\n this.expanded = (event.currentTarget as HTMLDetailsElement).open;\n };\n\n private stateLabel(item: AgentActivityItem): string {\n if (item.state === 'active') return 'In progress';\n if (item.state === 'complete') return 'Complete';\n if (item.state === 'error') return 'Error';\n return 'Pending';\n }\n\n render() {\n return (\n <Host>\n <details class=\"agent-activity\" open={this.open} onToggle={this.handleToggle}>\n <summary>\n <ds-icon name=\"ChevronRight\" size=\"xs\" color=\"inherit\" />\n <ds-text\n class=\"agent-activity__summary-label\"\n variant=\"text-body-small\"\n shimmer={!this.expanded && this.currentItem?.state === 'active'}\n >\n {this.expanded ? this.heading : (this.currentItem?.label ?? this.heading)}\n </ds-text>\n </summary>\n <ol>\n {this.items.map(item => (\n <li class={`agent-activity__item agent-activity__item--${item.state}`}>\n <span class=\"agent-activity__marker\" aria-hidden=\"true\">\n {item.state === 'active' ? (\n <ds-loader size=\"xs\" color=\"inherit\" />\n ) : item.state === 'pending' ? (\n <span class=\"agent-activity__pending-dot\" />\n ) : (\n <ds-icon\n name={item.state === 'error' ? 'ErrorTriangle' : 'Check'}\n size=\"xs\"\n color=\"inherit\"\n />\n )}\n </span>\n <span>\n <ds-text variant=\"text-body-small\" shimmer={item.state === 'active'}>\n {item.label}\n </ds-text>\n {item.detail ? (\n <ds-text variant=\"text-caption\" color=\"secondary\">\n {item.detail}\n </ds-text>\n ) : null}\n <span class=\"agent-activity__state ds-visually-hidden\">\n {this.stateLabel(item)}\n </span>\n </span>\n </li>\n ))}\n </ol>\n </details>\n </Host>\n );\n }\n}\n",
|
|
160
160
|
"type": "registry:ui"
|
|
161
161
|
}
|
|
162
162
|
]
|
|
@@ -261,17 +261,17 @@
|
|
|
261
261
|
"files": [
|
|
262
262
|
{
|
|
263
263
|
"path": "src/wc/components/AgentQuestionnaire/AgentQuestionnaire.css",
|
|
264
|
-
"content": "@import '../../utils/forced-colors.css';\n@import '../../utils/visually-hidden.css';\n\n:host {\n display: block;\n width: 100%;\n min-width: 0;\n box-sizing: border-box;\n -webkit-user-select: none;\n user-select: none;\n}\n\n.questionnaire {\n display: grid;\n gap: var(--dimension-space-150);\n width: 100%;\n padding: var(--dimension-space-200);\n border-radius: var(--dimension-radius-125);\n background: var(--color-background-primary);\n box-shadow: var(--effect-elevation-elevated-md);\n box-sizing: border-box;\n}\n\n.questionnaire--answered {\n gap: var(--dimension-space-100);\n padding: var(--dimension-space-150);\n background: var(--color-background-secondary);\n box-shadow: none;\n}\n\n.questionnaire--preparing {\n align-items: center;\n grid-template-columns: auto minmax(0, 1fr);\n}\n\n.questionnaire__header,\n.questionnaire__actions,\n.questionnaire__actions-leading,\n.questionnaire__error,\n.questionnaire__submission-error {\n display: flex;\n align-items: center;\n}\n\n.questionnaire__header,\n.questionnaire__actions {\n justify-content: space-between;\n gap: var(--dimension-space-100);\n}\n\n.questionnaire__body,\n.questionnaire__prompt,\n.questionnaire__choices,\n.questionnaire__single-choice,\n.questionnaire__multiple-choice,\n.questionnaire__other-choice,\n.questionnaire__summary,\n.questionnaire__summary li {\n display: grid;\n}\n\n.questionnaire__body,\n.questionnaire__prompt,\n.questionnaire__choices,\n.questionnaire__single-choice,\n.questionnaire__multiple-choice,\n.questionnaire__other-choice {\n gap: var(--dimension-space-100);\n}\n\n.questionnaire__choices {\n min-width: 0;\n margin: 0;\n padding: 0;\n border: 0;\n}\n\nds-radio,\nds-checkbox {\n width: 100%;\n min-width: 0;\n}\n\n.questionnaire__other-input,\n.questionnaire__text-input {\n width: 100%;\n padding: var(--dimension-space-100);\n border: var(--dimension-stroke-width-012) solid var(--color-border-secondary);\n border-radius: var(--dimension-radius-050);\n outline: none;\n background: var(--color-background-primary);\n color: var(--color-foreground-primary);\n font-family: var(--typography-font-family-ui);\n font-size: var(--typography-fontsize-md);\n font-weight: var(--typography-weight-regular);\n line-height: var(--typography-lineheight-md);\n letter-spacing: var(--typography-letterspacing-negative-half);\n box-sizing: border-box;\n -webkit-user-select: text;\n user-select: text;\n}\n\n.questionnaire__other-input {\n width: calc(100% - var(--dimension-size-500));\n margin-inline-start: var(--dimension-size-500);\n}\n\n.questionnaire__text-input {\n min-height: calc(var(--typography-lineheight-md) * 4 + var(--dimension-space-200));\n resize: vertical;\n}\n\n.questionnaire__other-input:focus,\n.questionnaire__text-input:focus {\n border-color: var(--color-border-bold-brand);\n box-shadow: inset 0 0 0 var(--dimension-stroke-width-018)
|
|
264
|
+
"content": "@import '../../utils/forced-colors.css';\n@import '../../utils/visually-hidden.css';\n\n:host {\n display: block;\n width: 100%;\n min-width: 0;\n box-sizing: border-box;\n -webkit-user-select: none;\n user-select: none;\n}\n\n.questionnaire {\n display: grid;\n gap: var(--dimension-space-150);\n width: 100%;\n padding: var(--dimension-space-200);\n border-radius: var(--dimension-radius-125);\n background: var(--color-background-primary);\n box-shadow: var(--effect-elevation-elevated-md);\n box-sizing: border-box;\n}\n\n.questionnaire--answered {\n gap: var(--dimension-space-100);\n padding: var(--dimension-space-150);\n background: var(--color-background-secondary);\n box-shadow: none;\n}\n\n.questionnaire--preparing {\n align-items: center;\n grid-template-columns: auto minmax(0, 1fr);\n}\n\n.questionnaire__header,\n.questionnaire__actions,\n.questionnaire__actions-leading,\n.questionnaire__error,\n.questionnaire__submission-error {\n display: flex;\n align-items: center;\n}\n\n.questionnaire__header,\n.questionnaire__actions {\n justify-content: space-between;\n gap: var(--dimension-space-100);\n}\n\n.questionnaire__body,\n.questionnaire__prompt,\n.questionnaire__choices,\n.questionnaire__single-choice,\n.questionnaire__multiple-choice,\n.questionnaire__other-choice,\n.questionnaire__summary,\n.questionnaire__summary li {\n display: grid;\n}\n\n.questionnaire__body,\n.questionnaire__prompt,\n.questionnaire__choices,\n.questionnaire__single-choice,\n.questionnaire__multiple-choice,\n.questionnaire__other-choice {\n gap: var(--dimension-space-100);\n}\n\n.questionnaire__choices {\n min-width: 0;\n margin: 0;\n padding: 0;\n border: 0;\n}\n\nds-radio,\nds-checkbox {\n width: 100%;\n min-width: 0;\n}\n\n.questionnaire__other-input,\n.questionnaire__text-input {\n width: 100%;\n padding: var(--dimension-space-100);\n border: var(--dimension-stroke-width-012) solid var(--color-border-secondary);\n border-radius: var(--dimension-radius-050);\n outline: none;\n background: var(--color-background-primary);\n color: var(--color-foreground-primary);\n font-family: var(--typography-font-family-ui);\n font-size: var(--typography-fontsize-md);\n font-weight: var(--typography-weight-regular);\n line-height: var(--typography-lineheight-md);\n letter-spacing: var(--typography-letterspacing-negative-half);\n box-sizing: border-box;\n -webkit-user-select: text;\n user-select: text;\n}\n\n.questionnaire__other-input {\n width: calc(100% - var(--dimension-size-500));\n margin-inline-start: var(--dimension-size-500);\n}\n\n.questionnaire__text-input {\n min-height: calc(var(--typography-lineheight-md) * 4 + var(--dimension-space-200));\n resize: vertical;\n}\n\n.questionnaire__other-input:focus,\n.questionnaire__text-input:focus {\n border-color: var(--color-border-bold-brand);\n box-shadow: inset 0 0 0 var(--dimension-stroke-width-018) var(--color-border-bold-brand);\n}\n\n.questionnaire__other-input[aria-invalid='true'],\n.questionnaire__text-input[aria-invalid='true'] {\n border-color: var(--color-border-bold-negative);\n}\n\n.questionnaire__error,\n.questionnaire__submission-error {\n gap: var(--dimension-space-050);\n color: var(--color-foreground-bold-negative);\n}\n\n.questionnaire__submission-error {\n padding: var(--dimension-space-075);\n border-radius: var(--dimension-radius-050);\n background: var(--color-background-faint-negative);\n}\n\n.questionnaire__actions-leading {\n flex-wrap: wrap;\n gap: var(--dimension-space-075);\n}\n\n.questionnaire__action-item {\n width: fit-content;\n max-width: 100%;\n}\n\n.questionnaire textarea:disabled {\n color: var(--color-foreground-tertiary);\n cursor: default;\n opacity: 1;\n}\n\n.questionnaire__summary {\n gap: var(--dimension-space-100);\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.questionnaire__summary li {\n gap: var(--dimension-space-025);\n}\n\n@media (max-width: 480px) {\n .questionnaire {\n padding: var(--dimension-space-150);\n }\n\n .questionnaire__actions {\n align-items: stretch;\n flex-direction: column;\n }\n\n .questionnaire__actions-leading {\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n width: 100%;\n }\n\n .questionnaire__action-item,\n .questionnaire__action-item--primary {\n width: 100%;\n }\n}\n\n@media (forced-colors: active) {\n .questionnaire {\n border: var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);\n box-shadow: none;\n }\n\n .questionnaire__other-input[aria-invalid='true'],\n .questionnaire__text-input[aria-invalid='true'] {\n outline: var(--dimension-stroke-width-025) dashed var(--ds-forced-color-content);\n }\n\n .questionnaire__submission-error {\n border: var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);\n background: var(--ds-forced-color-surface);\n }\n\n .questionnaire input:disabled,\n .questionnaire textarea:disabled {\n color: var(--ds-forced-color-disabled);\n }\n}\n",
|
|
265
265
|
"type": "registry:ui"
|
|
266
266
|
},
|
|
267
267
|
{
|
|
268
268
|
"path": "src/wc/components/AgentQuestionnaire/AgentQuestionnaire.tsx",
|
|
269
|
-
"content": "import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport type {\n AgentQuestion,\n AgentQuestionAnswer,\n AgentQuestionnaireAnswerEventDetail,\n AgentQuestionnaireCancelEventDetail,\n AgentQuestionnaireLabels,\n AgentQuestionnaireStatus,\n} from '../conversation-types';\nimport {\n createQuestionnaireDrafts,\n formatQuestionAnswer,\n normalizeQuestionAnswer,\n validateQuestionDraft,\n} from './agent-questionnaire-model';\nimport type {\n AgentQuestionDraft,\n AgentQuestionDrafts,\n} from './agent-questionnaire-model';\n\nconst DEFAULT_LABELS: AgentQuestionnaireLabels = {\n progress: 'Question {current} of {total}',\n previous: 'Previous',\n next: 'Next',\n answer: 'Answer',\n skip: 'Skip',\n cancel: 'Cancel',\n other: 'Other',\n otherPlaceholder: 'Enter another answer',\n preparing: 'Preparing questions…',\n};\n\nlet questionnaireId = 0;\n\n@Component({\n tag: 'ds-agent-questionnaire',\n styleUrl: 'AgentQuestionnaire.css',\n scoped: true,\n})\nexport class AgentQuestionnaire {\n @Element() el!: HTMLElement;\n\n @Prop() requestId!: string;\n @Prop() questions!: AgentQuestion[];\n @Prop() answers: AgentQuestionAnswer[] = [];\n @Prop() status: AgentQuestionnaireStatus = 'ready';\n @Prop() errorMessage?: string;\n @Prop() allowCancel: boolean = false;\n @Prop() labels?: Partial<AgentQuestionnaireLabels>;\n\n @Event() dsAnswer!: EventEmitter<AgentQuestionnaireAnswerEventDetail>;\n @Event() dsCancel!: EventEmitter<AgentQuestionnaireCancelEventDetail>;\n\n @State() private currentStep = 0;\n @State() private drafts: AgentQuestionDrafts = {};\n @State() private validation: Record<string, string> = {};\n\n private readonly instanceId = ++questionnaireId;\n private readonly otherValue = `__ds-agent-questionnaire-other-${this.instanceId}`;\n private answerPending = false;\n private resetScheduled = false;\n private draftRequestId?: string;\n private answersSnapshot: AgentQuestionAnswer[] = [];\n private waitingForRequestAnswers = false;\n\n componentWillLoad() {\n this.draftRequestId = this.requestId;\n this.answersSnapshot = this.answers;\n this.resetDraft();\n }\n\n @Watch('requestId')\n @Watch('questions')\n @Watch('answers')\n handleQuestionnaireInputChange() {\n this.scheduleDraftReset();\n }\n\n @Watch('status')\n handleStatusChange(status: AgentQuestionnaireStatus) {\n if (status !== 'submitting') this.answerPending = false;\n }\n\n @Method()\n async setFocus(): Promise<void> {\n this.focusCurrentControl();\n }\n\n private get copy(): AgentQuestionnaireLabels {\n return { ...DEFAULT_LABELS, ...this.labels };\n }\n\n private get disabled(): boolean {\n return this.status === 'submitting';\n }\n\n private resetDraft(answers = this.answers) {\n this.currentStep = 0;\n this.drafts = createQuestionnaireDrafts(this.questions ?? [], answers ?? []);\n this.validation = {};\n this.answerPending = false;\n }\n\n private scheduleDraftReset() {\n if (this.resetScheduled) return;\n this.resetScheduled = true;\n queueMicrotask(() => {\n this.resetScheduled = false;\n const requestChanged = this.requestId !== this.draftRequestId;\n const answersChanged = this.answers !== this.answersSnapshot;\n if (requestChanged && !answersChanged) {\n this.waitingForRequestAnswers = true;\n } else if (answersChanged) {\n this.waitingForRequestAnswers = false;\n }\n this.resetDraft(this.waitingForRequestAnswers ? [] : this.answers);\n this.draftRequestId = this.requestId;\n this.answersSnapshot = this.answers;\n });\n }\n\n private focusCurrentControl(preferInvalid = false) {\n const focus = () => {\n const invalidControl = preferInvalid\n ? this.el.querySelector<HTMLElement>(\n '[data-question-control][aria-invalid=\"true\"]:not([disabled])',\n )\n : null;\n const control = invalidControl ??\n this.el.querySelector<HTMLElement>(\n '[data-question-control]:not([disabled]):not([is-inactive])',\n );\n const action = this.el.querySelector<HTMLElement>(\n '[data-question-action]:not([is-inactive]):not([is-loading])',\n );\n const target = (control ?? action) as\n | (HTMLElement & { setFocus?: () => Promise<void> })\n | null;\n if (target?.setFocus) void target.setFocus();\n else target?.focus();\n };\n focus();\n requestAnimationFrame(focus);\n setTimeout(focus, 0);\n }\n\n private updateDraft(questionId: string, update: Partial<AgentQuestionDraft>) {\n const previous = this.drafts[questionId] ?? {\n value: '',\n otherSelected: false,\n otherText: '',\n skipped: false,\n };\n this.drafts = {\n ...this.drafts,\n [questionId]: { ...previous, ...update, skipped: false },\n };\n if (this.validation[questionId]) {\n const { [questionId]: _removed, ...rest } = this.validation;\n this.validation = rest;\n }\n }\n\n private validate(question: AgentQuestion): boolean {\n const message = validateQuestionDraft(question, this.drafts[question.id]);\n if (!message) return true;\n this.validation = { ...this.validation, [question.id]: message };\n this.focusCurrentControl(true);\n return false;\n }\n\n private move(step: number) {\n this.currentStep = Math.min(Math.max(step, 0), this.questions.length - 1);\n this.focusCurrentControl();\n }\n\n private next(question: AgentQuestion) {\n if (!this.validate(question)) return;\n this.move(this.currentStep + 1);\n }\n\n private skip(question: AgentQuestion) {\n if (question.required) return;\n this.drafts = {\n ...this.drafts,\n [question.id]: {\n ...(this.drafts[question.id] ?? {\n value: '',\n otherSelected: false,\n otherText: '',\n }),\n skipped: true,\n },\n };\n if (this.currentStep < this.questions.length - 1) this.move(this.currentStep + 1);\n else this.submit();\n }\n\n private submit() {\n if (this.disabled || this.answerPending) return;\n const invalidIndex = this.questions.findIndex(\n question => !this.validateWithoutFocus(question),\n );\n if (invalidIndex >= 0) {\n this.currentStep = invalidIndex;\n this.focusCurrentControl(true);\n return;\n }\n\n this.answerPending = true;\n this.dsAnswer.emit({\n requestId: this.requestId,\n answers: this.questions.map(question =>\n normalizeQuestionAnswer(question, this.drafts[question.id]),\n ),\n });\n }\n\n private validateWithoutFocus(question: AgentQuestion): boolean {\n const message = validateQuestionDraft(question, this.drafts[question.id]);\n if (!message) return true;\n this.validation = { ...this.validation, [question.id]: message };\n return false;\n }\n\n private progressLabel(): string {\n return this.copy.progress\n .split('{current}')\n .join(String(this.currentStep + 1))\n .split('{total}')\n .join(String(this.questions.length));\n }\n\n private selectSingle(question: AgentQuestion, value: string) {\n const otherSelected = value === this.otherValue;\n this.updateDraft(question.id, {\n value: otherSelected ? '' : value,\n otherSelected,\n });\n if (otherSelected) {\n requestAnimationFrame(() =>\n this.el.querySelector<HTMLInputElement>('[data-question-other-input]')?.focus(),\n );\n }\n }\n\n private renderSingleChoice(\n question: AgentQuestion,\n promptId: string,\n errorId: string,\n ) {\n const draft = this.drafts[question.id];\n const value = draft.otherSelected\n ? this.otherValue\n : typeof draft.value === 'string'\n ? draft.value\n : '';\n const options = [\n ...(question.choices ?? []),\n ...(question.allowOther\n ? [{ value: this.otherValue, label: this.copy.other }]\n : []),\n ];\n return (\n <div class=\"questionnaire__single-choice\">\n <ds-radio\n data-question-control\n size=\"lg\"\n options={options}\n value={value}\n disabled={this.disabled}\n form={`ds-agent-questionnaire-detached-${this.instanceId}`}\n ariaLabelledby={promptId}\n aria-describedby={this.validation[question.id] ? errorId : undefined}\n onDsChange={(event: CustomEvent<string>) =>\n this.selectSingle(question, event.detail)\n }\n />\n {draft.otherSelected ? this.renderOtherInput(question, errorId) : null}\n </div>\n );\n }\n\n private renderMultipleChoice(question: AgentQuestion, errorId: string) {\n const draft = this.drafts[question.id];\n const values = Array.isArray(draft.value) ? draft.value : [];\n const detachedForm = `ds-agent-questionnaire-detached-${this.instanceId}`;\n return (\n <div class=\"questionnaire__multiple-choice\">\n {question.choices?.map(choice => (\n <ds-checkbox\n key={choice.value}\n data-question-control\n size=\"lg\"\n label={choice.label}\n description={choice.description}\n value={choice.value}\n checked={values.includes(choice.value)}\n disabled={this.disabled}\n form={detachedForm}\n onDsChange={(event: CustomEvent<boolean>) => {\n this.updateDraft(question.id, {\n value: event.detail\n ? [...values, choice.value]\n : values.filter(value => value !== choice.value),\n });\n }}\n />\n ))}\n {question.allowOther ? (\n <div class=\"questionnaire__other-choice\">\n <ds-checkbox\n data-question-control\n size=\"lg\"\n label={this.copy.other}\n checked={draft.otherSelected}\n disabled={this.disabled}\n form={detachedForm}\n onDsChange={(event: CustomEvent<boolean>) => {\n this.updateDraft(question.id, { otherSelected: event.detail });\n if (event.detail) {\n requestAnimationFrame(() =>\n this.el\n .querySelector<HTMLInputElement>('[data-question-other-input]')\n ?.focus(),\n );\n }\n }}\n />\n {draft.otherSelected ? this.renderOtherInput(question, errorId) : null}\n </div>\n ) : null}\n </div>\n );\n }\n\n private renderOtherInput(question: AgentQuestion, errorId: string) {\n const draft = this.drafts[question.id];\n return (\n <input\n class=\"questionnaire__other-input\"\n data-question-control\n data-question-other-input\n type=\"text\"\n form={`ds-agent-questionnaire-detached-${this.instanceId}`}\n value={draft.otherText}\n placeholder={this.copy.otherPlaceholder}\n aria-label={this.copy.other}\n aria-invalid={this.validation[question.id] ? 'true' : undefined}\n aria-describedby={this.validation[question.id] ? errorId : undefined}\n disabled={this.disabled}\n onInput={(event: Event) =>\n this.updateDraft(question.id, {\n otherText: (event.target as HTMLInputElement).value,\n })\n }\n />\n );\n }\n\n private renderQuestion(question: AgentQuestion) {\n const draft = this.drafts[question.id];\n const errorId = `ds-agent-questionnaire-${this.instanceId}-${this.currentStep}-error`;\n const promptId = `ds-agent-questionnaire-${this.instanceId}-${this.currentStep}-prompt`;\n return (\n <div class=\"questionnaire__body\">\n <div class=\"questionnaire__prompt\">\n <ds-text as=\"h2\" variant=\"text-title-small\" textId={promptId}>\n {question.question}\n </ds-text>\n {question.description ? (\n <ds-text variant=\"text-body-small\" color=\"secondary\">\n {question.description}\n </ds-text>\n ) : null}\n </div>\n {question.type === 'text' ? (\n <textarea\n class=\"questionnaire__text-input\"\n data-question-control\n value={typeof draft.value === 'string' ? draft.value : ''}\n form={`ds-agent-questionnaire-detached-${this.instanceId}`}\n placeholder={question.placeholder}\n aria-label={question.question}\n aria-invalid={this.validation[question.id] ? 'true' : undefined}\n aria-describedby={this.validation[question.id] ? errorId : undefined}\n disabled={this.disabled}\n rows={4}\n onInput={(event: Event) =>\n this.updateDraft(question.id, {\n value: (event.target as HTMLTextAreaElement).value,\n })\n }\n />\n ) : (\n <fieldset\n class=\"questionnaire__choices\"\n aria-describedby={this.validation[question.id] ? errorId : undefined}\n >\n <legend class=\"ds-visually-hidden\">{question.question}</legend>\n {question.type === 'single'\n ? this.renderSingleChoice(question, promptId, errorId)\n : this.renderMultipleChoice(question, errorId)}\n </fieldset>\n )}\n {this.validation[question.id] ? (\n <div id={errorId} class=\"questionnaire__error\" role=\"alert\">\n <ds-icon name=\"ErrorTriangle\" size=\"xs\" color=\"inherit\" />\n <ds-text variant=\"text-body-small\" color=\"negative\">\n {this.validation[question.id]}\n </ds-text>\n </div>\n ) : null}\n </div>\n );\n }\n\n private renderAnswered() {\n return (\n <div class=\"questionnaire questionnaire--answered\">\n <ol class=\"questionnaire__summary\">\n {this.questions.map(question => (\n <li>\n <ds-text variant=\"text-body-small\" emphasis>{question.question}</ds-text>\n <ds-text variant=\"text-body-small\" color=\"secondary\">\n {formatQuestionAnswer(\n question,\n this.answers.find(answer => answer.questionId === question.id),\n )}\n </ds-text>\n </li>\n ))}\n </ol>\n </div>\n );\n }\n\n render() {\n if (this.status === 'preparing') {\n return (\n <Host>\n <div class=\"questionnaire questionnaire--preparing\" role=\"status\">\n <ds-loader size=\"sm\" />\n <ds-text variant=\"text-body-medium\">{this.copy.preparing}</ds-text>\n </div>\n </Host>\n );\n }\n if (!this.questions?.length) return null;\n if (this.status === 'answered') return <Host>{this.renderAnswered()}</Host>;\n\n const question = this.questions[this.currentStep];\n const last = this.currentStep === this.questions.length - 1;\n const canSkip = Boolean(question.skippable && !question.required);\n return (\n <Host>\n <section\n class={{\n questionnaire: true,\n 'questionnaire--submitting': this.disabled,\n 'questionnaire--error': this.status === 'error',\n }}\n aria-busy={this.disabled ? 'true' : undefined}\n aria-label={question.question}\n >\n <header class=\"questionnaire__header\">\n <ds-text variant=\"text-caption\" color=\"secondary\">{this.progressLabel()}</ds-text>\n {this.allowCancel ? (\n <ds-tooltip label={this.copy.cancel} side=\"top\" size=\"sm\">\n <ds-button-unfilled\n data-question-action\n variant=\"icon\"\n icon=\"Cross\"\n size=\"sm\"\n aria-label={this.copy.cancel}\n hasBorder={false}\n isInactive={this.disabled}\n onDsClick={() => this.dsCancel.emit({ requestId: this.requestId })}\n />\n </ds-tooltip>\n ) : null}\n </header>\n {this.renderQuestion(question)}\n {this.status === 'error' && this.errorMessage ? (\n <div class=\"questionnaire__submission-error\" role=\"alert\">\n <ds-icon name=\"ErrorTriangle\" size=\"xs\" color=\"inherit\" />\n <ds-text variant=\"text-body-small\" color=\"negative\">{this.errorMessage}</ds-text>\n </div>\n ) : null}\n <footer class=\"questionnaire__actions\">\n <div class=\"questionnaire__actions-leading\">\n {this.currentStep > 0 ? (\n <div class=\"questionnaire__action-item\">\n <ds-button-unfilled\n data-question-action\n label={this.copy.previous}\n size=\"sm\"\n width=\"fill\"\n isInactive={this.disabled}\n onDsClick={() => this.move(this.currentStep - 1)}\n />\n </div>\n ) : null}\n {canSkip ? (\n <div class=\"questionnaire__action-item\">\n <ds-button-unfilled\n data-question-action\n label={this.copy.skip}\n size=\"sm\"\n width=\"fill\"\n hasBorder={false}\n isInactive={this.disabled}\n onDsClick={() => this.skip(question)}\n />\n </div>\n ) : null}\n </div>\n <div class=\"questionnaire__action-item questionnaire__action-item--primary\">\n <ds-button-filled\n data-question-action\n label={last ? this.copy.answer : this.copy.next}\n size=\"sm\"\n width=\"fill\"\n isLoading={this.disabled}\n onDsClick={() => (last ? this.submit() : this.next(question))}\n />\n </div>\n </footer>\n </section>\n </Host>\n );\n }\n}\n",
|
|
269
|
+
"content": "import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport type {\n AgentQuestion,\n AgentQuestionAnswer,\n AgentQuestionnaireAnswerEventDetail,\n AgentQuestionnaireCancelEventDetail,\n AgentQuestionnaireLabels,\n AgentQuestionnaireStatus,\n} from '../conversation-types';\nimport {\n createQuestionnaireDrafts,\n formatQuestionAnswer,\n normalizeQuestionAnswer,\n validateQuestionDraft,\n} from './agent-questionnaire-model';\nimport type { AgentQuestionDraft, AgentQuestionDrafts } from './agent-questionnaire-model';\n\nconst DEFAULT_LABELS: AgentQuestionnaireLabels = {\n progress: 'Question {current} of {total}',\n previous: 'Previous',\n next: 'Next',\n answer: 'Answer',\n skip: 'Skip',\n cancel: 'Cancel',\n other: 'Other',\n otherPlaceholder: 'Enter another answer',\n preparing: 'Preparing questions…',\n};\n\nlet questionnaireId = 0;\n\n@Component({\n tag: 'ds-agent-questionnaire',\n styleUrl: 'AgentQuestionnaire.css',\n scoped: true,\n})\nexport class AgentQuestionnaire {\n @Element() el!: HTMLElement;\n\n @Prop() requestId!: string;\n @Prop() questions!: AgentQuestion[];\n @Prop() answers: AgentQuestionAnswer[] = [];\n @Prop() status: AgentQuestionnaireStatus = 'ready';\n @Prop() errorMessage?: string;\n @Prop() allowCancel: boolean = false;\n @Prop() labels?: Partial<AgentQuestionnaireLabels>;\n\n @Event() dsAnswer!: EventEmitter<AgentQuestionnaireAnswerEventDetail>;\n @Event() dsCancel!: EventEmitter<AgentQuestionnaireCancelEventDetail>;\n\n @State() private currentStep = 0;\n @State() private drafts: AgentQuestionDrafts = {};\n @State() private validation: Record<string, string> = {};\n\n private readonly instanceId = ++questionnaireId;\n private readonly otherValue = `__ds-agent-questionnaire-other-${this.instanceId}`;\n private answerPending = false;\n private resetScheduled = false;\n private draftRequestId?: string;\n private answersSnapshot: AgentQuestionAnswer[] = [];\n private waitingForRequestAnswers = false;\n\n componentWillLoad() {\n this.draftRequestId = this.requestId;\n this.answersSnapshot = this.answers;\n this.resetDraft();\n }\n\n @Watch('requestId')\n @Watch('questions')\n @Watch('answers')\n handleQuestionnaireInputChange() {\n this.scheduleDraftReset();\n }\n\n @Watch('status')\n handleStatusChange(status: AgentQuestionnaireStatus) {\n if (status !== 'submitting') this.answerPending = false;\n }\n\n @Method()\n async setFocus(): Promise<void> {\n this.focusCurrentControl();\n }\n\n private get copy(): AgentQuestionnaireLabels {\n return { ...DEFAULT_LABELS, ...this.labels };\n }\n\n private get disabled(): boolean {\n return this.status === 'submitting';\n }\n\n private resetDraft(answers = this.answers) {\n this.currentStep = 0;\n this.drafts = createQuestionnaireDrafts(this.questions ?? [], answers ?? []);\n this.validation = {};\n this.answerPending = false;\n }\n\n private scheduleDraftReset() {\n if (this.resetScheduled) return;\n this.resetScheduled = true;\n queueMicrotask(() => {\n this.resetScheduled = false;\n const requestChanged = this.requestId !== this.draftRequestId;\n const answersChanged = this.answers !== this.answersSnapshot;\n if (requestChanged && !answersChanged) {\n this.waitingForRequestAnswers = true;\n } else if (answersChanged) {\n this.waitingForRequestAnswers = false;\n }\n this.resetDraft(this.waitingForRequestAnswers ? [] : this.answers);\n this.draftRequestId = this.requestId;\n this.answersSnapshot = this.answers;\n });\n }\n\n private focusCurrentControl(preferInvalid = false) {\n const focus = () => {\n const invalidControl = preferInvalid\n ? this.el.querySelector<HTMLElement>(\n '[data-question-control][aria-invalid=\"true\"]:not([disabled])'\n )\n : null;\n const control =\n invalidControl ??\n this.el.querySelector<HTMLElement>(\n '[data-question-control]:not([disabled]):not([is-inactive])'\n );\n const action = this.el.querySelector<HTMLElement>(\n '[data-question-action]:not([is-inactive]):not([is-loading])'\n );\n const target = (control ?? action) as\n | (HTMLElement & { setFocus?: () => Promise<void> })\n | null;\n if (target?.setFocus) void target.setFocus();\n else target?.focus();\n };\n focus();\n requestAnimationFrame(focus);\n setTimeout(focus, 0);\n }\n\n private updateDraft(questionId: string, update: Partial<AgentQuestionDraft>) {\n const previous = this.drafts[questionId] ?? {\n value: '',\n otherSelected: false,\n otherText: '',\n skipped: false,\n };\n this.drafts = {\n ...this.drafts,\n [questionId]: { ...previous, ...update, skipped: false },\n };\n if (this.validation[questionId]) {\n const { [questionId]: _removed, ...rest } = this.validation;\n this.validation = rest;\n }\n }\n\n private validate(question: AgentQuestion): boolean {\n const message = validateQuestionDraft(question, this.drafts[question.id]);\n if (!message) return true;\n this.validation = { ...this.validation, [question.id]: message };\n this.focusCurrentControl(true);\n return false;\n }\n\n private move(step: number) {\n this.currentStep = Math.min(Math.max(step, 0), this.questions.length - 1);\n this.focusCurrentControl();\n }\n\n private next(question: AgentQuestion) {\n if (!this.validate(question)) return;\n this.move(this.currentStep + 1);\n }\n\n private skip(question: AgentQuestion) {\n if (question.required) return;\n this.drafts = {\n ...this.drafts,\n [question.id]: {\n ...(this.drafts[question.id] ?? {\n value: '',\n otherSelected: false,\n otherText: '',\n }),\n skipped: true,\n },\n };\n if (this.currentStep < this.questions.length - 1) this.move(this.currentStep + 1);\n else this.submit();\n }\n\n private submit() {\n if (this.disabled || this.answerPending) return;\n const invalidIndex = this.questions.findIndex(question => !this.validateWithoutFocus(question));\n if (invalidIndex >= 0) {\n this.currentStep = invalidIndex;\n this.focusCurrentControl(true);\n return;\n }\n\n this.answerPending = true;\n this.dsAnswer.emit({\n requestId: this.requestId,\n answers: this.questions.map(question =>\n normalizeQuestionAnswer(question, this.drafts[question.id])\n ),\n });\n }\n\n private validateWithoutFocus(question: AgentQuestion): boolean {\n const message = validateQuestionDraft(question, this.drafts[question.id]);\n if (!message) return true;\n this.validation = { ...this.validation, [question.id]: message };\n return false;\n }\n\n private progressLabel(): string {\n return this.copy.progress\n .split('{current}')\n .join(String(this.currentStep + 1))\n .split('{total}')\n .join(String(this.questions.length));\n }\n\n private selectSingle(question: AgentQuestion, value: string) {\n const otherSelected = value === this.otherValue;\n this.updateDraft(question.id, {\n value: otherSelected ? '' : value,\n otherSelected,\n });\n if (otherSelected) {\n requestAnimationFrame(() =>\n this.el.querySelector<HTMLInputElement>('[data-question-other-input]')?.focus()\n );\n }\n }\n\n private renderSingleChoice(question: AgentQuestion, promptId: string, errorId: string) {\n const draft = this.drafts[question.id];\n const value = draft.otherSelected\n ? this.otherValue\n : typeof draft.value === 'string'\n ? draft.value\n : '';\n const options = [\n ...(question.choices ?? []),\n ...(question.allowOther ? [{ value: this.otherValue, label: this.copy.other }] : []),\n ];\n return (\n <div class=\"questionnaire__single-choice\">\n <ds-radio\n data-question-control\n size=\"lg\"\n options={options}\n value={value}\n disabled={this.disabled}\n form={`ds-agent-questionnaire-detached-${this.instanceId}`}\n ariaLabelledby={promptId}\n aria-describedby={this.validation[question.id] ? errorId : undefined}\n onDsChange={(event: CustomEvent<string>) => this.selectSingle(question, event.detail)}\n />\n {draft.otherSelected ? this.renderOtherInput(question, errorId) : null}\n </div>\n );\n }\n\n private renderMultipleChoice(question: AgentQuestion, errorId: string) {\n const draft = this.drafts[question.id];\n const values = Array.isArray(draft.value) ? draft.value : [];\n const detachedForm = `ds-agent-questionnaire-detached-${this.instanceId}`;\n return (\n <div class=\"questionnaire__multiple-choice\">\n {question.choices?.map(choice => (\n <ds-checkbox\n key={choice.value}\n data-question-control\n size=\"lg\"\n label={choice.label}\n description={choice.description}\n value={choice.value}\n checked={values.includes(choice.value)}\n disabled={this.disabled}\n form={detachedForm}\n onDsChange={(event: CustomEvent<boolean>) => {\n this.updateDraft(question.id, {\n value: event.detail\n ? [...values, choice.value]\n : values.filter(value => value !== choice.value),\n });\n }}\n />\n ))}\n {question.allowOther ? (\n <div class=\"questionnaire__other-choice\">\n <ds-checkbox\n data-question-control\n size=\"lg\"\n label={this.copy.other}\n checked={draft.otherSelected}\n disabled={this.disabled}\n form={detachedForm}\n onDsChange={(event: CustomEvent<boolean>) => {\n this.updateDraft(question.id, { otherSelected: event.detail });\n if (event.detail) {\n requestAnimationFrame(() =>\n this.el.querySelector<HTMLInputElement>('[data-question-other-input]')?.focus()\n );\n }\n }}\n />\n {draft.otherSelected ? this.renderOtherInput(question, errorId) : null}\n </div>\n ) : null}\n </div>\n );\n }\n\n private renderOtherInput(question: AgentQuestion, errorId: string) {\n const draft = this.drafts[question.id];\n return (\n <input\n class=\"questionnaire__other-input\"\n data-question-control\n data-question-other-input\n type=\"text\"\n form={`ds-agent-questionnaire-detached-${this.instanceId}`}\n value={draft.otherText}\n placeholder={this.copy.otherPlaceholder}\n aria-label={this.copy.other}\n aria-invalid={this.validation[question.id] ? 'true' : undefined}\n aria-describedby={this.validation[question.id] ? errorId : undefined}\n disabled={this.disabled}\n onInput={(event: Event) =>\n this.updateDraft(question.id, {\n otherText: (event.target as HTMLInputElement).value,\n })\n }\n />\n );\n }\n\n private renderQuestion(question: AgentQuestion) {\n const draft = this.drafts[question.id];\n const errorId = `ds-agent-questionnaire-${this.instanceId}-${this.currentStep}-error`;\n const promptId = `ds-agent-questionnaire-${this.instanceId}-${this.currentStep}-prompt`;\n return (\n <div class=\"questionnaire__body\">\n <div class=\"questionnaire__prompt\">\n <ds-text as=\"h2\" variant=\"text-title-small\" textId={promptId}>\n {question.question}\n </ds-text>\n {question.description ? (\n <ds-text variant=\"text-body-small\" color=\"secondary\">\n {question.description}\n </ds-text>\n ) : null}\n </div>\n {question.type === 'text' ? (\n <textarea\n class=\"questionnaire__text-input\"\n data-question-control\n value={typeof draft.value === 'string' ? draft.value : ''}\n form={`ds-agent-questionnaire-detached-${this.instanceId}`}\n placeholder={question.placeholder}\n aria-label={question.question}\n aria-invalid={this.validation[question.id] ? 'true' : undefined}\n aria-describedby={this.validation[question.id] ? errorId : undefined}\n disabled={this.disabled}\n rows={4}\n onInput={(event: Event) =>\n this.updateDraft(question.id, {\n value: (event.target as HTMLTextAreaElement).value,\n })\n }\n />\n ) : (\n <fieldset\n class=\"questionnaire__choices\"\n aria-describedby={this.validation[question.id] ? errorId : undefined}\n >\n <legend class=\"ds-visually-hidden\">{question.question}</legend>\n {question.type === 'single'\n ? this.renderSingleChoice(question, promptId, errorId)\n : this.renderMultipleChoice(question, errorId)}\n </fieldset>\n )}\n {this.validation[question.id] ? (\n <div id={errorId} class=\"questionnaire__error\" role=\"alert\">\n <ds-icon name=\"ErrorTriangle\" size=\"xs\" color=\"inherit\" />\n <ds-text variant=\"text-body-small\" color=\"negative\">\n {this.validation[question.id]}\n </ds-text>\n </div>\n ) : null}\n </div>\n );\n }\n\n private renderAnswered() {\n return (\n <div class=\"questionnaire questionnaire--answered\">\n <ol class=\"questionnaire__summary\">\n {this.questions.map(question => (\n <li>\n <ds-text variant=\"text-body-small\" emphasis>\n {question.question}\n </ds-text>\n <ds-text variant=\"text-body-small\" color=\"secondary\">\n {formatQuestionAnswer(\n question,\n this.answers.find(answer => answer.questionId === question.id)\n )}\n </ds-text>\n </li>\n ))}\n </ol>\n </div>\n );\n }\n\n render() {\n if (this.status === 'preparing') {\n return (\n <Host>\n <div class=\"questionnaire questionnaire--preparing\" role=\"status\">\n <ds-loader size=\"sm\" />\n <ds-text variant=\"text-body-medium\">{this.copy.preparing}</ds-text>\n </div>\n </Host>\n );\n }\n if (!this.questions?.length) return null;\n if (this.status === 'answered') return <Host>{this.renderAnswered()}</Host>;\n\n const question = this.questions[this.currentStep];\n const last = this.currentStep === this.questions.length - 1;\n const canSkip = Boolean(question.skippable && !question.required);\n return (\n <Host>\n <section\n class={{\n questionnaire: true,\n 'questionnaire--submitting': this.disabled,\n 'questionnaire--error': this.status === 'error',\n }}\n aria-busy={this.disabled ? 'true' : undefined}\n aria-label={question.question}\n >\n <header class=\"questionnaire__header\">\n <ds-text variant=\"text-caption\" color=\"secondary\">\n {this.progressLabel()}\n </ds-text>\n {this.allowCancel ? (\n <ds-tooltip label={this.copy.cancel} side=\"top\" size=\"sm\">\n <ds-button-unfilled\n data-question-action\n variant=\"icon\"\n icon=\"Cross\"\n size=\"sm\"\n aria-label={this.copy.cancel}\n hasBorder={false}\n isInactive={this.disabled}\n onDsClick={() => this.dsCancel.emit({ requestId: this.requestId })}\n />\n </ds-tooltip>\n ) : null}\n </header>\n {this.renderQuestion(question)}\n {this.status === 'error' && this.errorMessage ? (\n <div class=\"questionnaire__submission-error\" role=\"alert\">\n <ds-icon name=\"ErrorTriangle\" size=\"xs\" color=\"inherit\" />\n <ds-text variant=\"text-body-small\" color=\"negative\">\n {this.errorMessage}\n </ds-text>\n </div>\n ) : null}\n <footer class=\"questionnaire__actions\">\n <div class=\"questionnaire__actions-leading\">\n {this.currentStep > 0 ? (\n <div class=\"questionnaire__action-item\">\n <ds-button-unfilled\n data-question-action\n label={this.copy.previous}\n size=\"sm\"\n width=\"fill\"\n isInactive={this.disabled}\n onDsClick={() => this.move(this.currentStep - 1)}\n />\n </div>\n ) : null}\n {canSkip ? (\n <div class=\"questionnaire__action-item\">\n <ds-button-unfilled\n data-question-action\n label={this.copy.skip}\n size=\"sm\"\n width=\"fill\"\n hasBorder={false}\n isInactive={this.disabled}\n onDsClick={() => this.skip(question)}\n />\n </div>\n ) : null}\n </div>\n <div class=\"questionnaire__action-item questionnaire__action-item--primary\">\n <ds-button-filled\n data-question-action\n label={last ? this.copy.answer : this.copy.next}\n size=\"sm\"\n width=\"fill\"\n isLoading={this.disabled}\n onDsClick={() => (last ? this.submit() : this.next(question))}\n />\n </div>\n </footer>\n </section>\n </Host>\n );\n }\n}\n",
|
|
270
270
|
"type": "registry:ui"
|
|
271
271
|
},
|
|
272
272
|
{
|
|
273
273
|
"path": "src/wc/components/AgentQuestionnaire/agent-questionnaire-model.ts",
|
|
274
|
-
"content": "import type {
|
|
274
|
+
"content": "import type { AgentQuestion, AgentQuestionAnswer } from '../conversation-types';\n\nexport interface AgentQuestionDraft {\n value: string | string[];\n otherSelected: boolean;\n otherText: string;\n skipped: boolean;\n}\n\nexport type AgentQuestionDrafts = Record<string, AgentQuestionDraft>;\n\nfunction answerFor(\n answers: AgentQuestionAnswer[],\n questionId: string\n): AgentQuestionAnswer | undefined {\n return answers.find(answer => answer.questionId === questionId);\n}\n\nexport function createQuestionnaireDrafts(\n questions: AgentQuestion[],\n answers: AgentQuestionAnswer[]\n): AgentQuestionDrafts {\n return Object.fromEntries(\n questions.map(question => {\n const answer = answerFor(answers, question.id);\n const choiceValues = new Set(question.choices?.map(choice => choice.value) ?? []);\n\n if (question.type === 'multiple') {\n const values = Array.isArray(answer?.value) ? answer.value : [];\n const known = values.filter(value => choiceValues.has(value));\n const other = values.find(value => !choiceValues.has(value)) ?? '';\n return [\n question.id,\n {\n value: known,\n otherSelected: Boolean(question.allowOther && other),\n otherText: question.allowOther ? other : '',\n skipped: answer?.value === null,\n },\n ];\n }\n\n const value = typeof answer?.value === 'string' ? answer.value : '';\n const isKnownChoice = question.type === 'single' && choiceValues.has(value);\n return [\n question.id,\n {\n value: question.type === 'single' && !isKnownChoice ? '' : value,\n otherSelected: Boolean(\n question.type === 'single' && question.allowOther && value && !isKnownChoice\n ),\n otherText:\n question.type === 'single' && question.allowOther && value && !isKnownChoice\n ? value\n : '',\n skipped: answer?.value === null,\n },\n ];\n })\n );\n}\n\nexport function normalizeQuestionAnswer(\n question: AgentQuestion,\n draft: AgentQuestionDraft\n): AgentQuestionAnswer {\n if (draft.skipped) return { questionId: question.id, value: null };\n\n if (question.type === 'multiple') {\n const values = Array.isArray(draft.value) ? [...draft.value] : [];\n if (draft.otherSelected && draft.otherText.trim()) values.push(draft.otherText.trim());\n return {\n questionId: question.id,\n value: values.length || question.required ? values : null,\n };\n }\n\n if (draft.otherSelected) {\n const other = draft.otherText.trim();\n return { questionId: question.id, value: other || null };\n }\n\n const value = typeof draft.value === 'string' ? draft.value.trim() : '';\n return { questionId: question.id, value: value || null };\n}\n\nexport function validateQuestionDraft(\n question: AgentQuestion,\n draft: AgentQuestionDraft\n): string | undefined {\n if ((question.type === 'single' || question.type === 'multiple') && !question.choices?.length) {\n return 'This question has no available choices.';\n }\n\n if (draft.otherSelected && !draft.otherText.trim()) {\n return 'Enter a response for Other.';\n }\n\n if (!question.required || draft.skipped) return undefined;\n const answer = normalizeQuestionAnswer(question, draft).value;\n const missing = answer === null || (Array.isArray(answer) && answer.length === 0);\n if (!missing) return undefined;\n return question.type === 'text'\n ? 'Enter an answer before continuing.'\n : 'Choose an answer before continuing.';\n}\n\nexport function formatQuestionAnswer(\n question: AgentQuestion,\n answer: AgentQuestionAnswer | undefined\n): string {\n if (!answer || answer.value === null) return 'Skipped';\n const values = Array.isArray(answer.value) ? answer.value : [answer.value];\n const labels = new Map(question.choices?.map(choice => [choice.value, choice.label]) ?? []);\n return values.map(value => labels.get(value) ?? value).join(', ');\n}\n",
|
|
275
275
|
"type": "registry:ui"
|
|
276
276
|
}
|
|
277
277
|
]
|
|
@@ -166,12 +166,12 @@
|
|
|
166
166
|
"files": [
|
|
167
167
|
{
|
|
168
168
|
"path": "src/wc/components/AgentSourceList/AgentSourceList.css",
|
|
169
|
-
"content": "@import '../../utils/text-decoration.css';\n\n:host {
|
|
169
|
+
"content": "@import '../../utils/text-decoration.css';\n\n:host {\n display: block;\n}\n.agent-sources {\n border-block-start: var(--dimension-stroke-width-012) solid var(--color-border-tertiary);\n}\nsummary {\n align-items: center;\n cursor: default;\n display: flex;\n gap: var(--dimension-space-050);\n list-style: none;\n padding-block: var(--dimension-space-075);\n}\nsummary::-webkit-details-marker {\n display: none;\n}\ndetails[open] summary ds-icon {\n transform: rotate(90deg);\n}\nol {\n display: grid;\n gap: var(--dimension-space-075);\n margin: 0;\n padding: 0 0 var(--dimension-space-075) var(--dimension-space-150);\n}\nli {\n display: grid;\n gap: var(--dimension-space-025);\n}\na {\n --ds-text-decoration-color: var(--color-foreground-tertiary);\n align-items: center;\n color: inherit;\n display: inline-flex;\n gap: var(--dimension-space-025);\n width: fit-content;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n summary ds-icon {\n transition: transform var(--effect-motion-short-2);\n }\n}\n",
|
|
170
170
|
"type": "registry:ui"
|
|
171
171
|
},
|
|
172
172
|
{
|
|
173
173
|
"path": "src/wc/components/AgentSourceList/AgentSourceList.tsx",
|
|
174
|
-
"content": "import { Component, Event, EventEmitter, Prop, h, Host } from '@stencil/core';\nimport { resolveSafeUrl } from '../../utils';\nimport type { AgentSource } from '../conversation-types';\n\n@Component({ tag: 'ds-agent-source-list', styleUrl: 'AgentSourceList.css', scoped: true })\nexport class AgentSourceList {\n @Prop() items: AgentSource[] = [];\n @Prop() heading: string = 'Sources';\n @Prop() open: boolean = false;\n\n @Event() dsOpenChange!: EventEmitter<{ open: boolean }>;\n\n private hostname(href: string): string {\n try {\n return new URL(href).hostname;\n } catch {\n return '';\n }\n }\n\n render() {\n if (!this.items.length) return null;\n return (\n <Host>\n <details\n class=\"agent-sources\"\n open={this.open}\n onToggle={(event: Event) =>\n this.dsOpenChange.emit({\n open: (event.currentTarget as HTMLDetailsElement).open,\n })\n }\n >\n <summary>\n <ds-icon name=\"ChevronRight\" size=\"xs\" color=\"inherit\" />\n <ds-text variant=\"text-body-small\" emphasis
|
|
174
|
+
"content": "import { Component, Event, EventEmitter, Prop, h, Host } from '@stencil/core';\nimport { resolveSafeUrl } from '../../utils';\nimport type { AgentSource } from '../conversation-types';\n\n@Component({ tag: 'ds-agent-source-list', styleUrl: 'AgentSourceList.css', scoped: true })\nexport class AgentSourceList {\n @Prop() items: AgentSource[] = [];\n @Prop() heading: string = 'Sources';\n @Prop() open: boolean = false;\n\n @Event() dsOpenChange!: EventEmitter<{ open: boolean }>;\n\n private hostname(href: string): string {\n try {\n return new URL(href).hostname;\n } catch {\n return '';\n }\n }\n\n render() {\n if (!this.items.length) return null;\n return (\n <Host>\n <details\n class=\"agent-sources\"\n open={this.open}\n onToggle={(event: Event) =>\n this.dsOpenChange.emit({\n open: (event.currentTarget as HTMLDetailsElement).open,\n })\n }\n >\n <summary>\n <ds-icon name=\"ChevronRight\" size=\"xs\" color=\"inherit\" />\n <ds-text variant=\"text-body-small\" emphasis>\n {this.heading} · {this.items.length}\n </ds-text>\n </summary>\n <ol>\n {this.items.map(source => {\n const href = resolveSafeUrl(source.url);\n const hostname = href ? this.hostname(href) : '';\n return (\n <li>\n {href ? (\n <a\n class=\"ds-text-decoration\"\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label={`${source.title} (${hostname}, opens in a new tab)`}\n >\n <ds-text variant=\"text-body-small\" emphasis>\n {source.title}\n </ds-text>\n <ds-icon name=\"ExternalLink\" size=\"xs\" color=\"inherit\" />\n </a>\n ) : (\n <ds-text variant=\"text-body-small\" emphasis>\n {source.title}\n </ds-text>\n )}\n {hostname ? (\n <ds-text variant=\"text-caption\" color=\"secondary\">\n {hostname}\n </ds-text>\n ) : null}\n {source.description ? (\n <ds-text variant=\"text-body-small\" color=\"secondary\">\n {source.description}\n </ds-text>\n ) : null}\n </li>\n );\n })}\n </ol>\n </details>\n </Host>\n );\n }\n}\n",
|
|
175
175
|
"type": "registry:ui"
|
|
176
176
|
}
|
|
177
177
|
]
|
|
@@ -247,12 +247,12 @@
|
|
|
247
247
|
"files": [
|
|
248
248
|
{
|
|
249
249
|
"path": "src/wc/components/AgentToolCall/AgentToolCall.css",
|
|
250
|
-
"content": "@import '../../utils/forced-colors.css';\n\n:host {\n display: block;\n min-width: 0;\n}\n\n.agent-tool {\n min-width: 0;\n color: var(--color-foreground-secondary);\n}\n\ndetails {\n margin: 0;\n}\n\nsummary,\n.agent-tool__row {\n min-width: 0;\n padding: var(--dimension-space-050) 0;\n}\n\nsummary {\n cursor: pointer;\n list-style: none;\n}\n\nsummary::-webkit-details-marker {\n display: none;\n}\n\n.agent-tool__summary-content {\n display: grid;\n align-items: center;\n grid-template-columns: auto minmax(0, 1fr) auto;\n gap: var(--dimension-space-075);\n min-width: 0;\n}\n\n.agent-tool__status-icon {\n display: flex;\n align-items: center;\n color: var(--color-foreground-faint-neutral);\n}\n\n.agent-tool--preparing .agent-tool__status-icon,\n.agent-tool--queued .agent-tool__status-icon,\n.agent-tool--running .agent-tool__status-icon {\n color: var(--color-foreground-faint-brand);\n}\n\n.agent-tool--waiting-for-user .agent-tool__status-icon {\n color: var(--color-foreground-bold-warning);\n}\n\n.agent-tool--error .agent-tool__status-icon,\n.agent-tool--denied .agent-tool__status-icon {\n color: var(--color-foreground-bold-negative);\n}\n\n.agent-tool__title {\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n gap: var(--dimension-space-025) var(--dimension-space-075);\n min-width: 0;\n overflow-wrap: anywhere;\n}\n\n.agent-tool__chevron {\n transition: none;\n}\n\ndetails[open] .agent-tool__chevron {\n transform: rotate(90deg);\n}\n\n.agent-tool__details,\n.agent-tool__diagnostics {\n display: grid;\n gap: var(--dimension-space-075);\n}\n\n.agent-tool__details {\n padding: var(--dimension-space-050) 0 var(--dimension-space-100)\n calc(var(--dimension-size-200) + var(--dimension-space-075));\n}\n\n.agent-tool__diagnostics section {\n display: grid;\n gap: var(--dimension-space-025);\n}\n\npre {\n max-width: 100%;\n margin: 0;\n padding: var(--dimension-space-075);\n overflow: auto;\n border-radius: var(--dimension-radius-050);\n background: var(--color-background-secondary);\n color: var(--color-foreground-primary);\n font-family: var(\n --typography-font-family-code,\n 'Fira Code'
|
|
250
|
+
"content": "@import '../../utils/forced-colors.css';\n\n:host {\n display: block;\n min-width: 0;\n}\n\n.agent-tool {\n min-width: 0;\n color: var(--color-foreground-secondary);\n}\n\ndetails {\n margin: 0;\n}\n\nsummary,\n.agent-tool__row {\n min-width: 0;\n padding: var(--dimension-space-050) 0;\n}\n\nsummary {\n cursor: pointer;\n list-style: none;\n}\n\nsummary::-webkit-details-marker {\n display: none;\n}\n\n.agent-tool__summary-content {\n display: grid;\n align-items: center;\n grid-template-columns: auto minmax(0, 1fr) auto;\n gap: var(--dimension-space-075);\n min-width: 0;\n}\n\n.agent-tool__status-icon {\n display: flex;\n align-items: center;\n color: var(--color-foreground-faint-neutral);\n}\n\n.agent-tool--preparing .agent-tool__status-icon,\n.agent-tool--queued .agent-tool__status-icon,\n.agent-tool--running .agent-tool__status-icon {\n color: var(--color-foreground-faint-brand);\n}\n\n.agent-tool--waiting-for-user .agent-tool__status-icon {\n color: var(--color-foreground-bold-warning);\n}\n\n.agent-tool--error .agent-tool__status-icon,\n.agent-tool--denied .agent-tool__status-icon {\n color: var(--color-foreground-bold-negative);\n}\n\n.agent-tool__title {\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n gap: var(--dimension-space-025) var(--dimension-space-075);\n min-width: 0;\n overflow-wrap: anywhere;\n}\n\n.agent-tool__chevron {\n transition: none;\n}\n\ndetails[open] .agent-tool__chevron {\n transform: rotate(90deg);\n}\n\n.agent-tool__details,\n.agent-tool__diagnostics {\n display: grid;\n gap: var(--dimension-space-075);\n}\n\n.agent-tool__details {\n padding: var(--dimension-space-050) 0 var(--dimension-space-100)\n calc(var(--dimension-size-200) + var(--dimension-space-075));\n}\n\n.agent-tool__diagnostics section {\n display: grid;\n gap: var(--dimension-space-025);\n}\n\npre {\n max-width: 100%;\n margin: 0;\n padding: var(--dimension-space-075);\n overflow: auto;\n border-radius: var(--dimension-radius-050);\n background: var(--color-background-secondary);\n color: var(--color-foreground-primary);\n font-family: var(\n --typography-font-family-code,\n 'Fira Code',\n ui-monospace,\n 'SFMono-Regular',\n 'Cascadia Code',\n 'Roboto Mono',\n Menlo,\n Monaco,\n Consolas,\n 'Liberation Mono',\n monospace\n );\n font-variant-ligatures: var(--ds-code-font-variant-ligatures, normal);\n font-weight: var(--typography-weight-regular);\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n}\n\n.agent-tool__result {\n min-width: 0;\n padding-block: var(--dimension-space-050);\n}\n\n.agent-tool__result--plain-text {\n font-family: var(--typography-font-family-ui);\n font-size: var(--typography-fontsize-md);\n font-weight: var(--typography-weight-regular);\n line-height: var(--typography-lineheight-md);\n letter-spacing: var(--typography-letterspacing-negative-half);\n}\n\nsummary:focus-visible {\n border-radius: var(--dimension-radius-025);\n outline: var(--dimension-stroke-width-025) solid var(--color-border-bold-brand);\n outline-offset: var(--dimension-space-025);\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .agent-tool__chevron {\n transition: transform var(--effect-motion-short-2);\n }\n}\n\n@media (forced-colors: active) {\n summary:focus-visible {\n outline-color: var(--ds-forced-color-selected);\n }\n\n .agent-tool--error .agent-tool__summary-content,\n .agent-tool--denied .agent-tool__summary-content {\n border-inline-start: var(--dimension-stroke-width-025) solid var(--ds-forced-color-content);\n padding-inline-start: var(--dimension-space-050);\n }\n}\n",
|
|
251
251
|
"type": "registry:ui"
|
|
252
252
|
},
|
|
253
253
|
{
|
|
254
254
|
"path": "src/wc/components/AgentToolCall/AgentToolCall.tsx",
|
|
255
|
-
"content": "import {
|
|
255
|
+
"content": "import { Component, Element, Event, EventEmitter, h, Host, Prop, State } from '@stencil/core';\nimport type { AgentToolState } from '../conversation-types';\n\nconst STATUS_LABELS: Record<AgentToolState, string> = {\n preparing: 'Preparing',\n queued: 'Queued',\n running: 'Running',\n 'waiting-for-user': 'Waiting for your response',\n success: 'Completed',\n error: 'Failed',\n denied: 'Permission denied',\n canceled: 'Canceled',\n};\n\n@Component({ tag: 'ds-agent-tool-call', styleUrl: 'AgentToolCall.css', scoped: true })\nexport class AgentToolCall {\n @Element() el!: HTMLElement;\n\n @Prop() name: string = '';\n @Prop() label: string = '';\n @Prop() state: AgentToolState = 'queued';\n @Prop() statusLabel?: string;\n @Prop() input?: unknown;\n @Prop() output?: unknown;\n @Prop() error?: string;\n @Prop() open: boolean = false;\n\n @Event() dsOpenChange!: EventEmitter<{ open: boolean }>;\n\n @State() private hasSummary = false;\n @State() private hasResult = false;\n @State() private hasPlainTextResult = false;\n @State() private hasDetails = false;\n\n private slotObserver?: MutationObserver;\n\n componentWillLoad() {\n this.syncSlots();\n }\n\n componentDidLoad() {\n this.syncSlots();\n this.slotObserver = new MutationObserver(() => this.syncSlots());\n this.slotObserver.observe(this.el, {\n childList: true,\n subtree: false,\n attributes: true,\n attributeFilter: ['slot'],\n });\n }\n\n disconnectedCallback() {\n this.slotObserver?.disconnect();\n }\n\n private syncSlots() {\n this.hasSummary = Boolean(this.el.querySelector('[slot=\"summary\"]'));\n const result = this.el.querySelector<HTMLElement>('[slot=\"result\"]');\n this.hasResult = Boolean(result);\n this.hasPlainTextResult = Boolean(\n result && result.childElementCount === 0 && result.textContent?.trim()\n );\n this.hasDetails = Boolean(this.el.querySelector('[slot=\"details\"]'));\n }\n\n private serialize(value: unknown) {\n if (value === undefined) return '';\n if (typeof value === 'string') return value;\n try {\n return JSON.stringify(value, null, 2);\n } catch {\n return String(value);\n }\n }\n\n private get active(): boolean {\n return ['preparing', 'queued', 'running'].includes(this.state);\n }\n\n private get expandable(): boolean {\n return (\n this.hasDetails ||\n this.input !== undefined ||\n this.output !== undefined ||\n Boolean(this.error)\n );\n }\n\n private renderStatusIcon() {\n if (this.active) return <ds-loader size=\"xs\" color=\"inherit\" />;\n if (this.state === 'success') {\n return <ds-icon name=\"Check\" size=\"xs\" color=\"inherit\" />;\n }\n if (this.state === 'waiting-for-user') {\n return <ds-icon name=\"Clock\" size=\"xs\" color=\"inherit\" />;\n }\n return <ds-icon name=\"ErrorTriangle\" size=\"xs\" color=\"inherit\" />;\n }\n\n private renderSummary(expandable: boolean) {\n return (\n <span class=\"agent-tool__summary-content\">\n <span class=\"agent-tool__status-icon\" aria-hidden=\"true\">\n {this.renderStatusIcon()}\n </span>\n <span class=\"agent-tool__title\">\n {this.hasSummary ? (\n <slot name=\"summary\" />\n ) : (\n <ds-text as=\"span\" variant=\"text-body-small\" emphasis>\n {this.label || this.name}\n </ds-text>\n )}\n <ds-text\n class=\"agent-tool__state-label\"\n as=\"span\"\n variant=\"text-caption\"\n color={['error', 'denied'].includes(this.state) ? 'negative' : 'secondary'}\n >\n {this.statusLabel ?? STATUS_LABELS[this.state]}\n </ds-text>\n </span>\n {expandable ? (\n <ds-icon class=\"agent-tool__chevron\" name=\"ChevronRight\" size=\"xs\" color=\"inherit\" />\n ) : null}\n </span>\n );\n }\n\n private renderGenericDetails() {\n return (\n <div class=\"agent-tool__diagnostics\">\n {this.input !== undefined ? (\n <section>\n <ds-text variant=\"text-caption\" emphasis>\n Input\n </ds-text>\n <pre>{this.serialize(this.input)}</pre>\n </section>\n ) : null}\n {this.output !== undefined ? (\n <section>\n <ds-text variant=\"text-caption\" emphasis>\n Output\n </ds-text>\n <pre>{this.serialize(this.output)}</pre>\n </section>\n ) : null}\n {this.error ? (\n <section>\n <ds-text variant=\"text-caption\" emphasis>\n Error\n </ds-text>\n <pre>{this.error}</pre>\n </section>\n ) : null}\n </div>\n );\n }\n\n private handleToggle = (event: Event) => {\n this.dsOpenChange.emit({ open: (event.currentTarget as HTMLDetailsElement).open });\n };\n\n render() {\n const expandable = this.expandable;\n return (\n <Host>\n <div class={`agent-tool agent-tool--${this.state}`}>\n {expandable ? (\n <details open={this.open} onToggle={this.handleToggle}>\n <summary>{this.renderSummary(true)}</summary>\n <div class=\"agent-tool__details\">\n {this.hasDetails ? <slot name=\"details\" /> : this.renderGenericDetails()}\n </div>\n </details>\n ) : (\n <div class=\"agent-tool__row\">{this.renderSummary(false)}</div>\n )}\n {this.hasResult ? (\n <div\n class={{\n 'agent-tool__result': true,\n 'agent-tool__result--plain-text': this.hasPlainTextResult,\n }}\n >\n <slot name=\"result\" />\n </div>\n ) : null}\n </div>\n </Host>\n );\n }\n}\n",
|
|
256
256
|
"type": "registry:ui"
|
|
257
257
|
}
|
|
258
258
|
]
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
},
|
|
136
136
|
{
|
|
137
137
|
"path": "src/wc/components/AttachmentList/AttachmentList.tsx",
|
|
138
|
-
"content": "import { Component, h, Host, Prop } from '@stencil/core';\nimport { resolveSafeUrl } from '../../utils';\nimport type { ConversationAttachment } from '../conversation-types';\n\n@Component({\n tag: 'ds-attachment-list',\n styleUrl: 'AttachmentList.css',\n scoped: true,\n})\nexport class AttachmentList {\n @Prop() items: ConversationAttachment[] = [];\n @Prop() label: string = 'Attachments';\n\n private renderItem(item: ConversationAttachment) {\n const url = resolveSafeUrl(item.url, {\n protocols: ['http:', 'https:', 'blob:'],\n });\n const content = (\n <span class=\"attachment-list__item-content\">\n <ds-icon name=\"Document\" size=\"sm\" color=\"secondary\" />\n <span class=\"attachment-list__copy\">\n <ds-text as=\"span\" variant=\"text-body-small\" emphasis color=\"primary\" lineTruncation={1}
|
|
138
|
+
"content": "import { Component, h, Host, Prop } from '@stencil/core';\nimport { resolveSafeUrl } from '../../utils';\nimport type { ConversationAttachment } from '../conversation-types';\n\n@Component({\n tag: 'ds-attachment-list',\n styleUrl: 'AttachmentList.css',\n scoped: true,\n})\nexport class AttachmentList {\n @Prop() items: ConversationAttachment[] = [];\n @Prop() label: string = 'Attachments';\n\n private renderItem(item: ConversationAttachment) {\n const url = resolveSafeUrl(item.url, {\n protocols: ['http:', 'https:', 'blob:'],\n });\n const content = (\n <span class=\"attachment-list__item-content\">\n <ds-icon name=\"Document\" size=\"sm\" color=\"secondary\" />\n <span class=\"attachment-list__copy\">\n <ds-text as=\"span\" variant=\"text-body-small\" emphasis color=\"primary\" lineTruncation={1}>\n {item.name}\n </ds-text>\n {item.mediaType || item.size ? (\n <ds-text as=\"span\" variant=\"text-caption\" color=\"secondary\">\n {[item.mediaType, item.size].filter(Boolean).join(' · ')}\n </ds-text>\n ) : null}\n </span>\n </span>\n );\n return url ? (\n <a class=\"attachment-list__item\" href={url} target=\"_blank\" rel=\"noopener noreferrer\">\n {content}\n </a>\n ) : (\n <div class=\"attachment-list__item\">{content}</div>\n );\n }\n\n render() {\n return (\n <Host>\n <div class=\"attachment-list\" role=\"list\" aria-label={this.label}>\n {this.items.map(item => (\n <div role=\"listitem\" key={item.id}>\n {this.renderItem(item)}\n </div>\n ))}\n </div>\n </Host>\n );\n }\n}\n",
|
|
139
139
|
"type": "registry:ui"
|
|
140
140
|
}
|
|
141
141
|
]
|
|
@@ -280,7 +280,7 @@
|
|
|
280
280
|
"files": [
|
|
281
281
|
{
|
|
282
282
|
"path": "src/wc/components/Badge/Badge.css",
|
|
283
|
-
"content": "@import '../../utils/visually-hidden.css';\n@import '../../utils/forced-colors.css';\n\n:host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n container-name: ds-badge-gradient;\n pointer-events: none;\n vertical-align: middle;\n\n --_badge-bg: var(--color-background-bold-brand);\n --_badge-fg: var(--color-foreground-on-bold-background-primary);\n --_badge-ring: var(--color-background-secondary);\n --_badge-ring-width: var(--dimension-stroke-width-018);\n --_badge-gradient-context: var(--ds-shell-gradient-context, flat);\n}\n\n:host(.badge--force-gradient-background) {\n --_badge-gradient-context: gradient;\n}\n\n:host(.badge--force-flat-background) {\n --_badge-gradient-context: flat;\n}\n\n.badge__mark {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n box-sizing: border-box;\n color: var(--_badge-fg);\n background: var(--_badge-bg);\n box-shadow: 0 0 0 var(--_badge-ring-width) var(--_badge-ring);\n white-space: nowrap;\n}\n\n:host(.badge--no-ring) {\n --_badge-ring-width: 0;\n}\n\n
|
|
283
|
+
"content": "@import '../../utils/visually-hidden.css';\n@import '../../utils/forced-colors.css';\n\n:host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n container-name: ds-badge-gradient;\n pointer-events: none;\n vertical-align: middle;\n\n --_badge-bg: var(--color-background-bold-brand);\n --_badge-fg: var(--color-foreground-on-bold-background-primary);\n --_badge-ring: var(--color-background-secondary);\n --_badge-ring-width: var(--dimension-stroke-width-018);\n --_badge-gradient-context: var(--ds-shell-gradient-context, flat);\n}\n\n:host(.badge--force-gradient-background) {\n --_badge-gradient-context: gradient;\n}\n\n:host(.badge--force-flat-background) {\n --_badge-gradient-context: flat;\n}\n\n.badge__mark {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n box-sizing: border-box;\n color: var(--_badge-fg);\n background: var(--_badge-bg);\n box-shadow: 0 0 0 var(--_badge-ring-width) var(--_badge-ring);\n white-space: nowrap;\n}\n\n:host(.badge--no-ring) {\n --_badge-ring-width: 0;\n}\n\n:host(.badge--dot) .badge__mark {\n width: var(--dimension-size-075);\n height: var(--dimension-size-075);\n border-radius: var(--dimension-radius-half);\n}\n\n:host(.badge--counter) .badge__mark {\n width: auto;\n min-width: var(--dimension-size-150);\n height: var(--dimension-size-150);\n padding: 0 var(--dimension-space-025);\n border-radius: var(--dimension-radius-half);\n}\n\n/* Shell gradient ring — base fill + wash donut (option 3). */\n@container ds-badge-gradient style(--_badge-gradient-context: gradient) {\n /* Match the scoped base rule's specificity; Stencil does not yet scope style-query selectors. */\n .badge__mark.badge__mark {\n position: relative;\n z-index: 0;\n box-shadow: none;\n isolation: isolate;\n }\n\n .badge__mark::before,\n .badge__mark::after {\n content: '';\n position: absolute;\n inset: calc(-1 * var(--_badge-ring-width));\n border-radius: inherit;\n box-sizing: border-box;\n padding: var(--_badge-ring-width);\n pointer-events: none;\n /* stylelint-disable color-no-hex -- mask luminance stops for ring cutout, not theme colors */\n -webkit-mask:\n linear-gradient(#fff 0 0) content-box,\n linear-gradient(#fff 0 0);\n -webkit-mask-composite: xor;\n mask:\n linear-gradient(#fff 0 0) content-box,\n linear-gradient(#fff 0 0);\n /* stylelint-enable color-no-hex */\n mask-composite: exclude;\n }\n\n .badge__mark::before {\n z-index: -2;\n background-color: var(--_badge-ring);\n }\n\n .badge__mark::after {\n z-index: -1;\n background-image: var(--ds-shell-gradient-image, none);\n background-size: var(--ds-shell-gradient-size, auto);\n background-position: 0 0;\n background-repeat: no-repeat;\n background-attachment: fixed;\n opacity: var(--ds-shell-gradient-opacity, 1);\n }\n}\n\n@media (forced-colors: active) {\n .badge__mark {\n color: var(--ds-forced-color-on-selected);\n background: var(--ds-forced-color-selected);\n box-shadow: none;\n outline: var(--_badge-ring-width) solid var(--ds-forced-color-surface);\n }\n\n .badge__mark::before,\n .badge__mark::after {\n display: none;\n }\n}\n",
|
|
284
284
|
"type": "registry:ui"
|
|
285
285
|
},
|
|
286
286
|
{
|