{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "github",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "devDependencies": [],
  "files": [
    {
      "path": "github.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 GithubIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface GithubIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst BODY_VARIANTS: Variants = {\n  normal: {\n    opacity: 1,\n    pathLength: 1,\n    scale: 1,\n    transition: {\n      duration: 0.3,\n    },\n  },\n  animate: {\n    opacity: [0, 1],\n    pathLength: [0, 1],\n    scale: [0.9, 1],\n    transition: {\n      duration: 0.4,\n    },\n  },\n};\n\nconst TAIL_VARIANTS: Variants = {\n  normal: {\n    pathLength: 1,\n    rotate: 0,\n    transition: {\n      duration: 0.3,\n    },\n  },\n  draw: {\n    pathLength: [0, 1],\n    rotate: 0,\n    transition: {\n      duration: 0.5,\n    },\n  },\n  wag: {\n    pathLength: 1,\n    rotate: [0, -15, 15, -10, 10, -5, 5],\n    transition: {\n      duration: 2.5,\n      ease: \"easeInOut\",\n      repeat: Number.POSITIVE_INFINITY,\n    },\n  },\n};\n\nconst GithubIcon = forwardRef<GithubIconHandle, GithubIconProps>(\n  ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n    const bodyControls = useAnimation();\n    const tailControls = useAnimation();\n    const isControlledRef = useRef(false);\n\n    useImperativeHandle(ref, () => {\n      isControlledRef.current = true;\n\n      return {\n        startAnimation: async () => {\n          bodyControls.start(\"animate\");\n          await tailControls.start(\"draw\");\n          tailControls.start(\"wag\");\n        },\n        stopAnimation: () => {\n          bodyControls.start(\"normal\");\n          tailControls.start(\"normal\");\n        },\n      };\n    });\n\n    const handleMouseEnter = useCallback(\n      async (e: React.MouseEvent<HTMLDivElement>) => {\n        if (isControlledRef.current) {\n          onMouseEnter?.(e);\n        } else {\n          bodyControls.start(\"animate\");\n          await tailControls.start(\"draw\");\n          tailControls.start(\"wag\");\n        }\n      },\n      [bodyControls, onMouseEnter, tailControls]\n    );\n\n    const handleMouseLeave = useCallback(\n      (e: React.MouseEvent<HTMLDivElement>) => {\n        if (isControlledRef.current) {\n          onMouseLeave?.(e);\n        } else {\n          bodyControls.start(\"normal\");\n          tailControls.start(\"normal\");\n        }\n      },\n      [bodyControls, tailControls, 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={bodyControls}\n            d=\"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4\"\n            initial=\"normal\"\n            variants={BODY_VARIANTS}\n          />\n          <motion.path\n            animate={tailControls}\n            d=\"M9 18c-4.51 2-5-2-7-2\"\n            initial=\"normal\"\n            variants={TAIL_VARIANTS}\n          />\n        </svg>\n      </div>\n    );\n  }\n);\n\nGithubIcon.displayName = \"GithubIcon\";\n\nexport { GithubIcon };\n",
      "type": "registry:ui"
    }
  ]
}
