{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "spray-can",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "devDependencies": [],
  "files": [
    {
      "path": "spray-can.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\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport interface SprayCanIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface SprayCanIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst SPRAY_DOT_VARIANTS: Variants = {\n  normal: {\n    opacity: 1,\n    transition: { duration: 0.2 },\n  },\n  animate: (index: number) => ({\n    opacity: [0, 1, 0],\n    transition: {\n      delay: index * 0.07,\n      duration: 1.05 + index * 0.06,\n      repeat: Number.POSITIVE_INFINITY,\n      ease: \"easeInOut\",\n      times: [0, 0.45, 1],\n    },\n  }),\n};\n\nconst DOT_PATHS_RTL = [\n  { d: \"M11 7h.01\", key: \"dot-3\" },\n  { d: \"M7 5h.01\", key: \"dot-2\" },\n  { d: \"M7 9h.01\", key: \"dot-5\" },\n  { d: \"M3 3h.01\", key: \"dot-1\" },\n  { d: \"M3 7h.01\", key: \"dot-4\" },\n  { d: \"M3 11h.01\", key: \"dot-6\" },\n] as const;\n\nconst SprayCanIcon = forwardRef<SprayCanIconHandle, SprayCanIconProps>(\n  ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n    const controls = useAnimation();\n    const isAnimatingRef = useRef(false);\n\n    const isRefControlled = ref != null;\n\n    const startAnimation = useCallback(() => {\n      if (isAnimatingRef.current) return;\n      isAnimatingRef.current = true;\n      controls.start(\"animate\").catch(() => {\n        // ignore when interrupted by a new animation\n      });\n    }, [controls]);\n\n    const stopAnimation = useCallback(async () => {\n      isAnimatingRef.current = false;\n      await controls.start(\"normal\");\n    }, [controls]);\n\n    useImperativeHandle(\n      ref,\n      () => ({\n        startAnimation,\n        stopAnimation,\n      }),\n      [startAnimation, stopAnimation]\n    );\n\n    const handleMouseEnter = useCallback(\n      (e: React.MouseEvent<HTMLDivElement>) => {\n        if (isRefControlled) {\n          onMouseEnter?.(e);\n        } else {\n          startAnimation();\n        }\n      },\n      [isRefControlled, startAnimation, onMouseEnter]\n    );\n\n    const handleMouseLeave = useCallback(\n      (e: React.MouseEvent<HTMLDivElement>) => {\n        if (isRefControlled) {\n          onMouseLeave?.(e);\n        } else {\n          stopAnimation();\n        }\n      },\n      [isRefControlled, stopAnimation, onMouseLeave]\n    );\n\n    return (\n      <div\n        className={cn(\"inline-flex items-center justify-center\", 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=\"2\"\n          viewBox=\"0 0 24 24\"\n          width={size}\n          xmlns=\"http://www.w3.org/2000/svg\"\n        >\n          <rect height=\"4\" width=\"4\" x=\"15\" y=\"5\" />\n          <path d=\"m19 9 2 2v10c0 .6-.4 1-1 1h-6c-.6 0-1-.4-1-1V11l2-2\" />\n          <path d=\"m13 14 8-2\" />\n          <path d=\"m13 19 8-2\" />\n          <g>\n            {DOT_PATHS_RTL.map((item, index) => (\n              <motion.path\n                animate={controls}\n                custom={index}\n                d={item.d}\n                initial=\"normal\"\n                key={item.key}\n                variants={SPRAY_DOT_VARIANTS}\n              />\n            ))}\n          </g>\n        </svg>\n      </div>\n    );\n  }\n);\n\nSprayCanIcon.displayName = \"SprayCanIcon\";\n\nexport { SprayCanIcon };\n",
      "type": "registry:ui"
    }
  ]
}
