{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "signal",
  "title": "signal",
  "description": "Animated signal icon for React",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "files": [
    {
      "path": "signal.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 SignalIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface SignalIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst WAVE_VARIANTS: Variants = {\n  normal: { opacity: 1, scale: 1 },\n  animate: (custom: number) => ({\n    opacity: 0,\n    scale: 0,\n    transition: {\n      opacity: {\n        duration: 0.2,\n        ease: \"easeInOut\",\n        repeat: 1,\n        repeatType: \"reverse\",\n        repeatDelay: 0.2,\n        delay: 0.2 * (custom - 1),\n      },\n      scale: {\n        duration: 0.2,\n        ease: \"easeInOut\",\n        repeat: 1,\n        repeatType: \"reverse\",\n        repeatDelay: 0.2,\n        delay: 0.2 * (custom - 1),\n      },\n    },\n  }),\n};\n\nconst SignalIcon = forwardRef<SignalIconHandle, SignalIconProps>(\n  ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n    const waveControls = useAnimation();\n    const isControlledRef = useRef(false);\n\n    useImperativeHandle(ref, () => {\n      isControlledRef.current = true;\n\n      return {\n        startAnimation: () => {\n          waveControls.start(\"animate\");\n        },\n        stopAnimation: () => {\n          waveControls.start(\"normal\");\n        },\n      };\n    });\n\n    const handleMouseEnter = useCallback(\n      (e: React.MouseEvent<HTMLDivElement>) => {\n        if (isControlledRef.current) {\n          onMouseEnter?.(e);\n        } else {\n          waveControls.start(\"animate\");\n        }\n      },\n      [waveControls, onMouseEnter]\n    );\n\n    const handleMouseLeave = useCallback(\n      (e: React.MouseEvent<HTMLDivElement>) => {\n        if (isControlledRef.current) {\n          onMouseLeave?.(e);\n        } else {\n          waveControls.start(\"normal\");\n        }\n      },\n      [waveControls, 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          <path d=\"M12 12h.008v.008H12V12Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z\" />\n          <motion.path\n            animate={waveControls}\n            custom={1}\n            d=\"M9.348 14.652a3.75 3.75 0 0 1 0-5.304m5.304 0a3.75 3.75 0 0 1 0 5.304\"\n            initial=\"normal\"\n            style={{ transformOrigin: \"12px 12px\" }}\n            variants={WAVE_VARIANTS}\n          />\n          <motion.path\n            animate={waveControls}\n            custom={2}\n            d=\"M7.227 16.773a6.75 6.75 0 0 1 0-9.546m9.546 0a6.75 6.75 0 0 1 0 9.546\"\n            initial=\"normal\"\n            style={{ transformOrigin: \"12px 12px\" }}\n            variants={WAVE_VARIANTS}\n          />\n          <motion.path\n            animate={waveControls}\n            custom={3}\n            d=\"M5.106 18.894c-3.808-3.807-3.808-9.98 0-13.788m13.788 0c3.808 3.807 3.808 9.98 0 13.788\"\n            initial=\"normal\"\n            style={{ transformOrigin: \"12px 12px\" }}\n            variants={WAVE_VARIANTS}\n          />\n        </svg>\n      </div>\n    );\n  }\n);\n\nSignalIcon.displayName = \"SignalIcon\";\n\nexport { SignalIcon };\n",
      "type": "registry:ui"
    }
  ]
}
