@cngx/common 0.1.0-rc.3 → 0.1.0-rc.4

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 (37) hide show
  1. package/display/README.md +1 -0
  2. package/fesm2022/cngx-common-a11y.mjs +123 -3
  3. package/fesm2022/cngx-common-a11y.mjs.map +1 -1
  4. package/fesm2022/cngx-common-card.mjs +8 -8
  5. package/fesm2022/cngx-common-card.mjs.map +1 -1
  6. package/fesm2022/cngx-common-data.mjs +691 -52
  7. package/fesm2022/cngx-common-data.mjs.map +1 -1
  8. package/fesm2022/cngx-common-display.mjs +320 -8
  9. package/fesm2022/cngx-common-display.mjs.map +1 -1
  10. package/fesm2022/cngx-common-interactive.mjs +1603 -75
  11. package/fesm2022/cngx-common-interactive.mjs.map +1 -1
  12. package/fesm2022/cngx-common-layout.mjs +187 -3
  13. package/fesm2022/cngx-common-layout.mjs.map +1 -1
  14. package/fesm2022/cngx-common-popover.mjs +63 -8
  15. package/fesm2022/cngx-common-popover.mjs.map +1 -1
  16. package/fesm2022/cngx-common.mjs +1 -1
  17. package/interactive/README.md +101 -0
  18. package/layout/README.md +39 -1
  19. package/package.json +1 -1
  20. package/theming/components/cngx-accordion.css +147 -0
  21. package/theming/components/cngx-badge.css +6 -0
  22. package/theming/components/cngx-bottom-sheet.css +8 -1
  23. package/theming/components/cngx-breadcrumb.css +108 -0
  24. package/theming/components/cngx-button-toggle.css +6 -0
  25. package/theming/components/cngx-data-grid.css +154 -0
  26. package/theming/components/cngx-dialog.css +4 -0
  27. package/theming/components/cngx-divider.css +4 -0
  28. package/theming/components/cngx-listbox.css +6 -0
  29. package/theming/components/cngx-menu.css +7 -0
  30. package/theming/components/cngx-slider.css +237 -0
  31. package/theming/components/cngx-tooltip.css +6 -0
  32. package/types/cngx-common-a11y.d.ts +67 -2
  33. package/types/cngx-common-data.d.ts +444 -22
  34. package/types/cngx-common-display.d.ts +189 -1
  35. package/types/cngx-common-interactive.d.ts +1014 -31
  36. package/types/cngx-common-layout.d.ts +88 -3
  37. package/types/cngx-common-popover.d.ts +25 -4
@@ -1,5 +1,5 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { TemplateRef, Signal, OnInit, InjectionToken, Resource, ElementRef, Injector, DestroyRef } from '@angular/core';
2
+ import { Signal, TemplateRef, OnInit, InjectionToken, Resource, ElementRef, Injector, DestroyRef } from '@angular/core';
3
3
  import { CngxAsyncState, AsyncStatus } from '@cngx/core/utils';
4
4
  import { DataSource } from '@angular/cdk/collections';
5
5
  import { Observable, MonoTypeOperatorFunction, OperatorFunction } from 'rxjs';
