"use client"; import "./components/ui/tidal.css"; import { useRef, useState } from "react"; import { TidalAlertDialog } from "./components/ui/alert-dialog"; import "./components/ui/alert-dialog.css"; const tidalExampleStyles = ".tidal-scope .alert-dialog-demo,\n.tidal-scope .alert-dialog-demo * {\n box-sizing: border-box;\n}\n\n.tidal-scope .alert-dialog-demo {\n display: grid;\n width: min(100%, 620px);\n min-width: 0;\n gap: 12px;\n margin-inline: auto;\n}\n\n.tidal-scope .alert-dialog-demo-card {\n display: flex;\n min-width: 0;\n align-items: center;\n justify-content: space-between;\n gap: 22px;\n padding: 20px;\n color: var(--t-ink);\n background: var(--t-surface);\n border: 1px solid var(--t-border);\n border-radius: 18px;\n box-shadow: 0 22px 48px -42px #0000008f;\n}\n\n.tidal-scope .alert-dialog-demo-card > div {\n display: grid;\n min-width: 0;\n gap: 4px;\n}\n\n.tidal-scope .alert-dialog-demo-card span {\n color: var(--t-muted);\n font-size: 11px;\n font-weight: 720;\n letter-spacing: 0.09em;\n line-height: 1.35;\n text-transform: uppercase;\n}\n\n.tidal-scope .alert-dialog-demo-card strong {\n font-size: 18px;\n font-weight: 650;\n letter-spacing: -0.025em;\n line-height: 1.25;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .alert-dialog-demo-card small {\n color: var(--t-muted);\n font-size: 12px;\n line-height: 1.4;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .alert-dialog-demo-card[data-removed=\"true\"] {\n border-style: dashed;\n}\n\n.tidal-scope .alert-dialog-demo-trigger {\n display: inline-flex;\n min-width: 0;\n min-height: 44px;\n flex: 0 0 auto;\n align-items: center;\n justify-content: center;\n padding: 10px 15px;\n color: var(--t-surface);\n background: var(--t-ink);\n border: 1px solid var(--t-ink);\n border-radius: 10px;\n font: inherit;\n font-size: 13px;\n font-weight: 680;\n line-height: 1.25;\n text-align: center;\n overflow-wrap: anywhere;\n cursor: pointer;\n transition:\n color 140ms var(--t-ease-out),\n background 140ms var(--t-ease-out),\n transform 140ms var(--t-ease-out);\n}\n\n.tidal-scope .alert-dialog-demo-trigger:hover {\n color: var(--t-ink);\n background: var(--t-surface);\n}\n\n.tidal-scope .alert-dialog-demo-trigger:active {\n transform: scale(0.975);\n}\n\n.tidal-scope .alert-dialog-demo-trigger:focus-visible {\n outline: 2px solid var(--t-accent);\n outline-offset: 3px;\n}\n\n.tidal-scope .alert-dialog-demo-status {\n margin: 0;\n color: var(--t-muted);\n font-size: 12px;\n line-height: 1.5;\n text-align: center;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .alert-dialog-demo-detail {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 12px;\n margin: 0;\n}\n\n.tidal-scope .alert-dialog-demo-detail > div {\n min-width: 0;\n}\n\n.tidal-scope .alert-dialog-demo-detail dt {\n font-size: 10px;\n font-weight: 720;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n}\n\n.tidal-scope .alert-dialog-demo-detail dd {\n margin: 3px 0 0;\n color: var(--t-ink);\n font-size: 12px;\n font-weight: 620;\n overflow-wrap: anywhere;\n}\n\n@container preview-stage (max-width: 440px) {\n .tidal-scope .alert-dialog-demo-card {\n display: grid;\n gap: 16px;\n padding: 16px;\n }\n\n .tidal-scope .alert-dialog-demo-trigger {\n width: 100%;\n font-size: 16px;\n }\n\n .tidal-scope .alert-dialog-demo-status {\n font-size: 14px;\n }\n}\n\n@media (max-width: 440px) {\n .tidal-scope .alert-dialog-demo-card {\n display: grid;\n gap: 16px;\n padding: 16px;\n }\n\n .tidal-scope .alert-dialog-demo-trigger {\n width: 100%;\n font-size: 16px;\n }\n\n .tidal-scope .alert-dialog-demo-status {\n font-size: 14px;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .tidal-scope .alert-dialog-demo-trigger {\n transition-duration: 0.01ms;\n }\n\n .tidal-scope .alert-dialog-demo-trigger:active {\n transform: none;\n }\n}"; export function AlertDialogDemo({ theme = "light", }: { theme?: "light" | "dark"; }) { const [open, setOpen] = useState(false); const [removed, setRemoved] = useState(false); const [status, setStatus] = useState("The sample report is available."); const triggerRef = useRef(null); return (
Weekly report {removed ? "Sample report removed" : "October 14 report"} {removed ? "Ready to restore" : "12 sections ยท Edited today"}
{ if (!removed) return; event.preventDefault(); setRemoved(false); setStatus("The sample report was restored locally."); }} > {removed ? "Restore sample report" : "Delete sample report"} } title="Delete this report?" description="This removes the report from the local preview. The action cannot be undone inside the open dialog." detail={
Report
October 14 report
Contents
12 sample sections
} cancelLabel="Keep report" confirmLabel="Delete report" tone="danger" escapeCancels outsidePointerCancels={false} onCancel={(_event, reason) => { setOpen(false); setStatus( reason === "escape-key" ? "Deletion cancelled with Escape." : reason === "outside-pointer" ? "Deletion cancelled from outside the dialog." : "The sample report was kept.", ); }} onConfirm={() => { setRemoved(true); setOpen(false); setStatus("The sample report was removed locally."); }} />

{status} Changes stay in this preview.

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