@cngx/common 0.1.0-rc.6 → 0.1.0-rc.7

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 (62) hide show
  1. package/chart/README.md +85 -0
  2. package/command/README.md +157 -0
  3. package/data/README.md +23 -0
  4. package/fesm2022/cngx-common-a11y.mjs +247 -85
  5. package/fesm2022/cngx-common-a11y.mjs.map +1 -1
  6. package/fesm2022/cngx-common-audio.mjs +37 -37
  7. package/fesm2022/cngx-common-audio.mjs.map +1 -1
  8. package/fesm2022/cngx-common-card.mjs +13 -9
  9. package/fesm2022/cngx-common-card.mjs.map +1 -1
  10. package/fesm2022/cngx-common-chart.mjs +3404 -1392
  11. package/fesm2022/cngx-common-chart.mjs.map +1 -1
  12. package/fesm2022/cngx-common-command.mjs +144 -0
  13. package/fesm2022/cngx-common-command.mjs.map +1 -0
  14. package/fesm2022/cngx-common-data.mjs +304 -213
  15. package/fesm2022/cngx-common-data.mjs.map +1 -1
  16. package/fesm2022/cngx-common-dialog.mjs +369 -100
  17. package/fesm2022/cngx-common-dialog.mjs.map +1 -1
  18. package/fesm2022/cngx-common-display.mjs +138 -24
  19. package/fesm2022/cngx-common-display.mjs.map +1 -1
  20. package/fesm2022/cngx-common-interactive.mjs +1089 -459
  21. package/fesm2022/cngx-common-interactive.mjs.map +1 -1
  22. package/fesm2022/cngx-common-layout.mjs +113 -61
  23. package/fesm2022/cngx-common-layout.mjs.map +1 -1
  24. package/fesm2022/cngx-common-popover.mjs +430 -54
  25. package/fesm2022/cngx-common-popover.mjs.map +1 -1
  26. package/fesm2022/cngx-common-stepper.mjs +107 -49
  27. package/fesm2022/cngx-common-stepper.mjs.map +1 -1
  28. package/fesm2022/cngx-common-tabs.mjs +1170 -752
  29. package/fesm2022/cngx-common-tabs.mjs.map +1 -1
  30. package/fesm2022/cngx-common-timeline.mjs +1086 -0
  31. package/fesm2022/cngx-common-timeline.mjs.map +1 -0
  32. package/fesm2022/cngx-common.mjs +2 -2
  33. package/fesm2022/cngx-common.mjs.map +1 -1
  34. package/package.json +11 -1
  35. package/stepper/README.md +1 -1
  36. package/theming/components/cngx-accordion.css +3 -0
  37. package/theming/components/cngx-badge.css +22 -0
  38. package/theming/components/cngx-bottom-sheet.css +14 -2
  39. package/theming/components/cngx-breadcrumb.css +8 -0
  40. package/theming/components/cngx-button-toggle.css +44 -2
  41. package/theming/components/cngx-data-grid.css +66 -0
  42. package/theming/components/cngx-dialog.css +12 -0
  43. package/theming/components/cngx-divider.css +12 -0
  44. package/theming/components/cngx-listbox.css +27 -0
  45. package/theming/components/cngx-menu.css +36 -0
  46. package/theming/components/cngx-ripple.css +1 -1
  47. package/theming/components/cngx-tooltip.css +11 -0
  48. package/types/cngx-common-a11y.d.ts +63 -17
  49. package/types/cngx-common-audio.d.ts +32 -32
  50. package/types/cngx-common-card.d.ts +10 -3
  51. package/types/cngx-common-chart.d.ts +1281 -141
  52. package/types/cngx-common-command.d.ts +167 -0
  53. package/types/cngx-common-data.d.ts +264 -98
  54. package/types/cngx-common-dialog.d.ts +214 -25
  55. package/types/cngx-common-display.d.ts +83 -13
  56. package/types/cngx-common-interactive.d.ts +708 -174
  57. package/types/cngx-common-layout.d.ts +48 -1
  58. package/types/cngx-common-popover.d.ts +120 -3
  59. package/types/cngx-common-stepper.d.ts +55 -5
  60. package/types/cngx-common-tabs.d.ts +386 -25
  61. package/types/cngx-common-timeline.d.ts +1059 -0
  62. package/types/cngx-common.d.ts +1 -1
@@ -1,8 +1,10 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { Signal, TemplateRef, OnInit, InjectionToken, Resource, EnvironmentProviders, ElementRef, Injector, DestroyRef } from '@angular/core';
3
- import { CngxAsyncState, AsyncStatus } from '@cngx/core/utils';
3
+ import { CngxAsyncState, AsyncStatus, CngxStateful, CngxLatencyProbe } from '@cngx/core/utils';
4
+ export { CngxLatencyProbe } from '@cngx/core/utils';
4
5
  import { DataSource } from '@angular/cdk/collections';
5
6
  import { Observable, MonoTypeOperatorFunction, OperatorFunction } from 'rxjs';
7
+ import { CngxSearch } from '@cngx/common/interactive';
6
8
  import { HttpContextToken, HttpContext, HttpInterceptorFn } from '@angular/common/http';
7
9
  import { CngxRovingTabindex, CngxActiveDescendant } from '@cngx/common/a11y';
8
10
 
