@cngx/common 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 (72) hide show
  1. package/card/README.md +2 -1
  2. package/chart/README.md +85 -0
  3. package/command/README.md +157 -0
  4. package/data/README.md +33 -1
  5. package/dialog/README.md +23 -1
  6. package/fesm2022/cngx-common-a11y.mjs +356 -180
  7. package/fesm2022/cngx-common-a11y.mjs.map +1 -1
  8. package/fesm2022/cngx-common-audio.mjs +84 -42
  9. package/fesm2022/cngx-common-audio.mjs.map +1 -1
  10. package/fesm2022/cngx-common-card.mjs +311 -53
  11. package/fesm2022/cngx-common-card.mjs.map +1 -1
  12. package/fesm2022/cngx-common-chart.mjs +4360 -1625
  13. package/fesm2022/cngx-common-chart.mjs.map +1 -1
  14. package/fesm2022/cngx-common-command.mjs +171 -0
  15. package/fesm2022/cngx-common-command.mjs.map +1 -0
  16. package/fesm2022/cngx-common-data.mjs +1556 -616
  17. package/fesm2022/cngx-common-data.mjs.map +1 -1
  18. package/fesm2022/cngx-common-dialog.mjs +518 -112
  19. package/fesm2022/cngx-common-dialog.mjs.map +1 -1
  20. package/fesm2022/cngx-common-display.mjs +468 -87
  21. package/fesm2022/cngx-common-display.mjs.map +1 -1
  22. package/fesm2022/cngx-common-interactive.mjs +2725 -1303
  23. package/fesm2022/cngx-common-interactive.mjs.map +1 -1
  24. package/fesm2022/cngx-common-layout.mjs +943 -164
  25. package/fesm2022/cngx-common-layout.mjs.map +1 -1
  26. package/fesm2022/cngx-common-popover.mjs +769 -103
  27. package/fesm2022/cngx-common-popover.mjs.map +1 -1
  28. package/fesm2022/cngx-common-stepper.mjs +816 -348
  29. package/fesm2022/cngx-common-stepper.mjs.map +1 -1
  30. package/fesm2022/cngx-common-tabs.mjs +2330 -1554
  31. package/fesm2022/cngx-common-tabs.mjs.map +1 -1
  32. package/fesm2022/cngx-common-timeline.mjs +1170 -0
  33. package/fesm2022/cngx-common-timeline.mjs.map +1 -0
  34. package/fesm2022/cngx-common.mjs +2 -2
  35. package/fesm2022/cngx-common.mjs.map +1 -1
  36. package/interactive/README.md +15 -4
  37. package/layout/README.md +21 -1
  38. package/package.json +11 -1
  39. package/popover/README.md +18 -2
  40. package/stepper/README.md +7 -5
  41. package/theming/components/cngx-accordion.css +4 -1
  42. package/theming/components/cngx-backdrop.css +12 -0
  43. package/theming/components/cngx-badge.css +22 -0
  44. package/theming/components/cngx-bottom-sheet.css +14 -2
  45. package/theming/components/cngx-breadcrumb.css +8 -0
  46. package/theming/components/cngx-button-toggle.css +73 -5
  47. package/theming/components/cngx-data-grid.css +234 -1
  48. package/theming/components/cngx-dialog.css +25 -0
  49. package/theming/components/cngx-divider.css +12 -0
  50. package/theming/components/cngx-listbox.css +48 -12
  51. package/theming/components/cngx-menu.css +91 -15
  52. package/theming/components/cngx-popover.css +24 -0
  53. package/theming/components/cngx-recycler-placeholder.css +196 -0
  54. package/theming/components/cngx-ripple.css +2 -2
  55. package/theming/components/cngx-slider.css +32 -1
  56. package/theming/components/cngx-tooltip.css +23 -0
  57. package/timeline/README.md +155 -0
  58. package/types/cngx-common-a11y.d.ts +101 -31
  59. package/types/cngx-common-audio.d.ts +32 -32
  60. package/types/cngx-common-card.d.ts +211 -20
  61. package/types/cngx-common-chart.d.ts +1605 -169
  62. package/types/cngx-common-command.d.ts +190 -0
  63. package/types/cngx-common-data.d.ts +842 -163
  64. package/types/cngx-common-dialog.d.ts +372 -28
  65. package/types/cngx-common-display.d.ts +432 -148
  66. package/types/cngx-common-interactive.d.ts +1553 -370
  67. package/types/cngx-common-layout.d.ts +613 -27
  68. package/types/cngx-common-popover.d.ts +376 -36
  69. package/types/cngx-common-stepper.d.ts +414 -114
  70. package/types/cngx-common-tabs.d.ts +597 -72
  71. package/types/cngx-common-timeline.d.ts +1125 -0
  72. package/types/cngx-common.d.ts +1 -1
