@ds-mo/ui 12.7.0 → 12.8.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 (311) hide show
  1. package/dist/.build-stamp +1 -1
  2. package/dist/agent-patterns.json +22 -9
  3. package/dist/agent.json +230 -18
  4. package/dist/angular/ds-button-filled.d.ts +1 -1
  5. package/dist/angular/ds-button-filled.js +3 -3
  6. package/dist/angular/ds-button-unfilled.d.ts +1 -1
  7. package/dist/angular/ds-button-unfilled.js +3 -3
  8. package/dist/angular/ds-card-overview.d.ts +19 -0
  9. package/dist/angular/ds-card-overview.js +42 -0
  10. package/dist/angular/index.d.ts +1 -1
  11. package/dist/angular/index.js +1 -0
  12. package/dist/angular/proxies.d.ts +1 -0
  13. package/dist/angular/proxies.js +1 -0
  14. package/dist/components/ds-agent-activity.js +1 -1
  15. package/dist/components/ds-agent-response.js +1 -1
  16. package/dist/components/ds-agent-source-list.js +1 -1
  17. package/dist/components/ds-agent-tool-call.js +1 -1
  18. package/dist/components/ds-attachment-list.js +1 -1
  19. package/dist/components/ds-badge.js +1 -1
  20. package/dist/components/ds-bar-nav.js +1 -1
  21. package/dist/components/ds-bar-title.js +1 -1
  22. package/dist/components/ds-bar-title.js.map +1 -1
  23. package/dist/components/ds-bar-workflow.js +1 -1
  24. package/dist/components/ds-breadcrumb.js +1 -1
  25. package/dist/components/ds-button-filled.js +1 -1
  26. package/dist/components/ds-button-unfilled.js +1 -1
  27. package/dist/components/ds-card-data-viz-bar.js +1 -1
  28. package/dist/components/ds-card-data-viz-bar.js.map +1 -1
  29. package/dist/components/ds-card-data-viz-donut.js +1 -1
  30. package/dist/components/ds-card-data-viz-donut.js.map +1 -1
  31. package/dist/components/ds-card-data-viz-line.js +1 -1
  32. package/dist/components/ds-card-data-viz-line.js.map +1 -1
  33. package/dist/components/ds-card-overview.d.ts +11 -0
  34. package/dist/components/ds-card-overview.js +2 -0
  35. package/dist/components/ds-card-overview.js.map +1 -0
  36. package/dist/components/ds-card-setting.js +1 -1
  37. package/dist/components/ds-card-shell-data-viz.js +1 -1
  38. package/dist/components/ds-chart-bar-stacked.js +1 -1
  39. package/dist/components/ds-chart-bar-stacked.js.map +1 -1
  40. package/dist/components/ds-chart-bar.js +1 -1
  41. package/dist/components/ds-chart-bar.js.map +1 -1
  42. package/dist/components/ds-chart-donut.js +1 -1
  43. package/dist/components/ds-chart-donut.js.map +1 -1
  44. package/dist/components/ds-chart-legend.js +1 -1
  45. package/dist/components/ds-chart-line.js +1 -1
  46. package/dist/components/ds-chart-line.js.map +1 -1
  47. package/dist/components/ds-checkbox.js +1 -1
  48. package/dist/components/ds-chip.js +1 -1
  49. package/dist/components/ds-code-block.js +1 -1
  50. package/dist/components/ds-conversation-list-item.js +1 -1
  51. package/dist/components/ds-conversation-list-item.js.map +1 -1
  52. package/dist/components/ds-conversation-list-section.js +1 -1
  53. package/dist/components/ds-conversation-list.js +1 -1
  54. package/dist/components/ds-conversation-list.js.map +1 -1
  55. package/dist/components/ds-divider.js +1 -1
  56. package/dist/components/ds-empty-state.js +1 -1
  57. package/dist/components/ds-field.js +1 -1
  58. package/dist/components/ds-input.js +1 -1
  59. package/dist/components/ds-markdown.js +1 -1
  60. package/dist/components/ds-menu.js +1 -1
  61. package/dist/components/ds-message-bubble.js +1 -1
  62. package/dist/components/ds-message-composer.js +1 -1
  63. package/dist/components/ds-message-scroller.js +1 -1
  64. package/dist/components/ds-message-scroller.js.map +1 -1
  65. package/dist/components/ds-message.js +1 -1
  66. package/dist/components/ds-mobile-bar-nav.js +1 -1
  67. package/dist/components/ds-mobile-header.js +1 -1
  68. package/dist/components/ds-mobile-section-switcher.js +1 -1
  69. package/dist/components/ds-mobile-sheet-nav.js +1 -1
  70. package/dist/components/ds-modal.js +1 -1
  71. package/dist/components/ds-modal.js.map +1 -1
  72. package/dist/components/ds-panel-nav.js +1 -1
  73. package/dist/components/ds-panel-nav.js.map +1 -1
  74. package/dist/components/ds-panel-sub-nav.js +1 -1
  75. package/dist/components/ds-panel-tool-header.js +1 -1
  76. package/dist/components/ds-panel-tool-search.js +1 -1
  77. package/dist/components/ds-panel-tools.js +1 -1
  78. package/dist/components/ds-radio.js +1 -1
  79. package/dist/components/ds-scroll-overlay.js +1 -1
  80. package/dist/components/ds-scroll-overlay.js.map +1 -1
  81. package/dist/components/ds-select-multi.js +1 -1
  82. package/dist/components/ds-select.js +1 -1
  83. package/dist/components/ds-shell-app.js +1 -1
  84. package/dist/components/ds-shell-app.js.map +1 -1
  85. package/dist/components/ds-shell-gradient-picker.js +1 -1
  86. package/dist/components/ds-shell-gradient-picker.js.map +1 -1
  87. package/dist/components/ds-shell-gradient-swatch.js +1 -1
  88. package/dist/components/ds-shell-page.js +1 -1
  89. package/dist/components/ds-shell-page.js.map +1 -1
  90. package/dist/components/ds-shell-tools.js +1 -1
  91. package/dist/components/ds-skeleton.js +1 -1
  92. package/dist/components/ds-skeleton.js.map +1 -1
  93. package/dist/components/ds-slider.js +1 -1
  94. package/dist/components/ds-slider.js.map +1 -1
  95. package/dist/components/ds-swatch-picker.js +1 -1
  96. package/dist/components/ds-switch.js +1 -1
  97. package/dist/components/ds-tab-group.js +1 -1
  98. package/dist/components/ds-tag.js +1 -1
  99. package/dist/components/ds-text.js +1 -1
  100. package/dist/components/ds-toast.js +1 -1
  101. package/dist/components/ds-toast.js.map +1 -1
  102. package/dist/components/ds-tooltip-data-viz.js +1 -1
  103. package/dist/components/ds-tooltip.js +1 -1
  104. package/dist/components/ds-typing-indicator.js +1 -1
  105. package/dist/components/p-2foAUsDN.js +2 -0
  106. package/dist/components/p-2foAUsDN.js.map +1 -0
  107. package/dist/components/{p-C9h13YnX.js → p-38PfdMkF.js} +2 -2
  108. package/dist/components/p-69lHhJiX.js +2 -0
  109. package/dist/components/p-69lHhJiX.js.map +1 -0
  110. package/dist/components/{p-CnAkobDW.js → p-B6NvVdeO.js} +2 -2
  111. package/dist/components/p-B6Vuayt6.js +2 -0
  112. package/dist/components/p-B6Vuayt6.js.map +1 -0
  113. package/dist/components/p-B6vE3ujd.js +2 -0
  114. package/dist/components/p-B6vE3ujd.js.map +1 -0
  115. package/dist/components/p-BBePKRHC.js +2 -0
  116. package/dist/components/p-BBePKRHC.js.map +1 -0
  117. package/dist/components/{p-BT5hgg5i.js → p-BFRMwl93.js} +2 -2
  118. package/dist/components/p-BKOlvCGS.js +2 -0
  119. package/dist/components/p-BKOlvCGS.js.map +1 -0
  120. package/dist/components/{p-C7bZ-jiU.js → p-BO5aqZcf.js} +2 -2
  121. package/dist/components/p-BX0BMhgz.js +2 -0
  122. package/dist/components/p-BX0BMhgz.js.map +1 -0
  123. package/dist/components/{p-C_9ZH0A3.js → p-BXaieghV.js} +2 -2
  124. package/dist/components/p-BlHzmszE.js +2 -0
  125. package/dist/components/{p-Bl001G0Y.js.map → p-BlHzmszE.js.map} +1 -1
  126. package/dist/components/p-By_s1wNN.js +2 -0
  127. package/dist/components/p-By_s1wNN.js.map +1 -0
  128. package/dist/components/p-CNgPwd11.js +2 -0
  129. package/dist/components/{p-1darPzys.js.map → p-CNgPwd11.js.map} +1 -1
  130. package/dist/components/{p-BcfC6phQ.js → p-CNjOyUQu.js} +2 -2
  131. package/dist/components/p-CNjOyUQu.js.map +1 -0
  132. package/dist/components/{p-k0Hmj1KV.js → p-CPwpgUWT.js} +2 -2
  133. package/dist/components/{p-DIa73GJP.js → p-CU2673IJ.js} +2 -2
  134. package/dist/components/{p-Crsn82rz.js → p-CsX3ICz7.js} +2 -2
  135. package/dist/components/{p-B-9A0e_0.js → p-D0e77tkd.js} +2 -2
  136. package/dist/components/p-D1bNvIpb.js +2 -0
  137. package/dist/components/p-D1bNvIpb.js.map +1 -0
  138. package/dist/components/{p-CvyTZ4Mg.js → p-D9u1_OEZ.js} +2 -2
  139. package/dist/components/{p-B_5nxOeB.js → p-DB9XJm2c.js} +2 -2
  140. package/dist/components/{p-CUAYsK44.js → p-DIFUsoM-.js} +2 -2
  141. package/dist/components/p-DhKvqh5G.js +2 -0
  142. package/dist/components/p-DhKvqh5G.js.map +1 -0
  143. package/dist/components/{p-guQ7hv6W.js → p-DhLmoCe_.js} +2 -2
  144. package/dist/components/{p-CqWV4Hl_.js → p-DmAHufd5.js} +2 -2
  145. package/dist/components/p-DzM3SzPz.js +2 -0
  146. package/dist/components/p-DzM3SzPz.js.map +1 -0
  147. package/dist/components/{p-DNFd4Ao-.js → p-G3qIxpQj.js} +2 -2
  148. package/dist/components/{p-C6xC48hG.js → p-Re2kPrXm.js} +2 -2
  149. package/dist/components/{p--eKXTylf.js → p-Utr23NC-.js} +2 -2
  150. package/dist/components/{p-5-QAFB4j.js → p-Vdufoj7G.js} +2 -2
  151. package/dist/components/{p-BuiZcSga.js → p-huw1oRbt.js} +2 -2
  152. package/dist/components/p-huw1oRbt.js.map +1 -0
  153. package/dist/components/p-ukB-dPOK.js +2 -0
  154. package/dist/components/{p-pgxlkvUy.js.map → p-ukB-dPOK.js.map} +1 -1
  155. package/dist/components/p-yhj1lIPx.js +2 -0
  156. package/dist/docs/components.json +599 -11
  157. package/dist/lib/components/Menu/menu-position.d.ts +6 -6
  158. package/dist/lib/toast/toast-types.d.ts +3 -3
  159. package/dist/lib/utils/anchored-position.d.ts +34 -0
  160. package/dist/lib/utils/choice-popup-alignment.d.ts +2 -2
  161. package/dist/lib/utils/index.d.ts +2 -0
  162. package/dist/lib/utils/index.js +31 -0
  163. package/dist/lib/utils/index.js.map +3 -3
  164. package/dist/lib/utils/metric-change.d.ts +52 -0
  165. package/dist/lib/utils/token-defaults.d.ts +3 -0
  166. package/dist/mcp-data/registry/agent-activity.json +1 -1
  167. package/dist/mcp-data/registry/agent-response.json +1 -1
  168. package/dist/mcp-data/registry/agent-source-list.json +1 -1
  169. package/dist/mcp-data/registry/agent-tool-call.json +1 -1
  170. package/dist/mcp-data/registry/attachment-list.json +1 -1
  171. package/dist/mcp-data/registry/avatar.json +1 -1
  172. package/dist/mcp-data/registry/badge.json +1 -1
  173. package/dist/mcp-data/registry/bar-nav.json +1 -1
  174. package/dist/mcp-data/registry/bar-title.json +2 -2
  175. package/dist/mcp-data/registry/bar-workflow.json +1 -1
  176. package/dist/mcp-data/registry/breadcrumb.json +1 -1
  177. package/dist/mcp-data/registry/button-filled.json +122 -6
  178. package/dist/mcp-data/registry/button-unfilled.json +49 -5
  179. package/dist/mcp-data/registry/card-data-viz-bar.json +2 -2
  180. package/dist/mcp-data/registry/card-data-viz-donut.json +2 -1
  181. package/dist/mcp-data/registry/card-data-viz-line.json +2 -2
  182. package/dist/mcp-data/registry/card-overview.json +317 -0
  183. package/dist/mcp-data/registry/card-setting.json +1 -1
  184. package/dist/mcp-data/registry/card-shell-data-viz.json +1 -1
  185. package/dist/mcp-data/registry/chart-bar-stacked.json +14 -9
  186. package/dist/mcp-data/registry/chart-bar.json +15 -10
  187. package/dist/mcp-data/registry/chart-donut.json +3 -2
  188. package/dist/mcp-data/registry/chart-legend.json +1 -1
  189. package/dist/mcp-data/registry/chart-line.json +15 -10
  190. package/dist/mcp-data/registry/checkbox.json +1 -1
  191. package/dist/mcp-data/registry/chip.json +1 -1
  192. package/dist/mcp-data/registry/code-block.json +1 -1
  193. package/dist/mcp-data/registry/conversation-list-item.json +1 -1
  194. package/dist/mcp-data/registry/conversation-list-section.json +1 -1
  195. package/dist/mcp-data/registry/conversation-list.json +1 -1
  196. package/dist/mcp-data/registry/divider.json +1 -1
  197. package/dist/mcp-data/registry/empty-state.json +1 -1
  198. package/dist/mcp-data/registry/field.json +1 -1
  199. package/dist/mcp-data/registry/icon.json +1 -1
  200. package/dist/mcp-data/registry/input.json +1 -1
  201. package/dist/mcp-data/registry/loader.json +1 -1
  202. package/dist/mcp-data/registry/markdown.json +1 -1
  203. package/dist/mcp-data/registry/menu.json +3 -3
  204. package/dist/mcp-data/registry/message-bubble.json +1 -1
  205. package/dist/mcp-data/registry/message-composer.json +1 -1
  206. package/dist/mcp-data/registry/message-scroller.json +1 -1
  207. package/dist/mcp-data/registry/message.json +1 -1
  208. package/dist/mcp-data/registry/mobile-bar-nav.json +1 -1
  209. package/dist/mcp-data/registry/mobile-header.json +1 -1
  210. package/dist/mcp-data/registry/mobile-section-switcher.json +1 -1
  211. package/dist/mcp-data/registry/mobile-sheet-nav.json +1 -1
  212. package/dist/mcp-data/registry/modal.json +1 -1
  213. package/dist/mcp-data/registry/panel-nav.json +1 -1
  214. package/dist/mcp-data/registry/panel-sub-nav.json +1 -1
  215. package/dist/mcp-data/registry/panel-tool-header.json +1 -1
  216. package/dist/mcp-data/registry/panel-tool-search.json +1 -1
  217. package/dist/mcp-data/registry/panel-tools.json +3 -2
  218. package/dist/mcp-data/registry/radio.json +1 -1
  219. package/dist/mcp-data/registry/registry.json +233 -18
  220. package/dist/mcp-data/registry/scroll-overlay.json +1 -1
  221. package/dist/mcp-data/registry/select-multi.json +1 -1
  222. package/dist/mcp-data/registry/select.json +1 -1
  223. package/dist/mcp-data/registry/shell-app.json +1 -1
  224. package/dist/mcp-data/registry/shell-gradient-picker.json +1 -1
  225. package/dist/mcp-data/registry/shell-gradient-swatch.json +1 -1
  226. package/dist/mcp-data/registry/shell-page.json +5 -4
  227. package/dist/mcp-data/registry/shell-tools.json +1 -1
  228. package/dist/mcp-data/registry/skeleton.json +1 -1
  229. package/dist/mcp-data/registry/slider.json +1 -1
  230. package/dist/mcp-data/registry/swatch-picker.json +1 -1
  231. package/dist/mcp-data/registry/switch.json +1 -1
  232. package/dist/mcp-data/registry/tab-group.json +1 -1
  233. package/dist/mcp-data/registry/tag.json +1 -1
  234. package/dist/mcp-data/registry/text.json +1 -1
  235. package/dist/mcp-data/registry/toast.json +2 -2
  236. package/dist/mcp-data/registry/tooltip-data-viz.json +3 -1
  237. package/dist/mcp-data/registry/tooltip.json +3 -8
  238. package/dist/mcp-data/registry/typing-indicator.json +1 -1
  239. package/dist/react/components.d.ts +1 -0
  240. package/dist/react/components.js +1 -0
  241. package/dist/react/ds-card-overview.d.ts +12 -0
  242. package/dist/react/ds-card-overview.js +12 -0
  243. package/dist/styles/control-elevation.css +11 -0
  244. package/dist/types/components/ButtonFilled/ButtonFilled.d.ts +32 -0
  245. package/dist/types/components/ButtonUnfilled/ButtonUnfilled.d.ts +20 -0
  246. package/dist/types/components/CardOverview/CardOverview.d.ts +59 -0
  247. package/dist/types/components/CardOverview/card-overview-types.d.ts +32 -0
  248. package/dist/types/components/CardOverview/index.d.ts +2 -0
  249. package/dist/types/components/ChartBar/ChartBar.d.ts +11 -0
  250. package/dist/types/components/ChartBarStacked/ChartBarStacked.d.ts +11 -0
  251. package/dist/types/components/ChartLine/ChartLine.d.ts +11 -0
  252. package/dist/types/components/Menu/Menu.d.ts +7 -4
  253. package/dist/types/components/Menu/menu-position.d.ts +6 -6
  254. package/dist/types/components/ShellPage/ShellPage.d.ts +1 -0
  255. package/dist/types/components/Tooltip/Tooltip.d.ts +1 -4
  256. package/dist/types/components.d.ts +212 -2
  257. package/dist/types/toast/toast-types.d.ts +3 -3
  258. package/dist/types/utils/anchored-position-controller.d.ts +96 -0
  259. package/dist/types/utils/anchored-position.d.ts +35 -0
  260. package/dist/types/utils/cartesian-chart-layout.d.ts +13 -0
  261. package/dist/types/utils/chart-viewport-controller.d.ts +21 -0
  262. package/dist/types/utils/choice-popup-alignment.d.ts +2 -2
  263. package/dist/types/utils/index.d.ts +2 -0
  264. package/dist/types/utils/metric-change.d.ts +53 -0
  265. package/dist/types/utils/select-controller.d.ts +3 -3
  266. package/dist/types/utils/token-defaults.d.ts +3 -0
  267. package/package.json +3 -3
  268. package/dist/components/p-1darPzys.js +0 -2
  269. package/dist/components/p-B8C_yfLQ.js +0 -2
  270. package/dist/components/p-B8C_yfLQ.js.map +0 -1
  271. package/dist/components/p-BcfC6phQ.js.map +0 -1
  272. package/dist/components/p-Bl001G0Y.js +0 -2
  273. package/dist/components/p-BuiZcSga.js.map +0 -1
  274. package/dist/components/p-Bv9frkvW.js +0 -2
  275. package/dist/components/p-Bv9frkvW.js.map +0 -1
  276. package/dist/components/p-C0-K8vnW.js +0 -2
  277. package/dist/components/p-C0-K8vnW.js.map +0 -1
  278. package/dist/components/p-C2ym_Ich.js +0 -2
  279. package/dist/components/p-C_ewSXTT.js +0 -2
  280. package/dist/components/p-C_ewSXTT.js.map +0 -1
  281. package/dist/components/p-Ca9-fnFl.js +0 -2
  282. package/dist/components/p-Ca9-fnFl.js.map +0 -1
  283. package/dist/components/p-CydY-v7X.js +0 -2
  284. package/dist/components/p-CydY-v7X.js.map +0 -1
  285. package/dist/components/p-De7NquTI.js +0 -2
  286. package/dist/components/p-De7NquTI.js.map +0 -1
  287. package/dist/components/p-Dg3xLna0.js +0 -2
  288. package/dist/components/p-Dg3xLna0.js.map +0 -1
  289. package/dist/components/p-pgxlkvUy.js +0 -2
  290. package/dist/lib/utils/anchored-popup.d.ts +0 -23
  291. package/dist/types/components/Tooltip/tooltip-position.d.ts +0 -21
  292. package/dist/types/utils/anchored-popup.d.ts +0 -24
  293. /package/dist/components/{p-C9h13YnX.js.map → p-38PfdMkF.js.map} +0 -0
  294. /package/dist/components/{p-CnAkobDW.js.map → p-B6NvVdeO.js.map} +0 -0
  295. /package/dist/components/{p-BT5hgg5i.js.map → p-BFRMwl93.js.map} +0 -0
  296. /package/dist/components/{p-C7bZ-jiU.js.map → p-BO5aqZcf.js.map} +0 -0
  297. /package/dist/components/{p-C_9ZH0A3.js.map → p-BXaieghV.js.map} +0 -0
  298. /package/dist/components/{p-k0Hmj1KV.js.map → p-CPwpgUWT.js.map} +0 -0
  299. /package/dist/components/{p-DIa73GJP.js.map → p-CU2673IJ.js.map} +0 -0
  300. /package/dist/components/{p-Crsn82rz.js.map → p-CsX3ICz7.js.map} +0 -0
  301. /package/dist/components/{p-B-9A0e_0.js.map → p-D0e77tkd.js.map} +0 -0
  302. /package/dist/components/{p-CvyTZ4Mg.js.map → p-D9u1_OEZ.js.map} +0 -0
  303. /package/dist/components/{p-B_5nxOeB.js.map → p-DB9XJm2c.js.map} +0 -0
  304. /package/dist/components/{p-CUAYsK44.js.map → p-DIFUsoM-.js.map} +0 -0
  305. /package/dist/components/{p-guQ7hv6W.js.map → p-DhLmoCe_.js.map} +0 -0
  306. /package/dist/components/{p-CqWV4Hl_.js.map → p-DmAHufd5.js.map} +0 -0
  307. /package/dist/components/{p-DNFd4Ao-.js.map → p-G3qIxpQj.js.map} +0 -0
  308. /package/dist/components/{p-C6xC48hG.js.map → p-Re2kPrXm.js.map} +0 -0
  309. /package/dist/components/{p--eKXTylf.js.map → p-Utr23NC-.js.map} +0 -0
  310. /package/dist/components/{p-5-QAFB4j.js.map → p-Vdufoj7G.js.map} +0 -0
  311. /package/dist/components/{p-C2ym_Ich.js.map → p-yhj1lIPx.js.map} +0 -0
