@ds-mo/ui 2.10.3 → 2.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/dist/.build-stamp +1 -1
  2. package/dist/components/ds-app-shell.js +1 -1
  3. package/dist/components/ds-banner.js +1 -1
  4. package/dist/components/ds-bar-nav.js +1 -1
  5. package/dist/components/ds-button-filled.js +1 -1
  6. package/dist/components/ds-button-unfilled-icon.js +1 -1
  7. package/dist/components/ds-card-data-viz.d.ts +11 -0
  8. package/dist/components/ds-card-data-viz.js +2 -0
  9. package/dist/components/ds-card-data-viz.js.map +1 -0
  10. package/dist/components/ds-card-setting.js +1 -1
  11. package/dist/components/{ds-card.d.ts → ds-chart-bar.d.ts} +4 -4
  12. package/dist/components/ds-chart-bar.js +2 -0
  13. package/dist/components/ds-chart-bar.js.map +1 -0
  14. package/dist/components/ds-chart-donut.d.ts +11 -0
  15. package/dist/components/ds-chart-donut.js +2 -0
  16. package/dist/components/ds-chart-donut.js.map +1 -0
  17. package/dist/components/ds-chart-legend.d.ts +11 -0
  18. package/dist/components/ds-chart-legend.js +2 -0
  19. package/dist/components/ds-chart-legend.js.map +1 -0
  20. package/dist/components/ds-chart-line.d.ts +11 -0
  21. package/dist/components/ds-chart-line.js +2 -0
  22. package/dist/components/ds-chart-line.js.map +1 -0
  23. package/dist/components/ds-checkbox.js +1 -1
  24. package/dist/components/ds-chip.js +1 -1
  25. package/dist/components/ds-divider.js +1 -1
  26. package/dist/components/ds-empty-state.js +1 -1
  27. package/dist/components/ds-empty-state.js.map +1 -1
  28. package/dist/components/ds-fade.js +1 -1
  29. package/dist/components/ds-field.js +1 -1
  30. package/dist/components/ds-header.js +1 -1
  31. package/dist/components/ds-header.js.map +1 -1
  32. package/dist/components/ds-icon.js +1 -1
  33. package/dist/components/ds-input.js +1 -1
  34. package/dist/components/ds-loader.js +1 -1
  35. package/dist/components/ds-menu.js +1 -1
  36. package/dist/components/ds-modal.js +1 -1
  37. package/dist/components/ds-panel-nav.js +1 -1
  38. package/dist/components/ds-panel-tools.js +1 -1
  39. package/dist/components/ds-radio-group.js +1 -1
  40. package/dist/components/ds-scrollbar.js +1 -1
  41. package/dist/components/ds-select.js +1 -1
  42. package/dist/components/ds-shell-gradient-picker.js +1 -1
  43. package/dist/components/ds-shell-gradient-swatch.js +1 -1
  44. package/dist/components/ds-slider.js +1 -1
  45. package/dist/components/ds-surface.js +1 -1
  46. package/dist/components/ds-tab-group-nav.js +1 -1
  47. package/dist/components/ds-tab-group.js +1 -1
  48. package/dist/components/ds-table.js +1 -1
  49. package/dist/components/ds-table.js.map +1 -1
  50. package/dist/components/ds-tag.js +1 -1
  51. package/dist/components/ds-text.js +1 -1
  52. package/dist/components/ds-toast-provider.js +1 -1
  53. package/dist/components/ds-toggle.js +1 -1
  54. package/dist/components/ds-tooltip-data-viz.d.ts +11 -0
  55. package/dist/components/ds-tooltip-data-viz.js +2 -0
  56. package/dist/components/ds-tooltip-data-viz.js.map +1 -0
  57. package/dist/components/ds-tooltip.js +1 -1
  58. package/dist/components/{p-B7HWSpyT.js → p-8Nt92j1-.js} +2 -2
  59. package/dist/components/{p-B7HWSpyT.js.map → p-8Nt92j1-.js.map} +1 -1
  60. package/dist/components/{p-rX6iIVpx.js → p-BMQbEIrQ.js} +2 -2
  61. package/dist/components/{p-B6ZyVOGV.js → p-BSFgy5r6.js} +2 -2
  62. package/dist/components/p-CMv_7vFs.js +2 -0
  63. package/dist/components/p-CMv_7vFs.js.map +1 -0
  64. package/dist/components/{p-CRh-MLwj.js → p-ChVwCVHy.js} +2 -2
  65. package/dist/components/{p-TuuGOzXH.js → p-CpNIQXz6.js} +2 -2
  66. package/dist/components/p-CrCGIx8s.js +2 -0
  67. package/dist/components/p-CrCGIx8s.js.map +1 -0
  68. package/dist/components/{p-BXI096cJ.js → p-CvgHQfvT.js} +2 -2
  69. package/dist/components/p-CzBnvtcz.js +2 -0
  70. package/dist/components/p-CzBnvtcz.js.map +1 -0
  71. package/dist/components/p-DEpLlQZK.js +2 -0
  72. package/dist/components/p-DEpLlQZK.js.map +1 -0
  73. package/dist/components/{p-BGZjpSXm.js → p-DOU4cbpc.js} +2 -2
  74. package/dist/components/p-DdFUTZ3y.js +2 -0
  75. package/dist/components/{p-eOWUz57C.js.map → p-DdFUTZ3y.js.map} +1 -1
  76. package/dist/components/p-bDf6yBQd.js +2 -0
  77. package/dist/components/p-bDf6yBQd.js.map +1 -0
  78. package/dist/lib/nav/index.js +7 -0
  79. package/dist/lib/nav/index.js.map +2 -2
  80. package/dist/lib/utils/format-compact-number.d.ts +2 -0
  81. package/dist/lib/utils/index.d.ts +2 -0
  82. package/dist/lib/utils/index.js +59 -1
  83. package/dist/lib/utils/index.js.map +3 -3
  84. package/dist/lib/utils/token-defaults.d.ts +7 -0
  85. package/dist/lib/utils/truncate-svg-text.d.ts +9 -0
  86. package/dist/types/components/CardDataViz/CardDataViz.d.ts +18 -0
  87. package/dist/types/components/CardDataViz/index.d.ts +2 -0
  88. package/dist/types/components/ChartBar/ChartBar.d.ts +9 -0
  89. package/dist/types/components/ChartBar/index.d.ts +2 -0
  90. package/dist/types/components/ChartDonut/ChartDonut.d.ts +35 -0
  91. package/dist/types/components/ChartDonut/index.d.ts +2 -0
  92. package/dist/types/components/ChartLegend/ChartLegend.d.ts +38 -0
  93. package/dist/types/components/ChartLegend/index.d.ts +3 -0
  94. package/dist/types/components/ChartLine/ChartLine.d.ts +12 -0
  95. package/dist/types/components/ChartLine/index.d.ts +2 -0
  96. package/dist/types/components/TooltipDataViz/TooltipDataViz.d.ts +28 -0
  97. package/dist/types/components/TooltipDataViz/index.d.ts +2 -0
  98. package/dist/types/components.d.ts +470 -23
  99. package/dist/types/utils/chart-colors.d.ts +2 -0
  100. package/dist/types/utils/chart-types.d.ts +23 -0
  101. package/dist/types/utils/format-compact-number.d.ts +3 -0
  102. package/dist/types/utils/index.d.ts +2 -0
  103. package/dist/types/utils/token-defaults.d.ts +7 -0
  104. package/dist/types/utils/truncate-svg-text.d.ts +10 -0
  105. package/package.json +13 -5
  106. package/src/angular/index.ts +7 -2
  107. package/src/angular/proxies.ts +144 -6
  108. package/src/react/components.ts +6 -1
  109. package/src/react/ds-card-data-viz.ts +26 -0
  110. package/src/react/{ds-card.ts → ds-chart-bar.ts} +7 -7
  111. package/src/react/ds-chart-donut.ts +27 -0
  112. package/src/react/ds-chart-legend.ts +33 -0
  113. package/src/react/ds-chart-line.ts +26 -0
  114. package/src/react/ds-tooltip-data-viz.ts +26 -0
  115. package/src/wc/components/CardDataViz/CardDataViz.tsx +67 -0
  116. package/src/wc/components/CardDataViz/index.ts +1 -0
  117. package/src/wc/components/ChartBar/ChartBar.tsx +88 -0
  118. package/src/wc/components/ChartBar/index.ts +1 -0
  119. package/src/wc/components/ChartDonut/ChartDonut.tsx +184 -0
  120. package/src/wc/components/ChartDonut/index.ts +1 -0
  121. package/src/wc/components/ChartLegend/ChartLegend.tsx +114 -0
  122. package/src/wc/components/ChartLegend/index.ts +2 -0
  123. package/src/wc/components/ChartLine/ChartLine.tsx +102 -0
  124. package/src/wc/components/ChartLine/index.ts +1 -0
  125. package/src/wc/components/Icon/system-icon-catalog.ts +2 -2
  126. package/src/wc/components/TooltipDataViz/TooltipDataViz.tsx +82 -0
  127. package/src/wc/components/TooltipDataViz/index.ts +1 -0
  128. package/src/wc/components.d.ts +470 -23
  129. package/src/wc/utils/chart-colors.ts +7 -0
  130. package/src/wc/utils/chart-types.ts +25 -0
  131. package/src/wc/utils/format-compact-number.ts +27 -0
  132. package/src/wc/utils/index.ts +2 -0
  133. package/src/wc/utils/token-defaults.ts +14 -0
  134. package/src/wc/utils/truncate-svg-text.ts +25 -0
  135. package/dist/components/ds-card.js +0 -2
  136. package/dist/components/ds-card.js.map +0 -1
  137. package/dist/components/p-eOWUz57C.js +0 -2
  138. package/dist/components/p-jjfqrXnP.js +0 -2
  139. package/dist/components/p-jjfqrXnP.js.map +0 -1
  140. package/dist/types/components/Card/Card.d.ts +0 -8
  141. package/src/wc/components/Card/Card.tsx +0 -26
  142. /package/dist/components/{p-rX6iIVpx.js.map → p-BMQbEIrQ.js.map} +0 -0
  143. /package/dist/components/{p-B6ZyVOGV.js.map → p-BSFgy5r6.js.map} +0 -0
  144. /package/dist/components/{p-CRh-MLwj.js.map → p-ChVwCVHy.js.map} +0 -0
  145. /package/dist/components/{p-TuuGOzXH.js.map → p-CpNIQXz6.js.map} +0 -0
  146. /package/dist/components/{p-BXI096cJ.js.map → p-CvgHQfvT.js.map} +0 -0
  147. /package/dist/components/{p-BGZjpSXm.js.map → p-DOU4cbpc.js.map} +0 -0
