Raxol.Core.Accessibility (Raxol v2.0.1)
View SourceRefactored Accessibility module that delegates to the unified GenAccessibilityServer.
This module provides the same API as the original Accessibility module but uses a supervised GenServer instead of the Process dictionary for state management.
Migration Notice
This module is a drop-in replacement for Raxol.Core.Accessibility.
All functions maintain backward compatibility while providing improved
fault tolerance and functional programming patterns.
Benefits over Process Dictionary
- Unified state management across all accessibility features
- Supervised state with fault tolerance
- Pure functional transformations
- Announcement queuing with priority
- Better debugging and testing capabilities
- No global state pollution
Consolidated Modules
This refactored version consolidates functionality from:
Summary
Functions
Make an announcement for screen readers.
Make an announcement with user preferences (behaviour callback).
Announce component activation.
Announce with synchronous confirmation.
Announce value change.
Check if any accessibility feature is active.
Clear announcement history.
Clear all announcements (behaviour callback).
Disable accessibility features.
Enable accessibility features with the given options.
Check if accessibility features are enabled.
Ensures the Accessibility server is started.
Get announcement history.
Get accessibility metadata for a component.
Get all accessibility preferences.
Handle focus change event.
Check if high contrast mode is enabled.
Initialize accessibility with the given options.
Check if large text mode is enabled.
Check if reduced motion mode is enabled.
Remove metadata for a component.
Reset all accessibility settings to defaults.
Check if screen reader support is enabled.
Set announcement callback function.
Set high contrast mode.
Set keyboard focus indicators.
Set large text mode.
Set large text mode with user preferences (behaviour callback).
Set accessibility metadata for a component.
Set reduced motion mode.
Set screen reader support.
Update a specific metadata field for a component.
Functions
Make an announcement for screen readers.
Options
:priority- Priority level (:high, :medium, :low) default: :medium:interrupt- Whether to interrupt current announcement default: false:language- Language for the announcement
Make an announcement with user preferences (behaviour callback).
Announce component activation.
Announce with synchronous confirmation.
Announce value change.
Check if any accessibility feature is active.
Clear announcement history.
Clear all announcements (behaviour callback).
Disable accessibility features.
Enable accessibility features with the given options.
Options
:high_contrast- Enable high contrast mode (default:false):reduced_motion- Enable reduced motion (default:false):large_text- Enable large text (default:false):screen_reader- Enable screen reader support (default:true):keyboard_focus- Enable keyboard focus indicators (default:true):silence_announcements- Silence screen reader announcements (default:false)
Check if accessibility features are enabled.
Ensures the Accessibility server is started.
Get announcement history.
Get accessibility metadata for a component.
Get all accessibility preferences.
Handle focus change event.
Check if high contrast mode is enabled.
Initialize accessibility with the given options.
Check if large text mode is enabled.
Check if reduced motion mode is enabled.
Remove metadata for a component.
Reset all accessibility settings to defaults.
Check if screen reader support is enabled.
Set announcement callback function.
Set high contrast mode.
Set keyboard focus indicators.
Set large text mode.
Set large text mode with user preferences (behaviour callback).
Set accessibility metadata for a component.
Metadata fields
:label- Accessible label for the component:role- ARIA role (button, navigation, etc.):description- Extended description:hint- Usage hint for screen readers:state- Current state (expanded, selected, etc.)
Set reduced motion mode.
Set screen reader support.
Update a specific metadata field for a component.