Drawn states (spec/02 §6): every component is always in exactly one, in this precedence,
each but live with a theme role, a glyph and words, and never blank.
iex> Macaw.Component.Drawn.pick([:stale, :loading])
:loading
iex> Macaw.Component.Drawn.role(:no_data)
:neutral
Summary
Functions
The eight states, in precedence order.
The glyph of the state's role's cue (Macaw.Layers.Theme.cue/1), nil for live.
The state of highest precedence among a list, :live for [].
A static notice for a state other than live: a paragraph with the state's class and
data-mw-drawn, a glyph element of the role's class hidden from assistive technology,
then the words. It is not a live region, so it holds in every mode. live is empty.
The state's theme role, nil for live.
The state's words, nil for live.
Types
Functions
@spec all() :: [t(), ...]
The eight states, in precedence order.
The glyph of the state's role's cue (Macaw.Layers.Theme.cue/1), nil for live.
The state of highest precedence among a list, :live for [].
@spec render(t(), Macaw.Component.Context.t() | nil) :: Phoenix.HTML.safe()
A static notice for a state other than live: a paragraph with the state's class and
data-mw-drawn, a glyph element of the role's class hidden from assistive technology,
then the words. It is not a live region, so it holds in every mode. live is empty.
iex> Macaw.Component.Drawn.render(:no_data, nil) |> Phoenix.HTML.safe_to_string()
~s(<p class="mw-drawn mw-drawn-no-data" data-mw-drawn="no_data"><span class="mw-glyph mw-glyph-diamond mw-role-neutral" aria-hidden="true"></span> No data</p>)
The state's theme role, nil for live.
The state's words, nil for live.