@@ -0,0 +1,23 @@
1
+ /** Shared data shapes for `ds-chart-*` components — kept minimal for the initial scaffold, expect these to grow per component once design is finalized. */
2
+ export interface ChartDatum {
3
+ label: string;
4
+ value: number;
5
+ /** CSS color override; defaults to the next `--color-data-category-*` token. */
6
+ color?: string;
7
+ }
8
+ export interface ChartSeries {
9
+ name: string;
10
+ data: number[];
11
+ /** CSS color override; defaults to the next `--color-data-category-*` token. */
12
+ color?: string;
13
+ }
14
+ /** `ds-chart-legend` entry — value is optional so a series name (no single value) can be legended too. */
15
+ export interface ChartLegendItem {
16
+ label: string;
17
+ value?: number;
18
+ /** CSS color override; defaults to the next `--color-data-category-*` token. */
19
+ color?: string;
20
+ /** When set, the row renders as a link (e.g. to a filtered list page for this segment). */
21
+ href?: string;
22
+ }
23
+ //# sourceMappingURL=chart-types.d.ts.map
@@ -0,0 +1,3 @@
1
+ /** Compact large numbers for display: 1000 -> "1k", 1500 -> "1.5k", 110100 -> "110.1k", 1000000 -> "1m". */
2
+ export declare function formatCompactNumber(value: number): string;
3
+ //# sourceMappingURL=format-compact-number.d.ts.map
@@ -1,5 +1,7 @@
1
1
  export { registerIcons } from '../components/Icon/icon-cache';
