"use client"; import "./components/ui/tidal.css"; import { useRef, useState } from "react"; import { TidalScrollArea } from "./components/ui/scroll-area"; import "./components/ui/scroll-area.css"; const tidalExampleStyles = ".tidal-scope .scroll-area-demo,\n.tidal-scope .scroll-area-demo * {\n box-sizing: border-box;\n}\n\n.tidal-scope .scroll-area-demo {\n width: 100%;\n min-width: 0;\n container: scroll-area-demo / inline-size;\n}\n\n.tidal-scope .scroll-area-demo-frame {\n min-width: 0;\n padding: 22px;\n border: 1px solid var(--t-border);\n border-radius: 22px;\n background:\n linear-gradient(var(--t-border) 1px, transparent 1px) 0 0 / 30px 30px,\n var(--t-subtle);\n}\n\n.tidal-scope .scroll-area-demo-list {\n display: grid;\n width: max-content;\n min-width: 100%;\n grid-template-columns: repeat(6, minmax(226px, 1fr));\n gap: 1px;\n margin: 0;\n padding: 0;\n background: var(--t-border);\n list-style: none;\n}\n\n.tidal-scope .scroll-area-demo-list > li {\n display: flex;\n min-width: 0;\n min-height: 238px;\n flex-direction: column;\n padding: 18px;\n background: var(--t-surface);\n animation: tidal-scroll-card-in 420ms var(--t-ease-out) both;\n}\n\n.tidal-scope .scroll-area-demo-list > li:nth-child(2) {\n animation-delay: 48ms;\n}\n\n.tidal-scope .scroll-area-demo-list > li:nth-child(3) {\n animation-delay: 96ms;\n}\n\n.tidal-scope .scroll-area-demo-list > li:nth-child(4) {\n animation-delay: 144ms;\n}\n\n.tidal-scope .scroll-area-demo-list > li:nth-child(5) {\n animation-delay: 192ms;\n}\n\n.tidal-scope .scroll-area-demo-list > li:nth-child(n + 6) {\n animation-delay: 240ms;\n}\n\n.tidal-scope .scroll-area-demo-index {\n display: flex;\n min-width: 0;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n color: var(--t-muted);\n font-size: 11px;\n font-weight: 700;\n letter-spacing: 0.09em;\n line-height: 1.35;\n text-transform: uppercase;\n}\n\n.tidal-scope .scroll-area-demo-list time {\n margin-top: auto;\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.4;\n}\n\n.tidal-scope .scroll-area-demo-list h3 {\n max-width: 13ch;\n margin: 9px 0 0;\n font-size: 21px;\n font-weight: 570;\n letter-spacing: -0.045em;\n line-height: 1.05;\n text-wrap: balance;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .scroll-area-demo-list p {\n max-width: 34ch;\n margin: 10px 0 0;\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.55;\n overflow-wrap: anywhere;\n}\n\n@container scroll-area-demo (max-width: 520px) {\n .tidal-scope .scroll-area-demo-frame {\n padding: 7px;\n }\n\n .tidal-scope .scroll-area-demo-list {\n grid-template-columns: repeat(6, minmax(252px, 1fr));\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .tidal-scope .scroll-area-demo-list > li {\n animation: none;\n }\n}\n\n@keyframes tidal-scroll-card-in {\n from {\n opacity: 0;\n transform: translateY(7px);\n }\n}"; const RELEASES = [ { id: "r-13", version: "1.3", dateTime: "2026-09-29", date: "Sep 29", title: "Mobile details", summary: "Narrow previews keep readable controls and natural scrolling.", }, { id: "r-14", version: "1.4", dateTime: "2026-10-02", date: "Oct 2", title: "Search recovery", summary: "Empty results include a direct reset with stable input focus.", }, { id: "r-15", version: "1.5", dateTime: "2026-10-05", date: "Oct 5", title: "Activity groups", summary: "Grouped updates now keep time, actor, and context together.", }, { id: "r-16", version: "1.6", dateTime: "2026-10-08", date: "Oct 8", title: "Project labels", summary: "Faster filtering with removable labels and visible counts.", }, { id: "r-17", version: "1.7", dateTime: "2026-10-11", date: "Oct 11", title: "Invoice layouts", summary: "Compact totals and line-item details for document previews.", }, { id: "r-18", version: "1.8", dateTime: "2026-10-14", date: "Oct 14", title: "Keyboard review", summary: "Clear focus order and visible recovery actions across the library.", }, ] as const; export function ScrollAreaDemo() { const viewportRef = useRef(null); const [position, setPosition] = useState("At the first update."); function updatePosition(node: HTMLDivElement) { const maximum = Math.max(0, node.scrollWidth - node.clientWidth); if (node.scrollLeft <= 4) setPosition("At the first update."); else if (node.scrollLeft >= maximum - 4) setPosition("At the latest update."); else setPosition("Reviewing the updates in between."); } return (
updatePosition(event.currentTarget), }} startAction={{ label: "First update", accessibleLabel: "Scroll to the first release update", onAction: () => setPosition("Returning to the first update."), }} endAction={{ label: "Latest update", accessibleLabel: "Scroll to the latest release update", onAction: () => setPosition("Moving to the latest update."), }} footer={ {position} Sample data. Changes stay in this preview. } >
    {RELEASES.map((release, index) => (
  1. {String(index + 1).padStart(2, "0")} v{release.version}

    {release.title}

    {release.summary}

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