@cngx/ui 0.1.0-rc.7 → 0.1.0-rc.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/README.md +0 -1
  2. package/a11y/README.md +11 -5
  3. package/accordion/README.md +4 -2
  4. package/breadcrumb/README.md +262 -0
  5. package/collection/README.md +6 -0
  6. package/command-palette/README.md +224 -0
  7. package/data-grid-accordion/README.md +76 -2
  8. package/feedback/README.md +40 -0
  9. package/fesm2022/cngx-ui-a11y.mjs +189 -57
  10. package/fesm2022/cngx-ui-a11y.mjs.map +1 -1
  11. package/fesm2022/cngx-ui-accordion.mjs +102 -35
  12. package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
  13. package/fesm2022/cngx-ui-action-button.mjs +112 -50
  14. package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
  15. package/fesm2022/cngx-ui-breadcrumb.mjs +176 -96
  16. package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
  17. package/fesm2022/cngx-ui-chart-panel.mjs +180 -23
  18. package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -1
  19. package/fesm2022/cngx-ui-collection.mjs +194 -62
  20. package/fesm2022/cngx-ui-collection.mjs.map +1 -1
  21. package/fesm2022/cngx-ui-command-palette.mjs +395 -119
  22. package/fesm2022/cngx-ui-command-palette.mjs.map +1 -1
  23. package/fesm2022/cngx-ui-context-menu.mjs +149 -34
  24. package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
  25. package/fesm2022/cngx-ui-data-grid-accordion.mjs +415 -98
  26. package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
  27. package/fesm2022/cngx-ui-empty-state.mjs +16 -6
  28. package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
  29. package/fesm2022/cngx-ui-feedback.mjs +1022 -439
  30. package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
  31. package/fesm2022/cngx-ui-mat-accordion.mjs +75 -7
  32. package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
  33. package/fesm2022/cngx-ui-mat-paginator.mjs +67 -24
  34. package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
  35. package/fesm2022/cngx-ui-mat-stepper.mjs +72 -47
  36. package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
  37. package/fesm2022/cngx-ui-mat-tabs.mjs +314 -141
  38. package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
  39. package/fesm2022/cngx-ui-overlay.mjs +69 -13
  40. package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
  41. package/fesm2022/cngx-ui-paginator.mjs +487 -178
  42. package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
  43. package/fesm2022/cngx-ui-sidenav.mjs +327 -106
  44. package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
  45. package/fesm2022/cngx-ui-skeleton.mjs +4 -16
  46. package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
  47. package/fesm2022/cngx-ui-speak.mjs +107 -8
  48. package/fesm2022/cngx-ui-speak.mjs.map +1 -1
  49. package/fesm2022/cngx-ui-stat-card.mjs +146 -46
  50. package/fesm2022/cngx-ui-stat-card.mjs.map +1 -1
  51. package/fesm2022/cngx-ui-stepper.mjs +191 -68
  52. package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
  53. package/fesm2022/cngx-ui-tabs.mjs +10 -6
  54. package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
  55. package/fesm2022/cngx-ui-timeline.mjs +74 -21
  56. package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
  57. package/fesm2022/cngx-ui-toc.mjs +70 -26
  58. package/fesm2022/cngx-ui-toc.mjs.map +1 -1
  59. package/fesm2022/cngx-ui.mjs +15 -20
  60. package/fesm2022/cngx-ui.mjs.map +1 -1
  61. package/mat-paginator/README.md +9 -2
  62. package/mat-tabs/styles/mat-tabs.css +9 -10
  63. package/overlay/README.md +9 -4
  64. package/package.json +4 -4
  65. package/paginator/README.md +8 -4
  66. package/sidenav/README.md +33 -11
  67. package/speak/README.md +3 -2
  68. package/stepper/README.md +13 -1
  69. package/timeline/README.md +1 -1
  70. package/toc/README.md +4 -1
  71. package/types/cngx-ui-a11y.d.ts +121 -30
  72. package/types/cngx-ui-accordion.d.ts +91 -26
  73. package/types/cngx-ui-action-button.d.ts +44 -3
  74. package/types/cngx-ui-breadcrumb.d.ts +154 -58
  75. package/types/cngx-ui-chart-panel.d.ts +122 -18
  76. package/types/cngx-ui-collection.d.ts +147 -55
  77. package/types/cngx-ui-command-palette.d.ts +297 -183
  78. package/types/cngx-ui-context-menu.d.ts +98 -6
  79. package/types/cngx-ui-data-grid-accordion.d.ts +274 -38
  80. package/types/cngx-ui-empty-state.d.ts +9 -2
  81. package/types/cngx-ui-feedback.d.ts +594 -56
  82. package/types/cngx-ui-mat-accordion.d.ts +29 -1
  83. package/types/cngx-ui-mat-paginator.d.ts +37 -8
  84. package/types/cngx-ui-mat-stepper.d.ts +23 -11
  85. package/types/cngx-ui-mat-tabs.d.ts +207 -14
  86. package/types/cngx-ui-overlay.d.ts +56 -10
  87. package/types/cngx-ui-paginator.d.ts +403 -129
  88. package/types/cngx-ui-sidenav.d.ts +248 -74
  89. package/types/cngx-ui-skeleton.d.ts +6 -7
  90. package/types/cngx-ui-speak.d.ts +118 -5
  91. package/types/cngx-ui-stat-card.d.ts +117 -33
  92. package/types/cngx-ui-stepper.d.ts +66 -27
  93. package/types/cngx-ui-tabs.d.ts +2 -2
  94. package/types/cngx-ui-timeline.d.ts +23 -7
  95. package/types/cngx-ui-toc.d.ts +80 -13
  96. package/types/cngx-ui.d.ts +7 -4
@@ -29,7 +29,47 @@ Toast, banner, and alerter services are **not** `providedIn: 'root'`. Provide th
29
29
 
30
30
  Loading timing (the flash-suppression `showDelay` / `minDwell` shared by every loading surface) lives in the `CNGX_LOADING_CONFIG` cascade in `@cngx/core/utils`. `provideFeedback(withLoadingDefaults({ delay, minDuration }))` still writes that token as a back-compat wrapper (`delay` maps to `showDelay`, `minDuration` to `minDwell`), but it replaces the whole config and resets `spinnerVsSkeletonCutoff`. For new apps prefer `provideLoadingConfig(withShowDelay(...), withMinDwell(...), withSpinnerVsSkeletonCutoff(...))` from `@cngx/core/utils` as the canonical loading-timing knob.
31
31
 
32
+ The alert stack and the toast outlet name their `role="region"` host, and both
33
+ outlets announce state changes - all English by default and all overridable
34
+ through `CNGX_FEEDBACK_I18N`:
35
+
36
+ ```ts
37
+ provideFeedback(
38
+ withToasts(),
39
+ withAlerts(),
40
+ withFeedbackI18nLabels({
41
+ alertsRegionLabel: 'Hinweise',
42
+ announcements: { alertDismissed: 'Hinweis verworfen' },
43
+ }),
44
+ )
45
+ ```
46
+
47
+ `provideFeedbackI18n({ ... })` sets the same bundle on its own, which is what a
48
+ consumer-composed language file uses: `provideFeedback(...)` replaces the whole
49
+ `CNGX_FEEDBACK_CONFIG` value, so routing a translation through it would reset
50
+ unrelated feedback defaults. Both accept a `Signal` of the overrides to switch
51
+ the language at runtime; `CNGX_FEEDBACK_I18N` itself is a `Signal` of the
52
+ resolved bundle. To translate the whole family, put a `feedback` section in
53
+ your language pack (`provideCngxI18n` from `@cngx/core/i18n`); the English
54
+ section is `CNGX_FEEDBACK_LANGUAGE_EN`, and the two providers above override
55
+ single keys on top of it.
56
+
57
+ The state bridges append an error detail only through a mapping you own. With
58
+ `[toastErrorDetail]="true"` (and the alert and banner equivalents), development
59
+ builds show the raw `Error.message` and warn once in the console; production
60
+ builds show the message alone until you set `withErrorDetail`:
61
+
62
+ ```ts
63
+ provideFeedback(
64
+ withToasts(),
65
+ withErrorDetail((error) =>
66
+ error instanceof HttpErrorResponse ? translate(`http.${error.status}`) : undefined,
67
+ ),
68
+ )
69
+ ```
70
+
32
71
  ## See also
33
72
 
34
73
  - Outlet components, services, bridge directives, slot directives, and `with*` config features in the **API** tab.
74
+ - Localising every cngx string: the "Localisation" chapter in the docs sidebar.
35
75
  - Conceptual deep dive: the "Async State Machine" chapter in the docs sidebar.
