@cngx/common 0.1.0-rc.6 → 0.1.0-rc.8

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 (72) hide show
  1. package/card/README.md +2 -1
  2. package/chart/README.md +85 -0
  3. package/command/README.md +157 -0
  4. package/data/README.md +33 -1
  5. package/dialog/README.md +23 -1
  6. package/fesm2022/cngx-common-a11y.mjs +356 -180
  7. package/fesm2022/cngx-common-a11y.mjs.map +1 -1
  8. package/fesm2022/cngx-common-audio.mjs +84 -42
  9. package/fesm2022/cngx-common-audio.mjs.map +1 -1
  10. package/fesm2022/cngx-common-card.mjs +311 -53
  11. package/fesm2022/cngx-common-card.mjs.map +1 -1
  12. package/fesm2022/cngx-common-chart.mjs +4360 -1625
  13. package/fesm2022/cngx-common-chart.mjs.map +1 -1
  14. package/fesm2022/cngx-common-command.mjs +171 -0
  15. package/fesm2022/cngx-common-command.mjs.map +1 -0
  16. package/fesm2022/cngx-common-data.mjs +1556 -616
  17. package/fesm2022/cngx-common-data.mjs.map +1 -1
  18. package/fesm2022/cngx-common-dialog.mjs +518 -112
  19. package/fesm2022/cngx-common-dialog.mjs.map +1 -1
  20. package/fesm2022/cngx-common-display.mjs +468 -87
  21. package/fesm2022/cngx-common-display.mjs.map +1 -1
  22. package/fesm2022/cngx-common-interactive.mjs +2725 -1303
  23. package/fesm2022/cngx-common-interactive.mjs.map +1 -1
  24. package/fesm2022/cngx-common-layout.mjs +943 -164
  25. package/fesm2022/cngx-common-layout.mjs.map +1 -1
  26. package/fesm2022/cngx-common-popover.mjs +769 -103
  27. package/fesm2022/cngx-common-popover.mjs.map +1 -1
  28. package/fesm2022/cngx-common-stepper.mjs +816 -348
  29. package/fesm2022/cngx-common-stepper.mjs.map +1 -1
  30. package/fesm2022/cngx-common-tabs.mjs +2330 -1554
  31. package/fesm2022/cngx-common-tabs.mjs.map +1 -1
  32. package/fesm2022/cngx-common-timeline.mjs +1170 -0
  33. package/fesm2022/cngx-common-timeline.mjs.map +1 -0
  34. package/fesm2022/cngx-common.mjs +2 -2
  35. package/fesm2022/cngx-common.mjs.map +1 -1
  36. package/interactive/README.md +15 -4
  37. package/layout/README.md +21 -1
  38. package/package.json +11 -1
  39. package/popover/README.md +18 -2
  40. package/stepper/README.md +7 -5
  41. package/theming/components/cngx-accordion.css +4 -1
  42. package/theming/components/cngx-backdrop.css +12 -0
  43. package/theming/components/cngx-badge.css +22 -0
  44. package/theming/components/cngx-bottom-sheet.css +14 -2
  45. package/theming/components/cngx-breadcrumb.css +8 -0
  46. package/theming/components/cngx-button-toggle.css +73 -5
  47. package/theming/components/cngx-data-grid.css +234 -1
  48. package/theming/components/cngx-dialog.css +25 -0
  49. package/theming/components/cngx-divider.css +12 -0
  50. package/theming/components/cngx-listbox.css +48 -12
  51. package/theming/components/cngx-menu.css +91 -15
  52. package/theming/components/cngx-popover.css +24 -0
  53. package/theming/components/cngx-recycler-placeholder.css +196 -0
  54. package/theming/components/cngx-ripple.css +2 -2
  55. package/theming/components/cngx-slider.css +32 -1
  56. package/theming/components/cngx-tooltip.css +23 -0
  57. package/timeline/README.md +155 -0
  58. package/types/cngx-common-a11y.d.ts +101 -31
  59. package/types/cngx-common-audio.d.ts +32 -32
  60. package/types/cngx-common-card.d.ts +211 -20
  61. package/types/cngx-common-chart.d.ts +1605 -169
  62. package/types/cngx-common-command.d.ts +190 -0
  63. package/types/cngx-common-data.d.ts +842 -163
  64. package/types/cngx-common-dialog.d.ts +372 -28
  65. package/types/cngx-common-display.d.ts +432 -148
  66. package/types/cngx-common-interactive.d.ts +1553 -370
  67. package/types/cngx-common-layout.d.ts +613 -27
  68. package/types/cngx-common-popover.d.ts +376 -36
  69. package/types/cngx-common-stepper.d.ts +414 -114
  70. package/types/cngx-common-tabs.d.ts +597 -72
  71. package/types/cngx-common-timeline.d.ts +1125 -0
  72. package/types/cngx-common.d.ts +1 -1
@@ -33,7 +33,6 @@ import { OnDestroy, ElementRef, InjectionToken, Signal } from '@angular/core';
33
33
  * ```
34
34
  *
35
35
  * @category common/a11y
36
- * @docsKind primary
37
36
  * @wcag AA
38
37
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/aria/aria-expanded.directive.ts
39
38
  * @since 0.1.0
@@ -80,7 +79,6 @@ declare class CngxAriaExpanded {
80
79
  * ```
