@ds-mo/ui 13.6.0 → 13.7.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 (259) hide show
  1. package/dist/.package-ready.json +1 -1
  2. package/dist/agent-patterns.json +2 -2
  3. package/dist/agent.json +109 -371
  4. package/dist/angular/ds-card-chart.d.ts +18 -0
  5. package/dist/angular/{ds-card-data-viz.js → ds-card-chart.js} +10 -10
  6. package/dist/angular/ds-chart.d.ts +19 -0
  7. package/dist/angular/{ds-chart-donut.js → ds-chart.js} +15 -15
  8. package/dist/angular/ds-tooltip-chart.d.ts +12 -0
  9. package/dist/angular/{ds-chart-line.js → ds-tooltip-chart.js} +12 -12
  10. package/dist/angular/index.d.ts +1 -1
  11. package/dist/angular/index.js +3 -5
  12. package/dist/angular/proxies.d.ts +3 -5
  13. package/dist/angular/proxies.js +3 -5
  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-banner.js +1 -1
  21. package/dist/components/ds-banner.js.map +1 -1
  22. package/dist/components/ds-bar-nav.js +1 -1
  23. package/dist/components/ds-bar-title.js +1 -1
  24. package/dist/components/ds-bar-workflow.js +1 -1
  25. package/dist/components/ds-breadcrumb.js +1 -1
  26. package/dist/components/ds-button-filled.js +1 -1
  27. package/dist/components/ds-button-unfilled.js +1 -1
  28. package/dist/components/{ds-chart-line.d.ts → ds-card-chart.d.ts} +4 -4
  29. package/dist/components/ds-card-chart.js +2 -0
  30. package/dist/components/ds-card-chart.js.map +1 -0
  31. package/dist/components/ds-card-overview.js +1 -1
  32. package/dist/components/ds-card-setting.js +1 -1
  33. package/dist/components/ds-card-setting.js.map +1 -1
  34. package/dist/components/ds-chart-legend.js +1 -1
  35. package/dist/components/ds-chart-legend.js.map +1 -1
  36. package/dist/components/{ds-chart-bar.d.ts → ds-chart.d.ts} +4 -4
  37. package/dist/components/ds-chart.js +2 -0
  38. package/dist/components/ds-chart.js.map +1 -0
  39. package/dist/components/ds-checkbox.js +1 -1
  40. package/dist/components/ds-chip.js +1 -1
  41. package/dist/components/ds-code-block.js +1 -1
  42. package/dist/components/ds-conversation-list-item.js +1 -1
  43. package/dist/components/ds-conversation-list-section.js +1 -1
  44. package/dist/components/ds-conversation-list.js +1 -1
  45. package/dist/components/ds-divider.js +1 -1
  46. package/dist/components/ds-empty-state.js +1 -1
  47. package/dist/components/ds-field.js +1 -1
  48. package/dist/components/ds-input.js +1 -1
  49. package/dist/components/ds-markdown.js +1 -1
  50. package/dist/components/ds-menu.js +1 -1
  51. package/dist/components/ds-message-actions.js +1 -1
  52. package/dist/components/ds-message-bubble.js +1 -1
  53. package/dist/components/ds-message-composer.js +1 -1
  54. package/dist/components/ds-message-composer.js.map +1 -1
  55. package/dist/components/ds-message-scroller.js +1 -1
  56. package/dist/components/ds-message.js +1 -1
  57. package/dist/components/ds-mobile-bar-nav.js +1 -1
  58. package/dist/components/ds-mobile-header.js +1 -1
  59. package/dist/components/ds-mobile-section-switcher.js +1 -1
  60. package/dist/components/ds-mobile-sheet-nav.js +1 -1
  61. package/dist/components/ds-modal.js +1 -1
  62. package/dist/components/ds-modal.js.map +1 -1
  63. package/dist/components/ds-panel-nav.js +1 -1
  64. package/dist/components/ds-panel-sub-nav.js +1 -1
  65. package/dist/components/ds-panel-tool-header.js +1 -1
  66. package/dist/components/ds-panel-tool-search.js +1 -1
  67. package/dist/components/ds-panel-tools.js +1 -1
  68. package/dist/components/ds-radio.js +1 -1
  69. package/dist/components/ds-scroll-overlay.js +1 -1
  70. package/dist/components/ds-scroll-overlay.js.map +1 -1
  71. package/dist/components/ds-select.js +1 -1
  72. package/dist/components/ds-select.js.map +1 -1
  73. package/dist/components/ds-shell-app.js +1 -1
  74. package/dist/components/ds-shell-page.js +1 -1
  75. package/dist/components/ds-shell-tools.js +1 -1
  76. package/dist/components/ds-skeleton.js +1 -1
  77. package/dist/components/ds-slider.js +1 -1
  78. package/dist/components/ds-swatch-picker.js +1 -1
  79. package/dist/components/ds-switch.js +1 -1
  80. package/dist/components/ds-tab-group.js +1 -1
  81. package/dist/components/ds-tag.js +1 -1
  82. package/dist/components/ds-text.js +1 -1
  83. package/dist/components/ds-toast.js +1 -1
  84. package/dist/components/ds-toast.js.map +1 -1
  85. package/dist/components/{ds-card-data-viz.d.ts → ds-tooltip-chart.d.ts} +4 -4
  86. package/dist/components/ds-tooltip-chart.js +2 -0
  87. package/dist/components/ds-tooltip.js +1 -1
  88. package/dist/components/ds-typing-indicator.js +1 -1
  89. package/dist/components/{p-IYy-jODg.js → p-1Zbh1MRy.js} +2 -2
  90. package/dist/components/{p-wOOAzVMC.js → p-BVsLc3t5.js} +2 -2
  91. package/dist/components/p-BZCUFHYa.js +2 -0
  92. package/dist/components/{p-D0bM3cKj.js.map → p-BZCUFHYa.js.map} +1 -1
  93. package/dist/components/{p-BBtjABBS.js → p-BjiRqLtB.js} +2 -2
  94. package/dist/components/p-Bk1A9jLm.js +2 -0
  95. package/dist/components/p-Bk1A9jLm.js.map +1 -0
  96. package/dist/components/{p-Bsfpxto1.js → p-BsBw-w1q.js} +2 -2
  97. package/dist/components/p-ByfXC1wu.js +2 -0
  98. package/dist/components/{p-1S9AW2MA.js.map → p-ByfXC1wu.js.map} +1 -1
  99. package/dist/components/{p-B6RrZQqw.js → p-C-ENnZzq.js} +2 -2
  100. package/dist/components/{p-BPyymeuR.js → p-C2U48kDH.js} +2 -2
  101. package/dist/components/{p-CKRJX0Y0.js → p-C7mCjS2t.js} +2 -2
  102. package/dist/components/{p-6B411hQA.js → p-CL8XL1eh.js} +2 -2
  103. package/dist/components/{p-DfvDNcoq.js → p-CMZVPEZ_.js} +2 -2
  104. package/dist/components/{p-BtuYufL3.js → p-CWL61nKt.js} +2 -2
  105. package/dist/components/p-CWL61nKt.js.map +1 -0
  106. package/dist/components/p-CWLrXsDQ.js +2 -0
  107. package/dist/components/{p-D2cjoj2r.js.map → p-CWLrXsDQ.js.map} +1 -1
  108. package/dist/components/{p-Di81y9Q2.js → p-CX7QIytv.js} +2 -2
  109. package/dist/components/p-CXduurfd.js +2 -0
  110. package/dist/components/p-CXduurfd.js.map +1 -0
  111. package/dist/components/p-CbAfTqlb.js +2 -0
  112. package/dist/components/{p-CuJ3J6OJ.js.map → p-CbAfTqlb.js.map} +1 -1
  113. package/dist/components/{p-DVuxzrCC.js → p-CfTThRNX.js} +2 -2
  114. package/dist/components/{p-BmNpPyzf.js → p-CkLffZGn.js} +2 -2
  115. package/dist/components/{p-B4_0Ys4w.js → p-CkyXU1YX.js} +2 -2
  116. package/dist/components/{p-iCjUWcp7.js → p-CywKWfgD.js} +2 -2
  117. package/dist/components/{p-BR_oMaas.js → p-D3UKwTEo.js} +2 -2
  118. package/dist/components/{p-Bl6A5AJq.js → p-D7z9bJ6n.js} +2 -2
  119. package/dist/components/{p-DaqFuVKZ.js → p-DAftUxvL.js} +2 -2
  120. package/dist/components/{p-BFfHIu6y.js → p-DQ94PkZA.js} +2 -2
  121. package/dist/components/{p-B-kRByho.js → p-DSpq7xQF.js} +2 -2
  122. package/dist/components/{p-og48Kh2i.js → p-DzM3TcyQ.js} +2 -2
  123. package/dist/components/p-GbTasczF.js +2 -0
  124. package/dist/components/{p-Ca6s5fLR.js → p-Mmr9b1bB.js} +2 -2
  125. package/dist/components/p-UH2AGfR0.js +2 -0
  126. package/dist/components/{p-DX4c3kZ1.js.map → p-UH2AGfR0.js.map} +1 -1
  127. package/dist/components/{p-CxgMUvqg.js → p-Z2zfShlF.js} +2 -2
  128. package/dist/components/{p-Bmo4T96l.js → p-_mClULFL.js} +2 -2
  129. package/dist/components/{p-Bb4f5SuF.js → p-jf1zCsuw.js} +2 -2
  130. package/dist/components/{p-Eep5mxtv.js → p-oiR4IoH1.js} +2 -2
  131. package/dist/components/{p-DHF5cLzr.js → p-u2OZHaLY.js} +2 -2
  132. package/dist/docs/components.json +180 -662
  133. package/dist/lib/utils/chart-grammar.d.ts +359 -0
  134. package/dist/lib/utils/index.d.ts +2 -0
  135. package/dist/lib/utils/index.js +504 -0
  136. package/dist/lib/utils/index.js.map +4 -4
  137. package/dist/lib/utils/token-defaults.d.ts +3 -0
  138. package/dist/mcp-data/registry/banner.json +2 -2
  139. package/dist/mcp-data/registry/card-chart.json +238 -0
  140. package/dist/mcp-data/registry/card-overview.json +2 -2
  141. package/dist/mcp-data/registry/card-setting.json +2 -2
  142. package/dist/mcp-data/registry/chart-legend.json +11 -18
  143. package/dist/mcp-data/registry/chart.json +258 -0
  144. package/dist/mcp-data/registry/mobile-bar-nav.json +3 -3
  145. package/dist/mcp-data/registry/registry.json +108 -376
  146. package/dist/mcp-data/registry/tooltip-chart.json +253 -0
  147. package/dist/mcp-data/registry/tooltip.json +2 -2
  148. package/dist/react/components.d.ts +3 -5
  149. package/dist/react/components.js +3 -5
  150. package/dist/react/ds-card-chart.d.ts +12 -0
  151. package/dist/react/ds-card-chart.js +12 -0
  152. package/dist/react/ds-chart.d.ts +12 -0
  153. package/dist/react/ds-chart.js +12 -0
  154. package/dist/react/{ds-chart-bar.d.ts → ds-tooltip-chart.d.ts} +3 -3
  155. package/dist/react/ds-tooltip-chart.js +12 -0
  156. package/dist/types/components/{CardDataViz/CardDataViz.d.ts → CardChart/CardChart.d.ts} +9 -13
  157. package/dist/types/components/CardChart/index.d.ts +2 -0
  158. package/dist/types/components/Chart/Chart.d.ts +66 -0
  159. package/dist/types/components/Chart/index.d.ts +2 -0
  160. package/dist/types/components/ChartLegend/ChartLegend.d.ts +1 -1
  161. package/dist/types/components/{TooltipDataViz/TooltipDataViz.d.ts → TooltipChart/TooltipChart.d.ts} +15 -6
  162. package/dist/types/components/TooltipChart/index.d.ts +2 -0
  163. package/dist/types/components.d.ts +129 -294
  164. package/dist/types/utils/chart-grammar.d.ts +360 -0
  165. package/dist/types/utils/chart-scene.d.ts +128 -0
  166. package/dist/types/utils/chart-theme.d.ts +27 -0
  167. package/dist/types/utils/chart-types.d.ts +0 -13
  168. package/dist/types/utils/index.d.ts +2 -0
  169. package/dist/types/utils/token-defaults.d.ts +3 -0
  170. package/package.json +1 -1
  171. package/dist/angular/ds-card-data-viz.d.ts +0 -18
  172. package/dist/angular/ds-chart-bar.d.ts +0 -12
  173. package/dist/angular/ds-chart-bar.js +0 -38
  174. package/dist/angular/ds-chart-donut.d.ts +0 -19
  175. package/dist/angular/ds-chart-line.d.ts +0 -12
  176. package/dist/angular/ds-tooltip-data-viz.d.ts +0 -12
  177. package/dist/angular/ds-tooltip-data-viz.js +0 -38
  178. package/dist/components/ds-card-data-viz.js +0 -2
  179. package/dist/components/ds-card-data-viz.js.map +0 -1
  180. package/dist/components/ds-chart-bar.js +0 -2
  181. package/dist/components/ds-chart-bar.js.map +0 -1
  182. package/dist/components/ds-chart-donut.d.ts +0 -11
  183. package/dist/components/ds-chart-donut.js +0 -2
  184. package/dist/components/ds-chart-donut.js.map +0 -1
  185. package/dist/components/ds-chart-line.js +0 -2
  186. package/dist/components/ds-chart-line.js.map +0 -1
  187. package/dist/components/ds-tooltip-data-viz.d.ts +0 -11
  188. package/dist/components/ds-tooltip-data-viz.js +0 -2
  189. package/dist/components/p-1S9AW2MA.js +0 -2
  190. package/dist/components/p-B6Vuayt6.js +0 -2
  191. package/dist/components/p-B6Vuayt6.js.map +0 -1
  192. package/dist/components/p-BBpASejH.js +0 -2
  193. package/dist/components/p-BBpASejH.js.map +0 -1
  194. package/dist/components/p-BtuYufL3.js.map +0 -1
  195. package/dist/components/p-BybqPD8K.js +0 -2
  196. package/dist/components/p-BybqPD8K.js.map +0 -1
  197. package/dist/components/p-C4uYvyq6.js +0 -2
  198. package/dist/components/p-C4uYvyq6.js.map +0 -1
  199. package/dist/components/p-CbjFUpOj.js +0 -2
  200. package/dist/components/p-CbjFUpOj.js.map +0 -1
  201. package/dist/components/p-CrCGIx8s.js +0 -2
  202. package/dist/components/p-CrCGIx8s.js.map +0 -1
  203. package/dist/components/p-CuJ3J6OJ.js +0 -2
  204. package/dist/components/p-D0bM3cKj.js +0 -2
  205. package/dist/components/p-D2cjoj2r.js +0 -2
  206. package/dist/components/p-DX4c3kZ1.js +0 -2
  207. package/dist/components/p-DXewjzkM.js +0 -2
  208. package/dist/components/p-DXewjzkM.js.map +0 -1
  209. package/dist/components/p-yhj1lIPx.js +0 -2
  210. package/dist/mcp-data/registry/card-data-viz.json +0 -241
  211. package/dist/mcp-data/registry/chart-bar.json +0 -245
  212. package/dist/mcp-data/registry/chart-donut.json +0 -344
  213. package/dist/mcp-data/registry/chart-line.json +0 -223
  214. package/dist/mcp-data/registry/tooltip-data-viz.json +0 -224
  215. package/dist/react/ds-card-data-viz.d.ts +0 -12
  216. package/dist/react/ds-card-data-viz.js +0 -12
  217. package/dist/react/ds-chart-bar.js +0 -12
  218. package/dist/react/ds-chart-donut.d.ts +0 -12
  219. package/dist/react/ds-chart-donut.js +0 -12
  220. package/dist/react/ds-chart-line.d.ts +0 -9
  221. package/dist/react/ds-chart-line.js +0 -12
  222. package/dist/react/ds-tooltip-data-viz.d.ts +0 -9
  223. package/dist/react/ds-tooltip-data-viz.js +0 -12
  224. package/dist/types/components/CardDataViz/index.d.ts +0 -2
  225. package/dist/types/components/ChartBar/ChartBar.d.ts +0 -31
  226. package/dist/types/components/ChartBar/index.d.ts +0 -3
  227. package/dist/types/components/ChartDonut/ChartDonut.d.ts +0 -72
  228. package/dist/types/components/ChartDonut/index.d.ts +0 -2
  229. package/dist/types/components/ChartLine/ChartLine.d.ts +0 -23
  230. package/dist/types/components/ChartLine/index.d.ts +0 -2
  231. package/dist/types/components/TooltipDataViz/index.d.ts +0 -2
  232. /package/dist/components/{ds-tooltip-data-viz.js.map → ds-tooltip-chart.js.map} +0 -0
  233. /package/dist/components/{p-IYy-jODg.js.map → p-1Zbh1MRy.js.map} +0 -0
  234. /package/dist/components/{p-wOOAzVMC.js.map → p-BVsLc3t5.js.map} +0 -0
  235. /package/dist/components/{p-BBtjABBS.js.map → p-BjiRqLtB.js.map} +0 -0
  236. /package/dist/components/{p-Bsfpxto1.js.map → p-BsBw-w1q.js.map} +0 -0
  237. /package/dist/components/{p-B6RrZQqw.js.map → p-C-ENnZzq.js.map} +0 -0
  238. /package/dist/components/{p-BPyymeuR.js.map → p-C2U48kDH.js.map} +0 -0
  239. /package/dist/components/{p-CKRJX0Y0.js.map → p-C7mCjS2t.js.map} +0 -0
  240. /package/dist/components/{p-6B411hQA.js.map → p-CL8XL1eh.js.map} +0 -0
  241. /package/dist/components/{p-DfvDNcoq.js.map → p-CMZVPEZ_.js.map} +0 -0
  242. /package/dist/components/{p-Di81y9Q2.js.map → p-CX7QIytv.js.map} +0 -0
  243. /package/dist/components/{p-DVuxzrCC.js.map → p-CfTThRNX.js.map} +0 -0
  244. /package/dist/components/{p-BmNpPyzf.js.map → p-CkLffZGn.js.map} +0 -0
  245. /package/dist/components/{p-B4_0Ys4w.js.map → p-CkyXU1YX.js.map} +0 -0
  246. /package/dist/components/{p-iCjUWcp7.js.map → p-CywKWfgD.js.map} +0 -0
  247. /package/dist/components/{p-BR_oMaas.js.map → p-D3UKwTEo.js.map} +0 -0
  248. /package/dist/components/{p-Bl6A5AJq.js.map → p-D7z9bJ6n.js.map} +0 -0
  249. /package/dist/components/{p-DaqFuVKZ.js.map → p-DAftUxvL.js.map} +0 -0
  250. /package/dist/components/{p-BFfHIu6y.js.map → p-DQ94PkZA.js.map} +0 -0
  251. /package/dist/components/{p-B-kRByho.js.map → p-DSpq7xQF.js.map} +0 -0
  252. /package/dist/components/{p-og48Kh2i.js.map → p-DzM3TcyQ.js.map} +0 -0
  253. /package/dist/components/{p-yhj1lIPx.js.map → p-GbTasczF.js.map} +0 -0
  254. /package/dist/components/{p-Ca6s5fLR.js.map → p-Mmr9b1bB.js.map} +0 -0
  255. /package/dist/components/{p-CxgMUvqg.js.map → p-Z2zfShlF.js.map} +0 -0
  256. /package/dist/components/{p-Bmo4T96l.js.map → p-_mClULFL.js.map} +0 -0
  257. /package/dist/components/{p-Bb4f5SuF.js.map → p-jf1zCsuw.js.map} +0 -0
  258. /package/dist/components/{p-Eep5mxtv.js.map → p-oiR4IoH1.js.map} +0 -0
  259. /package/dist/components/{p-DHF5cLzr.js.map → p-u2OZHaLY.js.map} +0 -0
