{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "mail-icon",
  "title": "Mail Icon",
  "description": "An animated mail icon with a moving envelope flap.",
  "dependencies": [
    "motion"
  ],
  "files": [
    {
      "path": "registry/chamaac/animated-icons/mail-icon.tsx",
      "content": "\"use client\";\n\nimport { useState } from \"react\";\nimport {\n  m,\n  LazyMotion,\n  domAnimation,\n  SVGMotionProps,\n  Easing,\n} from \"motion/react\";\n\ninterface MailIconProps extends SVGMotionProps<SVGSVGElement> {\n  size?: number;\n  duration?: number;\n  strokeWidth?: number;\n  isHovered?: boolean;\n  repeatDelay?: number;\n  ease?: Easing;\n}\n\nconst MailIcon = (props: MailIconProps) => {\n  const {\n    size = 28, // Icon size in pixels\n    duration = 4, // Animation duration in seconds\n    strokeWidth = 2, // SVG stroke width\n    isHovered = false, // When true, animate only on hover\n    repeatDelay = 1, // Delay between animation loops (seconds)\n    ease = \"easeInOut\", // Animation easing function\n    className,\n    ...restProps\n  } = props;\n\n  const [isHoveredInternal, setIsHoveredInternal] = useState(false);\n\n  const shouldAnimate = isHovered ? isHoveredInternal : true;\n\n  const envelopeProps = {\n    animate: shouldAnimate ? { y: [0, -2, 0] } : { y: 0 },\n    transition: {\n      duration: duration,\n      repeat: isHovered ? 0 : Infinity,\n      ease: ease,\n    },\n  };\n\n  const flapProps = {\n    animate: shouldAnimate\n      ? { pathLength: [0, 1, 1, 0], opacity: 1 }\n      : { pathLength: 1, opacity: 1 },\n    transition: {\n      duration: duration / 2,\n      repeat: isHovered ? 0 : Infinity,\n      ease: ease,\n      repeatDelay: repeatDelay,\n    },\n  };\n\n  return (\n    <LazyMotion features={domAnimation}>\n      <m.svg\n        {...restProps}\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={strokeWidth}\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        className={className}\n        overflow=\"visible\"\n        onMouseEnter={() => isHovered && setIsHoveredInternal(true)}\n        onMouseLeave={() => isHovered && setIsHoveredInternal(false)}\n      >\n        <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n        <m.path\n          d=\"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z\"\n          {...envelopeProps}\n        />\n        <m.path d=\"M3 7l9 6l9 -6\" {...flapProps} />\n      </m.svg>\n    </LazyMotion>\n  );\n};\n\nexport default MailIcon;\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}