{
  "name": "cai-animated-phone-forwarded",
  "type": "registry:ui",
  "description": "cai-animated-phone-forwarded component for the Canadian AI design system",
  "dependencies": [
    "motion"
  ],
  "files": [
    {
      "path": "components/lucide-animated/phone-forwarded.tsx",
      "target": "@components/lucide-animated/cai-animated-phone-forwarded.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 { motion, useAnimation, type Variants } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface PhoneForwardedIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface PhoneForwardedIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst PHONE_FORWARDED_VARIANTS: Variants = {\n  normal: {\n    rotate: 0,\n    scale: 1,\n  },\n  animate: {\n    scale: [1, 1.1, 1],\n    transition: {\n      duration: 0.9,\n      ease: \"easeInOut\",\n    },\n  },\n};\n\nconst HEAD_VARIANTS: Variants = {\n  normal: {\n    translateX: 0,\n  },\n  animate: {\n    translateX: [0, 3, 0],\n    transition: {\n      duration: 0.5,\n      ease: \"easeInOut\",\n    },\n  },\n};\n\nconst SHAFT_VARIANTS: Variants = {\n  normal: {\n    translateX: 0,\n    scale: 1,\n  },\n  animate: {\n    translateX: [0, 3, 0],\n    scale: [1, 0.85, 1],\n    originX: 1,\n    transition: {\n      duration: 0.5,\n      ease: \"easeInOut\",\n    },\n  },\n};\n\nconst PhoneForwardedIcon = forwardRef<\n  PhoneForwardedIconHandle,\n  PhoneForwardedIconProps\n>(({ onMouseEnter, onMouseLeave, className, size = 20, ...props }, ref) => {\n  const controls = useAnimation();\n  const isControlledRef = useRef(false);\n\n  useImperativeHandle(ref, () => {\n    isControlledRef.current = true;\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        initial=\"normal\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth={1.5}\n        style={{ overflow: \"visible\" }}\n        variants={PHONE_FORWARDED_VARIANTS}\n        viewBox=\"0 0 24 24\"\n        width={size}\n        xmlns=\"http://www.w3.org/2000/svg\"\n      >\n        <motion.path\n          animate={controls}\n          d=\"M14 6h8\"\n          initial=\"normal\"\n          variants={SHAFT_VARIANTS}\n        />\n        <motion.path\n          animate={controls}\n          d=\"m18 2 4 4-4 4\"\n          initial=\"normal\"\n          variants={HEAD_VARIANTS}\n        />\n\n        <path d=\"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384\" />\n      </motion.svg>\n    </div>\n  );\n});\n\nPhoneForwardedIcon.displayName = \"PhoneForwardedIcon\";\n\nexport { PhoneForwardedIcon };\n",
      "type": "registry:ui"
    }
  ]
}