{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "camera",
  "title": "camera",
  "description": "Animated camera icon for React",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "files": [
    {
      "path": "camera.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\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface CameraIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface CameraIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst BODY_VARIANTS: Variants = {\n  normal: { scale: 1 },\n  animate: {\n    scale: [1, 0.95, 1],\n    transition: {\n      duration: 0.3,\n      ease: \"easeInOut\",\n    },\n  },\n};\n\nconst LENS_VARIANTS: Variants = {\n  normal: { scale: 1, opacity: 1 },\n  animate: {\n    scale: [1, 1.1, 1],\n    opacity: [1, 0.6, 1],\n    transition: {\n      duration: 0.3,\n      ease: \"easeInOut\",\n    },\n  },\n};\n\nconst CameraIcon = forwardRef<CameraIconHandle, CameraIconProps>(\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          initial=\"normal\"\n          stroke=\"currentColor\"\n          strokeLinecap=\"round\"\n          strokeLinejoin=\"round\"\n          strokeWidth=\"1.5\"\n          variants={BODY_VARIANTS}\n          viewBox=\"0 0 24 24\"\n          width={size}\n          xmlns=\"http://www.w3.org/2000/svg\"\n        >\n          <path d=\"M6.827 6.175A2.31 2.31 0 0 1 5.186 7.23c-.38.054-.757.112-1.134.175C2.999 7.58 2.25 8.507 2.25 9.574V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9.574c0-1.067-.75-1.994-1.802-2.169a47.865 47.865 0 0 0-1.134-.175 2.31 2.31 0 0 1-1.64-1.055l-.822-1.316a2.192 2.192 0 0 0-1.736-1.039 48.774 48.774 0 0 0-5.232 0 2.192 2.192 0 0 0-1.736 1.039l-.821 1.316Z\" />\n          <motion.path\n            d=\"M16.5 12.75a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0ZM18.75 10.5h.008v.008h-.008V10.5Z\"\n            style={{ transformOrigin: \"12px 12.75px\" }}\n            variants={LENS_VARIANTS}\n          />\n        </motion.svg>\n      </div>\n    );\n  }\n);\n\nCameraIcon.displayName = \"CameraIcon\";\n\nexport { CameraIcon };\n",
      "type": "registry:ui"
    }
  ]
}
