import { Badge, Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@godxjp/ui/data-display"; import { Text } from "@godxjp/ui/general"; import { Flex, PageContainer, ResponsiveGrid } from "@godxjp/ui/layout"; /** * Radius & Shadow · design-token foundation. base radius 6px; shadows stay flat * (cards have NO shadow at rest · elevation only climbs at popover / dialog). * Boxes render the real token var; composed only from real @godxjp/ui components. */ // DS authors the base --radius (6px) and derives sm/md/lg in @theme. --radius-xl // and --radius-full are NOT overridden · they fall through to Tailwind defaults. // `value` is the CSS the swatch renders. ds tokens resolve their var; xl/full are NOT authored as // vars (they fall through to Tailwind `rounded-xl` / `rounded-full`), so we render their literal // value — otherwise `var(--radius-full)` is undefined and the swatch collapses to a square. const radii = [ { token: "--radius-sm", px: "2px", value: "var(--radius-sm)", source: "ds" as const }, { token: "--radius-md", px: "4px", value: "var(--radius-md)", source: "ds" as const }, { token: "--radius", px: "6px (base)", value: "var(--radius)", source: "ds" as const }, { token: "--radius-lg", px: "6px", value: "var(--radius-lg)", source: "ds" as const }, { token: "--radius-xl", px: "12px", value: "0.75rem", source: "tw" as const }, { token: "--radius-full", px: "pill", value: "9999px", source: "tw" as const }, ]; const shadows = [ { token: "--shadow-sm", role: "subtle lift" }, { token: "--shadow-lg", role: "popover / elevated" }, { token: "--shadow-xl", role: "dialog" }, ]; export default function Demo() { return ( Corner radius The system authors the base 6px radius and derives sm/md/lg from it. xl and full are not overridden; they fall through to Tailwind defaults. {radii.map((r) => (
{r.token} {r.source === "tw" ? ( Tailwind default ) : null} {r.px}
))} Elevation Cards carry a 1px border and NO shadow at rest. Shadow appears only on floating surfaces: popover and dialog. {shadows.map((s) => (
{s.token} {s.role}
))} {/* Rest vs elevated, shown live: a resting Card (border, no shadow) next to a floating surface lifted by --shadow-lg, so the elevation rule is demonstrated, not just asserted. */} At rest(カード) border-border, no shadow resting surface · flat {/* ui-audit-disable-next-line no-utility-spacing — a tile showing the shadow token itself; the box IS the subject */}
Floating(ポップオーバー) --shadow-lg lifts it off the page
floating surface · elevated
); }