{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "loader-icon",
  "type": "registry:ui",
  "title": "Loader Icon",
  "description": "Loader icon component.",
  "dependencies": [
    "motion"
  ],
  "files": [
    {
      "path": "registry/icons/loader/index.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\nimport { motion, type Variants } from 'motion/react';\n\nimport {\n  getVariants,\n  useAnimateIconContext,\n  IconWrapper,\n  type IconProps,\n} from '@/components/animate-ui/icons/icon';\n\ntype LoaderProps = IconProps<keyof typeof animations>;\n\nconst SEGMENT_COUNT = 8;\nconst DURATION = 1.2;\nconst BASE_OPACITY = 0.25;\n\nconst animations = {\n  default: (() => {\n    const spinner: Record<string, Variants> = {\n      group: { initial: {}, animate: {} },\n    };\n\n    for (let i = 1; i <= SEGMENT_COUNT; i++) {\n      const reverseIndex = SEGMENT_COUNT - i;\n      const delay = -(reverseIndex * DURATION) / SEGMENT_COUNT;\n\n      spinner[`path${i}`] = {\n        initial: { opacity: 1 },\n        animate: {\n          opacity: [1, BASE_OPACITY],\n          transition: {\n            duration: DURATION,\n            ease: 'linear',\n            repeat: Infinity,\n            repeatType: 'loop',\n            delay,\n          },\n        },\n      };\n    }\n\n    return spinner as Record<string, Variants>;\n  })() satisfies Record<string, Variants>,\n  spin: {\n    group: {\n      initial: { rotate: 0 },\n      animate: {\n        rotate: 360,\n        transition: {\n          duration: 1.5,\n          ease: 'linear',\n          repeat: Infinity,\n          repeatType: 'loop',\n        },\n      },\n    },\n    path1: {},\n    path2: {},\n    path3: {},\n    path4: {},\n    path5: {},\n    path6: {},\n    path7: {},\n    path8: {},\n  } satisfies Record<string, Variants>,\n} as const;\n\nfunction IconComponent({ size, ...props }: LoaderProps) {\n  const { controls } = useAnimateIconContext();\n  const variants = getVariants(animations);\n\n  return (\n    <motion.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      variants={variants.group}\n      initial=\"initial\"\n      animate={controls}\n      {...props}\n    >\n      <motion.path\n        d=\"M12 2v4\"\n        variants={variants.path1}\n        initial=\"initial\"\n        animate={controls}\n      />\n      <motion.path\n        d=\"m16.2 7.8 2.9-2.9\"\n        variants={variants.path2}\n        initial=\"initial\"\n        animate={controls}\n      />\n      <motion.path\n        d=\"M18 12h4\"\n        variants={variants.path3}\n        initial=\"initial\"\n        animate={controls}\n      />\n      <motion.path\n        d=\"m16.2 16.2 2.9 2.9\"\n        variants={variants.path4}\n        initial=\"initial\"\n        animate={controls}\n      />\n      <motion.path\n        d=\"M12 18v4\"\n        variants={variants.path5}\n        initial=\"initial\"\n        animate={controls}\n      />\n      <motion.path\n        d=\"m4.9 19.1 2.9-2.9\"\n        variants={variants.path6}\n        initial=\"initial\"\n        animate={controls}\n      />\n      <motion.path\n        d=\"M2 12h4\"\n        variants={variants.path7}\n        initial=\"initial\"\n        animate={controls}\n      />\n      <motion.path\n        d=\"m4.9 4.9 2.9 2.9\"\n        variants={variants.path8}\n        initial=\"initial\"\n        animate={controls}\n      />\n    </motion.svg>\n  );\n}\n\nfunction Loader(props: LoaderProps) {\n  return <IconWrapper icon={IconComponent} {...props} />;\n}\n\nexport {\n  animations,\n  Loader,\n  Loader as LoaderIcon,\n  type LoaderProps,\n  type LoaderProps as LoaderIconProps,\n};\n",
      "type": "registry:ui",
      "target": "components/animate-ui/icons/loader.tsx"
    }
  ],
  "meta": {
    "keywords": [
      "loading",
      "wait",
      "busy",
      "progress",
      "throbber",
      "spinner",
      "spinning"
    ]
  }
}