{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "context-menu",
  "title": "Context Menu",
  "description": "A menu of actions for an area of the page that opens on right click or long press, with checkbox and radio items, labels, shortcuts and submenus.",
  "dependencies": [
    "@radix-ui/react-context-menu",
    "lucide-react"
  ],
  "registryDependencies": [
    "@corsair-ui/utils"
  ],
  "files": [
    {
      "path": "registry/default/ui/context-menu.tsx",
      "content": "\"use client\";\n\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\";\nimport type { ComponentProps } from \"react\";\n\nimport { cn } from \"@/registry/default/lib/utils\";\n\n/**\n * A menu of actions for an area of the page, opened with a right click, a\n * long press on touch screens, or the keyboard's context menu key (or\n * Shift+F10) while something inside the trigger area has focus. Inside, the\n * arrow keys move between items, typing a letter jumps to the item that\n * starts with it, ArrowRight opens a submenu and ArrowLeft closes it, and\n * Escape closes the menu. Screen readers hear menu items, checkbox items and\n * radio items with their checked state. The menu is hidden until someone\n * asks for it, so every action in it should also be reachable another way\n * (a toolbar button or a DropdownMenu). With reduced motion it appears\n * without fading or zooming.\n *\n * @example\n * <ContextMenu>\n *   <ContextMenuTrigger className=\"rounded-md border p-8\">Right click here</ContextMenuTrigger>\n *   <ContextMenuContent>\n *     <ContextMenuItem>\n *       Copy\n *       <ContextMenuShortcut>⌘C</ContextMenuShortcut>\n *     </ContextMenuItem>\n *     <ContextMenuSeparator />\n *     <ContextMenuItem variant=\"destructive\">Delete</ContextMenuItem>\n *   </ContextMenuContent>\n * </ContextMenu>\n */\nfunction ContextMenu(props: ComponentProps<typeof ContextMenuPrimitive.Root>) {\n  return <ContextMenuPrimitive.Root data-slot=\"context-menu\" {...props} />;\n}\n\n/**\n * The area that opens the menu on right click or long press. It renders a\n * `<span>`; use `asChild` to make your own element the area. Keyboard users\n * reach the menu through a focusable element inside it.\n */\nfunction ContextMenuTrigger(props: ComponentProps<typeof ContextMenuPrimitive.Trigger>) {\n  return <ContextMenuPrimitive.Trigger data-slot=\"context-menu-trigger\" {...props} />;\n}\n\nfunction ContextMenuPortal(props: ComponentProps<typeof ContextMenuPrimitive.Portal>) {\n  return <ContextMenuPrimitive.Portal data-slot=\"context-menu-portal\" {...props} />;\n}\n\n/**\n * The floating list, rendered in a portal at the pointer. It never grows\n * taller than the space the viewport leaves it and scrolls instead.\n */\nfunction ContextMenuContent({\n  className,\n  ...props\n}: ComponentProps<typeof ContextMenuPrimitive.Content>) {\n  return (\n    <ContextMenuPrimitive.Portal>\n      <ContextMenuPrimitive.Content\n        data-slot=\"context-menu-content\"\n        className={cn(\n          \"bg-popover text-popover-foreground z-50 max-h-[var(--radix-context-menu-content-available-height)] min-w-[8rem] origin-[var(--radix-context-menu-content-transform-origin)] overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md outline-none\",\n          // animate-in/out sit behind motion-safe: so reduced motion really turns them off.\n          \"motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n          \"motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95\",\n          \"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\",\n          className\n        )}\n        {...props}\n      />\n    </ContextMenuPrimitive.Portal>\n  );\n}\n\nfunction ContextMenuGroup(props: ComponentProps<typeof ContextMenuPrimitive.Group>) {\n  return <ContextMenuPrimitive.Group data-slot=\"context-menu-group\" {...props} />;\n}\n\ninterface ContextMenuLabelProps extends ComponentProps<typeof ContextMenuPrimitive.Label> {\n  /** Indents the label to line up with items that have an icon or indicator. */\n  inset?: boolean;\n}\n\n/** A heading inside the menu. It is not focusable and cannot be selected. */\nfunction ContextMenuLabel({ className, inset, ...props }: ContextMenuLabelProps) {\n  return (\n    <ContextMenuPrimitive.Label\n      data-slot=\"context-menu-label\"\n      data-inset={inset || undefined}\n      className={cn(\"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\", className)}\n      {...props}\n    />\n  );\n}\n\ninterface ContextMenuItemProps extends ComponentProps<typeof ContextMenuPrimitive.Item> {\n  /** Indents the item to line up with items that have an icon or indicator. */\n  inset?: boolean;\n  /** `destructive` colours the item for actions that delete or cannot be undone. */\n  variant?: \"default\" | \"destructive\";\n}\n\n/** An action. `onSelect` runs on click, Enter or Space and then the menu closes. */\nfunction ContextMenuItem({\n  className,\n  inset,\n  variant = \"default\",\n  ...props\n}: ContextMenuItemProps) {\n  return (\n    <ContextMenuPrimitive.Item\n      data-slot=\"context-menu-item\"\n      data-inset={inset || undefined}\n      data-variant={variant}\n      className={cn(\n        \"relative flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none select-none\",\n        \"focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n        \"data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[inset]:pl-8\",\n        \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n        className\n      )}\n      {...props}\n    />\n  );\n}\n\n/** An item that toggles on and off, announced with its checked state. */\nfunction ContextMenuCheckboxItem({\n  className,\n  children,\n  ...props\n}: ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>) {\n  return (\n    <ContextMenuPrimitive.CheckboxItem\n      data-slot=\"context-menu-checkbox-item\"\n      className={cn(\n        \"relative flex cursor-default items-center gap-2 rounded-md py-1.5 pr-2 pl-8 text-sm outline-none select-none\",\n        \"focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n        \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n        className\n      )}\n      {...props}\n    >\n      <span\n        data-slot=\"context-menu-checkbox-item-indicator\"\n        className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\"\n      >\n        <ContextMenuPrimitive.ItemIndicator>\n          <CheckIcon aria-hidden=\"true\" className=\"size-4\" />\n        </ContextMenuPrimitive.ItemIndicator>\n      </span>\n      {children}\n    </ContextMenuPrimitive.CheckboxItem>\n  );\n}\n\n/** Groups radio items so exactly one is checked. Controlled with `value` / `onValueChange`. */\nfunction ContextMenuRadioGroup(props: ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {\n  return <ContextMenuPrimitive.RadioGroup data-slot=\"context-menu-radio-group\" {...props} />;\n}\n\n/** One option of a ContextMenuRadioGroup, announced with its checked state. */\nfunction ContextMenuRadioItem({\n  className,\n  children,\n  ...props\n}: ComponentProps<typeof ContextMenuPrimitive.RadioItem>) {\n  return (\n    <ContextMenuPrimitive.RadioItem\n      data-slot=\"context-menu-radio-item\"\n      className={cn(\n        \"relative flex cursor-default items-center gap-2 rounded-md py-1.5 pr-2 pl-8 text-sm outline-none select-none\",\n        \"focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n        \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n        className\n      )}\n      {...props}\n    >\n      <span\n        data-slot=\"context-menu-radio-item-indicator\"\n        className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\"\n      >\n        <ContextMenuPrimitive.ItemIndicator>\n          <CircleIcon aria-hidden=\"true\" className=\"size-2 fill-current\" />\n        </ContextMenuPrimitive.ItemIndicator>\n      </span>\n      {children}\n    </ContextMenuPrimitive.RadioItem>\n  );\n}\n\nfunction ContextMenuSeparator({\n  className,\n  ...props\n}: ComponentProps<typeof ContextMenuPrimitive.Separator>) {\n  return (\n    <ContextMenuPrimitive.Separator\n      data-slot=\"context-menu-separator\"\n      className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n      {...props}\n    />\n  );\n}\n\n/**\n * The keyboard shortcut shown at the end of an item. It is only a hint: the\n * shortcut itself is yours to handle, and `aria-keyshortcuts` on the item\n * tells screen readers about it.\n */\nfunction ContextMenuShortcut({ className, ...props }: ComponentProps<\"span\">) {\n  return (\n    <span\n      data-slot=\"context-menu-shortcut\"\n      className={cn(\"text-muted-foreground ml-auto text-xs tracking-widest\", className)}\n      {...props}\n    />\n  );\n}\n\n/** A nested menu: wraps a ContextMenuSubTrigger and a ContextMenuSubContent. */\nfunction ContextMenuSub(props: ComponentProps<typeof ContextMenuPrimitive.Sub>) {\n  return <ContextMenuPrimitive.Sub data-slot=\"context-menu-sub\" {...props} />;\n}\n\ninterface ContextMenuSubTriggerProps extends ComponentProps<\n  typeof ContextMenuPrimitive.SubTrigger\n> {\n  /** Indents the item to line up with items that have an icon or indicator. */\n  inset?: boolean;\n}\n\n/** The item that opens a submenu, on hover, Enter, Space or ArrowRight. */\nfunction ContextMenuSubTrigger({\n  className,\n  inset,\n  children,\n  ...props\n}: ContextMenuSubTriggerProps) {\n  return (\n    <ContextMenuPrimitive.SubTrigger\n      data-slot=\"context-menu-sub-trigger\"\n      data-inset={inset || undefined}\n      className={cn(\n        \"relative flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none select-none\",\n        \"focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n        \"data-[state=open]:bg-accent data-[state=open]:text-accent-foreground data-[inset]:pl-8\",\n        \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n        className\n      )}\n      {...props}\n    >\n      {children}\n      <ChevronRightIcon aria-hidden=\"true\" className=\"ml-auto size-4\" />\n    </ContextMenuPrimitive.SubTrigger>\n  );\n}\n\n/** The submenu's list, rendered in a portal next to its trigger. */\nfunction ContextMenuSubContent({\n  className,\n  ...props\n}: ComponentProps<typeof ContextMenuPrimitive.SubContent>) {\n  return (\n    <ContextMenuPrimitive.Portal>\n      <ContextMenuPrimitive.SubContent\n        data-slot=\"context-menu-sub-content\"\n        className={cn(\n          \"bg-popover text-popover-foreground z-50 max-h-[var(--radix-context-menu-content-available-height)] min-w-[8rem] origin-[var(--radix-context-menu-content-transform-origin)] overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-lg outline-none\",\n          \"motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n          \"motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95\",\n          \"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\",\n          className\n        )}\n        {...props}\n      />\n    </ContextMenuPrimitive.Portal>\n  );\n}\n\nexport {\n  ContextMenu,\n  ContextMenuCheckboxItem,\n  ContextMenuContent,\n  ContextMenuGroup,\n  ContextMenuItem,\n  ContextMenuLabel,\n  ContextMenuPortal,\n  ContextMenuRadioGroup,\n  ContextMenuRadioItem,\n  ContextMenuSeparator,\n  ContextMenuShortcut,\n  ContextMenuSub,\n  ContextMenuSubContent,\n  ContextMenuSubTrigger,\n  ContextMenuTrigger,\n  type ContextMenuItemProps,\n  type ContextMenuLabelProps,\n  type ContextMenuSubTriggerProps,\n};\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}