diff --git a/ui/src/components/ThemePaletteGrid.tsx b/ui/src/components/ThemePaletteGrid.tsx index a0c130b6..eed1aa4f 100644 --- a/ui/src/components/ThemePaletteGrid.tsx +++ b/ui/src/components/ThemePaletteGrid.tsx @@ -1,6 +1,11 @@ -import { Badge } from "@/components/ui/badge"; import { cn } from "@/lib/utils"; +/** + * Palette role shape emitted by the theme-generation workshop. + * Each role carries both a dark and light variant resolved as OKLCH + hex + * alongside a WCAG AA pass/fail flag computed against the generated + * background. + */ export interface PaletteRole { name: string; dark: { oklch: string; hex: string; wcagAA: boolean }; @@ -18,9 +23,9 @@ const ROLE_LABELS: Record = { surface: "Surface", overlay: "Overlay", text: "Text", - "accent-1": "Accent-1", - "accent-2": "Accent-2", - "accent-3": "Accent-3", + "accent-1": "Accent 1", + "accent-2": "Accent 2", + "accent-3": "Accent 3", }; function Swatch({ @@ -34,34 +39,35 @@ function Swatch({ const label = ROLE_LABELS[role.name] ?? role.name; return ( -
+
- - {entry.hex} - - {entry.wcagAA ? ( - + + {label} + + + {entry.hex} + + - AA - - ) : ( - - Fails AA - - )} + {entry.wcagAA ? "AA" : "Fails AA"} + +
); } @@ -75,8 +81,8 @@ function PaletteRow({ }) { return (
- - {variant} + + {variant === "dark" ? "Dark mode" : "Light mode"}
{palette.map((role) => ( @@ -89,28 +95,36 @@ function PaletteRow({ export function ThemePaletteGrid({ palette, - variant = "dark", + variant, className, }: ThemePaletteGridProps) { if (palette.length === 0) { return (
-

- No palette yet -

-

- Pick a seed color to generate a full OKLCH palette with dark and light - variants. +

No palette yet

+

+ Pick a seed color to generate a full OKLCH palette with dark and + light variants.

); } + // When variant is passed explicitly, render only that row. Otherwise show + // both dark and light, so reviewers can compare the generated bundle. + if (variant) { + return ( +
+ +
+ ); + } + return (