Part of the unification order in the UI sweep issue (step b). A badge named its tones positive/warning/negative, a hint muted/warn/error/ok, a banner info/warning/error and a toast info/ok/error. They now all take the shared Tone: neutral, info, ok, warn, error (a badge adds accent for a selected choice). Warn is amber everywhere (a hint used yellow), info is cyan everywhere (a toast used purple). A test pins the list against each component's CSS.
10 lines
530 B
TypeScript
10 lines
530 B
TypeScript
// The one set of status tones: a badge, a hint, a banner and a toast all
|
|
// take a `Tone`, so "ok" or "warn" is spelled and coloured the same way
|
|
// everywhere. `neutral` is "no signal" (plain text, no colour); the other four
|
|
// map to the theme's green, amber, red and cyan (`--green`, `--amber`,
|
|
// `--red`, `--cyan`). A new component that shows a status takes a `Tone` and
|
|
// does not add a fifth spelling.
|
|
|
|
export const TONES = ["neutral", "info", "ok", "warn", "error"] as const;
|
|
|
|
export type Tone = (typeof TONES)[number];
|