{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "history",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "devDependencies": [],
  "files": [
    {
      "path": "history.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 HistoryIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface HistoryIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst ARROW_TRANSITION: Transition = {\n  type: \"spring\",\n  stiffness: 250,\n  damping: 25,\n};\n\nconst ARROW_VARIANTS: Variants = {\n  normal: {\n    rotate: \"0deg\",\n  },\n  animate: {\n    rotate: \"-50deg\",\n  },\n};\n\nconst HAND_TRANSITION: Transition = {\n  duration: 0.6,\n  ease: [0.4, 0, 0.2, 1],\n};\n\nconst HAND_VARIANTS: Variants = {\n  normal: {\n    rotate: 0,\n    originX: \"0%\",\n    originY: \"100%\",\n  },\n  animate: {\n    rotate: -360,\n    originX: \"0%\",\n    originY: \"100%\",\n  },\n};\n\nconst MINUTE_HAND_TRANSITION: Transition = {\n  duration: 0.5,\n  ease: \"easeInOut\",\n};\n\nconst MINUTE_HAND_VARIANTS: Variants = {\n  normal: {\n    rotate: 0,\n    originX: \"0%\",\n    originY: \"0%\",\n  },\n  animate: {\n    rotate: -45,\n    originX: \"0%\",\n    originY: \"0%\",\n  },\n};\n\nconst HistoryIcon = forwardRef<HistoryIconHandle, HistoryIconProps>(\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          viewBox=\"0 0 24 24\"\n          width={size}\n          xmlns=\"http://www.w3.org/2000/svg\"\n        >\n          <motion.g\n            animate={controls}\n            transition={ARROW_TRANSITION}\n            variants={ARROW_VARIANTS}\n          >\n            <path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n            <path d=\"M3 3v5h5\" />\n          </motion.g>\n          <motion.line\n            animate={controls}\n            initial=\"normal\"\n            transition={HAND_TRANSITION}\n            variants={HAND_VARIANTS}\n            x1=\"12\"\n            x2=\"12\"\n            y1=\"12\"\n            y2=\"7\"\n          />\n          <motion.line\n            animate={controls}\n            initial=\"normal\"\n            transition={MINUTE_HAND_TRANSITION}\n            variants={MINUTE_HAND_VARIANTS}\n            x1=\"12\"\n            x2=\"16\"\n            y1=\"12\"\n            y2=\"14\"\n          />\n        </svg>\n      </div>\n    );\n  }\n);\n\nHistoryIcon.displayName = \"HistoryIcon\";\n\nexport { HistoryIcon };\n",
      "type": "registry:ui"
    }
  ]
}
