@ds-mo/ui 12.9.0 → 13.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (430) hide show
  1. package/README.md +1 -0
  2. package/dist/.package-ready.json +1 -0
  3. package/dist/agent-patterns.json +124 -135
  4. package/dist/agent.json +249 -1108
  5. package/dist/angular/ds-bar-nav.d.ts +1 -1
  6. package/dist/angular/ds-bar-nav.js +3 -3
  7. package/dist/angular/ds-button-filled.d.ts +1 -1
  8. package/dist/angular/ds-button-filled.js +3 -3
  9. package/dist/angular/ds-card-data-viz.d.ts +18 -0
  10. package/dist/angular/{ds-card-data-viz-donut.js → ds-card-data-viz.js} +12 -12
  11. package/dist/angular/ds-card-overview.d.ts +1 -1
  12. package/dist/angular/ds-card-overview.js +3 -3
  13. package/dist/angular/ds-chart-bar.d.ts +1 -1
  14. package/dist/angular/ds-chart-bar.js +3 -3
  15. package/dist/angular/ds-menu.d.ts +1 -7
  16. package/dist/angular/ds-menu.js +2 -5
  17. package/dist/angular/ds-mobile-header.d.ts +1 -1
  18. package/dist/angular/ds-mobile-header.js +3 -3
  19. package/dist/angular/ds-mobile-section-switcher.d.ts +1 -1
  20. package/dist/angular/ds-mobile-section-switcher.js +3 -3
  21. package/dist/angular/ds-panel-tools.d.ts +1 -1
  22. package/dist/angular/ds-panel-tools.js +3 -3
  23. package/dist/angular/ds-select.d.ts +5 -4
  24. package/dist/angular/ds-select.js +3 -3
  25. package/dist/angular/ds-shell-app.d.ts +90 -1
  26. package/dist/angular/ds-shell-app.js +44 -4
  27. package/dist/angular/ds-shell-tools.d.ts +1 -1
  28. package/dist/angular/ds-shell-tools.js +3 -3
  29. package/dist/angular/index.d.ts +1 -1
  30. package/dist/angular/index.js +1 -8
  31. package/dist/angular/proxies.d.ts +1 -8
  32. package/dist/angular/proxies.js +1 -8
  33. package/dist/components/ds-agent-activity.js +1 -1
  34. package/dist/components/ds-agent-response.js +1 -1
  35. package/dist/components/ds-agent-source-list.js +1 -1
  36. package/dist/components/ds-agent-tool-call.js +1 -1
  37. package/dist/components/ds-attachment-list.js +1 -1
  38. package/dist/components/ds-badge.js +1 -1
  39. package/dist/components/ds-bar-nav.js +1 -1
  40. package/dist/components/ds-bar-nav.js.map +1 -1
  41. package/dist/components/ds-bar-title.js +1 -1
  42. package/dist/components/ds-bar-title.js.map +1 -1
  43. package/dist/components/ds-bar-workflow.js +1 -1
  44. package/dist/components/ds-breadcrumb.js +1 -1
  45. package/dist/components/ds-button-filled.js +1 -1
  46. package/dist/components/ds-button-unfilled.js +1 -1
  47. package/dist/components/{ds-select-multi.d.ts → ds-card-data-viz.d.ts} +4 -4
  48. package/dist/components/ds-card-data-viz.js +2 -0
  49. package/dist/components/ds-card-data-viz.js.map +1 -0
  50. package/dist/components/ds-card-overview.js +1 -1
  51. package/dist/components/ds-card-overview.js.map +1 -1
  52. package/dist/components/ds-card-setting.js +1 -1
  53. package/dist/components/ds-chart-bar.js +1 -1
  54. package/dist/components/ds-chart-bar.js.map +1 -1
  55. package/dist/components/ds-chart-donut.js +1 -1
  56. package/dist/components/ds-chart-legend.js +1 -1
  57. package/dist/components/ds-chart-legend.js.map +1 -1
  58. package/dist/components/ds-chart-line.js +1 -1
  59. package/dist/components/ds-chart-line.js.map +1 -1
  60. package/dist/components/ds-checkbox.js +1 -1
  61. package/dist/components/ds-chip.js +1 -1
  62. package/dist/components/ds-code-block.js +1 -1
  63. package/dist/components/ds-conversation-list-item.js +1 -1
  64. package/dist/components/ds-conversation-list-item.js.map +1 -1
  65. package/dist/components/ds-conversation-list-section.js +1 -1
  66. package/dist/components/ds-conversation-list.js +1 -1
  67. package/dist/components/ds-divider.js +1 -1
  68. package/dist/components/ds-empty-state.js +1 -1
  69. package/dist/components/ds-field.js +1 -1
  70. package/dist/components/ds-input.js +1 -1
  71. package/dist/components/ds-input.js.map +1 -1
  72. package/dist/components/ds-markdown.js +1 -1
  73. package/dist/components/ds-menu.js +1 -1
  74. package/dist/components/ds-message-bubble.js +1 -1
  75. package/dist/components/ds-message-composer.js +1 -1
  76. package/dist/components/ds-message-composer.js.map +1 -1
  77. package/dist/components/ds-message-scroller.js +1 -1
  78. package/dist/components/ds-message.js +1 -1
  79. package/dist/components/ds-mobile-bar-nav.js +1 -1
  80. package/dist/components/ds-mobile-bar-nav.js.map +1 -1
  81. package/dist/components/ds-mobile-header.js +1 -1
  82. package/dist/components/ds-mobile-section-switcher.js +1 -1
  83. package/dist/components/ds-mobile-sheet-nav.js +1 -1
  84. package/dist/components/ds-mobile-sheet-nav.js.map +1 -1
  85. package/dist/components/ds-modal.js +1 -1
  86. package/dist/components/ds-panel-nav.js +1 -1
  87. package/dist/components/ds-panel-nav.js.map +1 -1
  88. package/dist/components/ds-panel-sub-nav.js +1 -1
  89. package/dist/components/ds-panel-tool-header.js +1 -1
  90. package/dist/components/ds-panel-tool-search.js +1 -1
  91. package/dist/components/ds-panel-tools.js +1 -1
  92. package/dist/components/ds-radio.js +1 -1
  93. package/dist/components/ds-radio.js.map +1 -1
  94. package/dist/components/ds-scroll-overlay.js +1 -1
  95. package/dist/components/ds-select.js +1 -1
  96. package/dist/components/ds-select.js.map +1 -1
  97. package/dist/components/ds-shell-app.js +1 -1
  98. package/dist/components/ds-shell-app.js.map +1 -1
  99. package/dist/components/ds-shell-page.js +1 -1
  100. package/dist/components/ds-shell-page.js.map +1 -1
  101. package/dist/components/ds-shell-tools.js +1 -1
  102. package/dist/components/ds-shell-tools.js.map +1 -1
  103. package/dist/components/ds-skeleton.js +1 -1
  104. package/dist/components/ds-slider.js +1 -1
  105. package/dist/components/ds-slider.js.map +1 -1
  106. package/dist/components/ds-swatch-picker.js +1 -1
  107. package/dist/components/ds-switch.js +1 -1
  108. package/dist/components/ds-tab-group.js +1 -1
  109. package/dist/components/ds-tag.js +1 -1
  110. package/dist/components/ds-text.js +1 -1
  111. package/dist/components/ds-toast.js +1 -1
  112. package/dist/components/ds-tooltip-data-viz.js +1 -1
  113. package/dist/components/ds-tooltip.js +1 -1
  114. package/dist/components/ds-typing-indicator.js +1 -1
  115. package/dist/components/{p-CgEYdMee.js → p-6qXDqCj_.js} +2 -2
  116. package/dist/components/{p-Cr3tEx7o.js → p-Ay1AX7Ql.js} +2 -2
  117. package/dist/components/p-B-qDb_Zo.js +2 -0
  118. package/dist/components/p-B-qDb_Zo.js.map +1 -0
  119. package/dist/components/{p-BOCfICln.js → p-B1cbQ0SG.js} +2 -2
  120. package/dist/components/{p-BKOlvCGS.js → p-BUZXuod2.js} +2 -2
  121. package/dist/components/{p-DCvA3Dc9.js → p-BaUsq_VK.js} +2 -2
  122. package/dist/components/p-BbMJTilO.js +2 -0
  123. package/dist/components/p-BbMJTilO.js.map +1 -0
  124. package/dist/components/{p-BO5aqZcf.js → p-BcTYhmku.js} +2 -2
  125. package/dist/components/p-Bkv3UjZz.js +2 -0
  126. package/dist/components/p-Bkv3UjZz.js.map +1 -0
  127. package/dist/components/p-BnQXAbif.js +2 -0
  128. package/dist/components/p-BnQXAbif.js.map +1 -0
  129. package/dist/components/p-BnbbnuVC.js +2 -0
  130. package/dist/components/p-BnbbnuVC.js.map +1 -0
  131. package/dist/components/{p-BDKtu6Wb.js → p-BroVnDzE.js} +2 -2
  132. package/dist/components/{p-CIiBpjCn.js → p-BsoqsbBh.js} +2 -2
  133. package/dist/components/p-BwT6B5Fi.js +2 -0
  134. package/dist/components/p-BwT6B5Fi.js.map +1 -0
  135. package/dist/components/p-BybqPD8K.js +2 -0
  136. package/dist/components/p-BybqPD8K.js.map +1 -0
  137. package/dist/components/p-C-vRkDyn.js +2 -0
  138. package/dist/components/p-C-vRkDyn.js.map +1 -0
  139. package/dist/components/p-C3ArcO50.js +2 -0
  140. package/dist/components/p-C3ArcO50.js.map +1 -0
  141. package/dist/components/p-C4uYvyq6.js +2 -0
  142. package/dist/components/p-C4uYvyq6.js.map +1 -0
  143. package/dist/components/{p-C8HU4W8q.js → p-CBazaRlE.js} +2 -2
  144. package/dist/components/{p-BhV5e6vF.js → p-CHuh71-U.js} +2 -2
  145. package/dist/components/{p-CChcuL04.js → p-CMWata9g.js} +2 -2
  146. package/dist/components/p-CS6CHlHK.js +2 -0
  147. package/dist/components/p-CS6CHlHK.js.map +1 -0
  148. package/dist/components/p-CTTnM7cE.js +2 -0
  149. package/dist/components/p-CTTnM7cE.js.map +1 -0
  150. package/dist/components/{p-CCzG5xDD.js → p-CWoXKe_h.js} +2 -2
  151. package/dist/components/p-CWoXKe_h.js.map +1 -0
  152. package/dist/components/p-CwwuSGER.js +2 -0
  153. package/dist/components/p-CwwuSGER.js.map +1 -0
  154. package/dist/components/p-D09HINr_.js +2 -0
  155. package/dist/components/p-D09HINr_.js.map +1 -0
  156. package/dist/components/p-D2xWcVv6.js +2 -0
  157. package/dist/components/p-D2xWcVv6.js.map +1 -0
  158. package/dist/components/p-DAW6G8Sl.js +2 -0
  159. package/dist/components/p-DAW6G8Sl.js.map +1 -0
  160. package/dist/components/p-DEaszb15.js +2 -0
  161. package/dist/components/p-DEaszb15.js.map +1 -0
  162. package/dist/components/{p-BgGP65Nn.js → p-DOUk4KoT.js} +1 -1
  163. package/dist/components/p-DOUk4KoT.js.map +1 -0
  164. package/dist/components/p-DbQr7Kwr.js +2 -0
  165. package/dist/components/p-DbQr7Kwr.js.map +1 -0
  166. package/dist/components/p-DdvEZyX4.js +2 -0
  167. package/dist/components/p-DdvEZyX4.js.map +1 -0
  168. package/dist/components/{p-DRnIuCiT.js → p-DeQwkbT1.js} +2 -2
  169. package/dist/components/{p-Cuih680v.js → p-Df17mJqI.js} +2 -2
  170. package/dist/components/p-Dg1LBXJ2.js +2 -0
  171. package/dist/components/p-Dg1LBXJ2.js.map +1 -0
  172. package/dist/components/p-DsiCDzoF.js +2 -0
  173. package/dist/components/p-DsiCDzoF.js.map +1 -0
  174. package/dist/components/p-_DzUXA86.js +2 -0
  175. package/dist/components/p-_DzUXA86.js.map +1 -0
  176. package/dist/components/p-lyZNvRvO.js +2 -0
  177. package/dist/components/p-lyZNvRvO.js.map +1 -0
  178. package/dist/components/{p-YR1XeuZf.js → p-ohsLFap_.js} +2 -2
  179. package/dist/components/{p-DjbTFy2B.js → p-ymtdhOU5.js} +1 -1
  180. package/dist/components/p-ymtdhOU5.js.map +1 -0
  181. package/dist/components/p-z5RIrXuX.js +2 -0
  182. package/dist/components/p-z5RIrXuX.js.map +1 -0
  183. package/dist/docs/components.json +929 -2371
  184. package/dist/framework/angular.d.ts +0 -1
  185. package/dist/framework/angular.js +0 -1
  186. package/dist/lib/components/BarTitle/bar-title-types.d.ts +28 -0
  187. package/dist/lib/components/Breadcrumb/breadcrumb-types.d.ts +16 -0
  188. package/dist/lib/components/ButtonFilled/ButtonFilled.d.ts +83 -0
  189. package/dist/lib/components/MobileHeader/mobile-header-types.d.ts +4 -0
  190. package/dist/lib/components/PanelTools/panel-tools-types.d.ts +21 -7
  191. package/dist/lib/components/ShellApp/shell-app-types.d.ts +91 -0
  192. package/dist/lib/shell/index.d.ts +5 -13
  193. package/dist/lib/shell/index.js +87 -358
  194. package/dist/lib/shell/index.js.map +3 -3
  195. package/dist/lib/shell/shell-responsive.d.ts +2 -1
  196. package/dist/lib/utils/button-render.d.ts +17 -0
  197. package/dist/lib/utils/button-types.d.ts +10 -0
  198. package/dist/lib/utils/choice-list.d.ts +25 -0
  199. package/dist/lib/utils/control-press.d.ts +8 -0
  200. package/dist/lib/utils/form-association.d.ts +22 -0
  201. package/dist/lib/utils/index.d.ts +4 -0
  202. package/dist/lib/utils/index.js +63 -0
  203. package/dist/lib/utils/index.js.map +3 -3
  204. package/dist/lib/utils/required-validity.d.ts +1 -1
  205. package/dist/lib/utils/safe-url.d.ts +11 -0
  206. package/dist/mcp/cli.js +38 -10
  207. package/dist/mcp-data/registry/agent-source-list.json +1 -1
  208. package/dist/mcp-data/registry/attachment-list.json +1 -1
  209. package/dist/mcp-data/registry/bar-nav.json +3 -21
  210. package/dist/mcp-data/registry/breadcrumb.json +1 -1
  211. package/dist/mcp-data/registry/button-filled.json +4 -19
  212. package/dist/mcp-data/registry/button-unfilled.json +14 -11
  213. package/dist/mcp-data/registry/card-data-viz.json +241 -0
  214. package/dist/mcp-data/registry/card-overview.json +38 -10
  215. package/dist/mcp-data/registry/card-setting.json +2 -2
  216. package/dist/mcp-data/registry/chart-bar.json +66 -18
  217. package/dist/mcp-data/registry/chart-donut.json +5 -5
  218. package/dist/mcp-data/registry/chart-legend.json +7 -9
  219. package/dist/mcp-data/registry/chart-line.json +1 -2
  220. package/dist/mcp-data/registry/checkbox.json +2 -2
  221. package/dist/mcp-data/registry/conversation-list-item.json +1 -1
  222. package/dist/mcp-data/registry/field.json +2 -3
  223. package/dist/mcp-data/registry/input.json +1 -1
  224. package/dist/mcp-data/registry/markdown.json +1 -1
  225. package/dist/mcp-data/registry/menu.json +10 -21
  226. package/dist/mcp-data/registry/mobile-bar-nav.json +1 -1
  227. package/dist/mcp-data/registry/mobile-header.json +1 -37
  228. package/dist/mcp-data/registry/mobile-section-switcher.json +1 -19
  229. package/dist/mcp-data/registry/panel-nav.json +2 -2
  230. package/dist/mcp-data/registry/panel-tool-search.json +1 -1
  231. package/dist/mcp-data/registry/panel-tools.json +19 -55
  232. package/dist/mcp-data/registry/radio.json +1 -1
  233. package/dist/mcp-data/registry/registry.json +294 -1174
  234. package/dist/mcp-data/registry/select.json +59 -25
  235. package/dist/mcp-data/registry/shell-app.json +345 -20
  236. package/dist/mcp-data/registry/shell-page.json +1 -1
  237. package/dist/mcp-data/registry/shell-tools.json +12 -43
  238. package/dist/mcp-data/registry/slider.json +1 -1
  239. package/dist/mcp-data/registry/switch.json +1 -1
  240. package/dist/react/components.d.ts +1 -8
  241. package/dist/react/components.js +1 -8
  242. package/dist/react/ds-card-data-viz.d.ts +12 -0
  243. package/dist/react/ds-card-data-viz.js +12 -0
  244. package/dist/react/ds-menu.d.ts +1 -2
  245. package/dist/react/ds-menu.js +0 -1
  246. package/dist/react/ds-select.d.ts +2 -2
  247. package/dist/react/ds-shell-app.d.ts +24 -1
  248. package/dist/react/ds-shell-app.js +16 -1
  249. package/dist/types/components/AgentSourceList/AgentSourceList.d.ts +0 -1
  250. package/dist/types/components/BarNav/BarNav.d.ts +0 -2
  251. package/dist/types/components/BarNav/bar-nav-utils.d.ts +2 -4
  252. package/dist/types/components/ButtonFilled/ButtonFilled.d.ts +5 -11
  253. package/dist/types/components/ButtonUnfilled/ButtonUnfilled.d.ts +13 -10
  254. package/dist/types/components/CardDataViz/CardDataViz.d.ts +32 -0
  255. package/dist/types/components/CardDataViz/index.d.ts +2 -0
  256. package/dist/types/components/CardOverview/CardOverview.d.ts +17 -0
  257. package/dist/types/components/CardOverview/card-overview-controller.d.ts +16 -0
  258. package/dist/types/components/ChartBar/ChartBar.d.ts +12 -1
  259. package/dist/types/components/ChartBar/index.d.ts +2 -1
  260. package/dist/types/components/Menu/Menu.d.ts +0 -4
  261. package/dist/types/components/Menu/menu-sections.d.ts +4 -0
  262. package/dist/types/components/Menu/menu-types.d.ts +2 -11
  263. package/dist/types/components/MobileHeader/MobileHeader.d.ts +0 -5
  264. package/dist/types/components/MobileSectionSwitcher/MobileSectionSwitcher.d.ts +0 -2
  265. package/dist/types/components/PanelTools/PanelTools.d.ts +0 -4
  266. package/dist/types/components/PanelTools/index.d.ts +1 -1
  267. package/dist/types/components/PanelTools/panel-tools-types.d.ts +21 -7
  268. package/dist/types/components/PanelTools/panel-tools-utils.d.ts +1 -1
  269. package/dist/types/components/Select/Select.d.ts +12 -4
  270. package/dist/types/components/Select/index.d.ts +1 -1
  271. package/dist/types/components/ShellApp/ShellApp.d.ts +98 -0
  272. package/dist/types/components/ShellApp/shell-app-types.d.ts +92 -0
  273. package/dist/types/components/ShellPage/ShellPage.d.ts +5 -0
  274. package/dist/types/components/ShellTools/ShellTools.d.ts +2 -2
  275. package/dist/types/components.d.ts +210 -889
  276. package/dist/types/shell/index.d.ts +5 -13
  277. package/dist/types/shell/shell-responsive.d.ts +2 -1
  278. package/dist/types/utils/button-render.d.ts +18 -0
  279. package/dist/types/utils/button-story-foundation.d.ts +9 -0
  280. package/dist/types/utils/button-types.d.ts +11 -0
  281. package/dist/types/utils/form-association.d.ts +23 -0
  282. package/dist/types/utils/index.d.ts +4 -0
  283. package/dist/types/utils/required-validity.d.ts +1 -1
  284. package/dist/types/utils/safe-url.d.ts +12 -0
  285. package/dist/types/utils/select-controller.d.ts +1 -1
  286. package/package.json +16 -8
  287. package/dist/.build-stamp +0 -1
  288. package/dist/angular/ds-card-data-viz-bar.d.ts +0 -18
  289. package/dist/angular/ds-card-data-viz-bar.js +0 -42
  290. package/dist/angular/ds-card-data-viz-donut.d.ts +0 -18
  291. package/dist/angular/ds-card-data-viz-line.d.ts +0 -18
  292. package/dist/angular/ds-card-data-viz-line.js +0 -42
  293. package/dist/angular/ds-card-shell-data-viz.d.ts +0 -12
  294. package/dist/angular/ds-card-shell-data-viz.js +0 -38
  295. package/dist/angular/ds-chart-bar-stacked.d.ts +0 -12
  296. package/dist/angular/ds-chart-bar-stacked.js +0 -38
  297. package/dist/angular/ds-select-multi.d.ts +0 -28
  298. package/dist/angular/ds-select-multi.js +0 -49
  299. package/dist/angular/ds-shell-gradient-picker.d.ts +0 -16
  300. package/dist/angular/ds-shell-gradient-picker.js +0 -42
  301. package/dist/angular/ds-shell-gradient-swatch.d.ts +0 -16
  302. package/dist/angular/ds-shell-gradient-swatch.js +0 -42
  303. package/dist/components/ds-card-data-viz-bar.d.ts +0 -11
  304. package/dist/components/ds-card-data-viz-bar.js +0 -2
  305. package/dist/components/ds-card-data-viz-bar.js.map +0 -1
  306. package/dist/components/ds-card-data-viz-donut.d.ts +0 -11
  307. package/dist/components/ds-card-data-viz-donut.js +0 -2
  308. package/dist/components/ds-card-data-viz-donut.js.map +0 -1
  309. package/dist/components/ds-card-data-viz-line.d.ts +0 -11
  310. package/dist/components/ds-card-data-viz-line.js +0 -2
  311. package/dist/components/ds-card-data-viz-line.js.map +0 -1
  312. package/dist/components/ds-card-shell-data-viz.d.ts +0 -11
  313. package/dist/components/ds-card-shell-data-viz.js +0 -2
  314. package/dist/components/ds-card-shell-data-viz.js.map +0 -1
  315. package/dist/components/ds-chart-bar-stacked.d.ts +0 -11
  316. package/dist/components/ds-chart-bar-stacked.js +0 -2
  317. package/dist/components/ds-chart-bar-stacked.js.map +0 -1
  318. package/dist/components/ds-select-multi.js +0 -2
  319. package/dist/components/ds-select-multi.js.map +0 -1
  320. package/dist/components/ds-shell-gradient-picker.d.ts +0 -11
  321. package/dist/components/ds-shell-gradient-picker.js +0 -2
  322. package/dist/components/ds-shell-gradient-picker.js.map +0 -1
  323. package/dist/components/ds-shell-gradient-swatch.d.ts +0 -11
  324. package/dist/components/ds-shell-gradient-swatch.js +0 -2
  325. package/dist/components/ds-shell-gradient-swatch.js.map +0 -1
  326. package/dist/components/p-2foAUsDN.js +0 -2
  327. package/dist/components/p-2foAUsDN.js.map +0 -1
  328. package/dist/components/p-8GK7B7K4.js +0 -2
  329. package/dist/components/p-8GK7B7K4.js.map +0 -1
  330. package/dist/components/p-B5tMlca-.js +0 -2
  331. package/dist/components/p-B5tMlca-.js.map +0 -1
  332. package/dist/components/p-B88n0pO3.js +0 -2
  333. package/dist/components/p-B88n0pO3.js.map +0 -1
  334. package/dist/components/p-BBePKRHC.js +0 -2
  335. package/dist/components/p-BBePKRHC.js.map +0 -1
  336. package/dist/components/p-BOQnc-M4.js +0 -2
  337. package/dist/components/p-BOQnc-M4.js.map +0 -1
  338. package/dist/components/p-BgGP65Nn.js.map +0 -1
  339. package/dist/components/p-BrusnEYP.js +0 -2
  340. package/dist/components/p-BrusnEYP.js.map +0 -1
  341. package/dist/components/p-C61yJkfr.js +0 -2
  342. package/dist/components/p-C61yJkfr.js.map +0 -1
  343. package/dist/components/p-CCzG5xDD.js.map +0 -1
  344. package/dist/components/p-CGVXbXv9.js +0 -2
  345. package/dist/components/p-CGVXbXv9.js.map +0 -1
  346. package/dist/components/p-CH3w-P2H.js +0 -2
  347. package/dist/components/p-CH3w-P2H.js.map +0 -1
  348. package/dist/components/p-Cuqxh-Tq.js +0 -2
  349. package/dist/components/p-Cuqxh-Tq.js.map +0 -1
  350. package/dist/components/p-D1HFMTdC.js +0 -2
  351. package/dist/components/p-D1HFMTdC.js.map +0 -1
  352. package/dist/components/p-D2x17ei-.js +0 -2
  353. package/dist/components/p-D2x17ei-.js.map +0 -1
  354. package/dist/components/p-DLZm_-sU.js +0 -2
  355. package/dist/components/p-DLZm_-sU.js.map +0 -1
  356. package/dist/components/p-DjKkSqrG.js +0 -2
  357. package/dist/components/p-DjKkSqrG.js.map +0 -1
  358. package/dist/components/p-DjbTFy2B.js.map +0 -1
  359. package/dist/components/p-DlscFn2m.js +0 -2
  360. package/dist/components/p-DlscFn2m.js.map +0 -1
  361. package/dist/components/p-DxkEC0hR.js +0 -2
  362. package/dist/components/p-DxkEC0hR.js.map +0 -1
  363. package/dist/components/p-Re2kPrXm.js +0 -2
  364. package/dist/components/p-Re2kPrXm.js.map +0 -1
  365. package/dist/components/p-XMZCaXs7.js +0 -2
  366. package/dist/components/p-XMZCaXs7.js.map +0 -1
  367. package/dist/components/p-dyUp3Adm.js +0 -2
  368. package/dist/components/p-dyUp3Adm.js.map +0 -1
  369. package/dist/components/p-nkYN0Bub.js +0 -2
  370. package/dist/components/p-nkYN0Bub.js.map +0 -1
  371. package/dist/framework/select-multi-value-accessor.d.ts +0 -9
  372. package/dist/framework/select-multi-value-accessor.js +0 -40
  373. package/dist/lib/shell/badge-gradient-ring.d.ts +0 -27
  374. package/dist/lib/shell/chrome-transition.d.ts +0 -32
  375. package/dist/lib/shell/shell-chrome-metrics.d.ts +0 -11
  376. package/dist/lib/shell/shell-gradient.d.ts +0 -41
  377. package/dist/lib/shell/shell-view-transition.d.ts +0 -23
  378. package/dist/mcp-data/registry/card-data-viz-bar.json +0 -213
  379. package/dist/mcp-data/registry/card-data-viz-donut.json +0 -214
  380. package/dist/mcp-data/registry/card-data-viz-line.json +0 -207
  381. package/dist/mcp-data/registry/card-shell-data-viz.json +0 -180
  382. package/dist/mcp-data/registry/chart-bar-stacked.json +0 -230
  383. package/dist/mcp-data/registry/select-multi.json +0 -758
  384. package/dist/mcp-data/registry/shell-gradient-picker.json +0 -195
  385. package/dist/mcp-data/registry/shell-gradient-swatch.json +0 -215
  386. package/dist/react/ds-card-data-viz-bar.d.ts +0 -12
  387. package/dist/react/ds-card-data-viz-bar.js +0 -12
  388. package/dist/react/ds-card-data-viz-donut.d.ts +0 -12
  389. package/dist/react/ds-card-data-viz-donut.js +0 -12
  390. package/dist/react/ds-card-data-viz-line.d.ts +0 -12
  391. package/dist/react/ds-card-data-viz-line.js +0 -12
  392. package/dist/react/ds-card-shell-data-viz.d.ts +0 -9
  393. package/dist/react/ds-card-shell-data-viz.js +0 -12
  394. package/dist/react/ds-chart-bar-stacked.d.ts +0 -9
  395. package/dist/react/ds-chart-bar-stacked.js +0 -12
  396. package/dist/react/ds-select-multi.d.ts +0 -14
  397. package/dist/react/ds-select-multi.js +0 -16
  398. package/dist/react/ds-shell-gradient-picker.d.ts +0 -12
  399. package/dist/react/ds-shell-gradient-picker.js +0 -12
  400. package/dist/react/ds-shell-gradient-swatch.d.ts +0 -12
  401. package/dist/react/ds-shell-gradient-swatch.js +0 -12
  402. package/dist/types/components/CardDataVizBar/CardDataVizBar.d.ts +0 -24
  403. package/dist/types/components/CardDataVizBar/index.d.ts +0 -2
  404. package/dist/types/components/CardDataVizDonut/CardDataVizDonut.d.ts +0 -28
  405. package/dist/types/components/CardDataVizDonut/index.d.ts +0 -2
  406. package/dist/types/components/CardDataVizLine/CardDataVizLine.d.ts +0 -24
  407. package/dist/types/components/CardDataVizLine/index.d.ts +0 -2
  408. package/dist/types/components/CardShellDataViz/CardShellDataViz.d.ts +0 -13
  409. package/dist/types/components/CardShellDataViz/index.d.ts +0 -2
  410. package/dist/types/components/ChartBarStacked/ChartBarStacked.d.ts +0 -26
  411. package/dist/types/components/ChartBarStacked/index.d.ts +0 -3
  412. package/dist/types/components/SelectMulti/SelectMulti.d.ts +0 -121
  413. package/dist/types/components/SelectMulti/index.d.ts +0 -2
  414. package/dist/types/components/ShellGradientPicker/ShellGradientPicker.d.ts +0 -12
  415. package/dist/types/components/ShellGradientSwatch/ShellGradientSwatch.d.ts +0 -15
  416. package/dist/types/components/ShellGradientSwatch/shell-gradient-swatch-types.d.ts +0 -4
  417. /package/dist/components/{p-CgEYdMee.js.map → p-6qXDqCj_.js.map} +0 -0
  418. /package/dist/components/{p-Cr3tEx7o.js.map → p-Ay1AX7Ql.js.map} +0 -0
  419. /package/dist/components/{p-BOCfICln.js.map → p-B1cbQ0SG.js.map} +0 -0
  420. /package/dist/components/{p-BKOlvCGS.js.map → p-BUZXuod2.js.map} +0 -0
  421. /package/dist/components/{p-DCvA3Dc9.js.map → p-BaUsq_VK.js.map} +0 -0
  422. /package/dist/components/{p-BO5aqZcf.js.map → p-BcTYhmku.js.map} +0 -0
  423. /package/dist/components/{p-BDKtu6Wb.js.map → p-BroVnDzE.js.map} +0 -0
  424. /package/dist/components/{p-CIiBpjCn.js.map → p-BsoqsbBh.js.map} +0 -0
  425. /package/dist/components/{p-C8HU4W8q.js.map → p-CBazaRlE.js.map} +0 -0
  426. /package/dist/components/{p-BhV5e6vF.js.map → p-CHuh71-U.js.map} +0 -0
  427. /package/dist/components/{p-CChcuL04.js.map → p-CMWata9g.js.map} +0 -0
  428. /package/dist/components/{p-DRnIuCiT.js.map → p-DeQwkbT1.js.map} +0 -0
  429. /package/dist/components/{p-Cuih680v.js.map → p-Df17mJqI.js.map} +0 -0
  430. /package/dist/components/{p-YR1XeuZf.js.map → p-ohsLFap_.js.map} +0 -0
