/** * `accent` is the brand color (primary actions, focus, selection), not a status. Statuses use * success, warning (in progress, needs attention), danger, or merged (finished work: merged, applied, * completed). */ export type Tone = "neutral" | "accent" | "success" | "warning" | "danger" | "merged"; /** * Tinted surfaces (callouts, status rows, selected toggles). Borderless: the fill alone carries the * tone. Never pair a tinted fill with a contrasting border. */ export const TONE_SURFACE: Record = { neutral: "bg-gray-900 text-gray-300", accent: "bg-accent-950 text-accent-200", success: "bg-success-950 text-success-200", warning: "bg-warning-950 text-warning-200", danger: "bg-danger-950 text-danger-200", merged: "bg-merged-950 text-merged-200", }; /** Solid badge fills: no border, readable text on the fill. */ export const TONE_BADGE: Record = { neutral: "bg-gray-800 text-gray-200", accent: "bg-accent-500 text-gray-950", success: "bg-success-700 text-white", warning: "bg-warning-400 text-gray-950", danger: "bg-danger-700 text-white", merged: "bg-merged-600 text-white", }; /** Solid fills (dots, progress tracks). */ export const TONE_FILL: Record = { neutral: "bg-gray-500", accent: "bg-accent-500", success: "bg-success-500", warning: "bg-warning-400", danger: "bg-danger-500", merged: "bg-merged-500", }; /** Pressed/selected state for bordered toggles: the border disappears into the fill. */ export const SELECTED_SURFACE = "border-transparent bg-accent-950 text-accent-200"; /** * Tone for an issue or pull request state. Purple means finished work (merged, completed). A closed * pull request is only purple when it is known to be merged. */ export function issueStateTone(state: string, kind: { pull?: boolean; merged?: boolean } = {}): Tone { if (kind.merged) return "merged"; if (state === "open") return "success"; return kind.pull ? "neutral" : "merged"; }