@@ -0,0 +1,317 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "card-overview",
4
+ "title": "CardOverview",
5
+ "description": "Page-level summary bar pairing one headline score with a reporting period, an application-owned period control, and a responsive grid of comparable measures.",
6
+ "type": "registry:ui",
7
+ "meta": {
8
+ "library": "@ds-mo/ui",
9
+ "distribution": "npm",
10
+ "storybook": "https://zainadeel.github.io/compomo/?path=/story/card-overview",
11
+ "source": "src/wc/components/CardOverview/CardOverview.tsx",
12
+ "intentStatus": "complete",
13
+ "intent": {
14
+ "audience": "general",
15
+ "status": "experimental",
16
+ "summary": "Page-level summary bar pairing one headline score with a reporting period, an application-owned period control, and a responsive grid of comparable measures.",
17
+ "useWhen": [
18
+ "A page opens with one headline figure that the surrounding measures explain.",
19
+ "Every measure is compared against the same period, so one caption describes the comparison for all of them.",
20
+ "The measures are read together at a glance rather than explored individually."
21
+ ],
22
+ "avoidWhen": [
23
+ "There is no headline figure and the measures are unrelated; use the matching card surface for each one.",
24
+ "A measure needs a chart, sparkline, or other visualization; the grid presents values and change only.",
25
+ "The measures each require their own comparison period or their own filter control.",
26
+ "The content is a settings section or a general read-only card."
27
+ ],
28
+ "alternatives": [
29
+ {
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."
33
+ },
34
+ {
35
+ "when": "The surface is a settings section with an edit workflow.",
36
+ "component": "component:ds-card-setting",
37
+ "reason": "CardSetting owns the controlled view and edit chrome."
38
+ }
39
+ ],
40
+ "commonlyComposedWith": [
41
+ "component:ds-select",
42
+ "component:ds-button-unfilled",
43
+ "component:ds-text",
44
+ "component:ds-tooltip"
45
+ ],
46
+ "accessibility": [
47
+ "The bar is a labelled region; set overviewLabel to name what is being summarised, such as Safety summary.",
48
+ "Trend arrows are decorative and hidden from assistive technology, so the formatted change value must read correctly on its own.",
49
+ "Colour never carries the trend meaning alone; the arrow direction and the value are both present.",
50
+ "Measures become selectable only when they are not inactive. Selectable measures form one roving tab stop, so the grid is a single stop and arrow keys move between measures.",
51
+ "Set labelTooltip when a measure's label needs qualifying rather than shortening the label into something ambiguous.",
52
+ "While loading, the region exposes a busy state and renders skeletons whose type metrics match the resolved content."
53
+ ],
54
+ "states": [
55
+ "Score and measures are supplied as data; the component owns their type treatment so summary bars stay consistent across pages.",
56
+ "Trend is supplied already resolved as a direction, a formatted value, and a tone. Whether a rise reads well is a product decision, so the component never infers tone from the numbers. Derive it with resolveMetricTrend.",
57
+ "Omit a trend when there is nothing to report; resolveMetricTrend returns null in that case so no zero change is rendered.",
58
+ "Omit score to render the bar without a headline figure. Set scoreErrorMessage to report that the figure could not be resolved while the measures remain readable.",
59
+ "Loading replaces the score and the measures with skeletons and does not alter the slotted period control.",
60
+ "The period control is slotted rather than owned, because the choice of stepper, select, or date range varies by product surface."
61
+ ],
62
+ "responsiveBehavior": [
63
+ "The measure grid reflows to fewer columns and finally stacks, driven by the minimum measure width alone. There is no measurement and no horizontal scrolling.",
64
+ "Set metricMinWidth to change the width a measure may shrink to before the grid drops a column.",
65
+ "The score block hugs its content and never shrinks, so the headline figure holds its size while the grid absorbs the remaining width.",
66
+ "The score moves above the body once the bar can no longer fit both side by side."
67
+ ],
68
+ "frameworkCaveats": {
69
+ "customElements": [
70
+ "Assign score and metrics as JavaScript properties; both are objects and cannot be expressed as HTML attributes.",
71
+ "Place the period control in the filter slot; the component reserves space for it but never renders one."
72
+ ],
73
+ "react": [
74
+ "Pass score and metrics as props and read the selected measure from the onDsMetricSelect event detail.",
75
+ "Derive each trend with resolveMetricTrend so tone stays an explicit product decision."
76
+ ],
77
+ "angular": [
78
+ "Bind [score] and [metrics] as properties and read the selected measure from $event.detail on (dsMetricSelect).",
79
+ "Derive each trend with resolveMetricTrend so tone stays an explicit product decision."
80
+ ]
81
+ },
82
+ "references": [
83
+ {
84
+ "label": "Storybook structural examples",
85
+ "path": "src/wc/components/CardOverview/CardOverview.stories.ts"
86
+ },
87
+ {
88
+ "label": "Trend resolution unit coverage",
89
+ "path": "tests/metric-change.test.ts"
90
+ }
91
+ ]
92
+ },
93
+ "api": {
94
+ "props": {
95
+ "comparisonLabel": {
96
+ "type": "string",
97
+ "resolvedType": "string",
98
+ "attribute": "comparison-label",
99
+ "default": "''",
100
+ "required": false,
101
+ "mutable": false,
102
+ "description": "Comparison caption, for example `vs. previous score period`."
103
+ },
104
+ "isLoading": {
105
+ "type": "boolean",
106
+ "resolvedType": "boolean",
107
+ "attribute": "is-loading",
108
+ "default": "false",
109
+ "required": false,
110
+ "mutable": false,
111
+ "description": "Replace the score and metrics with skeletons while data resolves."
112
+ },
113
+ "metricMinWidth": {
114
+ "type": "string",
115
+ "resolvedType": "string",
116
+ "attribute": "metric-min-width",
117
+ "default": "'var(--dimension-menu-width-xs)'",
118
+ "required": false,
119
+ "mutable": false,
120
+ "description": "Width a metric cell may shrink to before the grid drops a column. The grid\nreflows and then stacks from this alone, so no measurement is required."
121
+ },
122
+ "metrics": {
123
+ "type": "OverviewMetric[]",
124
+ "resolvedType": "OverviewMetric[]",
125
+ "default": "[]",
126
+ "required": false,
127
+ "mutable": false,
128
+ "description": "Measures rendered in the responsive grid."
129
+ },
130
+ "overviewLabel": {
131
+ "type": "string",
132
+ "resolvedType": "string",
133
+ "attribute": "overview-label",
134
+ "default": "'Overview'",
135
+ "required": false,
136
+ "mutable": false,
137
+ "description": "Accessible name for the region."
138
+ },
139
+ "periodLabel": {
140
+ "type": "string",
141
+ "resolvedType": "string",
142
+ "attribute": "period-label",
143
+ "default": "''",
144
+ "required": false,
145
+ "mutable": false,
146
+ "description": "Current reporting period, for example `Jun 29, 2026 – Jul 26, 2026`."
147
+ },
148
+ "score": {
149
+ "type": "OverviewScore | undefined",
150
+ "resolvedType": "OverviewScore | undefined",
151
+ "required": false,
152
+ "mutable": false,
153
+ "description": "Leading summary block. Omit to render the bar without a headline figure."
154
+ },
155
+ "scoreErrorMessage": {
156
+ "type": "string | undefined",
157
+ "resolvedType": "string | undefined",
158
+ "attribute": "score-error-message",
159
+ "required": false,
160
+ "mutable": false,
161
+ "description": "Message shown in place of the score when its figure cannot be resolved."
162
+ }
163
+ },
164
+ "events": [
165
+ {
166
+ "name": "dsMetricSelect",
167
+ "detail": "OverviewMetric",
168
+ "bubbles": true,
169
+ "cancelable": true,
170
+ "composed": true,
171
+ "description": "Emitted when a metric that is not inactive is activated."
172
+ }
173
+ ],
174
+ "methods": [],
175
+ "slots": []
176
+ },
177
+ "props": {
178
+ "comparisonLabel": {
179
+ "type": "string",
180
+ "resolvedType": "string",
181
+ "attribute": "comparison-label",
182
+ "default": "''",
183
+ "required": false,
184
+ "mutable": false,
185
+ "description": "Comparison caption, for example `vs. previous score period`."
186
+ },
187
+ "isLoading": {
188
+ "type": "boolean",
189
+ "resolvedType": "boolean",
190
+ "attribute": "is-loading",
191
+ "default": "false",
192
+ "required": false,
193
+ "mutable": false,
194
+ "description": "Replace the score and metrics with skeletons while data resolves."
195
+ },
196
+ "metricMinWidth": {
197
+ "type": "string",
198
+ "resolvedType": "string",
199
+ "attribute": "metric-min-width",
200
+ "default": "'var(--dimension-menu-width-xs)'",
201
+ "required": false,
202
+ "mutable": false,
203
+ "description": "Width a metric cell may shrink to before the grid drops a column. The grid\nreflows and then stacks from this alone, so no measurement is required."
204
+ },
205
+ "metrics": {
206
+ "type": "OverviewMetric[]",
207
+ "resolvedType": "OverviewMetric[]",
208
+ "default": "[]",
209
+ "required": false,
210
+ "mutable": false,
211
+ "description": "Measures rendered in the responsive grid."
212
+ },
213
+ "overviewLabel": {
214
+ "type": "string",
215
+ "resolvedType": "string",
216
+ "attribute": "overview-label",
217
+ "default": "'Overview'",
218
+ "required": false,
219
+ "mutable": false,
220
+ "description": "Accessible name for the region."
221
+ },
222
+ "periodLabel": {
223
+ "type": "string",
224
+ "resolvedType": "string",
225
+ "attribute": "period-label",
226
+ "default": "''",
227
+ "required": false,
228
+ "mutable": false,
229
+ "description": "Current reporting period, for example `Jun 29, 2026 – Jul 26, 2026`."
230
+ },
231
+ "score": {
232
+ "type": "OverviewScore | undefined",
233
+ "resolvedType": "OverviewScore | undefined",
234
+ "required": false,
235
+ "mutable": false,
236
+ "description": "Leading summary block. Omit to render the bar without a headline figure."
237
+ },
238
+ "scoreErrorMessage": {
239
+ "type": "string | undefined",
240
+ "resolvedType": "string | undefined",
241
+ "attribute": "score-error-message",
242
+ "required": false,
243
+ "mutable": false,
244
+ "description": "Message shown in place of the score when its figure cannot be resolved."
245
+ }
246
+ },
247
+ "events": [
248
+ {
249
+ "name": "dsMetricSelect",
250
+ "detail": "OverviewMetric",
251
+ "bubbles": true,
252
+ "cancelable": true,
253
+ "composed": true,
254
+ "description": "Emitted when a metric that is not inactive is activated."
255
+ }
256
+ ],
257
+ "methods": [],
258
+ "slots": [],
259
+ "exports": {
260
+ "customElement": "ds-card-overview",
261
+ "react": "DsCardOverview",
262
+ "angular": "DsCardOverview"
263
+ },
264
+ "consumption": {
265
+ "install": "npm install @ds-mo/ui @ds-mo/tokens @ds-mo/icons",
266
+ "cssSetup": "import '@ds-mo/tokens';\nimport '@ds-mo/tokens/reset';\nimport '@ds-mo/tokens/globals';",
267
+ "customElements": {
268
+ "import": "import '@ds-mo/ui/dist/components/ds-card-overview.js';",
269
+ "example": "<ds-card-overview></ds-card-overview>"
270
+ },
271
+ "react": {
272
+ "import": "import { DsCardOverview } from '@ds-mo/ui/react';",
273
+ "example": "<DsCardOverview />"
274
+ },
275
+ "angular": {
276
+ "import": "import { DsCardOverview } from '@ds-mo/ui/angular/ds-card-overview';",
277
+ "example": "<ds-card-overview></ds-card-overview>"
278
+ },
279
+ "complexPropertyNote": "Assign these non-primitive values as JavaScript properties: metrics, score.",
280
+ "peerDependencies": {
281
+ "required": [
282
+ "@ds-mo/tokens ^5.0.0",
283
+ "@ds-mo/icons ^6.4.0"
284
+ ],
285
+ "frameworks": "Custom Elements; React 18/19 wrappers; Angular 19-22 standalone adapters."
286
+ }
287
+ }
288
+ },
289
+ "dependencies": [
290
+ "@ds-mo/ui",
291
+ "@ds-mo/tokens",
292
+ "@ds-mo/icons"
293
+ ],
294
+ "registryDependencies": [
295
+ "icon",
296
+ "skeleton",
297
+ "text",
298
+ "tooltip"
299
+ ],
300
+ "files": [
301
+ {
302
+ "path": "src/wc/components/CardOverview/CardOverview.css",
303
+ "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: flex;\n flex-wrap: wrap;\n align-items: stretch;\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: var(--dimension-stroke-width-012) solid\n var(--color-always-dark-border-tertiary);\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/* ── 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 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/* 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.card-overview__score-label {\n color: var(--color-always-dark-foreground-secondary);\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/* 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 color: var(--color-always-dark-foreground-secondary);\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 flex: 1 1 0;\n flex-direction: column;\n min-width: min(100%, calc(var(--ds-card-overview-metric-min) * 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 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/*\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.card-overview__period-current {\n color: var(--color-always-dark-foreground-primary);\n}\n\n.card-overview__period-comparison {\n color: var(--color-always-dark-foreground-secondary);\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 * Reflows to fewer columns and finally stacks from `auto-fit` alone. No observer\n * and no horizontal scroll: a metric never compresses past its minimum, it moves\n * to the next row instead.\n */\n/*\n * Wrapping flex rather than an auto-fit grid, because a grid gives the final row's\n * items their column width and leaves a gap. Flex lets the last row's items grow\n * to fill, so a measure left on its own spans the full width.\n *\n * Dividers are trailing, not leading: a leading divider on the first cell would\n * land exactly on the score's own trailing border and paint it twice. The two\n * negative margins pull the final column's and final row's dividers past the card\n * edge, where the card's `overflow: hidden` clips them, so separators appear\n * between cells without needing to detect which cell ends a row.\n *\n * `flex: 1 1 auto` on the container makes it 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: flex;\n flex: 1 1 auto;\n flex-wrap: wrap;\n align-content: flex-start;\n min-width: 0;\n margin-inline-end: calc(-1 * var(--dimension-stroke-width-012));\n margin-block-end: calc(-1 * var(--dimension-stroke-width-012));\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: 1 1 var(--ds-card-overview-metric-min);\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 border-inline-end: var(--ds-card-overview-divider);\n border-block-end: var(--ds-card-overview-divider);\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 color: var(--color-always-dark-foreground-secondary);\n}\n\n.card-overview__metric-value {\n color: var(--color-always-dark-foreground-primary);\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.card-overview__trend--positive {\n color: var(--color-always-dark-foreground-positive);\n}\n\n.card-overview__trend--negative {\n color: var(--color-always-dark-foreground-negative);\n}\n\n/*\n * Secondary rather than tertiary: the change value is content, not decoration,\n * and tertiary does not hold a readable contrast at this size.\n */\n.card-overview__trend--neutral {\n color: var(--color-always-dark-foreground-secondary);\n}\n\n/* ── Narrow layout ────────────────────────────────────────────────────────── */\n\n/*\n * Below roughly two measure columns the card stops being a bar with a leading\n * score and becomes a stack. The score turns into its own full-width row reading\n * left to right, so its divider moves from the trailing edge to the underside and\n * the period bar spans the full width beneath it.\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__score {\n flex-direction: row;\n align-items: baseline;\n gap: var(--dimension-space-100);\n width: 100%;\n padding-block: var(--dimension-space-150);\n border-inline-end: none;\n border-block-end: var(--ds-card-overview-divider);\n }\n\n /* Pushes the figure and band to the trailing edge, opposite the label. */\n :host .card-overview__score-label-row {\n flex: 1 1 auto;\n min-height: 0;\n }\n\n /* The vertical rhythm that aligned these to the measure rows no longer applies. */\n :host .card-overview__score-band,\n :host .card-overview__score-figure {\n margin-block-start: 0;\n }\n\n /*\n * Here the band joins the baseline-aligned row, so the band skeleton needs the\n * same lift the trend skeleton gets: a solid bar synthesizes its baseline from\n * its bottom edge and would otherwise hang below the figure's baseline. The\n * column layout aligns the band by margin instead, so this is narrow-only.\n */\n :host .card-overview__score-band--loading {\n position: relative;\n inset-block-start: calc(-1 * (var(--dimension-space-150) + var(--dimension-space-012)));\n }\n\n /*\n * The period gets a full-width row of its own here, but not enough of it for\n * both parts on one line. Wrapping keeps the comparison readable; holding the\n * single-line rule instead collides the two runs of text.\n */\n :host .card-overview__header {\n align-items: flex-start;\n }\n\n :host .card-overview__period {\n flex-wrap: wrap;\n min-height: 0;\n overflow: visible;\n white-space: normal;\n }\n}\n",
304
+ "type": "registry:ui"
305
+ },
306
+ {
307
+ "path": "src/wc/components/CardOverview/CardOverview.tsx",
308
+ "content": "import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n State,\n} from '@stencil/core';\nimport type { TextVariant } from '../Text/text-types';\nimport type { MetricTrend } from '../../utils/metric-change';\nimport type { OverviewMetric, OverviewScore } 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@Component({\n tag: 'ds-card-overview',\n styleUrl: 'CardOverview.css',\n scoped: true,\n})\nexport class CardOverview {\n @Element() el!: HTMLElement;\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 score period`. */\n @Prop() comparisonLabel: string = '';\n\n /** Measures rendered in the responsive grid. */\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 /** Index of the roving tab stop, skipping inactive metrics. */\n private get rovingIndex(): number {\n const first = this.metrics.findIndex(metric => !metric.isInactive);\n if (first < 0) return -1;\n const current = this.metrics[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 count = this.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 (this.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=\"inherit\"\n fontFeature=\"tabular-nums\"\n >\n {trend.direction === 'up' ? '↑' : '↓'} {trend.value}\n </ds-text>\n );\n }\n\n private renderScore() {\n if (this.isLoading) {\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('text-caption', '80px', 'card-overview__score-band card-overview__score-band--loading')}\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 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\n color=\"inherit\"\n >\n {score.label}\n </ds-text>\n </div>\n <div class=\"card-overview__score-figure\">\n <ds-text as=\"span\" variant=\"text-display-medium\" emphasis color=\"inherit\" fontFeature=\"tabular-nums\">\n {score.value}\n </ds-text>\n {this.renderTrend(score.trend, 'text-body-small', true)}\n </div>\n {score.band && (\n <ds-text as=\"span\" class=\"card-overview__score-band\" variant=\"text-caption\" color=\"inherit\">\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 as=\"span\" class=\"card-overview__metric-label\" variant=\"text-body-small\" color=\"inherit\">\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\">{label}</ds-tooltip>\n : label}\n <div class=\"card-overview__metric-figure\">\n <ds-text as=\"span\" class=\"card-overview__metric-value\" variant=\"text-body-medium\" color=\"inherit\" fontFeature=\"tabular-nums\">\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.metrics.map((metric, index) => this.renderMetric(metric, index));\n }\n\n render() {\n const hasHeader = Boolean(this.periodLabel || this.comparisonLabel);\n\n return (\n <Host\n class={{\n 'card-overview': true,\n 'card-overview--has-score': this.hasScore,\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': true,\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 {this.hasScore && this.renderScore()}\n\n <div class=\"card-overview__body\">\n {/* `ds-control--md` supplies the 32px height and the label inset below. */}\n <div class=\"card-overview__header ds-control--md\">\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 ) : hasHeader && (\n <div class=\"card-overview__period ds-control-label-box\">\n {this.periodLabel && (\n <ds-text as=\"span\" class=\"card-overview__period-current ds-control-label-box\" variant=\"text-body-medium\" emphasis color=\"inherit\">\n {this.periodLabel}\n </ds-text>\n )}\n {this.comparisonLabel && (\n <ds-text as=\"span\" class=\"card-overview__period-comparison ds-control-label-box\" variant=\"text-body-medium\" color=\"inherit\">\n {this.comparisonLabel}\n </ds-text>\n )}\n </div>\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 variant=\"control\" controlSize=\"md\" width=\"128px\" background=\"always-dark\" />\n : <slot name=\"filter\" />}\n </div>\n </div>\n\n <div class=\"card-overview__metrics\" part=\"metrics\">\n {this.renderMetrics()}\n </div>\n\n <slot name=\"footer\" />\n </div>\n </Host>\n );\n }\n}\n",
309
+ "type": "registry:ui"
310
+ },
311
+ {
312
+ "path": "src/wc/components/CardOverview/card-overview-types.ts",
313
+ "content": "import type { MetricTrend } from '../../utils/metric-change';\n\n/**\n * Leading summary block — the headline figure the rest of the bar contextualises.\n *\n * Derive `trend` with `resolveMetricTrend` so whether a rise reads well stays a\n * product decision rather than a design-system one.\n */\nexport interface OverviewScore {\n /** Category above the figure, for example `Safety score`. */\n label: string;\n /** Display-ready headline figure. */\n value: string | number;\n /** Change against the comparison period. Omit when there is nothing to report. */\n trend?: MetricTrend;\n /** Qualitative band beneath the figure, for example `Good (67–83)`. */\n band?: string;\n}\n\n/** One measure in the overview grid. */\nexport interface OverviewMetric {\n /** Stable identity for keyed rendering and selection events. */\n id: string;\n label: string;\n /** Display-ready value; format compactly before passing it in. */\n value: string | number;\n /** Change against the comparison period. Omit when there is nothing to report. */\n trend?: MetricTrend;\n /** Present the measure without making it selectable. */\n isInactive?: boolean;\n /** Supplementary explanation for the label. */\n labelTooltip?: string;\n}\n",
314
+ "type": "registry:ui"
315
+ }
316
+ ]
317
+ }
@@ -249,7 +249,7 @@
249
249
  },
