claritykit-svelte
Version:
A comprehensive Svelte component library focused on accessibility, ADHD-optimized design, developer experience, and full SSR compatibility
110 lines • 3.63 kB
TypeScript
/**
* Cognitive Load Management for ADHD-Focused Components
*
* Provides intelligent cognitive load reduction, motion management, and
* interface simplification strategies specifically designed for ADHD users.
*/
export interface CognitiveLoadConfig {
respectReducedMotion: boolean;
enableAdaptiveAnimations: boolean;
defaultAnimationDuration: number;
emergencyMotionDisable: boolean;
enableProgressiveDisclosure: boolean;
maxVisibleOptions: number;
autoHideSecondaryActions: boolean;
simplifyOnCognitivePressure: boolean;
enableFocusAssist: boolean;
highlightActiveElements: boolean;
dimInactiveElements: boolean;
enableBreakReminders: boolean;
chunkedInformationDelivery: boolean;
maxInformationUnits: number;
enableContextualGuidance: boolean;
prioritizeEssentialInfo: boolean;
extendedTimeouts: boolean;
adaptivePacing: boolean;
enablePauseAnywhere: boolean;
defaultPaceMultiplier: number;
}
export interface CognitiveState {
overloadLevel: 'none' | 'mild' | 'moderate' | 'severe';
attentionSpan: 'short' | 'medium' | 'long';
processingSpeed: 'slow' | 'normal' | 'fast';
lastBreakTime: number;
cognitiveEffort: number;
taskComplexity: 'simple' | 'moderate' | 'complex';
}
export interface MotionPreferences {
reduceMotion: boolean;
allowEssentialMotion: boolean;
preferStaticFeedback: boolean;
customAnimationSpeed: number;
emergencyStopMotion: boolean;
}
/**
* Initialize cognitive load management system
*/
export declare function initCognitiveLoadManagement(userConfig?: Partial<CognitiveLoadConfig>): void;
/**
* Detect and respect system motion preferences
*/
export declare function detectMotionPreferences(): MotionPreferences;
/**
* Apply motion-safe animations for ADHD users
*/
export declare function applyMotionSafeAnimation(element: HTMLElement, animation: {
type: 'fade' | 'slide' | 'scale' | 'pulse' | 'essential-only';
duration?: number;
essential?: boolean;
fallback?: 'instant' | 'static-highlight' | 'none';
}): void;
/**
* Apply static feedback as alternative to motion
*/
export declare function applyStaticFeedback(element: HTMLElement, type?: 'instant' | 'static-highlight' | 'border-emphasis' | 'none'): void;
/**
* Assess and manage cognitive load levels
*/
export declare function assessCognitiveLoad(indicators: {
taskSwitches: number;
errorCount: number;
hesitationTime: number;
focusTime: number;
interactionSpeed: number;
}): CognitiveState;
/**
* Apply cognitive load reduction strategies
*/
export declare function applyLoadReductionStrategies(level: CognitiveState['overloadLevel']): void;
/**
* Implement progressive disclosure for complex interfaces
*/
export declare function implementProgressiveDisclosure(container: HTMLElement, options: {
initialVisible: number;
expandTrigger: 'click' | 'hover' | 'focus' | 'auto';
expandText: string;
collapseText: string;
animateExpansion: boolean;
}): void;
/**
* Create cognitive break reminders
*/
export declare function createBreakReminder(config: {
interval: number;
message: string;
dismissible: boolean;
autoHide: number;
}): void;
/**
* Get current cognitive state
*/
export declare function getCognitiveState(): CognitiveState;
/**
* Update cognitive load configuration
*/
export declare function updateCognitiveLoadConfig(updates: Partial<CognitiveLoadConfig>): void;
/**
* CSS for cognitive load management
*/
export declare function getCognitiveLoadCSS(): string;
//# sourceMappingURL=cognitive-load-management.d.ts.map