@cngx/ui 0.1.0-rc.6 → 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 (102) hide show
  1. package/README.md +112 -1
  2. package/a11y/README.md +87 -0
  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/context-menu/README.md +98 -0
  8. package/data-grid-accordion/README.md +103 -2
  9. package/feedback/README.md +42 -0
  10. package/fesm2022/cngx-ui-a11y.mjs +452 -0
  11. package/fesm2022/cngx-ui-a11y.mjs.map +1 -0
  12. package/fesm2022/cngx-ui-accordion.mjs +116 -38
  13. package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
  14. package/fesm2022/cngx-ui-action-button.mjs +115 -50
  15. package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
  16. package/fesm2022/cngx-ui-breadcrumb.mjs +181 -96
  17. package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
  18. package/fesm2022/cngx-ui-chart-panel.mjs +586 -0
  19. package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -0
  20. package/fesm2022/cngx-ui-collection.mjs +207 -66
  21. package/fesm2022/cngx-ui-collection.mjs.map +1 -1
  22. package/fesm2022/cngx-ui-command-palette.mjs +1281 -0
  23. package/fesm2022/cngx-ui-command-palette.mjs.map +1 -0
  24. package/fesm2022/cngx-ui-context-menu.mjs +857 -0
  25. package/fesm2022/cngx-ui-context-menu.mjs.map +1 -0
  26. package/fesm2022/cngx-ui-data-grid-accordion.mjs +498 -111
  27. package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
  28. package/fesm2022/cngx-ui-empty-state.mjs +16 -6
  29. package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
  30. package/fesm2022/cngx-ui-feedback.mjs +1095 -521
  31. package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
  32. package/fesm2022/cngx-ui-layout.mjs +18 -9
  33. package/fesm2022/cngx-ui-layout.mjs.map +1 -1
  34. package/fesm2022/cngx-ui-mat-accordion.mjs +84 -16
  35. package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
  36. package/fesm2022/cngx-ui-mat-paginator.mjs +67 -24
  37. package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
  38. package/fesm2022/cngx-ui-mat-stepper.mjs +72 -47
  39. package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
  40. package/fesm2022/cngx-ui-mat-tabs.mjs +370 -203
  41. package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
  42. package/fesm2022/cngx-ui-overlay.mjs +69 -13
  43. package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
  44. package/fesm2022/cngx-ui-paginator.mjs +501 -182
  45. package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
  46. package/fesm2022/cngx-ui-sidenav.mjs +327 -106
  47. package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
  48. package/fesm2022/cngx-ui-skeleton.mjs +22 -21
  49. package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
  50. package/fesm2022/cngx-ui-speak.mjs +107 -8
  51. package/fesm2022/cngx-ui-speak.mjs.map +1 -1
  52. package/fesm2022/cngx-ui-stat-card.mjs +718 -0
  53. package/fesm2022/cngx-ui-stat-card.mjs.map +1 -0
  54. package/fesm2022/cngx-ui-stepper.mjs +217 -76
  55. package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
  56. package/fesm2022/cngx-ui-tabs.mjs +40 -19
  57. package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
  58. package/fesm2022/cngx-ui-timeline.mjs +548 -0
  59. package/fesm2022/cngx-ui-timeline.mjs.map +1 -0
  60. package/fesm2022/cngx-ui-toc.mjs +748 -0
  61. package/fesm2022/cngx-ui-toc.mjs.map +1 -0
  62. package/fesm2022/cngx-ui.mjs +16 -21
  63. package/fesm2022/cngx-ui.mjs.map +1 -1
  64. package/mat-accordion/README.md +1 -1
  65. package/mat-paginator/README.md +9 -2
  66. package/mat-tabs/styles/mat-tabs.css +29 -27
  67. package/overlay/README.md +9 -4
  68. package/package.json +32 -1
  69. package/paginator/README.md +8 -4
  70. package/sidenav/README.md +33 -11
  71. package/skeleton/README.md +2 -0
  72. package/speak/README.md +3 -2
  73. package/stepper/README.md +15 -3
  74. package/timeline/README.md +350 -0
  75. package/toc/README.md +186 -0
  76. package/types/cngx-ui-a11y.d.ts +394 -0
  77. package/types/cngx-ui-accordion.d.ts +100 -30
  78. package/types/cngx-ui-action-button.d.ts +47 -3
  79. package/types/cngx-ui-breadcrumb.d.ts +159 -58
  80. package/types/cngx-ui-chart-panel.d.ts +382 -0
  81. package/types/cngx-ui-collection.d.ts +159 -58
  82. package/types/cngx-ui-command-palette.d.ts +565 -0
  83. package/types/cngx-ui-context-menu.d.ts +559 -0
  84. package/types/cngx-ui-data-grid-accordion.d.ts +344 -51
  85. package/types/cngx-ui-empty-state.d.ts +9 -2
  86. package/types/cngx-ui-feedback.d.ts +664 -73
  87. package/types/cngx-ui-layout.d.ts +8 -3
  88. package/types/cngx-ui-mat-accordion.d.ts +32 -4
  89. package/types/cngx-ui-mat-paginator.d.ts +37 -8
  90. package/types/cngx-ui-mat-stepper.d.ts +23 -11
  91. package/types/cngx-ui-mat-tabs.d.ts +218 -23
  92. package/types/cngx-ui-overlay.d.ts +56 -10
  93. package/types/cngx-ui-paginator.d.ts +416 -132
  94. package/types/cngx-ui-sidenav.d.ts +248 -74
  95. package/types/cngx-ui-skeleton.d.ts +18 -7
  96. package/types/cngx-ui-speak.d.ts +118 -5
  97. package/types/cngx-ui-stat-card.d.ts +411 -0
  98. package/types/cngx-ui-stepper.d.ts +81 -29
  99. package/types/cngx-ui-tabs.d.ts +22 -6
  100. package/types/cngx-ui-timeline.d.ts +495 -0
  101. package/types/cngx-ui-toc.d.ts +581 -0
  102. package/types/cngx-ui.d.ts +8 -5
