{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "cursor-arrow-rays",
  "title": "cursor-arrow-rays",
  "description": "Animated cursor-arrow-rays icon for React",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "files": [
    {
      "path": "cursor-arrow-rays.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 CursorArrowRaysIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface CursorArrowRaysIconProps 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 RAY_VARIANTS: Variants = {\n  normal: { opacity: 1, x: 0, y: 0 },\n  spread: (custom: { x: number; y: number }) => ({\n    opacity: [0, 1, 0, 0, 0, 0, 1],\n    x: [0, custom.x, 0, 0],\n    y: [0, custom.y, 0, 0],\n    transition: {\n      type: \"spring\",\n      stiffness: 70,\n      damping: 10,\n      mass: 0.4,\n    },\n  }),\n};\n\nconst CursorArrowRaysIcon = forwardRef<\n  CursorArrowRaysIconHandle,\n  CursorArrowRaysIconProps\n>(({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n  const cursorControls = useAnimation();\n  const rayControls = useAnimation();\n  const isControlledRef = useRef(false);\n\n  useImperativeHandle(ref, () => {\n    isControlledRef.current = true;\n\n    return {\n      startAnimation: () => {\n        cursorControls.start(\"animate\");\n        rayControls.start(\"spread\", { delay: 1.3 });\n      },\n      stopAnimation: () => {\n        cursorControls.start(\"normal\");\n        rayControls.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        rayControls.start(\"spread\", { delay: 1.3 });\n      }\n    },\n    [cursorControls, rayControls, 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        rayControls.start(\"normal\");\n      }\n    },\n    [cursorControls, rayControls, 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={rayControls}\n          custom={{ x: 0, y: -2 }}\n          d=\"M12 2.25V4.5\"\n          initial=\"normal\"\n          variants={RAY_VARIANTS}\n        />\n        <motion.path\n          animate={rayControls}\n          custom={{ x: 2, y: -2 }}\n          d=\"M17.8336 4.66637L16.2426 6.25736\"\n          initial=\"normal\"\n          variants={RAY_VARIANTS}\n        />\n        <motion.path\n          animate={rayControls}\n          custom={{ x: 2, y: 0 }}\n          d=\"M20.25 10.5H18\"\n          initial=\"normal\"\n          variants={RAY_VARIANTS}\n        />\n        <motion.path\n          animate={rayControls}\n          custom={{ x: -2, y: 2 }}\n          d=\"M7.75736 14.7426L6.16637 16.3336\"\n          initial=\"normal\"\n          variants={RAY_VARIANTS}\n        />\n        <motion.path\n          animate={rayControls}\n          custom={{ x: -2, y: 0 }}\n          d=\"M6 10.5H3.75\"\n          initial=\"normal\"\n          variants={RAY_VARIANTS}\n        />\n        <motion.path\n          animate={rayControls}\n          custom={{ x: -2, y: -2 }}\n          d=\"M7.75736 6.25736L6.16637 4.66637\"\n          initial=\"normal\"\n          variants={RAY_VARIANTS}\n        />\n      </svg>\n    </div>\n  );\n});\n\nCursorArrowRaysIcon.displayName = \"CursorArrowRaysIcon\";\n\nexport { CursorArrowRaysIcon };\n",
      "type": "registry:ui"
    }
  ]
}