2
2
  export { clearCssLengthPxCache, resolveCssLengthPx } from './resolve-css-length-px';
3
+ export { formatCompactNumber } from './format-compact-number';
4
+ export { truncateSvgTextToWidth } from './truncate-svg-text';
3
5
  export { parseCssTimeMs, resolveCssTimeMs } from './resolve-css-time-ms';
4
6
  export { SCROLL_EDGE_FADE_DEFAULT_SIZE, SCROLL_EDGE_FADE_SIZE_VAR, isScrollAtEdge, resolveScrollEdgeFadeSize, scrollEdgeFadeClassMap, scrollEdgeFadeMaskImage, scrollEdgeFadeMaskStyle, scrollEdgeFadeSizeStyle, } from './scroll-edge-fade';
5
7
  export type { ScrollEdgeFadeEdge, ScrollEdgeFadeOptions, ScrollEdgeFadeSize, ScrollEdgeFadeSizeToken, } from './scroll-edge-fade';
@@ -2,6 +2,8 @@
2
2
  export declare const TOKEN_DEFAULTS: {
3
3
  readonly space050: "--dimension-space-050";
4
4
  readonly space200: "--dimension-space-200";
5
+ readonly radius025: "--dimension-radius-025";
6
+ readonly size200: "--dimension-size-200";
5
7
  readonly size300: "--dimension-size-300";
6
8
  readonly size600: "--dimension-size-600";
7
9
  readonly size800: "--dimension-size-800";
@@ -12,6 +14,11 @@ export declare const TOKEN_DEFAULTS: {
12
14
  readonly panelWidthMd: "--dimension-panel-width-md";
13
15
  readonly panelWidthLg: "--dimension-panel-width-lg";
14
16
  readonly menuWidthXs: "--dimension-menu-width-xs";
17
+ readonly lineheightLg: "--typography-lineheight-lg";
18
+ readonly lineheightMd: "--typography-lineheight-md";
19
+ readonly lineheightSm: "--typography-lineheight-sm";
20
+ readonly lineheightXl: "--typography-lineheight-xl";
21
+ readonly lineheightXs: "--typography-lineheight-xs";
15
22
  readonly motionShort2: "--effect-motion-short-2";
16
23
  readonly motionShort3: "--effect-motion-short-3";
17
24
  readonly animationDurationShort3: "--effect-animation-duration-short-3";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Binary-searches the longest prefix of `text` (plus an ellipsis) that fits within `maxWidth`
3
+ * px when rendered by `el`, using the SVG `getComputedTextLength()` API for exact measurement —
4
+ * `text-overflow: ellipsis` doesn't apply to raw SVG `<text>` nodes.
5
+ *
6
+ * Mutates `el.textContent` during measurement; the caller's next render (driven by the
7
+ * returned string going into state) overwrites it with the final value.
8
+ */
9
+ export declare function truncateSvgTextToWidth(el: SVGTextElement, text: string, maxWidth: number): string;
10
+ //# sourceMappingURL=truncate-svg-text.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ds-mo/ui",
3
- "version": "2.10.3",
3
+ "version": "2.11.1",
4
4
  "description": "CompoMo — composable web components styled with TokoMo design tokens",
5
5
  "keywords": [
6
6
  "web-components",
@@ -104,7 +104,7 @@
104
104
  }
105
105
  },
