{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "projector",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "devDependencies": [],
  "files": [
    {
      "path": "projector.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 } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface ProjectorIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface ProjectorIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst RAY_LINE_VARIANTS: Variants = {\n  hidden: {\n    pathLength: 0,\n    opacity: 0,\n  },\n  animate: {\n    pathLength: 1,\n    opacity: 1,\n    transition: {\n      duration: 0.4,\n      ease: \"easeOut\",\n    },\n  },\n  visible: {\n    pathLength: 1,\n    opacity: 1,\n  },\n};\n\nconst PROJECTOR_BODY_VARIANTS: Variants = {\n  normal: {\n    scale: 1,\n    y: 0,\n  },\n  animate: {\n    scale: [1, 1.08, 1],\n    y: [0, -1, 0],\n    transition: {\n      duration: 0.8,\n      ease: \"easeInOut\",\n    },\n  },\n};\n\nconst ProjectorIcon = forwardRef<ProjectorIconHandle, ProjectorIconProps>(\n  ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n    const pathControls = useAnimation();\n    const bodyControls = useAnimation();\n    const isRefControlled = ref != null;\n\n    const startAll = useCallback(async () => {\n      bodyControls.start(\"animate\").catch(() => {\n        // ignore when interrupted by a new animation\n      });\n      await pathControls.start(\"hidden\");\n      await pathControls.start(\"animate\");\n    }, [bodyControls, pathControls]);\n\n    const stopAll = useCallback(() => {\n      bodyControls.start(\"normal\").catch(() => {\n        // ignore when interrupted\n      });\n      pathControls.start(\"visible\").catch(() => {\n        // ignore when interrupted\n      });\n    }, [bodyControls, pathControls]);\n\n    useImperativeHandle(\n      ref,\n      () => ({\n        startAnimation: () => {\n          startAll().catch(() => {\n            // ignore when interrupted\n          });\n        },\n        stopAnimation: () => stopAll(),\n      }),\n      [startAll, stopAll]\n    );\n\n    const handleMouseEnter = useCallback(\n      async (e: React.MouseEvent<HTMLDivElement>) => {\n        if (isRefControlled) {\n          onMouseEnter?.(e);\n        } else {\n          await startAll();\n        }\n      },\n      [isRefControlled, onMouseEnter, startAll]\n    );\n\n    const handleMouseLeave = useCallback(\n      (e: React.MouseEvent<HTMLDivElement>) => {\n        if (isRefControlled) {\n          onMouseLeave?.(e);\n        } else {\n          stopAll();\n        }\n      },\n      [isRefControlled, onMouseLeave, stopAll]\n    );\n\n    return (\n      <div\n        className={cn(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=\"2\"\n          viewBox=\"0 0 24 24\"\n          width={size}\n          xmlns=\"http://www.w3.org/2000/svg\"\n        >\n          <motion.path\n            animate={pathControls}\n            d=\"M5 7 3 5\"\n            initial=\"visible\"\n            variants={RAY_LINE_VARIANTS}\n          />\n          <motion.path\n            animate={pathControls}\n            d=\"M9 6V3\"\n            initial=\"visible\"\n            variants={RAY_LINE_VARIANTS}\n          />\n          <motion.path\n            animate={pathControls}\n            d=\"m13 7 2-2\"\n            initial=\"visible\"\n            variants={RAY_LINE_VARIANTS}\n          />\n          <motion.g\n            animate={bodyControls}\n            initial=\"normal\"\n            variants={PROJECTOR_BODY_VARIANTS}\n          >\n            <circle cx=\"9\" cy=\"13\" r=\"3\" />\n            <path d=\"M11.83 12H20a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h2.17\" />\n            <path d=\"M16 16h2\" />\n          </motion.g>\n        </svg>\n      </div>\n    );\n  }\n);\n\nProjectorIcon.displayName = \"ProjectorIcon\";\n\nexport { ProjectorIcon };\n",
      "type": "registry:ui"
    }
  ]
}
