{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "menubar",
  "type": "registry:ui",
  "title": "Menubar",
  "description": "A row of menus that stays on screen, as along the top of a desktop application: File, Edit, View.",
  "categories": [
    "ui"
  ],
  "dependencies": [
    "lucide-react",
    "radix-ui"
  ],
  "registryDependencies": [
    "@rivier-ui/theme",
    "@rivier-ui/cn"
  ],
  "files": [
    {
      "path": "registry/ui/menubar.tsx",
      "type": "registry:ui",
      "target": "components/ui/menubar.tsx",
      "content": "\"use client\";\n/**\n * @name menubar\n * @category ui\n * @description A row of menus that stays on screen, as along the top of a desktop application: File, Edit, View.\n * @when A working tool (an editor, a canvas, a table) with many commands that belong in named groups. The arrow keys move between the menus and through each one. Give the bar an `aria-label`. For one menu behind one button use dropdown-menu; for links between the pages of a site use navigation-menu or navbar.\n * @example\n * <Menubar aria-label=\"Document\">\n *   <MenubarMenu>\n *     <MenubarTrigger>File</MenubarTrigger>\n *     <MenubarContent>\n *       <MenubarItem onSelect={create}>New <MenubarShortcut>Ctrl N</MenubarShortcut></MenubarItem>\n *       <MenubarSeparator />\n *       <MenubarItem onSelect={print}>Print</MenubarItem>\n *     </MenubarContent>\n *   </MenubarMenu>\n *   <MenubarMenu>\n *     <MenubarTrigger>View</MenubarTrigger>\n *     <MenubarContent>\n *       <MenubarCheckboxItem checked={ruler} onCheckedChange={setRuler}>Ruler</MenubarCheckboxItem>\n *     </MenubarContent>\n *   </MenubarMenu>\n * </Menubar>\n */\nimport { Menubar as MenubarPrimitive } from \"radix-ui\";\nimport { Check, ChevronRight, Circle } from \"lucide-react\";\nimport type { ComponentProps } from \"react\";\nimport { cn } from \"@/lib/cn\";\n\n/* The same item as dropdown-menu: the highlight is the ground, the focus ring is drawn inside. */\nconst item =\n  \"relative flex min-h-9 cursor-default items-center gap-2 rounded-control px-2.5 py-1.5 text-sm select-none -outline-offset-2 data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-accent data-highlighted:text-accent-foreground pointer-coarse:min-h-10 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\";\n\n/*\n * The surface of dropdown-menu, without its closing animation. A menu that is still on screen while it\n * animates out sees focus arrive in the menu the arrow key has just opened, takes that for a move outside\n * the bar, and closes every menu. So a menu here closes at once.\n */\nconst surface =\n  \"z-50 max-h-(--radix-menubar-content-available-height) min-w-40 max-w-(--radix-menubar-content-available-width) origin-(--radix-menubar-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-surface border bg-popover p-1 text-popover-foreground ease-out animation-duration-(--duration-base) fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=open]:animate-in motion-reduce:animate-none!\";\n\n/** The bar. It wraps onto a second line rather than overflow a narrow screen. */\nexport function Menubar({ className, ...props }: ComponentProps<typeof MenubarPrimitive.Root>) {\n  return (\n    <MenubarPrimitive.Root\n      data-slot=\"menubar\"\n      className={cn(\"flex w-fit max-w-full flex-wrap items-center gap-1 rounded-surface border bg-background p-1\", className)}\n      {...props}\n    />\n  );\n}\n\nexport function MenubarMenu(props: ComponentProps<typeof MenubarPrimitive.Menu>) {\n  return <MenubarPrimitive.Menu {...props} />;\n}\n\nexport function MenubarTrigger({ className, ...props }: ComponentProps<typeof MenubarPrimitive.Trigger>) {\n  return (\n    <MenubarPrimitive.Trigger\n      data-slot=\"menubar-trigger\"\n      className={cn(\n        \"inline-flex h-control-sm cursor-default items-center rounded-control px-3 text-sm font-medium select-none transition-[background-color] duration-instant ease-out data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-accent data-[state=open]:bg-accent motion-reduce:transition-none pointer-coarse:h-control\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nexport function MenubarContent({ className, align = \"start\", sideOffset = 6, alignOffset = -4, collisionPadding = 8, ...props }: ComponentProps<typeof MenubarPrimitive.Content>) {\n  return (\n    <MenubarPrimitive.Portal>\n      <MenubarPrimitive.Content\n        data-slot=\"menubar-content\"\n        align={align}\n        sideOffset={sideOffset}\n        alignOffset={alignOffset}\n        collisionPadding={collisionPadding}\n        className={cn(surface, className)}\n        {...props}\n      />\n    </MenubarPrimitive.Portal>\n  );\n}\n\nexport function MenubarGroup(props: ComponentProps<typeof MenubarPrimitive.Group>) {\n  return <MenubarPrimitive.Group data-slot=\"menubar-group\" {...props} />;\n}\n\nexport type MenubarItemProps = ComponentProps<typeof MenubarPrimitive.Item> & {\n  /** Indent to line up with checkbox and radio items in the same menu. */\n  inset?: boolean;\n  /** \"destructive\" only for deleting. */\n  variant?: \"default\" | \"destructive\";\n};\n\nexport function MenubarItem({ className, inset = false, variant = \"default\", ...props }: MenubarItemProps) {\n  return (\n    <MenubarPrimitive.Item\n      data-slot=\"menubar-item\"\n      data-variant={variant}\n      className={cn(item, inset && \"ps-8\", variant === \"destructive\" && \"text-destructive data-highlighted:text-destructive\", className)}\n      {...props}\n    />\n  );\n}\n\nexport function MenubarCheckboxItem({ className, children, ...props }: ComponentProps<typeof MenubarPrimitive.CheckboxItem>) {\n  return (\n    <MenubarPrimitive.CheckboxItem data-slot=\"menubar-checkbox-item\" className={cn(item, \"ps-8\", className)} {...props}>\n      <span aria-hidden=\"true\" className=\"pointer-events-none absolute start-2.5 flex size-4 items-center justify-center\">\n        <MenubarPrimitive.ItemIndicator>\n          <Check strokeWidth={1.5} className=\"size-4\" />\n        </MenubarPrimitive.ItemIndicator>\n      </span>\n      {children}\n    </MenubarPrimitive.CheckboxItem>\n  );\n}\n\nexport function MenubarRadioGroup(props: ComponentProps<typeof MenubarPrimitive.RadioGroup>) {\n  return <MenubarPrimitive.RadioGroup data-slot=\"menubar-radio-group\" {...props} />;\n}\n\nexport function MenubarRadioItem({ className, children, ...props }: ComponentProps<typeof MenubarPrimitive.RadioItem>) {\n  return (\n    <MenubarPrimitive.RadioItem data-slot=\"menubar-radio-item\" className={cn(item, \"ps-8\", className)} {...props}>\n      <span aria-hidden=\"true\" className=\"pointer-events-none absolute start-2.5 flex size-4 items-center justify-center\">\n        <MenubarPrimitive.ItemIndicator>\n          <Circle strokeWidth={1.5} className=\"size-2 fill-current\" />\n        </MenubarPrimitive.ItemIndicator>\n      </span>\n      {children}\n    </MenubarPrimitive.RadioItem>\n  );\n}\n\nexport function MenubarLabel({ className, inset = false, ...props }: ComponentProps<typeof MenubarPrimitive.Label> & { inset?: boolean }) {\n  return (\n    <MenubarPrimitive.Label data-slot=\"menubar-label\" className={cn(\"px-2.5 py-1.5 text-xs font-medium text-muted-foreground\", inset && \"ps-8\", className)} {...props} />\n  );\n}\n\nexport function MenubarSeparator({ className, ...props }: ComponentProps<typeof MenubarPrimitive.Separator>) {\n  return <MenubarPrimitive.Separator data-slot=\"menubar-separator\" className={cn(\"-mx-1 my-1 h-px bg-border\", className)} {...props} />;\n}\n\n/** A keyboard hint at the end of an item. It only shows the keys: bind them yourself. */\nexport function MenubarShortcut({ className, ...props }: ComponentProps<\"span\">) {\n  return <span data-slot=\"menubar-shortcut\" className={cn(\"ms-auto ps-4 text-xs tracking-widest text-muted-foreground\", className)} {...props} />;\n}\n\nexport function MenubarSub(props: ComponentProps<typeof MenubarPrimitive.Sub>) {\n  return <MenubarPrimitive.Sub {...props} />;\n}\n\nexport function MenubarSubTrigger({ className, inset = false, children, ...props }: ComponentProps<typeof MenubarPrimitive.SubTrigger> & { inset?: boolean }) {\n  return (\n    <MenubarPrimitive.SubTrigger data-slot=\"menubar-sub-trigger\" className={cn(item, \"data-[state=open]:bg-accent\", inset && \"ps-8\", className)} {...props}>\n      {children}\n      <ChevronRight aria-hidden=\"true\" strokeWidth={1.5} className=\"ms-auto size-4 rtl:rotate-180\" />\n    </MenubarPrimitive.SubTrigger>\n  );\n}\n\nexport function MenubarSubContent({ className, collisionPadding = 8, ...props }: ComponentProps<typeof MenubarPrimitive.SubContent>) {\n  return (\n    <MenubarPrimitive.Portal>\n      <MenubarPrimitive.SubContent data-slot=\"menubar-sub-content\" collisionPadding={collisionPadding} className={cn(surface, className)} {...props} />\n    </MenubarPrimitive.Portal>\n  );\n}\n"
    }
  ],
  "meta": {
    "category": "ui",
    "when": "A working tool (an editor, a canvas, a table) with many commands that belong in named groups. The arrow keys move between the menus and through each one. Give the bar an `aria-label`. For one menu behind one button use dropdown-menu; for links between the pages of a site use navigation-menu or navbar.",
    "example": "<Menubar aria-label=\"Document\">\n  <MenubarMenu>\n    <MenubarTrigger>File</MenubarTrigger>\n    <MenubarContent>\n      <MenubarItem onSelect={create}>New <MenubarShortcut>Ctrl N</MenubarShortcut></MenubarItem>\n      <MenubarSeparator />\n      <MenubarItem onSelect={print}>Print</MenubarItem>\n    </MenubarContent>\n  </MenubarMenu>\n  <MenubarMenu>\n    <MenubarTrigger>View</MenubarTrigger>\n    <MenubarContent>\n      <MenubarCheckboxItem checked={ruler} onCheckedChange={setRuler}>Ruler</MenubarCheckboxItem>\n    </MenubarContent>\n  </MenubarMenu>\n</Menubar>",
    "client": true
  }
}
