{ "name": "bulb-icon", "type": "registry:ui", "registryDependencies": [], "dependencies": [ "motion", "lucide-react" ], "devDependencies": [], "tailwind": {}, "cssVars": { "light": {}, "dark": {} }, "files": [ { "path": "bulb-icon.tsx", "content": "'use client';\n\nimport { motion, useAnimation } from 'motion/react';\nimport { Lightbulb } from 'lucide-react';\nimport { cn } from '@/lib/utils';\nimport { useEffect, useState } from 'react';\n\ninterface BulbIconProps {\n className?: string;\n color?: string;\n size?: number;\n isLit?: boolean;\n startOnHover?: boolean;\n animationType?: 'pulse' | 'flash';\n}\n\nexport function BulbIcon({\n className,\n color = 'currentColor',\n size = 24,\n isLit = false,\n startOnHover = true,\n animationType = 'pulse',\n}: BulbIconProps) {\n const controls = useAnimation();\n const [isHovered, setIsHovered] = useState(false);\n const shouldAnimate = isLit || (startOnHover && isHovered);\n\n useEffect(() => {\n if (shouldAnimate) {\n if (animationType === 'pulse') {\n controls.start({\n scale: [1, 1.1, 1],\n opacity: [1, 0.8, 1],\n transition: {\n duration: 1.5,\n repeat: Infinity,\n repeatType: 'loop',\n ease: 'easeInOut',\n },\n });\n } else if (animationType === 'flash') {\n controls.start({\n opacity: [1, 0.2, 1],\n transition: {\n duration: 0.5,\n repeat: Infinity,\n repeatType: 'reverse',\n ease: 'linear',\n },\n });\n }\n } else {\n controls.stop();\n controls.set({ scale: 1, opacity: 1 });\n }\n }, [shouldAnimate, animationType, controls]);\n\n return (\n setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n {shouldAnimate && (\n \n )}\n \n \n \n \n );\n}\n", "type": "registry:ui" } ] }