Theme Showcase
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.
@stylexblocks/uiSolstice UI
Inspect live surface contrast, typography, corner radii, density rhythm, and interactive focus states across stock UI SDK primitives.
Workspace Access
3 membersInvite contributors and test select popovers, inputs, and avatar contrast.
solstice-coreArtifact Storage
68% usedNumeric hierarchy, circular rings, and progress track contrast.
Release Feed & Alerts
Status callouts, timeline connectors, tags, and keyboard cues.
Security & Alerts
2/3 onSelection controls verifying checked fills, focus rings, and label alignment.
Plan & Capacity
Selectable radio cards, numeric steppers, and range sliders.
Tokens & Controls
OKLCHInspect live semantic swatches, typographic scale, and button hierarchy.
accentPaletteInstall
1npx stylexblocks add theme-showcaseSource
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061import * 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 & 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 & 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 & 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 & 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 & 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 & 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 & 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> );}
Inspired by the Theme Showcase template from Astryx (MIT License · Copyright (c) 2026 Meta Platforms, Inc.).