import { KeyboardEvent } from 'react'; /** * Keyboard navigation helpers for consistent keyboard support across all components * * These utilities ensure consistent keyboard interaction patterns following * WCAG 2.2 Level AA standards and ARIA Authoring Practices Guide. */ export type KeyboardHandler = { onKeyDown: (e: KeyboardEvent) => void; }; /** * Create keyboard handler for button-like elements without native button behavior * Supports Enter and Space keys for activation * * @example * ```tsx * const keyboardHandler = createButtonKeyboardHandler( * (event) => event.currentTarget.click(), * false // disabled * ) * Click me * ``` */ export declare function createButtonKeyboardHandler(onClick: (event: KeyboardEvent) => void, disabled?: boolean): KeyboardHandler; /** * Create keyboard handler for arrow key navigation * Supports ArrowUp, ArrowDown, ArrowLeft, ArrowRight, Home, and End keys * * @example * ```tsx * const keyboardHandler = createArrowKeyHandler({ * onArrowDown: () => moveToNext(), * onArrowUp: () => moveToPrevious(), * onHome: () => moveToFirst(), * onEnd: () => moveToLast() * }) *
...
* ``` */ export declare function createArrowKeyHandler(options: { onArrowUp?: () => void; onArrowDown?: () => void; onArrowLeft?: () => void; onArrowRight?: () => void; onHome?: () => void; onEnd?: () => void; }): KeyboardHandler; /** * Create keyboard handler for escape key * * @example * ```tsx * const keyboardHandler = createEscapeHandler(() => closeModal()) *
Modal content
* ``` */ export declare function createEscapeHandler(onEscape: () => void): KeyboardHandler; /** * Create keyboard handler for tab trapping (modals, dropdowns) * Traps focus within a container by cycling between first and last elements * * @example * ```tsx * const firstElement = containerRef.current?.querySelector('[tabindex="0"]') * const lastElement = containerRef.current?.querySelector('[tabindex="0"]:last-child') * const keyboardHandler = createTabTrapHandler(firstElement, lastElement) *
Modal content
* ``` */ export declare function createTabTrapHandler(firstElement: HTMLElement | null, lastElement: HTMLElement | null): KeyboardHandler; /** * Create keyboard handler for list navigation * Combines arrow keys with Enter/Space for selection * * @example * ```tsx * const keyboardHandler = createListNavigationHandler({ * onArrowDown: () => moveToNext(), * onArrowUp: () => moveToPrevious(), * onSelect: () => selectCurrent() * }) *
    ...
* ``` */ export declare function createListNavigationHandler(options: { onArrowDown?: () => void; onArrowUp?: () => void; onArrowLeft?: () => void; onArrowRight?: () => void; onHome?: () => void; onEnd?: () => void; onSelect?: () => void; }): KeyboardHandler; /** * Create keyboard handler for grid navigation * Supports arrow keys for 2D navigation * * @example * ```tsx * const keyboardHandler = createGridNavigationHandler({ * onArrowUp: () => moveUp(), * onArrowDown: () => moveDown(), * onArrowLeft: () => moveLeft(), * onArrowRight: () => moveRight() * }) *
...
* ``` */ export declare function createGridNavigationHandler(options: { onArrowUp?: () => void; onArrowDown?: () => void; onArrowLeft?: () => void; onArrowRight?: () => void; onHome?: () => void; onEnd?: () => void; orientation?: 'horizontal' | 'vertical'; }): KeyboardHandler;