"use client"; import "./components/ui/tidal.css"; import { useId, useLayoutEffect, useRef, useState } from "react"; import { TidalAnnouncementBanner, type TidalAnnouncementAction } from "./components/ui/announcement-banner"; import "./components/ui/announcement-banner.css"; const tidalExampleStyles = ".tidal-scope .announcement-demo,\n.tidal-scope .announcement-demo * {\n box-sizing: border-box;\n}\n\n.tidal-scope .announcement-demo {\n container: announcement-demo / inline-size;\n display: grid;\n width: min(100%, 980px);\n min-width: 0;\n gap: 14px;\n margin-inline: auto;\n padding: clamp(10px, 3vw, 28px);\n color: var(--t-ink);\n}\n\n.tidal-scope .announcement-demo-header,\n.tidal-scope .announcement-demo-header > div,\n.tidal-scope .announcement-demo-restored,\n.tidal-scope .announcement-demo-restored > div,\n.tidal-scope .announcement-demo-details header,\n.tidal-scope .announcement-demo-footer {\n min-width: 0;\n}\n\n.tidal-scope .announcement-demo-header {\n display: flex;\n min-height: 52px;\n align-items: center;\n justify-content: space-between;\n gap: 14px;\n padding-bottom: 10px;\n border-bottom: 1px solid var(--t-border);\n}\n\n.tidal-scope .announcement-demo-header > div {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n\n.tidal-scope .announcement-demo-header > div > span {\n display: grid;\n width: 40px;\n height: 40px;\n flex: 0 0 auto;\n place-items: center;\n border-radius: 10px;\n background: var(--t-ink);\n color: var(--t-surface);\n font-size: 15px;\n font-weight: 780;\n}\n\n.tidal-scope .announcement-demo-header > div > div {\n display: grid;\n min-width: 0;\n gap: 2px;\n}\n\n.tidal-scope .announcement-demo :is(h2, p, strong, span) {\n min-width: 0;\n margin: 0;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .announcement-demo-header p,\n.tidal-scope .announcement-demo-header > span,\n.tidal-scope .announcement-demo-footer,\n.tidal-scope .announcement-demo-restored span,\n.tidal-scope .announcement-demo-details header span {\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.45;\n}\n\n.tidal-scope .announcement-demo-header h2 {\n font-size: 18px;\n font-weight: 640;\n letter-spacing: -0.035em;\n}\n\n.tidal-scope .announcement-demo-stage {\n display: grid;\n min-width: 0;\n gap: 10px;\n}\n\n.tidal-scope .announcement-demo-restored {\n display: flex;\n min-height: 82px;\n align-items: center;\n justify-content: space-between;\n gap: 14px;\n padding: 14px;\n border: 1px dashed var(--t-border-strong);\n border-radius: 18px;\n background: var(--t-subtle);\n}\n\n.tidal-scope .announcement-demo-restored > div {\n display: grid;\n gap: 4px;\n}\n\n.tidal-scope .announcement-demo-restored strong {\n font-size: 13px;\n}\n\n.tidal-scope .announcement-demo-restored button {\n min-width: 88px;\n min-height: 44px;\n padding: 8px 14px;\n border: 1px solid var(--t-ink);\n border-radius: 10px;\n background: var(--t-ink);\n color: var(--t-surface);\n font: inherit;\n font-size: 11px;\n font-weight: 700;\n cursor: pointer;\n transition: transform 140ms var(--t-ease-out);\n}\n\n.tidal-scope .announcement-demo-restored button:active {\n transform: scale(0.97);\n}\n\n.tidal-scope .announcement-demo-restored button:focus-visible {\n outline: 2px solid var(--t-accent);\n outline-offset: 3px;\n}\n\n.tidal-scope .announcement-demo-details {\n display: grid;\n min-width: 0;\n max-height: 0;\n gap: 12px;\n padding-inline: 16px;\n overflow: hidden;\n border: 1px solid transparent;\n border-radius: 16px;\n opacity: 0;\n background: var(--t-subtle);\n transform: translateY(-5px);\n transition:\n max-height 420ms var(--t-ease-out),\n padding 320ms var(--t-ease-out),\n border-color 240ms,\n opacity 240ms,\n transform 320ms var(--t-ease-out);\n}\n\n.tidal-scope .announcement-demo-details[data-open] {\n max-height: 260px;\n padding-block: 16px;\n border-color: var(--t-border);\n opacity: 1;\n transform: none;\n}\n\n.tidal-scope .announcement-demo-details header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n}\n\n.tidal-scope .announcement-demo-details header strong {\n font-size: 13px;\n}\n\n.tidal-scope .announcement-demo-details ol {\n display: grid;\n min-width: 0;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 8px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.tidal-scope .announcement-demo-details li {\n display: grid;\n min-width: 0;\n grid-template-columns: 30px minmax(0, 1fr);\n align-items: start;\n gap: 9px;\n padding: 10px;\n border: 1px solid var(--t-border);\n border-radius: 10px;\n background: var(--t-surface);\n}\n\n.tidal-scope .announcement-demo-details li span {\n display: grid;\n width: 30px;\n height: 30px;\n place-items: center;\n border-radius: 8px;\n background: var(--t-ink);\n color: var(--t-surface);\n font-size: 11px;\n font-weight: 740;\n}\n\n.tidal-scope .announcement-demo-details li p {\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.5;\n}\n\n.tidal-scope .announcement-demo-footer {\n display: flex;\n justify-content: space-between;\n gap: 12px;\n}\n\n@container announcement-demo (max-width: 520px) {\n .tidal-scope .announcement-demo-header > span {\n display: none;\n }\n\n .tidal-scope .announcement-demo-details ol {\n grid-template-columns: minmax(0, 1fr);\n }\n\n .tidal-scope .announcement-demo-restored,\n .tidal-scope .announcement-demo-footer {\n align-items: stretch;\n flex-direction: column;\n }\n\n .tidal-scope .announcement-demo-restored button {\n width: 100%;\n font-size: 16px;\n }\n}\n\n@media (pointer: coarse) {\n .tidal-scope .announcement-demo-restored button {\n font-size: 16px;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .tidal-scope .announcement-demo-restored button,\n .tidal-scope .announcement-demo-details {\n transition: none;\n }\n\n .tidal-scope .announcement-demo-restored button:active,\n .tidal-scope .announcement-demo-details {\n transform: none;\n }\n}"; export function AnnouncementBannerDemo() { const instanceId = useId().replace(/:/g, ""); const headingId = `${instanceId}-workspace-heading`; const detailsId = `${instanceId}-release-details`; const [visible, setVisible] = useState(true); const [detailsOpen, setDetailsOpen] = useState(false); const [status, setStatus] = useState("The release note is ready to review."); const [focusIntent, setFocusIntent] = useState<"dismiss" | "restore" | null>( null, ); const dismissRef = useRef(null); const restoreRef = useRef(null); useLayoutEffect(() => { if (focusIntent === "dismiss" && visible) dismissRef.current?.focus({ preventScroll: true }); if (focusIntent === "restore" && !visible) restoreRef.current?.focus({ preventScroll: true }); setFocusIntent(null); }, [focusIntent, visible]); const actions: readonly TidalAnnouncementAction[] = [ { id: "changes", kind: "button", label: detailsOpen ? "Hide changes" : "View changes", emphasis: "primary", buttonProps: { "aria-expanded": detailsOpen, "aria-controls": detailsId, onClick: () => { setDetailsOpen((current) => !current); setStatus( detailsOpen ? "Release details are hidden." : "Release details are visible below.", ); }, }, }, { id: "guide", kind: "link", href: `#${detailsId}`, label: "Open setup note", anchorProps: { onClick: () => { setDetailsOpen(true); setStatus("The local setup note is open."); }, }, }, ]; return (

Sample workspace

Release notes

October update
{visible ? ( { setVisible(false); setStatus("The release announcement was dismissed locally."); setFocusIntent("restore"); }} dismissButtonRef={dismissRef} /> ) : (
Announcement hidden The sample workspace remains unchanged.
)}
Local setup note Review queue
  1. 01

    Open a project and choose Review.

  2. 02

    Resolve or archive each sample note.

{status}

Sample data. Changes stay in this preview.
); } export default function AgentExample() { return (
); }