250
250
  "peerDependencies": {
251
251
  "required": [
252
- "@ds-mo/tokens ^3.1.1",
252
+ "@ds-mo/tokens ^5.0.0",
253
253
  "@ds-mo/icons ^6.4.0"
254
254
  ],
255
255
  "frameworks": "Custom Elements; React 18/19 wrappers; Angular 19-22 standalone adapters."
@@ -151,7 +151,7 @@
151
151
  },
152
152
  "peerDependencies": {
153
153
  "required": [
154
- "@ds-mo/tokens ^3.1.1",
154
+ "@ds-mo/tokens ^5.0.0",
155
155
  "@ds-mo/icons ^6.4.0"
156
156
  ],
157
157
  "frameworks": "Custom Elements; React 18/19 wrappers; Angular 19-22 standalone adapters."
@@ -61,8 +61,9 @@
61
61
  "Negative values are unsupported and render as zero; the owning product supplies loading, empty, and error states."
62
62
  ],
63
63
  "responsiveBehavior": [
64
- "The SVG preserves its authored aspect ratio while shrinking to fit a narrower parent.",
65
- "The parent supplies dimensions and chooses how many time buckets remain legible at each width.",
64
+ "Width and height provide the standalone intrinsic viewport; constrained card regions are measured and reflow both axes to their rendered pixel dimensions.",
65
+ "Responsive layout changes stack positions and plot extents without scaling SVG text, strokes, separators, corner radii, or margins.",
66
+ "The parent chooses how many time buckets remain legible at each width.",
66
67
  "Pre-format category labels and reduce bucket count before rendering when horizontal space becomes constrained."
67
68
  ],
