{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "heart-pulse",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "devDependencies": [],
  "files": [
    {
      "path": "heart-pulse.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 HeartPulseIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface HeartPulseIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst HEART_DRAW_VARIANTS: Variants = {\n  normal: { pathLength: 1, opacity: 1 },\n  hidden: { pathLength: 0, opacity: 0 },\n  draw: { pathLength: [0, 1], opacity: [0, 1] },\n};\n\nconst HEART_PULSE_VARIANTS: Variants = {\n  normal: { scale: 1 },\n  pulse: { scale: [1, 1.08, 1] },\n};\n\nconst LINE_VARIANTS: Variants = {\n  normal: { pathLength: 1, pathOffset: 0, opacity: 1 },\n  animate: { pathLength: [0, 1], pathOffset: [1, 0], opacity: [0, 1] },\n};\n\nconst HeartPulseIcon = forwardRef<HeartPulseIconHandle, HeartPulseIconProps>(\n  ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n    const heartDrawControls = useAnimation();\n    const heartPulseControls = useAnimation();\n    const lineControls = useAnimation();\n    const isControlledRef = useRef(false);\n\n    const startAnimation = useCallback(async () => {\n      heartDrawControls.start(\"hidden\", { duration: 0 });\n      await lineControls.start(\"animate\", {\n        duration: 0.6,\n        ease: \"linear\",\n        opacity: { duration: 0.1 },\n      });\n      await heartDrawControls.start(\"draw\", {\n        duration: 0.5,\n        ease: \"easeOut\",\n        opacity: { duration: 0.1 },\n      });\n      heartPulseControls.start(\"pulse\", {\n        duration: 0.9,\n        repeat: 1,\n        ease: \"easeInOut\",\n      });\n    }, [heartDrawControls, heartPulseControls, lineControls]);\n\n    const stopAnimation = useCallback(() => {\n      heartDrawControls.start(\"normal\", { duration: 0.3 });\n      heartPulseControls.start(\"normal\", { duration: 0.3 });\n      lineControls.start(\"normal\", { duration: 0.3 });\n    }, [heartDrawControls, heartPulseControls, lineControls]);\n\n    useImperativeHandle(ref, () => {\n      isControlledRef.current = true;\n      return { startAnimation, stopAnimation };\n    });\n\n    const handleMouseEnter = useCallback(\n      (e: React.MouseEvent<HTMLDivElement>) => {\n        if (isControlledRef.current) {\n          onMouseEnter?.(e);\n        } else {\n          startAnimation();\n        }\n      },\n      [startAnimation, onMouseEnter]\n    );\n\n    const handleMouseLeave = useCallback(\n      (e: React.MouseEvent<HTMLDivElement>) => {\n        if (isControlledRef.current) {\n          onMouseLeave?.(e);\n        } else {\n          stopAnimation();\n        }\n      },\n      [stopAnimation, 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=\"2\"\n          viewBox=\"0 0 24 24\"\n          width={size}\n          xmlns=\"http://www.w3.org/2000/svg\"\n        >\n          <motion.g\n            animate={heartPulseControls}\n            style={{ originX: \"12px\", originY: \"12px\" }}\n            variants={HEART_PULSE_VARIANTS}\n          >\n            <motion.path\n              animate={heartDrawControls}\n              d=\"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5\"\n              variants={HEART_DRAW_VARIANTS}\n            />\n          </motion.g>\n          <motion.path\n            animate={lineControls}\n            d=\"M3.22 13H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27\"\n            variants={LINE_VARIANTS}\n          />\n        </svg>\n      </div>\n    );\n  }\n);\n\nHeartPulseIcon.displayName = \"HeartPulseIcon\";\n\nexport { HeartPulseIcon };\n",
      "type": "registry:ui"
    }
  ]
}