@@ -22,6 +22,11 @@ interface SortEntry {
22
22
  * precedence over the internal state - pair with `sortChange` to keep them
23
23
  * in sync.
24
24
  *
25
+ * An uncontrolled sort may declare a **starting** column + direction via
26
+ * `[cngxSortInitial]`: it seeds the internal state exactly once on init, then
27
+ * user clicks take over. Distinct from the controlled `cngxSortActive` /
28
+ * `cngxSortDirection` pins - the seed is skipped when a controlled pin is bound.
29
+ *
25
30
  * When `multiSort` is `true`, holding **Shift** while clicking a sort header
26
31
  * adds it as a secondary (tertiary, …) sort key instead of replacing the
27
32
  * primary one. Shift-clicking an active column cycles it asc → desc → removed.
@@ -40,9 +45,6 @@ interface SortEntry {
40
45
  * <example-url>http://localhost:4200/#/common/data/sort/multi-sort</example-url>
41
46
  * <example-url>http://localhost:4200/#/common/data/sort/controlled</example-url>
42
47
  * <example-url>http://localhost:4200/#/common/data/sort/aria-and-keyboard</example-url>
43
- // * <example-url>http://localhost:4200/#/common/data/smart-data-source/auto-wired</example-url>
44
- // * <example-url>http://localhost:4200/#/common/data/smart-data-source/how-it-works-hostdirectives-inject</example-url>
45
- // * <example-url>http://localhost:4200/#/common/data/smart-data-source/smartdatasource-cngxpaginate-hostdirective</example-url>
46
48
  */
47
49
  declare class CngxSort {
48
50
  /** Controlled active column. When bound, takes precedence over internal state (single-sort only). */
@@ -54,7 +56,14 @@ declare class CngxSort {
54
56
  * replacing the current sort.
55
57
  */
56
58
  readonly multiSort: _angular_core.InputSignal<boolean>;
59
+ /**
60
+ * Uncontrolled starting sort. Seeds the internal state once on init if no sort
61
+ * is set yet and no controlled `cngxSortActive` pin is bound; user clicks own
62
+ * it thereafter. Ignored in controlled mode.
63
+ */
64
+ readonly initialSort: _angular_core.InputSignal<SortEntry | undefined>;
57
65
  private readonly sortsState;
66
+ constructor();
58
67
  /** The active sort column of the primary entry (controlled takes precedence in single-sort mode). */
59
68
  readonly active: _angular_core.Signal<string>;
60
69
  /** The active sort direction of the primary entry (controlled takes precedence in single-sort mode). */
@@ -85,7 +94,7 @@ declare class CngxSort {
85
94
  * Sets or toggles the sort for `field`.
86
95
  *
87
96
  * **`additive = false`** (default, plain click):
88
- * - Same field → toggle direction (asc → desc → asc)
97
+ * - Same field → cycle `asc` → `desc` → cleared (a third click removes the sort)
89
98
  * - Different field → replace stack with `{ field, asc }`
90
99
  *
91
100
  * **`additive = true`** (Shift+click when `multiSort` is enabled on the header):
@@ -97,7 +106,7 @@ declare class CngxSort {
97
106
  /** Clears all active sorts. Emits both `sortChange(undefined)` and `sortsChange([])`. */
98
107
  clear(): void;
99
108
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSort, never>;
100
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxSort, "[cngxSort]", ["cngxSort"], { "activeInput": { "alias": "cngxSortActive"; "required": false; "isSignal": true; }; "directionInput": { "alias": "cngxSortDirection"; "required": false; "isSignal": true; }; "multiSort": { "alias": "multiSort"; "required": false; "isSignal": true; }; }, { "sortChange": "sortChange"; "sortsChange": "sortsChange"; }, never, never, true, never>;
109
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxSort, "[cngxSort]", ["cngxSort"], { "activeInput": { "alias": "cngxSortActive"; "required": false; "isSignal": true; }; "directionInput": { "alias": "cngxSortDirection"; "required": false; "isSignal": true; }; "multiSort": { "alias": "multiSort"; "required": false; "isSignal": true; }; "initialSort": { "alias": "cngxSortInitial"; "required": false; "isSignal": true; }; }, { "sortChange": "sortChange"; "sortsChange": "sortsChange"; }, never, never, true, never>;
101
110
  }
102
111
 
103
112
  /**
@@ -139,7 +148,7 @@ declare class CngxSortHeader {
139
148
  readonly field: _angular_core.InputSignal<string>;
140
149
  /** Explicit reference to the owning `CngxSort`. */
141
150
  readonly cngxSortRef: _angular_core.InputSignal<CngxSort>;
142
- private readonly entry;
151
+ private readonly state;
143
152
  /** `true` when this column is part of the active sort (primary or secondary). */
144
153
  readonly isActive: _angular_core.Signal<boolean>;
145
154
  /** `true` when this column is active and sorted ascending. */
@@ -159,6 +168,53 @@ declare class CngxSortHeader {
159
168
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxSortHeader, "[cngxSortHeader]", ["cngxSortHeader"], { "field": { "alias": "cngxSortHeader"; "required": true; "isSignal": true; }; "cngxSortRef": { "alias": "cngxSortRef"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
160
169
  }
161
170
 
171
+ /**
172
+ * The derived sort-header state a header directive exposes for one column.
173
+ *
174
+ * Pure derivation over a single {@link CngxSort} source plus an imperative
175
+ * `toggle`. No async state, no signal writes outside `toggle`.
176
+ *
177
+ * @category common/data/sort
178
+ */
179
+ interface SortHeaderState {
180
+ /** The active sort entry for this column, or `undefined` when the column is not sorted. */
181
+ readonly entry: Signal<SortEntry | undefined>;
182
+ /** `true` when this column is part of the active sort (primary or secondary). */
183
+ readonly isActive: Signal<boolean>;
184
+ /** `true` when this column is active and sorted ascending. */
185
+ readonly isAsc: Signal<boolean>;
186
+ /** `true` when this column is active and sorted descending. */
187
+ readonly isDesc: Signal<boolean>;
188
+ /**
189
+ * 1-based position of this column in the sort stack, or `0` when it is not active.
190
+ * Only meaningful when `multiSort` is enabled on the owning `CngxSort`.
191
+ */
192
+ readonly priority: Signal<number>;
193
+ /**
194
+ * Toggles this column's sort through `CngxSort.setSort`. Pass the header's own
195
+ * Shift-key read as `additive`; the `multiSort` gate is applied here so the
196
+ * column only joins the stack additively when the owning sort allows it.
197
+ */
198
+ toggle(additive?: boolean): void;
199
+ }
200
+ /**
201
+ * Derives the shared sort-header state for one column from a {@link CngxSort} getter.
202
+ *
203
+ * Both {@link CngxSortHeader} (table context, `aria-sort`) and `CngxDgaSortHeader`
204
+ * (disclosure context, `role="button"` + `aria-describedby`) compose this factory
205
+ * and keep only their own a11y presentation. The factory is a11y-agnostic - it
206
+ * returns the plain derived signals each header maps to its own DOM/ARIA surface.
207
+ *
208
+ * @param sort Getter for the owning `CngxSort` engine (`() => sortRef`, `() => grid.sort`).
209
+ * @param field Getter for the column's field key.
210
+ * @returns The derived `{ entry, isActive, isAsc, isDesc, priority, toggle }` bundle.
211
+ *
212
+ * @category common/data/sort
213
+ * @since 0.1.0
214
+ * @relatedTo CngxSort, CngxSortHeader
215
+ */
216
+ declare function createSortHeaderState(sort: () => CngxSort, field: () => string): SortHeaderState;
217
+
162
218
  /**
163
219
  * Atom directive that holds one or more named filter predicates.
164
220
  *
@@ -429,14 +485,16 @@ declare class CngxFilterChips<TItem = unknown, TValue = unknown> {
429
485
  /**
430
486
  * Atom directive that tracks pagination state (current page index and page size).
431
487
  *
432
- * Supports both **uncontrolled** (internal state) and **controlled** modes.
488
+ * Supports both **uncontrolled** (internal state) and **controlled** modes. \
433
489
  * In controlled mode the `cngxPageIndex` / `cngxPageSize` inputs take precedence
434
- * over internal state - pair with `pageChange` / `pageSizeChange` to keep them
490
+ * over internal state - pair with \
491
+ * `pageChange` / `pageSizeChange` to keep them
435
492
  * in sync.
436
493
  *
437
494
  * Consumer connects this to a list or table via `range()` - nothing is injected
438
495
  * automatically.
439
496
  *
497
+ * ```
440
498
  * // Headless: read range() from a template ref
441
499
  * <div cngxPaginate #pg="cngxPaginate" [total]="items.length">
442
500
  * @for (item of items.slice(pg.range()[0], pg.range()[1]); track item.id) { ... }
@@ -446,7 +504,7 @@ declare class CngxFilterChips<TItem = unknown, TValue = unknown> {
446
504
  * <mat-paginator
447
505
  * [length]="pg.total()" [pageIndex]="pg.pageIndex()" [pageSize]="pg.pageSize()"
448
506
  * (page)="pg.setPageSize($event.pageSize, false); pg.setPage($event.pageIndex)" />
449
- *
507
+ * ```
450
508
  * @category common/data/paginate
451
509
  * @docsKind primary
452
510
  * @wcag AA
@@ -455,8 +513,6 @@ declare class CngxFilterChips<TItem = unknown, TValue = unknown> {
455
513
  * @relatedTo CngxSort, CngxFilter, CngxSmartDataSource
456
514
  *
457
515
  * <example-url>http://localhost:4200/#/common/data/data-source/datasource-cngxpaginate-manual-pipeline</example-url>
458
- * <example-url>http://localhost:4200/#/common/data/paginate-list/bridge-announce-page-changes</example-url>
459
- * <example-url>http://localhost:4200/#/common/data/paginate-list/instrumentation-bridge-cngxmatpaginator</example-url>
460
516
  * <example-url>http://localhost:4200/#/common/data/paginate-list/paginated-list-cngxpaginate-cngxmatpaginator</example-url>
461
517
  * <example-url>http://localhost:4200/#/common/data/paginate-list/uncontrolled-mode-zero-class-boilerplate</example-url>
462
518
  * <example-url>http://localhost:4200/#/common/data/smart-data-source/smartdatasource-cngxpaginate-hostdirective</example-url>
@@ -548,8 +604,8 @@ declare class CngxPaginate {
548
604
  declare function connectPaginateResetOn(paginate: CngxPaginate, key: () => unknown): void;
549
605
  /**
550
606
  * Resets a `cngxPaginate` host to the first page whenever the bound key
551
- * changes - the composable form of {@link connectPaginateResetOn}. Drop it on
552
- * the same element as `cngxPaginate` (or a `CngxPaginator` / `CngxMatPaginator`,
607
+ * changes - the composable form of {@link connectPaginateResetOn}. \
608
+ * Drop it on the same element as `cngxPaginate` (or a `CngxPaginator` / `CngxMatPaginator`,
553
609
  * which provide the brain), and bind the sort / filter / search value a result
554
610
  * set depends on, so a narrowed result never strands the user on a now-empty
555
611
  * page.
@@ -560,9 +616,11 @@ declare function connectPaginateResetOn(paginate: CngxPaginate, key: () => unkno
560
616
  * ```html
561
617
  * <table cngxPaginate [cngxPaginateResetOn]="filter()"><!-- ... --></table>
562
618
  * ```
619
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/reset-on-filter</example-url>
563
620
  *
564
621
  * @category common/data/paginate
565
622
  * @docsKind primary
623
+ * @wcag AA
566
624
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/paginate/paginate-reset.directive.ts
567
625
  * @since 0.1.0
568
626
  * @relatedTo CngxPaginate, CngxPaginator, CngxMatPaginator
@@ -576,6 +634,44 @@ declare class CngxPaginateResetOn {
576
634
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxPaginateResetOn, "[cngxPaginateResetOn]", ["cngxPaginateResetOn"], { "key": { "alias": "cngxPaginateResetOn"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
577
635
  }
578
636
 
637
+ /**
638
+ * Handlers the two-way emit bridge forwards page changes to - typically a
639
+ * host component's `pageIndexChange` / `pageSizeChange` output emitters.
640
+ *
641
+ * @category common/data/paginate
642
+ * @since 0.1.0
643
+ */
644
+ interface CngxPaginateEmitHandlers {
645
+ /** Called once per effective page-index change. */
646
+ readonly onIndex: (index: number) => void;
647
+ /** Called once per effective page-size change. */
648
+ readonly onSize: (size: number) => void;
649
+ }
650
+ /**
651
+ * Wires the {@link CngxPaginate} brain's page / page-size changes onto a host's
652
+ * two-way outputs with exactly-once emit semantics. Two paths feed each handler,
653
+ * sharing a last-emitted guard:
654
+ * - a subscription forwards the brain's nav-only `pageChange` / `pageSizeChange`
655
+ * - the only signal that captures a controlled-mode `setPage`, because the
656
+ * brain's `pageIndex()` stays pinned to the input until the consumer feeds it
657
+ * back;
658
+ * - an `effect()` reads the effective `pageIndex()` / `pageSize()` and covers a
659
+ * `total`-shrink clamp the nav-only output misses.
660
+ *
661
+ * The shared guard makes a value one path already emitted a no-op on the other,
662
+ * so each change emits exactly once. Seeded with the current effective values,
663
+ * so wiring emits no initial change.
664
+ *
665
+ * Shared verbatim by the `CngxPaginator` shell and the `CngxIncrementalList`
666
+ * organism, so the two-way emit behaviour is byte-identical. Call inside an
667
+ * injection context (constructor or field initialiser) - it reads `DestroyRef`
668
+ * and creates effects.
669
+ *
670
+ * @category common/data/paginate
671
+ * @since 0.1.0
672
+ */
673
+ declare function connectPaginateEmit(paginate: CngxPaginate, handlers: CngxPaginateEmitHandlers): void;
674
+
579
675
  /**
580
676
  * Persists a `cngxPaginate` host's page / size in the URL query string, so a
581
677
  * paginated view is deep-linkable and survives reload / back / forward.
@@ -589,7 +685,7 @@ declare class CngxPaginateResetOn {
589
685
  * ```
590
686
  *
591
687
  * Two paginators on one route must take distinct param names via
592
- * `[cngxPaginatePageParam]` / `[cngxPaginateSizeParam]` to avoid a collision.
688
+ * `[cngxPaginatePageParam]` / `[cngxPaginateSizeParam]` to avoid a collision. \
593
689
  * Requires `@angular/router` (`provideRouter`); without it the directive is an
594
690
  * inert no-op (a dev-mode warning is logged). Framework-agnostic of any UI - it
595
691
  * needs only the brain and the router.
@@ -625,6 +721,8 @@ declare class CngxPaginateRouting implements OnInit {
625
721
  * derived empty/active state to reflect.
626
722
  *
627
723
  * @category common/data/paginate
724
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/paginate/bucket-paginate-host.token.ts
725
+ * @since 0.1.0
628
726
  */
629
727
  interface CngxBucketPaginateView {
630
728
  /** Human-readable bucket label, e.g. `'A-C'`. Rendered as the chip text. */
@@ -643,6 +741,8 @@ interface CngxBucketPaginateView {
643
741
  * the active bucket clears it) holds in one place.
644
742
  *
645
743
  * @category common/data/paginate
744
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/paginate/bucket-paginate-host.token.ts
745
+ * @since 0.1.0
646
746
  */
647
747
  interface CngxBucketPaginateHost {
648
748
  /** The buckets to render, in declaration order. One chip per entry. */
@@ -1395,20 +1495,337 @@ declare class CngxMetric {
1395
1495
  * <example-url>http://localhost:4200/#/common/data/trend/trend-directions</example-url>
1396
1496
  */
1397
1497
  declare class CngxTrend {
1498
+ private readonly locale;
1398
1499
  /** Trend percentage. Positive = up, negative = down, zero = flat. */
1399
1500
  readonly value: _angular_core.InputSignal<number>;
1400
1501
  /** Consumer-provided SR label override. When set, replaces the generated default. */
1401
1502
  readonly label: _angular_core.InputSignal<string | undefined>;
1402
1503
  /** @internal */
1403
- readonly icon: _angular_core.Signal<"↑" | "↓" | "→">;
1504
+ protected readonly icon: _angular_core.Signal<string>;
1404
1505
  /** @internal */
1405
- readonly formattedValue: _angular_core.Signal<string>;
1506
+ protected readonly formattedValue: _angular_core.Signal<string>;
1406
1507
  /** @internal */
1407
- readonly resolvedLabel: _angular_core.Signal<string>;
1508
+ protected readonly resolvedLabel: _angular_core.Signal<string>;
1408
1509
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxTrend, never>;
1409
1510
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxTrend, "cngx-trend", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1410
1511
  }
1411
1512
 
1513
+ /**
1514
+ * Pure, framework-agnostic helpers that turn a signed delta value into the
1515
+ * three orthogonal signals a KPI atom renders: **direction** (which way the
1516
+ * arrow points), **sentiment** (whether the change is good or bad, which
1517
+ * drives colour and the SR word), and the formatted magnitude.
1518
+ *
1519
+ * Direction and sentiment are deliberately separate. `CngxTrend` colours by
1520
+ * direction (up = green); `CngxDelta` colours by sentiment, so a value that
1521
+ * dropped can still read as an improvement (churn down, latency down). Both
1522
+ * consume these helpers so the direction / glyph / format logic has a single
1523
+ * source of truth (Pillar 1) with no Angular dependency.
1524
+ */
1525
+ /** Which way the delta moved. `flat` is exactly zero. */
1526
+ type DeltaDirection = 'up' | 'down' | 'flat';
1527
+ /**
1528
+ * How to read the sign of a delta. `neutral` disables sentiment entirely
1529
+ * (direction still renders, colour stays neutral).
1530
+ */
1531
+ type DeltaPolarity = 'higher-is-better' | 'lower-is-better' | 'neutral';
1532
+ /** Good / bad / indifferent, derived from `direction × polarity`. */
1533
+ type DeltaSentiment = 'positive' | 'negative' | 'neutral';
1534
+ /** Percent (default, one fraction digit + `%`) or a locale-formatted absolute number. */
1535
+ type DeltaMode = 'percent' | 'absolute';
1536
+
1537
+ /**
1538
+ * Sentiment-aware delta indicator. Where `CngxTrend` colours strictly by
1539
+ * direction (up = green), `CngxDelta` colours by **sentiment**: a `polarity`
1540
+ * of `lower-is-better` makes a drop read as an improvement (churn, latency,
1541
+ * error rate). The arrow glyph always tracks the raw direction, so colour is
1542
+ * never the only signal - a green value can carry a down arrow, and the SR
1543
+ * label speaks the sentiment word.
1544
+ *
1545
+ * Sentiment, direction, glyph and the formatted magnitude are each a
1546
+ * `computed()` off the single `value`/`polarity` input pair (Pillar 1); the
1547
+ * colour class and the arrow are bound from independent signals so they can
1548
+ * diverge (Pillar 2).
1549
+ *
1550
+ * ### Basic (higher-is-better default)
1551
+ * ```html
1552
+ * <cngx-delta [value]="5.3" />
1553
+ * ```
1554
+ *
1555
+ * ### Lower-is-better (a drop is good)
1556
+ * ```html
1557
+ * <cngx-delta [value]="-2.1" polarity="lower-is-better" />
1558
+ * ```
1559
+ *
1560
+ * ### Absolute magnitude
1561
+ * ```html
1562
+ * <cngx-delta [value]="1240" mode="absolute" [format]="{ maximumFractionDigits: 0 }" />
1563
+ * ```
1564
+ *
1565
+ * @category common/data/metric
1566
+ * @docsKind primary
1567
+ * @wcag AA
1568
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/display/delta/delta.component.ts
1569
+ * @since 0.1.0
1570
+ * @relatedTo CngxTrend, CngxMetric, CngxStat
1571
+ *
1572
+ * <example-url>http://localhost:4200/#/common/data/delta/sentiment-polarity</example-url>
1573
+ */
1574
+ declare class CngxDelta {
1575
+ private readonly locale;
1576
+ /** Signed delta. Positive = up, negative = down, zero = flat. */
1577
+ readonly value: _angular_core.InputSignal<number>;
1578
+ /**
1579
+ * How to read the sign. `higher-is-better` (default) treats a rise as
1580
+ * positive; `lower-is-better` inverts it; `neutral` disables sentiment
1581
+ * (direction still renders, colour stays neutral).
1582
+ */
1583
+ readonly polarity: _angular_core.InputSignal<DeltaPolarity>;
1584
+ /** `percent` (default, one fraction digit + `%`) or `absolute`. */
1585
+ readonly mode: _angular_core.InputSignal<DeltaMode>;
1586
+ /** `Intl.NumberFormatOptions` applied to the magnitude in either mode. */
1587
+ readonly format: _angular_core.InputSignal<Intl.NumberFormatOptions | undefined>;
1588
+ /** Consumer-provided SR label override. Replaces the generated default. */
1589
+ readonly label: _angular_core.InputSignal<string | undefined>;
1590
+ /** @internal Raw movement, independent of polarity. Drives the glyph. */
1591
+ protected readonly direction: _angular_core.Signal<DeltaDirection>;
1592
+ /** @internal Good / bad / indifferent. Drives colour and the SR word. */
1593
+ protected readonly sentiment: _angular_core.Signal<DeltaSentiment>;
1594
+ /** @internal Arrow glyph bound from direction only. */
1595
+ protected readonly glyph: _angular_core.Signal<string>;
1596
+ /** @internal Formatted magnitude. */
1597
+ protected readonly formattedValue: _angular_core.Signal<string>;
1598
+ /** @internal Full SR label: magnitude plus the sentiment word. */
1599
+ protected readonly resolvedLabel: _angular_core.Signal<string>;
1600
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxDelta, never>;
1601
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxDelta, "cngx-delta", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; "polarity": { "alias": "polarity"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1602
+ }
1603
+
1604
+ /** The four coordinated slots of a {@link CngxStat}, in reading order. */
1605
+ type CngxStatSlotKind = 'label' | 'value' | 'delta' | 'caption';
1606
+ /**
1607
+ * Slot-registration contract a `CngxStat` exposes to its projected slot
1608
+ * directives. Each slot registers its generated id on init and withdraws it
1609
+ * on destroy; the molecule derives the combined `aria-labelledby` from the
1610
+ * live registration set. Fronted by a DI token (not the concrete `CngxStat`
1611
+ * class) so the slots stay decompose-safe - the ejected skin talks to the
1612
+ * same token the library defines.
1613
+ */
1614
+ interface CngxStatRegistry {
1615
+ /** Register (or replace) the id contributed by `kind`. */
1616
+ register(kind: CngxStatSlotKind, id: string): void;
1617
+ /** Withdraw the id contributed by `kind`. */
1618
+ unregister(kind: CngxStatSlotKind): void;
1619
+ }
1620
+ /** DI token carrying the {@link CngxStatRegistry} a `CngxStat` provides. */
1621
+ declare const CNGX_STAT: InjectionToken<CngxStatRegistry>;
1622
+
1623
+ /**
1624
+ * Coordination molecule for a KPI stat. Its sole reason to exist is the
1625
+ * screen-reader layer (Pillar 2): hand-assembling a heading, a `<cngx-metric>`
1626
+ * and a `<cngx-delta>` makes a screen reader announce three disconnected
1627
+ * fragments. `CngxStat` projects the label / value / delta / caption slots,
1628
+ * collects the id each slot registers, and derives one `aria-labelledby` that
1629
+ * reads the whole stat as a single accessible name in reading order.
1630
+ *
1631
+ * Composition, never a config bag (Pillar 3): the molecule owns only the id
1632
+ * coordination `computed()` graph; the visuals are whatever atoms the
1633
+ * consumer projects into the slots.
1634
+ *
1635
+ * ```html
1636
+ * <cngx-stat aria-live="polite">
1637
+ * <span cngxStatLabel>Revenue</span>
1638
+ * <cngx-metric cngxStatValue [value]="1.2" unit="M EUR" />
1639
+ * <cngx-delta cngxStatDelta [value]="5.3" />
1640
+ * <span cngxStatCaption>vs. last quarter</span>
1641
+ * </cngx-stat>
1642
+ * ```
1643
+ *
1644
+ * @category common/data/metric
1645
+ * @docsKind primary
1646
+ * @wcag AA
1647
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/display/stat/stat.component.ts
1648
+ * @since 0.1.0
1649
+ * @relatedTo CngxMetric, CngxDelta, CngxTrend
1650
+ *
1651
+ * <example-url>http://localhost:4200/#/common/data/stat/composed-kpi</example-url>
1652
+ */
1653
+ declare class CngxStat implements CngxStatRegistry {
1654
+ private readonly slots;
1655
+ /**
1656
+ * Politeness of the live region. `off` (default) for a static stat;
1657
+ * `polite` / `assertive` for a KPI whose value updates in place.
1658
+ */
1659
+ readonly live: _angular_core.InputSignal<"off" | "polite" | "assertive">;
1660
+ /** {@inheritDoc CngxStatRegistry.register} */
1661
+ register(kind: CngxStatSlotKind, id: string): void;
1662
+ /** {@inheritDoc CngxStatRegistry.unregister} */
1663
+ unregister(kind: CngxStatSlotKind): void;
1664
+ /** @internal Present slot ids in reading order; structurally stable. */
1665
+ protected readonly orderedIds: _angular_core.Signal<string[]>;
1666
+ /** @internal Combined accessible name; `null` when no slot is present. */
1667
+ protected readonly labelledBy: _angular_core.Signal<string | null>;
1668
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxStat, never>;
1669
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxStat, "cngx-stat", never, { "live": { "alias": "live"; "required": false; "isSignal": true; }; }, {}, never, ["[cngxStatLabel]", "[cngxStatValue]", "[cngxStatDelta]", "[cngxStatCaption]"], true, never>;
1670
+ }
1671
+
1672
+ /**
1673
+ * Marks the label element of a {@link CngxStat}. Its generated id leads the
1674
+ * molecule's `aria-labelledby`.
1675
+ *
1676
+ * @category common/data/metric
1677
+ * @since 0.1.0
1678
+ * @relatedTo CngxStat
1679
+ */
1680
+ declare class CngxStatLabel {
1681
+ /** Auto-generated id bound to the host `[id]`; consumed by `CngxStat`. */
1682
+ readonly id: string;
1683
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxStatLabel, never>;
1684
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxStatLabel, "[cngxStatLabel]", never, {}, {}, never, never, true, never>;
1685
+ }
1686
+ /**
1687
+ * Marks the primary value element of a {@link CngxStat} (typically a
1688
+ * `<cngx-metric>`).
1689
+ *
1690
+ * @category common/data/metric
1691
+ * @since 0.1.0
1692
+ * @relatedTo CngxStat
1693
+ */
1694
+ declare class CngxStatValue {
1695
+ /** Auto-generated id bound to the host `[id]`; consumed by `CngxStat`. */
1696
+ readonly id: string;
1697
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxStatValue, never>;
1698
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxStatValue, "[cngxStatValue]", never, {}, {}, never, never, true, never>;
1699
+ }
1700
+ /**
1701
+ * Marks the delta element of a {@link CngxStat} (typically a `<cngx-delta>`
1702
+ * or `<cngx-trend>`).
1703
+ *
1704
+ * @category common/data/metric
1705
+ * @since 0.1.0
1706
+ * @relatedTo CngxStat
1707
+ */
1708
+ declare class CngxStatDelta {
1709
+ /** Auto-generated id bound to the host `[id]`; consumed by `CngxStat`. */
1710
+ readonly id: string;
1711
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxStatDelta, never>;
1712
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxStatDelta, "[cngxStatDelta]", never, {}, {}, never, never, true, never>;
1713
+ }
1714
+ /**
1715
+ * Marks the caption element of a {@link CngxStat} - the trailing context
1716
+ * line (e.g. "vs. last quarter").
1717
+ *
1718
+ * @category common/data/metric
1719
+ * @since 0.1.0
1720
+ * @relatedTo CngxStat
1721
+ */
1722
+ declare class CngxStatCaption {
1723
+ /** Auto-generated id bound to the host `[id]`; consumed by `CngxStat`. */
1724
+ readonly id: string;
1725
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxStatCaption, never>;
1726
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxStatCaption, "[cngxStatCaption]", never, {}, {}, never, never, true, never>;
1727
+ }
1728
+
1729
+ /** Semantic health of a {@link CngxStatus}. */
1730
+ type StatusTone = 'success' | 'warning' | 'danger' | 'info' | 'neutral';
1731
+ /**
1732
+ * Semantic health indicator - a decorative tone dot paired with a visible
1733
+ * label. Distinct from `CngxBadge` (count overlay), `CngxChip` (interactive)
1734
+ * and `CngxTag` (labeled token): its single job is to communicate a status
1735
+ * (operational / degraded / down / info).
1736
+ *
1737
+ * Colour is never the only signal (Pillar 2): the tone drives the dot colour
1738
+ * *and* a tone glyph, so a colour-blind reader still distinguishes the states,
1739
+ * and the visible `label` carries the meaning for assistive tech (the dot is
1740
+ * `aria-hidden`). Set `live` for a status that changes in place.
1741
+ *
1742
+ * ### Basic
1743
+ * ```html
1744
+ * <cngx-status tone="success" label="Operational" />
1745
+ * ```
1746
+ *
1747
+ * ### Live-updating
1748
+ * ```html
1749
+ * <cngx-status tone="danger" label="Outage" live="assertive" />
1750
+ * ```
1751
+ *
1752
+ * @category common/data/metric
1753
+ * @docsKind primary
1754
+ * @wcag AA
1755
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/display/status/status.component.ts
1756
+ * @since 0.1.0
1757
+ * @relatedTo CngxBadge, CngxTag, CngxChip
1758
+ *
1759
+ * <example-url>http://localhost:4200/#/common/data/status/tone-matrix</example-url>
1760
+ */
1761
+ declare class CngxStatus {
1762
+ private readonly elRef;
1763
+ /** Semantic health. Drives both the dot colour and the tone glyph. */
1764
+ readonly tone: _angular_core.InputSignal<StatusTone>;
1765
+ /** Visible status text. Carries the meaning for assistive tech. */
1766
+ readonly label: _angular_core.InputSignal<string | undefined>;
1767
+ /**
1768
+ * Politeness of the live region. `off` (default) for a static status;
1769
+ * `polite` / `assertive` for a status that changes in place.
1770
+ */
1771
+ readonly live: _angular_core.InputSignal<"off" | "polite" | "assertive">;
1772
+ /** @internal Tone glyph bound into the decorative dot. */
1773
+ protected readonly glyph: _angular_core.Signal<string>;
1774
+ constructor();
1775
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxStatus, never>;
1776
+ 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>;
1777
+ }
1778
+
1779
+ /**
1780
+ * Determinate attainment bar - a continuous progress toward a target
1781
+ * (quota reached, budget spent, goal met). Named `CngxGoal` because
1782
+ * `cngx-progress` is the indeterminate async loading bar; this is the
1783
+ * finished-fraction indicator, distinct from that and from the discrete
1784
+ * `CngxSegmentedProgress`.
1785
+ *
1786
+ * Mirrors the `CngxSegmentedProgress` a11y shape: `role="progressbar"` with
1787
+ * the whole `aria-value*` set plus `aria-valuetext` living in the `computed()`
1788
+ * graph (Pillar 2). The value is clamped to `[0, max]`; the fill width is a
1789
+ * derived percent bound as a CSS custom property.
1790
+ *
1791
+ * ```html
1792
+ * <cngx-goal [value]="73" [max]="100" />
1793
+ * <cngx-goal [value]="q()" [max]="target()" [valueTextFormat]="quotaText" />
1794
+ * ```
1795
+ *
1796
+ * @category common/data/metric
1797
+ * @docsKind primary
1798
+ * @wcag AA
1799
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/display/goal/goal.component.ts
1800
+ * @since 0.1.0
1801
+ * @relatedTo CngxSegmentedProgress, CngxMetric
1802
+ *
1803
+ * <example-url>http://localhost:4200/#/common/data/goal/quota-attainment</example-url>
1804
+ */
1805
+ declare class CngxGoal {
1806
+ /** Current attainment. Clamped to `[0, max]`. */
1807
+ readonly value: _angular_core.InputSignal<number>;
1808
+ /** Target the value works toward. Defaults to `100`. */
1809
+ readonly max: _angular_core.InputSignal<number>;
1810
+ /**
1811
+ * Override the `aria-valuetext` string. Receives `(now, max)` - the clamped
1812
+ * value and the target. The default is `(now, max) => \`${now} of ${max}\``.
1813
+ * Supply a localised closure for richer text (e.g.
1814
+ * `(n, m) => \`${n} of ${m}, ${Math.round((n / m) * 100)}% of quota\``).
1815
+ */
1816
+ readonly valueTextFormat: _angular_core.InputSignal<((now: number, max: number) => string) | undefined>;
1817
+ /** `aria-valuemax` - the target, floored at 0. */
1818
+ protected readonly maxValue: Signal<number>;
1819
+ /** `aria-valuenow` - value clamped into `[0, max]`. */
1820
+ protected readonly now: Signal<number>;
1821
+ /** Fill width as a percent of the target; `0` when the target is `0`. */
1822
+ protected readonly fillPercent: Signal<number>;
1823
+ /** `aria-valuetext` - human-readable attainment via the resolved closure. */
1824
+ protected readonly valueText: Signal<string>;
1825
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxGoal, never>;
1826
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxGoal, "cngx-goal", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "valueTextFormat": { "alias": "valueTextFormat"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1827
+ }
1828
+
1412
1829
  /**
1413
1830
  * I18n interface for recycler SR announcements.
1414
1831
  * All methods return the announcement text. No hardcoded strings.
@@ -1468,8 +1885,13 @@ interface RecyclerConfig {
1468
1885
  * not the server-side total. Otherwise the sentinel becomes unreachable.
1469
1886
  */
1470
1887
  totalCount: () => number;
1471
- /** Estimated height per item (px). Number or function per index. */
1472
- estimateSize: number | ((index: number) => number);
1888
+ /**
1889
+ * Estimated height per item (px). A fixed `number`, a `Signal<number>` for a
1890
+ * reactive uniform estimate (e.g. an `input()` bound after construction), or a
1891
+ * `(index) => number` for genuine per-index variable heights. Only the last
1892
+ * form carries per-frame cost; a signal resolves to one uniform value.
1893
+ */
1894
+ estimateSize: number | Signal<number> | ((index: number) => number);
1473
1895
  /** Extra items to render above/below the viewport. Default: 5. */
1474
1896
  overscan?: number;
1475
1897
  /**
@@ -2093,5 +2515,5 @@ interface CngxMaterialBidirectionalSyncHandle {
2093
2515
  */
2094
2516
  declare function createMaterialBidirectionalSync(opts: CngxMaterialBidirectionalSyncOptions): CngxMaterialBidirectionalSyncHandle;
2095
2517
 
2096
- export { CNGX_BUCKET_PAGINATE_HOST, CNGX_COMMIT_CONTROLLER_FACTORY, CNGX_RECYCLER_I18N, CngxAsync, CngxBucketPaginate, CngxDataSource, CngxFilter, CngxFilterChip, CngxFilterChips, CngxMeasure, CngxMetric, CngxPaginate, CngxPaginateResetOn, CngxPaginateRouting, CngxRecyclerAnnouncer, CngxSmartDataSource, CngxSort, CngxSortHeader, CngxTrend, CngxVirtualItem, connectPaginateResetOn, connectRecyclerToActiveDescendant, connectRecyclerToRoving, createAsyncState, createCommitController, createManualState, createMaterialBidirectionalSync, fromHttpResource, fromResource, injectAsyncState, injectDataSource, injectRecycler, injectSmartDataSource, provideRecyclerI18n, resolveAsyncView, tapAsyncProgress, tapAsyncState, tapHttpAsyncState };
2097
- export type { AsyncView, CngxAsyncContext, CngxBucket, CngxBucketPaginateHost, CngxBucketPaginateView, CngxCommitBeginHandlers, CngxCommitController, CngxCommitControllerFactory, CngxCommitHandle, CngxCommitRunner, CngxFilterChipContext, CngxMaterialBidirectionalSyncHandle, CngxMaterialBidirectionalSyncOptions, CngxRecycler, CngxSmartDataSourceOptions, InjectAsyncStateOptions, ManualAsyncState, MutableAsyncState, ReactiveAsyncState, RecyclerConfig, RecyclerI18n, SortEntry };
2518
+ export { CNGX_BUCKET_PAGINATE_HOST, CNGX_COMMIT_CONTROLLER_FACTORY, CNGX_RECYCLER_I18N, CNGX_STAT, CngxAsync, CngxBucketPaginate, CngxDataSource, CngxDelta, CngxFilter, CngxFilterChip, CngxFilterChips, CngxGoal, CngxMeasure, CngxMetric, CngxPaginate, CngxPaginateResetOn, CngxPaginateRouting, CngxRecyclerAnnouncer, CngxSmartDataSource, CngxSort, CngxSortHeader, CngxStat, CngxStatCaption, CngxStatDelta, CngxStatLabel, CngxStatValue, CngxStatus, CngxTrend, CngxVirtualItem, connectPaginateEmit, connectPaginateResetOn, connectRecyclerToActiveDescendant, connectRecyclerToRoving, createAsyncState, createCommitController, createManualState, createMaterialBidirectionalSync, createSortHeaderState, fromHttpResource, fromResource, injectAsyncState, injectDataSource, injectRecycler, injectSmartDataSource, provideRecyclerI18n, resolveAsyncView, tapAsyncProgress, tapAsyncState, tapHttpAsyncState };
2519
+ export type { AsyncView, CngxAsyncContext, 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 };