{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "eye",
  "type": "registry:ui",
  "addGlobalCss": false,
  "registryDependencies": [],
  "dependencies": [
    "motion"
  ],
  "devDependencies": [],
  "files": [
    {
      "path": "eye-icon.tsx",
      "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport type { Variants } from \"motion/react\";\nimport {\n LazyMotion,\n domMin,\n m,\n useAnimation,\n useReducedMotion,\n} from \"motion/react\";\nimport {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useRef,\n type HTMLAttributes,\n} from \"react\";\nexport interface EyeIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface EyeIconProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n | \"color\"\n | \"onDrag\"\n | \"onDragStart\"\n | \"onDragEnd\"\n | \"onAnimationStart\"\n | \"onAnimationEnd\"\n | \"onAnimationIteration\"\n> {\n size?: number;\n duration?: number;\n isAnimated?: boolean;\n color?: string;\n}\n\nconst EyeIcon = forwardRef<EyeIconHandle, EyeIconProps>(\n (\n  {\n   onMouseEnter,\n   onMouseLeave,\n   className,\n   size = 24,\n   duration = 1,\n   isAnimated = true,\n   color,\n   ...props\n  },\n  ref,\n ) => {\n  const eyeControls = useAnimation();\n  const pupilControls = useAnimation();\n  const reduced = useReducedMotion();\n  const isControlled = useRef(false);\n\n  useImperativeHandle(ref, () => {\n   isControlled.current = true;\n   return {\n    startAnimation: () => {\n     if (reduced) {\n      eyeControls.start(\"open\");\n      pupilControls.start(\"center\");\n     } else {\n      eyeControls.start(\"blink\");\n      pupilControls.start(\"scan\");\n     }\n    },\n    stopAnimation: () => {\n     eyeControls.start(\"open\");\n     pupilControls.start(\"center\");\n    },\n   };\n  });\n\n  const handleEnter = useCallback(\n   (e?: React.MouseEvent<HTMLDivElement>) => {\n    if (!isAnimated || reduced) return;\n    if (!isControlled.current) {\n     eyeControls.start(\"blink\");\n     pupilControls.start(\"scan\");\n    } else {\n     onMouseEnter?.(e as any);\n    }\n   },\n   [eyeControls, pupilControls, onMouseEnter, reduced, isAnimated],\n  );\n\n  const handleLeave = useCallback(\n   (e: React.MouseEvent<HTMLDivElement>) => {\n    if (!isControlled.current) {\n     eyeControls.start(\"open\");\n     pupilControls.start(\"center\");\n    } else {\n     onMouseLeave?.(e as any);\n    }\n   },\n   [eyeControls, pupilControls, onMouseLeave],\n  );\n\n  const eyeVariants: Variants = {\n   open: { scaleY: 1 },\n   blink: {\n    scaleY: [1, 0.1, 1],\n    transition: {\n     duration: 0.25 * duration,\n     ease: \"easeInOut\",\n    },\n   },\n  };\n\n  const pupilVariants: Variants = {\n   center: { x: 0 },\n   scan: {\n    x: [-2, 2, -1, 1, 0],\n    transition: {\n     duration: 1.6 * duration,\n     ease: \"easeInOut\",\n    },\n   },\n  };\n\n  return (\n   <LazyMotion features={domMin} strict>\n    <m.div\n     className={cn(\"inline-flex items-center justify-center\", className)}\n     onMouseEnter={handleEnter}\n     onMouseLeave={handleLeave}\n     {...props}\n     style={{ color, ...props.style }}\n    >\n     <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width={size}\n      height={size}\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"2\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n     >\n      <m.path\n       d=\"M21.544 11.045C21.848 11.4713 22 11.6845 22 12C22 12.3155 21.848 12.5287 21.544 12.955C20.1779 14.8706 16.6892 19 12 19C7.31078 19 3.8221 14.8706 2.45604 12.955C2.15201 12.5287 2 12.3155 2 12C2 11.6845 2.15201 11.4713 2.45604 11.045C3.8221 9.12944 7.31078 5 12 5C16.6892 5 20.1779 9.12944 21.544 11.045Z\"\n       animate={eyeControls}\n       initial=\"open\"\n       variants={eyeVariants}\n       style={{\n        transformBox: \"fill-box\",\n        transformOrigin: \"center\",\n       }}\n      />\n      <m.circle\n       cx=\"12\"\n       cy=\"12\"\n       r=\"3\"\n       animate={pupilControls}\n       initial=\"center\"\n       variants={pupilVariants}\n      />\n     </svg>\n    </m.div>\n   </LazyMotion>\n  );\n },\n);\n\nEyeIcon.displayName = \"EyeIcon\";\nexport { EyeIcon };\n",
      "type": "registry:ui"
    }
  ]
}