@cngx/common 0.1.0-rc.1 → 0.1.0-rc.2

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.
@@ -8,7 +8,7 @@ export * from '@cngx/common/popover';
8
8
  import { makeVersion } from '@cngx/utils';
9
9
 
10
10
  /** @internal — replaced at publish time, not part of consumer API. */
11
- const VERSION = makeVersion('0.1.0-rc.1');
11
+ const VERSION = makeVersion('0.1.0-rc.2');
12
12
 
13
13
  /**
14
14
  * Public API Surface of @cngx/common
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cngx/common",
3
- "version": "0.1.0-rc.1",
4
- "description": "Atoms and molecules (a11y, interactive, layout, dialog, popover, display) for the CNGX Angular component library. CDK-only, no Material.",
3
+ "version": "0.1.0-rc.2",
4
+ "description": "Atoms and molecules (a11y, interactive, layout, dialog, popover, display) for the CNGX Angular component library.",
5
5
  "keywords": [
6
6
  "cngx",
7
7
  "angular",
package/stepper/README.md CHANGED
@@ -148,16 +148,3 @@ A step carries an error through two independent channels:
148
148
  - **Commit / async** - a `commitAction` that rejects sets `lastFailedIndex`; the rolled-back step decorates via `*cngxStepRejection` and announces through the `CngxToastOn` / `CngxBannerOn` bridges.
149
149
 
150
150
  The two never collide: validation owns `*cngxStepError`, commit owns `*cngxStepRejection`. The `[error]` input replaces the old `<fieldset cngxErrorAggregator><input cngxErrorSource>` boilerplate for the common "this step is invalid" case; the aggregator stays the power path. See `@cngx/ui/stepper` for the per-skin text-surface table.
151
-
152
- ## Architecture notes
153
-
154
- - **Pillar 1** (`Ableitung statt Verwaltung`): every derived value is a `computed()`; the only writable slot is the active-step model + a registry `WritableSignal<readonly CngxStepRegistration[]>` mutated only by `register`/`unregister`.
155
- - **Pillar 2** (`Kommunikation als First-Class`): host contracts (`CNGX_STEPPER_HOST` / `CNGX_STEP_PANEL_HOST`) expose ARIA-relevant state as `Signal<T>` so organisms can wire reactive `aria-current` / `aria-busy` / `aria-describedby` from day one.
156
- - **Pillar 3** (`Komposition statt Konfiguration`): step content is content-projected (`<cngxStep>` atoms), not configured via an options array. Organisms compose the presenter via `hostDirectives` rather than extending it.
157
- - **Memory hygiene**: every atom registers a `DestroyRef.onDestroy` unregister hook; the router-sync directive uses `takeUntilDestroyed` for its `NavigationEnd` stream.
158
-
159
- ## See also
160
-
161
- - `@cngx/ui/stepper` - `<cngx-stepper>` CNGX-standard organism
162
- - `@cngx/ui/mat-stepper` - `<cngx-mat-stepper>` Material-twin organism
163
- - `.internal/architektur/stepper-accepted-debt.md` - tracked architectural debt (single §1: native `<mat-step>` adoption is structurally impossible via Angular content projection)
@@ -1584,9 +1584,8 @@ declare const CNGX_COMMIT_CONTROLLER_FACTORY: InjectionToken<CngxCommitControlle
1584
1584
  *
1585
1585
  * Material types never enter this surface. The caller maps Material's
1586
1586
  * own event/property shape to a host-agnostic `Signal<number>` /
1587
- * `Observable<number>` / getter / setter at the directive boundary.
1588
- * That keeps `@cngx/common/data` independent of `@angular/material`
1589
- * (Sheriff Level-2 invariant).
1587
+ * `Observable<number>` / getter / setter at the directive boundary. \
1588
+ * That keeps `@cngx/common/data` independent of `@angular/material`.
1590
1589
  *
1591
1590
  * @category common/data/material-bridge
1592
1591
  */
@@ -1629,6 +1628,22 @@ interface CngxMaterialBidirectionalSyncOptions {
1629
1628
  /** DestroyRef used to clean up the effect and the subscription. */
1630
1629
  readonly destroyRef: DestroyRef;
1631
1630
  }
