{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "phone-forwarded",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "devDependencies": [],
  "files": [
    {
      "path": "phone-forwarded.tsx",
      "content": "\"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 = 28, ...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=\"2\"\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"
    }
  ]
}
