{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "login-card",
  "type": "registry:component",
  "title": "Login Card",
  "description": "A centered sign-in card with social buttons, floating-label fields, error alert, loading state and sign-up link.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "auth",
    "login",
    "auth",
    "form",
    "sign in",
    "card",
    "oauth",
    "section"
  ],
  "docs": "https://hyperblur.dev/effects/login-card",
  "files": [
    {
      "path": "registry/hyperblur/login-card.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/login-card.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface LoginProvider {\n  label: string;\n  icon?: React.ReactNode;\n  onClick?: () => void;\n}\n\nexport interface LoginValues {\n  email: string;\n  password: string;\n}\n\nexport interface LoginCardProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\" | \"onSubmit\"> {\n  logo?: React.ReactNode;\n  title?: string;\n  subtitle?: string;\n  providers?: LoginProvider[];\n  onSubmit?: (values: LoginValues) => void;\n  loading?: boolean;\n  error?: string | null;\n  accent?: string;\n  signupHref?: string;\n  forgotHref?: string;\n  submitLabel?: string;\n  loadingLabel?: string;\n  footerText?: string;\n  signupLabel?: string;\n}\n\nconst css = `\n@keyframes hb-lc-spin { to { transform: rotate(360deg); } }\n@keyframes hb-lc-in {\n  from { opacity: 0; transform: translate3d(0, 6px, 0); }\n  to { opacity: 1; transform: translate3d(0, 0, 0); }\n}\n.hb-lc {\n  --hb-accent: #2f7bff;\n  box-sizing: border-box;\n  display: flex;\n  justify-content: center;\n  width: 100%;\n  padding: 56px 16px;\n  background: #0a0a0a;\n  color: #f2f2f5;\n  font-family: ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-lc *, .hb-lc *::before, .hb-lc *::after { box-sizing: border-box; }\n.hb-lc-card {\n  display: flex;\n  flex-direction: column;\n  gap: 20px;\n  width: 100%;\n  max-width: 400px;\n  padding: 32px;\n  border: 1px solid rgba(255, 255, 255, .1);\n  border-radius: 24px;\n  background: rgba(255, 255, 255, .03);\n  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .9);\n}\n.hb-lc-head { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }\n.hb-lc-logo { display: grid; place-items: center; min-height: 40px; margin-bottom: 8px; color: var(--hb-accent); }\n.hb-lc-title { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.25; letter-spacing: -.02em; }\n.hb-lc-sub { margin: 0; color: rgba(255, 255, 255, .6); font-size: 14px; line-height: 1.5; }\n.hb-lc-social { display: flex; flex-direction: column; gap: 10px; }\n.hb-lc-btn {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  gap: 10px;\n  width: 100%;\n  min-height: 46px;\n  padding: 0 20px;\n  border: 1px solid rgba(255, 255, 255, .16);\n  border-radius: 999px;\n  background: rgba(255, 255, 255, .04);\n  color: #f2f2f5;\n  font: inherit;\n  font-size: 14px;\n  font-weight: 600;\n  line-height: 1;\n  cursor: pointer;\n  transition: background .2s ease, border-color .2s ease, opacity .2s ease, box-shadow .2s ease;\n}\n.hb-lc-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .3); }\n.hb-lc-btn:focus-visible { outline: 2px solid var(--hb-accent); outline-offset: 3px; }\n.hb-lc-btn:disabled { opacity: .55; cursor: default; }\n.hb-lc-btn svg { flex: none; }\n.hb-lc-btn[data-primary=\"true\"] {\n  border-color: var(--hb-accent);\n  background: var(--hb-accent);\n  color: #fff;\n  box-shadow: 0 8px 28px -10px var(--hb-accent);\n}\n.hb-lc-btn[data-primary=\"true\"]:hover:not(:disabled) { background: color-mix(in srgb, var(--hb-accent) 82%, #ffffff); border-color: transparent; }\n.hb-lc-btn[data-primary=\"true\"]:disabled { opacity: .75; }\n.hb-lc-or {\n  display: flex;\n  align-items: center;\n  gap: 12px;\n  color: rgba(255, 255, 255, .4);\n  font-size: 12px;\n  text-transform: uppercase;\n  letter-spacing: .08em;\n}\n.hb-lc-or::before, .hb-lc-or::after { content: \"\"; flex: 1 1 0; height: 1px; background: rgba(255, 255, 255, .1); }\n.hb-lc-form { display: flex; flex-direction: column; gap: 14px; margin: 0; }\n.hb-lc-set { display: flex; flex-direction: column; gap: 14px; min-width: 0; margin: 0; padding: 0; border: 0; }\n.hb-lc-field { position: relative; }\n.hb-lc-input {\n  display: block;\n  width: 100%;\n  height: 54px;\n  padding: 22px 16px 6px;\n  border: 1px solid rgba(255, 255, 255, .14);\n  border-radius: 14px;\n  background: rgba(255, 255, 255, .04);\n  color: #f2f2f5;\n  font: inherit;\n  font-size: 15px;\n  outline: none;\n  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;\n}\n.hb-lc-input:hover { border-color: rgba(255, 255, 255, .26); }\n.hb-lc-input:focus {\n  border-color: var(--hb-accent);\n  background: rgba(255, 255, 255, .06);\n  box-shadow: 0 0 0 3px color-mix(in srgb, var(--hb-accent) 28%, transparent);\n}\n.hb-lc-input[aria-invalid=\"true\"] { border-color: #ff5d6c; }\n.hb-lc-input[aria-invalid=\"true\"]:focus { box-shadow: 0 0 0 3px rgba(255, 93, 108, .28); }\n.hb-lc-input:disabled { opacity: .6; }\n.hb-lc-label {\n  position: absolute;\n  top: 50%;\n  left: 17px;\n  max-width: calc(100% - 34px);\n  overflow: hidden;\n  color: rgba(255, 255, 255, .5);\n  font-size: 15px;\n  line-height: 1;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n  pointer-events: none;\n  transform: translate3d(0, -50%, 0);\n  transition: top .18s ease, font-size .18s ease, color .18s ease;\n}\n.hb-lc-input:focus + .hb-lc-label,\n.hb-lc-input:not(:placeholder-shown) + .hb-lc-label {\n  top: 17px;\n  font-size: 11px;\n  color: rgba(255, 255, 255, .62);\n}\n.hb-lc-input:-webkit-autofill + .hb-lc-label { top: 17px; font-size: 11px; }\n.hb-lc-input:focus + .hb-lc-label { color: var(--hb-accent); }\n.hb-lc-row { display: flex; justify-content: flex-end; margin-top: -4px; }\n.hb-lc-link {\n  color: rgba(255, 255, 255, .6);\n  font-size: 13px;\n  text-decoration: none;\n  transition: color .2s ease;\n}\n.hb-lc-link:hover { color: #fff; text-decoration: underline; }\n.hb-lc-link:focus-visible { outline: 2px solid var(--hb-accent); outline-offset: 3px; border-radius: 4px; }\n.hb-lc-link[data-accent=\"true\"] { color: var(--hb-accent); font-weight: 600; }\n.hb-lc-link[data-accent=\"true\"]:hover { color: color-mix(in srgb, var(--hb-accent) 70%, #ffffff); }\n.hb-lc-error {\n  padding: 11px 14px;\n  border: 1px solid rgba(255, 93, 108, .35);\n  border-radius: 12px;\n  background: rgba(255, 93, 108, .1);\n  color: #ffb3bb;\n  font-size: 13px;\n  line-height: 1.45;\n  animation: hb-lc-in .25s ease both;\n}\n.hb-lc-spin {\n  width: 16px;\n  height: 16px;\n  border: 2px solid rgba(255, 255, 255, .35);\n  border-top-color: #fff;\n  border-radius: 50%;\n  animation: hb-lc-spin .7s linear infinite;\n}\n.hb-lc-foot { margin: 0; color: rgba(255, 255, 255, .55); font-size: 13px; text-align: center; }\n.hb-lc-foot .hb-lc-link { margin-left: 4px; }\n@media (max-width: 767px) {\n  .hb-lc { padding: 32px 16px; }\n  .hb-lc-card { padding: 24px 20px; border-radius: 20px; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-lc-btn, .hb-lc-input, .hb-lc-label, .hb-lc-link { transition: none; }\n  .hb-lc-error { animation: none; }\n  .hb-lc-spin { animation-duration: 2.4s; }\n}\n`;\n\nfunction Mark() {\n  return (\n    <svg width=\"36\" height=\"36\" viewBox=\"0 0 32 32\" fill=\"none\" aria-hidden=\"true\">\n      <rect width=\"32\" height=\"32\" rx=\"10\" fill=\"currentColor\" />\n      <path d=\"M9 21.5L16 9l7 12.5H9Z\" fill=\"#0a0a0a\" />\n    </svg>\n  );\n}\n\nfunction GithubIcon() {\n  return (\n    <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n      <path d=\"M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91.58.1.79-.25.79-.56v-2c-3.2.7-3.87-1.37-3.87-1.37-.52-1.33-1.28-1.69-1.28-1.69-1.05-.71.08-.7.08-.7 1.15.08 1.76 1.19 1.76 1.19 1.03 1.76 2.69 1.25 3.35.96.1-.74.4-1.25.73-1.54-2.55-.29-5.24-1.28-5.24-5.69 0-1.26.45-2.28 1.19-3.09-.12-.29-.52-1.46.11-3.05 0 0 .97-.31 3.17 1.18a11 11 0 0 1 5.77 0c2.2-1.49 3.16-1.18 3.16-1.18.63 1.59.23 2.76.11 3.05.74.81 1.18 1.83 1.18 3.09 0 4.42-2.69 5.39-5.25 5.68.41.36.78 1.06.78 2.14v3.17c0 .31.21.67.8.56A11.5 11.5 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5Z\" />\n    </svg>\n  );\n}\n\nfunction GoogleIcon() {\n  return (\n    <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n      <path fill=\"#4285F4\" d=\"M21.6 12.23c0-.71-.06-1.4-.18-2.05H12v3.87h5.39a4.6 4.6 0 0 1-2 3.02v2.5h3.24c1.9-1.75 2.97-4.32 2.97-7.34Z\" />\n      <path fill=\"#34A853\" d=\"M12 22c2.7 0 4.96-.9 6.62-2.43l-3.23-2.5c-.9.6-2.04.96-3.39.96-2.6 0-4.8-1.76-5.59-4.12H3.07v2.58A10 10 0 0 0 12 22Z\" />\n      <path fill=\"#FBBC05\" d=\"M6.41 13.91a6 6 0 0 1 0-3.82V7.51H3.07a10 10 0 0 0 0 8.98l3.34-2.58Z\" />\n      <path fill=\"#EA4335\" d=\"M12 5.98c1.47 0 2.79.5 3.83 1.5l2.87-2.87C16.95 2.99 14.7 2 12 2a10 10 0 0 0-8.93 5.51l3.34 2.58C7.2 7.74 9.4 5.98 12 5.98Z\" />\n    </svg>\n  );\n}\n\nconst defaultProviders: LoginProvider[] = [\n  { label: \"Continue with GitHub\", icon: <GithubIcon /> },\n  { label: \"Continue with Google\", icon: <GoogleIcon /> },\n];\n\nexport function LoginCard({\n  logo = <Mark />,\n  title = \"Welcome back\",\n  subtitle = \"Sign in to your account to continue.\",\n  providers = defaultProviders,\n  onSubmit,\n  loading = false,\n  error = null,\n  accent = \"#2f7bff\",\n  signupHref = \"#\",\n  forgotHref = \"#\",\n  submitLabel = \"Sign in\",\n  loadingLabel = \"Signing in\",\n  footerText = \"Don't have an account?\",\n  signupLabel = \"Sign up\",\n  className = \"\",\n  style,\n  ...rest\n}: LoginCardProps) {\n  const uid = React.useId();\n  const titleId = `${uid}-title`;\n  const emailId = `${uid}-email`;\n  const passwordId = `${uid}-password`;\n  const errorId = `${uid}-error`;\n  const invalid = error ? true : undefined;\n  const describedBy = error ? errorId : undefined;\n  const vars = { \"--hb-accent\": accent, ...style } as React.CSSProperties;\n\n  function handleSubmit(e: React.FormEvent<HTMLFormElement>) {\n    e.preventDefault();\n    if (loading) return;\n    const data = new FormData(e.currentTarget);\n    onSubmit?.({\n      email: String(data.get(\"email\") ?? \"\"),\n      password: String(data.get(\"password\") ?? \"\"),\n    });\n  }\n\n  return (\n    <section className={`hb-lc ${className}`} style={vars} aria-labelledby={titleId} {...rest}>\n      <style href=\"hb-login-card\" precedence=\"default\">{css}</style>\n      <div className=\"hb-lc-card\">\n        <div className=\"hb-lc-head\">\n          {logo != null ? <div className=\"hb-lc-logo\">{logo}</div> : null}\n          <h2 className=\"hb-lc-title\" id={titleId}>\n            {title}\n          </h2>\n          {subtitle ? <p className=\"hb-lc-sub\">{subtitle}</p> : null}\n        </div>\n        {providers.length > 0 ? (\n          <>\n            <div className=\"hb-lc-social\">\n              {providers.map((provider) => (\n                <button\n                  type=\"button\"\n                  className=\"hb-lc-btn\"\n                  key={provider.label}\n                  disabled={loading}\n                  onClick={provider.onClick}\n                >\n                  {provider.icon}\n                  {provider.label}\n                </button>\n              ))}\n            </div>\n            <div className=\"hb-lc-or\" aria-hidden=\"true\">\n              or\n            </div>\n          </>\n        ) : null}\n        <form className=\"hb-lc-form\" onSubmit={handleSubmit} aria-busy={loading || undefined}>\n          {error ? (\n            <div className=\"hb-lc-error\" id={errorId} role=\"alert\">\n              {error}\n            </div>\n          ) : null}\n          <fieldset className=\"hb-lc-set\" disabled={loading}>\n            <div className=\"hb-lc-field\">\n              <input\n                className=\"hb-lc-input\"\n                id={emailId}\n                name=\"email\"\n                type=\"email\"\n                autoComplete=\"email\"\n                placeholder=\" \"\n                required\n                aria-invalid={invalid}\n                aria-describedby={describedBy}\n              />\n              <label className=\"hb-lc-label\" htmlFor={emailId}>\n                Email\n              </label>\n            </div>\n            <div className=\"hb-lc-field\">\n              <input\n                className=\"hb-lc-input\"\n                id={passwordId}\n                name=\"password\"\n                type=\"password\"\n                autoComplete=\"current-password\"\n                placeholder=\" \"\n                required\n                aria-invalid={invalid}\n                aria-describedby={describedBy}\n              />\n              <label className=\"hb-lc-label\" htmlFor={passwordId}>\n                Password\n              </label>\n            </div>\n          </fieldset>\n          <div className=\"hb-lc-row\">\n            <a className=\"hb-lc-link\" href={forgotHref}>\n              Forgot password?\n            </a>\n          </div>\n          <button type=\"submit\" className=\"hb-lc-btn\" data-primary=\"true\" disabled={loading}>\n            {loading ? <span className=\"hb-lc-spin\" aria-hidden=\"true\" /> : null}\n            {loading ? loadingLabel : submitLabel}\n          </button>\n        </form>\n        <p className=\"hb-lc-foot\">\n          {footerText}\n          <a className=\"hb-lc-link\" data-accent=\"true\" href={signupHref}>\n            {signupLabel}\n          </a>\n        </p>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}