{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "magnet-pill",
  "title": "Magnet Pill",
  "type": "registry:component",
  "description": "Label drifts toward the cursor, pill stretches back",
  "dependencies": [
    "motion@^12.43.0"
  ],
  "files": [
    {
      "path": "src/kavyn/magnet-pill.jsx",
      "type": "registry:file",
      "target": "@components/kavyn/magnet-pill.jsx",
      "content": "'use client'\n\nimport { useRef, useState } from 'react'\nimport { motion, useMotionValue, useSpring, useTransform } from 'motion/react'\n\nexport default function MagnetPill({ children = 'Subscribe', pull = 0.35, className = 'p-10' }) {\n  const ref = useRef(null)\n  const x = useMotionValue(0), y = useMotionValue(0)\n  const sx = useSpring(x, { stiffness: 260, damping: 16, mass: 0.6 })\n  const sy = useSpring(y, { stiffness: 260, damping: 16, mass: 0.6 })\n  const stretch = useTransform(sx, (v) => 1 + Math.min(Math.abs(v) / 180, 0.12))\n  const lx = useTransform(sx, (v) => v * 0.6), ly = useTransform(sy, (v) => v * 0.6)\n  const [done, setDone] = useState(false)\n\n  const move = (e) => {\n    const r = ref.current.getBoundingClientRect()\n    x.set((e.clientX - (r.left + r.width / 2)) * pull)\n    y.set((e.clientY - (r.top + r.height / 2)) * pull)\n  }\n  const leave = () => { x.set(0); y.set(0) }\n\n  return (\n    <div onPointerMove={move} onPointerLeave={leave} className={`grid place-items-center ${className}`}>\n      <motion.button\n        ref={ref}\n        onClick={() => { setDone(true); setTimeout(() => setDone(false), 1600) }}\n        style={{ x: sx, y: sy, scaleX: stretch }}\n        whileTap={{ scale: 0.94 }}\n        className=\"h-12 rounded-full bg-tx px-8 text-sm font-medium text-bg\"\n      >\n        <motion.span style={{ x: lx, y: ly }} className=\"inline-block\">\n          {done ? 'You are in' : children}\n        </motion.span>\n      </motion.button>\n    </div>\n  )\n}\n"
    }
  ],
  "cssVars": {
    "theme": {
      "color-bg": "var(--bg)",
      "color-panel": "var(--panel)",
      "color-panel2": "var(--panel2)",
      "color-line": "var(--line)",
      "color-line2": "var(--line2)",
      "color-tx": "var(--tx)",
      "color-mute": "var(--mute)",
      "color-faint": "var(--faint)",
      "color-acc": "var(--acc)",
      "color-acc-fg": "var(--acc-fg)"
    },
    "light": {
      "bg": "#ffffff",
      "panel": "#f5f5f7",
      "panel2": "#e8e8ed",
      "line": "#e5e5ea",
      "line2": "#d2d2d7",
      "tx": "#1d1d1f",
      "mute": "#6e6e73",
      "faint": "#a1a1a6",
      "acc": "#1d1d1f",
      "acc-fg": "#ffffff"
    },
    "dark": {
      "bg": "#000000",
      "panel": "#141416",
      "panel2": "#1f1f22",
      "line": "#262628",
      "line2": "#3a3a3d",
      "tx": "#f5f5f7",
      "mute": "#a1a1a6",
      "faint": "#6e6e73",
      "acc": "#f5f5f7",
      "acc-fg": "#000000"
    }
  },
  "css": {
    ".light": {
      "--bg": "#ffffff",
      "--panel": "#f5f5f7",
      "--panel2": "#e8e8ed",
      "--line": "#e5e5ea",
      "--line2": "#d2d2d7",
      "--tx": "#1d1d1f",
      "--mute": "#6e6e73",
      "--faint": "#a1a1a6",
      "--acc": "#1d1d1f",
      "--acc-fg": "#ffffff"
    }
  }
}