68
69
  "frameworkCaveats": {
@@ -99,7 +100,8 @@
99
100
  "attribute": "height",
100
101
  "default": "240",
101
102
  "required": false,
102
- "mutable": false
103
+ "mutable": false,
104
+ "description": "Standalone intrinsic height. Container constraints reflow the plot at rendered pixel size."
103
105
  },
104
106
  "series": {
105
107
  "type": "ChartSeries[]",
@@ -123,7 +125,8 @@
123
125
  "attribute": "width",
124
126
  "default": "480",
125
127
  "required": false,
126
- "mutable": false
128
+ "mutable": false,
129
+ "description": "Standalone intrinsic width. Container constraints reflow the plot at rendered pixel size."
127
130
  }
128
131
  },
129
132
  "events": [],
@@ -145,7 +148,8 @@
145
148
  "attribute": "height",
146
149
  "default": "240",
147
150
  "required": false,
148
- "mutable": false
151
+ "mutable": false,
152
+ "description": "Standalone intrinsic height. Container constraints reflow the plot at rendered pixel size."
149
153
  },
150
154
  "series": {
151
155
  "type": "ChartSeries[]",
@@ -169,7 +173,8 @@
169
173
  "attribute": "width",
170
174
  "default": "480",
171
175
  "required": false,
172
- "mutable": false
176
+ "mutable": false,
177
+ "description": "Standalone intrinsic width. Container constraints reflow the plot at rendered pixel size."
173
178
  }
