claritykit-svelte
Version:
A comprehensive Svelte component library focused on accessibility, ADHD-optimized design, developer experience, and full SSR compatibility
147 lines • 4.69 kB
TypeScript
/**
* ARIA Utilities for Therapeutic Components
*
* Comprehensive ARIA attribute management specifically designed for therapeutic
* and ADHD-focused components with enhanced semantic meaning and context.
*/
export interface AriaTherapeuticProps {
label?: string;
labelledBy?: string;
describedBy?: string;
role?: string;
current?: 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time';
expanded?: boolean;
pressed?: boolean;
checked?: boolean | 'mixed';
selected?: boolean;
disabled?: boolean;
hidden?: boolean;
therapeuticType?: 'mood-tracker' | 'energy-indicator' | 'breathing-exercise' | 'crisis-control' | 'anchor' | 'meditation';
emotionalState?: string;
supportLevel?: 'low' | 'medium' | 'high' | 'crisis';
cognitiveLoad?: 'minimal' | 'low' | 'moderate' | 'high';
interactionMode?: 'keyboard' | 'mouse' | 'touch' | 'voice';
focusSupport?: 'enhanced' | 'standard' | 'minimal';
helpAvailable?: boolean;
progressValue?: number;
progressMax?: number;
progressText?: string;
completionState?: 'not-started' | 'in-progress' | 'completed' | 'paused';
liveRegion?: 'off' | 'polite' | 'assertive';
atomic?: boolean;
relevant?: 'additions' | 'removals' | 'text' | 'all';
customProps?: Record<string, string | number | boolean>;
}
/**
* Generate complete ARIA attributes for therapeutic components
*/
export declare function buildTherapeuticAriaProps(props: AriaTherapeuticProps): Record<string, string | boolean | number>;
/**
* Create ARIA description for mood tracking components
*/
export declare function createMoodAriaDescription(mood: {
value: number;
scale: '1-5' | '1-10' | 'emoji';
label: string;
description: string;
history?: number;
inputMethod: string;
}): string;
/**
* Create ARIA description for energy level indicators
*/
export declare function createEnergyAriaDescription(energy: {
level: string;
value: number;
description: string;
variant: string;
interactive: boolean;
}): string;
/**
* Create ARIA description for breathing exercises
*/
export declare function createBreathingAriaDescription(breathing: {
active: boolean;
phase?: 'inhale' | 'hold' | 'exhale';
cycleCount: number;
pattern: number[];
paused?: boolean;
}): string;
/**
* Create ARIA description for crisis mode controls
*/
export declare function createCrisisModeAriaDescription(crisis: {
enabled: boolean;
severity?: 'mild' | 'moderate' | 'severe';
adaptations?: string[];
autoDetect: boolean;
}): string;
/**
* Create live region for therapeutic announcements
*/
export declare function createTherapeuticLiveRegion(config: {
id: string;
priority: 'polite' | 'assertive';
atomic?: boolean;
relevant?: string;
className?: string;
}): HTMLElement;
/**
* Update therapeutic live region with debouncing
*/
export declare function updateTherapeuticLiveRegion(regionId: string, message: string, options?: {
debounce?: number;
clear?: boolean;
delay?: number;
}): void;
/**
* Create therapeutic component landmark
*/
export declare function createTherapeuticLandmark(config: {
type: 'region' | 'main' | 'complementary' | 'banner';
label: string;
description?: string;
therapeuticContext?: string;
}): Record<string, string>;
/**
* Generate keyboard shortcut announcements for therapeutic components
*/
export declare function announceKeyboardShortcuts(shortcuts: {
component: string;
shortcuts: Record<string, string>;
context?: string;
}): string;
/**
* Create accessible error messages for therapeutic components
*/
export declare function createTherapeuticErrorMessage(error: {
type: 'validation' | 'connection' | 'timeout' | 'user-input' | 'system';
message: string;
suggestion?: string;
emotional_support?: boolean;
recovery_action?: string;
}): string;
/**
* Build comprehensive screen reader content for complex therapeutic states
*/
export declare function buildScreenReaderContent(state: {
component: string;
currentState: Record<string, any>;
availableActions: string[];
helpHints: string[];
emotionalContext?: string;
progressInfo?: {
current: number;
total: number;
description: string;
};
}): string;
/**
* Export utility for creating hidden descriptions
*/
export declare function createHiddenDescription(id: string, content: string): HTMLElement;
/**
* Validate ARIA therapeutic props for development
*/
export declare function validateTherapeuticAriaProps(props: AriaTherapeuticProps): string[];
//# sourceMappingURL=aria-therapeutic.d.ts.map