@cngx/common 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 (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +18 -0
  3. package/a11y/README.md +77 -0
  4. package/card/README.md +79 -0
  5. package/chart/README.md +31 -0
  6. package/data/README.md +883 -0
  7. package/dialog/README.md +84 -0
  8. package/display/README.md +30 -0
  9. package/fesm2022/cngx-common-a11y.mjs +1260 -0
  10. package/fesm2022/cngx-common-a11y.mjs.map +1 -0
  11. package/fesm2022/cngx-common-card.mjs +765 -0
  12. package/fesm2022/cngx-common-card.mjs.map +1 -0
  13. package/fesm2022/cngx-common-chart.mjs +2943 -0
  14. package/fesm2022/cngx-common-chart.mjs.map +1 -0
  15. package/fesm2022/cngx-common-data.mjs +2886 -0
  16. package/fesm2022/cngx-common-data.mjs.map +1 -0
  17. package/fesm2022/cngx-common-dialog.mjs +1366 -0
  18. package/fesm2022/cngx-common-dialog.mjs.map +1 -0
  19. package/fesm2022/cngx-common-display.mjs +1603 -0
  20. package/fesm2022/cngx-common-display.mjs.map +1 -0
  21. package/fesm2022/cngx-common-interactive.mjs +8185 -0
  22. package/fesm2022/cngx-common-interactive.mjs.map +1 -0
  23. package/fesm2022/cngx-common-layout.mjs +1335 -0
  24. package/fesm2022/cngx-common-layout.mjs.map +1 -0
  25. package/fesm2022/cngx-common-popover.mjs +1200 -0
  26. package/fesm2022/cngx-common-popover.mjs.map +1 -0
  27. package/fesm2022/cngx-common-stepper.mjs +1350 -0
  28. package/fesm2022/cngx-common-stepper.mjs.map +1 -0
  29. package/fesm2022/cngx-common-tabs.mjs +1551 -0
  30. package/fesm2022/cngx-common-tabs.mjs.map +1 -0
  31. package/fesm2022/cngx-common.mjs +34 -0
  32. package/fesm2022/cngx-common.mjs.map +1 -0
  33. package/interactive/README.md +211 -0
  34. package/layout/README.md +117 -0
  35. package/package.json +100 -0
  36. package/popover/README.md +218 -0
  37. package/stepper/README.md +102 -0
  38. package/tabs/README.md +32 -0
  39. package/types/cngx-common-a11y.d.ts +616 -0
  40. package/types/cngx-common-card.d.ts +413 -0
  41. package/types/cngx-common-chart.d.ts +1081 -0
  42. package/types/cngx-common-data.d.ts +1460 -0
  43. package/types/cngx-common-dialog.d.ts +772 -0
  44. package/types/cngx-common-display.d.ts +1136 -0
  45. package/types/cngx-common-interactive.d.ts +5013 -0
  46. package/types/cngx-common-layout.d.ts +737 -0
  47. package/types/cngx-common-popover.d.ts +520 -0
  48. package/types/cngx-common-stepper.d.ts +982 -0
  49. package/types/cngx-common-tabs.d.ts +1237 -0
  50. package/types/cngx-common.d.ts +13 -0
@@ -0,0 +1,737 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { ElementRef, Signal, TemplateRef } from '@angular/core';
3
+ import * as i1 from '@cngx/common/a11y';
4
+
5
+ /**
6
+ * Manages backdrop overlay behavior: visibility, click-to-close, and
7
+ * `inert` toggling on sibling elements.
8
+ *
9
+ * When visible, all sibling elements of the host receive the `inert`
10
+ * attribute, preventing focus and interaction behind the backdrop.
11
+ * This is critical for a11y in modal/drawer overlays.
12
+ *
13
+ * The directive is purely behavioral -- the consumer provides all
14
+ * visual styling (background color, opacity, transitions) via CSS
15
+ * custom properties and the `.cngx-backdrop--visible` class.
16
+ *
17
+ * ### Drawer backdrop
18
+ * ```html
19
+ * <div cngxDrawer #drawer="cngxDrawer">
20
+ * <div [cngxBackdrop]="drawer.opened()" (backdropClick)="drawer.close()"
21
+ * class="my-backdrop"></div>
22
+ * <nav [cngxDrawerPanel]="drawer">…</nav>
23
+ * <main [cngxDrawerContent]="drawer">…</main>
24
+ * </div>
25
+ * ```
26
+ *
27
+ * ### CSS (consumer responsibility)
28
+ * ```css
29
+ * .my-backdrop {
30
+ * position: fixed;
31
+ * inset: 0;
32
+ * background: var(--cngx-backdrop-color, rgba(0, 0, 0, 0.5));
33
+ * opacity: 0;
34
+ * pointer-events: none;
35
+ * transition: opacity 0.25s ease;
36
+ * }
37
+ * .my-backdrop.cngx-backdrop--visible {
38
+ * opacity: 1;
39
+ * pointer-events: auto;
40
+ * }
41
+ * ```
42
+ */
43
+ declare class CngxBackdrop {
44
+ /** Whether the backdrop is visible and siblings are inert. */
45
+ readonly visible: _angular_core.InputSignal<boolean>;
46
+ /** Whether clicking the backdrop emits `backdropClick`. */
47
+ readonly closeOnClick: _angular_core.InputSignal<boolean>;
48
+ /** Emitted when the backdrop is clicked (and `closeOnClick` is true). */
49
+ readonly backdropClick: _angular_core.OutputEmitterRef<void>;
50
+ private readonly el;
51
+ private readonly siblings;
52
+ constructor();
53
+ /** @internal */
54
+ protected handleHostClick(): void;
55
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxBackdrop, never>;
56
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxBackdrop, "[cngxBackdrop]", ["cngxBackdrop"], { "visible": { "alias": "cngxBackdrop"; "required": false; "isSignal": true; }; "closeOnClick": { "alias": "closeOnClick"; "required": false; "isSignal": true; }; }, { "backdropClick": "backdropClick"; }, never, never, true, never>;
57
+ }
58
+
59
+ /** Position from which the drawer panel slides in. */
60
+ type DrawerPosition = 'left' | 'right' | 'top' | 'bottom';
61
+ /**
62
+ * State owner for a drawer / sidebar system.
63
+ *
64
+ * Holds the open/close state and handles the Escape key. Supports both
65
+ * **controlled** (`[cngxDrawerOpened]="signal()"`) and **uncontrolled**
66
+ * (internal state via `open()` / `close()` / `toggle()`) modes.
67
+ *
68
+ * Child directives (`CngxDrawerPanel`, `CngxDrawerContent`) receive a
69
+ * reference to this directive via an explicit input — no ancestor injection.
70
+ *
71
+ * ### Uncontrolled
72
+ * ```html
73
+ * <div cngxDrawer #drawer="cngxDrawer">
74
+ * <button (click)="drawer.toggle()">Menu</button>
75
+ * <nav [cngxDrawerPanel]="drawer" position="left">…</nav>
76
+ * <main [cngxDrawerContent]="drawer">…</main>
77
+ * </div>
78
+ * ```
79
+ *
80
+ * ### Controlled
81
+ * ```html
82
+ * <div cngxDrawer [cngxDrawerOpened]="sidebarOpen()"
83
+ * (openedChange)="sidebarOpen.set($event)">
84
+ * …
85
+ * </div>
86
+ * ```
87
+ */
88
+ declare class CngxDrawer {
89
+ /** @internal Host element ref — used by `CngxDrawerPanel` for click-outside containment. */
90
+ readonly elementRef: ElementRef<any>;
91
+ /** Controlled opened state. When bound, takes precedence over internal state. */
92
+ readonly openedInput: _angular_core.InputSignal<boolean | undefined>;
93
+ private readonly openedState;
94
+ /** Resolved opened state — controlled input wins over internal state. */
95
+ readonly opened: _angular_core.Signal<boolean>;
96
+ /** Emitted when the opened state changes. Wire to a signal for two-way binding. */
97
+ readonly openedChange: _angular_core.OutputEmitterRef<boolean>;
98
+ /** Emitted when the drawer closes. Convenience shorthand for close-only listeners. */
99
+ readonly closed: _angular_core.OutputEmitterRef<void>;
100
+ /** Opens the drawer. */
101
+ open(): void;
102
+ /** Closes the drawer. */
103
+ close(): void;
104
+ /** Toggles the drawer between open and closed. */
105
+ toggle(): void;
106
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxDrawer, never>;
107
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxDrawer, "[cngxDrawer]", ["cngxDrawer"], { "openedInput": { "alias": "cngxDrawerOpened"; "required": false; "isSignal": true; }; }, { "openedChange": "openedChange"; "closed": "closed"; }, never, never, true, never>;
108
+ }
109
+
110
+ /** How the drawer panel interacts with the content area. */
111
+ type DrawerMode = 'over' | 'push' | 'side';
112
+ /**
113
+ * The sliding panel of a drawer. Reads its open state from an explicit
114
+ * `[cngxDrawerPanel]` reference — no ancestor injection.
115
+ *
116
+ * Composes `CngxFocusTrap` as a `hostDirective` — the consumer controls
117
+ * the `[enabled]` and `[autoFocus]` inputs from the template.
118
+ *
119
+ * Optionally closes the drawer when the user clicks outside the panel
120
+ * (`closeOnClickOutside`, default `true`).
121
+ *
122
+ * ```html
123
+ * <nav [cngxDrawerPanel]="drawer" position="left" mode="over"
124
+ * [enabled]="drawer.opened()" [autoFocus]="true">
125
+ * <a href="/home">Home</a>
126
+ * </nav>
127
+ * ```
128
+ */
129
+ declare class CngxDrawerPanel {
130
+ /** Reference to the parent `CngxDrawer` state owner. */
131
+ readonly drawerRef: _angular_core.InputSignal<CngxDrawer>;
132
+ /** Direction the panel slides from. */
133
+ readonly position: _angular_core.InputSignal<DrawerPosition>;
134
+ /**
135
+ * How the panel interacts with the content area:
136
+ * - `'over'` (default) — overlays content (absolute positioned)
137
+ * - `'push'` — pushes content aside (content gets margin)
138
+ * - `'side'` — always visible, no toggle behavior
139
+ */
140
+ readonly mode: _angular_core.InputSignal<DrawerMode>;
141
+ /** Whether clicking outside the panel closes the drawer. */
142
+ readonly closeOnClickOutside: _angular_core.InputSignal<boolean>;
143
+ /** Whether the drawer is currently open (derived from the drawer ref). In `side` mode, always `true`. */
144
+ readonly isOpen: _angular_core.Signal<boolean>;
145
+ constructor();
146
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxDrawerPanel, never>;
147
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxDrawerPanel, "[cngxDrawerPanel]", ["cngxDrawerPanel"], { "drawerRef": { "alias": "cngxDrawerPanel"; "required": true; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "closeOnClickOutside": { "alias": "closeOnClickOutside"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.CngxFocusTrap; inputs: { "enabled": "enabled"; "autoFocus": "autoFocus"; }; outputs: {}; }]>;
148
+ }
149
+
150
+ /**
151
+ * Marks the main content area adjacent to a drawer panel.
152
+ *
153
+ * Adds a CSS class when the drawer is open so the consumer can offset
154
+ * the content via CSS transitions or transforms.
155
+ *
156
+ * ```html
157
+ * <main [cngxDrawerContent]="drawer">
158
+ * Page content
159
+ * </main>
160
+ * ```
161
+ */
162
+ declare class CngxDrawerContent {
163
+ /** Reference to the parent `CngxDrawer` state owner. */
164
+ readonly drawerRef: _angular_core.InputSignal<CngxDrawer>;
165
+ /** Whether the drawer is currently open (derived from the drawer ref). */
166
+ readonly isOpen: _angular_core.Signal<boolean>;
167
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxDrawerContent, never>;
168
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxDrawerContent, "[cngxDrawerContent]", ["cngxDrawerContent"], { "drawerRef": { "alias": "cngxDrawerContent"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
169
+ }
170
+
171
+ /**
172
+ * Observes whether the host element is visible in the viewport or a scroll container.
173
+ *
174
+ * Wraps the browser's `IntersectionObserver` API and exposes its state as
175
+ * Angular signals. The observer is automatically recreated when `root`,
176
+ * `rootMargin`, or `threshold` inputs change, and disconnected on destroy.
177
+ *
178
+ * Use cases: lazy loading images, infinite scroll sentinels, scroll-triggered
179
+ * animations, "back to top" buttons, analytics viewport tracking.
180
+ *
181
+ * ### Lazy load sentinel
182
+ * ```html
183
+ * <div cngxIntersectionObserver #io="cngxIntersectionObserver"
184
+ * (entered)="loadNextPage()">
185
+ * @if (io.isIntersecting()) { Loading... }
186
+ * </div>
187
+ * ```
188
+ *
189
+ * ### Scroll-triggered animation
190
+ * ```html
191
+ * <section cngxIntersectionObserver #io="cngxIntersectionObserver"
192
+ * [threshold]="0.5"
193
+ * [class.visible]="io.isIntersecting()">
194
+ * Content fades in at 50% visibility
195
+ * </section>
196
+ * ```
197
+ *
198
+ * ### Custom scroll container
199
+ * ```html
200
+ * <div cngxIntersectionObserver [root]="'.scroll-container'" [rootMargin]="'100px'">
201
+ * Observed within a scrollable parent
202
+ * </div>
203
+ * ```
204
+ */
205
+ declare class CngxIntersectionObserver {
206
+ /** CSS selector for the scroll container root. `null` (default) uses the viewport. */
207
+ readonly root: _angular_core.InputSignal<string | null>;
208
+ /** Margin around the root, using CSS margin syntax (e.g. `'100px 0px'`). */
209
+ readonly rootMargin: _angular_core.InputSignal<string>;
210
+ /** Visibility ratio(s) at which the callback fires. `0` = any pixel visible, `1` = fully visible. */
211
+ readonly threshold: _angular_core.InputSignal<number | number[]>;
212
+ private readonly entryState;
213
+ /** `true` when any part of the element is visible within the root. */
214
+ readonly isIntersecting: _angular_core.Signal<boolean>;
215
+ /** The fraction of the element currently visible (0–1). */
216
+ readonly intersectionRatio: _angular_core.Signal<number>;
217
+ /** Emitted on every intersection change with the raw `IntersectionObserverEntry`. */
218
+ readonly intersectionChange: _angular_core.OutputEmitterRef<IntersectionObserverEntry>;
219
+ /** Emitted once when the element enters the observed area. */
220
+ readonly entered: _angular_core.OutputEmitterRef<void>;
221
+ /** Emitted once when the element leaves the observed area. */
222
+ readonly left: _angular_core.OutputEmitterRef<void>;
223
+ private readonly el;
224
+ private readonly doc;
225
+ constructor();
226
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxIntersectionObserver, never>;
227
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxIntersectionObserver, "[cngxIntersectionObserver]", ["cngxIntersectionObserver"], { "root": { "alias": "root"; "required": false; "isSignal": true; }; "rootMargin": { "alias": "rootMargin"; "required": false; "isSignal": true; }; "threshold": { "alias": "threshold"; "required": false; "isSignal": true; }; }, { "intersectionChange": "intersectionChange"; "entered": "entered"; "left": "left"; }, never, never, true, never>;
228
+ }
229
+
230
+ /**
231
+ * Reactive media query directive that exposes a `matches` signal.
232
+ *
233
+ * Wraps `window.matchMedia()` with automatic cleanup. Usable for
234
+ * responsive layouts, drawer mode switching, conditional rendering,
235
+ * or any behavior that depends on viewport/preference queries.
236
+ *
237
+ * ### Responsive drawer mode
238
+ * ```html
239
+ * <div cngxMediaQuery="(min-width: 1024px)" #mq="cngxMediaQuery">
240
+ * <nav [cngxDrawerPanel]="drawer"
241
+ * [mode]="mq.matches() ? 'side' : 'over'">
242
+ * …
243
+ * </nav>
244
+ * </div>
245
+ * ```
246
+ *
247
+ * ### Conditional content
248
+ * ```html
249
+ * <div cngxMediaQuery="(prefers-color-scheme: dark)" #dark="cngxMediaQuery">
250
+ * @if (dark.matches()) { <span>Dark mode active</span> }
251
+ * </div>
252
+ * ```
253
+ */
254
+ declare class CngxMediaQuery {
255
+ /** The CSS media query string to evaluate. */
256
+ readonly query: _angular_core.InputSignal<string>;
257
+ private readonly matchesState;
258
+ private readonly win;
259
+ /** Whether the media query currently matches. */
260
+ readonly matches: _angular_core.Signal<boolean>;
261
+ constructor();
262
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxMediaQuery, never>;
263
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxMediaQuery, "[cngxMediaQuery]", ["cngxMediaQuery"], { "query": { "alias": "cngxMediaQuery"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
264
+ }
265
+
266
+ /**
267
+ * Observes size changes of the host element via the `ResizeObserver` API.
268
+ *
269
+ * Exposes `width()`, `height()`, `contentRect()`, and `isReady()` as Angular
270
+ * signals that update on every resize. The observer is automatically
271
+ * disconnected on destroy and recreated when the `box` input changes.
272
+ *
273
+ * Use cases: responsive component logic in TypeScript (not just CSS),
274
+ * container queries without CSS support, dynamic canvas/chart sizing,
275
+ * resize-aware layouts.
276
+ *
277
+ * ### Display current size
278
+ * ```html
279
+ * <div cngxResizeObserver #ro="cngxResizeObserver" style="resize: horizontal; overflow: auto;">
280
+ * {{ ro.width() | number:'1.0-0' }} × {{ ro.height() | number:'1.0-0' }} px
281
+ * </div>
282
+ * ```
283
+ *
284
+ * ### Responsive logic in TypeScript
285
+ * ```typescript
286
+ * readonly ro = viewChild(CngxResizeObserver);
287
+ * readonly columns = computed(() => (this.ro()?.width() ?? 0) > 600 ? 3 : 1);
288
+ * ```
289
+ */
290
+ declare class CngxResizeObserver {
291
+ /** Which box model to observe. `'content-box'` (default), `'border-box'`, or `'device-pixel-content-box'`. */
292
+ readonly box: _angular_core.InputSignal<ResizeObserverBoxOptions>;
293
+ private readonly entryState;
294
+ /** The full `DOMRectReadOnly` of the content box. `null` before first observation. */
295
+ readonly contentRect: _angular_core.Signal<DOMRectReadOnly | null>;
296
+ /** Current width in pixels. `0` before first observation. */
297
+ readonly width: _angular_core.Signal<number>;
298
+ /** Current height in pixels. `0` before first observation. */
299
+ readonly height: _angular_core.Signal<number>;
300
+ /** `true` after the first resize observation has been received. */
301
+ readonly isReady: _angular_core.Signal<boolean>;
302
+ /** Emitted on every resize with the raw `ResizeObserverEntry`. */
303
+ readonly resize: _angular_core.OutputEmitterRef<ResizeObserverEntry>;
304
+ private readonly el;
305
+ constructor();
306
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxResizeObserver, never>;
307
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxResizeObserver, "[cngxResizeObserver]", ["cngxResizeObserver"], { "box": { "alias": "box"; "required": false; "isSignal": true; }; }, { "resize": "resize"; }, never, never, true, never>;
308
+ }
309
+
310
+ /**
311
+ * Prevents scrolling on the document body when enabled.
312
+ *
313
+ * Sets `overflow: hidden` and `scrollbar-gutter: stable` on `<html>` to
314
+ * prevent layout shift when the scrollbar disappears. Restores original
315
+ * values when all lock instances are released.
316
+ *
317
+ * Multiple instances are ref-counted — the original styles are only
318
+ * restored when the last lock is released.
319
+ *
320
+ * ### With a drawer
321
+ * ```html
322
+ * <div cngxDrawer #drawer="cngxDrawer" [cngxScrollLock]="drawer.opened()">
323
+ * …
324
+ * </div>
325
+ * ```
326
+ *
327
+ * ### With a modal
328
+ * ```html
329
+ * <div [cngxScrollLock]="isModalOpen()">…</div>
330
+ * ```
331
+ */
332
+ declare class CngxScrollLock {
333
+ /** Whether scroll lock is active. */
334
+ readonly enabled: _angular_core.InputSignal<boolean>;
335
+ constructor();
336
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxScrollLock, never>;
337
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxScrollLock, "[cngxScrollLock]", ["cngxScrollLock"], { "enabled": { "alias": "cngxScrollLock"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
338
+ }
339
+
340
+ /**
341
+ * Headless skeleton loading placeholder.
342
+ *
343
+ * Toggles between loading and content states via CSS classes and ARIA attributes.
344
+ * No template -- the consumer renders the skeleton UI.
345
+ *
346
+ * Exposes an `indices()` signal for `@for` rendering of repeated skeleton elements.
347
+ * Respects `prefers-reduced-motion` (disables shimmer animation class).
348
+ *
349
+ * ### Basic loading placeholder
350
+ * ```html
351
+ * <div [cngxSkeleton]="isLoading()" #sk="cngxSkeleton">
352
+ * @if (sk.loading()) {
353
+ * @for (i of sk.indices(); track i) {
354
+ * <div class="skeleton-line" aria-hidden="true"></div>
355
+ * }
356
+ * } @else {
357
+ * <p>{{ content() }}</p>
358
+ * }
359
+ * </div>
360
+ * ```
361
+ *
362
+ * ### Card list with repeat count
363
+ * ```html
364
+ * <div [cngxSkeleton]="loading()" [count]="3" #sk="cngxSkeleton">
365
+ * @if (sk.loading()) {
366
+ * @for (i of sk.indices(); track i) {
367
+ * <div class="skeleton-card" aria-hidden="true">
368
+ * <div class="skeleton-avatar"></div>
369
+ * <div class="skeleton-line"></div>
370
+ * </div>
371
+ * }
372
+ * } @else {
373
+ * @for (card of cards(); track card.id) {
374
+ * <app-card [data]="card" />
375
+ * }
376
+ * }
377
+ * </div>
378
+ * ```
379
+ */
380
+ declare class CngxSkeleton {
381
+ /** Controls the loading state. */
382
+ readonly skeleton: _angular_core.InputSignal<boolean>;
383
+ /** Enables the `.cngx-skeleton--shimmer` class (respects `prefers-reduced-motion`). */
384
+ readonly shimmer: _angular_core.InputSignal<boolean>;
385
+ /** Repeat count — exposed via the `indices()` signal for `@for` rendering. */
386
+ readonly count: _angular_core.InputSignal<number>;
387
+ private readonly prefersReducedMotion;
388
+ constructor();
389
+ /** Whether the skeleton is in loading state. Mirrors the `cngxSkeleton` input. */
390
+ readonly loading: Signal<boolean>;
391
+ /** Array of indices for `@for` rendering of repeated skeleton elements. */
392
+ readonly indices: Signal<number[]>;
393
+ /** @internal — shimmer class condition. */
394
+ protected readonly showShimmer: Signal<boolean>;
395
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSkeleton, never>;
396
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxSkeleton, "[cngxSkeleton]", ["cngxSkeleton"], { "skeleton": { "alias": "cngxSkeleton"; "required": false; "isSignal": true; }; "shimmer": { "alias": "shimmer"; "required": false; "isSignal": true; }; "count": { "alias": "count"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
397
+ }
398
+
399
+ /**
400
+ * Infinite scroll trigger using `IntersectionObserver`.
401
+ *
402
+ * Place on a sentinel element at the bottom of a list. Fires `loadMore`
403
+ * when the sentinel enters the viewport. Includes a debounce guard and
404
+ * a `loading` input to prevent re-triggers during fetch.
405
+ *
406
+ * The observer is automatically recreated when `root`, `rootMargin`, or
407
+ * `threshold` inputs change, and disconnected on destroy or when `enabled`
408
+ * is set to `false`.
409
+ *
410
+ * ### Basic infinite list
411
+ * ```html
412
+ * <div class="item-list">
413
+ * @for (item of items(); track item.id) {
414
+ * <app-item [data]="item" />
415
+ * }
416
+ * <div cngxInfiniteScroll [loading]="isFetching()" (loadMore)="fetchNext()">
417
+ * @if (scroll.isLoading()) { <mat-spinner diameter="24" /> }
418
+ * </div>
419
+ * </div>
420
+ * ```
421
+ *
422
+ * ### Disable when all loaded
423
+ * ```html
424
+ * <div cngxInfiniteScroll
425
+ * [enabled]="hasNextPage()"
426
+ * [loading]="isFetching()"
427
+ * (loadMore)="fetchNext()">
428
+ * @if (!hasNextPage()) { <p>All items loaded</p> }
429
+ * </div>
430
+ * ```
431
+ *
432
+ * ### Custom scroll container with pre-fetch margin
433
+ * ```html
434
+ * <div cngxInfiniteScroll
435
+ * [root]="'.scroll-container'"
436
+ * [rootMargin]="'0px 0px 400px 0px'"
437
+ * [loading]="loading()"
438
+ * (loadMore)="loadMore()">
439
+ * </div>
440
+ * ```
441
+ */
442
+ declare class CngxInfiniteScroll {
443
+ /** IntersectionObserver threshold (0–1). */
444
+ readonly threshold: _angular_core.InputSignal<number>;
445
+ /** Pre-fetch margin. `'0px 0px 200px 0px'` triggers 200px before the sentinel is visible. */
446
+ readonly rootMargin: _angular_core.InputSignal<string>;
447
+ /** CSS selector for a custom scroll container root. `null` uses the viewport. */
448
+ readonly root: _angular_core.InputSignal<string | null>;
449
+ /** When `false`, the observer disconnects entirely. Use to stop loading when all items are fetched. */
450
+ readonly enabled: _angular_core.InputSignal<boolean>;
451
+ /** Set to `true` while fetching. Prevents re-trigger until the fetch completes. */
452
+ readonly loading: _angular_core.InputSignal<boolean>;
453
+ /** Minimum ms between consecutive `loadMore` emissions. */
454
+ readonly debounceMs: _angular_core.InputSignal<number>;
455
+ /** Emitted when the sentinel is visible, not loading, and debounce has elapsed. */
456
+ readonly loadMore: _angular_core.OutputEmitterRef<void>;
457
+ /** Readonly mirror of the `loading` input. */
458
+ readonly isLoading: Signal<boolean>;
459
+ private readonly el;
460
+ private readonly doc;
461
+ private lastEmitTime;
462
+ constructor();
463
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxInfiniteScroll, never>;
464
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxInfiniteScroll, "[cngxInfiniteScroll]", ["cngxInfiniteScroll"], { "threshold": { "alias": "threshold"; "required": false; "isSignal": true; }; "rootMargin": { "alias": "rootMargin"; "required": false; "isSignal": true; }; "root": { "alias": "root"; "required": false; "isSignal": true; }; "enabled": { "alias": "enabled"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "debounceMs": { "alias": "debounceMs"; "required": false; "isSignal": true; }; }, { "loadMore": "loadMore"; }, never, never, true, never>;
465
+ }
466
+
467
+ /**
468
+ * Communicates when a sticky-positioned element becomes stuck.
469
+ *
470
+ * Applies `position: sticky; top: 0` on the host automatically.
471
+ * The directive adds a sentinel element before the host and uses
472
+ * `IntersectionObserver` to detect when the sentinel scrolls out,
473
+ * meaning the header is now stuck. Toggles a CSS class for shadow,
474
+ * elevation, or background changes.
475
+ *
476
+ * ### Sticky header with shadow
477
+ * ```html
478
+ * <header cngxStickyHeader #sh="cngxStickyHeader"
479
+ * style="position: sticky; top: 0;">
480
+ * Page header
481
+ * </header>
482
+ * ```
483
+ *
484
+ * ```css
485
+ * .cngx-sticky--active { box-shadow: 0 2px 4px rgba(0,0,0,.1); }
486
+ * ```
487
+ */
488
+ declare class CngxStickyHeader {
489
+ /** Intersection threshold — `0` triggers as soon as the sentinel leaves. */
490
+ readonly threshold: _angular_core.InputSignal<number>;
491
+ /** Emitted when the sticky state changes. */
492
+ readonly stickyChange: _angular_core.OutputEmitterRef<boolean>;
493
+ private readonly isStickyState;
494
+ /** Whether the header is currently in its stuck position. */
495
+ readonly isSticky: _angular_core.Signal<boolean>;
496
+ private readonly el;
497
+ private readonly doc;
498
+ constructor();
499
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxStickyHeader, never>;
500
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxStickyHeader, "[cngxStickyHeader]", ["cngxStickyHeader"], { "threshold": { "alias": "threshold"; "required": false; "isSignal": true; }; }, { "stickyChange": "stickyChange"; }, never, never, true, never>;
501
+ }
502
+
503
+ /**
504
+ * Tracks which section is currently most visible in the viewport.
505
+ *
506
+ * Observes a list of elements by their IDs using `IntersectionObserver`
507
+ * and reports the one with the highest intersection ratio as the active section.
508
+ * Ideal for scroll-based navigation highlighting and reading progress.
509
+ *
510
+ * ### Navigation highlighting
511
+ * ```html
512
+ * <nav [cngxScrollSpy]="['intro', 'features', 'pricing']"
513
+ * #spy="cngxScrollSpy">
514
+ * <a [class.active]="spy.activeId() === 'intro'" href="#intro">Intro</a>
515
+ * <a [class.active]="spy.activeId() === 'features'" href="#features">Features</a>
516
+ * <a [class.active]="spy.activeId() === 'pricing'" href="#pricing">Pricing</a>
517
+ * </nav>
518
+ *
519
+ * <section id="intro">…</section>
520
+ * <section id="features">…</section>
521
+ * <section id="pricing">…</section>
522
+ * ```
523
+ */
524
+ declare class CngxScrollSpy {
525
+ /** IDs of the sections to observe. */
526
+ readonly sections: _angular_core.InputSignal<string[]>;
527
+ /** Minimum visibility ratio to consider a section as a candidate. */
528
+ readonly threshold: _angular_core.InputSignal<number>;
529
+ /** CSS selector for the scroll container root. `null` uses the viewport. */
530
+ readonly root: _angular_core.InputSignal<string | null>;
531
+ /** Root margin for the observer. */
532
+ readonly rootMargin: _angular_core.InputSignal<string>;
533
+ /** Emitted when the active section changes. */
534
+ readonly activeIdChange: _angular_core.OutputEmitterRef<string | null>;
535
+ private readonly activeIdState;
536
+ /** ID of the section with the highest intersection ratio. */
537
+ readonly activeId: _angular_core.Signal<string | null>;
538
+ private readonly doc;
539
+ /** Last observed intersection ratio keyed by section ID. */
540
+ private readonly ratios;
541
+ private readonly initialized;
542
+ private activeCleanup;
543
+ constructor();
544
+ /** Builds an `IntersectionObserver` for the current section IDs. Returns a disconnect callback. */
545
+ private setupObserver;
546
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxScrollSpy, never>;
547
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxScrollSpy, "[cngxScrollSpy]", ["cngxScrollSpy"], { "sections": { "alias": "cngxScrollSpy"; "required": true; "isSignal": true; }; "threshold": { "alias": "threshold"; "required": false; "isSignal": true; }; "root": { "alias": "root"; "required": false; "isSignal": true; }; "rootMargin": { "alias": "rootMargin"; "required": false; "isSignal": true; }; }, { "activeIdChange": "activeIdChange"; }, never, never, true, never>;
548
+ }
549
+
550
+ /**
551
+ * Manages text truncation with expand/collapse state detection.
552
+ *
553
+ * Applies `-webkit-line-clamp` when collapsed and detects whether the text
554
+ * is actually clamped (content overflows). Exposes `isClamped` so the consumer
555
+ * can conditionally show a "Show more" toggle only when needed.
556
+ *
557
+ * The `expanded` state supports two-way binding (controlled + uncontrolled).
558
+ *
559
+ * ### Basic truncation with toggle
560
+ * ```html
561
+ * <p [cngxTruncate]="3" [(expanded)]="expanded" #trunc="cngxTruncate">
562
+ * Long text content that may or may not overflow…
563
+ * </p>
564
+ * @if (trunc.isClamped() || trunc.expanded()) {
565
+ * <button (click)="expanded.set(!expanded())"
566
+ * [attr.aria-expanded]="expanded()">
567
+ * {{ expanded() ? 'Show less' : 'Show more' }}
568
+ * </button>
569
+ * }
570
+ * ```
571
+ */
572
+ declare class CngxTruncate {
573
+ /** Maximum number of visible lines when collapsed. */
574
+ readonly lines: _angular_core.InputSignal<number>;
575
+ /** Whether the text is expanded (full content visible). Supports two-way binding. */
576
+ readonly expanded: _angular_core.ModelSignal<boolean>;
577
+ private readonly isClampedState;
578
+ /** Whether the text content actually exceeds the line limit and is being clamped. */
579
+ readonly isClamped: _angular_core.Signal<boolean>;
580
+ private readonly el;
581
+ private observer;
582
+ private rafHandle;
583
+ /** @internal */
584
+ protected clampValue: () => string | null;
585
+ /** @internal */
586
+ protected displayValue: () => "-webkit-box" | null;
587
+ /** @internal */
588
+ protected orientValue: () => "vertical" | null;
589
+ /** @internal */
590
+ protected overflowValue: () => "hidden" | null;
591
+ constructor();
592
+ private cancelRaf;
593
+ /**
594
+ * Compares `scrollHeight` vs `clientHeight` to detect overflow.
595
+ * Only meaningful when collapsed — when expanded, the last known
596
+ * clamped state is preserved (can't measure hypothetical clamp height
597
+ * while showing full content).
598
+ */
599
+ private checkClamped;
600
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxTruncate, never>;
601
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxTruncate, "[cngxTruncate]", ["cngxTruncate"], { "lines": { "alias": "cngxTruncate"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; }, { "expanded": "expandedChange"; }, never, never, true, never>;
602
+ }
603
+
604
+ /**
605
+ * Search-text highlighting via `<mark>` elements.
606
+ *
607
+ * Walks `TEXT_NODE` children of the host element, splits at match boundaries,
608
+ * and wraps matched portions in `<mark>` elements. No `innerHTML` — safe by
609
+ * construction. The `<mark>` element has correct native SR semantics (announced
610
+ * as "highlighted" in most screen readers).
611
+ *
612
+ * Original DOM structure is restored when the term changes or the directive is destroyed.
613
+ *
614
+ * ### Search result highlighting
615
+ * ```html
616
+ * <p [cngxHighlight]="searchTerm()">
617
+ * Angular Signals represent a fundamental shift in reactivity.
618
+ * </p>
619
+ * ```
620
+ *
621
+ * ### Case-sensitive matching
622
+ * ```html
623
+ * <p [cngxHighlight]="term()" [highlightCaseSensitive]="true">
624
+ * CamelCase matters here.
625
+ * </p>
626
+ * ```
627
+ */
628
+ declare class CngxHighlight {
629
+ /** The search term to highlight. Empty string clears all highlights. */
630
+ readonly term: _angular_core.InputSignal<string>;
631
+ /** Whether matching is case-sensitive. */
632
+ readonly caseSensitive: _angular_core.InputSignal<boolean>;
633
+ private readonly matchCountState;
634
+ /** Number of matches found in the current highlight pass. */
635
+ readonly matchCount: _angular_core.Signal<number>;
636
+ private readonly el;
637
+ private readonly doc;
638
+ /** Snapshot of original child nodes — restored before each re-highlight. */
639
+ private originalNodes;
640
+ private readonly initialized;
641
+ constructor();
642
+ /**
643
+ * Performs the highlight pass: restores original DOM, then wraps matches
644
+ * in `<mark>` elements. Updates `matchCountState` with the result count.
645
+ */
646
+ private applyHighlight;
647
+ /** Restores the original DOM structure. */
648
+ private restore;
649
+ private restoreNodes;
650
+ /** Escapes special regex characters in the search term. */
651
+ private escapeRegex;
652
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxHighlight, never>;
653
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxHighlight, "[cngxHighlight]", ["cngxHighlight"], { "term": { "alias": "cngxHighlight"; "required": false; "isSignal": true; }; "caseSensitive": { "alias": "highlightCaseSensitive"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
654
+ }
655
+
656
+ /** Template context for the custom toggle template. */
657
+ interface CngxExpandableToggleContext {
658
+ /** Whether the text is currently expanded. */
659
+ $implicit: boolean;
660
+ /** Whether the text is currently expanded. */
661
+ expanded: boolean;
662
+ /** Call to toggle the expanded state. */
663
+ toggle: () => void;
664
+ }
665
+ /**
666
+ * Marks a custom toggle template inside `cngx-expandable-text`.
667
+ *
668
+ * ```html
669
+ * <cngx-expandable-text [lines]="3">
670
+ * Long text…
671
+ * <ng-template cngxExpandableToggle let-expanded let-toggle="toggle">
672
+ * <button (click)="toggle()" class="icon-btn">
673
+ * <mat-icon>{{ expanded ? 'expand_less' : 'expand_more' }}</mat-icon>
674
+ * </button>
675
+ * </ng-template>
676
+ * </cngx-expandable-text>
677
+ * ```
678
+ */
679
+ declare class CngxExpandableToggle {
680
+ readonly templateRef: TemplateRef<CngxExpandableToggleContext>;
681
+ constructor(templateRef: TemplateRef<CngxExpandableToggleContext>);
682
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxExpandableToggle, never>;
683
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxExpandableToggle, "ng-template[cngxExpandableToggle]", never, {}, {}, never, never, true, never>;
684
+ }
685
+ /**
686
+ * Molecule wrapping `CngxTruncate` with a built-in expand/collapse toggle.
687
+ *
688
+ * Projects content into a truncated container and conditionally renders
689
+ * a "Show more" / "Show less" button when the content is actually clamped.
690
+ * Handles `aria-expanded` automatically.
691
+ *
692
+ * Supports custom toggle templates via `ng-template[cngxExpandableToggle]` —
693
+ * use for icon buttons or any custom UI instead of plain text labels.
694
+ *
695
+ * ### Basic usage
696
+ * ```html
697
+ * <cngx-expandable-text [lines]="3">
698
+ * Long text that may or may not overflow the container…
699
+ * </cngx-expandable-text>
700
+ * ```
701
+ *
702
+ * ### Custom labels
703
+ * ```html
704
+ * <cngx-expandable-text [lines]="2" moreLabel="Mehr" lessLabel="Weniger">
705
+ * Langer Text…
706
+ * </cngx-expandable-text>
707
+ * ```
708
+ *
709
+ * ### Custom toggle template
710
+ * ```html
711
+ * <cngx-expandable-text [lines]="3">
712
+ * Long text…
713
+ * <ng-template cngxExpandableToggle let-expanded let-toggle="toggle">
714
+ * <button (click)="toggle()">{{ expanded ? 'Collapse' : 'Expand' }}</button>
715
+ * </ng-template>
716
+ * </cngx-expandable-text>
717
+ * ```
718
+ */
719
+ declare class CngxExpandableText {
720
+ /** Maximum visible lines when collapsed. */
721
+ readonly lines: _angular_core.InputSignal<number>;
722
+ /** Whether the text is expanded. Supports two-way `[(expanded)]` binding. */
723
+ readonly expanded: _angular_core.ModelSignal<boolean>;
724
+ /** Label for the "show more" button. */
725
+ readonly moreLabel: _angular_core.InputSignal<string>;
726
+ /** Label for the "show less" button. */
727
+ readonly lessLabel: _angular_core.InputSignal<string>;
728
+ /** Optional custom toggle template projected by the consumer. */
729
+ protected readonly customToggle: _angular_core.Signal<CngxExpandableToggle | undefined>;
730
+ /** Template context for the custom toggle. */
731
+ protected toggleContext(): CngxExpandableToggleContext;
732
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxExpandableText, never>;
733
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxExpandableText, "cngx-expandable-text", ["cngxExpandableText"], { "lines": { "alias": "lines"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; "moreLabel": { "alias": "moreLabel"; "required": false; "isSignal": true; }; "lessLabel": { "alias": "lessLabel"; "required": false; "isSignal": true; }; }, { "expanded": "expandedChange"; }, ["customToggle"], ["*"], true, never>;
734
+ }
735
+
736
+ export { CngxBackdrop, CngxDrawer, CngxDrawerContent, CngxDrawerPanel, CngxExpandableText, CngxExpandableToggle, CngxHighlight, CngxInfiniteScroll, CngxIntersectionObserver, CngxMediaQuery, CngxResizeObserver, CngxScrollLock, CngxScrollSpy, CngxSkeleton, CngxStickyHeader, CngxTruncate };
737
+ export type { CngxExpandableToggleContext, DrawerMode, DrawerPosition };