@@ -0,0 +1,241 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "card-data-viz",
4
+ "title": "CardDataViz",
5
+ "description": "Standard data-visualization card chrome with variant-owned chart and legend composition.",
6
+ "type": "registry:ui",
7
+ "meta": {
8
+ "library": "@ds-mo/ui",
9
+ "distribution": "npm",
10
+ "storybook": "https://zainadeel.github.io/compomo/?path=/story/card-data-viz",
11
+ "source": "src/wc/components/CardDataViz/CardDataViz.tsx",
12
+ "intentStatus": "complete",
13
+ "intent": {
14
+ "audience": "specialized",
15
+ "status": "experimental",
16
+ "summary": "Standard data-visualization card chrome with variant-owned chart and legend composition.",
17
+ "useWhen": [
18
+ "A chart, legend, metric visualization, or custom data-viz composition needs standard card chrome.",
19
+ "Bar and line legends should remain static, or a donut and legend should cross-highlight without redundant donut tooltips.",
20
+ "A data-viz card needs a visible heading, optional filter action, and application-owned chart data."
21
+ ],
22
+ "avoidWhen": [
23
+ "The card contains editable settings; use CardSetting.",
24
+ "The surface contains ordinary non-visualization content.",
25
+ "The application needs to replace the card chrome rather than compose its chart and actions."
26
+ ],
27
+ "alternatives": [
28
+ {
29
+ "when": "The surface contains editable settings.",
30
+ "component": "component:ds-card-setting",
31
+ "reason": "CardSetting owns the controlled settings-section workflow."
32
+ }
33
+ ],
34
+ "commonlyComposedWith": [
35
+ "component:ds-chart-bar",
36
+ "component:ds-chart-donut",
37
+ "component:ds-chart-line",
38
+ "component:ds-chart-legend",
39
+ "component:ds-button-unfilled"
40
+ ],
41
+ "accessibility": [
42
+ "Provide a concise visible heading; the component renders it as a section heading.",
43
+ "Slotted actions must provide accessible names and controlled-state semantics.",
44
+ "Charts retain their own image names and data summaries.",
45
+ "A visible donut legend owns persistent labels and values, so donut mode suppresses the redundant slice tooltip."
46
+ ],
47
+ "states": [
48
+ "Custom mode provides flexible body chrome and does not mutate chart or legend interaction.",
49
+ "Bar and line modes keep a slotted legend static by disabling hover emphasis.",
50
+ "Donut mode synchronizes active labels between chart and legend and shows chart tooltips only when no legend is present.",
51
+ "showFilter adds the standard filter action and emits dsFilterClick without owning filter state."
52
+ ],
53
+ "responsiveBehavior": [
54
+ "The sm, md, or lg width sets a matching token-based minimum height and remains constrained by its parent.",
55
+ "The body allocates remaining height to the chart while legends retain content height.",
56
+ "Parent layouts own wrapping, stacking, and breakpoint-dependent card width."
57
+ ],
58
+ "frameworkCaveats": {
59
+ "customElements": [
60
+ "Set variant to bar, line, or donut when the component should manage legend interaction; slot chart, legend, actions, and supporting content by name."
61
+ ],
62
+ "react": [
63
+ "Keep chart data in React and pass chart, legend, and action elements through named slots."
64
+ ],
65
+ "angular": [
66
+ "Keep chart data in Angular and project chart, legend, and action elements through named slots."
67
+ ]
68
+ },
69
+ "references": [
70
+ {
71
+ "label": "Storybook examples",
72
+ "path": "src/wc/components/CardDataViz/CardDataViz.stories.ts"
73
+ }
74
+ ]
75
+ },
76
+ "api": {
77
+ "props": {
78
+ "cardWidth": {
79
+ "type": "CardDataVizWidth",
80
+ "resolvedType": "\"lg\" | \"md\" | \"sm\"",
81
+ "attribute": "card-width",
82
+ "default": "'md'",
83
+ "required": false,
84
+ "mutable": false,
85
+ "description": "Width token with the matching data-visualization card min-height."
86
+ },
87
+ "filterLabel": {
88
+ "type": "string",
89
+ "resolvedType": "string",
90
+ "attribute": "filter-label",
91
+ "default": "'Filter'",
92
+ "required": false,
93
+ "mutable": false
94
+ },
95
+ "heading": {
96
+ "type": "string",
97
+ "resolvedType": "string",
98
+ "attribute": "heading",
99
+ "required": true,
100
+ "mutable": false,
101
+ "description": "Data-visualization heading shown in the card header."
102
+ },
103
+ "showFilter": {
104
+ "type": "boolean",
105
+ "resolvedType": "boolean",
106
+ "attribute": "show-filter",
107
+ "default": "false",
108
+ "required": false,
109
+ "mutable": false,
110
+ "description": "Renders the standard filter action before custom actions."
111
+ },
112
+ "variant": {
113
+ "type": "CardDataVizVariant",
114
+ "resolvedType": "\"bar\" | \"custom\" | \"donut\" | \"line\"",
115
+ "attribute": "variant",
116
+ "default": "'custom'",
117
+ "required": false,
118
+ "mutable": false,
119
+ "description": "Chart composition behavior."
120
+ }
121
+ },
122
+ "events": [
123
+ {
124
+ "name": "dsFilterClick",
125
+ "detail": "void",
126
+ "bubbles": true,
127
+ "cancelable": true,
128
+ "composed": true,
129
+ "description": "Emits when the standard header filter control is activated."
130
+ }
131
+ ],
132
+ "methods": [],
133
+ "slots": []
134
+ },
135
+ "props": {
136
+ "cardWidth": {
137
+ "type": "CardDataVizWidth",
138
+ "resolvedType": "\"lg\" | \"md\" | \"sm\"",
139
+ "attribute": "card-width",
140
+ "default": "'md'",
141
+ "required": false,
142
+ "mutable": false,
143
+ "description": "Width token with the matching data-visualization card min-height."
144
+ },
145
+ "filterLabel": {
146
+ "type": "string",
147
+ "resolvedType": "string",
148
+ "attribute": "filter-label",
149
+ "default": "'Filter'",
150
+ "required": false,
151
+ "mutable": false
152
+ },
153
+ "heading": {
154
+ "type": "string",
155
+ "resolvedType": "string",
156
+ "attribute": "heading",
157
+ "required": true,
158
+ "mutable": false,
159
+ "description": "Data-visualization heading shown in the card header."
160
+ },
161
+ "showFilter": {
162
+ "type": "boolean",
163
+ "resolvedType": "boolean",
164
+ "attribute": "show-filter",
165
+ "default": "false",
166
+ "required": false,
167
+ "mutable": false,
168
+ "description": "Renders the standard filter action before custom actions."
169
+ },
170
+ "variant": {
171
+ "type": "CardDataVizVariant",
172
+ "resolvedType": "\"bar\" | \"custom\" | \"donut\" | \"line\"",
173
+ "attribute": "variant",
174
+ "default": "'custom'",
175
+ "required": false,
176
+ "mutable": false,
177
+ "description": "Chart composition behavior."
178
+ }
179
+ },
180
+ "events": [
181
+ {
182
+ "name": "dsFilterClick",
183
+ "detail": "void",
184
+ "bubbles": true,
185
+ "cancelable": true,
186
+ "composed": true,
187
+ "description": "Emits when the standard header filter control is activated."
188
+ }
189
+ ],
190
+ "methods": [],
191
+ "slots": [],
192
+ "exports": {
193
+ "customElement": "ds-card-data-viz",
194
+ "react": "DsCardDataViz",
195
+ "angular": "DsCardDataViz"
196
+ },
197
+ "consumption": {
198
+ "install": "npm install @ds-mo/ui @ds-mo/tokens @ds-mo/icons",
199
+ "cssSetup": "import '@ds-mo/tokens';\nimport '@ds-mo/tokens/reset';\nimport '@ds-mo/tokens/globals';",
200
+ "customElements": {
201
+ "import": "import '@ds-mo/ui/dist/components/ds-card-data-viz.js';",
202
+ "example": "<ds-card-data-viz></ds-card-data-viz>"
203
+ },
204
+ "react": {
205
+ "import": "import { DsCardDataViz } from '@ds-mo/ui/react';",
206
+ "example": "<DsCardDataViz />"
207
+ },
208
+ "angular": {
209
+ "import": "import { DsCardDataViz } from '@ds-mo/ui/angular/ds-card-data-viz';",
210
+ "example": "<ds-card-data-viz></ds-card-data-viz>"
211
+ },
212
+ "peerDependencies": {
213
+ "required": [
214
+ "@ds-mo/tokens ^5.0.0",
215
+ "@ds-mo/icons ^6.4.0"
216
+ ],
217
+ "frameworks": "Custom Elements; React 18/19 wrappers; Angular 19-22 standalone adapters."
218
+ }
219
+ }
220
+ },
221
+ "dependencies": [
222
+ "@ds-mo/ui",
223
+ "@ds-mo/tokens"
224
+ ],
225
+ "registryDependencies": [
226
+ "button-unfilled",
227
+ "text"
228
+ ],
229
+ "files": [
230
+ {
231
+ "path": "src/wc/components/CardDataViz/CardDataViz.css",
232
+ "content": "@import '../../utils/chrome-layout.css';\n\n:host {\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n width: var(--_card-data-viz-width);\n min-height: var(--_card-data-viz-min-height);\n max-width: 100%;\n overflow: hidden;\n border: none;\n border-radius: var(--dimension-radius-025);\n background-color: var(--color-background-primary);\n box-shadow: 0 0 0 var(--dimension-stroke-width-012) var(--color-border-tertiary);\n}\n\n.card-data-viz__header {\n flex-shrink: 0;\n justify-content: space-between;\n height: var(--dimension-size-600);\n border-bottom: var(--dimension-stroke-width-012) solid var(--color-border-tertiary);\n background-color: var(--color-background-secondary);\n}\n\nds-text.card-data-viz__title {\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n box-sizing: border-box;\n min-width: 0;\n padding: calc(var(--dimension-space-075) + var(--dimension-space-025));\n -webkit-user-select: none;\n user-select: none;\n}\n\n.card-data-viz__actions {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n gap: var(--dimension-space-100);\n}\n\n.card-data-viz__actions:empty {\n display: none;\n}\n\n.card-data-viz__body,\n.card-data-viz__layout {\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n box-sizing: border-box;\n min-height: 0;\n}\n\n.card-data-viz__body {\n border-radius: 0 0 var(--dimension-radius-025) var(--dimension-radius-025);\n background-color: var(--color-background-primary);\n}\n\n.card-data-viz__layout {\n height: 100%;\n gap: var(--dimension-space-200);\n}\n\n.card-data-viz__chart {\n display: grid;\n flex: 1 1 auto;\n align-items: center;\n box-sizing: border-box;\n min-height: 0;\n padding: var(--dimension-space-400) var(--dimension-space-400) 0\n var(--dimension-space-400);\n}\n\n.card-data-viz__chart > * {\n width: 100%;\n height: 100%;\n min-width: 0;\n min-height: 0;\n max-width: 100%;\n max-height: 100%;\n}\n\n.card-data-viz__chart--fill > * {\n height: 100%;\n min-height: 0;\n max-height: 100%;\n}\n\n.card-data-viz__legend {\n flex: 0 0 auto;\n box-sizing: border-box;\n padding: 0 var(--dimension-space-100) var(--dimension-space-100)\n var(--dimension-space-100);\n}\n",
233
+ "type": "registry:ui"
234
+ },
235
+ {
236
+ "path": "src/wc/components/CardDataViz/CardDataViz.tsx",
237
+ "content": "import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n State,\n} from '@stencil/core';\n\nexport type CardDataVizWidth = 'sm' | 'md' | 'lg';\nexport type CardDataVizVariant = 'custom' | 'bar' | 'line' | 'donut';\n\ntype HoveredDatum = { label: string } | null;\n\ntype ChartSlot = HTMLElement & {\n activeLabel?: string | null;\n showTooltip?: boolean;\n};\n\ntype LegendSlot = HTMLElement & {\n activeLabel?: string | null;\n highlightOnHover?: boolean;\n};\n\nconst CARD_WIDTH_VARS: Record<CardDataVizWidth, string> = {\n sm: 'var(--dimension-card-width-sm)',\n md: 'var(--dimension-card-width-md)',\n lg: 'var(--dimension-card-width-lg)',\n};\n\nconst CARD_HEIGHT_VARS: Record<CardDataVizWidth, string> = {\n sm: 'var(--dimension-card-height-sm)',\n md: 'var(--dimension-card-height-md)',\n lg: 'var(--dimension-card-height-lg)',\n};\n\n/**\n * Standard data-visualization card chrome and composition. The variant owns\n * only the chart/legend relationship; applications continue to own data.\n */\n@Component({\n tag: 'ds-card-data-viz',\n styleUrl: 'CardDataViz.css',\n scoped: true,\n})\nexport class CardDataViz {\n @Element() el!: HTMLElement;\n\n /** Data-visualization heading shown in the card header. */\n @Prop() heading!: string;\n /** Chart composition behavior. */\n @Prop() variant: CardDataVizVariant = 'custom';\n /** Width token with the matching data-visualization card min-height. */\n @Prop() cardWidth: CardDataVizWidth = 'md';\n /** Renders the standard filter action before custom actions. */\n @Prop() showFilter: boolean = false;\n @Prop() filterLabel: string = 'Filter';\n\n /** Emits when the standard header filter control is activated. */\n @Event() dsFilterClick!: EventEmitter<void>;\n\n @State() private hasChartSlot = false;\n @State() private hasLegendSlot = false;\n\n componentWillRender() {\n this.hasChartSlot = !!this.el.querySelector('[slot=\"chart\"]');\n this.hasLegendSlot = !!this.el.querySelector('[slot=\"legend\"]');\n }\n\n componentDidLoad() {\n this.el.addEventListener('dsSliceHover', this.handleChartHover);\n this.el.addEventListener('dsItemHover', this.handleLegendHover);\n }\n\n componentDidRender() {\n const chart = this.el.querySelector('[slot=\"chart\"]') as ChartSlot | null;\n const legend = this.el.querySelector(\n 'ds-chart-legend[slot=\"legend\"]'\n ) as LegendSlot | null;\n\n if (this.variant === 'donut') {\n if (chart && 'showTooltip' in chart) {\n chart.showTooltip = !this.hasLegendSlot;\n }\n return;\n }\n\n if (\n (this.variant === 'bar' || this.variant === 'line') &&\n legend\n ) {\n legend.setAttribute('highlight-on-hover', 'false');\n if ('highlightOnHover' in legend) legend.highlightOnHover = false;\n }\n }\n\n disconnectedCallback() {\n this.el.removeEventListener('dsSliceHover', this.handleChartHover);\n this.el.removeEventListener('dsItemHover', this.handleLegendHover);\n }\n\n private handleChartHover = (event: Event) => {\n if (this.variant !== 'donut') return;\n const legend = this.el.querySelector('[slot=\"legend\"]') as LegendSlot | null;\n if (!legend || !('activeLabel' in legend)) return;\n legend.activeLabel =\n (event as CustomEvent<HoveredDatum>).detail?.label ?? null;\n };\n\n private handleLegendHover = (event: Event) => {\n if (this.variant !== 'donut') return;\n const chart = this.el.querySelector('[slot=\"chart\"]') as ChartSlot | null;\n if (!chart || !('activeLabel' in chart)) return;\n chart.activeLabel =\n (event as CustomEvent<HoveredDatum>).detail?.label ?? null;\n };\n\n private handleFilterClick = () => {\n this.dsFilterClick.emit();\n };\n\n render() {\n const usesChartLayout = this.variant !== 'custom' || this.hasChartSlot;\n return (\n <Host\n class={{\n 'card-data-viz': true,\n [`card-data-viz--${this.variant}`]: true,\n }}\n style={{\n '--_card-data-viz-width': CARD_WIDTH_VARS[this.cardWidth],\n '--_card-data-viz-min-height': CARD_HEIGHT_VARS[this.cardWidth],\n }}\n >\n <header class=\"card-data-viz__header ds-chrome-row ds-chrome-space--md\">\n <ds-text\n class=\"card-data-viz__title\"\n variant=\"text-title-small\"\n emphasis\n color=\"primary\"\n as=\"h2\"\n >\n {this.heading}\n </ds-text>\n <div class=\"card-data-viz__actions\">\n {this.showFilter ? (\n <ds-button-unfilled\n variant=\"icon\"\n type=\"button\"\n icon=\"Filters\"\n aria-label={this.filterLabel}\n onDsClick={this.handleFilterClick}\n />\n ) : null}\n <slot name=\"actions\" />\n </div>\n </header>\n <div class=\"card-data-viz__body\">\n {usesChartLayout ? (\n <div class=\"card-data-viz__layout\">\n {this.hasChartSlot ? (\n <div\n class={{\n 'card-data-viz__chart': true,\n 'card-data-viz__chart--fill': this.variant === 'donut',\n }}\n >\n <slot name=\"chart\" />\n </div>\n ) : null}\n {this.hasLegendSlot ? (\n <div class=\"card-data-viz__legend\">\n <slot name=\"legend\" />\n </div>\n ) : null}\n <slot />\n </div>\n ) : (\n <slot />\n )}\n </div>\n </Host>\n );\n }\n}\n",
238
+ "type": "registry:ui"
239
+ }
240
+ ]
241
+ }
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
3
  "name": "card-overview",