@@ -0,0 +1,238 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "card-chart",
4
+ "title": "CardChart",
5
+ "description": "Standard chart 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-chart",
11
+ "source": "src/wc/components/CardChart/CardChart.tsx",
12
+ "intentStatus": "complete",
13
+ "intent": {
14
+ "audience": "specialized",
15
+ "status": "stable",
16
+ "summary": "Standard chart card chrome with variant-owned chart and legend composition.",
17
+ "useWhen": [
18
+ "A chart, legend, metric visualization, or custom chart composition needs standard card chrome.",
19
+ "A chart and static external legend need one standard card layout.",
20
+ "A chart 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",
36
+ "component:ds-chart-legend",
37
+ "component:ds-button-unfilled"
38
+ ],
39
+ "accessibility": [
40
+ "Provide a concise visible heading; the component renders it as a section heading.",
41
+ "Slotted actions must provide accessible names and controlled-state semantics.",
42
+ "Charts retain their own image names and data summaries.",
43
+ "A visible legend provides persistent labels while the chart retains its own accessible name and focus behavior."
44
+ ],
45
+ "states": [
46
+ "Custom mode provides flexible body chrome and does not mutate chart or legend interaction.",
47
+ "Chart mode keeps a slotted external legend static by disabling hover emphasis.",
48
+ "showFilter adds the standard filter action and emits dsFilterClick without owning filter state."
49
+ ],
50
+ "responsiveBehavior": [
51
+ "The sm, md, or lg width sets a matching token-based minimum height and remains constrained by its parent.",
52
+ "The body allocates remaining height to an unconfigured ds-chart while legends retain content height; authored chart height and aspectRatio remain authoritative.",
53
+ "Parent layouts own wrapping, stacking, and breakpoint-dependent card width."
54
+ ],
55
+ "frameworkCaveats": {
56
+ "customElements": [
57
+ "Set variant to chart for the standard chart and static legend layout; slot chart, legend, actions, and supporting content by name."
58
+ ],
59
+ "react": [
60
+ "Keep chart data in React and pass chart, legend, and action elements through named slots."
61
+ ],
62
+ "angular": [
63
+ "Keep chart data in Angular and project chart, legend, and action elements through named slots."
64
+ ]
65
+ },
66
+ "references": [
67
+ {
68
+ "label": "Storybook examples",
69
+ "path": "src/wc/components/CardChart/CardChart.stories.ts"
70
+ }
71
+ ]
72
+ },
73
+ "api": {
74
+ "props": {
75
+ "cardWidth": {
76
+ "type": "CardChartWidth",
77
+ "resolvedType": "\"lg\" | \"md\" | \"sm\"",
78
+ "attribute": "card-width",
79
+ "default": "'md'",
80
+ "required": false,
81
+ "mutable": false,
82
+ "description": "Width token with the matching chart-card min-height."
83
+ },
84
+ "filterLabel": {
85
+ "type": "string",
86
+ "resolvedType": "string",
87
+ "attribute": "filter-label",
88
+ "default": "'Filter'",
89
+ "required": false,
90
+ "mutable": false
91
+ },
92
+ "heading": {
93
+ "type": "string",
94
+ "resolvedType": "string",
95
+ "attribute": "heading",
96
+ "required": true,
97
+ "mutable": false,
98
+ "description": "Chart heading shown in the card header."
99
+ },
100
+ "showFilter": {
101
+ "type": "boolean",
102
+ "resolvedType": "boolean",
103
+ "attribute": "show-filter",
104
+ "default": "false",
105
+ "required": false,
106
+ "mutable": false,
107
+ "description": "Renders the standard filter action before custom actions."
108
+ },
109
+ "variant": {
110
+ "type": "CardChartVariant",
111
+ "resolvedType": "\"chart\" | \"custom\"",
112
+ "attribute": "variant",
113
+ "default": "'custom'",
114
+ "required": false,
115
+ "mutable": false,
116
+ "description": "Chart composition behavior."
117
+ }
118
+ },
119
+ "events": [
120
+ {
121
+ "name": "dsFilterClick",
122
+ "detail": "void",
123
+ "bubbles": true,
124
+ "cancelable": true,
125
+ "composed": true,
126
+ "description": "Emits when the standard header filter control is activated."
127
+ }
128
+ ],
129
+ "methods": [],
130
+ "slots": []
131
+ },
132
+ "props": {
133
+ "cardWidth": {
134
+ "type": "CardChartWidth",
135
+ "resolvedType": "\"lg\" | \"md\" | \"sm\"",
136
+ "attribute": "card-width",
137
+ "default": "'md'",
138
+ "required": false,
139
+ "mutable": false,
140
+ "description": "Width token with the matching chart-card min-height."
141
+ },
142
+ "filterLabel": {
143
+ "type": "string",
144
+ "resolvedType": "string",
145
+ "attribute": "filter-label",
146
+ "default": "'Filter'",
147
+ "required": false,
148
+ "mutable": false
149
+ },
150
+ "heading": {
151
+ "type": "string",
152
+ "resolvedType": "string",
153
+ "attribute": "heading",
154
+ "required": true,
155
+ "mutable": false,
156
+ "description": "Chart heading shown in the card header."
157
+ },
158
+ "showFilter": {
159
+ "type": "boolean",
160
+ "resolvedType": "boolean",
161
+ "attribute": "show-filter",
162
+ "default": "false",
163
+ "required": false,
164
+ "mutable": false,
165
+ "description": "Renders the standard filter action before custom actions."
166
+ },
167
+ "variant": {
168
+ "type": "CardChartVariant",
169
+ "resolvedType": "\"chart\" | \"custom\"",
170
+ "attribute": "variant",
171
+ "default": "'custom'",
172
+ "required": false,
173
+ "mutable": false,
174
+ "description": "Chart composition behavior."
175
+ }
176
+ },
177
+ "events": [
178
+ {
179
+ "name": "dsFilterClick",
180
+ "detail": "void",
181
+ "bubbles": true,
182
+ "cancelable": true,
183
+ "composed": true,
184
+ "description": "Emits when the standard header filter control is activated."
185
+ }
186
+ ],
187
+ "methods": [],
188
+ "slots": [],
189
+ "exports": {
190
+ "customElement": "ds-card-chart",
191
+ "react": "DsCardChart",
192
+ "angular": "DsCardChart"
193
+ },
194
+ "consumption": {
195
+ "install": "npm install @ds-mo/ui @ds-mo/tokens @ds-mo/icons",
196
+ "cssSetup": "import '@ds-mo/tokens';\nimport '@ds-mo/tokens/reset';\nimport '@ds-mo/tokens/globals';",
197
+ "customElements": {
198
+ "import": "import '@ds-mo/ui/dist/components/ds-card-chart.js';",
199
+ "example": "<ds-card-chart></ds-card-chart>"
200
+ },
201
+ "react": {
202
+ "import": "import { DsCardChart } from '@ds-mo/ui/react';",
203
+ "example": "<DsCardChart />"
204
+ },
205
+ "angular": {
206
+ "import": "import { DsCardChart } from '@ds-mo/ui/angular/ds-card-chart';",
207
+ "example": "<ds-card-chart></ds-card-chart>"
208
+ },
209
+ "peerDependencies": {
210
+ "required": [
211
+ "@ds-mo/tokens ^5.1.1",
212
+ "@ds-mo/icons ^6.4.0"
213
+ ],
214
+ "frameworks": "Custom Elements; React 18/19 wrappers; Angular 19-22 standalone adapters."
215
+ }
216
+ }
217
+ },
218
+ "dependencies": [
219
+ "@ds-mo/ui",
220
+ "@ds-mo/tokens"
221
+ ],
222
+ "registryDependencies": [
223
+ "button-unfilled",
224
+ "text"
225
+ ],
226
+ "files": [
227
+ {
228
+ "path": "src/wc/components/CardChart/CardChart.css",
229
+ "content": "@import '../../utils/chrome-header.css';\n@import '../../utils/forced-colors.css';\n\n:host {\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n width: var(--_card-chart-width);\n min-height: var(--_card-chart-min-height);\n max-width: 100%;\n overflow: visible;\n border: none;\n border-radius: var(--dimension-radius-125);\n background-color: var(--color-background-primary);\n box-shadow: var(--effect-shadow-elevated-sm);\n}\n\n:host::after {\n content: '';\n position: absolute;\n inset: 0;\n z-index: 4;\n border-radius: inherit;\n box-shadow: var(--effect-highlight-elevated-sm);\n pointer-events: none;\n}\n\n.card-chart__header {\n flex-shrink: 0;\n border-bottom: var(--dimension-stroke-width-012) solid var(--color-border-tertiary);\n background-color: var(--color-background-primary);\n}\n\n.card-chart__copy {\n align-items: center;\n}\n\nds-text.card-chart__title {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n -webkit-user-select: none;\n user-select: none;\n}\n\n.card-chart__actions {\n flex-shrink: 0;\n}\n\n.card-chart__actions:empty {\n display: none;\n}\n\n.card-chart__body,\n.card-chart__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-chart__body {\n border-radius: 0 0 var(--dimension-radius-125) var(--dimension-radius-125);\n background-color: var(--color-background-primary);\n}\n\n.card-chart__layout {\n height: 100%;\n gap: var(--dimension-space-200);\n}\n\n.card-chart__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-200) var(--dimension-space-200) 0\n var(--dimension-space-200);\n}\n\n.card-chart__chart > * {\n width: 100%;\n min-width: 0;\n max-width: 100%;\n}\n\n.card-chart__chart > ds-chart {\n --ds-chart-container-height: 100%;\n}\n\n.card-chart__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\n@media (forced-colors: active) {\n :host {\n box-shadow: none;\n outline: var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);\n outline-offset: calc(-1 * var(--dimension-stroke-width-012));\n }\n\n :host::after {\n box-shadow: none;\n }\n}\n",
230
+ "type": "registry:ui"
231
+ },
232
+ {
233
+ "path": "src/wc/components/CardChart/CardChart.tsx",
234
+ "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 CardChartWidth = 'sm' | 'md' | 'lg';\nexport type CardChartVariant = 'custom' | 'chart';\n\ntype LegendSlot = HTMLElement & {\n activeLabel?: string | null;\n highlightOnHover?: boolean;\n};\n\nconst CARD_WIDTH_VARS: Record<CardChartWidth, 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<CardChartWidth, 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 chart 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-chart',\n styleUrl: 'CardChart.css',\n scoped: true,\n})\nexport class CardChart {\n @Element() el!: HTMLElement;\n\n /** Chart heading shown in the card header. */\n @Prop() heading!: string;\n /** Chart composition behavior. */\n @Prop() variant: CardChartVariant = 'custom';\n /** Width token with the matching chart-card min-height. */\n @Prop() cardWidth: CardChartWidth = '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 componentDidRender() {\n const legend = this.el.querySelector(\n 'ds-chart-legend[slot=\"legend\"]'\n ) as LegendSlot | null;\n if (this.variant === 'chart' && legend) {\n legend.setAttribute('highlight-on-hover', 'false');\n if ('highlightOnHover' in legend) legend.highlightOnHover = false;\n }\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-chart': true,\n [`card-chart--${this.variant}`]: true,\n }}\n style={{\n '--_card-chart-width': CARD_WIDTH_VARS[this.cardWidth],\n '--_card-chart-min-height': CARD_HEIGHT_VARS[this.cardWidth],\n }}\n >\n <header class=\"card-chart__header ds-chrome-header\">\n {/* eslint-disable-next-line local/prefer-direct-ds-text -- Shared header copy owns the control-density geometry around the semantic heading. */}\n <div class=\"card-chart__copy ds-chrome-header__copy ds-control--md\">\n <ds-text\n class=\"card-chart__title ds-chrome-header__heading\"\n variant=\"text-title-small\"\n emphasis\n color=\"primary\"\n as=\"h2\"\n >\n {this.heading}\n </ds-text>\n </div>\n <div class=\"card-chart__actions ds-chrome-header__trailing\">\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-chart__body\">\n {usesChartLayout ? (\n <div class=\"card-chart__layout\">\n {this.hasChartSlot ? (\n <div\n class={{\n 'card-chart__chart': true,\n }}\n >\n <slot name=\"chart\" />\n </div>\n ) : null}\n {this.hasLegendSlot ? (\n <div class=\"card-chart__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",
235
+ "type": "registry:ui"
236
+ }
237
+ ]
238
+ }
@@ -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-data-viz",
32
- "reason": "CardDataViz owns the data-visualization card contract; the overview grid presents values and change only."
31
+ "component": "component:ds-card-chart",
32
+ "reason": "CardChart 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.",
@@ -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-data-viz",
33
- "reason": "CardDataViz owns the independently evolving data-visualization card contract."
32
+ "component": "component:ds-card-chart",
33
+ "reason": "CardChart owns the independently evolving chart-card contract."
34
34
  },
