@ids-group-ltd/ids-design-system 0.13.1 → 0.13.3

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 (62) hide show
  1. package/CHANGELOG.md +626 -0
  2. package/components.md +17 -9
  3. package/docs/agent/INDEX.md +1 -1
  4. package/docs/agent/charts/ds-column-chart.md +3 -2
  5. package/docs/agent/charts/ds-line-chart.md +2 -1
  6. package/docs/agent/feedback/ds-bar.md +13 -0
  7. package/docs/agent/forms/ds-button.md +1 -1
  8. package/docs/agent/forms/ds-icon-button.md +1 -1
  9. package/docs/agent/surfaces/ds-card.md +1 -1
  10. package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs +81 -13
  11. package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -1
  12. package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs +95 -0
  13. package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs.map +1 -0
  14. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +3 -0
  15. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
  16. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs +47 -5
  17. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs.map +1 -1
  18. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs +198 -50
  19. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map +1 -1
  20. package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs +973 -0
  21. package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs.map +1 -0
  22. package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs +172 -111
  23. package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs.map +1 -1
  24. package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs +86 -15
  25. package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs.map +1 -1
  26. package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs +87 -12
  27. package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs.map +1 -1
  28. package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs +193 -98
  29. package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs.map +1 -1
  30. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +2 -2
  31. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
  32. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +233 -33
  33. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
  34. package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +1 -1
  35. package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
  36. package/fesm2022/ids-group-ltd-ids-design-system.mjs +2 -1
  37. package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
  38. package/migrations/0.13.2.json +269 -0
  39. package/migrations/0.13.3.json +211 -0
  40. package/package.json +17 -9
  41. package/styles/_chart-frame.scss +117 -10
  42. package/styles/_chart-interactive.scss +12 -3
  43. package/styles/_overlay-motion.scss +7 -6
  44. package/styles/_tokens-charts.scss +29 -5
  45. package/styles/_tokens.scss +1 -1
  46. package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +68 -5
  47. package/types/ids-group-ltd-ids-design-system-components-bar.d.ts +63 -0
  48. package/types/ids-group-ltd-ids-design-system-components-button.d.ts +3 -2
  49. package/types/ids-group-ltd-ids-design-system-components-chart-legend.d.ts +25 -2
  50. package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +21 -4
  51. package/types/ids-group-ltd-ids-design-system-components-chart.d.ts +543 -0
  52. package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +125 -37
  53. package/types/ids-group-ltd-ids-design-system-components-donut-chart.d.ts +43 -4
  54. package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +52 -4
  55. package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +90 -23
  56. package/types/ids-group-ltd-ids-design-system-components.d.ts +91 -16
  57. package/types/ids-group-ltd-ids-design-system-core.d.ts +73 -6
  58. package/types/ids-group-ltd-ids-design-system.d.ts +7 -6
  59. package/docs/agent/feedback/ds-progress.md +0 -7
  60. package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs +0 -41
  61. package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs.map +0 -1
  62. package/types/ids-group-ltd-ids-design-system-components-progress.d.ts +0 -22
package/components.md CHANGED
@@ -165,14 +165,14 @@ Content slots: default (label / leading or trailing icon), plus `[dsButtonSubtex
165
165
  - **Standing** (no permission, no integration — nothing here will change it): `disabledReason` beside `disabled`. The reason renders as a second line INSIDE the button, and setting it flips how the button is disabled — `aria-disabled="true"` instead of the native attribute, because a natively disabled button never takes focus and its description would never be announced (measured; Chrome's a11y tree reports name `"Approve invoice"`, description `"Needs the Finance role"`, state disabled). The click is swallowed in the handler instead, so `(pressed)` still never fires. Leave `disabledReason` unset and NOTHING changes: the native attribute stays, and so does every existing layout. Length is deliberately uncapped — the text wraps and the button grows.
166
166
  - **Temporary** (the form is not filled in yet): do NOT disable the button at all. Leave it live, judge validity in the submit handler, and carry the text UNDER the button with `hint` / `warning` / `error` — the same three inputs the fields take, resolved and rendered by the same `ds-field-message` row the fields use, with the same `messageIcon` and `reserveMessage` knobs and the same `DS_CONFIG.field.*` fallbacks. Those inputs live on an internal shared base class that `ButtonComponent` and every field extend, so the behaviour cannot drift apart. What it does NOT take is `errors` / `invalid` / `touched`: a button has no validation state of its own.
167
167
  Layout: a message-bearing button becomes a column (host class `with-message`), and because the host shrinks to fit, a message longer than the label widens the pair — button included, exactly as a field's control spans its own message. Without a message the host keeps the `inline-flex` box every existing layout was built against.
168
- Tokens: `--ds-button-bg-color`, `--ds-button-bg-color-hover`, `--ds-button-bg-color-active`, `--ds-button-bg-color-disabled`, `--ds-button-label-color`, `--ds-button-label-color-disabled`, `--ds-button-border-color`, `--ds-button-border-color-disabled`, `--ds-button-border-width`, `--ds-button-radius`, `--ds-button-focus-shadow`, `--ds-button-pressed-shadow`, `--ds-button-shadow`, `--ds-button-shadow-hover`. The last two are the REST and hover shadow, both `none` by default — before them the only way to give a button a resting shadow was a deep selector into its inner `<button>`. `-shadow-hover` falls back to `-shadow`, so setting the resting one alone keeps the button steady under the pointer; focus and pressed keep their own hooks and still win while those states are on. For `variant="solid"`, `-bg-color-hover` / `-bg-color-active` / `-pressed-shadow` default to a `color-mix()` derivation of the resolved fill (88 % / 76 % + black — the theme's hover/pressed recipe), so overriding the fill alone retints the whole state set; tonal, outline, ghost and text keep explicit ramp defaults, so a full retint there means setting the state tokens too.
168
+ Tokens: `--ds-button-bg-color`, `--ds-button-bg-color-hover`, `--ds-button-bg-color-active`, `--ds-button-bg-color-disabled`, `--ds-button-label-color`, `--ds-button-label-color-disabled`, `--ds-button-border-color`, `--ds-button-border-color-disabled`, `--ds-button-border-width`, `--ds-button-radius`, `--ds-button-pressed-shadow`, `--ds-button-shadow`, `--ds-button-shadow-hover`. The focus ring is not a button token — set `--focus-ring-color`, `--focus-ring-width` or `--focus-ring-offset` on the button's own scope. The last two are the REST and hover shadow, both `none` by default — before them the only way to give a button a resting shadow was a deep selector into its inner `<button>`. `-shadow-hover` falls back to `-shadow`, so setting the resting one alone keeps the button steady under the pointer; focus and pressed keep their own hooks and still win while those states are on. For `variant="solid"`, `-bg-color-hover` / `-bg-color-active` / `-pressed-shadow` default to a `color-mix()` derivation of the resolved fill (88 % / 76 % + black — the theme's hover/pressed recipe), so overriding the fill alone retints the whole state set; tonal, outline, ghost and text keep explicit ramp defaults, so a full retint there means setting the state tokens too.
169
169
 
170
170
  #### `<ds-icon-button>` — `IconButtonComponent`
171
171
  Icon-only action with its own taxonomy, distinct from `ds-button`. `ariaLabel` is required (icon-only must be labelled for a11y).
172
172
  Inputs: `icon: required IconName`, `ariaLabel: required string`, `ariaDescribedBy: string | null = null` (point at text the page already shows — e.g. why the action is refused; icon-only leaves no room for a second line, which is why there is deliberately no `disabledReason` here), `variant: IconButtonVariant = 'standard'` (`'standard' | 'filled' | 'tonal' | 'outlined'`), `size: IconButtonSize = 'md'` (`'sm' | 'md' | 'lg'` = 32/40/48), `type: 'button' | 'submit' | 'reset' = 'button'`, `disabled: boolean = false`, `selected: boolean = false` (toggle — sets `aria-pressed`)
173
173
  Output: `(pressed): MouseEvent` — fires when not disabled
174
174
  Variant emphasis: `standard` chromeless (hover-reveal) · `filled` `--primary` · `tonal` `--primary-muted` · `outlined` bordered. `selected` renders the pressed/active fill.
175
- Tokens: `--ds-icon-button-bg-color`, `--ds-icon-button-icon-color`, `--ds-icon-button-border`, `--ds-icon-button-bg-color-hover`, `--ds-icon-button-bg-color-active`, `--ds-icon-button-icon-color-hover`, `--ds-icon-button-radius`, `--ds-icon-button-focus-shadow`. `filled`/`selected` derive hover/active from the resolved bg, `standard`/`tonal`/`outlined` keep explicit ramp defaults.
175
+ Tokens: `--ds-icon-button-bg-color`, `--ds-icon-button-icon-color`, `--ds-icon-button-border`, `--ds-icon-button-bg-color-hover`, `--ds-icon-button-bg-color-active`, `--ds-icon-button-icon-color-hover`, `--ds-icon-button-radius`. The focus ring is not an icon-button token — set `--focus-ring-color`, `--focus-ring-width` or `--focus-ring-offset` on its own scope. `filled`/`selected` derive hover/active from the resolved bg, `standard`/`tonal`/`outlined` keep explicit ramp defaults.
176
176
 
177
177
  #### `<ds-input>` — `InputComponent`
178
178
  Inputs: `value: model<string>`, `type: InputType = 'text'` (`'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search'`), `size: 'sm' | 'md' | 'lg' = 'md'`, `label: string = ''`, `hint: string = ''`, `placeholder: string = ''`, `disabled: boolean = false`, `invalid: boolean = false`, `required: boolean = false`, `optional: boolean = false`, `name: string | null = null`, `clearable: boolean | null = null` (inline clear (×) button; `null` resolves to `true` for `type="search"` and `false` otherwise)
@@ -284,9 +284,15 @@ Inputs: `size: 'xs' | 'sm' | 'md' | 'lg' = 'md'`, `initials: string = ''`, `imag
284
284
  Inputs: `max: number = 4` (visible avatars before "+N" overflow), `total: number | null = null` (used to compute the overflow count; without `total` no overflow chip renders).
285
285
  Content: project `<ds-avatar>` children.
286
286
 
