import "./components/ui/tidal.css"; import { useState } from "react"; import { RotateCcw } from "lucide-react"; import { TidalStatsGrid, type TidalStatsGridMetric } from "./components/ui/stats-grid"; import "./components/ui/stats-grid.css"; const tidalExampleStyles = ".tidal-scope .stats-grid-demo {\n width: 100%;\n max-width: 1160px;\n min-width: 0;\n overflow: hidden;\n border: 1px solid var(--t-border);\n border-radius: 22px;\n background: var(--t-subtle);\n color: var(--t-ink);\n box-shadow: 0 30px 66px -46px #00000070;\n container-type: inline-size;\n}\n\n.tidal-scope .stats-grid-demo,\n.tidal-scope .stats-grid-demo * {\n box-sizing: border-box;\n}\n\n.tidal-scope .stats-grid-demo-layout {\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n min-width: 0;\n}\n\n\n.tidal-scope .stats-grid-demo-stage-head,\n.tidal-scope .stats-grid-demo-table-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 14px;\n min-width: 0;\n}\n\n.tidal-scope .stats-grid-demo-kicker {\n display: block;\n color: var(--t-muted);\n font-size: 11px;\n font-weight: 650;\n letter-spacing: 0.12em;\n line-height: 1.4;\n text-transform: uppercase;\n}\n\n.tidal-scope .stats-grid-demo-stage {\n display: grid;\n min-width: 0;\n gap: 20px;\n padding: 27px;\n background:\n linear-gradient(var(--t-border) 1px, transparent 1px),\n linear-gradient(90deg, var(--t-border) 1px, transparent 1px),\n var(--t-subtle);\n background-size: 22px 22px;\n}\n\n.tidal-scope .stats-grid-demo-stage-head {\n align-items: flex-start;\n}\n\n.tidal-scope .stats-grid-demo-table-head > div {\n min-width: 0;\n}\n\n.tidal-scope .stats-grid-demo-stage-head p {\n max-width: 530px;\n margin: 5px 0 0;\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.5;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .stats-grid-demo-stage-head button,\n.tidal-scope .stats-grid-demo-periods button {\n display: inline-flex;\n min-width: 44px;\n min-height: 44px;\n align-items: center;\n justify-content: center;\n gap: 7px;\n padding: 8px 12px;\n border: 1px solid var(--t-border);\n border-radius: 10px;\n background: var(--t-surface);\n color: var(--t-ink);\n font: inherit;\n font-size: 11px;\n font-weight: 650;\n cursor: pointer;\n transition:\n background 160ms,\n border-color 160ms,\n transform 140ms var(--t-ease-out);\n}\n\n.tidal-scope .stats-grid-demo-stage-head button {\n flex: none;\n}\n\n.tidal-scope .stats-grid-demo-stage-head button:hover,\n.tidal-scope .stats-grid-demo-periods button:hover {\n background: var(--t-wash);\n}\n\n.tidal-scope .stats-grid-demo-stage-head button:active,\n.tidal-scope .stats-grid-demo-periods button:active {\n transform: scale(0.98);\n}\n\n.tidal-scope .stats-grid-demo-stage-head button:focus-visible,\n.tidal-scope .stats-grid-demo-periods button:focus-visible {\n outline: 2px solid var(--t-accent);\n outline-offset: 3px;\n}\n\n.tidal-scope .stats-grid-demo-periods {\n display: grid;\n grid-template-columns: repeat(3, minmax(0, 1fr));\n gap: 7px;\n min-width: 0;\n}\n\n.tidal-scope .stats-grid-demo-periods button {\n min-width: 0;\n}\n\n.tidal-scope .stats-grid-demo-periods button[aria-pressed=\"true\"] {\n border-color: var(--t-ink);\n background: var(--t-ink);\n color: var(--t-surface);\n}\n\n.tidal-scope .stats-grid-demo-table-wrap {\n min-width: 0;\n padding: 21px 22px 19px;\n border: 1px solid var(--t-border);\n border-radius: 18px;\n background: var(--t-surface);\n}\n\n.tidal-scope .stats-grid-demo-table-head {\n align-items: end;\n padding-bottom: 16px;\n border-bottom: 1px solid var(--t-border);\n}\n\n.tidal-scope .stats-grid-demo-table-head h3 {\n margin: 7px 0 0;\n font-size: 20px;\n font-weight: 500;\n letter-spacing: -0.04em;\n line-height: 1.05;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .stats-grid-demo-table-note {\n max-width: 190px;\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.45;\n text-align: end;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .stats-grid-demo-table-scroll {\n min-width: 0;\n overflow-x: auto;\n}\n\n.tidal-scope .stats-grid-demo-table-scroll table {\n width: 100%;\n min-width: 0;\n table-layout: fixed;\n border-collapse: collapse;\n color: var(--t-ink);\n font-size: 11px;\n text-align: start;\n}\n\n.tidal-scope .stats-grid-demo-table-scroll th,\n.tidal-scope .stats-grid-demo-table-scroll td {\n padding: 13px 10px;\n border-bottom: 1px solid var(--t-border);\n text-align: start;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .stats-grid-demo-table-scroll thead th {\n color: var(--t-muted);\n font-size: 11px;\n font-weight: 650;\n letter-spacing: 0.1em;\n text-transform: uppercase;\n}\n\n.tidal-scope .stats-grid-demo-table-scroll tbody th {\n font-weight: 650;\n}\n\n.tidal-scope .stats-grid-demo-table-scroll tr:last-child > * {\n border-bottom: 0;\n}\n\n.tidal-scope .stats-grid-demo-disclosure {\n margin: 15px 0 0;\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.55;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .stats-grid-demo-visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n border: 0;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n white-space: nowrap;\n}\n\n@container (max-width: 760px) {\n .tidal-scope .stats-grid-demo-layout {\n grid-template-columns: minmax(0, 1fr);\n }\n}\n\n@container (max-width: 500px) {\n .tidal-scope .stats-grid-demo-stage {\n gap: 15px;\n padding: 14px;\n background-size: 18px 18px;\n }\n\n .tidal-scope .stats-grid-demo-stage-head {\n display: block;\n }\n\n .tidal-scope .stats-grid-demo-stage-head button {\n width: 100%;\n margin-top: 12px;\n }\n\n .tidal-scope .stats-grid-demo-periods {\n grid-template-columns: minmax(0, 1fr);\n }\n\n .tidal-scope .stats-grid-demo-table-wrap {\n padding: 18px 16px 16px;\n }\n\n .tidal-scope .stats-grid-demo-table-head {\n align-items: flex-start;\n flex-direction: column;\n gap: 8px;\n }\n\n .tidal-scope .stats-grid-demo-table-note {\n max-width: none;\n text-align: start;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .tidal-scope .stats-grid-demo-stage-head button,\n .tidal-scope .stats-grid-demo-periods button {\n transition: none;\n transform: none;\n }\n}"; type PeriodId = "current" | "previous" | "baseline"; interface PeriodData { label: string; note: string; metrics: readonly TidalStatsGridMetric[]; rows: readonly [string, string, string][]; } const PERIODS: Record = { current: { label: "Current month", note: "Sample workspace / current month", metrics: [ { id: "active-work", label: "Active work", value: "28", comparison: "+6 sample items", detail: "Open items across three fictional lanes.", trend: "positive", valueKey: "current-active", href: "#stats-grid-demo-table", }, { id: "review-ready", label: "Review ready", value: "12", comparison: "4 awaiting a read", detail: "Prepared items in the local review queue.", trend: "neutral", valueKey: "current-review", }, { id: "planned-hours", label: "Planned hours", value: "86h", comparison: "+14h in sample plan", detail: "A display value supplied by the workspace owner.", trend: "positive", valueKey: "current-hours", }, { id: "open-questions", label: "Open questions", value: "07", comparison: "2 marked urgent", detail: "Questions still visible in the local handoff list.", trend: "negative", valueKey: "current-questions", }, ], rows: [ ["Planning", "In review", "Ava"], ["Build", "On track", "Noah"], ["Handoff", "2 questions", "Mila"], ], }, previous: { label: "Previous month", note: "Sample workspace / previous month", metrics: [ { id: "active-work", label: "Active work", value: "22", comparison: "5 sample items", detail: "Open items in the previous local snapshot.", trend: "neutral", valueKey: "previous-active", href: "#stats-grid-demo-table", }, { id: "review-ready", label: "Review ready", value: "08", comparison: "3 awaiting a read", detail: "Prepared items in the previous sample queue.", trend: "neutral", valueKey: "previous-review", }, { id: "planned-hours", label: "Planned hours", value: "72h", comparison: "9h in sample plan", detail: "The earlier display value supplied by the workspace owner.", trend: "neutral", valueKey: "previous-hours", }, { id: "open-questions", label: "Open questions", value: "09", comparison: "3 marked urgent", detail: "Questions visible in the previous local handoff list.", trend: "negative", valueKey: "previous-questions", }, ], rows: [ ["Planning", "Draft", "Ava"], ["Build", "In progress", "Noah"], ["Handoff", "3 questions", "Mila"], ], }, baseline: { label: "Baseline snapshot", note: "Sample workspace / baseline snapshot", metrics: [ { id: "active-work", label: "Active work", value: "18", comparison: "Baseline sample", detail: "A fixed local comparison snapshot.", trend: "neutral", valueKey: "baseline-active", href: "#stats-grid-demo-table", }, { id: "review-ready", label: "Review ready", value: "06", comparison: "Baseline sample", detail: "A fixed local comparison snapshot.", trend: "neutral", valueKey: "baseline-review", }, { id: "planned-hours", label: "Planned hours", value: "64h", comparison: "Baseline sample", detail: "A fixed local comparison snapshot.", trend: "neutral", valueKey: "baseline-hours", }, { id: "open-questions", label: "Open questions", value: "11", comparison: "Baseline sample", detail: "A fixed local comparison snapshot.", trend: "neutral", valueKey: "baseline-questions", }, ], rows: [ ["Planning", "Open", "Ava"], ["Build", "Not started", "Noah"], ["Handoff", "4 questions", "Mila"], ], }, }; const PERIOD_OPTIONS: readonly { id: PeriodId; label: string }[] = [ { id: "current", label: "Current" }, { id: "previous", label: "Previous" }, { id: "baseline", label: "Baseline" }, ]; export function StatsGridDemo() { const [period, setPeriod] = useState("current"); const [message, setMessage] = useState("Current month sample selected."); const active = PERIODS[period]; function choosePeriod(next: PeriodId) { setPeriod(next); setMessage(`${PERIODS[next].label} sample selected.`); } function resetSample() { setPeriod("current"); setMessage("Current month sample restored."); } return (

{active.note}. Switching updates the cards and detail table.

{PERIOD_OPTIONS.map((option) => ( ))}
DETAIL TABLE

{active.label} lanes

{message}
{active.rows.map(([lane, state, owner]) => ( ))}
{active.label} fictional sample workspace lanes
Lane State Owner
{lane} {state} {owner}

Fictional sample values for local component review only. This preview makes no customer, adoption, performance, revenue, or live-data claim.

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