{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "receipt-percent",
  "title": "receipt-percent",
  "description": "Animated receipt-percent icon for React",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "files": [
    {
      "path": "receipt-percent.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\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface ReceiptPercentIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface ReceiptPercentIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst PERCENT_VARIANTS: Variants = {\n  normal: {\n    opacity: 1,\n    pathLength: 1,\n  },\n  animate: {\n    opacity: [0, 1],\n    pathLength: [0, 1],\n    transition: {\n      duration: 0.4,\n      ease: \"easeOut\",\n      opacity: { duration: 0.1 },\n    },\n  },\n};\n\nconst DOT_VARIANTS: Variants = {\n  normal: {\n    scale: 1,\n    opacity: 1,\n  },\n  animate: (delay: number) => ({\n    scale: [0, 1.2, 1],\n    opacity: [0, 1, 1],\n    transition: {\n      delay,\n      duration: 0.3,\n      ease: \"easeOut\",\n    },\n  }),\n};\n\nconst ReceiptPercentIcon = forwardRef<\n  ReceiptPercentIconHandle,\n  ReceiptPercentIconProps\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\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) {\n        onMouseEnter?.(e);\n      } else {\n        controls.start(\"animate\");\n      }\n    },\n    [controls, onMouseEnter]\n  );\n\n  const handleMouseLeave = useCallback(\n    (e: React.MouseEvent<HTMLDivElement>) => {\n      if (isControlledRef.current) {\n        onMouseLeave?.(e);\n      } else {\n        controls.start(\"normal\");\n      }\n    },\n    [controls, 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=\"1.5\"\n        viewBox=\"0 0 24 24\"\n        width={size}\n        xmlns=\"http://www.w3.org/2000/svg\"\n      >\n        <path d=\"M19.5 4.75699V21.75L15.75 20.25L12 21.75L8.25 20.25L4.5 21.75V4.75699C4.5 3.649 5.30608 2.70014 6.40668 2.57241C8.24156 2.35947 10.108 2.25 12 2.25C13.892 2.25 15.7584 2.35947 17.5933 2.57241C18.6939 2.70014 19.5 3.649 19.5 4.75699Z\" />\n        <motion.path\n          animate={controls}\n          d=\"M9 14.25L15 8.25\"\n          initial=\"normal\"\n          variants={PERCENT_VARIANTS}\n        />\n        <motion.path\n          animate={controls}\n          custom={0.2}\n          d=\"M9.75 9H9.7575V9.0075H9.75V9ZM10.125 9C10.125 9.20711 9.95711 9.375 9.75 9.375C9.54289 9.375 9.375 9.20711 9.375 9C9.375 8.79289 9.54289 8.625 9.75 8.625C9.95711 8.625 10.125 8.79289 10.125 9Z\"\n          initial=\"normal\"\n          variants={DOT_VARIANTS}\n        />\n        <motion.path\n          animate={controls}\n          custom={0.35}\n          d=\"M14.25 13.5H14.2575V13.5075H14.25V13.5ZM14.625 13.5C14.625 13.7071 14.4571 13.875 14.25 13.875C14.0429 13.875 13.875 13.7071 13.875 13.5C13.875 13.2929 14.0429 13.125 14.25 13.125C14.4571 13.125 14.625 13.2929 14.625 13.5Z\"\n          initial=\"normal\"\n          variants={DOT_VARIANTS}\n        />\n      </svg>\n    </div>\n  );\n});\n\nReceiptPercentIcon.displayName = \"ReceiptPercentIcon\";\n\nexport { ReceiptPercentIcon };\n",
      "type": "registry:ui"
    }
  ]
}
