@cngx/ui 0.1.0-rc.3 → 0.1.0-rc.5

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/accordion/README.md +86 -0
  2. package/collection/README.md +167 -0
  3. package/data-grid-accordion/README.md +137 -0
  4. package/fesm2022/cngx-ui-accordion.mjs +853 -0
  5. package/fesm2022/cngx-ui-accordion.mjs.map +1 -0
  6. package/fesm2022/cngx-ui-action-button.mjs +2 -2
  7. package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
  8. package/fesm2022/cngx-ui-breadcrumb.mjs +1044 -0
  9. package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -0
  10. package/fesm2022/cngx-ui-collection.mjs +645 -0
  11. package/fesm2022/cngx-ui-collection.mjs.map +1 -0
  12. package/fesm2022/cngx-ui-data-grid-accordion.mjs +1135 -0
  13. package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -0
  14. package/fesm2022/cngx-ui-empty-state.mjs +2 -2
  15. package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
  16. package/fesm2022/cngx-ui-feedback.mjs +10 -10
  17. package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
  18. package/fesm2022/cngx-ui-mat-accordion.mjs +229 -0
  19. package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -0
  20. package/fesm2022/cngx-ui-paginator.mjs +324 -255
  21. package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
  22. package/fesm2022/cngx-ui-sidenav.mjs +547 -65
  23. package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
  24. package/fesm2022/cngx-ui-tabs.mjs +6 -6
  25. package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
  26. package/fesm2022/cngx-ui.mjs +1 -1
  27. package/mat-accordion/README.md +48 -0
  28. package/package.json +21 -1
  29. package/paginator/README.md +9 -6
  30. package/sidenav/README.md +89 -3
  31. package/types/cngx-ui-accordion.d.ts +801 -0
  32. package/types/cngx-ui-breadcrumb.d.ts +890 -0
  33. package/types/cngx-ui-collection.d.ts +396 -0
  34. package/types/cngx-ui-data-grid-accordion.d.ts +912 -0
  35. package/types/cngx-ui-mat-accordion.d.ts +63 -0
  36. package/types/cngx-ui-paginator.d.ts +258 -146
  37. package/types/cngx-ui-sidenav.d.ts +429 -21
@@ -1,5 +1,6 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { ElementRef } from '@angular/core';
2
+ import { ElementRef, InjectionToken, ModelSignal, EnvironmentProviders, Provider } from '@angular/core';
3
+ import * as i1 from '@cngx/common/interactive';
3
4
 
4
5
  /**
5
6
  * Logical position - flips in RTL.
@@ -19,11 +20,18 @@ type SidenavPosition = 'start' | 'end';
19
20
  */
20
21
  type SidenavMode = 'over' | 'push' | 'side' | 'mini';
21
22
  /**
22
- * Declarative sidebar component that composes drawer, focus trap,
23
- * scroll lock, swipe dismiss, and media query atoms internally.
23
+ * Declarative sidebar component for the four drawer modes (`over`,
24
+ * `push`, `side`, `mini`), with responsive mode switching, two-way
25
+ * `[(opened)]` binding, and content projection via header/footer
26
+ * slots.
24
27
  *
25
- * Supports responsive mode switching, two-way `[(opened)]` binding,
26
- * and content projection via header/footer slots.
28
+ * In overlay (`over`) mode it drives a CDK focus trap directly via
29
+ * `FocusTrapFactory` (the same primitive `CngxFocusTrap` wraps): focus
30
+ * moves into the rail on open and is restored to the opener on close.
31
+ * Responsive switching runs off an inline `matchMedia` listener; the
32
+ * shared backdrop and document scroll lock are coordinated by
33
+ * `CngxSidenavLayout`. It does not compose `CngxDrawer` and has no
34
+ * swipe-to-dismiss.
27
35
  *
28
36
  * Use inside `CngxSidenavLayout` for dual-sidebar support and
29
37
  * shared backdrop coordination.
@@ -53,6 +61,14 @@ type SidenavMode = 'over' | 'push' | 'side' | 'mini';
53
61
  * <example-url>http://localhost:4200/#/ui/sidenav/material-theming-light-vs-dark</example-url>
54
62
  */