287
- #### `<ds-progress>` — `ProgressComponent`
288
- Linear progress bar (no circular variant).
289
- Inputs: `value: number = 0` (0–100, clamped), `variant: 'default' | 'success' | 'warn' | 'error' | 'indeterminate' = 'default'`
287
+ #### `<ds-bar>` — `BarComponent`
288
+ One horizontal track with one fill: a task's completion, or a measurement on a known scale. No circular variant.
289
+ Inputs: `value: number = 0` (in units of `max`, clamped), `max: number = 100`, `semantics: 'progress' | 'meter' | 'none' = 'progress'`, `variant: 'default' | 'success' | 'warning' | 'error' = 'default'`, `indeterminate: boolean = false`, `color: string | null = null`, `target: number | null = null`, `ariaLabel: string | null = null`.
290
+ `semantics` is the claim the bar makes, and it decides the role: `'progress'` is how far a task has got (`role="progressbar"`), `'meter'` is a measurement on a known scale with no beginning and no completion — a rate, a score, a count against a ceiling (`role="meter"`), `'none'` draws it and hides it from assistive technology. Use `'none'` for a bar in a table cell whose figure is printed beside it: left at the default, a table of two hundred rows announces two hundred progress bars.
291
+ `max` is the scale `value` and `target` are read against; left at 100 they are percentages. Set it to the real total — `[value]="37" [max]="80"` — and `aria-valuenow`/`aria-valuemax` carry "37 of 80" instead of a percentage the caller had to compute. For a column of measurements it is usually the column's own largest value. Zero or less falls back to 100.
292
+ `target` is a second point on the same scale, drawn as a hairline across the track — a goal, a baseline or a threshold. Clamped like `value` and ignored while `indeterminate`. The role announces one value, so name the comparison in `ariaLabel` ("Resolved 62% against a 75% target").
293
+ `indeterminate` is ignored unless `semantics` is `'progress'`: only a task has an unknown duration.
294
+ The bar fills its box, so the column decides its width. A box sized to its content is sized by what its contents contribute intrinsically and a `100%`-wide child contributes nothing, so the host carries a `min-inline-size` of `3rem`.
295
+ Tokens: `--ds-bar-height`, `--ds-bar-min-width`, `--ds-bar-track-color`, `--ds-bar-fill-color`, `--ds-bar-fill-color-success`, `--ds-bar-fill-color-warning`, `--ds-bar-fill-color-error`, `--ds-bar-target-color`, `--ds-bar-target-width`.
290
296
 
291
297
  #### `<ds-spinner>` — `SpinnerComponent`
292
298
  Input: `size: 'sm' | 'md' | 'lg' = 'md'`. Pure-CSS spinner, `role="status"` with built-in `aria-label`.
@@ -399,7 +405,7 @@ Content: label text (when `variant="label"`).
399
405
  #### `<ds-card>` — `CardComponent`
400
406
  Inputs: `elevation: 'flat' | 'raised' | 'hover' | 'interactive' = 'flat'`, `padding: 'none' | 'sm' | 'md' | 'lg' | null = null` (when `null`, no `padding-*` class is applied and the consumer controls padding via own CSS or `--ds-card-pad`)
401
407
  Output: `(pressed): MouseEvent` — fires only when `elevation="interactive"`
402
- Tokens: `--ds-card-bg-color`, `--ds-card-border`, `--ds-card-radius`, `--ds-card-pad`, `--ds-card-shadow`, `--ds-card-shadow-hover`, `--ds-card-focus-shadow`, `--ds-card-hover-lift`, `--ds-card-overflow`
408
+ Tokens: `--ds-card-bg-color`, `--ds-card-border`, `--ds-card-radius`, `--ds-card-pad`, `--ds-card-shadow`, `--ds-card-shadow-hover`, `--ds-card-hover-lift`, `--ds-card-overflow`. The focus ring is not a card token — set `--focus-ring-color`, `--focus-ring-width` or `--focus-ring-offset` on the card's own scope
403
409
  Full-bleed child: a child whose background reaches the card edge paints square corners over the radius, and the host cannot fix it — the rounded box is the card's inner element. Set `--ds-card-overflow: clip` (`clip`, not `hidden`, so the card stays out of the scroll-container business). It is opt-in because a clipped card also cuts the focus ring off a child at its edge; where the clipped card holds focusable content, pair it with `data-focus="inset"`.
404
410
  Convention tokens (consumer-side `.title` projected into the card slot — declared at `:root`, not on the host): `--card-title-fs` (default `var(--font-size-h4)` = 22px; a brand can step it down to `var(--font-size-h5)`). Consumer markup: `<h3 class="title">…</h3>`; local `.title` class reads the token via `font:` shorthand together with `--font-weight-bold` / `--line-height-snug` / `--font-heading`.
405
411
 
@@ -473,14 +479,15 @@ Tokens: `--ds-bar-chart-track-color`, `--ds-bar-chart-track-height`, `--ds-bar-c
473
479
 
474
480
  #### `<ds-column-chart>` — `ColumnChartComponent`
475
481
  Vertical columns for a short series read left to right — months, stages, teams — measured against one value axis whose ticks snap to round numbers.
476
- Inputs: `data: readonly ColumnChartPoint[]` (required), `showValues: boolean = true` (each column prints its own value above itself), `tickCount: number = 5` (a hint: ticks snap to a round step, so an axis asked for three ends up with five and one asked for ten stops at eight), `caption: string | null = null`, `summary: string | null = null`, `dataTable: 'toggle' | 'visible' | 'none' = 'toggle'`, `loading: boolean = false`, `emptyText: string = 'No data'`, `error: boolean = false`, `errorText: string = 'Could not load the data'`, `valueFormat: (value: number) => string`, `interactive: boolean = false`, `tooltip: 'item' | 'none' = 'item'`, `staggerMs: number = 0`
482
+ Inputs: `data: readonly ColumnChartPoint[]` (required), `showValues: boolean = true` (each column prints its own value above itself), `tickCount: number = 5` (a hint: ticks snap to a round step, so an axis asked for three ends up with five and one asked for ten stops at eight), `caption: string | null = null`, `summary: string | null = null`, `dataTable: 'toggle' | 'visible' | 'none' = 'toggle'`, `loading: boolean = false`, `emptyText: string = 'No data'`, `error: boolean = false`, `errorText: string = 'Could not load the data'`, `valueFormat: (value: number) => string`, `interactive: boolean = false`, `tooltip: 'item' | 'none' = 'item'`, `staggerMs: number = 0`, `thresholds: readonly ChartThreshold[] = []`
477
483
  Output: `(pointClicked): ColumnChartPoint` — same contract as `ds-bar-chart`'s `rowClicked`.
478
484
  Interaction: `interactive: boolean = false` turns on the affordance — pointer cursor, hover tint and the keyboard route. `dimOthers: boolean = false` is a SEPARATE opt-in that fades every other mark while one is hovered or focused; off by default, because the fade costs the separation between the faded marks (dE 14.8 -> 2.1 at the default dim opacity) — it buys loudness for one mark and pays for it with the rest. The output fires whether or not it is set. The keyboard route is ONE tab stop for the whole chart, not one per mark: arrows walk the marks, Home and End reach the extremes, and the ends wrap. `tooltip: 'item' | 'none' = 'item'` opens a panel for the hovered, tapped or focused mark; a tap latches it until the next tap outside. Project an `<ng-template #dsChartTooltip let-tip>` to replace its contents — `tip` is `{ category: string; entries: { label, value, formatted, color }[] }`.
479
485
  Motion: marks that leave finish leaving before marks that arrive start. `staggerMs: number = 0` spaces the arrivals; `40` is the documented step and the total is capped at 300ms. Every duration is a `--ds-motion-chart-*` role, so `prefers-reduced-motion` zeroes them with nothing per chart.
480
486
  States: `loading` draws skeleton marks at the real count; `error` shows `errorText` in place of the plot, which is a different claim from an empty `data` showing `emptyText`.
481
487
  Point: `ColumnChartPoint = { label: string; value: number; color?: string }`
488
+ Thresholds: `ChartThreshold = { value: number; label?: string; color?: string; to?: number; dash?: 'solid' | 'dashed' | 'dotted' }` draws a target, a budget or an SLA across the plot, behind the columns. ONE number, not a coordinate pair; `to` makes the same object a band between two readings, in either order; `dash` defaults to `'dashed'`. A threshold widens the value axis to hold it, and is named in the generated description, so a target above every column is neither drawn off the plot nor left unsaid.
482
489
  Colour: the categorical palette by position — `--ds-chart-series-1-color` onward. Set `color` on a column that carries a meaning its position does not, such as `var(--ds-chart-series-accent-color)` on the period the reader should land on. This is the one chart where the default is a judgement call rather than a rule: columns often ARE separate things (revenue by region), and where they are one quantity over time, `color` puts every column on `--ds-chart-series-default-color` in one pass.
483
- Tokens: `--ds-column-chart-plot-height`, `--ds-column-chart-column-width` (share of its own cell), `--ds-column-chart-column-max-width` (the cap that stops a five-column chart drawing slabs wider than their labels), `--ds-column-chart-column-gap`, `--ds-column-chart-grid-line-color`, `--ds-column-chart-value-space` (headroom for the value printed above a full-height column), `--ds-column-chart-axis-width` (the tick-label column; widen it for a `valueFormat` that prints longer ticks, which are clipped rather than wrapped).
490
+ Tokens: `--ds-column-chart-plot-height`, `--ds-column-chart-column-width` (share of its own cell), `--ds-column-chart-column-max-width` (the cap that stops a five-column chart drawing slabs wider than their labels), `--ds-column-chart-column-gap`, `--ds-column-chart-grid-line-color`, `--ds-column-chart-value-space` (headroom for the value printed above a full-height column), `--ds-column-chart-axis-width` (the tick-label column; widen it for a `valueFormat` that prints longer ticks, which are clipped rather than wrapped). Reference lines take `--ds-chart-threshold-color`, `--ds-chart-threshold-band-opacity`, `--ds-chart-threshold-dashed-pattern` and `--ds-chart-threshold-dotted-pattern`.
484
491
 
485
492
  #### `<ds-donut-chart>` — `DonutChartComponent`
