{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "auth-social-orbit",
  "type": "registry:component",
  "title": "Auth Social Orbit",
  "description": "A social-first sign-in where provider buttons circle the brand mark on a slow orbit that pauses on hover. Pointing at a provider draws a beam to the center, tints the scene and morphs the main button to Continue with that provider.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "auth",
    "auth",
    "social login",
    "oauth",
    "orbit",
    "providers",
    "sign in"
  ],
  "docs": "https://hyperblur.dev/effects/auth-social-orbit",
  "files": [
    {
      "path": "registry/hyperblur/auth-social-orbit.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/auth-social-orbit.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface AuthSocialOrbitProvider {\n  id: string;\n  label: string;\n  tint?: string;\n  icon?: React.ReactNode;\n}\n\nexport interface AuthSocialOrbitProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  brand?: string;\n  title?: string;\n  subtitle?: string;\n  providers?: AuthSocialOrbitProvider[];\n  lastUsed?: string | null;\n  speed?: number;\n  terms?: { label: string; href: string };\n  onProvider?: (id: string) => boolean | void | Promise<boolean | void>;\n  onEmail?: (email: string) => void;\n}\n\nconst css = `\n.hb-vf6 {\n  --hb-vf6-tint: #e5e5e5;\n  --hb-vf6-dur: 48s;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  min-height: 600px;\n  display: grid;\n  place-items: center;\n  padding: 44px 20px;\n  overflow: hidden;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n}\n.hb-vf6 *, .hb-vf6 *::before, .hb-vf6 *::after { box-sizing: border-box; }\n.hb-vf6::before { content: \"\"; position: absolute; left: 50%; top: 30%; width: 520px; height: 520px; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--hb-vf6-tint) 12%, transparent), transparent 62%); transition: background .6s; pointer-events: none; }\n.hb-vf6-card { position: relative; width: 100%; max-width: 400px; text-align: center; }\n.hb-vf6-ring { position: relative; width: 268px; height: 268px; margin: 0 auto 8px; }\n.hb-vf6-track { position: absolute; inset: 24px; border-radius: 50%; border: 1px dashed #262626; }\n.hb-vf6-track::after { content: \"\"; position: absolute; inset: 44px; border-radius: 50%; border: 1px solid #1a1a1a; }\n.hb-vf6-orbit { position: absolute; inset: 0; animation: hb-vf6-turn var(--hb-vf6-dur) linear infinite; }\n.hb-vf6-ring:hover .hb-vf6-orbit, .hb-vf6-ring:focus-within .hb-vf6-orbit, .hb-vf6-ring:hover .hb-vf6-spin, .hb-vf6-ring:focus-within .hb-vf6-spin, .hb-vf6[data-status=\"busy\"] .hb-vf6-orbit, .hb-vf6[data-status=\"busy\"] .hb-vf6-spin { animation-play-state: paused; }\n.hb-vf6-beam { position: absolute; left: 50%; top: 50%; width: 2px; height: 110px; margin-left: -1px; transform-origin: 50% 0; background: linear-gradient(180deg, transparent 30%, var(--hb-vf6-tint)); opacity: .75; border-radius: 2px; transition: transform .55s cubic-bezier(.3,1.3,.5,1), background .5s; }\n.hb-vf6-slot { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }\n.hb-vf6-spin { position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; animation: hb-vf6-unturn var(--hb-vf6-dur) linear infinite; }\n.hb-vf6-prov { position: relative; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; border: 1px solid #262626; background: linear-gradient(180deg, #171717, #101010); color: #cfcfcf; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 10px 24px -12px rgba(0,0,0,.9); transition: transform .45s cubic-bezier(.3,1.5,.5,1), border-color .3s, color .3s, box-shadow .4s; }\n.hb-vf6-prov:hover, .hb-vf6-prov[data-active=\"true\"] { color: #fff; border-color: color-mix(in srgb, var(--hb-vf6-c) 60%, #262626); transform: scale(1.14); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 0 0 4px color-mix(in srgb, var(--hb-vf6-c) 14%, transparent), 0 14px 30px -10px color-mix(in srgb, var(--hb-vf6-c) 50%, transparent); }\n.hb-vf6-prov:focus-visible { outline: 2px solid var(--hb-vf6-c); outline-offset: 4px; }\n.hb-vf6-last { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); white-space: nowrap; height: 16px; padding: 0 6px; border-radius: 999px; font-size: 9.5px; font-weight: 600; line-height: 16px; color: #0a0a0a; background: #ededed; letter-spacing: .02em; }\n.hb-vf6-core { position: absolute; left: 50%; top: 50%; width: 92px; height: 92px; margin: -46px 0 0 -46px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 50% 30%, #1c1c1c, #0d0d0d 70%); border: 1px solid #262626; box-shadow: 0 0 0 8px #0a0a0a, 0 0 50px -10px color-mix(in srgb, var(--hb-vf6-tint) 50%, transparent); transition: box-shadow .5s; }\n.hb-vf6-core::before { content: \"\"; position: absolute; inset: -5px; border-radius: 50%; background: conic-gradient(from 0deg, transparent, var(--hb-vf6-tint), transparent 40%); mask: radial-gradient(circle, transparent 47px, #000 48px); opacity: 0; transition: opacity .4s; }\n.hb-vf6[data-status=\"busy\"] .hb-vf6-core::before { opacity: 1; animation: hb-vf6-turn 1s linear infinite; }\n.hb-vf6-core-in { position: absolute; display: grid; place-items: center; transition: opacity .3s, transform .45s cubic-bezier(.3,1.5,.5,1); }\n.hb-vf6-core-in[data-on=\"false\"] { opacity: 0; transform: scale(.6); }\n.hb-vf6-title { margin: 6px 0 0; font-size: 25px; letter-spacing: -.03em; line-height: 1.15; font-weight: 600; }\n.hb-vf6-sub { margin: 8px auto 20px; max-width: 320px; color: #8f8f8f; font-size: 14px; line-height: 1.5; }\n.hb-vf6-cta { position: relative; width: 100%; height: 50px; border: 0; border-radius: 14px; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font: inherit; font-size: 15px; font-weight: 600; color: #0a0a0a; background: #f2f2f2; cursor: pointer; box-shadow: inset 0 -2px 0 rgba(0,0,0,.08), 0 16px 36px -16px var(--hb-vf6-tint); transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .5s, background .2s; }\n.hb-vf6-cta:hover { background: #fff; }\n.hb-vf6-cta:active { transform: scale(.985); }\n.hb-vf6-cta:disabled { cursor: progress; }\n.hb-vf6-cta:focus-visible, .hb-vf6-more:focus-visible, .hb-vf6-go:focus-visible, .hb-vf6-terms a:focus-visible { outline: 2px solid #ededed; outline-offset: 3px; }\n.hb-vf6-label { display: inline-flex; align-items: center; gap: 10px; animation: hb-vf6-swap .4s cubic-bezier(.2,.8,.2,1) both; }\n.hb-vf6-dots { display: inline-flex; gap: 4px; }\n.hb-vf6-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: hb-vf6-dot 1s ease-in-out infinite; }\n.hb-vf6-dots i:nth-child(2) { animation-delay: .15s; }\n.hb-vf6-dots i:nth-child(3) { animation-delay: .3s; }\n.hb-vf6-more { margin-top: 14px; border: 0; background: none; color: #a1a1a1; font: inherit; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; border-radius: 6px; transition: color .2s; }\n.hb-vf6-more:hover { color: #ededed; }\n.hb-vf6-more svg { transition: transform .35s cubic-bezier(.2,.8,.2,1); }\n.hb-vf6-more[aria-expanded=\"true\"] svg { transform: rotate(180deg); }\n.hb-vf6-panel { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .45s cubic-bezier(.2,.8,.2,1), opacity .3s; }\n.hb-vf6-panel[data-open=\"true\"] { grid-template-rows: 1fr; opacity: 1; }\n.hb-vf6-panel > div { overflow: hidden; }\n.hb-vf6-email { display: flex; gap: 8px; padding-top: 12px; }\n.hb-vf6-input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid #262626; background: #101010; color: #ededed; font: inherit; font-size: 14px; outline: none; transition: border-color .2s, box-shadow .2s; }\n.hb-vf6-input:focus { border-color: #5a5a5a; box-shadow: 0 0 0 4px rgba(255,255,255,.06); }\n.hb-vf6-input[aria-invalid=\"true\"] { border-color: #ef5f5f; }\n.hb-vf6-go { width: 44px; height: 44px; flex: none; border-radius: 12px; border: 1px solid #262626; background: #171717; color: #ededed; display: grid; place-items: center; cursor: pointer; transition: background .2s; }\n.hb-vf6-go:hover { background: #222; }\n.hb-vf6-terms { margin: 18px 0 0; font-size: 12px; color: #6b6b6b; line-height: 1.5; }\n.hb-vf6-terms a { color: #a1a1a1; text-decoration: none; border-bottom: 1px solid #333; }\n@keyframes hb-vf6-turn { to { transform: rotate(360deg); } }\n@keyframes hb-vf6-unturn { to { transform: rotate(-360deg); } }\n@keyframes hb-vf6-swap { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }\n@keyframes hb-vf6-dot { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }\n@media (prefers-reduced-motion: reduce) {\n  .hb-vf6 *, .hb-vf6 *::before, .hb-vf6 *::after { animation: none !important; transition: none !important; }\n}\n`;\n\nconst glyphs: Record<string, React.ReactNode> = {\n  google: <path d=\"M19.5 11h-7.2v2.8h4.2a4.6 4.6 0 1 1-1.4-4.9l2-2A7.4 7.4 0 1 0 19.6 12c0-.3 0-.7-.1-1Z\" fill=\"currentColor\" />,\n  github: <g stroke=\"currentColor\" strokeWidth=\"1.9\" fill=\"none\" strokeLinecap=\"round\"><circle cx=\"7\" cy=\"5.5\" r=\"2.2\" /><circle cx=\"7\" cy=\"18.5\" r=\"2.2\" /><circle cx=\"17\" cy=\"8\" r=\"2.2\" /><path d=\"M7 7.7v8.6M17 10.2c0 4-6 3.5-9.2 6.5\" /></g>,\n  apple: <g fill=\"currentColor\"><path d=\"M12 8.2c-3.6-1.6-7.2.4-7.2 5 0 4.2 2.9 7.8 5 7.8 1 0 1.4-.5 2.2-.5s1.2.5 2.2.5c2.1 0 5-3.6 5-7.8 0-4.6-3.6-6.6-7.2-5Z\" /><path d=\"M12.4 7c-.1-2.2 1.4-3.8 3.6-4-.1 2.1-1.5 3.8-3.6 4Z\" /></g>,\n  microsoft: <g fill=\"currentColor\"><rect x=\"4\" y=\"4\" width=\"7\" height=\"7\" rx=\"1.2\" /><rect x=\"13\" y=\"4\" width=\"7\" height=\"7\" rx=\"1.2\" opacity=\".75\" /><rect x=\"4\" y=\"13\" width=\"7\" height=\"7\" rx=\"1.2\" opacity=\".75\" /><rect x=\"13\" y=\"13\" width=\"7\" height=\"7\" rx=\"1.2\" opacity=\".5\" /></g>,\n  x: <path d=\"M5 4.5 19 19.5M19 4.5 5 19.5\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" />,\n  slack: <path d=\"M9.5 4v16M14.5 4v16M4 9.5h16M4 14.5h16\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" />,\n};\n\nconst defaultProviders: AuthSocialOrbitProvider[] = [\n  { id: \"github\", label: \"GitHub\", tint: \"#d4d4d8\" },\n  { id: \"google\", label: \"Google\", tint: \"#8ab4f8\" },\n  { id: \"apple\", label: \"Apple\", tint: \"#f5f5f5\" },\n  { id: \"microsoft\", label: \"Microsoft\", tint: \"#7dd3fc\" },\n  { id: \"x\", label: \"X\", tint: \"#a3a3a3\" },\n  { id: \"slack\", label: \"Slack\", tint: \"#e9a8ff\" },\n];\n\nfunction Glyph({ p, size = 22 }: { p: AuthSocialOrbitProvider; size?: number }) {\n  if (p.icon) return <>{p.icon}</>;\n  return (\n    <svg width={size} height={size} viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n      {glyphs[p.id] ?? <text x=\"12\" y=\"16.5\" textAnchor=\"middle\" fontSize=\"13\" fontWeight=\"700\" fill=\"currentColor\">{p.label.slice(0, 1)}</text>}\n    </svg>\n  );\n}\n\nconst isEmail = (v: string) => /^[^\\s@]+@[^\\s@]+\\.[^\\s@]{2,}$/.test(v.trim());\n\nexport function AuthSocialOrbit({\n  brand = \"Kite\",\n  title = \"One tap and you are in\",\n  subtitle = \"Pick the account you already use. We only read your name, email and avatar.\",\n  providers = defaultProviders,\n  lastUsed = \"github\",\n  speed = 48,\n  terms = { label: \"Terms and Privacy Policy\", href: \"#terms\" },\n  onProvider,\n  onEmail,\n  className,\n  style,\n  ...rest\n}: AuthSocialOrbitProps) {\n  const id = React.useId();\n  const startIndex = Math.max(0, providers.findIndex((p) => p.id === lastUsed));\n  const [active, setActive] = React.useState(startIndex);\n  const [status, setStatus] = React.useState<\"idle\" | \"busy\" | \"done\">(\"idle\");\n  const [open, setOpen] = React.useState(false);\n  const [email, setEmail] = React.useState(\"\");\n  const [emailTouched, setEmailTouched] = React.useState(false);\n  const refs = React.useRef<(HTMLButtonElement | null)[]>([]);\n\n  const current = providers[Math.min(active, providers.length - 1)];\n  const step = 360 / Math.max(1, providers.length);\n  const radius = 110;\n\n  const go = async (index: number) => {\n    if (status === \"busy\") return;\n    setActive(index);\n    setStatus(\"busy\");\n    try {\n      const p = providers[index];\n      const r = onProvider ? await onProvider(p.id) : await new Promise<boolean>((res) => setTimeout(() => res(true), 1400));\n      setStatus(r === false ? \"idle\" : \"done\");\n    } catch {\n      setStatus(\"idle\");\n    }\n  };\n\n  const onKey = (e: React.KeyboardEvent<HTMLButtonElement>, i: number) => {\n    const n = providers.length;\n    let next = -1;\n    if (e.key === \"ArrowRight\" || e.key === \"ArrowDown\") next = (i + 1) % n;\n    if (e.key === \"ArrowLeft\" || e.key === \"ArrowUp\") next = (i - 1 + n) % n;\n    if (e.key === \"Home\") next = 0;\n    if (e.key === \"End\") next = n - 1;\n    if (next < 0) return;\n    e.preventDefault();\n    setActive(next);\n    refs.current[next]?.focus();\n  };\n\n  const submitEmail = (e: React.FormEvent) => {\n    e.preventDefault();\n    setEmailTouched(true);\n    if (!isEmail(email)) return;\n    onEmail?.(email.trim());\n  };\n\n  return (\n    <section\n      className={[\"hb-vf6\", className].filter(Boolean).join(\" \")}\n      data-status={status}\n      style={{ \"--hb-vf6-tint\": current?.tint ?? \"#e5e5e5\", \"--hb-vf6-dur\": `${speed}s`, ...style } as React.CSSProperties}\n      {...rest}\n    >\n      <style href=\"hb-auth-social-orbit\" precedence=\"default\">{css}</style>\n      <div className=\"hb-vf6-card\">\n        <div className=\"hb-vf6-ring\">\n          <div className=\"hb-vf6-track\" aria-hidden=\"true\" />\n          <div className=\"hb-vf6-orbit\">\n            <span className=\"hb-vf6-beam\" aria-hidden=\"true\" style={{ transform: `rotate(${(active * step + 180).toFixed(2)}deg)` }} />\n            <div role=\"group\" aria-label={`Sign in to ${brand} with`}>\n              {providers.map((p, i) => {\n                const a = i * step;\n                const x = (Math.sin((a * Math.PI) / 180) * radius).toFixed(2);\n                const y = (-Math.cos((a * Math.PI) / 180) * radius).toFixed(2);\n                return (\n                  <div key={p.id} className=\"hb-vf6-slot\" style={{ transform: `translate(${x}px, ${y}px)` }}>\n                    <div className=\"hb-vf6-spin\">\n                      <button\n                        ref={(el) => { refs.current[i] = el; }}\n                        type=\"button\"\n                        className=\"hb-vf6-prov\"\n                        data-active={i === active}\n                        tabIndex={i === active ? 0 : -1}\n                        aria-label={`Continue with ${p.label}${p.id === lastUsed ? \", last used\" : \"\"}`}\n                        style={{ \"--hb-vf6-c\": p.tint ?? \"#e5e5e5\" } as React.CSSProperties}\n                        onMouseEnter={() => status !== \"busy\" && setActive(i)}\n                        onFocus={() => status !== \"busy\" && setActive(i)}\n                        onClick={() => go(i)}\n                        onKeyDown={(e) => onKey(e, i)}\n                      >\n                        <Glyph p={p} />\n                        {p.id === lastUsed ? <span className=\"hb-vf6-last\" aria-hidden=\"true\">LAST</span> : null}\n                      </button>\n                    </div>\n                  </div>\n                );\n              })}\n            </div>\n          </div>\n          <div className=\"hb-vf6-core\" aria-hidden=\"true\">\n            <span className=\"hb-vf6-core-in\" data-on={status !== \"done\"}>\n              <svg width=\"38\" height=\"38\" viewBox=\"0 0 40 40\" fill=\"none\">\n                <path d=\"M20 4 34 20 20 36 6 20Z\" stroke=\"#ededed\" strokeWidth=\"2\" strokeLinejoin=\"round\" />\n                <path d=\"M20 4v32M6 20h28\" stroke=\"var(--hb-vf6-tint)\" strokeWidth=\"1.6\" />\n              </svg>\n            </span>\n            <span className=\"hb-vf6-core-in\" data-on={status === \"done\"}>\n              <svg width=\"34\" height=\"34\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M5 12.5 10 17l9-10\" stroke=\"var(--hb-vf6-tint)\" strokeWidth=\"2.4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>\n            </span>\n          </div>\n        </div>\n        <h2 className=\"hb-vf6-title\">{status === \"done\" ? `Connected with ${current.label}` : title}</h2>\n        <p className=\"hb-vf6-sub\" aria-live=\"polite\">{status === \"done\" ? `Taking you to ${brand}. This window will close on its own.` : subtitle}</p>\n        <button type=\"button\" className=\"hb-vf6-cta\" onClick={() => go(active)} disabled={status !== \"idle\"} aria-busy={status === \"busy\"}>\n          <span key={`${current.id}-${status}`} className=\"hb-vf6-label\">\n            <Glyph p={current} size={18} />\n            {status === \"busy\" ? <>Opening {current.label} <span className=\"hb-vf6-dots\" aria-hidden=\"true\"><i /><i /><i /></span></> : status === \"done\" ? \"Redirecting\" : `Continue with ${current.label}`}\n          </span>\n        </button>\n        <button type=\"button\" className=\"hb-vf6-more\" aria-expanded={open} aria-controls={`${id}-panel`} onClick={() => setOpen((o) => !o)}>\n          Use email instead\n          <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" aria-hidden=\"true\"><path d=\"m3 4.5 3 3 3-3\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>\n        </button>\n        <div id={`${id}-panel`} className=\"hb-vf6-panel\" data-open={open}>\n          <div>\n            <form className=\"hb-vf6-email\" onSubmit={submitEmail} noValidate>\n              <input className=\"hb-vf6-input\" type=\"email\" placeholder=\"you@company.com\" aria-label=\"Email address\" value={email} onChange={(e) => setEmail(e.target.value)} tabIndex={open ? 0 : -1} aria-invalid={emailTouched && !isEmail(email) ? true : undefined} />\n              <button type=\"submit\" className=\"hb-vf6-go\" aria-label=\"Continue with email\" tabIndex={open ? 0 : -1}>\n                <svg width=\"15\" height=\"15\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\"><path d=\"M3 8h10m-4-4 4 4-4 4\" stroke=\"currentColor\" strokeWidth=\"1.7\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>\n              </button>\n            </form>\n          </div>\n        </div>\n        <p className=\"hb-vf6-terms\">By continuing you agree to the {brand} <a href={terms.href}>{terms.label}</a>.</p>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}