{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "cursor-arrow-ripple",
  "title": "cursor-arrow-ripple",
  "description": "Animated cursor-arrow-ripple icon for React",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "files": [
    {
      "path": "cursor-arrow-ripple.tsx",
      "content": "\"use client\";\n\nimport type { Variants } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface CursorArrowRippleIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface CursorArrowRippleIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst CURSOR_VARIANTS: Variants = {\n  normal: { x: 0, y: 0 },\n  animate: {\n    x: [0, 0, -3, 0],\n    y: [0, -4, 0, 0],\n    transition: {\n      duration: 1,\n      bounce: 0.3,\n    },\n  },\n};\n\nconst RIPPLE_VARIANTS: Variants = {\n  normal: {\n    opacity: 1,\n  },\n  ripple: (custom: number) => ({\n    opacity: [0, 1],\n    transition: {\n      duration: 0.3,\n      delay: 1 + custom * 0.3, // Start after cursor animation (1s) + stagger\n      ease: \"easeOut\",\n    },\n  }),\n};\n\nconst CursorArrowRippleIcon = forwardRef<\n  CursorArrowRippleIconHandle,\n  CursorArrowRippleIconProps\n>(({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n  const cursorControls = useAnimation();\n  const rippleControls = useAnimation();\n  const isControlledRef = useRef(false);\n\n  useImperativeHandle(ref, () => {\n    isControlledRef.current = true;\n\n    return {\n      startAnimation: () => {\n        cursorControls.start(\"animate\");\n        rippleControls.start(\"ripple\");\n      },\n      stopAnimation: () => {\n        cursorControls.start(\"normal\");\n        rippleControls.start(\"normal\");\n      },\n    };\n  });\n\n  const handleMouseEnter = useCallback(\n    (e: React.MouseEvent<HTMLDivElement>) => {\n      if (isControlledRef.current) {\n        onMouseEnter?.(e);\n      } else {\n        cursorControls.start(\"animate\");\n        rippleControls.start(\"ripple\");\n      }\n    },\n    [cursorControls, rippleControls, onMouseEnter]\n  );\n\n  const handleMouseLeave = useCallback(\n    (e: React.MouseEvent<HTMLDivElement>) => {\n      if (isControlledRef.current) {\n        onMouseLeave?.(e);\n      } else {\n        cursorControls.start(\"normal\");\n        rippleControls.start(\"normal\");\n      }\n    },\n    [cursorControls, rippleControls, onMouseLeave]\n  );\n\n  return (\n    <div\n      className={cn(className)}\n      onMouseEnter={handleMouseEnter}\n      onMouseLeave={handleMouseLeave}\n      {...props}\n    >\n      <svg\n        fill=\"none\"\n        height={size}\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.5\"\n        viewBox=\"0 0 24 24\"\n        width={size}\n        xmlns=\"http://www.w3.org/2000/svg\"\n      >\n        <motion.path\n          animate={cursorControls}\n          d=\"M15.0423 21.6718L13.6835 16.6007M13.6835 16.6007L11.1741 18.826L11.7425 9.35623L16.9697 17.2731L13.6835 16.6007Z\"\n          initial=\"normal\"\n          variants={CURSOR_VARIANTS}\n        />\n        <motion.path\n          animate={rippleControls}\n          custom={1}\n          d=\"M6.16637 16.3336C2.94454 13.1118 2.94454 7.88819 6.16637 4.66637C9.38819 1.44454 14.6118 1.44454 17.8336 4.66637C19.4445 6.27724 20.25 8.38854 20.25 10.4999\"\n          initial=\"normal\"\n          variants={RIPPLE_VARIANTS}\n        />\n        <motion.path\n          animate={rippleControls}\n          custom={0}\n          d=\"M8.28769 14.2123C6.23744 12.1621 6.23744 8.83794 8.28769 6.78769C10.3379 4.73744 13.6621 4.73744 15.7123 6.78769C16.7374 7.8128 17.25 9.15637 17.25 10.4999\"\n          initial=\"normal\"\n          variants={RIPPLE_VARIANTS}\n        />\n      </svg>\n    </div>\n  );\n});\n\nCursorArrowRippleIcon.displayName = \"CursorArrowRippleIcon\";\n\nexport { CursorArrowRippleIcon };\n",
      "type": "registry:ui"
    }
  ]
}