174
179
  },
175
180
  "events": [],
@@ -198,7 +203,7 @@
198
203
  "complexPropertyNote": "Assign these non-primitive values as JavaScript properties: categories, series.",
199
204
  "peerDependencies": {
200
205
  "required": [
201
- "@ds-mo/tokens ^3.1.1",
206
+ "@ds-mo/tokens ^5.0.0",
202
207
  "@ds-mo/icons ^6.4.0"
203
208
  ],
204
209
  "frameworks": "Custom Elements; React 18/19 wrappers; Angular 19-22 standalone adapters."
@@ -213,12 +218,12 @@
213
218
  "files": [
214
219
  {
215
220
  "path": "src/wc/components/ChartBarStacked/ChartBarStacked.css",
216
- "content": ":host {\n display: inline-flex;\n max-width: 100%;\n font-family: var(--typography-font-family);\n}\n\n.chart-bar-stacked__svg {\n display: block;\n max-width: 100%;\n height: auto;\n}\n\n.chart-bar-stacked__gridline {\n stroke: var(--color-border-tertiary);\n stroke-width: 1;\n}\n\n/* Matches ds-text text-caption regular (SVG cannot host ds-text). */\n.chart-bar-stacked__axis-label {\n fill: var(--color-foreground-secondary);\n font-family: var(--typography-font-family);\n font-size: var(--typography-fontsize-xs);\n font-weight: var(--typography-weight-medium);\n letter-spacing: var(--typography-letterspacing-positive);\n text-transform: uppercase;\n}\n\n.chart-bar-stacked__segment-shape--rounded {\n rx: var(--dimension-radius-025);\n}\n\n.chart-bar-stacked__segment-separator {\n stroke: var(--color-background-primary);\n stroke-width: var(--dimension-stroke-width-012);\n stroke-linecap: butt;\n}\n",
221
+ "content": ":host {\n display: inline-flex;\n max-width: 100%;\n font-family: var(--typography-font-family);\n}\n\n.chart-bar-stacked__svg {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n.chart-bar-stacked__gridline {\n stroke: var(--color-border-tertiary);\n stroke-width: var(--dimension-stroke-width-012);\n vector-effect: non-scaling-stroke;\n}\n\n/* Matches ds-text text-caption regular (SVG cannot host ds-text). */\n.chart-bar-stacked__axis-label {\n fill: var(--color-foreground-secondary);\n font-family: var(--typography-font-family);\n font-size: var(--typography-fontsize-xs);\n font-weight: var(--typography-weight-medium);\n letter-spacing: var(--typography-letterspacing-positive);\n text-transform: uppercase;\n}\n\n.chart-bar-stacked__segment-shape--rounded {\n rx: var(--dimension-radius-025);\n}\n\n.chart-bar-stacked__segment-separator {\n stroke: var(--color-background-primary);\n stroke-width: var(--dimension-stroke-width-012);\n stroke-linecap: butt;\n vector-effect: non-scaling-stroke;\n}\n",
217
222
  "type": "registry:ui"
218
223
  },
219
224
  {
220
225
  "path": "src/wc/components/ChartBarStacked/ChartBarStacked.tsx",
221
- "content": "import { Component, Prop, h, Host } from '@stencil/core';\nimport { scaleBand, scaleLinear } from 'd3-scale';\nimport { categoryColor } from '../../utils/chart-colors';\nimport { formatPercentage } from '../../utils';\nimport type { ChartSeries } from '../../utils/chart-types';\n\nexport type ChartBarStackedVariant = 'stacked' | 'percentage';\n\nconst MARGIN = { top: 16, right: 16, bottom: 24, left: 32 };\nconst PERCENTAGE_TICKS = [0, 25, 50, 75, 100];\n\n@Component({\n tag: 'ds-chart-bar-stacked',\n styleUrl: 'ChartBarStacked.css',\n scoped: true,\n})\nexport class ChartBarStacked {\n /** Ordered stack series. Set as a JS property (not an HTML attribute). */\n @Prop() series: ChartSeries[] = [];\n /** X-axis labels — must match each series' `data` length. Set as a JS property. */\n @Prop() categories: string[] = [];\n @Prop() variant: ChartBarStackedVariant = 'stacked';\n @Prop() width: number = 480;\n @Prop() height: number = 240;\n\n private valuesForCategory(categoryIndex: number) {\n return this.series.map(series => Math.max(0, series.data[categoryIndex] ?? 0));\n }\n\n private accessibleLabel() {\n return this.categories\n .map((category, categoryIndex) => {\n const values = this.valuesForCategory(categoryIndex);\n const total = values.reduce((sum, value) => sum + value, 0);\n const details = this.series\n .map((series, seriesIndex) => {\n const value = values[seriesIndex];\n const visibleValue = this.variant === 'percentage'\n ? formatPercentage(total ? value / total : 0, 1)\n : String(value);\n return `${series.name}: ${visibleValue}`;\n })\n .join(', ');\n return `${category}: ${details}`;\n })\n .join('; ');\n }\n\n render() {\n const innerWidth = this.width - MARGIN.left - MARGIN.right;\n const innerHeight = this.height - MARGIN.top - MARGIN.bottom;\n const categoryValues = this.categories.map((_, index) => this.valuesForCategory(index));\n const totals = categoryValues.map(values =>\n values.reduce((sum, value) => sum + value, 0)\n );\n const yMax = this.variant === 'percentage' ? 100 : Math.max(0, ...totals);\n\n const xScale = scaleBand()\n .domain(this.categories)\n .range([0, innerWidth])\n .padding(0.35);\n\n const yScale = scaleLinear()\n .domain([0, yMax || 1])\n .range([innerHeight, 0])\n .nice();\n\n const yTicks = this.variant === 'percentage' ? PERCENTAGE_TICKS : yScale.ticks(4);\n\n return (\n <Host class=\"chart-bar-stacked\">\n <svg\n class=\"chart-bar-stacked__svg\"\n viewBox={`0 0 ${this.width} ${this.height}`}\n width={this.width}\n height={this.height}\n role=\"img\"\n aria-label={this.accessibleLabel()}\n >\n <g transform={`translate(${MARGIN.left}, ${MARGIN.top})`}>\n {yTicks.map(tick => (\n <g key={`grid-${tick}`} transform={`translate(0, ${yScale(tick)})`}>\n <line class=\"chart-bar-stacked__gridline\" x1={0} x2={innerWidth} />\n <text\n class=\"chart-bar-stacked__axis-label\"\n x={-8}\n text-anchor=\"end\"\n dominant-baseline=\"middle\"\n >\n {this.variant === 'percentage' ? `${tick}%` : tick}\n </text>\n </g>\n ))}\n\n {this.categories.map((category, categoryIndex) => {\n const barWidth = xScale.bandwidth();\n const barX = xScale(category) ?? 0;\n const values = categoryValues[categoryIndex];\n const total = totals[categoryIndex];\n const topSeriesIndex = values.reduce(\n (topIndex, value, seriesIndex) => (value > 0 ? seriesIndex : topIndex),\n -1\n );\n let cumulativeValue = 0;\n\n return (\n <g class=\"chart-bar-stacked__stack\" data-category={category} key={category}>\n {this.series.map((series, seriesIndex) => {\n const rawValue = values[seriesIndex];\n const value = this.variant === 'percentage'\n ? total\n ? (rawValue / total) * 100\n : 0\n : rawValue;\n const segmentStart = cumulativeValue;\n const segmentEnd = cumulativeValue + value;\n cumulativeValue = segmentEnd;\n\n const segmentY = yScale(segmentEnd);\n const segmentBottom = yScale(segmentStart);\n const segmentHeight = Math.max(0, segmentBottom - segmentY);\n if (!segmentHeight) return null;\n\n const fill = series.color ?? categoryColor(seriesIndex);\n const isTopSegment = seriesIndex === topSeriesIndex;\n const hasRoundedTop =\n this.variant === 'stacked' && isTopSegment;\n const squareBaseY = segmentY + segmentHeight / 2;\n const squareBaseHeight = segmentHeight / 2;\n\n return (\n <g\n class=\"chart-bar-stacked__segment\"\n data-series={series.name}\n key={series.name}\n >\n <rect\n class={{\n 'chart-bar-stacked__segment-shape': true,\n 'chart-bar-stacked__segment-shape--rounded': hasRoundedTop,\n }}\n x={barX}\n y={segmentY}\n width={barWidth}\n height={segmentHeight}\n fill={fill}\n />\n {hasRoundedTop ? (\n <rect\n class=\"chart-bar-stacked__segment-square-base\"\n x={barX}\n y={squareBaseY}\n width={barWidth}\n height={squareBaseHeight}\n fill={fill}\n />\n ) : null}\n {segmentStart > 0 ? (\n <line\n class=\"chart-bar-stacked__segment-separator\"\n x1={barX}\n x2={barX + barWidth}\n y1={segmentBottom}\n y2={segmentBottom}\n vector-effect=\"non-scaling-stroke\"\n />\n ) : null}\n </g>\n );\n })}\n <text\n class=\"chart-bar-stacked__axis-label\"\n x={barX + barWidth / 2}\n y={innerHeight + 16}\n text-anchor=\"middle\"\n >\n {category}\n </text>\n </g>\n );\n })}\n </g>\n </svg>\n </Host>\n );\n }\n}\n",
226
+ "content": "import { Component, Prop, State, Watch, h, Host } from '@stencil/core';\nimport { scaleBand, scaleLinear } from 'd3-scale';\nimport { categoryColor } from '../../utils/chart-colors';\nimport { formatPercentage } from '../../utils';\nimport { resolveCartesianChartLayout } from '../../utils/cartesian-chart-layout';\nimport {\n ChartViewportController,\n type ChartViewportSize,\n} from '../../utils/chart-viewport-controller';\nimport type { ChartSeries } from '../../utils/chart-types';\n\nexport type ChartBarStackedVariant = 'stacked' | 'percentage';\n\nconst PERCENTAGE_TICKS = [0, 25, 50, 75, 100];\n\n@Component({\n tag: 'ds-chart-bar-stacked',\n styleUrl: 'ChartBarStacked.css',\n scoped: true,\n})\nexport class ChartBarStacked {\n /** Ordered stack series. Set as a JS property (not an HTML attribute). */\n @Prop() series: ChartSeries[] = [];\n /** X-axis labels — must match each series' `data` length. Set as a JS property. */\n @Prop() categories: string[] = [];\n @Prop() variant: ChartBarStackedVariant = 'stacked';\n /** Standalone intrinsic width. Container constraints reflow the plot at rendered pixel size. */\n @Prop() width: number = 480;\n /** Standalone intrinsic height. Container constraints reflow the plot at rendered pixel size. */\n @Prop() height: number = 240;\n\n @State() private viewport: ChartViewportSize | undefined;\n\n private viewportController: ChartViewportController | null = null;\n private svgEl: SVGElement | null = null;\n\n componentDidLoad() {\n this.connectViewportController();\n }\n\n connectedCallback() {\n if (this.svgEl && !this.viewportController) this.connectViewportController();\n }\n\n componentDidRender() {\n if (!this.viewportController) this.connectViewportController();\n }\n\n private connectViewportController() {\n if (!this.svgEl) return;\n this.viewportController = new ChartViewportController(this.svgEl, viewport => {\n if (\n viewport.width !== this.viewport?.width ||\n viewport.height !== this.viewport?.height\n ) {\n this.viewport = viewport;\n }\n });\n this.viewportController.connect();\n }\n\n disconnectedCallback() {\n this.viewportController?.disconnect();\n this.viewportController = null;\n }\n\n @Watch('width')\n @Watch('height')\n handleIntrinsicSizeChange() {\n this.viewport = undefined;\n if (typeof requestAnimationFrame === 'function') {\n requestAnimationFrame(() => this.viewportController?.measure());\n }\n }\n\n private valuesForCategory(categoryIndex: number) {\n return this.series.map(series => Math.max(0, series.data[categoryIndex] ?? 0));\n }\n\n private accessibleLabel() {\n return this.categories\n .map((category, categoryIndex) => {\n const values = this.valuesForCategory(categoryIndex);\n const total = values.reduce((sum, value) => sum + value, 0);\n const details = this.series\n .map((series, seriesIndex) => {\n const value = values[seriesIndex];\n const visibleValue = this.variant === 'percentage'\n ? formatPercentage(total ? value / total : 0, 1)\n : String(value);\n return `${series.name}: ${visibleValue}`;\n })\n .join(', ');\n return `${category}: ${details}`;\n })\n .join('; ');\n }\n\n render() {\n const viewportWidth = this.viewport?.width ?? this.width;\n const viewportHeight = this.viewport?.height ?? this.height;\n const { margin, axisLabelGap, categoryLabelOffset } =\n resolveCartesianChartLayout();\n const innerWidth = Math.max(0, viewportWidth - margin.left - margin.right);\n const innerHeight = Math.max(0, viewportHeight - margin.top - margin.bottom);\n const categoryValues = this.categories.map((_, index) => this.valuesForCategory(index));\n const totals = categoryValues.map(values =>\n values.reduce((sum, value) => sum + value, 0)\n );\n const yMax = this.variant === 'percentage' ? 100 : Math.max(0, ...totals);\n\n const xScale = scaleBand()\n .domain(this.categories)\n .range([0, innerWidth])\n .padding(0.35);\n\n const yScale = scaleLinear()\n .domain([0, yMax || 1])\n .range([innerHeight, 0])\n .nice();\n\n const yTicks = this.variant === 'percentage' ? PERCENTAGE_TICKS : yScale.ticks(4);\n\n return (\n <Host class=\"chart-bar-stacked\">\n <svg\n class=\"chart-bar-stacked__svg\"\n ref={element => {\n this.svgEl = element ?? null;\n }}\n width={viewportWidth}\n height={viewportHeight}\n role=\"img\"\n aria-label={this.accessibleLabel()}\n >\n <g transform={`translate(${margin.left}, ${margin.top})`}>\n {yTicks.map(tick => (\n <g key={`grid-${tick}`} transform={`translate(0, ${yScale(tick)})`}>\n <line class=\"chart-bar-stacked__gridline\" x1={0} x2={innerWidth} />\n <text\n class=\"chart-bar-stacked__axis-label\"\n x={-axisLabelGap}\n text-anchor=\"end\"\n dominant-baseline=\"middle\"\n >\n {this.variant === 'percentage' ? `${tick}%` : tick}\n </text>\n </g>\n ))}\n\n {this.categories.map((category, categoryIndex) => {\n const barWidth = xScale.bandwidth();\n const barX = xScale(category) ?? 0;\n const values = categoryValues[categoryIndex];\n const total = totals[categoryIndex];\n const topSeriesIndex = values.reduce(\n (topIndex, value, seriesIndex) => (value > 0 ? seriesIndex : topIndex),\n -1\n );\n let cumulativeValue = 0;\n\n return (\n <g class=\"chart-bar-stacked__stack\" data-category={category} key={category}>\n {this.series.map((series, seriesIndex) => {\n const rawValue = values[seriesIndex];\n const value = this.variant === 'percentage'\n ? total\n ? (rawValue / total) * 100\n : 0\n : rawValue;\n const segmentStart = cumulativeValue;\n const segmentEnd = cumulativeValue + value;\n cumulativeValue = segmentEnd;\n\n const segmentY = yScale(segmentEnd);\n const segmentBottom = yScale(segmentStart);\n const segmentHeight = Math.max(0, segmentBottom - segmentY);\n if (!segmentHeight) return null;\n\n const fill = series.color ?? categoryColor(seriesIndex);\n const isTopSegment = seriesIndex === topSeriesIndex;\n const hasRoundedTop =\n this.variant === 'stacked' && isTopSegment;\n const squareBaseY = segmentY + segmentHeight / 2;\n const squareBaseHeight = segmentHeight / 2;\n\n return (\n <g\n class=\"chart-bar-stacked__segment\"\n data-series={series.name}\n key={series.name}\n >\n <rect\n class={{\n 'chart-bar-stacked__segment-shape': true,\n 'chart-bar-stacked__segment-shape--rounded': hasRoundedTop,\n }}\n x={barX}\n y={segmentY}\n width={barWidth}\n height={segmentHeight}\n fill={fill}\n />\n {hasRoundedTop ? (\n <rect\n class=\"chart-bar-stacked__segment-square-base\"\n x={barX}\n y={squareBaseY}\n width={barWidth}\n height={squareBaseHeight}\n fill={fill}\n />\n ) : null}\n {segmentStart > 0 ? (\n <line\n class=\"chart-bar-stacked__segment-separator\"\n x1={barX}\n x2={barX + barWidth}\n y1={segmentBottom}\n y2={segmentBottom}\n vector-effect=\"non-scaling-stroke\"\n />\n ) : null}\n </g>\n );\n })}\n <text\n class=\"chart-bar-stacked__axis-label\"\n x={barX + barWidth / 2}\n y={innerHeight + categoryLabelOffset}\n text-anchor=\"middle\"\n >\n {category}\n </text>\n </g>\n );\n })}\n </g>\n </svg>\n </Host>\n );\n }\n}\n",
222
227
  "type": "registry:ui"
223
228
  }
224
229
  ]
@@ -60,7 +60,8 @@
60
60
  "Authored datum colors override the shared categorical palette."
61
61
  ],
