{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "spinners",
  "title": "Spinners",
  "description": "Six CSS-only loaders (ring, dots, bars, pulse, orbit, typing) sized in px or presets and painted with currentColor.",
  "dependencies": [],
  "registryDependencies": [
    "https://goodui.dev/r/goodui-motion.json"
  ],
  "files": [
    {
      "path": "registry/components/feedback/spinners.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\nimport { GooduiTokens } from \"@/lib/goodui-motion\"\n\n// All six loaders are CSS only. They are sized in em from the root's font-size and painted with currentColor.\nconst CSS = `\n@keyframes pc-spinners-rotate { to { transform: rotate(360deg) } }\n@keyframes pc-spinners-dot { 0%, 80%, 100% { transform: scale(.45); opacity: .35 } 40% { transform: scale(1); opacity: 1 } }\n@keyframes pc-spinners-bar { 0%, 100% { transform: scaleY(.35); opacity: .45 } 50% { transform: scaleY(1); opacity: 1 } }\n@keyframes pc-spinners-pulse { 0% { transform: scale(.1); opacity: .9 } 100% { transform: scale(1); opacity: 0 } }\n@keyframes pc-spinners-hop { 0%, 60%, 100% { transform: translateY(0); opacity: .45 } 30% { transform: translateY(-.22em); opacity: 1 } }\n@keyframes pc-spinners-fade { 0%, 100% { opacity: .35 } 50% { opacity: 1 } }\n:where(.pc-spinners) { display: inline-flex; flex-shrink: 0; position: relative; width: 1em; height: 1em; vertical-align: middle; color: inherit; }\n.pc-spinners-ring { animation: pc-spinners-rotate .75s linear infinite; }\n.pc-spinners-dots, .pc-spinners-typing { align-items: center; justify-content: space-between; padding: 0 .04em; }\n.pc-spinners-dots > i, .pc-spinners-typing > i { display: block; width: .25em; height: .25em; border-radius: 9999px; background: currentColor; }\n.pc-spinners-dots > i { animation: pc-spinners-dot 1.1s ease-in-out infinite; }\n.pc-spinners-typing > i { animation: pc-spinners-hop 1s ease-in-out infinite; }\n.pc-spinners-dots > i:nth-child(2), .pc-spinners-typing > i:nth-child(2) { animation-delay: .15s }\n.pc-spinners-dots > i:nth-child(3), .pc-spinners-typing > i:nth-child(3) { animation-delay: .3s }\n.pc-spinners-bars { align-items: center; justify-content: space-between; padding: .1em .06em; }\n.pc-spinners-bars > i { display: block; width: .14em; height: 100%; border-radius: 9999px; background: currentColor; animation: pc-spinners-bar .9s ease-in-out infinite; }\n.pc-spinners-bars > i:nth-child(2) { animation-delay: .12s }\n.pc-spinners-bars > i:nth-child(3) { animation-delay: .24s }\n.pc-spinners-bars > i:nth-child(4) { animation-delay: .36s }\n.pc-spinners-pulse > i { position: absolute; inset: 0; border-radius: 9999px; background: currentColor; animation: pc-spinners-pulse 1.4s var(--pc-ease-out) infinite; }\n.pc-spinners-pulse > i:nth-child(2) { animation-delay: .7s }\n.pc-spinners-orbit::before { content: \"\"; position: absolute; inset: 0; border-radius: 9999px; border: max(1px, .06em) solid currentColor; opacity: .18; }\n.pc-spinners-orbit > i { position: absolute; border-radius: 9999px; animation: pc-spinners-rotate 1.2s linear infinite; }\n.pc-spinners-orbit > i::after { content: \"\"; position: absolute; left: 50%; top: 0; border-radius: 9999px; background: currentColor; }\n.pc-spinners-orbit > i:nth-child(1) { inset: 0; }\n.pc-spinners-orbit > i:nth-child(1)::after { width: .2em; height: .2em; margin: -.07em 0 0 -.1em; }\n.pc-spinners-orbit > i:nth-child(2) { inset: .26em; animation-duration: .8s; animation-direction: reverse; }\n.pc-spinners-orbit > i:nth-child(2)::after { width: .14em; height: .14em; margin: -.07em 0 0 -.07em; opacity: .7; }\n@media (prefers-reduced-motion: reduce) {\n  .pc-spinners-ring, .pc-spinners-orbit > i { animation: none; }\n  .pc-spinners-ring, .pc-spinners-orbit, .pc-spinners-pulse { animation: pc-spinners-fade 1.6s ease-in-out infinite; }\n  .pc-spinners-pulse > i { animation: none; transform: scale(.6); opacity: .8; }\n  .pc-spinners-dots > i, .pc-spinners-typing > i, .pc-spinners-bars > i { animation-name: pc-spinners-fade; animation-duration: 1.6s; transform: none; }\n}\n`\n\nexport type SpinnerVariant = \"ring\" | \"dots\" | \"bars\" | \"pulse\" | \"orbit\" | \"typing\"\n\nexport type SpinnerProps = Omit<React.ComponentProps<\"span\">, \"children\"> & {\n  /** Loader style: ring, dots, bars, pulse, orbit or typing. */\n  variant?: SpinnerVariant\n  /** Preset or a size in px. */\n  size?: \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | number\n  /** Read by screen readers. Pass null when a parent already announces the busy state. */\n  label?: string | null\n}\n\nconst SIZES = { xs: 12, sm: 16, md: 24, lg: 32, xl: 48 }\n\nfunction Parts({ variant }: { variant: SpinnerVariant }) {\n  switch (variant) {\n    case \"ring\":\n      return (\n        <svg viewBox=\"0 0 24 24\" fill=\"none\" width=\"100%\" height=\"100%\" aria-hidden=\"true\">\n          <circle cx=\"12\" cy=\"12\" r=\"9.5\" stroke=\"currentColor\" strokeOpacity=\".18\" strokeWidth=\"3\" />\n          <path d=\"M21.5 12a9.5 9.5 0 0 0-9.5-9.5\" stroke=\"currentColor\" strokeWidth=\"3\" strokeLinecap=\"round\" />\n        </svg>\n      )\n    case \"dots\":\n    case \"typing\":\n      return (\n        <>\n          <i />\n          <i />\n          <i />\n        </>\n      )\n    case \"bars\":\n      return (\n        <>\n          <i />\n          <i />\n          <i />\n          <i />\n        </>\n      )\n    case \"pulse\":\n    case \"orbit\":\n      return (\n        <>\n          <i />\n          <i />\n        </>\n      )\n  }\n}\n\n/** Six CSS-only loaders (ring, dots, bars, pulse, orbit, typing). Sized in px or presets, colored by currentColor. */\nexport function Spinner({ variant = \"ring\", size = \"md\", label = \"Loading\", className, style, ...props }: SpinnerProps) {\n  const px = typeof size === \"number\" ? size : SIZES[size]\n  return (\n    <span\n      role={label === null ? undefined : \"status\"}\n      aria-hidden={label === null ? true : undefined}\n      className={cn(\"pc-spinners\", `pc-spinners-${variant}`, className)}\n      style={{ fontSize: px, ...style }}\n      {...props}\n    >\n      <GooduiTokens />\n      <style href=\"pc-spinners\" precedence=\"default\">\n        {CSS}\n      </style>\n      <Parts variant={variant} />\n      {label !== null && <span className=\"sr-only\">{label}</span>}\n    </span>\n  )\n}\n\ntype VariantSpinnerProps = Omit<SpinnerProps, \"variant\">\n\nexport function SpinnerRing(props: VariantSpinnerProps) {\n  return <Spinner variant=\"ring\" {...props} />\n}\nexport function SpinnerDots(props: VariantSpinnerProps) {\n  return <Spinner variant=\"dots\" {...props} />\n}\nexport function SpinnerBars(props: VariantSpinnerProps) {\n  return <Spinner variant=\"bars\" {...props} />\n}\nexport function SpinnerPulse(props: VariantSpinnerProps) {\n  return <Spinner variant=\"pulse\" {...props} />\n}\nexport function SpinnerOrbit(props: VariantSpinnerProps) {\n  return <Spinner variant=\"orbit\" {...props} />\n}\nexport function SpinnerTyping(props: VariantSpinnerProps) {\n  return <Spinner variant=\"typing\" {...props} />\n}\n",
      "type": "registry:component",
      "target": "components/goodui/spinners.tsx"
    }
  ],
  "categories": [
    "components",
    "feedback"
  ],
  "type": "registry:component"
}