"use client"; import "./components/ui/tidal.css"; import { useState } from "react"; import { TidalMentionInput, type TidalMentionSuggestion } from "./components/ui/mention-input"; import "./components/ui/mention-input.css"; const tidalExampleStyles = ".tidal-scope .mention-input-demo {\n container: mention-input-demo / inline-size;\n display: grid;\n gap: 20px;\n width: min(100%, 560px);\n min-width: 0;\n color: var(--t-ink);\n}\n\n.tidal-scope .mention-input-demo-actions {\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n}\n\n.tidal-scope .mention-input-demo-actions > button {\n min-width: 126px;\n min-height: 44px;\n padding: 10px 15px;\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 font-size: 13px;\n font-weight: 650;\n cursor: pointer;\n transition:\n border-color 140ms,\n background-color 140ms,\n color 140ms,\n transform 140ms var(--t-ease-out);\n}\n\n.tidal-scope .mention-input-demo-actions > button[type=\"submit\"] {\n border-color: var(--t-ink);\n background: var(--t-ink);\n color: var(--t-surface);\n}\n\n.tidal-scope .mention-input-demo-actions > button:hover {\n border-color: var(--t-ink);\n}\n\n.tidal-scope .mention-input-demo-actions > button[type=\"reset\"]:hover {\n background: var(--t-ink);\n color: var(--t-surface);\n}\n\n.tidal-scope .mention-input-demo-actions > button:active {\n transform: scale(0.98);\n}\n\n.tidal-scope .mention-input-demo-actions > button:focus-visible {\n outline: 2px solid var(--t-accent);\n outline-offset: 3px;\n}\n\n.tidal-scope .mention-input-demo-status {\n min-width: 0;\n margin: 0;\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.5;\n overflow-wrap: anywhere;\n}\n\n@container mention-input-demo (max-width: 320px) {\n .tidal-scope .mention-input-demo-actions {\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n }\n\n .tidal-scope .mention-input-demo-actions > button {\n width: 100%;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .tidal-scope .mention-input-demo-actions > button {\n transition: none;\n }\n\n .tidal-scope .mention-input-demo-actions > button:active {\n transform: none;\n }\n}"; const INITIAL_MESSAGE = "Review this with @"; const PEOPLE: readonly TidalMentionSuggestion[] = [ { id: "ava", label: "Ava Reed", value: "ava", description: "Design" }, { id: "noah", label: "Noah Kim", value: "noah", description: "Product" }, { id: "mila", label: "Mila Chen", value: "mila", description: "Research" }, { id: "sam", label: "Sam Ortiz", value: "sam", description: "Engineering" }, ]; export function MentionInputDemo() { const [message, setMessage] = useState(INITIAL_MESSAGE); const [error, setError] = useState(null); const [status, setStatus] = useState( "Type @ to choose a fictional teammate.", ); return (
{ event.preventDefault(); const submitted = new FormData(event.currentTarget).get("message"); setError(null); setStatus(`Prepared locally: ${String(submitted)}`); }} onReset={(event) => { if (event.defaultPrevented) return; setMessage(INITIAL_MESSAGE); setError(null); setStatus("Sample reset."); }} > { setMessage(nextValue); setError(null); setStatus("Type @ to choose a fictional teammate."); }} suggestions={PEOPLE} onMentionSelect={(person) => setStatus(`${person.label} added to the local note.`) } description="Suggestions are supplied by this local sample." error={error} placeholder="Write a note and type @" required onInvalid={(event) => { event.preventDefault(); setError("Write a review note."); setStatus("Check the note."); event.currentTarget.focus({ preventScroll: true }); }} />

{status}

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