{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "context-menu",
  "title": "Context Menu",
  "dependencies": [
    "solid-js@^1.9.15",
    "@kobalte/core@https://github.com/jhomra21/kobalte/releases/download/kobalte-solid1-audiocn-e0e3bf095f05c7e61230a251b79181c6d834d408/kobalte-core-0.13.14-audiocn.0.e0e3bf09.tgz"
  ],
  "registryDependencies": [
    "@audiocn-solid/core",
    "@audiocn-solid/kobalte-dom-collection"
  ],
  "files": [
    {
      "path": "components/ui/context-menu.tsx",
      "content": "import * as MenuPrimitive from \"@kobalte/core/context-menu\";\nimport type {\n  ContextMenuContentCommonProps,\n  ContextMenuContentOptions,\n  ContextMenuItemCommonProps,\n  ContextMenuItemOptions,\n  ContextMenuRadioItemCommonProps,\n  ContextMenuRadioItemOptions,\n  ContextMenuRadioGroupOptions,\n  ContextMenuRootProps,\n} from \"@kobalte/core/context-menu\";\nimport { createContext, useContext } from \"solid-js\";\n\nimport { provideContext } from \"@/lib/solid/context\";\nimport type {\n  DivDOMProps,\n  JSXElement,\n  SpanDOMProps,\n} from \"@/lib/solid/jsx-types\";\nimport { KobalteDomCollectionScope } from \"@/lib/solid/kobalte-dom-collection\";\nimport { omitProps } from \"@/lib/solid/props\";\nimport { cn } from \"@/lib/utils\";\n\ninterface TriggerContextValue {\n  element?: HTMLElement;\n}\n\nconst TriggerContext = createContext<TriggerContextValue>();\n\nexport const ContextMenu = (props: ContextMenuRootProps) => {\n  const trigger: TriggerContextValue = {};\n\n  return (\n    <MenuPrimitive.Root {...omitProps(props, [\"children\"])}>\n      {provideContext(TriggerContext, trigger, () => (\n        <KobalteDomCollectionScope>{props.children}</KobalteDomCollectionScope>\n      ))}\n    </MenuPrimitive.Root>\n  );\n};\n\nexport const ContextMenuTrigger: typeof MenuPrimitive.Trigger = (props) => {\n  const trigger = useContext(TriggerContext);\n\n  return (\n    <MenuPrimitive.Trigger\n      {...omitProps(props, [\"ref\"])}\n      ref={(element: HTMLElement) => {\n        if (trigger) trigger.element = element;\n\n        // Solid compiles writable node refs into callbacks; preserve the\n        // native JSX node union for direct runtime callers.\n        // oxlint-disable-next-line anti-slop/no-runtime-typeof\n        if (typeof props.ref === \"function\") {\n          // SAFETY: Kobalte supplies the same concrete node selected by `as`;\n          // this callback is the callable branch of that polymorphic ref.\n          const ref = props.ref as (node: HTMLElement) => void;\n          ref(element);\n        }\n      }}\n    />\n  );\n};\n\nexport const ContextMenuGroup = MenuPrimitive.Group;\n\nexport const ContextMenuPortal = MenuPrimitive.Portal;\n\nexport const ContextMenuSeparator = (\n  props: Parameters<typeof MenuPrimitive.Separator>[0] & { className?: string }\n) => (\n  <MenuPrimitive.Separator\n    data-slot=\"context-menu-separator\"\n    class={cn(\"bg-border/50 -mx-1 my-1 h-px\", props.class, props.className)}\n    {...omitProps(props, [\"class\", \"className\"])}\n  />\n);\n\nexport interface ContextMenuContentProps\n  extends\n    Omit<DivDOMProps, keyof ContextMenuContentCommonProps>,\n    Partial<ContextMenuContentCommonProps>,\n    ContextMenuContentOptions {\n  className?: string;\n}\n\nexport const ContextMenuContent = (props: ContextMenuContentProps) => {\n  const trigger = useContext(TriggerContext);\n\n  return (\n    <MenuPrimitive.Portal>\n      <MenuPrimitive.Content\n        data-slot=\"context-menu-content\"\n        class={cn(\n          \"text-popover-foreground ring-foreground/5 dark:ring-foreground/10 bg-popover/70 **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground! relative z-50 max-h-(--kb-popper-content-available-height) min-w-36 origin-(--kb-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-2xl p-1 shadow-lg ring-1 outline-none before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150\",\n          props.class,\n          props.className\n        )}\n        onCloseAutoFocus={(event: Event) => {\n          props.onCloseAutoFocus?.(event);\n\n          // Secondary clicks do not focus buttons in WebKit. Kobalte's\n          // prevention still protects an outside control that took focus.\n          if (!event.defaultPrevented) {\n            event.preventDefault();\n            trigger?.element?.focus({ preventScroll: true });\n          }\n        }}\n        {...omitProps(props, [\"class\", \"className\", \"onCloseAutoFocus\"])}\n      />\n    </MenuPrimitive.Portal>\n  );\n};\n\nexport const ContextMenuLabel = (\n  props: Parameters<typeof MenuPrimitive.GroupLabel>[0] & {\n    inset?: boolean;\n    className?: string;\n  }\n) => (\n  <MenuPrimitive.GroupLabel\n    data-slot=\"context-menu-label\"\n    data-inset={props.inset ? \"\" : undefined}\n    class={cn(\n      \"text-muted-foreground px-2 py-1 text-xs data-inset:pl-7\",\n      props.class,\n      props.className\n    )}\n    {...omitProps(props, [\"class\", \"className\", \"inset\"])}\n  />\n);\n\nexport interface ContextMenuItemProps\n  extends\n    Omit<\n      DivDOMProps,\n      keyof ContextMenuItemCommonProps | keyof ContextMenuItemOptions\n    >,\n    Partial<ContextMenuItemCommonProps>,\n    ContextMenuItemOptions {\n  variant?: \"default\" | \"destructive\";\n  inset?: boolean;\n  className?: string;\n}\n\nexport const ContextMenuItem = (props: ContextMenuItemProps) => (\n  <MenuPrimitive.Item\n    data-slot=\"context-menu-item\"\n    data-variant={props.variant ?? \"default\"}\n    data-inset={props.inset ? \"\" : undefined}\n    class={cn(\n      \"group/context-menu-item focus:bg-accent focus:text-accent-foreground data-highlighted:bg-foreground/10 data-[variant=destructive]:text-destructive relative flex min-h-7 cursor-default items-center gap-2 rounded-xl px-2 py-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n      props.class,\n      props.className\n    )}\n    {...omitProps(props, [\"class\", \"className\", \"variant\", \"inset\"])}\n  />\n);\n\nexport const ContextMenuRadioGroup = (\n  props: ContextMenuRadioGroupOptions & {\n    children?: JSXElement;\n    onValueChange?: (value: string) => void;\n  }\n) => (\n  <MenuPrimitive.RadioGroup\n    data-slot=\"context-menu-radio-group\"\n    {...omitProps(props, [\"onValueChange\"])}\n    onChange={(value) => {\n      props.onChange?.(value);\n      props.onValueChange?.(value);\n    }}\n  />\n);\n\nexport interface ContextMenuRadioItemProps\n  extends\n    Omit<\n      DivDOMProps,\n      keyof ContextMenuRadioItemCommonProps | keyof ContextMenuRadioItemOptions\n    >,\n    Partial<ContextMenuRadioItemCommonProps>,\n    ContextMenuRadioItemOptions {\n  inset?: boolean;\n  className?: string;\n}\n\nexport const ContextMenuRadioItem = (props: ContextMenuRadioItemProps) => (\n  <MenuPrimitive.RadioItem\n    data-slot=\"context-menu-radio-item\"\n    data-inset={props.inset ? \"\" : undefined}\n    class={cn(\n      \"focus:bg-accent focus:text-accent-foreground data-highlighted:bg-foreground/10 relative flex min-h-7 cursor-default items-center gap-2 rounded-xl py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n      props.class,\n      props.className\n    )}\n    {...omitProps(props, [\"class\", \"className\", \"children\", \"inset\"])}\n  >\n    <span aria-hidden=\"true\" class=\"pointer-events-none absolute right-2\">\n      <MenuPrimitive.ItemIndicator>\n        <MenuCheck />\n      </MenuPrimitive.ItemIndicator>\n    </span>\n    {props.children}\n  </MenuPrimitive.RadioItem>\n);\n\nconst MenuCheck = () => (\n  <svg\n    aria-hidden=\"true\"\n    fill=\"currentColor\"\n    height=\"1em\"\n    width=\"1em\"\n    viewBox=\"0 0 256 256\"\n  >\n    {/* Regular Phosphor Check, MIT © Phosphor Icons. */}\n    <path d=\"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z\" />\n  </svg>\n);\n\nexport const ContextMenuCheckboxItem = (\n  props: Parameters<typeof MenuPrimitive.CheckboxItem>[0] & {\n    inset?: boolean;\n    className?: string;\n  }\n) => (\n  <MenuPrimitive.CheckboxItem\n    data-slot=\"context-menu-checkbox-item\"\n    data-inset={props.inset ? \"\" : undefined}\n    class={cn(\n      \"focus:bg-accent focus:text-accent-foreground data-highlighted:bg-foreground/10 relative flex min-h-7 cursor-default items-center gap-2 rounded-xl py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n      props.class,\n      props.className\n    )}\n    {...omitProps(props, [\"class\", \"className\", \"children\", \"inset\"])}\n  >\n    <span class=\"pointer-events-none absolute right-2\">\n      <MenuPrimitive.ItemIndicator>\n        <MenuCheck />\n      </MenuPrimitive.ItemIndicator>\n    </span>\n    {props.children}\n  </MenuPrimitive.CheckboxItem>\n);\n\nexport const ContextMenuShortcut = (\n  props: SpanDOMProps & { className?: string }\n) => (\n  <span\n    data-slot=\"context-menu-shortcut\"\n    class={cn(\n      \"text-muted-foreground group-focus/context-menu-item:text-accent-foreground ml-auto text-xs tracking-widest\",\n      props.class,\n      props.className\n    )}\n    {...omitProps(props, [\"class\", \"className\"])}\n  />\n);\n\nexport const ContextMenuSub = (\n  props: Parameters<typeof MenuPrimitive.Sub>[0]\n) => (\n  <MenuPrimitive.Sub {...omitProps(props, [\"children\"])}>\n    <KobalteDomCollectionScope>{props.children}</KobalteDomCollectionScope>\n  </MenuPrimitive.Sub>\n);\n\nexport const ContextMenuSubTrigger = (\n  props: Parameters<typeof MenuPrimitive.SubTrigger>[0] & {\n    inset?: boolean;\n    className?: string;\n  }\n) => (\n  <MenuPrimitive.SubTrigger\n    data-slot=\"context-menu-sub-trigger\"\n    data-inset={props.inset ? \"\" : undefined}\n    class={cn(\n      \"focus:bg-foreground/10 data-highlighted:bg-foreground/10 aria-expanded:bg-foreground/10 flex min-h-7 cursor-default items-center rounded-xl px-2 py-1.5 text-sm outline-hidden select-none data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n      props.class,\n      props.className\n    )}\n    {...omitProps(props, [\"class\", \"className\", \"children\", \"inset\"])}\n  >\n    {props.children}\n    <svg\n      aria-hidden=\"true\"\n      class=\"ml-auto\"\n      fill=\"currentColor\"\n      height=\"1em\"\n      width=\"1em\"\n      viewBox=\"0 0 256 256\"\n    >\n      {/* Regular Phosphor CaretRight, MIT © Phosphor Icons. */}\n      <path d=\"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z\" />\n    </svg>\n  </MenuPrimitive.SubTrigger>\n);\n\nexport const ContextMenuSubContent = (\n  props: Parameters<typeof MenuPrimitive.SubContent>[0] & { className?: string }\n) => (\n  <MenuPrimitive.Portal>\n    <MenuPrimitive.SubContent\n      data-slot=\"context-menu-sub-content\"\n      class={cn(\n        \"text-popover-foreground ring-foreground/5 dark:ring-foreground/10 bg-popover/70 **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground! relative z-50 max-h-(--kb-popper-content-available-height) min-w-36 overflow-x-hidden overflow-y-auto rounded-2xl p-1 shadow-lg ring-1 outline-none before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150\",\n        props.class,\n        props.className\n      )}\n      {...omitProps(props, [\"class\", \"className\"])}\n    />\n  </MenuPrimitive.Portal>\n);\n",
      "type": "registry:ui"
    },
    {
      "path": "lib/audiocn-license.txt",
      "content": "Audio component source adapted from https://github.com/audiocn/ui.\nMIT License — Copyright (c) 2026 OrcDev\n\nRegular SVG icon geometry adapted from @phosphor-icons/react 2.1.10.\nMIT License — Copyright (c) 2020 Phosphor Icons\n\nThe following permission and warranty terms apply to both notices.\nRetain this file with copies or substantial portions of the source.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
      "type": "registry:file",
      "target": "@lib/audiocn-license.txt"
    }
  ],
  "type": "registry:ui"
}
