{cssVar}
{name}
{role}
import {
colorTokens,
defaultMotionAccessibility,
defaultMotionPack,
motionTokens,
motionAccessibilityDetails,
motionPackDetails,
radiusTokens,
shadowTokens,
themeDetails,
themeNames,
typographyTokens,
type MotionAccessibilityName,
type MotionPackName,
type ThemeName
} from "@ai-ui/tokens";
import type { Meta, StoryObj } from "@storybook/react";
type TokensOverviewProps = {
motionAccessibility: MotionAccessibilityName;
motionPack: MotionPackName;
theme: ThemeName;
};
function ResolvedTokenValue({ cssVar }: { cssVar: string }) {
const value =
typeof document === "undefined"
? ""
: getComputedStyle(document.documentElement).getPropertyValue(cssVar).trim();
return {value || cssVar};
}
function TokenSwatch({
cssVar,
name,
role
}: {
cssVar: string;
name: string;
role: string;
}) {
return (
{name} {role}
{theme.label}
{theme.note}
Surface
Secondary containers and ambient panels.
Card
Elevated containers for composition.
Primary
Shared action color and emphasis layer.
{cssVar}
AI UI / Phase 1
Theme switching now happens at the token layer, not inside component implementations. Motion is also represented as named tokens and starter recipes rather than ad hoc transition values.
Active Theme
{themeDetails[theme].label}
Motion Pack
{motionPackDetails[motionPack].label}
Accessibility Override
{motionAccessibilityDetails[motionAccessibility].label}
These cards render their own nested theme roots, so tokens can be validated side by side without touching component code.
Semantic color tokens replace hardcoded brand values. Components consume roles such as primary, muted, destructive, or surface.
The system now separates display voice, body readability, and metadata density into named text roles.
{token.fontVar}
{token.familyVar}
{token.sample}
{token.name}
{token.cssVar}
{token.name}
{token.cssVar}
Timing and motion scale now live in variables that components can consume directly. The toolbar now separates the active motion pack from the accessibility override.
`motion.css` now includes a small recipe layer for transitions, press feedback, enters, and overlays.
{recipe}
recipe