106
106
  "devDependencies": {
107
- "@ds-mo/icons": "^6.1.1",
107
+ "@ds-mo/icons": "^6.1.2",
108
108
  "@ds-mo/tokens": "^2.12.1",
109
109
  "@eslint/js": "^10.0.1",
110
110
  "@figma/code-connect": "^1.4.8",
@@ -116,9 +116,13 @@
116
116
  "@storybook/addon-docs": "^10.4.2",
117
117
  "@storybook/web-components": "^10.4.2",
118
118
  "@storybook/web-components-vite": "^10.4.2",
119
+ "@types/d3-array": "^3.2.2",
120
+ "@types/d3-scale": "^4.0.9",
121
+ "@types/d3-shape": "^3.1.8",
119
122
  "@types/react": "^19.2.17",
120
123
  "@types/react-dom": "^19.2.3",
121
124
  "concurrently": "^10.0.3",
125
+ "esbuild": "^0.28.0",
122
126
  "eslint": "^10.4.1",
123
127
  "eslint-plugin-react-hooks": "^7.1.1",
124
128
  "globals": "^17.6.0",
@@ -130,8 +134,7 @@
130
134
  "typescript": "~6.0.3",
131
135
  "typescript-eslint": "^8.59.1",
132
136
  "vite": "^8.0.16",
133
- "zod": "^4.4.3",
134
- "esbuild": "^0.28.0"
137
+ "zod": "^4.4.3"
135
138
  },
136
139
  "engines": {
137
140
  "node": "^20.19.0 || >=22.12.0"
@@ -139,5 +142,10 @@
139
142
  "sideEffects": [
140
143
  "**/*.css",
141
144
  "dist/components/**/*.js"
142
- ]
145
+ ],
146
+ "dependencies": {
147
+ "d3-array": "^3.2.4",
148
+ "d3-scale": "^4.0.2",
149
+ "d3-shape": "^3.2.0"
150
+ }
143
151
  }