@@ -0,0 +1,394 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, Signal, EnvironmentProviders, Provider } from '@angular/core';
3
+ import { CngxDensityValue, CngxTextScaleValue, CngxMotionPreference, CngxContrastPreference } from '@cngx/core';
4
+
5
+ /**
6
+ * The four accessibility axes the panel can render a control group for.
7
+ * Each maps 1:1 onto a writable signal returned by `injectA11yPreferences()`.
8
+ *
9
+ * @category ui/a11y
10
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts
11
+ * @since 0.1.0
12
+ */
13
+ type CngxA11yPanelAxis = 'density' | 'textScale' | 'motion' | 'contrast';
14
+ /**
15
+ * One selectable option in an axis control group: the value written to the
16
+ * axis signal plus the visible/toggle label. `V` is the axis' own value union
17
+ * (e.g. `CngxDensityValue`), so a misspelled value fails to compile rather
18
+ * than reaching the global preference signal. An option without a `label`
19
+ * reads it from the `a11yPanel` section of the language pack, by value.
20
+ *
21
+ * @category ui/a11y
22
+ * @relatedTo withA11yPanelAxes
23
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts
24
+ * @since 0.1.0
25
+ */
26
+ interface CngxA11yPanelAxisOption<V extends string = string> {
27
+ /** Value written to the axis signal - a valid member of that axis' union. */
28
+ readonly value: V;
29
+ /**
30
+ * Toggle-button label. Leave it out to read the label for `value` from the
31
+ * `a11yPanel` section of the language pack (English without one), so the
32
+ * option follows a language switch. A label set here wins.
33
+ */
34
+ readonly label?: string;
35
+ }
36
+ /**
37
+ * A rendered axis control group: which axis, its ordered options, and the
38
+ * value Reset restores (the axis' own library default). This is a
39
+ * discriminated union on `axis`, so `options` and `reset` are typed to that
40
+ * axis' value union - a `{ axis: 'density', reset: 'x' }` is a compile error,
41
+ * not a garbage value written to `<html data-density>`. Reorder or drop axes
42
+ * by supplying a subset via `withA11yPanelAxes`.
43
+ *
44
+ * @category ui/a11y
45
+ * @relatedTo withA11yPanelAxes
46
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts
47
+ * @since 0.1.0
48
+ */
49
+ type CngxA11yPanelAxisSpec = {
50
+ readonly axis: 'density';
51
+ readonly options: readonly CngxA11yPanelAxisOption<CngxDensityValue>[];
52
+ readonly reset: CngxDensityValue;
53
+ } | {
54
+ readonly axis: 'textScale';
55
+ readonly options: readonly CngxA11yPanelAxisOption<CngxTextScaleValue>[];
56
+ readonly reset: CngxTextScaleValue;
57
+ } | {
58
+ readonly axis: 'motion';
59
+ readonly options: readonly CngxA11yPanelAxisOption<CngxMotionPreference>[];
60
+ readonly reset: CngxMotionPreference;
61
+ } | {
62
+ readonly axis: 'contrast';
63
+ readonly options: readonly CngxA11yPanelAxisOption<CngxContrastPreference>[];
64
+ readonly reset: CngxContrastPreference;
65
+ };
66
+ /**
67
+ * Panel text: per-axis group labels, the Reset control label, the default
68
+ * heading (shown when no `[cngxA11yPanelHeader]` is projected), and the
69
+ * live-region message announced on Reset. The defaults come from the
70
+ * `a11yPanel` section of the language pack (English without one); override
71
+ * single keys via {@link withA11yPanelLabels}.
72
+ *
73
+ * @category ui/a11y
74
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts
75
+ * @since 0.1.0
76
+ */
77
+ interface CngxA11yPanelLabels {
78
+ /** Group label (the accessible name) per axis. */
79
+ readonly axes: Readonly<Record<CngxA11yPanelAxis, string>>;
80
+ /** Reset control label. */
81
+ readonly reset: string;
82
+ /** Default heading, shown when no `[cngxA11yPanelHeader]` slot is projected. */
83
+ readonly heading: string;
84
+ /** Live-announced when Reset restores every axis. */
85
+ readonly resetMessage: string;
86
+ }
87
+ /**
88
+ * Resolved panel configuration - the text overrides plus the ordered axis
89
+ * list. Merged from the library defaults and any `with*` features by the
90
+ * reducer in {@link provideA11yPanelConfig}.
91
+ *
92
+ * `labels` holds overrides only: unset by default, a value or a `Signal` once
93
+ * {@link withA11yPanelLabels} ran; every key it leaves out reads the
94
+ * `a11yPanel` section of the language pack. `axes` accepts a value or a
95
+ * `Signal`; its option labels are optional and default to the section. Read
96
+ * both through {@link injectA11yPanelLabels} and {@link injectA11yPanelAxes}.
97
+ *
98
+ * @category ui/a11y
99
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts
100
+ * @since 0.1.0
101
+ */
102
+ interface CngxA11yPanelConfig {
103
+ readonly labels?: CngxA11yPanelLabelsOverride | Signal<CngxA11yPanelLabelsOverride>;
104
+ readonly axes: readonly CngxA11yPanelAxisSpec[] | Signal<readonly CngxA11yPanelAxisSpec[]>;
105
+ }
106
+ /**
107
+ * Partial text override accepted by `withA11yPanelLabels`. The `axes`
108
+ * record merges key-by-key, so a consumer can relabel one axis group without
109
+ * restating the rest.
110
+ *
111
+ * @category ui/a11y
112
+ * @relatedTo withA11yPanelLabels
113
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts
114
+ * @since 0.1.0
115
+ */
116
+ interface CngxA11yPanelLabelsOverride {
117
+ readonly axes?: Partial<Record<CngxA11yPanelAxis, string>>;
118
+ readonly reset?: string;
119
+ readonly heading?: string;
120
+ readonly resetMessage?: string;
121
+ }
122
+ /**
123
+ * Library defaults: the four axes in their default order, each with its reset
124
+ * value. Carries no copy - the text and the option labels are the `a11yPanel`
125
+ * section of the language pack. Override via {@link provideA11yPanelConfig}.
126
+ */
127
+ declare const CNGX_A11Y_PANEL_DEFAULTS: CngxA11yPanelConfig & {
128
+ readonly axes: readonly CngxA11yPanelAxisSpec[];
129
+ };
130
+ /**
131
+ * Configuration cascade token. Resolution priority (high to low):
132
+ * `provideA11yPanelConfigAt(...)` in a component's `viewProviders`, then
133
+ * `provideA11yPanelConfig(...)` at the application root, then the library
134
+ * defaults.
135
+ *
136
+ * @category ui/a11y
137
+ * @relatedTo provideA11yPanelConfig
138
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts
139
+ * @since 0.1.0
140
+ */
141
+ declare const CNGX_A11Y_PANEL_CONFIG: InjectionToken<CngxA11yPanelConfig>;
142
+ /**
143
+ * A single configuration override produced by a `with*` feature factory. The
144
+ * reducer in {@link provideA11yPanelConfig} matches on `kind`: `labels` deep-
145
+ * merges the text bundle, `axes` replaces the axis list wholesale.
146
+ *
147
+ * @category ui/a11y
148
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts
149
+ * @since 0.1.0
150
+ */
151
+ type CngxA11yPanelConfigFeature = {
152
+ readonly kind: 'labels';
153
+ readonly payload: CngxA11yPanelLabelsOverride | Signal<CngxA11yPanelLabelsOverride>;
154
+ } | {
155
+ readonly kind: 'axes';
156
+ readonly payload: readonly CngxA11yPanelAxisSpec[] | Signal<readonly CngxA11yPanelAxisSpec[]>;
157
+ };
158
+ /**
159
+ * Override any subset of the panel text - axis group labels, the Reset label,
160
+ * the default heading, or the Reset announcement. The `axes` record merges
161
+ * key-by-key, so a single axis can be relabelled in isolation. Pass a `Signal`
162
+ * to switch the language at runtime.
163
+ *
164
+ * ```ts
165
+ * provideA11yPanelConfig(
166
+ * withA11yPanelLabels({
167
+ * heading: 'Barrierefreiheit',
168
+ * axes: { motion: 'Bewegung' },
169
+ * resetMessage: 'Einstellungen zurueckgesetzt',
170
+ * }),
171
+ * );
172
+ * ```
173
+ *
174
+ * @category ui/a11y
175
+ * @relatedTo provideA11yPanelConfig
176
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts
177
+ * @since 0.1.0
178
+ */
179
+ declare function withA11yPanelLabels(payload: CngxA11yPanelLabelsOverride | Signal<CngxA11yPanelLabelsOverride>): CngxA11yPanelConfigFeature;
180
+ /**
181
+ * Replace the rendered axis list - reorder groups, drop an axis, or restrict
182
+ * the options a group offers. Supplying a subset renders only those groups.
183
+ * Leave an option's `label` out and it reads the `a11yPanel` section of the
184
+ * language pack, so the options translate without restating the list; pass a
185
+ * `Signal` to relabel options you set yourself on a runtime language switch.
186
+ *
187
+ * ```ts
188
+ * provideA11yPanelConfig(
189
+ * withA11yPanelAxes([
190
+ * { axis: 'textScale', reset: 'md', options: [
191
+ * { value: 'md' },
192
+ * { value: 'lg', label: 'Bigger' },
193
+ * ] },
194
+ * ]),
195
+ * );
196
+ * ```
197
+ *
198
+ * @category ui/a11y
199
+ * @relatedTo provideA11yPanelConfig
200
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts
201
+ * @since 0.1.0
202
+ */
203
+ declare function withA11yPanelAxes(payload: readonly CngxA11yPanelAxisSpec[] | Signal<readonly CngxA11yPanelAxisSpec[]>): CngxA11yPanelConfigFeature;
204
+ /**
205
+ * Application-root configuration cascade for the accessibility panel. Pass any
206
+ * combination of `with*` features in `bootstrapApplication`'s providers;
207
+ * supplied features merge with the library defaults, so consumers only declare
208
+ * what they override.
209
+ *
210
+ * @category ui/a11y
211
+ * @relatedTo withA11yPanelLabels
212
+ * @relatedTo withA11yPanelAxes
213
+ * @relatedTo injectA11yPanelConfig
214
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts
215
+ * @since 0.1.0
216
+ */
217
+ declare function provideA11yPanelConfig(...features: CngxA11yPanelConfigFeature[]): EnvironmentProviders;
218
+ /**
219
+ * Component-scoped configuration override. Pass into a component's or
220
+ * directive's `viewProviders`; features merge on top of the parent config (an
221
+ * enclosing scope or the application root), so one panel can re-scope its axis
222
+ * subset or labels without disturbing the rest of the app. This is the
223
+ * component-scope tier of the resolution cascade: `provideA11yPanelConfigAt`
224
+ * (nearest) wins over `provideA11yPanelConfig` (root), which wins over the
225
+ * library defaults.
226
+ *
227
+ * ```ts
228
+ * @Component({
229
+ * viewProviders: [
230
+ * provideA11yPanelConfigAt(withA11yPanelAxes([
231
+ * { axis: 'textScale', reset: 'md', options: [
232
+ * { value: 'md', label: 'Default' },
233
+ * { value: 'lg', label: 'Large' },
234
+ * ] },
235
+ * ])),
236
+ * ],
237
+ * })
238
+ * ```
239
+ *
240
+ * @category ui/a11y
241
+ * @relatedTo provideA11yPanelConfig
242
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts
243
+ * @since 0.1.0
244
+ */
245
+ declare function provideA11yPanelConfigAt(...features: CngxA11yPanelConfigFeature[]): Provider[];
246
+ /**
247
+ * Convenience accessor for the resolved panel configuration. Runs in an
248
+ * injection context; resolves through the cascade. Equivalent to
249
+ * `inject(CNGX_A11Y_PANEL_CONFIG)`.
250
+ *
251
+ * @category ui/a11y
252
+ * @relatedTo provideA11yPanelConfig
253
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts
254
+ * @since 0.1.0
255
+ */
256
+ declare function injectA11yPanelConfig(): CngxA11yPanelConfig;
257
+ /**
258
+ * The resolved text bundle of the panel config in scope, as a Signal that
259
+ * follows a runtime language switch: the config overrides over the `a11yPanel`
260
+ * section of the active pack, the `axes` record merged key by key. A key the
261
+ * config leaves unset, `null` or `undefined` reads the section. Runs in an
262
+ * injection context; read it inside a `computed()`, a template or a handler.
263
+ *
264
+ * @category ui/a11y
265
+ * @relatedTo withA11yPanelLabels
266
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts
267
+ * @since 0.1.0
268
+ */
269
+ declare function injectA11yPanelLabels(): Signal<CngxA11yPanelLabels>;
270
+ /**
271
+ * The resolved axis list of the panel config in scope (values, option labels
272
+ * and reset targets), as a Signal that follows a runtime language switch.
273
+ * Every option without its own `label` carries the label for its value from
274
+ * the `a11yPanel` section of the active pack. Runs in an injection context.
275
+ *
276
+ * @category ui/a11y
277
+ * @relatedTo withA11yPanelAxes
278
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.config.ts
279
+ * @since 0.1.0
280
+ */
281
+ declare function injectA11yPanelAxes(): Signal<readonly CngxA11yPanelAxisSpec[]>;
282
+
283
+ /**
284
+ * One rendered axis group, resolved once from the config against the
285
+ * matching preference signal. `value` reads the current axis value as a
286
+ * string; `commit` writes a picked option back through the same signal.
287
+ * @internal
288
+ */
289
+ interface CngxA11yPanelAxisView {
290
+ readonly axis: CngxA11yPanelAxis;
291
+ readonly label: string;
292
+ readonly labelId: string;
293
+ readonly options: readonly CngxA11yPanelAxisOption[];
294
+ readonly value: Signal<string>;
295
+ readonly commit: (next: string | undefined) => void;
296
+ }
297
+ /**
298
+ * Batteries-included accessibility preferences card. Renders one labelled
299
+ * `cngx-button-toggle-group` per configured axis (spacing/density, text size,
300
+ * motion, contrast), each split-bound to the app-wide preference signal from
301
+ * `injectA11yPreferences()`, plus a Reset that restores every axis to its
302
+ * library default and announces the change.
303
+ *
304
+ * It ships no trigger, no overlay, and no placement of its own - it is a plain
305
+ * in-flow `CngxCard`. The consumer decides where it appears: inline, inside a
306
+ * `CngxDrawer`, inside a `CngxDialog`, or behind their own popover trigger.
307
+ * This mirrors `CngxListbox` under `CngxSelect` - the panel owns the axis
308
+ * controls, the consumer owns the overlay.
309
+ *
310
+ * Composition over reinvention (Pillar 3): the shell is `CngxCard`, each
311
+ * control is `CngxButtonToggleGroup` (roving tabindex + `model` value), and the
312
+ * Reset announcement rides the shared root `CngxLiveAnnouncer` - no hand-rolled
313
+ * card, control, or live region. The axis ARIA is the toggle group's own
314
+ * reactive `computed()` output (Pillar 2).
315
+ *
316
+ * ```html
317
+ * <cngx-a11y-panel />
318
+ * ```
319
+ *
320
+ * @category ui/a11y
321
+ * @docsKind primary
322
+ * @wcag AA
323
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/a11y/a11y-panel.component.ts
324
+ * @selector cngx-a11y-panel
325
+ * @since 0.1.0
326
+ * @relatedTo CngxCard, CngxButtonToggleGroup, CngxLiveAnnouncer, provideA11yPreferences, provideA11yPanelConfig
327
+ * <example-url>http://localhost:4200/#/ui/a11y/panel/inline</example-url>
328
+ */
329
+ declare class CngxA11yPanel {
330
+ private readonly announcer;
331
+ private readonly prefs;
332
+ protected readonly labels: Signal<CngxA11yPanelLabels>;
333
+ private readonly axes;
334
+ private readonly uid;
335
+ /**
336
+ * The axis groups to render, rebuilt when the axis list or the labels change
337
+ * so both follow a language switch. A rebuild that yields the same axes,
338
+ * labels and options keeps the previous array. Each view's `value` is the
339
+ * axis preference itself, so picking an option re-renders only that group.
340
+ */
341
+ protected readonly axisViews: Signal<readonly CngxA11yPanelAxisView[]>;
342
+ private buildAxisViews;
343
+ protected reset(): void;
344
+ static ɵfac: i0.ɵɵFactoryDeclaration<CngxA11yPanel, never>;
345
+ static ɵcmp: i0.ɵɵComponentDeclaration<CngxA11yPanel, "cngx-a11y-panel", never, {}, {}, never, ["[cngxA11yPanelHeader]"], true, never>;
346
+ }
347
+
348
+ /**
349
+ * The accessibility-panel section of a {@link CngxLanguagePack}: the copy of
350
+ * `CngxA11yPanel`. The text keys feed the `labels` of `CNGX_A11Y_PANEL_CONFIG`
351
+ * (a key set through `withA11yPanelLabels` still wins); the four option
352
+ * records label the toggle options by value, so an axis list from
353
+ * `withA11yPanelAxes` without option labels reads them from here.
354
+ *
355
+ * @category ui/a11y/i18n
356
+ * @since 0.1.0
357
+ * @relatedTo CNGX_A11Y_PANEL_CONFIG, withA11yPanelLabels, withA11yPanelAxes
358
+ */
359
+ interface CngxA11yPanelLanguageSection {
360
+ /** Default heading, shown when no `[cngxA11yPanelHeader]` slot is projected. */
361
+ readonly heading: string;
362
+ /** Reset control label. */
363
+ readonly reset: string;
364
+ /** Announced when Reset restores every axis. */
365
+ readonly resetMessage: string;
366
+ /** Group label (the accessible name) per axis. */
367
+ readonly axes: Readonly<Record<'density' | 'textScale' | 'motion' | 'contrast', string>>;
368
+ /** Option labels of the spacing group, by value. */
369
+ readonly density: Readonly<Record<CngxDensityValue, string>>;
370
+ /** Option labels of the text-size group, by value. */
371
+ readonly textScale: Readonly<Record<CngxTextScaleValue, string>>;
372
+ /** Option labels of the motion group, by value. */
373
+ readonly motion: Readonly<Record<CngxMotionPreference, string>>;
374
+ /** Option labels of the contrast group, by value. */
375
+ readonly contrast: Readonly<Record<CngxContrastPreference, string>>;
376
+ }
377
+ /**
378
+ * The English accessibility-panel section: the single source of the panel's
379
+ * English copy. The `CNGX_A11Y_PANEL_CONFIG` labels and option labels default
380
+ * to it.
381
+ *
382
+ * @category ui/a11y/i18n
383
+ * @since 0.1.0
384
+ * @relatedTo CNGX_A11Y_PANEL_CONFIG
385
+ */
386
+ declare const CNGX_A11Y_PANEL_LANGUAGE_EN: CngxA11yPanelLanguageSection;
387
+ declare module '@cngx/core/i18n' {
388
+ interface CngxLanguagePack {
389
+ readonly a11yPanel: CngxA11yPanelLanguageSection;
390
+ }
391
+ }
392
+
393
+ export { CNGX_A11Y_PANEL_CONFIG, CNGX_A11Y_PANEL_DEFAULTS, CNGX_A11Y_PANEL_LANGUAGE_EN, CngxA11yPanel, injectA11yPanelAxes, injectA11yPanelConfig, injectA11yPanelLabels, provideA11yPanelConfig, provideA11yPanelConfigAt, withA11yPanelAxes, withA11yPanelLabels };
394
+ export type { CngxA11yPanelAxis, CngxA11yPanelAxisOption, CngxA11yPanelAxisSpec, CngxA11yPanelConfig, CngxA11yPanelConfigFeature, CngxA11yPanelLabels, CngxA11yPanelLabelsOverride, CngxA11yPanelLanguageSection };
@@ -124,11 +124,12 @@ type CngxAccordionSeverity = 'error' | 'warning' | 'info';
124
124
  * 2. `provideAccordionConfigAt(...)` in a parent component's `viewProviders`
