{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ripple-burst-button",
  "type": "registry:ui",
  "title": "Ripple Burst Button",
  "author": "Rishabh Bose <https://theb0se.vercel.app/>",
  "description": "Tactile impulse button that spawns dual concentric shockwave rings from the exact pointer click coordinate with spring recoil.",
  "dependencies": [
    "framer-motion",
    "lucide-react",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "components/ui/ripple-burst-button.tsx",
      "content": "\"use client\";\n\nimport React, { useRef, useState } from \"react\";\nimport { motion, useReducedMotion } from \"framer-motion\";\nimport { Zap } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface RippleBurstButtonProps {\n  /** Button label text. Default: \"Emit Shockwave Pulse\" */\n  label?: string;\n  /** Spring stiffness coefficient for tactile press compression. Default: 400 */\n  stiffness?: number;\n  /** Spring damping coefficient for tactile press compression. Default: 22 */\n  damping?: number;\n  /** Click callback */\n  onClick?: () => void;\n  className?: string;\n}\n\ninterface RippleWave {\n  id: number;\n  x: number;\n  y: number;\n}\n\nexport function RippleBurstButton({\n  label = \"Emit Shockwave Pulse\",\n  stiffness = 400,\n  damping = 22,\n  onClick,\n  className,\n}: RippleBurstButtonProps) {\n  const shouldReduceMotion = useReducedMotion() ?? false;\n  const btnRef = useRef<HTMLButtonElement | null>(null);\n  const [waves, setWaves] = useState<RippleWave[]>([]);\n  const [pulseCount, setPulseCount] = useState(0);\n\n  const handleTrigger = (e: React.MouseEvent<HTMLButtonElement>) => {\n    const el = btnRef.current;\n    if (el && !shouldReduceMotion) {\n      const rect = el.getBoundingClientRect();\n      const x = e.clientX ? e.clientX - rect.left : rect.width / 2;\n      const y = e.clientY ? e.clientY - rect.top : rect.height / 2;\n      const id = Date.now() + Math.random();\n      setWaves((prev) => [...prev.slice(-3), { id, x, y }]);\n    }\n    setPulseCount((c) => c + 1);\n    onClick?.();\n  };\n\n  return (\n    <motion.button\n      ref={btnRef}\n      type=\"button\"\n      onClick={handleTrigger}\n      whileHover={shouldReduceMotion ? undefined : { scale: 1.03, y: -2 }}\n      whileTap={shouldReduceMotion ? undefined : { scale: 0.95 }}\n      transition={{ type: \"spring\", stiffness, damping }}\n      className={cn(\n        \"relative inline-flex h-12 items-center justify-center gap-2.5 overflow-hidden rounded-2xl border border-black bg-black px-6 text-xs font-semibold text-white shadow-sm 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        className\n      )}\n    >\n      {/* Concentric Dual Shockwave Rings */}\n      {!shouldReduceMotion &&\n        waves.map((wave) => (\n          <React.Fragment key={wave.id}>\n            <motion.span\n              aria-hidden=\"true\"\n              initial={{ scale: 0, opacity: 0.65 }}\n              animate={{ scale: 4.5, opacity: 0 }}\n              transition={{ duration: 0.65, ease: \"easeOut\" }}\n              style={{ left: wave.x - 24, top: wave.y - 24 }}\n              className=\"pointer-events-none absolute h-12 w-12 rounded-full bg-white/35 dark:bg-black/25\"\n            />\n            <motion.span\n              aria-hidden=\"true\"\n              initial={{ scale: 0, opacity: 0.8 }}\n              animate={{ scale: 3.2, opacity: 0 }}\n              transition={{ duration: 0.55, delay: 0.06, ease: \"easeOut\" }}\n              style={{ left: wave.x - 24, top: wave.y - 24 }}\n              className=\"pointer-events-none absolute h-12 w-12 rounded-full border border-white/60 dark:border-black/50\"\n            />\n          </React.Fragment>\n        ))}\n\n      <Zap className=\"relative z-10 h-4 w-4\" />\n      <span className=\"relative z-10\">{label}</span>\n      {pulseCount > 0 && (\n        <span className=\"relative z-10 rounded-full bg-white/20 px-1.5 py-0.5 font-mono text-[10px] dark:bg-black/15\">\n          ×{pulseCount}\n        </span>\n      )}\n    </motion.button>\n  );\n}\n\nexport default RippleBurstButton;\n",
      "type": "registry:ui",
      "target": "components/ui/ripple-burst-button.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"
    }
  ]
}
