@cngx/common 0.1.0-rc.7 → 0.1.0-rc.9
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/card/README.md +2 -1
- package/command/README.md +29 -0
- package/data/README.md +15 -3
- package/dialog/README.md +23 -1
- package/fesm2022/cngx-common-a11y.mjs +517 -184
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-audio.mjs +62 -17
- package/fesm2022/cngx-common-audio.mjs.map +1 -1
- package/fesm2022/cngx-common-card.mjs +301 -46
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +1221 -479
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-command.mjs +97 -16
- package/fesm2022/cngx-common-command.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +1496 -499
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +236 -61
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +364 -93
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +2040 -1046
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +955 -125
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-popover.mjs +1293 -89
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +997 -453
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +1794 -1265
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common-timeline.mjs +151 -61
- package/fesm2022/cngx-common-timeline.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +1 -1
- package/interactive/README.md +15 -4
- package/layout/README.md +37 -1
- package/package.json +20 -7
- package/popover/README.md +58 -2
- package/schematics/collection.json +9 -0
- package/schematics/ng-add/index.js +9 -0
- package/schematics/ng-add/schema.json +91 -0
- package/schematics/package.json +3 -0
- package/stepper/README.md +11 -8
- package/theming/components/cngx-accordion.css +1 -1
- package/theming/components/cngx-backdrop.css +12 -0
- package/theming/components/cngx-button-toggle.css +29 -3
- package/theming/components/cngx-data-grid.css +168 -1
- package/theming/components/cngx-dialog.css +13 -0
- package/theming/components/cngx-listbox.css +21 -12
- package/theming/components/cngx-menu.css +56 -16
- package/theming/components/cngx-popover-sheet.css +402 -0
- package/theming/components/cngx-popover.css +28 -0
- package/theming/components/cngx-recycler-placeholder.css +196 -0
- package/theming/components/cngx-ripple.css +1 -1
- package/theming/components/cngx-slider.css +32 -1
- package/theming/components/cngx-tooltip.css +12 -0
- package/timeline/README.md +155 -0
- package/types/cngx-common-a11y.d.ts +205 -28
- package/types/cngx-common-card.d.ts +201 -17
- package/types/cngx-common-chart.d.ts +345 -48
- package/types/cngx-common-command.d.ts +50 -10
- package/types/cngx-common-data.d.ts +743 -92
- package/types/cngx-common-dialog.d.ts +161 -10
- package/types/cngx-common-display.d.ts +356 -142
- package/types/cngx-common-interactive.d.ts +910 -226
- package/types/cngx-common-layout.d.ts +603 -32
- package/types/cngx-common-popover.d.ts +612 -49
- package/types/cngx-common-stepper.d.ts +526 -237
- package/types/cngx-common-tabs.d.ts +358 -75
- package/types/cngx-common-timeline.d.ts +108 -22
|
@@ -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/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\ntype Politeness = 'polite' | 'assertive';\n\n// One frame. Clear the region this long before writing so an intentionally\n// repeated identical string still registers as a content change for the SR.\nconst CLEAR_DELAY_MS = 16;\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 two visually-hidden `aria-live` regions appended to\n * `document.body` - one persistent polite node and one persistent assertive\n * node - and exposes an `announce(message, politeness)` call for template-less\n * directives and event handlers (e.g. `CngxCopyValue` copy success,\n * `CngxOtpInput` completion).\n *\n * Each region is created lazily on the first announcement of its politeness and\n * reused thereafter. Because polite and assertive live in separate fixed-\n * politeness nodes, an assertive announcement never clobbers a concurrent\n * polite one. Per region, the text is cleared and re-set one frame later so an\n * 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 region 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 politeRegion: HTMLElement | null = null;\n private assertiveRegion: HTMLElement | null = null;\n private readonly pending: Record<Politeness, ReturnType<typeof setTimeout> | null> = {\n polite: null,\n assertive: null,\n };\n\n /**\n * Announces `message` through the fixed-politeness 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. Each politeness owns its\n * own region, so the two never overwrite each other.\n */\n announce(message: string, politeness: Politeness = 'polite'): void {\n if (!this.isBrowser) {\n return;\n }\n const region = this.ensureRegion(politeness);\n // Clear first, then write one frame later so repeating the same string\n // still registers as a content change for the SR. Polite and assertive\n // keep independent timers so one politeness never cancels the other.\n region.textContent = '';\n const existing = this.pending[politeness];\n if (existing !== null) {\n clearTimeout(existing);\n }\n this.pending[politeness] = setTimeout(() => {\n region.textContent = message;\n this.pending[politeness] = null;\n }, CLEAR_DELAY_MS);\n }\n\n ngOnDestroy(): void {\n for (const politeness of ['polite', 'assertive'] as const) {\n const timer = this.pending[politeness];\n if (timer !== null) {\n clearTimeout(timer);\n this.pending[politeness] = null;\n }\n }\n this.politeRegion?.remove();\n this.assertiveRegion?.remove();\n this.politeRegion = null;\n this.assertiveRegion = null;\n }\n\n private ensureRegion(politeness: Politeness): HTMLElement {\n const existing = politeness === 'polite' ? this.politeRegion : this.assertiveRegion;\n if (existing) {\n return existing;\n }\n const span = this.doc.createElement('span');\n span.setAttribute('aria-live', politeness);\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 if (politeness === 'polite') {\n this.politeRegion = span;\n } else {\n this.assertiveRegion = span;\n }\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 untracked,\n} from '@angular/core';\nimport { injectDirection, resolveInlineStep } from '@cngx/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 '(focusin)': 'handleFocusIn($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 /** Document writing direction - flips the horizontal-arrow index deltas under `rtl` (APG). */\n private readonly direction = injectDirection();\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. Clamp the\n // model itself when the virtual space shrinks below it - a ghost\n // index would otherwise anchor the next arrow press. An empty space\n // (vc 0) keeps the model untouched so a repopulated list restores it.\n const clamped = vc > 0 ? Math.max(0, Math.min(active, vc - 1)) : active;\n if (clamped !== active) {\n untracked(() => this.activeIndex.set(clamped));\n }\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) === clamped ? '0' : '-1');\n });\n } else {\n // Standard mode: match by array index. The tab stop must land on an\n // enabled item - fall back to the first enabled one when the clamped\n // target is disabled (initial index into a disabled leaf, or the\n // active item got disabled). The model is written back so keyboard\n // navigation anchors where the tab stop actually sits. An empty list\n // keeps the model untouched so a repopulated list restores it.\n if (items.length === 0) {\n return;\n }\n let target = Math.max(0, Math.min(active, items.length - 1));\n if (items[target]?.disabled()) {\n target = this.findFirst(items) ?? target;\n }\n if (target !== active) {\n untracked(() => this.activeIndex.set(target));\n }\n items.forEach((item, i) =>\n (item.elementRef.nativeElement as HTMLElement).setAttribute(\n 'tabindex',\n i === target ? '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 // Never hijack browser/app shortcuts: Ctrl/Cmd/Alt combos pass through\n // untouched (Ctrl+Home, Cmd+ArrowLeft and friends belong to the app).\n if (event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n\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 inlineNav = (key: string): number | null => {\n if (!this.isHorizontal()) {\n return null;\n }\n const step = resolveInlineStep(key, this.direction());\n return step === null ? null : navigate(step);\n };\n\n const keyMap: Record<string, () => number | null> = {\n ArrowRight: () => inlineNav('ArrowRight'),\n ArrowLeft: () => inlineNav('ArrowLeft'),\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 * Keeps `activeIndex` in sync with real focus (APG): when an item gains\n * focus by any means - pointer click, script focus, assistive tech - the\n * tab stop follows it instead of staying on the last arrow-key target.\n */\n protected handleFocusIn(event: FocusEvent): void {\n const target = event.target as HTMLElement | null;\n if (target === null) {\n return;\n }\n const vc = this.virtualCount();\n if (vc != null) {\n const holder = target.closest('[data-cngx-recycle-index]');\n const idx = holder === null ? NaN : Number(holder.getAttribute('data-cngx-recycle-index'));\n if (Number.isInteger(idx) && idx >= 0 && idx < vc && idx !== this.activeIndex()) {\n this.activeIndex.set(idx);\n }\n return;\n }\n const items = this.items();\n const idx = items.findIndex((item) => {\n const el = item.elementRef.nativeElement as HTMLElement;\n return el === target || el.contains(target);\n });\n if (idx >= 0 && !items[idx].disabled() && idx !== this.activeIndex()) {\n this.activeIndex.set(idx);\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 untracked,\n} from '@angular/core';\nimport { injectDirection, resolveInlineStep } from '@cngx/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 addresses the absolute index space\n * `[0, virtualCount)` even when only a window is rendered. Bind `windowStart`\n * to the recycler's window start so item lookups (id resolution, disabled\n * checks, typeahead labels) map absolute indices onto the rendered subset.\n * Targets outside the window surface as `pendingHighlight`; the consumer\n * scrolls them into view (`connectRecyclerToActiveDescendant`) and the\n * directive clears the pending state once the target renders.\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 * Absolute index of the first rendered item in virtual mode - the recycler\n * window start. All rendered-item lookups are offset by it so absolute\n * indices resolve the right item once the window has scrolled past 0.\n * Ignored when `virtualCount` is unset.\n */\n readonly windowStart = input<number>(0);\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 /** Document writing direction - flips the horizontal-arrow steps under `rtl` (APG). */\n private readonly direction = injectDirection();\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 return this.itemAt(idx);\n });\n\n /**\n * `activeItem` pinned to the item id for the `highlighted` emission: a\n * re-render that produces a fresh object for the same item must not\n * re-emit. `activeItem` itself stays identity-equal so `activeValue`\n * tracks value changes on an unchanged id.\n */\n private readonly highlightedItem = computed<ActiveDescendantItem | null>(\n () => this.activeItem(),\n { equal: (a, b) => a === b || (a !== null && b !== null && a.id === b.id) },\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 // Leading nulls are start-up state, not a highlight change - emit only\n // once something was highlighted (later resets back to null still emit).\n let hadHighlight = false;\n effect(() => {\n const item = this.highlightedItem();\n if (!hadHighlight && item === null) {\n return;\n }\n hadHighlight = true;\n this.highlighted.emit(item);\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 // Clamp the active STATE, not just the derived display, when the item\n // space shrinks below it - otherwise the next arrow press navigates\n // relative to a ghost index.\n effect(() => {\n const total = this.totalCount();\n const idx = this.activeIndexState();\n if (idx >= total) {\n untracked(() => this.activeIndexState.set(total > 0 ? total - 1 : -1));\n }\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 rendered item whose value matches (via `Object.is`).\n * No-op if no match. Disabled items are rejected when `skipDisabled()` is\n * true. In virtual mode only the rendered window is searched; the resolved\n * index is absolute.\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 + this.windowOffset());\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 // Never hijack browser/app shortcuts: Ctrl/Cmd/Alt combos pass through\n // untouched (Ctrl+C would otherwise hit the typeahead branch and get\n // preventDefault'd). Shift stays allowed - it produces printable chars.\n if (event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n\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 'ArrowRight':\n case 'ArrowLeft': {\n if (orientation !== 'horizontal') {\n return;\n }\n // RTL flips the horizontal arrows (same kernel roving uses).\n const step = resolveInlineStep(key, this.direction());\n if (step === 1) {\n this.highlightNext();\n } else if (step === -1) {\n this.highlightPrev();\n }\n return;\n }\n case 'ArrowUp':\n if (orientation === 'vertical') {\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 // Labels exist only for rendered items, so the search space is the\n // rendered window; matches map back to absolute indices in virtual mode.\n const items = this.resolvedItems();\n const skip = this.skipDisabled();\n const count = items.length;\n if (count === 0) {\n return;\n }\n const windowOffset = this.windowOffset();\n const activeRel = this.activeIndexState() < 0 ? -1 : this.activeIndexState() - windowOffset;\n // APG cycle: a single-character query (including a repeated letter, whose\n // buffer collapses back to that letter) searches AFTER the active item so\n // each press advances through the matches. A genuine multi-character query\n // keeps matching the current item first.\n const sameChar = next.length > 1 && [...next].every((c) => c === next[0]);\n const term = sameChar ? next[0] : next;\n const cycles = term.length === 1;\n const startRel = cycles ? activeRel + 1 : Math.max(0, activeRel);\n for (let step = 0; step < count; step++) {\n const rel = (((startRel + step) % count) + count) % count;\n const candidate = items[rel];\n if (skip && candidate.disabled) {\n continue;\n }\n if (candidate.label.toLowerCase().startsWith(term)) {\n this.activeIndexState.set(rel + windowOffset);\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 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 || !this.isDisabledAt(idx)) {\n return idx;\n }\n }\n return null;\n }\n\n /**\n * First/last navigable absolute index. Spans the full virtual range - End\n * targets `totalCount - 1` even when that item is not rendered (it surfaces\n * as `pendingHighlight`); unrendered items count as enabled because their\n * disabled state is unknowable.\n */\n private findBoundary(direction: 1 | -1): number | null {\n const total = this.totalCount();\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 || !this.isDisabledAt(i)) {\n return i;\n }\n }\n } else {\n for (let i = total - 1; i >= 0; i--) {\n if (!skip || !this.isDisabledAt(i)) {\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 /** Rendered-window offset: `windowStart` in virtual mode, `0` otherwise. */\n private windowOffset(): number {\n return this.virtualCount() != null ? this.windowStart() : 0;\n }\n\n /** Item at an absolute index, `null` when outside the rendered window. */\n private itemAt(index: number): ActiveDescendantItem | null {\n const rel = index - this.windowOffset();\n const items = this.resolvedItems();\n if (rel < 0 || rel >= items.length) {\n return null;\n }\n return items[rel] ?? null;\n }\n\n private isDisabledAt(index: number): boolean {\n return !!this.itemAt(index)?.disabled;\n }\n\n private isRendered(index: number): boolean {\n return this.itemAt(index) !== null;\n }\n\n private scrollActiveIntoView(): void {\n const id = this.activeId();\n if (!id) {\n return;\n }\n // Document-wide by escaped id: aria-owns layouts render the option list\n // outside the host subtree, a host-scoped query never finds those.\n const doc = (this.hostEl.nativeElement as HTMLElement).ownerDocument;\n const el = doc.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, type Signal } from '@angular/core';\nimport { createMediaQuerySignal } from '@cngx/core/utils';\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 this.prefersReducedMotion = createMediaQuerySignal(\n '(prefers-reduced-motion: reduce)',\n inject(DestroyRef),\n inject(DOCUMENT).defaultView,\n );\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,kBAAkB,EAAA,CAAG;;AAE/D,IAAA,QAAQ,GAAG,KAAK,CAAqB,SAAS,+EAAC;uGAJ7C,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,kBAAA,EAAA,QAAA,E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AAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,2BAAA,EAAA,wBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAN7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE,EAAE,6BAA6B,EAAE,wBAAwB,EAAE;AAClE,iBAAA;;;AC1CD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
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/aria/live-region-pair.ts","../../../projects/common/a11y/aria/live-announcer.ts","../../../projects/common/a11y/aria/scoped-live-region.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 * @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 * @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 type { AriaLivePoliteness } from './live-announcer';\n\n// One frame. Clear the region this long before writing so an intentionally\n// repeated identical string still registers as a content change for the SR.\nconst CLEAR_DELAY_MS = 16;\n\n/**\n * A message whose write into its live region has not landed yet.\n *\n * @category common/a11y\n */\nexport interface CngxPendingAnnouncement {\n readonly message: string;\n readonly politeness: AriaLivePoliteness;\n}\n\n/**\n * @internal Polite + assertive live-region pair inside one container. The\n * engine behind `CngxLiveAnnouncer` (container `document.body`) and\n * `injectScopedLiveRegion` (container: an overlay host).\n */\nexport interface CngxLiveRegionPair {\n /**\n * Clear the region of `politeness` now, write `message` `delayMs` later\n * (default one frame).\n */\n announce(message: string, politeness: AriaLivePoliteness, delayMs?: number): void;\n /** Create both regions up front so they are in the DOM before any message. */\n ensure(): void;\n /** Cancel every write that has not landed and return what it would have said. */\n takePending(): readonly CngxPendingAnnouncement[];\n /** Cancel pending writes and remove both regions. */\n destroy(): void;\n}\n\nconst POLITENESS: readonly AriaLivePoliteness[] = ['polite', 'assertive'];\n\ninterface PendingWrite {\n readonly message: string;\n readonly timer: ReturnType<typeof setTimeout>;\n}\n\n/**\n * @internal Browser only: callers guard the server path. Each region is a\n * visually hidden `aria-live` + `aria-atomic=\"true\"` span (the attribute\n * contract of `CngxLiveRegion`), created lazily on the first announce of its\n * politeness or by `ensure()`.\n *\n * `redirect` is asked when a write is due: returning `true` means the caller\n * took the message elsewhere (its container stopped being readable while the\n * write was pending), so nothing is written here.\n */\nexport function createLiveRegionPair(\n container: HTMLElement,\n doc: Document,\n redirect?: (announcement: CngxPendingAnnouncement) => boolean,\n): CngxLiveRegionPair {\n const regions: Record<AriaLivePoliteness, HTMLElement | null> = {\n polite: null,\n assertive: null,\n };\n const pending: Record<AriaLivePoliteness, PendingWrite | null> = {\n polite: null,\n assertive: null,\n };\n\n const ensureRegion = (politeness: AriaLivePoliteness): HTMLElement => {\n const existing = regions[politeness];\n if (existing) {\n return existing;\n }\n const span = doc.createElement('span');\n span.setAttribute('aria-live', politeness);\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 container.appendChild(span);\n regions[politeness] = span;\n return span;\n };\n\n const cancel = (politeness: AriaLivePoliteness): PendingWrite | null => {\n const write = pending[politeness];\n if (write) {\n clearTimeout(write.timer);\n pending[politeness] = null;\n }\n return write;\n };\n\n return {\n announce(message, politeness, delayMs = CLEAR_DELAY_MS) {\n const region = ensureRegion(politeness);\n // Clear first, then write one frame later so repeating the same string\n // still registers as a content change for the SR. Polite and assertive\n // keep independent timers so one politeness never cancels the other.\n region.textContent = '';\n cancel(politeness);\n pending[politeness] = {\n message,\n timer: setTimeout(() => {\n pending[politeness] = null;\n if (redirect?.({ message, politeness })) {\n return;\n }\n region.textContent = message;\n }, delayMs),\n };\n },\n ensure() {\n for (const politeness of POLITENESS) {\n ensureRegion(politeness);\n }\n },\n takePending() {\n const taken: CngxPendingAnnouncement[] = [];\n for (const politeness of POLITENESS) {\n const write = cancel(politeness);\n if (write) {\n taken.push({ message: write.message, politeness });\n }\n }\n return taken;\n },\n destroy() {\n for (const politeness of POLITENESS) {\n cancel(politeness);\n regions[politeness]?.remove();\n regions[politeness] = null;\n }\n },\n };\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { inject, Injectable, type OnDestroy, PLATFORM_ID } from '@angular/core';\n\nimport {\n createLiveRegionPair,\n type CngxLiveRegionPair,\n type CngxPendingAnnouncement,\n} from './live-region-pair';\n\n// A screen reader commonly misses a change to a live region that entered the\n// DOM a frame earlier. A modal pair is created on the announcement that needs\n// it, so its first write waits until the regions have settled.\nconst FIRST_MODAL_WRITE_DELAY_MS = 100;\n\nconst MODAL_SELECTOR = '[aria-modal=\"true\"]';\n\n/** A modal container a screen reader currently reads. */\nfunction isOpenModal(el: HTMLElement): boolean {\n if (!el.isConnected || el.getAttribute('aria-modal') !== 'true') {\n return false;\n }\n return !(el instanceof HTMLDialogElement) || el.open;\n}\n\n// Overlays such as CngxDialog are appended to the body, and a nested modal\n// follows its container, so document order is stacking order: the last open\n// modal outside an inert subtree is the one a screen reader still reads.\nfunction topmostOpenModal(doc: Document): HTMLElement | null {\n const open = Array.from(doc.querySelectorAll<HTMLElement>(MODAL_SELECTOR)).filter(\n (el) => isOpenModal(el) && !el.closest('[inert]'),\n );\n return open.at(-1) ?? null;\n}\n\n/**\n * Politeness channel for {@link CngxLiveAnnouncer.announce}: `'polite'` queues\n * after the current utterance, `'assertive'` interrupts it immediately.\n *\n * @category common/a11y\n */\nexport type AriaLivePoliteness = 'polite' | 'assertive';\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 two visually-hidden `aria-live` regions appended to\n * `document.body` - one persistent polite node and one persistent assertive\n * node - and exposes an `announce(message, politeness)` call for template-less\n * directives and event handlers (e.g. `CngxCopyValue` copy success,\n * `CngxOtpInput` completion).\n *\n * Each region is created lazily on the first announcement of its politeness and\n * reused thereafter. Because polite and assertive live in separate fixed-\n * politeness nodes, an assertive announcement never clobbers a concurrent\n * polite one. Per region, the text is cleared and re-set one frame later so an\n * identical consecutive message is still re-read by the screen reader.\n *\n * A modal dialog hides everything outside it from assistive technology, so a\n * body region is silent while one is open. Pass the announcing element as the\n * third argument and the message goes to a region pair inside its enclosing\n * `[aria-modal=\"true\"]` container instead; without a modal ancestor it goes to\n * the body regions as before. When another modal covers that one, the topmost\n * open modal receives it: the last `[aria-modal=\"true\"]` element in document\n * order that is open and not inside an `[inert]` subtree. That covers a modal\n * nested inside the scope's own one as well as a sibling stacked on top of it,\n * which is how `CngxDialog` stacks dialogs (every host is appended to\n * `document.body`); a covered modal is hidden from assistive technology, so\n * its region would be silent. The pair is created with both regions on first\n * use and its first write waits until the regions have settled in the DOM. A\n * message still pending when its modal closes moves to the next enclosing open\n * modal, else to the topmost modal still open, else to the body regions, and\n * the pair is removed. The scope is opt-in per call - an unscoped announcement\n * never guesses a modal. {@link injectScopedLiveRegion} is the injection-time\n * alternative when the caller knows its overlay host up front.\n *\n * SSR-safe: all DOM access is guarded by `isPlatformBrowser`; on the server\n * `announce()` is a no-op and no region is created.\n *\n * ```typescript\n * const announcer = inject(CngxLiveAnnouncer);\n * announcer.announce('Copied');\n * announcer.announce('Save failed', 'assertive');\n * announcer.announce('Alert dismissed', 'polite', hostElement); // inside a modal\n * ```\n *\n * @category common/a11y\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 regions: CngxLiveRegionPair | null = null;\n /**\n * One pair per open `aria-modal` container, released once it closes.\n * `outer` is the container's parent at creation, the route for its unwritten\n * messages when it is removed from the DOM.\n */\n private readonly modalRegions = new Map<\n HTMLElement,\n { readonly pair: CngxLiveRegionPair; readonly outer: Element | null }\n >();\n\n /**\n * Announces `message` through the fixed-politeness 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. Each politeness owns its\n * own region, so the two never overwrite each other.\n * @param scope The announcing element. When it sits inside an\n * `[aria-modal=\"true\"]` container, the message is written into a region\n * inside the topmost open modal (that container unless another modal\n * covers it), which a screen reader still reads while the modal hides the\n * rest of the page. `null` / omitted: the body regions.\n */\n announce(\n message: string,\n politeness: AriaLivePoliteness = 'polite',\n scope?: Element | null,\n ): void {\n if (!this.isBrowser) {\n return;\n }\n this.releaseClosedModals();\n this.route(scope, { message, politeness });\n }\n\n ngOnDestroy(): void {\n this.regions?.destroy();\n this.regions = null;\n for (const { pair } of this.modalRegions.values()) {\n pair.destroy();\n }\n this.modalRegions.clear();\n }\n\n /**\n * `fromModal` marks a message that was already scoped to a modal which has\n * since closed: with no open modal around its new scope it still goes to the\n * topmost open modal rather than to the silent body regions.\n */\n private route(\n scope: Element | null | undefined,\n announcement: CngxPendingAnnouncement,\n fromModal = false,\n ): void {\n const modal = this.targetModal(scope, fromModal);\n if (!modal) {\n this.regions ??= createLiveRegionPair(this.doc.body, this.doc);\n this.regions.announce(announcement.message, announcement.politeness);\n return;\n }\n const existing = this.modalRegions.get(modal);\n if (existing) {\n existing.pair.announce(announcement.message, announcement.politeness);\n return;\n }\n const pair = createLiveRegionPair(modal, this.doc, (due) => this.redirectIfClosed(modal, due));\n pair.ensure();\n this.modalRegions.set(modal, { pair, outer: modal.parentElement });\n pair.announce(announcement.message, announcement.politeness, FIRST_MODAL_WRITE_DELAY_MS);\n }\n\n /**\n * The topmost open modal when `scope` sits in an open modal (or the message\n * comes from a closed one), else `null` for the body regions. Falls back to\n * the scope's own modal when no candidate outside an inert subtree is open.\n */\n private targetModal(scope: Element | null | undefined, fromModal: boolean): HTMLElement | null {\n const own = this.enclosingOpenModal(scope);\n if (!own && !fromModal) {\n return null;\n }\n return topmostOpenModal(this.doc) ?? own;\n }\n\n private enclosingOpenModal(scope: Element | null | undefined): HTMLElement | null {\n let candidate = scope?.closest(MODAL_SELECTOR) ?? null;\n while (candidate) {\n if (candidate instanceof HTMLElement && isOpenModal(candidate)) {\n return candidate;\n }\n candidate = candidate.parentElement?.closest(MODAL_SELECTOR) ?? null;\n }\n return null;\n }\n\n private redirectIfClosed(modal: HTMLElement, due: CngxPendingAnnouncement): boolean {\n if (isOpenModal(modal)) {\n return false;\n }\n const outer = this.outerOf(modal);\n this.release(modal);\n this.route(outer, due, true);\n return true;\n }\n\n private releaseClosedModals(): void {\n for (const modal of Array.from(this.modalRegions.keys())) {\n if (!isOpenModal(modal)) {\n this.release(modal);\n }\n }\n }\n\n /** Drop the pair of a closed modal; its unwritten messages move outward. */\n private release(modal: HTMLElement): void {\n const entry = this.modalRegions.get(modal);\n if (!entry) {\n return;\n }\n const outer = this.outerOf(modal);\n this.modalRegions.delete(modal);\n const unwritten = entry.pair.takePending();\n entry.pair.destroy();\n for (const announcement of unwritten) {\n this.route(outer, announcement, true);\n }\n }\n\n private outerOf(modal: HTMLElement): Element | null {\n return modal.parentElement ?? this.modalRegions.get(modal)?.outer ?? null;\n }\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { DestroyRef, inject, PLATFORM_ID } from '@angular/core';\n\nimport type { AriaLivePoliteness } from './live-announcer';\nimport {\n type CngxLiveRegionPair,\n type CngxPendingAnnouncement,\n createLiveRegionPair,\n} from './live-region-pair';\n\n/**\n * Polite + assertive live regions inside one host element.\n *\n * @category common/a11y\n */\nexport interface CngxScopedLiveRegion {\n /** Speak `message` from the region of `politeness` (default `'polite'`). */\n announce(message: string, politeness?: AriaLivePoliteness): void;\n /** Create both regions now, so they are in the DOM before the first message. */\n ensure(): void;\n /** Cancel every write that has not landed yet and return what it would have said. */\n takePending(): readonly CngxPendingAnnouncement[];\n /** Cancel pending writes and remove the regions. Runs on destroy as well. */\n destroy(): void;\n}\n\n/**\n * Create a polite + assertive live-region pair inside `host`.\n *\n * The scoped counterpart to {@link CngxLiveAnnouncer}: same regions, same\n * clear-then-set timing, but appended to an overlay host instead of\n * `document.body`. Use it for modal overlays: under `aria-modal` VoiceOver\n * drops body-level live regions and speaks them late after the overlay\n * closes, while a region inside the modal is spoken on every platform.\n * Polite and assertive keep separate regions, so an assertive error never\n * clobbers a polite status.\n *\n * Must run in an injection context; the regions are removed when that context\n * is destroyed. No-op on the server.\n *\n * ```typescript\n * private readonly region = injectScopedLiveRegion(inject(ElementRef).nativeElement);\n *\n * protected handleSaveFailed(): void {\n * this.region.announce('Save failed', 'assertive');\n * }\n * ```\n *\n * @param host - Element that receives the two visually hidden regions.\n *\n * @category common/a11y\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/aria/scoped-live-region.ts\n * @since 0.1.0\n * @relatedTo CngxLiveAnnouncer, CngxLiveRegion\n */\nexport function injectScopedLiveRegion(host: HTMLElement): CngxScopedLiveRegion {\n const doc = inject(DOCUMENT);\n const isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n let pair: CngxLiveRegionPair | null = null;\n const ensurePair = (): CngxLiveRegionPair => {\n pair ??= createLiveRegionPair(host, doc);\n return pair;\n };\n\n const region: CngxScopedLiveRegion = {\n announce(message, politeness = 'polite') {\n if (!isBrowser) {\n return;\n }\n ensurePair().announce(message, politeness);\n },\n ensure() {\n if (!isBrowser) {\n return;\n }\n ensurePair().ensure();\n },\n takePending() {\n return pair?.takePending() ?? [];\n },\n destroy() {\n pair?.destroy();\n pair = null;\n },\n };\n inject(DestroyRef).onDestroy(() => region.destroy());\n return region;\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 * @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 const el = this.el.nativeElement as HTMLElement;\n // A delayed schedule can outlive its trigger: the condition may have\n // flipped off or the element may have left the DOM. Re-check both so a\n // stale timer cannot steal focus from wherever it moved meanwhile.\n if (!this.when() || !el.isConnected) {\n return;\n }\n el.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.\n * When none resolves, focus is left where the browser put it - `<body>` is\n * deliberately never a restore target.\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 * @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 {\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n InjectionToken,\n Injector,\n input,\n type Signal,\n untracked,\n} from '@angular/core';\n\n/**\n * @internal Lets a directive that composes `CngxFocusTrap` as a host\n * directive drive it from its own state instead of the inputs. Provided by\n * the composer on the same element (`useExisting`); the trap resolves it\n * lazily with `self: true`, because the composer constructs after its host\n * directives.\n */\nexport interface CngxFocusTrapDriver {\n /** Whether the trap is active; wins over `[enabled]`. */\n readonly focusTrapEnabled: Signal<boolean>;\n /** Whether activation auto-focuses; wins over `[autoFocus]`. */\n readonly focusTrapAutoFocus: boolean;\n}\n\n/** @internal See {@link CngxFocusTrapDriver}. */\nexport const CNGX_FOCUS_TRAP_DRIVER = new InjectionToken<CngxFocusTrapDriver>(\n 'CngxFocusTrapDriver',\n);\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 * **Nesting:** traps do not coordinate with each other. When traps nest\n * (dialog over drawer), enable only the innermost one and drive each\n * `enabled` from your layering state - two simultaneously enabled traps\n * fight over Tab. `CngxDialogStack` already does this for stacked dialogs.\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 private readonly injector = inject(Injector);\n private resolvedDriver: CngxFocusTrapDriver | null | undefined = undefined;\n private driver(): CngxFocusTrapDriver | null {\n if (this.resolvedDriver === undefined) {\n this.resolvedDriver = this.injector.get(CNGX_FOCUS_TRAP_DRIVER, null, { self: true });\n }\n return this.resolvedDriver;\n }\n\n /**\n * The enabled state the trap actually follows: a composer's driver\n * (see {@link CngxFocusTrapDriver}) wins over the `[enabled]` input.\n */\n private readonly effectiveEnabled = computed(\n () => this.driver()?.focusTrapEnabled() ?? this.enabled(),\n );\n\n /**\n * Readable alias of the effective enabled state for `exportAs` consumers\n * (`trap.isActive()` reads better than re-binding the input).\n */\n readonly isActive = computed(() => this.effectiveEnabled());\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly factory = inject(FocusTrapFactory);\n private trap: FocusTrap | null = null;\n\n constructor() {\n // Track ONLY the effective enabled state: with autoFocus inside the\n // tracked zone, flipping [autoFocus] while the trap is active would\n // re-run the effect and yank focus back to the first tabbable element.\n // The CDK calls are service work, not dependencies.\n effect(() => {\n const enabled = this.effectiveEnabled();\n untracked(() => {\n if (!enabled && !this.trap) {\n return;\n }\n const trap = this.ensureTrap();\n trap.enabled = enabled;\n if (enabled && !trap.hasAttached()) {\n trap.attachAnchors();\n }\n if (enabled && (this.driver()?.focusTrapAutoFocus ?? this.autoFocus())) {\n void trap.focusFirstTabbableElementWhenReady();\n }\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.ensureTrap().focusFirstTabbableElementWhenReady();\n }\n\n /** Programmatically focus the last tabbable element within the trap. */\n focusLast(): void {\n void this.ensureTrap().focusLastTabbableElementWhenReady();\n }\n\n /**\n * @internal Focus the first tabbable element right now, in the caller's\n * stack. `focusFirst()` waits for the next render, which is too late for a\n * composer that must move focus inside the user gesture that opened it.\n * Returns `false` when nothing inside is tabbable.\n */\n focusFirstNow(): boolean {\n return this.ensureTrap().focusFirstTabbableElement();\n }\n\n // Deferred anchors: the CDK sentinels are inserted on the first enable,\n // so a trap that is never enabled leaves the DOM untouched.\n private ensureTrap(): FocusTrap {\n this.trap ??= this.factory.create(this.host, true);\n return this.trap;\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, inject, 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 * @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)': 'handlePointerDown()',\n '(focusin)': 'handleFocus()',\n '(focusout)': 'handleBlur()',\n '[class.cngx-focus-visible]': 'focusVisible()',\n },\n})\nexport class CngxFocusVisible {\n private readonly doc = inject(DOCUMENT);\n private readonly focusVisibleState = signal(false);\n /** `true` when focus was initiated via keyboard (not pointer). */\n readonly focusVisible = this.focusVisibleState.asReadonly();\n\n private pointerActive = false;\n private pointerClearTimer: ReturnType<typeof setTimeout> | null = null;\n\n private readonly schedulePointerClear = (): void => {\n // One macrotask of grace: on touch, the compat mousedown and the focusin\n // fire AFTER pointerup, so a synchronous clear here would misread a tap\n // as keyboard focus. The deferred clear runs after the whole tap\n // sequence settled.\n if (this.pointerClearTimer !== null) {\n clearTimeout(this.pointerClearTimer);\n }\n this.pointerClearTimer = setTimeout(() => {\n this.pointerActive = false;\n this.pointerClearTimer = null;\n }, 0);\n };\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this.doc.removeEventListener('pointerup', this.schedulePointerClear, true);\n if (this.pointerClearTimer !== null) {\n clearTimeout(this.pointerClearTimer);\n }\n });\n }\n\n /** @internal Arms the pointer flag for the imminent focusin. */\n protected handlePointerDown(): void {\n // A pending clear from the previous release must not fire mid-press.\n if (this.pointerClearTimer !== null) {\n clearTimeout(this.pointerClearTimer);\n this.pointerClearTimer = null;\n }\n this.pointerActive = true;\n // The flag must not outlive the click: a pointerdown that never focuses\n // (disabled child, text selection, drag released off-host) would\n // otherwise suppress the ring on the NEXT keyboard Tab-in. Document-level\n // capture catches the release wherever it lands.\n this.doc.addEventListener('pointerup', this.schedulePointerClear, {\n once: true,\n capture: true,\n });\n }\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 untracked,\n} from '@angular/core';\nimport {\n injectDirection,\n resolveBoundaryStep,\n resolveInlineStep,\n resolveStepFrom,\n} from '@cngx/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 * @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 '(focusin)': 'handleFocusIn($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 /** Document writing direction - flips the horizontal-arrow index deltas under `rtl` (APG). */\n private readonly direction = injectDirection();\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. Clamp the\n // model itself when the virtual space shrinks below it - a ghost\n // index would otherwise anchor the next arrow press. An empty space\n // (vc 0) keeps the model untouched so a repopulated list restores it.\n const clamped = vc > 0 ? Math.max(0, Math.min(active, vc - 1)) : active;\n if (clamped !== active) {\n untracked(() => this.activeIndex.set(clamped));\n }\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) === clamped ? '0' : '-1');\n });\n } else {\n // Standard mode: match by array index. The tab stop must land on an\n // enabled item - fall back to the first enabled one when the clamped\n // target is disabled (initial index into a disabled leaf, or the\n // active item got disabled). The model is written back so keyboard\n // navigation anchors where the tab stop actually sits. An empty list\n // keeps the model untouched so a repopulated list restores it.\n if (items.length === 0) {\n return;\n }\n let target = Math.max(0, Math.min(active, items.length - 1));\n if (items[target]?.disabled()) {\n target = this.findFirst(items) ?? target;\n }\n if (target !== active) {\n untracked(() => this.activeIndex.set(target));\n }\n items.forEach((item, i) =>\n (item.elementRef.nativeElement as HTMLElement).setAttribute(\n 'tabindex',\n i === target ? '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 // Never hijack browser/app shortcuts: Ctrl/Cmd/Alt combos pass through\n // untouched (Ctrl+Home, Cmd+ArrowLeft and friends belong to the app).\n if (event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n\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 inlineNav = (key: string): number | null => {\n if (!this.isHorizontal()) {\n return null;\n }\n const step = resolveInlineStep(key, this.direction());\n return step === null ? null : navigate(step);\n };\n\n const keyMap: Record<string, () => number | null> = {\n ArrowRight: () => inlineNav('ArrowRight'),\n ArrowLeft: () => inlineNav('ArrowLeft'),\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 * Keeps `activeIndex` in sync with real focus (APG): when an item gains\n * focus by any means - pointer click, script focus, assistive tech - the\n * tab stop follows it instead of staying on the last arrow-key target.\n */\n protected handleFocusIn(event: FocusEvent): void {\n const target = event.target as HTMLElement | null;\n if (target === null) {\n return;\n }\n const vc = this.virtualCount();\n if (vc != null) {\n const holder = target.closest('[data-cngx-recycle-index]');\n const idx = holder === null ? NaN : Number(holder.getAttribute('data-cngx-recycle-index'));\n if (Number.isInteger(idx) && idx >= 0 && idx < vc && idx !== this.activeIndex()) {\n this.activeIndex.set(idx);\n }\n return;\n }\n const items = this.items();\n const idx = items.findIndex((item) => {\n const el = item.elementRef.nativeElement as HTMLElement;\n return el === target || el.contains(target);\n });\n if (idx >= 0 && !items[idx].disabled() && idx !== this.activeIndex()) {\n this.activeIndex.set(idx);\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 (the resolver treats every index as\n * enabled when no `isDisabledAt` is supplied).\n */\n private findNextVirtual(current: number, total: number, direction: 1 | -1): number | null {\n return resolveStepFrom(current, direction, { count: total, loop: this.loop() });\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 return resolveStepFrom(current, direction, {\n count: items.length,\n loop: this.loop(),\n isDisabledAt: (i) => items[i].disabled(),\n });\n }\n\n private findFirst(items: readonly CngxRovingItem[]): number | null {\n return resolveBoundaryStep(1, {\n count: items.length,\n isDisabledAt: (i) => items[i].disabled(),\n });\n }\n\n private findLast(items: readonly CngxRovingItem[]): number | null {\n return resolveBoundaryStep(-1, {\n count: items.length,\n isDisabledAt: (i) => items[i].disabled(),\n });\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 linkedSignal,\n output,\n signal,\n} from '@angular/core';\nimport {\n injectDirection,\n resolveBoundaryStep,\n resolveInlineStep,\n resolveStepFrom,\n} from '@cngx/core';\nimport { createTypeaheadMatcher, injectLocale } from '@cngx/core/utils';\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 addresses the absolute index space\n * `[0, virtualCount)` even when only a window is rendered. Bind `windowStart`\n * to the recycler's window start so item lookups (id resolution, disabled\n * checks, typeahead labels) map absolute indices onto the rendered subset.\n * Targets outside the window surface as `pendingHighlight`; the consumer\n * scrolls them into view (`connectRecyclerToActiveDescendant`) and the\n * directive clears the pending state once the target renders.\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 * Absolute index of the first rendered item in virtual mode - the recycler\n * window start. All rendered-item lookups are offset by it so absolute\n * indices resolve the right item once the window has scrolled past 0.\n * Ignored when `virtualCount` is unset.\n */\n readonly windowStart = input<number>(0);\n /**\n * Equality used to find the previously active value again after the item\n * list changes. Defaults to `Object.is`; pass the same comparator as the\n * surrounding listbox / select when options are re-fetched as new objects\n * with equal identity, or the highlight drops on every refresh. The\n * parameters are typed `never` so a comparator over any value type binds\n * while the directive itself stays non-generic.\n */\n readonly compareWith = input<(a: never, b: never) => boolean>(Object.is);\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 * Emitted when a typeahead query finds no match in the rendered window.\n * Carries the resolved query term (lowercased; a repeated single letter\n * collapses to that letter per the APG cycle rule). The rendered window\n * is AD's whole search space - hosts whose real item space is larger\n * (collapsed tree branches, virtualized rows outside the window) listen\n * here to resolve the miss themselves.\n */\n readonly typeaheadMissed = output<string>();\n\n private readonly hostEl = inject(ElementRef<HTMLElement>);\n private readonly locale = injectLocale();\n private readonly registered = contentChildren(CNGX_AD_ITEM, { descendants: true });\n\n /** Document writing direction - flips the horizontal-arrow steps under `rtl` (APG). */\n private readonly direction = injectDirection();\n\n /** Guards host attribute writes until after first render. */\n private readonly initialized = signal(false);\n\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 /**\n * -1 means \"no active item\". Range is `[0, totalCount())`.\n *\n * Navigation writes the index; a change of the item space re-derives it.\n * The highlight follows its value, not its index: after the item list\n * changes, the previously active value is looked up again with\n * `compareWith`. Gone from a plain list means no highlight; in a virtual\n * window a value that merely scrolled out keeps its absolute index. The result is clamped to the new\n * item space, so the next arrow press never starts from a ghost index.\n */\n private readonly activeIndexState = linkedSignal<ActiveIndexSource, number>({\n source: () => ({\n items: this.resolvedItems(),\n total: this.totalCount(),\n offset: this.windowOffset(),\n virtual: this.virtualCount() != null,\n compareWith: this.compareWith() as (a: unknown, b: unknown) => boolean,\n }),\n computation: (source, previous) => {\n if (!previous) {\n return -1;\n }\n return clampIndex(reResolveIndex(source, previous.source, previous.value), source.total);\n },\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 return this.itemAt(idx);\n });\n\n /**\n * `activeItem` pinned to the item id for the `highlighted` emission: a\n * re-render that produces a fresh object for the same item must not\n * re-emit. `activeItem` itself stays identity-equal so `activeValue`\n * tracks value changes on an unchanged id.\n */\n private readonly highlightedItem = computed<ActiveDescendantItem | null>(\n () => this.activeItem(),\n { equal: (a, b) => a === b || (a !== null && b !== null && a.id === b.id) },\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 // Leading nulls are start-up state, not a highlight change - emit only\n // once something was highlighted (later resets back to null still emit).\n let hadHighlight = false;\n effect(() => {\n const item = this.highlightedItem();\n if (!hadHighlight && item === null) {\n return;\n }\n hadHighlight = true;\n this.highlighted.emit(item);\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 rendered item whose value matches (via `Object.is`).\n * No-op if no match. Disabled items are rejected when `skipDisabled()` is\n * true. In virtual mode only the rendered window is searched; the resolved\n * index is absolute.\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 + this.windowOffset());\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 // Never hijack browser/app shortcuts: Ctrl/Cmd/Alt combos pass through\n // untouched (Ctrl+C would otherwise hit the typeahead branch and get\n // preventDefault'd). Shift stays allowed - it produces printable chars.\n if (event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n\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 'ArrowRight':\n case 'ArrowLeft': {\n if (orientation !== 'horizontal') {\n return;\n }\n // RTL flips the horizontal arrows (same kernel roving uses).\n const step = resolveInlineStep(key, this.direction());\n if (step === 1) {\n this.highlightNext();\n } else if (step === -1) {\n this.highlightPrev();\n }\n return;\n }\n case 'ArrowUp':\n if (orientation === 'vertical') {\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 locale = this.locale();\n const next = this.typeaheadBuffer() + ch.toLocaleLowerCase(locale);\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 // Labels exist only for rendered items, so the search space is the\n // rendered window; matches map back to absolute indices in virtual mode.\n const items = this.resolvedItems();\n const skip = this.skipDisabled();\n const count = items.length;\n // APG cycle: a single-character query (including a repeated letter, whose\n // buffer collapses back to that letter) searches AFTER the active item so\n // each press advances through the matches. A genuine multi-character query\n // keeps matching the current item first.\n const sameChar = next.length > 1 && [...next].every((c) => c === next[0]);\n const term = sameChar ? next[0] : next;\n if (count === 0) {\n this.typeaheadMissed.emit(term);\n return;\n }\n const windowOffset = this.windowOffset();\n const activeRel = this.activeIndexState() < 0 ? -1 : this.activeIndexState() - windowOffset;\n const cycles = term.length === 1;\n const startRel = cycles ? activeRel + 1 : Math.max(0, activeRel);\n const matches = createTypeaheadMatcher(term, locale);\n for (let step = 0; step < count; step++) {\n const rel = (((startRel + step) % count) + count) % count;\n const candidate = items[rel];\n if (skip && candidate.disabled) {\n continue;\n }\n if (matches(candidate.label, candidate)) {\n this.activeIndexState.set(rel + windowOffset);\n return;\n }\n }\n this.typeaheadMissed.emit(term);\n }\n\n private findFrom(current: number, direction: 1 | -1): number | null {\n return resolveStepFrom(current, direction, {\n count: this.totalCount(),\n loop: this.loop(),\n isDisabledAt: this.skipDisabled() ? (i) => this.isDisabledAt(i) : undefined,\n });\n }\n\n /**\n * First/last navigable absolute index. Spans the full virtual range - End\n * targets `totalCount - 1` even when that item is not rendered (it surfaces\n * as `pendingHighlight`); unrendered items count as enabled because their\n * disabled state is unknowable (`isDisabledAt` resolves them to `false`).\n */\n private findBoundary(direction: 1 | -1): number | null {\n return resolveBoundaryStep(direction, {\n count: this.totalCount(),\n isDisabledAt: this.skipDisabled() ? (i) => this.isDisabledAt(i) : undefined,\n });\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 /** Rendered-window offset: `windowStart` in virtual mode, `0` otherwise. */\n private windowOffset(): number {\n return this.virtualCount() != null ? this.windowStart() : 0;\n }\n\n /** Item at an absolute index, `null` when outside the rendered window. */\n private itemAt(index: number): ActiveDescendantItem | null {\n const rel = index - this.windowOffset();\n const items = this.resolvedItems();\n if (rel < 0 || rel >= items.length) {\n return null;\n }\n return items[rel] ?? null;\n }\n\n private isDisabledAt(index: number): boolean {\n return !!this.itemAt(index)?.disabled;\n }\n\n private isRendered(index: number): boolean {\n return this.itemAt(index) !== null;\n }\n\n private scrollActiveIntoView(): void {\n const id = this.activeId();\n if (!id) {\n return;\n }\n // Document-wide by escaped id: aria-owns layouts render the option list\n // outside the host subtree, a host-scoped query never finds those.\n const doc = (this.hostEl.nativeElement as HTMLElement).ownerDocument;\n const el = doc.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 Item space the active index is derived against. */\ninterface ActiveIndexSource {\n readonly items: readonly ActiveDescendantItem[];\n readonly total: number;\n readonly offset: number;\n readonly virtual: boolean;\n readonly compareWith: (a: unknown, b: unknown) => boolean;\n}\n\n/**\n * @internal\n * Looks the previously active value up in the new item list. Unchanged items,\n * no previous highlight, or a previous index outside the old rendered window\n * keep the index as it is.\n */\nfunction reResolveIndex(\n source: ActiveIndexSource,\n previousSource: ActiveIndexSource,\n previousIndex: number,\n): number {\n if (previousSource.items === source.items || previousIndex < 0) {\n return previousIndex;\n }\n const previous = previousSource.items[previousIndex - previousSource.offset];\n if (!previous) {\n return previousIndex;\n }\n const match = source.items.findIndex((it) => source.compareWith(it.value, previous.value));\n if (match >= 0) {\n return match + source.offset;\n }\n return source.virtual ? previousIndex : -1;\n}\n\n/** @internal Pulls an index that ran past the item space back onto its last item. */\nfunction clampIndex(index: number, total: number): number {\n if (index < total) {\n return index;\n }\n return total > 0 ? total - 1 : -1;\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, type Signal } from '@angular/core';\nimport { createMediaQuerySignal } from '@cngx/core/utils';\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 * @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 this.prefersReducedMotion = createMediaQuerySignal(\n '(prefers-reduced-motion: reduce)',\n inject(DestroyRef),\n inject(DOCUMENT).defaultView,\n );\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, type AriaLivePoliteness } from './aria/live-announcer';\nexport { injectScopedLiveRegion, type CngxScopedLiveRegion } from './aria/scoped-live-region';\nexport type { CngxPendingAnnouncement } from './aria/live-region-pair';\nexport { CngxAutofocus } from './focus/autofocus.directive';\nexport { CngxFocusRestore, CNGX_FOCUSABLE_SELECTOR } from './focus/focus-restore.directive';\nexport {\n CngxFocusTrap,\n CNGX_FOCUS_TRAP_DRIVER,\n type CngxFocusTrapDriver,\n} 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCG;MAUU,gBAAgB,CAAA;;IAElB,QA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