Single source of truth mapping domain entity states to the canonical tone vocabulary and a human label.
The admin expresses state in many places — flag lifecycle badges, rollout
guardrails, the change-request queue, the schedule list. Before this module
each screen kept its own state_tone/1, so the same semantic state could
drift to different colors. Screens now call tone/2 (and optionally
label/2) with a domain, so a given state renders one consistent way
everywhere.
Canonical tones — each has a .rs-badge[data-tone=...] (and related) CSS rule:
positive · warning · critical · neutral · muted · accent.
Summary
Functions
Canonical human label for a domain state. Falls back to a humanized state.
Canonical tone string for a domain state. Falls back to neutral.
Types
@type domain() ::
:flag_lifecycle
| :flag_readiness
| :change_request
| :schedule
| :guardrail
| :audience
@type tone() :: String.t()