{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "rabbit",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "devDependencies": [],
  "files": [
    {
      "path": "rabbit.tsx",
      "content": "\"use client\";\n\nimport type { Transition, Variants } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport interface RabbitIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface RabbitIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst TRANSITION: Transition = {\n  duration: 0.6,\n  ease: [0.42, 0, 0.58, 1],\n};\n\nconst SPEED_VARIANTS: Variants = {\n  normal: {\n    rotate: 0,\n    x: 0,\n    y: 0,\n  },\n  animate: {\n    rotate: [0, 5, -5, 3, -3, 0],\n    x: [0, 3, -3, 2, -2, 0],\n    y: [0, 1.5, -1.5, 1, -1, 0],\n    transition: TRANSITION,\n  },\n};\n\nconst RabbitIcon = forwardRef<RabbitIconHandle, RabbitIconProps>(\n  ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n    const controls = useAnimation();\n    const isControlledRef = useRef(false);\n\n    useImperativeHandle(ref, () => {\n      isControlledRef.current = true;\n\n      return {\n        startAnimation: () => controls.start(\"animate\"),\n        stopAnimation: () => controls.start(\"normal\"),\n      };\n    });\n\n    const handleMouseEnter = useCallback(\n      (e: React.MouseEvent<HTMLDivElement>) => {\n        if (isControlledRef.current) {\n          onMouseEnter?.(e);\n        } else {\n          controls.start(\"animate\");\n        }\n      },\n      [controls, onMouseEnter]\n    );\n\n    const handleMouseLeave = useCallback(\n      (e: React.MouseEvent<HTMLDivElement>) => {\n        if (isControlledRef.current) {\n          onMouseLeave?.(e);\n        } else {\n          controls.start(\"normal\");\n        }\n      },\n      [controls, onMouseLeave]\n    );\n\n    return (\n      <div\n        className={cn(className)}\n        onMouseEnter={handleMouseEnter}\n        onMouseLeave={handleMouseLeave}\n        {...props}\n      >\n        <motion.svg\n          animate={controls}\n          fill=\"none\"\n          height={size}\n          stroke=\"currentColor\"\n          strokeLinecap=\"round\"\n          strokeLinejoin=\"round\"\n          strokeWidth=\"2\"\n          variants={SPEED_VARIANTS}\n          viewBox=\"0 0 24 24\"\n          width={size}\n          xmlns=\"http://www.w3.org/2000/svg\"\n        >\n          <path d=\"M18 21h-8a4 4 0 0 1-4-4 7 7 0 0 1 7-7h.2L9.6 6.4a1 1 0 1 1 2.8-2.8L15.8 7h.2c3.3 0 6 2.7 6 6v1a2 2 0 0 1-2 2h-1a3 3 0 0 0-3 3\" />\n          <path d=\"M13 16a3 3 0 0 1 2.24 5\" />\n          <path d=\"M18 12h.01\" />\n          <path d=\"M20 8.54V4a2 2 0 1 0-4 0v3\" />\n          <path d=\"M7.612 12.524a3 3 0 1 0-1.6 4.3\" />\n        </motion.svg>\n      </div>\n    );\n  }\n);\n\nRabbitIcon.displayName = \"RabbitIcon\";\n\nexport { RabbitIcon };\n",
      "type": "registry:ui"
    }
  ]
}
