{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "connect",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "devDependencies": [],
  "files": [
    {
      "path": "connect.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\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport interface ConnectIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface ConnectIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst PLUG_VARIANTS: Variants = {\n  normal: {\n    x: 0,\n    y: 0,\n  },\n  animate: {\n    x: -3,\n    y: 3,\n  },\n};\n\nconst SOCKET_VARIANTS: Variants = {\n  normal: {\n    x: 0,\n    y: 0,\n  },\n  animate: {\n    x: 3,\n    y: -3,\n  },\n};\n\nconst PATH_VARIANTS = {\n  normal: (custom: { x: number; y: number }) => ({\n    d: `M${custom.x} ${custom.y} l2.5 -2.5`,\n  }),\n  animate: (custom: { x: number; y: number }) => ({\n    d: `M${custom.x + 2.93} ${custom.y - 2.93} l0.10 -0.10`,\n  }),\n};\n\nconst ConnectIcon = forwardRef<ConnectIconHandle, ConnectIconProps>(\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=\"2\"\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=\"M19 5l3 -3\"\n            transition={{ type: \"spring\", stiffness: 500, damping: 30 }}\n            variants={{\n              normal: {\n                d: \"M19 5l3 -3\",\n              },\n              animate: {\n                d: \"M17 7l5 -5\",\n              },\n            }}\n          />\n          <motion.path\n            animate={controls}\n            d=\"m2 22 3-3\"\n            transition={{ type: \"spring\", stiffness: 500, damping: 30 }}\n            variants={{\n              normal: {\n                d: \"m2 22 3-3\",\n              },\n              animate: {\n                d: \"m2 22 6-6\",\n              },\n            }}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z\"\n            transition={{ type: \"spring\", stiffness: 500, damping: 30 }}\n            variants={SOCKET_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            custom={{ x: 7.5, y: 13.5 }}\n            initial=\"normal\"\n            transition={{ type: \"spring\", stiffness: 500, damping: 30 }}\n            variants={PATH_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            custom={{ x: 10.5, y: 16.5 }}\n            initial=\"normal\"\n            transition={{ type: \"spring\", stiffness: 500, damping: 30 }}\n            variants={PATH_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z\"\n            transition={{ type: \"spring\", stiffness: 500, damping: 30 }}\n            variants={PLUG_VARIANTS}\n          />\n        </svg>\n      </div>\n    );\n  }\n);\n\nConnectIcon.displayName = \"ConnectIcon\";\n\nexport { ConnectIcon };\n",
      "type": "registry:ui"
    }
  ]
}
