{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "academic-cap",
  "title": "academic-cap",
  "description": "Animated academic-cap icon for React",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "files": [
    {
      "path": "academic-cap.tsx",
      "content": "\"use client\";\n\nimport type { 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 AcademicCapIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface AcademicCapIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst CAP_VARIANTS: Variants = {\n  normal: { y: 0, rotate: 0 },\n  animate: {\n    y: [0, -3, 0],\n    rotate: [0, -5, 5, 0],\n    transition: {\n      duration: 0.5,\n      ease: \"easeInOut\",\n    },\n  },\n};\n\nconst TASSEL_VARIANTS: Variants = {\n  normal: { rotate: 0 },\n  animate: {\n    rotate: [0, 10, -10, 5, 0],\n    transition: {\n      duration: 0.6,\n      ease: \"easeInOut\",\n    },\n  },\n};\n\nconst AcademicCapIcon = forwardRef<AcademicCapIconHandle, AcademicCapIconProps>(\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.g\n            animate={controls}\n            initial=\"normal\"\n            style={{ transformOrigin: \"center center\" }}\n            variants={CAP_VARIANTS}\n          >\n            <path d=\"M4.26 10.147a60.438 60.438 0 0 0-.491 6.347A48.62 48.62 0 0 1 12 20.904a48.62 48.62 0 0 1 8.232-4.41 60.46 60.46 0 0 0-.491-6.347m-15.482 0a50.636 50.636 0 0 0-2.658-.813A59.906 59.906 0 0 1 12 3.493a59.903 59.903 0 0 1 10.399 5.84c-.896.248-1.783.52-2.658.814m-15.482 0A50.717 50.717 0 0 1 12 13.489a50.702 50.702 0 0 1 7.74-3.342\" />\n          </motion.g>\n          <motion.g\n            animate={controls}\n            initial=\"normal\"\n            style={{ transformOrigin: \"6.75px 14.25px\" }}\n            variants={TASSEL_VARIANTS}\n          >\n            <path d=\"M6.75 15a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm0 0v-3.675A55.378 55.378 0 0 1 12 8.443m-7.007 11.55A5.981 5.981 0 0 0 6.75 15.75v-1.5\" />\n          </motion.g>\n        </svg>\n      </div>\n    );\n  }\n);\n\nAcademicCapIcon.displayName = \"AcademicCapIcon\";\n\nexport { AcademicCapIcon };\n",
      "type": "registry:ui"
    }
  ]
}
