{
  "name": "cai-animated-spray-can",
  "type": "registry:ui",
  "description": "cai-animated-spray-can component for the Canadian AI design system",
  "dependencies": [
    "motion"
  ],
  "files": [
    {
      "path": "components/lucide-animated/spray-can.tsx",
      "target": "@components/lucide-animated/cai-animated-spray-can.tsx",
      "content": "/*\nMIT License\n\nCopyright (c) 2024-2026 pqoqubbw\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\"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 = 20, ...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={1.5}\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"
    }
  ]
}