import "./components/ui/tidal.css"; import { useState, type MouseEvent } from "react"; import { Activity, ArrowUpRight, FilePlus2, Folder, LayoutGrid, Plus, Settings2, Waves } from "lucide-react"; import { TidalNavigationBar, TidalNavigationBarAction, TidalNavigationBarLink } from "./components/ui/navigation-bar"; import "./components/ui/navigation-bar.css"; const tidalExampleStyles = ".tidal-scope .navigation-bar-specimen {\n width: 100%;\n max-width: 1080px;\n min-width: 0;\n padding: 18px;\n border: 1px solid var(--t-border);\n border-radius: var(--t-radius-card);\n background: var(--t-subtle);\n color: var(--t-ink);\n box-shadow: 0 24px 48px -34px #00000045;\n}\n.tidal-scope .navigation-bar-demo-main {\n min-width: 0;\n padding: 34px 22px 22px;\n}\n.tidal-scope .navigation-bar-demo-heading {\n display: flex;\n align-items: flex-end;\n justify-content: space-between;\n gap: 18px;\n margin-bottom: 18px;\n}\n.tidal-scope .navigation-bar-demo-kicker {\n margin: 0 0 6px;\n color: var(--t-muted);\n font-size: 11px;\n letter-spacing: 1.2px;\n}\n.tidal-scope .navigation-bar-demo-heading h2 {\n margin: 0;\n font-size: clamp(24px, 4vw, 38px);\n font-weight: 500;\n letter-spacing: -1.6px;\n line-height: 1.05;\n}\n.tidal-scope .navigation-bar-demo-state {\n flex: none;\n min-height: 28px;\n padding: 6px 9px;\n border: 1px solid var(--t-border);\n border-radius: 6px;\n background: var(--t-surface);\n color: var(--t-muted);\n font-size: 11px;\n}\n.tidal-scope .navigation-bar-demo-notice {\n min-height: 22px;\n margin: 0 0 25px;\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.5;\n}\n.tidal-scope .navigation-bar-demo-metrics {\n display: grid;\n grid-template-columns: repeat(3, minmax(0, 1fr));\n gap: 14px;\n margin-bottom: 26px;\n}\n.tidal-scope .navigation-bar-demo-metrics > div {\n display: flex;\n flex-direction: column;\n gap: 4px;\n min-width: 0;\n padding-top: 13px;\n border-top: 1px solid var(--t-border);\n}\n.tidal-scope .navigation-bar-demo-metrics strong {\n font-size: 28px;\n font-weight: 400;\n letter-spacing: -1px;\n}\n.tidal-scope .navigation-bar-demo-metrics span,\n.tidal-scope .navigation-bar-demo-panel-title small,\n.tidal-scope .navigation-bar-demo-project small,\n.tidal-scope .navigation-bar-demo-activity small,\n.tidal-scope .navigation-bar-demo-setting span {\n color: var(--t-muted);\n font-size: 11px;\n}\n.tidal-scope .navigation-bar-demo-panel {\n min-width: 0;\n padding: 0 15px;\n border: 1px solid var(--t-border);\n border-radius: 12px;\n background: var(--t-surface);\n}\n.tidal-scope .navigation-bar-demo-panel-title {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n min-height: 50px;\n border-bottom: 1px solid var(--t-border);\n color: var(--t-ink);\n font-size: 11px;\n font-weight: 500;\n}\n.tidal-scope .navigation-bar-demo-project,\n.tidal-scope .navigation-bar-demo-row-link,\n.tidal-scope .navigation-bar-demo-activity,\n.tidal-scope .navigation-bar-demo-setting {\n display: flex;\n align-items: center;\n gap: 10px;\n min-width: 0;\n min-height: 64px;\n padding: 10px 0;\n border-bottom: 1px solid var(--t-border);\n}\n.tidal-scope .navigation-bar-demo-project:last-child,\n.tidal-scope .navigation-bar-demo-row-link:last-child,\n.tidal-scope .navigation-bar-demo-activity:last-child,\n.tidal-scope .navigation-bar-demo-setting:last-child {\n border-bottom: 0;\n}\n.tidal-scope .navigation-bar-demo-project-mark {\n display: grid;\n place-items: center;\n flex: none;\n width: 32px;\n height: 34px;\n border: 1px solid var(--t-border);\n border-radius: 8px;\n color: var(--t-muted);\n}\n.tidal-scope .navigation-bar-demo-project > span:nth-child(2),\n.tidal-scope .navigation-bar-demo-row-link > span,\n.tidal-scope .navigation-bar-demo-activity p {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-width: 0;\n gap: 3px;\n margin: 0;\n}\n.tidal-scope .navigation-bar-demo-project strong,\n.tidal-scope .navigation-bar-demo-row-link strong,\n.tidal-scope .navigation-bar-demo-activity p {\n overflow-wrap: anywhere;\n font-size: 11px;\n font-weight: 500;\n}\n.tidal-scope .navigation-bar-demo-project b {\n flex: none;\n color: var(--t-muted);\n font-size: 11px;\n font-weight: 500;\n font-variant-numeric: tabular-nums;\n}\n.tidal-scope .navigation-bar-demo-row-link {\n color: var(--t-ink);\n text-decoration: none;\n transition:\n background 160ms,\n color 160ms,\n transform 140ms var(--t-ease-out);\n}\n.tidal-scope .navigation-bar-demo-row-link:hover,\n.tidal-scope .navigation-bar-demo-row-link[aria-current=\"location\"] {\n background: var(--t-subtle);\n color: var(--t-ink);\n}\n.tidal-scope .navigation-bar-demo-row-link:active {\n transform: translateY(1px);\n}\n.tidal-scope .navigation-bar-demo-row-link:focus-visible {\n outline: 2px solid var(--t-accent);\n outline-offset: -3px;\n}\n.tidal-scope .navigation-bar-demo-row-link > svg {\n flex: none;\n}\n.tidal-scope .navigation-bar-demo-activity > span {\n flex: none;\n width: 24px;\n color: var(--t-muted);\n font-size: 11px;\n font-variant-numeric: tabular-nums;\n}\n.tidal-scope .navigation-bar-demo-setting {\n justify-content: space-between;\n flex-wrap: wrap;\n}\n.tidal-scope .navigation-bar-demo-setting strong {\n font-size: 11px;\n font-weight: 500;\n}\n.tidal-scope .navigation-bar-demo-project-detail {\n display: flex;\n align-items: flex-start;\n gap: 11px;\n min-width: 0;\n margin: 13px 0;\n padding: 13px;\n border: 1px solid var(--t-border);\n border-radius: 10px;\n background: var(--t-subtle);\n scroll-margin-block: 14px;\n}\n.tidal-scope .navigation-bar-demo-project-detail:focus {\n outline: 2px solid var(--t-accent);\n outline-offset: 2px;\n}\n.tidal-scope .navigation-bar-demo-project-detail > span:last-child {\n min-width: 0;\n}\n.tidal-scope .navigation-bar-demo-project-detail small,\n.tidal-scope .navigation-bar-demo-project-detail strong {\n display: block;\n overflow-wrap: anywhere;\n}\n.tidal-scope .navigation-bar-demo-project-detail small {\n margin-bottom: 5px;\n color: var(--t-muted);\n font-size: 11px;\n letter-spacing: 0.8px;\n}\n.tidal-scope .navigation-bar-demo-project-detail strong {\n font-size: 12px;\n font-weight: 600;\n}\n.tidal-scope .navigation-bar-demo-project-detail p {\n margin: 5px 0 0;\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.55;\n overflow-wrap: anywhere;\n}\n.tidal-scope .navigation-bar-demo-footnote {\n margin: 17px 0 0;\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.6;\n}\n@media (max-width: 560px) {\n .tidal-scope .navigation-bar-specimen {\n padding: 10px;\n }\n .tidal-scope .navigation-bar-demo-main {\n padding: 25px 8px 12px;\n }\n .tidal-scope .navigation-bar-demo-heading {\n align-items: flex-start;\n flex-direction: column;\n gap: 10px;\n }\n .tidal-scope .navigation-bar-demo-state {\n min-height: 26px;\n }\n .tidal-scope .navigation-bar-demo-metrics {\n gap: 8px;\n }\n .tidal-scope .navigation-bar-demo-metrics strong {\n font-size: 23px;\n }\n .tidal-scope .navigation-bar-demo-panel {\n padding-inline: 11px;\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .tidal-scope .navigation-bar-demo-row-link {\n transition-duration: 0.01ms;\n }\n .tidal-scope .navigation-bar-demo-row-link:active {\n transform: none;\n }\n}"; const pages = [ { id: "overview", label: "Overview", hash: "#local-board", icon: LayoutGrid }, { id: "projects", label: "Projects", hash: "#local-projects", icon: Folder }, { id: "activity", label: "Activity", hash: "#local-activity", icon: Activity, }, { id: "settings", label: "Settings", hash: "#local-settings", icon: Settings2, }, ]; const projectRows = [ { id: "website", name: "Website", detail: "Design review", value: "72%" }, { id: "mobile", name: "Mobile app", detail: "In development", value: "48%" }, { id: "brand", name: "Brand assets", detail: "Ready to share", value: "100%", }, ]; interface LocalBrief { id: string; name: string; detail: string; value: string; } function isPlainHashClick(event: MouseEvent) { return ( event.button === 0 && !event.metaKey && !event.ctrlKey && !event.altKey && !event.shiftKey ); } export function NavigationBarDemo() { const [page, setPage] = useState("overview"); const [open, setOpen] = useState(false); const [briefs, setBriefs] = useState([]); const [selectedProject, setSelectedProject] = useState(projectRows[0]); const [notice, setNotice] = useState("Choose a view or create a brief."); function selectPage(id: string) { setPage(id); setNotice( `Showing ${pages.find((item) => item.id === id)?.label ?? "local board"}.`, ); } const allProjects = [...briefs, ...projectRows]; function createBrief() { const number = briefs.length + 1; const brief = { id: `brief-${number}`, name: `Local brief ${String(number).padStart(2, "0")}`, detail: "Ready for local editing", value: "0%", }; setBriefs((current) => [brief, ...current]); setSelectedProject(brief); setPage("projects"); setNotice(`${brief.name} created in this preview.`); } const navigation = ( <> {pages.map(({ id, label, hash, icon: Icon }) => ( } active={page === id} onClick={(event) => { if (!event.defaultPrevented && isPlainHashClick(event)) { event.preventDefault(); selectPage(id); } }} aria-label={`Open ${label} view`} /> ))} ); const actions = ( } onClick={createBrief} /> ); return (
} brandHref="#local-board" brandProps={{ "aria-label": "Return to local board", onClick: (event: import("react").MouseEvent) => { if (!event.defaultPrevented && isPlainHashClick(event)) { event.preventDefault(); selectPage("overview"); } }, }} navigation={navigation} actions={actions} open={open} onOpenChange={setOpen} navigationLabel="Local board navigation" />

