{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "radial-menu-orb",
  "type": "registry:ui",
  "title": "Radial Menu Orb",
  "author": "Rishabh Bose <https://theb0se.vercel.app/>",
  "description": "Floating command orb that blossoms into a 360-degree polar-coordinate action ring with staggered Hooke's Law spring trajectories.",
  "dependencies": [
    "framer-motion",
    "lucide-react",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "components/ui/radial-menu-orb.tsx",
      "content": "\"use client\";\n\nimport React, { useEffect, useState } from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"framer-motion\";\nimport {\n  Plus,\n  Sparkles,\n  Copy,\n  Share2,\n  Bookmark,\n  Terminal,\n} from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface RadialOrbAction {\n  id: string;\n  label: string;\n  icon: React.ReactNode;\n  onClick?: () => void;\n}\n\nexport interface RadialMenuOrbProps {\n  /** Array of satellite actions distributed along the polar ring. */\n  actions?: RadialOrbAction[];\n  /** Orbit radius in pixels from center trigger to satellite buttons. Default: 78 */\n  radius?: number;\n  /** Hooke's Law spring stiffness for radial blossom. Default: 340 */\n  stiffness?: number;\n  /** Spring damping coefficient for radial blossom. Default: 22 */\n  damping?: number;\n  /** Callback fired when an action is selected */\n  onSelect?: (id: string) => void;\n  className?: string;\n}\n\nconst DEFAULT_ACTIONS: RadialOrbAction[] = [\n  { id: \"inspect\", label: \"Inspect\", icon: <Sparkles className=\"h-4 w-4\" /> },\n  { id: \"cli\", label: \"Copy CLI\", icon: <Terminal className=\"h-4 w-4\" /> },\n  { id: \"duplicate\", label: \"Clone\", icon: <Copy className=\"h-4 w-4\" /> },\n  { id: \"bookmark\", label: \"Save\", icon: <Bookmark className=\"h-4 w-4\" /> },\n  { id: \"share\", label: \"Share\", icon: <Share2 className=\"h-4 w-4\" /> },\n];\n\nexport function RadialMenuOrb({\n  actions = DEFAULT_ACTIONS,\n  radius = 78,\n  stiffness = 340,\n  damping = 22,\n  onSelect,\n  className,\n}: RadialMenuOrbProps) {\n  const shouldReduceMotion = useReducedMotion() ?? false;\n  const [isOpen, setIsOpen] = useState(false);\n  const [lastSelected, setLastSelected] = useState<string>(\"Ready\");\n\n  useEffect(() => {\n    if (!isOpen) return;\n    const onKeyDown = (e: KeyboardEvent) => {\n      if (e.key === \"Escape\") {\n        setIsOpen(false);\n      }\n    };\n    window.addEventListener(\"keydown\", onKeyDown);\n    return () => window.removeEventListener(\"keydown\", onKeyDown);\n  }, [isOpen]);\n\n  return (\n    <div\n      className={cn(\n        \"relative flex min-h-[230px] w-full max-w-xs flex-col items-center justify-center\",\n        className\n      )}\n    >\n      {/* Orbital Ring Guide */}\n      <AnimatePresence>\n        {isOpen && (\n          <motion.div\n            aria-hidden=\"true\"\n            initial={{ scale: 0.4, opacity: 0 }}\n            animate={{ scale: 1, opacity: 1 }}\n            exit={{ scale: 0.4, opacity: 0 }}\n            transition={\n              shouldReduceMotion\n                ? { duration: 0 }\n                : { type: \"spring\", stiffness, damping }\n            }\n            style={{ width: radius * 2, height: radius * 2 }}\n            className=\"pointer-events-none absolute rounded-full border border-dashed border-neutral-300 dark:border-[#2A2A2A]\"\n          />\n        )}\n      </AnimatePresence>\n\n      {/* Polar Satellite Action Buttons */}\n      <AnimatePresence>\n        {isOpen &&\n          actions.map((action, index) => {\n            const angleDeg = (360 / actions.length) * index - 90;\n            const angleRad = (angleDeg * Math.PI) / 180;\n            const targetX = Math.cos(angleRad) * radius;\n            const targetY = Math.sin(angleRad) * radius;\n\n            return (\n              <motion.button\n                key={action.id}\n                type=\"button\"\n                aria-label={action.label}\n                initial={\n                  shouldReduceMotion\n                    ? { x: targetX, y: targetY, opacity: 1 }\n                    : { x: 0, y: 0, scale: 0.3, opacity: 0 }\n                }\n                animate={{ x: targetX, y: targetY, scale: 1, opacity: 1 }}\n                exit={\n                  shouldReduceMotion\n                    ? { opacity: 0 }\n                    : { x: 0, y: 0, scale: 0.3, opacity: 0 }\n                }\n                whileHover={shouldReduceMotion ? undefined : { scale: 1.14 }}\n                whileTap={shouldReduceMotion ? undefined : { scale: 0.92 }}\n                transition={\n                  shouldReduceMotion\n                    ? { duration: 0 }\n                    : {\n                        type: \"spring\",\n                        stiffness,\n                        damping,\n                        delay: index * 0.025,\n                      }\n                }\n                onClick={() => {\n                  setLastSelected(action.label);\n                  onSelect?.(action.id);\n                  action.onClick?.();\n                  setIsOpen(false);\n                }}\n                className=\"group absolute z-10 flex h-10 w-10 items-center justify-center rounded-full border border-neutral-200 bg-white text-black shadow-md transition-colors hover:border-black hover:bg-black hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-black dark:border-[#2A2A2A] dark:bg-[#121212] dark:text-white dark:hover:border-white dark:hover:bg-white dark:hover:text-black dark:focus-visible:ring-white\"\n              >\n                {action.icon}\n                <span className=\"pointer-events-none absolute -top-7 whitespace-nowrap rounded bg-black px-1.5 py-0.5 text-[10px] font-semibold text-white opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 dark:bg-white dark:text-black\">\n                  {action.label}\n                </span>\n              </motion.button>\n            );\n          })}\n      </AnimatePresence>\n\n      {/* Center Core Trigger Orb */}\n      <motion.button\n        type=\"button\"\n        aria-expanded={isOpen}\n        aria-label={isOpen ? \"Close radial command menu\" : \"Open radial command menu\"}\n        onClick={() => setIsOpen((prev) => !prev)}\n        whileTap={shouldReduceMotion ? undefined : { scale: 0.92 }}\n        className=\"relative z-20 flex h-14 w-14 items-center justify-center rounded-full border border-black bg-black text-white shadow-lg transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-black focus-visible:ring-offset-2 dark:border-white dark:bg-white dark:text-black dark:focus-visible:ring-white\"\n      >\n        <motion.span\n          animate={{ rotate: isOpen ? 135 : 0 }}\n          transition={\n            shouldReduceMotion\n              ? { duration: 0 }\n              : { type: \"spring\", stiffness: 360, damping: 22 }\n          }\n        >\n          <Plus className=\"h-5 w-5\" />\n        </motion.span>\n      </motion.button>\n\n      {/* Telemetry Status Readout */}\n      <div className=\"pointer-events-none absolute bottom-1 font-mono text-[11px] text-neutral-400 dark:text-neutral-500\">\n        {isOpen ? \"Select orbital node • Esc to close\" : `Action: ${lastSelected}`}\n      </div>\n    </div>\n  );\n}\n\nexport default RadialMenuOrb;\n",
      "type": "registry:ui",
      "target": "components/ui/radial-menu-orb.tsx"
    },
    {
      "path": "lib/utils.ts",
      "content": "import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport async function copyToClipboard(text: string): Promise<boolean> {\n  if (typeof window === \"undefined\") return false;\n\n  try {\n    if (navigator.clipboard && window.isSecureContext) {\n      await navigator.clipboard.writeText(text);\n      return true;\n    }\n\n    const textArea = document.createElement(\"textarea\");\n    textArea.value = text;\n    textArea.style.position = \"fixed\";\n    textArea.style.left = \"-999999px\";\n    textArea.style.top = \"-999999px\";\n    document.body.appendChild(textArea);\n    textArea.focus();\n    textArea.select();\n    const succeeded = document.execCommand(\"copy\");\n    textArea.remove();\n    return succeeded;\n  } catch {\n    return false;\n  }\n}\n",
      "type": "registry:lib",
      "target": "lib/utils.ts"
    }
  ]
}