81
80
  *
82
81
  * @category common/a11y
83
- * @docsKind primary
84
82
  * @wcag AA
85
83
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/aria/live-region.directive.ts
86
84
  * @since 0.1.0
@@ -104,22 +102,32 @@ declare class CngxLiveRegion {
104
102
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxLiveRegion, "[cngxLiveRegion]", ["cngxLiveRegion"], { "politeness": { "alias": "politeness"; "required": false; "isSignal": true; }; "atomic": { "alias": "atomic"; "required": false; "isSignal": true; }; "relevant": { "alias": "relevant"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
105
103
  }
106
104
 
105
+ /**
106
+ * Politeness channel for {@link CngxLiveAnnouncer.announce}: `'polite'` queues
107
+ * after the current utterance, `'assertive'` interrupts it immediately.
108
+ *
109
+ * @category common/a11y
110
+ */
111
+ type AriaLivePoliteness = 'polite' | 'assertive';
107
112
  /**
108
113
  * Imperative, reusable polite/assertive live-region announcer.
109
114
  *
110
115
  * The imperative counterpart to {@link CngxLiveRegion}: where the directive
111
116
  * decorates an element you render (the content IS the announcement), this
112
- * service owns a single visually-hidden `aria-live` element appended to
113
- * `document.body` and exposes an `announce(message)` call for template-less
117
+ * service owns two visually-hidden `aria-live` regions appended to
118
+ * `document.body` - one persistent polite node and one persistent assertive
119
+ * node - and exposes an `announce(message, politeness)` call for template-less
114
120
  * directives and event handlers (e.g. `CngxCopyValue` copy success,
115
121
  * `CngxOtpInput` completion).
116
122
  *
117
- * One root element is created lazily on the first announcement and reused for
118
- * every subsequent call. The text is cleared and re-set on the next macrotask
119
- * so an identical consecutive message is still re-read by the screen reader.
123
+ * Each region is created lazily on the first announcement of its politeness and
124
+ * reused thereafter. Because polite and assertive live in separate fixed-
125
+ * politeness nodes, an assertive announcement never clobbers a concurrent
126
+ * polite one. Per region, the text is cleared and re-set one frame later so an
127
+ * identical consecutive message is still re-read by the screen reader.
120
128
  *
121
129
  * SSR-safe: all DOM access is guarded by `isPlatformBrowser`; on the server
122
- * `announce()` is a no-op and no element is created.
130
+ * `announce()` is a no-op and no region is created.
123
131
  *
124
132
  * ```typescript
125
133
  * const announcer = inject(CngxLiveAnnouncer);
@@ -128,7 +136,6 @@ declare class CngxLiveRegion {
128
136
  * ```
129
137
  *
130
138
  * @category common/a11y
131
- * @docsKind primary
132
139
  * @wcag AA
133
140
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/aria/live-announcer.ts
134
141
  * @since 0.1.0
@@ -137,16 +144,18 @@ declare class CngxLiveRegion {
137
144
  declare class CngxLiveAnnouncer implements OnDestroy {
138
145
  private readonly doc;
139
146
  private readonly isBrowser;
140
- private region;
141
- private pending;
147
+ private politeRegion;
148
+ private assertiveRegion;
149
+ private readonly pending;
142
150
  /**
143
- * Announces `message` through the shared live region.
151
+ * Announces `message` through the fixed-politeness live region.
144
152
  *
145
153
  * @param message Text read by the screen reader.
146
154
  * @param politeness `'polite'` (default) queues after the current
147
- * utterance; `'assertive'` interrupts immediately.
155
+ * utterance; `'assertive'` interrupts immediately. Each politeness owns its
156
+ * own region, so the two never overwrite each other.
148
157
  */
149
- announce(message: string, politeness?: 'polite' | 'assertive'): void;
158
+ announce(message: string, politeness?: AriaLivePoliteness): void;
150
159
  ngOnDestroy(): void;
151
160
  private ensureRegion;
152
161
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxLiveAnnouncer, never>;
@@ -181,7 +190,6 @@ declare class CngxLiveAnnouncer implements OnDestroy {
181
190
  * ```
182
191
  *
183
192
  * @category common/a11y
184
- * @docsKind primary
185
193
  * @wcag AA
186
194
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/focus/autofocus.directive.ts
187
195
  * @since 0.1.0
@@ -232,7 +240,9 @@ declare const CNGX_FOCUSABLE_SELECTOR = "a[href], button:not(:disabled), input:n
232
240
  * `document.activeElement` at initialization time and restores it when the
233
241
  * host element is destroyed.
234
242
  *
235
- * Fallback chain: stored element → provided fallback → nearest focusable ancestor → body.
243
+ * Fallback chain: stored element → provided fallback → nearest focusable ancestor.
244
+ * When none resolves, focus is left where the browser put it - `<body>` is
245
+ * deliberately never a restore target.
236
246
  *
237
247
  * ### Panel that restores focus on close
238
248
  * ```html
@@ -253,7 +263,6 @@ declare const CNGX_FOCUSABLE_SELECTOR = "a[href], button:not(:disabled), input:n
253
263
  * ```
254
264
  *
255
265
  * @category common/a11y
256
- * @docsKind primary
257
266
  * @wcag AA
258
267
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/focus/focus-restore.directive.ts
259
268
  * @since 0.1.0
@@ -305,6 +314,11 @@ declare class CngxFocusRestore {
305
314
  * The CDK's imperative `create()` / `destroy()` / `enabled` setter lifecycle
306
315
  * is handled internally via `effect()` and `DestroyRef`.
307
316
  *
317
+ * **Nesting:** traps do not coordinate with each other. When traps nest
318
+ * (dialog over drawer), enable only the innermost one and drive each
319
+ * `enabled` from your layering state - two simultaneously enabled traps
320
+ * fight over Tab. `CngxDialogStack` already does this for stacked dialogs.
321
+ *
308
322
  * ### Modal dialog
309
323
  * ```html
310
324
  * <div cngxFocusTrap [enabled]="isOpen()" [autoFocus]="true"
@@ -337,7 +351,10 @@ declare class CngxFocusTrap {
337
351
  readonly enabled: _angular_core.InputSignal<boolean>;
338
352
  /** Whether to auto-focus the first tabbable element when the trap activates. */
339
353
  readonly autoFocus: _angular_core.InputSignal<boolean>;
340
- /** Computed signal reflecting the current trap state. */
354
+ /**
355
+ * Readable alias of `enabled` for `exportAs` consumers
356
+ * (`trap.isActive()` reads better than re-binding the input).
357
+ */
341
358
  readonly isActive: _angular_core.Signal<boolean>;
342
359
  private readonly trap;
343
360
  constructor();
@@ -363,7 +380,6 @@ declare class CngxFocusTrap {
363
380
  * ```
364
381
  *
365
382
  * @category common/a11y
366
- * @docsKind primary
367
383
  * @wcag AA
368
384
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/focus/focus-visible.directive.ts
369
385
  * @since 0.1.0
@@ -372,11 +388,16 @@ declare class CngxFocusTrap {
372
388
  * <example-url>http://localhost:4200/#/common/a11y/focus-visible/keyboard-vs-pointer</example-url>
373
389
  */
374
390
  declare class CngxFocusVisible {
391
+ private readonly doc;
375
392
  private readonly focusVisibleState;
376
393
  /** `true` when focus was initiated via keyboard (not pointer). */
377
394
  readonly focusVisible: _angular_core.Signal<boolean>;
378
- /** @internal Cleared on `focusin` after being set by `pointerdown`. */
379
- pointerActive: boolean;
395
+ private pointerActive;
396
+ private pointerClearTimer;
397
+ private readonly schedulePointerClear;
398
+ constructor();
399
+ /** @internal Arms the pointer flag for the imminent focusin. */
400
+ protected handlePointerDown(): void;
380
401
  /** @internal Sets focus-visible state; clears pointer flag. */
381
402
  protected handleFocus(): void;
382
403
  /** @internal Clears focus-visible state on blur. */
@@ -401,7 +422,6 @@ declare class CngxFocusVisible {
401
422
  * ```
402
423
  *
403
424
  * @category common/a11y
404
- * @docsKind primary
405
425
  * @wcag AA
406
426
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/roving/roving-tabindex.directive.ts
407
427
  * @since 0.1.0
@@ -501,6 +521,8 @@ declare class CngxRovingTabindex {
501
521
  /** Host element for `data-cngx-recycle-index` queries in virtual mode. */
502
522
  private readonly hostEl;
503
523
  private readonly pendingFocusState;
524
+ /** Document writing direction - flips the horizontal-arrow index deltas under `rtl` (APG). */
525
+ private readonly direction;
504
526
  /**
505
527
  * Set true just before a navigation key (arrow / Home / End) moves focus to a
506
528
  * new item, cleared by {@link consumeNavigationKey}. Transient handshake, not
@@ -537,6 +559,12 @@ declare class CngxRovingTabindex {
537
559
  * based on whether `virtualCount` is set.
538
560
  */
539
561
  protected handleKeyDown(event: KeyboardEvent): void;
562
+ /**
563
+ * Keeps `activeIndex` in sync with real focus (APG): when an item gains
564
+ * focus by any means - pointer click, script focus, assistive tech - the
565
+ * tab stop follows it instead of staying on the last arrow-key target.
566
+ */
567
+ protected handleFocusIn(event: FocusEvent): void;
540
568
  /**
541
569
  * Attempts to focus a virtual item by querying `data-cngx-recycle-index`.
542
570
  * If the element is not in the DOM, sets `pendingFocus` for external resolution.
@@ -544,7 +572,8 @@ declare class CngxRovingTabindex {
544
572
  private focusVirtualItem;
545
573
  /**
546
574
  * Finds the next index in virtual mode. No disabled-item skipping - can't check
547
- * disabled state of items not in the DOM.
575
+ * disabled state of items not in the DOM (the resolver treats every index as
576
+ * enabled when no `isDisabledAt` is supplied).
548
577
  */
549
578
  private findNextVirtual;
550
579
  private enabledItems;
@@ -638,9 +667,13 @@ interface CngxAdItemHandle {
638
667
  *
639
668
  * ### Virtualization
640
669
  *
641
- * When `virtualCount` is set, navigation can address indices not currently
642
- * in the DOM. `pendingHighlight` tells the consumer to scroll the missing
643
- * item into view; the consumer calls `clearPendingHighlight()` afterwards.
670
+ * When `virtualCount` is set, navigation addresses the absolute index space
671
+ * `[0, virtualCount)` even when only a window is rendered. Bind `windowStart`
672
+ * to the recycler's window start so item lookups (id resolution, disabled
673
+ * checks, typeahead labels) map absolute indices onto the rendered subset.
674
+ * Targets outside the window surface as `pendingHighlight`; the consumer
675
+ * scrolls them into view (`connectRecyclerToActiveDescendant`) and the
676
+ * directive clears the pending state once the target renders.
644
677
  *
645
678
  * ### Material/CDK equivalent
646
679
  *
@@ -683,12 +716,31 @@ declare class CngxActiveDescendant {
683
716
  * range surface as `pendingHighlight` for scroll-and-retry protocols.
684
717
  */
685
718
  readonly virtualCount: _angular_core.InputSignal<number | undefined>;
719
+ /**
720
+ * Absolute index of the first rendered item in virtual mode - the recycler
721
+ * window start. All rendered-item lookups are offset by it so absolute
722
+ * indices resolve the right item once the window has scrolled past 0.
723
+ * Ignored when `virtualCount` is unset.
724
+ */
725
+ readonly windowStart: _angular_core.InputSignal<number>;
686
726
  /** Emitted when `activateCurrent()` is called with an active item. */
687
727
  readonly activated: _angular_core.OutputEmitterRef<unknown>;
688
728
  /** Emitted whenever the highlighted item changes. */
689
729
  readonly highlighted: _angular_core.OutputEmitterRef<ActiveDescendantItem | null>;
730
+ /**
731
+ * Emitted when a typeahead query finds no match in the rendered window.
732
+ * Carries the resolved query term (lowercased; a repeated single letter
733
+ * collapses to that letter per the APG cycle rule). The rendered window
734
+ * is AD's whole search space - hosts whose real item space is larger
735
+ * (collapsed tree branches, virtualized rows outside the window) listen
736
+ * here to resolve the miss themselves.
737
+ */
738
+ readonly typeaheadMissed: _angular_core.OutputEmitterRef<string>;
690
739
  private readonly hostEl;
740
+ private readonly locale;
691
741
  private readonly registered;
742
+ /** Document writing direction - flips the horizontal-arrow steps under `rtl` (APG). */
743
+ private readonly direction;
692
744
  /** Guards host attribute writes until after first render. */
693
745
  private readonly initialized;
694
746
  /** -1 means "no active item". Range is [0, resolvedItems().length). */
@@ -708,6 +760,13 @@ declare class CngxActiveDescendant {
708
760
  * or the item is out of rendered range (virtual mode).
709
761
  */
710
762
  readonly activeItem: _angular_core.Signal<ActiveDescendantItem | null>;
763
+ /**
764
+ * `activeItem` pinned to the item id for the `highlighted` emission: a
765
+ * re-render that produces a fresh object for the same item must not
766
+ * re-emit. `activeItem` itself stays identity-equal so `activeValue`
767
+ * tracks value changes on an unchanged id.
768
+ */
769
+ private readonly highlightedItem;
711
770
  readonly activeId: _angular_core.Signal<string | null>;
712
771
  readonly activeValue: _angular_core.Signal<unknown>;
713
772
  private readonly typeaheadBuffer;
@@ -723,8 +782,10 @@ declare class CngxActiveDescendant {
723
782
  */
724
783
  highlightByIndex(index: number): void;
725
784
  /**
726
- * Highlight the first item whose value matches (via `Object.is`). No-op if
727
- * no match. Disabled items are rejected when `skipDisabled()` is true.
785
+ * Highlight the first rendered item whose value matches (via `Object.is`).
786
+ * No-op if no match. Disabled items are rejected when `skipDisabled()` is
787
+ * true. In virtual mode only the rendered window is searched; the resolved
788
+ * index is absolute.
728
789
  */
729
790
  highlightByValue(value: unknown): void;
730
791
  /** Clear the highlight. */
@@ -748,13 +809,23 @@ declare class CngxActiveDescendant {
748
809
  typeaheadChar(ch: string): void;
749
810
  private handleTypeahead;
750
811
  private findFrom;
812
+ /**
813
+ * First/last navigable absolute index. Spans the full virtual range - End
814
+ * targets `totalCount - 1` even when that item is not rendered (it surfaces
815
+ * as `pendingHighlight`); unrendered items count as enabled because their
816
+ * disabled state is unknowable (`isDisabledAt` resolves them to `false`).
817
+ */
751
818
  private findBoundary;
752
819
  private totalCount;
820
+ /** Rendered-window offset: `windowStart` in virtual mode, `0` otherwise. */
821
+ private windowOffset;
822
+ /** Item at an absolute index, `null` when outside the rendered window. */
823
+ private itemAt;
753
824
  private isDisabledAt;
754
825
  private isRendered;
755
826
  private scrollActiveIntoView;
756
827
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxActiveDescendant, never>;
757
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxActiveDescendant, "[cngxActiveDescendant]", ["cngxActiveDescendant"], { "items": { "alias": "items"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "loop": { "alias": "loop"; "required": false; "isSignal": true; }; "typeahead": { "alias": "typeahead"; "required": false; "isSignal": true; }; "typeaheadDebounce": { "alias": "typeaheadDebounce"; "required": false; "isSignal": true; }; "autoHighlightFirst": { "alias": "autoHighlightFirst"; "required": false; "isSignal": true; }; "skipDisabled": { "alias": "skipDisabled"; "required": false; "isSignal": true; }; "virtualCount": { "alias": "virtualCount"; "required": false; "isSignal": true; }; }, { "activated": "activated"; "highlighted": "highlighted"; }, ["registered"], never, true, never>;
828
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxActiveDescendant, "[cngxActiveDescendant]", ["cngxActiveDescendant"], { "items": { "alias": "items"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "loop": { "alias": "loop"; "required": false; "isSignal": true; }; "typeahead": { "alias": "typeahead"; "required": false; "isSignal": true; }; "typeaheadDebounce": { "alias": "typeaheadDebounce"; "required": false; "isSignal": true; }; "autoHighlightFirst": { "alias": "autoHighlightFirst"; "required": false; "isSignal": true; }; "skipDisabled": { "alias": "skipDisabled"; "required": false; "isSignal": true; }; "virtualCount": { "alias": "virtualCount"; "required": false; "isSignal": true; }; "windowStart": { "alias": "windowStart"; "required": false; "isSignal": true; }; }, { "activated": "activated"; "highlighted": "highlighted"; "typeaheadMissed": "typeaheadMissed"; }, ["registered"], never, true, never>;
758
829
  }
759
830
 
760
831
  /**
@@ -783,7 +854,6 @@ declare class CngxActiveDescendant {
783
854
  * ```
784
855
  *
785
856
  * @category common/a11y
786
- * @docsKind primary
787
857
  * @wcag AA
788
858
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/motion/reduced-motion.directive.ts
789
859
  * @since 0.1.0
@@ -799,4 +869,4 @@ declare class CngxReducedMotion {
799
869
  }
800
870
 
801
871
  export { CNGX_AD_ITEM, CNGX_FOCUSABLE_SELECTOR, CngxActiveDescendant, CngxAriaExpanded, CngxAutofocus, CngxFocusRestore, CngxFocusTrap, CngxFocusVisible, CngxLiveAnnouncer, CngxLiveRegion, CngxReducedMotion, CngxRovingItem, CngxRovingTabindex };
802
- export type { ActiveDescendantItem, CngxAdItemHandle };
872
+ export type { ActiveDescendantItem, AriaLivePoliteness, CngxAdItemHandle };
@@ -53,20 +53,20 @@ interface CngxToneGenerator {
53
53
  * @since 0.1.0
54
54
  */
55
55
  interface ToneGeneratorDeps {
56
- /** Lazy getter for the shared context — called per tone so the engine controls resume. */
56
+ /** Lazy getter for the shared context - called per tone so the engine controls resume. */
57
57
  readonly context: () => BaseAudioContext;
58
58
  /** Node to connect each tone into (typically the engine's master-volume gain). */
59
59
  readonly destination: () => AudioNode;
60
60
  }
61
61
  /**
62
- * Signature of the tone-generator factory — the shape an override must match.
62
+ * Signature of the tone-generator factory - the shape an override must match.
63
63
  * @category common/audio
64
64
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/tone-generator/tone-generator.ts
65
65
  * @since 0.1.0
66
66
  */
67
67
  type CngxAudioToneGeneratorFactory = (deps: ToneGeneratorDeps) => CngxToneGenerator;
68
68
  /**
69
- * Pure `OscillatorNode` synthesis — no audio assets. Each tone is an
69
+ * Pure `OscillatorNode` synthesis - no audio assets. Each tone is an
70
70
  * oscillator through a per-note gain envelope (5 ms attack, 30 ms release)
71
71
  * into the engine's master-volume node. The envelope is not decoration: a
72
72
  * bare `start()`/`stop()` on a full-amplitude oscillator produces an audible
@@ -82,7 +82,7 @@ declare const createToneGenerator: CngxAudioToneGeneratorFactory;
82
82
  /**
83
83
  * Swappable tone-generator factory. Defaults to {@link createToneGenerator}
84
84
  * (oscillator synthesis). Override to swap in sample-based playback without
85
- * forking the engine — the documented second consumer of this boundary token.
85
+ * forking the engine - the documented second consumer of this boundary token.
86
86
  *
87
87
  * @relatedTo createToneGenerator, CNGX_AUDIO_ENGINE_FACTORY
88
88
  * @category common/audio
@@ -92,7 +92,7 @@ declare const createToneGenerator: CngxAudioToneGeneratorFactory;
92
92
  declare const CNGX_AUDIO_TONE_GENERATOR_FACTORY: InjectionToken<CngxAudioToneGeneratorFactory>;
93
93
 
94
94
  /**
95
- * A named earcon — an ordered sequence of tone steps.
95
+ * A named earcon - an ordered sequence of tone steps.
96
96
  * @category common/audio
97
97
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/earcons/default-earcons.ts
98
98
  * @since 0.1.0
@@ -124,7 +124,7 @@ interface CngxAudioConfig {
124
124
  readonly earcons: Readonly<Record<string, EarconConfig>>;
125
125
  }
126
126
  /**
127
- * Library defaults — English, browser-native.
127
+ * Library defaults - English, browser-native.
128
128
  * @category common/audio
129
129
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/config/audio-config.ts
130
130
  * @since 0.1.0
@@ -161,7 +161,7 @@ interface CngxAudioFeature {
161
161
  readonly _apply: (config: Partial<CngxAudioConfig>) => Partial<CngxAudioConfig>;
162
162
  }
163
163
  /**
164
- * Register global audio defaults. Mirrors `provideFeedback` — a single small
164
+ * Register global audio defaults. Mirrors `provideFeedback` - a single small
165
165
  * config object folded through `with*` features.
166
166
  *
167
167
  * ```ts
@@ -178,7 +178,7 @@ interface CngxAudioFeature {
178
178
  * Register this at **application bootstrap**. The shared engine is
179
179
  * `providedIn: 'root'` and reads its configuration once, when it is first built,
180
180
  * so config registered in a lazy route's `providers` never reaches it. To
181
- * configure a subtree, use `provideCngxAudioAt(...)` in `viewProviders` — it
181
+ * configure a subtree, use `provideCngxAudioAt(...)` in `viewProviders` - it
182
182
  * layers over this one and re-provides the engine so the scope actually applies.
183
183
  *
184
184
  * @category common/audio
@@ -232,7 +232,7 @@ declare function withDebounceMs(ms: number): CngxAudioFeature;
232
232
 
233
233
  /**
234
234
  * Lifecycle state of the shared `AudioContext`, surfaced for debug panels and
235
- * headless e2e. Mute is a separate `muted` signal — this tracks the context,
235
+ * headless e2e. Mute is a separate `muted` signal - this tracks the context,
236
236
  * not the play gate.
237
237
  * @category common/audio
238
238
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/engine/audio-engine.ts
@@ -264,7 +264,7 @@ interface CngxAudioEngine {
264
264
  /**
265
265
  * Play a registered earcon by name. Gated + debounced centrally here.
266
266
  * `scale` (a `[0, 1]` multiplier over the per-tone default) scales just this
267
- * play — used by the directives' per-element `audioVolume` without touching
267
+ * play - used by the directives' per-element `audioVolume` without touching
268
268
  * the shared master volume.
269
269
  */
270
270
  play(name: string, scale?: number): void;
@@ -294,7 +294,7 @@ interface CngxAudioEngine {
294
294
  readonly lastPlayed: Signal<string | null>;
295
295
  }
296
296
  /**
297
- * Signature of the engine factory — the shape a telemetry/audit override matches.
297
+ * Signature of the engine factory - the shape a telemetry/audit override matches.
298
298
  * @category common/audio
299
299
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/engine/audio-engine.ts
300
300
  * @since 0.1.0
@@ -321,7 +321,7 @@ type CngxAudioEngineFactory = (options?: AudioEngineOptions) => CngxAudioEngine;
321
321
  declare const createAudioEngine: CngxAudioEngineFactory;
322
322
  /**
323
323
  * Swappable engine factory. Defaults to {@link createAudioEngine}. Override to
324
- * wrap the engine with telemetry/audit logging — the documented second consumer
324
+ * wrap the engine with telemetry/audit logging - the documented second consumer
325
325
  * of this boundary token.
326
326
  *
327
327
  * Register the override at **application bootstrap**. The shared engine instance
@@ -341,7 +341,7 @@ declare const createAudioEngine: CngxAudioEngineFactory;
341
341
  declare const CNGX_AUDIO_ENGINE_FACTORY: InjectionToken<CngxAudioEngineFactory>;
342
342
 
343
343
  /**
344
- * The public audio handle — what {@link injectCngxAudio} returns.
344
+ * The public audio handle - what {@link injectCngxAudio} returns.
345
345
  *
346
346
  * An alias for {@link CngxAudioEngine} rather than a second interface: the two
347
347
  * contracts were member-for-member identical, so a separate declaration was
@@ -374,7 +374,7 @@ type CngxAudioHandle = CngxAudioEngine;
374
374
  */
375
375
  declare function injectCngxAudio(): CngxAudioHandle;
376
376
  /**
377
- * Component-scope audio config — place in a component's `viewProviders` so a
377
+ * Component-scope audio config - place in a component's `viewProviders` so a
378
378
  * subtree runs its own muted / volume / earcon set, independent of the app-wide
379
379
  * `provideCngxAudio(...)`.
380
380
  *
@@ -393,19 +393,19 @@ declare function injectCngxAudio(): CngxAudioHandle;
393
393
  * registered on a lazy route never reaches it.
394
394
  *
395
395
  * Features **layer over** the ancestor config (root, or an enclosing scope)
396
- * rather than replacing it — the `provideMenuConfigAt` pattern. Scalar fields
396
+ * rather than replacing it - the `provideMenuConfigAt` pattern. Scalar fields
397
397
  * (`muted`, `volume`, `debounceMs`, `respectReducedMotion`) override; `earcons`
398
398
  * merge, so a subtree adds or overrides individual earcons without dropping the
399
399
  * app-wide registry.
400
400
  *
401
401
  * The default shared engine is a single, process-global `AudioContext`; this
402
402
  * deliberately re-provides {@link CNGX_AUDIO_ENGINE} so the subtree gets an
403
- * **isolated engine** reading the scoped {@link CNGX_AUDIO_CONFIG} — a
403
+ * **isolated engine** reading the scoped {@link CNGX_AUDIO_CONFIG} - a
404
404
  * config-only override would be inert against the already-built root engine.
405
405
  * That engine owns a **second `AudioContext`**, created lazily on its first play
406
406
  * and closed with the component's `DestroyRef`. Browsers cap the number of live
407
407
  * `AudioContext`s, so reach for this only when a subtree genuinely needs an
408
- * independent audio scope — per-element `[audioVolume]` / `[audioDisabled]`
408
+ * independent audio scope - per-element `[audioVolume]` / `[audioDisabled]`
409
409
  * cover the common case without a second context.
410
410
  *
411
411
  * @category common/audio
@@ -416,7 +416,7 @@ declare function injectCngxAudio(): CngxAudioHandle;
416
416
  declare function provideCngxAudioAt(...features: CngxAudioFeature[]): Provider[];
417
417
 
418
418
  /**
419
- * A minimal `EventTarget` surface — only what the gate installs. Accepting
419
+ * A minimal `EventTarget` surface - only what the gate installs. Accepting
420
420
  * this narrow shape (rather than a concrete `Document`) keeps the factory
421
421
  * inject-free and trivially fakeable in a spec.
422
422
  * @category common/audio
@@ -433,7 +433,7 @@ type GestureEventTarget = Pick<EventTarget, 'addEventListener' | 'removeEventLis
433
433
  interface CngxAutoplayGate {
434
434
  /**
435
435
  * `true` once a user gesture (or an explicit {@link arm}) has satisfied the
436
- * browser autoplay policy. Derived from a single gesture event — never
436
+ * browser autoplay policy. Derived from a single gesture event - never
437
437
  * synced from multiple handlers.
438
438
  */
439
439
  readonly armed: Signal<boolean>;
@@ -447,14 +447,14 @@ interface CngxAutoplayGate {
447
447
  * `AudioContext`, honouring the browser autoplay policy without a permission
448
448
  * prompt.
449
449
  *
450
- * Pure factory — takes its `target` and `destroyRef` as arguments rather than
450
+ * Pure factory - takes its `target` and `destroyRef` as arguments rather than
451
451
  * calling `inject()`, so it composes inside the engine's injection context yet
452
452
  * stays testable with a fake target. No DI token: the gate has no independent
453
453
  * swap consumer (severity ladder `concern: over-abstraction`), so it ships
454
454
  * token-less and the engine owns it.
455
455
  *
456
456
  * @param deps.target The event target to listen on (typically the `Document`).
457
- * @param deps.destroyRef Cleanup owner — removes any surviving listeners on destroy.
457
+ * @param deps.destroyRef Cleanup owner - removes any surviving listeners on destroy.
458
458
  * @category common/audio
459
459
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/autoplay-gate/autoplay-gate.ts
460
460
  * @since 0.1.0
@@ -483,13 +483,13 @@ interface CngxDebouncer {
483
483
  /**
484
484
  * Per-name time-window debouncer: suppresses repeated fires of the same earcon
485
485
  * within `windowMs`. A separate composed factory rather than logic buried in
486
- * the engine (Pillar 3). Plain factory, no DI token — `withDebounceMs` covers
486
+ * the engine (Pillar 3). Plain factory, no DI token - `withDebounceMs` covers
487
487
  * configuration and there is no independent swap consumer.
488
488
  *
489
489
  * `windowMs` accepts a getter so a caller whose window is a reactive input can
490
490
  * hold ONE debouncer instance for its lifetime and still track changes: the
491
491
  * window is resolved per `shouldFire` call, not captured at construction. That
492
- * keeps the (stateful) debouncer out of the signal graph — minting one inside a
492
+ * keeps the (stateful) debouncer out of the signal graph - minting one inside a
493
493
  * `computed` would return a fresh object per evaluation and break the equality
494
494
  * rule. `CngxAudioPitch` is the getter consumer; the engine passes a number.
495
495
  *
@@ -509,7 +509,7 @@ declare function createDebouncer(options?: {
509
509
 
510
510
  /**
511
511
  * Event-mode audio binder. Maps DOM events on the host to earcons via the
512
- * `event:earcon` grammar — a pure DOM-event-to-sound directive with no state
512
+ * `event:earcon` grammar - a pure DOM-event-to-sound directive with no state
513
513
  * coupling (that is `[cngxAudioStatus]`'s job).
514
514
  *
515
515
  * ```html
@@ -574,7 +574,7 @@ declare class CngxAudio {
574
574
 
575
575
  /**
576
576
  * Status-mode audio bridge. Maps `CngxAsyncState` lifecycle transitions to
577
- * earcons via the `status:earcon` grammar — the audition counterpart of
577
+ * earcons via the `status:earcon` grammar - the audition counterpart of
578
578
  * `CngxToastOn`. Fires only on a real status transition, never on the initial
579
579
  * `idle`, and at most once per transition.
580
580
  *
@@ -589,7 +589,7 @@ declare class CngxAudio {
589
589
  *
590
590
  * The state source resolves the same way the feedback bridges do: an explicit
591
591
  * `[state]` input wins, otherwise it falls back to an ancestor's
592
- * `CNGX_STATEFUL`. The grammar keys are lifecycle statuses only — DOM-event
592
+ * `CNGX_STATEFUL`. The grammar keys are lifecycle statuses only - DOM-event
593
593
  * keys (`click`, `focus`, …) belong to `[cngxAudio]` and are rejected with a
594
594
  * dev-error. `succeeded`/`failed` are accepted as aliases for `success`/`error`.
595
595
  *
@@ -607,7 +607,7 @@ declare class CngxAudioStatus {
607
607
  /** The `status:earcon` grammar, e.g. `'pending:tap, succeeded:success'`. */
608
608
  readonly spec: _angular_core.InputSignal<string>;
609
609
  /**
610
- * The async state to watch. Optional — when omitted, the bridge falls back to
610
+ * The async state to watch. Optional - when omitted, the bridge falls back to
611
611
  * an ancestor `CNGX_STATEFUL`. A bare `[state]` attribute (empty string) is
612
612
  * treated as "no input bound" so the fallback kicks in.
613
613
  */
@@ -616,7 +616,7 @@ declare class CngxAudioStatus {
616
616
  readonly audioVolume: _angular_core.InputSignal<number | undefined>;
617
617
  /** Suppress this element's audio without unbinding. */
618
618
  readonly audioDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
619
- /** Effective state — explicit input wins over ancestor `CNGX_STATEFUL`. */
619
+ /** Effective state - explicit input wins over ancestor `CNGX_STATEFUL`. */
620
620
  private readonly effectiveState;
621
621
  private readonly bindings;
622
622
  constructor();
@@ -637,7 +637,7 @@ interface CngxAudioZoneBinding {
637
637
  }
638
638
  /**
639
639
  * Zone-mode audio binder. Plays earcons as the pointer or keyboard focus enters
640
- * and leaves the host — a spatial complement to `[cngxAudio]`. The record input
640
+ * and leaves the host - a spatial complement to `[cngxAudio]`. The record input
641
641
  * makes the four zone transitions explicit rather than encoding them in the
642
642
  * `event:earcon` string grammar, because the listener set (pointer/focus zone)
643
643
  * and the shape (record vs string) are semantically distinct from event-mode.
@@ -671,7 +671,7 @@ declare class CngxAudioZone {
671
671
  /**
672
672
  * `focusin`/`focusout` bubble, so a zone wrapping focusable children would
673
673
  * otherwise fire on every internal tab move. Only a crossing of the zone
674
- * boundary counts — the focus counterpart of pointerenter/pointerleave.
674
+ * boundary counts - the focus counterpart of pointerenter/pointerleave.
675
675
  */
676
676
  protected handleFocusCross(kind: 'focus' | 'blur', event: FocusEvent): void;
677
677
  protected handleZone(kind: keyof CngxAudioZoneBinding): void;
@@ -683,7 +683,7 @@ declare class CngxAudioZone {
683
683
  * Pitch-mode audio binder. Sonifies a continuous numeric value: each change of
684
684
  * `[cngxAudioPitch]` clamps against a fixed domain, linear-scales into an output
685
685
  * frequency range, and plays a short tone. Useful for sliders, gauges, and live
686
- * metrics — the ear tracks a value without looking.
686
+ * metrics - the ear tracks a value without looking.
687
687
  *
688
688
  * ```html
689
689
  * <input type="range" min="0" max="100"
@@ -693,7 +693,7 @@ declare class CngxAudioZone {
693
693
  * ```
694
694
  *
695
695
  * The inputs are discrete rather than an options record so `[cngxAudioPitch]`
696
- * stays a native reactive input — passing `[cngxAudioPitch]="volume()"` binds a
696
+ * stays a native reactive input - passing `[cngxAudioPitch]="volume()"` binds a
697
697
  * signal value directly, never a `Signal` smuggled inside a config object. The
698
698
  * domain is caller-supplied and fixed; it is never accumulated from observed
699
699
  * values, so the directive holds no hidden state. Value-to-frequency is a pure