35
35
  {
36
36
  "when": "The task must block the interface for one focused decision or short workflow.",
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
3
  "name": "chart-legend",
4
4
  "title": "ChartLegend",
5
- "description": "Display-first chart legend with swatches, labels, optional values and percentages, explicit deep links, and highlight-only chart synchronization.",
5
+ "description": "External chart legend with swatches, labels, optional values and percentages, and explicit deep links.",
6
6
  "type": "registry:ui",
7
7
  "meta": {
8
8
  "library": "@ds-mo/ui",
@@ -12,11 +12,11 @@
12
12
  "intentStatus": "complete",
13
13
  "intent": {
14
14
  "audience": "specialized",
15
- "status": "experimental",
16
- "summary": "Display-first chart legend with swatches, labels, optional values and percentages, explicit deep links, and highlight-only chart synchronization.",
15
+ "status": "stable",
16
+ "summary": "External chart legend with swatches, labels, optional values and percentages, and explicit deep links.",
17
17
  "useWhen": [
18
18
  "A chart needs the standard swatch, label, and optional numeric-detail legend.",
19
- "Donut slices or line series need a continuously visible key beside or below the visualization.",
19
+ "Polar slices or Cartesian series need a continuously visible key beside or below the visualization.",
20
20
  "A category has an explicit deep-link destination and should render as an accessible link."
21
21
  ],
22
22
  "avoidWhen": [
@@ -31,25 +31,18 @@
31
31
  "reason": "Compose product-owned semantic markup from the same chart data rather than forcing it into this row recipe."
32
32
  },
33
33
  {
34
- "when": "The donut belongs in the canonical dashboard card.",
35
- "component": "component:ds-card-data-viz",
36
- "reason": "The donut variant places the legend and handles bidirectional highlight synchronization."
37
- },
38
- {
39
- "when": "A static line chart and series key belong in the canonical dashboard card.",
40
- "component": "component:ds-card-data-viz",
41
- "reason": "The line variant places the horizontal legend and disables decorative local hover highlighting."
34
+ "when": "A chart and static series key belong in the canonical dashboard card.",
35
+ "component": "component:ds-card-chart",
36
+ "reason": "The chart variant places the external legend and disables decorative local hover highlighting."
42
37
  }
43
38
  ],
44
39
  "commonlyComposedWith": [
45
- "component:ds-chart-donut",
46
- "component:ds-chart-bar",
47
- "component:ds-chart-line",
48
- "component:ds-card-data-viz"
40
+ "component:ds-chart",
41
+ "component:ds-card-chart"
49
42
  ],
50
43
  "accessibility": [
51
44
  "Rows remain non-interactive unless the item supplies an actual link destination.",
52
- "Synced highlight changes opacity only and never moves focus or announces selection.",
45
+ "Optional highlight changes opacity only and never moves focus or announces selection.",
53
46
  "Keep full labels available when visible text truncates, and retain stable tabular numeric columns.",
54
47
  "Do not rely on swatch color alone; every entry requires a meaningful visible label."
55
48
  ],
@@ -296,7 +289,7 @@
296
289
  },
297
290
  {
298
291
  "path": "src/wc/components/ChartLegend/ChartLegend.tsx",
299
- "content": "import { Component, Prop, State, Event, EventEmitter, h, Host, Watch } from '@stencil/core';\nimport { categoryColor } from '../../utils/chart-colors';\nimport { formatCompactNumber, formatPercentage, resolveSafeUrl } from '../../utils';\nimport type { ChartLegendItem } from '../../utils/chart-types';\n\nexport type ChartLegendDirection = 'vertical' | 'horizontal';\nexport type ChartLegendPercentageDecimals = 1 | 2;\n\n/**\n * Base legend for `ds-chart-*` components. Webapp's Overview widgets each style\n * legends differently (list w/ values, compact chips, bare swatches, external\n * stat callouts) — this covers the common \"swatch + label + optional value\" case.\n * Consumers who need a different treatment skip this component entirely and\n * render their own markup against the same `ChartDatum[]` data.\n */\n@Component({\n tag: 'ds-chart-legend',\n styleUrl: 'ChartLegend.css',\n scoped: true,\n})\nexport class ChartLegend {\n @Prop() locale: string | undefined;\n /** Legend entries. Set as a JS property (not an HTML attribute). */\n @Prop() items: ChartLegendItem[] = [];\n @Prop() direction: ChartLegendDirection = 'vertical';\n /** Show each item's share of the total (of items with a `value`) alongside its count. */\n @Prop() showPercentage: boolean = true;\n /** Fixed number of decimal places shown for percentages. */\n @Prop() percentageDecimals: ChartLegendPercentageDecimals = 1;\n /** Let local pointer/focus movement highlight one item and emit `dsItemHover`. */\n @Prop() highlightOnHover: boolean = true;\n /**\n * Externally controlled highlight, matched by `label` — e.g. drive this from a sibling\n * chart's `dsSliceHover` event to keep chart and legend hover in sync. Only dims the other\n * rows' opacity (like a chart dimming its other slices) — it never shows the hover-fill,\n * since that's reserved for a real pointer/keyboard interaction on this row.\n */\n @Prop() activeLabel: string | null = null;\n\n /** Own pointer/focus hover, kept separate from `activeLabel` so the hover-fill (a \"you can\n * click here\" affordance) never shows just because an external row was synced in. */\n @State() private hoveredLabel: string | null = null;\n\n /** Fires on row hover/focus with the item, or `null` on leave/blur. */\n @Event() dsItemHover!: EventEmitter<ChartLegendItem | null>;\n /** Fires when a deep-linkable row (`item.href` set) is activated. */\n @Event() dsItemClick!: EventEmitter<{ item: ChartLegendItem; originalEvent: MouseEvent }>;\n\n @Watch('highlightOnHover')\n handleHighlightOnHoverChange(enabled: boolean) {\n if (!enabled) this.hoveredLabel = null;\n }\n\n private handleHover(item: ChartLegendItem | null) {\n this.hoveredLabel = item?.label ?? null;\n this.dsItemHover.emit(item);\n }\n\n private handleClick = (item: ChartLegendItem, originalEvent: MouseEvent) => {\n this.dsItemClick.emit({ item, originalEvent });\n };\n\n render() {\n const total = this.items.reduce((sum, item) => sum + (item.value ?? 0), 0);\n // Highlight/dim from either this component's own hover or an externally-synced label\n // (e.g. a sibling ds-chart-donut slice) — same mechanism ds-chart-donut uses for its slices.\n const highlightLabel = this.activeLabel ?? (this.highlightOnHover ? this.hoveredLabel : null);\n\n return (\n <Host\n class={{\n 'chart-legend': true,\n [`chart-legend--${this.direction}`]: true,\n 'chart-legend--show-percentage': this.showPercentage,\n }}\n >\n {/* mouseleave lives on the list, not each row — the row-gap between items is still\n inside the list's box, so crossing it while moving between rows never fires this.\n Only actually leaving the whole list does, and that clears with no delay. */}\n <ul\n class=\"chart-legend__list\"\n onMouseLeave={this.highlightOnHover ? () => this.handleHover(null) : undefined}\n >\n {this.items.map((item, i) => {\n const isDimmed = highlightLabel != null && item.label !== highlightLabel;\n const href = resolveSafeUrl(item.href);\n const RowTag = href ? 'a' : 'div';\n const percentage = item.value != null\n ? formatPercentage(total ? item.value / total : 0, this.percentageDecimals, this.locale)\n : '';\n\n return (\n <li class=\"chart-legend__list-item\" key={item.label}>\n <RowTag\n class={{\n 'chart-legend__item': true,\n 'chart-legend__item--interactive': !!href,\n 'chart-legend__item--dimmed': isDimmed,\n 'ds-control--md': true,\n 'ds-interaction-fill': this.highlightOnHover || !!href,\n 'ds-focus-ring-inset': !!href,\n }}\n href={href}\n onClick={href ? (e: MouseEvent) => this.handleClick(item, e) : undefined}\n onMouseEnter={\n this.highlightOnHover ? () => this.handleHover(item) : undefined\n }\n onFocus={this.highlightOnHover ? () => this.handleHover(item) : undefined}\n onBlur={this.highlightOnHover ? () => this.handleHover(null) : undefined}\n >\n <span class=\"chart-legend__swatch-box\">\n <span class=\"chart-legend__swatch\" style={{ backgroundColor: item.color ?? categoryColor(i) }} />\n </span>\n <ds-text\n class=\"chart-legend__label\"\n as=\"span\"\n variant=\"text-body-medium\"\n color=\"secondary\"\n lineTruncation={1}\n title={item.label}\n >\n {item.label}\n </ds-text>\n {item.value != null && (\n <ds-text\n class=\"chart-legend__value\"\n as=\"span\"\n variant=\"text-body-medium\"\n color=\"primary\"\n lineTruncation={1}\n align=\"right\"\n fontFeature=\"tabular-nums\"\n title={String(item.value)}\n >\n {formatCompactNumber(item.value, this.locale)}\n </ds-text>\n )}\n {item.value != null && this.showPercentage && (\n <ds-text\n class=\"chart-legend__percentage\"\n as=\"span\"\n variant=\"text-body-medium\"\n color=\"primary\"\n lineTruncation={1}\n align=\"right\"\n fontFeature=\"tabular-nums\"\n title={percentage}\n >\n {percentage}\n </ds-text>\n )}\n </RowTag>\n </li>\n );\n })}\n </ul>\n </Host>\n );\n }\n}\n",
292
+ "content": "import { Component, Prop, State, Event, EventEmitter, h, Host, Watch } from '@stencil/core';\nimport { categoryColor } from '../../utils/chart-colors';\nimport { formatCompactNumber, formatPercentage, resolveSafeUrl } from '../../utils';\nimport type { ChartLegendItem } from '../../utils/chart-types';\n\nexport type ChartLegendDirection = 'vertical' | 'horizontal';\nexport type ChartLegendPercentageDecimals = 1 | 2;\n\n/**\n * Base legend for `ds-chart-*` components. Webapp's Overview widgets each style\n * legends differently (list w/ values, compact chips, bare swatches, external\n * stat callouts) — this covers the common \"swatch + label + optional value\" case.\n * Consumers who need a different treatment skip this component entirely and\n * render their own markup against the same `ChartLegendItem[]` data.\n */\n@Component({\n tag: 'ds-chart-legend',\n styleUrl: 'ChartLegend.css',\n scoped: true,\n})\nexport class ChartLegend {\n @Prop() locale: string | undefined;\n /** Legend entries. Set as a JS property (not an HTML attribute). */\n @Prop() items: ChartLegendItem[] = [];\n @Prop() direction: ChartLegendDirection = 'vertical';\n /** Show each item's share of the total (of items with a `value`) alongside its count. */\n @Prop() showPercentage: boolean = true;\n /** Fixed number of decimal places shown for percentages. */\n @Prop() percentageDecimals: ChartLegendPercentageDecimals = 1;\n /** Let local pointer/focus movement highlight one item and emit `dsItemHover`. */\n @Prop() highlightOnHover: boolean = true;\n /**\n * Externally controlled highlight, matched by `label` — e.g. drive this from a sibling\n * chart's `dsSliceHover` event to keep chart and legend hover in sync. Only dims the other\n * rows' opacity (like a chart dimming its other slices) — it never shows the hover-fill,\n * since that's reserved for a real pointer/keyboard interaction on this row.\n */\n @Prop() activeLabel: string | null = null;\n\n /** Own pointer/focus hover, kept separate from `activeLabel` so the hover-fill (a \"you can\n * click here\" affordance) never shows just because an external row was synced in. */\n @State() private hoveredLabel: string | null = null;\n\n /** Fires on row hover/focus with the item, or `null` on leave/blur. */\n @Event() dsItemHover!: EventEmitter<ChartLegendItem | null>;\n /** Fires when a deep-linkable row (`item.href` set) is activated. */\n @Event() dsItemClick!: EventEmitter<{ item: ChartLegendItem; originalEvent: MouseEvent }>;\n\n @Watch('highlightOnHover')\n handleHighlightOnHoverChange(enabled: boolean) {\n if (!enabled) this.hoveredLabel = null;\n }\n\n private handleHover(item: ChartLegendItem | null) {\n this.hoveredLabel = item?.label ?? null;\n this.dsItemHover.emit(item);\n }\n\n private handleClick = (item: ChartLegendItem, originalEvent: MouseEvent) => {\n this.dsItemClick.emit({ item, originalEvent });\n };\n\n render() {\n const total = this.items.reduce((sum, item) => sum + (item.value ?? 0), 0);\n // Highlight/dim from either this component's own hover or an externally-synced label\n // (e.g. an application-owned chart focus state).\n const highlightLabel = this.activeLabel ?? (this.highlightOnHover ? this.hoveredLabel : null);\n\n return (\n <Host\n class={{\n 'chart-legend': true,\n [`chart-legend--${this.direction}`]: true,\n 'chart-legend--show-percentage': this.showPercentage,\n }}\n >\n {/* mouseleave lives on the list, not each row — the row-gap between items is still\n inside the list's box, so crossing it while moving between rows never fires this.\n Only actually leaving the whole list does, and that clears with no delay. */}\n <ul\n class=\"chart-legend__list\"\n onMouseLeave={this.highlightOnHover ? () => this.handleHover(null) : undefined}\n >\n {this.items.map((item, i) => {\n const isDimmed = highlightLabel != null && item.label !== highlightLabel;\n const href = resolveSafeUrl(item.href);\n const RowTag = href ? 'a' : 'div';\n const percentage = item.value != null\n ? formatPercentage(total ? item.value / total : 0, this.percentageDecimals, this.locale)\n : '';\n\n return (\n <li class=\"chart-legend__list-item\" key={item.label}>\n <RowTag\n class={{\n 'chart-legend__item': true,\n 'chart-legend__item--interactive': !!href,\n 'chart-legend__item--dimmed': isDimmed,\n 'ds-control--md': true,\n 'ds-interaction-fill': this.highlightOnHover || !!href,\n 'ds-focus-ring-inset': !!href,\n }}\n href={href}\n onClick={href ? (e: MouseEvent) => this.handleClick(item, e) : undefined}\n onMouseEnter={\n this.highlightOnHover ? () => this.handleHover(item) : undefined\n }\n onFocus={this.highlightOnHover ? () => this.handleHover(item) : undefined}\n onBlur={this.highlightOnHover ? () => this.handleHover(null) : undefined}\n >\n <span class=\"chart-legend__swatch-box\">\n <span class=\"chart-legend__swatch\" style={{ backgroundColor: item.color ?? categoryColor(i) }} />\n </span>\n <ds-text\n class=\"chart-legend__label\"\n as=\"span\"\n variant=\"text-body-medium\"\n color=\"secondary\"\n lineTruncation={1}\n title={item.label}\n >\n {item.label}\n </ds-text>\n {item.value != null && (\n <ds-text\n class=\"chart-legend__value\"\n as=\"span\"\n variant=\"text-body-medium\"\n color=\"primary\"\n lineTruncation={1}\n align=\"right\"\n fontFeature=\"tabular-nums\"\n title={String(item.value)}\n >\n {formatCompactNumber(item.value, this.locale)}\n </ds-text>\n )}\n {item.value != null && this.showPercentage && (\n <ds-text\n class=\"chart-legend__percentage\"\n as=\"span\"\n variant=\"text-body-medium\"\n color=\"primary\"\n lineTruncation={1}\n align=\"right\"\n fontFeature=\"tabular-nums\"\n title={percentage}\n >\n {percentage}\n </ds-text>\n )}\n </RowTag>\n </li>\n );\n })}\n </ul>\n </Host>\n );\n }\n}\n",
300
293
  "type": "registry:ui"
301
294
  }
302
295
  ]