{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "navbar",
  "title": "Navbar",
  "description": "The bar across the top of an app: your brand, the main links and a few controls, with the current page marked `aria-current=\"page\"`, and the link of the section it is in `aria-current=\"true\"`, both underlined in the primary colour as in `FamilyBar`, distinct from hover and press highlights.",
  "registryDependencies": [
    "@ouro/button",
    "@ouro/lib-class-name-check",
    "@ouro/lib-cn",
    "@ouro/lib-current-path",
    "@ouro/lib-env",
    "@ouro/lib-router-link",
    "@ouro/lib-use-dev-messages",
    "@ouro/lib-use-media-query",
    "@ouro/navigation-menu",
    "@ouro/sheet"
  ],
  "files": [
    {
      "path": "registry/ouro/components/ouro/navbar/navbar.tsx",
      "content": "\"use client\";\n\nimport { startTransition, useEffect, useId, useLayoutEffect, useRef, useState, type JSX, type ReactNode, type Ref } from \"react\";\nimport { useAppearanceClassNameCheck } from \"@/registry/ouro/lib/ouro/class-name-check\";\nimport { cn } from \"@/registry/ouro/lib/ouro/cn\";\nimport { currentHref, samePath } from \"@/registry/ouro/lib/ouro/current-path\";\nimport { RouterLink } from \"@/registry/ouro/lib/ouro/router-link\";\nimport { useDevWarnings } from \"@/registry/ouro/lib/ouro/use-dev-messages\";\nimport { useMediaQuery } from \"@/registry/ouro/lib/ouro/use-media-query\";\nimport { Button } from \"@/registry/ouro/components/ouro/button/button\";\nimport { NavigationMenuView } from \"@/registry/ouro/components/ouro/navigation-menu/navigation-menu\";\nimport { SheetFrame } from \"@/registry/ouro/components/ouro/sheet/sheet\";\n\n/** One link in a Navbar: in the bar, or in a group's panel. */\nexport interface NavbarLink {\n  /** The link's text: \"Recipes\". */\n  label: string;\n  /** Where it goes. Internal paths go through `OuroProvider`'s `linkComponent` (your router's link). */\n  href: string;\n  /**\n   * In a group: a line under the label in the bar's panel, \"Everything you have saved.\"\n   *\n   * @claim \"In a group: a line under\" registry/ouro/components/ouro/navbar/navbar.test.tsx verify:testExists(registry/ouro/components/ouro/navbar/navbar.test.tsx::Navbar at tablet widths and with groups > opens a group of links as a panel in the bar)\n   */\n  description?: string | undefined;\n  /**\n   * Marks this link as the current page (`aria-current=\"page\"`), when the Navbar's\n   * `currentPath` cannot tell: a link whose page lives at another path.\n   */\n  current?: boolean | undefined;\n  /** Not with `href`. An item is a link (`href`) or a group of links (`links`). */\n  links?: never;\n}\n\n/** A group of links in a Navbar: a button that opens a panel in the bar, and a labelled group in the sheet. */\nexport interface NavbarGroup {\n  /** The group's name, the button's text: \"Recipes\". */\n  label: string;\n  /**\n   * The group's links, each with an optional `description`.\n   *\n   * @claim \"The group's links, each with an\" registry/ouro/components/ouro/navbar/navbar.test.tsx verify:testExists(registry/ouro/components/ouro/navbar/navbar.test.tsx::Navbar at tablet widths and with groups > closes the sheet when the links come to fit)\n   */\n  links: readonly NavbarLink[];\n  /** Not with `links`. To link the section's own page, make it the group's first link. */\n  href?: never;\n}\n\n/** One item of a Navbar: a link (`href`), or a group of links (`links`). */\nexport type NavbarItem = NavbarLink | NavbarGroup;\n\n/** Props for {@link Navbar}. */\nexport interface NavbarProps {\n  /** Names the navigation for screen readers (\"Main\"). It is not shown. */\n  label: string;\n  /**\n   * The links, in order, and groups of links (`{ label, links }`), which open a panel in the\n   * bar. When they do not fit, as on a phone, they move into a sheet.\n   */\n  items: readonly NavbarItem[];\n  /**\n   * The path of the page being shown, from your router (`useLocation().pathname`, or\n   * `usePathname()` in Next.js). The link to that path gets `aria-current=\"page\"` and the\n   * current look. On a deeper page, the longest link above it, the section\n   * (`/recipes` for `/recipes/12`), gets the same look and `aria-current=\"true\"`, so a\n   * screen reader hears one current page.\n   */\n  currentPath?: string | undefined;\n  /** Your logo or product name, at the start of the bar. Link it to the home page. */\n  brand?: ReactNode;\n  /**\n   * Controls at the end of the bar, at every width: a search button, an account `Menu`.\n   *\n   * @claim \"Controls at the end of the\" registry/ouro/components/ouro/navbar/navbar.test.tsx verify:testExists(registry/ouro/components/ouro/navbar/navbar.test.tsx::Navbar > shows the brand at the start and the actions at the end)\n   */\n  actions?: ReactNode;\n  /**\n   * The name of the button that opens the links below `collapseBelow` (640px by default), and the title of the sheet\n   * it opens. @default \"Menu\"\n   * @claim \"The name of the button that\" registry/ouro/components/ouro/navbar/navbar.test.tsx verify:testExists(registry/ouro/components/ouro/navbar/navbar.test.tsx::Navbar > collapses the links into a sheet behind a menu button below 640px)\n   * @claim \"The name of the button that\" registry/ouro/components/ouro/navbar/navbar.test.tsx verify:testExists(registry/ouro/components/ouro/navbar/navbar.test.tsx::Navbar > hides the menu button from 640px up)\n   */\n  menuLabel?: string | undefined;\n  /**\n   * What the sheet behind the menu button holds in place of the `items` links, when a phone\n   * needs more than the bar, such as a section's own pages under its name, or a filter over a\n   * long list. It replaces them, so list the links they held too. It sits in the sheet's `nav`;\n   * mark the current page yourself (`aria-current=\"page\"`). Choosing a link in it closes the\n   * sheet. Once the page has been idle it mounts, hidden, ahead of the first press (a press\n   * before then mounts it as it opens), and it mounts afresh the same way after each close, so\n   * each open starts with the state it first had.\n   *\n   * @claim \"Choosing a link in it closes the sheet.\" registry/ouro/components/ouro/navbar/navbar.test.tsx verify:testExists(registry/ouro/components/ouro/navbar/navbar.test.tsx::Navbar > shows the menu prop in the sheet in place of the links, and closes it when a link there is chosen)\n   * @claim \"Once the page has been idle\" registry/ouro/components/ouro/navbar/navbar.test.tsx verify:testExists(registry/ouro/components/ouro/navbar/navbar.test.tsx::Navbar > builds the sheet while the page is idle once the menu button shows, and keeps it, hidden, between opens)\n   * @claim \"so each open starts with the\" registry/ouro/components/ouro/navbar/navbar.test.tsx verify:testExists(registry/ouro/components/ouro/navbar/navbar.test.tsx::Navbar > opens afresh after each close: the menu prop's state and the sheet's scroll as the first open had them)\n   */\n  menu?: ReactNode;\n  /** The label of that sheet's close button. @default \"Close\" */\n  closeLabel?: string | undefined;\n  /**\n   * The Tailwind breakpoint below which the links collapse behind the menu button: `sm`, `md`, `lg` or `xl`. The server HTML\n   * and the first paint use it too, so the bar matches on hydration at every width. Use `lg` when the links need more room\n   * than a tablet's bar has. @default \"sm\"\n   * @claim \"The Tailwind breakpoint below which the links collapse\" test/navbar-first-paint.test.tsx verify:testExists(test/navbar-first-paint.test.tsx::Navbar's collapse breakpoint > with collapseBelow lg, the menu shows below lg and the links from lg up)\n   * @claim \"The server HTML and the first paint use it too\" test/navbar-first-paint.test.tsx verify:testExists(test/navbar-first-paint.test.tsx::Navbar's collapse breakpoint > with collapseBelow lg, is the same bar at 390, 768, 1024 and 1440, server HTML and hydrated, with nothing swapped)\n   */\n  collapseBelow?: \"sm\" | \"md\" | \"lg\" | \"xl\" | (string & { \"one of sm, md, lg, xl\": never }) | undefined;\n  /** Layout only: margins, position (`sticky top-0`). Appearance classes warn in development. */\n  className?: string | undefined;\n  ref?: Ref<HTMLElement> | undefined;\n\n  /** Not a prop. Ouro UI uses `items`: `<Navbar label=\"Main\" items={[{ label: \"Recipes\", href: \"/recipes\" }]} />`. */\n  links?: { 'Use <Navbar label=\"Main\" items={[{ label: \"Recipes\", href: \"/recipes\" }]} />': never };\n  /** Not a prop. Ouro UI uses `brand`: `<Navbar brand={<Logo />}>`. */\n  logo?: { \"Use <Navbar brand={<Logo />}>\": never };\n  /** Not a prop. Ouro UI uses `currentPath`: `<Navbar currentPath={pathname}>`. */\n  pathname?: { \"Use <Navbar currentPath={pathname}>\": never };\n  /** Not rendered. The bar is `items`, `brand` and `actions`. */\n  children?: { \"Use items={[{ label, href }]}, brand={...} and actions={...}\": never };\n}\n\n// Class strings are literal so the app's Tailwind finds them when it compiles. Each breakpoint is one of Tailwind's, the\n// media query the script reads, and the classes that show or hide the two forms and wrap the bar below it.\nconst breakpoints = {\n  sm: { query: \"(min-width: 40rem)\", show: \"sm:hidden\", hide: \"max-sm:hidden\", wrap: \"max-sm:flex-wrap max-sm:py-1\" },\n  md: { query: \"(min-width: 48rem)\", show: \"md:hidden\", hide: \"max-md:hidden\", wrap: \"max-md:flex-wrap max-md:py-1\" },\n  lg: { query: \"(min-width: 64rem)\", show: \"lg:hidden\", hide: \"max-lg:hidden\", wrap: \"max-lg:flex-wrap max-lg:py-1\" },\n  xl: { query: \"(min-width: 80rem)\", show: \"xl:hidden\", hide: \"max-xl:hidden\", wrap: \"max-xl:flex-wrap max-xl:py-1\" },\n} as const;\n\n// Below the collapse breakpoint the links are always behind the menu button, so a wrap there changes no measure of theirs;\n// from it up the links' room decides whether the menu button shows, and a wrap would change that room.\nconst bar =\n  \"box-border flex min-h-14 items-center gap-2 border-0 border-b border-solid border-border bg-background text-foreground \" +\n  \"ps-[max(1rem,env(safe-area-inset-left,0px))] pe-[max(1rem,env(safe-area-inset-right,0px))]\";\n\n// A link: 44px with 16px text on a coarse pointer at every width, 36px with 14px text with a\n// fine one. The current page, or the section it is in, is underlined in the primary colour as in the bar's row and in\n// FamilyBar, not given a hover highlight; forced colours keep the underline.\nconst link_ =\n  \"relative m-0 box-border items-center rounded-ouro-md px-3 font-medium text-muted-foreground no-underline select-none touch-manipulation \" +\n  \"text-base pointer-fine:text-sm leading-5 [-webkit-tap-highlight-color:transparent] \" +\n  \"pointer-fine:hover:bg-accent pointer-fine:hover:text-accent-foreground aria-[current=page]:font-semibold aria-[current=page]:text-foreground aria-[current=true]:font-semibold aria-[current=true]:text-foreground \" +\n  \"aria-[current=page]:underline aria-[current=true]:underline decoration-primary decoration-2 underline-offset-5 [text-decoration-skip-ink:none] \" +\n  \"outline-ring -outline-offset-2 focus-visible:outline-2 focus-visible:outline-solid\";\n// In the sheet a link is a full-width row, which highlights while pressed instead of scaling.\nconst sheetLink = \"flex min-h-11 pointer-fine:min-h-9 py-2 transition-colors duration-(--ouro-duration-fast) ease-[ease] active:bg-accent active:text-accent-foreground\";\n\nconst list_ = \"m-0 flex list-none p-0\";\nconst example = '<Navbar label=\"Main\" items={[{ label: \"Recipes\", href: \"/recipes\" }]}';\n\n/**\n * The bar across the top of an app: your brand, the main links and a few controls, with\n * the current page marked `aria-current=\"page\"`, and the link of the section it is in `aria-current=\"true\"`, both underlined in the primary colour as in `FamilyBar`, distinct from hover and press highlights. A group of links (`{ label, links }`)\n * opens a panel, as in `NavigationMenu`. Whenever the links do not fit, below the `collapseBelow` breakpoint and\n * wherever they overflow the bar, they collapse behind a menu button into a `Sheet` that slides in from\n * the side, with each group under its name; the brand and `actions` stay in the bar. When, below the collapse breakpoint,\n * even the brand and `actions` do not fit side by side (large text on a phone), the actions\n * move to a second row rather than off the screen. Links render through `OuroProvider`'s `linkComponent`,\n * so your router navigates.\n *\n * The phone menu opens once JavaScript has loaded (after hydration). Both the links and the menu button are in the\n * server HTML, and CSS shows one of them at the `collapseBelow` breakpoint, so the bar does not change when the page hydrates; only links\n * that do not fit the bar, on a tablet, collapse once the page has measured them. A tap on the menu button before then\n * does nothing unless your app keeps it: this site's head script keeps a tap on any control React has not yet hydrated, shows\n * the control pressed, and presses it again once it has (`site/src/early-input.ts` in the\n * repository). Once the menu button shows, the sheet is built while the page is idle and kept,\n * hidden, between opens, so a press only shows it.\n *\n * Use `Sidebar` instead for more than a handful of destinations, or sections of them. Use\n * `NavigationMenu` alone for a row of panels inside a page, and `Tabs` for views of one\n * page. `StackedLayout` puts a Navbar above the page.\n *\n * @group Navigation\n * @see https://ui.ouroboros.bot/docs/navbar\n *\n * @example\n * <Navbar\n *   label=\"Main\"\n *   brand={<Link href=\"/\">Spoonjoy</Link>}\n *   items={[\n *     { label: \"Recipes\", href: \"/recipes\" },\n *     { label: \"Cookbooks\", href: \"/cookbooks\" },\n *   ]}\n *   currentPath={pathname}\n *   actions={<Button href=\"/recipes/new\">New recipe</Button>}\n * />\n * @claim \"Whenever the links do not fit\" registry/ouro/components/ouro/navbar/navbar.test.tsx verify:testExists(registry/ouro/components/ouro/navbar/navbar.test.tsx::Navbar at tablet widths and with groups > collapses into the menu button whenever its links do not fit, from 640px up too)\n * @claim \"Whenever the links do not fit\" registry/ouro/components/ouro/navbar/navbar.test.tsx verify:testExists(registry/ouro/components/ouro/navbar/navbar.test.tsx::Navbar > collapses the links into a sheet behind a menu button below 640px)\n * @claim \"Whenever the links do not fit\" registry/ouro/components/ouro/navbar/navbar.test.tsx verify:testExists(registry/ouro/components/ouro/navbar/navbar.test.tsx::Navbar at tablet widths and with groups > puts a group's button and the bar's links in the server HTML)\n * @claim \"The phone menu opens once JavaScript\" registry/ouro/components/ouro/navbar/navbar.test.tsx verify:testExists(registry/ouro/components/ouro/navbar/navbar.test.tsx::Navbar > collapses the links into a sheet behind a menu button below 640px)\n * @claim \"The phone menu opens once JavaScript\" registry/ouro/components/ouro/navbar/navbar.test.tsx verify:testExists(registry/ouro/components/ouro/navbar/navbar.test.tsx::Navbar at tablet widths and with groups > puts a group's button and the bar's links in the server HTML)\n * @claim \"this site's head script keeps a tap\" site/e2e/early-input.spec.ts verify:fileLine(site/e2e/early-input.spec.ts, /a tap on the menu button before the page's script has run opens the menu/) verify:fileLine(site/src/early-input.ts, /export function keepEarlyInput/)\n * @claim \"the sheet is built while the page is\" registry/ouro/components/ouro/navbar/navbar.test.tsx verify:testExists(registry/ouro/components/ouro/navbar/navbar.test.tsx::Navbar > builds the sheet while the page is idle once the menu button shows, and keeps it, hidden, between opens)\n * @claim \"When, below the collapse breakpoint, even the brand and `actions` do not fit side by side\" registry/ouro/components/ouro/navbar/navbar.test.tsx verify:testExists(registry/ouro/components/ouro/navbar/navbar.test.tsx::Navbar > moves its actions to a second row when they and the brand do not fit beside each other, as with large text)\n * @claim \"Both the links and the menu button are in the server HTML\" test/navbar-first-paint.test.tsx verify:testExists(test/navbar-first-paint.test.tsx::Navbar's first paint > is the same bar on a phone, server HTML and hydrated, with nothing swapped)\n */\nexport function Navbar(props: NavbarProps): JSX.Element {\n  const {\n    label,\n    items,\n    currentPath,\n    brand,\n    actions,\n    menuLabel = \"Menu\",\n    menu,\n    closeLabel = \"Close\",\n    collapseBelow = \"sm\",\n    className,\n    ref,\n    // Guard props (hint types), dropped here so they never reach the DOM.\n    links,\n    logo,\n    pathname,\n    children,\n  } = props;\n  useAppearanceClassNameCheck(\n    \"Navbar\",\n    className,\n    process.env.NODE_ENV !== \"production\"\n      ? (token: string) => `remove \"${token}\"; Navbar sets its own look`\n      : /* istanbul ignore next @preserve -- production only */ \"\",\n  );\n  useDevWarnings(\n    \"Navbar\",\n    process.env.NODE_ENV !== \"production\"\n      ? () => [\n          !label && [\"label is required; it names the navigation for screen readers\", '<Navbar label=\"Main\">'],\n          links !== undefined && [\"links is not a prop\", `${example} />`],\n          logo !== undefined && [\"logo is not a prop\", \"<Navbar brand={<Logo />}>\"],\n          pathname !== undefined && [\"pathname is not a prop\", \"<Navbar currentPath={pathname}>\"],\n          children !== undefined && [\"children are not rendered\", `${example} brand={…} actions={…} />`],\n          !Object.hasOwn(breakpoints, collapseBelow) && [\"collapseBelow is not a breakpoint; it takes sm, md, lg or xl\", '<Navbar collapseBelow=\"lg\">'],\n        ]\n      : /* istanbul ignore next @preserve -- production only */ undefined,\n  );\n\n  // The unknown value, which the development check names, renders as sm.\n  const breakpoint = Object.hasOwn(breakpoints, collapseBelow) ? breakpoints[collapseBelow as keyof typeof breakpoints] : breakpoints.sm;\n  // Both forms are in the server HTML, and CSS shows one: the links from the collapse breakpoint up, the menu button below it.\n  // This query is that same breakpoint, in rem as the Tailwind classes are, so the sheet's script and the CSS agree at any root font size.\n  // The links also collapse wherever they do not fit the bar, which only the measure below can tell.\n  // Stryker disable next-line BooleanLiteral: the server default feeds only the hydration render, which draws the same bar either way; the sheet's build waits for an effect that reads the live value.\n  const wide = useMediaQuery(breakpoint.query, true);\n  const [overflow, setOverflow] = useState(false);\n  const collapsed = !wide || overflow;\n  const [open, setOpen] = useState(false);\n  // Focus goes back to the menu button when the sheet closes, in every browser.\n  const menuButton = useRef<HTMLButtonElement>(null);\n  const slot = useRef<HTMLDivElement>(null);\n  const list = useRef<HTMLUListElement>(null);\n  if (!collapsed && open) setOpen(false);\n  // Once the menu button shows, the sheet is built while the page is idle, so a press only shows it: building it then\n  // (a long menu is hundreds of elements) would hold up the press's first frame. Kept from then on, hidden while closed,\n  // and built afresh once each close has finished, so every open starts as the first did: the `menu` prop's own state\n  // (a filter's text, a list unfolded) and the sheet's scroll left behind.\n  const [built, setBuilt] = useState(false);\n  // The sheet's content goes in on a later turn than its frame: a transition renders in slices, but commits in one, and\n  // the docs' menu and the sheet's frame together held a frame of 110 ms on CI's WebKit (ourostack/ouro-ui#670).\n  const [filled, setFilled] = useState(false);\n  const [round, setRound] = useState(0);\n  useEffect(() => {\n    if (!collapsed || filled) return;\n    // As a transition, which React renders in slices that leave the frames between them free: built in one go, a long\n    // menu held a frame past 100 ms on a slow screen. A press in the middle opens the sheet as it is.\n    const build = () => startTransition(() => (built ? setFilled(true) : setBuilt(true)));\n    // Where the browser has no idle callback (Safari), after the page's other start-up work, and the content a beat later.\n    if (typeof requestIdleCallback !== \"function\") {\n      const timer = setTimeout(build, built ? 100 : 500);\n      return () => clearTimeout(timer);\n    }\n    // Stryker disable next-line ObjectLiteral: the timeout only bounds a page that is never idle, which no test page is.\n    const idle = requestIdleCallback(build, { timeout: 2000 });\n    return () => cancelIdleCallback(idle);\n    // `round` too: a close sets `filled` back, which changes nothing when the last content's transition had not committed\n    // yet (a loaded runner), and the fresh sheet must still ask for its content's turn.\n  }, [collapsed, built, filled, round]);\n\n  // Before paint, so a client mount never shows a row that does not fit.\n  useLayoutEffect(() => {\n    const measure = () => {\n      // The room the links would have: the slot, and the menu button's place when it shows.\n      const button = menuButton.current!.offsetWidth;\n      setOverflow(list.current!.scrollWidth > slot.current!.clientWidth + (button > 0 ? button + 8 : 0));\n    };\n    measure();\n    const observer = new ResizeObserver(measure);\n    observer.observe(slot.current!);\n    observer.observe(list.current!);\n    return () => observer.disconnect();\n  }, []);\n\n  // An item's own `current` wins; otherwise the path decides, across the links and the groups.\n  const all = items.flatMap((item): ReadonlyArray<{ href: string; current?: boolean | undefined }> => (item.links !== undefined ? item.links : [item]));\n  const marked = all.some((link) => link.current)\n    ? undefined\n    : currentHref(\n        all.map((link) => link.href),\n        currentPath,\n      );\n  const id = useId();\n  const sheetLinkFor = (link: { label: string; href: string; current?: boolean | undefined }, key: number) => (\n    <li key={key}>\n      <RouterLink\n        href={link.href}\n        aria-current={link.current || (link.href === marked && samePath(link.href, currentPath)) ? \"page\" : link.href === marked ? \"true\" : undefined}\n        data-ouro-control=\"navbar\"\n        data-ouro-part=\"sheet-link\"\n        className={cn(link_, sheetLink)}\n      >\n        {link.label}\n      </RouterLink>\n    </li>\n  );\n\n  return (\n    <header ref={ref} data-ouro=\"navbar\" className={cn(bar, breakpoint.wrap, className)}>\n      <Button\n        ref={menuButton}\n        data-ouro-navbar-menu=\"\"\n        data-ouro-control=\"navbar\"\n        data-ouro-part=\"menu\"\n        variant=\"plain\"\n        tone=\"secondary\"\n        aria-label={menuLabel}\n        // In the server HTML at every width, so the bar never changes on hydration: where the button is hidden it is out of\n        // the tree, and where it shows it opens the sheet.\n        aria-haspopup=\"dialog\"\n        aria-expanded={open}\n        onClick={() => setOpen(true)}\n        className={cn(\"-ms-2 w-11 px-0\", !overflow && breakpoint.show)}\n      >\n        <svg aria-hidden=\"true\" viewBox=\"0 0 20 20\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" className=\"size-5\">\n          <path d=\"M3 5.5h14M3 10h14M3 14.5h14\" />\n        </svg>\n      </Button>\n      {brand !== undefined && <div className=\"flex min-w-0 shrink-0 items-center\">{brand}</div>}\n      {/* The links' slot takes the room between the brand and the actions; hidden but measured when they do not fit. */}\n      <div ref={slot} data-ouro-navbar-links=\"\" className={cn(\"min-w-0 flex-1 overflow-hidden\", breakpoint.hide, overflow && \"invisible\")}>\n        <NavigationMenuView label={label} items={items} currentPath={currentPath} oneLine listRef={list} />\n      </div>\n      {actions !== undefined && <div className=\"ms-auto flex shrink-0 items-center gap-2\">{actions}</div>}\n      <SheetFrame\n        key={round}\n        onOpenChangeComplete={(shown) => {\n          if (shown) return;\n          // Stryker disable next-line ArithmeticOperator: any key the sheet has not had builds it afresh, a count down as well as up.\n          setRound((count) => count + 1);\n          // The fresh sheet, too, takes its frame now and its content on a later turn (ourostack/ouro-ui#670).\n          setFilled(false);\n        }}\n        keepMounted={built}\n        title={menuLabel}\n        closeLabel={closeLabel}\n        side=\"left\"\n        open={open}\n        onOpenChange={setOpen}\n        finalFocus={menuButton}\n      >\n        <nav\n          aria-label={label}\n          // A link chosen in the sheet closes it: the items' links, and any in the menu prop. Not one opened elsewhere (a new\n          // tab or window, with a modifier key held): the page stays, and so does the sheet. A router's link that handles the\n          // click itself still closes it.\n          onClick={(event) => {\n            if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n            if ((event.target as Element).closest(\"a[href]\")) setOpen(false);\n          }}\n        >\n          {!open && !filled ? null : menu ?? (\n            <ul className={cn(list_, \"flex-col gap-1\")}>\n              {items.map((item, index) =>\n                item.links !== undefined ? (\n                  <li key={index} className=\"grid gap-1 pt-3 first:pt-0\">\n                    <p id={`${id}${index}`} className=\"m-0 px-3 py-1 text-xs leading-4 font-medium text-muted-foreground\">\n                      {item.label}\n                    </p>\n                    <ul aria-labelledby={`${id}${index}`} className={cn(list_, \"flex-col gap-1\")}>\n                      {item.links.map(sheetLinkFor)}\n                    </ul>\n                  </li>\n                ) : (\n                  sheetLinkFor(item, index)\n                ),\n              )}\n            </ul>\n          )}\n        </nav>\n      </SheetFrame>\n    </header>\n  );\n}\n",
      "type": "registry:ui",
      "target": "@components/ouro/navbar/navbar.tsx"
    }
  ],
  "docs": "The bar across the top of an app: your brand, the main links and a few controls, with the current page marked `aria-current=\"page\"`, and the link of the section it is in `aria-current=\"true\"`, both underlined in the primary colour as in `FamilyBar`, distinct from hover and press highlights. Import: import { Navbar } from \"@/components/ouro/navbar/navbar\", with @/components replaced by your components alias (aliases.components in components.json, such as ~/components). Also installed: button, navigation-menu, sheet, the helpers they import in lib/ouro. Needs ouro-base in your stylesheet: add that item once per app, from the same place as this one, if you have not. Docs: https://ui.ouroboros.bot/docs/navbar.md Ouro UI v1.3.257.",
  "type": "registry:ui"
}