import "./components/ui/tidal.css"; import { useMemo, useState } from "react"; import { ArrowRight, Check, Clock3, Eye, ListChecks, LockKeyhole, RefreshCw, Sparkles, UsersRound } from "lucide-react"; import { TidalFeatureAction, TidalFeatureCard, TidalFeatureGrid } from "./components/ui/feature-grid"; import "./components/ui/feature-grid.css"; function tidalExampleAvatarDataUri(seed: unknown) { const text = String(seed).replace(/[^a-z0-9]/gi, "").slice(-2) || "UI"; const palette = ["#333333", "#555555", "#777777", "#999999", "#bbbbbb"]; const color = palette[Array.from(text).reduce((sum, character) => sum + character.charCodeAt(0), 0) % palette.length]; const svg = ``; return `data:image/svg+xml,${encodeURIComponent(svg)}`; } function tidalExampleImageDataUri(label: string) { const safeLabel = label.replace(/[<>&]/g, "").slice(0, 28) || "Sample image"; const svg = `${safeLabel}`; return `data:image/svg+xml,${encodeURIComponent(svg)}`; } const tidalExampleStyles = ".tidal-scope .feature-grid-demo-specimen {\n position: relative;\n width: 100%;\n min-width: 0;\n padding: clamp(18px, 4vw, 52px);\n color: var(--t-ink);\n background: var(--t-subtle);\n border: 1px solid var(--t-border);\n border-radius: var(--t-radius-card);\n container: feature-grid-demo / inline-size;\n}\n\n.tidal-scope .feature-grid-demo-tabs,\n.tidal-scope .feature-grid-demo-filters {\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n padding: 4px;\n background: var(--feature-subtle);\n border: 1px solid var(--feature-border);\n border-radius: 12px;\n}\n\n.tidal-scope .feature-grid-demo-tabs button,\n.tidal-scope .feature-grid-demo-filters button {\n position: relative;\n flex: 1 1 70px;\n min-width: 44px;\n min-height: 44px;\n padding: 8px 11px;\n color: var(--feature-muted);\n font: inherit;\n font-size: 11px;\n font-weight: 620;\n background: transparent;\n border: 0;\n border-radius: 8px;\n cursor: pointer;\n transition:\n color 180ms,\n background 180ms,\n transform 140ms var(--t-ease-out);\n}\n\n.tidal-scope .feature-grid-demo-tabs button[aria-pressed=\"true\"],\n.tidal-scope .feature-grid-demo-filters button[aria-pressed=\"true\"] {\n color: var(--feature-surface);\n background: var(--feature-ink);\n}\n\n.tidal-scope .feature-grid-demo-tabs button:hover,\n.tidal-scope .feature-grid-demo-filters button:hover {\n color: var(--feature-ink);\n}\n\n.tidal-scope .feature-grid-demo-tabs button:active,\n.tidal-scope .feature-grid-demo-filters button:active {\n transform: scale(0.97);\n}\n\n.tidal-scope .feature-grid-demo-tabs button:focus-visible,\n.tidal-scope .feature-grid-demo-filters button:focus-visible,\n.tidal-scope .feature-grid-demo-checklist input:focus-visible + span,\n.tidal-scope .feature-grid-demo-switch input:focus-visible ~ i {\n outline: 2px solid var(--feature-ink);\n outline-offset: 2px;\n}\n\n.tidal-scope .feature-grid-demo-timeline {\n display: grid;\n gap: 0;\n min-width: 0;\n margin: 18px 0 0;\n padding: 0;\n list-style: none;\n border-top: 1px solid var(--feature-border);\n}\n\n.tidal-scope .feature-grid-demo-timeline li {\n display: grid;\n grid-template-columns: 34px minmax(0, 1fr) auto;\n align-items: center;\n gap: 12px;\n min-width: 0;\n min-height: 54px;\n border-bottom: 1px solid var(--feature-border);\n}\n\n.tidal-scope .feature-grid-demo-timeline li > span,\n.tidal-scope .feature-grid-demo-timeline li > small {\n color: var(--feature-muted);\n font-size: 11px;\n font-variant-numeric: tabular-nums;\n}\n\n.tidal-scope .feature-grid-demo-timeline li > strong {\n min-width: 0;\n color: var(--feature-ink);\n font-size: 12px;\n font-weight: 560;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .feature-grid-demo-timeline li > small {\n padding: 4px 7px;\n color: var(--feature-ink);\n background: var(--feature-wash);\n border-radius: 999px;\n}\n\n.tidal-scope .feature-grid-demo-readiness .tidal-feature-card-content {\n position: relative;\n}\n\n.tidal-scope .feature-grid-demo-progress {\n height: 8px;\n overflow: hidden;\n background: var(--feature-wash);\n border-radius: 999px;\n}\n\n.tidal-scope .feature-grid-demo-progress > span {\n display: block;\n height: 100%;\n background: var(--feature-ink);\n border-radius: inherit;\n transition: width 420ms var(--t-ease-out);\n}\n\n.tidal-scope .feature-grid-demo-progress-label {\n display: block;\n margin-top: 10px;\n color: var(--feature-muted);\n font-size: 11px;\n font-weight: 550;\n font-variant-numeric: tabular-nums;\n}\n\n.tidal-scope .feature-grid-demo-checklist {\n display: grid;\n gap: 7px;\n margin-top: 24px;\n}\n\n.tidal-scope .feature-grid-demo-checklist label {\n position: relative;\n display: grid;\n grid-template-columns: 44px minmax(0, 1fr) auto;\n align-items: center;\n min-width: 0;\n min-height: 52px;\n padding-inline-end: 12px;\n color: var(--feature-muted);\n background: var(--feature-subtle);\n border: 1px solid var(--feature-border);\n border-radius: 11px;\n cursor: pointer;\n}\n\n.tidal-scope .feature-grid-demo-checklist input,\n.tidal-scope .feature-grid-demo-switch input {\n position: absolute;\n inset: 0;\n z-index: 1;\n width: 100%;\n height: 100%;\n margin: 0;\n opacity: 0;\n cursor: pointer;\n}\n\n.tidal-scope .feature-grid-demo-checklist label > span {\n display: grid;\n place-items: center;\n width: 44px;\n height: 44px;\n color: transparent;\n transition:\n color 180ms,\n transform 320ms var(--t-ease-spring);\n}\n\n.tidal-scope .feature-grid-demo-checklist input:checked + span {\n color: var(--feature-ink);\n transform: rotate(-4deg);\n}\n\n.tidal-scope .feature-grid-demo-checklist label > strong {\n min-width: 0;\n color: inherit;\n font-size: 11px;\n font-weight: 550;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .feature-grid-demo-checklist input:checked ~ strong {\n color: var(--feature-ink);\n}\n\n.tidal-scope .feature-grid-demo-checklist label > small {\n color: inherit;\n font-size: 11px;\n font-variant-numeric: tabular-nums;\n}\n\n.tidal-scope .feature-grid-demo-orbit {\n position: relative;\n display: grid;\n place-items: center;\n width: min(100%, 190px);\n aspect-ratio: 1;\n margin: auto auto 0;\n}\n\n.tidal-scope .feature-grid-demo-orbit > span {\n position: absolute;\n width: 72%;\n aspect-ratio: 1;\n border: 1px solid var(--feature-border);\n border-radius: 50%;\n}\n\n.tidal-scope .feature-grid-demo-orbit > span:nth-child(2) {\n width: 100%;\n border-style: dashed;\n transform: rotate(18deg);\n}\n\n.tidal-scope .feature-grid-demo-orbit > svg {\n width: 52px;\n height: 52px;\n padding: 14px;\n color: var(--feature-surface);\n background: var(--feature-ink);\n border-radius: 14px;\n box-shadow: 0 18px 32px -22px #000000;\n}\n\n.tidal-scope .feature-grid-demo-switch {\n position: relative;\n display: grid;\n grid-template-columns: minmax(0, 1fr) 52px;\n align-items: center;\n gap: 14px;\n min-width: 0;\n min-height: 70px;\n padding: 10px 10px 10px 14px;\n background: var(--feature-subtle);\n border: 1px solid var(--feature-border);\n border-radius: 12px;\n cursor: pointer;\n}\n\n.tidal-scope .feature-grid-demo-switch > span {\n min-width: 0;\n}\n\n.tidal-scope .feature-grid-demo-switch strong,\n.tidal-scope .feature-grid-demo-switch small {\n display: block;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .feature-grid-demo-switch strong {\n color: var(--feature-ink);\n font-size: 11px;\n font-weight: 600;\n}\n\n.tidal-scope .feature-grid-demo-switch small {\n margin-top: 4px;\n color: var(--feature-muted);\n font-size: 11px;\n line-height: 1.45;\n}\n\n.tidal-scope .feature-grid-demo-switch > i {\n display: flex;\n align-items: center;\n width: 48px;\n height: 30px;\n padding: 4px;\n background: var(--feature-wash);\n border: 1px solid var(--feature-border);\n border-radius: 999px;\n}\n\n.tidal-scope .feature-grid-demo-switch > i > span {\n width: 20px;\n height: 20px;\n background: var(--feature-ink);\n border-radius: 50%;\n transition: transform 320ms var(--t-ease-spring);\n}\n\n.tidal-scope .feature-grid-demo-switch input:checked ~ i > span {\n transform: translateX(17px);\n}\n\n[dir=\"rtl\"] .tidal-scope .feature-grid-demo-switch input:checked ~ i > span,\n.tidal-scope [dir=\"rtl\"] .feature-grid-demo-switch input:checked ~ i > span {\n transform: translateX(-17px);\n}\n\n.tidal-scope .feature-grid-demo-members {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 8px;\n margin-top: auto;\n padding-top: 22px;\n}\n\n.tidal-scope .feature-grid-demo-members > img {\n display: block;\n width: 34px;\n height: 34px;\n object-fit: cover;\n filter: grayscale(1) contrast(1.04);\n border: 1px solid var(--feature-border);\n border-radius: 50%;\n}\n\n.tidal-scope .feature-grid-demo-members > strong {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n color: var(--feature-muted);\n font-size: 11px;\n font-weight: 520;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .feature-grid-demo-events {\n display: grid;\n gap: 0;\n min-width: 0;\n margin: 14px 0 0;\n padding: 0;\n list-style: none;\n}\n\n.tidal-scope .feature-grid-demo-events li {\n display: grid;\n grid-template-columns: 9px minmax(0, 1fr);\n gap: 10px;\n min-width: 0;\n padding: 11px 2px;\n border-bottom: 1px solid var(--feature-border);\n}\n\n.tidal-scope .feature-grid-demo-events li > span {\n width: 7px;\n height: 7px;\n margin-top: 5px;\n background: var(--feature-ink);\n border-radius: 50%;\n}\n\n.tidal-scope .feature-grid-demo-events p {\n min-width: 0;\n margin: 0;\n color: var(--feature-muted);\n font-size: 11px;\n line-height: 1.5;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .feature-grid-demo-activity .tidal-feature-card-footer {\n display: flex;\n}\n\n.tidal-scope .feature-grid-demo-status {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .tidal-scope .feature-grid-demo-timeline,\n .tidal-scope .feature-grid-demo-events {\n animation: feature-grid-demo-content 320ms var(--t-ease-out) both;\n }\n}\n\n@keyframes feature-grid-demo-content {\n from {\n opacity: 0;\n transform: translateY(7px);\n }\n to {\n opacity: 1;\n transform: none;\n }\n}\n\n@container feature-grid-demo (max-width: 430px) {\n .tidal-scope .feature-grid-demo-timeline li {\n grid-template-columns: 26px minmax(0, 1fr) auto;\n gap: 8px;\n }\n\n .tidal-scope .feature-grid-demo-orbit {\n width: 142px;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .tidal-scope .feature-grid-demo-tabs button,\n .tidal-scope .feature-grid-demo-filters button,\n .tidal-scope .feature-grid-demo-progress > span,\n .tidal-scope .feature-grid-demo-checklist label > span,\n .tidal-scope .feature-grid-demo-switch > i > span,\n .tidal-scope .feature-grid-demo-timeline,\n .tidal-scope .feature-grid-demo-events {\n animation: none;\n transition: none;\n }\n\n .tidal-scope .feature-grid-demo-tabs button:active,\n .tidal-scope .feature-grid-demo-filters button:active,\n .tidal-scope .feature-grid-demo-checklist input:checked + span {\n transform: none;\n }\n}"; type WorkView = "plan" | "build" | "review"; type ActivityFilter = "all" | "updates" | "notes"; const views: ReadonlyArray<{ id: WorkView; label: string; focus: string; owner: string; time: string; tasks: readonly string[]; }> = [ { id: "plan", label: "Plan", focus: "Confirm the release outline", owner: "Ava", time: "09:30", tasks: ["Review scope", "Assign draft", "Set handoff"], }, { id: "build", label: "Build", focus: "Assemble the launch page", owner: "Noah", time: "11:00", tasks: ["Place sections", "Connect actions", "Check mobile"], }, { id: "review", label: "Review", focus: "Complete the final walkthrough", owner: "Mila", time: "14:15", tasks: ["Read every label", "Test keyboard", "Record decision"], }, ]; const milestoneOptions = [ { id: "copy", label: "Copy approved" }, { id: "layout", label: "Layout reviewed" }, { id: "mobile", label: "Mobile checked" }, ] as const; const baseActivity = [ { id: "u1", type: "updates", text: "Noah moved the sample page to review." }, { id: "n1", type: "notes", text: "Mila added a note to the launch outline." }, { id: "u2", type: "updates", text: "Ava confirmed the handoff window." }, ] as const; export function FeatureGridDemo() { const [view, setView] = useState("build"); const [complete, setComplete] = useState>( () => new Set(["copy", "layout"]), ); const [reviewPreview, setReviewPreview] = useState(false); const [filter, setFilter] = useState("all"); const [message, setMessage] = useState("Build view selected."); const active = views.find((item) => item.id === view) ?? views[0]; const progress = Math.round((complete.size / milestoneOptions.length) * 100); const activity = useMemo(() => { const items = reviewPreview ? [ { id: "access", type: "updates" as const, text: "Local review-link preview turned on. No link was created or shared.", }, ...baseActivity, ] : baseActivity; return filter === "all" ? items : items.filter((item) => item.type === filter); }, [filter, reviewPreview]); function chooseView(next: WorkView) { setView(next); const selected = views.find((item) => item.id === next); setMessage(`${selected?.label ?? next} view selected.`); } function toggleMilestone(id: string, checked: boolean) { setComplete((current) => { const next = new Set(current); if (checked) next.add(id); else next.delete(id); return next; }); const item = milestoneOptions.find((option) => option.id === id); setMessage( `${item?.label ?? "Milestone"} marked ${checked ? "complete" : "open"}.`, ); } function resetSample() { setView("build"); setComplete(new Set(["copy", "layout"])); setReviewPreview(false); setFilter("all"); setMessage("Sample workspace reset."); } return (
} footer={ {active.owner} owns this block ยท {active.time} sample time } >
{views.map((item) => ( ))}
    {active.tasks.map((task, index) => (
  1. {task} {index === 0 ? Now : null}
  2. ))}
} footer={ progress === 100 ? "Sample ready for a final decision." : "Complete every check before the final decision." } > {progress}% complete
{milestoneOptions.map((item, index) => ( ))}
: } >
Ava, fictional sample teammate Noah, fictional sample teammate Mila, fictional sample teammate
} footer={ } >
{(["all", "updates", "notes"] as const).map((item) => ( ))}
    {activity.map((item) => (
  • ))}

{message}

); } export default function AgentExample() { return (
); }