/** * Shared ARIA attribute helpers for consistent accessibility across all components * * These utilities ensure consistent ARIA implementation following WCAG 2.2 Level AA standards * and reduce code duplication across components. */ export type AriaAttributes = { 'aria-label'?: string; 'aria-labelledby'?: string; 'aria-describedby'?: string; 'aria-expanded'?: boolean; 'aria-selected'?: boolean; 'aria-disabled'?: boolean; 'aria-busy'?: boolean; 'aria-invalid'?: boolean; 'aria-required'?: boolean; 'aria-controls'?: string; 'aria-live'?: 'polite' | 'assertive' | 'off'; 'aria-atomic'?: boolean; 'aria-haspopup'?: 'true' | 'false' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'; 'aria-modal'?: boolean; 'aria-orientation'?: 'horizontal' | 'vertical'; role?: string; }; /** * Generate ARIA attributes for button components * * @example * ```tsx * const ariaAttrs = getButtonAriaAttributes({ * disabled: true, * loading: false, * ariaLabel: 'Close dialog' * }) * * ``` */ export declare function getButtonAriaAttributes(props: { disabled?: boolean; loading?: boolean; skeleton?: boolean; ariaLabel?: string; ariaLabelledBy?: string; }): AriaAttributes; /** * Generate ARIA attributes for input components * * @example * ```tsx * const ariaAttrs = getInputAriaAttributes({ * id: 'email-input', * labelId: 'email-label', * errorId: 'email-error', * hintId: 'email-hint', * required: true, * invalid: true * }) * * ``` */ export declare function getInputAriaAttributes(props: { id: string; labelId?: string; errorId?: string; hintId?: string; required?: boolean; invalid?: boolean; describedBy?: string[]; }): AriaAttributes; /** * Generate ARIA attributes for modal/dialog components * * @example * ```tsx * const ariaAttrs = getModalAriaAttributes({ * id: 'dialog-1', * titleId: 'dialog-title', * descriptionId: 'dialog-description', * isAlert: false * }) *
...
* ``` */ export declare function getModalAriaAttributes(props: { id: string; titleId: string; descriptionId?: string; isAlert?: boolean; }): AriaAttributes; /** * Generate ARIA attributes for dropdown/select components * * @example * ```tsx * const ariaAttrs = getDropdownAriaAttributes({ * id: 'select-1', * isOpen: true, * triggerId: 'select-trigger', * menuId: 'select-menu' * }) * * ``` */ export declare function getDropdownAriaAttributes(props: { id: string; isOpen: boolean; triggerId: string; menuId: string; hasPopup?: 'listbox' | 'menu'; }): AriaAttributes; /** * Generate ARIA attributes for tab components * * @example * ```tsx * const ariaAttrs = getTabAriaAttributes({ * id: 'tab-1', * panelId: 'panel-1', * selected: true * }) * * ``` */ export declare function getTabAriaAttributes(props: { id: string; panelId: string; selected: boolean; controls?: string; }): AriaAttributes; /** * Generate ARIA attributes for tab panel components * * @example * ```tsx * const ariaAttrs = getTabPanelAriaAttributes({ * id: 'panel-1', * tabId: 'tab-1', * labelledBy: 'tab-1-label' * }) *
Panel content
* ``` */ export declare function getTabPanelAriaAttributes(props: { id: string; tabId: string; labelledBy?: string; }): AriaAttributes; /** * Generate ARIA attributes for accordion components * * @example * ```tsx * const ariaAttrs = getAccordionAriaAttributes({ * headerId: 'accordion-header-1', * contentId: 'accordion-content-1', * expanded: false * }) * * ``` */ export declare function getAccordionAriaAttributes(props: { headerId: string; contentId: string; expanded: boolean; }): AriaAttributes; /** * Generate ARIA live region attributes for dynamic content * * @example * ```tsx * const ariaAttrs = getLiveRegionAriaAttributes({ * live: 'assertive', * atomic: true * }) *
Error message
* ``` */ export declare function getLiveRegionAriaAttributes(props: { live?: 'polite' | 'assertive' | 'off'; atomic?: boolean; }): AriaAttributes; /** * Generate unique IDs for ARIA relationships * * @example * ```tsx * const labelId = generateAriaId('label') * const inputId = generateAriaId('input') * ``` */ export declare function generateAriaId(prefix: string): string; /** * Combine multiple ARIA attribute objects * Later objects override earlier ones for conflicting keys * * @example * ```tsx * const baseAttrs = getButtonAriaAttributes({ disabled: true }) * const additionalAttrs = { 'aria-label': 'Custom label' } * const merged = mergeAriaAttributes(baseAttrs, additionalAttrs) * ``` */ export declare function mergeAriaAttributes(...attrs: Array): AriaAttributes;