{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "login-social-first",
  "type": "registry:component",
  "title": "Login Social First",
  "description": "A light sign-in page that leads with a grid of provider buttons with generic glyphs and a Last used badge, then an email and password form below a divider.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "auth",
    "login",
    "social login",
    "oauth",
    "light",
    "providers",
    "sso"
  ],
  "docs": "https://hyperblur.dev/effects/login-social-first",
  "files": [
    {
      "path": "registry/hyperblur/login-social-first.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/login-social-first.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface LoginSocialFirstLink {\n  label: string;\n  href: string;\n}\n\nexport type LoginSocialFirstGlyph = \"ring\" | \"square\" | \"triangle\" | \"hex\" | \"bolt\" | \"key\";\n\nexport interface LoginSocialFirstProvider {\n  id: string;\n  label: string;\n  glyph?: LoginSocialFirstGlyph;\n  color?: string;\n}\n\nexport interface LoginSocialFirstValues {\n  email: string;\n  password: string;\n}\n\nexport interface LoginSocialFirstProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\" | \"onSubmit\"> {\n  title?: string;\n  subtitle?: string;\n  providers?: LoginSocialFirstProvider[];\n  lastUsed?: string | null;\n  onProviderClick?: (id: string) => void;\n  onSubmit?: (values: LoginSocialFirstValues) => boolean | void | Promise<boolean | void>;\n  signup?: LoginSocialFirstLink;\n  terms?: LoginSocialFirstLink;\n  privacy?: LoginSocialFirstLink;\n  accent?: string;\n}\n\nconst css = `\n.hb-qh3 {\n  --hb-qh3-accent: #2f7bff;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  overflow: hidden;\n  container-type: inline-size;\n  background: #fbfaf7;\n  color: #15171c;\n  font-family: inherit;\n  padding: clamp(64px, 9cqw, 112px) 20px;\n}\n.hb-qh3 *, .hb-qh3 *::before, .hb-qh3 *::after { box-sizing: border-box; }\n.hb-qh3::before { content: \"\"; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgba(21,23,28,.12) 1px, transparent 1px); background-size: 22px 22px; mask: radial-gradient(ellipse 70% 60% at 50% 30%, #000, transparent 75%); }\n.hb-qh3::after { content: \"\"; position: absolute; left: 50%; top: -30%; width: 70%; height: 70%; transform: translateX(-50%); pointer-events: none; background: radial-gradient(closest-side, color-mix(in srgb, var(--hb-qh3-accent) 14%, transparent), transparent); }\n.hb-qh3-inner { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }\n.hb-qh3-head { text-align: center; margin-bottom: 32px; }\n.hb-qh3-logo { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: #15171c; color: #fff; box-shadow: 0 10px 24px -10px rgba(21,23,28,.5); margin-bottom: 18px; }\n.hb-qh3-title { margin: 0; font-size: clamp(28px, 4.2cqw, 40px); letter-spacing: -.03em; line-height: 1.08; font-weight: 600; }\n.hb-qh3-sub { margin: 10px auto 0; max-width: 440px; color: #5f6470; font-size: 15px; line-height: 1.55; }\n.hb-qh3-card { padding: 22px; border-radius: 22px; background: #fff; border: 1px solid rgba(21,23,28,.08); box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 1px 2px rgba(21,23,28,.04), 0 24px 60px -30px rgba(21,23,28,.25); }\n.hb-qh3-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }\n.hb-qh3-prov { position: relative; display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 14px; border-radius: 13px; border: 1px solid rgba(21,23,28,.1); background: #fff; color: #15171c; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; text-align: left; opacity: 0; animation: hb-qh3-in .5s cubic-bezier(.2,.7,.2,1) forwards; transition: border-color .2s, box-shadow .2s, transform .2s, background .2s; }\n.hb-qh3-prov:hover { border-color: rgba(21,23,28,.22); background: #fcfcfb; box-shadow: 0 8px 20px -12px rgba(21,23,28,.35); transform: translateY(-2px); }\n.hb-qh3-prov:active { transform: translateY(0); }\n.hb-qh3-prov:focus-visible, .hb-qh3-btn:focus-visible, .hb-qh3-link:focus-visible { outline: 2px solid var(--hb-qh3-accent); outline-offset: 2px; }\n.hb-qh3-glyph { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: color-mix(in srgb, var(--hb-qh3-g) 12%, white); color: var(--hb-qh3-g); transition: transform .4s cubic-bezier(.3,1.6,.5,1); }\n.hb-qh3-prov:hover .hb-qh3-glyph { transform: rotate(-12deg) scale(1.08); }\n.hb-qh3-plabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.hb-qh3-last { margin-left: auto; flex: none; height: 20px; padding: 0 8px; border-radius: 999px; display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; color: var(--hb-qh3-accent); background: color-mix(in srgb, var(--hb-qh3-accent) 10%, white); }\n.hb-qh3-prov[data-last=\"true\"] { border-color: color-mix(in srgb, var(--hb-qh3-accent) 45%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hb-qh3-accent) 10%, transparent); }\n.hb-qh3-div { display: flex; align-items: center; gap: 14px; margin: 22px 0 18px; color: #8b8f99; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }\n.hb-qh3-div::before, .hb-qh3-div::after { content: \"\"; flex: 1; height: 1px; background: rgba(21,23,28,.09); }\n.hb-qh3-form { display: grid; gap: 12px; }\n.hb-qh3-fields { display: grid; gap: 12px; }\n.hb-qh3-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: #3a3e48; }\n.hb-qh3-input { width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(21,23,28,.14); background: #fbfbfa; color: #15171c; font: inherit; font-size: 14px; outline: none; transition: border-color .2s, box-shadow .2s, background .2s; }\n.hb-qh3-input::placeholder { color: #a3a7b0; }\n.hb-qh3-input:focus { background: #fff; border-color: var(--hb-qh3-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--hb-qh3-accent) 14%, transparent); }\n.hb-qh3-input[aria-invalid=\"true\"] { border-color: #e5484d; box-shadow: 0 0 0 4px rgba(229,72,77,.1); }\n.hb-qh3-err { margin: 6px 0 0; font-size: 12px; color: #d1343a; }\n.hb-qh3-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border: 0; border-radius: 12px; background: #15171c; color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .2s, transform .2s; }\n.hb-qh3-btn:hover { background: #262a33; }\n.hb-qh3-btn:disabled { cursor: progress; }\n.hb-qh3-btn svg { transition: transform .25s; }\n.hb-qh3-btn:hover svg { transform: translateX(3px); }\n.hb-qh3-spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; animation: hb-qh3-turn .7s linear infinite; }\n.hb-qh3-alert { margin: 0; padding: 10px 12px; border-radius: 10px; background: #fff1f1; color: #b4262c; font-size: 13px; border: 1px solid #ffd6d6; }\n.hb-qh3-ok { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; background: color-mix(in srgb, var(--hb-qh3-accent) 8%, white); border: 1px solid color-mix(in srgb, var(--hb-qh3-accent) 25%, transparent); font-size: 14px; animation: hb-qh3-in .4s ease both; }\n.hb-qh3-ok i { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--hb-qh3-accent); color: #fff; }\n.hb-qh3-foot { margin: 22px 0 0; text-align: center; color: #6b707b; font-size: 13px; line-height: 1.6; }\n.hb-qh3-link { color: #15171c; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(21,23,28,.25); border-radius: 3px; }\n.hb-qh3-link:hover { text-decoration-color: currentColor; }\n@container (min-width: 600px) {\n  .hb-qh3-grid { grid-template-columns: repeat(3, 1fr); }\n  .hb-qh3-card { padding: 28px; }\n  .hb-qh3-fields { grid-template-columns: 1fr 1fr; }\n}\n@keyframes hb-qh3-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }\n@keyframes hb-qh3-turn { to { transform: rotate(360deg); } }\n@media (prefers-reduced-motion: reduce) {\n  .hb-qh3 *, .hb-qh3 *::before, .hb-qh3 *::after { animation: none !important; transition: none !important; }\n  .hb-qh3-prov { opacity: 1; }\n}\n`;\n\nfunction Glyph({ kind }: { kind: LoginSocialFirstGlyph }) {\n  const common = { fill: \"none\", stroke: \"currentColor\", strokeWidth: 1.8, strokeLinejoin: \"round\" as const, strokeLinecap: \"round\" as const };\n  return (\n    <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n      {kind === \"ring\" && <><circle cx=\"8\" cy=\"8\" r=\"5.5\" {...common} /><circle cx=\"8\" cy=\"8\" r=\"2\" fill=\"currentColor\" /></>}\n      {kind === \"square\" && <><rect x=\"2.5\" y=\"2.5\" width=\"4.5\" height=\"4.5\" rx=\"1\" fill=\"currentColor\" /><rect x=\"9\" y=\"2.5\" width=\"4.5\" height=\"4.5\" rx=\"1\" {...common} /><rect x=\"2.5\" y=\"9\" width=\"4.5\" height=\"4.5\" rx=\"1\" {...common} /><rect x=\"9\" y=\"9\" width=\"4.5\" height=\"4.5\" rx=\"1\" fill=\"currentColor\" /></>}\n      {kind === \"triangle\" && <path d=\"M8 2.5 14 13H2L8 2.5Z\" {...common} />}\n      {kind === \"hex\" && <path d=\"M8 1.8 13.4 5v6L8 14.2 2.6 11V5L8 1.8Z\" {...common} />}\n      {kind === \"bolt\" && <path d=\"M9 1.8 3.5 9H8l-1 5.2L12.5 7H8l1-5.2Z\" fill=\"currentColor\" />}\n      {kind === \"key\" && <><circle cx=\"5.5\" cy=\"8\" r=\"3\" {...common} /><path d=\"M8.5 8h5.5M12 8v2.5\" {...common} /></>}\n    </svg>\n  );\n}\n\nfunction wait(result: unknown) {\n  return result instanceof Promise ? result : new Promise<unknown>((resolve) => setTimeout(() => resolve(result), 900));\n}\n\nexport function LoginSocialFirst({\n  title = \"Sign in to Parcel\",\n  subtitle = \"Pick the account you use at work. We'll match you to your team's workspace automatically.\",\n  providers = [\n    { id: \"google\", label: \"Google\", glyph: \"ring\", color: \"#ea4335\" },\n    { id: \"microsoft\", label: \"Microsoft\", glyph: \"square\", color: \"#0078d4\" },\n    { id: \"apple\", label: \"Apple\", glyph: \"hex\", color: \"#15171c\" },\n    { id: \"github\", label: \"GitHub\", glyph: \"triangle\", color: \"#6e40c9\" },\n    { id: \"slack\", label: \"Slack\", glyph: \"bolt\", color: \"#e01e5a\" },\n    { id: \"sso\", label: \"Single sign-on\", glyph: \"key\", color: \"#0f9d74\" },\n  ],\n  lastUsed = \"google\",\n  onProviderClick,\n  onSubmit,\n  signup = { label: \"Start a free trial\", href: \"#signup\" },\n  terms = { label: \"Terms\", href: \"#terms\" },\n  privacy = { label: \"Privacy Policy\", href: \"#privacy\" },\n  accent = \"#2f7bff\",\n  className = \"\",\n  style,\n  ...rest\n}: LoginSocialFirstProps) {\n  const uid = React.useId();\n  const [email, setEmail] = React.useState(\"\");\n  const [password, setPassword] = React.useState(\"\");\n  const [errors, setErrors] = React.useState<{ email?: string; password?: string }>({});\n  const [status, setStatus] = React.useState<\"idle\" | \"loading\" | \"error\" | \"success\">(\"idle\");\n\n  async function handleSubmit(event: React.FormEvent<HTMLFormElement>) {\n    event.preventDefault();\n    if (status === \"loading\") return;\n    const next: { email?: string; password?: string } = {};\n    if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email.trim())) next.email = \"Enter a valid work email.\";\n    if (password.length < 8) next.password = \"At least 8 characters.\";\n    setErrors(next);\n    if (next.email || next.password) return;\n    setStatus(\"loading\");\n    try {\n      const result = await wait(onSubmit ? onSubmit({ email: email.trim(), password }) : true);\n      setStatus(result === false ? \"error\" : \"success\");\n    } catch {\n      setStatus(\"error\");\n    }\n  }\n\n  return (\n    <section className={`hb-qh3 ${className}`} style={{ \"--hb-qh3-accent\": accent, ...style } as React.CSSProperties} {...rest}>\n      <style href=\"hb-login-social-first\" precedence=\"default\">{css}</style>\n      <div className=\"hb-qh3-inner\">\n        <div className=\"hb-qh3-head\">\n          <span className=\"hb-qh3-logo\" aria-hidden=\"true\">\n            <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><path d=\"M3 6.5 10 3l7 3.5v7L10 17l-7-3.5v-7Z M3 6.5 10 10l7-3.5 M10 10v7\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinejoin=\"round\" /></svg>\n          </span>\n          <h2 className=\"hb-qh3-title\">{title}</h2>\n          <p className=\"hb-qh3-sub\">{subtitle}</p>\n        </div>\n        <div className=\"hb-qh3-card\">\n          <div className=\"hb-qh3-grid\">\n            {providers.map((p, i) => (\n              <button\n                key={p.id}\n                type=\"button\"\n                className=\"hb-qh3-prov\"\n                data-last={lastUsed === p.id}\n                style={{ animationDelay: `${(i * 0.06).toFixed(2)}s`, \"--hb-qh3-g\": p.color ?? \"#15171c\" } as React.CSSProperties}\n                onClick={() => onProviderClick?.(p.id)}\n              >\n                <span className=\"hb-qh3-glyph\"><Glyph kind={p.glyph ?? \"ring\"} /></span>\n                <span className=\"hb-qh3-plabel\">{p.label}</span>\n                {lastUsed === p.id && <span className=\"hb-qh3-last\">Last used</span>}\n              </button>\n            ))}\n          </div>\n          <div className=\"hb-qh3-div\">or use email</div>\n          {status === \"success\" ? (\n            <div className=\"hb-qh3-ok\" role=\"status\">\n              <i aria-hidden=\"true\">\n                <svg width=\"14\" height=\"14\" viewBox=\"0 0 16 16\"><path d=\"m3.5 8.5 3 3 6-7\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>\n              </i>\n              Signed in as {email.trim()}. Opening your workspace.\n            </div>\n          ) : (\n            <form className=\"hb-qh3-form\" noValidate onSubmit={handleSubmit}>\n              {status === \"error\" && <p className=\"hb-qh3-alert\" role=\"alert\">We couldn&apos;t sign you in with those details.</p>}\n              <div className=\"hb-qh3-fields\">\n                <div>\n                  <label className=\"hb-qh3-label\" htmlFor={`${uid}-e`}>Work email</label>\n                  <input id={`${uid}-e`} className=\"hb-qh3-input\" type=\"email\" autoComplete=\"email\" placeholder=\"priya@northwind.co\" value={email} aria-invalid={errors.email ? true : undefined} aria-describedby={errors.email ? `${uid}-ee` : undefined} onChange={(e) => setEmail(e.target.value)} />\n                  {errors.email && <p className=\"hb-qh3-err\" id={`${uid}-ee`}>{errors.email}</p>}\n                </div>\n                <div>\n                  <label className=\"hb-qh3-label\" htmlFor={`${uid}-p`}>Password</label>\n                  <input id={`${uid}-p`} className=\"hb-qh3-input\" type=\"password\" autoComplete=\"current-password\" placeholder=\"Your password\" value={password} aria-invalid={errors.password ? true : undefined} aria-describedby={errors.password ? `${uid}-pe` : undefined} onChange={(e) => setPassword(e.target.value)} />\n                  {errors.password && <p className=\"hb-qh3-err\" id={`${uid}-pe`}>{errors.password}</p>}\n                </div>\n              </div>\n              <button type=\"submit\" className=\"hb-qh3-btn\" disabled={status === \"loading\"} aria-busy={status === \"loading\"}>\n                {status === \"loading\" ? <><span className=\"hb-qh3-spin\" aria-hidden=\"true\" />Signing in</> : (\n                  <>\n                    Continue with email\n                    <svg width=\"14\" height=\"14\" viewBox=\"0 0 16 16\" aria-hidden=\"true\"><path d=\"M3 8h10M9 4l4 4-4 4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>\n                  </>\n                )}\n              </button>\n            </form>\n          )}\n        </div>\n        <p className=\"hb-qh3-foot\">\n          No account yet? <a className=\"hb-qh3-link\" href={signup.href}>{signup.label}</a>\n          <br />\n          By continuing you agree to the <a className=\"hb-qh3-link\" href={terms.href}>{terms.label}</a> and <a className=\"hb-qh3-link\" href={privacy.href}>{privacy.label}</a>.\n        </p>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}