{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "social-login-glass",
  "type": "registry:component",
  "title": "Social Login Glass",
  "description": "Frosted glass pills with a light streak that follows the pointer and a blurred orb of the provider color glowing from behind. While connecting, the orb sweeps back and forth and a ring spins around the glyph.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "buttons",
    "login",
    "glass",
    "blur",
    "oauth",
    "social",
    "pointer"
  ],
  "docs": "https://hyperblur.dev/effects/social-login-glass",
  "files": [
    {
      "path": "registry/hyperblur/social-login-glass.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/social-login-glass.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport type SocialProviderId =\n  | \"google\"\n  | \"github\"\n  | \"apple\"\n  | \"x\"\n  | \"linkedin\"\n  | \"discord\"\n  | \"facebook\"\n  | \"microsoft\"\n  | \"slack\"\n  | \"spotify\"\n  | \"twitch\"\n  | \"figma\"\n  | \"email\"\n  | \"link\";\n\nexport interface SocialProviderConfig {\n  id: string;\n  label?: string;\n  icon?: React.ReactNode;\n  color?: string;\n  bg?: string;\n  fg?: string;\n}\n\nexport type SocialProvider = SocialProviderId | SocialProviderConfig;\n\nconst BRANDS: Record<SocialProviderId, { label: string; color: string; bg: string; fg: string }> = {\n  google: { label: \"Google\", color: \"#4285f4\", bg: \"#ffffff\", fg: \"#1f1f1f\" },\n  github: { label: \"GitHub\", color: \"#c9d1d9\", bg: \"#24292f\", fg: \"#ffffff\" },\n  apple: { label: \"Apple\", color: \"#f5f5f7\", bg: \"#000000\", fg: \"#ffffff\" },\n  x: { label: \"X\", color: \"#e7e9ea\", bg: \"#0f1419\", fg: \"#ffffff\" },\n  linkedin: { label: \"LinkedIn\", color: \"#3b8fe0\", bg: \"#0a66c2\", fg: \"#ffffff\" },\n  discord: { label: \"Discord\", color: \"#7983f5\", bg: \"#5865f2\", fg: \"#ffffff\" },\n  facebook: { label: \"Facebook\", color: \"#4a95f5\", bg: \"#1877f2\", fg: \"#ffffff\" },\n  microsoft: { label: \"Microsoft\", color: \"#36b3f0\", bg: \"#2f2f2f\", fg: \"#ffffff\" },\n  slack: { label: \"Slack\", color: \"#e8587f\", bg: \"#4a154b\", fg: \"#ffffff\" },\n  spotify: { label: \"Spotify\", color: \"#1ed760\", bg: \"#1db954\", fg: \"#04140a\" },\n  twitch: { label: \"Twitch\", color: \"#a970ff\", bg: \"#9146ff\", fg: \"#ffffff\" },\n  figma: { label: \"Figma\", color: \"#b17cff\", bg: \"#1e1e1e\", fg: \"#ffffff\" },\n  email: { label: \"Email\", color: \"#f5b450\", bg: \"#2a2014\", fg: \"#ffe8c2\" },\n  link: { label: \"Copy link\", color: \"#a1a1a1\", bg: \"#262626\", fg: \"#ededed\" },\n};\n\nfunction Glyph({ id }: { id: string }) {\n  let body: React.ReactNode;\n  switch (id) {\n    case \"google\":\n      body = <path d=\"M18.4 7.2A8 8 0 1 0 20 12h-7.4\" />;\n      break;\n    case \"github\":\n      body = (\n        <>\n          <circle cx=\"7\" cy=\"5.5\" r=\"2.1\" />\n          <circle cx=\"7\" cy=\"18.5\" r=\"2.1\" />\n          <circle cx=\"17\" cy=\"7\" r=\"2.1\" />\n          <path d=\"M7 7.6v8.8M17 9.1v1.2a3 3 0 0 1-3 3h-4a3 3 0 0 0-3 3\" />\n        </>\n      );\n      break;\n    case \"apple\":\n      body = (\n        <>\n          <path d=\"M12 8.2c-1.7-1.3-4.7-1.2-6 1.1-1.5 2.6-.5 6.9 1.6 9.4 1.1 1.3 2.2 1.6 3.2 1.1.8-.4 1.6-.4 2.4 0 1 .5 2.1.2 3.2-1.1 2.1-2.5 3.1-6.8 1.6-9.4-1.3-2.3-4.3-2.4-6-1.1z\" />\n          <path d=\"M12 8.2c0-1.7.5-2.9 1.6-3.9\" />\n        </>\n      );\n      break;\n    case \"x\":\n      body = <path d=\"M5.5 5.5l13 13M18.5 5.5l-13 13\" />;\n      break;\n    case \"linkedin\":\n      body = (\n        <>\n          <circle cx=\"6.5\" cy=\"6\" r=\"1.3\" fill=\"currentColor\" stroke=\"none\" />\n          <path d=\"M6.5 10v8.5M11 18.5V10m0 3.4c0-2 1.5-3.4 3.3-3.4s3.2 1.4 3.2 3.4v5.1\" />\n        </>\n      );\n      break;\n    case \"discord\":\n      body = (\n        <>\n          <path d=\"M7.6 7.5h8.8a4 4 0 0 1 3.9 3.1l.9 4.1a2.3 2.3 0 0 1-3.9 2.1l-1.9-1.9H8.6l-1.9 1.9a2.3 2.3 0 0 1-3.9-2.1l.9-4.1a4 4 0 0 1 3.9-3.1z\" />\n          <path d=\"M8.2 10.4v2.8M6.8 11.8h2.8\" />\n          <circle cx=\"15.6\" cy=\"11\" r=\".8\" fill=\"currentColor\" stroke=\"none\" />\n          <circle cx=\"17.2\" cy=\"12.6\" r=\".8\" fill=\"currentColor\" stroke=\"none\" />\n        </>\n      );\n      break;\n    case \"facebook\":\n      body = <path d=\"M15.5 4.5h-1.8a2.7 2.7 0 0 0-2.7 2.7v12.3M8.5 11h6.5\" />;\n      break;\n    case \"microsoft\":\n      body = (\n        <>\n          <rect x=\"4.5\" y=\"4.5\" width=\"6.4\" height=\"6.4\" rx=\"1.4\" />\n          <rect x=\"13.1\" y=\"4.5\" width=\"6.4\" height=\"6.4\" rx=\"1.4\" />\n          <rect x=\"4.5\" y=\"13.1\" width=\"6.4\" height=\"6.4\" rx=\"1.4\" />\n          <rect x=\"13.1\" y=\"13.1\" width=\"6.4\" height=\"6.4\" rx=\"1.4\" />\n        </>\n      );\n      break;\n    case \"slack\":\n      body = <path d=\"M10 4.5 8.4 19.5M15.6 4.5 14 19.5M5 9.2h14.5M4.5 14.8H19\" />;\n      break;\n    case \"spotify\":\n      body = <path d=\"M4.5 10.5v3M8.25 7.5v9M12 4.5v15M15.75 8v8M19.5 10.5v3\" />;\n      break;\n    case \"twitch\":\n      body = (\n        <>\n          <path d=\"M6.5 4.5h11a2 2 0 0 1 2 2V14a2 2 0 0 1-2 2H12l-4 3.5V16H6.5a2 2 0 0 1-2-2V6.5a2 2 0 0 1 2-2z\" />\n          <path d=\"M10.2 8.5v3.2M14.4 8.5v3.2\" />\n        </>\n      );\n      break;\n    case \"figma\":\n      body = (\n        <>\n          <path d=\"M12 3.5 18 11l-6 9.5L6 11z\" />\n          <path d=\"M12 3.5v8\" />\n          <circle cx=\"12\" cy=\"13\" r=\"1.5\" />\n        </>\n      );\n      break;\n    case \"email\":\n      body = (\n        <>\n          <rect x=\"3.5\" y=\"5.5\" width=\"17\" height=\"13\" rx=\"2.5\" />\n          <path d=\"m4.5 7.5 7.5 5.5 7.5-5.5\" />\n        </>\n      );\n      break;\n    case \"link\":\n      body = (\n        <>\n          <path d=\"M10.2 13.8a3.6 3.6 0 0 0 5.1 0l3-3a3.6 3.6 0 0 0-5.1-5.1l-1.1 1.1\" />\n          <path d=\"M13.8 10.2a3.6 3.6 0 0 0-5.1 0l-3 3a3.6 3.6 0 0 0 5.1 5.1l1.1-1.1\" />\n        </>\n      );\n      break;\n    default:\n      body = <circle cx=\"12\" cy=\"12\" r=\"7\" />;\n  }\n  return (\n    <svg\n      viewBox=\"0 0 24 24\"\n      width=\"1em\"\n      height=\"1em\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth={1.9}\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n      aria-hidden=\"true\"\n      focusable=\"false\"\n    >\n      {body}\n    </svg>\n  );\n}\n\ninterface ResolvedProvider {\n  id: string;\n  label: string;\n  color: string;\n  bg: string;\n  fg: string;\n  icon: React.ReactNode;\n}\n\nfunction resolveProvider(p: SocialProvider): ResolvedProvider {\n  const cfg: SocialProviderConfig = typeof p === \"string\" ? { id: p } : p;\n  const brand = BRANDS[cfg.id as SocialProviderId] as (typeof BRANDS)[SocialProviderId] | undefined;\n  return {\n    id: cfg.id,\n    label: cfg.label ?? brand?.label ?? cfg.id,\n    color: cfg.color ?? brand?.color ?? \"#2f7bff\",\n    bg: cfg.bg ?? brand?.bg ?? cfg.color ?? \"#2f7bff\",\n    fg: cfg.fg ?? brand?.fg ?? \"#ffffff\",\n    icon: cfg.icon ?? <Glyph id={cfg.id} />,\n  };\n}\n\nfunction usePendingProvider(onSelect: ((id: string) => void | Promise<unknown>) | undefined, duration: number) {\n  const [pending, setPending] = React.useState<string | null>(null);\n  const timer = React.useRef<number | undefined>(undefined);\n  const alive = React.useRef(true);\n\n  React.useEffect(() => {\n    alive.current = true;\n    return () => {\n      alive.current = false;\n      window.clearTimeout(timer.current);\n    };\n  }, []);\n\n  const run = (id: string) => {\n    if (pending) return;\n    setPending(id);\n    const out = onSelect?.(id);\n    if (out && typeof (out as Promise<unknown>).then === \"function\") {\n      (out as Promise<unknown>).then(\n        () => {\n          if (alive.current) setPending(null);\n        },\n        () => {\n          if (alive.current) setPending(null);\n        },\n      );\n      return;\n    }\n    window.clearTimeout(timer.current);\n    timer.current = window.setTimeout(() => {\n      if (alive.current) setPending(null);\n    }, duration);\n  };\n\n  return [pending, run] as const;\n}\n\nexport interface SocialLoginGlassProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onSelect\"> {\n  providers?: SocialProvider[];\n  labelPrefix?: string;\n  backdrop?: boolean;\n  onSelect?: (provider: string) => void | Promise<unknown>;\n  pendingDuration?: number;\n  disabled?: boolean;\n}\n\nconst css = `\n.hb-xc3 { position: relative; width: 100%; box-sizing: border-box; font-family: inherit; isolation: isolate; }\n.hb-xc3 *, .hb-xc3 *::before, .hb-xc3 *::after { box-sizing: border-box; }\n.hb-xc3[data-backdrop=\"true\"] { padding: 14px; border-radius: 22px; overflow: hidden; background: #0b0b12; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }\n.hb-xc3-amb { position: absolute; inset: 0; z-index: -1; pointer-events: none; }\n.hb-xc3-amb span { position: absolute; border-radius: 50%; filter: blur(26px); opacity: 0.75; animation: hb-xc3-drift 14s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate; }\n.hb-xc3-amb span:nth-child(1) { width: 55%; height: 70%; left: -8%; top: -20%; background: #3b5bff; }\n.hb-xc3-amb span:nth-child(2) { width: 45%; height: 60%; right: -6%; top: 10%; background: #c43bff; animation-delay: -5s; animation-duration: 17s; }\n.hb-xc3-amb span:nth-child(3) { width: 50%; height: 55%; left: 25%; bottom: -30%; background: #ff7a3b; opacity: 0.55; animation-delay: -9s; }\n.hb-xc3-list { display: flex; flex-direction: column; gap: 9px; }\n.hb-xc3-b {\n  --hb-xc3-c: #7fb3ff;\n  --hb-xc3-x: 50%;\n  --hb-xc3-y: 50%;\n  position: relative;\n  display: flex;\n  align-items: center;\n  gap: 11px;\n  width: 100%;\n  height: 44px;\n  margin: 0;\n  padding: 0 16px 0 7px;\n  border: 0;\n  border-radius: 999px;\n  font: inherit;\n  font-size: 13.5px;\n  font-weight: 500;\n  letter-spacing: -0.005em;\n  color: rgba(255, 255, 255, 0.92);\n  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035));\n  -webkit-backdrop-filter: blur(18px) saturate(170%);\n  backdrop-filter: blur(18px) saturate(170%);\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 -10px 18px -14px rgba(255, 255, 255, 0.18), 0 10px 26px -14px rgba(0, 0, 0, 0.75);\n  cursor: pointer;\n  text-align: left;\n  overflow: hidden;\n  isolation: isolate;\n  user-select: none;\n  -webkit-tap-highlight-color: transparent;\n  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, opacity 0.3s ease;\n}\n.hb-xc3-b:hover:not(:disabled), .hb-xc3-b:focus-visible { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), inset 0 0 0 1px rgba(255, 255, 255, 0.16), inset 0 -10px 18px -14px rgba(255, 255, 255, 0.24), 0 14px 30px -14px color-mix(in srgb, var(--hb-xc3-c) 45%, rgba(0, 0, 0, 0.8)); }\n.hb-xc3-b:active:not(:disabled) { transform: scale(0.985); transition-duration: 0.12s; }\n.hb-xc3-b:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.85); outline-offset: 3px; }\n.hb-xc3-b:disabled { cursor: default; }\n.hb-xc3[data-busy=\"true\"] .hb-xc3-b:not([data-pending=\"true\"]) { opacity: 0.4; }\n.hb-xc3[data-off=\"true\"] .hb-xc3-b { opacity: 0.45; cursor: not-allowed; }\n.hb-xc3-orb {\n  position: absolute;\n  z-index: -1;\n  left: var(--hb-xc3-x);\n  top: 50%;\n  width: 130px;\n  height: 130px;\n  border-radius: 50%;\n  background: radial-gradient(circle, var(--hb-xc3-c) 0%, color-mix(in srgb, var(--hb-xc3-c) 40%, transparent) 38%, transparent 68%);\n  filter: blur(14px);\n  opacity: 0;\n  transform: translate(-50%, -50%) scale(0.7);\n  transition: opacity 0.45s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);\n  pointer-events: none;\n}\n.hb-xc3-spec {\n  position: absolute;\n  inset: 0;\n  z-index: 0;\n  border-radius: inherit;\n  background: radial-gradient(90px circle at var(--hb-xc3-x) var(--hb-xc3-y), rgba(255, 255, 255, 0.26), transparent 70%);\n  opacity: 0;\n  transition: opacity 0.35s ease;\n  pointer-events: none;\n}\n.hb-xc3-b:hover:not(:disabled) .hb-xc3-orb, .hb-xc3-b:focus-visible .hb-xc3-orb { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }\n.hb-xc3-b:hover:not(:disabled) .hb-xc3-spec { opacity: 1; }\n.hb-xc3-b[data-pending=\"true\"] .hb-xc3-orb { opacity: 0.65; transform: translate(-50%, -50%) scale(1); animation: hb-xc3-scan 1.6s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate; }\n.hb-xc3-chip {\n  position: relative;\n  z-index: 1;\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  flex: none;\n  width: 30px;\n  height: 30px;\n  border-radius: 50%;\n  font-size: 16px;\n  color: #ffffff;\n  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.06));\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 4px 10px -4px rgba(0, 0, 0, 0.5);\n}\n.hb-xc3-chip svg { display: block; }\n.hb-xc3-ring {\n  position: absolute;\n  inset: -3px;\n  border-radius: 50%;\n  background: conic-gradient(from 0deg, transparent 0 55%, #ffffff 100%);\n  -webkit-mask: radial-gradient(circle, transparent 15.5px, #000 16px);\n  mask: radial-gradient(circle, transparent 15.5px, #000 16px);\n  animation: hb-xc3-spin 0.9s linear infinite;\n}\n.hb-xc3-l { position: relative; z-index: 1; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25); }\n.hb-xc3-l b { font-weight: 600; color: #ffffff; }\n.hb-xc3-k { position: relative; z-index: 1; flex: none; font-size: 11px; color: rgba(255, 255, 255, 0.55); transition: color 0.3s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1); }\n.hb-xc3-b:hover:not(:disabled) .hb-xc3-k { color: #ffffff; transform: translateX(2px); }\n@keyframes hb-xc3-drift { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(14%, 10%) scale(1.15); } }\n@keyframes hb-xc3-scan { from { left: 12%; } to { left: 88%; } }\n@keyframes hb-xc3-spin { to { transform: rotate(360deg); } }\n@media (prefers-reduced-motion: reduce) {\n  .hb-xc3-amb span, .hb-xc3-b[data-pending=\"true\"] .hb-xc3-orb { animation: none; }\n  .hb-xc3-ring { animation-duration: 2.4s; }\n  .hb-xc3-b, .hb-xc3-orb, .hb-xc3-spec, .hb-xc3-k { transition: none; }\n  .hb-xc3-b:hover:not(:disabled), .hb-xc3-b:focus-visible, .hb-xc3-b:active:not(:disabled) { transform: none; }\n}\n`;\n\nexport function SocialLoginGlass({\n  providers = [\"apple\", \"google\", \"discord\"],\n  labelPrefix = \"Continue with\",\n  backdrop = true,\n  onSelect,\n  pendingDuration = 1400,\n  disabled = false,\n  className = \"\",\n  ...rest\n}: SocialLoginGlassProps) {\n  const [pending, run] = usePendingProvider(onSelect, pendingDuration);\n  const items = providers.map(resolveProvider);\n\n  function track(e: React.PointerEvent<HTMLButtonElement>) {\n    const el = e.currentTarget;\n    const r = el.getBoundingClientRect();\n    if (!r.width || !r.height) return;\n    el.style.setProperty(\"--hb-xc3-x\", `${(((e.clientX - r.left) / r.width) * 100).toFixed(1)}%`);\n    el.style.setProperty(\"--hb-xc3-y\", `${(((e.clientY - r.top) / r.height) * 100).toFixed(1)}%`);\n  }\n\n  return (\n    <>\n      <style href=\"hb-social-login-glass\" precedence=\"default\">{css}</style>\n      <div\n        className={`hb-xc3 ${className}`}\n        data-backdrop={backdrop ? \"true\" : undefined}\n        data-busy={pending ? \"true\" : undefined}\n        data-off={disabled ? \"true\" : undefined}\n        aria-busy={pending ? true : undefined}\n        {...rest}\n      >\n        {backdrop ? (\n          <div className=\"hb-xc3-amb\" aria-hidden=\"true\">\n            <span />\n            <span />\n            <span />\n          </div>\n        ) : null}\n        <div className=\"hb-xc3-list\">\n          {items.map((p) => {\n            const isPending = pending === p.id;\n            return (\n              <button\n                key={p.id}\n                type=\"button\"\n                className=\"hb-xc3-b\"\n                style={{ \"--hb-xc3-c\": p.color } as React.CSSProperties}\n                data-pending={isPending ? \"true\" : undefined}\n                disabled={disabled || (pending !== null && !isPending)}\n                onPointerMove={track}\n                onPointerEnter={track}\n                onClick={() => {\n                  if (!isPending) run(p.id);\n                }}\n              >\n                <span className=\"hb-xc3-orb\" aria-hidden=\"true\" />\n                <span className=\"hb-xc3-spec\" aria-hidden=\"true\" />\n                <span className=\"hb-xc3-chip\">\n                  {p.icon}\n                  {isPending ? <span className=\"hb-xc3-ring\" aria-hidden=\"true\" /> : null}\n                </span>\n                <span className=\"hb-xc3-l\">\n                  {isPending ? `Waiting for ${p.label}` : labelPrefix} {isPending ? null : <b>{p.label}</b>}\n                </span>\n                <span className=\"hb-xc3-k\" aria-hidden=\"true\">\n                  {isPending ? \"...\" : (\n                    <svg viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" strokeWidth={1.7} strokeLinecap=\"round\" strokeLinejoin=\"round\">\n                      <path d=\"M5 11 11 5M6 5h5v5\" />\n                    </svg>\n                  )}\n                </span>\n              </button>\n            );\n          })}\n        </div>\n      </div>\n    </>\n  );\n}\n"
    }
  ]
}