{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "smile",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "devDependencies": [],
  "files": [
    {
      "path": "smile.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 SmileIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface SmileIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst SmileIcon = forwardRef<SmileIconHandle, SmileIconProps>(\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.05, 1.1],\n        rotate: [0, -3, 3, 0],\n        strokeWidth: [2, 2.5, 2.5, 2.5],\n        transition: {\n          duration: 0.8,\n          times: [0, 0.3, 0.6, 1],\n          ease: \"easeInOut\",\n        },\n      },\n    };\n\n    const mouthVariants: Variants = {\n      normal: {\n        d: \"M8 14s1.5 2 4 2 4-2 4-2\",\n        pathLength: 1,\n        pathOffset: 0,\n        strokeWidth: 2,\n        transition: { duration: 0.3, ease: \"easeOut\" },\n      },\n      animate: {\n        d: \"M7 13.5s2.5 3.5 5 3.5 5-3.5 5-3.5\",\n        pathLength: [0.3, 1, 1],\n        pathOffset: [0, 0, 0],\n        strokeWidth: 2.5,\n        transition: {\n          d: { duration: 0.4, ease: \"easeOut\" },\n          pathLength: {\n            duration: 0.5,\n            times: [0, 0.5, 1],\n            ease: \"easeInOut\",\n          },\n          delay: 0.1,\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.5, 0.8, 1.2],\n        opacity: [1, 1, 1, 1],\n        transition: {\n          duration: 0.5,\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          <motion.circle cx=\"12\" cy=\"12\" r=\"10\" />\n          <motion.path\n            animate={controls}\n            d=\"M8 14s1.5 2 4 2 4-2 4-2\"\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\nSmileIcon.displayName = \"SmileIcon\";\n\nexport { SmileIcon };\n",
      "type": "registry:ui"
    }
  ]
}
