"use client"; import "./components/ui/tidal.css"; import { useState } from "react"; import { RotateCcw } from "lucide-react"; import { TidalTextReveal, type TidalTextRevealMode } from "./components/ui/text-reveal"; import "./components/ui/text-reveal.css"; const tidalExampleStyles = ".tidal-scope .text-reveal-demo {\n width: 100%;\n max-width: 1040px;\n min-width: 0;\n overflow: hidden;\n border: 1px solid var(--t-border);\n border-radius: var(--t-radius-card);\n background: var(--t-subtle);\n color: var(--t-ink);\n box-shadow: 0 24px 54px -40px #00000066;\n container-type: inline-size;\n}\n\n.tidal-scope .text-reveal-demo,\n.tidal-scope .text-reveal-demo * {\n box-sizing: border-box;\n}\n\n.tidal-scope .text-reveal-demo-layout {\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n min-width: 0;\n}\n\n\n.tidal-scope .text-reveal-demo-stage-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n}\n\n.tidal-scope .text-reveal-demo-stage {\n display: grid;\n min-width: 0;\n gap: 21px;\n padding: 26px;\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 .text-reveal-demo-stage-head {\n align-items: flex-start;\n min-width: 0;\n}\n\n.tidal-scope .text-reveal-demo-stage-head > div {\n min-width: 0;\n}\n\n.tidal-scope .text-reveal-demo-stage-head p {\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 .text-reveal-demo-stage-head button,\n.tidal-scope .text-reveal-demo-controls button {\n min-width: 44px;\n min-height: 44px;\n border: 1px solid var(--t-border);\n border-radius: var(--t-radius-control);\n background: var(--t-surface);\n color: var(--t-ink);\n font: inherit;\n cursor: pointer;\n transition:\n background 160ms,\n border-color 160ms,\n transform 140ms var(--t-ease-out);\n}\n\n.tidal-scope .text-reveal-demo-stage-head button {\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n gap: 7px;\n padding: 8px 12px;\n font-size: 11px;\n font-weight: 650;\n}\n\n.tidal-scope .text-reveal-demo-stage-head button:hover,\n.tidal-scope .text-reveal-demo-controls button:hover {\n background: var(--t-wash);\n}\n\n.tidal-scope .text-reveal-demo-stage-head button:active,\n.tidal-scope .text-reveal-demo-controls button:active {\n transform: scale(0.98);\n}\n\n.tidal-scope .text-reveal-demo-stage-head button:focus-visible,\n.tidal-scope .text-reveal-demo-controls button:focus-visible {\n outline: 2px solid var(--t-accent);\n outline-offset: 3px;\n}\n\n.tidal-scope .text-reveal-demo-sample {\n min-width: 0;\n padding: 29px 28px 31px;\n border: 1px solid var(--t-border);\n border-radius: var(--t-radius-card);\n background: var(--t-surface);\n box-shadow: 0 14px 30px -26px #0000005c;\n}\n\n.tidal-scope .text-reveal-demo-sample-label {\n display: block;\n margin-bottom: 19px;\n color: var(--t-muted);\n font-size: 11px;\n font-weight: 650;\n letter-spacing: 0.12em;\n}\n\n.tidal-scope .text-reveal-demo-sample h2 {\n max-width: 660px;\n font-size: clamp(29px, 5.3cqi, 56px);\n font-weight: 500;\n letter-spacing: -0.06em;\n line-height: 0.99;\n text-wrap: balance;\n}\n\n.tidal-scope .text-reveal-demo-sample > p {\n max-width: 470px;\n margin: 19px 0 0;\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.65;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .text-reveal-demo-controls {\n display: grid;\n grid-template-columns: repeat(3, minmax(0, 1fr));\n gap: 8px;\n min-width: 0;\n}\n\n.tidal-scope .text-reveal-demo-controls button {\n display: grid;\n min-width: 0;\n align-content: center;\n justify-items: start;\n gap: 3px;\n padding: 9px 12px;\n text-align: start;\n}\n\n.tidal-scope .text-reveal-demo-controls 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 .text-reveal-demo-controls span,\n.tidal-scope .text-reveal-demo-controls small {\n min-width: 0;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .text-reveal-demo-controls span {\n font-size: 11px;\n font-weight: 650;\n}\n\n.tidal-scope .text-reveal-demo-controls small {\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.35;\n}\n\n.tidal-scope .text-reveal-demo-controls button[aria-pressed=\"true\"] small {\n color: color-mix(in srgb, var(--t-surface) 78%, var(--t-ink));\n}\n\n.tidal-scope .text-reveal-demo-status {\n margin: -5px 0 0;\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.45;\n overflow-wrap: anywhere;\n}\n\n@container (max-width: 760px) {\n .tidal-scope .text-reveal-demo-layout {\n grid-template-columns: minmax(0, 1fr);\n }\n}\n\n@container (max-width: 500px) {\n .tidal-scope .text-reveal-demo-stage {\n gap: 17px;\n padding: 14px;\n background-size: 18px 18px;\n }\n\n .tidal-scope .text-reveal-demo-stage-head {\n display: block;\n }\n\n .tidal-scope .text-reveal-demo-stage-head button {\n width: 100%;\n margin-top: 13px;\n }\n\n .tidal-scope .text-reveal-demo-sample {\n padding: 23px 19px 25px;\n }\n\n .tidal-scope .text-reveal-demo-sample h2 {\n font-size: 31px;\n }\n\n .tidal-scope .text-reveal-demo-controls {\n grid-template-columns: minmax(0, 1fr);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .tidal-scope .text-reveal-demo-stage-head button,\n .tidal-scope .text-reveal-demo-controls button {\n transition: none;\n transform: none;\n }\n}"; const MODES: readonly TidalTextRevealMode[] = ["words", "lines", "simple"]; const MODE_COPY: Record = { words: { label: "Words", note: "Each word takes its place." }, lines: { label: "Lines", note: "Line breaks become the rhythm." }, simple: { label: "Simple", note: "One quiet surface reveal." }, }; const REVEAL_COPY: Record = { words: "Make the next decision easier to see.", lines: "Make the next decision\neasier to see.", simple: "Make the next decision easier to see.", }; export function TextRevealDemo() { const [mode, setMode] = useState("words"); const [replayKey, setReplayKey] = useState(0); const [replayCount, setReplayCount] = useState(0); function chooseMode(nextMode: TidalTextRevealMode) { setMode(nextMode); setReplayKey((value) => value + 1); } function replay() { setReplayKey((value) => value + 1); setReplayCount((value) => value + 1); } return (

Choose a staging mode, then replay the entrance.

CURRENT MODE / {mode} {REVEAL_COPY[mode]}

A semantic heading with a visual entrance that can stop at its final readable state.

{MODES.map((option) => ( ))}

{MODE_COPY[mode].label} staging selected. Replay is local and finite. {replayCount > 0 ? ` Replay ${replayCount} requested.` : ""}

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