/** * Focus management helpers for accessibility * * These utilities ensure consistent focus management across all components, * following WCAG 2.2 Level AA standards for keyboard navigation and focus visibility. */ /** * Focus an element safely (handles cases where element might not exist) * * @example * ```tsx * const inputRef = useRef(null) * safeFocus(inputRef.current) * ``` */ export declare function safeFocus(element: HTMLElement | null): void; /** * Focus first focusable element in container * * @example * ```tsx * const containerRef = useRef(null) * focusFirstFocusable(containerRef.current!) * ``` */ export declare function focusFirstFocusable(container: HTMLElement): void; /** * Focus last focusable element in container * * @example * ```tsx * const containerRef = useRef(null) * focusLastFocusable(containerRef.current!) * ``` */ export declare function focusLastFocusable(container: HTMLElement): void; /** * Store and restore focus (for modals, dropdowns, etc.) * * @example * ```tsx * const focusManager = createFocusManager() * * // When opening modal * focusManager.store() * focusFirstFocusable(modalRef.current!) * * // When closing modal * focusManager.restore() * ``` */ export declare function createFocusManager(): { store: () => void; restore: () => void; getStored: () => HTMLElement | null; }; /** * Check if element is focusable * * @example * ```tsx * if (isFocusable(element)) { * element.focus() * } * ``` */ export declare function isFocusable(element: HTMLElement): boolean; /** * Get all focusable elements within a container * * @example * ```tsx * const focusables = getFocusableElements(containerRef.current!) * focusables.forEach(el => console.log(el)) * ``` */ export declare function getFocusableElements(container: HTMLElement): HTMLElement[]; /** * Check if focus is within a container * * @example * ```tsx * if (isFocusWithin(modalRef.current!)) { * // Focus is inside modal * } * ``` */ export declare function isFocusWithin(container: HTMLElement): boolean; /** * Focus next focusable element in document order * * @example * ```tsx * focusNextFocusable(currentElement) * ``` */ export declare function focusNextFocusable(currentElement: HTMLElement): void; /** * Focus previous focusable element in document order * * @example * ```tsx * focusPreviousFocusable(currentElement) * ``` */ export declare function focusPreviousFocusable(currentElement: HTMLElement): void; /** * Remove focus from element * * @example * ```tsx * removeFocus(element) * ``` */ export declare function removeFocus(element: HTMLElement): void;