@@ -390,6 +392,17 @@ declare class CngxFilterChip<TItem = unknown, TValue = unknown> {
390
392
  * mount and unmount cleans the latest binding (per
391
393
  * `reference_signal_architecture` memory-hygiene rule).
392
394
  *
395
+ * **Visible caption.** The required `label` renders as a
396
+ * `.cngx-filter-chips__label` caption above the strip so a sighted user
397
+ * can tell which facet a chip row belongs to. The caption is
398
+ * `aria-hidden="true"`: the inner `<cngx-multi-chip-group>` is already
399
+ * named by the same string via `[label]`, so exposing the visible node
400
+ * to AT would announce the facet twice. Spacing between caption and
401
+ * strip is the `--cngx-filter-chips-gap` token; the caption's own
402
+ * appearance is `--cngx-filter-chips-label-color`,
403
+ * `--cngx-filter-chips-label-font-size` and
404
+ * `--cngx-filter-chips-label-font-weight`.
405
+ *
393
406
  * ```html
394
407
  * <cngx-filter-chips
395
408
  * label="Tags"
@@ -413,6 +426,7 @@ declare class CngxFilterChip<TItem = unknown, TValue = unknown> {
413
426
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/filter-chips/filter-chips.component.ts
414
427
  * @since 0.1.0
415
428
  * @relatedTo CngxFilter, CngxFilterChip, CngxMultiChipGroup
429
+ * @slot cngxFilterChip Renders one active filter chip; gets the filter entry and a remove callback.
416
430
  *
417
431
  * <example-url>http://localhost:4200/#/common/data/filter-chips/custom-chip-decoration-via-cngxfilterchip</example-url>
418
432
  * <example-url>http://localhost:4200/#/common/data/filter-chips/multi-role-filter-wired-to-a-list</example-url>
@@ -919,6 +933,24 @@ interface CngxSmartDataSourceOptions<T> {
919
933
  * direction. Defaults to a locale-aware string comparison.
920
934
  */
921
935
  sortFn?: (a: T, b: T, field: string, direction: 'asc' | 'desc') => number;
936
+ /**
937
+ * Resolve the `CngxSort` atom explicitly instead of relying on injection.
938
+ * A thunk, not an instance, so a `viewChild` that is `undefined` on the
939
+ * first pass resolves on a later read. A thunk result takes precedence over
940
+ * an injected instance whenever it yields one; on `undefined` / `null` the
941
+ * source falls back to the injected atom - so with both present, the
942
+ * injected atom drives the frames before the thunk's target mounts, and the
943
+ * thunk cannot express "use none".
944
+ * Use for atoms hosted below this source's injector, e.g.
945
+ * `{ sort: () => this.grid()?.sort }` against a `CngxDataGridAccordion`.
946
+ */
947
+ sort?: () => CngxSort | null | undefined;
948
+ /** Same as `sort`, for the `CngxFilter` atom. */
949
+ filter?: () => CngxFilter<T> | null | undefined;
950
+ /** Same as `sort`, for the `CngxSearch` atom. */
951
+ search?: () => CngxSearch | null | undefined;
952
+ /** Same as `sort`, for the `CngxPaginate` atom. */
953
+ paginate?: () => CngxPaginate | null | undefined;
922
954
  }
923
955
  /**
924
956
  * A CDK `DataSource` that optionally integrates with `CngxSort`,
@@ -926,6 +958,22 @@ interface CngxSmartDataSourceOptions<T> {
926
958
  * tree. Each directive is injected optionally - if absent, that processing
927
959
  * step is skipped.
928
960
  *
961
+ * Injection resolves UPWARD only. Any atom hosted by a descendant component
962
+ * - a `hostDirective` on an element below the consumer's injector - is
963
+ * invisible to these injects, and the matching step is silently skipped:
964
+ * the atom's own state still toggles (headers flip their arrows) while the
965
+ * rows never move. `CngxDataGridAccordion` is the case where this is always
966
+ * true: it hosts `CngxSort` and `CngxFilter` on the group element. Hand
967
+ * such atoms in through the options thunks instead:
968
+ *
969
+ * ```typescript
970
+ * readonly grid = viewChild(CngxDataGridAccordion);
971
+ * readonly dataSource = injectSmartDataSource(this.rows, {
972
+ * sort: () => this.grid()?.sort,
973
+ * filter: () => this.grid()?.filter,
974
+ * });
975
+ * ```
976
+ *
929
977
  * Accepts either a plain `Signal<T[]>` or a `CngxAsyncState<T[]>`.
930
978
  * When a `CngxAsyncState` is provided, the data source exposes the full
931
979
  * UX state (`isLoading`, `isRefreshing`, `error`, `isEmpty`) so the
@@ -952,10 +1000,10 @@ interface CngxSmartDataSourceOptions<T> {
952
1000
  declare class CngxSmartDataSource<T> extends DataSource<T> {
953
1001
  private readonly options?;
954
1002
  private readonly injector;
955
- private readonly sort;
956
- private readonly filter;
957
- private readonly search;
958
- private readonly paginate;
1003
+ private readonly injectedSort;
1004
+ private readonly injectedFilter;
1005
+ private readonly injectedSearch;
1006
+ private readonly injectedPaginate;
959
1007
  /**
960
1008
  * Items after filter and search are applied, before sort and pagination.
961
1009
  * Use `filteredCount()` to get the pre-pagination count for paginator `total`.
@@ -1010,7 +1058,7 @@ declare function injectSmartDataSource<T>(source: Signal<T[]> | CngxAsyncState<T
1010
1058
  /**
1011
1059
  * Writable extension of `CngxAsyncState` for manual control.
1012
1060
  *
1013
- * Returned by `createManualState()` — provides imperative setters
1061
+ * Returned by `createManualState()` - provides imperative setters
1014
1062
  * while the read-side stays the standard `CngxAsyncState` interface.
1015
1063
  *
1016
1064
  * @category common/data/async-state
@@ -1028,10 +1076,10 @@ interface ManualAsyncState<T> extends CngxAsyncState<T> {
1028
1076
  reset(): void;
1029
1077
  }
1030
1078
  /**
1031
- * Create a fully manual async state — no HTTP, no automatic loading.
1079
+ * Create a fully manual async state - no HTTP, no automatic loading.
1032
1080
  *
1033
1081
  * Use for local operations: heavy computations, Web Workers, complex local processes.
1034
- * Does **not** require an injection context — uses only `signal()` and `computed()`.
1082
+ * Does **not** require an injection context - uses only `signal()` and `computed()`.
1035
1083
  *
1036
1084
  * ```typescript
1037
1085
  * readonly processState = createManualState<ProcessResult>();
@@ -1061,7 +1109,7 @@ interface MutableAsyncState<T> extends CngxAsyncState<T> {
1061
1109
  * Execute an async action.
1062
1110
  *
1063
1111
  * Sets status to `pending`, then `success` or `error` on completion.
1064
- * Supersedes any in-flight execution — the previous result is discarded
1112
+ * Supersedes any in-flight execution - the previous result is discarded
1065
1113
  * but the underlying network request is not aborted.
1066
1114
  */
1067
1115
  execute(fn: () => Promise<T> | Observable<T>): Promise<void>;
@@ -1071,7 +1119,7 @@ interface MutableAsyncState<T> extends CngxAsyncState<T> {
1071
1119
  reset(): void;
1072
1120
  }
1073
1121
  /**
1074
- * Create a mutation async state — for explicit user-triggered actions.
1122
+ * Create a mutation async state - for explicit user-triggered actions.
1075
1123
  *
1076
1124
  * Must be called in an injection context (field initializer or constructor)
1077
1125
  * because it uses `inject(DestroyRef)` for cleanup.
@@ -1090,6 +1138,41 @@ interface MutableAsyncState<T> extends CngxAsyncState<T> {
1090
1138
  */
1091
1139
  declare function createAsyncState<T>(): MutableAsyncState<T>;
1092
1140
 
1141
+ /**
1142
+ * Wraps a *changing* source of async state in a stable
1143
+ * {@link CngxAsyncState} façade.
1144
+ *
1145
+ * A component that receives its state through an `Input` cannot publish that
1146
+ * object through `CNGX_STATEFUL` directly: the token is resolved once when a
1147
+ * bridge injects it, while the input can be rebound or absent. Capturing the
1148
+ * object would hand the bridge a stale state - or `undefined` before the
1149
+ * first binding.
1150
+ *
1151
+ * This returns one object whose every member is a `computed()` that reads the
1152
+ * source on each access, so bridges observe transitions of whatever is bound
1153
+ * right now. With nothing bound it reports a quiet `idle` state rather than
1154
+ * throwing, which is what lets a bridge sit inside a timeline that has not
1155
+ * been given a state yet.
1156
+ *
1157
+ * Contrast the select family, which provides `CNGX_STATEFUL` with
1158
+ * `useFactory` over a concrete `commitState` field - no forwarding needed
1159
+ * there, because the state is created by the component rather than passed in.
1160
+ * The split is not about the component, it is about where the state is born:
1161
+ * created locally, capture it; arriving through an `Input`, forward it.
1162
+ *
1163
+ * ```ts
1164
+ * readonly asyncState = createForwardedAsyncState(this.state);
1165
+ *
1166
+ * // providers:
1167
+ * { provide: CNGX_STATEFUL, useFactory: () => ({ state: inject(Host).asyncState }) }
1168
+ * ```
1169
+ *
1170
+ * @category common/data/async-state
1171
+ * @relatedTo createAsyncState, createManualState
1172
+ * @since 0.1.0
1173
+ */
1174
+ declare function createForwardedAsyncState<T>(source: () => CngxAsyncState<T> | undefined): CngxAsyncState<T>;
1175
+
1093
1176
  /**
1094
1177
  * Configuration options for `injectAsyncState`.
1095
1178
  *
@@ -1131,7 +1214,7 @@ interface ReactiveAsyncState<T> extends CngxAsyncState<T> {
1131
1214
  * Create a reactive async state that auto-loads when signal dependencies change.
1132
1215
  *
1133
1216
  * Must be called in an injection context (field initializer or constructor).
1134
- * The computation function is tracked by Angular's `effect()` — any signal
1217
+ * The computation function is tracked by Angular's `effect()` - any signal
1135
1218
  * read inside `fn` will cause a re-load when it changes.
1136
1219
  *
1137
1220
  * ```typescript
@@ -1156,7 +1239,7 @@ type AsyncView = 'none' | 'skeleton' | 'content' | 'empty' | 'error' | 'content+
1156
1239
  /**
1157
1240
  * Pure function that resolves which view to show based on async state.
1158
1241
  *
1159
- * Encodes the state machine as a lookup table — no branching:
1242
+ * Encodes the state machine as a lookup table - no branching:
1160
1243
  *
1161
1244
  * | status | firstLoad | empty | view |
1162
1245
  * |-------------|-----------|-------|---------------|
@@ -1173,13 +1256,82 @@ type AsyncView = 'none' | 'skeleton' | 'content' | 'empty' | 'error' | 'content+
1173
1256
  */
1174
1257
  declare function resolveAsyncView(status: AsyncStatus, firstLoad: boolean, empty: boolean): AsyncView;
1175
1258
 
1259
+ /**
1260
+ * One keyed upstream source feeding a {@link CngxAsyncBoundary}.
1261
+ *
1262
+ * The `key` (and optional `label`) travel with the state so per-source
1263
+ * attribution never relies on a parallel index array (Pillar 1).
1264
+ *
1265
+ * @category common/data/async-state
1266
+ * @since 0.1.0
1267
+ */
1268
+ interface AggregateSource<T = unknown> {
1269
+ /** Stable identity for this source, used to key attribution and `@for`. */
1270
+ readonly key: string;
1271
+ /** Human-readable label for the source, surfaced in the failures list. */
1272
+ readonly label?: string;
1273
+ /** The upstream state this source contributes to the aggregate. */
1274
+ readonly state: CngxAsyncState<T>;
1275
+ }
1276
+ /**
1277
+ * One errored source, surfaced by {@link CngxAsyncBoundary.failures}.
1278
+ *
1279
+ * @category common/data/async-state
1280
+ * @since 0.1.0
1281
+ */
1282
+ interface AggregateFailure {
1283
+ /** The failing source's key. */
1284
+ readonly key: string;
1285
+ /** The failing source's label, if it declared one. */
1286
+ readonly label?: string;
1287
+ /** The raw error from that source. */
1288
+ readonly error: unknown;
1289
+ }
1290
+ /**
1291
+ * Headless boundary that aggregates N keyed `CngxAsyncState`s into one derived
1292
+ * `CngxAsyncState` and provides it as `CNGX_STATEFUL`.
1293
+ *
1294
+ * The aggregate `state` is a first-class `CngxAsyncState`, so it renders
1295
+ * through `<cngx-async-container [state]="b.state">` and every other consumer
1296
+ * unchanged, and any transition bridge (`cngxToastOn`, `cngxAlertOn`,
1297
+ * `cngxBannerOn`) nested in the host fires on the combined status with zero
1298
+ * `[state]` wiring. `failures` exposes the errored sources - keyed, so a
1299
+ * consumer's `@for` can render per-source attribution through any feedback
1300
+ * component. `state.error` stays the first error for the single-error path.
1301
+ *
1302
+ * ```html
1303
+ * <div [cngxAsyncBoundary]="sources" #b="cngxAsyncBoundary">
1304
+ * <cngx-async-container [state]="b.state"> ... </cngx-async-container>
1305
+ * <cngx-toast-on />
1306
+ * @for (f of b.failures(); track f.key) {
1307
+ * <cngx-banner>{{ f.label }} failed</cngx-banner>
1308
+ * }
1309
+ * </div>
1310
+ * ```
1311
+ *
1312
+ * @category common/data/async-state
1313
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/async-state/async-boundary.directive.ts
1314
+ * @since 0.1.0
1315
+ */
1316
+ declare class CngxAsyncBoundary implements CngxStateful<readonly unknown[]> {
1317
+ /** The keyed source list to aggregate. */
1318
+ readonly sources: _angular_core.InputSignal<readonly AggregateSource<unknown>[]>;
1319
+ private readonly states;
1320
+ /** The derived aggregate state - also exposed via `CNGX_STATEFUL`. */
1321
+ readonly state: CngxAsyncState<readonly unknown[]>;
1322
+ /** The errored sources, keyed for per-source attribution. */
1323
+ readonly failures: _angular_core.Signal<readonly AggregateFailure[]>;
1324
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxAsyncBoundary, never>;
1325
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxAsyncBoundary, "[cngxAsyncBoundary]", ["cngxAsyncBoundary"], { "sources": { "alias": "cngxAsyncBoundary"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
1326
+ }
1327
+
1176
1328
  /**
1177
1329
  * Bridge that projects an Angular `Resource<T>` onto `CngxAsyncState<T>`.
1178
1330
  *
1179
1331
  * Must be called in an injection context (the `effect()` that tracks
1180
1332
  * `hadSuccess` requires one).
1181
1333
  *
1182
- * All signals are derived reactively from the resource — no manual
1334
+ * All signals are derived reactively from the resource - no manual
1183
1335
  * synchronization. The resource stays the single source of truth.
1184
1336
  *
1185
1337
  * ```typescript
@@ -1191,8 +1343,8 @@ declare function resolveAsyncView(status: AsyncStatus, firstLoad: boolean, empty
1191
1343
  * });
1192
1344
  *
1193
1345
  * readonly items = fromResource(this.res);
1194
- * // items.status(), items.data(), items.isFirstLoad() — all work
1195
- * // <cngx-async-container [state]="items"> — direct binding
1346
+ * // items.status(), items.data(), items.isFirstLoad() - all work
1347
+ * // <cngx-async-container [state]="items"> - direct binding
1196
1348
  * ```
1197
1349
  *
1198
1350
  * @category common/data/async-state
@@ -1200,7 +1352,7 @@ declare function resolveAsyncView(status: AsyncStatus, firstLoad: boolean, empty
1200
1352
  declare function fromResource<T>(ref: Resource<T>): CngxAsyncState<T>;
1201
1353
 
1202
1354
  /**
1203
- * Shape of an `HttpResourceRef` — only the signals we need.
1355
+ * Shape of an `HttpResourceRef` - only the signals we need.
1204
1356
  *
1205
1357
  * Declared here to avoid a hard dependency on `@angular/common/http`.
1206
1358
  * The consumer passes the actual `httpResource()` return value which
@@ -1225,7 +1377,7 @@ interface HttpResourceLike<T> extends Resource<T> {
1225
1377
  *
1226
1378
  * readonly items = fromHttpResource(this.res);
1227
1379
  * // items.progress() tracks upload/download progress
1228
- * // <cngx-progress [state]="items"> — auto-wired progress bar
1380
+ * // <cngx-progress [state]="items"> - auto-wired progress bar
1229
1381
  * ```
1230
1382
  *
1231
1383
  * @category common/data/async-state
@@ -1235,7 +1387,7 @@ declare function fromHttpResource<T>(ref: HttpResourceLike<T>): CngxAsyncState<T
1235
1387
  /**
1236
1388
  * Minimal write interface for async state operators.
1237
1389
  *
1238
- * Any `ManualAsyncState<T>` satisfies this — operators only need the write side.
1390
+ * Any `ManualAsyncState<T>` satisfies this - operators only need the write side.
1239
1391
  */
1240
1392
  interface AsyncStateSink<T> {
1241
1393
  set(status: 'loading' | 'refreshing' | 'pending'): void;
@@ -1250,7 +1402,7 @@ interface AsyncStateSink<T> {
1250
1402
  * On next: calls `setSuccess(value)`.
1251
1403
  * On error: calls `setError(err)` and **re-throws** (does not swallow).
1252
1404
  *
1253
- * The Observable passes through unchanged — `tapAsyncState` is a side-effect operator.
1405
+ * The Observable passes through unchanged - `tapAsyncState` is a side-effect operator.
1254
1406
  *
1255
1407
  * ```typescript
1256
1408
  * readonly residents = createManualState<Resident[]>();
@@ -1319,7 +1471,7 @@ declare function tapAsyncProgress<E>(state: Pick<AsyncStateSink<unknown>, 'setPr
1319
1471
  * tapHttpAsyncState(this.upload),
1320
1472
  * takeUntilDestroyed(this.destroyRef),
1321
1473
  * ).subscribe();
1322
- * // upload.status(), upload.progress(), upload.data() — all wired
1474
+ * // upload.status(), upload.progress(), upload.data() - all wired
1323
1475
  * }
1324
1476
  * ```
1325
1477
  *
@@ -1413,6 +1565,30 @@ declare function provideAsyncRegistry(): EnvironmentProviders;
1413
1565
  */
1414
1566
  declare function injectAsyncRegistry(): CngxAsyncRegistry | null;
1415
1567
 
1568
+ /**
1569
+ * Bridges {@link CngxAsyncRegistry} into a {@link CngxLatencyProbe} measuring the
1570
+ * registry's observed busy-envelope: how long the app was "anything loading"
1571
+ * during the last in-flight window.
1572
+ *
1573
+ * An app-shell indicator compares `lastDuration()` against
1574
+ * `CNGX_LOADING_CONFIG.spinnerVsSkeletonCutoff` to pick a spinner (fast last
1575
+ * aggregate) vs a skeleton (slow last aggregate) before the next load renders.
1576
+ *
1577
+ * When the registry is absent (`provideAsyncRegistry` never called),
1578
+ * `injectAsyncRegistry()` returns `null`, so the probe's source is permanently
1579
+ * `false`: it is never busy and never throws.
1580
+ *
1581
+ * Must run in an injection context.
1582
+ *
1583
+ * @returns A probe over `CngxAsyncRegistry.isAnythingLoading`.
1584
+ *
1585
+ * @category common/data/async-registry
1586
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/async-registry/inject-latency-probe.ts
1587
+ * @since 0.1.0
1588
+ * @relatedTo provideAsyncRegistry, injectAsyncRegistry, createLatencyProbe
1589
+ */
1590
+ declare function injectLatencyProbe(): CngxLatencyProbe;
1591
+
1416
1592
  /**
1417
1593
  * Per-request label surfaced in `CngxAsyncRegistry.activeOperations` when the
1418
1594
  * request is tracked by `cngxAsyncInterceptor`. Display only, never a key.
@@ -1808,6 +1984,52 @@ interface CngxStatRegistry {
1808
1984
  /** DI token carrying the {@link CngxStatRegistry} a `CngxStat` provides. */
1809
1985
  declare const CNGX_STAT: InjectionToken<CngxStatRegistry>;
1810
1986
 
1987
+ /**
1988
+ * The slot-id coordination brain behind {@link CNGX_STAT}. Collects the id each
1989
+ * `cngxStat*` slot registers and derives one `aria-labelledby` that reads the
1990
+ * whole stat as a single accessible name in reading order.
1991
+ *
1992
+ * Lives as a host directive rather than inside `CngxStat` because the slot
1993
+ * directives resolve `CNGX_STAT` against their **declaration** site: content
1994
+ * written inside an organism never reaches a `<cngx-stat>` that sits in that
1995
+ * organism's own template. Any component that wants to host the four slots
1996
+ * therefore applies this brain and re-points the token at it:
1997
+ *
1998
+ * ```ts
1999
+ * hostDirectives: [CngxStatCoordinator],
2000
+ * providers: [{ provide: CNGX_STAT, useExisting: CngxStatCoordinator }],
2001
+ * ```
2002
+ *
2003
+ * Same shape as `CngxPaginate` behind `CNGX_PAGINATOR_HOST`, which
2004
+ * `CngxPaginator` and `CngxIncrementalList` share the same way.
2005
+ *
2006
+ * @category common/data/metric
2007
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/display/stat/stat-coordinator.directive.ts
2008
+ * @since 0.1.0
2009
+ * @relatedTo CngxStat, CNGX_STAT
2010
+ */
2011
+ declare class CngxStatCoordinator implements CngxStatRegistry {
2012
+ private readonly slots;
2013
+ /** {@inheritDoc CngxStatRegistry.register} */
2014
+ register(kind: CngxStatSlotKind, id: string): void;
2015
+ /** {@inheritDoc CngxStatRegistry.unregister} */
2016
+ unregister(kind: CngxStatSlotKind): void;
2017
+ /** Present slot ids in reading order; structurally stable. */
2018
+ readonly orderedIds: _angular_core.Signal<string[]>;
2019
+ /** Combined accessible name for the host; `null` when no slot is present. */
2020
+ readonly labelledBy: _angular_core.Signal<string | null>;
2021
+ /**
2022
+ * Which slots a consumer actually projected, in reading order. Registration
2023
+ * happens when the slot directive is constructed in the consumer's template,
2024
+ * so this stays accurate even while the host renders a branch that does not
2025
+ * include the `<ng-content>` outlets - which is what lets a placeholder mirror
2026
+ * the real tile instead of guessing at it.
2027
+ */
2028
+ readonly presentKinds: _angular_core.Signal<CngxStatSlotKind[]>;
2029
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxStatCoordinator, never>;
2030
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxStatCoordinator, never, never, {}, {}, never, never, true, never>;
2031
+ }
2032
+
1811
2033
  /**
1812
2034
  * Coordination molecule for a KPI stat. Its sole reason to exist is the
1813
2035
  * screen-reader layer (Pillar 2): hand-assembling a heading, a `<cngx-metric>`
@@ -1816,9 +2038,10 @@ declare const CNGX_STAT: InjectionToken<CngxStatRegistry>;
1816
2038
  * collects the id each slot registers, and derives one `aria-labelledby` that
1817
2039
  * reads the whole stat as a single accessible name in reading order.
1818
2040
  *
1819
- * Composition, never a config bag (Pillar 3): the molecule owns only the id
1820
- * coordination `computed()` graph; the visuals are whatever atoms the
1821
- * consumer projects into the slots.
2041
+ * Composition, never a config bag (Pillar 3): the id coordination lives in the
2042
+ * {@link CngxStatCoordinator} host directive, so another component that hosts
2043
+ * the same four slots applies the identical brain instead of reimplementing it.
2044
+ * The visuals stay whatever atoms the consumer projects into the slots.
1822
2045
  *
1823
2046
  * ```html
1824
2047
  * <cngx-stat aria-live="polite">
@@ -1834,27 +2057,20 @@ declare const CNGX_STAT: InjectionToken<CngxStatRegistry>;
1834
2057
  * @wcag AA
1835
2058
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/display/stat/stat.component.ts
1836
2059
  * @since 0.1.0
1837
- * @relatedTo CngxMetric, CngxDelta, CngxTrend
2060
+ * @relatedTo CngxMetric, CngxDelta, CngxTrend, CngxStatCoordinator
1838
2061
  *
1839
2062
  * <example-url>http://localhost:4200/#/common/data/stat/composed-kpi</example-url>
1840
2063
  */
1841
- declare class CngxStat implements CngxStatRegistry {
1842
- private readonly slots;
2064
+ declare class CngxStat {
2065
+ /** @internal The shared slot-id brain, applied as a host directive. */
2066
+ protected readonly coordinator: CngxStatCoordinator;
1843
2067
  /**
1844
2068
  * Politeness of the live region. `off` (default) for a static stat;
1845
2069
  * `polite` / `assertive` for a KPI whose value updates in place.
1846
2070
  */
1847
2071
  readonly live: _angular_core.InputSignal<"off" | "polite" | "assertive">;
1848
- /** {@inheritDoc CngxStatRegistry.register} */
1849
- register(kind: CngxStatSlotKind, id: string): void;
1850
- /** {@inheritDoc CngxStatRegistry.unregister} */
1851
- unregister(kind: CngxStatSlotKind): void;
1852
- /** @internal Present slot ids in reading order; structurally stable. */
1853
- protected readonly orderedIds: _angular_core.Signal<string[]>;
1854
- /** @internal Combined accessible name; `null` when no slot is present. */
1855
- protected readonly labelledBy: _angular_core.Signal<string | null>;
1856
2072
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxStat, never>;
1857
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxStat, "cngx-stat", never, { "live": { "alias": "live"; "required": false; "isSignal": true; }; }, {}, never, ["[cngxStatLabel]", "[cngxStatValue]", "[cngxStatDelta]", "[cngxStatCaption]"], true, never>;
2073
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxStat, "cngx-stat", never, { "live": { "alias": "live"; "required": false; "isSignal": true; }; }, {}, never, ["[cngxStatLabel]", "[cngxStatValue]", "[cngxStatDelta]", "[cngxStatCaption]"], true, [{ directive: typeof CngxStatCoordinator; inputs: {}; outputs: {}; }]>;
1858
2074
  }
1859
2075
 
1860
2076
  /**
@@ -1914,56 +2130,6 @@ declare class CngxStatCaption {
1914
2130
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxStatCaption, "[cngxStatCaption]", never, {}, {}, never, never, true, never>;
1915
2131
  }
1916
2132
 
1917
- /** Semantic health of a {@link CngxStatus}. */
1918
- type StatusTone = 'success' | 'warning' | 'danger' | 'info' | 'neutral';
1919
- /**
1920
- * Semantic health indicator - a decorative tone dot paired with a visible
1921
- * label. Distinct from `CngxBadge` (count overlay), `CngxChip` (interactive)
1922
- * and `CngxTag` (labeled token): its single job is to communicate a status
1923
- * (operational / degraded / down / info).
1924
- *
1925
- * Colour is never the only signal (Pillar 2): the tone drives the dot colour
1926
- * *and* a tone glyph, so a colour-blind reader still distinguishes the states,
1927
- * and the visible `label` carries the meaning for assistive tech (the dot is
1928
- * `aria-hidden`). Set `live` for a status that changes in place.
1929
- *
1930
- * ### Basic
1931
- * ```html
1932
- * <cngx-status tone="success" label="Operational" />
1933
- * ```
1934
- *
1935
- * ### Live-updating
1936
- * ```html
1937
- * <cngx-status tone="danger" label="Outage" live="assertive" />
1938
- * ```
1939
- *
1940
- * @category common/data/metric
1941
- * @docsKind primary
1942
- * @wcag AA
1943
- * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/display/status/status.component.ts
1944
- * @since 0.1.0
1945
- * @relatedTo CngxBadge, CngxTag, CngxChip
1946
- *
1947
- * <example-url>http://localhost:4200/#/common/data/status/tone-matrix</example-url>
1948
- */
1949
- declare class CngxStatus {
1950
- private readonly elRef;
1951
- /** Semantic health. Drives both the dot colour and the tone glyph. */
1952
- readonly tone: _angular_core.InputSignal<StatusTone>;
1953
- /** Visible status text. Carries the meaning for assistive tech. */
1954
- readonly label: _angular_core.InputSignal<string | undefined>;
1955
- /**
1956
- * Politeness of the live region. `off` (default) for a static status;
1957
- * `polite` / `assertive` for a status that changes in place.
1958
- */
1959
- readonly live: _angular_core.InputSignal<"off" | "polite" | "assertive">;
1960
- /** @internal Tone glyph bound into the decorative dot. */
1961
- protected readonly glyph: _angular_core.Signal<string>;
1962
- constructor();
1963
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxStatus, never>;
1964
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxStatus, "cngx-status", never, { "tone": { "alias": "tone"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "live": { "alias": "live"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1965
- }
1966
-
1967
2133
  /**
1968
2134
  * Determinate attainment bar - a continuous progress toward a target
1969
2135
  * (quota reached, budget spent, goal met). Named `CngxGoal` because
@@ -2372,7 +2538,7 @@ declare class CngxRecyclerAnnouncer {
2372
2538
  * Must be called in an injection context (constructor or field initializer)
2373
2539
  * **on the component that hosts both the recycler's scroll container and the
2374
2540
  * `CngxRovingTabindex` directive**. The injected `ElementRef` is used to query
2375
- * `[data-cngx-recycle-index]` — calling from a child component would query the
2541
+ * `[data-cngx-recycle-index]` - calling from a child component would query the
2376
2542
  * wrong subtree.
2377
2543
  *
2378
2544
  * ```typescript
@@ -2410,7 +2576,7 @@ declare function connectRecyclerToRoving(recycler: CngxRecycler, roving: CngxRov
2410
2576
  *
2411
2577
  * Unlike {@link /projects/common/data/src/recycler/connect-recycler-roving.ts
2412
2578
  * connectRecyclerToRoving}, we don't re-focus a DOM element after the
2413
- * scroll — AD doesn't move real focus, it only rebinds
2579
+ * scroll - AD doesn't move real focus, it only rebinds
2414
2580
  * `aria-activedescendant`. Once the target index enters the rendered
2415
2581
  * range, the `[attr.aria-activedescendant]` binding on the combobox
2416
2582
  * trigger resolves to the now-present option element for free.
@@ -2422,7 +2588,7 @@ declare function connectRecyclerToRoving(recycler: CngxRecycler, roving: CngxRov
2422
2588
  * ```typescript
2423
2589
  * @Component({
2424
2590
  * hostDirectives: [
2425
- * { directive: CngxActiveDescendant, inputs: ['items', 'virtualCount'] },
2591
+ * { directive: CngxActiveDescendant, inputs: ['items', 'virtualCount', 'windowStart'] },
2426
2592
  * ],
2427
2593
  * })
2428
2594
  * class MyVirtualSelect {
@@ -2454,7 +2620,7 @@ interface CngxCommitHandle {
2454
2620
  /**
2455
2621
  * Action runner contract. Receives the controller's success/error
2456
2622
  * routes and returns a cancel handle. The runner is opaque to the
2457
- * controller — it can wrap any async source (Observable, Promise,
2623
+ * controller - it can wrap any async source (Observable, Promise,
2458
2624
  * sync value) and any cancellation primitive.
2459
2625
  *
2460
2626
  * Variants supply their own runner adapter (e.g. select's
@@ -2503,7 +2669,7 @@ interface CngxCommitController<T> {
2503
2669
  /** `true` while a commit is in flight. */
2504
2670
  readonly isCommitting: Signal<boolean>;
2505
2671
  /**
2506
- * The most recent intended value — what the user was trying to
2672
+ * The most recent intended value - what the user was trying to
2507
2673
  * commit. Used by the option-row spinner and the commit-error
2508
2674
  * template context to identify *which* option the failure belongs
2509
2675
  * to.
@@ -2518,7 +2684,7 @@ interface CngxCommitController<T> {
2518
2684
  * action and the intended value)
2519
2685
  * @param intended the value the user clicked
2520
2686
  * @param previous the value to roll back to on error
2521
- * @param handlers success/error routes — the controller only
2687
+ * @param handlers success/error routes - the controller only
2522
2688
  * updates its own state and calls these; it does
2523
2689
  * NOT touch external value signals, panel open
2524
2690
  * state, or component outputs.
@@ -2534,7 +2700,7 @@ interface CngxCommitController<T> {
2534
2700
  /**
2535
2701
  * Factory for the commit controller.
2536
2702
  *
2537
- * Plain function, not a class — matches the rest of the repo
2703
+ * Plain function, not a class - matches the rest of the repo
2538
2704
  * (`createManualState`, `createAsyncState`, `createTransitionTracker`).
2539
2705
  * See `reference_api_prefix_convention.md`.
2540
2706
  *
@@ -2594,7 +2760,7 @@ declare const CNGX_COMMIT_CONTROLLER_FACTORY: InjectionToken<CngxCommitControlle
2594
2760
  interface CngxMaterialBidirectionalSyncOptions {
2595
2761
  /**
2596
2762
  * Reactive source for the presenter's current index. The factory's
2597
- * `effect()` tracks this signal — when it changes, Material is
2763
+ * `effect()` tracks this signal - when it changes, Material is
2598
2764
  * written (subject to the equality guard against the Material
2599
2765
  * read-side).
2600
2766
  */
@@ -2652,7 +2818,7 @@ interface CngxMaterialBidirectionalSyncHandle {
2652
2818
  * (`<mat-tab-group>`, `<mat-stepper>`, etc.).
2653
2819
  *
2654
2820
  * Lives at Level 2 in `@cngx/common/data` parallel to
2655
- * `createCommitController`. Material types never enter the signature —
2821
+ * `createCommitController`. Material types never enter the signature -
2656
2822
  * the caller maps Material-specific events and property accessors to a
2657
2823
  * host-agnostic shape at the directive boundary.
2658
2824
  *
@@ -2666,7 +2832,7 @@ interface CngxMaterialBidirectionalSyncHandle {
2666
2832
  * 2. A Material→presenter subscription that forwards each
2667
2833
  * `selectionChange$` emission to `onMaterialSelection`
2668
2834
  * (equality-guarded against `presenterIndex()` so a Material event
2669
- * whose value already matches the presenter is dropped — closes
2835
+ * whose value already matches the presenter is dropped - closes
2670
2836
  * the re-entrancy loop).
2671
2837
  *
2672
2838
  * Both sides clean up via `destroyRef`.
@@ -2694,7 +2860,7 @@ interface CngxMaterialBidirectionalSyncHandle {
2694
2860
  * load-bearing for an ASYNC commit-action: Material emits the echo a
2695
2861
  * microtask later, by which point the commit may have advanced
2696
2862
  * `presenterIndex`, so an equality-only guard (`presenterIndex() ===
2697
- * idx`) would FAIL to drop the echo — it would re-enter the subscriber
2863
+ * idx`) would FAIL to drop the echo - it would re-enter the subscriber
2698
2864
  * and ping-pong against the in-flight navigation (the demo freezes).
2699
2865
  * Matching the echo by the value we wrote drops it regardless of where
2700
2866
  * the presenter has moved.
@@ -2703,5 +2869,5 @@ interface CngxMaterialBidirectionalSyncHandle {
2703
2869
  */
2704
2870
  declare function createMaterialBidirectionalSync(opts: CngxMaterialBidirectionalSyncOptions): CngxMaterialBidirectionalSyncHandle;
2705
2871
 
2706
- export { CNGX_ASYNC_LABEL, CNGX_ASYNC_SKIP, CNGX_BUCKET_PAGINATE_HOST, CNGX_COMMIT_CONTROLLER_FACTORY, CNGX_RECYCLER_I18N, CNGX_STAT, CngxAsync, CngxAsyncRegistry, CngxBucketPaginate, CngxDataSource, CngxDelta, CngxFilter, CngxFilterChip, CngxFilterChips, CngxGoal, CngxMeasure, CngxMetric, CngxPaginate, CngxPaginateResetOn, CngxPaginateRouting, CngxRecyclerAnnouncer, CngxSmartDataSource, CngxSort, CngxSortHeader, CngxStat, CngxStatCaption, CngxStatDelta, CngxStatLabel, CngxStatValue, CngxStatus, CngxTrend, CngxVirtualItem, cngxAsyncInterceptor, connectPaginateEmit, connectPaginateResetOn, connectRecyclerToActiveDescendant, connectRecyclerToRoving, createAsyncState, createCommitController, createManualState, createMaterialBidirectionalSync, createSortHeaderState, fromHttpResource, fromResource, injectAsyncRegistry, injectAsyncState, injectDataSource, injectRecycler, injectSmartDataSource, provideAsyncHttpObservability, provideAsyncRegistry, provideRecyclerI18n, resolveAsyncView, tapAsyncProgress, tapAsyncState, tapHttpAsyncState, withAsyncLabel, withAsyncSkip };
2707
- export type { AsyncView, CngxAsyncContext, CngxAsyncOperation, CngxBucket, CngxBucketPaginateHost, CngxBucketPaginateView, CngxCommitBeginHandlers, CngxCommitController, CngxCommitControllerFactory, CngxCommitHandle, CngxCommitRunner, CngxFilterChipContext, CngxMaterialBidirectionalSyncHandle, CngxMaterialBidirectionalSyncOptions, CngxPaginateEmitHandlers, CngxRecycler, CngxSmartDataSourceOptions, CngxStatRegistry, CngxStatSlotKind, DeltaMode, DeltaPolarity, InjectAsyncStateOptions, ManualAsyncState, MutableAsyncState, ReactiveAsyncState, RecyclerConfig, RecyclerI18n, SortEntry, SortHeaderState, StatusTone };
2872
+ export { CNGX_ASYNC_LABEL, CNGX_ASYNC_SKIP, CNGX_BUCKET_PAGINATE_HOST, CNGX_COMMIT_CONTROLLER_FACTORY, CNGX_RECYCLER_I18N, CNGX_STAT, CngxAsync, CngxAsyncBoundary, CngxAsyncRegistry, CngxBucketPaginate, CngxDataSource, CngxDelta, CngxFilter, CngxFilterChip, CngxFilterChips, CngxGoal, CngxMeasure, CngxMetric, CngxPaginate, CngxPaginateResetOn, CngxPaginateRouting, CngxRecyclerAnnouncer, CngxSmartDataSource, CngxSort, CngxSortHeader, CngxStat, CngxStatCaption, CngxStatCoordinator, CngxStatDelta, CngxStatLabel, CngxStatValue, CngxTrend, CngxVirtualItem, cngxAsyncInterceptor, connectPaginateEmit, connectPaginateResetOn, connectRecyclerToActiveDescendant, connectRecyclerToRoving, createAsyncState, createCommitController, createForwardedAsyncState, createManualState, createMaterialBidirectionalSync, createSortHeaderState, fromHttpResource, fromResource, injectAsyncRegistry, injectAsyncState, injectDataSource, injectLatencyProbe, injectRecycler, injectSmartDataSource, provideAsyncHttpObservability, provideAsyncRegistry, provideRecyclerI18n, resolveAsyncView, tapAsyncProgress, tapAsyncState, tapHttpAsyncState, withAsyncLabel, withAsyncSkip };
2873
+ export type { AggregateFailure, AggregateSource, AsyncView, CngxAsyncContext, CngxAsyncOperation, CngxBucket, CngxBucketPaginateHost, CngxBucketPaginateView, CngxCommitBeginHandlers, CngxCommitController, CngxCommitControllerFactory, CngxCommitHandle, CngxCommitRunner, CngxFilterChipContext, CngxMaterialBidirectionalSyncHandle, CngxMaterialBidirectionalSyncOptions, CngxPaginateEmitHandlers, CngxRecycler, CngxSmartDataSourceOptions, CngxStatRegistry, CngxStatSlotKind, DeltaMode, DeltaPolarity, InjectAsyncStateOptions, ManualAsyncState, MutableAsyncState, ReactiveAsyncState, RecyclerConfig, RecyclerI18n, SortEntry, SortHeaderState };