{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"social-orbit","type":"registry:ui","title":"Social Orbit","description":"An avatar with social links circling it on two counter-rotating rings, upright icons, brand-colored hovers and tooltip labels; pauses on hover.","dependencies":[],"registryDependencies":["utils"],"files":[{"path":"registry/ui/social-orbit.tsx","type":"registry:ui","content":"\"use client\";\n\nimport type { CSSProperties, ReactNode } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface SocialOrbitItem {\n  label: string;\n  href: string;\n  icon: ReactNode;\n  /** Brand color used as the hover fill. */\n  color?: string;\n}\n\nexport interface SocialOrbitProps {\n  /** Avatar image URL. */\n  avatar: string;\n  /** Person's name, used as the avatar's alt text. */\n  name?: string;\n  /** Social links. The first half orbits the inner ring, the rest the outer ring. */\n  items: SocialOrbitItem[];\n  /** Inner ring radius in px. */\n  innerRadius?: number;\n  /** Outer ring radius in px. */\n  outerRadius?: number;\n  /** Speed multiplier; 0 stops the orbit. */\n  speed?: number;\n  /** Pause while the pointer or keyboard focus is inside. */\n  pauseOnHover?: boolean;\n  /** Draw the dashed orbit paths. */\n  showRings?: boolean;\n  /** Avatar ring and glow color. */\n  accent?: string;\n  className?: string;\n}\n\nconst css = `\n@keyframes so-spin{to{transform:rotate(360deg)}}\n.so-ring,.so-counter{animation:so-spin var(--so-d) linear infinite;animation-direction:var(--so-dir)}\n.so-counter{animation-direction:var(--so-cdir)}\n@keyframes so-halo{to{transform:rotate(360deg)}}\n.so-halo{animation:so-halo 6s linear infinite}\n.so-root[data-pause]:hover :is(.so-ring,.so-counter),.so-root[data-pause]:focus-within :is(.so-ring,.so-counter){animation-play-state:paused}\n@media (prefers-reduced-motion:reduce){.so-ring,.so-counter,.so-halo{animation:none}}\n`;\n\nexport function SocialOrbit({\n  avatar,\n  name = \"\",\n  items,\n  innerRadius = 95,\n  outerRadius = 160,\n  speed = 1,\n  pauseOnHover = true,\n  showRings = true,\n  accent = \"#a3e635\",\n  className,\n}: SocialOrbitProps) {\n  const split = Math.ceil(items.length / 2);\n  const rings = [\n    { r: innerRadius, list: items.slice(0, split), secs: 26, reverse: false },\n    { r: outerRadius, list: items.slice(split), secs: 42, reverse: true },\n  ];\n  const size = outerRadius * 2 + 56;\n  const avatarSize = Math.max(48, Math.min(innerRadius * 2 - 70, 112));\n\n  return (\n    <div\n      data-pause={pauseOnHover || undefined}\n      className={cn(\"so-root relative shrink-0\", className)}\n      style={{ width: size, height: size }}\n    >\n      <style href=\"social-orbit\" precedence=\"default\">\n        {css}\n      </style>\n\n      {rings.map(({ r, list, secs, reverse }, ri) => (\n        <div key={ri}>\n          {showRings && (\n            <span\n              aria-hidden\n              className=\"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-dashed border-foreground/15\"\n              style={{ width: r * 2, height: r * 2 }}\n            />\n          )}\n          <ul\n            className=\"so-ring absolute inset-0\"\n            style={\n              {\n                [\"--so-d\" as string]: speed > 0 ? `${secs / speed}s` : \"0s\",\n                [\"--so-dir\" as string]: reverse ? \"reverse\" : \"normal\",\n                [\"--so-cdir\" as string]: reverse ? \"normal\" : \"reverse\",\n                animationPlayState: speed > 0 ? undefined : \"paused\",\n              } as CSSProperties\n            }\n          >\n            {list.map((it, i) => {\n              const a = (360 / list.length) * i + ri * (180 / Math.max(1, list.length));\n              return (\n                <li\n                  key={it.label}\n                  className=\"absolute left-1/2 top-1/2 -ml-[22px] -mt-[22px] hover:z-10 focus-within:z-10\"\n                  style={{ transform: `rotate(${a}deg) translateX(${r}px) rotate(${-a}deg)` }}\n                >\n                  <div className=\"so-counter\" style={{ animationPlayState: speed > 0 ? undefined : \"paused\" }}>\n                    <a\n                      href={it.href}\n                      target=\"_blank\"\n                      rel=\"noreferrer\"\n                      aria-label={it.label}\n                      className=\"group/so relative grid size-11 place-items-center rounded-full border border-border bg-card text-foreground shadow-[0_10px_24px_-10px_rgba(0,0,0,.7)] outline-none transition-[background-color,color,border-color,scale,box-shadow] duration-200 hover:scale-110 hover:border-transparent hover:bg-[var(--c)] hover:text-white hover:shadow-[0_8px_28px_-6px_var(--c)] focus-visible:ring-2 focus-visible:ring-ring [&_svg]:size-5\"\n                      style={{ [\"--c\" as string]: it.color ?? \"var(--foreground)\" } as CSSProperties}\n                    >\n                      {it.icon}\n                      <span className=\"pointer-events-none absolute bottom-full left-1/2 mb-2 -translate-x-1/2 translate-y-1 whitespace-nowrap rounded-md border border-border bg-popover px-2 py-1 text-xs font-medium text-popover-foreground opacity-0 shadow-md transition duration-150 group-hover/so:translate-y-0 group-hover/so:opacity-100 group-focus-visible/so:translate-y-0 group-focus-visible/so:opacity-100\">\n                        {it.label}\n                      </span>\n                    </a>\n                  </div>\n                </li>\n              );\n            })}\n          </ul>\n        </div>\n      ))}\n\n      <div className=\"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2\" style={{ width: avatarSize, height: avatarSize }}>\n        <span aria-hidden className=\"absolute -inset-6 rounded-full blur-2xl\" style={{ background: `color-mix(in oklab, ${accent} 28%, transparent)` }} />\n        <span\n          aria-hidden\n          className=\"so-halo absolute -inset-[3px] rounded-full\"\n          style={{ background: `conic-gradient(from 0deg, ${accent}, transparent 35%, ${accent} 60%, transparent 85%, ${accent})` }}\n        />\n        {/* eslint-disable-next-line @next/next/no-img-element */}\n        <img src={avatar} alt={name} draggable={false} className=\"relative size-full rounded-full border-[3px] border-background object-cover\" />\n        <span aria-hidden className=\"absolute bottom-[6%] right-[6%] size-4 rounded-full border-[3px] border-background bg-emerald-400\" />\n      </div>\n    </div>\n  );\n}\n"}]}