@ds-mo/ui 13.3.0 → 13.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.package-ready.json +1 -1
- package/dist/agent-patterns.json +14 -1
- package/dist/agent.json +108 -8
- package/dist/angular/boolean-value-accessor.js +3 -3
- package/dist/angular/ds-agent-activity.js +3 -3
- package/dist/angular/ds-agent-response.d.ts +1 -1
- package/dist/angular/ds-agent-response.js +5 -5
- package/dist/angular/ds-agent-source-list.js +3 -3
- package/dist/angular/ds-agent-tool-call.js +3 -3
- package/dist/angular/ds-attachment-list.js +3 -3
- package/dist/angular/ds-avatar.js +3 -3
- package/dist/angular/ds-badge.js +3 -3
- package/dist/angular/ds-bar-nav.js +3 -3
- package/dist/angular/ds-bar-title.js +3 -3
- package/dist/angular/ds-bar-workflow.js +3 -3
- package/dist/angular/ds-breadcrumb.js +3 -3
- package/dist/angular/ds-button-filled.js +3 -3
- package/dist/angular/ds-button-unfilled.js +3 -3
- package/dist/angular/ds-card-data-viz.js +3 -3
- package/dist/angular/ds-card-overview.js +3 -3
- package/dist/angular/ds-card-setting.js +3 -3
- package/dist/angular/ds-chart-bar.js +3 -3
- package/dist/angular/ds-chart-donut.js +3 -3
- package/dist/angular/ds-chart-legend.js +3 -3
- package/dist/angular/ds-chart-line.js +3 -3
- package/dist/angular/ds-checkbox.js +3 -3
- package/dist/angular/ds-chip.js +3 -3
- package/dist/angular/ds-code-block.js +3 -3
- package/dist/angular/ds-conversation-list-item.js +3 -3
- package/dist/angular/ds-conversation-list-section.js +3 -3
- package/dist/angular/ds-conversation-list.js +3 -3
- package/dist/angular/ds-divider.js +3 -3
- package/dist/angular/ds-empty-state.js +3 -3
- package/dist/angular/ds-field.js +3 -3
- package/dist/angular/ds-icon.js +3 -3
- package/dist/angular/ds-input.js +3 -3
- package/dist/angular/ds-loader.js +3 -3
- package/dist/angular/ds-markdown.js +3 -3
- package/dist/angular/ds-menu.js +3 -3
- package/dist/angular/ds-message-actions.d.ts +19 -0
- package/dist/angular/ds-message-actions.js +45 -0
- package/dist/angular/ds-message-bubble.js +3 -3
- package/dist/angular/ds-message-composer.js +3 -3
- package/dist/angular/ds-message-scroller.js +3 -3
- package/dist/angular/ds-message.d.ts +1 -1
- package/dist/angular/ds-message.js +5 -5
- package/dist/angular/ds-mobile-bar-nav.js +3 -3
- package/dist/angular/ds-mobile-header.js +3 -3
- package/dist/angular/ds-mobile-section-switcher.js +3 -3
- package/dist/angular/ds-mobile-sheet-nav.js +3 -3
- package/dist/angular/ds-modal.js +3 -3
- package/dist/angular/ds-panel-nav.js +3 -3
- package/dist/angular/ds-panel-sub-nav.js +3 -3
- package/dist/angular/ds-panel-tool-header.js +3 -3
- package/dist/angular/ds-panel-tool-search.js +3 -3
- package/dist/angular/ds-panel-tools.js +3 -3
- package/dist/angular/ds-radio.js +3 -3
- package/dist/angular/ds-scroll-overlay.js +3 -3
- package/dist/angular/ds-select.js +3 -3
- package/dist/angular/ds-shell-app.js +3 -3
- package/dist/angular/ds-shell-page.js +3 -3
- package/dist/angular/ds-shell-tools.js +3 -3
- package/dist/angular/ds-skeleton.js +3 -3
- package/dist/angular/ds-slider.js +3 -3
- package/dist/angular/ds-swatch-picker.js +3 -3
- package/dist/angular/ds-switch.js +3 -3
- package/dist/angular/ds-tab-group.js +3 -3
- package/dist/angular/ds-tag.js +3 -3
- package/dist/angular/ds-text.js +3 -3
- package/dist/angular/ds-toast.js +3 -3
- package/dist/angular/ds-tooltip-data-viz.js +3 -3
- package/dist/angular/ds-tooltip.js +3 -3
- package/dist/angular/ds-typing-indicator.js +3 -3
- package/dist/angular/index.d.ts +1 -1
- package/dist/angular/index.js +1 -0
- package/dist/angular/proxies.d.ts +1 -0
- package/dist/angular/proxies.js +1 -0
- package/dist/angular/radio-value-accessor.js +3 -3
- package/dist/angular/select-value-accessor.js +3 -3
- package/dist/angular/text-value-accessor.js +3 -3
- package/dist/angular/value-accessor.js +3 -3
- package/dist/components/ds-agent-response.js +1 -1
- package/dist/components/ds-agent-response.js.map +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-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-card-overview.js +1 -1
- package/dist/components/ds-card-overview.js.map +1 -1
- package/dist/components/ds-chart-donut.js +1 -1
- package/dist/components/ds-chart-line.js +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-section.js +1 -1
- package/dist/components/ds-empty-state.js +1 -1
- package/dist/components/ds-field.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.d.ts +11 -0
- package/dist/components/ds-message-actions.js +2 -0
- package/dist/components/ds-message-actions.js.map +1 -0
- package/dist/components/ds-message-composer.js +1 -1
- package/dist/components/ds-message-scroller.js +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-panel-nav.js +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-tools.js +1 -1
- package/dist/components/ds-select.js +1 -1
- package/dist/components/ds-shell-app.js +1 -1
- package/dist/components/ds-shell-page.js +1 -1
- package/dist/components/ds-shell-tools.js +1 -1
- package/dist/components/ds-swatch-picker.js +1 -1
- package/dist/components/ds-toast.js +1 -1
- package/dist/components/ds-tooltip-data-viz.js +1 -1
- package/dist/components/ds-typing-indicator.js +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/{p-DEaszb15.js → p-1moOgMI-.js} +2 -2
- package/dist/components/p-4scN0Mgn.js +2 -0
- package/dist/components/{p-dVlKpt8U.js → p-B3PdrMP0.js} +2 -2
- package/dist/components/{p-Beejrd-R.js → p-BN9FZESH.js} +2 -2
- package/dist/components/{p-CAAWaTYD.js → p-BQTJ7ePr.js} +2 -2
- package/dist/components/{p-POvz6PiQ.js → p-BgjtMMye.js} +2 -2
- package/dist/components/p-BnhGV__o.js +2 -0
- package/dist/components/p-BnhGV__o.js.map +1 -0
- package/dist/components/p-BxEOlO5k.js +2 -0
- package/dist/components/p-BxEOlO5k.js.map +1 -0
- package/dist/components/{p-CUWFHTM6.js → p-CIgag7g2.js} +2 -2
- package/dist/components/{p-E7Ds1fQa.js → p-CQ4vAZ9j.js} +2 -2
- package/dist/components/{p-L-JEw-kX.js → p-CUSz0JFa.js} +2 -2
- package/dist/components/{p-xNfMEOpU.js → p-CWItD0gL.js} +2 -2
- package/dist/components/p-CWKrq35a.js +2 -0
- package/dist/components/p-CWKrq35a.js.map +1 -0
- package/dist/components/{p-CyjC57Dk.js → p-CmUGA_q4.js} +2 -2
- package/dist/components/p-CqOswTy8.js +2 -0
- package/dist/components/{p-Bi-21Kvd.js.map → p-CqOswTy8.js.map} +1 -1
- package/dist/components/{p-DKaXlmoQ.js → p-D4bVE7e4.js} +2 -2
- package/dist/components/{p-DAbOfJgz.js → p-D5PN6zdD.js} +2 -2
- package/dist/components/{p-BvvoC1lV.js → p-DXGKfXTh.js} +2 -2
- package/dist/components/{p-krhJI5_Y.js → p-DtV263qO.js} +2 -2
- package/dist/components/{p-vY5ia2gz.js → p-RT1mts9U.js} +2 -2
- package/dist/components/{p-z6c6TMlA.js → p-a6cnCKWk.js} +2 -2
- package/dist/docs/components.json +282 -1
- package/dist/mcp-data/registry/agent-response.json +24 -3
- package/dist/mcp-data/registry/avatar.json +1 -1
- package/dist/mcp-data/registry/card-overview.json +2 -2
- package/dist/mcp-data/registry/code-block.json +1 -1
- package/dist/mcp-data/registry/message-actions.json +186 -0
- package/dist/mcp-data/registry/message.json +27 -6
- package/dist/mcp-data/registry/registry.json +110 -7
- package/dist/react/components.d.ts +1 -0
- package/dist/react/components.js +1 -0
- package/dist/react/ds-agent-activity.d.ts +1 -1
- package/dist/react/ds-agent-activity.js +1 -1
- package/dist/react/ds-agent-response.d.ts +1 -1
- package/dist/react/ds-agent-response.js +1 -1
- package/dist/react/ds-agent-source-list.d.ts +1 -1
- package/dist/react/ds-agent-source-list.js +1 -1
- package/dist/react/ds-agent-tool-call.d.ts +1 -1
- package/dist/react/ds-agent-tool-call.js +1 -1
- package/dist/react/ds-attachment-list.d.ts +1 -1
- package/dist/react/ds-attachment-list.js +1 -1
- package/dist/react/ds-avatar.d.ts +1 -1
- package/dist/react/ds-avatar.js +1 -1
- package/dist/react/ds-badge.d.ts +1 -1
- package/dist/react/ds-badge.js +1 -1
- package/dist/react/ds-bar-nav.d.ts +1 -1
- package/dist/react/ds-bar-nav.js +1 -1
- package/dist/react/ds-bar-title.d.ts +1 -1
- package/dist/react/ds-bar-title.js +1 -1
- package/dist/react/ds-bar-workflow.d.ts +1 -1
- package/dist/react/ds-bar-workflow.js +1 -1
- package/dist/react/ds-breadcrumb.d.ts +1 -1
- package/dist/react/ds-breadcrumb.js +1 -1
- package/dist/react/ds-button-filled.d.ts +1 -1
- package/dist/react/ds-button-filled.js +1 -1
- package/dist/react/ds-button-unfilled.d.ts +1 -1
- package/dist/react/ds-button-unfilled.js +1 -1
- package/dist/react/ds-card-data-viz.d.ts +1 -1
- package/dist/react/ds-card-data-viz.js +1 -1
- package/dist/react/ds-card-overview.d.ts +1 -1
- package/dist/react/ds-card-overview.js +1 -1
- package/dist/react/ds-card-setting.d.ts +1 -1
- package/dist/react/ds-card-setting.js +1 -1
- package/dist/react/ds-chart-bar.d.ts +1 -1
- package/dist/react/ds-chart-bar.js +1 -1
- package/dist/react/ds-chart-donut.d.ts +1 -1
- package/dist/react/ds-chart-donut.js +1 -1
- package/dist/react/ds-chart-legend.d.ts +1 -1
- package/dist/react/ds-chart-legend.js +1 -1
- package/dist/react/ds-chart-line.d.ts +1 -1
- package/dist/react/ds-chart-line.js +1 -1
- package/dist/react/ds-checkbox.d.ts +1 -1
- package/dist/react/ds-checkbox.js +1 -1
- package/dist/react/ds-chip.d.ts +1 -1
- package/dist/react/ds-chip.js +1 -1
- package/dist/react/ds-code-block.d.ts +1 -1
- package/dist/react/ds-code-block.js +1 -1
- package/dist/react/ds-conversation-list-item.d.ts +1 -1
- package/dist/react/ds-conversation-list-item.js +1 -1
- package/dist/react/ds-conversation-list-section.d.ts +1 -1
- package/dist/react/ds-conversation-list-section.js +1 -1
- package/dist/react/ds-conversation-list.d.ts +1 -1
- package/dist/react/ds-conversation-list.js +1 -1
- package/dist/react/ds-divider.d.ts +1 -1
- package/dist/react/ds-divider.js +1 -1
- package/dist/react/ds-empty-state.d.ts +1 -1
- package/dist/react/ds-empty-state.js +1 -1
- package/dist/react/ds-field.d.ts +1 -1
- package/dist/react/ds-field.js +1 -1
- package/dist/react/ds-icon.d.ts +1 -1
- package/dist/react/ds-icon.js +1 -1
- package/dist/react/ds-input.d.ts +1 -1
- package/dist/react/ds-input.js +1 -1
- package/dist/react/ds-loader.d.ts +1 -1
- package/dist/react/ds-loader.js +1 -1
- package/dist/react/ds-markdown.d.ts +1 -1
- package/dist/react/ds-markdown.js +1 -1
- package/dist/react/ds-menu.d.ts +1 -1
- package/dist/react/ds-menu.js +1 -1
- package/dist/react/ds-message-actions.d.ts +13 -0
- package/dist/react/ds-message-actions.js +15 -0
- package/dist/react/ds-message-bubble.d.ts +1 -1
- package/dist/react/ds-message-bubble.js +1 -1
- package/dist/react/ds-message-composer.d.ts +1 -1
- package/dist/react/ds-message-composer.js +1 -1
- package/dist/react/ds-message-scroller.d.ts +1 -1
- package/dist/react/ds-message-scroller.js +1 -1
- package/dist/react/ds-message.d.ts +1 -1
- package/dist/react/ds-message.js +1 -1
- package/dist/react/ds-mobile-bar-nav.d.ts +1 -1
- package/dist/react/ds-mobile-bar-nav.js +1 -1
- package/dist/react/ds-mobile-header.d.ts +1 -1
- package/dist/react/ds-mobile-header.js +1 -1
- package/dist/react/ds-mobile-section-switcher.d.ts +1 -1
- package/dist/react/ds-mobile-section-switcher.js +1 -1
- package/dist/react/ds-mobile-sheet-nav.d.ts +1 -1
- package/dist/react/ds-mobile-sheet-nav.js +1 -1
- package/dist/react/ds-modal.d.ts +1 -1
- package/dist/react/ds-modal.js +1 -1
- package/dist/react/ds-panel-nav.d.ts +1 -1
- package/dist/react/ds-panel-nav.js +1 -1
- package/dist/react/ds-panel-sub-nav.d.ts +1 -1
- package/dist/react/ds-panel-sub-nav.js +1 -1
- package/dist/react/ds-panel-tool-header.d.ts +1 -1
- package/dist/react/ds-panel-tool-header.js +1 -1
- package/dist/react/ds-panel-tool-search.d.ts +1 -1
- package/dist/react/ds-panel-tool-search.js +1 -1
- package/dist/react/ds-panel-tools.d.ts +1 -1
- package/dist/react/ds-panel-tools.js +1 -1
- package/dist/react/ds-radio.d.ts +1 -1
- package/dist/react/ds-radio.js +1 -1
- package/dist/react/ds-scroll-overlay.d.ts +1 -1
- package/dist/react/ds-scroll-overlay.js +1 -1
- package/dist/react/ds-select.d.ts +1 -1
- package/dist/react/ds-select.js +1 -1
- package/dist/react/ds-shell-app.d.ts +1 -1
- package/dist/react/ds-shell-app.js +1 -1
- package/dist/react/ds-shell-page.d.ts +1 -1
- package/dist/react/ds-shell-page.js +1 -1
- package/dist/react/ds-shell-tools.d.ts +1 -1
- package/dist/react/ds-shell-tools.js +1 -1
- package/dist/react/ds-skeleton.d.ts +1 -1
- package/dist/react/ds-skeleton.js +1 -1
- package/dist/react/ds-slider.d.ts +1 -1
- package/dist/react/ds-slider.js +1 -1
- package/dist/react/ds-swatch-picker.d.ts +1 -1
- package/dist/react/ds-swatch-picker.js +1 -1
- package/dist/react/ds-switch.d.ts +1 -1
- package/dist/react/ds-switch.js +1 -1
- package/dist/react/ds-tab-group.d.ts +1 -1
- package/dist/react/ds-tab-group.js +1 -1
- package/dist/react/ds-tag.d.ts +1 -1
- package/dist/react/ds-tag.js +1 -1
- package/dist/react/ds-text.d.ts +1 -1
- package/dist/react/ds-text.js +1 -1
- package/dist/react/ds-toast.d.ts +1 -1
- package/dist/react/ds-toast.js +1 -1
- package/dist/react/ds-tooltip-data-viz.d.ts +1 -1
- package/dist/react/ds-tooltip-data-viz.js +1 -1
- package/dist/react/ds-tooltip.d.ts +1 -1
- package/dist/react/ds-tooltip.js +1 -1
- package/dist/react/ds-typing-indicator.d.ts +1 -1
- package/dist/react/ds-typing-indicator.js +1 -1
- package/dist/react/react-runtime.d.ts +17 -0
- package/dist/react/react-runtime.js +13 -0
- package/dist/types/components/AgentResponse/AgentResponse.d.ts +3 -1
- package/dist/types/components/CardOverview/CardOverview.d.ts +1 -1
- package/dist/types/components/CodeBlock/CodeBlock.d.ts +3 -1
- package/dist/types/components/Message/Message.d.ts +4 -1
- package/dist/types/components/MessageActions/MessageActions.d.ts +18 -0
- package/dist/types/components/conversation-types.d.ts +5 -0
- package/dist/types/components.d.ts +72 -2
- package/dist/types/utils/clipboard.d.ts +31 -0
- package/package.json +3 -6
- package/dist/components/p-B_A4g4Xe.js +0 -2
- package/dist/components/p-B_A4g4Xe.js.map +0 -1
- package/dist/components/p-Bi-21Kvd.js +0 -2
- package/dist/components/p-DV-tK5TR.js +0 -2
- package/dist/components/p-awaBUdlz.js +0 -2
- package/dist/components/p-awaBUdlz.js.map +0 -1
- /package/dist/components/{p-DEaszb15.js.map → p-1moOgMI-.js.map} +0 -0
- /package/dist/components/{p-DV-tK5TR.js.map → p-4scN0Mgn.js.map} +0 -0
- /package/dist/components/{p-dVlKpt8U.js.map → p-B3PdrMP0.js.map} +0 -0
- /package/dist/components/{p-Beejrd-R.js.map → p-BN9FZESH.js.map} +0 -0
- /package/dist/components/{p-CAAWaTYD.js.map → p-BQTJ7ePr.js.map} +0 -0
- /package/dist/components/{p-POvz6PiQ.js.map → p-BgjtMMye.js.map} +0 -0
- /package/dist/components/{p-CUWFHTM6.js.map → p-CIgag7g2.js.map} +0 -0
- /package/dist/components/{p-E7Ds1fQa.js.map → p-CQ4vAZ9j.js.map} +0 -0
- /package/dist/components/{p-L-JEw-kX.js.map → p-CUSz0JFa.js.map} +0 -0
- /package/dist/components/{p-xNfMEOpU.js.map → p-CWItD0gL.js.map} +0 -0
- /package/dist/components/{p-CyjC57Dk.js.map → p-CmUGA_q4.js.map} +0 -0
- /package/dist/components/{p-DKaXlmoQ.js.map → p-D4bVE7e4.js.map} +0 -0
- /package/dist/components/{p-DAbOfJgz.js.map → p-D5PN6zdD.js.map} +0 -0
- /package/dist/components/{p-BvvoC1lV.js.map → p-DXGKfXTh.js.map} +0 -0
- /package/dist/components/{p-krhJI5_Y.js.map → p-DtV263qO.js.map} +0 -0
- /package/dist/components/{p-vY5ia2gz.js.map → p-RT1mts9U.js.map} +0 -0
- /package/dist/components/{p-z6c6TMlA.js.map → p-a6cnCKWk.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2026-07-
|
|
2
|
+
"timestamp": "2026-07-31T05:26:45",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "4.43.5",
|
|
@@ -200,6 +200,47 @@
|
|
|
200
200
|
"getter": false,
|
|
201
201
|
"setter": false
|
|
202
202
|
},
|
|
203
|
+
{
|
|
204
|
+
"name": "metadataVisibility",
|
|
205
|
+
"type": "\"always\" | \"hover\"",
|
|
206
|
+
"complexType": {
|
|
207
|
+
"original": "MessageMetadataVisibility",
|
|
208
|
+
"resolved": "\"always\" | \"hover\"",
|
|
209
|
+
"references": {
|
|
210
|
+
"MessageMetadataVisibility": {
|
|
211
|
+
"location": "import",
|
|
212
|
+
"path": "../conversation-types",
|
|
213
|
+
"id": "src/wc/components/conversation-types.ts::MessageMetadataVisibility",
|
|
214
|
+
"referenceLocation": "MessageMetadataVisibility"
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
"mutable": false,
|
|
219
|
+
"attr": "metadata-visibility",
|
|
220
|
+
"reflectToAttr": false,
|
|
221
|
+
"docs": "Controls whether the complete message metadata footer is persistent or revealed through hover/focus.",
|
|
222
|
+
"docsTags": [
|
|
223
|
+
{
|
|
224
|
+
"name": "default",
|
|
225
|
+
"text": "'always'"
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
"default": "'always'",
|
|
229
|
+
"values": [
|
|
230
|
+
{
|
|
231
|
+
"value": "always",
|
|
232
|
+
"type": "string"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"value": "hover",
|
|
236
|
+
"type": "string"
|
|
237
|
+
}
|
|
238
|
+
],
|
|
239
|
+
"optional": false,
|
|
240
|
+
"required": false,
|
|
241
|
+
"getter": false,
|
|
242
|
+
"setter": false
|
|
243
|
+
},
|
|
203
244
|
{
|
|
204
245
|
"name": "parts",
|
|
205
246
|
"type": "AgentResponsePart[]",
|
|
@@ -4585,6 +4626,7 @@
|
|
|
4585
4626
|
"ds-card-setting",
|
|
4586
4627
|
"ds-code-block",
|
|
4587
4628
|
"ds-input",
|
|
4629
|
+
"ds-message-actions",
|
|
4588
4630
|
"ds-message-composer",
|
|
4589
4631
|
"ds-message-scroller",
|
|
4590
4632
|
"ds-mobile-sheet-nav",
|
|
@@ -4635,6 +4677,9 @@
|
|
|
4635
4677
|
"ds-input": [
|
|
4636
4678
|
"ds-button-unfilled"
|
|
4637
4679
|
],
|
|
4680
|
+
"ds-message-actions": [
|
|
4681
|
+
"ds-button-unfilled"
|
|
4682
|
+
],
|
|
4638
4683
|
"ds-message-composer": [
|
|
4639
4684
|
"ds-button-unfilled"
|
|
4640
4685
|
],
|
|
@@ -11051,6 +11096,47 @@
|
|
|
11051
11096
|
"getter": false,
|
|
11052
11097
|
"setter": false
|
|
11053
11098
|
},
|
|
11099
|
+
{
|
|
11100
|
+
"name": "metadataVisibility",
|
|
11101
|
+
"type": "\"always\" | \"hover\"",
|
|
11102
|
+
"complexType": {
|
|
11103
|
+
"original": "MessageMetadataVisibility",
|
|
11104
|
+
"resolved": "\"always\" | \"hover\"",
|
|
11105
|
+
"references": {
|
|
11106
|
+
"MessageMetadataVisibility": {
|
|
11107
|
+
"location": "import",
|
|
11108
|
+
"path": "../conversation-types",
|
|
11109
|
+
"id": "src/wc/components/conversation-types.ts::MessageMetadataVisibility",
|
|
11110
|
+
"referenceLocation": "MessageMetadataVisibility"
|
|
11111
|
+
}
|
|
11112
|
+
}
|
|
11113
|
+
},
|
|
11114
|
+
"mutable": false,
|
|
11115
|
+
"attr": "metadata-visibility",
|
|
11116
|
+
"reflectToAttr": false,
|
|
11117
|
+
"docs": "Controls whether the complete metadata footer is persistent or revealed through hover/focus.",
|
|
11118
|
+
"docsTags": [
|
|
11119
|
+
{
|
|
11120
|
+
"name": "default",
|
|
11121
|
+
"text": "'always'"
|
|
11122
|
+
}
|
|
11123
|
+
],
|
|
11124
|
+
"default": "'always'",
|
|
11125
|
+
"values": [
|
|
11126
|
+
{
|
|
11127
|
+
"value": "always",
|
|
11128
|
+
"type": "string"
|
|
11129
|
+
},
|
|
11130
|
+
{
|
|
11131
|
+
"value": "hover",
|
|
11132
|
+
"type": "string"
|
|
11133
|
+
}
|
|
11134
|
+
],
|
|
11135
|
+
"optional": false,
|
|
11136
|
+
"required": false,
|
|
11137
|
+
"getter": false,
|
|
11138
|
+
"setter": false
|
|
11139
|
+
},
|
|
11054
11140
|
{
|
|
11055
11141
|
"name": "scrollAnchor",
|
|
11056
11142
|
"type": "boolean",
|
|
@@ -11190,6 +11276,182 @@
|
|
|
11190
11276
|
]
|
|
11191
11277
|
}
|
|
11192
11278
|
},
|
|
11279
|
+
{
|
|
11280
|
+
"filePath": "src/wc/components/MessageActions/MessageActions.tsx",
|
|
11281
|
+
"encapsulation": "scoped",
|
|
11282
|
+
"tag": "ds-message-actions",
|
|
11283
|
+
"docs": "",
|
|
11284
|
+
"docsTags": [],
|
|
11285
|
+
"usage": {},
|
|
11286
|
+
"props": [
|
|
11287
|
+
{
|
|
11288
|
+
"name": "copyText",
|
|
11289
|
+
"type": "string | undefined",
|
|
11290
|
+
"complexType": {
|
|
11291
|
+
"original": "string | undefined",
|
|
11292
|
+
"resolved": "string | undefined",
|
|
11293
|
+
"references": {}
|
|
11294
|
+
},
|
|
11295
|
+
"mutable": false,
|
|
11296
|
+
"attr": "copy-text",
|
|
11297
|
+
"reflectToAttr": false,
|
|
11298
|
+
"docs": "",
|
|
11299
|
+
"docsTags": [],
|
|
11300
|
+
"values": [
|
|
11301
|
+
{
|
|
11302
|
+
"type": "string"
|
|
11303
|
+
},
|
|
11304
|
+
{
|
|
11305
|
+
"type": "undefined"
|
|
11306
|
+
}
|
|
11307
|
+
],
|
|
11308
|
+
"optional": false,
|
|
11309
|
+
"required": false,
|
|
11310
|
+
"getter": false,
|
|
11311
|
+
"setter": false
|
|
11312
|
+
},
|
|
11313
|
+
{
|
|
11314
|
+
"name": "feedback",
|
|
11315
|
+
"type": "\"negative\" | \"positive\" | undefined",
|
|
11316
|
+
"complexType": {
|
|
11317
|
+
"original": "MessageFeedback | undefined",
|
|
11318
|
+
"resolved": "\"negative\" | \"positive\" | undefined",
|
|
11319
|
+
"references": {
|
|
11320
|
+
"MessageFeedback": {
|
|
11321
|
+
"location": "import",
|
|
11322
|
+
"path": "../conversation-types",
|
|
11323
|
+
"id": "src/wc/components/conversation-types.ts::MessageFeedback",
|
|
11324
|
+
"referenceLocation": "MessageFeedback"
|
|
11325
|
+
}
|
|
11326
|
+
}
|
|
11327
|
+
},
|
|
11328
|
+
"mutable": false,
|
|
11329
|
+
"attr": "feedback",
|
|
11330
|
+
"reflectToAttr": false,
|
|
11331
|
+
"docs": "",
|
|
11332
|
+
"docsTags": [],
|
|
11333
|
+
"values": [
|
|
11334
|
+
{
|
|
11335
|
+
"value": "negative",
|
|
11336
|
+
"type": "string"
|
|
11337
|
+
},
|
|
11338
|
+
{
|
|
11339
|
+
"value": "positive",
|
|
11340
|
+
"type": "string"
|
|
11341
|
+
},
|
|
11342
|
+
{
|
|
11343
|
+
"type": "undefined"
|
|
11344
|
+
}
|
|
11345
|
+
],
|
|
11346
|
+
"optional": false,
|
|
11347
|
+
"required": false,
|
|
11348
|
+
"getter": false,
|
|
11349
|
+
"setter": false
|
|
11350
|
+
},
|
|
11351
|
+
{
|
|
11352
|
+
"name": "feedbackEnabled",
|
|
11353
|
+
"type": "boolean",
|
|
11354
|
+
"complexType": {
|
|
11355
|
+
"original": "boolean",
|
|
11356
|
+
"resolved": "boolean",
|
|
11357
|
+
"references": {}
|
|
11358
|
+
},
|
|
11359
|
+
"mutable": false,
|
|
11360
|
+
"attr": "feedback-enabled",
|
|
11361
|
+
"reflectToAttr": false,
|
|
11362
|
+
"docs": "",
|
|
11363
|
+
"docsTags": [
|
|
11364
|
+
{
|
|
11365
|
+
"name": "default",
|
|
11366
|
+
"text": "false"
|
|
11367
|
+
}
|
|
11368
|
+
],
|
|
11369
|
+
"default": "false",
|
|
11370
|
+
"values": [
|
|
11371
|
+
{
|
|
11372
|
+
"type": "boolean"
|
|
11373
|
+
}
|
|
11374
|
+
],
|
|
11375
|
+
"optional": false,
|
|
11376
|
+
"required": false,
|
|
11377
|
+
"getter": false,
|
|
11378
|
+
"setter": false
|
|
11379
|
+
}
|
|
11380
|
+
],
|
|
11381
|
+
"methods": [],
|
|
11382
|
+
"events": [
|
|
11383
|
+
{
|
|
11384
|
+
"event": "dsCopyResult",
|
|
11385
|
+
"detail": "MessageCopyResultEventDetail",
|
|
11386
|
+
"bubbles": true,
|
|
11387
|
+
"complexType": {
|
|
11388
|
+
"original": "MessageCopyResultEventDetail",
|
|
11389
|
+
"resolved": "MessageCopyResultEventDetail",
|
|
11390
|
+
"references": {
|
|
11391
|
+
"MessageCopyResultEventDetail": {
|
|
11392
|
+
"location": "import",
|
|
11393
|
+
"path": "../conversation-types",
|
|
11394
|
+
"id": "src/wc/components/conversation-types.ts::MessageCopyResultEventDetail",
|
|
11395
|
+
"referenceLocation": "MessageCopyResultEventDetail"
|
|
11396
|
+
}
|
|
11397
|
+
}
|
|
11398
|
+
},
|
|
11399
|
+
"cancelable": true,
|
|
11400
|
+
"composed": true,
|
|
11401
|
+
"docs": "",
|
|
11402
|
+
"docsTags": []
|
|
11403
|
+
},
|
|
11404
|
+
{
|
|
11405
|
+
"event": "dsFeedbackChange",
|
|
11406
|
+
"detail": "\"negative\" | \"positive\" | undefined",
|
|
11407
|
+
"bubbles": true,
|
|
11408
|
+
"complexType": {
|
|
11409
|
+
"original": "MessageFeedback | undefined",
|
|
11410
|
+
"resolved": "\"negative\" | \"positive\" | undefined",
|
|
11411
|
+
"references": {
|
|
11412
|
+
"MessageFeedback": {
|
|
11413
|
+
"location": "import",
|
|
11414
|
+
"path": "../conversation-types",
|
|
11415
|
+
"id": "src/wc/components/conversation-types.ts::MessageFeedback",
|
|
11416
|
+
"referenceLocation": "MessageFeedback"
|
|
11417
|
+
}
|
|
11418
|
+
}
|
|
11419
|
+
},
|
|
11420
|
+
"cancelable": true,
|
|
11421
|
+
"composed": true,
|
|
11422
|
+
"docs": "",
|
|
11423
|
+
"docsTags": []
|
|
11424
|
+
}
|
|
11425
|
+
],
|
|
11426
|
+
"listeners": [],
|
|
11427
|
+
"styles": [],
|
|
11428
|
+
"slots": [],
|
|
11429
|
+
"parts": [],
|
|
11430
|
+
"states": [],
|
|
11431
|
+
"dependents": [],
|
|
11432
|
+
"dependencies": [
|
|
11433
|
+
"ds-tooltip",
|
|
11434
|
+
"ds-button-unfilled"
|
|
11435
|
+
],
|
|
11436
|
+
"dependencyGraph": {
|
|
11437
|
+
"ds-message-actions": [
|
|
11438
|
+
"ds-tooltip",
|
|
11439
|
+
"ds-button-unfilled"
|
|
11440
|
+
],
|
|
11441
|
+
"ds-tooltip": [
|
|
11442
|
+
"ds-text"
|
|
11443
|
+
],
|
|
11444
|
+
"ds-button-unfilled": [
|
|
11445
|
+
"ds-loader",
|
|
11446
|
+
"ds-icon",
|
|
11447
|
+
"ds-badge",
|
|
11448
|
+
"ds-text"
|
|
11449
|
+
],
|
|
11450
|
+
"ds-badge": [
|
|
11451
|
+
"ds-text"
|
|
11452
|
+
]
|
|
11453
|
+
}
|
|
11454
|
+
},
|
|
11193
11455
|
{
|
|
11194
11456
|
"filePath": "src/wc/components/MessageBubble/MessageBubble.tsx",
|
|
11195
11457
|
"encapsulation": "scoped",
|
|
@@ -23383,6 +23645,7 @@
|
|
|
23383
23645
|
"ds-bar-workflow",
|
|
23384
23646
|
"ds-card-overview",
|
|
23385
23647
|
"ds-code-block",
|
|
23648
|
+
"ds-message-actions",
|
|
23386
23649
|
"ds-message-composer",
|
|
23387
23650
|
"ds-message-scroller",
|
|
23388
23651
|
"ds-mobile-sheet-nav",
|
|
@@ -23414,6 +23677,9 @@
|
|
|
23414
23677
|
"ds-code-block": [
|
|
23415
23678
|
"ds-tooltip"
|
|
23416
23679
|
],
|
|
23680
|
+
"ds-message-actions": [
|
|
23681
|
+
"ds-tooltip"
|
|
23682
|
+
],
|
|
23417
23683
|
"ds-message-composer": [
|
|
23418
23684
|
"ds-tooltip"
|
|
23419
23685
|
],
|
|
@@ -24123,6 +24389,11 @@
|
|
|
24123
24389
|
"docstring": "",
|
|
24124
24390
|
"path": "src/wc/components/conversation-types.ts"
|
|
24125
24391
|
},
|
|
24392
|
+
"src/wc/components/conversation-types.ts::MessageMetadataVisibility": {
|
|
24393
|
+
"declaration": "export type MessageMetadataVisibility = 'always' | 'hover';",
|
|
24394
|
+
"docstring": "",
|
|
24395
|
+
"path": "src/wc/components/conversation-types.ts"
|
|
24396
|
+
},
|
|
24126
24397
|
"src/wc/components/conversation-types.ts::AgentSource": {
|
|
24127
24398
|
"declaration": "export interface AgentSource {\n id: string;\n title: string;\n url: string;\n description?: string;\n}",
|
|
24128
24399
|
"docstring": "",
|
|
@@ -24233,6 +24504,16 @@
|
|
|
24233
24504
|
"docstring": "",
|
|
24234
24505
|
"path": "src/wc/components/conversation-types.ts"
|
|
24235
24506
|
},
|
|
24507
|
+
"src/wc/components/conversation-types.ts::MessageFeedback": {
|
|
24508
|
+
"declaration": "export type MessageFeedback = 'positive' | 'negative';",
|
|
24509
|
+
"docstring": "",
|
|
24510
|
+
"path": "src/wc/components/conversation-types.ts"
|
|
24511
|
+
},
|
|
24512
|
+
"src/wc/components/conversation-types.ts::MessageCopyResultEventDetail": {
|
|
24513
|
+
"declaration": "export interface MessageCopyResultEventDetail {\n status: 'success' | 'error';\n}",
|
|
24514
|
+
"docstring": "",
|
|
24515
|
+
"path": "src/wc/components/conversation-types.ts"
|
|
24516
|
+
},
|
|
24236
24517
|
"src/wc/components/conversation-types.ts::MessageComposerStatus": {
|
|
24237
24518
|
"declaration": "export type MessageComposerStatus = 'ready' | 'submitted' | 'streaming' | 'error';",
|
|
24238
24519
|
"docstring": "",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
],
|
|
23
23
|
"commonlyComposedWith": [
|
|
24
24
|
"component:ds-message",
|
|
25
|
+
"component:ds-message-actions",
|
|
25
26
|
"component:ds-markdown",
|
|
26
27
|
"component:ds-agent-activity",
|
|
27
28
|
"component:ds-agent-tool-call",
|
|
@@ -32,12 +33,14 @@
|
|
|
32
33
|
],
|
|
33
34
|
"accessibility": [
|
|
34
35
|
"Part order matches authored reading order and remains inside generic message semantics.",
|
|
35
|
-
"Streaming state supplements rather than replaces meaningful textual status."
|
|
36
|
+
"Streaming state supplements rather than replaces meaningful textual status.",
|
|
37
|
+
"Forwarded metadata actions retain Message ordering, keyboard reveal, and touch visibility."
|
|
36
38
|
],
|
|
37
39
|
"states": [
|
|
38
40
|
"The owner replaces immutable part arrays as scripted or live output changes.",
|
|
39
41
|
"AgentResponse renders directly in Message without borrowing a plain MessageBubble surface.",
|
|
40
|
-
"Markdown parts use the optional safe renderer; prose CSS owns only semantic-tree styling and never response ordering or streaming state."
|
|
42
|
+
"Markdown parts use the optional safe renderer; prose CSS owns only semantic-tree styling and never response ordering or streaming state.",
|
|
43
|
+
"The application may compose MessageActions for completed-response Copy and controlled feedback while retaining persistent retry or recovery controls in the separate actions slot."
|
|
41
44
|
],
|
|
42
45
|
"responsiveBehavior": [
|
|
43
46
|
"Rich content uses the available transcript width while respecting readable measure and local overflow constraints."
|
|
@@ -71,6 +74,15 @@
|
|
|
71
74
|
"required": false,
|
|
72
75
|
"mutable": false
|
|
73
76
|
},
|
|
77
|
+
"metadataVisibility": {
|
|
78
|
+
"type": "MessageMetadataVisibility",
|
|
79
|
+
"resolvedType": "\"always\" | \"hover\"",
|
|
80
|
+
"attribute": "metadata-visibility",
|
|
81
|
+
"default": "'always'",
|
|
82
|
+
"required": false,
|
|
83
|
+
"mutable": false,
|
|
84
|
+
"description": "Controls whether the complete message metadata footer is persistent or revealed through hover/focus."
|
|
85
|
+
},
|
|
74
86
|
"parts": {
|
|
75
87
|
"type": "AgentResponsePart[]",
|
|
76
88
|
"resolvedType": "AgentResponsePart[]",
|
|
@@ -124,6 +136,15 @@
|
|
|
124
136
|
"required": false,
|
|
125
137
|
"mutable": false
|
|
126
138
|
},
|
|
139
|
+
"metadataVisibility": {
|
|
140
|
+
"type": "MessageMetadataVisibility",
|
|
141
|
+
"resolvedType": "\"always\" | \"hover\"",
|
|
142
|
+
"attribute": "metadata-visibility",
|
|
143
|
+
"default": "'always'",
|
|
144
|
+
"required": false,
|
|
145
|
+
"mutable": false,
|
|
146
|
+
"description": "Controls whether the complete message metadata footer is persistent or revealed through hover/focus."
|
|
147
|
+
},
|
|
127
148
|
"parts": {
|
|
128
149
|
"type": "AgentResponsePart[]",
|
|
129
150
|
"resolvedType": "AgentResponsePart[]",
|
|
@@ -209,7 +230,7 @@
|
|
|
209
230
|
},
|
|
210
231
|
{
|
|
211
232
|
"path": "src/wc/components/AgentResponse/AgentResponse.tsx",
|
|
212
|
-
"content": "import { Component, Prop, h, Host } from '@stencil/core';\nimport type {
|
|
233
|
+
"content": "import { Component, Prop, h, Host } from '@stencil/core';\nimport type {\n AgentResponsePart,\n MessageMetadataVisibility,\n} from '../conversation-types';\n\n@Component({ tag: 'ds-agent-response', styleUrl: 'AgentResponse.css', scoped: true })\nexport class AgentResponse {\n @Prop() messageId: string = '';\n @Prop() author: string = '';\n @Prop() showAuthor: boolean = true;\n @Prop() timestamp: string = '';\n @Prop() parts: AgentResponsePart[] = [];\n @Prop() streaming: boolean = false;\n /** Controls whether the complete message metadata footer is persistent or revealed through hover/focus. */\n @Prop() metadataVisibility: MessageMetadataVisibility = 'always';\n\n private renderPart(part: AgentResponsePart) {\n switch (part.type) {\n case 'markdown':\n return (\n <ds-markdown\n key={part.id}\n content={part.content}\n streaming={part.state === 'streaming'}\n />\n );\n case 'activity':\n return <ds-agent-activity key={part.id} items={part.items} />;\n case 'tool':\n return (\n <ds-agent-tool-call\n key={part.id}\n name={part.name}\n label={part.label}\n state={part.state}\n input={part.input}\n output={part.output}\n error={part.error}\n />\n );\n case 'attachments':\n return <ds-attachment-list key={part.id} items={part.items} />;\n case 'sources':\n return <ds-agent-source-list key={part.id} items={part.items} />;\n }\n }\n\n render() {\n return (\n <Host>\n <ds-message\n messageId={this.messageId}\n direction=\"incoming\"\n author={this.author}\n showAuthor={this.showAuthor}\n timestamp={this.timestamp}\n streaming={this.streaming}\n metadataVisibility={this.metadataVisibility}\n >\n <div class=\"agent-response\">{this.parts.map(part => this.renderPart(part))}</div>\n <slot name=\"footer\" slot=\"footer\" />\n <slot name=\"metadata-actions\" slot=\"metadata-actions\" />\n <slot name=\"actions\" slot=\"actions\" />\n </ds-message>\n </Host>\n );\n }\n}\n",
|
|
213
234
|
"type": "registry:ui"
|
|
214
235
|
}
|
|
215
236
|
]
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"intentStatus": "complete",
|
|
13
13
|
"intent": {
|
|
14
14
|
"audience": "general",
|
|
15
|
-
"status": "
|
|
15
|
+
"status": "stable",
|
|
16
16
|
"summary": "Compact icon avatar for visually identifying a person, group, channel, or conversation type.",
|
|
17
17
|
"useWhen": [
|
|
18
18
|
"A list or message composition needs a consistent circular identity marker represented by an icon at md, sm, or xs control density."
|
|
@@ -366,12 +366,12 @@
|
|
|
366
366
|
"files": [
|
|
367
367
|
{
|
|
368
368
|
"path": "src/wc/components/CardOverview/CardOverview.css",
|
|
369
|
-
"content": "@import '../../utils/interaction-fill.css';\n@import '../../utils/focus-ring.css';\n@import '../../utils/control-density.css';\n@import '../../utils/control-parts.css';\n@import '../../styles/control-elevation.css';\n\n/* The summary bar follows the theme-reactive inverted sub-theme. */\n\n:host {\n display: block;\n box-sizing: border-box;\n /* Drives the narrow layout below from the card's own width, not the viewport's. */\n container-type: inline-size;\n /* A summary is read, not copied; stray selection while clicking cells is noise. */\n -webkit-user-select: none;\n user-select: none;\n /* Width a metric may shrink to before the grid drops a column. */\n --ds-card-overview-metric-min: calc(var(--dimension-size-400) * 5);\n --ds-card-overview-divider-width: var(--dimension-stroke-width-012);\n --ds-card-overview-divider-color: var(--color-inverted-border-tertiary);\n --ds-card-overview-divider: var(--ds-card-overview-divider-width) solid\n var(--ds-card-overview-divider-color);\n color: var(--color-inverted-foreground-primary);\n}\n\n.card-overview__surface {\n width: 100%;\n min-width: 0;\n box-sizing: border-box;\n border-radius: var(--dimension-radius-050);\n background: var(--color-inverted-background);\n color: var(--color-inverted-foreground-primary);\n overflow-anchor: none;\n}\n\n/*\n * The visual surface owns elevation outside this clipping viewport. Keeping\n * those layers separate lets a page shrink the surface while content moves and\n * clips inside it without cutting off the shadow or inset highlight.\n */\n.card-overview__clip {\n height: 100%;\n min-width: 0;\n border-radius: inherit;\n background: inherit;\n overflow: hidden;\n}\n\n:host(.card-overview--scroll-collapsing) {\n height: var(--ds-card-overview-expanded-height);\n pointer-events: none;\n}\n\n:host(.card-overview--scroll-collapsing) .card-overview__surface {\n height: var(--ds-card-overview-visible-height);\n pointer-events: auto;\n will-change: height;\n}\n\n:host(.card-overview--scroll-collapsing) .card-overview__layout {\n transform: translateY(calc(-1 * var(--ds-card-overview-content-offset)));\n will-change: transform;\n}\n\n.card-overview__layout {\n display: grid;\n grid-template-rows: auto minmax(0, 1fr);\n grid-template-columns: minmax(0, 1fr);\n align-items: stretch;\n min-width: 0;\n}\n\n.card-overview__layout--has-score {\n grid-template-columns: auto minmax(0, 1fr);\n}\n\n/*\n * Transparent at regular widths so the score and header participate in the\n * inner layout grid directly. At the narrow breakpoint it becomes the unified\n * summary block above the metrics.\n */\n.card-overview__summary {\n display: contents;\n}\n\n/* ── Score ────────────────────────────────────────────────────────────────── */\n\n/*\n * Hugs its content and never shrinks, so the headline figure keeps its size and\n * the metric grid absorbs the remaining width.\n */\n/*\n * Top aligned rather than centred, and padded to match the header, so the score\n * label sits in the same 32px box at the same offset as the period text beside\n * it. Both use the same type variant, so their baselines land together.\n */\n.card-overview__score {\n display: flex;\n grid-row: 1 / span 2;\n grid-column: 1;\n flex: 0 0 auto;\n flex-direction: column;\n gap: 0;\n min-width: 0;\n padding: var(--dimension-space-100) var(--dimension-space-200);\n border-inline-end: var(--ds-card-overview-divider);\n}\n\n.card-overview__score--resolved {\n min-inline-size: max-content;\n}\n\n/* The control-height box that aligns this label with the period text. */\n.card-overview__score-label-row {\n display: flex;\n align-items: center;\n min-height: var(--ds-control-height);\n}\n\n/*\n * The score is its own column, so its rows cannot baseline-align with the measure\n * rows through flex or grid — those only align items that share a line. These two\n * offsets pull the column onto the measure baselines instead.\n *\n * They are compensation for how much lower a display-scale figure sits in its line\n * box than the body text it aligns to, so they are coupled to the type pairing:\n * change the score or measure variants and both need re-measuring.\n */\n.card-overview__score-figure {\n display: flex;\n align-items: baseline;\n gap: var(--dimension-space-050);\n min-width: 0;\n margin-block-start: calc(-1 * (var(--dimension-space-150) + var(--dimension-space-012)));\n}\n\n.card-overview__score-value {\n flex: 0 0 auto;\n}\n\n/* Second half of the baseline compensation described above the score figure. */\n.card-overview__score-band {\n margin-block-start: calc(-1 * var(--dimension-space-025));\n}\n\n/*\n * A skeleton bar is a solid block, so in a baseline-aligned row it aligns on its\n * bottom edge while the text it stands in for aligns on its baseline. Next to a\n * display-scale figure that difference is the descent under the figure's\n * baseline, which drops the bar below where the resolved trend sits.\n *\n * The offset is applied with relative positioning rather than a margin: a margin\n * is not part of a synthesized baseline, so it grows the figure instead of moving\n * the bar, which then pushes the band below it out of place.\n *\n * Only needed beside the score figure; the measure rows pair body variants whose\n * bottom edge and baseline already agree.\n */\n.card-overview__skeleton-baseline {\n position: relative;\n inset-block-start: calc(-1 * var(--dimension-space-150));\n}\n\n.card-overview__score--error {\n flex-direction: row;\n align-items: center;\n gap: var(--dimension-space-050);\n color: var(--color-inverted-foreground-negative);\n}\n\n/* ── Body ─────────────────────────────────────────────────────────────────── */\n\n/*\n * Takes the remaining inline space. The minimum is what makes the host wrap: once\n * the score and roughly two measure columns no longer fit side by side, the body\n * drops below the score instead of squeezing it. `min()` keeps that from becoming\n * an overflow floor on very narrow viewports.\n */\n.card-overview__body {\n display: flex;\n grid-row: 2;\n grid-column: 1;\n flex-direction: column;\n min-width: 0;\n}\n\n.card-overview__body--has-score {\n grid-column: 2;\n}\n\n/*\n * One control row: 8px of padding on every side around a 32px md control, so the\n * bar is 8 + 32 + 8. Both ends of the bar are control-shaped boxes — the period\n * text on the left and the slotted control on the right — so the row reads\n * balanced rather than text on one side and a control on the other.\n */\n.card-overview__header {\n display: flex;\n grid-row: 1;\n grid-column: 1;\n align-items: center;\n gap: var(--dimension-space-100);\n min-width: 0;\n padding: var(--dimension-space-100);\n border-block-end: var(--ds-card-overview-divider);\n box-sizing: border-box;\n}\n\n.card-overview__header--has-score {\n grid-column: 2;\n}\n\n/*\n * Matches the control's box on the opposite end, including its inline padding, so\n * the text lands at the same optical inset the slotted control does:\n * 8 from the bar + 6 from this box + 2 from the label inset = 16.\n *\n * Nowrap keeps the row at the control height; the period truncates rather than\n * growing the bar to two lines.\n */\n.card-overview__period {\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n gap: var(--dimension-space-050);\n min-height: var(--ds-control-height);\n min-width: 0;\n padding-inline: var(--ds-control-padding-inline);\n overflow: hidden;\n white-space: nowrap;\n}\n\n/* The period control is slotted, so only reserve space for it. */\n.card-overview__filter {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n}\n\n/* ── Metrics ──────────────────────────────────────────────────────────────── */\n\n/*\n * `auto-fit` gives every occupied track an equal share while all metrics fit on\n * one row. Once wrapping creates another row, its cells stay on those same\n * tracks, so a partial final row leaves empty space instead of stretching one\n * measure wider than its peers.\n *\n * Dividers are painted outward from each cell and clipped by this grid. That\n * leaves only the lines between cells: anything emitted from the final column or\n * final row lands outside the grid and is clipped without needing to detect the\n * number of tracks.\n *\n * `flex: 1 1 auto` makes the grid absorb whatever height the body has\n * left, so cells reach the card bottom and their hover wash has no dead strip.\n */\n.card-overview__metrics {\n display: grid;\n flex: 1 1 auto;\n grid-template-columns: repeat(\n auto-fit,\n minmax(min(100%, var(--ds-card-overview-metric-min)), 1fr)\n );\n align-content: stretch;\n min-width: 0;\n overflow: clip;\n}\n\n/*\n * Square by design. Cells tile edge to edge against their dividers, so a radius\n * would break the seam; the card's own radius clips the outer corners instead.\n *\n * Padding is plain rather than control-derived: a cell is a block of content, not\n * a control box that has to optically match something on the far side.\n */\n.card-overview__metric {\n display: flex;\n position: relative;\n flex-direction: column;\n gap: var(--dimension-space-050);\n min-width: 0;\n padding: var(--dimension-space-175) var(--dimension-space-200);\n border-radius: 0;\n box-shadow:\n var(--ds-card-overview-divider-width) 0 0 0 var(--ds-card-overview-divider-color),\n 0 var(--ds-card-overview-divider-width) 0 0 var(--ds-card-overview-divider-color);\n}\n\n.card-overview__metric[role='button'] {\n cursor: default;\n -webkit-user-select: none;\n user-select: none;\n}\n\n.card-overview__metric-label {\n min-width: 0;\n}\n\n.card-overview__metric-figure {\n display: flex;\n align-items: baseline;\n gap: var(--dimension-space-100);\n min-width: 0;\n}\n\n/* ── Trend ────────────────────────────────────────────────────────────────── */\n\n/*\n * Tone arrives resolved from the caller: the arrow direction and the sentiment\n * are independent, so a falling metric can read positive or neutral. The arrow is\n * a glyph inside this text node, so it always matches the surrounding weight.\n */\n.card-overview__trend {\n flex: 0 0 auto;\n white-space: nowrap;\n}\n\n/* ── Narrow layout ────────────────────────────────────────────────────────── */\n\n/*\n * Below roughly two measure columns the card becomes a full stack. The summary\n * wrapper owns one block above the metrics: score label, figure, and trend stay\n * together at the start; the period control sits at the upper end; and the period\n * copy follows the score instead of becoming a separate divided row.\n */\n/*\n * Selectors are host-qualified purely for specificity: the compiled sheet places\n * these rules ahead of the base ones, so a plain class here would only ever add\n * properties and never override them.\n */\n@container (max-width: 480px) {\n :host .card-overview__layout {\n grid-template-rows: auto minmax(0, 1fr);\n grid-template-columns: minmax(0, 1fr);\n }\n\n :host .card-overview__summary {\n display: grid;\n grid-row: 1;\n grid-column: 1;\n grid-template-columns: minmax(0, 1fr) auto;\n grid-template-rows: auto;\n border-block-end: var(--ds-card-overview-divider);\n }\n\n :host .card-overview__score {\n display: grid;\n grid-row: 1;\n grid-column: 1;\n grid-template-rows: auto auto;\n grid-template-columns: auto auto;\n justify-content: start;\n column-gap: var(--dimension-space-100);\n width: auto;\n padding-block-end: var(--dimension-space-100);\n padding-inline-end: var(--dimension-space-100);\n border-inline-end: none;\n }\n\n :host .card-overview__score-label-row {\n grid-row: 1;\n grid-column: 1 / -1;\n min-height: var(--ds-control-height);\n }\n\n /*\n * The wide score uses optical offsets to meet the neighbouring metric\n * baselines. In the stacked summary those neighbours are gone, so natural\n * document flow keeps the label, figure, band, and period clearly ordered.\n */\n :host .card-overview__score-band,\n :host .card-overview__score-figure {\n grid-row: 2;\n margin-block-start: 0;\n }\n\n :host .card-overview__score-figure {\n grid-column: 1;\n align-self: baseline;\n gap: var(--dimension-space-100);\n }\n\n :host .card-overview__score-band {\n grid-column: 2;\n align-self: baseline;\n display: none;\n }\n\n :host .card-overview__header {\n display: grid;\n grid-row: 1;\n grid-column: 2;\n grid-template-rows: auto auto;\n align-content: start;\n gap: 0;\n padding: 0;\n border-block-end: none;\n }\n\n :host .card-overview__filter {\n grid-row: 1;\n grid-column: 1;\n align-self: start;\n justify-self: end;\n padding: var(--dimension-space-100) var(--dimension-space-100) 0 0;\n }\n\n :host .card-overview__period {\n grid-row: 2;\n grid-column: 1;\n flex-direction: column;\n align-items: flex-end;\n justify-self: stretch;\n gap: 0;\n min-height: 0;\n padding-block: var(--dimension-space-150) var(--dimension-space-100);\n padding-inline: var(--dimension-space-100) var(--dimension-space-200);\n overflow: visible;\n text-align: end;\n white-space: nowrap;\n }\n\n :host .card-overview__body {\n grid-row: 2;\n grid-column: 1;\n }\n}\n\n/*\n * Page shells may enter a responsive mode before this card itself becomes\n * narrow. The explicit stacked layout applies the same composition without\n * coupling CardOverview to a viewport breakpoint.\n */\n:host(.card-overview--stacked) .card-overview__layout {\n grid-template-rows: auto minmax(0, 1fr);\n grid-template-columns: minmax(0, 1fr);\n}\n\n:host(.card-overview--stacked) .card-overview__summary {\n display: grid;\n grid-row: 1;\n grid-column: 1;\n grid-template-columns: minmax(0, 1fr) auto;\n grid-template-rows: auto;\n border-block-end: var(--ds-card-overview-divider);\n}\n\n:host(.card-overview--stacked) .card-overview__score {\n display: grid;\n grid-row: 1;\n grid-column: 1;\n grid-template-rows: auto auto;\n grid-template-columns: auto auto;\n justify-content: start;\n column-gap: var(--dimension-space-100);\n width: auto;\n padding-block-end: var(--dimension-space-100);\n padding-inline-end: var(--dimension-space-100);\n border-inline-end: none;\n}\n\n:host(.card-overview--stacked) .card-overview__score-label-row {\n grid-row: 1;\n grid-column: 1 / -1;\n min-height: var(--ds-control-height);\n}\n\n:host(.card-overview--stacked) .card-overview__score-band,\n:host(.card-overview--stacked) .card-overview__score-figure {\n grid-row: 2;\n margin-block-start: 0;\n}\n\n:host(.card-overview--stacked) .card-overview__score-figure {\n grid-column: 1;\n align-self: baseline;\n gap: var(--dimension-space-100);\n}\n\n:host(.card-overview--stacked) .card-overview__score-band {\n grid-column: 2;\n align-self: baseline;\n display: none;\n}\n\n:host(.card-overview--stacked) .card-overview__header {\n display: grid;\n grid-row: 1;\n grid-column: 2;\n grid-template-rows: auto auto;\n align-content: start;\n gap: 0;\n padding: 0;\n border-block-end: none;\n}\n\n:host(.card-overview--stacked) .card-overview__filter {\n grid-row: 1;\n grid-column: 1;\n align-self: start;\n justify-self: end;\n padding: var(--dimension-space-100) var(--dimension-space-100) 0 0;\n}\n\n:host(.card-overview--stacked) .card-overview__period {\n grid-row: 2;\n grid-column: 1;\n flex-direction: column;\n align-items: flex-end;\n justify-self: stretch;\n gap: 0;\n min-height: 0;\n padding-block: var(--dimension-space-150) var(--dimension-space-100);\n padding-inline: var(--dimension-space-100) var(--dimension-space-200);\n overflow: visible;\n text-align: end;\n white-space: nowrap;\n}\n\n:host(.card-overview--stacked) .card-overview__body {\n grid-row: 2;\n grid-column: 1;\n}\n\n:host(.card-overview--stacked) .card-overview__metrics {\n grid-template-columns: minmax(0, 1fr);\n}\n\n/* ── Compact presentation ───────────────────────────────────────────────── */\n\n/*\n * Matches the shared 48px bar contract: one 32px control row with 8px above\n * and below. The score remains a distinct leading cell, while reporting copy\n * absorbs the available width and the application-owned control never shrinks.\n */\n:host(.card-overview--compact) {\n height: var(--dimension-size-600);\n min-height: var(--dimension-size-600);\n}\n\n:host(.card-overview--compact) .card-overview__surface {\n height: 100%;\n}\n\n:host(.card-overview--compact) .card-overview__layout,\n:host(.card-overview--compact) .card-overview__summary {\n display: flex;\n width: 100%;\n height: 100%;\n min-width: 0;\n}\n\n:host(.card-overview--compact) .card-overview__score {\n display: flex;\n flex: 0 0 auto;\n flex-direction: row;\n align-items: center;\n gap: var(--dimension-space-100);\n width: auto;\n height: 100%;\n min-width: 0;\n padding: var(--dimension-space-100) var(--dimension-space-200);\n border-inline-end: var(--ds-card-overview-divider);\n box-sizing: border-box;\n}\n\n:host(.card-overview--compact) .card-overview__score-label-row {\n display: contents;\n min-height: 0;\n}\n\n:host(.card-overview--compact) .card-overview__score-label,\n:host(.card-overview--compact) .card-overview__score-figure,\n:host(.card-overview--compact) .card-overview__trend {\n flex: 0 0 auto;\n}\n\n:host(.card-overview--compact) .card-overview__score-figure {\n display: flex;\n align-self: center;\n align-items: baseline;\n gap: var(--dimension-space-050);\n margin-block-start: 0;\n}\n\n:host(.card-overview--compact) .card-overview__score-band {\n display: none;\n}\n\n:host(.card-overview--compact) .card-overview__header {\n display: flex;\n flex: 1 1 auto;\n grid-row: auto;\n grid-column: auto;\n align-items: center;\n gap: var(--dimension-space-100);\n height: 100%;\n min-width: 0;\n padding: var(--dimension-space-100);\n border-block-end: none;\n box-sizing: border-box;\n}\n\n:host(.card-overview--compact) .card-overview__period {\n display: flex;\n flex: 1 1 auto;\n flex-direction: row;\n align-items: center;\n gap: var(--dimension-space-050);\n min-width: 0;\n min-height: var(--ds-control-height);\n padding-inline: var(--ds-control-padding-inline);\n overflow: hidden;\n text-align: start;\n white-space: nowrap;\n}\n\n:host(.card-overview--compact) .card-overview__period-current,\n:host(.card-overview--compact) .card-overview__period-comparison {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n:host(.card-overview--compact) .card-overview__period-current {\n flex: 0 1 auto;\n}\n\n:host(.card-overview--compact) .card-overview__period-comparison {\n flex: 1 1 auto;\n}\n\n:host(.card-overview--compact) .card-overview__filter {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n padding: 0;\n}\n",
|
|
369
|
+
"content": "@import '../../utils/interaction-fill.css';\n@import '../../utils/focus-ring.css';\n@import '../../utils/control-density.css';\n@import '../../utils/control-parts.css';\n@import '../../styles/control-elevation.css';\n\n/* The summary bar follows the always-dark sub-theme. */\n\n:host {\n display: block;\n box-sizing: border-box;\n /* Drives the narrow layout below from the card's own width, not the viewport's. */\n container-type: inline-size;\n /* A summary is read, not copied; stray selection while clicking cells is noise. */\n -webkit-user-select: none;\n user-select: none;\n /* Width a metric may shrink to before the grid drops a column. */\n --ds-card-overview-metric-min: calc(var(--dimension-size-400) * 5);\n --ds-card-overview-divider-width: var(--dimension-stroke-width-012);\n --ds-card-overview-divider-color: var(--color-always-dark-border-tertiary);\n --ds-card-overview-divider: var(--ds-card-overview-divider-width) solid\n var(--ds-card-overview-divider-color);\n color: var(--color-always-dark-foreground-primary);\n}\n\n.card-overview__surface {\n width: 100%;\n min-width: 0;\n box-sizing: border-box;\n border-radius: var(--dimension-radius-050);\n background: var(--color-always-dark-background);\n color: var(--color-always-dark-foreground-primary);\n overflow-anchor: none;\n}\n\n/*\n * The visual surface owns elevation outside this clipping viewport. Keeping\n * those layers separate lets a page shrink the surface while content moves and\n * clips inside it without cutting off the shadow or inset highlight.\n */\n.card-overview__clip {\n height: 100%;\n min-width: 0;\n border-radius: inherit;\n background: inherit;\n overflow: hidden;\n}\n\n:host(.card-overview--scroll-collapsing) {\n height: var(--ds-card-overview-expanded-height);\n pointer-events: none;\n}\n\n:host(.card-overview--scroll-collapsing) .card-overview__surface {\n height: var(--ds-card-overview-visible-height);\n pointer-events: auto;\n will-change: height;\n}\n\n:host(.card-overview--scroll-collapsing) .card-overview__layout {\n transform: translateY(calc(-1 * var(--ds-card-overview-content-offset)));\n will-change: transform;\n}\n\n.card-overview__layout {\n display: grid;\n grid-template-rows: auto minmax(0, 1fr);\n grid-template-columns: minmax(0, 1fr);\n align-items: stretch;\n min-width: 0;\n}\n\n.card-overview__layout--has-score {\n grid-template-columns: auto minmax(0, 1fr);\n}\n\n/*\n * Transparent at regular widths so the score and header participate in the\n * inner layout grid directly. At the narrow breakpoint it becomes the unified\n * summary block above the metrics.\n */\n.card-overview__summary {\n display: contents;\n}\n\n/* ── Score ────────────────────────────────────────────────────────────────── */\n\n/*\n * Hugs its content and never shrinks, so the headline figure keeps its size and\n * the metric grid absorbs the remaining width.\n */\n/*\n * Top aligned rather than centred, and padded to match the header, so the score\n * label sits in the same 32px box at the same offset as the period text beside\n * it. Both use the same type variant, so their baselines land together.\n */\n.card-overview__score {\n display: flex;\n grid-row: 1 / span 2;\n grid-column: 1;\n flex: 0 0 auto;\n flex-direction: column;\n gap: 0;\n min-width: 0;\n padding: var(--dimension-space-100) var(--dimension-space-200);\n border-inline-end: var(--ds-card-overview-divider);\n}\n\n.card-overview__score--resolved {\n min-inline-size: max-content;\n}\n\n/* The control-height box that aligns this label with the period text. */\n.card-overview__score-label-row {\n display: flex;\n align-items: center;\n min-height: var(--ds-control-height);\n}\n\n/*\n * The score is its own column, so its rows cannot baseline-align with the measure\n * rows through flex or grid — those only align items that share a line. These two\n * offsets pull the column onto the measure baselines instead.\n *\n * They are compensation for how much lower a display-scale figure sits in its line\n * box than the body text it aligns to, so they are coupled to the type pairing:\n * change the score or measure variants and both need re-measuring.\n */\n.card-overview__score-figure {\n display: flex;\n align-items: baseline;\n gap: var(--dimension-space-050);\n min-width: 0;\n margin-block-start: calc(-1 * (var(--dimension-space-150) + var(--dimension-space-012)));\n}\n\n.card-overview__score-value {\n flex: 0 0 auto;\n}\n\n/* Second half of the baseline compensation described above the score figure. */\n.card-overview__score-band {\n margin-block-start: calc(-1 * var(--dimension-space-025));\n}\n\n/*\n * A skeleton bar is a solid block, so in a baseline-aligned row it aligns on its\n * bottom edge while the text it stands in for aligns on its baseline. Next to a\n * display-scale figure that difference is the descent under the figure's\n * baseline, which drops the bar below where the resolved trend sits.\n *\n * The offset is applied with relative positioning rather than a margin: a margin\n * is not part of a synthesized baseline, so it grows the figure instead of moving\n * the bar, which then pushes the band below it out of place.\n *\n * Only needed beside the score figure; the measure rows pair body variants whose\n * bottom edge and baseline already agree.\n */\n.card-overview__skeleton-baseline {\n position: relative;\n inset-block-start: calc(-1 * var(--dimension-space-150));\n}\n\n.card-overview__score--error {\n flex-direction: row;\n align-items: center;\n gap: var(--dimension-space-050);\n color: var(--color-always-dark-foreground-negative);\n}\n\n/* ── Body ─────────────────────────────────────────────────────────────────── */\n\n/*\n * Takes the remaining inline space. The minimum is what makes the host wrap: once\n * the score and roughly two measure columns no longer fit side by side, the body\n * drops below the score instead of squeezing it. `min()` keeps that from becoming\n * an overflow floor on very narrow viewports.\n */\n.card-overview__body {\n display: flex;\n grid-row: 2;\n grid-column: 1;\n flex-direction: column;\n min-width: 0;\n}\n\n.card-overview__body--has-score {\n grid-column: 2;\n}\n\n/*\n * One control row: 8px of padding on every side around a 32px md control, so the\n * bar is 8 + 32 + 8. Both ends of the bar are control-shaped boxes — the period\n * text on the left and the slotted control on the right — so the row reads\n * balanced rather than text on one side and a control on the other.\n */\n.card-overview__header {\n display: flex;\n grid-row: 1;\n grid-column: 1;\n align-items: center;\n gap: var(--dimension-space-100);\n min-width: 0;\n padding: var(--dimension-space-100);\n border-block-end: var(--ds-card-overview-divider);\n box-sizing: border-box;\n}\n\n.card-overview__header--has-score {\n grid-column: 2;\n}\n\n/*\n * Matches the control's box on the opposite end, including its inline padding, so\n * the text lands at the same optical inset the slotted control does:\n * 8 from the bar + 6 from this box + 2 from the label inset = 16.\n *\n * Nowrap keeps the row at the control height; the period truncates rather than\n * growing the bar to two lines.\n */\n.card-overview__period {\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n gap: var(--dimension-space-050);\n min-height: var(--ds-control-height);\n min-width: 0;\n padding-inline: var(--ds-control-padding-inline);\n overflow: hidden;\n white-space: nowrap;\n}\n\n/* The period control is slotted, so only reserve space for it. */\n.card-overview__filter {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n}\n\n/* ── Metrics ──────────────────────────────────────────────────────────────── */\n\n/*\n * `auto-fit` gives every occupied track an equal share while all metrics fit on\n * one row. Once wrapping creates another row, its cells stay on those same\n * tracks, so a partial final row leaves empty space instead of stretching one\n * measure wider than its peers.\n *\n * Dividers are painted outward from each cell and clipped by this grid. That\n * leaves only the lines between cells: anything emitted from the final column or\n * final row lands outside the grid and is clipped without needing to detect the\n * number of tracks.\n *\n * `flex: 1 1 auto` makes the grid absorb whatever height the body has\n * left, so cells reach the card bottom and their hover wash has no dead strip.\n */\n.card-overview__metrics {\n display: grid;\n flex: 1 1 auto;\n grid-template-columns: repeat(\n auto-fit,\n minmax(min(100%, var(--ds-card-overview-metric-min)), 1fr)\n );\n align-content: stretch;\n min-width: 0;\n overflow: clip;\n}\n\n/*\n * Square by design. Cells tile edge to edge against their dividers, so a radius\n * would break the seam; the card's own radius clips the outer corners instead.\n *\n * Padding is plain rather than control-derived: a cell is a block of content, not\n * a control box that has to optically match something on the far side.\n */\n.card-overview__metric {\n display: flex;\n position: relative;\n flex-direction: column;\n gap: var(--dimension-space-050);\n min-width: 0;\n padding: var(--dimension-space-175) var(--dimension-space-200);\n border-radius: 0;\n box-shadow:\n var(--ds-card-overview-divider-width) 0 0 0 var(--ds-card-overview-divider-color),\n 0 var(--ds-card-overview-divider-width) 0 0 var(--ds-card-overview-divider-color);\n}\n\n.card-overview__metric[role='button'] {\n cursor: default;\n -webkit-user-select: none;\n user-select: none;\n}\n\n.card-overview__metric-label {\n min-width: 0;\n}\n\n.card-overview__metric-figure {\n display: flex;\n align-items: baseline;\n gap: var(--dimension-space-100);\n min-width: 0;\n}\n\n/* ── Trend ────────────────────────────────────────────────────────────────── */\n\n/*\n * Tone arrives resolved from the caller: the arrow direction and the sentiment\n * are independent, so a falling metric can read positive or neutral. The arrow is\n * a glyph inside this text node, so it always matches the surrounding weight.\n */\n.card-overview__trend {\n flex: 0 0 auto;\n white-space: nowrap;\n}\n\n/* ── Narrow layout ────────────────────────────────────────────────────────── */\n\n/*\n * Below roughly two measure columns the card becomes a full stack. The summary\n * wrapper owns one block above the metrics: score label, figure, and trend stay\n * together at the start; the period control sits at the upper end; and the period\n * copy follows the score instead of becoming a separate divided row.\n */\n/*\n * Selectors are host-qualified purely for specificity: the compiled sheet places\n * these rules ahead of the base ones, so a plain class here would only ever add\n * properties and never override them.\n */\n@container (max-width: 480px) {\n :host .card-overview__layout {\n grid-template-rows: auto minmax(0, 1fr);\n grid-template-columns: minmax(0, 1fr);\n }\n\n :host .card-overview__summary {\n display: grid;\n grid-row: 1;\n grid-column: 1;\n grid-template-columns: minmax(0, 1fr) auto;\n grid-template-rows: auto;\n border-block-end: var(--ds-card-overview-divider);\n }\n\n :host .card-overview__score {\n display: grid;\n grid-row: 1;\n grid-column: 1;\n grid-template-rows: auto auto;\n grid-template-columns: auto auto;\n justify-content: start;\n column-gap: var(--dimension-space-100);\n width: auto;\n padding-block-end: var(--dimension-space-100);\n padding-inline-end: var(--dimension-space-100);\n border-inline-end: none;\n }\n\n :host .card-overview__score-label-row {\n grid-row: 1;\n grid-column: 1 / -1;\n min-height: var(--ds-control-height);\n }\n\n /*\n * The wide score uses optical offsets to meet the neighbouring metric\n * baselines. In the stacked summary those neighbours are gone, so natural\n * document flow keeps the label, figure, band, and period clearly ordered.\n */\n :host .card-overview__score-band,\n :host .card-overview__score-figure {\n grid-row: 2;\n margin-block-start: 0;\n }\n\n :host .card-overview__score-figure {\n grid-column: 1;\n align-self: baseline;\n gap: var(--dimension-space-100);\n }\n\n :host .card-overview__score-band {\n grid-column: 2;\n align-self: baseline;\n display: none;\n }\n\n :host .card-overview__header {\n display: grid;\n grid-row: 1;\n grid-column: 2;\n grid-template-rows: auto auto;\n align-content: start;\n gap: 0;\n padding: 0;\n border-block-end: none;\n }\n\n :host .card-overview__filter {\n grid-row: 1;\n grid-column: 1;\n align-self: start;\n justify-self: end;\n padding: var(--dimension-space-100) var(--dimension-space-100) 0 0;\n }\n\n :host .card-overview__period {\n grid-row: 2;\n grid-column: 1;\n flex-direction: column;\n align-items: flex-end;\n justify-self: stretch;\n gap: 0;\n min-height: 0;\n padding-block: var(--dimension-space-150) var(--dimension-space-100);\n padding-inline: var(--dimension-space-100) var(--dimension-space-200);\n overflow: visible;\n text-align: end;\n white-space: nowrap;\n }\n\n :host .card-overview__body {\n grid-row: 2;\n grid-column: 1;\n }\n}\n\n/*\n * Page shells may enter a responsive mode before this card itself becomes\n * narrow. The explicit stacked layout applies the same composition without\n * coupling CardOverview to a viewport breakpoint.\n */\n:host(.card-overview--stacked) .card-overview__layout {\n grid-template-rows: auto minmax(0, 1fr);\n grid-template-columns: minmax(0, 1fr);\n}\n\n:host(.card-overview--stacked) .card-overview__summary {\n display: grid;\n grid-row: 1;\n grid-column: 1;\n grid-template-columns: minmax(0, 1fr) auto;\n grid-template-rows: auto;\n border-block-end: var(--ds-card-overview-divider);\n}\n\n:host(.card-overview--stacked) .card-overview__score {\n display: grid;\n grid-row: 1;\n grid-column: 1;\n grid-template-rows: auto auto;\n grid-template-columns: auto auto;\n justify-content: start;\n column-gap: var(--dimension-space-100);\n width: auto;\n padding-block-end: var(--dimension-space-100);\n padding-inline-end: var(--dimension-space-100);\n border-inline-end: none;\n}\n\n:host(.card-overview--stacked) .card-overview__score-label-row {\n grid-row: 1;\n grid-column: 1 / -1;\n min-height: var(--ds-control-height);\n}\n\n:host(.card-overview--stacked) .card-overview__score-band,\n:host(.card-overview--stacked) .card-overview__score-figure {\n grid-row: 2;\n margin-block-start: 0;\n}\n\n:host(.card-overview--stacked) .card-overview__score-figure {\n grid-column: 1;\n align-self: baseline;\n gap: var(--dimension-space-100);\n}\n\n:host(.card-overview--stacked) .card-overview__score-band {\n grid-column: 2;\n align-self: baseline;\n display: none;\n}\n\n:host(.card-overview--stacked) .card-overview__header {\n display: grid;\n grid-row: 1;\n grid-column: 2;\n grid-template-rows: auto auto;\n align-content: start;\n gap: 0;\n padding: 0;\n border-block-end: none;\n}\n\n:host(.card-overview--stacked) .card-overview__filter {\n grid-row: 1;\n grid-column: 1;\n align-self: start;\n justify-self: end;\n padding: var(--dimension-space-100) var(--dimension-space-100) 0 0;\n}\n\n:host(.card-overview--stacked) .card-overview__period {\n grid-row: 2;\n grid-column: 1;\n flex-direction: column;\n align-items: flex-end;\n justify-self: stretch;\n gap: 0;\n min-height: 0;\n padding-block: var(--dimension-space-150) var(--dimension-space-100);\n padding-inline: var(--dimension-space-100) var(--dimension-space-200);\n overflow: visible;\n text-align: end;\n white-space: nowrap;\n}\n\n:host(.card-overview--stacked) .card-overview__body {\n grid-row: 2;\n grid-column: 1;\n}\n\n:host(.card-overview--stacked) .card-overview__metrics {\n grid-template-columns: minmax(0, 1fr);\n}\n\n/* ── Compact presentation ───────────────────────────────────────────────── */\n\n/*\n * Matches the shared 48px bar contract: one 32px control row with 8px above\n * and below. The score remains a distinct leading cell, while reporting copy\n * absorbs the available width and the application-owned control never shrinks.\n */\n:host(.card-overview--compact) {\n height: var(--dimension-size-600);\n min-height: var(--dimension-size-600);\n}\n\n:host(.card-overview--compact) .card-overview__surface {\n height: 100%;\n}\n\n:host(.card-overview--compact) .card-overview__layout,\n:host(.card-overview--compact) .card-overview__summary {\n display: flex;\n width: 100%;\n height: 100%;\n min-width: 0;\n}\n\n:host(.card-overview--compact) .card-overview__score {\n display: flex;\n flex: 0 0 auto;\n flex-direction: row;\n align-items: center;\n gap: var(--dimension-space-100);\n width: auto;\n height: 100%;\n min-width: 0;\n padding: var(--dimension-space-100) var(--dimension-space-200);\n border-inline-end: var(--ds-card-overview-divider);\n box-sizing: border-box;\n}\n\n:host(.card-overview--compact) .card-overview__score-label-row {\n display: contents;\n min-height: 0;\n}\n\n:host(.card-overview--compact) .card-overview__score-label,\n:host(.card-overview--compact) .card-overview__score-figure,\n:host(.card-overview--compact) .card-overview__trend {\n flex: 0 0 auto;\n}\n\n:host(.card-overview--compact) .card-overview__score-figure {\n display: flex;\n align-self: center;\n align-items: baseline;\n gap: var(--dimension-space-050);\n margin-block-start: 0;\n}\n\n:host(.card-overview--compact) .card-overview__score-band {\n display: none;\n}\n\n:host(.card-overview--compact) .card-overview__header {\n display: flex;\n flex: 1 1 auto;\n grid-row: auto;\n grid-column: auto;\n align-items: center;\n gap: var(--dimension-space-100);\n height: 100%;\n min-width: 0;\n padding: var(--dimension-space-100);\n border-block-end: none;\n box-sizing: border-box;\n}\n\n:host(.card-overview--compact) .card-overview__period {\n display: flex;\n flex: 1 1 auto;\n flex-direction: row;\n align-items: center;\n gap: var(--dimension-space-050);\n min-width: 0;\n min-height: var(--ds-control-height);\n padding-inline: var(--ds-control-padding-inline);\n overflow: hidden;\n text-align: start;\n white-space: nowrap;\n}\n\n:host(.card-overview--compact) .card-overview__period-current,\n:host(.card-overview--compact) .card-overview__period-comparison {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n:host(.card-overview--compact) .card-overview__period-current {\n flex: 0 1 auto;\n}\n\n:host(.card-overview--compact) .card-overview__period-comparison {\n flex: 1 1 auto;\n}\n\n:host(.card-overview--compact) .card-overview__filter {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n padding: 0;\n}\n",
|
|
370
370
|
"type": "registry:ui"
|
|
371
371
|
},
|
|
372
372
|
{
|
|
373
373
|
"path": "src/wc/components/CardOverview/CardOverview.tsx",
|
|
374
|
-
"content": "import { Component, Element, Event, EventEmitter, h, Host, Prop, State } from '@stencil/core';\nimport { resolveCssLengthPx, TOKEN_DEFAULTS } from '../../utils';\nimport type { TextColor, TextVariant } from '../Text/text-types';\nimport type { MetricTrend } from '../../utils/metric-change';\nimport type {\n CardOverviewLayout,\n CardOverviewVariant,\n OverviewMetric,\n OverviewScore,\n} from './card-overview-types';\nimport {\n findNextOverviewMetricIndex,\n resolveCardOverviewCollapseGeometry,\n resolveOverviewRovingIndex,\n} from './card-overview-controller';\n\n/** Metric cells below this width drop a grid column rather than compress further. */\nconst DEFAULT_METRIC_MIN_WIDTH = 'var(--dimension-menu-width-xs)';\n\n/** Skeleton cells rendered while loading with no metrics supplied yet. */\nconst LOADING_PLACEHOLDER_COUNT = 4;\n\n/** Maximum number of comparable measures the summary bar presents at once. */\nconst MAX_METRIC_COUNT = 6;\n\nconst TREND_COLORS: Record<MetricTrend['tone'], TextColor> = {\n positive: 'var(--color-inverted-foreground-positive)',\n negative: 'var(--color-inverted-foreground-negative)',\n neutral: 'var(--color-inverted-foreground-secondary)',\n};\n\nconst INVERTED_PRIMARY: TextColor = 'var(--color-inverted-foreground-primary)';\nconst INVERTED_SECONDARY: TextColor = 'var(--color-inverted-foreground-secondary)';\n\n@Component({\n tag: 'ds-card-overview',\n styleUrl: 'CardOverview.css',\n scoped: true,\n})\nexport class CardOverview {\n @Element() el!: HTMLElement;\n\n /** Full summary card, or the condensed 48px summary bar. */\n @Prop() variant: CardOverviewVariant = 'default';\n\n /** Intrinsic responsive layout, or a page-owned single-column stack. */\n @Prop() layout: CardOverviewLayout = 'auto';\n\n /** Leading summary block. Omit to render the bar without a headline figure. */\n @Prop() score: OverviewScore | undefined;\n\n /** Current reporting period, for example `Jun 29, 2026 – Jul 26, 2026`. */\n @Prop() periodLabel: string = '';\n\n /** Comparison caption, for example `vs Previous period`. */\n @Prop() comparisonLabel: string = '';\n\n /** Measures rendered in the responsive grid. Only the first six are shown. */\n @Prop() metrics: OverviewMetric[] = [];\n\n /**\n * Width a metric cell may shrink to before the grid drops a column. The grid\n * reflows and then stacks from this alone, so no measurement is required.\n */\n @Prop() metricMinWidth: string = DEFAULT_METRIC_MIN_WIDTH;\n\n /** Replace the score and metrics with skeletons while data resolves. */\n @Prop() isLoading: boolean = false;\n\n /** Message shown in place of the score when its figure cannot be resolved. */\n @Prop() scoreErrorMessage: string | undefined;\n\n /** Accessible name for the region. */\n @Prop() overviewLabel: string = 'Overview';\n\n /**\n * Page-controlled visual collapse from the full card (`0`) toward its 48px\n * compact handoff height (`1`). The component preserves its expanded flow\n * height, keeps elevation on the shrinking surface, and clips translated\n * content internally. The page still owns sticky positioning and the final\n * swap to `variant=\"compact\"`.\n */\n @Prop() scrollCollapseProgress: number = 0;\n\n /** Emitted when a metric that is not inactive is activated. */\n @Event() dsMetricSelect!: EventEmitter<OverviewMetric>;\n\n /** Roving tab stop across selectable metrics. */\n @State() private focusedMetricIndex: number = 0;\n @State() private expandedHeight: number = 0;\n\n private layoutEl?: HTMLElement;\n private layoutResizeObserver: ResizeObserver | null = null;\n\n componentDidLoad() {\n this.observeLayout();\n }\n\n componentDidRender() {\n // Re-bind after HMR when DidLoad's observer was dropped.\n if (!this.layoutResizeObserver) this.observeLayout();\n }\n\n disconnectedCallback() {\n this.layoutResizeObserver?.disconnect();\n this.layoutResizeObserver = null;\n }\n\n private get hasScore(): boolean {\n return this.score !== undefined || this.scoreErrorMessage !== undefined || this.isLoading;\n }\n\n private get visibleMetrics(): OverviewMetric[] {\n return this.metrics.slice(0, MAX_METRIC_COUNT);\n }\n\n private get resolvedScrollCollapseProgress(): number {\n if (this.variant === 'compact' || !Number.isFinite(this.scrollCollapseProgress)) return 0;\n return Math.min(1, Math.max(0, this.scrollCollapseProgress));\n }\n\n private get scrollCollapseGeometry() {\n const compactHeight = resolveCssLengthPx(TOKEN_DEFAULTS.size600, 48);\n return resolveCardOverviewCollapseGeometry({\n variant: this.variant,\n progress: this.resolvedScrollCollapseProgress,\n expandedHeight: this.expandedHeight,\n compactHeight,\n });\n }\n\n private observeLayout() {\n const layout = this.layoutEl;\n if (!layout) return;\n\n const updateHeight = (height: number) => {\n if (height > 0 && Math.abs(height - this.expandedHeight) >= 0.5) {\n this.expandedHeight = height;\n }\n };\n\n updateHeight(layout.getBoundingClientRect().height);\n if (typeof ResizeObserver === 'undefined') return;\n\n this.layoutResizeObserver?.disconnect();\n this.layoutResizeObserver = new ResizeObserver(entries => {\n const height = entries[0]?.contentRect.height;\n if (height !== undefined) updateHeight(height);\n });\n this.layoutResizeObserver.observe(layout);\n }\n\n /** Index of the roving tab stop, skipping inactive metrics. */\n private get rovingIndex(): number {\n return resolveOverviewRovingIndex(this.visibleMetrics, this.focusedMetricIndex);\n }\n\n private selectMetric(metric: OverviewMetric, index: number) {\n if (metric.isInactive) return;\n this.focusedMetricIndex = index;\n this.dsMetricSelect.emit(metric);\n }\n\n /** Move the roving tab stop, wrapping and skipping inactive metrics. */\n private moveFocus(from: number, step: number) {\n const metrics = this.visibleMetrics;\n const next = findNextOverviewMetricIndex(metrics, from, step < 0 ? -1 : 1);\n if (next < 0) return;\n\n this.focusedMetricIndex = next;\n const cells = this.el.querySelectorAll<HTMLElement>('.card-overview__metric');\n cells[next]?.focus();\n }\n\n private handleMetricKeyDown = (event: KeyboardEvent, index: number) => {\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n event.preventDefault();\n this.moveFocus(index, 1);\n break;\n case 'ArrowLeft':\n case 'ArrowUp':\n event.preventDefault();\n this.moveFocus(index, -1);\n break;\n default:\n break;\n }\n };\n\n /**\n * A skeleton bar matching the type metrics of the text it stands in for, so the\n * loading state holds the same shape and rhythm as the resolved content.\n *\n * `background` is always passed so the base and shimmer follow the card's\n * inverted surface in both themes.\n */\n private bar(textVariant: TextVariant, width: string, className?: string) {\n return (\n <ds-skeleton\n class={className}\n variant=\"text\"\n textVariant={textVariant}\n width={width}\n background=\"inverted\"\n />\n );\n }\n\n /**\n * Arrow and change in one text node.\n *\n * The arrow is a typeface glyph rather than an icon so it inherits the exact\n * size, weight, and baseline of the value beside it; an icon would need its\n * own size scale and would drift whenever the type scale changed.\n *\n * Tone is supplied by the caller and never inferred here.\n */\n private renderTrend(trend: MetricTrend | undefined, variant: TextVariant, emphasis = false) {\n if (!trend) return null;\n return (\n <ds-text\n as=\"span\"\n class={{\n 'card-overview__trend': true,\n [`card-overview__trend--${trend.tone}`]: true,\n }}\n variant={variant}\n emphasis={emphasis}\n color={TREND_COLORS[trend.tone]}\n fontFeature=\"tabular-nums\"\n >\n {trend.direction === 'up' ? '↑' : '↓'} {trend.value}\n </ds-text>\n );\n }\n\n private renderScore(compact: boolean) {\n if (this.isLoading) {\n if (compact) {\n return (\n <div class=\"card-overview__score ds-control--md\" part=\"score\">\n {this.bar('text-body-medium', '40px', 'card-overview__score-label')}\n <div class=\"card-overview__score-figure\">\n {this.bar('text-body-medium', '24px')}\n {this.bar('text-body-medium', '32px')}\n </div>\n </div>\n );\n }\n\n return (\n <div class=\"card-overview__score ds-control--md\" part=\"score\">\n {/*\n * The label row is kept but left empty. It carries the control-height\n * box that aligns the score block with the period control, so dropping\n * it would shift the whole block up; a bar inside it would collide with\n * the figure, which sits under the label by design.\n */}\n <div class=\"card-overview__score-label-row\" />\n <div class=\"card-overview__score-figure\">\n {this.bar('text-display-medium', '56px')}\n {this.bar('text-body-small', '24px', 'card-overview__skeleton-baseline')}\n </div>\n {/*\n * Class goes on the skeleton itself, matching the resolved band. In a\n * wrapper the bar picks up inline leading and drops below the resolved\n * band position.\n */}\n {this.bar(\n 'text-caption',\n '80px',\n 'card-overview__score-band card-overview__score-band--loading'\n )}\n </div>\n );\n }\n\n if (this.scoreErrorMessage) {\n return (\n <div class=\"card-overview__score card-overview__score--error\" part=\"score\" role=\"alert\">\n <ds-icon name=\"CircleExclamation\" size=\"sm\" color=\"inherit\" aria-hidden=\"true\" />\n <ds-text as=\"span\" variant=\"text-body-medium\" color=\"inherit\">\n {this.scoreErrorMessage}\n </ds-text>\n </div>\n );\n }\n\n const score = this.score;\n if (!score) return null;\n\n return (\n <div class=\"card-overview__score card-overview__score--resolved ds-control--md\" part=\"score\">\n {/* The row owns cross-layout baseline geometry and becomes display: contents in compact mode. */}\n {/* eslint-disable-next-line local/prefer-direct-ds-text */}\n <div class=\"card-overview__score-label-row\">\n <ds-text\n as=\"span\"\n class=\"card-overview__score-label\"\n variant=\"text-body-medium\"\n emphasis={!compact}\n color={INVERTED_SECONDARY}\n >\n {score.label}\n </ds-text>\n </div>\n <div class=\"card-overview__score-figure\">\n <ds-text\n as=\"span\"\n class=\"card-overview__score-value\"\n variant={compact ? 'text-body-medium' : 'text-display-medium'}\n emphasis\n color={INVERTED_PRIMARY}\n fontFeature=\"tabular-nums\"\n >\n {score.value}\n </ds-text>\n {this.renderTrend(\n score.trend,\n compact ? 'text-body-medium' : 'text-body-small',\n !compact\n )}\n </div>\n {score.band && !compact && (\n <ds-text\n as=\"span\"\n class=\"card-overview__score-band\"\n variant=\"text-caption\"\n color={INVERTED_SECONDARY}\n >\n {score.band}\n </ds-text>\n )}\n </div>\n );\n }\n\n private renderMetric(metric: OverviewMetric, index: number) {\n const selectable = !metric.isInactive;\n const label = (\n <ds-text\n as=\"span\"\n class=\"card-overview__metric-label\"\n variant=\"text-body-small\"\n color={INVERTED_SECONDARY}\n >\n {metric.label}\n </ds-text>\n );\n\n return (\n <div\n class={{\n 'card-overview__metric': true,\n 'card-overview__metric--inactive': !selectable,\n // Selection targets get the shared wash; press scaling is not used here\n // so the grid keeps its columns aligned. See docs/control-press-policy.md.\n 'ds-interaction-fill': selectable,\n 'ds-interaction-fill--on-inverted': selectable,\n 'ds-focus-ring-inset': selectable,\n }}\n part=\"metric\"\n role={selectable ? 'button' : undefined}\n tabIndex={selectable && index === this.rovingIndex ? 0 : -1}\n onClick={() => this.selectMetric(metric, index)}\n onKeyDown={event => this.handleMetricKeyDown(event, index)}\n onFocusin={() => {\n if (selectable) this.focusedMetricIndex = index;\n }}\n >\n {metric.labelTooltip ? (\n <ds-tooltip label={metric.labelTooltip} side=\"top\" size=\"sm\">\n {label}\n </ds-tooltip>\n ) : (\n label\n )}\n <div class=\"card-overview__metric-figure\">\n <ds-text\n as=\"span\"\n class=\"card-overview__metric-value\"\n variant=\"text-body-medium\"\n color={INVERTED_PRIMARY}\n fontFeature=\"tabular-nums\"\n >\n {metric.value}\n </ds-text>\n {this.renderTrend(metric.trend, 'text-body-medium')}\n </div>\n </div>\n );\n }\n\n private renderMetrics() {\n if (this.isLoading && this.metrics.length === 0) {\n return Array.from({ length: LOADING_PLACEHOLDER_COUNT }, (_, index) => (\n <div class=\"card-overview__metric\" key={`loading-${index}`}>\n {this.bar('text-body-small', '70%', 'card-overview__metric-label')}\n <div class=\"card-overview__metric-figure\">\n {this.bar('text-body-medium', '36px')}\n {/* text-body-medium, matching renderTrend for a metric — a smaller\n * variant here leaves the trend bar short of the value beside it. */}\n {this.bar('text-body-medium', '40px')}\n </div>\n </div>\n ));\n }\n\n return this.visibleMetrics.map((metric, index) => this.renderMetric(metric, index));\n }\n\n render() {\n const hasHeader = Boolean(this.periodLabel || this.comparisonLabel);\n const compact = this.variant === 'compact';\n const collapse = this.scrollCollapseGeometry;\n\n return (\n <Host\n class={{\n 'card-overview': true,\n 'card-overview--has-score': this.hasScore,\n 'card-overview--compact': compact,\n 'card-overview--stacked': !compact && this.layout === 'stacked',\n 'card-overview--scroll-collapsing': collapse.active,\n }}\n role=\"region\"\n aria-label={this.overviewLabel}\n aria-busy={this.isLoading ? 'true' : undefined}\n style={{\n '--ds-card-overview-metric-min': this.metricMinWidth,\n '--ds-card-overview-expanded-height': collapse.active\n ? `${collapse.expandedHeight}px`\n : undefined,\n '--ds-card-overview-visible-height': collapse.active\n ? `${collapse.visibleHeight}px`\n : undefined,\n '--ds-card-overview-content-offset': collapse.active\n ? `${collapse.offset}px`\n : undefined,\n }}\n >\n <div\n class={{\n 'card-overview__surface': true,\n // Split shadow and inset highlight, so the opaque surface cannot cover\n // the highlight the way a combined elevation shadow would.\n 'ds-control-elevation': true,\n 'ds-control-elevation--sm': !compact,\n 'ds-control-elevation--floating': compact,\n }}\n >\n <div class=\"card-overview__clip\">\n <div\n ref={element => {\n this.layoutEl = (element as HTMLElement) ?? undefined;\n }}\n class={{\n 'card-overview__layout': true,\n 'card-overview__layout--has-score': this.hasScore,\n }}\n >\n <div class=\"card-overview__summary\">\n {this.hasScore && this.renderScore(compact)}\n\n {/* `ds-control--md` supplies the 32px height and the label inset below. */}\n <div\n class={{\n 'card-overview__header': true,\n 'card-overview__header--has-score': this.hasScore,\n 'ds-control--md': true,\n }}\n >\n {this.isLoading ? (\n <div class=\"card-overview__period ds-control-label-box\">\n {this.bar('text-body-medium', '184px')}\n {this.bar('text-body-medium', '248px')}\n </div>\n ) : (\n hasHeader && (\n <div class=\"card-overview__period ds-control-label-box\">\n {this.periodLabel && (\n <ds-text\n as=\"span\"\n class=\"card-overview__period-current ds-control-label-box\"\n variant=\"text-body-medium\"\n emphasis\n color={INVERTED_PRIMARY}\n >\n {this.periodLabel}\n </ds-text>\n )}\n {this.comparisonLabel && (\n <ds-text\n as=\"span\"\n class=\"card-overview__period-comparison ds-control-label-box\"\n variant=\"text-body-medium\"\n color={INVERTED_SECONDARY}\n >\n {this.comparisonLabel}\n </ds-text>\n )}\n </div>\n )\n )}\n <div class=\"card-overview__filter\">\n {/*\n Period control is application owned: it varies by product surface.\n While loading it is stood in for by a control-shaped skeleton so the\n header keeps its resolved proportions.\n */}\n {this.isLoading ? (\n <ds-skeleton\n variant=\"control\"\n controlSize=\"md\"\n width=\"128px\"\n background=\"inverted\"\n />\n ) : (\n <slot name=\"filter\" />\n )}\n </div>\n </div>\n </div>\n\n {!compact && (\n <div\n class={{\n 'card-overview__body': true,\n 'card-overview__body--has-score': this.hasScore,\n }}\n >\n <div class=\"card-overview__metrics\" part=\"metrics\">\n {this.renderMetrics()}\n </div>\n\n <slot name=\"footer\" />\n </div>\n )}\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n",
|
|
374
|
+
"content": "import { Component, Element, Event, EventEmitter, h, Host, Prop, State } from '@stencil/core';\nimport { resolveCssLengthPx, TOKEN_DEFAULTS } from '../../utils';\nimport type { TextColor, TextVariant } from '../Text/text-types';\nimport type { MetricTrend } from '../../utils/metric-change';\nimport type {\n CardOverviewLayout,\n CardOverviewVariant,\n OverviewMetric,\n OverviewScore,\n} from './card-overview-types';\nimport {\n findNextOverviewMetricIndex,\n resolveCardOverviewCollapseGeometry,\n resolveOverviewRovingIndex,\n} from './card-overview-controller';\n\n/** Metric cells below this width drop a grid column rather than compress further. */\nconst DEFAULT_METRIC_MIN_WIDTH = 'var(--dimension-menu-width-xs)';\n\n/** Skeleton cells rendered while loading with no metrics supplied yet. */\nconst LOADING_PLACEHOLDER_COUNT = 4;\n\n/** Maximum number of comparable measures the summary bar presents at once. */\nconst MAX_METRIC_COUNT = 6;\n\nconst TREND_COLORS: Record<MetricTrend['tone'], TextColor> = {\n positive: 'var(--color-always-dark-foreground-positive)',\n negative: 'var(--color-always-dark-foreground-negative)',\n neutral: 'var(--color-always-dark-foreground-secondary)',\n};\n\nconst ALWAYS_DARK_PRIMARY: TextColor = 'var(--color-always-dark-foreground-primary)';\nconst ALWAYS_DARK_SECONDARY: TextColor = 'var(--color-always-dark-foreground-secondary)';\n\n@Component({\n tag: 'ds-card-overview',\n styleUrl: 'CardOverview.css',\n scoped: true,\n})\nexport class CardOverview {\n @Element() el!: HTMLElement;\n\n /** Full summary card, or the condensed 48px summary bar. */\n @Prop() variant: CardOverviewVariant = 'default';\n\n /** Intrinsic responsive layout, or a page-owned single-column stack. */\n @Prop() layout: CardOverviewLayout = 'auto';\n\n /** Leading summary block. Omit to render the bar without a headline figure. */\n @Prop() score: OverviewScore | undefined;\n\n /** Current reporting period, for example `Jun 29, 2026 – Jul 26, 2026`. */\n @Prop() periodLabel: string = '';\n\n /** Comparison caption, for example `vs Previous period`. */\n @Prop() comparisonLabel: string = '';\n\n /** Measures rendered in the responsive grid. Only the first six are shown. */\n @Prop() metrics: OverviewMetric[] = [];\n\n /**\n * Width a metric cell may shrink to before the grid drops a column. The grid\n * reflows and then stacks from this alone, so no measurement is required.\n */\n @Prop() metricMinWidth: string = DEFAULT_METRIC_MIN_WIDTH;\n\n /** Replace the score and metrics with skeletons while data resolves. */\n @Prop() isLoading: boolean = false;\n\n /** Message shown in place of the score when its figure cannot be resolved. */\n @Prop() scoreErrorMessage: string | undefined;\n\n /** Accessible name for the region. */\n @Prop() overviewLabel: string = 'Overview';\n\n /**\n * Page-controlled visual collapse from the full card (`0`) toward its 48px\n * compact handoff height (`1`). The component preserves its expanded flow\n * height, keeps elevation on the shrinking surface, and clips translated\n * content internally. The page still owns sticky positioning and the final\n * swap to `variant=\"compact\"`.\n */\n @Prop() scrollCollapseProgress: number = 0;\n\n /** Emitted when a metric that is not inactive is activated. */\n @Event() dsMetricSelect!: EventEmitter<OverviewMetric>;\n\n /** Roving tab stop across selectable metrics. */\n @State() private focusedMetricIndex: number = 0;\n @State() private expandedHeight: number = 0;\n\n private layoutEl?: HTMLElement;\n private layoutResizeObserver: ResizeObserver | null = null;\n\n componentDidLoad() {\n this.observeLayout();\n }\n\n componentDidRender() {\n // Re-bind after HMR when DidLoad's observer was dropped.\n if (!this.layoutResizeObserver) this.observeLayout();\n }\n\n disconnectedCallback() {\n this.layoutResizeObserver?.disconnect();\n this.layoutResizeObserver = null;\n }\n\n private get hasScore(): boolean {\n return this.score !== undefined || this.scoreErrorMessage !== undefined || this.isLoading;\n }\n\n private get visibleMetrics(): OverviewMetric[] {\n return this.metrics.slice(0, MAX_METRIC_COUNT);\n }\n\n private get resolvedScrollCollapseProgress(): number {\n if (this.variant === 'compact' || !Number.isFinite(this.scrollCollapseProgress)) return 0;\n return Math.min(1, Math.max(0, this.scrollCollapseProgress));\n }\n\n private get scrollCollapseGeometry() {\n const compactHeight = resolveCssLengthPx(TOKEN_DEFAULTS.size600, 48);\n return resolveCardOverviewCollapseGeometry({\n variant: this.variant,\n progress: this.resolvedScrollCollapseProgress,\n expandedHeight: this.expandedHeight,\n compactHeight,\n });\n }\n\n private observeLayout() {\n const layout = this.layoutEl;\n if (!layout) return;\n\n const updateHeight = (height: number) => {\n if (height > 0 && Math.abs(height - this.expandedHeight) >= 0.5) {\n this.expandedHeight = height;\n }\n };\n\n updateHeight(layout.getBoundingClientRect().height);\n if (typeof ResizeObserver === 'undefined') return;\n\n this.layoutResizeObserver?.disconnect();\n this.layoutResizeObserver = new ResizeObserver(entries => {\n const height = entries[0]?.contentRect.height;\n if (height !== undefined) updateHeight(height);\n });\n this.layoutResizeObserver.observe(layout);\n }\n\n /** Index of the roving tab stop, skipping inactive metrics. */\n private get rovingIndex(): number {\n return resolveOverviewRovingIndex(this.visibleMetrics, this.focusedMetricIndex);\n }\n\n private selectMetric(metric: OverviewMetric, index: number) {\n if (metric.isInactive) return;\n this.focusedMetricIndex = index;\n this.dsMetricSelect.emit(metric);\n }\n\n /** Move the roving tab stop, wrapping and skipping inactive metrics. */\n private moveFocus(from: number, step: number) {\n const metrics = this.visibleMetrics;\n const next = findNextOverviewMetricIndex(metrics, from, step < 0 ? -1 : 1);\n if (next < 0) return;\n\n this.focusedMetricIndex = next;\n const cells = this.el.querySelectorAll<HTMLElement>('.card-overview__metric');\n cells[next]?.focus();\n }\n\n private handleMetricKeyDown = (event: KeyboardEvent, index: number) => {\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n event.preventDefault();\n this.moveFocus(index, 1);\n break;\n case 'ArrowLeft':\n case 'ArrowUp':\n event.preventDefault();\n this.moveFocus(index, -1);\n break;\n default:\n break;\n }\n };\n\n /**\n * A skeleton bar matching the type metrics of the text it stands in for, so the\n * loading state holds the same shape and rhythm as the resolved content.\n *\n * `background` is always passed so the base and shimmer follow the card's\n * permanently dark surface in both themes.\n */\n private bar(textVariant: TextVariant, width: string, className?: string) {\n return (\n <ds-skeleton\n class={className}\n variant=\"text\"\n textVariant={textVariant}\n width={width}\n background=\"always-dark\"\n />\n );\n }\n\n /**\n * Arrow and change in one text node.\n *\n * The arrow is a typeface glyph rather than an icon so it inherits the exact\n * size, weight, and baseline of the value beside it; an icon would need its\n * own size scale and would drift whenever the type scale changed.\n *\n * Tone is supplied by the caller and never inferred here.\n */\n private renderTrend(trend: MetricTrend | undefined, variant: TextVariant, emphasis = false) {\n if (!trend) return null;\n return (\n <ds-text\n as=\"span\"\n class={{\n 'card-overview__trend': true,\n [`card-overview__trend--${trend.tone}`]: true,\n }}\n variant={variant}\n emphasis={emphasis}\n color={TREND_COLORS[trend.tone]}\n fontFeature=\"tabular-nums\"\n >\n {trend.direction === 'up' ? '↑' : '↓'} {trend.value}\n </ds-text>\n );\n }\n\n private renderScore(compact: boolean) {\n if (this.isLoading) {\n if (compact) {\n return (\n <div class=\"card-overview__score ds-control--md\" part=\"score\">\n {this.bar('text-body-medium', '40px', 'card-overview__score-label')}\n <div class=\"card-overview__score-figure\">\n {this.bar('text-body-medium', '24px')}\n {this.bar('text-body-medium', '32px')}\n </div>\n </div>\n );\n }\n\n return (\n <div class=\"card-overview__score ds-control--md\" part=\"score\">\n {/*\n * The label row is kept but left empty. It carries the control-height\n * box that aligns the score block with the period control, so dropping\n * it would shift the whole block up; a bar inside it would collide with\n * the figure, which sits under the label by design.\n */}\n <div class=\"card-overview__score-label-row\" />\n <div class=\"card-overview__score-figure\">\n {this.bar('text-display-medium', '56px')}\n {this.bar('text-body-small', '24px', 'card-overview__skeleton-baseline')}\n </div>\n {/*\n * Class goes on the skeleton itself, matching the resolved band. In a\n * wrapper the bar picks up inline leading and drops below the resolved\n * band position.\n */}\n {this.bar(\n 'text-caption',\n '80px',\n 'card-overview__score-band card-overview__score-band--loading'\n )}\n </div>\n );\n }\n\n if (this.scoreErrorMessage) {\n return (\n <div class=\"card-overview__score card-overview__score--error\" part=\"score\" role=\"alert\">\n <ds-icon name=\"CircleExclamation\" size=\"sm\" color=\"inherit\" aria-hidden=\"true\" />\n <ds-text as=\"span\" variant=\"text-body-medium\" color=\"inherit\">\n {this.scoreErrorMessage}\n </ds-text>\n </div>\n );\n }\n\n const score = this.score;\n if (!score) return null;\n\n return (\n <div class=\"card-overview__score card-overview__score--resolved ds-control--md\" part=\"score\">\n {/* The row owns cross-layout baseline geometry and becomes display: contents in compact mode. */}\n {/* eslint-disable-next-line local/prefer-direct-ds-text */}\n <div class=\"card-overview__score-label-row\">\n <ds-text\n as=\"span\"\n class=\"card-overview__score-label\"\n variant=\"text-body-medium\"\n emphasis={!compact}\n color={ALWAYS_DARK_SECONDARY}\n >\n {score.label}\n </ds-text>\n </div>\n <div class=\"card-overview__score-figure\">\n <ds-text\n as=\"span\"\n class=\"card-overview__score-value\"\n variant={compact ? 'text-body-medium' : 'text-display-medium'}\n emphasis\n color={ALWAYS_DARK_PRIMARY}\n fontFeature=\"tabular-nums\"\n >\n {score.value}\n </ds-text>\n {this.renderTrend(\n score.trend,\n compact ? 'text-body-medium' : 'text-body-small',\n !compact\n )}\n </div>\n {score.band && !compact && (\n <ds-text\n as=\"span\"\n class=\"card-overview__score-band\"\n variant=\"text-caption\"\n color={ALWAYS_DARK_SECONDARY}\n >\n {score.band}\n </ds-text>\n )}\n </div>\n );\n }\n\n private renderMetric(metric: OverviewMetric, index: number) {\n const selectable = !metric.isInactive;\n const label = (\n <ds-text\n as=\"span\"\n class=\"card-overview__metric-label\"\n variant=\"text-body-small\"\n color={ALWAYS_DARK_SECONDARY}\n >\n {metric.label}\n </ds-text>\n );\n\n return (\n <div\n class={{\n 'card-overview__metric': true,\n 'card-overview__metric--inactive': !selectable,\n // Selection targets get the shared wash; press scaling is not used here\n // so the grid keeps its columns aligned. See docs/control-press-policy.md.\n 'ds-interaction-fill': selectable,\n 'ds-interaction-fill--on-always-dark': selectable,\n 'ds-focus-ring-inset': selectable,\n }}\n part=\"metric\"\n role={selectable ? 'button' : undefined}\n tabIndex={selectable && index === this.rovingIndex ? 0 : -1}\n onClick={() => this.selectMetric(metric, index)}\n onKeyDown={event => this.handleMetricKeyDown(event, index)}\n onFocusin={() => {\n if (selectable) this.focusedMetricIndex = index;\n }}\n >\n {metric.labelTooltip ? (\n <ds-tooltip label={metric.labelTooltip} side=\"top\" size=\"sm\">\n {label}\n </ds-tooltip>\n ) : (\n label\n )}\n <div class=\"card-overview__metric-figure\">\n <ds-text\n as=\"span\"\n class=\"card-overview__metric-value\"\n variant=\"text-body-medium\"\n color={ALWAYS_DARK_PRIMARY}\n fontFeature=\"tabular-nums\"\n >\n {metric.value}\n </ds-text>\n {this.renderTrend(metric.trend, 'text-body-medium')}\n </div>\n </div>\n );\n }\n\n private renderMetrics() {\n if (this.isLoading && this.metrics.length === 0) {\n return Array.from({ length: LOADING_PLACEHOLDER_COUNT }, (_, index) => (\n <div class=\"card-overview__metric\" key={`loading-${index}`}>\n {this.bar('text-body-small', '70%', 'card-overview__metric-label')}\n <div class=\"card-overview__metric-figure\">\n {this.bar('text-body-medium', '36px')}\n {/* text-body-medium, matching renderTrend for a metric — a smaller\n * variant here leaves the trend bar short of the value beside it. */}\n {this.bar('text-body-medium', '40px')}\n </div>\n </div>\n ));\n }\n\n return this.visibleMetrics.map((metric, index) => this.renderMetric(metric, index));\n }\n\n render() {\n const hasHeader = Boolean(this.periodLabel || this.comparisonLabel);\n const compact = this.variant === 'compact';\n const collapse = this.scrollCollapseGeometry;\n\n return (\n <Host\n class={{\n 'card-overview': true,\n 'card-overview--has-score': this.hasScore,\n 'card-overview--compact': compact,\n 'card-overview--stacked': !compact && this.layout === 'stacked',\n 'card-overview--scroll-collapsing': collapse.active,\n }}\n role=\"region\"\n aria-label={this.overviewLabel}\n aria-busy={this.isLoading ? 'true' : undefined}\n style={{\n '--ds-card-overview-metric-min': this.metricMinWidth,\n '--ds-card-overview-expanded-height': collapse.active\n ? `${collapse.expandedHeight}px`\n : undefined,\n '--ds-card-overview-visible-height': collapse.active\n ? `${collapse.visibleHeight}px`\n : undefined,\n '--ds-card-overview-content-offset': collapse.active\n ? `${collapse.offset}px`\n : undefined,\n }}\n >\n <div\n class={{\n 'card-overview__surface': true,\n // Split shadow and inset highlight, so the opaque surface cannot cover\n // the highlight the way a combined elevation shadow would.\n 'ds-control-elevation': true,\n 'ds-control-elevation--sm': !compact,\n 'ds-control-elevation--floating': compact,\n }}\n >\n <div class=\"card-overview__clip\">\n <div\n ref={element => {\n this.layoutEl = (element as HTMLElement) ?? undefined;\n }}\n class={{\n 'card-overview__layout': true,\n 'card-overview__layout--has-score': this.hasScore,\n }}\n >\n <div class=\"card-overview__summary\">\n {this.hasScore && this.renderScore(compact)}\n\n {/* `ds-control--md` supplies the 32px height and the label inset below. */}\n <div\n class={{\n 'card-overview__header': true,\n 'card-overview__header--has-score': this.hasScore,\n 'ds-control--md': true,\n }}\n >\n {this.isLoading ? (\n <div class=\"card-overview__period ds-control-label-box\">\n {this.bar('text-body-medium', '184px')}\n {this.bar('text-body-medium', '248px')}\n </div>\n ) : (\n hasHeader && (\n <div class=\"card-overview__period ds-control-label-box\">\n {this.periodLabel && (\n <ds-text\n as=\"span\"\n class=\"card-overview__period-current ds-control-label-box\"\n variant=\"text-body-medium\"\n emphasis\n color={ALWAYS_DARK_PRIMARY}\n >\n {this.periodLabel}\n </ds-text>\n )}\n {this.comparisonLabel && (\n <ds-text\n as=\"span\"\n class=\"card-overview__period-comparison ds-control-label-box\"\n variant=\"text-body-medium\"\n color={ALWAYS_DARK_SECONDARY}\n >\n {this.comparisonLabel}\n </ds-text>\n )}\n </div>\n )\n )}\n <div class=\"card-overview__filter\">\n {/*\n Period control is application owned: it varies by product surface.\n While loading it is stood in for by a control-shaped skeleton so the\n header keeps its resolved proportions.\n */}\n {this.isLoading ? (\n <ds-skeleton\n variant=\"control\"\n controlSize=\"md\"\n width=\"128px\"\n background=\"always-dark\"\n />\n ) : (\n <slot name=\"filter\" />\n )}\n </div>\n </div>\n </div>\n\n {!compact && (\n <div\n class={{\n 'card-overview__body': true,\n 'card-overview__body--has-score': this.hasScore,\n }}\n >\n <div class=\"card-overview__metrics\" part=\"metrics\">\n {this.renderMetrics()}\n </div>\n\n <slot name=\"footer\" />\n </div>\n )}\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n",
|
|
375
375
|
"type": "registry:ui"
|
|
376
376
|
},
|
|
377
377
|
{
|