@cngx/ui 0.0.1-rc.0

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 (60) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +550 -0
  3. package/action-button/README.md +98 -0
  4. package/empty-state/README.md +103 -0
  5. package/feedback/README.md +33 -0
  6. package/fesm2022/cngx-ui-action-button.mjs +319 -0
  7. package/fesm2022/cngx-ui-action-button.mjs.map +1 -0
  8. package/fesm2022/cngx-ui-empty-state.mjs +138 -0
  9. package/fesm2022/cngx-ui-empty-state.mjs.map +1 -0
  10. package/fesm2022/cngx-ui-feedback.mjs +2962 -0
  11. package/fesm2022/cngx-ui-feedback.mjs.map +1 -0
  12. package/fesm2022/cngx-ui-layout.mjs +89 -0
  13. package/fesm2022/cngx-ui-layout.mjs.map +1 -0
  14. package/fesm2022/cngx-ui-mat-stepper.mjs +567 -0
  15. package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -0
  16. package/fesm2022/cngx-ui-mat-tabs.mjs +1405 -0
  17. package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -0
  18. package/fesm2022/cngx-ui-material.mjs +79 -0
  19. package/fesm2022/cngx-ui-material.mjs.map +1 -0
  20. package/fesm2022/cngx-ui-overlay.mjs +91 -0
  21. package/fesm2022/cngx-ui-overlay.mjs.map +1 -0
  22. package/fesm2022/cngx-ui-sidenav.mjs +521 -0
  23. package/fesm2022/cngx-ui-sidenav.mjs.map +1 -0
  24. package/fesm2022/cngx-ui-skeleton.mjs +158 -0
  25. package/fesm2022/cngx-ui-skeleton.mjs.map +1 -0
  26. package/fesm2022/cngx-ui-speak.mjs +112 -0
  27. package/fesm2022/cngx-ui-speak.mjs.map +1 -0
  28. package/fesm2022/cngx-ui-stepper.mjs +312 -0
  29. package/fesm2022/cngx-ui-stepper.mjs.map +1 -0
  30. package/fesm2022/cngx-ui-tabs.mjs +507 -0
  31. package/fesm2022/cngx-ui-tabs.mjs.map +1 -0
  32. package/fesm2022/cngx-ui.mjs +45 -0
  33. package/fesm2022/cngx-ui.mjs.map +1 -0
  34. package/layout/README.md +133 -0
  35. package/mat-stepper/README.md +34 -0
  36. package/mat-tabs/README.md +163 -0
  37. package/mat-tabs/styles/mat-tabs.css +233 -0
  38. package/material/README.md +90 -0
  39. package/overlay/README.md +99 -0
  40. package/package.json +98 -0
  41. package/sidenav/README.md +127 -0
  42. package/skeleton/README.md +98 -0
  43. package/speak/README.md +93 -0
  44. package/speak/speak-button-theme.scss +78 -0
  45. package/stepper/README.md +40 -0
  46. package/tabs/README.md +28 -0
  47. package/types/cngx-ui-action-button.d.ts +126 -0
  48. package/types/cngx-ui-empty-state.d.ts +41 -0
  49. package/types/cngx-ui-feedback.d.ts +1174 -0
  50. package/types/cngx-ui-layout.d.ts +56 -0
  51. package/types/cngx-ui-mat-stepper.d.ts +234 -0
  52. package/types/cngx-ui-mat-tabs.d.ts +664 -0
  53. package/types/cngx-ui-material.d.ts +36 -0
  54. package/types/cngx-ui-overlay.d.ts +57 -0
  55. package/types/cngx-ui-sidenav.d.ts +209 -0
  56. package/types/cngx-ui-skeleton.d.ts +97 -0
  57. package/types/cngx-ui-speak.d.ts +31 -0
  58. package/types/cngx-ui-stepper.d.ts +129 -0
  59. package/types/cngx-ui-tabs.d.ts +165 -0
  60. package/types/cngx-ui.d.ts +18 -0