4
4
  "title": "CardOverview",
5
- "description": "Page-level summary card pairing one headline score with a reporting period, an application-owned period control, and a responsive grid of comparable measures, with an optional compact 48px presentation.",
5
+ "description": "Page-level summary card pairing one headline score with a reporting period, an application-owned period control, and a responsive grid of comparable measures, with an optional elevated scroll-collapse surface and compact 48px presentation.",
6
6
  "type": "registry:ui",
7
7
  "meta": {
8
8
  "library": "@ds-mo/ui",
@@ -13,7 +13,7 @@
13
13
  "intent": {
14
14
  "audience": "general",
15
15
  "status": "experimental",
16
- "summary": "Page-level summary card pairing one headline score with a reporting period, an application-owned period control, and a responsive grid of comparable measures, with an optional compact 48px presentation.",
16
+ "summary": "Page-level summary card pairing one headline score with a reporting period, an application-owned period control, and a responsive grid of comparable measures, with an optional elevated scroll-collapse surface and compact 48px presentation.",
17
17
  "useWhen": [
18
18
  "A page opens with one headline figure that the surrounding measures explain.",
19
19
  "Every measure is compared against the same period, so one caption describes the comparison for all of them.",
@@ -28,8 +28,8 @@
28
28
  "alternatives": [
29
29
  {
30
30
  "when": "A measure needs a chart or other data visualization.",
31
- "component": "component:ds-card-shell-data-viz",
32
- "reason": "CardShellDataViz owns the data-visualization shell contract; the overview grid presents values and change only."
31
+ "component": "component:ds-card-data-viz",
32
+ "reason": "CardDataViz owns the data-visualization card contract; the overview grid presents values and change only."
33
33
  },
34
34
  {
35
35
  "when": "The surface is a settings section with an edit workflow.",
@@ -59,6 +59,7 @@
59
59
  "Loading replaces the score and the measures with skeletons and does not alter the slotted period control.",
60
60
  "At most six measures are shown. Keep larger collections outside the summary bar rather than turning it into a dense dashboard.",
61
61
  "The period control is slotted rather than owned, because the choice of stepper, select, or date range varies by product surface.",
62
+ "During a page-controlled scroll collapse, the component preserves its expanded flow height while the elevated visual surface shrinks toward 48px and the full content translates upward inside an internal clip. The elevation remains fitted to the visible surface instead of being clipped with the content.",
62
63
  "compact is exactly 48px high and keeps only the score label, score value, trend, reporting copy, and slotted period control. It omits the score band, measures, and footer."
63
64
  ],
64
65
  "responsiveBehavior": [
@@ -70,20 +71,24 @@
70
71
  "In that stacked summary, the score and trend share one line at the start, while the score band is hidden to preserve space. The period control stays at the upper end, while the current period and comparison sit on separate right-aligned lines beside the score.",
71
72
  "Every measure occupies a full-width row in the stacked state.",
72
73
  "Set layout to stacked when the owning page shell enters a responsive mode before the card's own container reaches its narrow threshold.",
73
- "CardOverview does not observe scroll or choose its own presentation. The page owner may use compact as sticky summary chrome on supported breakpoints."
74
+ "CardOverview does not observe scroll, choose sticky offsets, or switch its own presentation. The page owner supplies collapse progress, keeps the card sticky at the appropriate shell inset, and swaps to compact at the 48px endpoint.",
75
+ "Leave scroll collapse inactive on page modes that do not support sticky compact summary chrome."
74
76
  ],
75
77
  "frameworkCaveats": {
76
78
  "customElements": [
77
79
  "Assign score and metrics as JavaScript properties; both are objects and cannot be expressed as HTML attributes.",
78
- "Place the period control in the filter slot; the component reserves space for it but never renders one."
80
+ "Place the period control in the filter slot; the component reserves space for it but never renders one.",
81
+ "When driving scroll collapse, update scrollCollapseProgress from page-owned geometry and swap to a separate compact presentation at the endpoint."
79
82
  ],
80
83
  "react": [
81
84
  "Pass score and metrics as props and read the selected measure from the onDsMetricSelect event detail.",
82
- "Derive each trend with resolveMetricTrend so tone stays an explicit product decision."
85
+ "Derive each trend with resolveMetricTrend so tone stays an explicit product decision.",
86
+ "Keep sticky geometry and scrollCollapseProgress in the page owner; CardOverview only renders the visual collapse."
83
87
  ],
84
88
  "angular": [
85
89
  "Bind [score] and [metrics] as properties and read the selected measure from $event.detail on (dsMetricSelect).",
86
- "Derive each trend with resolveMetricTrend so tone stays an explicit product decision."
90
+ "Derive each trend with resolveMetricTrend so tone stays an explicit product decision.",
91
+ "Keep sticky geometry and [scrollCollapseProgress] in the page owner; CardOverview only renders the visual collapse."
87
92
  ]
88
93
  },
89
94
  "references": [
@@ -176,6 +181,15 @@
176
181
  "mutable": false,
177
182
  "description": "Message shown in place of the score when its figure cannot be resolved."
178
183
  },
184
+ "scrollCollapseProgress": {
185
+ "type": "number",
186
+ "resolvedType": "number",
187
+ "attribute": "scroll-collapse-progress",
188
+ "default": "0",
189
+ "required": false,
190
+ "mutable": false,
191
+ "description": "Page-controlled visual collapse from the full card (`0`) toward its 48px\ncompact handoff height (`1`). The component preserves its expanded flow\nheight, keeps elevation on the shrinking surface, and clips translated\ncontent internally. The page still owns sticky positioning and the final\nswap to `variant=\"compact\"`."
192
+ },
179
193
  "variant": {
180
194
  "type": "CardOverviewVariant",
181
195
  "resolvedType": "\"compact\" | \"default\"",
@@ -277,6 +291,15 @@
277
291
  "mutable": false,
278
292
  "description": "Message shown in place of the score when its figure cannot be resolved."
279
293
  },
294
+ "scrollCollapseProgress": {
295
+ "type": "number",
296
+ "resolvedType": "number",
297
+ "attribute": "scroll-collapse-progress",
298
+ "default": "0",
299
+ "required": false,
300
+ "mutable": false,
301
+ "description": "Page-controlled visual collapse from the full card (`0`) toward its 48px\ncompact handoff height (`1`). The component preserves its expanded flow\nheight, keeps elevation on the shrinking surface, and clips translated\ncontent internally. The page still owns sticky positioning and the final\nswap to `variant=\"compact\"`."
302
+ },
280
303
  "variant": {
281
304
  "type": "CardOverviewVariant",
282
305
  "resolvedType": "\"compact\" | \"default\"",
@@ -343,12 +366,17 @@
343
366
  "files": [
344
367
  {
345
368
  "path": "src/wc/components/CardOverview/CardOverview.css",
346
- "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/*\n * A permanently dark surface, independent of the page theme, so the summary bar\n * reads the same on every product surface. Every foreground, border, and\n * interaction token below therefore comes from the always-dark family rather\n * than the theme-reactive one.\n */\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 border-radius: var(--dimension-radius-050);\n background: var(--color-always-dark-background);\n color: var(--color-always-dark-foreground-primary);\n /*\n * Clips the square-cornered metric washes to the card radius. The outer\n * elevation shadow is painted outside the border box and is unaffected, and\n * the inset highlight is meant to sit exactly on this edge.\n */\n overflow: hidden;\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__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/*\n * A permanently dark surface, independent of the page theme, so the summary bar\n * reads the same on every product surface. Every foreground, border, and\n * interaction token below therefore comes from the always-dark family rather\n * than the theme-reactive one.\n */\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: clip;\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-reference-dark-red-30-l70-c20-bold);\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",
347
370
  "type": "registry:ui"
348
371
  },
349
372
  {
350
373
  "path": "src/wc/components/CardOverview/CardOverview.tsx",
351
- "content": "import { Component, Element, Event, EventEmitter, h, Host, Prop, State } from '@stencil/core';\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';\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 /** 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\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 /** Index of the roving tab stop, skipping inactive metrics. */\n private get rovingIndex(): number {\n const first = this.visibleMetrics.findIndex(metric => !metric.isInactive);\n if (first < 0) return -1;\n const current = this.visibleMetrics[this.focusedMetricIndex];\n return current && !current.isInactive ? this.focusedMetricIndex : first;\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 count = metrics.length;\n if (count === 0) return;\n\n for (let offset = 1; offset <= count; offset += 1) {\n // Positive modulo so a backwards step from the first metric wraps to the last.\n const next = (((from + step * offset) % count) + count) % count;\n if (metrics[next]?.isInactive) continue;\n\n this.focusedMetricIndex = next;\n const cells = this.el.querySelectorAll<HTMLElement>('.card-overview__metric');\n cells[next]?.focus();\n return;\n }\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: the default base is the theme's quaternary\n * foreground, which is black and therefore invisible on this permanently dark\n * surface.\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 <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 // The card is permanently dark, so interaction tokens come from that family.\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\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 // 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 role=\"region\"\n aria-label={this.overviewLabel}\n aria-busy={this.isLoading ? 'true' : undefined}\n style={{ '--ds-card-overview-metric-min': this.metricMinWidth }}\n >\n <div\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 </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 // CardOverview is permanently always-dark. Reference-level dark-surface\n // intent tokens avoid theme overrides and retain AA contrast at body size.\n positive: 'var(--color-reference-dark-green-145-l70-c19-bold)',\n negative: 'var(--color-reference-dark-red-30-l70-c20-bold)',\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: the default base is the theme's quaternary\n * foreground, which is black and therefore invisible on this permanently dark\n * surface.\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 // The card is permanently dark, so interaction tokens come from that family.\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
+ "type": "registry:ui"
376
+ },
377
+ {
378
+ "path": "src/wc/components/CardOverview/card-overview-controller.ts",
379
+ "content": "import type { CardOverviewVariant, OverviewMetric } from './card-overview-types';\n\nexport interface CardOverviewCollapseGeometry {\n active: boolean;\n expandedHeight: number;\n offset: number;\n visibleHeight: number;\n}\n\nexport function resolveCardOverviewCollapseGeometry(options: {\n variant: CardOverviewVariant;\n progress: number;\n expandedHeight: number;\n compactHeight: number;\n}): CardOverviewCollapseGeometry {\n const compactHeight = Math.max(0, options.compactHeight);\n const expandedHeight = Math.max(options.expandedHeight, compactHeight);\n const progress =\n options.variant === 'compact' || !Number.isFinite(options.progress)\n ? 0\n : Math.min(1, Math.max(0, options.progress));\n const distance = Math.max(0, expandedHeight - compactHeight);\n const offset = distance * progress;\n\n return {\n active: progress > 0 && distance > 0,\n expandedHeight,\n offset,\n visibleHeight: expandedHeight - offset,\n };\n}\n\nexport function resolveOverviewRovingIndex(\n metrics: readonly OverviewMetric[],\n focusedIndex: number\n): number {\n const first = metrics.findIndex(metric => !metric.isInactive);\n if (first < 0) return -1;\n return metrics[focusedIndex] && !metrics[focusedIndex].isInactive\n ? focusedIndex\n : first;\n}\n\nexport function findNextOverviewMetricIndex(\n metrics: readonly OverviewMetric[],\n from: number,\n step: -1 | 1\n): number {\n for (let offset = 1; offset <= metrics.length; offset += 1) {\n const next = (((from + step * offset) % metrics.length) + metrics.length) % metrics.length;\n if (!metrics[next]?.isInactive) return next;\n }\n return -1;\n}\n",
352
380
  "type": "registry:ui"
353
381
  },
354
382
  {
@@ -29,8 +29,8 @@
29
29
  "alternatives": [
30
30
  {
31
31
  "when": "The surface contains a chart or specialized data-visualization composition.",
32
- "component": "component:ds-card-shell-data-viz",
33
- "reason": "CardShellDataViz owns the independently evolving data-visualization shell contract."
32
+ "component": "component:ds-card-data-viz",
33
+ "reason": "CardDataViz owns the independently evolving data-visualization card contract."
34
34
  },
35
35
  {
36
36
  "when": "The task must block the interface for one focused decision or short workflow.",