{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"meteor-orbit","type":"registry:ui","title":"Meteor Orbit","description":"Icons circling a center on concentric rings while glowing meteor streaks race along each orbit.","dependencies":[],"registryDependencies":["utils"],"files":[{"path":"registry/ui/meteor-orbit.tsx","type":"registry:ui","content":"\"use client\";\n\nimport type { CSSProperties, ReactNode } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface MeteorOrbitItem {\n  label: string;\n  icon: ReactNode;\n}\n\nexport interface MeteorOrbitProps {\n  /** Icons spread round-robin over the rings, innermost first. */\n  items: MeteorOrbitItem[];\n  /** Content in the middle. */\n  children?: ReactNode;\n  /** Outer diameter in px. */\n  size?: number;\n  rings?: number;\n  /** Seconds per revolution of the innermost ring. Outer rings are slower. */\n  duration?: number;\n  /** Meteor streaks per ring. 0 hides them. */\n  meteors?: number;\n  meteorColor?: string;\n  /** Icon bubble size in px. */\n  iconSize?: number;\n  pauseOnHover?: boolean;\n  className?: string;\n}\n\nconst css = `\n@keyframes meteor-orbit-spin{to{transform:rotate(360deg)}}\n.mo-spin{animation:meteor-orbit-spin var(--mo-d) linear infinite}\n.mo-root[data-pause]:hover .mo-spin{animation-play-state:paused}\n@media (prefers-reduced-motion:reduce){.mo-spin{animation:none}}\n`;\n\nexport function MeteorOrbit({\n  items,\n  children,\n  size = 400,\n  rings = 3,\n  duration = 24,\n  meteors = 2,\n  meteorColor = \"#a3e635\",\n  iconSize = 44,\n  pauseOnHover = true,\n  className,\n}: MeteorOrbitProps) {\n  const ringCount = Math.max(1, rings);\n  const inner = size * 0.22;\n  const radii = Array.from({ length: ringCount }, (_, r) =>\n    ringCount === 1 ? size / 2 - iconSize / 2 : inner + ((size / 2 - iconSize / 2 - inner) * r) / (ringCount - 1),\n  );\n  const byRing = radii.map((_, r) => items.filter((_, i) => i % ringCount === r));\n\n  return (\n    <div\n      className={cn(\"mo-root relative shrink-0\", className)}\n      data-pause={pauseOnHover || undefined}\n      style={{ width: size, height: size }}\n    >\n      <style href=\"meteor-orbit\" precedence=\"default\">\n        {css}\n      </style>\n      <div\n        aria-hidden\n        className=\"absolute inset-0 rounded-full\"\n        style={{ background: `radial-gradient(circle, color-mix(in oklab, ${meteorColor} 14%, transparent), transparent 60%)` }}\n      />\n      {radii.map((radius, r) => {\n        const d = duration * (1 + r * 0.6);\n        const reverse = r % 2 === 1;\n        const box: CSSProperties = { width: radius * 2, height: radius * 2, left: size / 2 - radius, top: size / 2 - radius };\n        const list = byRing[r];\n        return (\n          <div key={r}>\n            <div aria-hidden className=\"absolute rounded-full border border-border\" style={box} />\n            {Array.from({ length: meteors }, (_, m) => (\n              <div\n                key={m}\n                aria-hidden\n                className=\"mo-spin absolute\"\n                style={{ ...box, \"--mo-d\": `${d / 2.2}s`, animationDirection: reverse ? \"reverse\" : \"normal\", animationDelay: `${(-d / 2.2) * (m / meteors + r * 0.37)}s` } as CSSProperties}\n              >\n                {/* Comet tail: a conic sweep clipped to a thin ring, brightest at the head. */}\n                <div\n                  className=\"absolute inset-0 rounded-full\"\n                  style={{\n                    background: `conic-gradient(from ${reverse ? 0 : 270}deg, ${reverse ? `${meteorColor}, transparent 25%` : `transparent, ${meteorColor} 25%, transparent 25%`})`,\n                    mask: \"radial-gradient(closest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px), #000 calc(100% - .5px), transparent 100%)\",\n                    WebkitMask: \"radial-gradient(closest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px), #000 calc(100% - .5px), transparent 100%)\",\n                  }}\n                />\n                <span\n                  className=\"absolute top-0 left-1/2 size-1.5 -translate-x-1/2 -translate-y-[1px] rounded-full bg-white\"\n                  style={{ boxShadow: `0 0 6px 2px ${meteorColor}, 0 0 14px 4px ${meteorColor}` }}\n                />\n              </div>\n            ))}\n            <ul className=\"mo-spin absolute\" style={{ ...box, \"--mo-d\": `${d}s`, animationDirection: reverse ? \"reverse\" : \"normal\" } as CSSProperties}>\n              {list.map((item, i) => {\n                const a = (i / list.length) * 360 + r * 40;\n                return (\n                  <li\n                    key={item.label}\n                    className=\"absolute top-1/2 left-1/2\"\n                    style={{ transform: `rotate(${a}deg) translateY(${-radius}px) rotate(${-a}deg)` }}\n                  >\n                    {/* Spins the opposite way at the same speed so the icon stays upright. */}\n                    <div\n                      className=\"mo-spin\"\n                      style={{ \"--mo-d\": `${d}s`, animationDirection: reverse ? \"normal\" : \"reverse\", margin: -iconSize / 2 } as CSSProperties}\n                    >\n                      <div\n                        title={item.label}\n                        aria-label={item.label}\n                        role=\"img\"\n                        className=\"grid place-items-center rounded-full border border-border bg-card text-foreground shadow-lg transition-transform duration-300 hover:scale-110 [&>svg]:size-[45%]\"\n                        style={{ width: iconSize, height: iconSize }}\n                      >\n                        {item.icon}\n                      </div>\n                    </div>\n                  </li>\n                );\n              })}\n            </ul>\n          </div>\n        );\n      })}\n      {children && <div className=\"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2\">{children}</div>}\n    </div>\n  );\n}\n"}]}