125
125
  * (component-scoped override).
126
126
  * 3. `provideAccordionConfig(...)` at the application root.
127
- * 4. Library defaults (English; `CNGX_ACCORDION_DEFAULTS`).
127
+ * 4. Library defaults (`CNGX_ACCORDION_DEFAULTS`; the copy comes from the
128
+ * `accordion` section of the language pack).
128
129
  *
129
- * Both keys are required on the resolved config - the token ships a complete
130
- * default, and every `with*` feature overrides a whole key, so no consumer ever
131
- * observes a partial shape.
130
+ * The copy keys are overrides only: the token's default leaves them unset, and
131
+ * {@link injectAccordionLabels} fills every unset key from the `accordion`
132
+ * section of the language pack, so a reader never observes a partial shape.
132
133
  *
133
134
  * @category ui/accordion
134
135
  * @since 0.1.0
@@ -136,17 +137,22 @@ type CngxAccordionSeverity = 'error' | 'warning' | 'info';
136
137
  interface CngxAccordionConfig {
137
138
  /**
138
139
  * Reason announced to assistive tech when an item is disabled, bound through
139
- * the item's always-present `aria-describedby` reason element. English
140
- * default; a per-instance `[disabledReason]` still wins over the cascade.
140
+ * the item's always-present `aria-describedby` reason element. An override
141
+ * only: unset, the reason comes from the `accordion` section of the language
142
+ * pack. A per-instance `[disabledReason]` still wins over the cascade.
143
+ * Accepts a `Signal` so the reason follows a runtime language switch.
141
144
  */
142
- readonly disabledReason: string;
145
+ readonly disabledReason?: string | Signal<string>;
143
146
  /**
144
147
  * Message announced (via a `role="alert"`) when an item's `[state]` is error
145
- * and no `*cngxAccordionItemError` slot is provided. English default; a
146
- * per-instance `[errorMessage]` or the error slot still wins. Ships a spoken
148
+ * and no `*cngxAccordionItemError` slot is provided. An override only:
149
+ * unset, the message comes from the `accordion` section of the language
150
+ * pack. A per-instance `[errorMessage]` or the error slot still wins. Ships a spoken
147
151
  * default so the error state is never silent to assistive tech (Pillar 2).
152
+ * Accepts a `Signal`; a shown message keeps its text on a language switch and
153
+ * speaks the new language with the next error.
148
154
  */
149
- readonly errorMessage: string;
155
+ readonly errorMessage?: string | Signal<string>;
150
156
  /**
151
157
  * Default `aria-level` (2-6) every `CngxAccordionGroup` heading wrapper
152
158
  * reflects when `[headingLevel]` is not bound. Clamped into the ARIA range by
@@ -385,6 +391,10 @@ declare class CngxAccordionItemSubtitle {
385
391
  * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/accordion/accordion-item.component.ts
386
392
  * @since 0.1.0
387
393
  * @relatedTo CngxAccordionGroup, CngxAccordionPanel
394
+ * @slot cngxAccordionItemIcon Replaces the item's expand/collapse chevron.
395
+ * @slot cngxAccordionItemContent The panel body, rendered lazily when the item opens.
396
+ * @slot cngxAccordionItemBusy Rendered over the item while its content loads.
397
+ * @slot cngxAccordionItemError Rendered when the item's content failed to load.
388
398
  *
389
399
  * <example-url>http://localhost:4200/#/ui/accordion/async-panel/lazy-fetch</example-url>
390
400
  * <example-url>http://localhost:4200/#/ui/accordion/disabled-lazy/disabled-and-lazy</example-url>
@@ -393,6 +403,7 @@ declare class CngxAccordionItemSubtitle {
393
403
  */
394
404
  declare class CngxAccordionItem {
395
405
  private readonly config;
406
+ private readonly copy;
396
407
  /**
397
408
  * Disabled item: the header reports `tabindex="-1"` + `aria-disabled="true"`,
398
409
  * is skipped by roving, and its click never expands. The reason text is
@@ -410,18 +421,19 @@ declare class CngxAccordionItem {
410
421
  * Reason announced to assistive tech when the item is disabled, bound through
411
422
  * the always-present `aria-describedby` reason element. Resolves
412
423
  * `input ?? CNGX_ACCORDION_CONFIG.disabledReason ?? EN default`: an unbound
413
- * input falls back to the app-wide config (English out of the box, overridden
414
- * via `withAccordionLabels`).
424
+ * input (`undefined`) falls back to the app-wide config (English out of the
425
+ * box, overridden via `withAccordionLabels`) and follows a language switch.
415
426
  */
416
- readonly disabledReason: _angular_core.InputSignal<string>;
427
+ readonly disabledReason: _angular_core.InputSignal<string | undefined>;
417
428
  /**
418
429
  * Message announced through a `role="alert"` when `[state]` is error and no
419
430
  * `*cngxAccordionItemError` slot is provided. Resolves
420
431
  * `input ?? CNGX_ACCORDION_CONFIG.errorMessage ?? EN default`, mirroring
421
432
  * {@link disabledReason}: a spoken default so the error state is never silent
422
- * to assistive tech. The error slot, when present, wins over this string.
433
+ * to assistive tech. The error slot, when present, wins over this string. An
434
+ * unbound input reads `undefined`.
423
435
  */
424
- readonly errorMessage: _angular_core.InputSignal<string>;
436
+ readonly errorMessage: _angular_core.InputSignal<string | undefined>;
425
437
  /**
426
438
  * Stable id this item registers under in the coordinator's open-set. Defaults
427
439
  * to a generated id; bind `[panelId]` to a stable consumer value to address
@@ -445,14 +457,17 @@ declare class CngxAccordionItem {
445
457
  protected readonly titleId: string;
446
458
  protected readonly subtitleId: string;
447
459
  protected readonly reasonId: string;
460
+ /** The disabled reason: the bound input, else the cascade default. */
461
+ protected readonly resolvedDisabledReason: _angular_core.Signal<string>;
448
462
  /**
449
463
  * The button's `aria-describedby`: subtitle first (an informative secondary
450
464
  * line the title-only name-pin would otherwise hide from AT), then the
451
- * disabled-reason element. Both IDREFs are always present in the DOM - the
452
- * subtitle span toggles `aria-hidden` by presence, the reason span toggles by
453
- * `disabled()`. Constant string: the ids never change, so no `computed()`.
465
+ * disabled-reason element. Both target spans stay in the DOM; each ID
466
+ * reference is emitted only while its description applies - accname 1.2
467
+ * §2A traverses a directly-referenced node even when it is hidden, so
468
+ * `aria-hidden` alone would not suppress a dangling reference.
454
469
  */
455
- protected readonly describedBy: string;
470
+ protected readonly describedBy: _angular_core.Signal<string | null>;
456
471
  /** Lazy region-body slot; absent means the body projects eagerly through the default slot. */
457
472
  protected readonly contentSlot: _angular_core.Signal<CngxAccordionItemContent | undefined>;
458
473
  /**
@@ -497,6 +512,13 @@ declare class CngxAccordionItem {
497
512
  * pending) so the string and object input forms agree. Boolean, no `equal`.
498
513
  */
499
514
  protected readonly busy: _angular_core.Signal<boolean>;
515
+ /**
516
+ * Text of the `role="alert"`. A bound `[errorMessage]` is tracked; the cascade
517
+ * default is read untracked and re-read on a status change, so a language
518
+ * switch does not re-announce a shown error - the next error speaks the new
519
+ * language.
520
+ */
521
+ protected readonly resolvedErrorMessage: _angular_core.Signal<string>;
500
522
  /** Whether this item's region is open, derived from the coordinator's open-set. */
501
523
  protected readonly expanded: _angular_core.Signal<boolean>;
502
524
  /**
@@ -632,8 +654,8 @@ declare const CNGX_ACCORDION_CONFIG: InjectionToken<CngxAccordionConfig>;
632
654
  type CngxAccordionConfigFeature = {
633
655
  readonly kind: 'labels';
634
656
  readonly payload: {
635
- readonly disabledReason?: string;
636
- readonly errorMessage?: string;
657
+ readonly disabledReason?: string | Signal<string>;
658
+ readonly errorMessage?: string | Signal<string>;
637
659
  };
638
660
  } | {
639
661
  readonly kind: 'headingLevel';
@@ -711,7 +733,8 @@ declare function provideAccordionConfigAt(...features: CngxAccordionConfigFeatur
711
733
  * (spoken when an item is disabled) and `errorMessage` (spoken via `role="alert"`
712
734
  * when an item's `[state]` is error and no error slot is given). Pass either or
713
735
  * both. Per-instance `[disabledReason]` / `[errorMessage]` still win over the
714
- * cascade; this only sets the fallback.
736
+ * cascade; this only sets the fallback. Pass a `Signal` for either string to
737
+ * switch the language at runtime.
715
738
  *
716
739
  * ```ts
717
740
  * provideAccordionConfig(
@@ -726,8 +749,8 @@ declare function provideAccordionConfigAt(...features: CngxAccordionConfigFeatur
726
749
  * @since 0.1.0
727
750
  */
728
751
  declare function withAccordionLabels(payload: {
729
- disabledReason?: string;
730
- errorMessage?: string;
752
+ disabledReason?: string | Signal<string>;
753
+ errorMessage?: string | Signal<string>;
731
754
  }): CngxAccordionConfigFeature;
732
755
  /**
733
756
  * Override the default heading level (`aria-level`) a `CngxAccordionGroup`
@@ -777,6 +800,37 @@ declare function withAccordionSkin(skin: CngxAccordionSkin): CngxAccordionConfig
777
800
  */
778
801
  declare function withAccordionTemplates(payload: NonNullable<CngxAccordionConfig['templates']>): CngxAccordionConfigFeature;
779
802
 
803
+ /**
804
+ * The accordion section of a {@link CngxLanguagePack}: the copy
805
+ * `CngxAccordionItem` speaks on its own behalf. It feeds the copy keys of
806
+ * `CNGX_ACCORDION_CONFIG`; a key set through `withAccordionLabels` or a bound
807
+ * `[disabledReason]` / `[errorMessage]` still wins.
808
+ *
809
+ * @category ui/accordion/i18n
810
+ * @since 0.1.0
811
+ * @relatedTo CNGX_ACCORDION_CONFIG, withAccordionLabels
812
+ */
813
+ interface CngxAccordionLanguageSection {
814
+ /** Reason announced when an item is disabled. */
815
+ readonly disabledReason: string;
816
+ /** Announced through `role="alert"` when an item's state is error. */
817
+ readonly errorMessage: string;
818
+ }
819
+ /**
820
+ * The English accordion section: the single source of the accordion's English
821
+ * copy. The `CNGX_ACCORDION_CONFIG` copy keys default to it.
822
+ *
823
+ * @category ui/accordion/i18n
824
+ * @since 0.1.0
825
+ * @relatedTo CNGX_ACCORDION_CONFIG
826
+ */
827
+ declare const CNGX_ACCORDION_LANGUAGE_EN: CngxAccordionLanguageSection;
828
+ declare module '@cngx/core/i18n' {
829
+ interface CngxLanguagePack {
830
+ readonly accordion: CngxAccordionLanguageSection;
831
+ }
832
+ }
833
+
780
834
  /**
781
835
  * Convenience accessor for the accordion configuration cascade. Runs in
782
836
  * injection context; resolves through the priority chain (per-instance Input
@@ -785,17 +839,33 @@ declare function withAccordionTemplates(payload: NonNullable<CngxAccordionConfig
785
839
  * so consumers don't import the token directly. Mirrors `injectBreadcrumbConfig`
786
840
  * in `@cngx/ui/breadcrumb`.
787
841
  *
842
+ * The copy keys `disabledReason` and `errorMessage` hold overrides only; read
843
+ * the resolved copy (overrides over the language pack) through
844
+ * {@link injectAccordionLabels}.
845
+ *
846
+ * @category ui/accordion
847
+ * @since 0.1.0
848
+ */
849
+ declare function injectAccordionConfig(): CngxAccordionConfig;
850
+ /**
851
+ * The accordion copy in scope - `disabledReason` and `errorMessage` - as a
852
+ * Signal that follows a runtime language switch. A key the config sets wins;
853
+ * a key it leaves unset, `null` or `undefined` reads the `accordion` section
854
+ * of the active pack (English without one). Runs in injection context; read it
855
+ * inside a `computed()`, a template or a handler, and untracked where it
856
+ * builds live-region text.
857
+ *
788
858
  * ```ts
789
- * export class CngxAccordionItem {
790
- * private readonly config = injectAccordionConfig();
791
- * readonly disabledReason = input<string>(this.config.disabledReason);
859
+ * export class MyAccordionReason {
860
+ * private readonly copy = injectAccordionLabels();
861
+ * protected readonly reason = computed(() => this.copy().disabledReason);
792
862
  * }
793
863
  * ```
794
864
  *
795
865
  * @category ui/accordion
796
866
  * @since 0.1.0
797
867
  */
798
- declare function injectAccordionConfig(): CngxAccordionConfig;
868
+ declare function injectAccordionLabels(): Signal<CngxAccordionLanguageSection>;
799
869
 
800
- export { CNGX_ACCORDION_CONFIG, CNGX_ACCORDION_GROUP, CngxAccordionGroup, CngxAccordionItem, CngxAccordionItemBusy, CngxAccordionItemContent, CngxAccordionItemError, CngxAccordionItemIcon, CngxAccordionItemLeading, CngxAccordionItemMeta, CngxAccordionItemSubtitle, CngxAccordionItemTitle, injectAccordionConfig, provideAccordionConfig, provideAccordionConfigAt, withAccordionLabels, withAccordionSkin, withAccordionTemplates, withDefaultHeadingLevel };
801
- export type { CngxAccordionConfig, CngxAccordionConfigFeature, CngxAccordionGroupContext, CngxAccordionItemIconContext, CngxAccordionItemStateContext, CngxAccordionSeverity, CngxAccordionSkin };
870
+ export { CNGX_ACCORDION_CONFIG, CNGX_ACCORDION_GROUP, CNGX_ACCORDION_LANGUAGE_EN, CngxAccordionGroup, CngxAccordionItem, CngxAccordionItemBusy, CngxAccordionItemContent, CngxAccordionItemError, CngxAccordionItemIcon, CngxAccordionItemLeading, CngxAccordionItemMeta, CngxAccordionItemSubtitle, CngxAccordionItemTitle, injectAccordionConfig, injectAccordionLabels, provideAccordionConfig, provideAccordionConfigAt, withAccordionLabels, withAccordionSkin, withAccordionTemplates, withDefaultHeadingLevel };
871
+ export type { CngxAccordionConfig, CngxAccordionConfigFeature, CngxAccordionGroupContext, CngxAccordionItemIconContext, CngxAccordionItemStateContext, CngxAccordionLanguageSection, CngxAccordionSeverity, CngxAccordionSkin };