{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "cpu-chip",
  "title": "cpu-chip",
  "description": "Animated cpu-chip icon for React",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "files": [
    {
      "path": "cpu-chip.tsx",
      "content": "\"use client\";\n\nimport type { Transition, 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 CpuChipIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface CpuChipIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst TRANSITION: Transition = {\n  duration: 0.5,\n  ease: \"easeInOut\",\n  repeat: 1,\n};\n\nconst Y_VARIANTS: Variants = {\n  normal: {\n    scale: 1,\n    rotate: 0,\n    opacity: 1,\n  },\n  animate: {\n    scaleY: [1, 1.5, 1],\n    opacity: [1, 0.8, 1],\n  },\n};\n\nconst X_VARIANTS: Variants = {\n  normal: {\n    scale: 1,\n    rotate: 0,\n    opacity: 1,\n  },\n  animate: {\n    scaleX: [1, 1.5, 1],\n    opacity: [1, 0.8, 1],\n  },\n};\n\nconst CpuChipIcon = forwardRef<CpuChipIconHandle, CpuChipIconProps>(\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=\"1.5\"\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=\"M8.25 3V4.5\"\n            transition={TRANSITION}\n            variants={Y_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M12 3V4.5\"\n            transition={TRANSITION}\n            variants={Y_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M15.75 3V4.5\"\n            transition={TRANSITION}\n            variants={Y_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M4.5 8.25H3\"\n            transition={TRANSITION}\n            variants={X_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M4.5 12H3\"\n            transition={TRANSITION}\n            variants={X_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M4.5 15.75H3\"\n            transition={TRANSITION}\n            variants={X_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M21 8.25H19.5\"\n            transition={TRANSITION}\n            variants={X_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M21 12H19.5\"\n            transition={TRANSITION}\n            variants={X_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M21 15.75H19.5\"\n            transition={TRANSITION}\n            variants={X_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M8.25 19.5V21\"\n            transition={TRANSITION}\n            variants={Y_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M12 19.5V21\"\n            transition={TRANSITION}\n            variants={Y_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M15.75 19.5V21\"\n            transition={TRANSITION}\n            variants={Y_VARIANTS}\n          />\n          <path d=\"M6.75 19.5H17.25C18.4926 19.5 19.5 18.4926 19.5 17.25V6.75C19.5 5.50736 18.4926 4.5 17.25 4.5H6.75C5.50736 4.5 4.5 5.50736 4.5 6.75V17.25C4.5 18.4926 5.50736 19.5 6.75 19.5ZM7.5 7.5H16.5V16.5H7.5V7.5Z\" />\n        </svg>\n      </div>\n    );\n  }\n);\n\nCpuChipIcon.displayName = \"CpuChipIcon\";\n\nexport { CpuChipIcon };\n",
      "type": "registry:ui"
    }
  ]
}