@@ -1,63 +1,115 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, makeEnvironmentProviders, SkipSelf, Optional, inject, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { InjectionToken, inject, computed, makeEnvironmentProviders, SkipSelf, Optional, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
3
3
  import { CngxLiveAnnouncer } from '@cngx/common/a11y';
4
4
  import { CngxButtonToggleGroup, CngxButtonToggle } from '@cngx/common/interactive';
5
5
  import { CngxCard, CngxCardHeader, CngxCardBody, CngxCardFooter } from '@cngx/common/card';
6
6
  import { injectA11yPreferences } from '@cngx/core';
7
- import { nextUid } from '@cngx/core/utils';
7
+ import { createNestedOverrideMerge, createDefaultsFill, coerceSignal, nextUid } from '@cngx/core/utils';
8
+ import { createLanguageSection, createSectionBundle } from '@cngx/core/i18n';
9
+ import { recordEqual } from '@cngx/utils';
8
10
 
9
- /** Library defaults - English. Override via {@link provideA11yPanelConfig}. */
10
- const CNGX_A11Y_PANEL_DEFAULTS = {
11
- labels: {
12
- axes: {
13
- density: 'Spacing',
14
- textScale: 'Text size',
15
- motion: 'Motion',
16
- contrast: 'Contrast',
17
- },
18
- reset: 'Reset to defaults',
19
- heading: 'Accessibility',
20
- resetMessage: 'Preferences reset to defaults',
11
+ /**
12
+ * The English accessibility-panel section: the single source of the panel's
13
+ * English copy. The `CNGX_A11Y_PANEL_CONFIG` labels and option labels default
14
+ * to it.
15
+ *
16
+ * @category ui/a11y/i18n
17
+ * @since 0.1.0
18
+ * @relatedTo CNGX_A11Y_PANEL_CONFIG
19
+ */
20
+ const CNGX_A11Y_PANEL_LANGUAGE_EN = {
21
+ heading: 'Accessibility',
22
+ reset: 'Reset to defaults',
23
+ resetMessage: 'Preferences reset to defaults',
24
+ axes: {
25
+ density: 'Spacing',
26
+ textScale: 'Text size',
27
+ motion: 'Motion',
28
+ contrast: 'Contrast',
21
29
  },
30
+ density: { compact: 'Compact', comfortable: 'Comfortable', spacious: 'Spacious' },
31
+ textScale: { sm: 'Small', md: 'Default', lg: 'Large' },
32
+ motion: { full: 'Full', reduced: 'Reduced', auto: 'System' },
33
+ contrast: { normal: 'Normal', more: 'More', auto: 'System' },
34
+ };
35
+
36
+ /** @internal Turns an accessibility-panel section into the panel copy. Pure. */
37
+ function a11yPanelCopyFrom(section) {
38
+ return {
39
+ labels: {
40
+ axes: section.axes,
41
+ reset: section.reset,
42
+ heading: section.heading,
43
+ resetMessage: section.resetMessage,
44
+ },
45
+ options: {
46
+ density: section.density,
47
+ textScale: section.textScale,
48
+ motion: section.motion,
49
+ contrast: section.contrast,
50
+ },
51
+ };
52
+ }
53
+ /** @internal The accessibility-panel section of the active pack over the English section. */
54
+ const injectA11yPanelLanguage = createLanguageSection('a11yPanel', CNGX_A11Y_PANEL_LANGUAGE_EN);
55
+ /** @internal Builds and reads the section copy. */
56
+ const a11yPanelBundle = createSectionBundle({
57
+ section: injectA11yPanelLanguage,
58
+ toBundle: a11yPanelCopyFrom,
59
+ });
60
+ /**
61
+ * @internal The panel copy of the active pack. Private: consumers override the
62
+ * text through `withA11yPanelLabels`, option labels through `withA11yPanelAxes`.
63
+ */
64
+ const A11Y_PANEL_SECTION_COPY = new InjectionToken('CngxA11yPanelSectionCopy', { providedIn: 'root', factory: () => a11yPanelBundle.build() });
65
+ const SITES = new WeakMap();
66
+ /**
67
+ * @internal The panel copy at the reading site, each part its own signal.
68
+ * Memoized per copy signal. Injection context required.
69
+ */
70
+ function injectA11yPanelSiteCopy() {
71
+ const copy = a11yPanelBundle.resolve(inject(A11Y_PANEL_SECTION_COPY));
72
+ let site = SITES.get(copy);
73
+ if (!site) {
74
+ site = {
75
+ labels: computed(() => copy().labels, { equal: recordEqual }),
76
+ options: computed(() => copy().options, { equal: recordEqual }),
77
+ };
78
+ SITES.set(copy, site);
79
+ }
80
+ return site;
81
+ }
82
+
83
+ /**
84
+ * Library defaults: the four axes in their default order, each with its reset
85
+ * value. Carries no copy - the text and the option labels are the `a11yPanel`
86
+ * section of the language pack. Override via {@link provideA11yPanelConfig}.
87
+ */
88
+ const CNGX_A11Y_PANEL_DEFAULTS = {
22
89
  axes: [
23
90
  {
24
91
  axis: 'density',
25
92
  reset: 'comfortable',
26
- options: [
27
- { value: 'compact', label: 'Compact' },
28
- { value: 'comfortable', label: 'Comfortable' },
29
- { value: 'spacious', label: 'Spacious' },
30
- ],
93
+ options: [{ value: 'compact' }, { value: 'comfortable' }, { value: 'spacious' }],
31
94
  },
32
95
  {
33
96
  axis: 'textScale',
34
97
  reset: 'md',
35
- options: [
36
- { value: 'sm', label: 'Small' },
37
- { value: 'md', label: 'Default' },
38
- { value: 'lg', label: 'Large' },
39
- ],
98
+ options: [{ value: 'sm' }, { value: 'md' }, { value: 'lg' }],
40
99
  },
41
100
  {
42
101
  axis: 'motion',
43
102
  reset: 'auto',
44
- options: [
45
- { value: 'full', label: 'Full' },
46
- { value: 'reduced', label: 'Reduced' },
47
- { value: 'auto', label: 'System' },
48
- ],
103
+ options: [{ value: 'full' }, { value: 'reduced' }, { value: 'auto' }],
49
104
  },
50
105
  {
51
106
  axis: 'contrast',
52
107
  reset: 'auto',
53
- options: [
54
- { value: 'normal', label: 'Normal' },
55
- { value: 'more', label: 'More' },
56
- { value: 'auto', label: 'System' },
57
- ],
108
+ options: [{ value: 'normal' }, { value: 'more' }, { value: 'auto' }],
58
109
  },
59
110
  ],
60
111
  };
112
+ const NO_LABELS = {};
61
113
  /**
62
114
  * Configuration cascade token. Resolution priority (high to low):
63
115
  * `provideA11yPanelConfigAt(...)` in a component's `viewProviders`, then
@@ -79,11 +131,7 @@ function applyFeatures(base, features) {
79
131
  let axes = base.axes;
80
132
  for (const feature of features) {
81
133
  if (feature.kind === 'labels') {
82
- labels = {
83
- ...labels,
84
- ...feature.payload,
85
- axes: { ...labels.axes, ...feature.payload.axes },
86
- };
134
+ labels = createNestedOverrideMerge(labels ?? NO_LABELS, feature.payload, 'axes');
87
135
  }
88
136
  else {
89
137
  axes = feature.payload;
@@ -94,7 +142,8 @@ function applyFeatures(base, features) {
94
142
  /**
95
143
  * Override any subset of the panel text - axis group labels, the Reset label,
96
144
  * the default heading, or the Reset announcement. The `axes` record merges
97
- * key-by-key, so a single axis can be relabelled in isolation.
145
+ * key-by-key, so a single axis can be relabelled in isolation. Pass a `Signal`
146
+ * to switch the language at runtime.
98
147
  *
99
148
  * ```ts
100
149
  * provideA11yPanelConfig(
@@ -117,13 +166,16 @@ function withA11yPanelLabels(payload) {
117
166
  /**
118
167
  * Replace the rendered axis list - reorder groups, drop an axis, or restrict
119
168
  * the options a group offers. Supplying a subset renders only those groups.
169
+ * Leave an option's `label` out and it reads the `a11yPanel` section of the
170
+ * language pack, so the options translate without restating the list; pass a
171
+ * `Signal` to relabel options you set yourself on a runtime language switch.
120
172
  *
121
173
  * ```ts
122
174
  * provideA11yPanelConfig(
123
175
  * withA11yPanelAxes([
124
176
  * { axis: 'textScale', reset: 'md', options: [
125
- * { value: 'md', label: 'Default' },
126
- * { value: 'lg', label: 'Large' },
177
+ * { value: 'md' },
178
+ * { value: 'lg', label: 'Bigger' },
127
179
  * ] },
128
180
  * ]),
129
181
  * );
@@ -212,7 +264,86 @@ function provideA11yPanelConfigAt(...features) {
212
264
  function injectA11yPanelConfig() {
213
265
  return inject(CNGX_A11Y_PANEL_CONFIG);
214
266
  }
267
+ /**
268
+ * The resolved text bundle of the panel config in scope, as a Signal that
269
+ * follows a runtime language switch: the config overrides over the `a11yPanel`
270
+ * section of the active pack, the `axes` record merged key by key. A key the
271
+ * config leaves unset, `null` or `undefined` reads the section. Runs in an
272
+ * injection context; read it inside a `computed()`, a template or a handler.
273
+ *
274
+ * @category ui/a11y
275
+ * @relatedTo withA11yPanelLabels
276
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts
277
+ * @since 0.1.0
278
+ */
279
+ function injectA11yPanelLabels() {
280
+ const section = injectA11yPanelSiteCopy().labels;
281
+ return createDefaultsFill(createNestedOverrideMerge(section, injectA11yPanelConfig().labels, 'axes'), section, 'axes');
282
+ }
283
+ /** Options keyed by their array, then by the option-label record they were resolved against. */
284
+ const RESOLVED_OPTIONS = new WeakMap();
285
+ /** `options` with every missing label read from `labels`, by value. Memoized per input pair. */
286
+ function resolveOptions(options, labels) {
287
+ let byLabels = RESOLVED_OPTIONS.get(options);
288
+ if (!byLabels) {
289
+ byLabels = new WeakMap();
290
+ RESOLVED_OPTIONS.set(options, byLabels);
291
+ }
292
+ let resolved = byLabels.get(labels);
293
+ if (!resolved) {
294
+ resolved = options.map((option) => option.label === undefined ? { ...option, label: labels[option.value] } : option);
295
+ byLabels.set(labels, resolved);
296
+ }
297
+ return resolved;
298
+ }
299
+ /** Axis lists are equal when every spec keeps its axis, reset target and options array. */
300
+ function sameAxes(a, b) {
301
+ return (a.length === b.length &&
302
+ a.every((spec, i) => spec.axis === b[i].axis && spec.reset === b[i].reset && spec.options === b[i].options));
303
+ }
304
+ /** Resolved axis lists, memoized per config object and option-label signal. */
305
+ const RESOLVED_AXES = new WeakMap();
306
+ /** The axis list with every option label filled. Kept out of a field initializer for compodocx. */
307
+ function resolveAxes(axes, optionLabels) {
308
+ return axes.map((spec) => ({
309
+ ...spec,
310
+ options: resolveOptions(spec.options, optionLabels[spec.axis]),
311
+ }));
312
+ }
313
+ /**
314
+ * The resolved axis list of the panel config in scope (values, option labels
315
+ * and reset targets), as a Signal that follows a runtime language switch.
316
+ * Every option without its own `label` carries the label for its value from
317
+ * the `a11yPanel` section of the active pack. Runs in an injection context.
318
+ *
319
+ * @category ui/a11y
320
+ * @relatedTo withA11yPanelAxes
321
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts
322
+ * @since 0.1.0
323
+ */
324
+ function injectA11yPanelAxes() {
325
+ const config = injectA11yPanelConfig();
326
+ const optionLabels = injectA11yPanelSiteCopy().options;
327
+ let byLabels = RESOLVED_AXES.get(config);
328
+ if (!byLabels) {
329
+ byLabels = new WeakMap();
330
+ RESOLVED_AXES.set(config, byLabels);
331
+ }
332
+ const cached = byLabels.get(optionLabels);
333
+ if (cached) {
334
+ return cached;
335
+ }
336
+ const axes = coerceSignal(config.axes);
337
+ const resolved = computed(() => resolveAxes(axes(), optionLabels()), { ...(ngDevMode ? { debugName: "resolved" } : /* istanbul ignore next */ {}), equal: sameAxes });
338
+ byLabels.set(optionLabels, resolved);
339
+ return resolved;
340
+ }
215
341
 
342
+ /** Views are equal when every group keeps its axis, label and options. */
343
+ function sameAxisViews(a, b) {
344
+ return (a.length === b.length &&
345
+ a.every((view, i) => view.axis === b[i].axis && view.label === b[i].label && view.options === b[i].options));
346
+ }
216
347
  /**
217
348
  * Batteries-included accessibility preferences card. Renders one labelled
218
349
  * `cngx-button-toggle-group` per configured axis (spacing/density, text size,
@@ -248,20 +379,21 @@ function injectA11yPanelConfig() {
248
379
  class CngxA11yPanel {
249
380
  announcer = inject(CngxLiveAnnouncer);
250
381
  prefs = injectA11yPreferences();
251
- config = injectA11yPanelConfig();
382
+ labels = injectA11yPanelLabels();
383
+ axes = injectA11yPanelAxes();
252
384
  uid = nextUid('cngx-a11y-panel');
253
385
  /**
254
- * The axis groups to render. Resolved once from the config: the axis list is
255
- * static, so this is a plain field (no equality concern). Each view's `value`
256
- * is its own one-axis `computed`, so a change to one axis re-renders only its
257
- * group's bound value, not the whole list.
386
+ * The axis groups to render, rebuilt when the axis list or the labels change
387
+ * so both follow a language switch. A rebuild that yields the same axes,
388
+ * labels and options keeps the previous array. Each view's `value` is the
389
+ * axis preference itself, so picking an option re-renders only that group.
258
390
  */
259
- axisViews = this.buildAxisViews();
391
+ axisViews = computed(() => this.buildAxisViews(this.axes(), this.labels()), { ...(ngDevMode ? { debugName: "axisViews" } : /* istanbul ignore next */ {}), equal: sameAxisViews });
260
392
  // Kept as a method, not an inline `.map()` field initializer: compodocx's
261
393
  // property-default serializer catastrophically backtracks on a `.map` that
262
394
  // returns object literals with nested arrow functions, hanging docs:json.
263
- buildAxisViews() {
264
- return this.config.axes.map((spec) => {
395
+ buildAxisViews(axes, labels) {
396
+ return axes.map((spec) => {
265
397
  // `CngxA11yPanelAxisSpec` is a discriminated union whose options/reset are
266
398
  // typed to each axis' value union, so every value reaching this write is
267
399
  // compile-checked valid. Erasing the invariant signal type to `string`
@@ -270,10 +402,10 @@ class CngxA11yPanel {
270
402
  const sig = this.prefs[spec.axis];
271
403
  return {
272
404
  axis: spec.axis,
273
- label: this.config.labels.axes[spec.axis],
405
+ label: labels.axes[spec.axis],
274
406
  labelId: `${this.uid}-${spec.axis}`,
275
407
  options: spec.options,
276
- value: computed(() => sig()),
408
+ value: sig.asReadonly(),
277
409
  commit: (next) => {
278
410
  // `CngxButtonToggleGroup.value` is `model<T | undefined>`; this group
279
411
  // never deselects, so `undefined` is never emitted, but the guard
@@ -286,15 +418,15 @@ class CngxA11yPanel {
286
418
  });
287
419
  }
288
420
  reset() {
289
- for (const spec of this.config.axes) {
421
+ for (const spec of this.axes()) {
290
422
  this.prefs[spec.axis].set(spec.reset);
291
423
  }
292
424
  // Bulk multi-axis change with focus staying on Reset: announce it (Pillar 2)
293
425
  // through the shared root live region rather than a private one.
294
- this.announcer.announce(this.config.labels.resetMessage);
426
+ this.announcer.announce(this.labels().resetMessage);
295
427
  }
296
428
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxA11yPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
297
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxA11yPanel, isStandalone: true, selector: "cngx-a11y-panel", host: { classAttribute: "cngx-a11y-panel-host" }, ngImport: i0, template: "<cngx-card class=\"cngx-a11y-panel\">\n <header cngxCardHeader class=\"cngx-a11y-panel__header\">\n <ng-content select=\"[cngxA11yPanelHeader]\">\n <h2 class=\"cngx-a11y-panel__heading\">{{ config.labels.heading }}</h2>\n </ng-content>\n </header>\n\n <div cngxCardBody class=\"cngx-a11y-panel__body\">\n @for (axis of axisViews; track axis.axis) {\n <div class=\"cngx-a11y-panel__axis\">\n <span class=\"cngx-a11y-panel__axis-label\" [id]=\"axis.labelId\">{{ axis.label }}</span>\n <cngx-button-toggle-group\n class=\"cngx-a11y-panel__group\"\n [attr.aria-labelledby]=\"axis.labelId\"\n [value]=\"axis.value()\"\n (valueChange)=\"axis.commit($event)\"\n >\n @for (option of axis.options; track option.value) {\n <button cngxButtonToggle [value]=\"option.value\">{{ option.label }}</button>\n }\n </cngx-button-toggle-group>\n </div>\n }\n </div>\n\n <footer cngxCardFooter class=\"cngx-a11y-panel__footer\">\n <button type=\"button\" class=\"cngx-a11y-panel__reset\" (click)=\"reset()\">\n {{ config.labels.reset }}\n </button>\n </footer>\n</cngx-card>\n", styles: ["@layer cngx.components{.cngx-a11y-panel-host{display:block}.cngx-a11y-panel{--cngx-a11y-panel-gap: var(--cngx-space-md, 1rem);--cngx-a11y-panel-axis-gap: var(--cngx-space-sm, .5rem);--cngx-a11y-panel-reset-pad-x: var(--cngx-space-md, 1rem);--cngx-a11y-panel-reset-pad-y: var(--cngx-space-sm, .5rem)}.cngx-a11y-panel__heading{margin:0;font-size:var(--cngx-a11y-panel-heading-size, 1.125rem);font-weight:var(--cngx-a11y-panel-heading-weight, 600);color:var(--cngx-a11y-panel-heading-color, inherit)}.cngx-a11y-panel__body{display:flex;flex-direction:column;gap:var(--cngx-a11y-panel-gap, 1rem)}.cngx-a11y-panel__axis{display:flex;flex-direction:column;gap:var(--cngx-a11y-panel-axis-gap, .5rem)}.cngx-a11y-panel__axis-label{font-weight:var(--cngx-a11y-panel-label-weight, 600);color:var(--cngx-a11y-panel-label-color, inherit)}.cngx-a11y-panel__footer{display:flex;justify-content:flex-end}.cngx-a11y-panel__reset{min-block-size:var(--cngx-target-min, 0px);padding-block:var(--cngx-a11y-panel-reset-pad-y, .5rem);padding-inline:var(--cngx-a11y-panel-reset-pad-x, 1rem);cursor:pointer;color:var(--cngx-a11y-panel-reset-color, inherit);background:var(--cngx-a11y-panel-reset-bg, transparent);border:var(--cngx-a11y-panel-reset-border-width, 1px) solid var(--cngx-a11y-panel-reset-border-color, currentColor);border-radius:var(--cngx-a11y-panel-reset-radius, .375rem)}}\n"], dependencies: [{ kind: "component", type: CngxCard, selector: "cngx-card", inputs: ["as", "href", "ariaLabel", "selected", "selectable", "loading", "disabled", "disabledReason"], outputs: ["selectedChange", "clicked"] }, { kind: "directive", type: CngxCardHeader, selector: "header[cngxCardHeader]" }, { kind: "directive", type: CngxCardBody, selector: "[cngxCardBody]" }, { kind: "directive", type: CngxCardFooter, selector: "footer[cngxCardFooter]" }, { kind: "component", type: CngxButtonToggleGroup, selector: "cngx-button-toggle-group, [cngxButtonToggleGroup]", inputs: ["value", "disabled", "required", "invalid", "errorMessageId", "orientation", "label", "state"], outputs: ["valueChange", "disabledChange", "requiredChange", "invalidChange"], exportAs: ["cngxButtonToggleGroup"] }, { kind: "directive", type: CngxButtonToggle, selector: "button[cngxButtonToggle]", inputs: ["value", "disabled", "cngxDescribedBy"], exportAs: ["cngxButtonToggle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
429
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxA11yPanel, isStandalone: true, selector: "cngx-a11y-panel", host: { classAttribute: "cngx-a11y-panel-host" }, ngImport: i0, template: "<cngx-card class=\"cngx-a11y-panel\">\n <header cngxCardHeader class=\"cngx-a11y-panel__header\">\n <ng-content select=\"[cngxA11yPanelHeader]\">\n <h2 class=\"cngx-a11y-panel__heading\">{{ labels().heading }}</h2>\n </ng-content>\n </header>\n\n <div cngxCardBody class=\"cngx-a11y-panel__body\">\n @for (axis of axisViews(); track axis.axis) {\n <div class=\"cngx-a11y-panel__axis\">\n <span class=\"cngx-a11y-panel__axis-label\" [id]=\"axis.labelId\">{{ axis.label }}</span>\n <cngx-button-toggle-group\n class=\"cngx-a11y-panel__group\"\n [labelledBy]=\"axis.labelId\"\n [value]=\"axis.value()\"\n (valueChange)=\"axis.commit($event)\"\n >\n @for (option of axis.options; track option.value) {\n <button cngxButtonToggle [value]=\"option.value\">{{ option.label }}</button>\n }\n </cngx-button-toggle-group>\n </div>\n }\n </div>\n\n <footer cngxCardFooter class=\"cngx-a11y-panel__footer\">\n <button type=\"button\" class=\"cngx-a11y-panel__reset\" (click)=\"reset()\">\n {{ labels().reset }}\n </button>\n </footer>\n</cngx-card>\n", styles: ["@layer cngx.components{.cngx-a11y-panel-host{display:block}.cngx-a11y-panel{--cngx-a11y-panel-gap: var(--cngx-space-md, 1rem);--cngx-a11y-panel-axis-gap: var(--cngx-space-sm, .5rem);--cngx-a11y-panel-reset-pad-x: var(--cngx-space-md, 1rem);--cngx-a11y-panel-reset-pad-y: var(--cngx-space-sm, .5rem)}.cngx-a11y-panel__heading{margin:0;font-size:var(--cngx-a11y-panel-heading-size, 1.125rem);font-weight:var(--cngx-a11y-panel-heading-weight, 600);color:var(--cngx-a11y-panel-heading-color, inherit)}.cngx-a11y-panel__body{display:flex;flex-direction:column;gap:var(--cngx-a11y-panel-gap, 1rem)}.cngx-a11y-panel__axis{display:flex;flex-direction:column;gap:var(--cngx-a11y-panel-axis-gap, .5rem)}.cngx-a11y-panel__axis-label{font-weight:var(--cngx-a11y-panel-label-weight, 600);color:var(--cngx-a11y-panel-label-color, inherit)}.cngx-a11y-panel__footer{display:flex;justify-content:flex-end}.cngx-a11y-panel__reset{min-block-size:var(--cngx-target-min, 0px);padding-block:var(--cngx-a11y-panel-reset-pad-y, .5rem);padding-inline:var(--cngx-a11y-panel-reset-pad-x, 1rem);cursor:pointer;color:var(--cngx-a11y-panel-reset-color, inherit);background:var(--cngx-a11y-panel-reset-bg, transparent);border:var(--cngx-a11y-panel-reset-border-width, 1px) solid var(--cngx-a11y-panel-reset-border-color, currentColor);border-radius:var(--cngx-a11y-panel-reset-radius, .375rem)}}\n"], dependencies: [{ kind: "component", type: CngxCard, selector: "cngx-card", inputs: ["as", "href", "role", "ariaLabel", "selected", "selectable", "loading", "disabled", "disabledReason"], outputs: ["selectedChange", "clicked"] }, { kind: "directive", type: CngxCardHeader, selector: "header[cngxCardHeader]" }, { kind: "directive", type: CngxCardBody, selector: "[cngxCardBody]" }, { kind: "directive", type: CngxCardFooter, selector: "footer[cngxCardFooter]" }, { kind: "component", type: CngxButtonToggleGroup, selector: "cngx-button-toggle-group, [cngxButtonToggleGroup]", inputs: ["value", "disabled", "required", "invalid", "errorMessageId", "orientation", "label", "labelledBy", "state"], outputs: ["valueChange", "disabledChange", "requiredChange", "invalidChange"], exportAs: ["cngxButtonToggleGroup"] }, { kind: "directive", type: CngxButtonToggle, selector: "button[cngxButtonToggle]", inputs: ["value", "disabled", "cngxDescribedBy"], exportAs: ["cngxButtonToggle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
298
430
  }
299
431
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxA11yPanel, decorators: [{
300
432
  type: Component,
@@ -305,7 +437,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
305
437
  CngxCardFooter,
306
438
  CngxButtonToggleGroup,
307
439
  CngxButtonToggle,
308
- ], host: { class: 'cngx-a11y-panel-host' }, template: "<cngx-card class=\"cngx-a11y-panel\">\n <header cngxCardHeader class=\"cngx-a11y-panel__header\">\n <ng-content select=\"[cngxA11yPanelHeader]\">\n <h2 class=\"cngx-a11y-panel__heading\">{{ config.labels.heading }}</h2>\n </ng-content>\n </header>\n\n <div cngxCardBody class=\"cngx-a11y-panel__body\">\n @for (axis of axisViews; track axis.axis) {\n <div class=\"cngx-a11y-panel__axis\">\n <span class=\"cngx-a11y-panel__axis-label\" [id]=\"axis.labelId\">{{ axis.label }}</span>\n <cngx-button-toggle-group\n class=\"cngx-a11y-panel__group\"\n [attr.aria-labelledby]=\"axis.labelId\"\n [value]=\"axis.value()\"\n (valueChange)=\"axis.commit($event)\"\n >\n @for (option of axis.options; track option.value) {\n <button cngxButtonToggle [value]=\"option.value\">{{ option.label }}</button>\n }\n </cngx-button-toggle-group>\n </div>\n }\n </div>\n\n <footer cngxCardFooter class=\"cngx-a11y-panel__footer\">\n <button type=\"button\" class=\"cngx-a11y-panel__reset\" (click)=\"reset()\">\n {{ config.labels.reset }}\n </button>\n </footer>\n</cngx-card>\n", styles: ["@layer cngx.components{.cngx-a11y-panel-host{display:block}.cngx-a11y-panel{--cngx-a11y-panel-gap: var(--cngx-space-md, 1rem);--cngx-a11y-panel-axis-gap: var(--cngx-space-sm, .5rem);--cngx-a11y-panel-reset-pad-x: var(--cngx-space-md, 1rem);--cngx-a11y-panel-reset-pad-y: var(--cngx-space-sm, .5rem)}.cngx-a11y-panel__heading{margin:0;font-size:var(--cngx-a11y-panel-heading-size, 1.125rem);font-weight:var(--cngx-a11y-panel-heading-weight, 600);color:var(--cngx-a11y-panel-heading-color, inherit)}.cngx-a11y-panel__body{display:flex;flex-direction:column;gap:var(--cngx-a11y-panel-gap, 1rem)}.cngx-a11y-panel__axis{display:flex;flex-direction:column;gap:var(--cngx-a11y-panel-axis-gap, .5rem)}.cngx-a11y-panel__axis-label{font-weight:var(--cngx-a11y-panel-label-weight, 600);color:var(--cngx-a11y-panel-label-color, inherit)}.cngx-a11y-panel__footer{display:flex;justify-content:flex-end}.cngx-a11y-panel__reset{min-block-size:var(--cngx-target-min, 0px);padding-block:var(--cngx-a11y-panel-reset-pad-y, .5rem);padding-inline:var(--cngx-a11y-panel-reset-pad-x, 1rem);cursor:pointer;color:var(--cngx-a11y-panel-reset-color, inherit);background:var(--cngx-a11y-panel-reset-bg, transparent);border:var(--cngx-a11y-panel-reset-border-width, 1px) solid var(--cngx-a11y-panel-reset-border-color, currentColor);border-radius:var(--cngx-a11y-panel-reset-radius, .375rem)}}\n"] }]
440
+ ], host: { class: 'cngx-a11y-panel-host' }, template: "<cngx-card class=\"cngx-a11y-panel\">\n <header cngxCardHeader class=\"cngx-a11y-panel__header\">\n <ng-content select=\"[cngxA11yPanelHeader]\">\n <h2 class=\"cngx-a11y-panel__heading\">{{ labels().heading }}</h2>\n </ng-content>\n </header>\n\n <div cngxCardBody class=\"cngx-a11y-panel__body\">\n @for (axis of axisViews(); track axis.axis) {\n <div class=\"cngx-a11y-panel__axis\">\n <span class=\"cngx-a11y-panel__axis-label\" [id]=\"axis.labelId\">{{ axis.label }}</span>\n <cngx-button-toggle-group\n class=\"cngx-a11y-panel__group\"\n [labelledBy]=\"axis.labelId\"\n [value]=\"axis.value()\"\n (valueChange)=\"axis.commit($event)\"\n >\n @for (option of axis.options; track option.value) {\n <button cngxButtonToggle [value]=\"option.value\">{{ option.label }}</button>\n }\n </cngx-button-toggle-group>\n </div>\n }\n </div>\n\n <footer cngxCardFooter class=\"cngx-a11y-panel__footer\">\n <button type=\"button\" class=\"cngx-a11y-panel__reset\" (click)=\"reset()\">\n {{ labels().reset }}\n </button>\n </footer>\n</cngx-card>\n", styles: ["@layer cngx.components{.cngx-a11y-panel-host{display:block}.cngx-a11y-panel{--cngx-a11y-panel-gap: var(--cngx-space-md, 1rem);--cngx-a11y-panel-axis-gap: var(--cngx-space-sm, .5rem);--cngx-a11y-panel-reset-pad-x: var(--cngx-space-md, 1rem);--cngx-a11y-panel-reset-pad-y: var(--cngx-space-sm, .5rem)}.cngx-a11y-panel__heading{margin:0;font-size:var(--cngx-a11y-panel-heading-size, 1.125rem);font-weight:var(--cngx-a11y-panel-heading-weight, 600);color:var(--cngx-a11y-panel-heading-color, inherit)}.cngx-a11y-panel__body{display:flex;flex-direction:column;gap:var(--cngx-a11y-panel-gap, 1rem)}.cngx-a11y-panel__axis{display:flex;flex-direction:column;gap:var(--cngx-a11y-panel-axis-gap, .5rem)}.cngx-a11y-panel__axis-label{font-weight:var(--cngx-a11y-panel-label-weight, 600);color:var(--cngx-a11y-panel-label-color, inherit)}.cngx-a11y-panel__footer{display:flex;justify-content:flex-end}.cngx-a11y-panel__reset{min-block-size:var(--cngx-target-min, 0px);padding-block:var(--cngx-a11y-panel-reset-pad-y, .5rem);padding-inline:var(--cngx-a11y-panel-reset-pad-x, 1rem);cursor:pointer;color:var(--cngx-a11y-panel-reset-color, inherit);background:var(--cngx-a11y-panel-reset-bg, transparent);border:var(--cngx-a11y-panel-reset-border-width, 1px) solid var(--cngx-a11y-panel-reset-border-color, currentColor);border-radius:var(--cngx-a11y-panel-reset-radius, .375rem)}}\n"] }]
309
441
  }] });
310
442
 
311
443
  /**
@@ -316,5 +448,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
316
448
  * Generated bundle index. Do not edit.
317
449
  */
318
450
 
319
- export { CNGX_A11Y_PANEL_CONFIG, CNGX_A11Y_PANEL_DEFAULTS, CngxA11yPanel, injectA11yPanelConfig, provideA11yPanelConfig, provideA11yPanelConfigAt, withA11yPanelAxes, withA11yPanelLabels };
451
+ export { CNGX_A11Y_PANEL_CONFIG, CNGX_A11Y_PANEL_DEFAULTS, CNGX_A11Y_PANEL_LANGUAGE_EN, CngxA11yPanel, injectA11yPanelAxes, injectA11yPanelConfig, injectA11yPanelLabels, provideA11yPanelConfig, provideA11yPanelConfigAt, withA11yPanelAxes, withA11yPanelLabels };
320
452
  //# sourceMappingURL=cngx-ui-a11y.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"cngx-ui-a11y.mjs","sources":["../../../projects/ui/a11y/a11y-panel.config.ts","../../../projects/ui/a11y/a11y-panel.component.ts","../../../projects/ui/a11y/a11y-panel.component.html","../../../projects/ui/a11y/public-api.ts","../../../projects/ui/a11y/cngx-ui-a11y.ts"],"sourcesContent":["import {\n inject,\n InjectionToken,\n makeEnvironmentProviders,\n Optional,\n SkipSelf,\n type EnvironmentProviders,\n type Provider,\n} from '@angular/core';\nimport type {\n CngxContrastPreference,\n CngxDensityValue,\n CngxMotionPreference,\n CngxTextScaleValue,\n} from '@cngx/core';\n\n/**\n * The four accessibility axes the panel can render a control group for.\n * Each maps 1:1 onto a writable signal returned by `injectA11yPreferences()`.\n *\n * @category ui/a11y\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport type CngxA11yPanelAxis = 'density' | 'textScale' | 'motion' | 'contrast';\n\n/**\n * One selectable option in an axis control group: the value written to the\n * axis signal plus the visible/toggle label. `V` is the axis' own value union\n * (e.g. `CngxDensityValue`), so a misspelled value fails to compile rather\n * than reaching the global preference signal. Library defaults are English;\n * consumers relabel via `withA11yPanelAxes`.\n *\n * @category ui/a11y\n * @relatedTo withA11yPanelAxes\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport interface CngxA11yPanelAxisOption<V extends string = string> {\n /** Value written to the axis signal - a valid member of that axis' union. */\n readonly value: V;\n /** Toggle-button label. */\n readonly label: string;\n}\n\n/**\n * A rendered axis control group: which axis, its ordered options, and the\n * value Reset restores (the axis' own library default). This is a\n * discriminated union on `axis`, so `options` and `reset` are typed to that\n * axis' value union - a `{ axis: 'density', reset: 'x' }` is a compile error,\n * not a garbage value written to `<html data-density>`. Reorder or drop axes\n * by supplying a subset via `withA11yPanelAxes`.\n *\n * @category ui/a11y\n * @relatedTo withA11yPanelAxes\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport type CngxA11yPanelAxisSpec =\n | {\n readonly axis: 'density';\n readonly options: readonly CngxA11yPanelAxisOption<CngxDensityValue>[];\n readonly reset: CngxDensityValue;\n }\n | {\n readonly axis: 'textScale';\n readonly options: readonly CngxA11yPanelAxisOption<CngxTextScaleValue>[];\n readonly reset: CngxTextScaleValue;\n }\n | {\n readonly axis: 'motion';\n readonly options: readonly CngxA11yPanelAxisOption<CngxMotionPreference>[];\n readonly reset: CngxMotionPreference;\n }\n | {\n readonly axis: 'contrast';\n readonly options: readonly CngxA11yPanelAxisOption<CngxContrastPreference>[];\n readonly reset: CngxContrastPreference;\n };\n\n/**\n * Panel text: per-axis group labels, the Reset control label, the default\n * heading (shown when no `[cngxA11yPanelHeader]` is projected), and the\n * live-region message announced on Reset. Library defaults are English;\n * consumers localise via {@link withA11yPanelLabels}.\n *\n * @category ui/a11y\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport interface CngxA11yPanelLabels {\n /** Group label (the accessible name) per axis. */\n readonly axes: Readonly<Record<CngxA11yPanelAxis, string>>;\n /** Reset control label. */\n readonly reset: string;\n /** Default heading, shown when no `[cngxA11yPanelHeader]` slot is projected. */\n readonly heading: string;\n /** Live-announced when Reset restores every axis. */\n readonly resetMessage: string;\n}\n\n/**\n * Resolved panel configuration - the text bundle plus the ordered axis list.\n * Merged from the library defaults and any `with*` features by the reducer in\n * {@link provideA11yPanelConfig}.\n *\n * @category ui/a11y\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport interface CngxA11yPanelConfig {\n readonly labels: CngxA11yPanelLabels;\n readonly axes: readonly CngxA11yPanelAxisSpec[];\n}\n\n/**\n * Partial text override accepted by `withA11yPanelLabels`. The `axes`\n * record merges key-by-key, so a consumer can relabel one axis group without\n * restating the rest.\n *\n * @category ui/a11y\n * @relatedTo withA11yPanelLabels\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport interface CngxA11yPanelLabelsOverride {\n readonly axes?: Partial<Record<CngxA11yPanelAxis, string>>;\n readonly reset?: string;\n readonly heading?: string;\n readonly resetMessage?: string;\n}\n\n/** Library defaults - English. Override via {@link provideA11yPanelConfig}. */\nexport const CNGX_A11Y_PANEL_DEFAULTS: CngxA11yPanelConfig = {\n labels: {\n axes: {\n density: 'Spacing',\n textScale: 'Text size',\n motion: 'Motion',\n contrast: 'Contrast',\n },\n reset: 'Reset to defaults',\n heading: 'Accessibility',\n resetMessage: 'Preferences reset to defaults',\n },\n axes: [\n {\n axis: 'density',\n reset: 'comfortable',\n options: [\n { value: 'compact', label: 'Compact' },\n { value: 'comfortable', label: 'Comfortable' },\n { value: 'spacious', label: 'Spacious' },\n ],\n },\n {\n axis: 'textScale',\n reset: 'md',\n options: [\n { value: 'sm', label: 'Small' },\n { value: 'md', label: 'Default' },\n { value: 'lg', label: 'Large' },\n ],\n },\n {\n axis: 'motion',\n reset: 'auto',\n options: [\n { value: 'full', label: 'Full' },\n { value: 'reduced', label: 'Reduced' },\n { value: 'auto', label: 'System' },\n ],\n },\n {\n axis: 'contrast',\n reset: 'auto',\n options: [\n { value: 'normal', label: 'Normal' },\n { value: 'more', label: 'More' },\n { value: 'auto', label: 'System' },\n ],\n },\n ],\n};\n\n/**\n * Configuration cascade token. Resolution priority (high to low):\n * `provideA11yPanelConfigAt(...)` in a component's `viewProviders`, then\n * `provideA11yPanelConfig(...)` at the application root, then the library\n * defaults.\n *\n * @category ui/a11y\n * @relatedTo provideA11yPanelConfig\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport const CNGX_A11Y_PANEL_CONFIG = new InjectionToken<CngxA11yPanelConfig>(\n 'CngxA11yPanelConfig',\n {\n providedIn: 'root',\n factory: () => CNGX_A11Y_PANEL_DEFAULTS,\n },\n);\n\n/**\n * A single configuration override produced by a `with*` feature factory. The\n * reducer in {@link provideA11yPanelConfig} matches on `kind`: `labels` deep-\n * merges the text bundle, `axes` replaces the axis list wholesale.\n *\n * @category ui/a11y\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport type CngxA11yPanelConfigFeature =\n | { readonly kind: 'labels'; readonly payload: CngxA11yPanelLabelsOverride }\n | { readonly kind: 'axes'; readonly payload: readonly CngxA11yPanelAxisSpec[] };\n\n/** Reduce a feature list onto a base config, merging text and axes in isolation. */\nfunction applyFeatures(\n base: CngxA11yPanelConfig,\n features: readonly CngxA11yPanelConfigFeature[],\n): CngxA11yPanelConfig {\n let labels = base.labels;\n let axes = base.axes;\n for (const feature of features) {\n if (feature.kind === 'labels') {\n labels = {\n ...labels,\n ...feature.payload,\n axes: { ...labels.axes, ...feature.payload.axes },\n };\n } else {\n axes = feature.payload;\n }\n }\n return { labels, axes };\n}\n\n/**\n * Override any subset of the panel text - axis group labels, the Reset label,\n * the default heading, or the Reset announcement. The `axes` record merges\n * key-by-key, so a single axis can be relabelled in isolation.\n *\n * ```ts\n * provideA11yPanelConfig(\n * withA11yPanelLabels({\n * heading: 'Barrierefreiheit',\n * axes: { motion: 'Bewegung' },\n * resetMessage: 'Einstellungen zurueckgesetzt',\n * }),\n * );\n * ```\n *\n * @category ui/a11y\n * @relatedTo provideA11yPanelConfig\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport function withA11yPanelLabels(\n payload: CngxA11yPanelLabelsOverride,\n): CngxA11yPanelConfigFeature {\n return { kind: 'labels', payload };\n}\n\n/**\n * Replace the rendered axis list - reorder groups, drop an axis, or restrict\n * the options a group offers. Supplying a subset renders only those groups.\n *\n * ```ts\n * provideA11yPanelConfig(\n * withA11yPanelAxes([\n * { axis: 'textScale', reset: 'md', options: [\n * { value: 'md', label: 'Default' },\n * { value: 'lg', label: 'Large' },\n * ] },\n * ]),\n * );\n * ```\n *\n * @category ui/a11y\n * @relatedTo provideA11yPanelConfig\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport function withA11yPanelAxes(\n payload: readonly CngxA11yPanelAxisSpec[],\n): CngxA11yPanelConfigFeature {\n return { kind: 'axes', payload };\n}\n\n/**\n * Application-root configuration cascade for the accessibility panel. Pass any\n * combination of `with*` features in `bootstrapApplication`'s providers;\n * supplied features merge with the library defaults, so consumers only declare\n * what they override.\n *\n * @category ui/a11y\n * @relatedTo withA11yPanelLabels\n * @relatedTo withA11yPanelAxes\n * @relatedTo injectA11yPanelConfig\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport function provideA11yPanelConfig(\n ...features: CngxA11yPanelConfigFeature[]\n): EnvironmentProviders {\n // Empty-features: leave the root default reference untouched so downstream\n // identity comparisons stay stable.\n if (features.length === 0) {\n return makeEnvironmentProviders([]);\n }\n return makeEnvironmentProviders([\n {\n provide: CNGX_A11Y_PANEL_CONFIG,\n useValue: applyFeatures(CNGX_A11Y_PANEL_DEFAULTS, features),\n },\n ]);\n}\n\n/**\n * Component-scoped configuration override. Pass into a component's or\n * directive's `viewProviders`; features merge on top of the parent config (an\n * enclosing scope or the application root), so one panel can re-scope its axis\n * subset or labels without disturbing the rest of the app. This is the\n * component-scope tier of the resolution cascade: `provideA11yPanelConfigAt`\n * (nearest) wins over `provideA11yPanelConfig` (root), which wins over the\n * library defaults.\n *\n * ```ts\n * @Component({\n * viewProviders: [\n * provideA11yPanelConfigAt(withA11yPanelAxes([\n * { axis: 'textScale', reset: 'md', options: [\n * { value: 'md', label: 'Default' },\n * { value: 'lg', label: 'Large' },\n * ] },\n * ])),\n * ],\n * })\n * ```\n *\n * @category ui/a11y\n * @relatedTo provideA11yPanelConfig\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport function provideA11yPanelConfigAt(\n ...features: CngxA11yPanelConfigFeature[]\n): Provider[] {\n return [\n {\n provide: CNGX_A11Y_PANEL_CONFIG,\n useFactory: (parent: CngxA11yPanelConfig | null) =>\n applyFeatures(parent ?? CNGX_A11Y_PANEL_DEFAULTS, features),\n deps: [[new SkipSelf(), new Optional(), CNGX_A11Y_PANEL_CONFIG]],\n },\n ];\n}\n\n/**\n * Convenience accessor for the resolved panel configuration. Runs in an\n * injection context; resolves through the cascade. Equivalent to\n * `inject(CNGX_A11Y_PANEL_CONFIG)`.\n *\n * @category ui/a11y\n * @relatedTo provideA11yPanelConfig\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport function injectA11yPanelConfig(): CngxA11yPanelConfig {\n return inject(CNGX_A11Y_PANEL_CONFIG);\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n ViewEncapsulation,\n type Signal,\n type WritableSignal,\n} from '@angular/core';\nimport { CngxLiveAnnouncer } from '@cngx/common/a11y';\nimport { CngxButtonToggle, CngxButtonToggleGroup } from '@cngx/common/interactive';\nimport { CngxCard, CngxCardBody, CngxCardFooter, CngxCardHeader } from '@cngx/common/card';\nimport { injectA11yPreferences } from '@cngx/core';\nimport { nextUid } from '@cngx/core/utils';\n\nimport {\n type CngxA11yPanelAxis,\n type CngxA11yPanelAxisOption,\n injectA11yPanelConfig,\n} from './a11y-panel.config';\n\n/**\n * One rendered axis group, resolved once from the config against the\n * matching preference signal. `value` reads the current axis value as a\n * string; `commit` writes a picked option back through the same signal.\n * @internal\n */\ninterface CngxA11yPanelAxisView {\n readonly axis: CngxA11yPanelAxis;\n readonly label: string;\n readonly labelId: string;\n readonly options: readonly CngxA11yPanelAxisOption[];\n readonly value: Signal<string>;\n readonly commit: (next: string | undefined) => void;\n}\n\n/**\n * Batteries-included accessibility preferences card. Renders one labelled\n * `cngx-button-toggle-group` per configured axis (spacing/density, text size,\n * motion, contrast), each split-bound to the app-wide preference signal from\n * `injectA11yPreferences()`, plus a Reset that restores every axis to its\n * library default and announces the change.\n *\n * It ships no trigger, no overlay, and no placement of its own - it is a plain\n * in-flow `CngxCard`. The consumer decides where it appears: inline, inside a\n * `CngxDrawer`, inside a `CngxDialog`, or behind their own popover trigger.\n * This mirrors `CngxListbox` under `CngxSelect` - the panel owns the axis\n * controls, the consumer owns the overlay.\n *\n * Composition over reinvention (Pillar 3): the shell is `CngxCard`, each\n * control is `CngxButtonToggleGroup` (roving tabindex + `model` value), and the\n * Reset announcement rides the shared root `CngxLiveAnnouncer` - no hand-rolled\n * card, control, or live region. The axis ARIA is the toggle group's own\n * reactive `computed()` output (Pillar 2).\n *\n * ```html\n * <cngx-a11y-panel />\n * ```\n *\n * @category ui/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.component.ts\n * @selector cngx-a11y-panel\n * @since 0.1.0\n * @relatedTo CngxCard, CngxButtonToggleGroup, CngxLiveAnnouncer, provideA11yPreferences, provideA11yPanelConfig\n * <example-url>http://localhost:4200/#/ui/a11y/panel/inline</example-url>\n */\n@Component({\n selector: 'cngx-a11y-panel',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [\n CngxCard,\n CngxCardHeader,\n CngxCardBody,\n CngxCardFooter,\n CngxButtonToggleGroup,\n CngxButtonToggle,\n ],\n templateUrl: './a11y-panel.component.html',\n styleUrls: ['./a11y-panel.component.css'],\n host: { class: 'cngx-a11y-panel-host' },\n})\nexport class CngxA11yPanel {\n private readonly announcer = inject(CngxLiveAnnouncer);\n private readonly prefs = injectA11yPreferences();\n protected readonly config = injectA11yPanelConfig();\n private readonly uid = nextUid('cngx-a11y-panel');\n\n /**\n * The axis groups to render. Resolved once from the config: the axis list is\n * static, so this is a plain field (no equality concern). Each view's `value`\n * is its own one-axis `computed`, so a change to one axis re-renders only its\n * group's bound value, not the whole list.\n */\n protected readonly axisViews: readonly CngxA11yPanelAxisView[] = this.buildAxisViews();\n\n // Kept as a method, not an inline `.map()` field initializer: compodocx's\n // property-default serializer catastrophically backtracks on a `.map` that\n // returns object literals with nested arrow functions, hanging docs:json.\n private buildAxisViews(): readonly CngxA11yPanelAxisView[] {\n return this.config.axes.map((spec) => {\n // `CngxA11yPanelAxisSpec` is a discriminated union whose options/reset are\n // typed to each axis' value union, so every value reaching this write is\n // compile-checked valid. Erasing the invariant signal type to `string`\n // here is then safe-by-construction - the union just can't be narrowed\n // through a runtime `spec.axis` index without duplicating the map per axis.\n const sig = this.prefs[spec.axis] as unknown as WritableSignal<string>;\n return {\n axis: spec.axis,\n label: this.config.labels.axes[spec.axis],\n labelId: `${this.uid}-${spec.axis}`,\n options: spec.options,\n value: computed(() => sig()),\n commit: (next: string | undefined) => {\n // `CngxButtonToggleGroup.value` is `model<T | undefined>`; this group\n // never deselects, so `undefined` is never emitted, but the guard\n // keeps the non-undefined axis setter type-safe under strictTemplates.\n if (next !== undefined) {\n sig.set(next);\n }\n },\n };\n });\n }\n\n protected reset(): void {\n for (const spec of this.config.axes) {\n (this.prefs[spec.axis] as unknown as WritableSignal<string>).set(spec.reset);\n }\n // Bulk multi-axis change with focus staying on Reset: announce it (Pillar 2)\n // through the shared root live region rather than a private one.\n this.announcer.announce(this.config.labels.resetMessage);\n }\n}\n","<cngx-card class=\"cngx-a11y-panel\">\n <header cngxCardHeader class=\"cngx-a11y-panel__header\">\n <ng-content select=\"[cngxA11yPanelHeader]\">\n <h2 class=\"cngx-a11y-panel__heading\">{{ config.labels.heading }}</h2>\n </ng-content>\n </header>\n\n <div cngxCardBody class=\"cngx-a11y-panel__body\">\n @for (axis of axisViews; track axis.axis) {\n <div class=\"cngx-a11y-panel__axis\">\n <span class=\"cngx-a11y-panel__axis-label\" [id]=\"axis.labelId\">{{ axis.label }}</span>\n <cngx-button-toggle-group\n class=\"cngx-a11y-panel__group\"\n [attr.aria-labelledby]=\"axis.labelId\"\n [value]=\"axis.value()\"\n (valueChange)=\"axis.commit($event)\"\n >\n @for (option of axis.options; track option.value) {\n <button cngxButtonToggle [value]=\"option.value\">{{ option.label }}</button>\n }\n </cngx-button-toggle-group>\n </div>\n }\n </div>\n\n <footer cngxCardFooter class=\"cngx-a11y-panel__footer\">\n <button type=\"button\" class=\"cngx-a11y-panel__reset\" (click)=\"reset()\">\n {{ config.labels.reset }}\n </button>\n </footer>\n</cngx-card>\n","/**\n * @module @cngx/ui/a11y\n */\n\nexport { CngxA11yPanel } from './a11y-panel.component';\n\nexport {\n CNGX_A11Y_PANEL_CONFIG,\n CNGX_A11Y_PANEL_DEFAULTS,\n provideA11yPanelConfig,\n provideA11yPanelConfigAt,\n withA11yPanelLabels,\n withA11yPanelAxes,\n injectA11yPanelConfig,\n} from './a11y-panel.config';\nexport type {\n CngxA11yPanelConfig,\n CngxA11yPanelAxis,\n CngxA11yPanelAxisSpec,\n CngxA11yPanelAxisOption,\n CngxA11yPanelLabels,\n CngxA11yPanelLabelsOverride,\n CngxA11yPanelConfigFeature,\n} from './a11y-panel.config';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAoIA;AACO,MAAM,wBAAwB,GAAwB;AAC3D,IAAA,MAAM,EAAE;AACN,QAAA,IAAI,EAAE;AACJ,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,SAAS,EAAE,WAAW;AACtB,YAAA,MAAM,EAAE,QAAQ;AAChB,YAAA,QAAQ,EAAE,UAAU;AACrB,SAAA;AACD,QAAA,KAAK,EAAE,mBAAmB;AAC1B,QAAA,OAAO,EAAE,eAAe;AACxB,QAAA,YAAY,EAAE,+BAA+B;AAC9C,KAAA;AACD,IAAA,IAAI,EAAE;AACJ,QAAA;AACE,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,KAAK,EAAE,aAAa;AACpB,YAAA,OAAO,EAAE;AACP,gBAAA,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;AACtC,gBAAA,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;AAC9C,gBAAA,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;AACzC,aAAA;AACF,SAAA;AACD,QAAA;AACE,YAAA,IAAI,EAAE,WAAW;AACjB,YAAA,KAAK,E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A,EAAA,IAAA,EACZ,cAAc,EAAA,QAAA,EAAA,wBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACd,qBAAqB,2TACrB,gBAAgB,EAAA,QAAA,EAAA,0BAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,UAAA,EAAA,iBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAMP,aAAa,EAAA,UAAA,EAAA,CAAA;kBAjBzB,SAAS;+BACE,iBAAiB,EAAA,UAAA,EACf,IAAI,EAAA,eAAA,EACC,uBAAuB,CAAC,MAAM,EAAA,aAAA,EAChC,iBAAiB,CAAC,IAAI,EAAA,OAAA,EAC5B;wBACP,QAAQ;wBACR,cAAc;wBACd,YAAY;wBACZ,cAAc;wBACd,qBAAqB;wBACrB,gBAAgB;AACjB,qBAAA,EAAA,IAAA,EAGK,EAAE,KAAK,EAAE,sBAAsB,EAAE,EAAA,QAAA,EAAA,2qCAAA,EAAA,MAAA,EAAA,CAAA,w1CAAA,CAAA,EAAA;;;AEnFzC;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"cngx-ui-a11y.mjs","sources":["../../../projects/ui/a11y/i18n/a11y-panel-language-section.ts","../../../projects/ui/a11y/i18n/a11y-panel-i18n.ts","../../../projects/ui/a11y/a11y-panel.config.ts","../../../projects/ui/a11y/a11y-panel.component.ts","../../../projects/ui/a11y/a11y-panel.component.html","../../../projects/ui/a11y/public-api.ts","../../../projects/ui/a11y/cngx-ui-a11y.ts"],"sourcesContent":["import type {\n CngxContrastPreference,\n CngxDensityValue,\n CngxMotionPreference,\n CngxTextScaleValue,\n} from '@cngx/core';\n\n/**\n * The accessibility-panel section of a {@link CngxLanguagePack}: the copy of\n * `CngxA11yPanel`. The text keys feed the `labels` of `CNGX_A11Y_PANEL_CONFIG`\n * (a key set through `withA11yPanelLabels` still wins); the four option\n * records label the toggle options by value, so an axis list from\n * `withA11yPanelAxes` without option labels reads them from here.\n *\n * @category ui/a11y/i18n\n * @since 0.1.0\n * @relatedTo CNGX_A11Y_PANEL_CONFIG, withA11yPanelLabels, withA11yPanelAxes\n */\nexport interface CngxA11yPanelLanguageSection {\n /** Default heading, shown when no `[cngxA11yPanelHeader]` slot is projected. */\n readonly heading: string;\n /** Reset control label. */\n readonly reset: string;\n /** Announced when Reset restores every axis. */\n readonly resetMessage: string;\n /** Group label (the accessible name) per axis. */\n readonly axes: Readonly<Record<'density' | 'textScale' | 'motion' | 'contrast', string>>;\n /** Option labels of the spacing group, by value. */\n readonly density: Readonly<Record<CngxDensityValue, string>>;\n /** Option labels of the text-size group, by value. */\n readonly textScale: Readonly<Record<CngxTextScaleValue, string>>;\n /** Option labels of the motion group, by value. */\n readonly motion: Readonly<Record<CngxMotionPreference, string>>;\n /** Option labels of the contrast group, by value. */\n readonly contrast: Readonly<Record<CngxContrastPreference, string>>;\n}\n\n/**\n * The English accessibility-panel section: the single source of the panel's\n * English copy. The `CNGX_A11Y_PANEL_CONFIG` labels and option labels default\n * to it.\n *\n * @category ui/a11y/i18n\n * @since 0.1.0\n * @relatedTo CNGX_A11Y_PANEL_CONFIG\n */\nexport const CNGX_A11Y_PANEL_LANGUAGE_EN: CngxA11yPanelLanguageSection = {\n heading: 'Accessibility',\n reset: 'Reset to defaults',\n resetMessage: 'Preferences reset to defaults',\n axes: {\n density: 'Spacing',\n textScale: 'Text size',\n motion: 'Motion',\n contrast: 'Contrast',\n },\n density: { compact: 'Compact', comfortable: 'Comfortable', spacious: 'Spacious' },\n textScale: { sm: 'Small', md: 'Default', lg: 'Large' },\n motion: { full: 'Full', reduced: 'Reduced', auto: 'System' },\n contrast: { normal: 'Normal', more: 'More', auto: 'System' },\n};\n\ndeclare module '@cngx/core/i18n' {\n interface CngxLanguagePack {\n readonly a11yPanel: CngxA11yPanelLanguageSection;\n }\n}\n","import { computed, inject, InjectionToken, type Signal } from '@angular/core';\n\nimport { createLanguageSection, createSectionBundle } from '@cngx/core/i18n';\nimport { recordEqual } from '@cngx/utils';\n\nimport type { CngxA11yPanelAxis, CngxA11yPanelLabels } from '../a11y-panel.config';\nimport {\n CNGX_A11Y_PANEL_LANGUAGE_EN,\n type CngxA11yPanelLanguageSection,\n} from './a11y-panel-language-section';\n\n/** @internal Option labels by axis, then by value. */\nexport type CngxA11yPanelOptionLabels = Readonly<\n Record<CngxA11yPanelAxis, Readonly<Record<string, string>>>\n>;\n\n/** @internal The panel copy of one section, split into config labels and option labels. */\nexport interface CngxA11yPanelCopy {\n readonly labels: CngxA11yPanelLabels;\n readonly options: CngxA11yPanelOptionLabels;\n}\n\n/** @internal Turns an accessibility-panel section into the panel copy. Pure. */\nexport function a11yPanelCopyFrom(section: CngxA11yPanelLanguageSection): CngxA11yPanelCopy {\n return {\n labels: {\n axes: section.axes,\n reset: section.reset,\n heading: section.heading,\n resetMessage: section.resetMessage,\n },\n options: {\n density: section.density,\n textScale: section.textScale,\n motion: section.motion,\n contrast: section.contrast,\n },\n };\n}\n\n/** @internal The accessibility-panel section of the active pack over the English section. */\nconst injectA11yPanelLanguage = createLanguageSection('a11yPanel', CNGX_A11Y_PANEL_LANGUAGE_EN);\n\n/** @internal Builds and reads the section copy. */\nconst a11yPanelBundle = createSectionBundle<CngxA11yPanelLanguageSection, CngxA11yPanelCopy>({\n section: injectA11yPanelLanguage,\n toBundle: a11yPanelCopyFrom,\n});\n\n/**\n * @internal The panel copy of the active pack. Private: consumers override the\n * text through `withA11yPanelLabels`, option labels through `withA11yPanelAxes`.\n */\nconst A11Y_PANEL_SECTION_COPY = new InjectionToken<Signal<CngxA11yPanelCopy>>(\n 'CngxA11yPanelSectionCopy',\n { providedIn: 'root', factory: () => a11yPanelBundle.build() },\n);\n\ninterface SiteDefaults {\n readonly labels: Signal<CngxA11yPanelLabels>;\n readonly options: Signal<CngxA11yPanelOptionLabels>;\n}\n\nconst SITES = new WeakMap<Signal<CngxA11yPanelCopy>, SiteDefaults>();\n\n/**\n * @internal The panel copy at the reading site, each part its own signal.\n * Memoized per copy signal. Injection context required.\n */\nexport function injectA11yPanelSiteCopy(): SiteDefaults {\n const copy = a11yPanelBundle.resolve(inject(A11Y_PANEL_SECTION_COPY));\n let site = SITES.get(copy);\n if (!site) {\n site = {\n labels: computed(() => copy().labels, { equal: recordEqual }),\n options: computed(() => copy().options, { equal: recordEqual }),\n };\n SITES.set(copy, site);\n }\n return site;\n}\n","import {\n computed,\n inject,\n InjectionToken,\n makeEnvironmentProviders,\n Optional,\n SkipSelf,\n type EnvironmentProviders,\n type Provider,\n type Signal,\n} from '@angular/core';\nimport type {\n CngxContrastPreference,\n CngxDensityValue,\n CngxMotionPreference,\n CngxTextScaleValue,\n} from '@cngx/core';\nimport { coerceSignal, createDefaultsFill, createNestedOverrideMerge } from '@cngx/core/utils';\n\nimport { injectA11yPanelSiteCopy, type CngxA11yPanelOptionLabels } from './i18n/a11y-panel-i18n';\n\n/**\n * The four accessibility axes the panel can render a control group for.\n * Each maps 1:1 onto a writable signal returned by `injectA11yPreferences()`.\n *\n * @category ui/a11y\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport type CngxA11yPanelAxis = 'density' | 'textScale' | 'motion' | 'contrast';\n\n/**\n * One selectable option in an axis control group: the value written to the\n * axis signal plus the visible/toggle label. `V` is the axis' own value union\n * (e.g. `CngxDensityValue`), so a misspelled value fails to compile rather\n * than reaching the global preference signal. An option without a `label`\n * reads it from the `a11yPanel` section of the language pack, by value.\n *\n * @category ui/a11y\n * @relatedTo withA11yPanelAxes\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport interface CngxA11yPanelAxisOption<V extends string = string> {\n /** Value written to the axis signal - a valid member of that axis' union. */\n readonly value: V;\n /**\n * Toggle-button label. Leave it out to read the label for `value` from the\n * `a11yPanel` section of the language pack (English without one), so the\n * option follows a language switch. A label set here wins.\n */\n readonly label?: string;\n}\n\n/**\n * A rendered axis control group: which axis, its ordered options, and the\n * value Reset restores (the axis' own library default). This is a\n * discriminated union on `axis`, so `options` and `reset` are typed to that\n * axis' value union - a `{ axis: 'density', reset: 'x' }` is a compile error,\n * not a garbage value written to `<html data-density>`. Reorder or drop axes\n * by supplying a subset via `withA11yPanelAxes`.\n *\n * @category ui/a11y\n * @relatedTo withA11yPanelAxes\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport type CngxA11yPanelAxisSpec =\n | {\n readonly axis: 'density';\n readonly options: readonly CngxA11yPanelAxisOption<CngxDensityValue>[];\n readonly reset: CngxDensityValue;\n }\n | {\n readonly axis: 'textScale';\n readonly options: readonly CngxA11yPanelAxisOption<CngxTextScaleValue>[];\n readonly reset: CngxTextScaleValue;\n }\n | {\n readonly axis: 'motion';\n readonly options: readonly CngxA11yPanelAxisOption<CngxMotionPreference>[];\n readonly reset: CngxMotionPreference;\n }\n | {\n readonly axis: 'contrast';\n readonly options: readonly CngxA11yPanelAxisOption<CngxContrastPreference>[];\n readonly reset: CngxContrastPreference;\n };\n\n/**\n * Panel text: per-axis group labels, the Reset control label, the default\n * heading (shown when no `[cngxA11yPanelHeader]` is projected), and the\n * live-region message announced on Reset. The defaults come from the\n * `a11yPanel` section of the language pack (English without one); override\n * single keys via {@link withA11yPanelLabels}.\n *\n * @category ui/a11y\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport interface CngxA11yPanelLabels {\n /** Group label (the accessible name) per axis. */\n readonly axes: Readonly<Record<CngxA11yPanelAxis, string>>;\n /** Reset control label. */\n readonly reset: string;\n /** Default heading, shown when no `[cngxA11yPanelHeader]` slot is projected. */\n readonly heading: string;\n /** Live-announced when Reset restores every axis. */\n readonly resetMessage: string;\n}\n\n/**\n * Resolved panel configuration - the text overrides plus the ordered axis\n * list. Merged from the library defaults and any `with*` features by the\n * reducer in {@link provideA11yPanelConfig}.\n *\n * `labels` holds overrides only: unset by default, a value or a `Signal` once\n * {@link withA11yPanelLabels} ran; every key it leaves out reads the\n * `a11yPanel` section of the language pack. `axes` accepts a value or a\n * `Signal`; its option labels are optional and default to the section. Read\n * both through {@link injectA11yPanelLabels} and {@link injectA11yPanelAxes}.\n *\n * @category ui/a11y\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport interface CngxA11yPanelConfig {\n readonly labels?: CngxA11yPanelLabelsOverride | Signal<CngxA11yPanelLabelsOverride>;\n readonly axes: readonly CngxA11yPanelAxisSpec[] | Signal<readonly CngxA11yPanelAxisSpec[]>;\n}\n\n/**\n * Partial text override accepted by `withA11yPanelLabels`. The `axes`\n * record merges key-by-key, so a consumer can relabel one axis group without\n * restating the rest.\n *\n * @category ui/a11y\n * @relatedTo withA11yPanelLabels\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport interface CngxA11yPanelLabelsOverride {\n readonly axes?: Partial<Record<CngxA11yPanelAxis, string>>;\n readonly reset?: string;\n readonly heading?: string;\n readonly resetMessage?: string;\n}\n\n/**\n * Library defaults: the four axes in their default order, each with its reset\n * value. Carries no copy - the text and the option labels are the `a11yPanel`\n * section of the language pack. Override via {@link provideA11yPanelConfig}.\n */\nexport const CNGX_A11Y_PANEL_DEFAULTS: CngxA11yPanelConfig & {\n readonly axes: readonly CngxA11yPanelAxisSpec[];\n} = {\n axes: [\n {\n axis: 'density',\n reset: 'comfortable',\n options: [{ value: 'compact' }, { value: 'comfortable' }, { value: 'spacious' }],\n },\n {\n axis: 'textScale',\n reset: 'md',\n options: [{ value: 'sm' }, { value: 'md' }, { value: 'lg' }],\n },\n {\n axis: 'motion',\n reset: 'auto',\n options: [{ value: 'full' }, { value: 'reduced' }, { value: 'auto' }],\n },\n {\n axis: 'contrast',\n reset: 'auto',\n options: [{ value: 'normal' }, { value: 'more' }, { value: 'auto' }],\n },\n ],\n};\n\nconst NO_LABELS: CngxA11yPanelLabelsOverride = {};\n\n/**\n * Configuration cascade token. Resolution priority (high to low):\n * `provideA11yPanelConfigAt(...)` in a component's `viewProviders`, then\n * `provideA11yPanelConfig(...)` at the application root, then the library\n * defaults.\n *\n * @category ui/a11y\n * @relatedTo provideA11yPanelConfig\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport const CNGX_A11Y_PANEL_CONFIG = new InjectionToken<CngxA11yPanelConfig>(\n 'CngxA11yPanelConfig',\n {\n providedIn: 'root',\n factory: () => CNGX_A11Y_PANEL_DEFAULTS,\n },\n);\n\n/**\n * A single configuration override produced by a `with*` feature factory. The\n * reducer in {@link provideA11yPanelConfig} matches on `kind`: `labels` deep-\n * merges the text bundle, `axes` replaces the axis list wholesale.\n *\n * @category ui/a11y\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport type CngxA11yPanelConfigFeature =\n | {\n readonly kind: 'labels';\n readonly payload: CngxA11yPanelLabelsOverride | Signal<CngxA11yPanelLabelsOverride>;\n }\n | {\n readonly kind: 'axes';\n readonly payload: readonly CngxA11yPanelAxisSpec[] | Signal<readonly CngxA11yPanelAxisSpec[]>;\n };\n\n/** Reduce a feature list onto a base config, merging text and axes in isolation. */\nfunction applyFeatures(\n base: CngxA11yPanelConfig,\n features: readonly CngxA11yPanelConfigFeature[],\n): CngxA11yPanelConfig {\n let labels = base.labels;\n let axes = base.axes;\n for (const feature of features) {\n if (feature.kind === 'labels') {\n labels = createNestedOverrideMerge(labels ?? NO_LABELS, feature.payload, 'axes');\n } else {\n axes = feature.payload;\n }\n }\n return { labels, axes };\n}\n\n/**\n * Override any subset of the panel text - axis group labels, the Reset label,\n * the default heading, or the Reset announcement. The `axes` record merges\n * key-by-key, so a single axis can be relabelled in isolation. Pass a `Signal`\n * to switch the language at runtime.\n *\n * ```ts\n * provideA11yPanelConfig(\n * withA11yPanelLabels({\n * heading: 'Barrierefreiheit',\n * axes: { motion: 'Bewegung' },\n * resetMessage: 'Einstellungen zurueckgesetzt',\n * }),\n * );\n * ```\n *\n * @category ui/a11y\n * @relatedTo provideA11yPanelConfig\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport function withA11yPanelLabels(\n payload: CngxA11yPanelLabelsOverride | Signal<CngxA11yPanelLabelsOverride>,\n): CngxA11yPanelConfigFeature {\n return { kind: 'labels', payload };\n}\n\n/**\n * Replace the rendered axis list - reorder groups, drop an axis, or restrict\n * the options a group offers. Supplying a subset renders only those groups.\n * Leave an option's `label` out and it reads the `a11yPanel` section of the\n * language pack, so the options translate without restating the list; pass a\n * `Signal` to relabel options you set yourself on a runtime language switch.\n *\n * ```ts\n * provideA11yPanelConfig(\n * withA11yPanelAxes([\n * { axis: 'textScale', reset: 'md', options: [\n * { value: 'md' },\n * { value: 'lg', label: 'Bigger' },\n * ] },\n * ]),\n * );\n * ```\n *\n * @category ui/a11y\n * @relatedTo provideA11yPanelConfig\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport function withA11yPanelAxes(\n payload: readonly CngxA11yPanelAxisSpec[] | Signal<readonly CngxA11yPanelAxisSpec[]>,\n): CngxA11yPanelConfigFeature {\n return { kind: 'axes', payload };\n}\n\n/**\n * Application-root configuration cascade for the accessibility panel. Pass any\n * combination of `with*` features in `bootstrapApplication`'s providers;\n * supplied features merge with the library defaults, so consumers only declare\n * what they override.\n *\n * @category ui/a11y\n * @relatedTo withA11yPanelLabels\n * @relatedTo withA11yPanelAxes\n * @relatedTo injectA11yPanelConfig\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport function provideA11yPanelConfig(\n ...features: CngxA11yPanelConfigFeature[]\n): EnvironmentProviders {\n // Empty-features: leave the root default reference untouched so downstream\n // identity comparisons stay stable.\n if (features.length === 0) {\n return makeEnvironmentProviders([]);\n }\n return makeEnvironmentProviders([\n {\n provide: CNGX_A11Y_PANEL_CONFIG,\n useValue: applyFeatures(CNGX_A11Y_PANEL_DEFAULTS, features),\n },\n ]);\n}\n\n/**\n * Component-scoped configuration override. Pass into a component's or\n * directive's `viewProviders`; features merge on top of the parent config (an\n * enclosing scope or the application root), so one panel can re-scope its axis\n * subset or labels without disturbing the rest of the app. This is the\n * component-scope tier of the resolution cascade: `provideA11yPanelConfigAt`\n * (nearest) wins over `provideA11yPanelConfig` (root), which wins over the\n * library defaults.\n *\n * ```ts\n * @Component({\n * viewProviders: [\n * provideA11yPanelConfigAt(withA11yPanelAxes([\n * { axis: 'textScale', reset: 'md', options: [\n * { value: 'md', label: 'Default' },\n * { value: 'lg', label: 'Large' },\n * ] },\n * ])),\n * ],\n * })\n * ```\n *\n * @category ui/a11y\n * @relatedTo provideA11yPanelConfig\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport function provideA11yPanelConfigAt(...features: CngxA11yPanelConfigFeature[]): Provider[] {\n return [\n {\n provide: CNGX_A11Y_PANEL_CONFIG,\n useFactory: (parent: CngxA11yPanelConfig | null) =>\n applyFeatures(parent ?? CNGX_A11Y_PANEL_DEFAULTS, features),\n deps: [[new SkipSelf(), new Optional(), CNGX_A11Y_PANEL_CONFIG]],\n },\n ];\n}\n\n/**\n * Convenience accessor for the resolved panel configuration. Runs in an\n * injection context; resolves through the cascade. Equivalent to\n * `inject(CNGX_A11Y_PANEL_CONFIG)`.\n *\n * @category ui/a11y\n * @relatedTo provideA11yPanelConfig\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport function injectA11yPanelConfig(): CngxA11yPanelConfig {\n return inject(CNGX_A11Y_PANEL_CONFIG);\n}\n\n/**\n * The resolved text bundle of the panel config in scope, as a Signal that\n * follows a runtime language switch: the config overrides over the `a11yPanel`\n * section of the active pack, the `axes` record merged key by key. A key the\n * config leaves unset, `null` or `undefined` reads the section. Runs in an\n * injection context; read it inside a `computed()`, a template or a handler.\n *\n * @category ui/a11y\n * @relatedTo withA11yPanelLabels\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport function injectA11yPanelLabels(): Signal<CngxA11yPanelLabels> {\n const section = injectA11yPanelSiteCopy().labels;\n return createDefaultsFill<CngxA11yPanelLabels, 'axes'>(\n createNestedOverrideMerge<CngxA11yPanelLabels, 'axes'>(\n section,\n injectA11yPanelConfig().labels,\n 'axes',\n ),\n section,\n 'axes',\n );\n}\n\n/** Options keyed by their array, then by the option-label record they were resolved against. */\nconst RESOLVED_OPTIONS = new WeakMap<\n readonly CngxA11yPanelAxisOption[],\n WeakMap<object, readonly CngxA11yPanelAxisOption[]>\n>();\n\n/** `options` with every missing label read from `labels`, by value. Memoized per input pair. */\nfunction resolveOptions(\n options: readonly CngxA11yPanelAxisOption[],\n labels: Readonly<Record<string, string>>,\n): readonly CngxA11yPanelAxisOption[] {\n let byLabels = RESOLVED_OPTIONS.get(options);\n if (!byLabels) {\n byLabels = new WeakMap();\n RESOLVED_OPTIONS.set(options, byLabels);\n }\n let resolved = byLabels.get(labels);\n if (!resolved) {\n resolved = options.map((option) =>\n option.label === undefined ? { ...option, label: labels[option.value] } : option,\n );\n byLabels.set(labels, resolved);\n }\n return resolved;\n}\n\n/** Axis lists are equal when every spec keeps its axis, reset target and options array. */\nfunction sameAxes(\n a: readonly CngxA11yPanelAxisSpec[],\n b: readonly CngxA11yPanelAxisSpec[],\n): boolean {\n return (\n a.length === b.length &&\n a.every(\n (spec, i) =>\n spec.axis === b[i].axis && spec.reset === b[i].reset && spec.options === b[i].options,\n )\n );\n}\n\n/** Resolved axis lists, memoized per config object and option-label signal. */\nconst RESOLVED_AXES = new WeakMap<\n CngxA11yPanelConfig,\n WeakMap<Signal<CngxA11yPanelOptionLabels>, Signal<readonly CngxA11yPanelAxisSpec[]>>\n>();\n\n/** The axis list with every option label filled. Kept out of a field initializer for compodocx. */\nfunction resolveAxes(\n axes: readonly CngxA11yPanelAxisSpec[],\n optionLabels: CngxA11yPanelOptionLabels,\n): readonly CngxA11yPanelAxisSpec[] {\n return axes.map(\n (spec) =>\n ({\n ...spec,\n options: resolveOptions(spec.options, optionLabels[spec.axis]),\n }) as CngxA11yPanelAxisSpec,\n );\n}\n\n/**\n * The resolved axis list of the panel config in scope (values, option labels\n * and reset targets), as a Signal that follows a runtime language switch.\n * Every option without its own `label` carries the label for its value from\n * the `a11yPanel` section of the active pack. Runs in an injection context.\n *\n * @category ui/a11y\n * @relatedTo withA11yPanelAxes\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts\n * @since 0.1.0\n */\nexport function injectA11yPanelAxes(): Signal<readonly CngxA11yPanelAxisSpec[]> {\n const config = injectA11yPanelConfig();\n const optionLabels = injectA11yPanelSiteCopy().options;\n let byLabels = RESOLVED_AXES.get(config);\n if (!byLabels) {\n byLabels = new WeakMap();\n RESOLVED_AXES.set(config, byLabels);\n }\n const cached = byLabels.get(optionLabels);\n if (cached) {\n return cached;\n }\n const axes = coerceSignal(config.axes);\n const resolved = computed(() => resolveAxes(axes(), optionLabels()), { equal: sameAxes });\n byLabels.set(optionLabels, resolved);\n return resolved;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n ViewEncapsulation,\n type Signal,\n type WritableSignal,\n} from '@angular/core';\nimport { CngxLiveAnnouncer } from '@cngx/common/a11y';\nimport { CngxButtonToggle, CngxButtonToggleGroup } from '@cngx/common/interactive';\nimport { CngxCard, CngxCardBody, CngxCardFooter, CngxCardHeader } from '@cngx/common/card';\nimport { injectA11yPreferences } from '@cngx/core';\nimport { nextUid } from '@cngx/core/utils';\n\nimport {\n type CngxA11yPanelAxis,\n type CngxA11yPanelAxisOption,\n type CngxA11yPanelAxisSpec,\n type CngxA11yPanelLabels,\n injectA11yPanelAxes,\n injectA11yPanelLabels,\n} from './a11y-panel.config';\n\n/**\n * One rendered axis group, resolved once from the config against the\n * matching preference signal. `value` reads the current axis value as a\n * string; `commit` writes a picked option back through the same signal.\n * @internal\n */\ninterface CngxA11yPanelAxisView {\n readonly axis: CngxA11yPanelAxis;\n readonly label: string;\n readonly labelId: string;\n readonly options: readonly CngxA11yPanelAxisOption[];\n readonly value: Signal<string>;\n readonly commit: (next: string | undefined) => void;\n}\n\n/** Views are equal when every group keeps its axis, label and options. */\nfunction sameAxisViews(\n a: readonly CngxA11yPanelAxisView[],\n b: readonly CngxA11yPanelAxisView[],\n): boolean {\n return (\n a.length === b.length &&\n a.every(\n (view, i) =>\n view.axis === b[i].axis && view.label === b[i].label && view.options === b[i].options,\n )\n );\n}\n\n/**\n * Batteries-included accessibility preferences card. Renders one labelled\n * `cngx-button-toggle-group` per configured axis (spacing/density, text size,\n * motion, contrast), each split-bound to the app-wide preference signal from\n * `injectA11yPreferences()`, plus a Reset that restores every axis to its\n * library default and announces the change.\n *\n * It ships no trigger, no overlay, and no placement of its own - it is a plain\n * in-flow `CngxCard`. The consumer decides where it appears: inline, inside a\n * `CngxDrawer`, inside a `CngxDialog`, or behind their own popover trigger.\n * This mirrors `CngxListbox` under `CngxSelect` - the panel owns the axis\n * controls, the consumer owns the overlay.\n *\n * Composition over reinvention (Pillar 3): the shell is `CngxCard`, each\n * control is `CngxButtonToggleGroup` (roving tabindex + `model` value), and the\n * Reset announcement rides the shared root `CngxLiveAnnouncer` - no hand-rolled\n * card, control, or live region. The axis ARIA is the toggle group's own\n * reactive `computed()` output (Pillar 2).\n *\n * ```html\n * <cngx-a11y-panel />\n * ```\n *\n * @category ui/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.component.ts\n * @selector cngx-a11y-panel\n * @since 0.1.0\n * @relatedTo CngxCard, CngxButtonToggleGroup, CngxLiveAnnouncer, provideA11yPreferences, provideA11yPanelConfig\n * <example-url>http://localhost:4200/#/ui/a11y/panel/inline</example-url>\n */\n@Component({\n selector: 'cngx-a11y-panel',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [\n CngxCard,\n CngxCardHeader,\n CngxCardBody,\n CngxCardFooter,\n CngxButtonToggleGroup,\n CngxButtonToggle,\n ],\n templateUrl: './a11y-panel.component.html',\n styleUrls: ['./a11y-panel.component.css'],\n host: { class: 'cngx-a11y-panel-host' },\n})\nexport class CngxA11yPanel {\n private readonly announcer = inject(CngxLiveAnnouncer);\n private readonly prefs = injectA11yPreferences();\n protected readonly labels = injectA11yPanelLabels();\n private readonly axes = injectA11yPanelAxes();\n private readonly uid = nextUid('cngx-a11y-panel');\n\n /**\n * The axis groups to render, rebuilt when the axis list or the labels change\n * so both follow a language switch. A rebuild that yields the same axes,\n * labels and options keeps the previous array. Each view's `value` is the\n * axis preference itself, so picking an option re-renders only that group.\n */\n protected readonly axisViews = computed(\n () => this.buildAxisViews(this.axes(), this.labels()),\n { equal: sameAxisViews },\n );\n\n // Kept as a method, not an inline `.map()` field initializer: compodocx's\n // property-default serializer catastrophically backtracks on a `.map` that\n // returns object literals with nested arrow functions, hanging docs:json.\n private buildAxisViews(\n axes: readonly CngxA11yPanelAxisSpec[],\n labels: CngxA11yPanelLabels,\n ): readonly CngxA11yPanelAxisView[] {\n return axes.map((spec) => {\n // `CngxA11yPanelAxisSpec` is a discriminated union whose options/reset are\n // typed to each axis' value union, so every value reaching this write is\n // compile-checked valid. Erasing the invariant signal type to `string`\n // here is then safe-by-construction - the union just can't be narrowed\n // through a runtime `spec.axis` index without duplicating the map per axis.\n const sig = this.prefs[spec.axis] as unknown as WritableSignal<string>;\n return {\n axis: spec.axis,\n label: labels.axes[spec.axis],\n labelId: `${this.uid}-${spec.axis}`,\n options: spec.options,\n value: sig.asReadonly(),\n commit: (next: string | undefined) => {\n // `CngxButtonToggleGroup.value` is `model<T | undefined>`; this group\n // never deselects, so `undefined` is never emitted, but the guard\n // keeps the non-undefined axis setter type-safe under strictTemplates.\n if (next !== undefined) {\n sig.set(next);\n }\n },\n };\n });\n }\n\n protected reset(): void {\n for (const spec of this.axes()) {\n (this.prefs[spec.axis] as unknown as WritableSignal<string>).set(spec.reset);\n }\n // Bulk multi-axis change with focus staying on Reset: announce it (Pillar 2)\n // through the shared root live region rather than a private one.\n this.announcer.announce(this.labels().resetMessage);\n }\n}\n","<cngx-card class=\"cngx-a11y-panel\">\n <header cngxCardHeader class=\"cngx-a11y-panel__header\">\n <ng-content select=\"[cngxA11yPanelHeader]\">\n <h2 class=\"cngx-a11y-panel__heading\">{{ labels().heading }}</h2>\n </ng-content>\n </header>\n\n <div cngxCardBody class=\"cngx-a11y-panel__body\">\n @for (axis of axisViews(); track axis.axis) {\n <div class=\"cngx-a11y-panel__axis\">\n <span class=\"cngx-a11y-panel__axis-label\" [id]=\"axis.labelId\">{{ axis.label }}</span>\n <cngx-button-toggle-group\n class=\"cngx-a11y-panel__group\"\n [labelledBy]=\"axis.labelId\"\n [value]=\"axis.value()\"\n (valueChange)=\"axis.commit($event)\"\n >\n @for (option of axis.options; track option.value) {\n <button cngxButtonToggle [value]=\"option.value\">{{ option.label }}</button>\n }\n </cngx-button-toggle-group>\n </div>\n }\n </div>\n\n <footer cngxCardFooter class=\"cngx-a11y-panel__footer\">\n <button type=\"button\" class=\"cngx-a11y-panel__reset\" (click)=\"reset()\">\n {{ labels().reset }}\n </button>\n </footer>\n</cngx-card>\n","/**\n * @module @cngx/ui/a11y\n */\n\nexport { CngxA11yPanel } from './a11y-panel.component';\n\nexport {\n CNGX_A11Y_PANEL_CONFIG,\n CNGX_A11Y_PANEL_DEFAULTS,\n provideA11yPanelConfig,\n provideA11yPanelConfigAt,\n withA11yPanelLabels,\n withA11yPanelAxes,\n injectA11yPanelConfig,\n injectA11yPanelLabels,\n injectA11yPanelAxes,\n} from './a11y-panel.config';\nexport type {\n CngxA11yPanelConfig,\n CngxA11yPanelAxis,\n CngxA11yPanelAxisSpec,\n CngxA11yPanelAxisOption,\n CngxA11yPanelLabels,\n CngxA11yPanelLabelsOverride,\n CngxA11yPanelConfigFeature,\n} from './a11y-panel.config';\nexport {\n CNGX_A11Y_PANEL_LANGUAGE_EN,\n type CngxA11yPanelLanguageSection,\n} from './i18n/a11y-panel-language-section';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AAqCA;;;;;;;;AAQG;AACI,MAAM,2BAA2B,GAAiC;AACvE,IAAA,OAAO,EAAE,eAAe;AACxB,IAAA,KAAK,EAAE,mBAAmB;AAC1B,IAAA,YAAY,EAAE,+BAA+B;AAC7C,IAAA,IAAI,EAAE;AACJ,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,SAAS,EAAE,WAAW;AACtB,QAAA,MAAM,EAAE,QAAQ;AAChB,QAAA,QAAQ,EAAE,UAAU;AACrB,KAAA;AACD,IAAA,OAAO,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE;AACjF,IAAA,SAAS,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE;AACtD,IAAA,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE;AAC5D,IAAA,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;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