@ids-group-ltd/ids-design-system 0.13.0 → 0.13.2
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.
- package/CHANGELOG.md +656 -3
- package/components.md +32 -11
- package/docs/agent/INDEX.md +2 -0
- package/docs/agent/charts/ds-bar-chart.md +1 -1
- package/docs/agent/charts/ds-column-chart.md +1 -1
- package/docs/agent/charts/ds-config.md +12 -0
- package/docs/agent/charts/ds-donut-chart.md +2 -2
- package/docs/agent/charts/ds-funnel-chart.md +1 -1
- package/docs/agent/charts/ds-line-chart.md +3 -2
- package/docs/agent/feedback/ds-meter.md +11 -0
- package/docs/agent/feedback/ds-progress.md +4 -1
- package/docs/agent/forms/ds-button.md +1 -1
- package/docs/agent/forms/ds-icon-button.md +1 -1
- package/docs/agent/surfaces/ds-card.md +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +9 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs +100 -15
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +3 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs +47 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs +155 -21
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +9 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs +81 -18
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +9 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs +75 -23
- package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs +2 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs +107 -19
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs +236 -31
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +2 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-meter.mjs +61 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-meter.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +9 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs +34 -10
- package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +9 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +9 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +119 -13
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.13.1.json +236 -0
- package/migrations/0.13.2.json +269 -0
- package/package.json +9 -1
- package/styles/_chart-frame.scss +116 -4
- package/styles/_chart-interactive.scss +27 -7
- package/styles/_chart-motion.scss +61 -18
- package/styles/_dropdown-overlay.scss +9 -3
- package/styles/_focus.scss +10 -1
- package/styles/_overlay-motion.scss +11 -1
- package/styles/_tokens-charts.scss +5 -0
- package/types/ids-group-ltd-ids-design-system-components-autocomplete.d.ts +6 -1
- package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +87 -10
- package/types/ids-group-ltd-ids-design-system-components-button.d.ts +1 -0
- package/types/ids-group-ltd-ids-design-system-components-chart-legend.d.ts +25 -2
- package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +23 -3
- package/types/ids-group-ltd-ids-design-system-components-color-picker.d.ts +6 -1
- package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +60 -9
- package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +6 -1
- package/types/ids-group-ltd-ids-design-system-components-donut-chart.d.ts +53 -13
- package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +73 -11
- package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +116 -12
- package/types/ids-group-ltd-ids-design-system-components-meter.d.ts +36 -0
- package/types/ids-group-ltd-ids-design-system-components-multi-select.d.ts +6 -1
- package/types/ids-group-ltd-ids-design-system-components-progress.d.ts +21 -3
- package/types/ids-group-ltd-ids-design-system-components-select.d.ts +6 -1
- package/types/ids-group-ltd-ids-design-system-components-time-picker.d.ts +6 -1
- package/types/ids-group-ltd-ids-design-system-components.d.ts +47 -5
- package/types/ids-group-ltd-ids-design-system-core.d.ts +40 -1
- package/types/ids-group-ltd-ids-design-system.d.ts +6 -5
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-
|
|
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
|
|
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)
|
|
@@ -286,7 +286,18 @@ Content: project `<ds-avatar>` children.
|
|
|
286
286
|
|
|
287
287
|
#### `<ds-progress>` — `ProgressComponent`
|
|
288
288
|
Linear progress bar (no circular variant).
|
|
289
|
-
Inputs: `value: number = 0` (
|
|
289
|
+
Inputs: `value: number = 0` (in units of `max`, clamped), `max: number = 100`, `variant: 'default' | 'success' | 'warning' | 'error' = 'default'`, `indeterminate: boolean = false`, `target: number | null = null`, `ariaLabel: string | null = null`.
|
|
290
|
+
`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. Zero or less falls back to 100.
|
|
291
|
+
`target` is a second point on the same scale, drawn as a hairline across the track — a goal or baseline to read `value` against. Clamped like `value` and ignored while `indeterminate`. `role="progressbar"` announces one value, so name the comparison in `ariaLabel` ("Resolved 62% against a 75% target"); the mark alone reaches nobody using a screen reader.
|
|
292
|
+
Tokens: `--ds-progress-height`, `--ds-progress-track-color`, `--ds-progress-bar-color`, `--ds-progress-bar-color-success`, `--ds-progress-bar-color-warning`, `--ds-progress-bar-color-error`, `--ds-progress-target-color`, `--ds-progress-target-width`.
|
|
293
|
+
|
|
294
|
+
#### `<ds-meter>` — `MeterComponent`
|
|
295
|
+
One track and one fill, for a measurement inside a table cell — no caption, no legend, no annex table.
|
|
296
|
+
Inputs: `value: number = 0` (in units of `max`, clamped), `max: number = 100` (zero or less falls back to 100), `color: string | null = null`, `ariaLabel: string | null = null`.
|
|
297
|
+
Not `<ds-progress>`: that reports how far a task has got and says so with `role="progressbar"`, which a table of two hundred measurements would announce two hundred times. Here the mark is `aria-hidden` unless `ariaLabel` names it — leave it unset where the cell prints the figure beside the bar, set it where the bar is the only place the number appears.
|
|
298
|
+
`max` is usually the column's own largest value, so the longest bar fills its track and the rest are its share.
|
|
299
|
+
The meter fills whatever box it is in, so the column decides the bar's width. A box sized to its content — `width: 'content'` on `ds-table`, or a shrink-to-fit flex or grid item — is sized by what its contents contribute intrinsically, and a bar that is 100% of its cell contributes nothing, so the host carries a `min-inline-size` of `3rem`. Give it a width of your own where the bar should be a fixed size.
|
|
300
|
+
Tokens: `--ds-meter-height`, `--ds-meter-min-width`, `--ds-meter-track-color`, `--ds-meter-radius`, `--ds-meter-fill-color`.
|
|
290
301
|
|
|
291
302
|
#### `<ds-spinner>` — `SpinnerComponent`
|
|
292
303
|
Input: `size: 'sm' | 'md' | 'lg' = 'md'`. Pure-CSS spinner, `role="status"` with built-in `aria-label`.
|
|
@@ -399,7 +410,7 @@ Content: label text (when `variant="label"`).
|
|
|
399
410
|
#### `<ds-card>` — `CardComponent`
|
|
400
411
|
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
412
|
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-
|
|
413
|
+
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
414
|
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
415
|
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
416
|
|
|
@@ -462,7 +473,7 @@ Tokens: `--ds-table-border: var(--border-default)`, `--ds-table-radius: var(--ra
|
|
|
462
473
|
#### `<ds-bar-chart>` — `BarChartComponent`
|
|
463
474
|
Inputs: `data: readonly BarChartRow[]` (required), `max: number | null = null` (track length is relative to this; null uses the largest value, so the longest row always fills its track — a max BELOW the largest value is allowed and its bar clips at the track edge), `caption: string | null = null`, `summary: string | null = null` (accessible name; generated from the data when omitted), `dataTable: 'toggle' | 'visible' | 'none' = 'toggle'` (`'toggle'` renders a closed `<details>`; `'none'` is only correct when the same numbers are already in the DOM nearby), `showPercent: boolean = true`, `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`
|
|
464
475
|
Output: `(rowClicked): BarChartRow` — emits the clicked row.
|
|
465
|
-
Interaction: `interactive: boolean = false` turns on the affordance — pointer cursor, hover tint and the keyboard route. 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 }[] }`.
|
|
476
|
+
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 }[] }`.
|
|
466
477
|
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.
|
|
467
478
|
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`.
|
|
468
479
|
Row: `BarChartRow = { label: string; value: number; percent?: number; color?: string }`. `percent` is derived from `value / max` when omitted.
|
|
@@ -475,7 +486,7 @@ Tokens: `--ds-bar-chart-track-color`, `--ds-bar-chart-track-height`, `--ds-bar-c
|
|
|
475
486
|
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
487
|
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`
|
|
477
488
|
Output: `(pointClicked): ColumnChartPoint` — same contract as `ds-bar-chart`'s `rowClicked`.
|
|
478
|
-
Interaction: `interactive: boolean = false` turns on the affordance — pointer cursor, hover tint and the keyboard route. 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 }[] }`.
|
|
489
|
+
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
490
|
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
491
|
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
492
|
Point: `ColumnChartPoint = { label: string; value: number; color?: string }`
|
|
@@ -486,8 +497,8 @@ Tokens: `--ds-column-chart-plot-height`, `--ds-column-chart-column-width` (share
|
|
|
486
497
|
A ring that splits one total into its parts, with the middle free for the total or a headline figure of your own.
|
|
487
498
|
Inputs: `data: readonly DonutChartSlice[]` (required), `centerValue: string | null = null`, `centerLabel: string | null = null`, `legend: 'end' | 'bottom' | 'none' = 'end'`, `maxSlices: number | null = null`, `otherLabel: string = 'Other'`, `thickness: number = 0.32`, `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`
|
|
488
499
|
Output: `(sliceClicked): DonutChartSlice`
|
|
489
|
-
Interaction: `interactive: boolean = false` turns on the affordance — pointer cursor, hover tint and the keyboard route. 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 }[] }`.
|
|
490
|
-
Motion:
|
|
500
|
+
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 }[] }`.
|
|
501
|
+
Motion: the RING fades as one object rather than slice by slice — arcs share their edges, and fading them one at a time lets the background through every seam. `staggerMs` is accepted for parity with the other four charts and has no effect here, because there is nothing to stagger. 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.
|
|
491
502
|
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`.
|
|
492
503
|
Slice: `DonutChartSlice = { id: string; label: string; value: number; slot?: number }`. `slot` is a 1-based palette slot: pinning a slice keeps every other slice's colour where it is when one is filtered out of `data`; left off, the colour follows the index and the whole ring repaints.
|
|
493
504
|
Colour: slices ARE different things, so this is the chart the categorical palette exists for — `--ds-chart-series-1-color` … `--ds-chart-series-8-color`.
|
|
@@ -500,7 +511,7 @@ Tokens: `--ds-donut-chart-size`, `--ds-donut-chart-gap`, `--ds-donut-chart-swatc
|
|
|
500
511
|
Stages of a journey, drawn top to bottom in the order you give them — they are never sorted, because the order is the meaning.
|
|
501
512
|
Inputs: `data: readonly FunnelChartStage[]` (required), `shape: 'taper' | 'width' | 'area' = 'area'`, `showTable: boolean = true` (the aligned stage table under the funnel: value, share of the first stage, and how much fell away since the stage above), `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`
|
|
502
513
|
Output: `(stageClicked): FunnelChartStage`
|
|
503
|
-
Interaction: `interactive: boolean = false` turns on the affordance — pointer cursor, hover tint and the keyboard route. 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 }[] }`.
|
|
514
|
+
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 }[] }`.
|
|
504
515
|
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.
|
|
505
516
|
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`.
|
|
506
517
|
Stage: `FunnelChartStage = { id: string; label: string; value: number }`
|
|
@@ -513,13 +524,23 @@ Tokens: `--ds-funnel-chart-stage-height`, `--ds-funnel-chart-stage-gap`, `--ds-f
|
|
|
513
524
|
One or more series plotted over a shared set of categories.
|
|
514
525
|
Inputs: `categories: readonly string[]` (required), `series: readonly LineChartSeries[]` (required), `yAxisMode: 'rounded' | 'exact' | 'independent' | 'stacked' = 'rounded'`, `showMarkers: boolean = true`, `gaps: 'break' | 'zero' = 'break'`, `tickCount: number = 5`, `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' | 'axis' | 'none' = 'axis'`, `patterns: boolean = false`, `staggerMs: number = 0`, `legendFilters: boolean = false`, `hiddenSeries: readonly string[] = []` (two-way), `rescaleOnHide: boolean = false`, `noVisibleSeriesText: string = 'All series are hidden'`
|
|
515
526
|
Output: `(pointClicked): LineChartPoint` — the reading that was clicked or activated. Fires whether or not `interactive` is set.
|
|
516
|
-
Interaction: a pointer moving over the plot picks the CATEGORY under it — a band paints behind every series and `tooltip="axis"`, the default here, names every series at that category. Tabbing reaches ONE marker per series; arrows walk that series' readings, and a focused marker's tooltip names its own series alone. A tap picks a category and latches the panel until the next tap outside; markers carry a transparent hit stroke of 24px, or 44px under `(pointer: coarse)`.
|
|
527
|
+
Interaction: a pointer moving over the plot picks the CATEGORY under it — a band paints behind every series and `tooltip="axis"`, the default here, names every series at that category. Tabbing reaches ONE marker per series; arrows walk that series' readings, and a focused marker's tooltip names its own series alone. A tap picks a category and latches the panel until the next tap outside; markers carry a transparent hit stroke of 24px, or 44px under `(pointer: coarse)`. `dimOthers` is the same separate opt-in as on the other four, and here it is the legend hover that drives it.
|
|
517
528
|
Legend: drawn whenever there is more than one series. `legendFilters` turns each entry into a checkbox that hides its series, `hiddenSeries` is two-way so a page can drive it from a URL parameter, and hovering an entry dims the others and thickens the one hovered. **The axis does not move when a series is hidden** unless `rescaleOnHide` says so — a silent rescale turns a period-over-period comparison into a different claim. Hiding every series replaces the plot with `noVisibleSeriesText` on a `role="status"` line, legend still rendered.
|
|
518
529
|
Second channel: `patterns` gives every series a dash of its own, in palette-slot order, with slot 1 left solid. Off by default — the shipped palette clears the colour-blind separation threshold on its own, so this is for monochrome print, a retuned palette, or a reader who asks for it.
|
|
519
530
|
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
531
|
`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
532
|
Colour: series ARE different things, so the categorical palette applies — `--ds-chart-series-1-color` onward, by position or by `slot`.
|
|
522
|
-
|
|
533
|
+
`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.
|
|
534
|
+
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`.
|
|
535
|
+
|
|
536
|
+
#### Chart defaults — what `DS_CONFIG` decides once
|
|
537
|
+
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.
|
|
538
|
+
|
|
539
|
+
```ts
|
|
540
|
+
providers: [provideDsConfig({ chart: { valueFormat: v => v.toLocaleString('de-DE'), dataTable: 'visible' } })]
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
Everything else stays per chart: `interactive`, `tooltip`, `staggerMs`, `legend`, `tickCount` and the geometry inputs each answer a question about one plot.
|
|
523
544
|
|
|
524
545
|
#### Chart frame — the box a chart draws around itself
|
|
525
546
|
Every chart paints its own border, radius, padding and `--surface-default` background, on by default. That is unusual here — most components resist owning chrome — and a chart earns the exception because it is read as an OBJECT: a plot with axes, a legend and an annex table, whose parts run into the page without an edge. A chart that already sits inside a card drops the frame with two declarations rather than a mode flag:
|
package/docs/agent/INDEX.md
CHANGED
|
@@ -24,6 +24,7 @@ and token names.** These leaves are for orientation and usage.
|
|
|
24
24
|
- [<ds-donut-chart> — DonutChartComponent](charts/ds-donut-chart.md) — A ring that splits one total into its parts, with the middle free for the total or a headline figure of your o
|
|
25
25
|
- [<ds-funnel-chart> — FunnelChartComponent](charts/ds-funnel-chart.md) — Stages of a journey, drawn top to bottom in the order you give them — they are never sorted, because the order
|
|
26
26
|
- [<ds-line-chart> — LineChartComponent](charts/ds-line-chart.md) — One or more series plotted over a shared set of categories.
|
|
27
|
+
- [Chart defaults — what DS_CONFIG decides once](charts/ds-config.md) — Four chart inputs resolve through DS_CONFIG.chart because they are one decision per APP, not per plot: valueFo
|
|
27
28
|
- [Chart frame — the box a chart draws around itself](charts/chart-frame-the-box-a-chart-draws-around-itself.md) — Every chart paints its own border, radius, padding and --surface-default background, on by default. That is un
|
|
28
29
|
- [Chart colour — which palette a chart takes](charts/chart-colour-which-palette-a-chart-takes.md) — Three families, and reaching for the wrong one is the usual chart bug. Set the --ds-chart-* contract tokens, n
|
|
29
30
|
|
|
@@ -39,6 +40,7 @@ and token names.** These leaves are for orientation and usage.
|
|
|
39
40
|
- [<ds-avatar> — AvatarComponent](feedback/ds-avatar.md) — Inputs: size: 'xs' | 'sm' | 'md' | 'lg' = 'md', initials: string = '', imageUrl: string | null = null, tint: {
|
|
40
41
|
- [<ds-avatar-group> — AvatarGroupComponent](feedback/ds-avatar-group.md) — Content: project <ds-avatar> children.
|
|
41
42
|
- [<ds-progress> — ProgressComponent](feedback/ds-progress.md) — Linear progress bar (no circular variant).
|
|
43
|
+
- [<ds-meter> — MeterComponent](feedback/ds-meter.md) — One track and one fill, for a measurement inside a table cell — no caption, no legend, no annex table.
|
|
42
44
|
- [<ds-spinner> — SpinnerComponent](feedback/ds-spinner.md) — Input: size: 'sm' | 'md' | 'lg' = 'md'. Pure-CSS spinner, role="status" with built-in aria-label.
|
|
43
45
|
- [<ds-skeleton> — SkeletonComponent](feedback/ds-skeleton.md) — Inputs: width?: string, height?: string, circle: boolean = false, inline: boolean = false. Shimmer animation r
|
|
44
46
|
- [<ds-stat> — StatComponent](feedback/ds-stat.md) — Delta direction is derived from the sign of delta: positive → up (arrow + green), negative → down (arrow + red
|
|
@@ -5,7 +5,7 @@ Group: Charts
|
|
|
5
5
|
|
|
6
6
|
Inputs: `data: readonly BarChartRow[]` (required), `max: number | null = null` (track length is relative to this; null uses the largest value, so the longest row always fills its track — a max BELOW the largest value is allowed and its bar clips at the track edge), `caption: string | null = null`, `summary: string | null = null` (accessible name; generated from the data when omitted), `dataTable: 'toggle' | 'visible' | 'none' = 'toggle'` (`'toggle'` renders a closed `<details>`; `'none'` is only correct when the same numbers are already in the DOM nearby), `showPercent: boolean = true`, `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
7
|
Output: `(rowClicked): BarChartRow` — emits the clicked row.
|
|
8
|
-
Interaction: `interactive: boolean = false` turns on the affordance — pointer cursor, hover tint and the keyboard route. 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 }[] }`.
|
|
8
|
+
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 }[] }`.
|
|
9
9
|
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.
|
|
10
10
|
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`.
|
|
11
11
|
Row: `BarChartRow = { label: string; value: number; percent?: number; color?: string }`. `percent` is derived from `value / max` when omitted.
|
|
@@ -6,7 +6,7 @@ Group: Charts
|
|
|
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
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`
|
|
8
8
|
Output: `(pointClicked): ColumnChartPoint` — same contract as `ds-bar-chart`'s `rowClicked`.
|
|
9
|
-
Interaction: `interactive: boolean = false` turns on the affordance — pointer cursor, hover tint and the keyboard route. 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 }[] }`.
|
|
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 }`
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!-- GENERATED by tools/split-agent-catalogue.mjs from components.md. Do not edit. -->
|
|
2
|
+
# Chart defaults — what `DS_CONFIG` decides once
|
|
3
|
+
|
|
4
|
+
Group: Charts
|
|
5
|
+
|
|
6
|
+
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.
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
providers: [provideDsConfig({ chart: { valueFormat: v => v.toLocaleString('de-DE'), dataTable: 'visible' } })]
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Everything else stays per chart: `interactive`, `tooltip`, `staggerMs`, `legend`, `tickCount` and the geometry inputs each answer a question about one plot.
|
|
@@ -6,8 +6,8 @@ Group: Charts
|
|
|
6
6
|
A ring that splits one total into its parts, with the middle free for the total or a headline figure of your own.
|
|
7
7
|
Inputs: `data: readonly DonutChartSlice[]` (required), `centerValue: string | null = null`, `centerLabel: string | null = null`, `legend: 'end' | 'bottom' | 'none' = 'end'`, `maxSlices: number | null = null`, `otherLabel: string = 'Other'`, `thickness: number = 0.32`, `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`
|
|
8
8
|
Output: `(sliceClicked): DonutChartSlice`
|
|
9
|
-
Interaction: `interactive: boolean = false` turns on the affordance — pointer cursor, hover tint and the keyboard route. 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
|
-
Motion:
|
|
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
|
+
Motion: the RING fades as one object rather than slice by slice — arcs share their edges, and fading them one at a time lets the background through every seam. `staggerMs` is accepted for parity with the other four charts and has no effect here, because there is nothing to stagger. 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
|
Slice: `DonutChartSlice = { id: string; label: string; value: number; slot?: number }`. `slot` is a 1-based palette slot: pinning a slice keeps every other slice's colour where it is when one is filtered out of `data`; left off, the colour follows the index and the whole ring repaints.
|
|
13
13
|
Colour: slices ARE different things, so this is the chart the categorical palette exists for — `--ds-chart-series-1-color` … `--ds-chart-series-8-color`.
|
|
@@ -6,7 +6,7 @@ Group: Charts
|
|
|
6
6
|
Stages of a journey, drawn top to bottom in the order you give them — they are never sorted, because the order is the meaning.
|
|
7
7
|
Inputs: `data: readonly FunnelChartStage[]` (required), `shape: 'taper' | 'width' | 'area' = 'area'`, `showTable: boolean = true` (the aligned stage table under the funnel: value, share of the first stage, and how much fell away since the stage above), `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`
|
|
8
8
|
Output: `(stageClicked): FunnelChartStage`
|
|
9
|
-
Interaction: `interactive: boolean = false` turns on the affordance — pointer cursor, hover tint and the keyboard route. 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 }[] }`.
|
|
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
|
Stage: `FunnelChartStage = { id: string; label: string; value: number }`
|
|
@@ -6,10 +6,11 @@ Group: Charts
|
|
|
6
6
|
One or more series plotted over a shared set of categories.
|
|
7
7
|
Inputs: `categories: readonly string[]` (required), `series: readonly LineChartSeries[]` (required), `yAxisMode: 'rounded' | 'exact' | 'independent' | 'stacked' = 'rounded'`, `showMarkers: boolean = true`, `gaps: 'break' | 'zero' = 'break'`, `tickCount: number = 5`, `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' | 'axis' | 'none' = 'axis'`, `patterns: boolean = false`, `staggerMs: number = 0`, `legendFilters: boolean = false`, `hiddenSeries: readonly string[] = []` (two-way), `rescaleOnHide: boolean = false`, `noVisibleSeriesText: string = 'All series are hidden'`
|
|
8
8
|
Output: `(pointClicked): LineChartPoint` — the reading that was clicked or activated. Fires whether or not `interactive` is set.
|
|
9
|
-
Interaction: a pointer moving over the plot picks the CATEGORY under it — a band paints behind every series and `tooltip="axis"`, the default here, names every series at that category. Tabbing reaches ONE marker per series; arrows walk that series' readings, and a focused marker's tooltip names its own series alone. A tap picks a category and latches the panel until the next tap outside; markers carry a transparent hit stroke of 24px, or 44px under `(pointer: coarse)`.
|
|
9
|
+
Interaction: a pointer moving over the plot picks the CATEGORY under it — a band paints behind every series and `tooltip="axis"`, the default here, names every series at that category. Tabbing reaches ONE marker per series; arrows walk that series' readings, and a focused marker's tooltip names its own series alone. A tap picks a category and latches the panel until the next tap outside; markers carry a transparent hit stroke of 24px, or 44px under `(pointer: coarse)`. `dimOthers` is the same separate opt-in as on the other four, and here it is the legend hover that drives it.
|
|
10
10
|
Legend: drawn whenever there is more than one series. `legendFilters` turns each entry into a checkbox that hides its series, `hiddenSeries` is two-way so a page can drive it from a URL parameter, and hovering an entry dims the others and thickens the one hovered. **The axis does not move when a series is hidden** unless `rescaleOnHide` says so — a silent rescale turns a period-over-period comparison into a different claim. Hiding every series replaces the plot with `noVisibleSeriesText` on a `role="status"` line, legend still rendered.
|
|
11
11
|
Second channel: `patterns` gives every series a dash of its own, in palette-slot order, with slot 1 left solid. Off by default — the shipped palette clears the colour-blind separation threshold on its own, so this is for monochrome print, a retuned palette, or a reader who asks for it.
|
|
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
|
-
|
|
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,11 @@
|
|
|
1
|
+
<!-- GENERATED by tools/split-agent-catalogue.mjs from components.md. Do not edit. -->
|
|
2
|
+
# `<ds-meter>` — `MeterComponent`
|
|
3
|
+
|
|
4
|
+
Group: Display & feedback
|
|
5
|
+
|
|
6
|
+
One track and one fill, for a measurement inside a table cell — no caption, no legend, no annex table.
|
|
7
|
+
Inputs: `value: number = 0` (in units of `max`, clamped), `max: number = 100` (zero or less falls back to 100), `color: string | null = null`, `ariaLabel: string | null = null`.
|
|
8
|
+
Not `<ds-progress>`: that reports how far a task has got and says so with `role="progressbar"`, which a table of two hundred measurements would announce two hundred times. Here the mark is `aria-hidden` unless `ariaLabel` names it — leave it unset where the cell prints the figure beside the bar, set it where the bar is the only place the number appears.
|
|
9
|
+
`max` is usually the column's own largest value, so the longest bar fills its track and the rest are its share.
|
|
10
|
+
The meter fills whatever box it is in, so the column decides the bar's width. A box sized to its content — `width: 'content'` on `ds-table`, or a shrink-to-fit flex or grid item — is sized by what its contents contribute intrinsically, and a bar that is 100% of its cell contributes nothing, so the host carries a `min-inline-size` of `3rem`. Give it a width of your own where the bar should be a fixed size.
|
|
11
|
+
Tokens: `--ds-meter-height`, `--ds-meter-min-width`, `--ds-meter-track-color`, `--ds-meter-radius`, `--ds-meter-fill-color`.
|
|
@@ -4,4 +4,7 @@
|
|
|
4
4
|
Group: Display & feedback
|
|
5
5
|
|
|
6
6
|
Linear progress bar (no circular variant).
|
|
7
|
-
Inputs: `value: number = 0` (
|
|
7
|
+
Inputs: `value: number = 0` (in units of `max`, clamped), `max: number = 100`, `variant: 'default' | 'success' | 'warning' | 'error' = 'default'`, `indeterminate: boolean = false`, `target: number | null = null`, `ariaLabel: string | null = null`.
|
|
8
|
+
`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. Zero or less falls back to 100.
|
|
9
|
+
`target` is a second point on the same scale, drawn as a hairline across the track — a goal or baseline to read `value` against. Clamped like `value` and ignored while `indeterminate`. `role="progressbar"` announces one value, so name the comparison in `ariaLabel` ("Resolved 62% against a 75% target"); the mark alone reaches nobody using a screen reader.
|
|
10
|
+
Tokens: `--ds-progress-height`, `--ds-progress-track-color`, `--ds-progress-bar-color`, `--ds-progress-bar-color-success`, `--ds-progress-bar-color-warning`, `--ds-progress-bar-color-error`, `--ds-progress-target-color`, `--ds-progress-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-
|
|
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
|
|
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-
|
|
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`.
|
|
@@ -38,11 +38,11 @@ class AccordionItemComponent {
|
|
|
38
38
|
this.expanded.set(false);
|
|
39
39
|
}
|
|
40
40
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: AccordionItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
41
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.22", type: AccordionItemComponent, isStandalone: true, selector: "ds-accordion-item", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expanded: "expandedChange" }, ngImport: i0, template: "<button\n type=\"button\"\n class=\"head\"\n [id]=\"headId\"\n [attr.aria-expanded]=\"expanded()\"\n [attr.aria-controls]=\"bodyId\"\n [disabled]=\"disabled() || null\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n (click)=\"toggle()\">\n <span>\n {{ title() }}\n </span>\n\n <ng-content select=\"[badge]\"></ng-content>\n\n <ds-icon\n name=\"chevronRight\"\n class=\"chev\"\n [size]=\"16\" />\n</button>\n\n<div\n class=\"body\"\n role=\"region\"\n [id]=\"bodyId\"\n [attr.aria-labelledby]=\"headId\"\n [class.is-open]=\"expanded()\"\n [attr.inert]=\"expanded() ? null : ''\">\n <div class=\"body-inner\">\n <div class=\"body-content\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\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)}}:host{--_accordion-header-bg-color: var(--ds-accordion-header-bg-color, var(--surface-default));--_accordion-header-text-color: var(--ds-accordion-header-text-color, var(--text-primary));--_accordion-header-hover-bg-color: var(--ds-accordion-header-hover-bg-color, var(--surface-secondary));--_accordion-divider-color: var(--ds-accordion-divider-color, var(--border-divider));--_accordion-chevron-color: var(--ds-accordion-chevron-color, var(--icon-default));--_accordion-body-text-color: var(--ds-accordion-body-text-color, var(--text-secondary));display:block}:host+:host{border-top:var(--border-width-default) solid var(--_accordion-divider-color)}:host:first-of-type .head{border-top-left-radius:var(--radius-lg);border-top-right-radius:var(--radius-lg)}:host:last-of-type .head{border-bottom-left-radius:var(--radius-lg);border-bottom-right-radius:var(--radius-lg)}:host .head{display:flex;align-items:center;gap:var(--space-2);width:100%;padding:var(--space-3) var(--space-4);border:0;background:var(--_accordion-header-bg-color);text-align:left;cursor:pointer;font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_accordion-header-text-color)}:host .head:hover:not(:disabled){background:var(--_accordion-header-hover-bg-color)}:host .head:active:not(:disabled){background:var(--surface-muted)}:host .head:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:calc(-1 * var(--focus-ring-width));animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}:host .head .chev{margin-left:auto;transition:transform var(--duration-base) var(--ease-standard);color:var(--_accordion-chevron-color)}:host .head[aria-expanded=true] .chev{transform:rotate(90deg)}:host .head:disabled{cursor:not-allowed;color:var(--text-disabled)}:host .head:disabled .chev{color:var(--text-disabled)}:host .body{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--duration-base) var(--ease-standard)}:host .body.is-open{grid-template-rows:1fr}@media(prefers-reduced-motion:reduce){:host .body{transition:none}}:host .body-inner{overflow:hidden;min-height:0}:host .body-content{padding:var(--space-2) var(--space-4) var(--space-4);color:var(--_accordion-body-text-color);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
41
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.22", type: AccordionItemComponent, isStandalone: true, selector: "ds-accordion-item", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expanded: "expandedChange" }, host: { properties: { "attr.title": "null" } }, ngImport: i0, template: "<button\n type=\"button\"\n class=\"head\"\n [id]=\"headId\"\n [attr.aria-expanded]=\"expanded()\"\n [attr.aria-controls]=\"bodyId\"\n [disabled]=\"disabled() || null\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n (click)=\"toggle()\">\n <span>\n {{ title() }}\n </span>\n\n <ng-content select=\"[badge]\"></ng-content>\n\n <ds-icon\n name=\"chevronRight\"\n class=\"chev\"\n [size]=\"16\" />\n</button>\n\n<div\n class=\"body\"\n role=\"region\"\n [id]=\"bodyId\"\n [attr.aria-labelledby]=\"headId\"\n [class.is-open]=\"expanded()\"\n [attr.inert]=\"expanded() ? null : ''\">\n <div class=\"body-inner\">\n <div class=\"body-content\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\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)}}:host{--_accordion-header-bg-color: var(--ds-accordion-header-bg-color, var(--surface-default));--_accordion-header-text-color: var(--ds-accordion-header-text-color, var(--text-primary));--_accordion-header-hover-bg-color: var(--ds-accordion-header-hover-bg-color, var(--surface-secondary));--_accordion-divider-color: var(--ds-accordion-divider-color, var(--border-divider));--_accordion-chevron-color: var(--ds-accordion-chevron-color, var(--icon-default));--_accordion-body-text-color: var(--ds-accordion-body-text-color, var(--text-secondary));display:block}:host+:host{border-top:var(--border-width-default) solid var(--_accordion-divider-color)}:host:first-of-type .head{border-top-left-radius:var(--radius-lg);border-top-right-radius:var(--radius-lg)}:host:last-of-type .head{border-bottom-left-radius:var(--radius-lg);border-bottom-right-radius:var(--radius-lg)}:host .head{display:flex;align-items:center;gap:var(--space-2);width:100%;padding:var(--space-3) var(--space-4);border:0;background:var(--_accordion-header-bg-color);text-align:left;cursor:pointer;font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_accordion-header-text-color)}:host .head:hover:not(:disabled){background:var(--_accordion-header-hover-bg-color)}:host .head:active:not(:disabled){background:var(--surface-muted)}:host .head:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:calc(-1 * var(--focus-ring-width));animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}:host .head .chev{margin-left:auto;transition:transform var(--duration-base) var(--ease-standard);color:var(--_accordion-chevron-color)}:host .head[aria-expanded=true] .chev{transform:rotate(90deg)}:host .head:disabled{cursor:not-allowed;color:var(--text-disabled)}:host .head:disabled .chev{color:var(--text-disabled)}:host .body{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--duration-base) var(--ease-standard)}:host .body.is-open{grid-template-rows:1fr}@media(prefers-reduced-motion:reduce){:host .body{transition:none}}:host .body-inner{overflow:hidden;min-height:0}:host .body-content{padding:var(--space-2) var(--space-4) var(--space-4);color:var(--_accordion-body-text-color);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
42
42
|
}
|
|
43
43
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: AccordionItemComponent, decorators: [{
|
|
44
44
|
type: Component,
|
|
45
|
-
args: [{ selector: 'ds-accordion-item', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, template: "<button\n type=\"button\"\n class=\"head\"\n [id]=\"headId\"\n [attr.aria-expanded]=\"expanded()\"\n [attr.aria-controls]=\"bodyId\"\n [disabled]=\"disabled() || null\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n (click)=\"toggle()\">\n <span>\n {{ title() }}\n </span>\n\n <ng-content select=\"[badge]\"></ng-content>\n\n <ds-icon\n name=\"chevronRight\"\n class=\"chev\"\n [size]=\"16\" />\n</button>\n\n<div\n class=\"body\"\n role=\"region\"\n [id]=\"bodyId\"\n [attr.aria-labelledby]=\"headId\"\n [class.is-open]=\"expanded()\"\n [attr.inert]=\"expanded() ? null : ''\">\n <div class=\"body-inner\">\n <div class=\"body-content\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\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)}}:host{--_accordion-header-bg-color: var(--ds-accordion-header-bg-color, var(--surface-default));--_accordion-header-text-color: var(--ds-accordion-header-text-color, var(--text-primary));--_accordion-header-hover-bg-color: var(--ds-accordion-header-hover-bg-color, var(--surface-secondary));--_accordion-divider-color: var(--ds-accordion-divider-color, var(--border-divider));--_accordion-chevron-color: var(--ds-accordion-chevron-color, var(--icon-default));--_accordion-body-text-color: var(--ds-accordion-body-text-color, var(--text-secondary));display:block}:host+:host{border-top:var(--border-width-default) solid var(--_accordion-divider-color)}:host:first-of-type .head{border-top-left-radius:var(--radius-lg);border-top-right-radius:var(--radius-lg)}:host:last-of-type .head{border-bottom-left-radius:var(--radius-lg);border-bottom-right-radius:var(--radius-lg)}:host .head{display:flex;align-items:center;gap:var(--space-2);width:100%;padding:var(--space-3) var(--space-4);border:0;background:var(--_accordion-header-bg-color);text-align:left;cursor:pointer;font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_accordion-header-text-color)}:host .head:hover:not(:disabled){background:var(--_accordion-header-hover-bg-color)}:host .head:active:not(:disabled){background:var(--surface-muted)}:host .head:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:calc(-1 * var(--focus-ring-width));animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}:host .head .chev{margin-left:auto;transition:transform var(--duration-base) var(--ease-standard);color:var(--_accordion-chevron-color)}:host .head[aria-expanded=true] .chev{transform:rotate(90deg)}:host .head:disabled{cursor:not-allowed;color:var(--text-disabled)}:host .head:disabled .chev{color:var(--text-disabled)}:host .body{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--duration-base) var(--ease-standard)}:host .body.is-open{grid-template-rows:1fr}@media(prefers-reduced-motion:reduce){:host .body{transition:none}}:host .body-inner{overflow:hidden;min-height:0}:host .body-content{padding:var(--space-2) var(--space-4) var(--space-4);color:var(--_accordion-body-text-color);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans)}\n"] }]
|
|
45
|
+
args: [{ selector: 'ds-accordion-item', standalone: true, imports: [IconComponent], host: { '[attr.title]': 'null' }, encapsulation: ViewEncapsulation.Emulated, template: "<button\n type=\"button\"\n class=\"head\"\n [id]=\"headId\"\n [attr.aria-expanded]=\"expanded()\"\n [attr.aria-controls]=\"bodyId\"\n [disabled]=\"disabled() || null\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n (click)=\"toggle()\">\n <span>\n {{ title() }}\n </span>\n\n <ng-content select=\"[badge]\"></ng-content>\n\n <ds-icon\n name=\"chevronRight\"\n class=\"chev\"\n [size]=\"16\" />\n</button>\n\n<div\n class=\"body\"\n role=\"region\"\n [id]=\"bodyId\"\n [attr.aria-labelledby]=\"headId\"\n [class.is-open]=\"expanded()\"\n [attr.inert]=\"expanded() ? null : ''\">\n <div class=\"body-inner\">\n <div class=\"body-content\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\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)}}:host{--_accordion-header-bg-color: var(--ds-accordion-header-bg-color, var(--surface-default));--_accordion-header-text-color: var(--ds-accordion-header-text-color, var(--text-primary));--_accordion-header-hover-bg-color: var(--ds-accordion-header-hover-bg-color, var(--surface-secondary));--_accordion-divider-color: var(--ds-accordion-divider-color, var(--border-divider));--_accordion-chevron-color: var(--ds-accordion-chevron-color, var(--icon-default));--_accordion-body-text-color: var(--ds-accordion-body-text-color, var(--text-secondary));display:block}:host+:host{border-top:var(--border-width-default) solid var(--_accordion-divider-color)}:host:first-of-type .head{border-top-left-radius:var(--radius-lg);border-top-right-radius:var(--radius-lg)}:host:last-of-type .head{border-bottom-left-radius:var(--radius-lg);border-bottom-right-radius:var(--radius-lg)}:host .head{display:flex;align-items:center;gap:var(--space-2);width:100%;padding:var(--space-3) var(--space-4);border:0;background:var(--_accordion-header-bg-color);text-align:left;cursor:pointer;font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_accordion-header-text-color)}:host .head:hover:not(:disabled){background:var(--_accordion-header-hover-bg-color)}:host .head:active:not(:disabled){background:var(--surface-muted)}:host .head:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:calc(-1 * var(--focus-ring-width));animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}:host .head .chev{margin-left:auto;transition:transform var(--duration-base) var(--ease-standard);color:var(--_accordion-chevron-color)}:host .head[aria-expanded=true] .chev{transform:rotate(90deg)}:host .head:disabled{cursor:not-allowed;color:var(--text-disabled)}:host .head:disabled .chev{color:var(--text-disabled)}:host .body{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--duration-base) var(--ease-standard)}:host .body.is-open{grid-template-rows:1fr}@media(prefers-reduced-motion:reduce){:host .body{transition:none}}:host .body-inner{overflow:hidden;min-height:0}:host .body-content{padding:var(--space-2) var(--space-4) var(--space-4);color:var(--_accordion-body-text-color);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans)}\n"] }]
|
|
46
46
|
}], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: false }] }, { type: i0.Output, args: ["expandedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
47
47
|
|
|
48
48
|
class AccordionComponent {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-accordion.mjs","sources":["../../../src/lib/components/accordion/accordion.token.ts","../../../src/lib/components/accordion/accordion-item.component.ts","../../../src/lib/components/accordion/accordion-item.component.html","../../../src/lib/components/accordion/accordion.component.ts","../../../src/lib/components/accordion/ids-group-ltd-ids-design-system-components-accordion.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\n/** Contract that ds-accordion-item reads from its parent ds-accordion. */\nexport interface AccordionContract {\n readonly multi: () => boolean;\n /** Called when an item opens; coordinator may close other items. */\n notifyOpen(item: AccordionItemRef): void;\n}\n\n/** Contract ds-accordion reads back from each projected item. */\nexport interface AccordionItemRef {\n /** Closes this item (sets expanded to false). */\n closeItem(): void;\n}\n\nexport const ACCORDION = new InjectionToken<AccordionContract>('ACCORDION');\n","import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n effect,\n inject,\n input,\n model,\n} from '@angular/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { ACCORDION, type AccordionItemRef } from './accordion.token';\n\nlet nextId = 0;\n\n@Component({\n selector: 'ds-accordion-item',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './accordion-item.component.html',\n styleUrl: './accordion-item.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class AccordionItemComponent implements AccordionItemRef {\n /** Header text shown in the toggle button. */\n readonly title = input.required<string>();\n /** Open state, two-way bound. */\n readonly expanded = model<boolean>(false);\n /** Disables the toggle button; state stays as-is. */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n protected readonly uid = `ds-accordion-${++nextId}`;\n protected readonly headId = `${this.uid}-head`;\n protected readonly bodyId = `${this.uid}-body`;\n\n private readonly accordion = inject(ACCORDION, { optional: true });\n\n /** Tracks last expanded state so we only notify on a true open transition. */\n private previousExpanded = false;\n\n constructor() {\n effect(() => {\n const isExpanded = this.expanded();\n if (isExpanded && !this.previousExpanded) {\n this.accordion?.notifyOpen(this);\n }\n this.previousExpanded = isExpanded;\n });\n }\n\n protected toggle(): void {\n if (this.disabled()) {\n return;\n }\n this.expanded.set(!this.expanded());\n }\n\n /** Called by the accordion coordinator to enforce single-open mode. */\n closeItem(): void {\n this.expanded.set(false);\n }\n}\n","<button\n type=\"button\"\n class=\"head\"\n [id]=\"headId\"\n [attr.aria-expanded]=\"expanded()\"\n [attr.aria-controls]=\"bodyId\"\n [disabled]=\"disabled() || null\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n (click)=\"toggle()\">\n <span>\n {{ title() }}\n </span>\n\n <ng-content select=\"[badge]\"></ng-content>\n\n <ds-icon\n name=\"chevronRight\"\n class=\"chev\"\n [size]=\"16\" />\n</button>\n\n<div\n class=\"body\"\n role=\"region\"\n [id]=\"bodyId\"\n [attr.aria-labelledby]=\"headId\"\n [class.is-open]=\"expanded()\"\n [attr.inert]=\"expanded() ? null : ''\">\n <div class=\"body-inner\">\n <div class=\"body-content\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n","import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n contentChildren,\n forwardRef,\n input,\n} from '@angular/core';\nimport {\n ACCORDION,\n type AccordionContract,\n type AccordionItemRef,\n} from './accordion.token';\nimport { AccordionItemComponent } from './accordion-item.component';\n\n@Component({\n selector: 'ds-accordion',\n standalone: true,\n imports: [],\n template: `<ng-content></ng-content>`,\n styles: [\n `\n :host {\n display: block;\n border: var(--border-width-default) solid var(--border-divider);\n border-radius: var(--radius-lg);\n overflow: hidden;\n }\n `,\n ],\n encapsulation: ViewEncapsulation.Emulated,\n providers: [\n {\n provide: ACCORDION,\n useExisting: forwardRef(() => AccordionComponent),\n },\n ],\n})\nexport class AccordionComponent implements AccordionContract {\n /** When false, opening one item automatically closes all others. */\n readonly multi = input(true, { transform: booleanAttribute });\n\n private readonly items = contentChildren(AccordionItemComponent);\n\n notifyOpen(opened: AccordionItemRef): void {\n if (this.multi()) {\n return;\n }\n for (const item of this.items() as unknown as AccordionItemRef[]) {\n if (item !== opened) {\n item.closeItem();\n }\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAea,SAAS,GAAG,IAAI,cAAc,CAAoB,WAAW;;ACH1E,IAAI,MAAM,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-accordion.mjs","sources":["../../../src/lib/components/accordion/accordion.token.ts","../../../src/lib/components/accordion/accordion-item.component.ts","../../../src/lib/components/accordion/accordion-item.component.html","../../../src/lib/components/accordion/accordion.component.ts","../../../src/lib/components/accordion/ids-group-ltd-ids-design-system-components-accordion.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\n/** Contract that ds-accordion-item reads from its parent ds-accordion. */\nexport interface AccordionContract {\n readonly multi: () => boolean;\n /** Called when an item opens; coordinator may close other items. */\n notifyOpen(item: AccordionItemRef): void;\n}\n\n/** Contract ds-accordion reads back from each projected item. */\nexport interface AccordionItemRef {\n /** Closes this item (sets expanded to false). */\n closeItem(): void;\n}\n\nexport const ACCORDION = new InjectionToken<AccordionContract>('ACCORDION');\n","import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n effect,\n inject,\n input,\n model,\n} from '@angular/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { ACCORDION, type AccordionItemRef } from './accordion.token';\n\nlet nextId = 0;\n\n@Component({\n selector: 'ds-accordion-item',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './accordion-item.component.html',\n styleUrl: './accordion-item.component.scss',\n // A static `title=\"…\"` feeding the input below ALSO stays in the DOM as the global attribute,\n // which makes the host a native browser tooltip over everything inside it.\n host: { '[attr.title]': 'null' },\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class AccordionItemComponent implements AccordionItemRef {\n /** Header text shown in the toggle button. */\n readonly title = input.required<string>();\n /** Open state, two-way bound. */\n readonly expanded = model<boolean>(false);\n /** Disables the toggle button; state stays as-is. */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n protected readonly uid = `ds-accordion-${++nextId}`;\n protected readonly headId = `${this.uid}-head`;\n protected readonly bodyId = `${this.uid}-body`;\n\n private readonly accordion = inject(ACCORDION, { optional: true });\n\n /** Tracks last expanded state so we only notify on a true open transition. */\n private previousExpanded = false;\n\n constructor() {\n effect(() => {\n const isExpanded = this.expanded();\n if (isExpanded && !this.previousExpanded) {\n this.accordion?.notifyOpen(this);\n }\n this.previousExpanded = isExpanded;\n });\n }\n\n protected toggle(): void {\n if (this.disabled()) {\n return;\n }\n this.expanded.set(!this.expanded());\n }\n\n /** Called by the accordion coordinator to enforce single-open mode. */\n closeItem(): void {\n this.expanded.set(false);\n }\n}\n","<button\n type=\"button\"\n class=\"head\"\n [id]=\"headId\"\n [attr.aria-expanded]=\"expanded()\"\n [attr.aria-controls]=\"bodyId\"\n [disabled]=\"disabled() || null\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n (click)=\"toggle()\">\n <span>\n {{ title() }}\n </span>\n\n <ng-content select=\"[badge]\"></ng-content>\n\n <ds-icon\n name=\"chevronRight\"\n class=\"chev\"\n [size]=\"16\" />\n</button>\n\n<div\n class=\"body\"\n role=\"region\"\n [id]=\"bodyId\"\n [attr.aria-labelledby]=\"headId\"\n [class.is-open]=\"expanded()\"\n [attr.inert]=\"expanded() ? null : ''\">\n <div class=\"body-inner\">\n <div class=\"body-content\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n","import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n contentChildren,\n forwardRef,\n input,\n} from '@angular/core';\nimport {\n ACCORDION,\n type AccordionContract,\n type AccordionItemRef,\n} from './accordion.token';\nimport { AccordionItemComponent } from './accordion-item.component';\n\n@Component({\n selector: 'ds-accordion',\n standalone: true,\n imports: [],\n template: `<ng-content></ng-content>`,\n styles: [\n `\n :host {\n display: block;\n border: var(--border-width-default) solid var(--border-divider);\n border-radius: var(--radius-lg);\n overflow: hidden;\n }\n `,\n ],\n encapsulation: ViewEncapsulation.Emulated,\n providers: [\n {\n provide: ACCORDION,\n useExisting: forwardRef(() => AccordionComponent),\n },\n ],\n})\nexport class AccordionComponent implements AccordionContract {\n /** When false, opening one item automatically closes all others. */\n readonly multi = input(true, { transform: booleanAttribute });\n\n private readonly items = contentChildren(AccordionItemComponent);\n\n notifyOpen(opened: AccordionItemRef): void {\n if (this.multi()) {\n return;\n }\n for (const item of this.items() as unknown as AccordionItemRef[]) {\n if (item !== opened) {\n item.closeItem();\n }\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAea,SAAS,GAAG,IAAI,cAAc,CAAoB,WAAW;;ACH1E,IAAI,MAAM,GAAG,CAAC;MAaD,sBAAsB,CAAA;;AAExB,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,2EAAU;;AAEhC,IAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,+EAAC;;IAEhC,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAE9C,IAAA,GAAG,GAAG,CAAA,aAAA,EAAgB,EAAE,MAAM,EAAE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AAsB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC1CjE;;AAEG;;;;"}
|
|
@@ -49,11 +49,11 @@ class AlertComponent {
|
|
|
49
49
|
this.closed.emit();
|
|
50
50
|
}
|
|
51
51
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: AlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
52
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: AlertComponent, isStandalone: true, selector: "ds-alert", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, announce: { classPropertyName: "announce", publicName: "announce", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, host: { properties: { "attr.role": "this.ariaRole", "attr.aria-live": "this.ariaLive" } }, ngImport: i0, template: "<div [class]=\"classes()\">\n <ds-icon\n class=\"a-icon\"\n [name]=\"resolvedIcon()\"\n [size]=\"16\">\n </ds-icon>\n\n <div class=\"a-body\">\n @if (title()) {\n <div class=\"a-title\">\n {{ title() }}\n </div>\n }\n\n <div class=\"a-msg\">\n <ng-content />\n </div>\n\n <div class=\"a-actions\">\n <ng-content select=\"[actions]\" />\n </div>\n </div>\n\n @if (dismissible()) {\n <button\n class=\"a-close\"\n type=\"button\"\n aria-label=\"Dismiss\"\n (click)=\"onDismiss()\">\n <ds-icon\n name=\"x\"\n [size]=\"14\">\n </ds-icon>\n </button>\n }\n</div>\n", styles: [":host{display:inline-flex}.alert{--_alert-bg-color: var(--ds-alert-bg-color, var(--info-subtitle));--_alert-text-color: var(--ds-alert-text-color, var(--info-text));--_alert-title-text-color: var(--ds-alert-title-text-color, var(--text-primary));--_alert-close-icon-color: var(--ds-alert-close-icon-color, var(--icon-default));--_alert-close-icon-color-hover: var(--ds-alert-close-icon-color-hover, var(--icon-strong));--_alert-pad-y: var(--ds-alert-pad-y, var(--space-2));--_alert-pad-x: var(--ds-alert-pad-x, var(--space-3));--_alert-radius: var(--ds-alert-radius, var(--ds-radius-control));--_alert-enter-keyframes: var(--ds-alert-enter-keyframes, ds-
|
|
52
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: AlertComponent, isStandalone: true, selector: "ds-alert", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, announce: { classPropertyName: "announce", publicName: "announce", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, host: { properties: { "attr.title": "null", "attr.role": "this.ariaRole", "attr.aria-live": "this.ariaLive" } }, ngImport: i0, template: "<div [class]=\"classes()\">\n <ds-icon\n class=\"a-icon\"\n [name]=\"resolvedIcon()\"\n [size]=\"16\">\n </ds-icon>\n\n <div class=\"a-body\">\n @if (title()) {\n <div class=\"a-title\">\n {{ title() }}\n </div>\n }\n\n <div class=\"a-msg\">\n <ng-content />\n </div>\n\n <div class=\"a-actions\">\n <ng-content select=\"[actions]\" />\n </div>\n </div>\n\n @if (dismissible()) {\n <button\n class=\"a-close\"\n type=\"button\"\n aria-label=\"Dismiss\"\n (click)=\"onDismiss()\">\n <ds-icon\n name=\"x\"\n [size]=\"14\">\n </ds-icon>\n </button>\n }\n</div>\n", styles: [":host{display:inline-flex}.alert{--_alert-bg-color: var(--ds-alert-bg-color, var(--info-subtitle));--_alert-text-color: var(--ds-alert-text-color, var(--info-text));--_alert-title-text-color: var(--ds-alert-title-text-color, var(--text-primary));--_alert-close-icon-color: var(--ds-alert-close-icon-color, var(--icon-default));--_alert-close-icon-color-hover: var(--ds-alert-close-icon-color-hover, var(--icon-strong));--_alert-pad-y: var(--ds-alert-pad-y, var(--space-2));--_alert-pad-x: var(--ds-alert-pad-x, var(--space-3));--_alert-radius: var(--ds-alert-radius, var(--ds-radius-control));--_alert-enter-keyframes: var(--ds-alert-enter-keyframes, ds-fade-in);--_alert-enter-duration: var(--ds-alert-enter-duration, var(--ds-motion-enter-surface-duration));--_alert-enter-easing: var(--ds-alert-enter-easing, var(--ds-motion-enter-surface-easing));--_alert-enter-offset: var(--ds-alert-enter-offset, 2px);--_ds-enter-y: calc(-1 * var(--_alert-enter-offset));--_ds-enter-scale: var(--ds-alert-enter-scale, .96);display:inline-flex;align-items:flex-start;gap:var(--space-2);padding:var(--_alert-pad-y) var(--_alert-pad-x);border-radius:var(--_alert-radius);background-color:var(--_alert-bg-color);color:var(--_alert-text-color);animation-name:var(--_alert-enter-keyframes);animation-duration:var(--_alert-enter-duration);animation-timing-function:var(--_alert-enter-easing)}@media(prefers-reduced-motion:reduce){.alert{--_alert-enter-duration: 0ms}}.alert.success{--_alert-bg-color: var(--ds-alert-bg-color, var(--success-subtitle));--_alert-text-color: var(--ds-alert-text-color, var(--success-text))}.alert.warning{--_alert-bg-color: var(--ds-alert-bg-color, var(--warning-subtitle));--_alert-text-color: var(--ds-alert-text-color, var(--warning-text))}.alert.error{--_alert-bg-color: var(--ds-alert-bg-color, var(--error-subtitle));--_alert-text-color: var(--ds-alert-text-color, var(--error-text))}.alert.neutral{--_alert-bg-color: var(--ds-alert-bg-color, var(--surface-secondary));--_alert-text-color: var(--ds-alert-text-color, var(--text-secondary))}.alert .a-icon{flex-shrink:0;color:inherit;align-self:center}.alert .a-body{flex:1;min-width:0}.alert .a-title{font:var(--font-weight-bold) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_alert-title-text-color);margin:0 0 var(--space-1)}.alert .a-actions{display:flex;gap:var(--space-2);margin-top:var(--space-2)}.alert .a-actions:empty{display:none}.alert .a-close{background:none;border:0;cursor:pointer;padding:0;color:var(--_alert-close-icon-color);flex-shrink:0}.alert .a-close:hover{color:var(--_alert-close-icon-color-hover)}.alert .a-close:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
53
53
|
}
|
|
54
54
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: AlertComponent, decorators: [{
|
|
55
55
|
type: Component,
|
|
56
|
-
args: [{ selector: 'ds-alert', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, template: "<div [class]=\"classes()\">\n <ds-icon\n class=\"a-icon\"\n [name]=\"resolvedIcon()\"\n [size]=\"16\">\n </ds-icon>\n\n <div class=\"a-body\">\n @if (title()) {\n <div class=\"a-title\">\n {{ title() }}\n </div>\n }\n\n <div class=\"a-msg\">\n <ng-content />\n </div>\n\n <div class=\"a-actions\">\n <ng-content select=\"[actions]\" />\n </div>\n </div>\n\n @if (dismissible()) {\n <button\n class=\"a-close\"\n type=\"button\"\n aria-label=\"Dismiss\"\n (click)=\"onDismiss()\">\n <ds-icon\n name=\"x\"\n [size]=\"14\">\n </ds-icon>\n </button>\n }\n</div>\n", styles: [":host{display:inline-flex}.alert{--_alert-bg-color: var(--ds-alert-bg-color, var(--info-subtitle));--_alert-text-color: var(--ds-alert-text-color, var(--info-text));--_alert-title-text-color: var(--ds-alert-title-text-color, var(--text-primary));--_alert-close-icon-color: var(--ds-alert-close-icon-color, var(--icon-default));--_alert-close-icon-color-hover: var(--ds-alert-close-icon-color-hover, var(--icon-strong));--_alert-pad-y: var(--ds-alert-pad-y, var(--space-2));--_alert-pad-x: var(--ds-alert-pad-x, var(--space-3));--_alert-radius: var(--ds-alert-radius, var(--ds-radius-control));--_alert-enter-keyframes: var(--ds-alert-enter-keyframes, ds-
|
|
56
|
+
args: [{ selector: 'ds-alert', standalone: true, imports: [IconComponent], host: { '[attr.title]': 'null' }, encapsulation: ViewEncapsulation.Emulated, template: "<div [class]=\"classes()\">\n <ds-icon\n class=\"a-icon\"\n [name]=\"resolvedIcon()\"\n [size]=\"16\">\n </ds-icon>\n\n <div class=\"a-body\">\n @if (title()) {\n <div class=\"a-title\">\n {{ title() }}\n </div>\n }\n\n <div class=\"a-msg\">\n <ng-content />\n </div>\n\n <div class=\"a-actions\">\n <ng-content select=\"[actions]\" />\n </div>\n </div>\n\n @if (dismissible()) {\n <button\n class=\"a-close\"\n type=\"button\"\n aria-label=\"Dismiss\"\n (click)=\"onDismiss()\">\n <ds-icon\n name=\"x\"\n [size]=\"14\">\n </ds-icon>\n </button>\n }\n</div>\n", styles: [":host{display:inline-flex}.alert{--_alert-bg-color: var(--ds-alert-bg-color, var(--info-subtitle));--_alert-text-color: var(--ds-alert-text-color, var(--info-text));--_alert-title-text-color: var(--ds-alert-title-text-color, var(--text-primary));--_alert-close-icon-color: var(--ds-alert-close-icon-color, var(--icon-default));--_alert-close-icon-color-hover: var(--ds-alert-close-icon-color-hover, var(--icon-strong));--_alert-pad-y: var(--ds-alert-pad-y, var(--space-2));--_alert-pad-x: var(--ds-alert-pad-x, var(--space-3));--_alert-radius: var(--ds-alert-radius, var(--ds-radius-control));--_alert-enter-keyframes: var(--ds-alert-enter-keyframes, ds-fade-in);--_alert-enter-duration: var(--ds-alert-enter-duration, var(--ds-motion-enter-surface-duration));--_alert-enter-easing: var(--ds-alert-enter-easing, var(--ds-motion-enter-surface-easing));--_alert-enter-offset: var(--ds-alert-enter-offset, 2px);--_ds-enter-y: calc(-1 * var(--_alert-enter-offset));--_ds-enter-scale: var(--ds-alert-enter-scale, .96);display:inline-flex;align-items:flex-start;gap:var(--space-2);padding:var(--_alert-pad-y) var(--_alert-pad-x);border-radius:var(--_alert-radius);background-color:var(--_alert-bg-color);color:var(--_alert-text-color);animation-name:var(--_alert-enter-keyframes);animation-duration:var(--_alert-enter-duration);animation-timing-function:var(--_alert-enter-easing)}@media(prefers-reduced-motion:reduce){.alert{--_alert-enter-duration: 0ms}}.alert.success{--_alert-bg-color: var(--ds-alert-bg-color, var(--success-subtitle));--_alert-text-color: var(--ds-alert-text-color, var(--success-text))}.alert.warning{--_alert-bg-color: var(--ds-alert-bg-color, var(--warning-subtitle));--_alert-text-color: var(--ds-alert-text-color, var(--warning-text))}.alert.error{--_alert-bg-color: var(--ds-alert-bg-color, var(--error-subtitle));--_alert-text-color: var(--ds-alert-text-color, var(--error-text))}.alert.neutral{--_alert-bg-color: var(--ds-alert-bg-color, var(--surface-secondary));--_alert-text-color: var(--ds-alert-text-color, var(--text-secondary))}.alert .a-icon{flex-shrink:0;color:inherit;align-self:center}.alert .a-body{flex:1;min-width:0}.alert .a-title{font:var(--font-weight-bold) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_alert-title-text-color);margin:0 0 var(--space-1)}.alert .a-actions{display:flex;gap:var(--space-2);margin-top:var(--space-2)}.alert .a-actions:empty{display:none}.alert .a-close{background:none;border:0;cursor:pointer;padding:0;color:var(--_alert-close-icon-color);flex-shrink:0}.alert .a-close:hover{color:var(--_alert-close-icon-color-hover)}.alert .a-close:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}\n"] }]
|
|
57
57
|
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], dismissible: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissible", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }], announce: [{ type: i0.Input, args: [{ isSignal: true, alias: "announce", required: false }] }], ariaRole: [{
|
|
58
58
|
type: HostBinding,
|
|
59
59
|
args: ['attr.role']
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-alert.mjs","sources":["../../../src/lib/components/alert/alert.component.ts","../../../src/lib/components/alert/alert.component.html","../../../src/lib/components/alert/ids-group-ltd-ids-design-system-components-alert.ts"],"sourcesContent":["import {\n Component,\n HostBinding,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n input,\n output,\n} from '@angular/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport type { IconName } from '@ids-group-ltd/ids-design-system/core';\nimport type { AlertVariant } from './alert.types';\n\n@Component({\n selector: 'ds-alert',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './alert.component.html',\n styleUrl: './alert.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class AlertComponent {\n /** Severity — drives colour, the default icon and the ARIA role/live. */\n readonly variant = input<AlertVariant>('info');\n /** Optional bold heading above the message. */\n readonly title = input<string>('');\n /** Show a close button that emits `closed`. */\n readonly dismissible = input(false, { transform: booleanAttribute });\n /** Override the variant's default icon. */\n readonly icon = input<IconName | null>(null);\n /** Fires when the user dismisses the alert. */\n readonly closed = output<void>();\n\n /** Announce this alert to a screen reader when it appears. Off by default — see\n * `ds-banner`'s `announce` for why, and prefer `ToastService` for anything\n * transient. */\n readonly announce = input(false, { transform: booleanAttribute });\n\n @HostBinding('attr.role')\n protected get ariaRole(): 'alert' | 'status' | null {\n if (!this.announce()) {\n return null;\n }\n const value = this.variant();\n\n return value === 'error' || value === 'warning' ? 'alert' : 'status';\n }\n\n @HostBinding('attr.aria-live')\n protected get ariaLive(): 'assertive' | 'polite' | null {\n if (!this.announce()) {\n return null;\n }\n\n return this.ariaRole === 'alert' ? 'assertive' : 'polite';\n }\n\n protected readonly classes = computed(() => `alert ${this.variant()}`);\n\n protected readonly defaultIcon = computed<IconName>(() => {\n const variant = this.variant();\n if (variant === 'success') {\n return 'success';\n }\n if (variant === 'warning') {\n return 'warn';\n }\n if (variant === 'error') {\n return 'error';\n }\n\n return 'info';\n });\n\n protected readonly resolvedIcon = computed<IconName>(\n () => this.icon() ?? this.defaultIcon(),\n );\n\n protected onDismiss(): void {\n this.closed.emit();\n }\n}\n","<div [class]=\"classes()\">\n <ds-icon\n class=\"a-icon\"\n [name]=\"resolvedIcon()\"\n [size]=\"16\">\n </ds-icon>\n\n <div class=\"a-body\">\n @if (title()) {\n <div class=\"a-title\">\n {{ title() }}\n </div>\n }\n\n <div class=\"a-msg\">\n <ng-content />\n </div>\n\n <div class=\"a-actions\">\n <ng-content select=\"[actions]\" />\n </div>\n </div>\n\n @if (dismissible()) {\n <button\n class=\"a-close\"\n type=\"button\"\n aria-label=\"Dismiss\"\n (click)=\"onDismiss()\">\n <ds-icon\n name=\"x\"\n [size]=\"14\">\n </ds-icon>\n </button>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-alert.mjs","sources":["../../../src/lib/components/alert/alert.component.ts","../../../src/lib/components/alert/alert.component.html","../../../src/lib/components/alert/ids-group-ltd-ids-design-system-components-alert.ts"],"sourcesContent":["import {\n Component,\n HostBinding,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n input,\n output,\n} from '@angular/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport type { IconName } from '@ids-group-ltd/ids-design-system/core';\nimport type { AlertVariant } from './alert.types';\n\n@Component({\n selector: 'ds-alert',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './alert.component.html',\n styleUrl: './alert.component.scss',\n // A static `title=\"…\"` feeding the input below ALSO stays in the DOM as the global attribute,\n // which makes the host a native browser tooltip over everything inside it.\n host: { '[attr.title]': 'null' },\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class AlertComponent {\n /** Severity — drives colour, the default icon and the ARIA role/live. */\n readonly variant = input<AlertVariant>('info');\n /** Optional bold heading above the message. */\n readonly title = input<string>('');\n /** Show a close button that emits `closed`. */\n readonly dismissible = input(false, { transform: booleanAttribute });\n /** Override the variant's default icon. */\n readonly icon = input<IconName | null>(null);\n /** Fires when the user dismisses the alert. */\n readonly closed = output<void>();\n\n /** Announce this alert to a screen reader when it appears. Off by default — see\n * `ds-banner`'s `announce` for why, and prefer `ToastService` for anything\n * transient. */\n readonly announce = input(false, { transform: booleanAttribute });\n\n @HostBinding('attr.role')\n protected get ariaRole(): 'alert' | 'status' | null {\n if (!this.announce()) {\n return null;\n }\n const value = this.variant();\n\n return value === 'error' || value === 'warning' ? 'alert' : 'status';\n }\n\n @HostBinding('attr.aria-live')\n protected get ariaLive(): 'assertive' | 'polite' | null {\n if (!this.announce()) {\n return null;\n }\n\n return this.ariaRole === 'alert' ? 'assertive' : 'polite';\n }\n\n protected readonly classes = computed(() => `alert ${this.variant()}`);\n\n protected readonly defaultIcon = computed<IconName>(() => {\n const variant = this.variant();\n if (variant === 'success') {\n return 'success';\n }\n if (variant === 'warning') {\n return 'warn';\n }\n if (variant === 'error') {\n return 'error';\n }\n\n return 'info';\n });\n\n protected readonly resolvedIcon = computed<IconName>(\n () => this.icon() ?? this.defaultIcon(),\n );\n\n protected onDismiss(): void {\n this.closed.emit();\n }\n}\n","<div [class]=\"classes()\">\n <ds-icon\n class=\"a-icon\"\n [name]=\"resolvedIcon()\"\n [size]=\"16\">\n </ds-icon>\n\n <div class=\"a-body\">\n @if (title()) {\n <div class=\"a-title\">\n {{ title() }}\n </div>\n }\n\n <div class=\"a-msg\">\n <ng-content />\n </div>\n\n <div class=\"a-actions\">\n <ng-content select=\"[actions]\" />\n </div>\n </div>\n\n @if (dismissible()) {\n <button\n class=\"a-close\"\n type=\"button\"\n aria-label=\"Dismiss\"\n (click)=\"onDismiss()\">\n <ds-icon\n name=\"x\"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