/** * diwa-modal-utils.ts * ==================== * Accessibility and ARIA utilities for . * * Mirrors the PDS pattern used in: * packages/components/src/components/modal/modal-utils.ts * * Separating focus-trap and ARIA logic into a dedicated utility file keeps * the main component lean and makes accessibility behaviour independently * testable. */ /** * Returns all focusable elements within a root element or shadow root. * Used to build the focus-trap cycle when the modal is open. */ export declare const getFocusableElements: (root: Element | ShadowRoot) => HTMLElement[]; /** * Implements a keyboard focus trap within the modal shadow root. * * When Tab is pressed on the last focusable element, focus wraps to the first. * When Shift+Tab is pressed on the first, focus wraps to the last. * * WCAG 2.4.3 Focus Order — ensures that only the modal is reachable via * keyboard while it is open, preventing interaction with background content. * * @param e — The keydown KeyboardEvent (key must be 'Tab'). * @param focusable — Ordered list of focusable elements inside the modal. * @param activeEl — The currently focused element (from shadowRoot.activeElement). */ export declare const trapFocus: (e: KeyboardEvent, focusable: HTMLElement[], activeEl: Element | null) => void; //# sourceMappingURL=diwa-modal-utils.d.ts.map