62
62
  "responsiveBehavior": [
63
- "The owner supplies dimensions and updates them with its layout; the chart does not measure its container.",
63
+ "Width and height provide the standalone intrinsic viewport; container constraints are measured and reflow the plot across the available pixels.",
64
+ "Responsive layout changes bar positions and plot extents without scaling SVG text, strokes, corner radii, or margins.",
64
65
  "Limit or pre-format long category labels so they remain legible at the chosen width.",
65
66
  "Time labels remain ordered, pre-formatted buckets with equal spacing rather than raw continuous timestamps."
66
67
  ],
@@ -69,10 +70,10 @@
69
70
  "Assign data as a JavaScript property; arrays are not supported as HTML attributes."
70
71
  ],
71
72
  "react": [
72
- "Pass a stable data array and dimensions derived from the containing layout."
73
+ "Pass a stable data array; width and height provide standalone intrinsic dimensions while constrained containers reflow automatically."
73
74
  ],
74
75
  "angular": [
75
- "Bind data as a property and update dimensions from the containing layout."
76
+ "Bind data as a property; width and height provide standalone intrinsic dimensions while constrained containers reflow automatically."
76
77
  ]
77
78
  },
78
79
  "references": [
@@ -98,7 +99,8 @@
98
99
  "attribute": "height",
99
100
  "default": "240",
100
101
  "required": false,
101
- "mutable": false
102
+ "mutable": false,
103
+ "description": "Standalone intrinsic height. Container constraints reflow the plot at rendered pixel size."
102
104
  },
