@cngx/common 0.1.0-rc.3 → 0.1.0-rc.4
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.
- package/display/README.md +1 -0
- package/fesm2022/cngx-common-a11y.mjs +123 -3
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-card.mjs +8 -8
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +691 -52
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +320 -8
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +1603 -75
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +187 -3
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-popover.mjs +63 -8
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +1 -1
- package/interactive/README.md +101 -0
- package/layout/README.md +39 -1
- package/package.json +1 -1
- package/theming/components/cngx-accordion.css +147 -0
- package/theming/components/cngx-badge.css +6 -0
- package/theming/components/cngx-bottom-sheet.css +8 -1
- package/theming/components/cngx-breadcrumb.css +108 -0
- package/theming/components/cngx-button-toggle.css +6 -0
- package/theming/components/cngx-data-grid.css +154 -0
- package/theming/components/cngx-dialog.css +4 -0
- package/theming/components/cngx-divider.css +4 -0
- package/theming/components/cngx-listbox.css +6 -0
- package/theming/components/cngx-menu.css +7 -0
- package/theming/components/cngx-slider.css +237 -0
- package/theming/components/cngx-tooltip.css +6 -0
- package/types/cngx-common-a11y.d.ts +67 -2
- package/types/cngx-common-data.d.ts +444 -22
- package/types/cngx-common-display.d.ts +189 -1
- package/types/cngx-common-interactive.d.ts +1014 -31
- package/types/cngx-common-layout.d.ts +88 -3
- package/types/cngx-common-popover.d.ts +25 -4
package/display/README.md
CHANGED
|
@@ -7,6 +7,7 @@ Display-only atoms. Icons, avatars, badges, chips, tags, indicators, dividers -
|
|
|
7
7
|
You need a primitive visual piece that other components compose:
|
|
8
8
|
|
|
9
9
|
- An avatar that gracefully degrades from photo URL → initials → fallback.
|
|
10
|
+
- A stacked `CngxAvatarGroup` that overlaps avatars and collapses the extras past `[max]` into a `+N` overflow pill, with an `aria-label` summarising the hidden count.
|
|
10
11
|
- A chip the user can remove (used internally by multi-select, combobox, tag-input, filter-chips - and available to you for the same purpose).
|
|
11
12
|
- A tag pill that conveys status, category, or count - non-removable, theme-aware.
|
|
12
13
|
- A checkbox or radio glyph for a custom row design where you want the cngx look but own the selection logic yourself.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, Directive, inject, ElementRef, Injector, DestroyRef, afterNextRender, effect, signal, computed, model, contentChildren, InjectionToken, output } from '@angular/core';
|
|
3
|
-
import { DOCUMENT } from '@angular/common';
|
|
2
|
+
import { input, Directive, inject, PLATFORM_ID, Injectable, ElementRef, Injector, DestroyRef, afterNextRender, effect, signal, computed, model, contentChildren, InjectionToken, output } from '@angular/core';
|
|
3
|
+
import { DOCUMENT, isPlatformBrowser } from '@angular/common';
|
|
4
4
|
import { FocusTrapFactory } from '@angular/cdk/a11y';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -132,6 +132,102 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
132
132
|
}]
|
|
133
133
|
}], propDecorators: { politeness: [{ type: i0.Input, args: [{ isSignal: true, alias: "politeness", required: false }] }], atomic: [{ type: i0.Input, args: [{ isSignal: true, alias: "atomic", required: false }] }], relevant: [{ type: i0.Input, args: [{ isSignal: true, alias: "relevant", required: false }] }] } });
|
|
134
134
|
|
|
135
|
+
/**
|
|
136
|
+
* Imperative, reusable polite/assertive live-region announcer.
|
|
137
|
+
*
|
|
138
|
+
* The imperative counterpart to {@link CngxLiveRegion}: where the directive
|
|
139
|
+
* decorates an element you render (the content IS the announcement), this
|
|
140
|
+
* service owns a single visually-hidden `aria-live` element appended to
|
|
141
|
+
* `document.body` and exposes an `announce(message)` call for template-less
|
|
142
|
+
* directives and event handlers (e.g. `CngxCopyValue` copy success,
|
|
143
|
+
* `CngxOtpInput` completion).
|
|
144
|
+
*
|
|
145
|
+
* One root element is created lazily on the first announcement and reused for
|
|
146
|
+
* every subsequent call. The text is cleared and re-set on the next macrotask
|
|
147
|
+
* so an identical consecutive message is still re-read by the screen reader.
|
|
148
|
+
*
|
|
149
|
+
* SSR-safe: all DOM access is guarded by `isPlatformBrowser`; on the server
|
|
150
|
+
* `announce()` is a no-op and no element is created.
|
|
151
|
+
*
|
|
152
|
+
* ```typescript
|
|
153
|
+
* const announcer = inject(CngxLiveAnnouncer);
|
|
154
|
+
* announcer.announce('Copied');
|
|
155
|
+
* announcer.announce('Save failed', 'assertive');
|
|
156
|
+
* ```
|
|
157
|
+
*
|
|
158
|
+
* @category common/a11y
|
|
159
|
+
* @docsKind primary
|
|
160
|
+
* @wcag AA
|
|
161
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/aria/live-announcer.ts
|
|
162
|
+
* @since 0.1.0
|
|
163
|
+
* @relatedTo CngxLiveRegion
|
|
164
|
+
*/
|
|
165
|
+
class CngxLiveAnnouncer {
|
|
166
|
+
doc = inject(DOCUMENT);
|
|
167
|
+
isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
168
|
+
region = null;
|
|
169
|
+
pending = null;
|
|
170
|
+
/**
|
|
171
|
+
* Announces `message` through the shared live region.
|
|
172
|
+
*
|
|
173
|
+
* @param message Text read by the screen reader.
|
|
174
|
+
* @param politeness `'polite'` (default) queues after the current
|
|
175
|
+
* utterance; `'assertive'` interrupts immediately.
|
|
176
|
+
*/
|
|
177
|
+
announce(message, politeness = 'polite') {
|
|
178
|
+
if (!this.isBrowser) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
const region = this.ensureRegion();
|
|
182
|
+
region.setAttribute('aria-live', politeness);
|
|
183
|
+
// Clear first, then write on the next macrotask so repeating the same
|
|
184
|
+
// string still registers as a content change for the SR.
|
|
185
|
+
region.textContent = '';
|
|
186
|
+
if (this.pending !== null) {
|
|
187
|
+
clearTimeout(this.pending);
|
|
188
|
+
}
|
|
189
|
+
this.pending = setTimeout(() => {
|
|
190
|
+
region.textContent = message;
|
|
191
|
+
this.pending = null;
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
ngOnDestroy() {
|
|
195
|
+
if (this.pending !== null) {
|
|
196
|
+
clearTimeout(this.pending);
|
|
197
|
+
this.pending = null;
|
|
198
|
+
}
|
|
199
|
+
this.region?.remove();
|
|
200
|
+
this.region = null;
|
|
201
|
+
}
|
|
202
|
+
ensureRegion() {
|
|
203
|
+
if (this.region) {
|
|
204
|
+
return this.region;
|
|
205
|
+
}
|
|
206
|
+
const span = this.doc.createElement('span');
|
|
207
|
+
span.setAttribute('aria-live', 'polite');
|
|
208
|
+
span.setAttribute('aria-atomic', 'true');
|
|
209
|
+
span.className = 'cngx-sr-only';
|
|
210
|
+
span.style.position = 'absolute';
|
|
211
|
+
span.style.width = '1px';
|
|
212
|
+
span.style.height = '1px';
|
|
213
|
+
span.style.padding = '0';
|
|
214
|
+
span.style.margin = '-1px';
|
|
215
|
+
span.style.overflow = 'hidden';
|
|
216
|
+
span.style.clip = 'rect(0, 0, 0, 0)';
|
|
217
|
+
span.style.whiteSpace = 'nowrap';
|
|
218
|
+
span.style.border = '0';
|
|
219
|
+
this.doc.body.appendChild(span);
|
|
220
|
+
this.region = span;
|
|
221
|
+
return span;
|
|
222
|
+
}
|
|
223
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxLiveAnnouncer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
224
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxLiveAnnouncer, providedIn: 'root' });
|
|
225
|
+
}
|
|
226
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxLiveAnnouncer, decorators: [{
|
|
227
|
+
type: Injectable,
|
|
228
|
+
args: [{ providedIn: 'root' }]
|
|
229
|
+
}] });
|
|
230
|
+
|
|
135
231
|
/**
|
|
136
232
|
* Reactive autofocus for dynamically inserted elements.
|
|
137
233
|
*
|
|
@@ -631,6 +727,13 @@ class CngxRovingTabindex {
|
|
|
631
727
|
/** Host element for `data-cngx-recycle-index` queries in virtual mode. */
|
|
632
728
|
hostEl = inject((ElementRef));
|
|
633
729
|
pendingFocusState = signal(null, ...(ngDevMode ? [{ debugName: "pendingFocusState" }] : /* istanbul ignore next */ []));
|
|
730
|
+
/**
|
|
731
|
+
* Set true just before a navigation key (arrow / Home / End) moves focus to a
|
|
732
|
+
* new item, cleared by {@link consumeNavigationKey}. Transient handshake, not
|
|
733
|
+
* reactive state: consumer groups read it synchronously from the
|
|
734
|
+
* newly-focused leaf's `(focus)` handler.
|
|
735
|
+
*/
|
|
736
|
+
navigationKeyInFlight = false;
|
|
634
737
|
/**
|
|
635
738
|
* Index of the item that should receive focus but is not currently in the DOM.
|
|
636
739
|
* Non-null when virtual navigation targets an out-of-range item.
|
|
@@ -668,6 +771,19 @@ class CngxRovingTabindex {
|
|
|
668
771
|
clearPendingFocus() {
|
|
669
772
|
this.pendingFocusState.set(null);
|
|
670
773
|
}
|
|
774
|
+
/**
|
|
775
|
+
* Whether the last focus move was driven by a navigation key, consuming the
|
|
776
|
+
* flag so it reads `true` exactly once. Consumer groups (radio,
|
|
777
|
+
* button-toggle) call this from the newly-focused leaf's `(focus)` handler to
|
|
778
|
+
* decide whether to auto-select. The flag is set before `.focus()`, so it is
|
|
779
|
+
* already `true` when focus lands - this closes the one-press-behind race
|
|
780
|
+
* that a group's own `(keydown)` binding suffered (#135).
|
|
781
|
+
*/
|
|
782
|
+
consumeNavigationKey() {
|
|
783
|
+
const inFlight = this.navigationKeyInFlight;
|
|
784
|
+
this.navigationKeyInFlight = false;
|
|
785
|
+
return inFlight;
|
|
786
|
+
}
|
|
671
787
|
/**
|
|
672
788
|
* Handles arrow-key, Home, and End navigation within the group.
|
|
673
789
|
* Prevents default scrolling on arrow keys.
|
|
@@ -706,6 +822,10 @@ class CngxRovingTabindex {
|
|
|
706
822
|
if (nextIndex !== null && nextIndex !== currentActive) {
|
|
707
823
|
event.preventDefault();
|
|
708
824
|
this.activeIndex.set(nextIndex);
|
|
825
|
+
// Expose the navigation intent before focus moves, so the newly-focused
|
|
826
|
+
// leaf's (focus) handler reads an already-set fact instead of racing the
|
|
827
|
+
// group's own late (keydown) binding (#135).
|
|
828
|
+
this.navigationKeyInFlight = true;
|
|
709
829
|
if (isVirtual) {
|
|
710
830
|
this.focusVirtualItem(nextIndex);
|
|
711
831
|
}
|
|
@@ -1369,5 +1489,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1369
1489
|
* Generated bundle index. Do not edit.
|
|
1370
1490
|
*/
|
|
1371
1491
|
|
|
1372
|
-
export { CNGX_AD_ITEM, CNGX_FOCUSABLE_SELECTOR, CngxActiveDescendant, CngxAriaExpanded, CngxAutofocus, CngxFocusRestore, CngxFocusTrap, CngxFocusVisible, CngxLiveRegion, CngxReducedMotion, CngxRovingItem, CngxRovingTabindex };
|
|
1492
|
+
export { CNGX_AD_ITEM, CNGX_FOCUSABLE_SELECTOR, CngxActiveDescendant, CngxAriaExpanded, CngxAutofocus, CngxFocusRestore, CngxFocusTrap, CngxFocusVisible, CngxLiveAnnouncer, CngxLiveRegion, CngxReducedMotion, CngxRovingItem, CngxRovingTabindex };
|
|
1373
1493
|
//# sourceMappingURL=cngx-common-a11y.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cngx-common-a11y.mjs","sources":["../../../projects/common/a11y/aria/aria-expanded.directive.ts","../../../projects/common/a11y/aria/live-region.directive.ts","../../../projects/common/a11y/focus/autofocus.directive.ts","../../../projects/common/a11y/focus/focus-restore.directive.ts","../../../projects/common/a11y/focus/focus-trap.directive.ts","../../../projects/common/a11y/focus/focus-visible.directive.ts","../../../projects/common/a11y/roving/roving-tabindex.directive.ts","../../../projects/common/a11y/active-descendant/ad-item.token.ts","../../../projects/common/a11y/active-descendant/active-descendant.directive.ts","../../../projects/common/a11y/motion/reduced-motion.directive.ts","../../../projects/common/a11y/public-api.ts","../../../projects/common/a11y/cngx-common-a11y.ts"],"sourcesContent":["import { Directive, input } from '@angular/core';\n\n/**\n * Manages `aria-expanded` and optionally `aria-controls` on the host element.\n *\n * Pairs a disclosure trigger (button) with its controlled region via standard\n * WAI-ARIA attributes. Supports accordions, dropdowns, tree items, and any\n * disclosure pattern where a control toggles visibility of another element.\n *\n * Unlike manual `[attr.aria-expanded]` binding, this directive couples both\n * attributes (`aria-expanded` + `aria-controls`) in a single declaration,\n * preventing mismatches where one is set without the other.\n *\n * ### Simple disclosure\n * ```html\n * <button [cngxAriaExpanded]=\"open()\" [controls]=\"'panel-id'\" (click)=\"open.set(!open())\">\n * Toggle\n * </button>\n * <div id=\"panel-id\" role=\"region\" [hidden]=\"!open()\">Panel content</div>\n * ```\n *\n * ### Accordion with multiple panels\n * ```html\n * @for (panel of panels(); track panel.id) {\n * <button [cngxAriaExpanded]=\"panel.open\" [controls]=\"panel.id\" (click)=\"toggle(panel)\">\n * {{ panel.label }}\n * </button>\n * @if (panel.open) {\n * <div [id]=\"panel.id\" role=\"region\">{{ panel.content }}</div>\n * }\n * }\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/aria/aria-expanded.directive.ts\n * @since 0.1.0\n * @relatedTo CngxLiveRegion, CngxExpandable, CngxDisclosure\n * <example-url>http://localhost:4200/#/common/a11y/aria-expanded/accordion-multiple-panels</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/aria-expanded/disclosure-pattern</example-url>\n */\n@Directive({\n selector: '[cngxAriaExpanded]',\n exportAs: 'cngxAriaExpanded',\n standalone: true,\n host: {\n '[attr.aria-expanded]': 'expanded()',\n '[attr.aria-controls]': 'controls() ?? null',\n },\n})\nexport class CngxAriaExpanded {\n /** Whether the controlled element is currently expanded. Sets `aria-expanded`. */\n readonly expanded = input<boolean>(false, { alias: 'cngxAriaExpanded' });\n /** The `id` of the controlled element. Sets `aria-controls`. */\n readonly controls = input<string | undefined>(undefined);\n}\n","import { Directive, input } from '@angular/core';\n\n/**\n * Configures the host element as an ARIA live region.\n *\n * Screen readers monitor live regions and announce content changes automatically.\n * `polite` announcements are queued after the current utterance finishes;\n * `assertive` announcements interrupt immediately. `off` disables announcements.\n *\n * Sets `role=\"alert\"` for assertive regions and `role=\"status\"` for polite regions\n * via a host binding - no manual attribute wiring needed.\n *\n * Unlike CDK's `LiveAnnouncer` service (which creates a hidden DOM element and\n * requires imperative `announce()` calls), this directive decorates your own\n * element declaratively - the content you render IS the announcement.\n *\n * ### Status message\n * ```html\n * <div cngxLiveRegion [politeness]=\"'polite'\">\n * {{ statusMessage() }}\n * </div>\n * ```\n *\n * ### Form validation error (assertive)\n * ```html\n * <div cngxLiveRegion [politeness]=\"'assertive'\"\n * [style.color]=\"error() ? 'red' : 'transparent'\">\n * {{ error() }}\n * </div>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/aria/live-region.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAriaExpanded\n * <example-url>http://localhost:4200/#/common/a11y/live-region/form-validation-assertive-error-announcements</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/live-region/polite-vs-assertive</example-url>\n */\n@Directive({\n selector: '[cngxLiveRegion]',\n exportAs: 'cngxLiveRegion',\n standalone: true,\n host: {\n '[attr.aria-live]': 'politeness()',\n '[attr.aria-atomic]': 'atomic()',\n '[attr.aria-relevant]': 'relevant()',\n '[attr.role]':\n \"politeness() === 'off' ? null : politeness() === 'assertive' ? 'alert' : 'status'\",\n },\n})\nexport class CngxLiveRegion {\n /**\n * Controls the urgency of announcements.\n * - `'polite'` - queued after current speech (default)\n * - `'assertive'` - interrupts immediately\n * - `'off'` - no announcements\n */\n readonly politeness = input<'polite' | 'assertive' | 'off'>('polite');\n /** Whether the entire region should be announced as a whole. */\n readonly atomic = input<boolean>(true);\n /** Which types of content changes to announce. Space-separated: `additions`, `removals`, `text`. */\n readonly relevant = input<string>('additions text');\n}\n","import {\n afterNextRender,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n Injector,\n} from '@angular/core';\n\n/**\n * Reactive autofocus for dynamically inserted elements.\n *\n * The native `autofocus` HTML attribute only works on initial page load.\n * This directive handles dynamic content: dialogs, panels, stepper steps,\n * and any element that appears after the initial render.\n *\n * Focuses the host element after the next render frame using `afterNextRender`.\n * When `when` changes to `true`, focus is re-applied.\n *\n * ### Focus on insertion\n * ```html\n * @if (showSearch()) {\n * <input cngxAutofocus placeholder=\"Search…\" />\n * }\n * ```\n *\n * ### Conditional focus\n * ```html\n * <input [cngxAutofocus]=\"isActive()\" />\n * ```\n *\n * ### With delay for transitions\n * ```html\n * <input cngxAutofocus [autofocusDelay]=\"200\" />\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/focus/autofocus.directive.ts\n * @since 0.1.0\n * @relatedTo CngxFocusRestore, CngxFocusTrap, CngxFocusVisible\n * <example-url>http://localhost:4200/#/common/a11y/autofocus/conditional-focus</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/autofocus/focus-on-insert</example-url>\n */\n@Directive({\n selector: '[cngxAutofocus]',\n exportAs: 'cngxAutofocus',\n standalone: true,\n})\nexport class CngxAutofocus {\n /** Whether to focus the element. Defaults to `true` (always focus on render). */\n readonly when = input<boolean>(true, { alias: 'cngxAutofocus' });\n /** Delay in ms before focusing - useful when the element appears during a transition. */\n readonly delay = input<number>(0, { alias: 'autofocusDelay' });\n /** `FocusOptions` passed to `element.focus()`. */\n readonly options = input<FocusOptions>({}, { alias: 'autofocusOptions' });\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly injector = inject(Injector);\n private pendingTimer: ReturnType<typeof setTimeout> | null = null;\n private initialized = false;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.clearPending());\n\n afterNextRender(() => {\n if (this.when()) {\n this.scheduleFocus();\n }\n this.initialized = true;\n });\n\n // Re-focus on false→true transitions only; `previousWhen` starts as `true`\n // so the initial effect run does not double-trigger alongside afterNextRender.\n let previousWhen = true;\n effect(() => {\n const current = this.when();\n if (this.initialized && current && !previousWhen) {\n this.scheduleFocus();\n }\n previousWhen = current;\n });\n }\n\n private scheduleFocus(): void {\n this.clearPending();\n const delayMs = this.delay();\n if (delayMs > 0) {\n this.pendingTimer = setTimeout(() => this.applyFocus(), delayMs);\n } else {\n afterNextRender(() => this.applyFocus(), { injector: this.injector });\n }\n }\n\n private applyFocus(): void {\n (this.el.nativeElement as HTMLElement).focus(this.options());\n }\n\n private clearPending(): void {\n if (this.pendingTimer !== null) {\n clearTimeout(this.pendingTimer);\n this.pendingTimer = null;\n }\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, inject, input, signal } from '@angular/core';\n\n/**\n * CSS selector matching natively-focusable elements: links with an\n * `href`, the enabled form controls, and anything with an explicit\n * non-negative `tabindex`. Form controls carry `:not(:disabled)` because\n * a disabled control is not in the tab order - without it a descendant\n * probe would count a disabled button as focusable and a restore target\n * could land on an unfocusable element. Single source of truth for \"is\n * this focusable\" - the element-level {@link CngxFocusRestore} predicate\n * matches against it, and descendant probes (e.g. \"does this panel\n * contain a focusable child?\") query against it. Keeping one selector\n * stops the two uses from drifting apart.\n *\n * @category common/a11y\n * @since 0.1.0\n */\nexport const CNGX_FOCUSABLE_SELECTOR =\n 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * Stores the previously focused element and restores focus on destroy.\n *\n * Prevents focus from falling to `<body>` when dynamic content is removed\n * (dialogs closing, panels collapsing, tabs switching). The directive captures\n * `document.activeElement` at initialization time and restores it when the\n * host element is destroyed.\n *\n * Fallback chain: stored element → provided fallback → nearest focusable ancestor → body.\n *\n * ### Panel that restores focus on close\n * ```html\n * @if (panelOpen()) {\n * <div cngxFocusRestore>\n * Panel content…\n * <button (click)=\"panelOpen.set(false)\">Close</button>\n * </div>\n * }\n * ```\n *\n * ### With explicit fallback\n * ```html\n * <div cngxFocusRestore [focusRestoreFallback]=\"fallbackBtn\">\n * Dynamic content…\n * </div>\n * <button #fallbackBtn>Fallback target</button>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/focus/focus-restore.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAutofocus, CngxFocusTrap, CngxFocusVisible\n * <example-url>http://localhost:4200/#/common/a11y/focus-restore/inline-details</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/focus-restore/panel-with-automatic-restore</example-url>\n */\n@Directive({\n selector: '[cngxFocusRestore]',\n exportAs: 'cngxFocusRestore',\n standalone: true,\n})\nexport class CngxFocusRestore {\n /** Whether to restore focus when the host element is destroyed. */\n readonly restoreOnDestroy = input<boolean>(true);\n /** Explicit fallback element if the stored element is no longer in the DOM. */\n readonly fallback = input<HTMLElement | null>(null);\n\n private readonly doc = inject(DOCUMENT);\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly storedElement = signal<HTMLElement | null>(null);\n\n constructor() {\n const activeEl = this.doc.activeElement;\n if (activeEl instanceof HTMLElement) {\n this.storedElement.set(activeEl);\n }\n\n inject(DestroyRef).onDestroy(() => {\n if (!this.restoreOnDestroy()) {\n return;\n }\n\n const target = this.resolveTarget();\n if (target) {\n target.focus();\n }\n });\n }\n\n /** Manually store the current focus target for later restoration. */\n capture(): void {\n const activeEl = this.doc.activeElement;\n if (activeEl instanceof HTMLElement) {\n this.storedElement.set(activeEl);\n }\n }\n\n /** Manually restore focus to the stored element. */\n restore(): void {\n const target = this.resolveTarget();\n if (target) {\n target.focus();\n }\n }\n\n /**\n * Walks the fallback chain:\n * 1. Stored element (if still in DOM and not body/self)\n * 2. Explicit fallback input\n * 3. Nearest focusable ancestor\n */\n private resolveTarget(): HTMLElement | null {\n const stored = this.storedElement();\n // Skip body - it signals \"nothing meaningful was focused\", not a real restore target.\n if (\n stored &&\n stored !== this.doc.body &&\n this.doc.contains(stored) &&\n stored !== (this.el.nativeElement as HTMLElement)\n ) {\n return stored;\n }\n\n const fallback = this.fallback();\n if (fallback && this.doc.contains(fallback)) {\n return fallback;\n }\n\n return this.findFocusableAncestor();\n }\n\n /** Traverses up the DOM tree looking for the first natively focusable element. */\n private findFocusableAncestor(): HTMLElement | null {\n let current = (this.el.nativeElement as HTMLElement).parentElement;\n while (current) {\n if (this.isFocusable(current)) {\n return current;\n }\n current = current.parentElement;\n }\n return null;\n }\n\n /**\n * Checks if an element is natively focusable (tabindex, links, form\n * controls). Element-level predicate over the shared\n * {@link CNGX_FOCUSABLE_SELECTOR}, so it never drifts from the\n * descendant-query callers.\n */\n private isFocusable(el: HTMLElement): boolean {\n return el.matches(CNGX_FOCUSABLE_SELECTOR);\n }\n}\n","import { type FocusTrap, FocusTrapFactory } from '@angular/cdk/a11y';\nimport { computed, DestroyRef, Directive, effect, ElementRef, inject, input } from '@angular/core';\n\n/**\n * Traps keyboard focus within the host element using the CDK `FocusTrap`.\n *\n * When enabled, Tab and Shift+Tab cycle only within the host element's\n * focusable children. When `autoFocus` is `true` (default), focus moves to\n * the first tabbable element automatically on activation.\n *\n * Wraps CDK's `FocusTrapFactory` with a declarative, Signal-driven API.\n * The CDK's imperative `create()` / `destroy()` / `enabled` setter lifecycle\n * is handled internally via `effect()` and `DestroyRef`.\n *\n * ### Modal dialog\n * ```html\n * <div cngxFocusTrap [enabled]=\"isOpen()\" [autoFocus]=\"true\"\n * tabindex=\"-1\" role=\"dialog\" aria-modal=\"true\"\n * (keydown.escape)=\"isOpen.set(false)\">\n * <input placeholder=\"First input\" />\n * <button (click)=\"isOpen.set(false)\">Close</button>\n * </div>\n * ```\n *\n * ### Drawer / sidebar\n * ```html\n * <nav cngxFocusTrap [enabled]=\"drawerOpen()\" tabindex=\"-1\">\n * <a href=\"/home\">Home</a>\n * <a href=\"/settings\">Settings</a>\n * </nav>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/focus/focus-trap.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAutofocus, CngxFocusRestore, CngxDialog\n * <example-url>http://localhost:4200/#/common/a11y/focus-trap/modal-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/focus-trap/slide-out-drawer</example-url>\n */\n@Directive({\n selector: '[cngxFocusTrap]',\n exportAs: 'cngxFocusTrap',\n standalone: true,\n})\nexport class CngxFocusTrap {\n /** Whether the focus trap is active. When `false`, Tab navigates normally. */\n readonly enabled = input<boolean>(false);\n /** Whether to auto-focus the first tabbable element when the trap activates. */\n readonly autoFocus = input<boolean>(true);\n\n /** Computed signal reflecting the current trap state. */\n readonly isActive = computed(() => this.enabled());\n\n private readonly trap: FocusTrap;\n\n constructor() {\n const el = inject(ElementRef<HTMLElement>);\n this.trap = inject(FocusTrapFactory).create(el.nativeElement as HTMLElement);\n\n effect(() => {\n const enabled = this.enabled();\n this.trap.enabled = enabled;\n if (enabled && this.autoFocus()) {\n void this.trap.focusFirstTabbableElementWhenReady();\n }\n });\n\n inject(DestroyRef).onDestroy(() => this.trap.destroy());\n }\n\n /** Programmatically focus the first tabbable element within the trap. */\n focusFirst(): void {\n void this.trap.focusFirstTabbableElementWhenReady();\n }\n\n /** Programmatically focus the last tabbable element within the trap. */\n focusLast(): void {\n void this.trap.focusLastTabbableElementWhenReady();\n }\n}\n","import { Directive, signal } from '@angular/core';\n\n/**\n * Tracks keyboard-initiated focus on the host element.\n *\n * Adds `cngx-focus-visible` CSS class when the element receives focus via keyboard\n * and removes it on blur or when focus was initiated by pointer interaction.\n *\n *\n * ```html\n * <button cngxFocusVisible #fv=\"cngxFocusVisible\">\n * @if (fv.focusVisible()) { Focus ring visible }\n * </button>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/focus/focus-visible.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAutofocus, CngxFocusRestore, CngxFocusTrap\n * <example-url>http://localhost:4200/#/common/a11y/focus-visible/form-fields-custom-focus-ring</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/focus-visible/keyboard-vs-pointer</example-url>\n */\n@Directive({\n selector: '[cngxFocusVisible]',\n exportAs: 'cngxFocusVisible',\n standalone: true,\n host: {\n '(pointerdown)': 'pointerActive = true',\n '(focusin)': 'handleFocus()',\n '(focusout)': 'handleBlur()',\n '[class.cngx-focus-visible]': 'focusVisible()',\n },\n})\nexport class CngxFocusVisible {\n private readonly focusVisibleState = signal(false);\n /** `true` when focus was initiated via keyboard (not pointer). */\n readonly focusVisible = this.focusVisibleState.asReadonly();\n\n /** @internal Cleared on `focusin` after being set by `pointerdown`. */\n pointerActive = false;\n\n /** @internal Sets focus-visible state; clears pointer flag. */\n protected handleFocus(): void {\n this.focusVisibleState.set(!this.pointerActive);\n this.pointerActive = false;\n }\n\n /** @internal Clears focus-visible state on blur. */\n protected handleBlur(): void {\n this.focusVisibleState.set(false);\n }\n}\n","import {\n afterNextRender,\n contentChildren,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\n\n/**\n * Marker directive for items managed by `CngxRovingTabindex`.\n *\n * Place on each focusable child inside a `[cngxRovingTabindex]` container.\n * The roving tabindex controller sets `tabindex=\"0\"` on the active item\n * and `tabindex=\"-1\"` on all others.\n *\n * ```html\n * <div cngxRovingTabindex>\n * <button cngxRovingItem>One</button>\n * <button cngxRovingItem>Two</button>\n * <button cngxRovingItem>Three</button>\n * </div>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/roving/roving-tabindex.directive.ts\n * @since 0.1.0\n * @relatedTo CngxRovingTabindex, CngxButtonToggle\n * <example-url>http://localhost:4200/#/common/a11y/roving-tabindex/horizontal-toolbar</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/roving-tabindex/vertical-menu</example-url>\n */\n@Directive({\n selector: '[cngxRovingItem]',\n exportAs: 'cngxRovingItem',\n standalone: true,\n})\nexport class CngxRovingItem {\n /** @internal Reference used by the parent `CngxRovingTabindex` to set `tabindex`. */\n readonly elementRef = inject(ElementRef<HTMLElement>);\n\n /** Whether this item is disabled and should be skipped during navigation. */\n readonly disabled = input<boolean>(false, { alias: 'cngxRovingItemDisabled' });\n\n /** Programmatically focus this item. Called by the parent on arrow-key navigation. */\n focus(): void {\n (this.elementRef.nativeElement as HTMLElement).focus();\n }\n}\n\n/**\n * Implements the WAI-ARIA roving tabindex pattern for composite widgets.\n *\n * Only the active item in the group has `tabindex=\"0\"` - all others get\n * `tabindex=\"-1\"`. Arrow keys move focus within the group; Tab leaves it.\n * Home/End jump to first/last item.\n *\n * Works for toolbars, tab lists, card grids, menu bars, and any composite\n * widget where only one item should be in the tab order at a time.\n *\n * ### Virtual mode\n *\n * When `virtualCount` is set, `activeIndex` ranges from 0 to `virtualCount - 1`\n * instead of being bounded by `contentChildren.length`. Items are matched by\n * `data-cngx-recycle-index` attribute. When the target item is not in the DOM\n * (out of rendered range), `pendingFocus` is set so a wiring function like\n * `connectRecyclerToRoving()` can scroll it into view.\n *\n * ### Horizontal toolbar\n * ```html\n * <div cngxRovingTabindex orientation=\"horizontal\" #rv=\"cngxRovingTabindex\">\n * <button cngxRovingItem>Cut</button>\n * <button cngxRovingItem>Copy</button>\n * <button cngxRovingItem>Paste</button>\n * </div>\n * ```\n *\n * ### Vertical menu with controlled index\n * ```html\n * <ul cngxRovingTabindex orientation=\"vertical\" [(activeIndex)]=\"selectedIdx\">\n * @for (item of items(); track item.id) {\n * <li cngxRovingItem>{{ item.label }}</li>\n * }\n * </ul>\n * ```\n *\n * ### Virtual scroll integration\n * ```html\n * <div cngxRovingTabindex orientation=\"vertical\" [virtualCount]=\"recycler.ariaSetSize()\">\n * @for (item of visibleItems(); track item.id; let i = $index) {\n * <div cngxRovingItem [cngxVirtualItem]=\"recycler\" [cngxVirtualItemIndex]=\"recycler.start() + i\">\n * {{ item.name }}\n * </div>\n * }\n * </div>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/roving/roving-tabindex.directive.ts\n * @since 0.1.0\n * @relatedTo CngxRovingItem, CngxActiveDescendant\n * <example-url>http://localhost:4200/#/common/a11y/roving-tabindex/horizontal-toolbar</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/roving-tabindex/vertical-menu</example-url>\n */\n@Directive({\n selector: '[cngxRovingTabindex]',\n exportAs: 'cngxRovingTabindex',\n standalone: true,\n host: {\n '(keydown)': 'handleKeyDown($event)',\n },\n})\nexport class CngxRovingTabindex {\n /**\n * Arrow key navigation axis. `'both'` enables both horizontal and\n * vertical arrows. Exposed as a `model` so composite hosts (e.g.\n * `CngxRadioGroup`, where the keyboard axis must always be `'both'`\n * per WAI-ARIA APG regardless of the cosmetic group orientation) can\n * override it from their own constructor.\n */\n readonly orientation = model<'horizontal' | 'vertical' | 'both'>('horizontal');\n /** Whether navigation wraps from last to first and vice versa. */\n readonly loop = input<boolean>(true);\n /** Index of the currently active (focusable) item. Supports two-way `[(activeIndex)]` binding. */\n readonly activeIndex = model<number>(0);\n\n /**\n * Total item count for virtual mode. When set, `activeIndex` ranges from 0 to\n * `virtualCount - 1` and items are matched by `data-cngx-recycle-index` attribute.\n * When not set, standard `contentChildren`-based navigation is used.\n */\n readonly virtualCount = input<number | undefined>(undefined);\n\n /** All `CngxRovingItem` children discovered via `contentChildren`. */\n private readonly items = contentChildren(CngxRovingItem);\n\n /** Guards against setting `tabindex` before the DOM is ready. */\n private readonly initialized = signal(false);\n\n /** Host element for `data-cngx-recycle-index` queries in virtual mode. */\n private readonly hostEl = inject(ElementRef<HTMLElement>);\n\n private readonly pendingFocusState = signal<number | null>(null);\n\n /**\n * Index of the item that should receive focus but is not currently in the DOM.\n * Non-null when virtual navigation targets an out-of-range item.\n * Used by `connectRecyclerToRoving()` to scroll the item into view and focus it.\n */\n readonly pendingFocus = this.pendingFocusState.asReadonly();\n\n constructor() {\n afterNextRender(() => this.initialized.set(true));\n\n effect(() => {\n if (!this.initialized()) {\n return;\n }\n const items = this.items();\n const active = this.activeIndex();\n const vc = this.virtualCount();\n\n if (vc != null) {\n // Virtual mode: match by data-cngx-recycle-index attribute\n items.forEach((item) => {\n const el = item.elementRef.nativeElement as HTMLElement;\n const idx = el.dataset['cngxRecycleIndex'];\n el.setAttribute('tabindex', idx != null && Number(idx) === active ? '0' : '-1');\n });\n } else {\n // Standard mode: match by array index\n const clamped = Math.max(0, Math.min(active, items.length - 1));\n items.forEach((item, i) =>\n (item.elementRef.nativeElement as HTMLElement).setAttribute(\n 'tabindex',\n i === clamped ? '0' : '-1',\n ),\n );\n }\n });\n }\n\n /**\n * Clears the pending focus target. Called by `connectRecyclerToRoving()`\n * after the item has been scrolled into view and focused.\n */\n clearPendingFocus(): void {\n this.pendingFocusState.set(null);\n }\n\n /**\n * Handles arrow-key, Home, and End navigation within the group.\n * Prevents default scrolling on arrow keys.\n *\n * Unified handler - delegates to virtual or contentChildren navigation\n * based on whether `virtualCount` is set.\n */\n protected handleKeyDown(event: KeyboardEvent): void {\n const vc = this.virtualCount();\n const allItems = this.items();\n const isVirtual = vc != null;\n const total = isVirtual ? vc : allItems.length;\n\n if (total === 0) {\n return;\n }\n if (!isVirtual && this.enabledItems().length === 0) {\n return;\n }\n\n const currentActive = this.activeIndex();\n const navigate = (direction: 1 | -1): number | null =>\n isVirtual\n ? this.findNextVirtual(currentActive, total, direction)\n : this.findNext(currentActive, allItems, direction);\n\n const keyMap: Record<string, () => number | null> = {\n ArrowRight: () => (this.isHorizontal() ? navigate(1) : null),\n ArrowLeft: () => (this.isHorizontal() ? navigate(-1) : null),\n ArrowDown: () => (this.isVertical() ? navigate(1) : null),\n ArrowUp: () => (this.isVertical() ? navigate(-1) : null),\n Home: () => (isVirtual ? 0 : this.findFirst(allItems)),\n End: () => (isVirtual ? total - 1 : this.findLast(allItems)),\n };\n\n const handler = keyMap[event.key];\n if (!handler) {\n return;\n }\n\n const nextIndex = handler();\n if (nextIndex !== null && nextIndex !== currentActive) {\n event.preventDefault();\n this.activeIndex.set(nextIndex);\n if (isVirtual) {\n this.focusVirtualItem(nextIndex);\n } else {\n allItems[nextIndex].focus();\n }\n } else if (nextIndex === currentActive) {\n event.preventDefault();\n }\n }\n\n /**\n * Attempts to focus a virtual item by querying `data-cngx-recycle-index`.\n * If the element is not in the DOM, sets `pendingFocus` for external resolution.\n */\n private focusVirtualItem(index: number): void {\n const el = (this.hostEl.nativeElement as HTMLElement).querySelector(\n `[data-cngx-recycle-index=\"${index}\"]`,\n );\n if (el instanceof HTMLElement) {\n el.focus();\n this.pendingFocusState.set(null);\n } else {\n this.pendingFocusState.set(index);\n }\n }\n\n /**\n * Finds the next index in virtual mode. No disabled-item skipping - can't check\n * disabled state of items not in the DOM.\n */\n private findNextVirtual(current: number, total: number, direction: 1 | -1): number | null {\n if (total === 0) {\n return null;\n }\n const idx = current + direction;\n if (this.loop()) {\n return ((idx % total) + total) % total;\n }\n if (idx < 0 || idx >= total) {\n return null;\n }\n return idx;\n }\n\n private enabledItems(): readonly CngxRovingItem[] {\n return this.items().filter((item) => !item.disabled());\n }\n\n private isHorizontal(): boolean {\n const o = this.orientation();\n return o === 'horizontal' || o === 'both';\n }\n\n private isVertical(): boolean {\n const o = this.orientation();\n return o === 'vertical' || o === 'both';\n }\n\n /**\n * Searches for the next enabled item starting from `current + direction`.\n * Respects `loop` - wraps around or stops at the boundary.\n * Skips disabled items.\n */\n private findNext(\n current: number,\n items: readonly CngxRovingItem[],\n direction: 1 | -1,\n ): number | null {\n const len = items.length;\n if (len === 0) {\n return null;\n }\n\n let idx = current + direction;\n const loop = this.loop();\n\n for (let i = 0; i < len; i++) {\n if (loop) {\n idx = ((idx % len) + len) % len;\n } else if (idx < 0 || idx >= len) {\n return null;\n }\n\n if (!items[idx].disabled()) {\n return idx;\n }\n idx += direction;\n }\n\n return null;\n }\n\n private findFirst(items: readonly CngxRovingItem[]): number | null {\n const idx = items.findIndex((item) => !item.disabled());\n return idx >= 0 ? idx : null;\n }\n\n private findLast(items: readonly CngxRovingItem[]): number | null {\n for (let i = items.length - 1; i >= 0; i--) {\n if (!items[i].disabled()) {\n return i;\n }\n }\n return null;\n }\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * Descriptor of an item managed by `CngxActiveDescendant`.\n *\n * `id` must be unique and stable across change detection runs (use `nextUid()`\n * from `@cngx/core/utils`). `label` is used by typeahead matching.\n *\n * @category common/a11y\n */\nexport interface ActiveDescendantItem {\n /** Unique DOM `id` on the element - required for `aria-activedescendant`. */\n readonly id: string;\n /** Opaque value emitted on `activated`. Compared with `Object.is` by default. */\n readonly value: unknown;\n /** Human-readable text used by typeahead. Falls back to empty string. */\n readonly label: string;\n /** Disabled items are skipped during navigation when `skipDisabled` is true. */\n readonly disabled?: boolean;\n}\n\n/**\n * DI token for content-projected items that should register with the\n * surrounding `CngxActiveDescendant`.\n *\n * Consumers like `CngxOption` and `CngxMenuItem` expose themselves via:\n *\n * ```typescript\n * providers: [{ provide: CNGX_AD_ITEM, useExisting: MyItem }]\n * ```\n *\n * The contained directive must expose `id`, `value`, `label`, and optionally\n * `disabled` as signals - the AD reads them reactively.\n *\n * @category common/a11y\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/active-descendant/ad-item.token.ts\n * @since 0.1.0\n */\nexport const CNGX_AD_ITEM = new InjectionToken<CngxAdItemHandle>('CNGX_AD_ITEM');\n\n/**\n * Minimum shape an AD-registered directive must expose.\n *\n * The shape is signal-based so the AD recomputes when any field changes.\n *\n * @category common/a11y\n */\nexport interface CngxAdItemHandle {\n readonly id: string;\n readonly value: Signal<unknown>;\n /**\n * Label accessor. Typically a signal, but may be a plain getter when the\n * label derives from runtime DOM state (e.g. `textContent` fallback).\n */\n readonly label: Signal<string> | (() => string);\n readonly disabled?: Signal<boolean>;\n}\n","import {\n afterNextRender,\n computed,\n contentChildren,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nimport { CNGX_AD_ITEM, type ActiveDescendantItem, type CngxAdItemHandle } from './ad-item.token';\n\n/**\n * WAI-ARIA active-descendant pattern. Focus stays on the host; the active\n * option is reported via `aria-activedescendant`.\n *\n * ### When to use this vs. `CngxRovingTabindex`\n *\n * - **Active-descendant** when focus stays on one container (listbox, menu,\n * combobox input) and items must not be tab-stops. Screen readers announce\n * the referenced option while the focus ring stays on the host.\n * - **Roving tabindex** when items themselves are tab-stops (toolbar, tab\n * list, grid cells). See `CngxRovingTabindex`.\n *\n * ### Item registration\n *\n * Items register either by providing `CNGX_AD_ITEM` via `hostDirectives` /\n * `providers`, or by passing a `Signal<ActiveDescendantItem[]>` through the\n * `items` input. The `items` input wins when both are present; use it when\n * items come from a dynamic data source.\n *\n * ### Virtualization\n *\n * When `virtualCount` is set, navigation can address indices not currently\n * in the DOM. `pendingHighlight` tells the consumer to scroll the missing\n * item into view; the consumer calls `clearPendingHighlight()` afterwards.\n *\n * ### Material/CDK equivalent\n *\n * Same model as `cdk-listbox` and `mat-select`, without the visual shell and\n * driven by signals instead of `ListKeyManager`.\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/active-descendant/active-descendant.directive.ts\n * @since 0.1.0\n * @relatedTo CngxRovingTabindex, CngxListbox, CngxMenu\n * <example-url>http://localhost:4200/#/common/a11y/active-descendant/listbox-with-items-input</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/active-descendant/typeahead</example-url>\n */\n@Directive({\n selector: '[cngxActiveDescendant]',\n exportAs: 'cngxActiveDescendant',\n standalone: true,\n host: {\n '[attr.aria-activedescendant]': 'activeId()',\n '(keydown)': 'handleKeydown($event)',\n },\n})\nexport class CngxActiveDescendant {\n /**\n * Optional explicit item list. When provided, takes precedence over items\n * registered via `CNGX_AD_ITEM`. Useful for combobox-style consumers that\n * drive the menu from a dynamic data source - pass the unwrapped array\n * (typically the result of a `computed()`), Angular's signal inputs make it\n * reactive automatically.\n */\n readonly items = input<ActiveDescendantItem[] | undefined>(undefined);\n\n /** Arrow-key navigation axis. Defaults to `'vertical'` (listbox/menu style). */\n readonly orientation = input<'vertical' | 'horizontal'>('vertical');\n /** Whether navigation wraps from last to first and vice versa. */\n readonly loop = input<boolean>(true);\n /** Whether alphanumeric typeahead navigation is enabled. */\n readonly typeahead = input<boolean>(true);\n /** Buffer reset window for typeahead, in milliseconds. */\n readonly typeaheadDebounce = input<number>(300);\n /** Whether the first non-disabled item is highlighted automatically. */\n readonly autoHighlightFirst = input<boolean>(false);\n /** Whether disabled items are skipped during navigation and value lookup. */\n readonly skipDisabled = input<boolean>(true);\n /**\n * When set, navigation treats the range `[0, virtualCount)` as the item\n * space even if only a subset is rendered. Targets outside the rendered\n * range surface as `pendingHighlight` for scroll-and-retry protocols.\n */\n readonly virtualCount = input<number | undefined>(undefined);\n\n /** Emitted when `activateCurrent()` is called with an active item. */\n readonly activated = output<unknown>();\n /** Emitted whenever the highlighted item changes. */\n readonly highlighted = output<ActiveDescendantItem | null>();\n\n private readonly hostEl = inject(ElementRef<HTMLElement>);\n private readonly registered = contentChildren(CNGX_AD_ITEM, { descendants: true });\n\n /** Guards host attribute writes until after first render. */\n private readonly initialized = signal(false);\n\n /** -1 means \"no active item\". Range is [0, resolvedItems().length). */\n private readonly activeIndexState = signal<number>(-1);\n\n /** Index of an item that should be highlighted but is not in the DOM. */\n private readonly pendingHighlightState = signal<number | null>(null);\n readonly pendingHighlight = this.pendingHighlightState.asReadonly();\n\n /**\n * Resolved item list. Input `items` wins; otherwise the contentChildren\n * handles are projected into `ActiveDescendantItem` shape.\n */\n readonly resolvedItems = computed<ActiveDescendantItem[]>(() => {\n const explicit = this.items();\n if (explicit) {\n return explicit;\n }\n return this.registered().map(handleToItem);\n });\n\n /** Current active index. `-1` when no item is highlighted. */\n readonly activeIndex = computed<number>(() => {\n const idx = this.activeIndexState();\n const total = this.totalCount();\n if (idx < 0 || idx >= total) {\n return -1;\n }\n return idx;\n });\n\n /**\n * `activeIndex` always mapped back to an item. `null` when no active index\n * or the item is out of rendered range (virtual mode).\n */\n readonly activeItem = computed<ActiveDescendantItem | null>(() => {\n const idx = this.activeIndex();\n if (idx < 0) {\n return null;\n }\n const list = this.resolvedItems();\n return list[idx] ?? null;\n });\n\n readonly activeId = computed<string | null>(() => this.activeItem()?.id ?? null);\n readonly activeValue = computed<unknown>(() => this.activeItem()?.value ?? null);\n\n private readonly typeaheadBuffer = signal<string>('');\n private typeaheadTimer: ReturnType<typeof setTimeout> | null = null;\n\n constructor() {\n afterNextRender(() => this.initialized.set(true));\n\n effect(() => {\n if (!this.initialized()) {\n return;\n }\n if (this.autoHighlightFirst() && this.activeIndexState() === -1) {\n this.highlightFirst();\n }\n });\n\n effect(() => {\n this.highlighted.emit(this.activeItem());\n });\n\n effect(() => {\n const idx = this.activeIndex();\n if (idx < 0) {\n return;\n }\n if (this.virtualCount() != null) {\n if (!this.isRendered(idx)) {\n this.pendingHighlightState.set(idx);\n return;\n }\n this.pendingHighlightState.set(null);\n }\n queueMicrotask(() => this.scrollActiveIntoView());\n });\n\n inject(DestroyRef).onDestroy(() => {\n if (this.typeaheadTimer !== null) {\n clearTimeout(this.typeaheadTimer);\n }\n });\n }\n\n highlightNext(): void {\n const next = this.findFrom(this.activeIndexState(), 1);\n if (next !== null) {\n this.activeIndexState.set(next);\n }\n }\n\n highlightPrev(): void {\n const next = this.findFrom(this.activeIndexState(), -1);\n if (next !== null) {\n this.activeIndexState.set(next);\n }\n }\n\n highlightFirst(): void {\n const first = this.findBoundary(1);\n if (first !== null) {\n this.activeIndexState.set(first);\n }\n }\n\n highlightLast(): void {\n const last = this.findBoundary(-1);\n if (last !== null) {\n this.activeIndexState.set(last);\n }\n }\n\n /**\n * Highlight by zero-based index. Out-of-range indices are ignored.\n * Disabled items are rejected when `skipDisabled()` is true.\n */\n highlightByIndex(index: number): void {\n const total = this.totalCount();\n if (index < 0 || index >= total) {\n return;\n }\n if (this.skipDisabled() && this.isDisabledAt(index)) {\n return;\n }\n this.activeIndexState.set(index);\n }\n\n /**\n * Highlight the first item whose value matches (via `Object.is`). No-op if\n * no match. Disabled items are rejected when `skipDisabled()` is true.\n */\n highlightByValue(value: unknown): void {\n const items = this.resolvedItems();\n const idx = items.findIndex((it) => Object.is(it.value, value));\n if (idx < 0) {\n return;\n }\n if (this.skipDisabled() && items[idx].disabled) {\n return;\n }\n this.activeIndexState.set(idx);\n }\n\n /** Clear the highlight. */\n resetHighlight(): void {\n this.activeIndexState.set(-1);\n }\n\n /** Emit `activated` with the current item's value. No-op if nothing active. */\n activateCurrent(): void {\n const item = this.activeItem();\n if (item) {\n this.activated.emit(item.value);\n }\n }\n\n /** Called by recycler bridges after scrolling the pending index into view. */\n clearPendingHighlight(): void {\n this.pendingHighlightState.set(null);\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n // Skip events from editable descendants. Without this, every\n // printable key typed into a descendant <input> hits AD's typeahead\n // branch, gets preventDefault'd, and never reaches the input.\n const target = event.target as HTMLElement | null;\n if (target && target !== event.currentTarget && isEditableTarget(target)) {\n return;\n }\n\n const key = event.key;\n\n if (this.isNavKey(key)) {\n const before = this.activeIndexState();\n this.dispatchNav(key);\n if (this.activeIndexState() !== before) {\n event.preventDefault();\n }\n return;\n }\n\n if (key === 'Enter' || key === ' ') {\n if (this.activeItem()) {\n event.preventDefault();\n this.activateCurrent();\n }\n return;\n }\n\n if (this.typeahead() && isPrintableChar(key)) {\n event.preventDefault();\n this.handleTypeahead(key);\n }\n }\n\n private isNavKey(key: string): boolean {\n switch (key) {\n case 'ArrowDown':\n case 'ArrowUp':\n case 'ArrowLeft':\n case 'ArrowRight':\n case 'Home':\n case 'End':\n return true;\n default:\n return false;\n }\n }\n\n private dispatchNav(key: string): void {\n const orientation = this.orientation();\n switch (key) {\n case 'ArrowDown':\n if (orientation === 'vertical') {\n this.highlightNext();\n }\n return;\n case 'ArrowUp':\n if (orientation === 'vertical') {\n this.highlightPrev();\n }\n return;\n case 'ArrowRight':\n if (orientation === 'horizontal') {\n this.highlightNext();\n }\n return;\n case 'ArrowLeft':\n if (orientation === 'horizontal') {\n this.highlightPrev();\n }\n return;\n case 'Home':\n this.highlightFirst();\n return;\n case 'End':\n this.highlightLast();\n return;\n }\n }\n\n /**\n * Push a printable character into the typeahead buffer and jump to the next\n * matching option. Exposed for external keyboard hosts (e.g. a select\n * trigger) that keep focus on themselves while using active-descendant\n * semantics on a separate listbox.\n *\n * Consumers should only forward single-character printable keys (`length === 1`,\n * non-whitespace). Navigation keys and non-printables must not be forwarded.\n */\n typeaheadChar(ch: string): void {\n if (!this.typeahead()) {\n return;\n }\n this.handleTypeahead(ch);\n }\n\n private handleTypeahead(ch: string): void {\n const next = this.typeaheadBuffer() + ch.toLowerCase();\n this.typeaheadBuffer.set(next);\n\n if (this.typeaheadTimer !== null) {\n clearTimeout(this.typeaheadTimer);\n }\n this.typeaheadTimer = setTimeout(() => {\n this.typeaheadBuffer.set('');\n this.typeaheadTimer = null;\n }, this.typeaheadDebounce());\n\n const items = this.resolvedItems();\n const skip = this.skipDisabled();\n const start = Math.max(0, this.activeIndexState());\n const total = items.length;\n for (let offset = 0; offset < total; offset++) {\n const i = (start + offset) % total;\n const candidate = items[i];\n if (skip && candidate.disabled) {\n continue;\n }\n if (candidate.label.toLowerCase().startsWith(next)) {\n this.activeIndexState.set(i);\n return;\n }\n }\n }\n\n private findFrom(current: number, direction: 1 | -1): number | null {\n const total = this.totalCount();\n if (total === 0) {\n return null;\n }\n const items = this.resolvedItems();\n const skip = this.skipDisabled();\n const loop = this.loop();\n\n let idx = current < 0 ? (direction === 1 ? -1 : total) : current;\n for (let step = 0; step < total; step++) {\n idx += direction;\n if (idx < 0 || idx >= total) {\n if (!loop) {\n return null;\n }\n idx = ((idx % total) + total) % total;\n }\n if (!skip || !items[idx]?.disabled) {\n return idx;\n }\n }\n return null;\n }\n\n private findBoundary(direction: 1 | -1): number | null {\n const items = this.resolvedItems();\n const total = items.length;\n if (total === 0) {\n return null;\n }\n const skip = this.skipDisabled();\n if (direction === 1) {\n for (let i = 0; i < total; i++) {\n if (!skip || !items[i].disabled) {\n return i;\n }\n }\n } else {\n for (let i = total - 1; i >= 0; i--) {\n if (!skip || !items[i].disabled) {\n return i;\n }\n }\n }\n return null;\n }\n\n private totalCount(): number {\n const vc = this.virtualCount();\n if (vc != null) {\n return vc;\n }\n return this.resolvedItems().length;\n }\n\n private isDisabledAt(index: number): boolean {\n const items = this.resolvedItems();\n return !!items[index]?.disabled;\n }\n\n private isRendered(index: number): boolean {\n const items = this.resolvedItems();\n return index >= 0 && index < items.length && !!items[index];\n }\n\n private scrollActiveIntoView(): void {\n const id = this.activeId();\n if (!id) {\n return;\n }\n const el = (this.hostEl.nativeElement as HTMLElement).querySelector(`#${cssEscape(id)}`);\n if (el instanceof HTMLElement && typeof el.scrollIntoView === 'function') {\n el.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }\n }\n}\n\n/** @internal */\nfunction handleToItem(handle: CngxAdItemHandle): ActiveDescendantItem {\n return {\n id: handle.id,\n value: handle.value(),\n label: handle.label(),\n disabled: handle.disabled?.() ?? false,\n };\n}\n\n/** @internal */\nfunction isPrintableChar(key: string): boolean {\n return key.length === 1 && /\\S/.exec(key) !== null;\n}\n\n/**\n * True when the element would capture text input natively - a text\n * `<input>`, `<textarea>`, or any `contenteditable` host. Read-only /\n * button-type inputs (submit, radio, checkbox) are NOT editable; AD's\n * keyboard navigation still applies when focus lands on them.\n *\n * @internal\n */\nfunction isEditableTarget(el: HTMLElement): boolean {\n if (el.isContentEditable) {\n return true;\n }\n const tag = el.tagName;\n if (tag === 'TEXTAREA') {\n return true;\n }\n if (tag === 'INPUT') {\n const type = (el as HTMLInputElement).type.toLowerCase();\n return (\n type !== 'button' &&\n type !== 'submit' &&\n type !== 'reset' &&\n type !== 'checkbox' &&\n type !== 'radio' &&\n type !== 'range' &&\n type !== 'color' &&\n type !== 'file' &&\n type !== 'image'\n );\n }\n return false;\n}\n\n/** @internal */\nfunction cssEscape(id: string): string {\n const api = (globalThis as { CSS?: { escape?: (s: string) => string } }).CSS;\n if (api && typeof api.escape === 'function') {\n return api.escape(id);\n }\n return id.replace(/[^a-zA-Z0-9_-]/g, (m) => `\\\\${m}`);\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, inject, signal, type Signal } from '@angular/core';\n\n/**\n * Reflects the user's `prefers-reduced-motion` media query as a reactive signal.\n *\n * Adds the `cngx-reduced-motion` CSS class to the host when the user prefers\n * reduced motion. The `prefersReducedMotion()` signal updates live when the\n * OS preference changes - use it in TypeScript to skip animations, disable\n * auto-playing media, or choose between animated and instant transitions.\n *\n * Unlike a CSS-only `@media (prefers-reduced-motion: reduce)` approach, this\n * directive makes the preference available in component logic (e.g., to pick\n * a different animation strategy or suppress requestAnimationFrame loops).\n *\n * ### Conditional animation\n * ```html\n * <div cngxReducedMotion #rm=\"cngxReducedMotion\"\n * [style.animation]=\"rm.prefersReducedMotion() ? 'none' : 'spin 2s linear infinite'\">\n * </div>\n * ```\n *\n * ### TypeScript logic\n * ```typescript\n * readonly rm = viewChild(CngxReducedMotion);\n * readonly duration = computed(() => this.rm()?.prefersReducedMotion() ? 0 : 300);\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/motion/reduced-motion.directive.ts\n * @since 0.1.0\n * <example-url>http://localhost:4200/#/common/a11y/reduced-motion/animation-toggle</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/reduced-motion/toast-notifications-motion-aware</example-url>\n */\n@Directive({\n selector: '[cngxReducedMotion]',\n exportAs: 'cngxReducedMotion',\n standalone: true,\n host: { '[class.cngx-reduced-motion]': 'prefersReducedMotion()' },\n})\nexport class CngxReducedMotion {\n /** `true` when the user's OS is set to prefer reduced motion. Updates reactively. */\n readonly prefersReducedMotion: Signal<boolean>;\n\n constructor() {\n const win = inject(DOCUMENT).defaultView;\n const pref = signal(false);\n\n if (win) {\n const mq = win.matchMedia('(prefers-reduced-motion: reduce)');\n pref.set(mq.matches);\n const listener = (e: MediaQueryListEvent) => pref.set(e.matches);\n mq.addEventListener('change', listener);\n inject(DestroyRef).onDestroy(() => mq.removeEventListener('change', listener));\n }\n\n this.prefersReducedMotion = pref.asReadonly();\n }\n}\n","/**\n * @module @cngx/common/a11y\n */\nexport { CngxAriaExpanded } from './aria/aria-expanded.directive';\nexport { CngxLiveRegion } from './aria/live-region.directive';\nexport { CngxAutofocus } from './focus/autofocus.directive';\nexport {\n CngxFocusRestore,\n CNGX_FOCUSABLE_SELECTOR,\n} from './focus/focus-restore.directive';\nexport { CngxFocusTrap } from './focus/focus-trap.directive';\nexport { CngxFocusVisible } from './focus/focus-visible.directive';\nexport { CngxRovingTabindex, CngxRovingItem } from './roving/roving-tabindex.directive';\nexport { CngxActiveDescendant } from './active-descendant/active-descendant.directive';\nexport {\n CNGX_AD_ITEM,\n type ActiveDescendantItem,\n type CngxAdItemHandle,\n} from './active-descendant/ad-item.token';\nexport { CngxReducedMotion } from './motion/reduced-motion.directive';\n","/**\n * Generated bundle index.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x-common-a11y.mjs","sources":["../../../projects/common/a11y/aria/aria-expanded.directive.ts","../../../projects/common/a11y/aria/live-region.directive.ts","../../../projects/common/a11y/aria/live-announcer.ts","../../../projects/common/a11y/focus/autofocus.directive.ts","../../../projects/common/a11y/focus/focus-restore.directive.ts","../../../projects/common/a11y/focus/focus-trap.directive.ts","../../../projects/common/a11y/focus/focus-visible.directive.ts","../../../projects/common/a11y/roving/roving-tabindex.directive.ts","../../../projects/common/a11y/active-descendant/ad-item.token.ts","../../../projects/common/a11y/active-descendant/active-descendant.directive.ts","../../../projects/common/a11y/motion/reduced-motion.directive.ts","../../../projects/common/a11y/public-api.ts","../../../projects/common/a11y/cngx-common-a11y.ts"],"sourcesContent":["import { Directive, input } from '@angular/core';\n\n/**\n * Manages `aria-expanded` and optionally `aria-controls` on the host element.\n *\n * Pairs a disclosure trigger (button) with its controlled region via standard\n * WAI-ARIA attributes. Supports accordions, dropdowns, tree items, and any\n * disclosure pattern where a control toggles visibility of another element.\n *\n * Unlike manual `[attr.aria-expanded]` binding, this directive couples both\n * attributes (`aria-expanded` + `aria-controls`) in a single declaration,\n * preventing mismatches where one is set without the other.\n *\n * ### Simple disclosure\n * ```html\n * <button [cngxAriaExpanded]=\"open()\" [controls]=\"'panel-id'\" (click)=\"open.set(!open())\">\n * Toggle\n * </button>\n * <div id=\"panel-id\" role=\"region\" [hidden]=\"!open()\">Panel content</div>\n * ```\n *\n * ### Accordion with multiple panels\n * ```html\n * @for (panel of panels(); track panel.id) {\n * <button [cngxAriaExpanded]=\"panel.open\" [controls]=\"panel.id\" (click)=\"toggle(panel)\">\n * {{ panel.label }}\n * </button>\n * @if (panel.open) {\n * <div [id]=\"panel.id\" role=\"region\">{{ panel.content }}</div>\n * }\n * }\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/aria/aria-expanded.directive.ts\n * @since 0.1.0\n * @relatedTo CngxLiveRegion, CngxExpandable, CngxDisclosure\n * <example-url>http://localhost:4200/#/common/a11y/aria-expanded/accordion-multiple-panels</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/aria-expanded/disclosure-pattern</example-url>\n */\n@Directive({\n selector: '[cngxAriaExpanded]',\n exportAs: 'cngxAriaExpanded',\n standalone: true,\n host: {\n '[attr.aria-expanded]': 'expanded()',\n '[attr.aria-controls]': 'controls() ?? null',\n },\n})\nexport class CngxAriaExpanded {\n /** Whether the controlled element is currently expanded. Sets `aria-expanded`. */\n readonly expanded = input<boolean>(false, { alias: 'cngxAriaExpanded' });\n /** The `id` of the controlled element. Sets `aria-controls`. */\n readonly controls = input<string | undefined>(undefined);\n}\n","import { Directive, input } from '@angular/core';\n\n/**\n * Configures the host element as an ARIA live region.\n *\n * Screen readers monitor live regions and announce content changes automatically.\n * `polite` announcements are queued after the current utterance finishes;\n * `assertive` announcements interrupt immediately. `off` disables announcements.\n *\n * Sets `role=\"alert\"` for assertive regions and `role=\"status\"` for polite regions\n * via a host binding - no manual attribute wiring needed.\n *\n * Unlike CDK's `LiveAnnouncer` service (which creates a hidden DOM element and\n * requires imperative `announce()` calls), this directive decorates your own\n * element declaratively - the content you render IS the announcement.\n *\n * ### Status message\n * ```html\n * <div cngxLiveRegion [politeness]=\"'polite'\">\n * {{ statusMessage() }}\n * </div>\n * ```\n *\n * ### Form validation error (assertive)\n * ```html\n * <div cngxLiveRegion [politeness]=\"'assertive'\"\n * [style.color]=\"error() ? 'red' : 'transparent'\">\n * {{ error() }}\n * </div>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/aria/live-region.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAriaExpanded\n * <example-url>http://localhost:4200/#/common/a11y/live-region/form-validation-assertive-error-announcements</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/live-region/polite-vs-assertive</example-url>\n */\n@Directive({\n selector: '[cngxLiveRegion]',\n exportAs: 'cngxLiveRegion',\n standalone: true,\n host: {\n '[attr.aria-live]': 'politeness()',\n '[attr.aria-atomic]': 'atomic()',\n '[attr.aria-relevant]': 'relevant()',\n '[attr.role]':\n \"politeness() === 'off' ? null : politeness() === 'assertive' ? 'alert' : 'status'\",\n },\n})\nexport class CngxLiveRegion {\n /**\n * Controls the urgency of announcements.\n * - `'polite'` - queued after current speech (default)\n * - `'assertive'` - interrupts immediately\n * - `'off'` - no announcements\n */\n readonly politeness = input<'polite' | 'assertive' | 'off'>('polite');\n /** Whether the entire region should be announced as a whole. */\n readonly atomic = input<boolean>(true);\n /** Which types of content changes to announce. Space-separated: `additions`, `removals`, `text`. */\n readonly relevant = input<string>('additions text');\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { inject, Injectable, type OnDestroy, PLATFORM_ID } from '@angular/core';\n\n/**\n * Imperative, reusable polite/assertive live-region announcer.\n *\n * The imperative counterpart to {@link CngxLiveRegion}: where the directive\n * decorates an element you render (the content IS the announcement), this\n * service owns a single visually-hidden `aria-live` element appended to\n * `document.body` and exposes an `announce(message)` call for template-less\n * directives and event handlers (e.g. `CngxCopyValue` copy success,\n * `CngxOtpInput` completion).\n *\n * One root element is created lazily on the first announcement and reused for\n * every subsequent call. The text is cleared and re-set on the next macrotask\n * so an identical consecutive message is still re-read by the screen reader.\n *\n * SSR-safe: all DOM access is guarded by `isPlatformBrowser`; on the server\n * `announce()` is a no-op and no element is created.\n *\n * ```typescript\n * const announcer = inject(CngxLiveAnnouncer);\n * announcer.announce('Copied');\n * announcer.announce('Save failed', 'assertive');\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/aria/live-announcer.ts\n * @since 0.1.0\n * @relatedTo CngxLiveRegion\n */\n@Injectable({ providedIn: 'root' })\nexport class CngxLiveAnnouncer implements OnDestroy {\n private readonly doc = inject(DOCUMENT);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n private region: HTMLElement | null = null;\n private pending: ReturnType<typeof setTimeout> | null = null;\n\n /**\n * Announces `message` through the shared live region.\n *\n * @param message Text read by the screen reader.\n * @param politeness `'polite'` (default) queues after the current\n * utterance; `'assertive'` interrupts immediately.\n */\n announce(message: string, politeness: 'polite' | 'assertive' = 'polite'): void {\n if (!this.isBrowser) {\n return;\n }\n const region = this.ensureRegion();\n region.setAttribute('aria-live', politeness);\n // Clear first, then write on the next macrotask so repeating the same\n // string still registers as a content change for the SR.\n region.textContent = '';\n if (this.pending !== null) {\n clearTimeout(this.pending);\n }\n this.pending = setTimeout(() => {\n region.textContent = message;\n this.pending = null;\n });\n }\n\n ngOnDestroy(): void {\n if (this.pending !== null) {\n clearTimeout(this.pending);\n this.pending = null;\n }\n this.region?.remove();\n this.region = null;\n }\n\n private ensureRegion(): HTMLElement {\n if (this.region) {\n return this.region;\n }\n const span = this.doc.createElement('span');\n span.setAttribute('aria-live', 'polite');\n span.setAttribute('aria-atomic', 'true');\n span.className = 'cngx-sr-only';\n span.style.position = 'absolute';\n span.style.width = '1px';\n span.style.height = '1px';\n span.style.padding = '0';\n span.style.margin = '-1px';\n span.style.overflow = 'hidden';\n span.style.clip = 'rect(0, 0, 0, 0)';\n span.style.whiteSpace = 'nowrap';\n span.style.border = '0';\n this.doc.body.appendChild(span);\n this.region = span;\n return span;\n }\n}\n","import {\n afterNextRender,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n Injector,\n} from '@angular/core';\n\n/**\n * Reactive autofocus for dynamically inserted elements.\n *\n * The native `autofocus` HTML attribute only works on initial page load.\n * This directive handles dynamic content: dialogs, panels, stepper steps,\n * and any element that appears after the initial render.\n *\n * Focuses the host element after the next render frame using `afterNextRender`.\n * When `when` changes to `true`, focus is re-applied.\n *\n * ### Focus on insertion\n * ```html\n * @if (showSearch()) {\n * <input cngxAutofocus placeholder=\"Search…\" />\n * }\n * ```\n *\n * ### Conditional focus\n * ```html\n * <input [cngxAutofocus]=\"isActive()\" />\n * ```\n *\n * ### With delay for transitions\n * ```html\n * <input cngxAutofocus [autofocusDelay]=\"200\" />\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/focus/autofocus.directive.ts\n * @since 0.1.0\n * @relatedTo CngxFocusRestore, CngxFocusTrap, CngxFocusVisible\n * <example-url>http://localhost:4200/#/common/a11y/autofocus/conditional-focus</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/autofocus/focus-on-insert</example-url>\n */\n@Directive({\n selector: '[cngxAutofocus]',\n exportAs: 'cngxAutofocus',\n standalone: true,\n})\nexport class CngxAutofocus {\n /** Whether to focus the element. Defaults to `true` (always focus on render). */\n readonly when = input<boolean>(true, { alias: 'cngxAutofocus' });\n /** Delay in ms before focusing - useful when the element appears during a transition. */\n readonly delay = input<number>(0, { alias: 'autofocusDelay' });\n /** `FocusOptions` passed to `element.focus()`. */\n readonly options = input<FocusOptions>({}, { alias: 'autofocusOptions' });\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly injector = inject(Injector);\n private pendingTimer: ReturnType<typeof setTimeout> | null = null;\n private initialized = false;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.clearPending());\n\n afterNextRender(() => {\n if (this.when()) {\n this.scheduleFocus();\n }\n this.initialized = true;\n });\n\n // Re-focus on false→true transitions only; `previousWhen` starts as `true`\n // so the initial effect run does not double-trigger alongside afterNextRender.\n let previousWhen = true;\n effect(() => {\n const current = this.when();\n if (this.initialized && current && !previousWhen) {\n this.scheduleFocus();\n }\n previousWhen = current;\n });\n }\n\n private scheduleFocus(): void {\n this.clearPending();\n const delayMs = this.delay();\n if (delayMs > 0) {\n this.pendingTimer = setTimeout(() => this.applyFocus(), delayMs);\n } else {\n afterNextRender(() => this.applyFocus(), { injector: this.injector });\n }\n }\n\n private applyFocus(): void {\n (this.el.nativeElement as HTMLElement).focus(this.options());\n }\n\n private clearPending(): void {\n if (this.pendingTimer !== null) {\n clearTimeout(this.pendingTimer);\n this.pendingTimer = null;\n }\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, inject, input, signal } from '@angular/core';\n\n/**\n * CSS selector matching natively-focusable elements: links with an\n * `href`, the enabled form controls, and anything with an explicit\n * non-negative `tabindex`. Form controls carry `:not(:disabled)` because\n * a disabled control is not in the tab order - without it a descendant\n * probe would count a disabled button as focusable and a restore target\n * could land on an unfocusable element. Single source of truth for \"is\n * this focusable\" - the element-level {@link CngxFocusRestore} predicate\n * matches against it, and descendant probes (e.g. \"does this panel\n * contain a focusable child?\") query against it. Keeping one selector\n * stops the two uses from drifting apart.\n *\n * @category common/a11y\n * @since 0.1.0\n */\nexport const CNGX_FOCUSABLE_SELECTOR =\n 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * Stores the previously focused element and restores focus on destroy.\n *\n * Prevents focus from falling to `<body>` when dynamic content is removed\n * (dialogs closing, panels collapsing, tabs switching). The directive captures\n * `document.activeElement` at initialization time and restores it when the\n * host element is destroyed.\n *\n * Fallback chain: stored element → provided fallback → nearest focusable ancestor → body.\n *\n * ### Panel that restores focus on close\n * ```html\n * @if (panelOpen()) {\n * <div cngxFocusRestore>\n * Panel content…\n * <button (click)=\"panelOpen.set(false)\">Close</button>\n * </div>\n * }\n * ```\n *\n * ### With explicit fallback\n * ```html\n * <div cngxFocusRestore [focusRestoreFallback]=\"fallbackBtn\">\n * Dynamic content…\n * </div>\n * <button #fallbackBtn>Fallback target</button>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/focus/focus-restore.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAutofocus, CngxFocusTrap, CngxFocusVisible\n * <example-url>http://localhost:4200/#/common/a11y/focus-restore/inline-details</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/focus-restore/panel-with-automatic-restore</example-url>\n */\n@Directive({\n selector: '[cngxFocusRestore]',\n exportAs: 'cngxFocusRestore',\n standalone: true,\n})\nexport class CngxFocusRestore {\n /** Whether to restore focus when the host element is destroyed. */\n readonly restoreOnDestroy = input<boolean>(true);\n /** Explicit fallback element if the stored element is no longer in the DOM. */\n readonly fallback = input<HTMLElement | null>(null);\n\n private readonly doc = inject(DOCUMENT);\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly storedElement = signal<HTMLElement | null>(null);\n\n constructor() {\n const activeEl = this.doc.activeElement;\n if (activeEl instanceof HTMLElement) {\n this.storedElement.set(activeEl);\n }\n\n inject(DestroyRef).onDestroy(() => {\n if (!this.restoreOnDestroy()) {\n return;\n }\n\n const target = this.resolveTarget();\n if (target) {\n target.focus();\n }\n });\n }\n\n /** Manually store the current focus target for later restoration. */\n capture(): void {\n const activeEl = this.doc.activeElement;\n if (activeEl instanceof HTMLElement) {\n this.storedElement.set(activeEl);\n }\n }\n\n /** Manually restore focus to the stored element. */\n restore(): void {\n const target = this.resolveTarget();\n if (target) {\n target.focus();\n }\n }\n\n /**\n * Walks the fallback chain:\n * 1. Stored element (if still in DOM and not body/self)\n * 2. Explicit fallback input\n * 3. Nearest focusable ancestor\n */\n private resolveTarget(): HTMLElement | null {\n const stored = this.storedElement();\n // Skip body - it signals \"nothing meaningful was focused\", not a real restore target.\n if (\n stored &&\n stored !== this.doc.body &&\n this.doc.contains(stored) &&\n stored !== (this.el.nativeElement as HTMLElement)\n ) {\n return stored;\n }\n\n const fallback = this.fallback();\n if (fallback && this.doc.contains(fallback)) {\n return fallback;\n }\n\n return this.findFocusableAncestor();\n }\n\n /** Traverses up the DOM tree looking for the first natively focusable element. */\n private findFocusableAncestor(): HTMLElement | null {\n let current = (this.el.nativeElement as HTMLElement).parentElement;\n while (current) {\n if (this.isFocusable(current)) {\n return current;\n }\n current = current.parentElement;\n }\n return null;\n }\n\n /**\n * Checks if an element is natively focusable (tabindex, links, form\n * controls). Element-level predicate over the shared\n * {@link CNGX_FOCUSABLE_SELECTOR}, so it never drifts from the\n * descendant-query callers.\n */\n private isFocusable(el: HTMLElement): boolean {\n return el.matches(CNGX_FOCUSABLE_SELECTOR);\n }\n}\n","import { type FocusTrap, FocusTrapFactory } from '@angular/cdk/a11y';\nimport { computed, DestroyRef, Directive, effect, ElementRef, inject, input } from '@angular/core';\n\n/**\n * Traps keyboard focus within the host element using the CDK `FocusTrap`.\n *\n * When enabled, Tab and Shift+Tab cycle only within the host element's\n * focusable children. When `autoFocus` is `true` (default), focus moves to\n * the first tabbable element automatically on activation.\n *\n * Wraps CDK's `FocusTrapFactory` with a declarative, Signal-driven API.\n * The CDK's imperative `create()` / `destroy()` / `enabled` setter lifecycle\n * is handled internally via `effect()` and `DestroyRef`.\n *\n * ### Modal dialog\n * ```html\n * <div cngxFocusTrap [enabled]=\"isOpen()\" [autoFocus]=\"true\"\n * tabindex=\"-1\" role=\"dialog\" aria-modal=\"true\"\n * (keydown.escape)=\"isOpen.set(false)\">\n * <input placeholder=\"First input\" />\n * <button (click)=\"isOpen.set(false)\">Close</button>\n * </div>\n * ```\n *\n * ### Drawer / sidebar\n * ```html\n * <nav cngxFocusTrap [enabled]=\"drawerOpen()\" tabindex=\"-1\">\n * <a href=\"/home\">Home</a>\n * <a href=\"/settings\">Settings</a>\n * </nav>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/focus/focus-trap.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAutofocus, CngxFocusRestore, CngxDialog\n * <example-url>http://localhost:4200/#/common/a11y/focus-trap/modal-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/focus-trap/slide-out-drawer</example-url>\n */\n@Directive({\n selector: '[cngxFocusTrap]',\n exportAs: 'cngxFocusTrap',\n standalone: true,\n})\nexport class CngxFocusTrap {\n /** Whether the focus trap is active. When `false`, Tab navigates normally. */\n readonly enabled = input<boolean>(false);\n /** Whether to auto-focus the first tabbable element when the trap activates. */\n readonly autoFocus = input<boolean>(true);\n\n /** Computed signal reflecting the current trap state. */\n readonly isActive = computed(() => this.enabled());\n\n private readonly trap: FocusTrap;\n\n constructor() {\n const el = inject(ElementRef<HTMLElement>);\n this.trap = inject(FocusTrapFactory).create(el.nativeElement as HTMLElement);\n\n effect(() => {\n const enabled = this.enabled();\n this.trap.enabled = enabled;\n if (enabled && this.autoFocus()) {\n void this.trap.focusFirstTabbableElementWhenReady();\n }\n });\n\n inject(DestroyRef).onDestroy(() => this.trap.destroy());\n }\n\n /** Programmatically focus the first tabbable element within the trap. */\n focusFirst(): void {\n void this.trap.focusFirstTabbableElementWhenReady();\n }\n\n /** Programmatically focus the last tabbable element within the trap. */\n focusLast(): void {\n void this.trap.focusLastTabbableElementWhenReady();\n }\n}\n","import { Directive, signal } from '@angular/core';\n\n/**\n * Tracks keyboard-initiated focus on the host element.\n *\n * Adds `cngx-focus-visible` CSS class when the element receives focus via keyboard\n * and removes it on blur or when focus was initiated by pointer interaction.\n *\n *\n * ```html\n * <button cngxFocusVisible #fv=\"cngxFocusVisible\">\n * @if (fv.focusVisible()) { Focus ring visible }\n * </button>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/focus/focus-visible.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAutofocus, CngxFocusRestore, CngxFocusTrap\n * <example-url>http://localhost:4200/#/common/a11y/focus-visible/form-fields-custom-focus-ring</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/focus-visible/keyboard-vs-pointer</example-url>\n */\n@Directive({\n selector: '[cngxFocusVisible]',\n exportAs: 'cngxFocusVisible',\n standalone: true,\n host: {\n '(pointerdown)': 'pointerActive = true',\n '(focusin)': 'handleFocus()',\n '(focusout)': 'handleBlur()',\n '[class.cngx-focus-visible]': 'focusVisible()',\n },\n})\nexport class CngxFocusVisible {\n private readonly focusVisibleState = signal(false);\n /** `true` when focus was initiated via keyboard (not pointer). */\n readonly focusVisible = this.focusVisibleState.asReadonly();\n\n /** @internal Cleared on `focusin` after being set by `pointerdown`. */\n pointerActive = false;\n\n /** @internal Sets focus-visible state; clears pointer flag. */\n protected handleFocus(): void {\n this.focusVisibleState.set(!this.pointerActive);\n this.pointerActive = false;\n }\n\n /** @internal Clears focus-visible state on blur. */\n protected handleBlur(): void {\n this.focusVisibleState.set(false);\n }\n}\n","import {\n afterNextRender,\n contentChildren,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\n\n/**\n * Marker directive for items managed by `CngxRovingTabindex`.\n *\n * Place on each focusable child inside a `[cngxRovingTabindex]` container.\n * The roving tabindex controller sets `tabindex=\"0\"` on the active item\n * and `tabindex=\"-1\"` on all others.\n *\n * ```html\n * <div cngxRovingTabindex>\n * <button cngxRovingItem>One</button>\n * <button cngxRovingItem>Two</button>\n * <button cngxRovingItem>Three</button>\n * </div>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/roving/roving-tabindex.directive.ts\n * @since 0.1.0\n * @relatedTo CngxRovingTabindex, CngxButtonToggle\n * <example-url>http://localhost:4200/#/common/a11y/roving-tabindex/horizontal-toolbar</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/roving-tabindex/vertical-menu</example-url>\n */\n@Directive({\n selector: '[cngxRovingItem]',\n exportAs: 'cngxRovingItem',\n standalone: true,\n})\nexport class CngxRovingItem {\n /** @internal Reference used by the parent `CngxRovingTabindex` to set `tabindex`. */\n readonly elementRef = inject(ElementRef<HTMLElement>);\n\n /** Whether this item is disabled and should be skipped during navigation. */\n readonly disabled = input<boolean>(false, { alias: 'cngxRovingItemDisabled' });\n\n /** Programmatically focus this item. Called by the parent on arrow-key navigation. */\n focus(): void {\n (this.elementRef.nativeElement as HTMLElement).focus();\n }\n}\n\n/**\n * Implements the WAI-ARIA roving tabindex pattern for composite widgets.\n *\n * Only the active item in the group has `tabindex=\"0\"` - all others get\n * `tabindex=\"-1\"`. Arrow keys move focus within the group; Tab leaves it.\n * Home/End jump to first/last item.\n *\n * Works for toolbars, tab lists, card grids, menu bars, and any composite\n * widget where only one item should be in the tab order at a time.\n *\n * ### Virtual mode\n *\n * When `virtualCount` is set, `activeIndex` ranges from 0 to `virtualCount - 1`\n * instead of being bounded by `contentChildren.length`. Items are matched by\n * `data-cngx-recycle-index` attribute. When the target item is not in the DOM\n * (out of rendered range), `pendingFocus` is set so a wiring function like\n * `connectRecyclerToRoving()` can scroll it into view.\n *\n * ### Horizontal toolbar\n * ```html\n * <div cngxRovingTabindex orientation=\"horizontal\" #rv=\"cngxRovingTabindex\">\n * <button cngxRovingItem>Cut</button>\n * <button cngxRovingItem>Copy</button>\n * <button cngxRovingItem>Paste</button>\n * </div>\n * ```\n *\n * ### Vertical menu with controlled index\n * ```html\n * <ul cngxRovingTabindex orientation=\"vertical\" [(activeIndex)]=\"selectedIdx\">\n * @for (item of items(); track item.id) {\n * <li cngxRovingItem>{{ item.label }}</li>\n * }\n * </ul>\n * ```\n *\n * ### Virtual scroll integration\n * ```html\n * <div cngxRovingTabindex orientation=\"vertical\" [virtualCount]=\"recycler.ariaSetSize()\">\n * @for (item of visibleItems(); track item.id; let i = $index) {\n * <div cngxRovingItem [cngxVirtualItem]=\"recycler\" [cngxVirtualItemIndex]=\"recycler.start() + i\">\n * {{ item.name }}\n * </div>\n * }\n * </div>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/roving/roving-tabindex.directive.ts\n * @since 0.1.0\n * @relatedTo CngxRovingItem, CngxActiveDescendant\n * <example-url>http://localhost:4200/#/common/a11y/roving-tabindex/horizontal-toolbar</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/roving-tabindex/vertical-menu</example-url>\n */\n@Directive({\n selector: '[cngxRovingTabindex]',\n exportAs: 'cngxRovingTabindex',\n standalone: true,\n host: {\n '(keydown)': 'handleKeyDown($event)',\n },\n})\nexport class CngxRovingTabindex {\n /**\n * Arrow key navigation axis. `'both'` enables both horizontal and\n * vertical arrows. Exposed as a `model` so composite hosts (e.g.\n * `CngxRadioGroup`, where the keyboard axis must always be `'both'`\n * per WAI-ARIA APG regardless of the cosmetic group orientation) can\n * override it from their own constructor.\n */\n readonly orientation = model<'horizontal' | 'vertical' | 'both'>('horizontal');\n /** Whether navigation wraps from last to first and vice versa. */\n readonly loop = input<boolean>(true);\n /** Index of the currently active (focusable) item. Supports two-way `[(activeIndex)]` binding. */\n readonly activeIndex = model<number>(0);\n\n /**\n * Total item count for virtual mode. When set, `activeIndex` ranges from 0 to\n * `virtualCount - 1` and items are matched by `data-cngx-recycle-index` attribute.\n * When not set, standard `contentChildren`-based navigation is used.\n */\n readonly virtualCount = input<number | undefined>(undefined);\n\n /** All `CngxRovingItem` children discovered via `contentChildren`. */\n private readonly items = contentChildren(CngxRovingItem);\n\n /** Guards against setting `tabindex` before the DOM is ready. */\n private readonly initialized = signal(false);\n\n /** Host element for `data-cngx-recycle-index` queries in virtual mode. */\n private readonly hostEl = inject(ElementRef<HTMLElement>);\n\n private readonly pendingFocusState = signal<number | null>(null);\n\n /**\n * Set true just before a navigation key (arrow / Home / End) moves focus to a\n * new item, cleared by {@link consumeNavigationKey}. Transient handshake, not\n * reactive state: consumer groups read it synchronously from the\n * newly-focused leaf's `(focus)` handler.\n */\n private navigationKeyInFlight = false;\n\n /**\n * Index of the item that should receive focus but is not currently in the DOM.\n * Non-null when virtual navigation targets an out-of-range item.\n * Used by `connectRecyclerToRoving()` to scroll the item into view and focus it.\n */\n readonly pendingFocus = this.pendingFocusState.asReadonly();\n\n constructor() {\n afterNextRender(() => this.initialized.set(true));\n\n effect(() => {\n if (!this.initialized()) {\n return;\n }\n const items = this.items();\n const active = this.activeIndex();\n const vc = this.virtualCount();\n\n if (vc != null) {\n // Virtual mode: match by data-cngx-recycle-index attribute\n items.forEach((item) => {\n const el = item.elementRef.nativeElement as HTMLElement;\n const idx = el.dataset['cngxRecycleIndex'];\n el.setAttribute('tabindex', idx != null && Number(idx) === active ? '0' : '-1');\n });\n } else {\n // Standard mode: match by array index\n const clamped = Math.max(0, Math.min(active, items.length - 1));\n items.forEach((item, i) =>\n (item.elementRef.nativeElement as HTMLElement).setAttribute(\n 'tabindex',\n i === clamped ? '0' : '-1',\n ),\n );\n }\n });\n }\n\n /**\n * Clears the pending focus target. Called by `connectRecyclerToRoving()`\n * after the item has been scrolled into view and focused.\n */\n clearPendingFocus(): void {\n this.pendingFocusState.set(null);\n }\n\n /**\n * Whether the last focus move was driven by a navigation key, consuming the\n * flag so it reads `true` exactly once. Consumer groups (radio,\n * button-toggle) call this from the newly-focused leaf's `(focus)` handler to\n * decide whether to auto-select. The flag is set before `.focus()`, so it is\n * already `true` when focus lands - this closes the one-press-behind race\n * that a group's own `(keydown)` binding suffered (#135).\n */\n consumeNavigationKey(): boolean {\n const inFlight = this.navigationKeyInFlight;\n this.navigationKeyInFlight = false;\n return inFlight;\n }\n\n /**\n * Handles arrow-key, Home, and End navigation within the group.\n * Prevents default scrolling on arrow keys.\n *\n * Unified handler - delegates to virtual or contentChildren navigation\n * based on whether `virtualCount` is set.\n */\n protected handleKeyDown(event: KeyboardEvent): void {\n const vc = this.virtualCount();\n const allItems = this.items();\n const isVirtual = vc != null;\n const total = isVirtual ? vc : allItems.length;\n\n if (total === 0) {\n return;\n }\n if (!isVirtual && this.enabledItems().length === 0) {\n return;\n }\n\n const currentActive = this.activeIndex();\n const navigate = (direction: 1 | -1): number | null =>\n isVirtual\n ? this.findNextVirtual(currentActive, total, direction)\n : this.findNext(currentActive, allItems, direction);\n\n const keyMap: Record<string, () => number | null> = {\n ArrowRight: () => (this.isHorizontal() ? navigate(1) : null),\n ArrowLeft: () => (this.isHorizontal() ? navigate(-1) : null),\n ArrowDown: () => (this.isVertical() ? navigate(1) : null),\n ArrowUp: () => (this.isVertical() ? navigate(-1) : null),\n Home: () => (isVirtual ? 0 : this.findFirst(allItems)),\n End: () => (isVirtual ? total - 1 : this.findLast(allItems)),\n };\n\n const handler = keyMap[event.key];\n if (!handler) {\n return;\n }\n\n const nextIndex = handler();\n if (nextIndex !== null && nextIndex !== currentActive) {\n event.preventDefault();\n this.activeIndex.set(nextIndex);\n // Expose the navigation intent before focus moves, so the newly-focused\n // leaf's (focus) handler reads an already-set fact instead of racing the\n // group's own late (keydown) binding (#135).\n this.navigationKeyInFlight = true;\n if (isVirtual) {\n this.focusVirtualItem(nextIndex);\n } else {\n allItems[nextIndex].focus();\n }\n } else if (nextIndex === currentActive) {\n event.preventDefault();\n }\n }\n\n /**\n * Attempts to focus a virtual item by querying `data-cngx-recycle-index`.\n * If the element is not in the DOM, sets `pendingFocus` for external resolution.\n */\n private focusVirtualItem(index: number): void {\n const el = (this.hostEl.nativeElement as HTMLElement).querySelector(\n `[data-cngx-recycle-index=\"${index}\"]`,\n );\n if (el instanceof HTMLElement) {\n el.focus();\n this.pendingFocusState.set(null);\n } else {\n this.pendingFocusState.set(index);\n }\n }\n\n /**\n * Finds the next index in virtual mode. No disabled-item skipping - can't check\n * disabled state of items not in the DOM.\n */\n private findNextVirtual(current: number, total: number, direction: 1 | -1): number | null {\n if (total === 0) {\n return null;\n }\n const idx = current + direction;\n if (this.loop()) {\n return ((idx % total) + total) % total;\n }\n if (idx < 0 || idx >= total) {\n return null;\n }\n return idx;\n }\n\n private enabledItems(): readonly CngxRovingItem[] {\n return this.items().filter((item) => !item.disabled());\n }\n\n private isHorizontal(): boolean {\n const o = this.orientation();\n return o === 'horizontal' || o === 'both';\n }\n\n private isVertical(): boolean {\n const o = this.orientation();\n return o === 'vertical' || o === 'both';\n }\n\n /**\n * Searches for the next enabled item starting from `current + direction`.\n * Respects `loop` - wraps around or stops at the boundary.\n * Skips disabled items.\n */\n private findNext(\n current: number,\n items: readonly CngxRovingItem[],\n direction: 1 | -1,\n ): number | null {\n const len = items.length;\n if (len === 0) {\n return null;\n }\n\n let idx = current + direction;\n const loop = this.loop();\n\n for (let i = 0; i < len; i++) {\n if (loop) {\n idx = ((idx % len) + len) % len;\n } else if (idx < 0 || idx >= len) {\n return null;\n }\n\n if (!items[idx].disabled()) {\n return idx;\n }\n idx += direction;\n }\n\n return null;\n }\n\n private findFirst(items: readonly CngxRovingItem[]): number | null {\n const idx = items.findIndex((item) => !item.disabled());\n return idx >= 0 ? idx : null;\n }\n\n private findLast(items: readonly CngxRovingItem[]): number | null {\n for (let i = items.length - 1; i >= 0; i--) {\n if (!items[i].disabled()) {\n return i;\n }\n }\n return null;\n }\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * Descriptor of an item managed by `CngxActiveDescendant`.\n *\n * `id` must be unique and stable across change detection runs (use `nextUid()`\n * from `@cngx/core/utils`). `label` is used by typeahead matching.\n *\n * @category common/a11y\n */\nexport interface ActiveDescendantItem {\n /** Unique DOM `id` on the element - required for `aria-activedescendant`. */\n readonly id: string;\n /** Opaque value emitted on `activated`. Compared with `Object.is` by default. */\n readonly value: unknown;\n /** Human-readable text used by typeahead. Falls back to empty string. */\n readonly label: string;\n /** Disabled items are skipped during navigation when `skipDisabled` is true. */\n readonly disabled?: boolean;\n}\n\n/**\n * DI token for content-projected items that should register with the\n * surrounding `CngxActiveDescendant`.\n *\n * Consumers like `CngxOption` and `CngxMenuItem` expose themselves via:\n *\n * ```typescript\n * providers: [{ provide: CNGX_AD_ITEM, useExisting: MyItem }]\n * ```\n *\n * The contained directive must expose `id`, `value`, `label`, and optionally\n * `disabled` as signals - the AD reads them reactively.\n *\n * @category common/a11y\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/active-descendant/ad-item.token.ts\n * @since 0.1.0\n */\nexport const CNGX_AD_ITEM = new InjectionToken<CngxAdItemHandle>('CNGX_AD_ITEM');\n\n/**\n * Minimum shape an AD-registered directive must expose.\n *\n * The shape is signal-based so the AD recomputes when any field changes.\n *\n * @category common/a11y\n */\nexport interface CngxAdItemHandle {\n readonly id: string;\n readonly value: Signal<unknown>;\n /**\n * Label accessor. Typically a signal, but may be a plain getter when the\n * label derives from runtime DOM state (e.g. `textContent` fallback).\n */\n readonly label: Signal<string> | (() => string);\n readonly disabled?: Signal<boolean>;\n}\n","import {\n afterNextRender,\n computed,\n contentChildren,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nimport { CNGX_AD_ITEM, type ActiveDescendantItem, type CngxAdItemHandle } from './ad-item.token';\n\n/**\n * WAI-ARIA active-descendant pattern. Focus stays on the host; the active\n * option is reported via `aria-activedescendant`.\n *\n * ### When to use this vs. `CngxRovingTabindex`\n *\n * - **Active-descendant** when focus stays on one container (listbox, menu,\n * combobox input) and items must not be tab-stops. Screen readers announce\n * the referenced option while the focus ring stays on the host.\n * - **Roving tabindex** when items themselves are tab-stops (toolbar, tab\n * list, grid cells). See `CngxRovingTabindex`.\n *\n * ### Item registration\n *\n * Items register either by providing `CNGX_AD_ITEM` via `hostDirectives` /\n * `providers`, or by passing a `Signal<ActiveDescendantItem[]>` through the\n * `items` input. The `items` input wins when both are present; use it when\n * items come from a dynamic data source.\n *\n * ### Virtualization\n *\n * When `virtualCount` is set, navigation can address indices not currently\n * in the DOM. `pendingHighlight` tells the consumer to scroll the missing\n * item into view; the consumer calls `clearPendingHighlight()` afterwards.\n *\n * ### Material/CDK equivalent\n *\n * Same model as `cdk-listbox` and `mat-select`, without the visual shell and\n * driven by signals instead of `ListKeyManager`.\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/active-descendant/active-descendant.directive.ts\n * @since 0.1.0\n * @relatedTo CngxRovingTabindex, CngxListbox, CngxMenu\n * <example-url>http://localhost:4200/#/common/a11y/active-descendant/listbox-with-items-input</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/active-descendant/typeahead</example-url>\n */\n@Directive({\n selector: '[cngxActiveDescendant]',\n exportAs: 'cngxActiveDescendant',\n standalone: true,\n host: {\n '[attr.aria-activedescendant]': 'activeId()',\n '(keydown)': 'handleKeydown($event)',\n },\n})\nexport class CngxActiveDescendant {\n /**\n * Optional explicit item list. When provided, takes precedence over items\n * registered via `CNGX_AD_ITEM`. Useful for combobox-style consumers that\n * drive the menu from a dynamic data source - pass the unwrapped array\n * (typically the result of a `computed()`), Angular's signal inputs make it\n * reactive automatically.\n */\n readonly items = input<ActiveDescendantItem[] | undefined>(undefined);\n\n /** Arrow-key navigation axis. Defaults to `'vertical'` (listbox/menu style). */\n readonly orientation = input<'vertical' | 'horizontal'>('vertical');\n /** Whether navigation wraps from last to first and vice versa. */\n readonly loop = input<boolean>(true);\n /** Whether alphanumeric typeahead navigation is enabled. */\n readonly typeahead = input<boolean>(true);\n /** Buffer reset window for typeahead, in milliseconds. */\n readonly typeaheadDebounce = input<number>(300);\n /** Whether the first non-disabled item is highlighted automatically. */\n readonly autoHighlightFirst = input<boolean>(false);\n /** Whether disabled items are skipped during navigation and value lookup. */\n readonly skipDisabled = input<boolean>(true);\n /**\n * When set, navigation treats the range `[0, virtualCount)` as the item\n * space even if only a subset is rendered. Targets outside the rendered\n * range surface as `pendingHighlight` for scroll-and-retry protocols.\n */\n readonly virtualCount = input<number | undefined>(undefined);\n\n /** Emitted when `activateCurrent()` is called with an active item. */\n readonly activated = output<unknown>();\n /** Emitted whenever the highlighted item changes. */\n readonly highlighted = output<ActiveDescendantItem | null>();\n\n private readonly hostEl = inject(ElementRef<HTMLElement>);\n private readonly registered = contentChildren(CNGX_AD_ITEM, { descendants: true });\n\n /** Guards host attribute writes until after first render. */\n private readonly initialized = signal(false);\n\n /** -1 means \"no active item\". Range is [0, resolvedItems().length). */\n private readonly activeIndexState = signal<number>(-1);\n\n /** Index of an item that should be highlighted but is not in the DOM. */\n private readonly pendingHighlightState = signal<number | null>(null);\n readonly pendingHighlight = this.pendingHighlightState.asReadonly();\n\n /**\n * Resolved item list. Input `items` wins; otherwise the contentChildren\n * handles are projected into `ActiveDescendantItem` shape.\n */\n readonly resolvedItems = computed<ActiveDescendantItem[]>(() => {\n const explicit = this.items();\n if (explicit) {\n return explicit;\n }\n return this.registered().map(handleToItem);\n });\n\n /** Current active index. `-1` when no item is highlighted. */\n readonly activeIndex = computed<number>(() => {\n const idx = this.activeIndexState();\n const total = this.totalCount();\n if (idx < 0 || idx >= total) {\n return -1;\n }\n return idx;\n });\n\n /**\n * `activeIndex` always mapped back to an item. `null` when no active index\n * or the item is out of rendered range (virtual mode).\n */\n readonly activeItem = computed<ActiveDescendantItem | null>(() => {\n const idx = this.activeIndex();\n if (idx < 0) {\n return null;\n }\n const list = this.resolvedItems();\n return list[idx] ?? null;\n });\n\n readonly activeId = computed<string | null>(() => this.activeItem()?.id ?? null);\n readonly activeValue = computed<unknown>(() => this.activeItem()?.value ?? null);\n\n private readonly typeaheadBuffer = signal<string>('');\n private typeaheadTimer: ReturnType<typeof setTimeout> | null = null;\n\n constructor() {\n afterNextRender(() => this.initialized.set(true));\n\n effect(() => {\n if (!this.initialized()) {\n return;\n }\n if (this.autoHighlightFirst() && this.activeIndexState() === -1) {\n this.highlightFirst();\n }\n });\n\n effect(() => {\n this.highlighted.emit(this.activeItem());\n });\n\n effect(() => {\n const idx = this.activeIndex();\n if (idx < 0) {\n return;\n }\n if (this.virtualCount() != null) {\n if (!this.isRendered(idx)) {\n this.pendingHighlightState.set(idx);\n return;\n }\n this.pendingHighlightState.set(null);\n }\n queueMicrotask(() => this.scrollActiveIntoView());\n });\n\n inject(DestroyRef).onDestroy(() => {\n if (this.typeaheadTimer !== null) {\n clearTimeout(this.typeaheadTimer);\n }\n });\n }\n\n highlightNext(): void {\n const next = this.findFrom(this.activeIndexState(), 1);\n if (next !== null) {\n this.activeIndexState.set(next);\n }\n }\n\n highlightPrev(): void {\n const next = this.findFrom(this.activeIndexState(), -1);\n if (next !== null) {\n this.activeIndexState.set(next);\n }\n }\n\n highlightFirst(): void {\n const first = this.findBoundary(1);\n if (first !== null) {\n this.activeIndexState.set(first);\n }\n }\n\n highlightLast(): void {\n const last = this.findBoundary(-1);\n if (last !== null) {\n this.activeIndexState.set(last);\n }\n }\n\n /**\n * Highlight by zero-based index. Out-of-range indices are ignored.\n * Disabled items are rejected when `skipDisabled()` is true.\n */\n highlightByIndex(index: number): void {\n const total = this.totalCount();\n if (index < 0 || index >= total) {\n return;\n }\n if (this.skipDisabled() && this.isDisabledAt(index)) {\n return;\n }\n this.activeIndexState.set(index);\n }\n\n /**\n * Highlight the first item whose value matches (via `Object.is`). No-op if\n * no match. Disabled items are rejected when `skipDisabled()` is true.\n */\n highlightByValue(value: unknown): void {\n const items = this.resolvedItems();\n const idx = items.findIndex((it) => Object.is(it.value, value));\n if (idx < 0) {\n return;\n }\n if (this.skipDisabled() && items[idx].disabled) {\n return;\n }\n this.activeIndexState.set(idx);\n }\n\n /** Clear the highlight. */\n resetHighlight(): void {\n this.activeIndexState.set(-1);\n }\n\n /** Emit `activated` with the current item's value. No-op if nothing active. */\n activateCurrent(): void {\n const item = this.activeItem();\n if (item) {\n this.activated.emit(item.value);\n }\n }\n\n /** Called by recycler bridges after scrolling the pending index into view. */\n clearPendingHighlight(): void {\n this.pendingHighlightState.set(null);\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n // Skip events from editable descendants. Without this, every\n // printable key typed into a descendant <input> hits AD's typeahead\n // branch, gets preventDefault'd, and never reaches the input.\n const target = event.target as HTMLElement | null;\n if (target && target !== event.currentTarget && isEditableTarget(target)) {\n return;\n }\n\n const key = event.key;\n\n if (this.isNavKey(key)) {\n const before = this.activeIndexState();\n this.dispatchNav(key);\n if (this.activeIndexState() !== before) {\n event.preventDefault();\n }\n return;\n }\n\n if (key === 'Enter' || key === ' ') {\n if (this.activeItem()) {\n event.preventDefault();\n this.activateCurrent();\n }\n return;\n }\n\n if (this.typeahead() && isPrintableChar(key)) {\n event.preventDefault();\n this.handleTypeahead(key);\n }\n }\n\n private isNavKey(key: string): boolean {\n switch (key) {\n case 'ArrowDown':\n case 'ArrowUp':\n case 'ArrowLeft':\n case 'ArrowRight':\n case 'Home':\n case 'End':\n return true;\n default:\n return false;\n }\n }\n\n private dispatchNav(key: string): void {\n const orientation = this.orientation();\n switch (key) {\n case 'ArrowDown':\n if (orientation === 'vertical') {\n this.highlightNext();\n }\n return;\n case 'ArrowUp':\n if (orientation === 'vertical') {\n this.highlightPrev();\n }\n return;\n case 'ArrowRight':\n if (orientation === 'horizontal') {\n this.highlightNext();\n }\n return;\n case 'ArrowLeft':\n if (orientation === 'horizontal') {\n this.highlightPrev();\n }\n return;\n case 'Home':\n this.highlightFirst();\n return;\n case 'End':\n this.highlightLast();\n return;\n }\n }\n\n /**\n * Push a printable character into the typeahead buffer and jump to the next\n * matching option. Exposed for external keyboard hosts (e.g. a select\n * trigger) that keep focus on themselves while using active-descendant\n * semantics on a separate listbox.\n *\n * Consumers should only forward single-character printable keys (`length === 1`,\n * non-whitespace). Navigation keys and non-printables must not be forwarded.\n */\n typeaheadChar(ch: string): void {\n if (!this.typeahead()) {\n return;\n }\n this.handleTypeahead(ch);\n }\n\n private handleTypeahead(ch: string): void {\n const next = this.typeaheadBuffer() + ch.toLowerCase();\n this.typeaheadBuffer.set(next);\n\n if (this.typeaheadTimer !== null) {\n clearTimeout(this.typeaheadTimer);\n }\n this.typeaheadTimer = setTimeout(() => {\n this.typeaheadBuffer.set('');\n this.typeaheadTimer = null;\n }, this.typeaheadDebounce());\n\n const items = this.resolvedItems();\n const skip = this.skipDisabled();\n const start = Math.max(0, this.activeIndexState());\n const total = items.length;\n for (let offset = 0; offset < total; offset++) {\n const i = (start + offset) % total;\n const candidate = items[i];\n if (skip && candidate.disabled) {\n continue;\n }\n if (candidate.label.toLowerCase().startsWith(next)) {\n this.activeIndexState.set(i);\n return;\n }\n }\n }\n\n private findFrom(current: number, direction: 1 | -1): number | null {\n const total = this.totalCount();\n if (total === 0) {\n return null;\n }\n const items = this.resolvedItems();\n const skip = this.skipDisabled();\n const loop = this.loop();\n\n let idx = current < 0 ? (direction === 1 ? -1 : total) : current;\n for (let step = 0; step < total; step++) {\n idx += direction;\n if (idx < 0 || idx >= total) {\n if (!loop) {\n return null;\n }\n idx = ((idx % total) + total) % total;\n }\n if (!skip || !items[idx]?.disabled) {\n return idx;\n }\n }\n return null;\n }\n\n private findBoundary(direction: 1 | -1): number | null {\n const items = this.resolvedItems();\n const total = items.length;\n if (total === 0) {\n return null;\n }\n const skip = this.skipDisabled();\n if (direction === 1) {\n for (let i = 0; i < total; i++) {\n if (!skip || !items[i].disabled) {\n return i;\n }\n }\n } else {\n for (let i = total - 1; i >= 0; i--) {\n if (!skip || !items[i].disabled) {\n return i;\n }\n }\n }\n return null;\n }\n\n private totalCount(): number {\n const vc = this.virtualCount();\n if (vc != null) {\n return vc;\n }\n return this.resolvedItems().length;\n }\n\n private isDisabledAt(index: number): boolean {\n const items = this.resolvedItems();\n return !!items[index]?.disabled;\n }\n\n private isRendered(index: number): boolean {\n const items = this.resolvedItems();\n return index >= 0 && index < items.length && !!items[index];\n }\n\n private scrollActiveIntoView(): void {\n const id = this.activeId();\n if (!id) {\n return;\n }\n const el = (this.hostEl.nativeElement as HTMLElement).querySelector(`#${cssEscape(id)}`);\n if (el instanceof HTMLElement && typeof el.scrollIntoView === 'function') {\n el.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }\n }\n}\n\n/** @internal */\nfunction handleToItem(handle: CngxAdItemHandle): ActiveDescendantItem {\n return {\n id: handle.id,\n value: handle.value(),\n label: handle.label(),\n disabled: handle.disabled?.() ?? false,\n };\n}\n\n/** @internal */\nfunction isPrintableChar(key: string): boolean {\n return key.length === 1 && /\\S/.exec(key) !== null;\n}\n\n/**\n * True when the element would capture text input natively - a text\n * `<input>`, `<textarea>`, or any `contenteditable` host. Read-only /\n * button-type inputs (submit, radio, checkbox) are NOT editable; AD's\n * keyboard navigation still applies when focus lands on them.\n *\n * @internal\n */\nfunction isEditableTarget(el: HTMLElement): boolean {\n if (el.isContentEditable) {\n return true;\n }\n const tag = el.tagName;\n if (tag === 'TEXTAREA') {\n return true;\n }\n if (tag === 'INPUT') {\n const type = (el as HTMLInputElement).type.toLowerCase();\n return (\n type !== 'button' &&\n type !== 'submit' &&\n type !== 'reset' &&\n type !== 'checkbox' &&\n type !== 'radio' &&\n type !== 'range' &&\n type !== 'color' &&\n type !== 'file' &&\n type !== 'image'\n );\n }\n return false;\n}\n\n/** @internal */\nfunction cssEscape(id: string): string {\n const api = (globalThis as { CSS?: { escape?: (s: string) => string } }).CSS;\n if (api && typeof api.escape === 'function') {\n return api.escape(id);\n }\n return id.replace(/[^a-zA-Z0-9_-]/g, (m) => `\\\\${m}`);\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, inject, signal, type Signal } from '@angular/core';\n\n/**\n * Reflects the user's `prefers-reduced-motion` media query as a reactive signal.\n *\n * Adds the `cngx-reduced-motion` CSS class to the host when the user prefers\n * reduced motion. The `prefersReducedMotion()` signal updates live when the\n * OS preference changes - use it in TypeScript to skip animations, disable\n * auto-playing media, or choose between animated and instant transitions.\n *\n * Unlike a CSS-only `@media (prefers-reduced-motion: reduce)` approach, this\n * directive makes the preference available in component logic (e.g., to pick\n * a different animation strategy or suppress requestAnimationFrame loops).\n *\n * ### Conditional animation\n * ```html\n * <div cngxReducedMotion #rm=\"cngxReducedMotion\"\n * [style.animation]=\"rm.prefersReducedMotion() ? 'none' : 'spin 2s linear infinite'\">\n * </div>\n * ```\n *\n * ### TypeScript logic\n * ```typescript\n * readonly rm = viewChild(CngxReducedMotion);\n * readonly duration = computed(() => this.rm()?.prefersReducedMotion() ? 0 : 300);\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/motion/reduced-motion.directive.ts\n * @since 0.1.0\n * <example-url>http://localhost:4200/#/common/a11y/reduced-motion/animation-toggle</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/reduced-motion/toast-notifications-motion-aware</example-url>\n */\n@Directive({\n selector: '[cngxReducedMotion]',\n exportAs: 'cngxReducedMotion',\n standalone: true,\n host: { '[class.cngx-reduced-motion]': 'prefersReducedMotion()' },\n})\nexport class CngxReducedMotion {\n /** `true` when the user's OS is set to prefer reduced motion. Updates reactively. */\n readonly prefersReducedMotion: Signal<boolean>;\n\n constructor() {\n const win = inject(DOCUMENT).defaultView;\n const pref = signal(false);\n\n if (win) {\n const mq = win.matchMedia('(prefers-reduced-motion: reduce)');\n pref.set(mq.matches);\n const listener = (e: MediaQueryListEvent) => pref.set(e.matches);\n mq.addEventListener('change', listener);\n inject(DestroyRef).onDestroy(() => mq.removeEventListener('change', listener));\n }\n\n this.prefersReducedMotion = pref.asReadonly();\n }\n}\n","/**\n * @module @cngx/common/a11y\n */\nexport { CngxAriaExpanded } from './aria/aria-expanded.directive';\nexport { CngxLiveRegion } from './aria/live-region.directive';\nexport { CngxLiveAnnouncer } from './aria/live-announcer';\nexport { CngxAutofocus } from './focus/autofocus.directive';\nexport {\n CngxFocusRestore,\n CNGX_FOCUSABLE_SELECTOR,\n} from './focus/focus-restore.directive';\nexport { CngxFocusTrap } from './focus/focus-trap.directive';\nexport { CngxFocusVisible } from './focus/focus-visible.directive';\nexport { CngxRovingTabindex, CngxRovingItem } from './roving/roving-tabindex.directive';\nexport { CngxActiveDescendant } from './active-descendant/active-descendant.directive';\nexport {\n CNGX_AD_ITEM,\n type ActiveDescendantItem,\n type CngxAdItemHandle,\n} from './active-descendant/ad-item.token';\nexport { CngxReducedMotion } from './motion/reduced-motion.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCG;MAUU,gBAAgB,CAAA;;IAElB,QAAQ,GAAG,KAAK,CAAU,KAAK,gFAAI,KAAK,EAAE,kBAA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