LOCAL BOARD

{page === "settings" ? "Settings" : pages.find((item) => item.id === page)?.label}

{briefs.length ? `${briefs.length} local ${briefs.length === 1 ? "brief" : "briefs"}` : "Local sample"}

{notice}

{page === "overview" ? (
{allProjects.length} Local projects
1 Ready for review
12 Open tasks
Next on the board Local sample
{allProjects.slice(0, 3).map((project) => (
{project.name} {project.detail} {project.value}
))}
) : page === "projects" ? (
Project destinations {allProjects.length} local records
{allProjects.map((project) => ( { if (!event.defaultPrevented && isPlainHashClick(event)) { event.preventDefault(); setSelectedProject(project); setNotice(`Selected ${project.name} in this preview.`); } }} > {project.name} {project.detail} ))}
SELECTED LOCAL RECORD {selectedProject.name}

{selectedProject.detail}. Progress shown:{" "} {selectedProject.value}.

) : page === "activity" ? (
Recent activity Preparation only
{[ "Brand assets marked ready", "Website moved to design review", "Mobile app brief updated", ].map((item, index) => (
0{index + 1}

{item} Local board event

))}
) : (
Local board settings Consumer-owned state
Navigation mode In-flow disclosure
Motion policy Reduced motion ready
)}

Switch views or create a brief.

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