486
493
  A ring that splits one total into its parts, with the middle free for the total or a headline figure of your own.
@@ -519,7 +526,8 @@ Second channel: `patterns` gives every series a dash of its own, in palette-slot
519
526
  Series: `LineChartSeries = { id: string; label: string; data: readonly (number | null)[]; axis?: 'primary' | 'secondary'; area?: boolean; slot?: number }`. A `null` is a missing reading and `gaps` decides what it draws — `'break'` leaves a hole in the line, `'zero'` plants a point on the baseline. `area` fills the band between the line and its axis baseline. `slot` pins a palette slot, so hiding one series leaves every other series' colour alone.
520
527
  `yAxisMode` only matters once a series sets `axis: 'secondary'`: `'rounded'` shares one set of gridlines and rounds the secondary step up, so that series stops short of the top; `'exact'` shares the gridlines but ends the secondary axis on its largest reading, so it uses the full height and its labels are not round; `'independent'` scales and grids each axis on its own; `'stacked'` draws two plots one above the other, sharing the category axis.
521
528
  Colour: series ARE different things, so the categorical palette applies — `--ds-chart-series-1-color` onward, by position or by `slot`.
522
- Tokens: `--ds-line-chart-plot-height`, `--ds-line-chart-line-width`, `--ds-line-chart-dot-radius`, `--ds-line-chart-area-opacity`, `--ds-line-chart-swatch-size`, `--ds-line-chart-grid-line-color`, `--ds-line-chart-axis-line-color`, `--ds-line-chart-axis-label-color`, `--ds-line-chart-axis-font-size`.
529
+ `annotations: LineChartAnnotation[]` pins a label over one reading — `{ categoryIndex, label, seriesId? }`, the series defaulting to the first plotted one — so a peak reads in a screenshot with no pointer. Placed above the reading, below it where the plot has no room, and anchored to its own edge within 48 view units of one. An annotation whose series is hidden or whose reading is `null` draws nothing. Marked `aria-hidden`: the annex table already carries every reading, so announcing it again reads the number twice.
530
+ Tokens: `--ds-line-chart-plot-height`, `--ds-line-chart-line-width`, `--ds-line-chart-dot-radius`, `--ds-line-chart-area-opacity`, `--ds-line-chart-swatch-size`, `--ds-line-chart-grid-line-color`, `--ds-line-chart-axis-line-color`, `--ds-line-chart-axis-label-color`, `--ds-line-chart-axis-font-size`, `--ds-line-chart-annotation-color`, `--ds-line-chart-annotation-font-size`, `--ds-line-chart-annotation-weight`, `--ds-line-chart-annotation-halo-color`, `--ds-line-chart-annotation-halo-width`.
523
531
 
524
532
  #### Chart defaults — what `DS_CONFIG` decides once
525
533
  Four chart inputs resolve through `DS_CONFIG.chart` because they are one decision per APP, not per plot: `valueFormat` (a number reads one way in a product; a formatter passed per chart drifts as soon as there are two screens), `dataTable` (whether the numbers behind a plot have a non-visual route is an accessibility policy), `emptyText` and `errorText` (copy, and the place localisation lands). Precedence is the input, then the config, then the built-in — so binding one on a single chart still wins.
@@ -39,7 +39,7 @@ and token names.** These leaves are for orientation and usage.
39
39
  - [<ds-tag> — TagComponent](feedback/ds-tag.md) — Content: label.
