aura-glass
Version:
A comprehensive glassmorphism design system for React applications with 142+ production-ready components
146 lines • 4.99 kB
TypeScript
/**
* AuraGlass Accessibility Enhancement Components and HOCs
* Higher-order components and wrappers to enhance accessibility of existing components
*/
import React from "react";
/**
* Enhanced keyboard shortcuts support
*/
export interface KeyboardShortcut {
key: string;
modifiers?: {
ctrl?: boolean;
alt?: boolean;
shift?: boolean;
meta?: boolean;
};
action: () => void;
description?: string;
global?: boolean;
preventDefault?: boolean;
}
export interface UseKeyboardShortcutsOptions {
shortcuts: KeyboardShortcut[];
enabled?: boolean;
}
export declare function useKeyboardShortcuts({ shortcuts, enabled, }: UseKeyboardShortcutsOptions): {
containerRef: React.RefObject<HTMLElement>;
};
/**
* HOC to add keyboard shortcuts to any component
*/
export declare function withKeyboardShortcuts<P extends {}>(Component: React.ComponentType<P>, shortcuts: KeyboardShortcut[]): React.ForwardRefExoticComponent<React.PropsWithoutRef<P & {
shortcutsEnabled?: boolean;
}> & React.RefAttributes<HTMLElement>>;
/**
* Enhanced Skip Links Component
*/
export interface SkipLinksProps {
links: Array<{
href: string;
label: string;
}>;
className?: string;
}
export declare function SkipLinks({ links, className }: SkipLinksProps): import("react/jsx-runtime").JSX.Element;
/**
* Enhanced Focus Trap Component
*/
export interface FocusTrapProps {
children: React.ReactNode;
active?: boolean;
restoreFocus?: boolean;
autoFocus?: boolean;
escapeDeactivates?: boolean;
onEscape?: () => void;
className?: string;
}
export declare function FocusTrap({ children, active, restoreFocus, autoFocus, escapeDeactivates, onEscape, className, }: FocusTrapProps): import("react/jsx-runtime").JSX.Element;
/**
* Enhanced Tooltip with keyboard support
*/
export interface AccessibleTooltipProps {
content: string;
children: React.ReactElement;
placement?: "top" | "bottom" | "left" | "right";
delay?: number;
className?: string;
}
export declare function AccessibleTooltip({ content, children, placement, delay, className, }: AccessibleTooltipProps): import("react/jsx-runtime").JSX.Element;
/**
* Enhanced Loading Spinner with accessibility
*/
export interface AccessibleLoadingProps {
loading: boolean;
children?: React.ReactNode;
loadingText?: string;
size?: "sm" | "md" | "lg";
className?: string;
}
export declare function AccessibleLoading({ loading, children, loadingText, size, className, }: AccessibleLoadingProps): import("react/jsx-runtime").JSX.Element;
/**
* Enhanced Form Field wrapper with comprehensive accessibility
*/
export interface AccessibleFormFieldProps {
children: React.ReactElement;
label?: string;
required?: boolean;
error?: string;
description?: string;
disabled?: boolean;
className?: string;
}
export declare function AccessibleFormField({ children, label, required, error, description, disabled, className, }: AccessibleFormFieldProps): import("react/jsx-runtime").JSX.Element;
/**
* Accessible Modal overlay with focus management
*/
export interface AccessibleModalOverlayProps {
children: React.ReactNode;
open: boolean;
onClose: () => void;
title?: string;
description?: string;
className?: string;
escapeCloses?: boolean;
backdropCloses?: boolean;
}
export declare function AccessibleModalOverlay({ children, open, onClose, title, description, className, escapeCloses, backdropCloses, }: AccessibleModalOverlayProps): import("react/jsx-runtime").JSX.Element | null;
/**
* Live Region component for dynamic content announcements
*/
export interface LiveRegionProps {
message?: string;
level?: "polite" | "assertive" | "off";
atomic?: boolean;
className?: string;
}
export declare function LiveRegion({ message, level, atomic, className, }: LiveRegionProps): import("react/jsx-runtime").JSX.Element;
/**
* Accessible Progress component
*/
export interface AccessibleProgressProps {
value: number;
max?: number;
min?: number;
label?: string;
description?: string;
showValue?: boolean;
className?: string;
}
export declare function AccessibleProgress({ value, max, min, label, description, showValue, className, }: AccessibleProgressProps): import("react/jsx-runtime").JSX.Element;
/**
* Export all accessibility enhancers
*/
export declare const A11yEnhancers: {
SkipLinks: typeof SkipLinks;
FocusTrap: typeof FocusTrap;
AccessibleTooltip: typeof AccessibleTooltip;
AccessibleLoading: typeof AccessibleLoading;
AccessibleFormField: typeof AccessibleFormField;
AccessibleModalOverlay: typeof AccessibleModalOverlay;
LiveRegion: typeof LiveRegion;
AccessibleProgress: typeof AccessibleProgress;
useKeyboardShortcuts: typeof useKeyboardShortcuts;
withKeyboardShortcuts: typeof withKeyboardShortcuts;
};
//# sourceMappingURL=a11yEnhancers.d.ts.map