import "./components/ui/tidal.css"; import { useState, useRef, useId } from "react"; import { Plus } from "lucide-react"; import { TidalDialog } from "./components/ui/dialog"; import "./components/ui/dialog.css"; import { TidalField } from "./components/ui/form-field"; import "./components/ui/form-field.css"; import { TidalButton } from "./components/ui/tidal-button"; const tidalExampleStyles = ".dialog-specimen{width:100%;max-width:330px;text-align:center;color:var(--t-ink)}.dialog-specimen>.demo-eyebrow{display:block;margin:20px 0 12px;font-size:11px}.dialog-specimen>h3{font-size:23px;letter-spacing:-.9px}.dialog-specimen>p{font-size:11px;color:var(--t-muted);margin:9px 0 22px}.dialog-specimen>.dialog-demo-status{font-size:11px;margin-top:19px;margin-bottom:0}.workspace-illustration{height:73px;width:88px;position:relative;margin:auto}.workspace-illustration>span{position:absolute;width:66px;height:48px;border:1px solid var(--t-border);border-radius:9px;background:var(--t-surface);box-shadow:0 7px 15px #1f1f1f08;top:22px;left:20px;transform:rotate(8deg)}.workspace-illustration>span:nth-child(2){top:11px;left:10px;transform:rotate(-5deg);background:var(--t-wash)}.workspace-illustration>span:nth-child(3){top:0;left:0;transform:rotate(-12deg);background:var(--t-surface)}.workspace-illustration>span:before{content:\"\";position:absolute;inset:12px 12px auto;height:4px;background:var(--t-border);border-radius:2px;box-shadow:0 9px var(--t-border)}\n\n.workspace-illustration>span{transition:transform 420ms var(--t-ease-out),box-shadow 420ms var(--t-ease-out)}\n.dialog-specimen:hover .workspace-illustration>span:first-child,.dialog-specimen:focus-within .workspace-illustration>span:first-child{transform:translate(4px,3px) rotate(14deg)}\n.dialog-specimen:hover .workspace-illustration>span:nth-child(3),.dialog-specimen:focus-within .workspace-illustration>span:nth-child(3){transform:translate(-4px,-3px) rotate(-16deg)}\n@media(prefers-reduced-motion:reduce){.dialog-specimen:hover .workspace-illustration>span:first-child,.dialog-specimen:focus-within .workspace-illustration>span:first-child{transform:rotate(8deg)}.dialog-specimen:hover .workspace-illustration>span:nth-child(3),.dialog-specimen:focus-within .workspace-illustration>span:nth-child(3){transform:rotate(-12deg)}}"; export function DialogDemo({ theme = "light" }: { theme?: "light" | "dark" }) { const [open, setOpen] = useState(false); const [name, setName] = useState(""); const [error, setError] = useState(""); const [created, setCreated] = useState(""); const field = useRef(null); const formId = useId(); return (
{ setOpen(value); if (!value) setError(""); }} title="Create workspace" description="Enter a name for this sample workspace." trigger={ } footer={ <> setOpen(false)}> Cancel Create workspace } >
{ e.preventDefault(); if (!name.trim()) { setError("Give your workspace a name."); field.current?.focus({ preventScroll: true }); return; } setCreated(name.trim()); setOpen(false); setError(""); setName(""); }} > { setName(e.target.value); setError(""); }} placeholder="e.g. Northstar Studio" error={error} />

{created ? created + " created. Sample workspace only." : "Create a sample workspace."}

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