@ids-group-ltd/ids-design-system 0.13.2 → 0.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +265 -0
- package/components.md +12 -16
- package/docs/agent/INDEX.md +1 -2
- package/docs/agent/charts/ds-column-chart.md +3 -2
- package/docs/agent/feedback/ds-bar.md +13 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs +9 -10
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs +95 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs +70 -41
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs +973 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs +141 -120
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs +42 -11
- package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs +16 -7
- 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 +14 -83
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.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.mjs +163 -21
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.13.3.json +211 -0
- package/package.json +17 -17
- package/styles/_chart-frame.scss +16 -6
- package/styles/_tokens-charts.scss +29 -5
- package/styles/_tokens.scss +1 -1
- package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +2 -1
- package/types/ids-group-ltd-ids-design-system-components-bar.d.ts +63 -0
- package/types/ids-group-ltd-ids-design-system-components-button.d.ts +2 -2
- package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +7 -4
- package/types/ids-group-ltd-ids-design-system-components-chart.d.ts +543 -0
- package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +95 -38
- package/types/ids-group-ltd-ids-design-system-components-donut-chart.d.ts +15 -2
- package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +6 -1
- package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +8 -18
- package/types/ids-group-ltd-ids-design-system-components.d.ts +58 -9
- package/types/ids-group-ltd-ids-design-system-core.d.ts +55 -4
- package/types/ids-group-ltd-ids-design-system.d.ts +4 -4
- package/docs/agent/feedback/ds-meter.md +0 -11
- package/docs/agent/feedback/ds-progress.md +0 -10
- package/fesm2022/ids-group-ltd-ids-design-system-components-meter.mjs +0 -61
- package/fesm2022/ids-group-ltd-ids-design-system-components-meter.mjs.map +0 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs +0 -65
- package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs.map +0 -1
- package/types/ids-group-ltd-ids-design-system-components-meter.d.ts +0 -36
- package/types/ids-group-ltd-ids-design-system-components-progress.d.ts +0 -40
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<!-- GENERATED by tools/split-agent-catalogue.mjs from components.md. Do not edit. -->
|
|
2
|
-
# `<ds-progress>` — `ProgressComponent`
|
|
3
|
-
|
|
4
|
-
Group: Display & feedback
|
|
5
|
-
|
|
6
|
-
Linear progress bar (no circular variant).
|
|
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`.
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, numberAttribute, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* One track and one fill, for a measurement inside a table cell.
|
|
6
|
-
*
|
|
7
|
-
* A chart is a block with a caption, a legend and an annex table; in a 60px cell that chrome is
|
|
8
|
-
* the whole cell. This is the mark on its own — no caption, no legend, no tooltip, no table.
|
|
9
|
-
*
|
|
10
|
-
* It is NOT `ds-progress`, which reports how far a task has got and says so with
|
|
11
|
-
* `role="progressbar"`. A rate, a score or a count against a ceiling is a measurement: it has no
|
|
12
|
-
* beginning and no completion, and a table of two hundred of them would announce two hundred
|
|
13
|
-
* progress bars. Here the mark is hidden from assistive technology unless `ariaLabel` names it,
|
|
14
|
-
* because the cell beside it almost always prints the number already.
|
|
15
|
-
*/
|
|
16
|
-
class MeterComponent {
|
|
17
|
-
/** The measurement, in units of `max`. Clamped to the track. */
|
|
18
|
-
value = input(0, { ...(ngDevMode ? { debugName: "value" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
19
|
-
/** The ceiling `value` is read against — the column's own largest, or the scale the number
|
|
20
|
-
* means something on. Left at 100, `value` is a percentage. Zero or less falls back to 100,
|
|
21
|
-
* because a scale with no width has no fraction to draw. */
|
|
22
|
-
max = input(100, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
23
|
-
/** The fill's colour. Unset takes `--ds-meter-fill-color`, so a column is coloured once in a
|
|
24
|
-
* stylesheet rather than per row; set it per row where the colour carries meaning. */
|
|
25
|
-
color = input(null, ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
26
|
-
/** Names the measurement, and is what decides whether it is announced at all. Unset, the mark
|
|
27
|
-
* is `aria-hidden` — right where the cell prints the figure beside it, and wrong where the bar
|
|
28
|
-
* is the only place the number appears. */
|
|
29
|
-
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
30
|
-
scale = computed(() => {
|
|
31
|
-
const max = this.max();
|
|
32
|
-
return Number.isFinite(max) && max > 0 ? max : 100;
|
|
33
|
-
}, ...(ngDevMode ? [{ debugName: "scale" }] : /* istanbul ignore next */ []));
|
|
34
|
-
clamped = computed(() => {
|
|
35
|
-
const value = this.value();
|
|
36
|
-
return Number.isFinite(value)
|
|
37
|
-
? Math.max(0, Math.min(this.scale(), value))
|
|
38
|
-
: 0;
|
|
39
|
-
}, ...(ngDevMode ? [{ debugName: "clamped" }] : /* istanbul ignore next */ []));
|
|
40
|
-
percent = computed(() => (this.clamped() / this.scale()) * 100, ...(ngDevMode ? [{ debugName: "percent" }] : /* istanbul ignore next */ []));
|
|
41
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: MeterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
42
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.22", type: MeterComponent, isStandalone: true, selector: "ds-meter", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.role": "ariaLabel() ? 'meter' : null", "attr.aria-hidden": "ariaLabel() ? null : true", "attr.aria-valuemin": "ariaLabel() ? 0 : null", "attr.aria-valuemax": "ariaLabel() ? scale() : null", "attr.aria-valuenow": "ariaLabel() ? clamped() : null", "attr.aria-label": "ariaLabel()" } }, ngImport: i0, template: "<span\n class=\"fill\"\n [style.width.%]=\"percent()\"\n [style.background]=\"color()\">\n</span>\n", styles: [":host{--_meter-height: var(--ds-meter-height, 6px);--_meter-track-color: var(--ds-meter-track-color, var(--surface-muted));--_meter-radius: var(--ds-meter-radius, var(--radius-pill));display:block;inline-size:100%;min-inline-size:var(--ds-meter-min-width, 3rem);block-size:var(--_meter-height);border-radius:var(--_meter-radius);background:var(--_meter-track-color);overflow:hidden}.fill{display:block;block-size:100%;border-radius:inherit;background:var(--ds-meter-fill-color, var(--ds-chart-series-1-color));transition:inline-size var(--duration-base) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.fill{transition:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
43
|
-
}
|
|
44
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: MeterComponent, decorators: [{
|
|
45
|
-
type: Component,
|
|
46
|
-
args: [{ selector: 'ds-meter', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, host: {
|
|
47
|
-
'[attr.role]': "ariaLabel() ? 'meter' : null",
|
|
48
|
-
'[attr.aria-hidden]': 'ariaLabel() ? null : true',
|
|
49
|
-
'[attr.aria-valuemin]': 'ariaLabel() ? 0 : null',
|
|
50
|
-
'[attr.aria-valuemax]': 'ariaLabel() ? scale() : null',
|
|
51
|
-
'[attr.aria-valuenow]': 'ariaLabel() ? clamped() : null',
|
|
52
|
-
'[attr.aria-label]': 'ariaLabel()',
|
|
53
|
-
}, template: "<span\n class=\"fill\"\n [style.width.%]=\"percent()\"\n [style.background]=\"color()\">\n</span>\n", styles: [":host{--_meter-height: var(--ds-meter-height, 6px);--_meter-track-color: var(--ds-meter-track-color, var(--surface-muted));--_meter-radius: var(--ds-meter-radius, var(--radius-pill));display:block;inline-size:100%;min-inline-size:var(--ds-meter-min-width, 3rem);block-size:var(--_meter-height);border-radius:var(--_meter-radius);background:var(--_meter-track-color);overflow:hidden}.fill{display:block;block-size:100%;border-radius:inherit;background:var(--ds-meter-fill-color, var(--ds-chart-series-1-color));transition:inline-size var(--duration-base) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.fill{transition:none}}\n"] }]
|
|
54
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Generated bundle index. Do not edit.
|
|
58
|
-
*/
|
|
59
|
-
|
|
60
|
-
export { MeterComponent };
|
|
61
|
-
//# sourceMappingURL=ids-group-ltd-ids-design-system-components-meter.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-meter.mjs","sources":["../../../src/lib/components/meter/meter.component.ts","../../../src/lib/components/meter/meter.component.html","../../../src/lib/components/meter/ids-group-ltd-ids-design-system-components-meter.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n input,\n numberAttribute,\n} from '@angular/core';\n\n/**\n * One track and one fill, for a measurement inside a table cell.\n *\n * A chart is a block with a caption, a legend and an annex table; in a 60px cell that chrome is\n * the whole cell. This is the mark on its own — no caption, no legend, no tooltip, no table.\n *\n * It is NOT `ds-progress`, which reports how far a task has got and says so with\n * `role=\"progressbar\"`. A rate, a score or a count against a ceiling is a measurement: it has no\n * beginning and no completion, and a table of two hundred of them would announce two hundred\n * progress bars. Here the mark is hidden from assistive technology unless `ariaLabel` names it,\n * because the cell beside it almost always prints the number already.\n */\n@Component({\n selector: 'ds-meter',\n standalone: true,\n imports: [],\n templateUrl: './meter.component.html',\n styleUrl: './meter.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n '[attr.role]': \"ariaLabel() ? 'meter' : null\",\n '[attr.aria-hidden]': 'ariaLabel() ? null : true',\n '[attr.aria-valuemin]': 'ariaLabel() ? 0 : null',\n '[attr.aria-valuemax]': 'ariaLabel() ? scale() : null',\n '[attr.aria-valuenow]': 'ariaLabel() ? clamped() : null',\n '[attr.aria-label]': 'ariaLabel()',\n },\n})\nexport class MeterComponent {\n /** The measurement, in units of `max`. Clamped to the track. */\n readonly value = input(0, { transform: numberAttribute });\n /** The ceiling `value` is read against — the column's own largest, or the scale the number\n * means something on. Left at 100, `value` is a percentage. Zero or less falls back to 100,\n * because a scale with no width has no fraction to draw. */\n readonly max = input(100, { transform: numberAttribute });\n /** The fill's colour. Unset takes `--ds-meter-fill-color`, so a column is coloured once in a\n * stylesheet rather than per row; set it per row where the colour carries meaning. */\n readonly color = input<string | null>(null);\n /** Names the measurement, and is what decides whether it is announced at all. Unset, the mark\n * is `aria-hidden` — right where the cell prints the figure beside it, and wrong where the bar\n * is the only place the number appears. */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly scale = computed(() => {\n const max = this.max();\n\n return Number.isFinite(max) && max > 0 ? max : 100;\n });\n\n protected readonly clamped = computed(() => {\n const value = this.value();\n\n return Number.isFinite(value)\n ? Math.max(0, Math.min(this.scale(), value))\n : 0;\n });\n\n protected readonly percent = computed(\n () => (this.clamped() / this.scale()) * 100,\n );\n}\n","<span\n class=\"fill\"\n [style.width.%]=\"percent()\"\n [style.background]=\"color()\">\n</span>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AASA;;;;;;;;;;;AAWG;MAkBU,cAAc,CAAA;;IAEhB,KAAK,GAAG,KAAK,CAAC,CAAC,6EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;AACzD;;AAE6D;IACpD,GAAG,GAAG,KAAK,CAAC,GAAG,2EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;AACzD;AACuF;AAC9E,IAAA,KAAK,GAAG,KAAK,CAAgB,IAAI,4EAAC;AAC3C;;AAE4C;AACnC,IAAA,SAAS,GAAG,KAAK,CAAgB,IAAI,gFAAC;AAE5B,IAAA,KAAK,GAAG,QAAQ,CAAC,MAAK;AACvC,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE;AAEtB,QAAA,OAAO,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG;AACpD,IAAA,CAAC,4EAAC;AAEiB,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;AACzC,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;AAE1B,QAAA,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK;AAC1B,cAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GA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
|
3
|
-
|
|
4
|
-
class ProgressComponent {
|
|
5
|
-
/** Progress in units of `max`, so 0–100 by default; clamped, and ignored while
|
|
6
|
-
* `indeterminate`. */
|
|
7
|
-
value = input(0, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
8
|
-
/** The full scale `value` and `target` are read against. Left at 100 they are percentages, which
|
|
9
|
-
* is why nothing existing changes. Set it to the real total — `[value]="37" [max]="80"` — and
|
|
10
|
-
* the accessible name carries "37 of 80" rather than the 46% a caller would otherwise have to
|
|
11
|
-
* compute and a screen reader would read instead. Zero or less falls back to 100, because a
|
|
12
|
-
* scale with no width has no fraction to draw. */
|
|
13
|
-
max = input(100, ...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
14
|
-
/** Colour variant — drives the success/warning/error styling. */
|
|
15
|
-
variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
16
|
-
/** Indeterminate (unknown-duration) animation instead of a fixed `value`. */
|
|
17
|
-
indeterminate = input(false, { ...(ngDevMode ? { debugName: "indeterminate" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
18
|
-
/** Accessible name for the progress bar (e.g. "Upload progress"). With a `target` set, name the
|
|
19
|
-
* comparison here — the mark is drawn, and `role="progressbar"` has no second value to announce,
|
|
20
|
-
* so "Resolved 62% against a 75% target" is what reaches a screen reader. */
|
|
21
|
-
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
22
|
-
/** A second point on the same scale as `value`, drawn as a hairline across the track — a goal or
|
|
23
|
-
* a baseline to read `value` against. Clamped like `value`, ignored while `indeterminate`, and
|
|
24
|
-
* unset draws nothing. */
|
|
25
|
-
target = input(null, ...(ngDevMode ? [{ debugName: "target" }] : /* istanbul ignore next */ []));
|
|
26
|
-
scale = computed(() => {
|
|
27
|
-
const max = this.max();
|
|
28
|
-
return max > 0 ? max : 100;
|
|
29
|
-
}, ...(ngDevMode ? [{ debugName: "scale" }] : /* istanbul ignore next */ []));
|
|
30
|
-
clampedValue = computed(() => Math.max(0, Math.min(this.scale(), this.value())), ...(ngDevMode ? [{ debugName: "clampedValue" }] : /* istanbul ignore next */ []));
|
|
31
|
-
/** Width and offset are percentages of the track whatever the scale is. */
|
|
32
|
-
valuePercent = computed(() => (this.clampedValue() / this.scale()) * 100, ...(ngDevMode ? [{ debugName: "valuePercent" }] : /* istanbul ignore next */ []));
|
|
33
|
-
clampedTarget = computed(() => {
|
|
34
|
-
const target = this.target();
|
|
35
|
-
return target == null ? null : Math.max(0, Math.min(this.scale(), target));
|
|
36
|
-
}, ...(ngDevMode ? [{ debugName: "clampedTarget" }] : /* istanbul ignore next */ []));
|
|
37
|
-
targetPercent = computed(() => {
|
|
38
|
-
const target = this.clampedTarget();
|
|
39
|
-
return target == null ? null : (target / this.scale()) * 100;
|
|
40
|
-
}, ...(ngDevMode ? [{ debugName: "targetPercent" }] : /* istanbul ignore next */ []));
|
|
41
|
-
isIndet = computed(() => this.indeterminate(), ...(ngDevMode ? [{ debugName: "isIndet" }] : /* istanbul ignore next */ []));
|
|
42
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ProgressComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
43
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ProgressComponent, isStandalone: true, selector: "ds-progress", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "progressbar", "aria-valuemin": "0" }, properties: { "attr.aria-valuemax": "scale()", "attr.aria-valuenow": "isIndet() ? null : clampedValue()", "attr.aria-label": "ariaLabel()", "class.success": "variant() === 'success'", "class.warning": "variant() === 'warning'", "class.error": "variant() === 'error'", "class.indeterminate": "isIndet()" } }, ngImport: i0, template: "@if (isIndet()) {\n <span></span>\n} @else {\n <span [style.width.%]=\"valuePercent()\"></span>\n\n @if (targetPercent() !== null) {\n <div\n class=\"target\"\n [style.left.%]=\"targetPercent()\">\n </div>\n }\n}\n", styles: ["@charset \"UTF-8\";:host{--_progress-height: var(--ds-progress-height, var(--progress-h));--_progress-track-color: var(--ds-progress-track-color, var(--surface-muted));--_progress-bar-color: var(--ds-progress-bar-color, var(--accent));--_progress-target-color: var(--ds-progress-target-color, var(--text-primary));--_progress-target-width: var(--ds-progress-target-width, 2px);display:block;position:relative;width:100%;height:var(--_progress-height);background:var(--_progress-track-color);border-radius:var(--radius-pill);overflow:hidden}:host>span{display:block;height:100%;background:var(--_progress-bar-color);border-radius:var(--radius-pill);transition:width var(--duration-base) var(--ease-standard)}:host>.target{position:absolute;top:0;height:100%;width:var(--_progress-target-width);transform:translate(-50%);background:var(--_progress-target-color);transition:left var(--duration-base) var(--ease-standard)}:host(.success){--_progress-bar-color-success: var(--ds-progress-bar-color-success, var(--success))}:host(.warning){--_progress-bar-color-warning: var(--ds-progress-bar-color-warning, var(--yellow-500))}:host(.error){--_progress-bar-color-error: var(--ds-progress-bar-color-error, var(--error))}:host(.success)>span{background:var(--_progress-bar-color-success)}:host(.warning)>span{background:var(--_progress-bar-color-warning)}:host(.error)>span{background:var(--_progress-bar-color-error)}:host(.indeterminate)>span{width:30%;animation:progress-indet var(--duration-loop-slow) var(--ease-standard) infinite}@keyframes progress-indet{0%{transform:translate(-100%)}to{transform:translate(400%)}}\n"] });
|
|
44
|
-
}
|
|
45
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ProgressComponent, decorators: [{
|
|
46
|
-
type: Component,
|
|
47
|
-
args: [{ selector: 'ds-progress', standalone: true, imports: [], encapsulation: ViewEncapsulation.Emulated, host: {
|
|
48
|
-
role: 'progressbar',
|
|
49
|
-
'aria-valuemin': '0',
|
|
50
|
-
'[attr.aria-valuemax]': 'scale()',
|
|
51
|
-
'[attr.aria-valuenow]': 'isIndet() ? null : clampedValue()',
|
|
52
|
-
'[attr.aria-label]': 'ariaLabel()',
|
|
53
|
-
'[class.success]': "variant() === 'success'",
|
|
54
|
-
'[class.warning]': "variant() === 'warning'",
|
|
55
|
-
'[class.error]': "variant() === 'error'",
|
|
56
|
-
'[class.indeterminate]': 'isIndet()',
|
|
57
|
-
}, template: "@if (isIndet()) {\n <span></span>\n} @else {\n <span [style.width.%]=\"valuePercent()\"></span>\n\n @if (targetPercent() !== null) {\n <div\n class=\"target\"\n [style.left.%]=\"targetPercent()\">\n </div>\n }\n}\n", styles: ["@charset \"UTF-8\";:host{--_progress-height: var(--ds-progress-height, var(--progress-h));--_progress-track-color: var(--ds-progress-track-color, var(--surface-muted));--_progress-bar-color: var(--ds-progress-bar-color, var(--accent));--_progress-target-color: var(--ds-progress-target-color, var(--text-primary));--_progress-target-width: var(--ds-progress-target-width, 2px);display:block;position:relative;width:100%;height:var(--_progress-height);background:var(--_progress-track-color);border-radius:var(--radius-pill);overflow:hidden}:host>span{display:block;height:100%;background:var(--_progress-bar-color);border-radius:var(--radius-pill);transition:width var(--duration-base) var(--ease-standard)}:host>.target{position:absolute;top:0;height:100%;width:var(--_progress-target-width);transform:translate(-50%);background:var(--_progress-target-color);transition:left var(--duration-base) var(--ease-standard)}:host(.success){--_progress-bar-color-success: var(--ds-progress-bar-color-success, var(--success))}:host(.warning){--_progress-bar-color-warning: var(--ds-progress-bar-color-warning, var(--yellow-500))}:host(.error){--_progress-bar-color-error: var(--ds-progress-bar-color-error, var(--error))}:host(.success)>span{background:var(--_progress-bar-color-success)}:host(.warning)>span{background:var(--_progress-bar-color-warning)}:host(.error)>span{background:var(--_progress-bar-color-error)}:host(.indeterminate)>span{width:30%;animation:progress-indet var(--duration-loop-slow) var(--ease-standard) infinite}@keyframes progress-indet{0%{transform:translate(-100%)}to{transform:translate(400%)}}\n"] }]
|
|
58
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], target: [{ type: i0.Input, args: [{ isSignal: true, alias: "target", required: false }] }] } });
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Generated bundle index. Do not edit.
|
|
62
|
-
*/
|
|
63
|
-
|
|
64
|
-
export { ProgressComponent };
|
|
65
|
-
//# sourceMappingURL=ids-group-ltd-ids-design-system-components-progress.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-progress.mjs","sources":["../../../src/lib/components/progress/progress.component.ts","../../../src/lib/components/progress/progress.component.html","../../../src/lib/components/progress/ids-group-ltd-ids-design-system-components-progress.ts"],"sourcesContent":["import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n input,\n} from '@angular/core';\nimport type { ProgressVariant } from './progress.types';\n\n@Component({\n selector: 'ds-progress',\n standalone: true,\n imports: [],\n templateUrl: './progress.component.html',\n styleUrl: './progress.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n role: 'progressbar',\n 'aria-valuemin': '0',\n '[attr.aria-valuemax]': 'scale()',\n '[attr.aria-valuenow]': 'isIndet() ? null : clampedValue()',\n '[attr.aria-label]': 'ariaLabel()',\n '[class.success]': \"variant() === 'success'\",\n '[class.warning]': \"variant() === 'warning'\",\n '[class.error]': \"variant() === 'error'\",\n '[class.indeterminate]': 'isIndet()',\n },\n})\nexport class ProgressComponent {\n /** Progress in units of `max`, so 0–100 by default; clamped, and ignored while\n * `indeterminate`. */\n readonly value = input<number>(0);\n /** The full scale `value` and `target` are read against. Left at 100 they are percentages, which\n * is why nothing existing changes. Set it to the real total — `[value]=\"37\" [max]=\"80\"` — and\n * the accessible name carries \"37 of 80\" rather than the 46% a caller would otherwise have to\n * compute and a screen reader would read instead. Zero or less falls back to 100, because a\n * scale with no width has no fraction to draw. */\n readonly max = input<number>(100);\n /** Colour variant — drives the success/warning/error styling. */\n readonly variant = input<ProgressVariant>('default');\n /** Indeterminate (unknown-duration) animation instead of a fixed `value`. */\n readonly indeterminate = input(false, { transform: booleanAttribute });\n /** Accessible name for the progress bar (e.g. \"Upload progress\"). With a `target` set, name the\n * comparison here — the mark is drawn, and `role=\"progressbar\"` has no second value to announce,\n * so \"Resolved 62% against a 75% target\" is what reaches a screen reader. */\n readonly ariaLabel = input<string | null>(null);\n /** A second point on the same scale as `value`, drawn as a hairline across the track — a goal or\n * a baseline to read `value` against. Clamped like `value`, ignored while `indeterminate`, and\n * unset draws nothing. */\n readonly target = input<number | null>(null);\n\n protected readonly scale = computed(() => {\n const max = this.max();\n\n return max > 0 ? max : 100;\n });\n\n protected readonly clampedValue = computed(() =>\n Math.max(0, Math.min(this.scale(), this.value())),\n );\n\n /** Width and offset are percentages of the track whatever the scale is. */\n protected readonly valuePercent = computed(\n () => (this.clampedValue() / this.scale()) * 100,\n );\n\n protected readonly clampedTarget = computed(() => {\n const target = this.target();\n\n return target == null ? null : Math.max(0, Math.min(this.scale(), target));\n });\n\n protected readonly targetPercent = computed(() => {\n const target = this.clampedTarget();\n\n return target == null ? null : (target / this.scale()) * 100;\n });\n\n protected readonly isIndet = computed(() => this.indeterminate());\n}\n","@if (isIndet()) {\n <span></span>\n} @else {\n <span [style.width.%]=\"valuePercent()\"></span>\n\n @if (targetPercent() !== null) {\n <div\n class=\"target\"\n [style.left.%]=\"targetPercent()\">\n </div>\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MA4Ba,iBAAiB,CAAA;AAC5B;AACuB;AACd,IAAA,KAAK,GAAG,KAAK,CAAS,CAAC,4EAAC;AACjC;;;;AAImD;AAC1C,IAAA,GAAG,GAAG,KAAK,CAAS,GAAG,0EAAC;;AAExB,IAAA,OAAO,GAAG,KAAK,CAAkB,SAAS,8EAAC;;IAE3C,aAAa,GAAG,KAAK,CAAC,KAAK,qFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AACtE;;AAE8E;AACrE,IAAA,SAAS,GAAG,KAAK,CAAgB,IAAI,gFAAC;AAC/C;;AAE2B;AAClB,IAAA,MAAM,GAAG,KAAK,CAAgB,IAAI,6EAAC;AAEzB,IAAA,KAAK,GAAG,QAAQ,CAAC,MAAK;AACvC,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE;QAEtB,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG;AAC5B,IAAA,CAAC,4EAAC;AAEiB,IAAA,YAAY,GAAG,QAAQ,CAAC,MACzC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,cAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAClD;;IAGkB,YAAY,GAAG,QAAQ,CACxC,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,IAAI,GAAG,mFACjD;AAEkB,IAAA,aAAa,GAAG,QAAQ,CAAC,MAAK;AAC/C,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,E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AE,yBAAyB;AAC5C,wBAAA,iBAAiB,EAAE,yBAAyB;AAC5C,wBAAA,eAAe,EAAE,uBAAuB;AACxC,wBAAA,uBAAuB,EAAE,WAAW;AACrC,qBAAA,EAAA,QAAA,EAAA,4OAAA,EAAA,MAAA,EAAA,CAAA,klDAAA,CAAA,EAAA;;;AE1BH;;AAEG;;;;"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as _angular_core from '@angular/core';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* One track and one fill, for a measurement inside a table cell.
|
|
5
|
-
*
|
|
6
|
-
* A chart is a block with a caption, a legend and an annex table; in a 60px cell that chrome is
|
|
7
|
-
* the whole cell. This is the mark on its own — no caption, no legend, no tooltip, no table.
|
|
8
|
-
*
|
|
9
|
-
* It is NOT `ds-progress`, which reports how far a task has got and says so with
|
|
10
|
-
* `role="progressbar"`. A rate, a score or a count against a ceiling is a measurement: it has no
|
|
11
|
-
* beginning and no completion, and a table of two hundred of them would announce two hundred
|
|
12
|
-
* progress bars. Here the mark is hidden from assistive technology unless `ariaLabel` names it,
|
|
13
|
-
* because the cell beside it almost always prints the number already.
|
|
14
|
-
*/
|
|
15
|
-
declare class MeterComponent {
|
|
16
|
-
/** The measurement, in units of `max`. Clamped to the track. */
|
|
17
|
-
readonly value: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
18
|
-
/** The ceiling `value` is read against — the column's own largest, or the scale the number
|
|
19
|
-
* means something on. Left at 100, `value` is a percentage. Zero or less falls back to 100,
|
|
20
|
-
* because a scale with no width has no fraction to draw. */
|
|
21
|
-
readonly max: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
22
|
-
/** The fill's colour. Unset takes `--ds-meter-fill-color`, so a column is coloured once in a
|
|
23
|
-
* stylesheet rather than per row; set it per row where the colour carries meaning. */
|
|
24
|
-
readonly color: _angular_core.InputSignal<string | null>;
|
|
25
|
-
/** Names the measurement, and is what decides whether it is announced at all. Unset, the mark
|
|
26
|
-
* is `aria-hidden` — right where the cell prints the figure beside it, and wrong where the bar
|
|
27
|
-
* is the only place the number appears. */
|
|
28
|
-
readonly ariaLabel: _angular_core.InputSignal<string | null>;
|
|
29
|
-
protected readonly scale: _angular_core.Signal<number>;
|
|
30
|
-
protected readonly clamped: _angular_core.Signal<number>;
|
|
31
|
-
protected readonly percent: _angular_core.Signal<number>;
|
|
32
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MeterComponent, never>;
|
|
33
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MeterComponent, "ds-meter", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export { MeterComponent };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { DsStatus } from '@ids-group-ltd/ids-design-system/core';
|
|
3
|
-
|
|
4
|
-
type ProgressVariant = 'default' | Exclude<DsStatus, 'info'>;
|
|
5
|
-
|
|
6
|
-
declare class ProgressComponent {
|
|
7
|
-
/** Progress in units of `max`, so 0–100 by default; clamped, and ignored while
|
|
8
|
-
* `indeterminate`. */
|
|
9
|
-
readonly value: _angular_core.InputSignal<number>;
|
|
10
|
-
/** The full scale `value` and `target` are read against. Left at 100 they are percentages, which
|
|
11
|
-
* is why nothing existing changes. Set it to the real total — `[value]="37" [max]="80"` — and
|
|
12
|
-
* the accessible name carries "37 of 80" rather than the 46% a caller would otherwise have to
|
|
13
|
-
* compute and a screen reader would read instead. Zero or less falls back to 100, because a
|
|
14
|
-
* scale with no width has no fraction to draw. */
|
|
15
|
-
readonly max: _angular_core.InputSignal<number>;
|
|
16
|
-
/** Colour variant — drives the success/warning/error styling. */
|
|
17
|
-
readonly variant: _angular_core.InputSignal<ProgressVariant>;
|
|
18
|
-
/** Indeterminate (unknown-duration) animation instead of a fixed `value`. */
|
|
19
|
-
readonly indeterminate: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
20
|
-
/** Accessible name for the progress bar (e.g. "Upload progress"). With a `target` set, name the
|
|
21
|
-
* comparison here — the mark is drawn, and `role="progressbar"` has no second value to announce,
|
|
22
|
-
* so "Resolved 62% against a 75% target" is what reaches a screen reader. */
|
|
23
|
-
readonly ariaLabel: _angular_core.InputSignal<string | null>;
|
|
24
|
-
/** A second point on the same scale as `value`, drawn as a hairline across the track — a goal or
|
|
25
|
-
* a baseline to read `value` against. Clamped like `value`, ignored while `indeterminate`, and
|
|
26
|
-
* unset draws nothing. */
|
|
27
|
-
readonly target: _angular_core.InputSignal<number | null>;
|
|
28
|
-
protected readonly scale: _angular_core.Signal<number>;
|
|
29
|
-
protected readonly clampedValue: _angular_core.Signal<number>;
|
|
30
|
-
/** Width and offset are percentages of the track whatever the scale is. */
|
|
31
|
-
protected readonly valuePercent: _angular_core.Signal<number>;
|
|
32
|
-
protected readonly clampedTarget: _angular_core.Signal<number | null>;
|
|
33
|
-
protected readonly targetPercent: _angular_core.Signal<number | null>;
|
|
34
|
-
protected readonly isIndet: _angular_core.Signal<boolean>;
|
|
35
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ProgressComponent, never>;
|
|
36
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ProgressComponent, "ds-progress", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "target": { "alias": "target"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export { ProgressComponent };
|
|
40
|
-
export type { ProgressVariant };
|