"use client"; import "./components/ui/tidal.css"; import { useId, useRef, useState } from "react"; import { CalendarDays, MessageCircle, ShieldCheck, Sparkles } from "lucide-react"; import { TidalNotificationCenter, type TidalNotificationFilterOption, type TidalNotificationRecord } from "./components/ui/notification-center"; import "./components/ui/notification-center.css"; import "./components/ui/sheet-drawer.css"; const tidalExampleStyles = ".notification-center-demo,\n.notification-center-demo * {\n box-sizing: border-box;\n}\n\n.tidal-scope .notification-center-demo {\n display: grid;\n width: 100%;\n max-width: 420px;\n justify-items: center;\n min-width: 0;\n gap: 12px;\n}\n\n.notification-center-demo-detail {\n display: grid;\n min-width: 0;\n gap: 4px;\n padding: 14px 16px;\n border: 1px solid var(--t-border);\n border-radius: var(--t-radius-card);\n outline: 0;\n background: var(--t-subtle);\n color: var(--t-ink);\n}\n\n.notification-center-demo-detail:focus-visible {\n outline: 2px solid var(--t-accent);\n outline-offset: 3px;\n}\n\n.notification-center-demo-detail > span {\n color: var(--t-muted);\n font-size: 11px;\n font-weight: 720;\n letter-spacing: 0.05em;\n line-height: 1.3;\n text-transform: uppercase;\n}\n\n.notification-center-demo-detail > strong {\n font-size: 13px;\n line-height: 1.4;\n overflow-wrap: anywhere;\n}\n\n.notification-center-demo-detail > p,\n.notification-center-demo-note {\n margin: 0;\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.5;\n overflow-wrap: anywhere;\n}\n\n@media (forced-colors: active) {\n .notification-center-demo-detail {\n border-color: CanvasText;\n }\n}\n\n.notification-center-demo-detail {\n width: 100%;\n}\n.notification-center-demo-detail[hidden] {\n display: none;\n}\n.notification-center-demo-note {\n text-align: center;\n}"; const FILTERS: readonly TidalNotificationFilterOption[] = [ { id: "all", label: "All", mode: "all" }, { id: "unread", label: "Unread", mode: "unread" }, { id: "mentions", label: "Mentions", mode: "type", type: "mention" }, { id: "system", label: "System", mode: "type", type: "system" }, ]; const INITIAL_NOTIFICATIONS: readonly TidalNotificationRecord[] = [ { id: "review-mention", accessibleLabel: "Mina mentioned you in Launch review", title: "Mina mentioned you in Launch review", description: "The final checklist is ready for your notes.", type: "mention", typeLabel: "Mention", read: false, timeLabel: "8 minutes ago", dateTime: "2026-10-14T18:42:00-05:00", leading: , destination: { href: "#notification-center-detail", label: "Open review detail", }, }, { id: "workspace-brief", accessibleLabel: "Workspace brief is ready", title: "Workspace brief is ready", description: "The local sample brief now includes the revised milestones.", type: "project", typeLabel: "Project", read: false, timeLabel: "35 minutes ago", dateTime: "2026-10-14T18:15:00-05:00", leading: , destination: { href: "#notification-center-detail", label: "Review brief detail", }, }, { id: "calendar-window", accessibleLabel: "Review window moved to Thursday", title: "Review window moved to Thursday", description: "The supplied schedule now shows a 2:30 PM review window.", type: "schedule", typeLabel: "Schedule", read: true, timeLabel: "Yesterday", dateTime: "2026-10-13T15:10:00-05:00", leading: , destination: { href: "#notification-center-detail", label: "Open schedule detail", }, }, { id: "access-check", accessibleLabel: "Access review completed", title: "Access review completed", description: "The supplied workspace record reports no pending access changes.", type: "system", typeLabel: "System", read: false, timeLabel: "Monday", dateTime: "2026-10-12T11:20:00-05:00", leading: , destination: { href: "#notification-center-detail", label: "View access detail", }, }, ]; export function NotificationCenterDemo({ theme = "light", }: { theme?: "light" | "dark"; }) { const [notifications, setNotifications] = useState( [...INITIAL_NOTIFICATIONS], ); const [filter, setFilter] = useState("all"); const [open, setOpen] = useState(false); const [selectedId, setSelectedId] = useState(null); const detailId = `notification-center-detail-${useId().replace(/:/g, "")}`; const detailRef = useRef(null); const focusDetail = useRef(false); const selected = notifications.find( (notification) => notification.id === selectedId, ); return (
({ ...notification, destination: notification.destination ? { ...notification.destination, href: `#${detailId}`, linkProps: { onClick: (event: import("react").MouseEvent) => { if ( event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey ) return; event.preventDefault(); focusDetail.current = true; setSelectedId(notification.id); setOpen(false); }, }, } : undefined, }))} filters={FILTERS} filterValue={filter} onFilterChange={setFilter} onReadChange={(notification, read) => setNotifications((current) => current.map((candidate) => candidate.id === notification.id ? { ...candidate, read } : candidate, ), ) } onMarkAllRead={(ids) => { const selectedIds = new Set(ids); setNotifications((current) => current.map((notification) => selectedIds.has(notification.id) ? { ...notification, read: true } : notification, ), ); }} sheetProps={{ theme, onCloseAutoFocus: (event) => { if (!focusDetail.current) return; event.preventDefault(); focusDetail.current = false; detailRef.current?.focus({ preventScroll: true }); }, }} />

Local sample records. Changes are not stored or sent.

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