{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "video-camera",
  "title": "video-camera",
  "description": "Animated video-camera icon for React",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "files": [
    {
      "path": "video-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 VideoCameraIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface VideoCameraIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst CAMERA_VARIANTS: Variants = {\n  normal: {\n    scale: 1,\n  },\n  animate: {\n    scale: [1, 1.05, 1],\n    transition: {\n      duration: 0.4,\n      ease: \"easeInOut\",\n    },\n  },\n};\n\nconst RECORD_VARIANTS: Variants = {\n  normal: {\n    opacity: 0,\n  },\n  animate: {\n    opacity: [0, 1, 0, 1, 0],\n    transition: {\n      duration: 0.8,\n      ease: \"easeInOut\",\n    },\n  },\n};\n\nconst VideoCameraIcon = forwardRef<VideoCameraIconHandle, VideoCameraIconProps>(\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={CAMERA_VARIANTS}\n          viewBox=\"0 0 24 24\"\n          width={size}\n          xmlns=\"http://www.w3.org/2000/svg\"\n        >\n          <path d=\"M15.75 10.5L20.4697 5.78033C20.9421 5.30786 21.75 5.64248 21.75 6.31066V17.6893C21.75 18.3575 20.9421 18.6921 20.4697 18.2197L15.75 13.5M4.5 18.75H13.5C14.7426 18.75 15.75 17.7426 15.75 16.5V7.5C15.75 6.25736 14.7426 5.25 13.5 5.25H4.5C3.25736 5.25 2.25 6.25736 2.25 7.5V16.5C2.25 17.7426 3.25736 18.75 4.5 18.75Z\" />\n          <motion.circle\n            cx=\"5\"\n            cy=\"7.5\"\n            fill=\"red\"\n            initial=\"normal\"\n            r=\"1\"\n            stroke=\"none\"\n            variants={RECORD_VARIANTS}\n          />\n        </motion.svg>\n      </div>\n    );\n  }\n);\n\nVideoCameraIcon.displayName = \"VideoCameraIcon\";\n\nexport { VideoCameraIcon };\n",
      "type": "registry:ui"
    }
  ]
}
