{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "chess-bishop",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "devDependencies": [],
  "files": [
    {
      "path": "chess-bishop.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 ChessBishopIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface ChessBishopIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst BISHOP_VARIANTS: Variants = {\n  normal: {\n    x: 0,\n    y: 0,\n    rotate: 0,\n    opacity: 1,\n    transition: { type: \"spring\", stiffness: 220, damping: 18 },\n  },\n  animate: {\n    x: [0, -6, -6, -6, 6, 6, 6, 0],\n    y: [0, -6, -6, -6, 6, 6, 6, 0],\n    rotate: [0, -16, -16, -16, 16, 16, 4, 0],\n    opacity: [1, 1, 0, 0, 0, 0, 1, 1],\n    transition: {\n      duration: 1.4,\n      times: [0, 0.28, 0.38, 0.45, 0.5, 0.58, 0.72, 1],\n      ease: \"easeInOut\",\n    },\n  },\n};\n\nconst ChessBishopIcon = forwardRef<ChessBishopIconHandle, ChessBishopIconProps>(\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      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          style={{ overflow: \"visible\" }}\n          viewBox=\"0 0 24 24\"\n          width={size}\n          xmlns=\"http://www.w3.org/2000/svg\"\n        >\n          <motion.g\n            animate={controls}\n            initial=\"normal\"\n            style={{ transformBox: \"view-box\", transformOrigin: \"12px 12px\" }}\n            variants={BISHOP_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=\"M15 18c1.5-.615 3-2.461 3-4.923C18 8.769 14.5 4.462 12 2 9.5 4.462 6 8.77 6 13.077 6 15.539 7.5 17.385 9 18\" />\n            <path d=\"m16 7-2.5 2.5\" />\n            <path d=\"M9 2h6\" />\n          </motion.g>\n        </svg>\n      </div>\n    );\n  }\n);\n\nChessBishopIcon.displayName = \"ChessBishopIcon\";\n\nexport { ChessBishopIcon };\n",
      "type": "registry:ui"
    }
  ]
}