55
63
  declare class CngxSidenav {
64
+ /**
65
+ * Resolved sidenav configuration cascade. Seeds the dimension, `responsive`,
66
+ * and `shortcut` input defaults below so a per-instance binding still wins
67
+ * (Controlled+Uncontrolled), an app-wide `provideSidenavConfig(...)` moves the
68
+ * default, and an un-configured consumer keeps the byte-identical literals.
69
+ * Declared first so the input field initialisers can read it.
70
+ */
71
+ private readonly cfg;
56
72
  /** Logical position: `'start'` (default left in LTR) or `'end'` (right in LTR). */
57
73
  readonly position: _angular_core.InputSignal<SidenavPosition>;
58
74
  /** Accessible label for the complementary landmark. */
@@ -88,7 +104,29 @@ declare class CngxSidenav {
88
104
  readonly resizing: _angular_core.Signal<boolean>;
89
105
  /** Two-way opened state. Supports `[(opened)]="signal"`. */
90
106
  readonly opened: _angular_core.ModelSignal<boolean>;
91
- /** Whether the mini-mode rail is currently expanded (hover or programmatic). */
107
+ /** Debounced mini expand-on-hover, composed as a hostDirective (its own pointer listeners drive it). */
108
+ private readonly hoverIntent;
109
+ /**
110
+ * Composed source for `expandedState`: the effective mode, the debounced
111
+ * hover-intent signal, and the on/off switch. Carries an explicit `equal` so
112
+ * the object literal never churns identity and re-runs the computation when
113
+ * none of the three fields actually changed.
114
+ */
115
+ private readonly hoverSource;
116
+ /**
117
+ * Whether the mini-mode rail is currently expanded. A pure derivation of
118
+ * `(effectiveMode, hoverIntent.active, expandOnHover)`, not two imperative
119
+ * event-handler writes:
120
+ *
121
+ * - outside `mini` it is always `false`;
122
+ * - with `expandOnHover=true` the debounced hover is the source of truth, so a
123
+ * pointer edge overrides a prior `expand()`/`collapse()` (see `expand()`);
124
+ * - with `expandOnHover=false` hover is ignored and the prior value is kept, so
125
+ * `expand()`/`collapse()` retain full programmatic authority.
126
+ *
127
+ * It stays a writable `linkedSignal` so `expand()`/`collapse()` can `set()` it;
128
+ * the next source change re-derives from the debounced hover.
129
+ */
92
130
  private readonly expandedState;
93
131
  readonly expanded: _angular_core.Signal<boolean>;
94
132
  /** @internal Reference to host element for layout positioning. */
@@ -98,12 +136,32 @@ declare class CngxSidenav {
98
136
  readonly effectiveMode: _angular_core.Signal<SidenavMode>;
99
137
  /** Whether this sidenav is in overlay mode (over). */
100
138
  readonly isOverlay: _angular_core.Signal<boolean>;
139
+ /** Whether the sidenav is currently a modal overlay: overlay mode and open. */
140
+ readonly overlayActive: _angular_core.Signal<boolean>;
101
141
  /** Resolved width - mini mode uses miniWidth unless expanded. */
102
142
  readonly effectiveWidth: _angular_core.Signal<string>;
103
143
  private readonly doc;
104
144
  private readonly win;
105
- /** Tracks the previous effective mode to detect transitions. */
106
- private readonly prevMode;
145
+ /**
146
+ * Current/previous effective-mode pair for transition detection. Mirrors the
147
+ * `createTransitionTracker` shape from `@cngx/core/utils`, inlined because that
148
+ * helper is typed to `AsyncStatus`; `SidenavMode` needs the same `linkedSignal`
149
+ * pattern. Replaces the hand-rolled `prevMode` signal that was `.set()` inside
150
+ * the mode effect.
151
+ */
152
+ private readonly modeTransition;
153
+ /** CDK focus trap over the host; enabled only while a modal overlay is open. */
154
+ private readonly focusTrap;
155
+ /** Element that held focus when the overlay opened, restored to it on close. */
156
+ private restoreTarget;
157
+ /**
158
+ * Set when the mode-transition effect auto-opens an overlay (a viewport-driven
159
+ * `side`/`mini` -> `over` switch). The focus effect reads it to enable the trap
160
+ * without pulling focus into the rail, since that open was not user-initiated.
161
+ */
162
+ private autoOpenInFlight;
163
+ /** Aborts the in-flight resize drag's document listeners (pointerup or teardown). */
164
+ private resizeAbort;
107
165
  constructor();
108
166
  /** Opens the sidenav. */
109
167
  open(): void;
@@ -112,23 +170,31 @@ declare class CngxSidenav {
112
170
  /** Toggles the sidenav. */
113
171
  toggle(): void;
114
172
  /** @internal Close only if in overlay mode (for Escape key, click-outside). */
115
- closeIfOverlay(): void;
116
- /** Expand the mini rail to full width. */
173
+ protected closeIfOverlay(): void;
174
+ /**
175
+ * Expand the mini rail to full width.
176
+ *
177
+ * When `expandOnHover=true` (the default) the debounced hover is the source of
178
+ * truth for `expanded`, so a programmatic `expand()` is transient: the next
179
+ * pointer edge overrides it. For authoritative programmatic control set
180
+ * `expandOnHover=false`, which hands `expand()`/`collapse()` full authority.
181
+ */
117
182
  expand(): void;
118
- /** Collapse the expanded mini rail back to miniWidth. */
183
+ /**
184
+ * Collapse the expanded mini rail back to miniWidth.
185
+ *
186
+ * Same reconciliation as `expand()`: transient while `expandOnHover=true`,
187
+ * authoritative while `expandOnHover=false`.
188
+ */
119
189
  collapse(): void;
120
- /** @internal */
121
- handleMouseEnter(): void;
122
- /** @internal */
123
- handleMouseLeave(): void;
124
190
  /** @internal Parse a CSS px value to a number. */
125
- widthPx: _angular_core.Signal<number>;
126
- minWidthPx: _angular_core.Signal<number>;
127
- maxWidthPx: _angular_core.Signal<number>;
191
+ protected readonly widthPx: _angular_core.Signal<number>;
192
+ protected readonly minWidthPx: _angular_core.Signal<number>;
193
+ protected readonly maxWidthPx: _angular_core.Signal<number>;
128
194
  /** @internal */
129
195
  handleResizeStart(e: PointerEvent): void;
130
196
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSidenav, never>;
131
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxSidenav, "cngx-sidenav", ["cngxSidenav"], { "position": { "alias": "position"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "responsive": { "alias": "responsive"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "miniWidth": { "alias": "miniWidth"; "required": false; "isSignal": true; }; "expandOnHover": { "alias": "expandOnHover"; "required": false; "isSignal": true; }; "resizable": { "alias": "resizable"; "required": false; "isSignal": true; }; "minWidth": { "alias": "minWidth"; "required": false; "isSignal": true; }; "maxWidth": { "alias": "maxWidth"; "required": false; "isSignal": true; }; "shortcut": { "alias": "shortcut"; "required": false; "isSignal": true; }; "opened": { "alias": "opened"; "required": false; "isSignal": true; }; }, { "width": "widthChange"; "opened": "openedChange"; }, never, ["cngx-sidenav-header, [cngxSidenavHeader]", "*", "cngx-sidenav-footer, [cngxSidenavFooter]"], true, never>;
197
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxSidenav, "cngx-sidenav", ["cngxSidenav"], { "position": { "alias": "position"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "responsive": { "alias": "responsive"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "miniWidth": { "alias": "miniWidth"; "required": false; "isSignal": true; }; "expandOnHover": { "alias": "expandOnHover"; "required": false; "isSignal": true; }; "resizable": { "alias": "resizable"; "required": false; "isSignal": true; }; "minWidth": { "alias": "minWidth"; "required": false; "isSignal": true; }; "maxWidth": { "alias": "maxWidth"; "required": false; "isSignal": true; }; "shortcut": { "alias": "shortcut"; "required": false; "isSignal": true; }; "opened": { "alias": "opened"; "required": false; "isSignal": true; }; }, { "width": "widthChange"; "opened": "openedChange"; }, never, ["cngx-sidenav-header, [cngxSidenavHeader]", "*", "cngx-sidenav-footer, [cngxSidenavFooter]"], true, [{ directive: typeof i1.CngxHoverIntent; inputs: { "enterDelay": "expandDelay"; "leaveDelay": "collapseDelay"; }; outputs: {}; }]>;
132
198
  }
133
199
 
134
200
  /**
@@ -177,6 +243,69 @@ declare class CngxSidenavLayout {
177
243
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxSidenavLayout, "cngx-sidenav-layout", ["cngxSidenavLayout"], {}, {}, ["sidenavs"], ["cngx-sidenav[position=start], cngx-sidenav:not([position])", "cngx-sidenav-content", "cngx-sidenav[position=end]"], true, never>;
178
244
  }
179
245
 
246
+ /**
247
+ * Minimal contract a sidenav rail exposes to the router-sync directive: the
248
+ * two-way `opened` signal it reads and writes. Injected via {@link CNGX_SIDENAV}
249
+ * + `useExisting`, never by injecting the concrete `CngxSidenav` class - that
250
+ * would create a cyclic type dependency and block the decompose brain/skin
251
+ * split. The deferred layout-coordination consumer will broaden this contract
252
+ * (with `close()` / `elementRef`) in the branch that migrates
253
+ * `CngxSidenavLayout` onto the token.
254
+ *
255
+ * @category ui/sidenav
256
+ * @since 0.1.0
257
+ */
258
+ interface CngxSidenavContract {
259
+ /** Two-way open state; the directive both reads and writes it. */
260
+ readonly opened: ModelSignal<boolean>;
261
+ }
262
+ /**
263
+ * Contract token for a sidenav rail. `CngxSidenav` provides it via
264
+ * `{ provide: CNGX_SIDENAV, useExisting: CngxSidenav }`, so a collaborator
265
+ * injects the narrow {@link CngxSidenavContract} instead of the concrete class.
266
+ *
267
+ * @category ui/sidenav
268
+ * @since 0.1.0
269
+ * @relatedTo CngxSidenav, CngxSidenavRouterSync
270
+ */
271
+ declare const CNGX_SIDENAV: InjectionToken<CngxSidenavContract>;
272
+
273
+ /**
274
+ * Deep-links a sidenav's open state into a query param. Opt-in via
275
+ * `[cngxSidenavRouterSync]` on a `<cngx-sidenav>`: opening writes `?nav=open`,
276
+ * an initial `?nav=open` hydrates it open, closing removes the param, and
277
+ * browser back/forward re-hydrates it. A thin caller over
278
+ * `injectQueryParamSync` - it reaches the rail through the {@link CNGX_SIDENAV}
279
+ * contract token, never the concrete class.
280
+ *
281
+ * The `param` default cascades: per-instance `[param]` wins, then
282
+ * `withSidenavRouterSync({ param })` on `CNGX_SIDENAV_CONFIG`, then the `'nav'`
283
+ * literal. Without `@angular/router` the kernel dev-warns once and no-ops.
284
+ *
285
+ * @category ui/sidenav
286
+ * @docsKind primary
287
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/sidenav/sidenav-router-sync.directive.ts
288
+ * @since 0.1.0
289
+ * @relatedTo CngxSidenav, CNGX_SIDENAV, injectQueryParamSync
290
+ * <example-url>http://localhost:4200/#/ui/sidenav/router-sync/deep-linkable-overlay</example-url>
291
+ */
292
+ declare class CngxSidenavRouterSync {
293
+ private readonly sidenav;
294
+ private readonly cfg;
295
+ /**
296
+ * Raw `[param]` input. Read the resolved {@link param} computed instead.
297
+ * @internal
298
+ */
299
+ readonly paramInput: _angular_core.InputSignal<string | undefined>;
300
+ /** Resolved query-param key: `[param]` -> config `routerSync.param` -> `'nav'`. */
301
+ readonly param: _angular_core.Signal<string>;
302
+ /** Emits when a `router.navigate` rejection is observed. Parity with the stepper sibling. */
303
+ readonly syncError: _angular_core.OutputEmitterRef<unknown>;
304
+ constructor();
305
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSidenavRouterSync, never>;
306
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxSidenavRouterSync, "[cngxSidenavRouterSync]", ["cngxSidenavRouterSync"], { "paramInput": { "alias": "param"; "required": false; "isSignal": true; }; }, { "syncError": "syncError"; }, never, never, true, never>;
307
+ }
308
+
180
309
  /**
181
310
  * Main content area within a `CngxSidenavLayout`.
182
311
  *
@@ -299,5 +428,284 @@ declare class CngxSidenavFooter {
299
428
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxSidenavFooter, "cngx-sidenav-footer, [cngxSidenavFooter]", never, {}, {}, never, never, true, never>;
300
429
  }
301
430
 
302
- export { CngxSidenav, CngxSidenavContent, CngxSidenavFooter, CngxSidenavHeader, CngxSidenavLayout };
303
- export type { SidenavMode, SidenavPosition };
431
+ /**
432
+ * App-wide cascade for the sidenav family's dimension defaults, the mini
433
+ * expand-on-hover dwell, and the `responsive` / `shortcut` behaviour knobs.
434
+ *
435
+ * Resolution priority (high -> low):
436
+ * 1. Per-instance Input binding (e.g. `[width]="'320px'"`, `[shortcut]="'mod+b'"`).
437
+ * 2. `provideSidenavConfigAt(...)` in a parent component's `viewProviders`
438
+ * (component-scoped override).
439
+ * 3. `provideSidenavConfig(...)` at the application root.
440
+ * 4. Library defaults (merged in via `CNGX_SIDENAV_DEFAULTS`).
441
+ *
442
+ * Every key is optional - partial overrides deep-merge with the library
443
+ * defaults, so consumers declare only the keys they want to override. The
444
+ * `dimensions`, `hover`, and `routerSync` sub-trees are one level deep
445
+ * (spread-merged per key); `responsive` and `shortcut` are flat top-level
446
+ * scalars.
447
+ *
448
+ * The cascaded keys are the dimension inputs, the mini hover dwell, the
449
+ * `responsive` and `shortcut` defaults, and the router-sync `param`.
450
+ * `ariaLabel`, `position`, and `mode` stay per-instance only, since they
451
+ * describe an individual rail rather than an app-wide default.
452
+ *
453
+ * @category ui/sidenav
454
+ * @since 0.1.0
455
+ */
456
+ interface CngxSidenavConfig {
457
+ /**
458
+ * Panel dimensions. Per-instance `[width]` / `[miniWidth]` / `[minWidth]` /
459
+ * `[maxWidth]` bindings still win; this only moves the cascade defaults. A
460
+ * one-level nested sub-tree (spread-merged per key in the config reducer).
461
+ */
462
+ readonly dimensions?: {
463
+ /** Width of the expanded panel. Seeds the two-way `[(width)]` model. */
464
+ readonly width?: string;
465
+ /** Width of the collapsed rail in `mini` mode. */
466
+ readonly miniWidth?: string;
467
+ /** Minimum width constraint during resize. */
468
+ readonly minWidth?: string;
469
+ /** Maximum width constraint during resize. */
470
+ readonly maxWidth?: string;
471
+ };
472
+ /**
473
+ * Mini expand-on-hover dwell, forwarded to the composed `CngxHoverIntent`
474
+ * hostDirective. A one-level nested sub-tree. Wired via
475
+ * `withSidenavHoverDwell(...)`.
476
+ */
477
+ readonly hover?: {
478
+ /** Delay in ms before the mini rail expands on pointer enter. */
479
+ readonly enterDelay?: number;
480
+ /** Delay in ms before the mini rail collapses on pointer leave. */
481
+ readonly leaveDelay?: number;
482
+ };
483
+ /**
484
+ * URL query-param sync defaults for `[cngxSidenavRouterSync]`. A one-level
485
+ * nested sub-tree (spread-merged per key in the config reducer). Wired via
486
+ * `withSidenavRouterSync(...)`; the directive resolves `param` as
487
+ * `[param] ?? routerSync.param ?? 'nav'`, so an un-configured consumer keeps
488
+ * the `'nav'` literal.
489
+ */
490
+ readonly routerSync?: {
491
+ /** Query-param key the sidenav's `opened` state syncs to. Defaults to `'nav'`. */
492
+ readonly param?: string;
493
+ };
494
+ /**
495
+ * Default CSS media-query string for responsive mode switching. Per-instance
496
+ * `[responsive]` still wins. A flat top-level scalar, not a nested sub-tree.
497
+ */
498
+ readonly responsive?: string;
499
+ /**
500
+ * Default keyboard shortcut to toggle the sidenav (e.g. `'mod+b'`).
501
+ * Per-instance `[shortcut]` still wins. A flat top-level scalar.
502
+ */
503
+ readonly shortcut?: string;
504
+ }
505
+
506
+ /**
507
+ * App-wide configuration cascade for the sidenav family. Resolves in priority
508
+ * order:
509
+ *
510
+ * 1. Per-instance Input binding.
511
+ * 2. `provideSidenavConfigAt(...)` in a parent component's `viewProviders`.
512
+ * 3. `provideSidenavConfig(...)` at the application root.
513
+ * 4. Library defaults (this token's `factory`).
514
+ *
515
+ * `providedIn: 'root'` with a default factory means consumers never need to
516
+ * provide the token explicitly - `inject(CNGX_SIDENAV_CONFIG)` always resolves.
517
+ * Consumers who want overrides call `provideSidenavConfig(...)` in
518
+ * `bootstrapApplication` providers (root cascade) or `provideSidenavConfigAt(...)`
519
+ * in a component's `viewProviders` (sub-tree cascade).
520
+ *
521
+ * @category ui/sidenav
522
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/sidenav/config/sidenav.config.defaults.ts
523
+ * @since 0.1.0
524
+ */
525
+ declare const CNGX_SIDENAV_CONFIG: InjectionToken<CngxSidenavConfig>;
526
+
527
+ /**
528
+ * Discriminated-union shape returned by the sidenav config features -
529
+ * `withSidenavDimensions`, `withSidenavResponsive`, `withSidenavShortcut`,
530
+ * `withSidenavHoverDwell`, and `withSidenavRouterSync`. The reducer in
531
+ * `provideSidenavConfig` / `provideSidenavConfigAt` matches on `kind` and merges
532
+ * `payload` into the corresponding config sub-tree: `dimensions`, `hover`, and
533
+ * `routerSync` are one-level nested sub-trees, `responsive` and `shortcut` are
534
+ * flat top-level scalars. Mirrors `CngxBreadcrumbConfigFeature` from
535
+ * `@cngx/ui/breadcrumb` (nested-sub-tree style; the stepper family uses flat
536
+ * scalar keys instead).
537
+ *
538
+ * @category ui/sidenav
539
+ * @since 0.1.0
540
+ */
541
+ type CngxSidenavConfigFeature = {
542
+ readonly kind: 'dimensions';
543
+ readonly payload: NonNullable<CngxSidenavConfig['dimensions']>;
544
+ } | {
545
+ readonly kind: 'hover';
546
+ readonly payload: NonNullable<CngxSidenavConfig['hover']>;
547
+ } | {
548
+ readonly kind: 'routerSync';
549
+ readonly payload: NonNullable<CngxSidenavConfig['routerSync']>;
550
+ } | {
551
+ readonly kind: 'responsive';
552
+ readonly payload: {
553
+ readonly responsive: string;
554
+ };
555
+ } | {
556
+ readonly kind: 'shortcut';
557
+ readonly payload: {
558
+ readonly shortcut: string;
559
+ };
560
+ };
561
+ /**
562
+ * Application-root configuration cascade for the sidenav family. Pass any
563
+ * combination of `withSidenavDimensions`, `withSidenavResponsive`,
564
+ * `withSidenavShortcut`, `withSidenavHoverDwell`, and `withSidenavRouterSync`
565
+ * features in `bootstrapApplication`'s providers array.
566
+ *
567
+ * Resolution priority (high -> low):
568
+ * 1. Per-instance Input binding.
569
+ * 2. `provideSidenavConfigAt(...)` in a parent component's `viewProviders`.
570
+ * 3. `provideSidenavConfig(...)` at the application root.
571
+ * 4. Library defaults (`CNGX_SIDENAV_DEFAULTS`).
572
+ *
573
+ * The provider deep-merges supplied features with the library defaults so
574
+ * consumers only declare keys they want to override.
575
+ *
576
+ * ```ts
577
+ * bootstrapApplication(AppComponent, {
578
+ * providers: [
579
+ * provideSidenavConfig(
580
+ * withSidenavDimensions({ width: '320px' }),
581
+ * withSidenavShortcut('mod+b'),
582
+ * ),
583
+ * ],
584
+ * });
585
+ * ```
586
+ *
587
+ * @category ui/sidenav
588
+ * @since 0.1.0
589
+ */
590
+ declare function provideSidenavConfig(...features: CngxSidenavConfigFeature[]): EnvironmentProviders;
591
+ /**
592
+ * Component-scoped configuration cascade for the sidenav family. Pass any
593
+ * combination of feature factories in a parent component's `viewProviders`
594
+ * array.
595
+ *
596
+ * Unlike `provideSidenavConfig` (root-only), `provideSidenavConfigAt` injects
597
+ * the parent injector's `CNGX_SIDENAV_CONFIG` value (resolves through the
598
+ * priority chain - root provider, library defaults, or another
599
+ * `provideSidenavConfigAt` further up) and deep-merges the supplied features on
600
+ * top. Descendant sidenav instances see the merged config; sibling sub-trees
601
+ * keep the inherited value untouched.
602
+ *
603
+ * ```ts
604
+ * @Component({
605
+ * viewProviders: [
606
+ * provideSidenavConfigAt(withSidenavDimensions({ width: '320px' })),
607
+ * ],
608
+ * template: '<cngx-sidenav>...</cngx-sidenav>',
609
+ * })
610
+ * class Section {}
611
+ * ```
612
+ *
613
+ * @category ui/sidenav
614
+ * @since 0.1.0
615
+ */
616
+ declare function provideSidenavConfigAt(...features: CngxSidenavConfigFeature[]): Provider[];
617
+
618
+ /**
619
+ * Override the sidenav family's panel dimensions - `width`, `miniWidth`,
620
+ * `minWidth`, and `maxWidth`. Per-instance `[width]` / `[miniWidth]` /
621
+ * `[minWidth]` / `[maxWidth]` bindings still win over the cascade; this only
622
+ * moves the defaults. Partial payloads deep-merge, so pass only the keys you
623
+ * want to change.
624
+ *
625
+ * ```ts
626
+ * provideSidenavConfig(withSidenavDimensions({ width: '320px', miniWidth: '64px' }));
627
+ * ```
628
+ *
629
+ * @category ui/sidenav
630
+ * @since 0.1.0
631
+ */
632
+ declare function withSidenavDimensions(payload: NonNullable<CngxSidenavConfig['dimensions']>): CngxSidenavConfigFeature;
633
+ /**
634
+ * Set the app-wide default CSS media-query string for responsive mode
635
+ * switching. When the query matches, the sidenav resolves to `'side'`;
636
+ * otherwise it falls back to its `mode`. Per-instance `[responsive]` still
637
+ * wins.
638
+ *
639
+ * ```ts
640
+ * provideSidenavConfig(withSidenavResponsive('(min-width: 1024px)'));
641
+ * ```
642
+ *
643
+ * @category ui/sidenav
644
+ * @since 0.1.0
645
+ */
646
+ declare function withSidenavResponsive(query: string): CngxSidenavConfigFeature;
647
+ /**
648
+ * Set the app-wide default keyboard shortcut to toggle the sidenav (e.g.
649
+ * `'mod+b'`, which resolves to `ctrl` on Windows/Linux and `meta` on macOS).
650
+ * Per-instance `[shortcut]` still wins.
651
+ *
652
+ * ```ts
653
+ * provideSidenavConfig(withSidenavShortcut('mod+b'));
654
+ * ```
655
+ *
656
+ * @category ui/sidenav
657
+ * @since 0.1.0
658
+ */
659
+ declare function withSidenavShortcut(combo: string): CngxSidenavConfigFeature;
660
+ /**
661
+ * Set the app-wide default mini expand-on-hover dwell - `enterDelay` (ms before
662
+ * the rail expands) and `leaveDelay` (ms before it collapses). Flows into the
663
+ * composed `CngxHoverIntent` via `CNGX_HOVER_INTENT_DEFAULTS`. Per-instance
664
+ * `[enterDelay]` / `[leaveDelay]` still win; the shipped literals (120 / 0)
665
+ * apply when neither is set. Partial payloads deep-merge, so pass only the key
666
+ * you want to change.
667
+ *
668
+ * ```ts
669
+ * provideSidenavConfig(withSidenavHoverDwell({ enterDelay: 200, leaveDelay: 150 }));
670
+ * ```
671
+ *
672
+ * @category ui/sidenav
673
+ * @since 0.1.0
674
+ */
675
+ declare function withSidenavHoverDwell(payload: NonNullable<CngxSidenavConfig['hover']>): CngxSidenavConfigFeature;
676
+ /**
677
+ * Set the app-wide default query-param key for `[cngxSidenavRouterSync]` - the
678
+ * param the sidenav's `opened` state deep-links to. Per-instance `[param]`
679
+ * still wins; the `'nav'` literal applies when neither is set.
680
+ *
681
+ * ```ts
682
+ * provideSidenavConfig(withSidenavRouterSync({ param: 'menu' }));
683
+ * ```
684
+ *
685
+ * @category ui/sidenav
686
+ * @since 0.1.0
687
+ */
688
+ declare function withSidenavRouterSync(payload: NonNullable<CngxSidenavConfig['routerSync']>): CngxSidenavConfigFeature;
689
+
690
+ /**
691
+ * Convenience accessor for the sidenav configuration cascade. Runs in injection
692
+ * context; resolves through the priority chain (per-instance Input ->
693
+ * `provideSidenavConfigAt` -> `provideSidenavConfig` -> library defaults).
694
+ * Equivalent to `inject(CNGX_SIDENAV_CONFIG)` - the helper exists so consumers
695
+ * don't import the token directly. Mirrors `injectBreadcrumbConfig` in
696
+ * `@cngx/ui/breadcrumb`.
697
+ *
698
+ * ```ts
699
+ * export class CngxSidenav {
700
+ * private readonly cfg = injectSidenavConfig();
701
+ * readonly width = model<string>(this.cfg.dimensions?.width ?? '280px');
702
+ * }
703
+ * ```
704
+ *
705
+ * @category ui/sidenav
706
+ * @since 0.1.0
707
+ */
708
+ declare function injectSidenavConfig(): CngxSidenavConfig;
709
+
710
+ export { CNGX_SIDENAV, CNGX_SIDENAV_CONFIG, CngxSidenav, CngxSidenavContent, CngxSidenavFooter, CngxSidenavHeader, CngxSidenavLayout, CngxSidenavRouterSync, injectSidenavConfig, provideSidenavConfig, provideSidenavConfigAt, withSidenavDimensions, withSidenavHoverDwell, withSidenavResponsive, withSidenavRouterSync, withSidenavShortcut };
711
+ export type { CngxSidenavConfig, CngxSidenavConfigFeature, CngxSidenavContract, SidenavMode, SidenavPosition };