refactor(web): controls, toggles and segments as utilities

look.ts builds each control's class list from its whole state, so no
two utilities fight over a property. The contextual overrides from rows,
trays, page heads and the removal panel become props.

Refs #280

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Miguel Palhas
2026-11-11 17:40:50 +00:00
co-authored by Claude Opus 5.5
parent 288d4b26ad
commit e07db5a042
15 changed files with 277 additions and 408 deletions
+2 -1
View File
@@ -40,7 +40,8 @@ function walk(dir, out = []) {
}
const COLOR_LITERAL = /#[0-9a-fA-F]{3,8}\b|\b(?:oklch|oklab|lab|lch|rgba?|hsla?|hwb|color)\(/;
const RELATIVE_FROM_TOKEN = /\b(?:oklch|oklab|lab|lch|rgb|hsl|hwb|color)\(\s*from\s+var\(--/g;
// `_` is a space inside a Tailwind arbitrary value
const RELATIVE_FROM_TOKEN = /\b(?:oklch|oklab|lab|lch|rgb|hsl|hwb|color)\([\s_]*from[\s_]+var\(--/g;
const SPACING_PROP = /^(?:margin|padding|gap|row-gap|column-gap|inset)(?:-[a-z-]+)?$/;
const SPACING_VALUE = /^(?:var\(--[\w-]+\)|0|auto|-?[\d.]+%)$/;
const FONT_SIZE_VALUE = /^var\(--text-[\w-]+\)$/;