{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "animated-spinner",
  "title": "Animated Spinner",
  "description": "A restrained Motion-powered spinner for buttons, cards, and async loading states.",
  "dependencies": [
    "motion"
  ],
  "registryDependencies": [
    "https://ui.corr.sh/r/animated-number.json"
  ],
  "files": [
    {
      "path": "registry/corr/components/animated-spinner.tsx",
      "content": "\"use client\"\n\nimport { motion, useReducedMotion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport type AnimatedSpinnerSize = \"sm\" | \"default\" | \"lg\"\nexport type AnimatedSpinnerTone =\n  | \"neutral\"\n  | \"primary\"\n  | \"muted\"\n  | \"success\"\n  | \"warning\"\n  | \"destructive\"\n\nconst sizeClassName: Record<AnimatedSpinnerSize, string> = {\n  sm: \"size-4 border-2\",\n  default: \"size-5 border-2\",\n  lg: \"size-7 border-[3px]\",\n}\n\nconst toneClassName: Record<AnimatedSpinnerTone, string> = {\n  neutral: \"border-foreground/20 border-t-foreground\",\n  primary: \"border-primary/20 border-t-primary\",\n  muted: \"border-muted-foreground/20 border-t-muted-foreground\",\n  success: \"border-emerald-500/20 border-t-emerald-600\",\n  warning: \"border-amber-500/25 border-t-amber-600\",\n  destructive: \"border-destructive/20 border-t-destructive\",\n}\n\nexport function AnimatedSpinner({\n  size = \"default\",\n  tone = \"neutral\",\n  label = \"Loading\",\n  className,\n}: {\n  size?: AnimatedSpinnerSize\n  tone?: AnimatedSpinnerTone\n  label?: string\n  className?: string\n}) {\n  const reduceMotion = useReducedMotion()\n\n  return (\n    <span\n      role=\"status\"\n      aria-label={label}\n      className={cn(\"inline-flex items-center justify-center\", className)}\n    >\n      <motion.span\n        aria-hidden=\"true\"\n        animate={reduceMotion ? undefined : { rotate: 360 }}\n        transition={{\n          duration: 0.9,\n          ease: \"linear\",\n          repeat: reduceMotion ? 0 : Infinity,\n        }}\n        className={cn(\n          \"block rounded-full\",\n          sizeClassName[size],\n          toneClassName[tone]\n        )}\n      />\n      <span className=\"sr-only\">{label}</span>\n    </span>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}