1631
+ /**
1632
+ * Handle returned by {@link createMaterialBidirectionalSync}.
1633
+ *
1634
+ * @category common/data/material-bridge
1635
+ */
1636
+ interface CngxMaterialBidirectionalSyncHandle {
1637
+ /**
1638
+ * Force Material's selected index to the presenter's current index,
1639
+ * routed through the factory's self-echo suppression so it never
1640
+ * re-enters the Material→presenter path. Hosts call this from their
1641
+ * commit lifecycle when a pessimistic commit settles WITHOUT advancing
1642
+ * the presenter (a rejected switch), which leaves Material eager-
1643
+ * advanced on the refused tab. A no-op when already in sync.
1644
+ */
1645
+ readonly reconcile: () => void;
1646
+ }
1632
1647
  /**
1633
1648
  * Single shared bidirectional-sync factory for cngx organisms /
1634
1649
  * directives that bridge a cngx presenter against a Material parent
@@ -1654,39 +1669,37 @@ interface CngxMaterialBidirectionalSyncOptions {
1654
1669
  *
1655
1670
  * Both sides clean up via `destroyRef`.
1656
1671
  *
1657
- * **Pessimistic-commit gate (deliberately absent).** An earlier draft
1658
- * carried a third option `commitState: CngxAsyncState<unknown>` that
1659
- * gated the Material write while `commitState.isPending()`. The plan
1660
- * (`global-material-bridge-and-architecture-hardening-plan` §54)
1661
- * specified this gate "for the pessimistic flow." Implementation
1662
- * showed the gate is redundant: cngx commit handlers already keep
1663
- * `presenter.activeIndex` at the origin during pessimistic-pending,
1664
- * so the equality guard alone suppresses the Material write.
1665
- * Conversely, in optimistic mode the presenter advances IMMEDIATELY
1666
- * (before the commit settles); a `pending`-keyed gate would suppress
1667
- * that legitimate advance and break the optimistic UX. Dropping the
1668
- * gate makes both modes work via the simple presenter→Material
1669
- * mirror — same outcome as the gate version for pessimistic, and the
1670
- * correct outcome for optimistic.
1671
- *
1672
1672
  * **Material-eager-advance reconciliation.** Material's MDC click
1673
- * handler advances `selectedIndex` synchronously *before* the
1674
- * Material→presenter subscription forwards the click to
1675
- * `onMaterialSelection`. When the presenter HOLDS its index
1676
- * (pessimistic mode + bound `commitAction`, or any future contract
1677
- * that refuses a select), the presenter→Material `effect()` does
1678
- * NOT fire — `presenterIndex` did not change — so Material's
1679
- * eager-advance is never reverted, and the visual diverges from the
1680
- * cngx semantic state. Closes `tabs-accepted-debt §6` by force-
1681
- * writing Material back to the presenter's value when the
1682
- * forwarding callback returns and the values still diverge. Idempotent
1683
- * with the regular presenter→Material effect (the read-equality guard
1684
- * at the effect site suppresses a duplicate write when the presenter
1685
- * later changes to the same value).
1673
+ * handler advances `selectedIndex` *before* the Material→presenter
1674
+ * subscription forwards the click. When the presenter HOLDS its index
1675
+ * (pessimistic mode + bound `commitAction`), the subscriber does NOT
1676
+ * write Material back: on a SUCCESSFUL commit the presenter later
1677
+ * advances to the clicked target and Material is already there, so the
1678
+ * mirror effect is a no-op (no flash); on a REJECTED commit the presenter
1679
+ * never moves, leaving Material eager-advanced on the refused tab. The
1680
+ * host detects the rejection through its own commit lifecycle and calls
1681
+ * {@link CngxMaterialBidirectionalSyncHandle.reconcile} to snap Material
1682
+ * back. Writing from inside the subscriber instead is unsafe: Material's
1683
+ * `selectedIndex` read-back lags a programmatic write, so the mirror
1684
+ * effect's equality guard reads a stale value and skips the corrective
1685
+ * write, sticking the visual on the wrong tab.
1686
+ *
1687
+ * **Self-echo suppression (loop-safety).** Every programmatic
1688
+ * `selectedIndex` write makes Material re-emit `selectionChange`. The
1689
+ * factory records each value it writes and drops the matching echo
1690
+ * (`indexOf` + splice, which also prunes earlier writes whose echo
1691
+ * Material coalesced away) before any other processing. This is
1692
+ * load-bearing for an ASYNC commit-action: Material emits the echo a
1693
+ * microtask later, by which point the commit may have advanced
1694
+ * `presenterIndex`, so an equality-only guard (`presenterIndex() ===
1695
+ * idx`) would FAIL to drop the echo — it would re-enter the subscriber
1696
+ * and ping-pong against the in-flight navigation (the demo freezes).
1697
+ * Matching the echo by the value we wrote drops it regardless of where
1698
+ * the presenter has moved.
1686
1699
  *
1687
1700
  * @category common/data/material-bridge
1688
1701
  */
1689
- declare function createMaterialBidirectionalSync(opts: CngxMaterialBidirectionalSyncOptions): void;
1702
+ declare function createMaterialBidirectionalSync(opts: CngxMaterialBidirectionalSyncOptions): CngxMaterialBidirectionalSyncHandle;
1690
1703
 
1691
1704
  export { CNGX_COMMIT_CONTROLLER_FACTORY, CNGX_RECYCLER_I18N, CngxAsync, CngxDataSource, CngxFilter, CngxFilterChip, CngxFilterChips, CngxMeasure, CngxMetric, CngxPaginate, CngxRecyclerAnnouncer, CngxSmartDataSource, CngxSort, CngxSortHeader, CngxTrend, CngxVirtualItem, connectRecyclerToActiveDescendant, connectRecyclerToRoving, createAsyncState, createCommitController, createManualState, createMaterialBidirectionalSync, injectAsyncState, injectDataSource, injectRecycler, injectSmartDataSource, provideRecyclerI18n, resolveAsyncView };
1692
- export type { AsyncView, CngxAsyncContext, CngxCommitBeginHandlers, CngxCommitController, CngxCommitControllerFactory, CngxCommitHandle, CngxCommitRunner, CngxFilterChipContext, CngxMaterialBidirectionalSyncOptions, CngxRecycler, CngxSmartDataSourceOptions, InjectAsyncStateOptions, ManualAsyncState, MutableAsyncState, ReactiveAsyncState, RecyclerConfig, RecyclerI18n, SortEntry };
1705
+ export type { AsyncView, CngxAsyncContext, CngxCommitBeginHandlers, CngxCommitController, CngxCommitControllerFactory, CngxCommitHandle, CngxCommitRunner, CngxFilterChipContext, CngxMaterialBidirectionalSyncHandle, CngxMaterialBidirectionalSyncOptions, CngxRecycler, CngxSmartDataSourceOptions, InjectAsyncStateOptions, ManualAsyncState, MutableAsyncState, ReactiveAsyncState, RecyclerConfig, RecyclerI18n, SortEntry };
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Signal, InjectionToken, TemplateRef, EnvironmentProviders, Provider, DestroyRef } from '@angular/core';
2
+ import { Signal, InjectionToken, TemplateRef, EnvironmentProviders, Provider, DestroyRef, Injector } from '@angular/core';
3
3
  import { CngxAsyncState, StatusTransition } from '@cngx/core/utils';
