ColorField: shared color-input primitive, Theme Builder + Chart Builder migration

This commit is contained in:
2026-06-14 11:02:20 +03:00
parent 236b1c8a37
commit df6a0b3845
8 changed files with 240 additions and 114 deletions
+5
View File
@@ -179,6 +179,11 @@ UI by swapping one set of values. Borrowed from Carbon's layering model:
buttons are **`IconButton`** (24px `sm` exists solely for controls nested
_inside_ a 32px control — a search field's clear, a toast's dismiss); writing
`height:` on a new ad-hoc button is the code smell.
- **Color inputs go through `ColorField`** — the one home for the native
`type="color"` chrome reset and the optional paired hex field (read/copy/retype
a value). A bare `<input type="color">` is the code smell; the Theme Builder
swatches (`hex`) and the Chart Builder constant-colour binding (`size="sm"`,
inside a pill) share it. Per-context removal is the caller's, not the field's.
- **Buttons:** square, via the `Button` primitive. Variants: **primary** (filled
`--accent`), **secondary** (1px `--border-strong`, `--bg` fill —
so a bordered control on a gray panel goes white, never a darker gray), **ghost** (text-only, borderless; a transparent