aura-glass
Version:
A comprehensive glassmorphism design system for React applications with 142+ production-ready components
103 lines • 2.64 kB
TypeScript
/**
* AuraGlass Accessibility Testing Framework
* Automated accessibility testing utilities for WCAG 2.1 AA compliance
*/
export interface A11yTestResult {
element: HTMLElement;
rule: string;
level: 'error' | 'warning' | 'info';
message: string;
suggestion?: string;
wcagReference?: string;
}
export interface A11yTestSuite {
name: string;
description: string;
tests: A11yTest[];
}
export interface A11yTest {
name: string;
rule: string;
test: (element: HTMLElement) => A11yTestResult[];
selector?: string;
}
/**
* Color contrast utilities
*/
export declare const ColorContrast: {
/**
* Convert hex color to RGB
*/
hexToRgb(hex: string): [number, number, number] | null;
/**
* Calculate relative luminance
*/
getLuminance(r: number, g: number, b: number): number;
/**
* Calculate contrast ratio between two colors
*/
getContrastRatio(color1: string, color2: string): number;
/**
* Check if contrast ratio meets WCAG standards
*/
meetsWCAG(ratio: number, level?: "AA" | "AAA", textSize?: "normal" | "large"): boolean;
};
/**
* Focus management tests
*/
export declare const FocusTests: A11yTestSuite;
/**
* ARIA tests
*/
export declare const AriaTests: A11yTestSuite;
/**
* Keyboard navigation tests
*/
export declare const KeyboardTests: A11yTestSuite;
/**
* Color and contrast tests
*/
export declare const ColorContrastTests: A11yTestSuite;
/**
* Form accessibility tests
*/
export declare const FormTests: A11yTestSuite;
/**
* Main accessibility testing function
*/
export declare class A11yTester {
private testSuites;
/**
* Add custom test suite
*/
addTestSuite(testSuite: A11yTestSuite): void;
/**
* Run all tests on a container element
*/
runTests(container?: HTMLElement): A11yTestResult[];
/**
* Run specific test by rule name
*/
runTestByRule(rule: string, container?: HTMLElement): A11yTestResult[];
/**
* Generate accessibility report
*/
generateReport(results: A11yTestResult[]): string;
}
/**
* Global accessibility tester instance
*/
export declare const a11yTester: A11yTester;
/**
* Helper function to quickly test an element
*/
export declare function testA11y(element?: HTMLElement): A11yTestResult[];
/**
* Helper function to log accessibility issues to console
*/
export declare function logA11yIssues(element?: HTMLElement): void;
/**
* Development-only automatic testing (only runs in development)
*/
export declare function enableA11yTesting(): void;
//# sourceMappingURL=a11yTesting.d.ts.map