/** * Card — surface component * * ── SPACING SYSTEM (do not override) ──────────────────────────────────────── * Card owns all vertical rhythm via `--card-spacing`: * default → 16px (`--spacing(4)`) * size="sm" → 12px (`--spacing(3)`) * * Rules: * ✗ Never add pb-X / pt-X to CardContent or CardHeader * ✗ Never add h-full / flex / flex-col to the Card wrapper * ✗ Never add flex-1 / min-h-0 to CardContent * ✗ Never add shrink-0 / pb-2 to CardHeader * ✓ For scrollable list content (Activity, Tasks): add overflow-auto only * ✓ For equal-height grid pairs in MixView: handle at grid cell level * ✓ Edge-to-edge scroll: `-mx-(--card-spacing)` + `px-(--card-spacing)` on the same node only * * ── CARD MEDIA ────────────────────────────────────────────────────────────── * CardMedia — photo, video, animation, illustration, audio only. * Charts and data viz belong in ChartCard — not CardMedia. * * ── GLOW TREATMENT ────────────────────────────────────────────────────────── * Only two approved uses — see full spec in key-metrics.tsx GLOW GUIDELINE: * 1. AI surfaces (Insights card, Ask Leo responses) → opacity 0.12–0.16 * 2. Hero sections (Key Metrics KPI band, onboarding) → opacity 0.18–0.24 * Always pair with overflow-hidden on the Card. * Never add glow to: Tasks, Activity, Learn, Charts, nav elements. * * ── FOOTER PATTERN ────────────────────────────────────────────────────────── * Use CardFooter for card-level CTA actions (e.g. "View all tasks", "Ask Leo"). * CardFooter renders with border-t only (no fill wash). * Do not put primary workflow actions in CardFooter — use CardHeader CardAction. * * ── INTERACTIVE ───────────────────────────────────────────────────────────── * Pass interactive on Card for hover shadow + cursor when the card is navigational. * Prefer wrapping in Link with interactive — do not nest buttons inside onClick Card. * Passing onClick makes the shell role="button" + tabIndex={0}; Enter and Space * activate it. Keys raised by nested controls are ignored. * * ── SIZE VARIANT ──────────────────────────────────────────────────────────── * size="sm" → tighter spacing. Use inside compact grids. * size="default" (implicit) → standard spacing described above. * * ── TYPOGRAPHY ────────────────────────────────────────────────────────────── * CardTitle renders as h3 by default (section heading inside a page with one H1). * CardDescription + CardContent body: text-sm minimum. * Never use arbitrary sub-12px classes on visible card copy. */ import * as React from "react" import { Slot } from "radix-ui" import { cn } from "../../lib/utils" import { ScrollRegion } from "./scroll-region" function Card({ className, size = "default", interactive = false, onClick, onKeyDown, ...props }: React.ComponentProps<"div"> & { size?: "default" | "sm" /** Hover shadow + pointer cursor — pair with Link or a single focusable child. */ interactive?: boolean }) { // A clickable Card stays a