import type { ControlSize } from "@charcuterie/tokens"; import type { ReactNode } from "react"; import type { NavItem } from "./navItems.ts"; /** Where the row is drawn. Each paints differently; all are links. */ export type NavLinkPlacement = "bar" | "bottom" | "panel" | "rail" | "railIcons"; export type NavLinkProps = { isCurrent: boolean; item: NavItem; /** * Fires when the reader activates this link **in a way that keeps * them on the page** — a plain left click, Enter, Space. It is * what closes the panel behind them. * * A modified click (ctrl, meta, shift, alt) opens a new tab and * leaves this document exactly where it was, so it deliberately * does not fire: shutting the menu the reader is still working * through is the behaviour that makes people stop ctrl-clicking. */ onNavigate?: () => void; placement: NavLinkPlacement; size: ControlSize; /** Hands the bar row's box to the measuring hook. Bar only. */ trackElement?: (element: HTMLElement | null) => void; }; /** * One destination — and it is a real `` in every placement. * * That is the whole reason this exists rather than the `Menu` a * collapsed `Toolbar` opens: `MenuItem` is `{ label, onSelect }`, so * a nav folded into one becomes a row of `