---
title: "Theme Showcase · UI SDK — StyleX Blocks"
description: "Interactive design-system and token workbench featuring scoped accent, density, and corner-radius live preview controls over a responsive 3-column bento of cohesive UI SDK cards."
url: "https://stylexblocks.com/block/ui-sdk/theme-showcase/"
agent:
  instructions: "Use this search API to find relevant components and blocks across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://stylexblocks.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Theme Showcase block

Interactive design-system and token workbench featuring scoped accent, density, and corner-radius live preview controls over a responsive 3-column bento of cohesive UI SDK cards.

- Behavior engine: UI SDK
- Category: [Content](https://stylexblocks.com/blocks/content.md)
- Built with: [Alert](https://stylexblocks.com/components/ui-sdk/alert.md), [Avatar](https://stylexblocks.com/components/ui-sdk/avatar.md), [Badge](https://stylexblocks.com/components/ui-sdk/badge.md), [Button](https://stylexblocks.com/components/ui-sdk/button.md), [Card](https://stylexblocks.com/components/ui-sdk/card.md), [Center](https://stylexblocks.com/components/ui-sdk/center.md), [Checkbox](https://stylexblocks.com/components/ui-sdk/checkbox.md), [Code](https://stylexblocks.com/components/ui-sdk/code.md), [Color Swatch](https://stylexblocks.com/components/ui-sdk/color-swatch.md), [Grid](https://stylexblocks.com/components/ui-sdk/grid.md), [Heading](https://stylexblocks.com/components/ui-sdk/heading.md), [Icon](https://stylexblocks.com/components/ui-sdk/icon.md), [Input](https://stylexblocks.com/components/ui-sdk/input.md), [Kbd](https://stylexblocks.com/components/ui-sdk/kbd.md), [Number Input](https://stylexblocks.com/components/ui-sdk/number-input.md), [Progress](https://stylexblocks.com/components/ui-sdk/progress.md), [Progress Circle](https://stylexblocks.com/components/ui-sdk/progress-circle.md), [Radio Card](https://stylexblocks.com/components/ui-sdk/radio-card.md), [Radio Group](https://stylexblocks.com/components/ui-sdk/radio-group.md), [Rating Group](https://stylexblocks.com/components/ui-sdk/rating-group.md), [Segment Group](https://stylexblocks.com/components/ui-sdk/segment-group.md), [Select](https://stylexblocks.com/components/ui-sdk/select.md), [Separator](https://stylexblocks.com/components/ui-sdk/separator.md), [Slider](https://stylexblocks.com/components/ui-sdk/slider.md), [Stack](https://stylexblocks.com/components/ui-sdk/stack.md), [Stat](https://stylexblocks.com/components/ui-sdk/stat.md), [Status](https://stylexblocks.com/components/ui-sdk/status.md), [Switch](https://stylexblocks.com/components/ui-sdk/switch.md), [Tabs](https://stylexblocks.com/components/ui-sdk/tabs.md), [Tag](https://stylexblocks.com/components/ui-sdk/tag.md), [Text](https://stylexblocks.com/components/ui-sdk/text.md), [Timeline](https://stylexblocks.com/components/ui-sdk/timeline.md), [Toast](https://stylexblocks.com/components/ui-sdk/toast.md), [Tooltip](https://stylexblocks.com/components/ui-sdk/tooltip.md)
- HTML page: https://stylexblocks.com/block/ui-sdk/theme-showcase/

## Install

Configure the project once (sets the behavior engine and import aliases):

```sh
npx stylexblocks init --style ui-sdk
```

Then add the item as source you own:

```sh
npx stylexblocks add theme-showcase
```

Equivalent: `npx shadcn add @stylexblocks/theme-showcase`. Registry item JSON: https://stylexblocks.com/r/ui-sdk/theme-showcase.json

## Usage

```tsx
import { ThemeShowcase } from "#components/blocks/ui-sdk/theme-showcase.tsx";

export function Example() {
  return (
    <div style={{ minHeight: "100dvh" }}>
      <ThemeShowcase />
    </div>
  );
}
```

## Source

`components/blocks/ui-sdk/theme-showcase.tsx`

```tsx
import * as stylex from "@stylexjs/stylex";
import { useCallback, useMemo, useState } from "react";
import { Alert } from "#components/ui/ui-sdk/alert.tsx";
import { Avatar } from "#components/ui/ui-sdk/avatar.tsx";
import { Badge } from "#components/ui/ui-sdk/badge.tsx";
import { Button } from "#components/ui/ui-sdk/button.tsx";
import { Card } from "#components/ui/ui-sdk/card.tsx";
import { Square } from "#components/ui/ui-sdk/center.tsx";
import { Checkbox } from "#components/ui/ui-sdk/checkbox.tsx";
import { Code } from "#components/ui/ui-sdk/code.tsx";
import { ColorSwatch } from "#components/ui/ui-sdk/color-swatch.tsx";
import { Grid } from "#components/ui/ui-sdk/grid.tsx";
import { Heading } from "#components/ui/ui-sdk/heading.tsx";
import { Icon } from "#components/ui/ui-sdk/icon.tsx";
import { Input } from "#components/ui/ui-sdk/input.tsx";
import { Kbd } from "#components/ui/ui-sdk/kbd.tsx";
import { NumberInput } from "#components/ui/ui-sdk/number-input.tsx";
import { Progress } from "#components/ui/ui-sdk/progress.tsx";
import { ProgressCircle } from "#components/ui/ui-sdk/progress-circle.tsx";
import { RadioCard } from "#components/ui/ui-sdk/radio-card.tsx";
import { RadioGroup } from "#components/ui/ui-sdk/radio-group.tsx";
import { RatingGroup } from "#components/ui/ui-sdk/rating-group.tsx";
import { SegmentGroup } from "#components/ui/ui-sdk/segment-group.tsx";
import { Select } from "#components/ui/ui-sdk/select.tsx";
import { Separator } from "#components/ui/ui-sdk/separator.tsx";
import { Slider } from "#components/ui/ui-sdk/slider.tsx";
import { HStack, VStack } from "#components/ui/ui-sdk/stack.tsx";
import { Stat } from "#components/ui/ui-sdk/stat.tsx";
import { Status } from "#components/ui/ui-sdk/status.tsx";
import { Switch } from "#components/ui/ui-sdk/switch.tsx";
import { Tabs } from "#components/ui/ui-sdk/tabs.tsx";
import { Tag } from "#components/ui/ui-sdk/tag.tsx";
import { Text } from "#components/ui/ui-sdk/text.tsx";
import { Timeline } from "#components/ui/ui-sdk/timeline.tsx";
import { Toast, Toaster } from "#components/ui/ui-sdk/toast.tsx";
import { Tooltip } from "#components/ui/ui-sdk/tooltip.tsx";
import { colorPalette } from "@stylexblocks/ui/color-palette.stylex.ts";
import { semanticColors } from "@stylexblocks/ui/semantic-tokens/colors.stylex.ts";
import { semanticRadii } from "@stylexblocks/ui/semantic-tokens/radii.stylex.ts";
import {
  accentPalette,
  amberPalette,
  bluePalette,
  emeraldPalette,
  indigoPalette,
  redPalette,
  rosePalette,
  skyPalette,
  tealPalette,
  violetPalette,
} from "@stylexblocks/ui/themes/palettes.ts";
import { durations } from "@stylexblocks/ui/tokens/durations.stylex.ts";
import { fontSizes } from "@stylexblocks/ui/tokens/font-sizes.stylex.ts";
import { fonts } from "@stylexblocks/ui/tokens/fonts.stylex.ts";
import { lineHeights } from "@stylexblocks/ui/tokens/line-heights.stylex.ts";
import { radii } from "@stylexblocks/ui/tokens/radii.stylex.ts";
import { sizes } from "@stylexblocks/ui/tokens/sizes.stylex.ts";
import { spacing } from "@stylexblocks/ui/tokens/spacing.stylex.ts";
import type { StyleOverrideProps } from "#lib/recipe-props.ts";

export type ThemeAccentPreset =
  | "theme"
  | "indigo"
  | "teal"
  | "emerald"
  | "amber"
  | "rose"
  | "violet"
  | "sky";

export type ThemeDensityPreset = "compact" | "default" | "spacious";

export type ThemeRadiusPreset = "theme" | "sharp" | "soft" | "pill";

export type TeamMemberRole = "owner" | "maintainer" | "reviewer";

export interface ThemeShowcaseMember {
  id: string;
  name: string;
  email: string;
  initials: string;
  role: TeamMemberRole;
  accent: "indigo" | "teal" | "violet" | "emerald" | "amber" | "rose";
}

export interface ThemeShowcaseExportPayload {
  accent: ThemeAccentPreset;
  density: ThemeDensityPreset;
  radius: ThemeRadiusPreset;
  snippet: string;
}

export interface ThemeShowcaseProps extends StyleOverrideProps {
  /** Top banner heading. */
  title?: string;
  /** Supporting subtitle describing the live token workbench. */
  description?: string;
  /** Initial scoped accent preset. */
  defaultAccent?: ThemeAccentPreset;
  /** Initial scoped density scale. */
  defaultDensity?: ThemeDensityPreset;
  /** Initial scoped corner radius profile. */
  defaultRadius?: ThemeRadiusPreset;
  /** Optional callback fired whenever the user exports the active token summary. */
  onExportTokens?: (payload: ThemeShowcaseExportPayload) => void;
}

const ACCENT_OPTIONS: ReadonlyArray<{
  id: ThemeAccentPreset;
  label: string;
  tokenHint: string;
}> = [
  { id: "theme", label: "Theme default", tokenHint: "accentPalette" },
  { id: "indigo", label: "Indigo", tokenHint: "indigoPalette" },
  { id: "teal", label: "Teal", tokenHint: "tealPalette" },
  { id: "emerald", label: "Emerald", tokenHint: "emeraldPalette" },
  { id: "amber", label: "Amber", tokenHint: "amberPalette" },
  { id: "rose", label: "Rose", tokenHint: "rosePalette" },
  { id: "violet", label: "Violet", tokenHint: "violetPalette" },
  { id: "sky", label: "Sky", tokenHint: "skyPalette" },
];

const ACCENT_PALETTES: Record<ThemeAccentPreset, stylex.Theme<typeof colorPalette>> = {
  theme: accentPalette,
  indigo: indigoPalette,
  teal: tealPalette,
  emerald: emeraldPalette,
  amber: amberPalette,
  rose: rosePalette,
  violet: violetPalette,
  sky: skyPalette,
};

const MEMBER_AVATAR_PALETTES: Record<
  ThemeShowcaseMember["accent"],
  stylex.Theme<typeof colorPalette>
> = {
  indigo: indigoPalette,
  teal: tealPalette,
  violet: violetPalette,
  emerald: emeraldPalette,
  amber: amberPalette,
  rose: rosePalette,
};

const ROLE_OPTIONS: ReadonlyArray<{ value: TeamMemberRole; label: string }> = [
  { value: "owner", label: "Owner" },
  { value: "maintainer", label: "Maintainer" },
  { value: "reviewer", label: "Reviewer" },
];

const INITIAL_MEMBERS: readonly ThemeShowcaseMember[] = [
  {
    id: "sora",
    name: "Sora Takahashi",
    email: "sora@solstice.design",
    initials: "ST",
    role: "owner",
    accent: "indigo",
  },
  {
    id: "mateo",
    name: "Mateo Delgado",
    email: "mateo@solstice.design",
    initials: "MD",
    role: "maintainer",
    accent: "teal",
  },
  {
    id: "anika",
    name: "Anika Lindholm",
    email: "anika@solstice.design",
    initials: "AL",
    role: "reviewer",
    accent: "violet",
  },
];

type PlanTier = "studio" | "scale" | "enterprise";

const PLAN_OPTIONS: ReadonlyArray<{
  value: PlanTier;
  label: string;
  summary: string;
  monthlyPerSeat: number;
}> = [
  {
    value: "studio",
    label: "Studio",
    summary: "Shared token registries & preview builds",
    monthlyPerSeat: 24,
  },
  {
    value: "scale",
    label: "Scale",
    summary: "Multi-brand themes, SSO & visual diffs",
    monthlyPerSeat: 52,
  },
  {
    value: "enterprise",
    label: "Enterprise",
    summary: "Dedicated edge cache & SLA audit stream",
    monthlyPerSeat: 96,
  },
];

type AlertTone = "info" | "success" | "warning" | "error";

const ALERT_PRESETS: ReadonlyArray<{
  tone: AlertTone;
  label: string;
  title: string;
  description: string;
  palette: stylex.Theme<typeof colorPalette>;
}> = [
  {
    tone: "success",
    label: "Pass",
    title: "Contrast audit passed (WCAG AA)",
    description: "All 38 interactive surfaces cleared 4.5:1 foreground contrast in light and dark mode.",
    palette: emeraldPalette,
  },
  {
    tone: "info",
    label: "Info",
    title: "Scoped overrides active",
    description: "Changes in the top bar preview StyleX theme layers without mutating your global tokens.",
    palette: bluePalette,
  },
  {
    tone: "warning",
    label: "Warn",
    title: "Canary token drift detected",
    description: "2 spacing overrides differ from solstice-core v2.4. Review before publishing release notes.",
    palette: amberPalette,
  },
  {
    tone: "error",
    label: "Alert",
    title: "Strict focus ring check",
    description: "Verify custom surface cards preserve a visible focus outline across high-contrast palettes.",
    palette: redPalette,
  },
];

const ACTIVITY_EVENTS: ReadonlyArray<{
  id: string;
  title: string;
  time: string;
  detail: string;
  tag: string;
  tagPalette: stylex.Theme<typeof colorPalette>;
}> = [
  {
    id: "evt-tokens",
    title: "Published OKLCH semantic palette",
    time: "14m ago",
    detail: "Calibrated accentMuted and focusRing stops across 8 chromatic scales.",
    tag: "tokens",
    tagPalette: indigoPalette,
  },
  {
    id: "evt-a11y",
    title: "Verified keyboard focus order",
    time: "2h ago",
    detail: "Confirmed roving tab-index in RadioCard, Tabs, SegmentGroup, and Timeline.",
    tag: "a11y",
    tagPalette: emeraldPalette,
  },
  {
    id: "evt-release",
    title: "Cut Solstice UI v2.4.0 snapshot",
    time: "Yesterday",
    detail: "Synced 14 radius and control-size variables to staging docs.",
    tag: "release",
    tagPalette: tealPalette,
  },
];

const SWATCH_SPECIMENS: ReadonlyArray<{
  id: keyof typeof tokenSwatchStyles;
  label: string;
  token: string;
}> = [
  { id: "accentSolid", label: "Accent solid", token: "colorPalette.solid" },
  { id: "accentSubtle", label: "Accent subtle", token: "colorPalette.subtle" },
  { id: "accentFg", label: "Accent fg", token: "colorPalette.fg" },
  { id: "bg", label: "Canvas bg", token: "semanticColors.bg" },
  { id: "bgSurface", label: "Surface", token: "semanticColors.bgSurface" },
  { id: "bgMuted", label: "Muted bg", token: "semanticColors.bgMuted" },
  { id: "fg", label: "Primary ink", token: "semanticColors.fg" },
  { id: "fgMuted", label: "Muted ink", token: "semanticColors.fgMuted" },
  { id: "border", label: "Border", token: "semanticColors.borderEmphasized" },
  { id: "success", label: "Success", token: "semanticColors.successSolid" },
  { id: "warning", label: "Warning", token: "semanticColors.warningSolid" },
  { id: "destructive", label: "Destructive", token: "semanticColors.destructiveSolid" },
];

// Scoped StyleX theme layers for live previewing radius and density overrides
// directly inside the workbench canvas without leaking into the host app.
const sharpRadiiTheme = stylex.createTheme(semanticRadii, {
  l1: "0.0625rem",
  l2: "0.125rem",
  l3: "0.1875rem",
  control: "0.125rem",
  controlSm: "0.0625rem",
  controlMd: "0.125rem",
  controlLg: "0.1875rem",
  panel: "0.1875rem",
  panelSm: "0.125rem",
  panelMd: "0.1875rem",
  panelLg: "0.25rem",
  indicator: "0.125rem",
  indicatorSm: "0.0625rem",
  indicatorMd: "0.125rem",
  indicatorLg: "0.1875rem",
});

const softRadiiTheme = stylex.createTheme(semanticRadii, {
  l1: "0.375rem",
  l2: "0.5rem",
  l3: "0.75rem",
  control: "0.5rem",
  controlSm: "0.375rem",
  controlMd: "0.5rem",
  controlLg: "0.75rem",
  panel: "0.875rem",
  panelSm: "0.625rem",
  panelMd: "0.875rem",
  panelLg: "1.125rem",
  indicator: "0.5rem",
  indicatorSm: "0.375rem",
  indicatorMd: "0.5rem",
  indicatorLg: "0.75rem",
});

const pillRadiiTheme = stylex.createTheme(semanticRadii, {
  l1: "0.5rem",
  l2: "0.75rem",
  l3: "1rem",
  control: "9999px",
  controlSm: "9999px",
  controlMd: "9999px",
  controlLg: "9999px",
  panel: "1.25rem",
  panelSm: "0.875rem",
  panelMd: "1.25rem",
  panelLg: "1.5rem",
  indicator: "9999px",
  indicatorSm: "9999px",
  indicatorMd: "9999px",
  indicatorLg: "9999px",
});

const compactSpacingTheme = stylex.createTheme(spacing, {
  _0_5: "0.1rem",
  _1: "0.2rem",
  _1_5: "0.3rem",
  _2: "0.4rem",
  _2_5: "0.5rem",
  _3: "0.625rem",
  _3_5: "0.725rem",
  _4: "0.825rem",
  _4_5: "0.95rem",
  _5: "1.05rem",
  _6: "1.25rem",
});

const spaciousSpacingTheme = stylex.createTheme(spacing, {
  _0_5: "0.15rem",
  _1: "0.3rem",
  _1_5: "0.45rem",
  _2: "0.6rem",
  _2_5: "0.75rem",
  _3: "0.9rem",
  _3_5: "1.05rem",
  _4: "1.2rem",
  _4_5: "1.35rem",
  _5: "1.5rem",
  _6: "1.8rem",
});

const compactSizesTheme = stylex.createTheme(sizes, {
  controlXs: "1.375rem",
  controlSm: "1.625rem",
  controlMd: "1.875rem",
  controlLg: "2.25rem",
  controlXl: "2.75rem",
});

const spaciousSizesTheme = stylex.createTheme(sizes, {
  controlXs: "1.75rem",
  controlSm: "2rem",
  controlMd: "2.375rem",
  controlLg: "2.875rem",
  controlXl: "3.375rem",
});

const accentSwatchStyles = stylex.create({
  theme: { "--color": semanticColors.accentSolid },
  indigo: { "--color": semanticColors.indigoSolid },
  teal: { "--color": semanticColors.tealSolid },
  emerald: { "--color": semanticColors.emeraldSolid },
  amber: { "--color": semanticColors.amberSolid },
  rose: { "--color": semanticColors.roseSolid },
  violet: { "--color": semanticColors.violetSolid },
  sky: { "--color": semanticColors.skySolid },
});

const tokenSwatchStyles = stylex.create({
  accentSolid: { "--color": colorPalette.solid },
  accentSubtle: { "--color": colorPalette.subtle },
  accentFg: { "--color": colorPalette.fg },
  bg: { "--color": semanticColors.bg },
  bgSurface: { "--color": semanticColors.bgSurface },
  bgMuted: { "--color": semanticColors.bgMuted },
  fg: { "--color": semanticColors.fg },
  fgMuted: { "--color": semanticColors.fgMuted },
  border: { "--color": semanticColors.borderEmphasized },
  success: { "--color": semanticColors.successSolid },
  warning: { "--color": semanticColors.warningSolid },
  destructive: { "--color": semanticColors.destructiveSolid },
});

const MEDIUM = "@container theme-showcase (max-width: 1080px)";
const COMPACT = "@container theme-showcase (max-width: 720px)";

const styles = stylex.create({
  root: {
    backgroundColor: semanticColors.bg,
    color: semanticColors.fg,
    containerName: "theme-showcase",
    containerType: "inline-size",
    display: "flex",
    flexDirection: "column",
    fontFamily: fonts.body,
    minHeight: "100%",
    width: "100%",
  },
  topStrip: {
    backgroundColor: semanticColors.bgSurface,
    borderBottomColor: semanticColors.borderSubtle,
    borderBottomStyle: "solid",
    borderBottomWidth: "1px",
    paddingBlock: spacing._5,
    paddingInline: {
      default: spacing._6,
      [COMPACT]: spacing._4,
    },
  },
  maxWidthInner: {
    marginInline: "auto",
    maxWidth: "82rem",
    width: "100%",
  },
  headerRow: {
    columnGap: spacing._4,
    rowGap: spacing._3,
  },
  brandBlock: {
    maxWidth: "40rem",
  },
  brandEyebrow: {
    columnGap: spacing._2,
    rowGap: spacing._1_5,
  },
  brandMark: {
    backgroundColor: colorPalette.subtle,
    borderColor: colorPalette.border,
    borderRadius: semanticRadii.controlSm,
    borderStyle: "solid",
    borderWidth: "1px",
    color: colorPalette.fg,
  },
  pageTitle: {
    marginBlock: 0,
  },
  leadingMd: {
    lineHeight: lineHeights.md,
  },
  fullWidth: {
    width: "100%",
  },
  nowrap: {
    whiteSpace: "nowrap",
  },
  controlBar: {
    backgroundColor: semanticColors.bg,
    borderColor: semanticColors.border,
    borderRadius: semanticRadii.panel,
    borderStyle: "solid",
    borderWidth: "1px",
    columnGap: spacing._4,
    paddingBlock: spacing._3,
    paddingInline: spacing._4,
    rowGap: spacing._3,
  },
  controlGroup: {
    columnGap: spacing._2_5,
    rowGap: spacing._2,
  },
  controlLabel: {
    letterSpacing: "0.02em",
    whiteSpace: "nowrap",
  },
  accentButton: {
    alignItems: "center",
    appearance: "none",
    backgroundColor: "transparent",
    borderColor: {
      default: "transparent",
      ":hover": semanticColors.borderEmphasized,
    },
    borderRadius: radii.full,
    borderStyle: "solid",
    borderWidth: "1.5px",
    cursor: "pointer",
    display: "inline-flex",
    justifyContent: "center",
    outlineColor: {
      default: null,
      ":focus-visible": colorPalette.focusRing,
    },
    outlineOffset: {
      default: null,
      ":focus-visible": "2px",
    },
    outlineStyle: {
      default: "none",
      ":focus-visible": "solid",
    },
    outlineWidth: {
      default: null,
      ":focus-visible": "2px",
    },
    paddingBlock: "2px",
    paddingInline: "2px",
    transitionDuration: durations.fast,
    transitionProperty: "border-color, transform",
  },
  accentButtonSelected: {
    borderColor: semanticColors.fg,
  },
  controlDivider: {
    display: {
      default: "block",
      [COMPACT]: "none",
    },
    height: sizes._5,
  },
  canvas: {
    flexGrow: 1,
    paddingBlock: spacing._6,
    paddingInline: {
      default: spacing._6,
      [COMPACT]: spacing._4,
    },
  },
  statusSummaryBar: {
    columnGap: spacing._2_5,
    rowGap: spacing._2,
  },
  statusChips: {
    columnGap: spacing._2,
    rowGap: spacing._1_5,
  },
  bentoGrid: {
    gridTemplateColumns: {
      default: "repeat(3, minmax(0, 1fr))",
      [MEDIUM]: "repeat(2, minmax(0, 1fr))",
      [COMPACT]: "minmax(0, 1fr)",
    },
  },
  card: {
    height: "100%",
    transitionDuration: durations.moderate,
    transitionProperty: "border-color, border-radius, box-shadow",
  },
  cardTitle: {
    marginBlock: 0,
  },
  cardDescription: {
    marginBlock: 0,
  },
  cardBodyStack: {
    display: "flex",
    flexDirection: "column",
    rowGap: spacing._4,
  },
  cardFooterBetween: {
    flexWrap: "wrap",
    justifyContent: "space-between",
  },
  // Card 1: Workspace Access & Invites
  inviteForm: {
    gridTemplateColumns: {
      default: "minmax(0, 1fr) 7.5rem auto",
      [COMPACT]: "minmax(0, 1fr)",
    },
  },
  memberRoleSelect: {
    flexShrink: 0,
    width: "7.25rem",
  },
  // Card 2: Compute & Storage Quota
  quotaHero: {
    backgroundColor: semanticColors.bgMuted,
    borderColor: semanticColors.borderSubtle,
    borderRadius: semanticRadii.panelSm,
    borderStyle: "solid",
    borderWidth: "1px",
    paddingBlock: spacing._3_5,
    paddingInline: spacing._4,
  },
  // Card 3: Activity Feed & Alerts
  timelineLastContent: {
    paddingBottom: 0,
  },
  timelineTagRow: {
    marginTop: spacing._0_5,
  },
  kbdRow: {
    columnGap: spacing._3,
    rowGap: spacing._1_5,
  },
  kbdShortcut: {
    alignItems: "center",
    color: semanticColors.fgMuted,
    columnGap: spacing._1,
    display: "inline-flex",
    fontSize: fontSizes.xs,
    lineHeight: lineHeights.xs,
  },
  // Card 4: Notifications & Security
  sectionLabel: {
    letterSpacing: "0.03em",
  },
  // Card 5: Plan & Capacity Estimator
  radioCardStack: {
    display: "flex",
    flexDirection: "column",
    rowGap: spacing._2,
  },
  radioCardControl: {
    alignItems: "center",
    columnGap: spacing._3,
    justifyContent: "space-between",
  },
  radioCardEnd: {
    alignItems: "center",
    columnGap: spacing._2_5,
    display: "inline-flex",
    flexShrink: 0,
  },
  estimatorControls: {
    columnGap: spacing._3,
    gridTemplateColumns: "6.5rem minmax(0, 1fr)",
    rowGap: spacing._2,
  },
  // Card 6: Typography, Swatches & Controls
  tabsPanelBody: {
    display: "flex",
    flexDirection: "column",
    paddingBottom: 0,
    paddingInline: 0,
    paddingTop: spacing._3,
    rowGap: spacing._3,
  },
  swatchTile: {
    alignItems: "center",
    appearance: "none",
    backgroundColor: {
      default: semanticColors.bgMuted,
      ":hover": semanticColors.bgSubtle,
    },
    borderColor: {
      default: semanticColors.borderSubtle,
      ":hover": semanticColors.borderEmphasized,
    },
    borderRadius: semanticRadii.control,
    borderStyle: "solid",
    borderWidth: "1px",
    color: semanticColors.fg,
    columnGap: spacing._2,
    cursor: "pointer",
    display: "flex",
    fontFamily: "inherit",
    minWidth: 0,
    outlineColor: {
      default: null,
      ":focus-visible": colorPalette.focusRing,
    },
    outlineOffset: {
      default: null,
      ":focus-visible": "2px",
    },
    outlineStyle: {
      default: "none",
      ":focus-visible": "solid",
    },
    outlineWidth: {
      default: null,
      ":focus-visible": "2px",
    },
    paddingBlock: spacing._1_5,
    paddingInline: spacing._2,
    textAlign: "start",
    transitionDuration: durations.fast,
    transitionProperty: "background-color, border-color",
  },
  typeSpecimenHeading: {
    marginBlock: 0,
  },
  ratingRow: {
    backgroundColor: semanticColors.bgMuted,
    borderColor: semanticColors.borderSubtle,
    borderRadius: semanticRadii.control,
    borderStyle: "solid",
    borderWidth: "1px",
    columnGap: spacing._3,
    paddingBlock: spacing._2_5,
    paddingInline: spacing._3,
    rowGap: spacing._2,
  },
});

function SparkleIcon() {
  return (
    <Icon
      size="sm"
      viewBox="0 0 20 20"
      fill="none"
      stroke="currentColor"
      strokeWidth="1.6"
      strokeLinecap="round"
      strokeLinejoin="round"
      aria-hidden="true"
    >
      <path d="M10 2.5 11.9 7.6 17 9.5l-5.1 1.9L10 16.5l-1.9-5.1L3 9.5l5.1-1.9L10 2.5Z" />
    </Icon>
  );
}

function RotateResetIcon() {
  return (
    <Icon
      size="sm"
      viewBox="0 0 20 20"
      fill="none"
      stroke="currentColor"
      strokeWidth="1.6"
      strokeLinecap="round"
      strokeLinejoin="round"
      aria-hidden="true"
    >
      <path d="M4.5 8.5A5.75 5.75 0 1 1 6 14.2" />
      <path d="M4.5 4.75v3.75h3.75" />
    </Icon>
  );
}

function ExportIcon() {
  return (
    <Icon
      size="sm"
      viewBox="0 0 20 20"
      fill="none"
      stroke="currentColor"
      strokeWidth="1.6"
      strokeLinecap="round"
      strokeLinejoin="round"
      aria-hidden="true"
    >
      <path d="M10 12.75V3.5" />
      <path d="m6.75 6.75 3.25-3.25 3.25 3.25" />
      <path d="M4.25 12.75v2a1.5 1.5 0 0 0 1.5 1.5h8.5a1.5 1.5 0 0 0 1.5-1.5v-2" />
    </Icon>
  );
}

function UserPlusIcon() {
  return (
    <Icon
      size="sm"
      viewBox="0 0 20 20"
      fill="none"
      stroke="currentColor"
      strokeWidth="1.6"
      strokeLinecap="round"
      strokeLinejoin="round"
      aria-hidden="true"
    >
      <circle cx="8" cy="6.5" r="2.75" />
      <path d="M3.25 15.75c.55-2.3 2.35-3.75 4.75-3.75s4.2 1.45 4.75 3.75" />
      <path d="M15.25 6.5v4.5M13 8.75h4.5" />
    </Icon>
  );
}

function InfoCircleIcon() {
  return (
    <Icon
      size="sm"
      viewBox="0 0 20 20"
      fill="none"
      stroke="currentColor"
      strokeWidth="1.6"
      strokeLinecap="round"
      strokeLinejoin="round"
      aria-hidden="true"
    >
      <circle cx="10" cy="10" r="7.25" />
      <path d="M10 9v4.25" />
      <circle cx="10" cy="6.5" r="0.5" fill="currentColor" stroke="none" />
    </Icon>
  );
}

function CheckCircleIcon() {
  return (
    <Icon
      size="sm"
      viewBox="0 0 20 20"
      fill="none"
      stroke="currentColor"
      strokeWidth="1.6"
      strokeLinecap="round"
      strokeLinejoin="round"
      aria-hidden="true"
    >
      <circle cx="10" cy="10" r="7.25" />
      <path d="m7 10.2 2 2 4-4.4" />
    </Icon>
  );
}

function WarningTriangleIcon() {
  return (
    <Icon
      size="sm"
      viewBox="0 0 20 20"
      fill="none"
      stroke="currentColor"
      strokeWidth="1.6"
      strokeLinecap="round"
      strokeLinejoin="round"
      aria-hidden="true"
    >
      <path d="M10 3.25 17 15.75H3L10 3.25Z" />
      <path d="M10 8v3.25" />
      <circle cx="10" cy="13.5" r="0.5" fill="currentColor" stroke="none" />
    </Icon>
  );
}

function initialsFromEmail(email: string): string {
  const local = email.split("@")[0] ?? "";
  const parts = local
    .split(/[._-]+/)
    .map((part) => part.trim())
    .filter(Boolean);
  if (parts.length >= 2) {
    return `${parts[0][0] ?? ""}${parts[1][0] ?? ""}`.toUpperCase();
  }
  return (local.slice(0, 2) || "NU").toUpperCase();
}

function displayNameFromEmail(email: string): string {
  const local = email.split("@")[0] ?? "New member";
  const parts = local
    .split(/[._-]+/)
    .map((part) => part.trim())
    .filter(Boolean);
  if (parts.length === 0) return "New Member";
  return parts
    .map((part) => part.charAt(0).toUpperCase() + part.slice(1).toLowerCase())
    .join(" ");
}

/**
 * ThemeShowcase — interactive design-system & token workbench showcasing live
 * UI SDK primitives across a balanced 3-column bento canvas with scoped accent,
 * density, and radius live-preview controls.
 */
export function ThemeShowcase({
  title = "Solstice UI",
  description = "Inspect live surface contrast, typography, corner radii, density rhythm, and interactive focus states across stock UI SDK primitives.",
  defaultAccent = "theme",
  defaultDensity = "default",
  defaultRadius = "theme",
  onExportTokens,
  palette,
  style,
}: ThemeShowcaseProps) {
  const toaster = useMemo(() => Toast.createToaster(), []);

  // Scoped workbench overrides
  const [accent, setAccent] = useState<ThemeAccentPreset>(defaultAccent);
  const [density, setDensity] = useState<ThemeDensityPreset>(defaultDensity);
  const [radius, setRadius] = useState<ThemeRadiusPreset>(defaultRadius);

  // Card 1: Team & invites state
  const [members, setMembers] = useState<ThemeShowcaseMember[]>(() => [...INITIAL_MEMBERS]);
  const [inviteEmail, setInviteEmail] = useState("");
  const [inviteRole, setInviteRole] = useState<TeamMemberRole>("reviewer");

  // Card 2: Storage & quota state
  const [cachePruned, setCachePruned] = useState(false);

  // Card 3: Activity & alerts state
  const [alertTone, setAlertTone] = useState<AlertTone>("success");

  // Card 4: Notifications & security state
  const [releaseDigest, setReleaseDigest] = useState(true);
  const [passkeyRequired, setPasskeyRequired] = useState(true);
  const [anomalyStream, setAnomalyStream] = useState(false);
  const [auditExports, setAuditExports] = useState(true);
  const [tokenDiffs, setTokenDiffs] = useState(true);
  const [contrastDigest, setContrastDigest] = useState(false);
  const [visibility, setVisibility] = useState("workspace");

  // Card 5: Plan & capacity estimator state
  const [billingCycle, setBillingCycle] = useState<"monthly" | "annual">("annual");
  const [planTier, setPlanTier] = useState<PlanTier>("scale");
  const [seats, setSeats] = useState(8);
  const [concurrency, setConcurrency] = useState(12);

  // Card 6: Swatches, typography & controls sampler state
  const [samplerTab, setSamplerTab] = useState("swatches");
  const [harmonyScore, setHarmonyScore] = useState(4);

  const scopedPalette = useMemo(() => {
    if (accent === "theme") {
      return palette ?? accentPalette;
    }
    return ACCENT_PALETTES[accent];
  }, [accent, palette]);

  const radiusTheme = useMemo(() => {
    if (radius === "sharp") return sharpRadiiTheme;
    if (radius === "soft") return softRadiiTheme;
    if (radius === "pill") return pillRadiiTheme;
    return undefined;
  }, [radius]);

  const densitySpacingTheme = useMemo(() => {
    if (density === "compact") return compactSpacingTheme;
    if (density === "spacious") return spaciousSpacingTheme;
    return undefined;
  }, [density]);

  const densitySizesTheme = useMemo(() => {
    if (density === "compact") return compactSizesTheme;
    if (density === "spacious") return spaciousSizesTheme;
    return undefined;
  }, [density]);

  const isCustomized =
    accent !== defaultAccent || density !== defaultDensity || radius !== defaultRadius;

  const activeAccentMeta =
    ACCENT_OPTIONS.find((item) => item.id === accent) ?? ACCENT_OPTIONS[0];

  const handleResetTheme = useCallback(() => {
    setAccent(defaultAccent);
    setDensity(defaultDensity);
    setRadius(defaultRadius);
    toaster.info("Reset workbench overrides", {
      description: "Restored active host theme accent, density, and corner radius defaults.",
    });
  }, [defaultAccent, defaultDensity, defaultRadius, toaster]);

  const handleExportTokens = useCallback(() => {
    const snippet = [
      `// Solstice UI · Scoped Theme Summary`,
      `palette: ${activeAccentMeta.tokenHint}`,
      `density: "${density}"`,
      `radius: "${radius}"`,
    ].join("\n");

    if (typeof navigator !== "undefined" && navigator.clipboard) {
      void navigator.clipboard.writeText(snippet).catch(() => {});
    }

    onExportTokens?.({ accent, density, radius, snippet });
    toaster.success("Theme tokens copied", {
      description: `${activeAccentMeta.label} · ${density} density · ${radius} radius`,
    });
  }, [accent, activeAccentMeta.label, activeAccentMeta.tokenHint, density, onExportTokens, radius, toaster]);

  const handleInviteSubmit = useCallback(
    (event: React.FormEvent<HTMLFormElement>) => {
      event.preventDefault();
      const trimmed = inviteEmail.trim();
      if (!trimmed || !trimmed.includes("@")) {
        toaster.error("Enter a valid email", {
          description: "Use an address such as devon@solstice.design to send an invite.",
        });
        return;
      }

      const paletteCycle: ThemeShowcaseMember["accent"][] = [
        "emerald",
        "amber",
        "rose",
        "indigo",
        "teal",
        "violet",
      ];
      const nextMember: ThemeShowcaseMember = {
        id: `${trimmed.toLowerCase()}-${Date.now()}`,
        name: displayNameFromEmail(trimmed),
        email: trimmed.toLowerCase(),
        initials: initialsFromEmail(trimmed),
        role: inviteRole,
        accent: paletteCycle[members.length % paletteCycle.length],
      };

      setMembers((prev) => [nextMember, ...prev.slice(0, 3)]);
      setInviteEmail("");
      toaster.success(`Invited ${nextMember.name}`, {
        description: `Assigned ${inviteRole} access to ${nextMember.email}.`,
      });
    },
    [inviteEmail, inviteRole, members.length, toaster],
  );

  const handleRoleChange = useCallback(
    (memberId: string, nextRole: TeamMemberRole) => {
      setMembers((prev) =>
        prev.map((member) => (member.id === memberId ? { ...member, role: nextRole } : member)),
      );
      const target = members.find((item) => item.id === memberId);
      if (target) {
        toaster.info("Role updated", {
          description: `${target.name} is now set to ${nextRole}.`,
        });
      }
    },
    [members, toaster],
  );

  const handleTogglePruneCache = useCallback(() => {
    setCachePruned((prev) => {
      const next = !prev;
      toaster.success(next ? "Build cache pruned" : "Snapshot cache restored", {
        description: next
          ? "Reclaimed 14.2 GB from expired preview bundles."
          : "Restored baseline cache telemetry for comparison.",
      });
      return next;
    });
  }, [toaster]);

  const handleCopyToken = useCallback(
    (token: string, label: string) => {
      if (typeof navigator !== "undefined" && navigator.clipboard) {
        void navigator.clipboard.writeText(token).catch(() => {});
      }
      toaster.info(`Copied ${label}`, {
        description: token,
      });
    },
    [toaster],
  );

  // Derived quota numbers
  const bundlesGb = 26.4;
  const snapshotsGb = cachePruned ? 16.8 : 31.0;
  const artifactsGb = 11.0;
  const totalUsedGb = Number((bundlesGb + snapshotsGb + artifactsGb).toFixed(1));
  const quotaPct = Math.round(totalUsedGb);

  // Derived plan pricing
  const selectedPlan =
    PLAN_OPTIONS.find((item) => item.value === planTier) ?? PLAN_OPTIONS[1];
  const discountMultiplier = billingCycle === "annual" ? 0.8 : 1;
  const effectiveSeatRate = Math.round(selectedPlan.monthlyPerSeat * discountMultiplier);
  const runnerAddon = Math.max(0, concurrency - 4) * 3;
  const monthlyEstimate = seats * effectiveSeatRate + runnerAddon;

  const activeAlert =
    ALERT_PRESETS.find((item) => item.tone === alertTone) ?? ALERT_PRESETS[0];

  const handlePreviewInvoice = useCallback(() => {
    toaster.success("Estimate ready", {
      description: `${selectedPlan.label} (${billingCycle}) · ${seats} seats · ${concurrency} runners — $${monthlyEstimate}/mo`,
    });
  }, [billingCycle, concurrency, monthlyEstimate, seats, selectedPlan.label, toaster]);

  return (
    <div {...stylex.props(palette, styles.root, style)}>
      {/* Top workbench control strip (always remains crisp and legible at host scale) */}
      <header {...stylex.props(scopedPalette, styles.topStrip)}>
        <VStack gap="4" style={styles.maxWidthInner}>
          <HStack align="start" justify="between" wrap="wrap" style={styles.headerRow}>
            <VStack gap="1.5" style={styles.brandBlock}>
              <HStack wrap="wrap" style={styles.brandEyebrow}>
                <Square render={<span />} size="xs" style={styles.brandMark}>
                  <SparkleIcon />
                </Square>
                <Badge variant="subtle" size="sm" palette={scopedPalette}>
                  Live Token &amp; Surface Workbench
                </Badge>
                <Code variant="outline" size="xs">
                  @stylexblocks/ui
                </Code>
              </HStack>
              <Heading render={<h1 />} size="2xl" style={styles.pageTitle}>
                {title}
              </Heading>
              <Text variant="muted" size="sm" style={styles.leadingMd}>
                {description}
              </Text>
            </VStack>

            <HStack gap="2" wrap="wrap">
              <Button
                variant="surface"
                size="sm"
                disabled={!isCustomized}
                onClick={handleResetTheme}
              >
                <RotateResetIcon />
                Reset
              </Button>
              <Button
                variant="solid"
                size="sm"
                palette={scopedPalette}
                onClick={handleExportTokens}
              >
                <ExportIcon />
                Export tokens
              </Button>
            </HStack>
          </HStack>

          <HStack
            role="region"
            aria-label="Theme preview controls"
            justify="between"
            wrap="wrap"
            style={styles.controlBar}
          >
            <HStack wrap="wrap" style={styles.controlGroup}>
              <Text render={<span />} variant="overline" weight="medium" style={styles.controlLabel}>
                Accent
              </Text>
              <HStack role="radiogroup" aria-label="Accent palette" gap="1.5" wrap="wrap">
                {ACCENT_OPTIONS.map((option) => {
                  const isSelected = accent === option.id;
                  return (
                    <Tooltip.Root key={option.id} variant="inverted" delay={120} closeDelay={60}>
                      <Tooltip.Trigger
                        render={
                          <button
                            type="button"
                            role="radio"
                            aria-checked={isSelected}
                            aria-label={`${option.label} accent palette`}
                            onClick={() => setAccent(option.id)}
                            {...stylex.props(
                              styles.accentButton,
                              isSelected && styles.accentButtonSelected,
                            )}
                          />
                        }
                      >
                        <ColorSwatch
                          size="sm"
                          shape="circle"
                          style={accentSwatchStyles[option.id]}
                        />
                      </Tooltip.Trigger>
                      <Tooltip.Content side="top" sideOffset={6}>
                        <Tooltip.Arrow />
                        {option.label}
                      </Tooltip.Content>
                    </Tooltip.Root>
                  );
                })}
              </HStack>
            </HStack>

            <Separator orientation="vertical" style={styles.controlDivider} />

            <HStack wrap="wrap" style={styles.controlGroup}>
              <Text render={<span />} variant="overline" weight="medium" style={styles.controlLabel}>
                Density
              </Text>
              <SegmentGroup.Root
                size="xs"
                value={density}
                onValueChange={(next) => setDensity(next as ThemeDensityPreset)}
                aria-label="Density scale"
              >
                <SegmentGroup.Item value="compact">Compact</SegmentGroup.Item>
                <SegmentGroup.Item value="default">Default</SegmentGroup.Item>
                <SegmentGroup.Item value="spacious">Spacious</SegmentGroup.Item>
              </SegmentGroup.Root>
            </HStack>

            <Separator orientation="vertical" style={styles.controlDivider} />

            <HStack wrap="wrap" style={styles.controlGroup}>
              <Text render={<span />} variant="overline" weight="medium" style={styles.controlLabel}>
                Radius
              </Text>
              <SegmentGroup.Root
                size="xs"
                value={radius}
                onValueChange={(next) => setRadius(next as ThemeRadiusPreset)}
                aria-label="Corner radius profile"
              >
                <SegmentGroup.Item value="theme">Theme</SegmentGroup.Item>
                <SegmentGroup.Item value="sharp">Sharp</SegmentGroup.Item>
                <SegmentGroup.Item value="soft">Soft</SegmentGroup.Item>
                <SegmentGroup.Item value="pill">Pill</SegmentGroup.Item>
              </SegmentGroup.Root>
            </HStack>
          </HStack>
        </VStack>
      </header>

      {/* Scoped workbench canvas: inherits live accent, density, and radius StyleX themes */}
      <main
        {...stylex.props(
          scopedPalette,
          radiusTheme,
          densitySpacingTheme,
          densitySizesTheme,
          styles.canvas,
        )}
      >
        <VStack gap="4" style={styles.maxWidthInner}>
          <HStack justify="between" wrap="wrap" style={styles.statusSummaryBar}>
            <HStack wrap="wrap" style={styles.statusChips}>
              <Status.Root size="sm" palette={emeraldPalette}>
                <Status.Indicator />
                <span>All 30 primitives live</span>
              </Status.Root>
              <Badge variant="outline" size="sm" palette={scopedPalette}>
                {activeAccentMeta.label}
              </Badge>
              <Badge variant="subtle" size="sm">
                Density: {density}
              </Badge>
              <Badge variant="subtle" size="sm">
                Radius: {radius}
              </Badge>
            </HStack>
            <Text render={<span />} variant="muted" size="xs">
              Interactive stress-test canvas — click any control to inspect states
            </Text>
          </HStack>

          <Grid gap="4" style={styles.bentoGrid}>
            {/* Card 1: Workspace Access & Invites */}
            <Card.Root variant="outline" size="md" style={styles.card}>
              <Card.Header>
                <HStack gap="2" justify="between">
                  <Card.Title style={styles.cardTitle}>Workspace Access</Card.Title>
                  <Badge variant="subtle" size="sm" palette={scopedPalette}>
                    {members.length} members
                  </Badge>
                </HStack>
                <Card.Description style={styles.cardDescription}>
                  Invite contributors and test select popovers, inputs, and avatar contrast.
                </Card.Description>
              </Card.Header>

              <Card.Body style={styles.cardBodyStack}>
                <Grid
                  render={<form onSubmit={handleInviteSubmit} />}
                  gap="2"
                  style={styles.inviteForm}
                >
                  <Input
                    size="sm"
                    type="email"
                    aria-label="Teammate email"
                    placeholder="name@solstice.design"
                    value={inviteEmail}
                    onValueChange={(value) => setInviteEmail(value)}
                    palette={scopedPalette}
                  />
                  <Select.Root
                    size="sm"
                    items={ROLE_OPTIONS}
                    value={inviteRole}
                    onValueChange={(next) => {
                      if (next) setInviteRole(next as TeamMemberRole);
                    }}
                    palette={scopedPalette}
                  >
                    <Select.Control>
                      <Select.Trigger aria-label="Invite role">
                        <Select.Value />
                      </Select.Trigger>
                      <Select.IndicatorGroup>
                        <Select.Icon />
                      </Select.IndicatorGroup>
                    </Select.Control>
                    <Select.Content>
                      {ROLE_OPTIONS.map((option) => (
                        <Select.Item key={option.value} value={option.value}>
                          <Select.ItemText>{option.label}</Select.ItemText>
                          <Select.ItemIndicator />
                        </Select.Item>
                      ))}
                    </Select.Content>
                  </Select.Root>
                  <Button type="submit" variant="solid" size="sm" palette={scopedPalette}>
                    <UserPlusIcon />
                    Invite
                  </Button>
                </Grid>

                <Separator />

                <VStack gap="2.5">
                  {members.map((member) => (
                    <HStack key={member.id} gap="2.5" justify="between">
                      <HStack gap="2.5">
                        <Avatar.Root
                          size="sm"
                          variant="subtle"
                          palette={MEMBER_AVATAR_PALETTES[member.accent]}
                        >
                          <Avatar.Fallback>{member.initials}</Avatar.Fallback>
                        </Avatar.Root>
                        <VStack gap="0">
                          <Text render={<span />} size="sm" weight="medium" truncate="true">
                            {member.name}
                          </Text>
                          <Text render={<span />} variant="muted" size="xs" truncate="true">
                            {member.email}
                          </Text>
                        </VStack>
                      </HStack>

                      <div {...stylex.props(styles.memberRoleSelect)}>
                        <Select.Root
                          size="xs"
                          variant="subtle"
                          items={ROLE_OPTIONS}
                          value={member.role}
                          onValueChange={(next) => {
                            if (next) handleRoleChange(member.id, next as TeamMemberRole);
                          }}
                          palette={scopedPalette}
                        >
                          <Select.Control>
                            <Select.Trigger aria-label={`Role for ${member.name}`}>
                              <Select.Value />
                            </Select.Trigger>
                            <Select.IndicatorGroup>
                              <Select.Icon />
                            </Select.IndicatorGroup>
                          </Select.Control>
                          <Select.Content>
                            {ROLE_OPTIONS.map((option) => (
                              <Select.Item key={option.value} value={option.value}>
                                <Select.ItemText>{option.label}</Select.ItemText>
                                <Select.ItemIndicator />
                              </Select.Item>
                            ))}
                          </Select.Content>
                        </Select.Root>
                      </div>
                    </HStack>
                  ))}
                </VStack>
              </Card.Body>

              <Card.Footer style={styles.cardFooterBetween}>
                <Text render={<span />} variant="muted" size="xs">
                  SSO enforced via Okta SAML
                </Text>
                <Code variant="subtle" size="xs">
                  solstice-core
                </Code>
              </Card.Footer>
            </Card.Root>

            {/* Card 2: Storage & Usage Quota */}
            <Card.Root variant="outline" size="md" style={styles.card}>
              <Card.Header>
                <HStack gap="2" justify="between">
                  <Card.Title style={styles.cardTitle}>Artifact Storage</Card.Title>
                  <Status.Root
                    size="sm"
                    palette={cachePruned ? emeraldPalette : amberPalette}
                  >
                    <Status.Indicator />
                    <span>{cachePruned ? "Optimal" : "68% used"}</span>
                  </Status.Root>
                </HStack>
                <Card.Description style={styles.cardDescription}>
                  Numeric hierarchy, circular rings, and progress track contrast.
                </Card.Description>
              </Card.Header>

              <Card.Body style={styles.cardBodyStack}>
                <HStack gap="4" justify="between" style={styles.quotaHero}>
                  <VStack gap="1">
                    <Stat.Root size="md">
                      <Stat.Label>Workspace volume</Stat.Label>
                      <Stat.ValueText>
                        {totalUsedGb}
                        <Stat.ValueUnit>/ 100 GB</Stat.ValueUnit>
                      </Stat.ValueText>
                      <Stat.HelpText>
                        {cachePruned
                          ? "−14.2 GB reclaimed just now"
                          : "+4.2 GB since last Tuesday"}
                      </Stat.HelpText>
                    </Stat.Root>
                  </VStack>

                  <ProgressCircle.Root
                    size="lg"
                    role="progressbar"
                    aria-label="Storage quota used"
                    aria-valuemin={0}
                    aria-valuemax={100}
                    aria-valuenow={quotaPct}
                    palette={scopedPalette}
                  >
                    <ProgressCircle.Circle>
                      <ProgressCircle.CircleTrack pathLength={100} />
                      <ProgressCircle.CircleRange
                        pathLength={100}
                        strokeDasharray={`${quotaPct} 100`}
                      />
                    </ProgressCircle.Circle>
                    <ProgressCircle.ValueText>{quotaPct}%</ProgressCircle.ValueText>
                  </ProgressCircle.Root>
                </HStack>

                <VStack gap="3">
                  <VStack gap="1.5">
                    <HStack gap="2" justify="between">
                      <Text render={<span />} size="xs" weight="medium">
                        Compiled token bundles
                      </Text>
                      <Text render={<span />} variant="muted" size="xs" tabular="true">
                        {bundlesGb} GB
                      </Text>
                    </HStack>
                    <Progress.Root
                      value={bundlesGb}
                      max={100}
                      size="sm"
                      variant="subtle"
                      palette={scopedPalette}
                    >
                      <Progress.Track>
                        <Progress.Range />
                      </Progress.Track>
                    </Progress.Root>
                  </VStack>

                  <VStack gap="1.5">
                    <HStack gap="2" justify="between">
                      <Text render={<span />} size="xs" weight="medium">
                        Preview visual snapshots
                      </Text>
                      <Text render={<span />} variant="muted" size="xs" tabular="true">
                        {snapshotsGb} GB
                      </Text>
                    </HStack>
                    <Progress.Root
                      value={snapshotsGb}
                      max={100}
                      size="sm"
                      variant="outline"
                      palette={tealPalette}
                    >
                      <Progress.Track>
                        <Progress.Range />
                      </Progress.Track>
                    </Progress.Root>
                  </VStack>

                  <VStack gap="1.5">
                    <HStack gap="2" justify="between">
                      <Text render={<span />} size="xs" weight="medium">
                        Edge CDN artifacts
                      </Text>
                      <Text render={<span />} variant="muted" size="xs" tabular="true">
                        {artifactsGb} GB
                      </Text>
                    </HStack>
                    <Progress.Root
                      value={artifactsGb}
                      max={100}
                      size="sm"
                      variant="subtle"
                      palette={violetPalette}
                    >
                      <Progress.Track>
                        <Progress.Range />
                      </Progress.Track>
                    </Progress.Root>
                  </VStack>
                </VStack>
              </Card.Body>

              <Card.Footer style={styles.cardFooterBetween}>
                <Badge variant="outline" size="sm">
                  Auto-prune: 30d
                </Badge>
                <Button variant="surface" size="xs" onClick={handleTogglePruneCache}>
                  {cachePruned ? "Restore cache" : "Prune cache"}
                </Button>
              </Card.Footer>
            </Card.Root>

            {/* Card 3: Activity Feed & Alerts */}
            <Card.Root variant="outline" size="md" style={styles.card}>
              <Card.Header>
                <HStack gap="2" justify="between">
                  <Card.Title style={styles.cardTitle}>Release Feed &amp; Alerts</Card.Title>
                  <HStack gap="1" wrap="wrap">
                    {ALERT_PRESETS.map((preset) => (
                      <Button
                        key={preset.tone}
                        variant={alertTone === preset.tone ? "subtle" : "ghost"}
                        size="2xs"
                        palette={alertTone === preset.tone ? preset.palette : undefined}
                        onClick={() => setAlertTone(preset.tone)}
                      >
                        {preset.label}
                      </Button>
                    ))}
                  </HStack>
                </HStack>
                <Card.Description style={styles.cardDescription}>
                  Status callouts, timeline connectors, tags, and keyboard cues.
                </Card.Description>
              </Card.Header>

              <Card.Body style={styles.cardBodyStack}>
                <Alert.Root
                  status={activeAlert.tone}
                  variant="subtle"
                  size="sm"
                  palette={activeAlert.palette}
                >
                  <Alert.Indicator>
                    {activeAlert.tone === "success" ? (
                      <CheckCircleIcon />
                    ) : activeAlert.tone === "info" ? (
                      <InfoCircleIcon />
                    ) : (
                      <WarningTriangleIcon />
                    )}
                  </Alert.Indicator>
                  <Alert.Content>
                    <Alert.Title>{activeAlert.title}</Alert.Title>
                    <Alert.Description>{activeAlert.description}</Alert.Description>
                  </Alert.Content>
                </Alert.Root>

                <Timeline.Root variant="subtle" size="sm">
                  {ACTIVITY_EVENTS.map((event, index) => {
                    const isLast = index === ACTIVITY_EVENTS.length - 1;
                    return (
                      <Timeline.Item key={event.id}>
                        <Timeline.Connector>
                          {!isLast ? <Timeline.Separator /> : null}
                          <Timeline.Indicator />
                        </Timeline.Connector>
                        <Timeline.Content style={isLast ? styles.timelineLastContent : undefined}>
                          <Timeline.Title>
                            <HStack gap="2" justify="between" style={styles.fullWidth}>
                              <span>{event.title}</span>
                              <Text
                                render={<span />}
                                variant="subtle"
                                size="xs"
                                tabular="true"
                                style={styles.nowrap}
                              >
                                {event.time}
                              </Text>
                            </HStack>
                          </Timeline.Title>
                          <Timeline.Description>{event.detail}</Timeline.Description>
                          <HStack gap="1.5" wrap="wrap" style={styles.timelineTagRow}>
                            <Tag.Root variant="surface" size="sm" palette={event.tagPalette}>
                              <Tag.Label>{event.tag}</Tag.Label>
                            </Tag.Root>
                          </HStack>
                        </Timeline.Content>
                      </Timeline.Item>
                    );
                  })}
                </Timeline.Root>
              </Card.Body>

              <Card.Footer style={styles.cardFooterBetween}>
                <HStack wrap="wrap" style={styles.kbdRow}>
                  <span {...stylex.props(styles.kbdShortcut)}>
                    <Kbd variant="raised" size="xs">
                      ⌘
                    </Kbd>
                    <Kbd variant="raised" size="xs">
                      K
                    </Kbd>
                    <span>Jump</span>
                  </span>
                  <span {...stylex.props(styles.kbdShortcut)}>
                    <Kbd variant="raised" size="xs">
                      ⇧
                    </Kbd>
                    <Kbd variant="raised" size="xs">
                      R
                    </Kbd>
                    <span>Reset</span>
                  </span>
                  <span {...stylex.props(styles.kbdShortcut)}>
                    <Kbd variant="raised" size="xs">
                      ⌘
                    </Kbd>
                    <Kbd variant="raised" size="xs">
                      E
                    </Kbd>
                    <span>Export</span>
                  </span>
                </HStack>
              </Card.Footer>
            </Card.Root>

            {/* Card 4: Notifications & Security */}
            <Card.Root variant="outline" size="md" style={styles.card}>
              <Card.Header>
                <HStack gap="2" justify="between">
                  <Card.Title style={styles.cardTitle}>Security &amp; Alerts</Card.Title>
                  <Badge variant="surface" size="sm">
                    {[releaseDigest, passkeyRequired, anomalyStream].filter(Boolean).length}/3 on
                  </Badge>
                </HStack>
                <Card.Description style={styles.cardDescription}>
                  Selection controls verifying checked fills, focus rings, and label alignment.
                </Card.Description>
              </Card.Header>

              <Card.Body style={styles.cardBodyStack}>
                <VStack gap="3">
                  <HStack gap="3" justify="between">
                    <VStack gap="0.5">
                      <Text render={<span />} size="sm" weight="medium">
                        Release digest alerts
                      </Text>
                      <Text render={<span />} variant="muted" size="xs">
                        Summarize token schema changes after every merge.
                      </Text>
                    </VStack>
                    <Switch.Root size="sm" palette={scopedPalette}>
                      <Switch.Control
                        aria-label="Release digest alerts"
                        checked={releaseDigest}
                        onCheckedChange={setReleaseDigest}
                      />
                    </Switch.Root>
                  </HStack>

                  <HStack gap="3" justify="between">
                    <VStack gap="0.5">
                      <Text render={<span />} size="sm" weight="medium">
                        Hardware passkeys
                      </Text>
                      <Text render={<span />} variant="muted" size="xs">
                        Require WebAuthn verification before publishing themes.
                      </Text>
                    </VStack>
                    <Switch.Root size="sm" palette={scopedPalette}>
                      <Switch.Control
                        aria-label="Hardware passkeys"
                        checked={passkeyRequired}
                        onCheckedChange={setPasskeyRequired}
                      />
                    </Switch.Root>
                  </HStack>

                  <HStack gap="3" justify="between">
                    <VStack gap="0.5">
                      <Text render={<span />} size="sm" weight="medium">
                        Anomaly webhook stream
                      </Text>
                      <Text render={<span />} variant="muted" size="xs">
                        Push contrast regressions to PagerDuty or Slack.
                      </Text>
                    </VStack>
                    <Switch.Root size="sm" palette={scopedPalette}>
                      <Switch.Control
                        aria-label="Anomaly webhook stream"
                        checked={anomalyStream}
                        onCheckedChange={setAnomalyStream}
                      />
                    </Switch.Root>
                  </HStack>
                </VStack>

                <Separator />

                <VStack gap="2">
                  <Text render={<span />} variant="overline" style={styles.sectionLabel}>
                    Included channels
                  </Text>
                  <Checkbox.Root size="sm" palette={scopedPalette}>
                    <Checkbox.Control
                      checked={auditExports}
                      onCheckedChange={(checked) => setAuditExports(checked === true)}
                    />
                    <Checkbox.Label>Signed JSON audit exports</Checkbox.Label>
                  </Checkbox.Root>
                  <Checkbox.Root size="sm" palette={scopedPalette}>
                    <Checkbox.Control
                      checked={tokenDiffs}
                      onCheckedChange={(checked) => setTokenDiffs(checked === true)}
                    />
                    <Checkbox.Label>PR token diff comments</Checkbox.Label>
                  </Checkbox.Root>
                  <Checkbox.Root size="sm" palette={scopedPalette}>
                    <Checkbox.Control
                      checked={contrastDigest}
                      onCheckedChange={(checked) => setContrastDigest(checked === true)}
                    />
                    <Checkbox.Label>Weekly WCAG contrast report</Checkbox.Label>
                  </Checkbox.Root>
                </VStack>

                <Separator />

                <VStack gap="2">
                  <Text render={<span />} variant="overline" style={styles.sectionLabel}>
                    Preview link visibility
                  </Text>
                  <RadioGroup.Root
                    size="sm"
                    value={visibility}
                    onValueChange={setVisibility}
                    palette={scopedPalette}
                    aria-label="Preview link visibility"
                  >
                    <RadioGroup.Item>
                      <RadioGroup.ItemControl value="workspace" />
                      <RadioGroup.ItemText>Workspace members only</RadioGroup.ItemText>
                    </RadioGroup.Item>
                    <RadioGroup.Item>
                      <RadioGroup.ItemControl value="maintainers" />
                      <RadioGroup.ItemText>Maintainers &amp; reviewers</RadioGroup.ItemText>
                    </RadioGroup.Item>
                    <RadioGroup.Item>
                      <RadioGroup.ItemControl value="public" />
                      <RadioGroup.ItemText>Unlisted public preview URL</RadioGroup.ItemText>
                    </RadioGroup.Item>
                  </RadioGroup.Root>
                </VStack>
              </Card.Body>

              <Card.Footer style={styles.cardFooterBetween}>
                <Text render={<span />} variant="muted" size="xs">
                  Policy synced · {visibility}
                </Text>
                <Badge variant="outline" size="xs" palette={emeraldPalette}>
                  Verified
                </Badge>
              </Card.Footer>
            </Card.Root>

            {/* Card 5: Plan & Capacity Estimator */}
            <Card.Root variant="outline" size="md" style={styles.card}>
              <Card.Header>
                <HStack gap="2" justify="between" wrap="wrap">
                  <Card.Title style={styles.cardTitle}>Plan &amp; Capacity</Card.Title>
                  <SegmentGroup.Root
                    size="xs"
                    value={billingCycle}
                    onValueChange={(next) => setBillingCycle(next as "monthly" | "annual")}
                    aria-label="Billing interval"
                  >
                    <SegmentGroup.Item value="monthly">Monthly</SegmentGroup.Item>
                    <SegmentGroup.Item value="annual">Annual −20%</SegmentGroup.Item>
                  </SegmentGroup.Root>
                </HStack>
                <Card.Description style={styles.cardDescription}>
                  Selectable radio cards, numeric steppers, and range sliders.
                </Card.Description>
              </Card.Header>

              <Card.Body style={styles.cardBodyStack}>
                <RadioCard.Root
                  variant="outline"
                  size="sm"
                  value={planTier}
                  onValueChange={(next) => {
                    if (next) setPlanTier(next as PlanTier);
                  }}
                  palette={scopedPalette}
                  aria-label="Subscription plan"
                  style={styles.radioCardStack}
                >
                  {PLAN_OPTIONS.map((option) => {
                    const price = Math.round(option.monthlyPerSeat * discountMultiplier);
                    return (
                      <RadioCard.Item key={option.value} value={option.value}>
                        <RadioCard.ItemControl style={styles.radioCardControl}>
                          <RadioCard.ItemContent>
                            <RadioCard.ItemText>{option.label}</RadioCard.ItemText>
                            <RadioCard.ItemDescription>
                              {option.summary}
                            </RadioCard.ItemDescription>
                          </RadioCard.ItemContent>
                          <span {...stylex.props(styles.radioCardEnd)}>
                            <Text render={<span />} size="sm" weight="semibold" tabular="true">
                              ${price}
                            </Text>
                            <RadioCard.ItemIndicator />
                          </span>
                        </RadioCard.ItemControl>
                      </RadioCard.Item>
                    );
                  })}
                </RadioCard.Root>

                <Grid align="end" style={styles.estimatorControls}>
                  <VStack gap="1.5">
                    <Text render={<span />} variant="muted" size="xs" weight="medium">
                      Seats
                    </Text>
                    <NumberInput.Root
                      size="sm"
                      min={1}
                      max={50}
                      step={1}
                      value={seats}
                      onValueChange={(next) => setSeats(next ?? 1)}
                      palette={scopedPalette}
                    >
                      <NumberInput.Group>
                        <NumberInput.Input aria-label="Seat count" />
                        <NumberInput.Control />
                      </NumberInput.Group>
                    </NumberInput.Root>
                  </VStack>

                  <VStack gap="1.5">
                    <HStack gap="2" justify="between">
                      <Text render={<span />} variant="muted" size="xs" weight="medium">
                        Build runners
                      </Text>
                      <Text render={<span />} size="xs" weight="semibold" tabular="true">
                        {concurrency} parallel
                      </Text>
                    </HStack>
                    <Slider.Root
                      size="sm"
                      min={2}
                      max={32}
                      step={2}
                      value={concurrency}
                      onValueChange={(next) => {
                        const resolved = Array.isArray(next) ? (next[0] ?? concurrency) : next;
                        setConcurrency(resolved);
                      }}
                      palette={scopedPalette}
                    >
                      <Slider.Control>
                        <Slider.Track>
                          <Slider.Indicator />
                          <Slider.Thumb aria-label="Build runner concurrency" />
                        </Slider.Track>
                      </Slider.Control>
                    </Slider.Root>
                  </VStack>
                </Grid>
              </Card.Body>

              <Card.Footer style={styles.cardFooterBetween}>
                <VStack gap="0">
                  <Text render={<span />} size="lg" weight="semibold" tabular="true">
                    ${monthlyEstimate}/mo
                  </Text>
                  <Text render={<span />} variant="muted" size="xs">
                    {seats} × ${effectiveSeatRate} + {concurrency} runners
                  </Text>
                </VStack>
                <Button
                  variant="solid"
                  size="sm"
                  palette={scopedPalette}
                  onClick={handlePreviewInvoice}
                >
                  Preview invoice
                </Button>
              </Card.Footer>
            </Card.Root>

            {/* Card 6: Typography, Swatches & Controls Sampler */}
            <Card.Root variant="outline" size="md" style={styles.card}>
              <Card.Header>
                <HStack gap="2" justify="between">
                  <Card.Title style={styles.cardTitle}>Tokens &amp; Controls</Card.Title>
                  <Badge variant="subtle" size="sm" palette={scopedPalette}>
                    OKLCH
                  </Badge>
                </HStack>
                <Card.Description style={styles.cardDescription}>
                  Inspect live semantic swatches, typographic scale, and button hierarchy.
                </Card.Description>
              </Card.Header>

              <Card.Body style={styles.cardBodyStack}>
                <Tabs.Root
                  variant="enclosed"
                  size="sm"
                  value={samplerTab}
                  onValueChange={setSamplerTab}
                  palette={scopedPalette}
                >
                  <Tabs.List>
                    <Tabs.Tab value="swatches">Swatches</Tabs.Tab>
                    <Tabs.Tab value="type">Type</Tabs.Tab>
                    <Tabs.Tab value="controls">Controls</Tabs.Tab>
                  </Tabs.List>

                  <Tabs.Panel value="swatches" style={styles.tabsPanelBody}>
                    <Grid columns="3" gap="2">
                      {SWATCH_SPECIMENS.map((swatch) => (
                        <Tooltip.Root key={swatch.id} variant="inverted" delay={140} closeDelay={60}>
                          <Tooltip.Trigger
                            render={
                              <button
                                type="button"
                                onClick={() => handleCopyToken(swatch.token, swatch.label)}
                                {...stylex.props(styles.swatchTile)}
                              />
                            }
                          >
                            <ColorSwatch
                              size="xs"
                              shape="rounded"
                              style={tokenSwatchStyles[swatch.id]}
                            />
                            <Text render={<span />} size="xs" truncate="true">
                              {swatch.label}
                            </Text>
                          </Tooltip.Trigger>
                          <Tooltip.Content side="top" sideOffset={6}>
                            <Tooltip.Arrow />
                            Click to copy {swatch.token}
                          </Tooltip.Content>
                        </Tooltip.Root>
                      ))}
                    </Grid>
                  </Tabs.Panel>

                  <Tabs.Panel value="type" style={styles.tabsPanelBody}>
                    <VStack gap="2">
                      <Heading render={<h4 />} size="xl" style={styles.typeSpecimenHeading}>
                        Display &amp; Surface Rhythm
                      </Heading>
                      <Heading render={<h5 />} size="md" style={styles.typeSpecimenHeading}>
                        Optical hierarchy across dense panels
                      </Heading>
                      <Text variant="muted" size="sm" style={styles.leadingMd}>
                        Perceptual OKLCH contrast preserves legibility as surfaces step from canvas
                        to elevated cards across both light and dark modes.
                      </Text>
                      <HStack gap="1.5" wrap="wrap">
                        <Code variant="subtle" size="xs" palette={scopedPalette}>
                          semanticRadii.panel
                        </Code>
                        <Code variant="surface" size="xs">
                          fontSizes.md
                        </Code>
                        <Code variant="outline" size="xs">
                          spacing._4
                        </Code>
                      </HStack>
                    </VStack>
                  </Tabs.Panel>

                  <Tabs.Panel value="controls" style={styles.tabsPanelBody}>
                    <HStack gap="2" wrap="wrap">
                      <Button variant="solid" size="xs" palette={scopedPalette}>
                        Solid
                      </Button>
                      <Button variant="subtle" size="xs" palette={scopedPalette}>
                        Subtle
                      </Button>
                      <Button variant="surface" size="xs">
                        Surface
                      </Button>
                      <Button variant="outline" size="xs" palette={scopedPalette}>
                        Outline
                      </Button>
                      <Button variant="ghost" size="xs" palette={scopedPalette}>
                        Ghost
                      </Button>
                    </HStack>
                    <HStack gap="2" wrap="wrap">
                      <Badge variant="solid" size="sm" palette={scopedPalette}>
                        Solid
                      </Badge>
                      <Badge variant="subtle" size="sm" palette={scopedPalette}>
                        Subtle
                      </Badge>
                      <Badge variant="surface" size="sm" palette={scopedPalette}>
                        Surface
                      </Badge>
                      <Badge variant="outline" size="sm" palette={scopedPalette}>
                        Outline
                      </Badge>
                    </HStack>
                  </Tabs.Panel>
                </Tabs.Root>

                <HStack justify="between" wrap="wrap" style={styles.ratingRow}>
                  <VStack gap="0.5">
                    <Text render={<span />} size="xs" weight="medium">
                      Theme harmony score
                    </Text>
                    <Text render={<span />} variant="muted" size="xs" tabular="true">
                      Rated {harmonyScore} / 5 for {activeAccentMeta.label.toLowerCase()}
                    </Text>
                  </VStack>
                  <RatingGroup
                    size="sm"
                    count={5}
                    value={harmonyScore}
                    onValueChange={setHarmonyScore}
                    palette={scopedPalette}
                    aria-label="Theme harmony rating"
                  />
                </HStack>
              </Card.Body>

              <Card.Footer style={styles.cardFooterBetween}>
                <Text render={<span />} variant="muted" size="xs">
                  Click any swatch to copy token
                </Text>
                <Code variant="outline" size="xs">
                  {activeAccentMeta.tokenHint}
                </Code>
              </Card.Footer>
            </Card.Root>
          </Grid>
        </VStack>
      </main>

      <Toaster toaster={toaster} />
    </div>
  );
}
```

Credit: Inspired by [Theme Showcase](https://astryx.atmeta.com/playground?template=theme-showcase) from Astryx (MIT License · Copyright (c) 2026 Meta Platforms, Inc.)
