/** * Button — action-gated (W2 §The Kit). The `onClick`/`action` prop NAMES a host * tool; the tree renderer binds it to the guarded, approval-gated pipe. Unlike * Crayon/Tambo/Tremor buttons (which can't mutate anything), this carries a real * host action. Standalone it just calls the bound callback. */ import type { PropsWithChildren } from "react"; import { type KitStyled, type KitTone } from "../tokens.js"; export interface ButtonProps extends KitStyled { label?: string; /** How loud the action is, in the Kit's ONE tone vocabulary. `accent` is the * page's own action and the default; `neutral` is the quiet one beside it. */ tone?: KitTone; /** @deprecated The older word for the same three tones — `primary`, * `secondary`, `danger`. Still read, so a stored screen keeps painting, but * `tone` is the word to write. */ variant?: "primary" | "secondary" | "danger"; disabled?: boolean; /** A lucide glyph before the label — the action's own mark. */ icon?: string; /** The action is in flight: a spinner takes the icon's place and the click is * refused, so a slow tool cannot be sent twice. */ loading?: boolean; /** Bound host-tool action (renderer-supplied). */ onClick?: () => void; type?: "button" | "submit"; /** The host's own class, written by the RENDERER and only on a ported node * (tree/renderer.tsx, after the props it binds — same containment as the * display bricks): the splitter rewrites a host