{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "rocking-chair",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "devDependencies": [],
  "files": [
    {
      "path": "rocking-chair.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\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport interface RockingChairIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface RockingChairIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst DEFAULT_TRANSITION: Transition = {\n  type: \"spring\",\n  stiffness: 100,\n  damping: 12,\n  mass: 0.4,\n};\n\nconst ROCKING_VARIANTS: Variants = {\n  normal: { rotate: 0 },\n  animate: {\n    rotate: [-5, 5, -5],\n    transition: {\n      repeat: Number.POSITIVE_INFINITY,\n      repeatType: \"mirror\" as const,\n      duration: 1.2,\n      ease: \"easeInOut\",\n    },\n  },\n};\n\nconst RockingChairIcon = forwardRef<\n  RockingChairIconHandle,\n  RockingChairIconProps\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      <motion.svg\n        animate={controls}\n        fill=\"none\"\n        height={size}\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"2\"\n        style={{ originX: \"10%\", originY: \"90%\" }}\n        variants={ROCKING_VARIANTS}\n        viewBox=\"0 0 24 24\"\n        width={size}\n        xmlns=\"http://www.w3.org/2000/svg\"\n      >\n        <motion.polyline\n          animate={controls}\n          points=\"3.5 2 6.5 12.5 18 12.5\"\n          transition={DEFAULT_TRANSITION}\n        />\n        <motion.line\n          animate={controls}\n          transition={DEFAULT_TRANSITION}\n          x1=\"9.5\"\n          x2=\"5.5\"\n          y1=\"12.5\"\n          y2=\"20\"\n        />\n        <motion.line\n          animate={controls}\n          transition={DEFAULT_TRANSITION}\n          x1=\"15\"\n          x2=\"18.5\"\n          y1=\"12.5\"\n          y2=\"20\"\n        />\n        <motion.path\n          animate={controls}\n          d=\"M2.75 18a13 13 0 0 0 18.5 0\"\n          transition={DEFAULT_TRANSITION}\n        />\n      </motion.svg>\n    </div>\n  );\n});\n\nRockingChairIcon.displayName = \"RockingChairIcon\";\n\nexport { RockingChairIcon };\n",
      "type": "registry:ui"
    }
  ]
}
