// The state vocabulary for data surfaces. See docs/design-language-interface.md ยง 3. // // Five tones and no others. The point of a closed set is that colour keeps meaning something: when a // view can reach for any of Tailwind's twenty-two palettes, green stops reading as "open" and starts // reading as "the author liked green here". Every tone maps to a semantic token, never a palette // number, so it follows the theme and survives dark mode. // // Class strings are written out in full rather than composed (`text-${tone}`) because Tailwind's // scanner reads source text โ€” an interpolated class name is not in the output CSS at all. export type Tone = 'neutral' | 'success' | 'warning' | 'danger' | 'info'; /** Foreground only โ€” for an icon or a word carrying state inside otherwise normal text. */ export const toneText: Record = { neutral: 'text-muted-foreground', success: 'text-success', warning: 'text-warning', danger: 'text-destructive', info: 'text-info', }; /** * The tinted fill used by pills and badges. Always /15 โ€” a solid saturated fill on something this * small fights the text on top of it and shouts louder than the state deserves. */ export const toneFill: Record = { neutral: 'bg-muted text-muted-foreground', success: 'bg-success/15 text-success', warning: 'bg-warning/15 text-warning', danger: 'bg-destructive/15 text-destructive', info: 'bg-info/15 text-info', }; /** A left border or rule carrying state, for rows that mark status without a pill. */ export const toneBorder: Record = { neutral: 'border-border', success: 'border-success', warning: 'border-warning', danger: 'border-destructive', info: 'border-info', };