import "./components/ui/tidal.css"; import { useId, useMemo, useRef, useState } from "react"; import { Accessibility, LayoutGrid, RotateCcw, Settings2, UserRound } from "lucide-react"; import { TidalAccountMenuProfileCard, type TidalAccountMenuGroup } from "./components/ui/account-menu-profile-card"; import "./components/ui/account-menu-profile-card.css"; const tidalExampleStyles = ".tidal-scope .account-profile-demo,\n.tidal-scope .account-profile-demo * {\n box-sizing: border-box;\n}\n\n.tidal-scope .account-profile-demo {\n display: grid;\n width: 100%;\n max-width: 1160px;\n min-width: 0;\n grid-template-columns: minmax(0, 1fr);\n overflow: hidden;\n border: 1px solid var(--t-border);\n border-radius: 22px;\n background: var(--t-surface);\n color: var(--t-ink);\n box-shadow: 0 32px 70px -50px #0000008f;\n container: account-profile-demo / inline-size;\n}\n\n.tidal-scope .account-profile-demo-kicker {\n display: block;\n color: var(--t-muted);\n font-size: 11px;\n font-weight: 690;\n letter-spacing: 0.11em;\n line-height: 1.4;\n text-transform: uppercase;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .account-profile-demo-stage {\n display: flex;\n min-width: 0;\n flex-direction: column;\n padding: 25px;\n background:\n linear-gradient(var(--t-border) 1px, transparent 1px),\n linear-gradient(90deg, var(--t-border) 1px, transparent 1px),\n var(--t-subtle);\n background-size: 22px 22px;\n}\n\n.tidal-scope .account-profile-demo-topbar {\n display: flex;\n min-width: 0;\n align-items: center;\n justify-content: space-between;\n gap: 18px;\n padding: 13px 13px 13px 16px;\n border: 1px solid var(--t-border);\n border-radius: 18px;\n background: var(--t-surface);\n}\n\n.tidal-scope .account-profile-demo-topbar > div:first-child {\n min-width: 0;\n}\n\n.tidal-scope .account-profile-demo-topbar p {\n max-width: 42ch;\n margin: 4px 0 0;\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.5;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .account-profile-demo-sheet {\n width: min(100%, 600px);\n min-width: 0;\n margin: auto;\n padding: 22px;\n border: 1px solid var(--t-border);\n border-radius: 18px;\n background: var(--t-surface);\n box-shadow: 0 20px 50px -42px #0000008f;\n transition:\n padding 320ms var(--t-ease-out),\n transform 320ms var(--t-ease-out);\n}\n\n.tidal-scope\n .account-profile-demo[data-density=\"compact\"]\n .account-profile-demo-sheet {\n padding-block: 15px;\n transform: scale(0.985);\n}\n\n.tidal-scope .account-profile-demo-sheet-head {\n display: flex;\n min-width: 0;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n padding-bottom: 17px;\n border-bottom: 1px solid var(--t-border);\n}\n\n.tidal-scope .account-profile-demo-sheet-head > div {\n min-width: 0;\n}\n\n.tidal-scope .account-profile-demo-sheet-head h3 {\n margin: 6px 0 0;\n font-size: 20px;\n font-weight: 560;\n letter-spacing: -0.04em;\n line-height: 1.1;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .account-profile-demo-sheet-head button {\n display: inline-flex;\n min-width: 44px;\n min-height: 44px;\n flex: none;\n align-items: center;\n justify-content: center;\n gap: 8px;\n padding: 8px 12px;\n border: 1px solid var(--t-border);\n border-radius: 10px;\n background: var(--t-surface);\n color: var(--t-ink);\n font: inherit;\n font-size: 11px;\n font-weight: 650;\n cursor: pointer;\n transition:\n background 160ms,\n transform 140ms var(--t-ease-out);\n}\n\n.tidal-scope .account-profile-demo-sheet-head button:hover {\n background: var(--t-wash);\n}\n\n.tidal-scope .account-profile-demo-sheet-head button:active {\n transform: scale(0.98);\n}\n\n.tidal-scope .account-profile-demo-sheet-head button:focus-visible {\n outline: 2px solid var(--t-accent);\n outline-offset: 3px;\n}\n\n.tidal-scope .account-profile-demo-fields {\n display: grid;\n grid-template-columns: repeat(3, minmax(0, 1fr));\n min-width: 0;\n margin-top: 18px;\n border: 1px solid var(--t-border);\n border-radius: 10px;\n overflow: hidden;\n}\n\n.tidal-scope .account-profile-demo-fields > div {\n min-width: 0;\n padding: 13px;\n background: var(--t-subtle);\n transition: padding 320ms var(--t-ease-out);\n}\n\n.tidal-scope\n .account-profile-demo[data-density=\"compact\"]\n .account-profile-demo-fields\n > div {\n padding-block: 8px;\n}\n\n.tidal-scope .account-profile-demo-fields > div + div {\n border-inline-start: 1px solid var(--t-border);\n}\n\n.tidal-scope .account-profile-demo-fields span,\n.tidal-scope .account-profile-demo-fields strong {\n display: block;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .account-profile-demo-fields span {\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.4;\n}\n\n.tidal-scope .account-profile-demo-fields strong {\n margin-top: 5px;\n font-size: 11px;\n font-weight: 650;\n line-height: 1.4;\n}\n\n.tidal-scope .account-profile-demo-status {\n min-height: 34px;\n margin: 16px 0 0;\n padding-inline-start: 12px;\n border-inline-start: 2px solid var(--t-ink);\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.55;\n overflow-wrap: anywhere;\n}\n\n@container account-profile-demo (max-width: 700px) {\n .tidal-scope .account-profile-demo {\n grid-template-columns: 1fr;\n }\n\n .tidal-scope .account-profile-demo-stage {\n min-height: 480px;\n }\n}\n\n@container account-profile-demo (max-width: 420px) {\n \n .tidal-scope .account-profile-demo-stage {\n padding: 14px;\n }\n\n .tidal-scope .account-profile-demo-topbar {\n align-items: flex-start;\n padding: 10px;\n }\n\n .tidal-scope .account-profile-demo-topbar > div:first-child {\n flex: 1;\n }\n\n .tidal-scope .account-profile-demo-sheet {\n margin-top: 28px;\n padding: 15px;\n }\n\n .tidal-scope .account-profile-demo-sheet-head {\n align-items: flex-start;\n }\n\n .tidal-scope .account-profile-demo-sheet-head button {\n width: 44px;\n padding-inline: 0;\n font-size: 0;\n }\n\n .tidal-scope .account-profile-demo-sheet-head button svg {\n width: 16px;\n height: 16px;\n }\n\n .tidal-scope .account-profile-demo-fields {\n grid-template-columns: 1fr;\n }\n\n .tidal-scope .account-profile-demo-fields > div + div {\n border-inline-start: 0;\n border-top: 1px solid var(--t-border);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .tidal-scope .account-profile-demo-sheet,\n .tidal-scope .account-profile-demo-fields > div,\n .tidal-scope .account-profile-demo-sheet-head button {\n transition-duration: 0.01ms;\n }\n}"; export function AccountMenuProfileCardDemo() { const generatedId = useId().replace(/:/g, ""); const profileTargetId = `account-demo-${generatedId}-profile`; const preferencesTargetId = `account-demo-${generatedId}-preferences`; const accessibilityTargetId = `account-demo-${generatedId}-accessibility`; const [menuOpen, setMenuOpen] = useState(false); const [compact, setCompact] = useState(false); const [message, setMessage] = useState( "Open the account menu to preview its links and actions.", ); const triggerRef = useRef(null); const groups = useMemo( () => [ { id: "account", label: "Account", items: [ { kind: "link", id: "profile", label: "Profile details", description: "Review name and contact details", href: `#${profileTargetId}`, icon: , linkProps: { onClick: () => setMessage("Profile details target selected in this preview."), }, }, { kind: "link", id: "preferences", label: "Preferences", description: "Review workspace preferences", href: `#${preferencesTargetId}`, icon: , badge: "3 sections", linkProps: { onClick: () => setMessage("Preferences target selected in this preview."), }, }, ], }, { id: "display", label: "Display", items: [ { kind: "action", id: "density", label: compact ? "Use comfortable layout" : "Use compact layout", description: "Adjust the workspace density", icon: , badge: compact ? "Compact" : "Comfortable", closeOnSelect: false, onAction: () => { setCompact((current) => !current); setMessage( compact ? "Comfortable sample layout restored." : "Compact sample layout selected.", ); }, }, { kind: "link", id: "accessibility", label: "Accessibility settings", description: "Review display preferences", href: `#${accessibilityTargetId}`, icon: , linkProps: { onClick: () => setMessage("Accessibility target selected in this preview."), }, }, ], }, ], [accessibilityTargetId, compact, preferencesTargetId, profileTargetId], ); function resetPreview() { setCompact(false); setMenuOpen(false); setMessage("The local sample was reset. No account data changed."); triggerRef.current?.focus({ preventScroll: true }); } return (

Workspace

Sample profile. Changes stay in this preview.} />
PROFILE

Account overview

Display name Rowan Vale
Email rowan@example.test
Layout density {compact ? "Compact" : "Comfortable"}

{message}

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