{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"menubar","title":"Menubar","author":"brijr","description":"A horizontal set of menus, built on UI SDK.","dependencies":["@ui-sdk/react","@ui-sdk/core","cn","lucide-react"],"files":[{"path":"components/ui/menubar.tsx","content":"import * as React from \"react\"\nimport {\n  Menu,\n  MenuCheckboxItem as MenuCheckboxItemPrimitive,\n  MenuContent as MenuContentPrimitive,\n  MenuGroup,\n  MenuGroupLabel as MenuGroupLabelPrimitive,\n  MenuItem as MenuItemPrimitive,\n  MenuItemIndicator,\n  MenuRadioGroup,\n  MenuRadioItem as MenuRadioItemPrimitive,\n  MenuSeparator as MenuSeparatorPrimitive,\n  MenuShortcut as MenuShortcutPrimitive,\n  MenuSub,\n  MenuSubContent as MenuSubContentPrimitive,\n  MenuSubTrigger as MenuSubTriggerPrimitive,\n  MenuTrigger as MenuTriggerPrimitive,\n} from \"@ui-sdk/react/menu\"\nimport { Menubar as MenubarPrimitive } from \"@ui-sdk/react/menubar\"\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\"\nimport { cn } from \"cn\"\n\nfunction Menubar({\n  className,\n  ...props\n}: Omit<React.ComponentProps<typeof MenubarPrimitive>, \"className\"> & {\n  className?: string\n}) {\n  return (\n    <MenubarPrimitive\n      className={cn(\n        \"flex h-10 items-center gap-1 rounded-lg border bg-background p-1 shadow-(--elevation-control) data-[orientation=vertical]:h-auto data-[orientation=vertical]:w-fit data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nconst MenubarMenu = Menu\n\nconst MenubarGroup = MenuGroup\n\nconst MenubarRadioGroup = MenuRadioGroup\n\nconst MenubarSub = MenuSub\n\nfunction MenubarTrigger({\n  className,\n  ...props\n}: Omit<React.ComponentProps<typeof MenuTriggerPrimitive>, \"className\"> & {\n  className?: string\n}) {\n  return (\n    <MenuTriggerPrimitive\n      className={cn(\n        \"relative flex items-center self-stretch rounded-md px-2.5 py-1 text-sm font-medium outline-none select-none hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground focus-visible:ring-3 focus-visible:ring-ring/50 aria-disabled:pointer-events-none aria-disabled:opacity-50 pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:-inset-y-2 data-open:bg-accent data-open:text-accent-foreground\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction MenubarContent({\n  className,\n  align = \"start\",\n  sideOffset = 6,\n  ...props\n}: Omit<React.ComponentProps<typeof MenuContentPrimitive>, \"className\"> & {\n  className?: string\n}) {\n  return (\n    <MenuContentPrimitive\n      align={align}\n      sideOffset={sideOffset}\n      className={cn(\n        \"max-h-(--available-height) min-w-48 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-xl bg-popover p-1 text-popover-foreground shadow-(--elevation-popup) transition-[opacity,scale] duration-(--duration-popup) ease-(--easing-enter) outline-none data-ending-style:scale-95 data-ending-style:opacity-0 data-ending-style:duration-(--duration-popup-exit) data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:transition-none\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction MenubarItem({\n  className,\n  inset,\n  variant = \"default\",\n  ...props\n}: Omit<\n  React.ComponentProps<typeof MenuItemPrimitive>,\n  \"className\" | \"destructive\"\n> & {\n  className?: string\n  inset?: boolean\n  variant?: \"default\" | \"destructive\"\n}) {\n  return (\n    <MenuItemPrimitive\n      data-inset={inset || undefined}\n      destructive={variant === \"destructive\"}\n      className={cn(\n        \"relative flex cursor-default items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-none select-none data-destructive:text-destructive data-highlighted:bg-accent data-highlighted:text-accent-foreground data-destructive:data-highlighted:bg-destructive/10 data-[inset]:pl-8 *:data-[slot=menu-shortcut]:ml-auto *:data-[slot=menu-shortcut]:text-xs *:data-[slot=menu-shortcut]:tracking-widest *:data-[slot=menu-shortcut]:text-muted-foreground pointer-coarse:py-3 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction MenubarCheckboxItem({\n  className,\n  children,\n  ...props\n}: Omit<\n  React.ComponentProps<typeof MenuCheckboxItemPrimitive>,\n  \"className\" | \"children\"\n> & {\n  className?: string\n  children?: React.ReactNode\n}) {\n  return (\n    <MenuCheckboxItemPrimitive\n      className={cn(\n        \"relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-none select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground *:data-[slot=menu-shortcut]:ml-auto *:data-[slot=menu-shortcut]:text-xs *:data-[slot=menu-shortcut]:tracking-widest *:data-[slot=menu-shortcut]:text-muted-foreground pointer-coarse:py-3 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n        className\n      )}\n      {...props}\n    >\n      <MenuItemIndicator className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n        <CheckIcon className=\"size-4\" />\n      </MenuItemIndicator>\n      {children}\n    </MenuCheckboxItemPrimitive>\n  )\n}\n\nfunction MenubarRadioItem({\n  className,\n  children,\n  ...props\n}: Omit<\n  React.ComponentProps<typeof MenuRadioItemPrimitive>,\n  \"className\" | \"children\"\n> & {\n  className?: string\n  children?: React.ReactNode\n}) {\n  return (\n    <MenuRadioItemPrimitive\n      className={cn(\n        \"relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-none select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground *:data-[slot=menu-shortcut]:ml-auto *:data-[slot=menu-shortcut]:text-xs *:data-[slot=menu-shortcut]:tracking-widest *:data-[slot=menu-shortcut]:text-muted-foreground pointer-coarse:py-3 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n        className\n      )}\n      {...props}\n    >\n      <MenuItemIndicator className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n        <CircleIcon className=\"size-2 fill-current\" />\n      </MenuItemIndicator>\n      {children}\n    </MenuRadioItemPrimitive>\n  )\n}\n\nfunction MenubarLabel({\n  className,\n  inset,\n  ...props\n}: React.ComponentProps<\"div\"> & { inset?: boolean }) {\n  return (\n    <div\n      data-slot=\"menubar-label\"\n      data-inset={inset || undefined}\n      className={cn(\n        \"px-2 py-1.5 text-xs text-muted-foreground data-[inset]:pl-8\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction MenubarGroupLabel({\n  className,\n  inset,\n  ...props\n}: Omit<React.ComponentProps<typeof MenuGroupLabelPrimitive>, \"className\"> & {\n  className?: string\n  inset?: boolean\n}) {\n  return (\n    <MenuGroupLabelPrimitive\n      data-inset={inset || undefined}\n      className={cn(\n        \"px-2 py-1.5 text-xs text-muted-foreground data-[inset]:pl-8\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction MenubarSeparator({\n  className,\n  ...props\n}: Omit<React.ComponentProps<typeof MenuSeparatorPrimitive>, \"className\"> & {\n  className?: string\n}) {\n  return (\n    <MenuSeparatorPrimitive\n      className={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction MenubarShortcut({\n  className,\n  ...props\n}: Omit<React.ComponentProps<typeof MenuShortcutPrimitive>, \"className\"> & {\n  className?: string\n}) {\n  return (\n    <MenuShortcutPrimitive\n      className={cn(\n        \"ml-auto text-xs tracking-widest text-muted-foreground\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction MenubarSubTrigger({\n  className,\n  inset,\n  children,\n  ...props\n}: Omit<\n  React.ComponentProps<typeof MenuSubTriggerPrimitive>,\n  \"className\" | \"children\"\n> & {\n  className?: string\n  children?: React.ReactNode\n  inset?: boolean\n}) {\n  return (\n    <MenuSubTriggerPrimitive\n      data-inset={inset || undefined}\n      className={cn(\n        \"flex cursor-default items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-none select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[inset]:pl-8 pointer-coarse:py-3 data-open:bg-accent data-open:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground\",\n        className\n      )}\n      {...props}\n    >\n      {children}\n      <ChevronRightIcon aria-hidden=\"true\" className=\"ml-auto size-4\" />\n    </MenuSubTriggerPrimitive>\n  )\n}\n\nfunction MenubarSubContent({\n  className,\n  sideOffset = 4,\n  ...props\n}: Omit<React.ComponentProps<typeof MenuSubContentPrimitive>, \"className\"> & {\n  className?: string\n}) {\n  return (\n    <MenuSubContentPrimitive\n      sideOffset={sideOffset}\n      className={cn(\n        \"max-h-(--available-height) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-xl bg-popover p-1 text-popover-foreground shadow-(--elevation-popup) transition-[opacity,scale] duration-(--duration-popup) ease-(--easing-enter) outline-none data-ending-style:scale-95 data-ending-style:opacity-0 data-ending-style:duration-(--duration-popup-exit) data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:transition-none\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nexport {\n  Menubar,\n  MenubarMenu,\n  MenubarTrigger,\n  MenubarContent,\n  MenubarItem,\n  MenubarSeparator,\n  MenubarLabel,\n  MenubarGroupLabel,\n  MenubarCheckboxItem,\n  MenubarRadioGroup,\n  MenubarRadioItem,\n  MenubarSubContent,\n  MenubarSubTrigger,\n  MenubarGroup,\n  MenubarSub,\n  MenubarShortcut,\n}\n","type":"registry:ui"}],"type":"registry:ui"}