{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "numbered-list",
  "title": "numbered-list",
  "description": "Animated numbered-list icon for React",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "files": [
    {
      "path": "numbered-list.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 NumberedListIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface NumberedListIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst NUMBER_DURATION = 0.2;\nconst LINE_DURATION = 0.3;\n\nconst CREATE_NUMBER_VARIANTS = (delay: number): Variants => ({\n  normal: {\n    pathLength: 1,\n    opacity: 1,\n  },\n  animate: {\n    pathLength: [0, 1],\n    opacity: [0, 1],\n    transition: {\n      pathLength: { duration: NUMBER_DURATION, ease: \"easeInOut\", delay },\n      opacity: { duration: NUMBER_DURATION, ease: \"easeInOut\", delay },\n    },\n  },\n});\n\nconst CREATE_LINE_VARIANTS = (delay: number): Variants => ({\n  normal: {\n    pathLength: 1,\n    opacity: 1,\n  },\n  animate: {\n    pathLength: [0, 1],\n    opacity: [0, 1],\n    transition: {\n      pathLength: { duration: LINE_DURATION, ease: \"easeInOut\", delay },\n      opacity: { duration: LINE_DURATION, ease: \"easeInOut\", delay },\n    },\n  },\n});\n\nconst LIST_ITEMS = [\n  {\n    y: 5.992,\n    numberPath:\n      \"M4.1157 7.49548V3.74512H2.99072M4.1157 7.49548H2.99072M4.1157 7.49548H5.24068\",\n    linePath: \"M8.24185 5.99179H20.2416\",\n  },\n  {\n    y: 11.9945,\n    numberPath:\n      \"M3.32128 10.0715C3.76061 9.63214 4.4729 9.63214 4.91223 10.0715C5.35157 10.5109 5.35157 11.2233 4.91223 11.6627L3.08285 13.4923L5.24182 13.4925\",\n    linePath: \"M8.24118 11.9945H20.2409\",\n  },\n  {\n    y: 17.9936,\n    numberPath:\n      \"M2.99072 15.7446H4.1156C4.73696 15.7446 5.24068 16.2484 5.24068 16.8697C5.24068 17.4911 4.73696 17.9949 4.1156 17.9949H3.74071M3.74071 17.9928H4.1156C4.73696 17.9928 5.24068 18.4966 5.24068 19.1179C5.24068 19.7393 4.73696 20.243 4.1156 20.243H2.99072\",\n    linePath: \"M8.24185 17.9936H20.2416\",\n  },\n] as const;\n\nconst NumberedListIcon = forwardRef<\n  NumberedListIconHandle,\n  NumberedListIconProps\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        {LIST_ITEMS.map((item, index) => {\n          const numberDelay = index * (NUMBER_DURATION + LINE_DURATION);\n          const lineDelay = numberDelay + NUMBER_DURATION;\n\n          return (\n            <g key={item.y}>\n              <motion.path\n                animate={controls}\n                d={item.numberPath}\n                initial=\"normal\"\n                variants={CREATE_NUMBER_VARIANTS(numberDelay)}\n              />\n              <motion.path\n                animate={controls}\n                d={item.linePath}\n                initial=\"normal\"\n                variants={CREATE_LINE_VARIANTS(lineDelay)}\n              />\n            </g>\n          );\n        })}\n      </svg>\n    </div>\n  );\n});\n\nNumberedListIcon.displayName = \"NumberedListIcon\";\n\nexport { NumberedListIcon };\n",
      "type": "registry:ui"
    }
  ]
}
