Raxol.Core.Accessibility.Behaviour behaviour (Raxol v0.4.0)
View SourceDefines the behaviour for accessibility services. This behaviour outlines the contract for modules that provide accessibility functionality such as screen reader announcements, feature toggles (high contrast, reduced motion, large text), and preference management related to accessibility.
Summary
Callbacks
Makes an announcement for screen readers.
Clears all pending announcements.
Disables accessibility features.
Enables accessibility features with the given options.
Gets the current color scheme based on accessibility settings.
Gets style settings for a component type.
Gets metadata for an element.
Gets the next announcement to be read by screen readers.
Gets an accessibility option value.
Gets the current text scale factor based on the large text setting.
Handles focus change events for accessibility announcements.
Checks if high contrast mode is enabled.
Checks if large text mode is enabled.
Checks if reduced motion mode is enabled.
Registers style settings for a component type.
Registers metadata for an element to be used for accessibility features.
Enables or disables high contrast mode.
Enables or disables large text mode.
Sets an accessibility option value.
Enables or disables reduced motion.
Callbacks
@callback announce( message :: String.t(), opts :: list(), user_preferences_pid_or_name :: atom() | pid() | nil ) :: :ok
Makes an announcement for screen readers.
@callback clear_announcements() :: :ok
Clears all pending announcements.
@callback disable() :: :ok
Disables accessibility features.
Enables accessibility features with the given options.
@callback get_color_scheme() :: map()
Gets the current color scheme based on accessibility settings.
Gets style settings for a component type.
Gets metadata for an element.
@callback get_next_announcement() :: String.t() | nil
Gets the next announcement to be read by screen readers.
@callback get_option( key :: atom(), user_preferences_pid_or_name :: atom() | pid() | nil, default :: any() ) :: any()
Gets an accessibility option value.
Gets the current text scale factor based on the large text setting.
@callback handle_focus_change(event_payload :: tuple()) :: :ok
Handles focus change events for accessibility announcements.
Checks if high contrast mode is enabled.
Checks if large text mode is enabled.
@callback reduced_motion_enabled?(user_preferences_pid_or_name :: atom() | pid() | nil) :: boolean()
Checks if reduced motion mode is enabled.
Registers style settings for a component type.
Registers metadata for an element to be used for accessibility features.
@callback set_high_contrast( enabled :: boolean(), user_preferences_pid_or_name :: atom() | pid() | nil ) :: :ok
Enables or disables high contrast mode.
@callback set_large_text( enabled :: boolean(), user_preferences_pid_or_name :: atom() | pid() | nil ) :: :ok
Enables or disables large text mode.
@callback set_option( key :: atom(), value :: any(), user_preferences_pid_or_name :: atom() | pid() | nil ) :: :ok
Sets an accessibility option value.
@callback set_reduced_motion( enabled :: boolean(), user_preferences_pid_or_name :: atom() | pid() | nil ) :: :ok
Enables or disables reduced motion.