package/card/README.md CHANGED
@@ -45,11 +45,12 @@ export class ExampleComponent {
45
45
  ## Accessibility
46
46
 
47
47
  - **ARIA roles:** `role="article"` (default), `role="button"`, or `role="link"` based on `as` input
48
+ - **Link navigation:** `as="link"` + `[href]` navigates on activation - internal URLs through the app `Router` when provided, otherwise `window.location.assign`. The host is not a native anchor, so modifier-click/new-tab affordances do not apply
48
49
  - **Keyboard interaction:**
49
50
  - `Enter` / `Space`: Activate interactive cards (button/link)
50
51
  - `Arrow Left/Right`: Navigate cards in grid (CngxRovingTabindex)
51
52
  - `Home` / `End`: Jump to first/last card in grid
52
- - **Screen reader:** `aria-busy` when loading; live region announces "Loading", "Selected", "Deselected" state changes; `aria-describedby` points to disabled reason explanation
53
+ - **Screen reader:** `aria-busy` when loading; live region announces "Loading", "Selected", "Deselected" state changes (English defaults, translated by the `card` section of the language pack, `provideCngxI18n` from `@cngx/core/i18n`, and overridable per key via `provideCardI18n(withCardI18nLabels({ ... }))`); `aria-describedby` points to disabled reason explanation
53
54
  - **Focus management:** Interactive cards get `tabindex="0"` when standalone; CngxCardGrid's roving tabindex manages focus among cards
54
55
 
55
56
  ## Composition
package/chart/README.md CHANGED
@@ -21,6 +21,91 @@ Three properties make the chart system feel different from a wrapped library:
21
21
  - **Async-native.** Bind `[state]` and the chart switches between skeleton, content, refresh, empty, and error views the same way every other cngx surface does. Loading is a built-in mode, not a parent wrapper.
22
22
  - **Override slots.** Loading, empty, and error placeholders are template slots; the chart never blocks you from owning the UX of a failed fetch.
23
23
 
24
+ ## Sizing and the plot area
25
+
26
+ The chart fills its host box. Inside that box it maps marks onto the **plot area**: the box minus the room the axes you projected need for their tick labels and titles. That is what keeps a `1,200,000` tick label inside a card instead of painting over its border, and it is why you never have to pad a container to catch overhanging axis text.
27
+
28
+ The reservation is derived. Which sides reserve comes from the axes you mounted; how much each reserves comes from the labels that axis formats. Every axis also reserves a little on the two sides perpendicular to it, because a tick label is centred on its tick and the end ticks sit on the plot corners - half of the first and last label would otherwise hang outside.
29
+
30
+ A chart with no axis reserves nothing and fills the box edge to edge. So does a chart whose axes are `[cngxAxisDomain]` rather than `[cngxAxis]` - that directive publishes a scale domain and draws nothing, so it claims no room. It is how the sparkline and mini-area presets declare their scales without paying for a gutter they never paint, and what you reach for whenever a mark needs a domain but the box has no space for ticks.
31
+
32
+ Both directives satisfy the same `CngxChartAxis` contract, provided through `CNGX_CHART_AXIS`. Implement it on your own directive when you need an axis the chart participates with but the library does not ship - a logarithmic publisher, a domain fed from a service, decoration you draw yourself. The chart queries the token, so it cannot tell your axis from ours.
33
+
34
+ There is no knob. No input, no CSS custom property, no DI token sizes the gutter, because the component already knows everything needed to compute it. The one approximation is character width: the chart measures no text, so it estimates one character as a fraction of the default axis font size. Restyling `--cngx-axis-font-size` scales your labels but not the gutter they sit in. If that bites, the fix is a real measure pass or an escape hatch, and both are additive - open an issue with the font and the label that clipped.
35
+
36
+ ### Layering HTML over the plot area
37
+
38
+ To put HTML on top of the marks, project an `*cngxChartOverlay` template. The chart renders it in a frame it insets to the plot area for you, so there is no arithmetic and no wrapper you have to make a containing block:
39
+
40
+ ```html
41
+ <cngx-chart [data]="load" [width]="480" [height]="200">
42
+ <svg:g cngxAxis position="left" type="linear" [domain]="[0, 100000]"></svg:g>
43
+ <svg:g cngxLine></svg:g>
44
+
45
+ <ng-template cngxChartOverlay>
46
+ <div class="peak-window">peak window</div>
47
+ </ng-template>
48
+ </cngx-chart>
49
+ ```
50
+
51
+ The frame is `pointer-events: none`, so it never swallows a click meant for the marks; an interactive element inside it opts back in with `pointer-events: auto`. It renders only in the content view - in the loading, empty and error arms there are no marks to annotate, and each of those arms owns its own frame.
52
+
53
+ The overlay template receives the same slot context every other slot gets, so `plot` - `{ x0, y0, x1, y1, width, height }` in viewBox user units - is readable for content that reasons about the drawing surface rather than the host box:
54
+
55
+ ```html
56
+ <ng-template cngxChartEmpty let-plot="plot">
57
+ <span>No readings for this range ({{ plot.width }} x {{ plot.height }})</span>
58
+ </ng-template>
59
+ ```
60
+
61
+ Mind the two coordinate spaces. Slot templates render into an HTML frame layered over the SVG, so `width`/`height` on the context are **rendered px** while `plot` is **viewBox units**. They diverge whenever an explicit `[width]` chart is squeezed by `max-width`. Do not compute a ratio across the two. For SVG-space geometry read `plot` off `injectChartContext()` inside a directive on an `<svg:g>` host, the way the layer atoms do.
62
+
63
+ #### When the overlay must live outside the chart box
64
+
65
+ The slot covers HTML over the plot. When the overlay has to sit outside the chart's own box, or you need the rectangle in TypeScript rather than in a template, read it off the instance instead. An HTML sibling never inherits the plot custom properties - everything projected into `<cngx-chart>` lands inside its SVG - so the instance is the route it has. Divide by `dimensions()`, the viewBox extent `plot` is measured in, rather than by a copy of the bound width, so the same code works on a responsive chart with no `[width]` to copy.
66
+
67
+ ```html
68
+ <div style="position: relative; display: inline-block">
69
+ <cngx-chart #chart="cngxChart" [width]="480" [height]="200" [data]="load">
70
+ <svg:g cngxAxis position="left" type="linear" [domain]="[0, 100000]"></svg:g>
71
+ <svg:g cngxLine></svg:g>
72
+ </cngx-chart>
73
+
74
+ <div
75
+ style="position: absolute"
76
+ [style.left.%]="(chart.plot().x0 / chart.dimensions().width) * 100"
77
+ [style.top.%]="(chart.plot().y0 / chart.dimensions().height) * 100"
78
+ [style.width.%]="(chart.plot().width / chart.dimensions().width) * 100"
79
+ [style.height.%]="(chart.plot().height / chart.dimensions().height) * 100"
80
+ >…</div>
81
+ </div>
82
+ ```
83
+
84
+ In CSS, the chart writes the same numbers as four custom properties onto its own host, as percentages of the host box. Custom properties inherit downwards only, so these reach the chart's own subtree - the `*cngxChartOverlay` frame reads them to inset itself - but not an outside sibling, which is what the instance route above is for:
85
+
86
+ |Property|Reserved on|
87
+ |-|-|
88
+ |`--cngx-chart-plot-inline-start`|left|
89
+ |`--cngx-chart-plot-inline-end`|right|
90
+ |`--cngx-chart-plot-block-start`|top|
91
+ |`--cngx-chart-plot-block-end`|bottom|
92
+
93
+ These are outputs, not settings. The chart rewrites them whenever the box or the axis set changes, so setting them yourself has no effect.
94
+
95
+ ```css
96
+ /* reachable from the chart's own subtree; a sibling does not inherit these */
97
+ .some-descendant {
98
+ inset: var(--cngx-chart-plot-block-start) var(--cngx-chart-plot-inline-end)
99
+ var(--cngx-chart-plot-block-end) var(--cngx-chart-plot-inline-start);
100
+ }
101
+ ```
102
+
103
+ Percent rather than pixels because an explicit-`[width]` chart squeezed by `max-width` keeps its viewBox: a user unit stops being a CSS pixel, while a fraction stays a fraction. That holds while the host keeps the viewBox ratio, which it does whenever both `[width]` and `[height]` are bound. Bind only one and the SVG letterboxes, so the percentages address the host box rather than the drawing area.
104
+
105
+ ### Implementing CngxChartContext yourself
106
+
107
+ `CngxChartContext` carries a required `plot` field. Injecting the context via `injectChartContext()` is unaffected. If you implement the interface directly - a hand-rolled test double, a custom container providing `CNGX_CHART_CONTEXT` - you have to supply it; there is no fallback to the host box, deliberately, so a mis-wired container fails loudly instead of silently drawing edge to edge.
108
+
24
109
  ## Status
25
110
 
26
111
  Under active development. Treat the **preset molecules** as stable for adoption. Treat the **atom internals** (axis tick computation, layer projection caching, custom-layer authoring) as still in flux until the chart-area master plan closes - APIs may move between minor releases.
@@ -0,0 +1,157 @@
1
+ # @cngx/common/command - Headless Command Registry
2
+
3
+ A typed command model and a DI registry that app parts contribute to, with a
4
+ swappable ranking strategy. Zero rendered chrome. This is the base the
5
+ `@cngx/ui/command-palette` preset renders; register commands here and either
6
+ take that preset or build your own surface.
7
+
8
+ ## This Is a Registry, Not a UI
9
+
10
+ `@cngx/common/command` holds `CngxCommand` payloads and merges them into one
11
+ reactive signal. It draws nothing. A consumer registers commands against it
12
+ without pulling in any component, then feeds the merged signal to a surface -
13
+ the shipped Cmd/Ctrl+K palette (`@cngx/ui/command-palette`), or a bespoke one.
14
+
15
+ | | `@cngx/common/command` | `@cngx/ui/command-palette` |
16
+ |-|-|-|
17
+ | Level | 2 (atoms/DI, no chrome) | 4 (organism, renders `<cngx-dialog>`) |
18
+ | Owns | command model, sources, matcher | the Cmd/Ctrl+K dialog, slots, config |
19
+ | Ships | data + DI tokens | a rendered preset |
20
+ | Depends on | `@cngx/core/utils` only | this + `common/interactive` + `dialog` + ... |
21
+
22
+ Split on purpose: register against the base without the preset's weight; the
23
+ preset is one opinionated way to render it, not the only way.
24
+
25
+ ## Register Commands
26
+
27
+ `provideCommands(...)` returns `Provider[]`, so it registers at any injector
28
+ scope - app root, a lazy route, or a component's `providers` / `viewProviders`.
29
+ App parts contribute sets without a central list, and `injectCommands()` merges
30
+ them.
31
+
32
+ ```typescript
33
+ // app root
34
+ bootstrapApplication(AppComponent, {
35
+ providers: [provideCommands(FILE_COMMANDS)],
36
+ });
37
+
38
+ // or scoped to a route / component
39
+ @Component({
40
+ viewProviders: [provideCommands(EDITOR_COMMANDS)],
41
+ })
42
+ export class EditorView {}
43
+ ```
44
+
45
+ A source is either a static list or a reactive `Signal` - a signal source lets a
46
+ contributor add, remove, or disable commands live:
47
+
48
+ ```typescript
49
+ const commands = signal<CngxCommand[]>([saveCmd]);
50
+ provideCommands(commands); // injectCommands() tracks it
51
+
52
+ // later, from anywhere:
53
+ commands.update((list) => [...list, publishCmd]);
54
+ ```
55
+
56
+ ## Read Them
57
+
58
+ ```typescript
59
+ private readonly commands = injectCommands();
60
+ // Signal<readonly CngxCommand[]> - every provideCommands source, merged.
61
+ ```
62
+
63
+ The merge carries an explicit `equal` (length + per-command identity), so
64
+ re-emitting the same set does not produce a fresh array and cascade downstream
65
+ `computed()`s. Re-providing identical references is a no-op.
66
+
67
+ ## The Command Model
68
+
69
+ ```typescript
70
+ export interface CngxCommand {
71
+ readonly id: string; // stable identity; drives the merge equal
72
+ readonly label: string; // primary match target
73
+ readonly keywords?: readonly string[];
74
+ readonly group?: string; // also the matcher's scope-filter key
75
+ readonly icon?: string; // token; your row template resolves it
76
+ run(): void | Promise<void>;
77
+ readonly disabled?: Signal<boolean>; // reactive; stays perceivable
78
+ readonly disabledReason?: string; // the why (Pillar 2 - surfaced via aria-describedby)
79
+ readonly data?: unknown; // consumer payload, narrowed at the row slot
80
+ }
81
+ ```
82
+
83
+ `data` is `unknown` on purpose: a command list is heterogeneous, so there is no
84
+ `CngxCommand<T>` type parameter. Narrow `data` where you render the row.
85
+
86
+ Commands cluster into groups for the result surface:
87
+
88
+ ```typescript
89
+ export interface CommandGroup {
90
+ readonly id: string;
91
+ readonly label: string;
92
+ readonly commands: readonly CngxCommand[];
93
+ }
94
+ ```
95
+
96
+ ## Match Strategy
97
+
98
+ Ranking sits behind a swappable factory token. The default is a pure
99
+ label/keyword ranker; there is no fuzzy engine in the bundle - drop one in
100
+ without touching any surface.
101
+
102
+ ```typescript
103
+ // default: label-exact > label-prefix > label-substring > keyword; scope filters by group
104
+ const match = inject(CNGX_COMMAND_MATCH_FACTORY)();
105
+ const ranked = match(commands(), term(), scope()); // RankedCommand[]
106
+ ```
107
+
108
+ Swap it app-wide (or per-component via `viewProviders`):
109
+
110
+ ```typescript
111
+ providers: [
112
+ {
113
+ provide: CNGX_COMMAND_MATCH_FACTORY,
114
+ useValue: () => (commands, term) => fuzzyRank(commands, term), // your engine
115
+ },
116
+ ];
117
+ ```
118
+
119
+ `CngxCommandMatcher` is `(commands, term, scope?) => readonly RankedCommand[]`;
120
+ each `RankedCommand` is `{ command, score }` (higher scores rank first, `0` for
121
+ an empty query).
122
+
123
+ ## Render Them
124
+
125
+ The registry draws nothing. Feed it to a surface:
126
+
127
+ ```html
128
+ <!-- the shipped preset: @cngx/ui/command-palette -->
129
+ <cngx-command-palette />
130
+ ```
131
+
132
+ ```typescript
133
+ providers: [provideCommands(APP_COMMANDS)];
134
+ // Cmd/Ctrl+K opens; type-to-filter runs the matcher over the merged registry.
135
+ ```
136
+
137
+ The preset owns the dialog, keyboard model, ARIA, theming, config cascade, and
138
+ slot overrides. See the live demos at `/ui/command-palette/basic` and
139
+ `/ui/command-palette/custom-row`. To build your own surface, read
140
+ `injectCommands()`, run a `CNGX_COMMAND_MATCH_FACTORY` matcher over it in a
141
+ `computed()`, and render the result.
142
+
143
+ ## Exports
144
+
145
+ | Symbol | Kind | Purpose |
146
+ |-|-|-|
147
+ | `CngxCommand` | interface | the command model |
148
+ | `CommandGroup` | interface | a named cluster of commands |
149
+ | `CngxCommandSource` | type | a static list or a `Signal` of commands |
150
+ | `provideCommands(...sources)` | `Provider[]` | register sources at any injector scope |
151
+ | `injectCommands()` | `Signal<readonly CngxCommand[]>` | merged, `equal`-guarded registry |
152
+ | `CNGX_COMMAND_SOURCE` | multi token | what `provideCommands` contributes to |
153
+ | `createDefaultCommandMatcher()` | factory | the pure label/keyword ranker |
154
+ | `CngxCommandMatcher` | type | `(commands, term, scope?) => RankedCommand[]` |
155
+ | `RankedCommand` | interface | `{ command, score }` |
156
+ | `CNGX_COMMAND_MATCH_FACTORY` | token | swap the ranker (providedIn `'root'`) |
157
+ | `CngxCommandMatchFactory` | type | the factory shape |
package/data/README.md CHANGED
@@ -101,6 +101,8 @@ readonly residents = injectAsyncState(() =>
101
101
 
102
102
  All return `CngxAsyncState<T>` - the same interface every UI component accepts.
103
103
 
104
+ Depending on **several** of these at once? `createAggregateAsyncState(sources)` (from `@cngx/core/utils`) folds N states into one `CngxAsyncState`, and the headless `CngxAsyncBoundary` directive wires the keyed list, exposes a per-source `failures` list, and provides `CNGX_STATEFUL`. See the async-state entry README.
105
+
104
106
 
105
107
 
106
108
  ## 1. injectAsyncState - Reactive Query
@@ -591,6 +593,13 @@ export class ResidentApi {
591
593
  ### Component
592
594
 
593
595
  ```typescript
596
+ import { CngxAsyncContainer, CngxAsyncSkeletonTpl, CngxAsyncContentTpl,
597
+ CngxAsyncEmptyTpl, CngxAsyncErrorTpl, CngxAlert, CngxToast } from '@cngx/ui/feedback';
598
+ import { CngxCardGrid, CngxCard, CngxCardHeader, CngxCardBody,
599
+ CngxCardFooter, CngxCardSkeleton } from '@cngx/common/card';
600
+ import { CngxActionButton } from '@cngx/ui/action-button';
601
+ import { CngxEmptyState } from '@cngx/ui/empty-state';
602
+
594
603
  @Component({
595
604
  selector: 'app-resident-list',
596
605
  template: `
@@ -832,7 +841,9 @@ The paginator accepts `[state]` and blocks navigation while busy:
832
841
 
833
842
  ## CngxFileDrop - Upload State
834
843
 
835
- The file drop accepts `[state]` for upload lifecycle feedback:
844
+ The file drop accepts `[state]` for upload lifecycle feedback
845
+ (`CngxFileDrop` ships in `@cngx/forms/input`; `cngx-progress` and
846
+ `cngx-alert` in `@cngx/ui/feedback`):
836
847
 
837
848
  ```html
838
849
  <div cngxFileDrop #drop="cngxFileDrop"
@@ -886,3 +897,24 @@ handleUpload(files: File[]): void {
886
897
  | `[cngxPaginate]` | `isBusy` blocks navigation, disabled paginator |
887
898
  | `[cngxFileDrop]` | `uploading`, `uploadProgress`, `uploadError`, blocks drop/browse |
888
899
  | `injectSmartDataSource` | `isLoading`, `isRefreshing`, `error`, `isEmpty`, `filteredCount` |
900
+
901
+ The loading surfaces above (skeleton, overlay, async-container refresh bar, recycler skeleton) debounce their show/hide through the `CNGX_LOADING_CONFIG` cascade in `@cngx/core/utils`: `provideLoadingConfig(withShowDelay(...), withMinDwell(...))` suppresses the flash on fast operations app-wide, with per-instance `[delay]` / `[minDwell]` / `[skeletonDelay]` overrides. See the Async State Machine chapter for the full timing model.
902
+
903
+ ## Latency probe
904
+
905
+ `injectLatencyProbe()` measures how long the app's aggregate busy window lasted, so an app-shell indicator can pick spinner-vs-skeleton from observed latency before the next load renders.
906
+
907
+ It bridges `CngxAsyncRegistry.isAnythingLoading` (see the async-registry section) into a `createLatencyProbe` from `@cngx/core/utils`:
908
+
909
+ ```typescript
910
+ const probe = injectLatencyProbe();
911
+ // probe.lastDuration(): ms of the last completed busy window, or undefined
912
+ // probe.isBusy(): true while anything is loading
913
+
914
+ const showSkeleton = computed(() => {
915
+ const last = probe.lastDuration();
916
+ return last !== undefined && last > injectLoadingConfig().spinnerVsSkeletonCutoff;
917
+ });
918
+ ```
919
+
920
+ The probe measures the **busy-envelope**: from the first operation starting to the last finishing, not any single operation. When no registry is provided (`provideAsyncRegistry()` not called), the probe is simply never busy and never throws. For a single state rather than the whole app, call `createLatencyProbe(() => state.isBusy())` directly with any boolean-busy source.
package/dialog/README.md CHANGED
@@ -68,11 +68,33 @@ The dialog system is built around the native `<dialog>` element, which is the on
68
68
 
69
69
  - **`aria-labelledby` and `aria-describedby` are wired automatically** from `[cngxDialogTitle]` and `[cngxDialogDescription]` content children. Place them in the template; the linkage is reactive.
70
70
  - **Title announcement.** When a modal dialog transitions to `'open'`, the title text is announced through a polite live region. Screen-reader users hear the dialog purpose without an explicit `aria-live` element.
71
- - **Icon-only close buttons** need an explicit `aria-label`. The library does not invent labels.
71
+ - **Icon-only close buttons** fall back to a library-supplied name. `CngxDialogClose` sets `aria-label` only when the trigger carries no text of its own and no `aria-label` from the consumer - an explicit label always wins.
72
72
  - **Multi-step content** - wizards, tabbed dialogs, paginated forms - is the consumer's responsibility. The dialog moves focus once on open. After that, calling `.focus()` on the first element of the new step is on you.
73
73
  - **Error state.** Bind `[error]` to apply `aria-invalid="true"` and the `cngx-dialog--error` class. Pair with a `cngx-form-errors` block (or any `role="alert"` region) inside the dialog for WCAG-compliant form-error announcements.
74
74
  - **Reduced motion.** The theme honors `prefers-reduced-motion: reduce` - open and close transitions disable themselves automatically.
75
75
 
76
+ ### Localising the built-in strings
77
+
78
+ To translate the whole app, set a language pack with `provideCngxI18n(withPack(...))` from `@cngx/core/i18n` (see the localisation guide); `provideDialogConfig` overrides single keys on top of the `dialog` section.
79
+
80
+ Five strings the dialog family renders on its own behalf are English by
81
+ default and overridable as one bundle:
82
+
83
+ ```ts
84
+ provideDialogConfig(
85
+ withDialogLabels({
86
+ close: 'Dialog schließen',
87
+ errorFallback: 'Ein Fehler ist aufgetreten',
88
+ dragHandle: 'Dialog verschieben',
89
+ dragHandleRoleDescription: 'verschiebbar',
90
+ dragInstructions: 'Pfeiltasten bewegen den Dialog, Shift für größere Schritte',
91
+ }),
92
+ )
93
+ ```
94
+
95
+ Unset keys keep their English default. `provideDialogConfigAt(...)` in a
96
+ component's `viewProviders` scopes the override to that subtree.
97
+
76
98
  ## See also
77
99
 
78
100
  - Directive selectors, signals, methods, inputs, and CSS custom properties in the **API** tab of the generated docs.