@@ -0,0 +1,664 @@
1
+ import * as _cngx_common_tabs from '@cngx/common/tabs';
2
+ import { CngxTabHandle, CngxTabOverflowDomAdapter } from '@cngx/common/tabs';
3
+ import * as i0 from '@angular/core';
4
+ import { Signal, WritableSignal, InjectionToken, Injector, TemplateRef, EnvironmentProviders, Provider } from '@angular/core';
5
+ import { MatTab } from '@angular/material/tabs';
6
+ import { CngxErrorAggregatorContract } from '@cngx/common/interactive';
7
+ import { MatStepperIconContext } from '@angular/material/stepper';
8
+ import { Subject } from 'rxjs';
9
+
10
+ /**
11
+ * Wiring bundle returned from {@link createMatTabHandle}. The
12
+ * directive owns the writable `errorAggregator` slot so the
13
+ * `[cngxMatTabError]` per-tab directive can pump aggregators into
14
+ * it; `label` and `disabled` track Material's current state via a
15
+ * `toSignal(matTab._stateChanges)` trigger.
16
+ */
17
+ interface CngxMatTabHandleSetup {
18
+ readonly handle: CngxTabHandle;
19
+ /** Convenience mirror of `handle.label`. */
20
+ readonly label: Signal<string | undefined>;
21
+ /** Convenience mirror of `handle.disabled`. */
22
+ readonly disabled: Signal<boolean>;
23
+ readonly errorAggregator: WritableSignal<CngxErrorAggregatorContract | undefined>;
24
+ }
25
+ /**
26
+ * Translates a Material `MatTab` into a cngx {@link CngxTabHandle}
27
+ * plus a writable `errorAggregator` slot the `[cngxMatTabError]`
28
+ * directive binds.
29
+ *
30
+ * - `id` — fresh `idSeed()` value; a label-keyed id would collide
31
+ * when two tabs share a label.
32
+ * - `label` / `disabled` — `computed` signals retriggered by
33
+ * `toSignal(matTab._stateChanges)`. Bridge lifetime is tied to
34
+ * the supplied `injector` (typically a per-tab child
35
+ * `EnvironmentInjector`). `_stateChanges` is a Material-internal
36
+ * surface — see `tabs-accepted-debt §5`.
37
+ * - `errorAggregator` — writable seeded at `undefined`;
38
+ * `[cngxMatTabError]` writes its bound aggregator in and resets
39
+ * on teardown. The handle exposes `.asReadonly()` to preserve the
40
+ * `CngxTabHandle` contract.
41
+ */
42
+ declare function createMatTabHandle(matTab: MatTab, idSeed: () => string, injector: Injector): CngxMatTabHandleSetup;
43
+ /**
44
+ * Factory signature for {@link createMatTabHandle}. The DI token
45
+ * {@link CNGX_MAT_TAB_HANDLE_FACTORY} resolves to a function with
46
+ * this exact shape — overrides match it identically.
47
+ */
48
+ type CngxMatTabHandleFactory = typeof createMatTabHandle;
49
+ /**
50
+ * DI token fronting the per-tab handle factory used by
51
+ * `[cngxMatTabs]`. Default is {@link createMatTabHandle}. Symmetric
52
+ * with `CNGX_MAT_STEP_HANDLE_FACTORY` and
53
+ * `CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY`.
54
+ *
55
+ * The seam separates handle shape (factory body) from id keying
56
+ * (the supplied `idSeed` closure). Overrides may call, ignore, or
57
+ * replace `idSeed` — server-synced ids, deterministic test ids,
58
+ * consumer-domain ids — without touching the factory body.
59
+ *
60
+ * Tracked-debt: family-uniformity staging, single in-package
61
+ * consumer today. See `tabs-accepted-debt §10`.
62
+ *
63
+ * ```ts
64
+ * providers: [
65
+ * {
66
+ * provide: CNGX_MAT_TAB_HANDLE_FACTORY,
67
+ * useValue: ((tab, idSeed, injector) => {
68
+ * const setup = createMatTabHandle(tab, idSeed, injector);
69
+ * reportTabRegistered(setup.handle.id);
70
+ * return setup;
71
+ * }) satisfies CngxMatTabHandleFactory,
72
+ * },
73
+ * ]
74
+ * ```
75
+ */
76
+ declare const CNGX_MAT_TAB_HANDLE_FACTORY: InjectionToken<typeof createMatTabHandle>;
77
+
78
+ /**
79
+ * Read-mostly contract for the per-tab handle-setup registry.
80
+ * `[cngxMatTabError]` and any future `[cngxMatTab*]` decoration
81
+ * directive injects this with `{ host: true }` to reach the
82
+ * per-handle `errorAggregator` slot — closes the
83
+ * `tabs-accepted-debt §7` concrete-sibling-injection coupling.
84
+ *
85
+ * Return type narrows to `Pick<..., 'errorAggregator'>` so the
86
+ * access path exposes only the per-handle aggregator slot; the
87
+ * rest of the setup stays internal bookkeeping.
88
+ */
89
+ interface CngxMatTabsRegistryHost {
90
+ /**
91
+ * Returns the per-handle `errorAggregator` slot, or `undefined`
92
+ * before the tab is registered. The `contentChildren(MatTab)`
93
+ * query lands during content-init, so a same-microtask injection
94
+ * from an attribute directive can race; consumers recover by
95
+ * tracking `presenter.tabs()` and re-attempting on the next sync
96
+ * tick.
97
+ */
98
+ getHandleSetup(matTab: MatTab): Pick<CngxMatTabHandleSetup, 'errorAggregator'> | undefined;
99
+ }
100
+ /**
101
+ * DI token the {@link CngxMatTabsRegistry} directive provides via
102
+ * `useExisting`. Sibling per-tab directives inject this with
103
+ * `{ host: true }` to reach per-handle slots without walking the
104
+ * concrete registry class.
105
+ */
106
+ declare const CNGX_MAT_TABS_REGISTRY_HOST: InjectionToken<CngxMatTabsRegistryHost>;
107
+ /**
108
+ * Sibling host-directive that owns the per-MatTab handle registry
109
+ * for `[cngxMatTabs]`. Extracted in Phase 7.1 so the parent stays
110
+ * under the level-4 organism LOC guard and per-tab decoration
111
+ * directives reach the registry through a typed token.
112
+ *
113
+ * Owns: `contentChildren(MatTab)` query, the `setupsByTab` map
114
+ * (per-tab cngx setup paired with a child `EnvironmentInjector`
115
+ * scoping the `_stateChanges` bridge), an `effect()` that diffs the
116
+ * MatTab list and (un)registers handles with `CNGX_TAB_GROUP_HOST`,
117
+ * and a `DestroyRef` cleanup that destroys every child injector.
118
+ *
119
+ * Composition: `[cngxMatTabs]` declares this in `hostDirectives`;
120
+ * both share the parent's `CngxTabGroupPresenter` and the same
121
+ * `<mat-tab-group>` content-children scope. Standalone use is
122
+ * exported but staged — see `tabs-accepted-debt §11`.
123
+ */
124
+ declare class CngxMatTabsRegistry implements CngxMatTabsRegistryHost {
125
+ private readonly presenter;
126
+ private readonly destroyRef;
127
+ private readonly envInjector;
128
+ private readonly createHandle;
129
+ private readonly matTabs;
130
+ private readonly setupsByTab;
131
+ constructor();
132
+ getHandleSetup(matTab: MatTab): Pick<CngxMatTabHandleSetup, 'errorAggregator'> | undefined;
133
+ private syncHandles;
134
+ static ɵfac: i0.ɵɵFactoryDeclaration<CngxMatTabsRegistry, never>;
135
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CngxMatTabsRegistry, "[cngxMatTabsRegistry]", ["cngxMatTabsRegistry"], {}, {}, ["matTabs"], never, true, never>;
136
+ }
137
+
138
+ /**
139
+ * Attaches to an existing `<mat-tab-group>` and wires it to a
140
+ * {@link CngxTabGroupPresenter} — consumers get the commit-action
141
+ * lifecycle, `CNGX_STATEFUL` (so `<cngx-toast-on />` and
142
+ * `<cngx-banner-on />` compose as children), and the tab-handle
143
+ * registry from one attribute.
144
+ *
145
+ * Topology inverts `<cngx-mat-stepper>`: Material is the host, cngx
146
+ * is the instrumentation layer. `inject(MatTabGroup, { self: true })`
147
+ * resolves on the consumer's own element — no content projection
148
+ * blocker (`stepper-accepted-debt §1` does not apply here).
149
+ *
150
+ * Rejection (`--error`) and aggregator (`--has-errors`) visuals
151
+ * live in the package-private projector factories under
152
+ * `./decorations/`; this directive supplies their reactive triggers
153
+ * and the delegators consumer templates call.
154
+ */
155
+ declare class CngxMatTabs {
156
+ private readonly matTabGroup;
157
+ private readonly presenter;
158
+ private readonly destroyRef;
159
+ private readonly injector;
160
+ private readonly renderer;
161
+ private readonly hostEl;
162
+ private readonly viewContainerRef;
163
+ private readonly overflowRef;
164
+ private readonly aggregatorContentSlot;
165
+ private readonly aggregatorContentTemplate;
166
+ private readonly rejectionContentSlot;
167
+ private readonly rejectionContentTemplate;
168
+ private readonly i18n;
169
+ private readonly failedHandleId;
170
+ private readonly rejectionState;
171
+ private readonly aggregatedErrorTabs;
172
+ constructor();
173
+ /**
174
+ * Clears `presenter.lastFailedIndex`, dismissing the rejection
175
+ * decoration. Mirrors `CngxTabGroup.clearLastFailed()` so a
176
+ * template ref (`#mt="cngxMatTabs"`) is enough — no host-token
177
+ * injection needed.
178
+ */
179
+ clearLastFailed(): void;
180
+ static ɵfac: i0.ɵɵFactoryDeclaration<CngxMatTabs, never>;
181
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CngxMatTabs, "[cngxMatTabs]", ["cngxMatTabs"], {}, {}, ["aggregatorContentSlot", "rejectionContentSlot"], never, true, [{ directive: typeof _cngx_common_tabs.CngxTabGroupPresenter; inputs: { "activeIndex": "activeIndex"; "orientation": "orientation"; "loop": "loop"; "commitAction": "commitAction"; "commitMode": "commitMode"; }; outputs: { "activeIndexChange": "activeIndexChange"; }; }, { directive: typeof CngxMatTabsRegistry; inputs: {}; outputs: {}; }]>;
182
+ }
183
+
184
+ /**
185
+ * Per-tab error-aggregator binding for `[cngxMatTabs]`. Attach to a
186
+ * `<mat-tab>`; the bound aggregator's `shouldShow()` projects onto
187
+ * the matching Material tab button (badge + descriptor span) via
188
+ * the Renderer2 effect inside {@link CngxMatTabs}.
189
+ *
190
+ * Material owns `<mat-tab>` declarations — `[cngxTab]` cannot host
191
+ * here — so a sibling attribute directive carries the input.
192
+ * Empty-string transform handles the bare-attribute case per
193
+ * `feedback_bridge_input_not_required` (a developer typing
194
+ * `cngxMatTabError` without `[]` brackets must not poison the
195
+ * slot).
196
+ *
197
+ * Locates its target via {@link CNGX_MAT_TABS_REGISTRY_HOST} —
198
+ * the registry provides the token with `useExisting`, so sibling
199
+ * directives reach per-handle slots through a typed contract
200
+ * instead of the concrete class. Tracks `presenter.tabs()` to
201
+ * recover from a same-microtask race where the directive injects
202
+ * before the registry's sync runs. `destroyRef.onDestroy` clears
203
+ * the slot so an `*ngIf`-toggled binding returns to the
204
+ * no-aggregator default.
205
+ */
206
+ declare class CngxMatTabError {
207
+ private readonly matTab;
208
+ private readonly registry;
209
+ private readonly presenter;
210
+ private readonly destroyRef;
211
+ readonly aggregator: i0.InputSignalWithTransform<CngxErrorAggregatorContract | undefined, "" | CngxErrorAggregatorContract | undefined>;
212
+ constructor();
213
+ static ɵfac: i0.ɵɵFactoryDeclaration<CngxMatTabError, never>;
214
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CngxMatTabError, "[cngxMatTabError]", ["cngxMatTabError"], { "aggregator": { "alias": "cngxMatTabError"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
215
+ }
216
+
217
+ /**
218
+ * Context passed to the `*cngxMatTabAggregatorContent` template.
219
+ * Drives the SR-descriptor content rendered inside the
220
+ * `<span class="cngx-sr-only">` decoration that `[cngxMatTabs]`
221
+ * appends to a Material tab button when its bound aggregator wants
222
+ * reveal. The surrounding span (with its `cngx-sr-only` class, its
223
+ * stable id, and the `aria-describedby` wiring on the button)
224
+ * stays library-owned — the slot only customises the descriptor
225
+ * text or markup so consumers can swap the announcement phrasing
226
+ * (counter pills, localised templates, branded prefixes) without
227
+ * fighting the AT contract.
228
+ *
229
+ * `count` mirrors the bound aggregator's `errorCount()` at the
230
+ * moment the decoration was applied; `label` is the human-readable
231
+ * label of the tab (the Material `MatTab.textLabel`);
232
+ * `announcement` is the resolved AT phrase (the same string the
233
+ * imperative `textContent` fallback would write). All three are
234
+ * snapshotted into the decorated entry — re-emissions of the
235
+ * underlying signals re-fire the projector's effect, which
236
+ * re-applies the decoration with the fresh context.
237
+ */
238
+ interface CngxMatTabAggregatorContentContext {
239
+ /** Aggregated error count for this tab (≥ 1 when shown). */
240
+ readonly count: number;
241
+ /** Resolved tab label (Material `textLabel`). */
242
+ readonly label: string;
243
+ /**
244
+ * Resolved AT announcement phrase the imperative fallback path
245
+ * would write verbatim — the bound aggregator's `announcement()`
246
+ * value at the moment the decoration was applied. Use this when
247
+ * the consumer template wants to render the canonical phrase
248
+ * alongside its own decoration (counter pill, branded prefix)
249
+ * without re-injecting the aggregator.
250
+ */
251
+ readonly announcement: string;
252
+ }
253
+ /**
254
+ * Structural slot directive marking the aggregator-descriptor
255
+ * template for `[cngxMatTabs]`. Discovered via `contentChild` on the
256
+ * directive; when bound, the projector renders an embedded view of
257
+ * this template into the SR-only descriptor span instead of writing
258
+ * the aggregator's `announcement()` string verbatim.
259
+ *
260
+ * Pure marker — zero logic. Holds only a typed
261
+ * {@link TemplateRef} reference. Mirrors the family-standard slot
262
+ * pattern (`CngxStepBadge`, `CngxTabErrorBadge`, `CngxTabOverflowItem`).
263
+ *
264
+ * Single-consumer note: tracked as `tabs-accepted-debt §9`
265
+ * (sibling to `stepper-accepted-debt §4` for the mat-stepper
266
+ * twin's similar Material-binding asymmetry). Material owns the
267
+ * tab-button chrome; the cngx descriptor span is the only
268
+ * consumer-visible decoration seam, so this slot directive lands
269
+ * with one consumer (the package-private aggregator-decoration
270
+ * projector). The shape is uniform with the rest of the family
271
+ * pattern; the staging is acknowledged debt.
272
+ *
273
+ * ```html
274
+ * <mat-tab-group cngxMatTabs>
275
+ * <ng-template
276
+ * cngxMatTabAggregatorContent
277
+ * let-count="count"
278
+ * let-label="label"
279
+ * >
280
+ * {{ label }}: {{ count }} validation issue(s)
281
+ * </ng-template>
282
+ * <mat-tab label="Profile" cngxMatTabError="profile">…</mat-tab>
283
+ * </mat-tab-group>
284
+ * ```
285
+ */
286
+ declare class CngxMatTabAggregatorContent {
287
+ readonly templateRef: TemplateRef<CngxMatTabAggregatorContentContext>;
288
+ static ɵfac: i0.ɵɵFactoryDeclaration<CngxMatTabAggregatorContent, never>;
289
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CngxMatTabAggregatorContent, "ng-template[cngxMatTabAggregatorContent]", ["cngxMatTabAggregatorContent"], {}, {}, never, never, true, never>;
290
+ }
291
+
292
+ /**
293
+ * Context passed to the `*cngxMatTabRejectionContent` template. Drives
294
+ * the SR-descriptor content rendered inside the
295
+ * `<span class="cngx-sr-only">` decoration that `[cngxMatTabs]`
296
+ * appends to a Material tab button when its bound `commitAction`
297
+ * rejects a tab change. The surrounding span (with its
298
+ * `cngx-sr-only` class, its stable id, and the `aria-describedby`
299
+ * wiring on the button) stays library-owned — the slot only
300
+ * customises the descriptor text or markup so consumers can swap
301
+ * the rejection phrasing (branded prefixes, retry CTAs, localised
302
+ * templates) without fighting the AT contract.
303
+ *
304
+ * `failedHandleId` is the stable id of the rejected handle (the
305
+ * same id the descriptor span uses as its `${id}-rejected` DOM id);
306
+ * `originLabel` is the label the rollback returned to (when the
307
+ * presenter exposes an `originIndexDuringCommit` and that index
308
+ * resolves to a handle with a non-empty label) — `undefined` when
309
+ * no labelled rollback origin is resolvable; `fallbackText` is the
310
+ * built-in i18n phrase the imperative fallback path would write
311
+ * verbatim (typically `commitRolledBackTo(originLabel)` when the
312
+ * origin is resolvable, `commitFailedRetry` otherwise).
313
+ *
314
+ * **Re-instantiation warning.** The decoration projector destroys
315
+ * the embedded view and creates a fresh one on every `descriptorText`
316
+ * re-emission — typical when the rollback origin label resolves
317
+ * later than the failed-handle id (e.g. `presenter.tabs()` re-emits
318
+ * mid-rejection and the origin label flows in on the second tick).
319
+ * The slot template runs to the end of its lifecycle each time;
320
+ * consumers wiring expensive subtrees (e.g. an embedded chart, a
321
+ * complex form) should treat this as a destroy + remount cycle and
322
+ * lift heavy state into a sibling `*ngTemplateOutlet`-friendly
323
+ * structure outside the slot. Cheap text + simple markup (the
324
+ * intended use) sees no observable difference.
325
+ */
326
+ interface CngxMatTabRejectionContentContext {
327
+ /** Stable id of the rejected `CngxTabHandle`. */
328
+ readonly failedHandleId: string;
329
+ /**
330
+ * Label of the rollback origin (only set when the presenter's
331
+ * `originIndexDuringCommit` resolves to a handle with a non-empty
332
+ * label).
333
+ */
334
+ readonly originLabel: string | undefined;
335
+ /**
336
+ * Library-default i18n phrase the imperative fallback path would
337
+ * write verbatim. Use this if the consumer template wants to
338
+ * render the canonical phrase as a base alongside its own
339
+ * decoration (icon, branded prefix, retry CTA).
340
+ */
341
+ readonly fallbackText: string;
342
+ }
343
+ /**
344
+ * Structural slot directive marking the rejection-descriptor
345
+ * template for `[cngxMatTabs]`. Discovered via `contentChild` on the
346
+ * directive; when bound, the projector renders an embedded view of
347
+ * this template into the SR-only descriptor span instead of writing
348
+ * the resolved fallback string verbatim.
349
+ *
350
+ * Pure marker — zero logic. Holds only a typed
351
+ * {@link TemplateRef} reference. Mirrors the family-standard slot
352
+ * pattern (`CngxMatTabAggregatorContent`, `CngxStepBadge`,
353
+ * `CngxTabErrorBadge`).
354
+ *
355
+ * Cascade resolution (per
356
+ * `architecture-summary.md` slot-cascade rule):
357
+ * 1. Per-instance `*cngxMatTabRejectionContent` template wins
358
+ * via `contentChild(CngxMatTabRejectionContent)`.
359
+ * 2. When Phase 2's `CNGX_MAT_TABS_CONFIG` infrastructure
360
+ * lands on main, the config-tier
361
+ * `CNGX_MAT_TABS_CONFIG.templates.rejection` slot fills the
362
+ * middle tier (planned follow-up — gated by Phase 2 merge;
363
+ * `tabs-accepted-debt §12` binds the staging with
364
+ * Re-Eval Triggers).
365
+ * 3. Library default — imperative `Renderer2.createElement('span')`
366
+ * with `textContent = fallbackText` (the resolved
367
+ * `commitRolledBackTo(originLabel)` / `commitFailedRetry`
368
+ * phrase from `injectTabsI18n()`).
369
+ *
370
+ * ```html
371
+ * <mat-tab-group cngxMatTabs [commitAction]="save">
372
+ * <ng-template
373
+ * cngxMatTabRejectionContent
374
+ * let-failedHandleId="failedHandleId"
375
+ * let-originLabel="originLabel"
376
+ * let-fallbackText="fallbackText"
377
+ * >
378
+ * <span class="brand-icon" aria-hidden="true"></span>
379
+ * {{ fallbackText }}
380
+ * @if (originLabel) {
381
+ * <button (click)="retry(failedHandleId)">Retry</button>
382
+ * }
383
+ * </ng-template>
384
+ * <mat-tab label="Profile">…</mat-tab>
385
+ * </mat-tab-group>
386
+ * ```
387
+ */
388
+ declare class CngxMatTabRejectionContent {
389
+ readonly templateRef: TemplateRef<CngxMatTabRejectionContentContext>;
390
+ static ɵfac: i0.ɵɵFactoryDeclaration<CngxMatTabRejectionContent, never>;
391
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CngxMatTabRejectionContent, "ng-template[cngxMatTabRejectionContent]", ["cngxMatTabRejectionContent"], {}, {}, never, never, true, never>;
392
+ }
393
+
394
+ /**
395
+ * Sink callback invoked by `[cngxMatTabs]`'s aggregator-decoration
396
+ * projector when a consumer wires exactly one of
397
+ * `*cngxMatTabAggregatorContent` (the slot template) or
398
+ * `ViewContainerRef` (the embedded-view host) — the half-wired-slot
399
+ * misconfiguration. The projector silently falls back to the
400
+ * imperative `textContent` path when this happens; the sink is the
401
+ * only deliberate signal that the consumer's slot template will not
402
+ * render.
403
+ *
404
+ * Override via `provideMatTabsConfig(withHalfWiredSlotSink(fn))` to
405
+ * wire production telemetry (Sentry breadcrumbs, custom logger, CI
406
+ * fail-fast). The library default is a dev-mode `console.warn`; the
407
+ * exported {@link CNGX_DEFAULT_HALF_WIRED_SLOT_SINK} value lets test
408
+ * doubles compose against a stable reference.
409
+ */
410
+ type CngxMatTabHalfWiredSlotSink = (missing: 'contentTemplate' | 'viewContainerRef') => void;
411
+
412
+ /**
413
+ * Behaviour knobs for `[cngxMatTabs]`. Single canonical surface
414
+ * symmetric to `provideSelectConfig` in the select family — every
415
+ * tunable is a `with*` feature on the same aggregator instead of
416
+ * a standalone DI token, so consumers configure the directive
417
+ * through one entry point and the API surface stays small.
418
+ *
419
+ * Per-instance Inputs win over `provideMatTabsConfigAt(...)`
420
+ * (component scope), which wins over `provideMatTabsConfig(...)`
421
+ * (root), which wins over the library defaults captured by
422
+ * {@link CNGX_MAT_TABS_CONFIG_DEFAULTS}.
423
+ */
424
+ interface CngxMatTabsConfig {
425
+ /**
426
+ * Cap on the `[cngxMatTabs]` overflow-anchor retry loop. The
427
+ * directive runs `createDomAnchorRetry` on every `afterNextRender`
428
+ * until `.mat-mdc-tab-header` materialises in the host subtree;
429
+ * the cap exists so a never-rendered host (e.g. `<mat-tab-group>`
430
+ * gated behind a never-true `*ngIf` / `@defer`) does not re-arm
431
+ * forever.
432
+ *
433
+ * Default: `5` — well above normal Material render lag (a single
434
+ * `afterNextRender` is enough on every supported version), low
435
+ * enough to surface a dev-mode `console.warn` promptly when the
436
+ * consumer DOM never appears.
437
+ *
438
+ * Note: `<cngx-tab-overflow>`'s own attach loop uses `60` rAF
439
+ * frames, not `5` — different scheduler, different budget. The
440
+ * two caps are intentionally independent because the underlying
441
+ * timing primitives differ; a shared "anchor max attempts" knob
442
+ * would conflate one frame of `afterNextRender` with one rAF
443
+ * frame, which they are not. The asymmetry is documented in
444
+ * `tabs-accepted-debt §11`; consumers needing cngx-native rAF
445
+ * tuning should re-evaluate that entry.
446
+ */
447
+ readonly anchorMaxAttempts?: number;
448
+ /**
449
+ * Diagnostic sink invoked when a consumer wires exactly one of
450
+ * `*cngxMatTabAggregatorContent` or its `ViewContainerRef`.
451
+ * Default is a dev-mode `console.warn`; override via
452
+ * {@link withHalfWiredSlotSink} to wire production telemetry
453
+ * (Sentry breadcrumbs, custom logger, CI fail-fast).
454
+ */
455
+ readonly halfWiredSlotSink?: CngxMatTabHalfWiredSlotSink;
456
+ }
457
+ /**
458
+ * DI token holding a partial {@link CngxMatTabsConfig}. Set via
459
+ * {@link provideMatTabsConfig} (app-wide) or
460
+ * {@link provideMatTabsConfigAt} (component scope). Read via
461
+ * {@link injectMatTabsConfig}, which merges with the library
462
+ * defaults so callers never see `undefined`.
463
+ */
464
+ declare const CNGX_MAT_TABS_CONFIG: InjectionToken<CngxMatTabsConfig>;
465
+ /**
466
+ * Feature object returned by `with*` mat-tabs functions and consumed
467
+ * by {@link provideMatTabsConfig} / {@link provideMatTabsConfigAt}.
468
+ * The optional `_target` discriminator is reserved for a future
469
+ * cross-family aggregator (`provideCngxMatTabs`) that dispatches
470
+ * features to the right provider — analogous to `_target: 'select'`
471
+ * in the select family.
472
+ */
473
+ interface CngxMatTabsConfigFeature {
474
+ readonly config: Partial<CngxMatTabsConfig>;
475
+ /** @internal */
476
+ readonly _target?: 'mat-tabs';
477
+ }
478
+ /**
479
+ * Cap on the `[cngxMatTabs]` overflow-anchor retry loop.
480
+ * See {@link CngxMatTabsConfig.anchorMaxAttempts} for default + rationale.
481
+ */
482
+ declare function withAnchorRetryAttempts(n: number): CngxMatTabsConfigFeature;
483
+ /**
484
+ * Override the half-wired-slot diagnostic sink.
485
+ * See {@link CngxMatTabsConfig.halfWiredSlotSink}.
486
+ */
487
+ declare function withHalfWiredSlotSink(sink: CngxMatTabHalfWiredSlotSink): CngxMatTabsConfigFeature;
488
+ /**
489
+ * App-wide `[cngxMatTabs]` configuration. Returns
490
+ * `EnvironmentProviders` for use inside `bootstrapApplication`'s
491
+ * `providers` array.
492
+ *
493
+ * ```ts
494
+ * bootstrapApplication(App, {
495
+ * providers: [
496
+ * provideMatTabsConfig(
497
+ * withAnchorRetryAttempts(10),
498
+ * withHalfWiredSlotSink((missing) => Sentry.captureMessage(`half-wired ${missing}`)),
499
+ * ),
500
+ * ],
501
+ * });
502
+ * ```
503
+ */
504
+ declare function provideMatTabsConfig(...features: CngxMatTabsConfigFeature[]): EnvironmentProviders;
505
+ /**
506
+ * Component-scope `[cngxMatTabs]` configuration. Returns a
507
+ * `Provider[]` so the result can be spread into a component's
508
+ * `providers` or `viewProviders` (which cannot accept opaque
509
+ * environment providers).
510
+ *
511
+ * ```ts
512
+ * @Component({
513
+ * selector: 'app-tabs-page',
514
+ * viewProviders: [
515
+ * ...provideMatTabsConfigAt(withAnchorRetryAttempts(20)),
516
+ * ],
517
+ * ...
518
+ * })
519
+ * ```
520
+ */
521
+ declare function provideMatTabsConfigAt(...features: CngxMatTabsConfigFeature[]): Provider[];
522
+ /**
523
+ * Resolve the effective `[cngxMatTabs]` configuration for the current
524
+ * injector. Always returns a fully populated, non-`undefined` object
525
+ * so call sites do not need null-coalescing.
526
+ *
527
+ * Resolution order per key:
528
+ * 1. `CNGX_MAT_TABS_CONFIG` value (set via
529
+ * {@link provideMatTabsConfig} / {@link provideMatTabsConfigAt}).
530
+ * 2. {@link CNGX_MAT_TABS_CONFIG_DEFAULTS} (library default).
531
+ */
532
+ declare function injectMatTabsConfig(): Required<CngxMatTabsConfig>;
533
+
534
+ /**
535
+ * Centralised type façade and selector constants for every Angular
536
+ * Material internal surface cngx Material-bridge code couples to.
537
+ * Replaces the per-call-site `as unknown as { _foo? }` casts and
538
+ * the scattered `'.mat-mdc-tab*'` string literals with a single
539
+ * grep target.
540
+ *
541
+ * Every leading-underscore field cngx reaches into and every
542
+ * Material-internal CSS selector cngx queries against has its
543
+ * declaration here. A Material-version upgrade audit only needs to
544
+ * grep this file plus the matching tracked-debt entries — that grep
545
+ * value is the consumer-facing benefit, so this namespace is part
546
+ * of the published surface of `@cngx/ui/mat-tabs` (re-exported from
547
+ * the package barrel) rather than a private implementation detail.
548
+ *
549
+ * Tracked-debt cross-links:
550
+ * - tabs-accepted-debt §5 — `MatTab._stateChanges` plus the three
551
+ * `.mat-mdc-tab*` selectors used by `[cngxMatTabs]` and the
552
+ * Material-twin overflow adapter. The closing paragraph of §5
553
+ * explicitly names this namespace as the family-shared
554
+ * upgrade-watch surface.
555
+ * - stepper-accepted-debt §4 — `MatStepper._iconOverrides` reach
556
+ * from `<cngx-mat-stepper>`.
557
+ * - stepper-accepted-debt §1, handle.ts JSDoc — `CdkStep._completedOverride`
558
+ * read from `createMatStepHandle`'s `state` computed.
559
+ *
560
+ * The grouping uses a TypeScript `namespace` so a single
561
+ * `MaterialPrivateSurfaces.<member>` access path covers both the
562
+ * type façades and the selector constants. The TS namespace also
563
+ * lets cross-package consumers (`@cngx/ui/mat-stepper`) read the
564
+ * grouped name through ESLint's `@typescript-eslint` type resolver
565
+ * — a flat `export * as` re-export from `public-api.ts` does not
566
+ * resolve nested members through the path-alias.
567
+ */
568
+
569
+ declare namespace MaterialPrivateSurfaces {
570
+ /**
571
+ * Subset of Material's `MatTab` carrying the `_stateChanges`
572
+ * Subject. The leading underscore signals
573
+ * Material-internal-by-convention, even though the field is
574
+ * `readonly` on the public class surface. The Subject emits
575
+ * `void` whenever a `MatTab` input (`textLabel`, `disabled`, …)
576
+ * changes; cngx bridges it into the Signal graph via
577
+ * `toSignal(matTab._stateChanges)` because Material exposes no
578
+ * public reactive surface for input changes.
579
+ */
580
+ interface StateChangeSource {
581
+ readonly _stateChanges: Subject<void>;
582
+ }
583
+ /**
584
+ * Subset of Material's `MatStepper` carrying the `_iconOverrides`
585
+ * map. `<cngx-mat-stepper>` patches this map inside
586
+ * `afterNextRender` to forward consumer-projected
587
+ * `<ng-template matStepperIcon>` declarations through the wrapper
588
+ * into Material's per-header indicator bindings (the only
589
+ * deterministic forwarding path — `<ng-content>` projection
590
+ * inside `<mat-stepper>` does not reach
591
+ * `@ContentChildren(MatStepperIcon)` due to content-init
592
+ * lifecycle ordering).
593
+ */
594
+ interface IconOverrideHost {
595
+ _iconOverrides?: Record<string, TemplateRef<MatStepperIconContext>>;
596
+ }
597
+ /**
598
+ * Subset of CDK's `CdkStep` carrying the `_completedOverride`
599
+ * `WritableSignal`. `MatStep.completed`'s getter reads this
600
+ * signal, so cngx's per-step `state` computed transitively tracks
601
+ * it through the getter and re-fires whenever Material flips
602
+ * completion. Documented limitation: `hasError` writes that are
603
+ * not paired with a `completed` change do not retrigger the
604
+ * computed — sharper note lives on `createMatStepHandle`'s JSDoc.
605
+ */
606
+ interface CompletedOverrideSource {
607
+ readonly _completedOverride: WritableSignal<boolean | null>;
608
+ }
609
+ /**
610
+ * `.mat-mdc-tab` — the class Material applies to the rendered
611
+ * tab `<button>` elements inside `MatTabHeader`. cngx
612
+ * index-correlates `presenter.tabs()` registration order against
613
+ * `host.querySelectorAll('.mat-mdc-tab')` because `MatTab` is a
614
+ * portal — the rendered buttons live inside `MatTabHeader`'s
615
+ * template, not on the `<mat-tab>` declaration site, and Material
616
+ * exposes no public per-tab element accessor.
617
+ */
618
+ const MAT_MDC_TAB_SELECTOR = ".mat-mdc-tab";
619
+ /**
620
+ * `.mat-mdc-tab-header` — the strip element rendered by
621
+ * `MatTabHeader`. `[cngxMatTabs]` walks
622
+ * `host.querySelector('.mat-mdc-tab-header')` to locate the mount
623
+ * anchor for the cngx overflow molecule (so the More button pins
624
+ * inside Material's strip rather than as a sibling of
625
+ * `<mat-tab-group>`).
626
+ */
627
+ const MAT_MDC_TAB_HEADER_SELECTOR = ".mat-mdc-tab-header";
628
+ /**
629
+ * `.mat-mdc-tab-label-container` — Material's IO-friendly scroll
630
+ * viewport ancestor of the rendered tab buttons. The Material-
631
+ * twin overflow adapter walks `host → header → any tab → closest
632
+ * label-container` to attach the molecule's
633
+ * `IntersectionObserver` against the same element Material
634
+ * itself scrolls.
635
+ */
636
+ const MAT_MDC_TAB_LABEL_CONTAINER_SELECTOR = ".mat-mdc-tab-label-container";
637
+ }
638
+
639
+ /**
640
+ * Material variant of {@link CngxTabOverflowDomAdapter}.
641
+ *
642
+ * `resolveStripRoot` walks from host up to `<mat-tab-header>` and
643
+ * locates `.mat-mdc-tab-label-container` via any rendered
644
+ * `.mat-mdc-tab` descendant — Material's IO-friendly scroll
645
+ * container (`tabs-accepted-debt §5`).
646
+ *
647
+ * `resolveTabButton` indexes positionally; Material owns the DOM
648
+ * and cngx handle ids never reach the button elements. Index
649
+ * correlates against `presenter.tabs()` registration order.
650
+ *
651
+ * Wire it via the directive's
652
+ * `CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY` provider:
653
+ *
654
+ * ```ts
655
+ * providers: [
656
+ * { provide: CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY,
657
+ * useValue: createCngxMatTabOverflowDomAdapter }
658
+ * ]
659
+ * ```
660
+ */
661
+ declare function createCngxMatTabOverflowDomAdapter(): CngxTabOverflowDomAdapter;
662
+
663
+ export { CNGX_MAT_TABS_CONFIG, CNGX_MAT_TABS_REGISTRY_HOST, CNGX_MAT_TAB_HANDLE_FACTORY, CngxMatTabAggregatorContent, CngxMatTabError, CngxMatTabRejectionContent, CngxMatTabs, CngxMatTabsRegistry, MaterialPrivateSurfaces, createCngxMatTabOverflowDomAdapter, createMatTabHandle, injectMatTabsConfig, provideMatTabsConfig, provideMatTabsConfigAt, withAnchorRetryAttempts, withHalfWiredSlotSink };
664
+ export type { CngxMatTabAggregatorContentContext, CngxMatTabHalfWiredSlotSink, CngxMatTabHandleFactory, CngxMatTabRejectionContentContext, CngxMatTabsConfig, CngxMatTabsConfigFeature, CngxMatTabsRegistryHost };