GPUI.Accessibility (gpui v0.2.0-rc.1)

Copy Markdown View Source

Bounded renderer-independent accessibility contracts for generic elements.

Semantic native components own their roles and state policy. This module validates explicit metadata on generic primitives before it crosses a display or transport boundary.

Summary

Functions

Returns generic accessibility attributes accepted by schema containers.

Returns whether an attribute map contains generic accessibility metadata.

Returns role specifications used by validation and native code generation.

Returns the closed generic accessibility role vocabulary.

Returns accessibility state-to-role validation rules.

Validates generic accessibility metadata for one supported element tag.

Types

checked()

@type checked() :: boolean() | :mixed

interaction()

@type interaction() :: :structural | :activate | :composite | :value

role()

@type role() :: String.t()

role_spec()

@type role_spec() :: {atom(), %{gpui: atom(), interaction: interaction()}}

state_rule()

@type state_rule() :: {atom(), [String.t()]}

Functions

attrs()

Returns generic accessibility attributes accepted by schema containers.

metadata?(attrs)

@spec metadata?(map()) :: boolean()

Returns whether an attribute map contains generic accessibility metadata.

role_specs()

@spec role_specs() :: [role_spec()]

Returns role specifications used by validation and native code generation.

roles()

@spec roles() :: [String.t()]

Returns the closed generic accessibility role vocabulary.

state_roles()

@spec state_roles() :: [state_rule()]

Returns accessibility state-to-role validation rules.

validate_generic!(tag, attrs)

@spec validate_generic!(atom(), map()) :: map()

Validates generic accessibility metadata for one supported element tag.