{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "auth-magic-link",
  "type": "registry:component",
  "title": "Auth Magic Link",
  "description": "A light passwordless sign-in: an email field that morphs into a Check your inbox state with an envelope that folds shut, a resend countdown and a change email action.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "auth",
    "auth",
    "magic link",
    "passwordless",
    "email",
    "light",
    "form"
  ],
  "docs": "https://hyperblur.dev/effects/auth-magic-link",
  "files": [
    {
      "path": "registry/hyperblur/auth-magic-link.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/auth-magic-link.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface AuthMagicLinkLink {\n  label: string;\n  href: string;\n}\n\nexport interface AuthMagicLinkValues {\n  email: string;\n}\n\nexport interface AuthMagicLinkProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\" | \"onSubmit\"> {\n  brand?: string;\n  title?: string;\n  subtitle?: string;\n  notes?: string[];\n  expiresIn?: string;\n  resendSeconds?: number;\n  defaultEmail?: string;\n  alternate?: AuthMagicLinkLink | null;\n  onSubmit?: (values: AuthMagicLinkValues) => void | Promise<unknown>;\n  onResend?: (email: string) => void | Promise<unknown>;\n  accent?: string;\n}\n\nconst css = `\n@keyframes hb-kf4-float {\n  0%, 100% { transform: translate3d(0, 0, 0) rotate(var(--hb-kf4-r, 0deg)); }\n  50% { transform: translate3d(0, -8px, 0) rotate(var(--hb-kf4-r, 0deg)); }\n}\n@keyframes hb-kf4-letter {\n  0% { transform: translateY(-46px); }\n  55% { transform: translateY(-46px); }\n  100% { transform: translateY(0); }\n}\n@keyframes hb-kf4-flap-back {\n  0%, 60% { transform: scaleY(-1); }\n  78% { transform: scaleY(0); }\n  100% { transform: scaleY(0); }\n}\n@keyframes hb-kf4-flap-front {\n  0%, 78% { transform: scaleY(0); }\n  100% { transform: scaleY(1); }\n}\n@keyframes hb-kf4-bounce {\n  0%, 100% { transform: translateY(0) rotate(0); }\n  30% { transform: translateY(-10px) rotate(-3deg); }\n  60% { transform: translateY(0) rotate(1.5deg); }\n}\n@keyframes hb-kf4-hover {\n  0%, 100% { transform: translateY(0); }\n  50% { transform: translateY(-5px); }\n}\n@keyframes hb-kf4-pop {\n  from { opacity: 0; transform: scale(.4); }\n  to { opacity: 1; transform: scale(1); }\n}\n@keyframes hb-kf4-in {\n  from { opacity: 0; transform: translate3d(0, 6px, 0); }\n  to { opacity: 1; transform: translate3d(0, 0, 0); }\n}\n@keyframes hb-kf4-spin { to { transform: rotate(360deg); } }\n.hb-kf4 {\n  --hb-kf4-accent: #2f7bff;\n  --hb-kf4-ink: #171512;\n  --hb-kf4-muted: #6b675e;\n  --hb-kf4-line: rgba(23, 21, 18, .1);\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  padding: 72px 16px;\n  overflow: hidden;\n  isolation: isolate;\n  container-type: inline-size;\n  background: #f7f5ef;\n  color: var(--hb-kf4-ink);\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-kf4 *, .hb-kf4 *::before, .hb-kf4 *::after { box-sizing: border-box; }\n.hb-kf4::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  z-index: -1;\n  background-image:\n    linear-gradient(var(--hb-kf4-line) 1px, transparent 1px),\n    linear-gradient(90deg, var(--hb-kf4-line) 1px, transparent 1px);\n  background-size: 56px 56px;\n  background-position: center top;\n  opacity: .55;\n  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 45%, #000 20%, transparent 80%);\n  mask-image: radial-gradient(ellipse 60% 70% at 50% 45%, #000 20%, transparent 80%);\n}\n.hb-kf4::after {\n  content: \"\";\n  position: absolute;\n  top: 18%;\n  left: 50%;\n  z-index: -1;\n  width: 640px;\n  height: 420px;\n  border-radius: 50%;\n  background: radial-gradient(closest-side, color-mix(in srgb, var(--hb-kf4-accent) 18%, transparent), transparent);\n  transform: translateX(-50%);\n}\n.hb-kf4-stage { position: relative; display: flex; justify-content: center; max-width: 1120px; margin: 0 auto; }\n.hb-kf4-note {\n  position: absolute;\n  display: none;\n  align-items: center;\n  gap: 8px;\n  padding: 9px 14px 9px 10px;\n  border: 1px solid var(--hb-kf4-line);\n  border-radius: 999px;\n  background: rgba(255, 255, 255, .8);\n  box-shadow: 0 12px 30px -16px rgba(23, 21, 18, .35);\n  color: var(--hb-kf4-ink);\n  font-size: 13px;\n  font-weight: 500;\n  white-space: nowrap;\n  backdrop-filter: blur(8px);\n  animation: hb-kf4-float 7s ease-in-out infinite;\n}\n.hb-kf4-note i {\n  display: grid;\n  place-items: center;\n  width: 22px;\n  height: 22px;\n  border-radius: 50%;\n  background: color-mix(in srgb, var(--hb-kf4-accent) 14%, #fff);\n  color: var(--hb-kf4-accent);\n  font-style: normal;\n}\n.hb-kf4-note[data-n=\"0\"] { top: 64px; left: 2%; --hb-kf4-r: -3deg; }\n.hb-kf4-note[data-n=\"1\"] { top: 220px; right: 1%; --hb-kf4-r: 2.5deg; animation-delay: -2.5s; }\n.hb-kf4-note[data-n=\"2\"] { bottom: 56px; left: 7%; --hb-kf4-r: 2deg; animation-delay: -4.5s; }\n.hb-kf4-card {\n  position: relative;\n  display: grid;\n  width: 100%;\n  max-width: 452px;\n  padding: 36px 28px 28px;\n  border: 1px solid var(--hb-kf4-line);\n  border-radius: 26px;\n  background: #fff;\n  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 30px 70px -36px rgba(23, 21, 18, .35), 0 2px 6px rgba(23, 21, 18, .04);\n}\n.hb-kf4-state {\n  grid-area: 1 / 1;\n  display: flex;\n  flex-direction: column;\n  min-width: 0;\n  transition: opacity .45s ease, transform .55s cubic-bezier(.2, .8, .2, 1), filter .45s ease, visibility 0s linear 0s;\n}\n.hb-kf4-state[data-on=\"false\"] { visibility: hidden; opacity: 0; filter: blur(6px); transition: opacity .3s ease, transform .4s ease, filter .3s ease, visibility 0s linear .4s; }\n.hb-kf4-state[data-s=\"form\"][data-on=\"false\"] { transform: scale(.96) translateY(-10px); }\n.hb-kf4-state[data-s=\"sent\"][data-on=\"false\"] { transform: scale(1.03) translateY(10px); }\n.hb-kf4-logo { display: flex; align-items: center; gap: 9px; margin-bottom: 30px; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }\n.hb-kf4-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--hb-kf4-ink); color: #f7f5ef; }\n.hb-kf4-title { margin: 0; font-size: clamp(26px, 5cqw, 32px); font-weight: 650; line-height: 1.12; letter-spacing: -.035em; text-wrap: balance; }\n.hb-kf4-sub { margin: 10px 0 26px; color: var(--hb-kf4-muted); font-size: 15px; line-height: 1.55; }\n.hb-kf4-form { display: flex; flex-direction: column; gap: 12px; margin: 0; }\n.hb-kf4-label { font-size: 13px; font-weight: 600; }\n.hb-kf4-input {\n  display: block;\n  width: 100%;\n  height: 48px;\n  padding: 0 16px;\n  border: 1px solid rgba(23, 21, 18, .16);\n  border-radius: 14px;\n  background: #fbfaf7;\n  color: var(--hb-kf4-ink);\n  font: inherit;\n  font-size: 15px;\n  outline: none;\n  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;\n}\n.hb-kf4-input::placeholder { color: #a29d92; }\n.hb-kf4-input:hover { border-color: rgba(23, 21, 18, .28); }\n.hb-kf4-input:focus { border-color: var(--hb-kf4-accent); background: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--hb-kf4-accent) 18%, transparent); }\n.hb-kf4-input[aria-invalid=\"true\"] { border-color: #dc2626; }\n.hb-kf4-input[aria-invalid=\"true\"]:focus { box-shadow: 0 0 0 4px rgba(220, 38, 38, .14); }\n.hb-kf4-err { display: flex; align-items: center; gap: 6px; margin: -2px 0 0; color: #b91c1c; font-size: 13px; animation: hb-kf4-in .2s ease both; }\n.hb-kf4-btn {\n  position: relative;\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  gap: 10px;\n  height: 48px;\n  margin-top: 4px;\n  overflow: hidden;\n  border: 0;\n  border-radius: 14px;\n  background: var(--hb-kf4-ink);\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 10px 24px -12px rgba(23, 21, 18, .6);\n  color: #fff;\n  font: inherit;\n  font-size: 15px;\n  font-weight: 600;\n  cursor: pointer;\n  transition: transform .2s ease, background .2s ease;\n}\n.hb-kf4-btn::after {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%);\n  transform: translateX(-100%);\n  transition: transform .7s ease;\n}\n.hb-kf4-btn:hover:not(:disabled)::after { transform: translateX(100%); }\n.hb-kf4-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--hb-kf4-ink) 88%, var(--hb-kf4-accent)); }\n.hb-kf4-btn:active:not(:disabled) { transform: translateY(1px); }\n.hb-kf4-btn:disabled { cursor: progress; opacity: .85; }\n.hb-kf4-btn:focus-visible { outline: 2px solid var(--hb-kf4-accent); outline-offset: 3px; }\n.hb-kf4-spin { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: hb-kf4-spin .7s linear infinite; }\n.hb-kf4-alert { margin: 0; padding: 10px 12px; border: 1px solid rgba(220, 38, 38, .25); border-radius: 12px; background: #fef2f2; color: #991b1b; font-size: 13px; }\n.hb-kf4-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--hb-kf4-line); color: var(--hb-kf4-muted); font-size: 13px; }\n.hb-kf4-a { color: var(--hb-kf4-ink); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(23, 21, 18, .25); text-underline-offset: 3px; border-radius: 4px; }\n.hb-kf4-a:hover { text-decoration-color: currentColor; }\n.hb-kf4-a:focus-visible { outline: 2px solid var(--hb-kf4-accent); outline-offset: 2px; }\n.hb-kf4-env { display: grid; place-items: center; height: 150px; margin: -6px 0 18px; }\n.hb-kf4-env svg { overflow: visible; }\n.hb-kf4-env-wrap { position: relative; }\n.hb-kf4-env-body { transform-box: fill-box; transform-origin: center bottom; }\n.hb-kf4-letter { transform: translateY(-46px); }\n.hb-kf4-flap-back { transform-box: fill-box; transform-origin: center top; transform: scaleY(-1); }\n.hb-kf4-flap-front { transform-box: fill-box; transform-origin: center top; transform: scaleY(0); }\n.hb-kf4-badge { transform-box: fill-box; transform-origin: center; opacity: 0; }\n.hb-kf4[data-sent=\"true\"] .hb-kf4-letter { animation: hb-kf4-letter 1s cubic-bezier(.5, 0, .2, 1) both; }\n.hb-kf4[data-sent=\"true\"] .hb-kf4-flap-back { animation: hb-kf4-flap-back 1.25s ease both; }\n.hb-kf4[data-sent=\"true\"] .hb-kf4-flap-front { animation: hb-kf4-flap-front 1.25s ease both; }\n.hb-kf4[data-sent=\"true\"] .hb-kf4-env-body { animation: hb-kf4-bounce .6s 1.25s ease both, hb-kf4-hover 4s 2s ease-in-out infinite; }\n.hb-kf4[data-sent=\"true\"] .hb-kf4-badge { animation: hb-kf4-pop .4s 1.45s cubic-bezier(.2, 1.4, .4, 1) both; }\n.hb-kf4-sent-title { margin: 0; font-size: 26px; font-weight: 650; letter-spacing: -.03em; text-align: center; outline: none; }\n.hb-kf4-sent-sub { margin: 10px 0 0; color: var(--hb-kf4-muted); font-size: 15px; line-height: 1.6; text-align: center; }\n.hb-kf4-sent-sub strong { color: var(--hb-kf4-ink); font-weight: 600; overflow-wrap: anywhere; }\n.hb-kf4-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }\n.hb-kf4-ghost {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  gap: 8px;\n  height: 44px;\n  border: 1px solid rgba(23, 21, 18, .14);\n  border-radius: 12px;\n  background: #fff;\n  color: var(--hb-kf4-ink);\n  font: inherit;\n  font-size: 14px;\n  font-weight: 550;\n  font-variant-numeric: tabular-nums;\n  cursor: pointer;\n  transition: background .2s ease, border-color .2s ease;\n}\n.hb-kf4-ghost:hover:not(:disabled) { background: #f7f5ef; border-color: rgba(23, 21, 18, .24); }\n.hb-kf4-ghost:disabled { color: var(--hb-kf4-muted); cursor: default; }\n.hb-kf4-ghost:focus-visible { outline: 2px solid var(--hb-kf4-accent); outline-offset: 2px; }\n.hb-kf4-text { padding: 6px; border: 0; border-radius: 8px; background: transparent; color: var(--hb-kf4-muted); font: inherit; font-size: 13px; cursor: pointer; }\n.hb-kf4-text:hover { color: var(--hb-kf4-ink); text-decoration: underline; text-underline-offset: 3px; }\n.hb-kf4-text:focus-visible { outline: 2px solid var(--hb-kf4-accent); outline-offset: 1px; }\n.hb-kf4-toast { min-height: 18px; margin: 12px 0 0; color: #15803d; font-size: 13px; text-align: center; }\n.hb-kf4-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n@container (min-width: 860px) {\n  .hb-kf4 { padding: 104px 24px; }\n  .hb-kf4-note { display: inline-flex; }\n  .hb-kf4-card { padding: 44px 40px 32px; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-kf4-note, .hb-kf4-err { animation: none; }\n  .hb-kf4-state, .hb-kf4-input, .hb-kf4-btn, .hb-kf4-btn::after, .hb-kf4-ghost { transition: none; }\n  .hb-kf4[data-sent=\"true\"] .hb-kf4-letter,\n  .hb-kf4[data-sent=\"true\"] .hb-kf4-flap-back,\n  .hb-kf4[data-sent=\"true\"] .hb-kf4-flap-front,\n  .hb-kf4[data-sent=\"true\"] .hb-kf4-env-body,\n  .hb-kf4[data-sent=\"true\"] .hb-kf4-badge { animation: none; }\n  .hb-kf4[data-sent=\"true\"] .hb-kf4-letter { transform: none; }\n  .hb-kf4[data-sent=\"true\"] .hb-kf4-flap-back { transform: scaleY(0); }\n  .hb-kf4[data-sent=\"true\"] .hb-kf4-flap-front { transform: none; }\n  .hb-kf4[data-sent=\"true\"] .hb-kf4-badge { opacity: 1; }\n  .hb-kf4-spin { animation-duration: 2s; }\n}\n`;\n\nconst defaultNotes = [\"No password to remember\", \"Link expires in 15 minutes\", \"Works on every device\"];\nconst emailPattern = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]{2,}$/;\n\nfunction wait(result: unknown) {\n  return result instanceof Promise ? result : new Promise((resolve) => setTimeout(resolve, 900));\n}\n\nfunction NoteIcon({ index }: { index: number }) {\n  const paths = [\"M5 8.5 7 10.5l4-5\", \"M8 4.5V8l2.2 1.4M14 8A6 6 0 1 1 2 8a6 6 0 0 1 12 0Z\", \"M5 2.5h6a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1ZM7 11.5h2\"];\n  return (\n    <svg width=\"12\" height=\"12\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n      <path d={paths[index % paths.length]} />\n    </svg>\n  );\n}\n\nfunction Envelope() {\n  return (\n    <svg width=\"168\" height=\"124\" viewBox=\"0 0 168 124\" fill=\"none\" aria-hidden=\"true\">\n      <ellipse cx=\"84\" cy=\"118\" rx=\"54\" ry=\"5\" fill=\"rgba(23,21,18,.08)\" />\n      <g className=\"hb-kf4-env-body\">\n        <rect x=\"20\" y=\"40\" width=\"128\" height=\"76\" rx=\"10\" fill=\"#efe9dc\" stroke=\"rgba(23,21,18,.14)\" />\n        <path className=\"hb-kf4-flap-back\" d=\"M20.5 41.5 84 84l63.5-42.5Z\" fill=\"#e4dccb\" stroke=\"rgba(23,21,18,.12)\" strokeLinejoin=\"round\" />\n        <g className=\"hb-kf4-letter\">\n          <rect x=\"34\" y=\"24\" width=\"100\" height=\"70\" rx=\"6\" fill=\"#fff\" stroke=\"rgba(23,21,18,.12)\" />\n          <rect x=\"46\" y=\"38\" width=\"44\" height=\"6\" rx=\"3\" fill=\"var(--hb-kf4-accent)\" />\n          <rect x=\"46\" y=\"52\" width=\"76\" height=\"4\" rx=\"2\" fill=\"rgba(23,21,18,.14)\" />\n          <rect x=\"46\" y=\"62\" width=\"60\" height=\"4\" rx=\"2\" fill=\"rgba(23,21,18,.14)\" />\n        </g>\n        <path d=\"M20 50v56a10 10 0 0 0 10 10h108a10 10 0 0 0 10-10V50L84 88 20 50Z\" fill=\"#f3eee3\" stroke=\"rgba(23,21,18,.14)\" strokeLinejoin=\"round\" />\n        <path d=\"M24 112 70 79M144 112 98 79\" stroke=\"rgba(23,21,18,.1)\" />\n        <path className=\"hb-kf4-flap-front\" d=\"M20.5 41.5 84 84l63.5-42.5Z\" fill=\"#ebe4d5\" stroke=\"rgba(23,21,18,.14)\" strokeLinejoin=\"round\" />\n        <g className=\"hb-kf4-badge\">\n          <circle cx=\"140\" cy=\"44\" r=\"15\" fill=\"var(--hb-kf4-accent)\" stroke=\"#fff\" strokeWidth=\"3\" />\n          <path d=\"m133.5 44.3 4.3 4.2 8-8.3\" stroke=\"#fff\" strokeWidth=\"2.6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n        </g>\n      </g>\n    </svg>\n  );\n}\n\nexport function AuthMagicLink({\n  brand = \"Northwind\",\n  title = \"Sign in with a link, not a password\",\n  subtitle = \"Enter your work email and we'll send you a secure link that signs you in instantly.\",\n  notes = defaultNotes,\n  expiresIn = \"15 minutes\",\n  resendSeconds = 30,\n  defaultEmail = \"\",\n  alternate = { label: \"Use single sign-on\", href: \"#sso\" },\n  onSubmit,\n  onResend,\n  accent = \"#2f7bff\",\n  className = \"\",\n  style,\n  ...rest\n}: AuthMagicLinkProps) {\n  const uid = React.useId();\n  const [email, setEmail] = React.useState(defaultEmail);\n  const [touched, setTouched] = React.useState(false);\n  const [submitted, setSubmitted] = React.useState(false);\n  const [status, setStatus] = React.useState<\"idle\" | \"loading\" | \"sent\">(\"idle\");\n  const [formError, setFormError] = React.useState(\"\");\n  const [left, setLeft] = React.useState(0);\n  const [resending, setResending] = React.useState(false);\n  const [toast, setToast] = React.useState(\"\");\n  const [round, setRound] = React.useState(0);\n  const inputRef = React.useRef<HTMLInputElement>(null);\n  const sentTitleRef = React.useRef<HTMLHeadingElement>(null);\n  const moved = React.useRef<\"sent\" | \"form\" | null>(null);\n\n  React.useEffect(() => {\n    if (left <= 0) return;\n    const id = window.setTimeout(() => setLeft((s) => s - 1), 1000);\n    return () => window.clearTimeout(id);\n  }, [left]);\n\n  React.useEffect(() => {\n    const target = moved.current;\n    if (!target) return;\n    moved.current = null;\n    if (target === \"sent\") sentTitleRef.current?.focus();\n    else inputRef.current?.focus();\n  }, [status]);\n\n  const value = email.trim();\n  const emailError = !value ? \"Enter your email address.\" : !emailPattern.test(value) ? \"Check the email format, like maya@northwind.io.\" : \"\";\n  const showError = (touched || submitted) && emailError;\n  const loading = status === \"loading\";\n  const sent = status === \"sent\";\n\n  async function handleSubmit(event: React.FormEvent<HTMLFormElement>) {\n    event.preventDefault();\n    if (loading) return;\n    setSubmitted(true);\n    setFormError(\"\");\n    if (emailError) {\n      inputRef.current?.focus();\n      return;\n    }\n    setStatus(\"loading\");\n    try {\n      await wait(onSubmit?.({ email: value }));\n      moved.current = \"sent\";\n      setToast(\"\");\n      setLeft(resendSeconds);\n      setRound((r) => r + 1);\n      setStatus(\"sent\");\n    } catch (error) {\n      setStatus(\"idle\");\n      setFormError(error instanceof Error && error.message ? error.message : \"We couldn't send the link. Try again in a moment.\");\n    }\n  }\n\n  async function resend() {\n    if (left > 0 || resending) return;\n    setResending(true);\n    setToast(\"\");\n    try {\n      await wait(onResend?.(value));\n      setToast(`A fresh link is on its way to ${value}.`);\n      setLeft(resendSeconds);\n      setRound((r) => r + 1);\n    } catch {\n      setToast(\"Couldn't resend right now. Try again shortly.\");\n    }\n    setResending(false);\n  }\n\n  function changeEmail() {\n    moved.current = \"form\";\n    setStatus(\"idle\");\n    setSubmitted(false);\n    setTouched(false);\n  }\n\n  const vars = { \"--hb-kf4-accent\": accent, ...style } as React.CSSProperties;\n\n  return (\n    <section className={`hb-kf4 ${className}`} style={vars} data-sent={sent ? \"true\" : undefined} aria-labelledby={`${uid}-t`} {...rest}>\n      <style href=\"hb-auth-magic-link\" precedence=\"default\">{css}</style>\n      <div className=\"hb-kf4-stage\">\n        {notes.slice(0, 3).map((note, i) => (\n          <span className=\"hb-kf4-note\" data-n={i} key={note} aria-hidden=\"true\">\n            <i>\n              <NoteIcon index={i} />\n            </i>\n            {note}\n          </span>\n        ))}\n        <div className=\"hb-kf4-card\">\n          <div className=\"hb-kf4-state\" data-s=\"form\" data-on={sent ? \"false\" : \"true\"} inert={sent}>\n            <div className=\"hb-kf4-logo\">\n              <span className=\"hb-kf4-mark\" aria-hidden=\"true\">\n                <svg width=\"14\" height=\"14\" viewBox=\"0 0 16 16\" fill=\"currentColor\">\n                  <path d=\"M2.5 13.5V2.5h2.6l5.8 7V2.5h2.6v11h-2.6l-5.8-7v7H2.5Z\" />\n                </svg>\n              </span>\n              {brand}\n            </div>\n            <h2 className=\"hb-kf4-title\" id={sent ? undefined : `${uid}-t`}>\n              {title}\n            </h2>\n            <p className=\"hb-kf4-sub\">{subtitle}</p>\n            <form className=\"hb-kf4-form\" noValidate onSubmit={handleSubmit} aria-busy={loading || undefined}>\n              {formError ? (\n                <p className=\"hb-kf4-alert\" role=\"alert\">\n                  {formError}\n                </p>\n              ) : null}\n              <label className=\"hb-kf4-label\" htmlFor={`${uid}-email`}>\n                Work email\n              </label>\n              <input\n                ref={inputRef}\n                id={`${uid}-email`}\n                className=\"hb-kf4-input\"\n                type=\"email\"\n                name=\"email\"\n                autoComplete=\"email\"\n                placeholder=\"maya@northwind.io\"\n                value={email}\n                disabled={loading}\n                onChange={(e) => setEmail(e.target.value)}\n                onBlur={() => setTouched(true)}\n                aria-invalid={showError ? true : undefined}\n                aria-describedby={showError ? `${uid}-err` : undefined}\n              />\n              {showError ? (\n                <p className=\"hb-kf4-err\" id={`${uid}-err`}>\n                  {emailError}\n                </p>\n              ) : null}\n              <button type=\"submit\" className=\"hb-kf4-btn\" disabled={loading}>\n                {loading ? <span className=\"hb-kf4-spin\" aria-hidden=\"true\" /> : null}\n                {loading ? \"Sending your link\" : \"Email me a sign-in link\"}\n              </button>\n              <span className=\"hb-kf4-sr\" role=\"status\">\n                {loading ? \"Sending your link\" : \"\"}\n              </span>\n            </form>\n            <div className=\"hb-kf4-foot\">\n              <span>Links expire after {expiresIn}.</span>\n              {alternate ? (\n                <a className=\"hb-kf4-a\" href={alternate.href}>\n                  {alternate.label}\n                </a>\n              ) : null}\n            </div>\n          </div>\n          <div className=\"hb-kf4-state\" data-s=\"sent\" data-on={sent ? \"true\" : \"false\"} inert={!sent}>\n            <div className=\"hb-kf4-env\">\n              <div className=\"hb-kf4-env-wrap\" key={round}>\n                <Envelope />\n              </div>\n            </div>\n            <h2 className=\"hb-kf4-sent-title\" id={sent ? `${uid}-t` : undefined} ref={sentTitleRef} tabIndex={-1}>\n              Check your inbox\n            </h2>\n            <p className=\"hb-kf4-sent-sub\">\n              We sent a sign-in link to <strong>{value || \"your email\"}</strong>. It expires in {expiresIn}.\n            </p>\n            <div className=\"hb-kf4-actions\">\n              <button type=\"button\" className=\"hb-kf4-ghost\" disabled={left > 0 || resending} onClick={resend}>\n                {resending ? \"Resending\" : left > 0 ? `Resend link in ${left}s` : \"Resend link\"}\n              </button>\n              <button type=\"button\" className=\"hb-kf4-text\" onClick={changeEmail}>\n                Use a different email\n              </button>\n            </div>\n            <p className=\"hb-kf4-toast\" aria-live=\"polite\">\n              {toast}\n            </p>\n          </div>\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}