{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "magnetic-cta",
  "type": "registry:component",
  "title": "Magnetic cta",
  "description": "A magnetic button that drifts toward the cursor on a spring and snaps back on leave. Takes all Button props plus a strength value; static for reduced motion.",
  "dependencies": [
    "motion"
  ],
  "registryDependencies": [
    "https://ui.minidev.pro/r/button.json",
    "utils"
  ],
  "files": [
    {
      "path": "registry/premium/magnetic-cta.tsx",
      "type": "registry:ui",
      "target": "components/ui/magnetic-cta.tsx",
      "content": "\"use client\"\nimport * as React from \"react\"\nimport { motion, useMotionValue, useSpring, useReducedMotion } from \"motion/react\"\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\nfunction MagneticCta({\n  children = \"Get started\",\n  className,\n  strength = 28,\n  ...props\n}: React.ComponentProps<typeof Button> & { strength?: number }) {\n  const reduce = useReducedMotion()\n  const x = useMotionValue(0)\n  const y = useMotionValue(0)\n  const sx = useSpring(x, { stiffness: 220, damping: 18, mass: 0.4 })\n  const sy = useSpring(y, { stiffness: 220, damping: 18, mass: 0.4 })\n  const ref = React.useRef<HTMLDivElement>(null)\n\n  const onMove = (e: React.MouseEvent) => {\n    if (reduce || !ref.current) return\n    const r = ref.current.getBoundingClientRect()\n    const dx = e.clientX - (r.left + r.width / 2)\n    const dy = e.clientY - (r.top + r.height / 2)\n    x.set((dx / (r.width / 2)) * strength)\n    y.set((dy / (r.height / 2)) * strength)\n  }\n\n  return (\n    <motion.div\n      data-slot=\"magnetic-cta\"\n      data-tier=\"premium\"\n      ref={ref}\n      onMouseMove={onMove}\n      onMouseLeave={() => { x.set(0); y.set(0) }}\n      style={reduce ? undefined : { x: sx, y: sy }}\n      className={cn(\"inline-flex\", className)}>\n      <Button type=\"button\" className=\"w-full\" {...props}>{children}</Button>\n    </motion.div>\n  )\n}\nexport { MagneticCta }\n"
    }
  ]
}