40
40
  - [<ds-avatar> — AvatarComponent](feedback/ds-avatar.md) — Inputs: size: 'xs' | 'sm' | 'md' | 'lg' = 'md', initials: string = '', imageUrl: string | null = null, tint: {
41
41
  - [<ds-avatar-group> — AvatarGroupComponent](feedback/ds-avatar-group.md) — Content: project <ds-avatar> children.
42
- - [<ds-progress> — ProgressComponent](feedback/ds-progress.md) — Linear progress bar (no circular variant).
42
+ - [<ds-bar> — BarComponent](feedback/ds-bar.md) — One horizontal track with one fill: a task's completion, or a measurement on a known scale. No circular varian
43
43
  - [<ds-spinner> — SpinnerComponent](feedback/ds-spinner.md) — Input: size: 'sm' | 'md' | 'lg' = 'md'. Pure-CSS spinner, role="status" with built-in aria-label.
44
44
  - [<ds-skeleton> — SkeletonComponent](feedback/ds-skeleton.md) — Inputs: width?: string, height?: string, circle: boolean = false, inline: boolean = false. Shimmer animation r
45
45
  - [<ds-stat> — StatComponent](feedback/ds-stat.md) — Delta direction is derived from the sign of delta: positive → up (arrow + green), negative → down (arrow + red
@@ -4,11 +4,12 @@
4
4
  Group: Charts
5
5
 
6
6
  Vertical columns for a short series read left to right — months, stages, teams — measured against one value axis whose ticks snap to round numbers.
7
- Inputs: `data: readonly ColumnChartPoint[]` (required), `showValues: boolean = true` (each column prints its own value above itself), `tickCount: number = 5` (a hint: ticks snap to a round step, so an axis asked for three ends up with five and one asked for ten stops at eight), `caption: string | null = null`, `summary: string | null = null`, `dataTable: 'toggle' | 'visible' | 'none' = 'toggle'`, `loading: boolean = false`, `emptyText: string = 'No data'`, `error: boolean = false`, `errorText: string = 'Could not load the data'`, `valueFormat: (value: number) => string`, `interactive: boolean = false`, `tooltip: 'item' | 'none' = 'item'`, `staggerMs: number = 0`
7
+ Inputs: `data: readonly ColumnChartPoint[]` (required), `showValues: boolean = true` (each column prints its own value above itself), `tickCount: number = 5` (a hint: ticks snap to a round step, so an axis asked for three ends up with five and one asked for ten stops at eight), `caption: string | null = null`, `summary: string | null = null`, `dataTable: 'toggle' | 'visible' | 'none' = 'toggle'`, `loading: boolean = false`, `emptyText: string = 'No data'`, `error: boolean = false`, `errorText: string = 'Could not load the data'`, `valueFormat: (value: number) => string`, `interactive: boolean = false`, `tooltip: 'item' | 'none' = 'item'`, `staggerMs: number = 0`, `thresholds: readonly ChartThreshold[] = []`
8
8
  Output: `(pointClicked): ColumnChartPoint` — same contract as `ds-bar-chart`'s `rowClicked`.
9
9
  Interaction: `interactive: boolean = false` turns on the affordance — pointer cursor, hover tint and the keyboard route. `dimOthers: boolean = false` is a SEPARATE opt-in that fades every other mark while one is hovered or focused; off by default, because the fade costs the separation between the faded marks (dE 14.8 -> 2.1 at the default dim opacity) — it buys loudness for one mark and pays for it with the rest. The output fires whether or not it is set. The keyboard route is ONE tab stop for the whole chart, not one per mark: arrows walk the marks, Home and End reach the extremes, and the ends wrap. `tooltip: 'item' | 'none' = 'item'` opens a panel for the hovered, tapped or focused mark; a tap latches it until the next tap outside. Project an `<ng-template #dsChartTooltip let-tip>` to replace its contents — `tip` is `{ category: string; entries: { label, value, formatted, color }[] }`.
10
10
  Motion: marks that leave finish leaving before marks that arrive start. `staggerMs: number = 0` spaces the arrivals; `40` is the documented step and the total is capped at 300ms. Every duration is a `--ds-motion-chart-*` role, so `prefers-reduced-motion` zeroes them with nothing per chart.
11
11
  States: `loading` draws skeleton marks at the real count; `error` shows `errorText` in place of the plot, which is a different claim from an empty `data` showing `emptyText`.
12
12
  Point: `ColumnChartPoint = { label: string; value: number; color?: string }`
13
+ Thresholds: `ChartThreshold = { value: number; label?: string; color?: string; to?: number; dash?: 'solid' | 'dashed' | 'dotted' }` draws a target, a budget or an SLA across the plot, behind the columns. ONE number, not a coordinate pair; `to` makes the same object a band between two readings, in either order; `dash` defaults to `'dashed'`. A threshold widens the value axis to hold it, and is named in the generated description, so a target above every column is neither drawn off the plot nor left unsaid.
13
14
  Colour: the categorical palette by position — `--ds-chart-series-1-color` onward. Set `color` on a column that carries a meaning its position does not, such as `var(--ds-chart-series-accent-color)` on the period the reader should land on. This is the one chart where the default is a judgement call rather than a rule: columns often ARE separate things (revenue by region), and where they are one quantity over time, `color` puts every column on `--ds-chart-series-default-color` in one pass.
14
- Tokens: `--ds-column-chart-plot-height`, `--ds-column-chart-column-width` (share of its own cell), `--ds-column-chart-column-max-width` (the cap that stops a five-column chart drawing slabs wider than their labels), `--ds-column-chart-column-gap`, `--ds-column-chart-grid-line-color`, `--ds-column-chart-value-space` (headroom for the value printed above a full-height column), `--ds-column-chart-axis-width` (the tick-label column; widen it for a `valueFormat` that prints longer ticks, which are clipped rather than wrapped).
15
+ Tokens: `--ds-column-chart-plot-height`, `--ds-column-chart-column-width` (share of its own cell), `--ds-column-chart-column-max-width` (the cap that stops a five-column chart drawing slabs wider than their labels), `--ds-column-chart-column-gap`, `--ds-column-chart-grid-line-color`, `--ds-column-chart-value-space` (headroom for the value printed above a full-height column), `--ds-column-chart-axis-width` (the tick-label column; widen it for a `valueFormat` that prints longer ticks, which are clipped rather than wrapped). Reference lines take `--ds-chart-threshold-color`, `--ds-chart-threshold-band-opacity`, `--ds-chart-threshold-dashed-pattern` and `--ds-chart-threshold-dotted-pattern`.
@@ -12,4 +12,5 @@ Second channel: `patterns` gives every series a dash of its own, in palette-slot
12
12
  Series: `LineChartSeries = { id: string; label: string; data: readonly (number | null)[]; axis?: 'primary' | 'secondary'; area?: boolean; slot?: number }`. A `null` is a missing reading and `gaps` decides what it draws — `'break'` leaves a hole in the line, `'zero'` plants a point on the baseline. `area` fills the band between the line and its axis baseline. `slot` pins a palette slot, so hiding one series leaves every other series' colour alone.
13
13
  `yAxisMode` only matters once a series sets `axis: 'secondary'`: `'rounded'` shares one set of gridlines and rounds the secondary step up, so that series stops short of the top; `'exact'` shares the gridlines but ends the secondary axis on its largest reading, so it uses the full height and its labels are not round; `'independent'` scales and grids each axis on its own; `'stacked'` draws two plots one above the other, sharing the category axis.
14
14
  Colour: series ARE different things, so the categorical palette applies — `--ds-chart-series-1-color` onward, by position or by `slot`.
15
- Tokens: `--ds-line-chart-plot-height`, `--ds-line-chart-line-width`, `--ds-line-chart-dot-radius`, `--ds-line-chart-area-opacity`, `--ds-line-chart-swatch-size`, `--ds-line-chart-grid-line-color`, `--ds-line-chart-axis-line-color`, `--ds-line-chart-axis-label-color`, `--ds-line-chart-axis-font-size`.
15
+ `annotations: LineChartAnnotation[]` pins a label over one reading — `{ categoryIndex, label, seriesId? }`, the series defaulting to the first plotted one — so a peak reads in a screenshot with no pointer. Placed above the reading, below it where the plot has no room, and anchored to its own edge within 48 view units of one. An annotation whose series is hidden or whose reading is `null` draws nothing. Marked `aria-hidden`: the annex table already carries every reading, so announcing it again reads the number twice.
16
+ Tokens: `--ds-line-chart-plot-height`, `--ds-line-chart-line-width`, `--ds-line-chart-dot-radius`, `--ds-line-chart-area-opacity`, `--ds-line-chart-swatch-size`, `--ds-line-chart-grid-line-color`, `--ds-line-chart-axis-line-color`, `--ds-line-chart-axis-label-color`, `--ds-line-chart-axis-font-size`, `--ds-line-chart-annotation-color`, `--ds-line-chart-annotation-font-size`, `--ds-line-chart-annotation-weight`, `--ds-line-chart-annotation-halo-color`, `--ds-line-chart-annotation-halo-width`.
@@ -0,0 +1,13 @@
1
+ <!-- GENERATED by tools/split-agent-catalogue.mjs from components.md. Do not edit. -->
2
+ # `<ds-bar>` — `BarComponent`
3
+
4
+ Group: Display & feedback
5
+
6
+ One horizontal track with one fill: a task's completion, or a measurement on a known scale. No circular variant.
7
+ Inputs: `value: number = 0` (in units of `max`, clamped), `max: number = 100`, `semantics: 'progress' | 'meter' | 'none' = 'progress'`, `variant: 'default' | 'success' | 'warning' | 'error' = 'default'`, `indeterminate: boolean = false`, `color: string | null = null`, `target: number | null = null`, `ariaLabel: string | null = null`.
8
+ `semantics` is the claim the bar makes, and it decides the role: `'progress'` is how far a task has got (`role="progressbar"`), `'meter'` is a measurement on a known scale with no beginning and no completion — a rate, a score, a count against a ceiling (`role="meter"`), `'none'` draws it and hides it from assistive technology. Use `'none'` for a bar in a table cell whose figure is printed beside it: left at the default, a table of two hundred rows announces two hundred progress bars.
9
+ `max` is the scale `value` and `target` are read against; left at 100 they are percentages. Set it to the real total — `[value]="37" [max]="80"` — and `aria-valuenow`/`aria-valuemax` carry "37 of 80" instead of a percentage the caller had to compute. For a column of measurements it is usually the column's own largest value. Zero or less falls back to 100.
10
+ `target` is a second point on the same scale, drawn as a hairline across the track — a goal, a baseline or a threshold. Clamped like `value` and ignored while `indeterminate`. The role announces one value, so name the comparison in `ariaLabel` ("Resolved 62% against a 75% target").
11
+ `indeterminate` is ignored unless `semantics` is `'progress'`: only a task has an unknown duration.
12
+ The bar fills its box, so the column decides its width. A box sized to its content is sized by what its contents contribute intrinsically and a `100%`-wide child contributes nothing, so the host carries a `min-inline-size` of `3rem`.
13
+ Tokens: `--ds-bar-height`, `--ds-bar-min-width`, `--ds-bar-track-color`, `--ds-bar-fill-color`, `--ds-bar-fill-color-success`, `--ds-bar-fill-color-warning`, `--ds-bar-fill-color-error`, `--ds-bar-target-color`, `--ds-bar-target-width`.
@@ -15,4 +15,4 @@ Content slots: default (label / leading or trailing icon), plus `[dsButtonSubtex
15
15
  - **Standing** (no permission, no integration — nothing here will change it): `disabledReason` beside `disabled`. The reason renders as a second line INSIDE the button, and setting it flips how the button is disabled — `aria-disabled="true"` instead of the native attribute, because a natively disabled button never takes focus and its description would never be announced (measured; Chrome's a11y tree reports name `"Approve invoice"`, description `"Needs the Finance role"`, state disabled). The click is swallowed in the handler instead, so `(pressed)` still never fires. Leave `disabledReason` unset and NOTHING changes: the native attribute stays, and so does every existing layout. Length is deliberately uncapped — the text wraps and the button grows.
16
16
  - **Temporary** (the form is not filled in yet): do NOT disable the button at all. Leave it live, judge validity in the submit handler, and carry the text UNDER the button with `hint` / `warning` / `error` — the same three inputs the fields take, resolved and rendered by the same `ds-field-message` row the fields use, with the same `messageIcon` and `reserveMessage` knobs and the same `DS_CONFIG.field.*` fallbacks. Those inputs live on an internal shared base class that `ButtonComponent` and every field extend, so the behaviour cannot drift apart. What it does NOT take is `errors` / `invalid` / `touched`: a button has no validation state of its own.
17
17
  Layout: a message-bearing button becomes a column (host class `with-message`), and because the host shrinks to fit, a message longer than the label widens the pair — button included, exactly as a field's control spans its own message. Without a message the host keeps the `inline-flex` box every existing layout was built against.
18
- Tokens: `--ds-button-bg-color`, `--ds-button-bg-color-hover`, `--ds-button-bg-color-active`, `--ds-button-bg-color-disabled`, `--ds-button-label-color`, `--ds-button-label-color-disabled`, `--ds-button-border-color`, `--ds-button-border-color-disabled`, `--ds-button-border-width`, `--ds-button-radius`, `--ds-button-focus-shadow`, `--ds-button-pressed-shadow`, `--ds-button-shadow`, `--ds-button-shadow-hover`. The last two are the REST and hover shadow, both `none` by default — before them the only way to give a button a resting shadow was a deep selector into its inner `<button>`. `-shadow-hover` falls back to `-shadow`, so setting the resting one alone keeps the button steady under the pointer; focus and pressed keep their own hooks and still win while those states are on. For `variant="solid"`, `-bg-color-hover` / `-bg-color-active` / `-pressed-shadow` default to a `color-mix()` derivation of the resolved fill (88 % / 76 % + black — the theme's hover/pressed recipe), so overriding the fill alone retints the whole state set; tonal, outline, ghost and text keep explicit ramp defaults, so a full retint there means setting the state tokens too.
18
+ Tokens: `--ds-button-bg-color`, `--ds-button-bg-color-hover`, `--ds-button-bg-color-active`, `--ds-button-bg-color-disabled`, `--ds-button-label-color`, `--ds-button-label-color-disabled`, `--ds-button-border-color`, `--ds-button-border-color-disabled`, `--ds-button-border-width`, `--ds-button-radius`, `--ds-button-pressed-shadow`, `--ds-button-shadow`, `--ds-button-shadow-hover`. The focus ring is not a button token — set `--focus-ring-color`, `--focus-ring-width` or `--focus-ring-offset` on the button's own scope. The last two are the REST and hover shadow, both `none` by default — before them the only way to give a button a resting shadow was a deep selector into its inner `<button>`. `-shadow-hover` falls back to `-shadow`, so setting the resting one alone keeps the button steady under the pointer; focus and pressed keep their own hooks and still win while those states are on. For `variant="solid"`, `-bg-color-hover` / `-bg-color-active` / `-pressed-shadow` default to a `color-mix()` derivation of the resolved fill (88 % / 76 % + black — the theme's hover/pressed recipe), so overriding the fill alone retints the whole state set; tonal, outline, ghost and text keep explicit ramp defaults, so a full retint there means setting the state tokens too.
@@ -7,4 +7,4 @@ Icon-only action with its own taxonomy, distinct from `ds-button`. `ariaLabel` i
7
7
  Inputs: `icon: required IconName`, `ariaLabel: required string`, `ariaDescribedBy: string | null = null` (point at text the page already shows — e.g. why the action is refused; icon-only leaves no room for a second line, which is why there is deliberately no `disabledReason` here), `variant: IconButtonVariant = 'standard'` (`'standard' | 'filled' | 'tonal' | 'outlined'`), `size: IconButtonSize = 'md'` (`'sm' | 'md' | 'lg'` = 32/40/48), `type: 'button' | 'submit' | 'reset' = 'button'`, `disabled: boolean = false`, `selected: boolean = false` (toggle — sets `aria-pressed`)
8
8
  Output: `(pressed): MouseEvent` — fires when not disabled
9
9
  Variant emphasis: `standard` chromeless (hover-reveal) · `filled` `--primary` · `tonal` `--primary-muted` · `outlined` bordered. `selected` renders the pressed/active fill.
10
- Tokens: `--ds-icon-button-bg-color`, `--ds-icon-button-icon-color`, `--ds-icon-button-border`, `--ds-icon-button-bg-color-hover`, `--ds-icon-button-bg-color-active`, `--ds-icon-button-icon-color-hover`, `--ds-icon-button-radius`, `--ds-icon-button-focus-shadow`. `filled`/`selected` derive hover/active from the resolved bg, `standard`/`tonal`/`outlined` keep explicit ramp defaults.
10
+ Tokens: `--ds-icon-button-bg-color`, `--ds-icon-button-icon-color`, `--ds-icon-button-border`, `--ds-icon-button-bg-color-hover`, `--ds-icon-button-bg-color-active`, `--ds-icon-button-icon-color-hover`, `--ds-icon-button-radius`. The focus ring is not an icon-button token — set `--focus-ring-color`, `--focus-ring-width` or `--focus-ring-offset` on its own scope. `filled`/`selected` derive hover/active from the resolved bg, `standard`/`tonal`/`outlined` keep explicit ramp defaults.
@@ -5,6 +5,6 @@ Group: Surfaces
5
5
 
6
6
  Inputs: `elevation: 'flat' | 'raised' | 'hover' | 'interactive' = 'flat'`, `padding: 'none' | 'sm' | 'md' | 'lg' | null = null` (when `null`, no `padding-*` class is applied and the consumer controls padding via own CSS or `--ds-card-pad`)
7
7
  Output: `(pressed): MouseEvent` — fires only when `elevation="interactive"`
8
- Tokens: `--ds-card-bg-color`, `--ds-card-border`, `--ds-card-radius`, `--ds-card-pad`, `--ds-card-shadow`, `--ds-card-shadow-hover`, `--ds-card-focus-shadow`, `--ds-card-hover-lift`, `--ds-card-overflow`
8
+ Tokens: `--ds-card-bg-color`, `--ds-card-border`, `--ds-card-radius`, `--ds-card-pad`, `--ds-card-shadow`, `--ds-card-shadow-hover`, `--ds-card-hover-lift`, `--ds-card-overflow`. The focus ring is not a card token — set `--focus-ring-color`, `--focus-ring-width` or `--focus-ring-offset` on the card's own scope
9
9
  Full-bleed child: a child whose background reaches the card edge paints square corners over the radius, and the host cannot fix it — the rounded box is the card's inner element. Set `--ds-card-overflow: clip` (`clip`, not `hidden`, so the card stays out of the scroll-container business). It is opt-in because a clipped card also cuts the focus ring off a child at its edge; where the clipped card holds focusable content, pair it with `data-focus="inset"`.
10
10
  Convention tokens (consumer-side `.title` projected into the card slot — declared at `:root`, not on the host): `--card-title-fs` (default `var(--font-size-h4)` = 22px; a brand can step it down to `var(--font-size-h5)`). Consumer markup: `<h3 class="title">…</h3>`; local `.title` class reads the token via `font:` shorthand together with `--font-weight-bold` / `--line-height-snug` / `--font-heading`.
@@ -1,7 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { input, numberAttribute, booleanAttribute, output, contentChild, signal, computed, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
3
- import { formatValue, staggerDelay, nextRovingIndex, focusMark, describeShare, chartColors, formatPercent, describeSeries } from '@ids-group-ltd/ids-design-system/components';
3
+ import { CHART_SERIES_COLORS, defaultChartFormat, staggerDelay, nextRovingIndex, focusMark, describeShare, chartColors, shareOfTotal, formatPercent, describeSeries } from '@ids-group-ltd/ids-design-system/components';
4
4
  import { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';
5
+ import { IconComponent } from '@ids-group-ltd/ids-design-system/icons';
5
6
  import { resolveWithConfig } from '@ids-group-ltd/ids-design-system/core';
6
7
  import { chartActiveMark, ChartTooltipDirective } from '@ids-group-ltd/ids-design-system/components/chart-tooltip';
7
8
 
@@ -26,14 +27,58 @@ function widthPercent(value, max) {
26
27
  }
27
28
  return Math.max((value / max) * 100, 0);
28
29
  }
30
+ /** Each segment's share of the row's track, in percent. Sized against the segments' OWN sum, never
31
+ * the row's `value`: when the two disagree the row is a distribution that does not add up, and a
32
+ * gap left where the difference is would draw that error as an unlabelled category.
33
+ *
34
+ * A set with no positive finite total has no shares to give, and returns none. */
35
+ function segmentWidths(values) {
36
+ const total = values
37
+ .filter((value) => Number.isFinite(value) && value > 0)
38
+ .reduce((sum, value) => sum + value, 0);
39
+ if (total <= 0) {
40
+ return [];
41
+ }
42
+ return values.map((value) => Number.isFinite(value) && value > 0 ? (value / total) * 100 : 0);
43
+ }
29
44
 
30
- const defaultValueFormat = (value) => formatValue(value);
45
+ /** A row's parts, ready to draw: a width, a colour and a formatted value each. Segments are
46
+ * CATEGORIES, so they take the categorical palette in order — unlike the rows, which are one
47
+ * series and share one colour. */
48
+ function segmentsOf(row, format) {
49
+ const parts = row.segments ?? [];
50
+ const widths = segmentWidths(parts.map((part) => part.value));
51
+ return widths.length
52
+ ? parts.map((segment, index) => ({
53
+ key: segment.id ?? String(index),
54
+ segment,
55
+ widthPercent: widths[index],
56
+ formattedValue: format(segment.value),
57
+ color: segment.color ??
58
+ CHART_SERIES_COLORS[index % CHART_SERIES_COLORS.length],
59
+ }))
60
+ : [];
61
+ }
31
62
  class BarChartComponent {
32
63
  /** One row per bar, drawn in the order given. */
33
64
  data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
34
65
  /** Track length is relative to this. Null uses the largest value, so the
35
66
  * longest row always fills its track. */
36
67
  max = input(null, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}), transform: (raw) => (raw == null ? null : numberAttribute(raw)) });
68
+ /** Whether the chart draws its own bordered, padded box. `'auto'`, the default, draws it;
69
+ * `'none'` leaves the chart bare, for one placed inside a card the page has already drawn.
70
+ * Unset falls back to `DS_CONFIG.chart.frame`, then `'auto'` — whether charts live inside cards
71
+ * is one decision per app rather than per plot. */
72
+ frame = input(null, ...(ngDevMode ? [{ debugName: "frame" }] : /* istanbul ignore next */ []));
73
+ /** How long the tooltip stays after the pointer leaves the mark, in milliseconds. Zero, the
74
+ * default, takes it away at once: a panel that outlives the pointer sits over the plot the
75
+ * reader has moved on to.
76
+ *
77
+ * Raise it only for a panel a reader has to REACH — one carrying a link, a figure, or anything
78
+ * selectable — which is WCAG 1.4.13's hoverable clause. The panel is portaled to the body, so
79
+ * crossing the gap to it at an ordinary pointer speed needs about 140. Unset falls back to
80
+ * `DS_CONFIG.chart.tooltipLingerMs`, then 0. */
81
+ tooltipLingerMs = input(null, { ...(ngDevMode ? { debugName: "tooltipLingerMs" } : /* istanbul ignore next */ {}), transform: (raw) => (raw == null ? null : numberAttribute(raw)) });
37
82
  /** Printed above the plot as the chart's visible title, and reused as the annex table's
38
83
  * caption. */
39
84
  caption = input(null, ...(ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []));
@@ -42,8 +87,13 @@ class BarChartComponent {
42
87
  /** The label-and-value table under the plot: `'toggle'` puts it behind a disclosure,
43
88
  * `'visible'` opens it, `'none'` renders none. It is the non-visual route to the numbers, so
44
89
  * `'none'` belongs only where the same data is already in a table on the page.
45
- * Unset falls back to `DS_CONFIG.chart.dataTable`, then `'toggle'`. */
90
+ * Unset falls back to `DS_CONFIG.chart.dataTable`, then `'none'`. */
46
91
  dataTable = input(null, ...(ngDevMode ? [{ debugName: "dataTable" }] : /* istanbul ignore next */ []));
92
+ /** Declares that the marks are parts of one whole, which is what makes a share of their total a
93
+ * real quantity. Off by default: a chart of visitors per stage or revenue per month sums to a
94
+ * number nobody can point at, and "18.6% of total" against it is arithmetic dressed as a fact.
95
+ * On, each mark's share appears on the tooltip's second line and in the data table. */
96
+ partOfWhole = input(false, { ...(ngDevMode ? { debugName: "partOfWhole" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
47
97
  /** Prints each row's share of `max` beside its value. */
48
98
  showPercent = input(true, { ...(ngDevMode ? { debugName: "showPercent" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
49
99
  /** Draws skeleton marks in place of the data, at the same count, so the chart does not resize
@@ -63,10 +113,11 @@ class BarChartComponent {
63
113
  * included. Unset falls back to `DS_CONFIG.chart.valueFormat`, then the browser's locale
64
114
  * grouping with a K/M/B suffix past four digits. */
65
115
  valueFormat = input(null, ...(ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []));
66
- dataTableResolved = resolveWithConfig(this.dataTable, (config) => config.chart?.dataTable, 'toggle');
116
+ frameResolved = resolveWithConfig(this.frame, (config) => config.chart?.frame, 'auto');
117
+ dataTableResolved = resolveWithConfig(this.dataTable, (config) => config.chart?.dataTable, 'none');
67
118
  emptyTextResolved = resolveWithConfig(this.emptyText, (config) => config.chart?.emptyText, 'No data');
68
119
  errorTextResolved = resolveWithConfig(this.errorText, (config) => config.chart?.errorText, 'Could not load the data');
69
- valueFormatResolved = resolveWithConfig(this.valueFormat, (config) => config.chart?.valueFormat, defaultValueFormat);
120
+ valueFormatResolved = resolveWithConfig(this.valueFormat, (config) => config.chart?.valueFormat, defaultChartFormat);
70
121
  /** Turns on the click affordance — the pointer cursor and any hover tint.
71
122
  * The click output fires whether or not this is set, so a consumer that
72
123
  * binds the output and forgets the flag still receives every click. */
@@ -74,6 +125,11 @@ class BarChartComponent {
74
125
  /** The row that was clicked, or activated with Enter or Space. Fires whether or not
75
126
  * `interactive` is set. */
76
127
  rowClicked = output();
128
+ /** Holds the hovered mark and its tooltip in place when it is clicked, until Escape or a press
129
+ * outside releases it. Off by default: a click is already the drill-down hook, and a mark left
130
+ * lit after the pointer has gone needs a reader who knows why it is lit. `rowClicked` fires
131
+ * either way — pinning is a state, not a handler. */
132
+ pinOnClick = input(false, { ...(ngDevMode ? { debugName: "pinOnClick" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
77
133
  /** Dims every OTHER mark while one is hovered or focused, so the reader's eye is held on the
78
134
  * one under the pointer. Off by default: the dimming costs the separation BETWEEN the dimmed
79
135
  * marks — measured 2026-09-13, the worst pair of three dimmed series falls from dE 14.8 at full
@@ -91,7 +147,14 @@ class BarChartComponent {
91
147
  * chart's marks ARE its categories, so an axis tooltip would repeat the item one. */
92
148
  tooltip = input('item', ...(ngDevMode ? [{ debugName: "tooltip" }] : /* istanbul ignore next */ []));
93
149
  tooltipTemplate = contentChild('dsChartTooltip', ...(ngDevMode ? [{ debugName: "tooltipTemplate" }] : /* istanbul ignore next */ []));
94
- activeMark = chartActiveMark();
150
+ tooltipLingerResolved = resolveWithConfig(this.tooltipLingerMs, (config) => config.chart?.tooltipLingerMs, 0);
151
+ activeMark = chartActiveMark(() => this.tooltipLingerResolved());
152
+ onMarkClick(payload, index, event) {
153
+ this.rowClicked.emit(payload);
154
+ if (this.pinOnClick()) {
155
+ this.activeMark.pin(index, event, '.track');
156
+ }
157
+ }
95
158
  /** One tab stop per chart, not one per mark: WCAG 2.1.1's Understanding is explicit that not
96
159
  * every mouse-operable control has to be separately focusable, and that is what keeps a
97
160
  * twenty-five mark chart from being twenty-five stops in the page's tab order. */
@@ -99,7 +162,7 @@ class BarChartComponent {
99
162
  tabStopIndex = computed(() => Math.min(this.rovingIndex(), Math.max(0, this.rows().length - 1)), ...(ngDevMode ? [{ debugName: "tabStopIndex" }] : /* istanbul ignore next */ []));
100
163
  onMarkFocus(index, event) {
101
164
  this.rovingIndex.set(index);
102
- this.activeMark.enter(index, event);
165
+ this.activeMark.enter(index, event, '.track');
103
166
  }
104
167
  onMarkNavigation(event, index) {
105
168
  const next = nextRovingIndex(event.key, index, this.rows().length);
@@ -123,7 +186,9 @@ class BarChartComponent {
123
186
  value: entry.row.value,
124
187
  formatted: entry.formattedValue,
125
188
  color: entry.color,
126
- detail: describeShare(this.data().map((row) => row.value), this.activeMark.index()),
189
+ detail: this.partOfWhole()
190
+ ? describeShare(this.data().map((row) => row.value), this.activeMark.index())
191
+ : undefined,
127
192
  },
128
193
  ],
129
194
  };
@@ -132,19 +197,22 @@ class BarChartComponent {
132
197
  rows = computed(() => {
133
198
  const max = this.resolvedMax();
134
199
  const format = this.valueFormatResolved();
200
+ const values = this.data().map((row) => row.value);
135
201
  return this.data().map((row, index) => ({
136
202
  key: row.id ?? String(index),
137
203
  row,
138
204
  widthPercent: widthPercent(row.value, max),
139
- formattedValue: format(row.value),
205
+ formattedValue: format(row.value, 'tooltip'),
140
206
  formattedPercent: row.percent !== undefined
141
207
  ? formatPercent(row.percent, 100)
142
208
  : formatPercent(row.value, max),
209
+ share: this.partOfWhole() ? shareOfTotal(values, index) : '',
210
+ segments: segmentsOf(row, (value) => format(value, 'tooltip')),
143
211
  color: row.color ?? chartColors.seriesDefault,
144
212
  }));
145
213
  }, ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
146
214
  accessibleName = computed(() => this.summary() ??
147
- describeSeries(this.caption() ?? 'Chart', this.data().map((row) => ({ label: row.label, value: row.value })), this.valueFormatResolved(), this.dataTableResolved() !== 'none'), ...(ngDevMode ? [{ debugName: "accessibleName" }] : /* istanbul ignore next */ []));
215
+ describeSeries(this.caption() ?? 'Chart', this.data().map((row) => ({ label: row.label, value: row.value })), (value) => this.valueFormatResolved()(value, 'tooltip'), this.dataTableResolved() !== 'none'), ...(ngDevMode ? [{ debugName: "accessibleName" }] : /* istanbul ignore next */ []));
148
216
  entryLabel(entry) {
149
217
  return `${entry.row.label}, ${entry.formattedValue}`;
150
218
  }
@@ -162,12 +230,12 @@ class BarChartComponent {
162
230
  * when the data lands; falls back to three when `data` is still empty. */
163
231
  skeletonRows = computed(() => Array.from({ length: Math.max(this.data().length, 3) }), ...(ngDevMode ? [{ debugName: "skeletonRows" }] : /* istanbul ignore next */ []));
164
232
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: BarChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
165
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: BarChartComponent, isStandalone: true, selector: "ds-bar-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, summary: { classPropertyName: "summary", publicName: "summary", isSignal: true, isRequired: false, transformFunction: null }, dataTable: { classPropertyName: "dataTable", publicName: "dataTable", isSignal: true, isRequired: false, transformFunction: null }, showPercent: { classPropertyName: "showPercent", publicName: "showPercent", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, errorText: { classPropertyName: "errorText", publicName: "errorText", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, dimOthers: { classPropertyName: "dimOthers", publicName: "dimOthers", isSignal: true, isRequired: false, transformFunction: null }, staggerMs: { classPropertyName: "staggerMs", publicName: "staggerMs", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { rowClicked: "rowClicked" }, queries: [{ propertyName: "tooltipTemplate", first: true, predicate: ["dsChartTooltip"], descendants: true, isSignal: true }], ngImport: i0, template: "<figure class=\"bar-chart\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_bar-chart-track-height)\" />\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"rows\"\n [class.dims-others]=\"dimOthers()\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n @for (entry of rows(); track entry.key; let index = $index) {\n <div\n class=\"row\"\n animate.leave=\"mark-leave\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [class.interactive]=\"interactive()\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index)\"\n (click)=\"rowClicked.emit(entry.row)\"\n (keydown.enter)=\"onRowKey(entry.row, $event)\"\n (keydown.space)=\"onRowKey(entry.row, $event)\">\n <span class=\"label\">\n {{ entry.row.label }}\n </span>\n\n <span class=\"value\">\n {{ entry.formattedValue }}\n </span>\n\n @if (showPercent()) {\n <span class=\"percent\">\n {{ entry.formattedPercent }}\n </span>\n }\n\n <span class=\"track\">\n <span\n class=\"fill\"\n animate.enter=\"mark-enter\"\n [style.width.%]=\"entry.widthPercent\"\n [style.background]=\"entry.color\">\n </span>\n </span>\n </div>\n }\n </div>\n\n @if (dataTableResolved() !== 'none') {\n <details\n class=\"data-table\"\n [open]=\"dataTableResolved() === 'visible'\">\n <summary>\n Data table\n </summary>\n\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Label\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n </tr>\n </thead>\n\n <tbody>\n @for (entry of rows(); track entry.key) {\n <tr>\n <td>\n {{ entry.row.label }}\n </td>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n </tr>\n }\n </tbody>\n </table>\n </details>\n }\n }\n</figure>\n", styles: ["@charset \"UTF-8\";@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.row .fill{transform-origin:left}.fill.mark-enter{animation:ds-chart-mark-grow-x var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.row.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}:host{display:block;padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.bar-chart{--_bar-chart-track-color: var(--ds-bar-chart-track-color, var(--ds-chart-grid-line-color));--_bar-chart-track-height: var(--ds-bar-chart-track-height, 12px);--_bar-chart-cap-radius: var( --ds-bar-chart-cap-radius, var(--ds-chart-mark-cap-radius) );--_bar-chart-row-gap: var(--ds-bar-chart-row-gap, var(--space-5));--_bar-chart-label-gap: var(--ds-bar-chart-label-gap, var(--space-1));margin:0}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:600}.rows .row{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.rows .row.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.rows.dims-others:has(.row.interactive:hover) .row.interactive:not(:hover),.rows.dims-others:has(.row.interactive:focus-visible) .row.interactive:not(:focus-visible){opacity:var(--ds-chart-dim-opacity)}.rows .row.interactive{cursor:pointer}.rows{display:grid}.skeleton{display:grid;row-gap:var(--_bar-chart-row-gap)}.row{padding-block:calc(var(--_bar-chart-row-gap) / 2);display:grid;grid-template-columns:1fr auto auto;gap:var(--_bar-chart-label-gap) var(--space-2);align-items:baseline}.empty{display:grid;place-items:center;min-block-size:calc(3 * (var(--_bar-chart-track-height) + var(--_bar-chart-row-gap)));margin:0;color:var(--text-secondary);text-align:center}.label{color:var(--text-secondary)}.value{font-weight:700}.percent{color:var(--text-tertiary);font-size:var(--font-size-xs)}.track{grid-column:1/-1;block-size:var(--_bar-chart-track-height);border-radius:var(--_bar-chart-cap-radius);background:var(--_bar-chart-track-color);overflow:hidden}.fill{display:block;block-size:100%;border-radius:inherit;transition:inline-size var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),background-color var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.empty.is-error{color:var(--error)}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}\n"], dependencies: [{ kind: "component", type: SkeletonComponent, selector: "ds-skeleton", inputs: ["width", "height", "circle", "inline"] }, { kind: "directive", type: ChartTooltipDirective, selector: "[dsChartTooltip]", inputs: ["dsChartTooltip", "dsChartTooltipOrigin", "dsChartTooltipTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
233
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: BarChartComponent, isStandalone: true, selector: "ds-bar-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, frame: { classPropertyName: "frame", publicName: "frame", isSignal: true, isRequired: false, transformFunction: null }, tooltipLingerMs: { classPropertyName: "tooltipLingerMs", publicName: "tooltipLingerMs", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, summary: { classPropertyName: "summary", publicName: "summary", isSignal: true, isRequired: false, transformFunction: null }, dataTable: { classPropertyName: "dataTable", publicName: "dataTable", isSignal: true, isRequired: false, transformFunction: null }, partOfWhole: { classPropertyName: "partOfWhole", publicName: "partOfWhole", isSignal: true, isRequired: false, transformFunction: null }, showPercent: { classPropertyName: "showPercent", publicName: "showPercent", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, errorText: { classPropertyName: "errorText", publicName: "errorText", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, pinOnClick: { classPropertyName: "pinOnClick", publicName: "pinOnClick", isSignal: true, isRequired: false, transformFunction: null }, dimOthers: { classPropertyName: "dimOthers", publicName: "dimOthers", isSignal: true, isRequired: false, transformFunction: null }, staggerMs: { classPropertyName: "staggerMs", publicName: "staggerMs", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { rowClicked: "rowClicked" }, host: { properties: { "class.framed": "frameResolved() === 'auto'" } }, queries: [{ propertyName: "tooltipTemplate", first: true, predicate: ["dsChartTooltip"], descendants: true, isSignal: true }], ngImport: i0, template: "<figure class=\"bar-chart\">\n @if (activeMark.pinned()) {\n <button\n class=\"pin-reset\"\n type=\"button\"\n (click)=\"activeMark.release()\">\n Unpin\n </button>\n }\n\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_bar-chart-track-height)\" />\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"rows\"\n [class.dims-others]=\"dimOthers()\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipPreferBelow]=\"activeMark.pinned()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n @for (entry of rows(); track entry.key; let index = $index) {\n <div\n class=\"row\"\n animate.leave=\"mark-leave\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [class.interactive]=\"interactive()\"\n [class.is-pinned]=\"\n activeMark.pinned() && activeMark.index() === index\n \"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (pointerenter)=\"activeMark.enter(index, $event, '.track')\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index)\"\n (click)=\"onMarkClick(entry.row, index, $event)\"\n (keydown.enter)=\"onRowKey(entry.row, $event)\"\n (keydown.space)=\"onRowKey(entry.row, $event)\">\n <span class=\"label\">\n {{ entry.row.label }}\n\n @if (entry.row.detail) {\n <span class=\"detail\">\n {{ entry.row.detail }}\n </span>\n }\n </span>\n\n <span class=\"value\">\n {{ entry.formattedValue }}\n </span>\n\n @if (showPercent()) {\n <span class=\"percent\">\n {{ entry.formattedPercent }}\n </span>\n }\n\n <span class=\"track\">\n <span\n class=\"fill\"\n animate.enter=\"mark-enter\"\n [style.width.%]=\"entry.widthPercent\"\n [style.background]=\"entry.segments.length ? null : entry.color\">\n @for (part of entry.segments; track part.key) {\n <span\n class=\"segment\"\n [style.width.%]=\"part.widthPercent\"\n [style.background]=\"part.color\">\n </span>\n }\n\n @if (activeMark.pinned() && activeMark.index() === index) {\n <ds-icon\n class=\"pin-marker\"\n name=\"pin\"\n [size]=\"14\" />\n }\n </span>\n </span>\n </div>\n }\n </div>\n\n @if (dataTableResolved() !== 'none') {\n <details\n class=\"data-table\"\n [open]=\"dataTableResolved() === 'visible'\">\n <summary>\n Data table\n </summary>\n\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Label\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n\n @if (partOfWhole()) {\n <th scope=\"col\">\n Share of total\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (entry of rows(); track entry.key) {\n <tr>\n <td>\n {{ entry.row.label }}\n\n @if (entry.row.detail) {\n <span class=\"detail\">\n {{ entry.row.detail }}\n </span>\n }\n </td>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n\n @if (partOfWhole()) {\n <td>\n {{ entry.share }}\n </td>\n }\n </tr>\n\n @for (part of entry.segments; track part.key) {\n <tr class=\"segment-row\">\n <td>\n {{ part.segment.label }}\n </td>\n\n <td>\n {{ part.formattedValue }}\n </td>\n\n @if (partOfWhole()) {\n <td></td>\n }\n </tr>\n }\n }\n </tbody>\n </table>\n </details>\n }\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.row .fill{transform-origin:left}.fill.mark-enter{animation:ds-chart-mark-grow-x var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.row.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}:host{display:block;-webkit-user-select:none;user-select:none}:host(.framed){padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table,.stage-table,figcaption{-webkit-user-select:text;user-select:text}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.bar-chart{--_bar-chart-track-color: var(--ds-bar-chart-track-color, var(--ds-chart-grid-line-color));--_bar-chart-track-height: var(--ds-bar-chart-track-height, 12px);--_bar-chart-cap-radius: var( --ds-bar-chart-cap-radius, var(--ds-chart-mark-cap-radius) );--_bar-chart-row-gap: var(--ds-bar-chart-row-gap, var(--space-5));--_bar-chart-label-gap: var(--ds-bar-chart-label-gap, var(--space-1));margin:0}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:600}.rows .row{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.rows .row.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.rows.dims-others:not(:has(.row.is-pinned)):has(.row.interactive:hover) .row.interactive:not(:hover),.rows.dims-others:not(:has(.row.is-pinned)):has(.row.interactive:focus-visible) .row.interactive:not(:focus-visible),.rows.dims-others:has(.row.is-pinned) .row:not(.is-pinned){opacity:var(--ds-chart-dim-opacity)}.rows .row.interactive{cursor:pointer}.rows{display:grid}.skeleton{display:grid;row-gap:var(--_bar-chart-row-gap)}.row{padding-block:calc(var(--_bar-chart-row-gap) / 2);display:grid;grid-template-columns:1fr auto auto;gap:var(--_bar-chart-label-gap) var(--space-2);align-items:baseline}.empty{display:grid;place-items:center;min-block-size:calc(3 * (var(--_bar-chart-track-height) + var(--_bar-chart-row-gap)));margin:0;color:var(--text-secondary);text-align:center}.label{color:var(--text-secondary)}.value{font-weight:700}.percent{color:var(--text-tertiary);font-size:var(--font-size-xs)}.track{grid-column:1/-1;block-size:var(--_bar-chart-track-height);border-radius:var(--_bar-chart-cap-radius);background:var(--_bar-chart-track-color)}.fill{position:relative;display:flex;block-size:100%;max-inline-size:100%;border-radius:inherit;transition:inline-size var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),background-color var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.empty.is-error{color:var(--error)}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}:host{position:relative}.pin-reset{position:absolute;inset-block-start:var(--space-2);inset-inline:0;z-index:1;justify-self:center;margin-inline:auto;display:inline-flex;align-items:center;gap:var(--space-1);min-block-size:var(--space-12);inline-size:fit-content;padding:var(--space-1) var(--space-3);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-secondary);font-size:var(--font-size-xs);line-height:1;box-shadow:var(--shadow-1);cursor:pointer}.pin-reset:hover{color:var(--text-primary);border-color:var(--border-strong)}.pin-marker{display:grid;place-items:center;inline-size:var(--ds-chart-pin-size, 22px);block-size:var(--ds-chart-pin-size, 22px);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-primary);box-shadow:var(--shadow-1);pointer-events:none}.label>.detail{display:block;color:var(--text-secondary);font-size:var(--font-size-xs)}.segment{block-size:100%;transition:background-color var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.segment:first-of-type{border-start-start-radius:var(--_bar-chart-cap-radius);border-end-start-radius:var(--_bar-chart-cap-radius)}.segment:last-of-type{border-start-end-radius:var(--_bar-chart-cap-radius);border-end-end-radius:var(--_bar-chart-cap-radius)}.segment+.segment{border-inline-start:2px solid var(--ds-chart-frame-bg-color, var(--surface-default))}.fill>.pin-marker{position:absolute;inset-inline-start:0;inset-block-start:50%;translate:0 -50%}.segment-row>td:first-child{padding-inline-start:var(--space-6);color:var(--text-secondary)}\n"], dependencies: [{ kind: "component", type: SkeletonComponent, selector: "ds-skeleton", inputs: ["width", "height", "circle", "inline"] }, { kind: "directive", type: ChartTooltipDirective, selector: "[dsChartTooltip]", inputs: ["dsChartTooltip", "dsChartTooltipOrigin", "dsChartTooltipTemplate", "dsChartTooltipExtraGap", "dsChartTooltipPreferBelow"] }, { kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
166
234
  }
167
235
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: BarChartComponent, decorators: [{
168
236
  type: Component,
169
- args: [{ selector: 'ds-bar-chart', standalone: true, imports: [SkeletonComponent, ChartTooltipDirective], encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<figure class=\"bar-chart\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_bar-chart-track-height)\" />\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"rows\"\n [class.dims-others]=\"dimOthers()\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n @for (entry of rows(); track entry.key; let index = $index) {\n <div\n class=\"row\"\n animate.leave=\"mark-leave\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [class.interactive]=\"interactive()\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index)\"\n (click)=\"rowClicked.emit(entry.row)\"\n (keydown.enter)=\"onRowKey(entry.row, $event)\"\n (keydown.space)=\"onRowKey(entry.row, $event)\">\n <span class=\"label\">\n {{ entry.row.label }}\n </span>\n\n <span class=\"value\">\n {{ entry.formattedValue }}\n </span>\n\n @if (showPercent()) {\n <span class=\"percent\">\n {{ entry.formattedPercent }}\n </span>\n }\n\n <span class=\"track\">\n <span\n class=\"fill\"\n animate.enter=\"mark-enter\"\n [style.width.%]=\"entry.widthPercent\"\n [style.background]=\"entry.color\">\n </span>\n </span>\n </div>\n }\n </div>\n\n @if (dataTableResolved() !== 'none') {\n <details\n class=\"data-table\"\n [open]=\"dataTableResolved() === 'visible'\">\n <summary>\n Data table\n </summary>\n\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Label\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n </tr>\n </thead>\n\n <tbody>\n @for (entry of rows(); track entry.key) {\n <tr>\n <td>\n {{ entry.row.label }}\n </td>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n </tr>\n }\n </tbody>\n </table>\n </details>\n }\n }\n</figure>\n", styles: ["@charset \"UTF-8\";@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.row .fill{transform-origin:left}.fill.mark-enter{animation:ds-chart-mark-grow-x var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.row.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}:host{display:block;padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.bar-chart{--_bar-chart-track-color: var(--ds-bar-chart-track-color, var(--ds-chart-grid-line-color));--_bar-chart-track-height: var(--ds-bar-chart-track-height, 12px);--_bar-chart-cap-radius: var( --ds-bar-chart-cap-radius, var(--ds-chart-mark-cap-radius) );--_bar-chart-row-gap: var(--ds-bar-chart-row-gap, var(--space-5));--_bar-chart-label-gap: var(--ds-bar-chart-label-gap, var(--space-1));margin:0}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:600}.rows .row{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.rows .row.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.rows.dims-others:has(.row.interactive:hover) .row.interactive:not(:hover),.rows.dims-others:has(.row.interactive:focus-visible) .row.interactive:not(:focus-visible){opacity:var(--ds-chart-dim-opacity)}.rows .row.interactive{cursor:pointer}.rows{display:grid}.skeleton{display:grid;row-gap:var(--_bar-chart-row-gap)}.row{padding-block:calc(var(--_bar-chart-row-gap) / 2);display:grid;grid-template-columns:1fr auto auto;gap:var(--_bar-chart-label-gap) var(--space-2);align-items:baseline}.empty{display:grid;place-items:center;min-block-size:calc(3 * (var(--_bar-chart-track-height) + var(--_bar-chart-row-gap)));margin:0;color:var(--text-secondary);text-align:center}.label{color:var(--text-secondary)}.value{font-weight:700}.percent{color:var(--text-tertiary);font-size:var(--font-size-xs)}.track{grid-column:1/-1;block-size:var(--_bar-chart-track-height);border-radius:var(--_bar-chart-cap-radius);background:var(--_bar-chart-track-color);overflow:hidden}.fill{display:block;block-size:100%;border-radius:inherit;transition:inline-size var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),background-color var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.empty.is-error{color:var(--error)}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}\n"] }]
170
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], summary: [{ type: i0.Input, args: [{ isSignal: true, alias: "summary", required: false }] }], dataTable: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTable", required: false }] }], showPercent: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPercent", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], errorText: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorText", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], rowClicked: [{ type: i0.Output, args: ["rowClicked"] }], dimOthers: [{ type: i0.Input, args: [{ isSignal: true, alias: "dimOthers", required: false }] }], staggerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "staggerMs", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipTemplate: [{ type: i0.ContentChild, args: ['dsChartTooltip', { isSignal: true }] }] } });
237
+ args: [{ selector: 'ds-bar-chart', standalone: true, imports: [SkeletonComponent, ChartTooltipDirective, IconComponent], host: { '[class.framed]': "frameResolved() === 'auto'" }, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<figure class=\"bar-chart\">\n @if (activeMark.pinned()) {\n <button\n class=\"pin-reset\"\n type=\"button\"\n (click)=\"activeMark.release()\">\n Unpin\n </button>\n }\n\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_bar-chart-track-height)\" />\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"rows\"\n [class.dims-others]=\"dimOthers()\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipPreferBelow]=\"activeMark.pinned()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n @for (entry of rows(); track entry.key; let index = $index) {\n <div\n class=\"row\"\n animate.leave=\"mark-leave\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [class.interactive]=\"interactive()\"\n [class.is-pinned]=\"\n activeMark.pinned() && activeMark.index() === index\n \"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (pointerenter)=\"activeMark.enter(index, $event, '.track')\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index)\"\n (click)=\"onMarkClick(entry.row, index, $event)\"\n (keydown.enter)=\"onRowKey(entry.row, $event)\"\n (keydown.space)=\"onRowKey(entry.row, $event)\">\n <span class=\"label\">\n {{ entry.row.label }}\n\n @if (entry.row.detail) {\n <span class=\"detail\">\n {{ entry.row.detail }}\n </span>\n }\n </span>\n\n <span class=\"value\">\n {{ entry.formattedValue }}\n </span>\n\n @if (showPercent()) {\n <span class=\"percent\">\n {{ entry.formattedPercent }}\n </span>\n }\n\n <span class=\"track\">\n <span\n class=\"fill\"\n animate.enter=\"mark-enter\"\n [style.width.%]=\"entry.widthPercent\"\n [style.background]=\"entry.segments.length ? null : entry.color\">\n @for (part of entry.segments; track part.key) {\n <span\n class=\"segment\"\n [style.width.%]=\"part.widthPercent\"\n [style.background]=\"part.color\">\n </span>\n }\n\n @if (activeMark.pinned() && activeMark.index() === index) {\n <ds-icon\n class=\"pin-marker\"\n name=\"pin\"\n [size]=\"14\" />\n }\n </span>\n </span>\n </div>\n }\n </div>\n\n @if (dataTableResolved() !== 'none') {\n <details\n class=\"data-table\"\n [open]=\"dataTableResolved() === 'visible'\">\n <summary>\n Data table\n </summary>\n\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Label\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n\n @if (partOfWhole()) {\n <th scope=\"col\">\n Share of total\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (entry of rows(); track entry.key) {\n <tr>\n <td>\n {{ entry.row.label }}\n\n @if (entry.row.detail) {\n <span class=\"detail\">\n {{ entry.row.detail }}\n </span>\n }\n </td>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n\n @if (partOfWhole()) {\n <td>\n {{ entry.share }}\n </td>\n }\n </tr>\n\n @for (part of entry.segments; track part.key) {\n <tr class=\"segment-row\">\n <td>\n {{ part.segment.label }}\n </td>\n\n <td>\n {{ part.formattedValue }}\n </td>\n\n @if (partOfWhole()) {\n <td></td>\n }\n </tr>\n }\n }\n </tbody>\n </table>\n </details>\n }\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.row .fill{transform-origin:left}.fill.mark-enter{animation:ds-chart-mark-grow-x var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.row.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}:host{display:block;-webkit-user-select:none;user-select:none}:host(.framed){padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table,.stage-table,figcaption{-webkit-user-select:text;user-select:text}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.bar-chart{--_bar-chart-track-color: var(--ds-bar-chart-track-color, var(--ds-chart-grid-line-color));--_bar-chart-track-height: var(--ds-bar-chart-track-height, 12px);--_bar-chart-cap-radius: var( --ds-bar-chart-cap-radius, var(--ds-chart-mark-cap-radius) );--_bar-chart-row-gap: var(--ds-bar-chart-row-gap, var(--space-5));--_bar-chart-label-gap: var(--ds-bar-chart-label-gap, var(--space-1));margin:0}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:600}.rows .row{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.rows .row.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.rows.dims-others:not(:has(.row.is-pinned)):has(.row.interactive:hover) .row.interactive:not(:hover),.rows.dims-others:not(:has(.row.is-pinned)):has(.row.interactive:focus-visible) .row.interactive:not(:focus-visible),.rows.dims-others:has(.row.is-pinned) .row:not(.is-pinned){opacity:var(--ds-chart-dim-opacity)}.rows .row.interactive{cursor:pointer}.rows{display:grid}.skeleton{display:grid;row-gap:var(--_bar-chart-row-gap)}.row{padding-block:calc(var(--_bar-chart-row-gap) / 2);display:grid;grid-template-columns:1fr auto auto;gap:var(--_bar-chart-label-gap) var(--space-2);align-items:baseline}.empty{display:grid;place-items:center;min-block-size:calc(3 * (var(--_bar-chart-track-height) + var(--_bar-chart-row-gap)));margin:0;color:var(--text-secondary);text-align:center}.label{color:var(--text-secondary)}.value{font-weight:700}.percent{color:var(--text-tertiary);font-size:var(--font-size-xs)}.track{grid-column:1/-1;block-size:var(--_bar-chart-track-height);border-radius:var(--_bar-chart-cap-radius);background:var(--_bar-chart-track-color)}.fill{position:relative;display:flex;block-size:100%;max-inline-size:100%;border-radius:inherit;transition:inline-size var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),background-color var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.empty.is-error{color:var(--error)}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}:host{position:relative}.pin-reset{position:absolute;inset-block-start:var(--space-2);inset-inline:0;z-index:1;justify-self:center;margin-inline:auto;display:inline-flex;align-items:center;gap:var(--space-1);min-block-size:var(--space-12);inline-size:fit-content;padding:var(--space-1) var(--space-3);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-secondary);font-size:var(--font-size-xs);line-height:1;box-shadow:var(--shadow-1);cursor:pointer}.pin-reset:hover{color:var(--text-primary);border-color:var(--border-strong)}.pin-marker{display:grid;place-items:center;inline-size:var(--ds-chart-pin-size, 22px);block-size:var(--ds-chart-pin-size, 22px);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-primary);box-shadow:var(--shadow-1);pointer-events:none}.label>.detail{display:block;color:var(--text-secondary);font-size:var(--font-size-xs)}.segment{block-size:100%;transition:background-color var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.segment:first-of-type{border-start-start-radius:var(--_bar-chart-cap-radius);border-end-start-radius:var(--_bar-chart-cap-radius)}.segment:last-of-type{border-start-end-radius:var(--_bar-chart-cap-radius);border-end-end-radius:var(--_bar-chart-cap-radius)}.segment+.segment{border-inline-start:2px solid var(--ds-chart-frame-bg-color, var(--surface-default))}.fill>.pin-marker{position:absolute;inset-inline-start:0;inset-block-start:50%;translate:0 -50%}.segment-row>td:first-child{padding-inline-start:var(--space-6);color:var(--text-secondary)}\n"] }]
238
+ }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], frame: [{ type: i0.Input, args: [{ isSignal: true, alias: "frame", required: false }] }], tooltipLingerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipLingerMs", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], summary: [{ type: i0.Input, args: [{ isSignal: true, alias: "summary", required: false }] }], dataTable: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTable", required: false }] }], partOfWhole: [{ type: i0.Input, args: [{ isSignal: true, alias: "partOfWhole", required: false }] }], showPercent: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPercent", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], errorText: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorText", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], rowClicked: [{ type: i0.Output, args: ["rowClicked"] }], pinOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinOnClick", required: false }] }], dimOthers: [{ type: i0.Input, args: [{ isSignal: true, alias: "dimOthers", required: false }] }], staggerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "staggerMs", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipTemplate: [{ type: i0.ContentChild, args: ['dsChartTooltip', { isSignal: true }] }] } });
171
239
 
172
240
  /**
173
241
  * Generated bundle index. Do not edit.