{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "light-bulb",
  "title": "light-bulb",
  "description": "Animated light-bulb icon for React",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "files": [
    {
      "path": "light-bulb.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 LightBulbIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface LightBulbIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst BULB_VARIANTS: Variants = {\n  normal: {\n    fillOpacity: 0,\n    fill: \"currentColor\",\n  },\n  animate: {\n    fillOpacity: [0, 1, 0, 1, 0],\n    transition: {\n      duration: 0.6,\n      ease: \"easeInOut\",\n      times: [0, 0.25, 0.5, 0.75, 1],\n    },\n  },\n};\n\nconst LightBulbIcon = forwardRef<LightBulbIconHandle, LightBulbIconProps>(\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        <svg\n          fill=\"none\"\n          height={size}\n          stroke=\"currentColor\"\n          strokeLinecap=\"round\"\n          strokeLinejoin=\"round\"\n          strokeWidth=\"1.5\"\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.25 18V17.8083C14.25 16.8254 14.9083 15.985 15.7585 15.4917C17.9955 14.1938 19.5 11.7726 19.5 9C19.5 4.85786 16.1421 1.5 12 1.5C7.85786 1.5 4.5 4.85786 4.5 9C4.5 11.7726 6.00446 14.1938 8.24155 15.4917C9.09173 15.985 9.75 16.8254 9.75 17.8083V18\"\n            initial=\"normal\"\n            variants={BULB_VARIANTS}\n          />\n          <path d=\"M12 18V12.75M12 12.75C12.5179 12.75 13.0206 12.6844 13.5 12.561M12 12.75C11.4821 12.75 10.9794 12.6844 10.5 12.561\" />\n          <path d=\"M14.25 20.0394C13.5212 20.1777 12.769 20.25 12 20.25C11.231 20.25 10.4788 20.1777 9.75 20.0394\" />\n          <path d=\"M13.5 22.422C13.007 22.4736 12.5066 22.5 12 22.5C11.4934 22.5 10.993 22.4736 10.5 22.422\" />\n        </svg>\n      </div>\n    );\n  }\n);\n\nLightBulbIcon.displayName = \"LightBulbIcon\";\n\nexport { LightBulbIcon };\n",
      "type": "registry:ui"
    }
  ]
}
