{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "chess-pawn",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "devDependencies": [],
  "files": [
    {
      "path": "chess-pawn.tsx",
      "content": "\"use client\";\n\nimport { motion, useAnimation, type Variants } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport interface ChessPawnIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface ChessPawnIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst HEAD_VARIANTS: Variants = {\n  normal: {\n    x: 0,\n    y: 0,\n    scale: 1,\n    rotate: 0,\n    transition: {\n      type: \"spring\",\n      stiffness: 180,\n      damping: 16,\n    },\n  },\n  animate: {\n    x: [0, -5, 5, 0],\n    rotate: [0, -15, 15, 0],\n    transition: {\n      duration: 2.4,\n      times: [0, 0.33, 0.66, 1],\n      ease: \"easeInOut\",\n    },\n  },\n};\n\nconst BODY_VARIANTS: Variants = {\n  normal: {\n    rotate: 0,\n    transition: {\n      type: \"spring\",\n      stiffness: 260,\n      damping: 16,\n    },\n  },\n  animate: {\n    rotate: [0, 5, 5, 5, 3, 0],\n    transition: {\n      duration: 1.8,\n      times: [0, 0.08, 0.3, 0.52, 0.72, 1],\n      ease: \"easeInOut\",\n    },\n  },\n};\n\nconst ChessPawnIcon = forwardRef<ChessPawnIconHandle, ChessPawnIconProps>(\n  ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n    const headControls = useAnimation();\n    const bodyControls = useAnimation();\n    const isControlledRef = useRef(false);\n\n    useImperativeHandle(ref, () => {\n      isControlledRef.current = true;\n      return {\n        startAnimation: () => {\n          headControls.start(\"animate\");\n          bodyControls.start(\"animate\");\n        },\n        stopAnimation: () => {\n          headControls.start(\"normal\");\n          bodyControls.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          headControls.start(\"animate\");\n          bodyControls.start(\"animate\");\n        }\n      },\n      [headControls, bodyControls, onMouseEnter]\n    );\n\n    const handleMouseLeave = useCallback(\n      (e: React.MouseEvent<HTMLDivElement>) => {\n        if (isControlledRef.current) {\n          onMouseLeave?.(e);\n        } else {\n          headControls.start(\"normal\");\n          bodyControls.start(\"normal\");\n        }\n      },\n      [headControls, bodyControls, 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.g\n            animate={bodyControls}\n            initial=\"normal\"\n            style={{ transformBox: \"view-box\", transformOrigin: \"12px 21px\" }}\n            variants={BODY_VARIANTS}\n          >\n            <path d=\"M5 20a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1z\" />\n            <path d=\"m14.5 10 1.5 8\" />\n            <path d=\"M7 10h10\" />\n            <path d=\"m8 18 1.5-8\" />\n          </motion.g>\n          <motion.circle\n            animate={headControls}\n            cx=\"12\"\n            cy=\"6\"\n            initial=\"normal\"\n            r=\"4\"\n            style={{ transformBox: \"fill-box\", transformOrigin: \"center\" }}\n            variants={HEAD_VARIANTS}\n          />\n        </svg>\n      </div>\n    );\n  }\n);\n\nChessPawnIcon.displayName = \"ChessPawnIcon\";\n\nexport { ChessPawnIcon };\n",
      "type": "registry:ui"
    }
  ]
}
