{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "laugh",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "devDependencies": [],
  "files": [
    {
      "path": "laugh.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\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport interface LaughIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface LaughIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst LaughIcon = forwardRef<LaughIconHandle, LaughIconProps>(\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) controls.start(\"animate\");\n        onMouseEnter?.(e);\n      },\n      [controls, onMouseEnter]\n    );\n\n    const handleMouseLeave = useCallback(\n      (e: React.MouseEvent<HTMLDivElement>) => {\n        if (!isControlledRef.current) controls.start(\"normal\");\n        onMouseLeave?.(e);\n      },\n      [controls, onMouseLeave]\n    );\n\n    const faceVariants: Variants = {\n      normal: {\n        scale: 1,\n        rotate: 0,\n        strokeWidth: 2,\n        transition: { duration: 0.3, ease: \"easeOut\" },\n      },\n      animate: {\n        scale: [1, 1.15, 1, 1.1, 1.05],\n        rotate: [0, 3, -2, 3, 0],\n        strokeWidth: [2, 2.5, 2.5, 2.5, 2],\n        transition: {\n          duration: 1.2,\n          times: [0, 0.2, 0.4, 0.6, 1],\n          ease: \"easeInOut\",\n          repeat: 0,\n          repeatType: \"reverse\",\n        },\n      },\n    };\n\n    const mouthVariants: Variants = {\n      normal: {\n        d: \"M18 13a6 6 0 0 1-6 5 6 6 0 0 1-6-5h12Z\",\n        pathLength: 1,\n        strokeWidth: 2,\n        transition: { duration: 0.3, ease: \"easeOut\" },\n      },\n      animate: {\n        d: \"M18 13a6 6 0 0 1-6 5 6 6 0 0 1-6-5h12Z\",\n        pathLength: [0.7, 1, 1],\n        strokeWidth: 2.5,\n        scaleY: [1, 1.2, 1.1],\n        y: [0, 0.5, 0.3],\n        transition: {\n          duration: 0.6,\n          times: [0, 0.5, 1],\n          ease: \"easeInOut\",\n        },\n      },\n    };\n\n    const eyeVariants: Variants = {\n      normal: {\n        scale: 1,\n        opacity: 1,\n        transition: { duration: 0.3, ease: \"easeOut\" },\n      },\n      animate: {\n        scale: [1, 1.3, 1, 1.7],\n        opacity: [1, 1, 1, 1],\n        transition: {\n          duration: 0.6,\n          times: [0, 0.3, 0.6, 1],\n          ease: \"easeInOut\",\n        },\n      },\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          initial=\"normal\"\n          stroke=\"currentColor\"\n          strokeLinecap=\"round\"\n          strokeLinejoin=\"round\"\n          strokeWidth=\"2\"\n          variants={faceVariants}\n          viewBox=\"0 0 24 24\"\n          width={size}\n          xmlns=\"http://www.w3.org/2000/svg\"\n        >\n          <circle cx=\"12\" cy=\"12\" r=\"10\" />\n          <motion.path\n            animate={controls}\n            initial=\"normal\"\n            variants={mouthVariants}\n          />\n          <motion.line\n            animate={controls}\n            initial=\"normal\"\n            variants={eyeVariants}\n            x1=\"9\"\n            x2=\"9.01\"\n            y1=\"9\"\n            y2=\"9\"\n          />\n          <motion.line\n            animate={controls}\n            initial=\"normal\"\n            variants={eyeVariants}\n            x1=\"15\"\n            x2=\"15.01\"\n            y1=\"9\"\n            y2=\"9\"\n          />\n        </motion.svg>\n      </div>\n    );\n  }\n);\n\nLaughIcon.displayName = \"LaughIcon\";\n\nexport { LaughIcon };\n",
      "type": "registry:ui"
    }
  ]
}