4
4
  import { Observable } from 'rxjs';
5
5
  import * as i1 from '@cngx/common/interactive';
@@ -89,8 +89,32 @@ interface CngxStepperHost {
89
89
  * @category common/stepper
90
90
  */
91
91
  readonly stepsOnly: Signal<readonly CngxStepNode[]>;
92
+ /**
93
+ * Flat strip projection under the focus-driven group-collapse policy:
94
+ * identical to {@link flatSteps} when `groupCollapse` is `'off'`, and
95
+ * with every non-active root-level group's children dropped (header
96
+ * node alone) under `'expand-active'`. The strip `@for` reads this;
97
+ * `stepsOnly` stays the single counting / announcement source.
98
+ *
99
+ * **Contract:** variant and skin organisms drive the strip off this
100
+ * projection, never re-derive it. Structural-equal via `flatStepsEqual`
101
+ * (each retained node keeps its `flatSteps` `flatIndex`), so a
102
+ * shape-stable re-emit short-circuits the strip render.
103
+ *
104
+ * @category common/stepper
105
+ */
106
+ readonly visibleStripNodes: Signal<readonly CngxStepNode[]>;
92
107
  readonly activeStepIndex: Signal<number>;
93
108
  readonly activeStepId: Signal<string | null>;
109
+ /**
110
+ * Root-level group whose subtree contains the active step, or `null`
111
+ * when the active step is a root-level step (e.g. a trailing
112
+ * `Finish`). The single focus-driven-collapse source: atoms read it
113
+ * via this contract, never the concrete presenter. Drives
114
+ * `CngxStepGroup.isCollapsed`, the strip `aria-expanded` binding, and
115
+ * {@link visibleStripNodes}.
116
+ */
117
+ readonly activeGroupId: Signal<string | null>;
94
118
  /** Step-only count - the length of {@link stepsOnly}. */
95
119
  readonly stepCount: Signal<number>;
96
120
  /** `true` when the active step is the first one (no earlier step). */
@@ -265,6 +289,30 @@ declare class CngxStepperPresenter implements CngxStepperHost {
265
289
  readonly stepsOnly: Signal<readonly CngxStepNode[]>;
266
290
  private readonly clampedIndex;
267
291
  readonly activeStepId: Signal<string | null>;
292
+ /**
293
+ * {@inheritDoc CngxStepperHost.activeGroupId}
294
+ *
295
+ * Single derivation over `activeStepId` and `stepTree` - the root-level
296
+ * group whose subtree holds the active step, or `null` for a
297
+ * root-level active step (e.g. a trailing `Finish`). Walked once here;
298
+ * `CngxStepGroup.isCollapsed`, the strip `aria-expanded` binding, and
299
+ * `visibleStripNodes` read this rather than re-walking the tree.
300
+ */
301
+ readonly activeGroupId: Signal<string | null>;
302
+ /**
303
+ * {@inheritDoc CngxStepperHost.visibleStripNodes}
304
+ *
305
+ * Flat strip projection honouring the focus-driven group-collapse
306
+ * policy. Under `'off'` it returns `flatSteps()` verbatim (same
307
+ * reference, so the `equal` short-circuits). Under `'expand-active'`
308
+ * every non-active root-level group's subtree is dropped, leaving the
309
+ * group header node alone - the active group and all root-level steps
310
+ * stay. Each retained node keeps its canonical `flatIndex` from
311
+ * `flatSteps`, so per-step state/announcement lookups are unaffected.
312
+ * Returns a fresh array, so it MUST carry `{ equal: flatStepsEqual }`
313
+ * or every re-emit cascades the strip `@for`.
314
+ */
315
+ readonly visibleStripNodes: Signal<readonly CngxStepNode[]>;
268
316
  readonly commitState: CngxAsyncState<number | undefined>;
269
317
  /**
270
318
  * Next enabled step-only index after the active one, skipping
@@ -452,7 +500,7 @@ declare function flatStepsEqual(a: readonly CngxStepNode[], b: readonly CngxStep
452
500
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/step-content.directive.ts
453
501
  * @since 0.1.0
454
502
  * @relatedTo CngxStep, CngxStepLabel
455
- * <example-url>http://localhost:4200/#/ui/stepper/stepper-horizontal/three-step-wizard</example-url>
503
+ * <example-url>http://localhost:4200/#/ui/stepper/stepper-step-content/typed-lazy-panels</example-url>
456
504
  */
457
505
  declare class CngxStepContent {
458
506
  readonly templateRef: TemplateRef<CngxStepContentContext>;
@@ -499,7 +547,7 @@ declare class CngxStepLabel {
499
547
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/step.directive.ts
500
548
  * @since 0.1.0
501
549
  * @relatedTo CngxStepGroup, CngxStepperPresenter, CngxStepLabel, CngxStepContent
502
- * <example-url>http://localhost:4200/#/ui/stepper/stepper-horizontal/three-step-wizard</example-url>
550
+ * <example-url>http://localhost:4200/#/ui/stepper/stepper-step-content/typed-lazy-panels</example-url>
503
551
  */
504
552
  declare class CngxStep {
505
553
  readonly id: i0.InputSignal<string>;
@@ -553,14 +601,31 @@ declare class CngxStep {
553
601
  * @since 0.1.0
554
602
  * @relatedTo CngxStep, CngxStepperPresenter, CngxStepGroupHeader
555
603
  * <example-url>http://localhost:4200/#/ui/stepper/stepper-hierarchical/group-nested-steps-trailing-root-step</example-url>
604
+ * <example-url>http://localhost:4200/#/ui/stepper/stepper-hierarchical/expand-active-group-collapse</example-url>
605
+ * <example-url>http://localhost:4200/#/ui/stepper/stepper-hierarchical/group-collapse-summary-count</example-url>
556
606
  */
557
607
  declare class CngxStepGroup implements CngxStepGroupHost {
558
608
  readonly id: i0.InputSignal<string>;
559
609
  readonly disabled: i0.InputSignal<boolean>;
560
610
  readonly label: i0.InputSignal<string>;
611
+ private readonly config;
561
612
  private readonly childRegistry;
562
613
  readonly aggregatedStatus: Signal<CngxStepStatus>;
563
614
  private readonly stepperHost;
615
+ /**
616
+ * `true` when this group's children are collapsed to the header node:
617
+ * the focus-driven policy is `'expand-active'`, this group does not
618
+ * hold the active step, and it has at least one child. Pure
619
+ * `computed()` over the host's `activeGroupId` + the resolved policy -
620
+ * never toggled in an event handler (Pillar 1).
621
+ *
622
+ * Consumer-readable via `exportAs: 'cngxStepGroup'` (e.g.
623
+ * `#g="cngxStepGroup"` then `g.isCollapsed()`). The rendered strip
624
+ * group header owns the reactive `aria-expanded` disclosure attribute
625
+ * (`<cngx-stepper>` `groupAriaExpanded`); the projected `[cngxStepGroup]`
626
+ * host element is not rendered in the strip, so it carries no ARIA.
627
+ */
628
+ readonly isCollapsed: Signal<boolean>;
564
629
  constructor();
565
630
  register(handle: CngxStepRegistration): void;
566
631
  unregister(id: string): void;
@@ -952,7 +1017,6 @@ interface CngxDotStepperDotContext {
952
1017
  * @since 0.1.0
953
1018
  * @relatedTo CngxStepIndicator, CngxStepBadge, CngxStepBusySpinner, CngxStepRejection
954
1019
  * <example-url>http://localhost:4200/#/ui/stepper/dot-stepper/icon-dots-via-code-cngxdotstepperdot-code</example-url>
955
- * <example-url>http://localhost:4200/#/ui/stepper/dot-stepper/mobile-carousel</example-url>
956
1020
  */
957
1021
  declare class CngxDotStepperDot {
958
1022
  readonly templateRef: TemplateRef<CngxDotStepperDotContext>;
@@ -1031,6 +1095,51 @@ type CngxStepperMobileCollapse = 'text' | 'dots' | 'off';
1031
1095
  * @category common/stepper
1032
1096
  */
1033
1097
  type CngxStepperHeaderNavigation = 'none' | 'visited';
1098
+ /**
1099
+ * Focus-driven group-collapse policy for grouped `<cngx-stepper>` flows.
1100
+ * `'expand-active'` collapses every non-active `cngxStepGroup` branch to
1101
+ * its header node and expands only the group holding the active step;
1102
+ * `'off'` (default) keeps every group's children rendered in the strip -
1103
+ * the browser-native baseline. Orthogonal to the `mobileCollapse` axis;
1104
+ * the two never edit each other. The Material twin (`[cngxMatStepper]`)
1105
+ * ignores this setting.
1106
+ *
1107
+ * @category common/stepper
1108
+ */
1109
+ type CngxStepperGroupCollapse = 'expand-active' | 'off';
1110
+ /**
1111
+ * What a collapsed `cngxStepGroup` header shows next to its label under
1112
+ * `groupCollapse: 'expand-active'`. `'progress'` (default) shows
1113
+ * completed/total steps; `'count'` shows the step count; `'status'`
1114
+ * shows a status dot coloured by the group's rolled-up state; `'off'`
1115
+ * shows the bare label. Only ever rendered on a collapsed group header.
1116
+ *
1117
+ * @category common/stepper
1118
+ */
1119
+ type CngxStepperGroupSummary = 'progress' | 'count' | 'status' | 'off';
1120
+ /**
1121
+ * Space-driven density policy for the classic `<cngx-stepper>` strip.
1122
+ * `'auto'` degrades the strip on its own container width
1123
+ * (full labels -> ellipsis-truncated -> indicators-only with the active
1124
+ * label kept); `'comfortable'` (default) keeps full labels at every
1125
+ * width. Orthogonal to `mobileCollapse` and `groupCollapse`; the
1126
+ * Material twin ignores this setting.
1127
+ *
1128
+ * @category common/stepper
1129
+ */
1130
+ type CngxStepperDensity = 'comfortable' | 'auto';
1131
+ /**
1132
+ * Per-step px thresholds the `density: 'auto'` ladder reacts to.
1133
+ * `compact` is the minimum px per step that keeps full labels; below
1134
+ * `minimal` px per step the strip drops to indicators-only. `compact`
1135
+ * must exceed `minimal`.
1136
+ *
1137
+ * @category common/stepper
1138
+ */
1139
+ interface CngxStepperDensityBreakpoints {
1140
+ readonly compact: number;
1141
+ readonly minimal: number;
1142
+ }
1034
1143
  /**
1035
1144
  * Where the mobile auto-collapse indicator (text caption or dot row)
1036
1145
  * sits relative to the active step's panel content under narrow
@@ -1051,6 +1160,15 @@ type CngxStepperMobileIndicatorPosition = 'top' | 'bottom';
1051
1160
  * @category common/stepper
1052
1161
  */
1053
1162
  declare const STEPPER_DEFAULT_MOBILE_BREAKPOINT = "(max-width: 480px)";
1163
+ /**
1164
+ * Default per-step px thresholds for the `density: 'auto'` ladder. The
1165
+ * literal lives on a single exported const so the runtime resolver, the
1166
+ * config default, and any JSDoc cross-references stay in lockstep.
1167
+ * Consumers override via {@link withStepperDensity}'s second argument.
1168
+ *
1169
+ * @category common/stepper
1170
+ */
1171
+ declare const STEPPER_DEFAULT_DENSITY_BREAKPOINTS: CngxStepperDensityBreakpoints;
1054
1172
  /**
1055
1173
  * Stepper config surface. Resolution priority: per-instance Input
1056
1174
  * > `provideStepperConfigAt` (viewProviders) > `provideStepperConfig`
@@ -1072,6 +1190,34 @@ interface CngxStepperConfig {
1072
1190
  * Per-instance `[headerNavigation]` Input still wins.
1073
1191
  */
1074
1192
  readonly headerNavigation?: CngxStepperHeaderNavigation;
1193
+ /**
1194
+ * Focus-driven group-collapse policy. `'expand-active'` collapses
1195
+ * non-active `cngxStepGroup` branches to their header node and expands
1196
+ * only the active group; `'off'` (default) keeps the full strip.
1197
+ * Orthogonal to `mobileCollapse`. Apply app-wide via
1198
+ * {@link withStepperGroupCollapse}.
1199
+ */
1200
+ readonly groupCollapse?: CngxStepperGroupCollapse;
1201
+ /**
1202
+ * What a collapsed `cngxStepGroup` header shows beside its label.
1203
+ * Default `'progress'` (completed/total). Only applies when
1204
+ * `groupCollapse` is `'expand-active'`. Set via
1205
+ * {@link withStepperGroupCollapseSummary}.
1206
+ */
1207
+ readonly groupCollapseSummary?: CngxStepperGroupSummary;
1208
+ /**
1209
+ * Space-driven density policy for the classic strip. `'auto'`
1210
+ * degrades labels on the strip's own container width; `'comfortable'`
1211
+ * (default) keeps full labels. Orthogonal to `mobileCollapse`. Apply
1212
+ * app-wide via {@link withStepperDensity}.
1213
+ */
1214
+ readonly density?: CngxStepperDensity;
1215
+ /**
1216
+ * Per-step px thresholds for the `density: 'auto'` ladder. Default
1217
+ * {@link STEPPER_DEFAULT_DENSITY_BREAKPOINTS}. Override via
1218
+ * {@link withStepperDensity}'s second argument.
1219
+ */
1220
+ readonly densityBreakpoints?: CngxStepperDensityBreakpoints;
1075
1221
  /**
1076
1222
  * Opt-in connector rail between adjacent step indicators on the
1077
1223
  * classic skin. Off by default. The rule is double-scoped on
@@ -1229,6 +1375,39 @@ declare function withStepperMobileSwipe(enabled: boolean): CngxStepperConfigFeat
1229
1375
  * @category common/stepper
1230
1376
  */
1231
1377
  declare function withStepperHeaderNavigation(mode: CngxStepperHeaderNavigation): CngxStepperConfigFeature;
1378
+ /**
1379
+ * Set the app-wide focus-driven group-collapse policy for grouped
1380
+ * `<cngx-stepper>` flows. `'expand-active'` collapses every non-active
1381
+ * `cngxStepGroup` branch to its header node and expands only the group
1382
+ * holding the active step; `'off'` (library default) keeps the full
1383
+ * strip. Orthogonal to the `mobileCollapse` axis. The Material twin
1384
+ * ignores this setting.
1385
+ *
1386
+ * @category common/stepper
1387
+ */
1388
+ declare function withStepperGroupCollapse(mode: CngxStepperGroupCollapse): CngxStepperConfigFeature;
1389
+ /**
1390
+ * Choose what a collapsed `cngxStepGroup` header shows beside its label
1391
+ * under `groupCollapse: 'expand-active'`. `'progress'` (library default)
1392
+ * shows completed/total steps; `'count'` the step count; `'status'` a
1393
+ * status dot coloured by the group's rolled-up state; `'off'` the bare
1394
+ * label. No effect unless `groupCollapse` is `'expand-active'`.
1395
+ *
1396
+ * @category common/stepper
1397
+ */
1398
+ declare function withStepperGroupCollapseSummary(mode: CngxStepperGroupSummary): CngxStepperConfigFeature;
1399
+ /**
1400
+ * Set the app-wide space-driven density policy for the classic
1401
+ * `<cngx-stepper>` strip. `'auto'` degrades labels on the strip's own
1402
+ * container width (full -> compact -> minimal); `'comfortable'`
1403
+ * (library default) keeps full labels at every width. The optional
1404
+ * second argument overrides the per-step px thresholds (default
1405
+ * {@link STEPPER_DEFAULT_DENSITY_BREAKPOINTS}). Orthogonal to the
1406
+ * `mobileCollapse` axis; the Material twin ignores this setting.
1407
+ *
1408
+ * @category common/stepper
1409
+ */
1410
+ declare function withStepperDensity(mode: CngxStepperDensity, breakpoints?: CngxStepperDensityBreakpoints): CngxStepperConfigFeature;
1232
1411
  /**
1233
1412
  * Merge ARIA labels into the cascade. Keys not provided keep their
1234
1413
  * library defaults; per-instance overrides on the stepper still win.
@@ -1625,6 +1804,162 @@ declare function createMobileViewportSignal(mediaQuery: string, destroyRef: Dest
1625
1804
  */
1626
1805
  declare function createStepperDisplayMode(mediaQuery: string, mobileCollapse: () => CngxStepperMobileCollapse | undefined, destroyRef: DestroyRef): Signal<'classic' | 'text' | 'dots'>;
1627
1806
 
1807
+ /**
1808
+ * Resolved density rung for the classic `<cngx-stepper>` strip.
1809
+ * `'full'` shows every label; `'compact'` ellipsis-truncates labels;
1810
+ * `'minimal'` drops to indicators-only (the active step keeps its
1811
+ * label). Orthogonal to the `mobileCollapse` display-mode union.
1812
+ *
1813
+ * @category common/stepper
1814
+ */
1815
+ type CngxStripDensity = 'full' | 'compact' | 'minimal';
1816
+ /**
1817
+ * Options for {@link createStripDensity}.
1818
+ *
1819
+ * @internal
1820
+ */
1821
+ interface CngxStripDensityOptions {
1822
+ /** Strip container element whose width drives the density rung. */
1823
+ readonly element: HTMLElement;
1824
+ /** Current step-only count - the width budget is split across these. */
1825
+ readonly stepCount: () => number;
1826
+ /**
1827
+ * Resolved density policy. Only `'auto'` degrades; `'comfortable'`
1828
+ * (or `undefined`) short-circuits to `'full'`, preserving today's
1829
+ * behaviour.
1830
+ */
1831
+ readonly density: () => 'comfortable' | 'auto' | undefined;
1832
+ /**
1833
+ * Per-step width thresholds in px. At or above `compact` px per step
1834
+ * the strip stays `'full'`; at or above `minimal` it is `'compact'`;
1835
+ * below `minimal` it is `'minimal'`. `compact` must exceed `minimal`.
1836
+ */
1837
+ readonly breakpoints: () => {
1838
+ readonly compact: number;
1839
+ readonly minimal: number;
1840
+ };
1841
+ readonly destroyRef: DestroyRef;
1842
+ }
1843
+ /**
1844
+ * Resolves the classic strip's density rung from its own container
1845
+ * width against the step count and two per-step px thresholds. Pure
1846
+ * `create*` factory, sibling to `createStepperDisplayMode` - it owns a
1847
+ * `ResizeObserver` the way the display-mode factory owns a
1848
+ * `matchMedia` listener, and returns a single derived `Signal`.
1849
+ *
1850
+ * `'comfortable'` density short-circuits to `'full'` (no measurement
1851
+ * dependency). Before the first measurement (`width === 0`) and for an
1852
+ * empty strip the rung is `'full'`, so the strip never flashes
1853
+ * `'minimal'` on mount.
1854
+ *
1855
+ * @category common/stepper
1856
+ */
1857
+ declare function createStripDensity(options: CngxStripDensityOptions): Signal<CngxStripDensity>;
1858
+
1859
+ /**
1860
+ * Collapsed-group summary view consumed by `<cngx-stepper>`. Resolves
1861
+ * the `groupCollapseSummary` mode and the per-group `progress` / `count`
1862
+ * text, the `status`-dot gate, and the SR phrase. Pure derivation over
1863
+ * the group's subtree step states; rendered only on collapsed groups.
1864
+ *
1865
+ * @category common/stepper
1866
+ */
1867
+ interface CngxStepperGroupSummaryView {
1868
+ /** Resolved summary mode (config cascade, default `'progress'`). */
1869
+ readonly mode: Signal<CngxStepperGroupSummary>;
1870
+ /** Visible badge text for `progress`/`count`, else `null`. */
1871
+ text(node: CngxStepNode): string | null;
1872
+ /** `true` when a status dot should render (mode `status`, group collapsed). */
1873
+ showStatus(node: CngxStepNode): boolean;
1874
+ /** Screen-reader phrase for `progress`/`count`, else `null`. */
1875
+ srText(node: CngxStepNode): string | null;
1876
+ }
1877
+ /**
1878
+ * Options for {@link createStepperGroupSummary}.
1879
+ *
1880
+ * @internal
1881
+ */
1882
+ interface CngxStepperGroupSummaryOptions {
1883
+ /** Raw `groupCollapseSummary` config value (may be undefined). */
1884
+ readonly summaryMode: () => CngxStepperGroupSummary | undefined;
1885
+ /** Whether a given group node is currently collapsed. */
1886
+ readonly isCollapsed: (node: CngxStepNode) => boolean;
1887
+ }
1888
+ /**
1889
+ * Builds the collapsed-group summary view. Level-2 helper so the
1890
+ * organism stays a thin renderer. `status` mode defers its SR phrasing
1891
+ * to the group's existing status-phrase span, so {@link srText} returns
1892
+ * `null` there. English defaults (locale via the i18n cascade is a
1893
+ * follow-up).
1894
+ *
1895
+ * @category common/stepper
1896
+ */
1897
+ declare function createStepperGroupSummary(options: CngxStepperGroupSummaryOptions): CngxStepperGroupSummaryView;
1898
+
1899
+ /**
1900
+ * Collapsed-group pointer-navigation view consumed by `<cngx-stepper>`
1901
+ * under `groupCollapse: 'expand-active'`. A folded group header becomes a
1902
+ * click shortcut into its branch: activating it selects the group's first
1903
+ * navigable step, which then becomes the active group and expands as a
1904
+ * consequence (no in-place disclosure). Keyboard users reach the same
1905
+ * steps via the arrow-key contract, which already steps into a collapsed
1906
+ * group, so this is a supplementary pointer affordance.
1907
+ *
1908
+ * @category common/stepper
1909
+ */
1910
+ interface CngxStepperGroupNavigationView {
1911
+ /**
1912
+ * `true` when a collapsed group header offers a click shortcut: header
1913
+ * navigation is on, the group is folded, and at least one descendant
1914
+ * step is navigable right now. The expanded (active) group header is
1915
+ * never navigable - its steps are already on screen and clickable.
1916
+ */
1917
+ isNavigable(node: CngxStepNode): boolean;
1918
+ /**
1919
+ * Selects the group's first navigable step. No-op for an expanded
1920
+ * header, a navigation-off header, or a group with no reachable step.
1921
+ */
1922
+ select(node: CngxStepNode): void;
1923
+ /**
1924
+ * `true` when the group owns the active step (`activeGroupId`). Drives
1925
+ * the active-branch chip treatment on the header, independent of
1926
+ * `groupCollapse`, so the branch in focus reads distinctly even when
1927
+ * every group stays expanded.
1928
+ */
1929
+ isActive(node: CngxStepNode): boolean;
1930
+ }
1931
+ /**
1932
+ * Options for {@link createStepperGroupNavigation}.
1933
+ *
1934
+ * @internal
1935
+ */
1936
+ interface CngxStepperGroupNavigationOptions {
1937
+ /**
1938
+ * Host slice owning the flat projection (`flatSteps`, DFS order with
1939
+ * live `flatIndex`), the reachability predicate (`canNavigateTo`), the
1940
+ * commit-in-flight gate (`busy`), and the selection method (`select`).
1941
+ */
1942
+ readonly presenter: Pick<CngxStepperHost, 'flatSteps' | 'canNavigateTo' | 'busy' | 'select' | 'activeGroupId'>;
1943
+ /** Whether a given group node is currently folded. */
1944
+ readonly isCollapsed: (node: CngxStepNode) => boolean;
1945
+ /** `false` when `headerNavigation: 'none'` keeps every header inert. */
1946
+ readonly navigationEnabled: () => boolean;
1947
+ }
1948
+ /**
1949
+ * Builds the collapsed-group pointer-navigation view. Level-2 helper so
1950
+ * the organism stays a thin renderer.
1951
+ *
1952
+ * Indices resolve against `flatSteps` (DFS order, live `flatIndex`) rather
1953
+ * than `group.children` - the flattener spreads group nodes but leaves
1954
+ * their `children` as the tree projection where every step still carries
1955
+ * the seeded `-1`. Each candidate is gated by `canNavigateTo` + `busy`
1956
+ * (mirroring the step-header reachability), so a linear-blocked leading
1957
+ * step is skipped to the first reachable one.
1958
+ *
1959
+ * @category common/stepper
1960
+ */
1961
+ declare function createStepperGroupNavigation(options: CngxStepperGroupNavigationOptions): CngxStepperGroupNavigationView;
1962
+
1628
1963
  /**
1629
1964
  * Input bundle for {@link createStepperHostAttrs}: the three per-instance
1630
1965
  * inputs (each `Signal<T | undefined>`) and the resolved config (read
@@ -1697,6 +2032,15 @@ interface CngxStepperStripKeyboardNavOptions {
1697
2032
  * labels rather than focusable buttons. Omitted defaults to enabled.
1698
2033
  */
1699
2034
  readonly enabled?: () => boolean;
2035
+ /**
2036
+ * Injector used to defer the post-move focus to `afterNextRender`.
2037
+ * Required when the strip can re-render its node set on navigation
2038
+ * (focus-driven group collapse: crossing a group boundary removes the
2039
+ * old button and adds the target's), so the focus lands after the new
2040
+ * DOM exists. Omitted, focus falls back to a `queueMicrotask` defer -
2041
+ * correct for a static strip where every button is always present.
2042
+ */
2043
+ readonly injector?: Injector;
1700
2044
  }
1701
2045
  /**
1702
2046
  * Builds the WAI-ARIA APG arrow-key handler for a stepper strip. The
@@ -2293,5 +2637,5 @@ declare function provideCngxStepper(...features: readonly CngxStepperFeature[]):
2293
2637
  */
2294
2638
  declare function provideCngxStepperAt(...features: readonly CngxStepperFeature[]): Provider[];
2295
2639
 
2296
- export { CNGX_STEPPER_COMMIT_HANDLER_FACTORY, CNGX_STEPPER_CONFIG, CNGX_STEPPER_GLYPHS, CNGX_STEPPER_HOST, CNGX_STEPPER_I18N, CNGX_STEP_GROUP_HOST, CNGX_STEP_PANEL_HOST, CngxDotStepperDot, CngxStep, CngxStepBadge, CngxStepBusySpinner, CngxStepContent, CngxStepError, CngxStepGroup, CngxStepGroupHeader, CngxStepIndicator, CngxStepLabel, CngxStepRejection, CngxStepperComplete, CngxStepperCount, CngxStepperEmpty, CngxStepperNext, CngxStepperPresenter, CngxStepperPrevious, CngxStepperRouterSync, CngxStepperSwipeNav, STEPPER_DEFAULT_MOBILE_BREAKPOINT, createMobileViewportSignal, createStepperAnnouncementBuilders, createStepperCommitHandler, createStepperDisplayMode, createStepperHostAttrs, createStepperHostProxy, createStepperSlotContextBuilders, createStepperStateView, createStepperStripKeyboardNav, createStepperTemplateBindings, flatStepsEqual, injectStepperConfig, injectStepperI18n, provideCngxStepper, provideCngxStepperAt, provideStepperConfig, provideStepperConfigAt, provideStepperI18n, resolveStepperErrorSummary, resolveStepperStatusLabel, withDotStepperDotTemplate, withStepBadgeTemplate, withStepBusySpinnerTemplate, withStepErrorTemplate, withStepGroupHeaderTemplate, withStepIndicatorTemplate, withStepRejectionTemplate, withStepperAriaLabels, withStepperCommitMode, withStepperConnectors, withStepperDefaultOrientation, withStepperEmptyTemplate, withStepperFallbackLabels, withStepperHeaderNavigation, withStepperI18nLabels, withStepperLinear, withStepperMobileBreakpoint, withStepperMobileCollapse, withStepperMobileIndicatorPosition, withStepperMobileSwipe, withStepperRouterSync, withStepperSkin };
2297
- export type { CngxDotStepperDotContext, CngxStepBadgeContext, CngxStepBusySpinnerContext, CngxStepContentContext, CngxStepErrorContext, CngxStepGroupHeaderContext, CngxStepGroupHost, CngxStepIndicatorContext, CngxStepLabelContext, CngxStepNode, CngxStepPanelHost, CngxStepRegistration, CngxStepRejectionContext, CngxStepStatus, CngxStepperAnnouncementBuilders, CngxStepperAnnouncementBuildersInputs, CngxStepperAriaLabels, CngxStepperCommitAction, CngxStepperCommitHandler, CngxStepperCommitHandlerFactory, CngxStepperCommitHandlerOptions, CngxStepperConfig, CngxStepperConfigFeature, CngxStepperCountHost, CngxStepperFallbackLabels, CngxStepperFeature, CngxStepperHeaderNavigation, CngxStepperHost, CngxStepperHostAttrs, CngxStepperHostAttrsInputs, CngxStepperI18n, CngxStepperI18nFeature, CngxStepperI18nOverrides, CngxStepperMobileCollapse, CngxStepperMobileIndicatorPosition, CngxStepperSkin, CngxStepperSlotContextBuilders, CngxStepperSlotContextBuildersInputs, CngxStepperStateView, CngxStepperStatusLabels, CngxStepperStripKeyboardNavOptions, CngxStepperTemplateBindings, CngxStepperTemplateBindingsOptions, CngxStepperTemplates };
2640
+ export { CNGX_STEPPER_COMMIT_HANDLER_FACTORY, CNGX_STEPPER_CONFIG, CNGX_STEPPER_GLYPHS, CNGX_STEPPER_HOST, CNGX_STEPPER_I18N, CNGX_STEP_GROUP_HOST, CNGX_STEP_PANEL_HOST, CngxDotStepperDot, CngxStep, CngxStepBadge, CngxStepBusySpinner, CngxStepContent, CngxStepError, CngxStepGroup, CngxStepGroupHeader, CngxStepIndicator, CngxStepLabel, CngxStepRejection, CngxStepperComplete, CngxStepperCount, CngxStepperEmpty, CngxStepperNext, CngxStepperPresenter, CngxStepperPrevious, CngxStepperRouterSync, CngxStepperSwipeNav, STEPPER_DEFAULT_DENSITY_BREAKPOINTS, STEPPER_DEFAULT_MOBILE_BREAKPOINT, createMobileViewportSignal, createStepperAnnouncementBuilders, createStepperCommitHandler, createStepperDisplayMode, createStepperGroupNavigation, createStepperGroupSummary, createStepperHostAttrs, createStepperHostProxy, createStepperSlotContextBuilders, createStepperStateView, createStepperStripKeyboardNav, createStepperTemplateBindings, createStripDensity, flatStepsEqual, injectStepperConfig, injectStepperI18n, provideCngxStepper, provideCngxStepperAt, provideStepperConfig, provideStepperConfigAt, provideStepperI18n, resolveStepperErrorSummary, resolveStepperStatusLabel, withDotStepperDotTemplate, withStepBadgeTemplate, withStepBusySpinnerTemplate, withStepErrorTemplate, withStepGroupHeaderTemplate, withStepIndicatorTemplate, withStepRejectionTemplate, withStepperAriaLabels, withStepperCommitMode, withStepperConnectors, withStepperDefaultOrientation, withStepperDensity, withStepperEmptyTemplate, withStepperFallbackLabels, withStepperGroupCollapse, withStepperGroupCollapseSummary, withStepperHeaderNavigation, withStepperI18nLabels, withStepperLinear, withStepperMobileBreakpoint, withStepperMobileCollapse, withStepperMobileIndicatorPosition, withStepperMobileSwipe, withStepperRouterSync, withStepperSkin };
2641
+ export type { CngxDotStepperDotContext, CngxStepBadgeContext, CngxStepBusySpinnerContext, CngxStepContentContext, CngxStepErrorContext, CngxStepGroupHeaderContext, CngxStepGroupHost, CngxStepIndicatorContext, CngxStepLabelContext, CngxStepNode, CngxStepPanelHost, CngxStepRegistration, CngxStepRejectionContext, CngxStepStatus, CngxStepperAnnouncementBuilders, CngxStepperAnnouncementBuildersInputs, CngxStepperAriaLabels, CngxStepperCommitAction, CngxStepperCommitHandler, CngxStepperCommitHandlerFactory, CngxStepperCommitHandlerOptions, CngxStepperConfig, CngxStepperConfigFeature, CngxStepperCountHost, CngxStepperDensity, CngxStepperDensityBreakpoints, CngxStepperFallbackLabels, CngxStepperFeature, CngxStepperGroupCollapse, CngxStepperGroupNavigationOptions, CngxStepperGroupNavigationView, CngxStepperGroupSummary, CngxStepperGroupSummaryOptions, CngxStepperGroupSummaryView, CngxStepperHeaderNavigation, CngxStepperHost, CngxStepperHostAttrs, CngxStepperHostAttrsInputs, CngxStepperI18n, CngxStepperI18nFeature, CngxStepperI18nOverrides, CngxStepperMobileCollapse, CngxStepperMobileIndicatorPosition, CngxStepperSkin, CngxStepperSlotContextBuilders, CngxStepperSlotContextBuildersInputs, CngxStepperStateView, CngxStepperStatusLabels, CngxStepperStripKeyboardNavOptions, CngxStepperTemplateBindings, CngxStepperTemplateBindingsOptions, CngxStepperTemplates, CngxStripDensity, CngxStripDensityOptions };