{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "lens-loupe",
  "title": "Lens Loupe",
  "type": "registry:component",
  "description": "Magnifier follows the cursor with live zoom",
  "dependencies": [
    "motion@^12.43.0"
  ],
  "files": [
    {
      "path": "src/kavyn/lens-loupe.jsx",
      "type": "registry:file",
      "target": "@components/kavyn/lens-loupe.jsx",
      "content": "'use client'\n\nimport { useRef, useState } from 'react'\nimport { motion, useMotionValue, useSpring, useTransform } from 'motion/react'\n\nfunction Product() {\n  return (\n    <div className=\"relative size-full bg-[radial-gradient(circle_at_50%_40%,var(--line2),var(--panel)_70%)]\">\n      <div className=\"absolute left-1/2 top-1/2 h-[46%] w-[62%] -translate-x-1/2 -translate-y-1/2 -rotate-12 rounded-[40%_60%_30%_30%/50%_50%_20%_20%] bg-gradient-to-br from-[#ededef] to-[#8a8a93] shadow-2xl\">\n        <div className=\"absolute bottom-[12%] left-[8%] right-[6%] h-[16%] rounded-full bg-acc\" />\n        <div className=\"absolute left-[30%] top-[22%] h-[30%] w-[34%] rounded-[50%] border-[3px] border-dashed border-faint\" />\n        {Array.from({ length: 5 }).map((_, i) => (\n          <div key={i} className=\"absolute h-[3px] w-[10%] rounded bg-faint\" style={{ left: `${32 + i * 7}%`, top: `${30 + i * 4}%` }} />\n        ))}\n      </div>\n      <div className=\"absolute bottom-4 left-4 font-mono text-[10px] text-faint\">RUNNER 02 / CLAY</div>\n    </div>\n  )\n}\n\nexport default function LensLoupe({ zoom = 2.4, size = 130 }) {\n  const ref = useRef(null)\n  const [on, setOn] = useState(false)\n  const [box, setBox] = useState({ w: 1, h: 1 })\n  const x = useMotionValue(0), y = useMotionValue(0)\n  const sx = useSpring(x, { stiffness: 500, damping: 40 }), sy = useSpring(y, { stiffness: 500, damping: 40 })\n  const ix = useTransform(sx, (v) => -v * zoom + size / 2), iy = useTransform(sy, (v) => -v * zoom + size / 2)\n  const lx = useTransform(sx, (v) => v - size / 2), ly = useTransform(sy, (v) => v - size / 2)\n  return (\n    <div\n      ref={ref}\n      onPointerEnter={() => { const r = ref.current.getBoundingClientRect(); setBox({ w: r.width, h: r.height }); setOn(true) }}\n      onPointerLeave={() => setOn(false)}\n      onPointerMove={(e) => { const r = ref.current.getBoundingClientRect(); x.set(e.clientX - r.left); y.set(e.clientY - r.top) }}\n      className=\"relative aspect-[4/3] w-full max-w-sm cursor-none overflow-hidden rounded-2xl border border-line\"\n    >\n      <Product />\n      <motion.div\n        style={{ x: lx, y: ly, width: size, height: size }}\n        animate={{ scale: on ? 1 : 0, opacity: on ? 1 : 0 }}\n        transition={{ type: 'spring', stiffness: 400, damping: 28 }}\n        className=\"pointer-events-none absolute left-0 top-0 overflow-hidden rounded-full border-2 border-tx/80 shadow-[0_10px_40px_rgba(0,0,0,.6)]\"\n      >\n        <motion.div style={{ x: ix, y: iy, width: box.w * zoom, height: box.h * zoom }} className=\"absolute left-0 top-0\">\n          <div style={{ width: box.w, height: box.h, transform: `scale(${zoom})`, transformOrigin: '0 0' }}><Product /></div>\n        </motion.div>\n      </motion.div>\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"
    }
  }
}
