{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "wifi",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "devDependencies": [],
  "files": [
    {
      "path": "wifi.tsx",
      "content": "\"use client\";\n\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport interface WifiIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface WifiIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst WIFI_LEVELS = [\n  { d: \"M12 20h.01\", initialOpacity: 1, delay: 0 },\n  { d: \"M8.5 16.429a5 5 0 0 1 7 0\", initialOpacity: 1, delay: 0.1 },\n  { d: \"M5 12.859a10 10 0 0 1 14 0\", initialOpacity: 1, delay: 0.2 },\n  { d: \"M2 8.82a15 15 0 0 1 20 0\", initialOpacity: 1, delay: 0.3 },\n];\n\nconst WifiIcon = forwardRef<WifiIconHandle, WifiIconProps>(\n  ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n    const controls = useAnimation();\n\n    const isControlledRef = useRef(false);\n\n    useImperativeHandle(ref, () => {\n      isControlledRef.current = true;\n\n      return {\n        startAnimation: async () => {\n          await controls.start(\"fadeOut\");\n          controls.start(\"fadeIn\");\n        },\n        stopAnimation: () => controls.start(\"fadeIn\"),\n      };\n    });\n\n    const handleMouseEnter = useCallback(\n      async (e: React.MouseEvent<HTMLDivElement>) => {\n        if (isControlledRef.current) {\n          onMouseEnter?.(e);\n        } else {\n          await controls.start(\"fadeOut\");\n          controls.start(\"fadeIn\");\n        }\n      },\n      [controls, onMouseEnter]\n    );\n\n    const handleMouseLeave = useCallback(\n      (e: React.MouseEvent<HTMLDivElement>) => {\n        controls.start(\"fadeIn\");\n        onMouseLeave?.(e);\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=\"2\"\n          viewBox=\"0 0 24 24\"\n          width={size}\n          xmlns=\"http://www.w3.org/2000/svg\"\n        >\n          {WIFI_LEVELS.map((level, index) => (\n            <motion.path\n              animate={controls}\n              d={level.d}\n              initial={{ opacity: level.initialOpacity }}\n              key={index}\n              variants={{\n                fadeOut: {\n                  opacity: index === 0 ? 1 : 0,\n                  transition: { duration: 0.2 },\n                },\n                fadeIn: {\n                  opacity: 1,\n                  transition: {\n                    type: \"spring\",\n                    stiffness: 300,\n                    damping: 20,\n                    delay: level.delay,\n                  },\n                },\n              }}\n            />\n          ))}\n        </svg>\n      </div>\n    );\n  }\n);\n\nWifiIcon.displayName = \"WifiIcon\";\n\nexport { WifiIcon };\n",
      "type": "registry:ui"
    }
  ]
}
