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
+6 -2
View File
@@ -16,6 +16,7 @@ import { LAYER, LiveContext, type Nav, NavContext, type TvDeckRequest, useEscape
import { type Download, fetchDownloads } from "./downloads";
import { type Probe, probeHealth } from "./health";
import { Icon, type IconName } from "./icons";
import { control, cx } from "./look";
import { two } from "./parts";
import {
currentRoute,
@@ -586,7 +587,7 @@ export function App() {
</span>
<button
type="button"
className="control control-icon flex-none ml-2 sm:hidden"
className={cx(control({ shape: "icon" }), "flex-none ml-2 sm:hidden")}
aria-label="close search"
onClick={() => {
setSearching(false);
@@ -598,7 +599,10 @@ export function App() {
</div>
<button
type="button"
className="control control-icon group-data-searching/rail:hidden sm:hidden"
className={cx(
control({ shape: "icon" }),
"group-data-searching/rail:hidden sm:hidden",
)}
aria-label="search"
onClick={openSearch}
>