103
105
  "width": {
104
106
  "type": "number",
@@ -106,7 +108,8 @@
106
108
  "attribute": "width",
107
109
  "default": "480",
108
110
  "required": false,
109
- "mutable": false
111
+ "mutable": false,
112
+ "description": "Standalone intrinsic width. Container constraints reflow the plot at rendered pixel size."
110
113
  }
111
114
  },
112
115
  "events": [],
@@ -128,7 +131,8 @@
128
131
  "attribute": "height",
129
132
  "default": "240",
130
133
  "required": false,
131
- "mutable": false
134
+ "mutable": false,
135
+ "description": "Standalone intrinsic height. Container constraints reflow the plot at rendered pixel size."
132
136
  },
133
137
  "width": {
134
138
  "type": "number",
@@ -136,7 +140,8 @@
136
140
  "attribute": "width",
137
141
  "default": "480",
138
142
  "required": false,
139
- "mutable": false
143
+ "mutable": false,
144
+ "description": "Standalone intrinsic width. Container constraints reflow the plot at rendered pixel size."
140
145
  }
141
146
  },
142
147
  "events": [],
@@ -165,7 +170,7 @@
165
170
  "complexPropertyNote": "Assign these non-primitive values as JavaScript properties: data.",
166
171
  "peerDependencies": {
167
172
  "required": [
168
- "@ds-mo/tokens ^3.1.1",
173
+ "@ds-mo/tokens ^5.0.0",
169
174
  "@ds-mo/icons ^6.4.0"
170
175
  ],
171
176
  "frameworks": "Custom Elements; React 18/19 wrappers; Angular 19-22 standalone adapters."
@@ -180,12 +185,12 @@
180
185
  "files": [
181
186
  {
182
187
  "path": "src/wc/components/ChartBar/ChartBar.css",
183
- "content": ":host {\n display: inline-flex;\n font-family: var(--typography-font-family);\n}\n\n.chart-bar__gridline {\n stroke: var(--color-border-tertiary);\n stroke-width: 1;\n}\n\n/* Matches ds-text text-caption regular (SVG cannot host ds-text). */\n.chart-bar__axis-label {\n fill: var(--color-foreground-secondary);\n font-family: var(--typography-font-family);\n font-size: var(--typography-fontsize-xs);\n font-weight: var(--typography-weight-medium);\n letter-spacing: var(--typography-letterspacing-positive);\n text-transform: uppercase;\n}\n\n.chart-bar__bar--rounded {\n rx: var(--dimension-radius-025);\n}\n",
188
+ "content": ":host {\n display: inline-block;\n max-width: 100%;\n font-family: var(--typography-font-family);\n}\n\n.chart-bar__svg {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n.chart-bar__gridline {\n stroke: var(--color-border-tertiary);\n stroke-width: var(--dimension-stroke-width-012);\n vector-effect: non-scaling-stroke;\n}\n\n/* Matches ds-text text-caption regular (SVG cannot host ds-text). */\n.chart-bar__axis-label {\n fill: var(--color-foreground-secondary);\n font-family: var(--typography-font-family);\n font-size: var(--typography-fontsize-xs);\n font-weight: var(--typography-weight-medium);\n letter-spacing: var(--typography-letterspacing-positive);\n text-transform: uppercase;\n}\n\n.chart-bar__bar--rounded {\n rx: var(--dimension-radius-025);\n}\n",
184
189
  "type": "registry:ui"
185
190
  },
186
191
  {
187
192
  "path": "src/wc/components/ChartBar/ChartBar.tsx",
188
- "content": "import { Component, Prop, h, Host } from '@stencil/core';\nimport { scaleBand, scaleLinear } from 'd3-scale';\nimport { max } from 'd3-array';\nimport { categoryColor } from '../../utils/chart-colors';\nimport type { ChartDatum } from '../../utils/chart-types';\n\nconst MARGIN = { top: 16, right: 16, bottom: 24, left: 32 };\n\n@Component({\n tag: 'ds-chart-bar',\n styleUrl: 'ChartBar.css',\n scoped: true,\n})\nexport class ChartBar {\n /** Bars to render. Set as a JS property (not an HTML attribute). */\n @Prop() data: ChartDatum[] = [];\n @Prop() width: number = 480;\n @Prop() height: number = 240;\n\n render() {\n const innerWidth = this.width - MARGIN.left - MARGIN.right;\n const innerHeight = this.height - MARGIN.top - MARGIN.bottom;\n\n const yMax = max(this.data, d => d.value) ?? 0;\n\n const xScale = scaleBand()\n .domain(this.data.map(d => d.label))\n .range([0, innerWidth])\n .padding(0.35);\n\n const yScale = scaleLinear()\n .domain([0, yMax || 1])\n .range([innerHeight, 0])\n .nice();\n\n const yTicks = yScale.ticks(4);\n\n return (\n <Host class=\"chart-bar\">\n <svg\n class=\"chart-bar__svg\"\n viewBox={`0 0 ${this.width} ${this.height}`}\n width={this.width}\n height={this.height}\n role=\"img\"\n aria-label={this.data.map(d => `${d.label}: ${d.value}`).join(', ')}\n >\n <g transform={`translate(${MARGIN.left}, ${MARGIN.top})`}>\n {yTicks.map(tick => (\n <g key={`grid-${tick}`} transform={`translate(0, ${yScale(tick)})`}>\n <line class=\"chart-bar__gridline\" x1={0} x2={innerWidth} />\n <text class=\"chart-bar__axis-label\" x={-8} text-anchor=\"end\" dominant-baseline=\"middle\">\n {tick}\n </text>\n </g>\n ))}\n\n {this.data.map((d, i) => {\n const barWidth = xScale.bandwidth();\n const barX = xScale(d.label) ?? 0;\n const barY = yScale(d.value);\n const barHeight = innerHeight - barY;\n const squareBaseY = barY + barHeight / 2;\n const squareBaseHeight = barHeight / 2;\n const fill = d.color ?? categoryColor(i);\n return (\n <g key={d.label}>\n <rect\n class=\"chart-bar__bar chart-bar__bar--rounded\"\n x={barX}\n y={barY}\n width={barWidth}\n height={barHeight}\n fill={fill}\n />\n <rect\n class=\"chart-bar__bar chart-bar__bar--square-base\"\n x={barX}\n y={squareBaseY}\n width={barWidth}\n height={squareBaseHeight}\n fill={fill}\n />\n <text\n class=\"chart-bar__axis-label\"\n x={barX + barWidth / 2}\n y={innerHeight + 16}\n text-anchor=\"middle\"\n >\n {d.label}\n </text>\n </g>\n );\n })}\n </g>\n </svg>\n </Host>\n );\n }\n}\n",
193
+ "content": "import { Component, Prop, State, Watch, h, Host } from '@stencil/core';\nimport { scaleBand, scaleLinear } from 'd3-scale';\nimport { max } from 'd3-array';\nimport { categoryColor } from '../../utils/chart-colors';\nimport { resolveCartesianChartLayout } from '../../utils/cartesian-chart-layout';\nimport {\n ChartViewportController,\n type ChartViewportSize,\n} from '../../utils/chart-viewport-controller';\nimport type { ChartDatum } from '../../utils/chart-types';\n\n@Component({\n tag: 'ds-chart-bar',\n styleUrl: 'ChartBar.css',\n scoped: true,\n})\nexport class ChartBar {\n /** Bars to render. Set as a JS property (not an HTML attribute). */\n @Prop() data: ChartDatum[] = [];\n /** Standalone intrinsic width. Container constraints reflow the plot at rendered pixel size. */\n @Prop() width: number = 480;\n /** Standalone intrinsic height. Container constraints reflow the plot at rendered pixel size. */\n @Prop() height: number = 240;\n\n @State() private viewport: ChartViewportSize | undefined;\n\n private viewportController: ChartViewportController | null = null;\n private svgEl: SVGElement | null = null;\n\n componentDidLoad() {\n this.connectViewportController();\n }\n\n connectedCallback() {\n if (this.svgEl && !this.viewportController) this.connectViewportController();\n }\n\n componentDidRender() {\n if (!this.viewportController) this.connectViewportController();\n }\n\n private connectViewportController() {\n if (!this.svgEl) return;\n this.viewportController = new ChartViewportController(this.svgEl, viewport => {\n if (\n viewport.width !== this.viewport?.width ||\n viewport.height !== this.viewport?.height\n ) {\n this.viewport = viewport;\n }\n });\n this.viewportController.connect();\n }\n\n disconnectedCallback() {\n this.viewportController?.disconnect();\n this.viewportController = null;\n }\n\n @Watch('width')\n @Watch('height')\n handleIntrinsicSizeChange() {\n this.viewport = undefined;\n if (typeof requestAnimationFrame === 'function') {\n requestAnimationFrame(() => this.viewportController?.measure());\n }\n }\n\n render() {\n const viewportWidth = this.viewport?.width ?? this.width;\n const viewportHeight = this.viewport?.height ?? this.height;\n const { margin, axisLabelGap, categoryLabelOffset } =\n resolveCartesianChartLayout();\n const innerWidth = Math.max(0, viewportWidth - margin.left - margin.right);\n const innerHeight = Math.max(0, viewportHeight - margin.top - margin.bottom);\n\n const yMax = max(this.data, d => d.value) ?? 0;\n\n const xScale = scaleBand()\n .domain(this.data.map(d => d.label))\n .range([0, innerWidth])\n .padding(0.35);\n\n const yScale = scaleLinear()\n .domain([0, yMax || 1])\n .range([innerHeight, 0])\n .nice();\n\n const yTicks = yScale.ticks(4);\n\n return (\n <Host class=\"chart-bar\">\n <svg\n class=\"chart-bar__svg\"\n ref={element => {\n this.svgEl = element ?? null;\n }}\n width={viewportWidth}\n height={viewportHeight}\n role=\"img\"\n aria-label={this.data.map(d => `${d.label}: ${d.value}`).join(', ')}\n >\n <g transform={`translate(${margin.left}, ${margin.top})`}>\n {yTicks.map(tick => (\n <g key={`grid-${tick}`} transform={`translate(0, ${yScale(tick)})`}>\n <line class=\"chart-bar__gridline\" x1={0} x2={innerWidth} />\n <text\n class=\"chart-bar__axis-label\"\n x={-axisLabelGap}\n text-anchor=\"end\"\n dominant-baseline=\"middle\"\n >\n {tick}\n </text>\n </g>\n ))}\n\n {this.data.map((d, i) => {\n const barWidth = xScale.bandwidth();\n const barX = xScale(d.label) ?? 0;\n const barY = yScale(d.value);\n const barHeight = innerHeight - barY;\n const squareBaseY = barY + barHeight / 2;\n const squareBaseHeight = barHeight / 2;\n const fill = d.color ?? categoryColor(i);\n return (\n <g key={d.label}>\n <rect\n class=\"chart-bar__bar chart-bar__bar--rounded\"\n x={barX}\n y={barY}\n width={barWidth}\n height={barHeight}\n fill={fill}\n />\n <rect\n class=\"chart-bar__bar chart-bar__bar--square-base\"\n x={barX}\n y={squareBaseY}\n width={barWidth}\n height={squareBaseHeight}\n fill={fill}\n />\n <text\n class=\"chart-bar__axis-label\"\n x={barX + barWidth / 2}\n y={innerHeight + categoryLabelOffset}\n text-anchor=\"middle\"\n >\n {d.label}\n </text>\n </g>\n );\n })}\n </g>\n </svg>\n </Host>\n );\n }\n}\n",
189
194
  "type": "registry:ui"
190
195
  }
191
196
  ]