{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "context-menu",
  "type": "registry:ui",
  "title": "Context Menu",
  "description": "A context menu component",
  "dependencies": [
    "solid-js",
    "@kobalte/core"
  ],
  "files": [
    {
      "path": "src/registry/ui/context-menu.tsx",
      "content": "import type { Component, ComponentProps, JSX, ValidComponent } from \"solid-js\"\nimport { splitProps } from \"solid-js\"\n\nimport * as ContextMenuPrimitive from \"@kobalte/core/context-menu\"\nimport type { PolymorphicProps } from \"@kobalte/core/polymorphic\"\n\nimport { cn } from \"~/lib/utils\"\n\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger\nconst ContextMenuPortal = ContextMenuPrimitive.Portal\nconst ContextMenuSub = ContextMenuPrimitive.Sub\nconst ContextMenuGroup = ContextMenuPrimitive.Group\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup\n\nconst ContextMenu: Component<ContextMenuPrimitive.ContextMenuRootProps> = (props) => {\n  return <ContextMenuPrimitive.Root gutter={4} {...props} />\n}\n\ntype ContextMenuContentProps<T extends ValidComponent = \"div\"> =\n  ContextMenuPrimitive.ContextMenuContentProps<T> & {\n    class?: string | undefined\n  }\n\nconst ContextMenuContent = <T extends ValidComponent = \"div\">(\n  props: PolymorphicProps<T, ContextMenuContentProps<T>>\n) => {\n  const [local, others] = splitProps(props as ContextMenuContentProps, [\"class\"])\n  return (\n    <ContextMenuPrimitive.Portal>\n      <ContextMenuPrimitive.Content\n        class={cn(\n          \"z-50 min-w-32 origin-[var(--kb-menu-content-transform-origin)] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in\",\n          local.class\n        )}\n        {...others}\n      />\n    </ContextMenuPrimitive.Portal>\n  )\n}\n\ntype ContextMenuItemProps<T extends ValidComponent = \"div\"> =\n  ContextMenuPrimitive.ContextMenuItemProps<T> & {\n    class?: string | undefined\n  }\n\nconst ContextMenuItem = <T extends ValidComponent = \"div\">(\n  props: PolymorphicProps<T, ContextMenuItemProps<T>>\n) => {\n  const [local, others] = splitProps(props as ContextMenuItemProps, [\"class\"])\n  return (\n    <ContextMenuPrimitive.Item\n      class={cn(\n        \"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n        local.class\n      )}\n      {...others}\n    />\n  )\n}\n\nconst ContextMenuShortcut: Component<ComponentProps<\"span\">> = (props) => {\n  const [local, others] = splitProps(props, [\"class\"])\n  return <span class={cn(\"ml-auto text-xs tracking-widest opacity-60\", local.class)} {...others} />\n}\n\ntype ContextMenuSeparatorProps<T extends ValidComponent = \"hr\"> =\n  ContextMenuPrimitive.ContextMenuSeparatorProps<T> & {\n    class?: string | undefined\n  }\n\nconst ContextMenuSeparator = <T extends ValidComponent = \"hr\">(\n  props: PolymorphicProps<T, ContextMenuSeparatorProps<T>>\n) => {\n  const [local, others] = splitProps(props as ContextMenuSeparatorProps, [\"class\"])\n  return (\n    <ContextMenuPrimitive.Separator\n      class={cn(\"-mx-1 my-1 h-px bg-muted\", local.class)}\n      {...others}\n    />\n  )\n}\n\ntype ContextMenuSubTriggerProps<T extends ValidComponent = \"div\"> =\n  ContextMenuPrimitive.ContextMenuSubTriggerProps<T> & {\n    class?: string | undefined\n    children?: JSX.Element\n  }\n\nconst ContextMenuSubTrigger = <T extends ValidComponent = \"div\">(\n  props: PolymorphicProps<T, ContextMenuSubTriggerProps<T>>\n) => {\n  const [local, others] = splitProps(props as ContextMenuSubTriggerProps, [\"class\", \"children\"])\n  return (\n    <ContextMenuPrimitive.SubTrigger\n      class={cn(\n        \"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent\",\n        local.class\n      )}\n      {...others}\n    >\n      {local.children}\n      <svg\n        xmlns=\"http://www.w3.org/2000/svg\"\n        viewBox=\"0 0 24 24\"\n        fill=\"none\"\n        stroke=\"currentColor\"\n        stroke-width=\"2\"\n        stroke-linecap=\"round\"\n        stroke-linejoin=\"round\"\n        class=\"ml-auto size-4\"\n      >\n        <path d=\"M9 6l6 6l-6 6\" />\n      </svg>\n    </ContextMenuPrimitive.SubTrigger>\n  )\n}\n\ntype ContextMenuSubContentProps<T extends ValidComponent = \"div\"> =\n  ContextMenuPrimitive.ContextMenuSubContentProps<T> & {\n    class?: string | undefined\n  }\n\nconst ContextMenuSubContent = <T extends ValidComponent = \"div\">(\n  props: PolymorphicProps<T, ContextMenuSubContentProps<T>>\n) => {\n  const [local, others] = splitProps(props as ContextMenuSubContentProps, [\"class\"])\n  return (\n    <ContextMenuPrimitive.SubContent\n      class={cn(\n        \"z-50 min-w-32 origin-[var(--kb-menu-content-transform-origin)] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in\",\n        local.class\n      )}\n      {...others}\n    />\n  )\n}\n\ntype ContextMenuCheckboxItemProps<T extends ValidComponent = \"div\"> =\n  ContextMenuPrimitive.ContextMenuCheckboxItemProps<T> & {\n    class?: string | undefined\n    children?: JSX.Element\n  }\n\nconst ContextMenuCheckboxItem = <T extends ValidComponent = \"div\">(\n  props: PolymorphicProps<T, ContextMenuCheckboxItemProps<T>>\n) => {\n  const [local, others] = splitProps(props as ContextMenuCheckboxItemProps, [\"class\", \"children\"])\n  return (\n    <ContextMenuPrimitive.CheckboxItem\n      class={cn(\n        \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n        local.class\n      )}\n      {...others}\n    >\n      <span class=\"absolute left-2 flex size-3.5 items-center justify-center\">\n        <ContextMenuPrimitive.ItemIndicator>\n          <svg\n            xmlns=\"http://www.w3.org/2000/svg\"\n            viewBox=\"0 0 24 24\"\n            fill=\"none\"\n            stroke=\"currentColor\"\n            stroke-width=\"2\"\n            stroke-linecap=\"round\"\n            stroke-linejoin=\"round\"\n            class=\"size-4\"\n          >\n            <path d=\"M5 12l5 5l10 -10\" />\n          </svg>\n        </ContextMenuPrimitive.ItemIndicator>\n      </span>\n      {local.children}\n    </ContextMenuPrimitive.CheckboxItem>\n  )\n}\n\ntype ContextMenuGroupLabelProps<T extends ValidComponent = \"span\"> =\n  ContextMenuPrimitive.ContextMenuGroupLabelProps<T> & {\n    class?: string | undefined\n  }\n\nconst ContextMenuGroupLabel = <T extends ValidComponent = \"span\">(\n  props: PolymorphicProps<T, ContextMenuGroupLabelProps<T>>\n) => {\n  const [local, others] = splitProps(props as ContextMenuGroupLabelProps, [\"class\"])\n  return (\n    <ContextMenuPrimitive.GroupLabel\n      class={cn(\"px-2 py-1.5 text-sm font-semibold\", local.class)}\n      {...others}\n    />\n  )\n}\n\ntype ContextMenuRadioItemProps<T extends ValidComponent = \"div\"> =\n  ContextMenuPrimitive.ContextMenuRadioItemProps<T> & {\n    class?: string | undefined\n    children?: JSX.Element\n  }\n\nconst ContextMenuRadioItem = <T extends ValidComponent = \"div\">(\n  props: PolymorphicProps<T, ContextMenuRadioItemProps<T>>\n) => {\n  const [local, others] = splitProps(props as ContextMenuRadioItemProps, [\"class\", \"children\"])\n  return (\n    <ContextMenuPrimitive.RadioItem\n      class={cn(\n        \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n        local.class\n      )}\n      {...others}\n    >\n      <span class=\"absolute left-2 flex size-3.5 items-center justify-center\">\n        <ContextMenuPrimitive.ItemIndicator>\n          <svg\n            xmlns=\"http://www.w3.org/2000/svg\"\n            viewBox=\"0 0 24 24\"\n            fill=\"none\"\n            stroke=\"currentColor\"\n            stroke-width=\"2\"\n            stroke-linecap=\"round\"\n            stroke-linejoin=\"round\"\n            class=\"size-2 fill-current\"\n          >\n            <path d=\"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\" />\n          </svg>\n        </ContextMenuPrimitive.ItemIndicator>\n      </span>\n      {local.children}\n    </ContextMenuPrimitive.RadioItem>\n  )\n}\n\nexport {\n  ContextMenu,\n  ContextMenuTrigger,\n  ContextMenuPortal,\n  ContextMenuContent,\n  ContextMenuItem,\n  ContextMenuShortcut,\n  ContextMenuSeparator,\n  ContextMenuSub,\n  ContextMenuSubTrigger,\n  ContextMenuSubContent,\n  ContextMenuCheckboxItem,\n  ContextMenuGroup,\n  ContextMenuGroupLabel,\n  ContextMenuRadioGroup,\n  ContextMenuRadioItem\n}\n",
      "type": "registry:ui"
    }
  ]
}