@@ -10,8 +10,12 @@ export const DIRECTIVES = [
10
10
  d.DsBreadcrumb,
11
11
  d.DsButtonFilled,
12
12
  d.DsButtonUnfilledIcon,
13
- d.DsCard,
13
+ d.DsCardDataViz,
14
14
  d.DsCardSetting,
15
+ d.DsChartBar,
16
+ d.DsChartDonut,
17
+ d.DsChartLegend,
18
+ d.DsChartLine,
15
19
  d.DsCheckbox,
16
20
  d.DsChip,
17
21
  d.DsDivider,
@@ -42,5 +46,6 @@ export const DIRECTIVES = [
42
46
  d.DsText,
43
47
  d.DsToastProvider,
44
48
  d.DsToggle,
45
- d.DsTooltip
49
+ d.DsTooltip,
50
+ d.DsTooltipDataViz
46
51
  ];
@@ -231,18 +231,18 @@ export declare interface DsButtonUnfilledIcon extends Components.DsButtonUnfille
231
231
 
232
232
 
233
233
  @ProxyCmp({
234
- inputs: ['elevation', 'radius']
234
+ inputs: ['cardWidth', 'heading']
235
235
  })
236
236
  @Component({
237
- selector: 'ds-card',
237
+ selector: 'ds-card-data-viz',
238
238
  changeDetection: ChangeDetectionStrategy.OnPush,
239
239
  template: '<ng-content></ng-content>',
240
240
  // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
241
- inputs: ['elevation', 'radius'],
241
+ inputs: ['cardWidth', { name: 'heading', required: true }],
242
242
  standalone: false
243
243
  })
244
- export class DsCard {
245
- protected el: HTMLDsCardElement;
244
+ export class DsCardDataViz {
245
+ protected el: HTMLDsCardDataVizElement;
246
246
  constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
247
247
  c.detach();
248
248
  this.el = r.nativeElement;
@@ -250,7 +250,7 @@ export class DsCard {
250
250
  }
251
251
 
252
252
 
253
- export declare interface DsCard extends Components.DsCard {}
253
+ export declare interface DsCardDataViz extends Components.DsCardDataViz {}
254
254
 
255
255
 
256
256
  @ProxyCmp({
@@ -283,6 +283,121 @@ export declare interface DsCardSetting extends Components.DsCardSetting {
283
283
  }
284
284
 
285
285
 
286
+ @ProxyCmp({
287
+ inputs: ['data', 'height', 'width']
288
+ })
289
+ @Component({
290
+ selector: 'ds-chart-bar',
291
+ changeDetection: ChangeDetectionStrategy.OnPush,
292
+ template: '<ng-content></ng-content>',
293
+ // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
294
+ inputs: ['data', 'height', 'width'],
295
+ standalone: false
296
+ })
297
+ export class DsChartBar {
298
+ protected el: HTMLDsChartBarElement;
299
+ constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
300
+ c.detach();
301
+ this.el = r.nativeElement;
302
+ }
303
+ }
304
+
305
+
306
+ export declare interface DsChartBar extends Components.DsChartBar {}
307
+
308
+
309
+ @ProxyCmp({
310
+ inputs: ['activeLabel', 'centerCaption', 'centerValue', 'cornerRadius', 'data', 'gap', 'size', 'thickness']
311
+ })
312
+ @Component({
313
+ selector: 'ds-chart-donut',
314
+ changeDetection: ChangeDetectionStrategy.OnPush,
315
+ template: '<ng-content></ng-content>',
316
+ // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
317
+ inputs: ['activeLabel', 'centerCaption', 'centerValue', 'cornerRadius', 'data', 'gap', 'size', 'thickness'],
318
+ outputs: ['dsSliceHover'],
319
+ standalone: false
320
+ })
321
+ export class DsChartDonut {
322
+ protected el: HTMLDsChartDonutElement;
323
+ @Output() dsSliceHover = new EventEmitter<CustomEvent<IDsChartDonutChartDatum | null>>();
324
+ constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
325
+ c.detach();
326
+ this.el = r.nativeElement;
327
+ }
328
+ }
329
+
330
+
331
+ import type { ChartDatum as IDsChartDonutChartDatum } from '@ds-mo/ui';
332
+
333
+ export declare interface DsChartDonut extends Components.DsChartDonut {
334
+ /**
335
+ * Fires with the hovered/focused slice's datum, or `null` on leave/blur.
336
+ */
337
+ dsSliceHover: EventEmitter<CustomEvent<IDsChartDonutChartDatum | null>>;
338
+ }
339
+
340
+
341
+ @ProxyCmp({
342
+ inputs: ['activeLabel', 'direction', 'items', 'showPercentage']
343
+ })
344
+ @Component({
345
+ selector: 'ds-chart-legend',
346
+ changeDetection: ChangeDetectionStrategy.OnPush,
347
+ template: '<ng-content></ng-content>',
348
+ // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
349
+ inputs: ['activeLabel', 'direction', 'items', 'showPercentage'],
350
+ outputs: ['dsItemHover', 'dsItemClick'],
351
+ standalone: false
352
+ })
353
+ export class DsChartLegend {
354
+ protected el: HTMLDsChartLegendElement;
355
+ @Output() dsItemHover = new EventEmitter<CustomEvent<IDsChartLegendChartLegendItem | null>>();
356
+ @Output() dsItemClick = new EventEmitter<CustomEvent<{ item: IDsChartLegendChartLegendItem; originalEvent: MouseEvent }>>();
357
+ constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
358
+ c.detach();
359
+ this.el = r.nativeElement;
360
+ }
361
+ }
362
+
363
+
364
+ import type { ChartLegendItem as IDsChartLegendChartLegendItem } from '@ds-mo/ui';
365
+
366
+ export declare interface DsChartLegend extends Components.DsChartLegend {
367
+ /**
368
+ * Fires on row hover/focus with the item, or `null` on leave/blur.
369
+ */
370
+ dsItemHover: EventEmitter<CustomEvent<IDsChartLegendChartLegendItem | null>>;
371
+ /**
372
+ * Fires when a deep-linkable row (`item.href` set) is activated.
373
+ */
374
+ dsItemClick: EventEmitter<CustomEvent<{ item: IDsChartLegendChartLegendItem; originalEvent: MouseEvent }>>;
375
+ }
376
+
377
+
378
+ @ProxyCmp({
379
+ inputs: ['categories', 'height', 'series', 'showPoints', 'width']
380
+ })
381
+ @Component({
382
+ selector: 'ds-chart-line',
383
+ changeDetection: ChangeDetectionStrategy.OnPush,
384
+ template: '<ng-content></ng-content>',
385
+ // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
386
+ inputs: ['categories', 'height', 'series', 'showPoints', 'width'],
387
+ standalone: false
388
+ })
389
+ export class DsChartLine {
390
+ protected el: HTMLDsChartLineElement;
391
+ constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
392
+ c.detach();
393
+ this.el = r.nativeElement;
394
+ }
395
+ }
396
+
397
+
398
+ export declare interface DsChartLine extends Components.DsChartLine {}
399
+
400
+
286
401
  @ProxyCmp({
287
402
  inputs: ['checked', 'inactive', 'indeterminate', 'label']
288
403
  })
@@ -1169,3 +1284,26 @@ export class DsTooltip {
1169
1284
  export declare interface DsTooltip extends Components.DsTooltip {}
1170
1285
 
1171
1286
 
1287
+ @ProxyCmp({
1288
+ inputs: ['label', 'value', 'x', 'y']
1289
+ })
1290
+ @Component({
1291
+ selector: 'ds-tooltip-data-viz',
1292
+ changeDetection: ChangeDetectionStrategy.OnPush,
1293
+ template: '<ng-content></ng-content>',
1294
+ // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
1295
+ inputs: ['label', 'value', 'x', 'y'],
1296
+ standalone: false
1297
+ })
1298
+ export class DsTooltipDataViz {
1299
+ protected el: HTMLDsTooltipDataVizElement;
1300
+ constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
1301
+ c.detach();
1302
+ this.el = r.nativeElement;
1303
+ }
1304
+ }
1305
+
1306
+
1307
+ export declare interface DsTooltipDataViz extends Components.DsTooltipDataViz {}
1308
+
1309
+
@@ -12,8 +12,12 @@ export { DsBarNav } from "./ds-bar-nav.js";
12
12
  export { DsBreadcrumb } from "./ds-breadcrumb.js";
13
13
  export { DsButtonFilled } from "./ds-button-filled.js";
14
14
  export { DsButtonUnfilledIcon } from "./ds-button-unfilled-icon.js";
15
+ export { DsCardDataViz } from "./ds-card-data-viz.js";
15
16
  export { DsCardSetting } from "./ds-card-setting.js";
16
- export { DsCard } from "./ds-card.js";
17
+ export { DsChartBar } from "./ds-chart-bar.js";
18
+ export { DsChartDonut } from "./ds-chart-donut.js";
19
+ export { DsChartLegend } from "./ds-chart-legend.js";
20
+ export { DsChartLine } from "./ds-chart-line.js";
17
21
  export { DsCheckbox } from "./ds-checkbox.js";
18
22
  export { DsChip } from "./ds-chip.js";
19
23
  export { DsDivider } from "./ds-divider.js";
@@ -44,4 +48,5 @@ export { DsTag } from "./ds-tag.js";
44
48
  export { DsText } from "./ds-text.js";
45
49
  export { DsToastProvider } from "./ds-toast-provider.js";
46
50
  export { DsToggle } from "./ds-toggle.js";
51
+ export { DsTooltipDataViz } from "./ds-tooltip-data-viz.js";
47
52
  export { DsTooltip } from "./ds-tooltip.js";
@@ -0,0 +1,26 @@
1
+ 'use client';
2
+
3
+ /**
4
+ * This file was automatically generated by the Stencil React Output Target.
5
+ * Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
6
+ */
7
+
8
+ /* eslint-disable */
9
+
10
+ import type { StencilReactComponent } from '@stencil/react-output-target/runtime';
11
+ import { createComponent } from '@stencil/react-output-target/runtime';
12
+ import React from 'react';
13
+
14
+ import type { Components } from "@ds-mo/ui/dist/components";
15
+ import { DsCardDataViz as DsCardDataVizElement, defineCustomElement as defineDsCardDataViz } from "@ds-mo/ui/dist/components/ds-card-data-viz.js";
16
+
17
+ export type DsCardDataVizEvents = NonNullable<unknown>;
18
+
19
+ export const DsCardDataViz: StencilReactComponent<DsCardDataVizElement, DsCardDataVizEvents, Components.DsCardDataViz> = /*@__PURE__*/ createComponent<DsCardDataVizElement, DsCardDataVizEvents, Components.DsCardDataViz>({
20
+ tagName: 'ds-card-data-viz',
21
+ elementClass: DsCardDataVizElement,
22
+ // @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
23
+ react: React,
24
+ events: {} as DsCardDataVizEvents,
25
+ defineCustomElement: defineDsCardDataViz
26
+ });
@@ -12,15 +12,15 @@ import { createComponent } from '@stencil/react-output-target/runtime';
12
12
  import React from 'react';
13
13
 
14
14
  import type { Components } from "@ds-mo/ui/dist/components";
15
- import { DsCard as DsCardElement, defineCustomElement as defineDsCard } from "@ds-mo/ui/dist/components/ds-card.js";
15
+ import { DsChartBar as DsChartBarElement, defineCustomElement as defineDsChartBar } from "@ds-mo/ui/dist/components/ds-chart-bar.js";
16
16
 
17
- export type DsCardEvents = NonNullable<unknown>;
17
+ export type DsChartBarEvents = NonNullable<unknown>;
18
18
 
19
- export const DsCard: StencilReactComponent<DsCardElement, DsCardEvents, Components.DsCard> = /*@__PURE__*/ createComponent<DsCardElement, DsCardEvents, Components.DsCard>({
20
- tagName: 'ds-card',
21
- elementClass: DsCardElement,
19
+ export const DsChartBar: StencilReactComponent<DsChartBarElement, DsChartBarEvents, Components.DsChartBar> = /*@__PURE__*/ createComponent<DsChartBarElement, DsChartBarEvents, Components.DsChartBar>({
20
+ tagName: 'ds-chart-bar',
21
+ elementClass: DsChartBarElement,
22
22
  // @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
23
23
  react: React,
24
- events: {} as DsCardEvents,
25
- defineCustomElement: defineDsCard
24
+ events: {} as DsChartBarEvents,
25
+ defineCustomElement: defineDsChartBar
26
26
  });
@@ -0,0 +1,27 @@
1
+ 'use client';
2
+
3
+ /**
4
+ * This file was automatically generated by the Stencil React Output Target.
5
+ * Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
6
+ */
7
+
8
+ /* eslint-disable */
9
+
10
+ import type { EventName, StencilReactComponent } from '@stencil/react-output-target/runtime';
11
+ import { createComponent } from '@stencil/react-output-target/runtime';
12
+ import React from 'react';
13
+
14
+ import { type ChartDatum, type DsChartDonutCustomEvent } from "@ds-mo/ui";
15
+ import type { Components } from "@ds-mo/ui/dist/components";
16
+ import { DsChartDonut as DsChartDonutElement, defineCustomElement as defineDsChartDonut } from "@ds-mo/ui/dist/components/ds-chart-donut.js";
17
+
18
+ export type DsChartDonutEvents = { onDsSliceHover: EventName<DsChartDonutCustomEvent<ChartDatum | null>> };
19
+
20
+ export const DsChartDonut: StencilReactComponent<DsChartDonutElement, DsChartDonutEvents, Components.DsChartDonut> = /*@__PURE__*/ createComponent<DsChartDonutElement, DsChartDonutEvents, Components.DsChartDonut>({
21
+ tagName: 'ds-chart-donut',
22
+ elementClass: DsChartDonutElement,
23
+ // @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
24
+ react: React,
25
+ events: { onDsSliceHover: 'dsSliceHover' } as DsChartDonutEvents,
26
+ defineCustomElement: defineDsChartDonut
27
+ });
@@ -0,0 +1,33 @@
1
+ 'use client';
2
+
3
+ /**
4
+ * This file was automatically generated by the Stencil React Output Target.
5
+ * Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
6
+ */
7
+
8
+ /* eslint-disable */
9
+
10
+ import type { EventName, StencilReactComponent } from '@stencil/react-output-target/runtime';
11
+ import { createComponent } from '@stencil/react-output-target/runtime';
12
+ import React from 'react';
13
+
14
+ import { type ChartLegendItem, type DsChartLegendCustomEvent } from "@ds-mo/ui";
15
+ import type { Components } from "@ds-mo/ui/dist/components";
16
+ import { DsChartLegend as DsChartLegendElement, defineCustomElement as defineDsChartLegend } from "@ds-mo/ui/dist/components/ds-chart-legend.js";
17
+
18
+ export type DsChartLegendEvents = {
19
+ onDsItemHover: EventName<DsChartLegendCustomEvent<ChartLegendItem | null>>,
20
+ onDsItemClick: EventName<DsChartLegendCustomEvent<{ item: ChartLegendItem; originalEvent: MouseEvent }>>
21
+ };
22
+
23
+ export const DsChartLegend: StencilReactComponent<DsChartLegendElement, DsChartLegendEvents, Components.DsChartLegend> = /*@__PURE__*/ createComponent<DsChartLegendElement, DsChartLegendEvents, Components.DsChartLegend>({
24
+ tagName: 'ds-chart-legend',
25
+ elementClass: DsChartLegendElement,
26
+ // @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
27
+ react: React,
28
+ events: {
29
+ onDsItemHover: 'dsItemHover',
30
+ onDsItemClick: 'dsItemClick'
31
+ } as DsChartLegendEvents,
32
+ defineCustomElement: defineDsChartLegend
33
+ });
@@ -0,0 +1,26 @@
1
+ 'use client';
2
+
3
+ /**
4
+ * This file was automatically generated by the Stencil React Output Target.
5
+ * Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
6
+ */
7
+
8
+ /* eslint-disable */
9
+
10
+ import type { StencilReactComponent } from '@stencil/react-output-target/runtime';
11
+ import { createComponent } from '@stencil/react-output-target/runtime';
12
+ import React from 'react';
13
+
14
+ import type { Components } from "@ds-mo/ui/dist/components";
15
+ import { DsChartLine as DsChartLineElement, defineCustomElement as defineDsChartLine } from "@ds-mo/ui/dist/components/ds-chart-line.js";
16
+
17
+ export type DsChartLineEvents = NonNullable<unknown>;
18
+
19
+ export const DsChartLine: StencilReactComponent<DsChartLineElement, DsChartLineEvents, Components.DsChartLine> = /*@__PURE__*/ createComponent<DsChartLineElement, DsChartLineEvents, Components.DsChartLine>({
20
+ tagName: 'ds-chart-line',
21
+ elementClass: DsChartLineElement,
22
+ // @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
23
+ react: React,
24
+ events: {} as DsChartLineEvents,
25
+ defineCustomElement: defineDsChartLine
26
+ });
@@ -0,0 +1,26 @@
1
+ 'use client';
2
+
3
+ /**
4
+ * This file was automatically generated by the Stencil React Output Target.
5
+ * Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
6
+ */
7
+
8
+ /* eslint-disable */
9
+
10
+ import type { StencilReactComponent } from '@stencil/react-output-target/runtime';
11
+ import { createComponent } from '@stencil/react-output-target/runtime';
12
+ import React from 'react';
13
+
14
+ import type { Components } from "@ds-mo/ui/dist/components";
15
+ import { DsTooltipDataViz as DsTooltipDataVizElement, defineCustomElement as defineDsTooltipDataViz } from "@ds-mo/ui/dist/components/ds-tooltip-data-viz.js";
16
+
17
+ export type DsTooltipDataVizEvents = NonNullable<unknown>;
18
+
19
+ export const DsTooltipDataViz: StencilReactComponent<DsTooltipDataVizElement, DsTooltipDataVizEvents, Components.DsTooltipDataViz> = /*@__PURE__*/ createComponent<DsTooltipDataVizElement, DsTooltipDataVizEvents, Components.DsTooltipDataViz>({
20
+ tagName: 'ds-tooltip-data-viz',
21
+ elementClass: DsTooltipDataVizElement,
22
+ // @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
23
+ react: React,
24
+ events: {} as DsTooltipDataVizEvents,
25
+ defineCustomElement: defineDsTooltipDataViz
26
+ });
@@ -0,0 +1,67 @@
1
+ import { Component, Element, State, h, Host, Prop } from '@stencil/core';
2
+
3
+ export type CardDataVizWidth = 'xs' | 'sm' | 'md' | 'lg';
4
+
5
+ const CARD_WIDTH_VARS: Record<CardDataVizWidth, string> = {
6
+ xs: 'var(--dimension-card-width-xs)',
7
+ sm: 'var(--dimension-card-width-sm)',
8
+ md: 'var(--dimension-card-width-md)',
9
+ lg: 'var(--dimension-card-width-lg)',
10
+ };
11
+
12
+ /**
13
+ * Copied from CardSetting as a starting scaffold — header edit affordance removed for now
14
+ * (data-viz widgets don't have an obvious "edit" action the way settings fields do); revisit
15
+ * once the data-viz card's real header actions (menu, caption, footer stat) are designed.
16
+ */
17
+ @Component({
18
+ tag: 'ds-card-data-viz',
19
+ styleUrl: 'CardDataViz.css',
20
+ scoped: true,
21
+ })
22
+ export class CardDataViz {
23
+ @Element() el!: HTMLElement;
24
+
25
+ /** Widget heading shown in the card header. */
26
+ @Prop() heading!: string;
27
+
28
+ /** Card width token. */
29
+ @Prop() cardWidth: CardDataVizWidth = 'md';
30
+
31
+ // Scoped (light-DOM) components have no native slot projection to detect emptiness from CSS —
32
+ // check the actual children so an unused region (e.g. no legend) doesn't render a dangling
33
+ // padded box plus a body gap next to nothing.
34
+ @State() private hasChartSlot = false;
35
+ @State() private hasLegendSlot = false;
36
+
37
+ componentWillRender() {
38
+ this.hasChartSlot = !!this.el.querySelector(':scope > [slot="chart"]');
39
+ this.hasLegendSlot = !!this.el.querySelector(':scope > [slot="legend"]');
40
+ }
41
+
42
+ render() {
43
+ return (
44
+ <Host class="card-data-viz" style={{ '--_card-data-viz-width': CARD_WIDTH_VARS[this.cardWidth] }}>
45
+ <header class="card-data-viz__header">
46
+ <div class="card-data-viz__title-wrap">
47
+ <ds-text class="card-data-viz__title" variant="text-title-small" color="primary" as="h2">
48
+ {this.heading}
49
+ </ds-text>
50
+ </div>
51
+ </header>
52
+ <div class="card-data-viz__body">
53
+ {this.hasChartSlot && (
54
+ <div class="card-data-viz__chart-region">
55
+ <slot name="chart" />
56
+ </div>
57
+ )}
58
+ {this.hasLegendSlot && (
59
+ <div class="card-data-viz__legend-region">
60
+ <slot name="legend" />
61
+ </div>
62
+ )}
63
+ </div>
64
+ </Host>
65
+ );
66
+ }
67
+ }
@@ -0,0 +1 @@
1
+ export type { CardDataVizWidth } from './CardDataViz';