{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "login-minimal-line",
  "type": "registry:component",
  "title": "Login Minimal Line",
  "description": "An ultra-minimal sign-in on warm paper: a large serif greeting whose words rise in, underline fields with floating labels that draw an ink line on focus, and a pill submit button.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "auth",
    "login",
    "minimal",
    "serif",
    "light",
    "underline",
    "editorial"
  ],
  "docs": "https://hyperblur.dev/effects/login-minimal-line",
  "files": [
    {
      "path": "registry/hyperblur/login-minimal-line.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/login-minimal-line.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface LoginMinimalLineLink {\n  label: string;\n  href: string;\n}\n\nexport interface LoginMinimalLineValues {\n  email: string;\n  password: string;\n}\n\nexport interface LoginMinimalLineProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\" | \"onSubmit\"> {\n  brand?: string;\n  greeting?: string;\n  note?: string;\n  submitLabel?: string;\n  onSubmit?: (values: LoginMinimalLineValues) => boolean | void | Promise<boolean | void>;\n  forgot?: LoginMinimalLineLink;\n  signup?: LoginMinimalLineLink;\n  accent?: string;\n}\n\nconst css = `\n.hb-qh4 {\n  --hb-qh4-accent: #c2410c;\n  --hb-qh4-ink: #1c1a17;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  overflow: hidden;\n  container-type: inline-size;\n  background: #f7f5ef;\n  color: var(--hb-qh4-ink);\n  font-family: inherit;\n  padding: clamp(72px, 10cqw, 128px) 24px;\n}\n.hb-qh4 *, .hb-qh4 *::before, .hb-qh4 *::after { box-sizing: border-box; }\n.hb-qh4::before { content: \"\"; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(to bottom, transparent 0 31px, rgba(28,26,23,.045) 31px 32px); mask: linear-gradient(to right, transparent, #000 30%, #000 70%, transparent); }\n.hb-qh4-inner { position: relative; max-width: 1120px; margin: 0 auto; display: grid; gap: 48px; align-items: end; }\n.hb-qh4-brand { display: flex; align-items: center; gap: 10px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: rgba(28,26,23,.6); margin-bottom: 28px; }\n.hb-qh4-brand i { width: 8px; height: 8px; border-radius: 50%; background: var(--hb-qh4-accent); }\n.hb-qh4-greet { margin: 0; font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif); font-weight: 400; font-size: clamp(48px, 9cqw, 104px); line-height: .95; letter-spacing: -.02em; }\n.hb-qh4-word { display: inline-block; opacity: 0; transform: translateY(.4em); animation: hb-qh4-rise .9s cubic-bezier(.2,.7,.2,1) forwards; }\n.hb-qh4-greet em { font-style: normal; color: var(--hb-qh4-accent); }\n.hb-qh4-note { margin: 24px 0 0; max-width: 380px; font-size: 15px; line-height: 1.6; color: rgba(28,26,23,.62); }\n.hb-qh4-form { display: grid; gap: 30px; max-width: 420px; width: 100%; justify-self: end; }\n.hb-qh4-field { position: relative; padding-top: 18px; }\n.hb-qh4-input { display: block; width: 100%; height: 40px; padding: 0 0 4px; border: 0; border-bottom: 1px solid rgba(28,26,23,.25); border-radius: 0; background: transparent; color: var(--hb-qh4-ink); font: inherit; font-size: 18px; outline: none; }\n.hb-qh4-label { position: absolute; left: 0; top: 26px; font-size: 18px; color: rgba(28,26,23,.45); pointer-events: none; transform-origin: left top; transition: transform .3s cubic-bezier(.2,.7,.2,1), color .3s; }\n.hb-qh4-input:focus + .hb-qh4-label, .hb-qh4-input:not(:placeholder-shown) + .hb-qh4-label { transform: translateY(-24px) scale(.7); color: rgba(28,26,23,.7); }\n.hb-qh4-line { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--hb-qh4-ink); transform: scaleX(0); transform-origin: left; transition: transform .45s cubic-bezier(.2,.7,.2,1); }\n.hb-qh4-input:focus ~ .hb-qh4-line { transform: scaleX(1); }\n.hb-qh4-input[aria-invalid=\"true\"] ~ .hb-qh4-line { transform: scaleX(1); background: #b42318; }\n.hb-qh4-err { position: absolute; left: 0; top: calc(100% + 6px); margin: 0; font-size: 12px; color: #b42318; }\n.hb-qh4-forgot { position: absolute; right: 0; top: 30px; font-size: 13px; color: rgba(28,26,23,.55); text-decoration: none; border-radius: 3px; }\n.hb-qh4-forgot:hover { color: var(--hb-qh4-ink); }\n.hb-qh4-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 6px; }\n.hb-qh4-signup { font-size: 14px; color: rgba(28,26,23,.6); }\n.hb-qh4-signup a { color: var(--hb-qh4-ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--hb-qh4-accent); border-radius: 3px; }\n.hb-qh4-btn { display: inline-flex; align-items: center; gap: 14px; height: 52px; padding: 0 8px 0 22px; border: 0; border-radius: 999px; background: var(--hb-qh4-ink); color: #f7f5ef; font: inherit; font-size: 15px; cursor: pointer; transition: gap .3s cubic-bezier(.2,.7,.2,1), background .2s; }\n.hb-qh4-btn:hover { gap: 20px; }\n.hb-qh4-btn:disabled { cursor: progress; }\n.hb-qh4-btn i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--hb-qh4-accent); color: #fff; }\n.hb-qh4-btn:focus-visible, .hb-qh4-forgot:focus-visible, .hb-qh4-signup a:focus-visible { outline: 2px solid var(--hb-qh4-accent); outline-offset: 3px; }\n.hb-qh4-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: hb-qh4-turn .7s linear infinite; }\n.hb-qh4-alert { margin: 0; font-size: 14px; color: #b42318; }\n.hb-qh4-done { max-width: 420px; justify-self: end; animation: hb-qh4-rise .6s ease both; }\n.hb-qh4-done p { margin: 0 0 10px; font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif); font-size: 36px; line-height: 1.1; }\n.hb-qh4-done span { color: rgba(28,26,23,.6); font-size: 15px; }\n.hb-qh4-bar { margin-top: 20px; height: 2px; background: rgba(28,26,23,.12); overflow: hidden; }\n.hb-qh4-bar i { display: block; height: 100%; width: 100%; background: var(--hb-qh4-accent); transform-origin: left; animation: hb-qh4-load 1.8s ease forwards; }\n@container (min-width: 780px) {\n  .hb-qh4-inner { grid-template-columns: 1.25fr 1fr; gap: 72px; }\n}\n@container (max-width: 779px) {\n  .hb-qh4-form, .hb-qh4-done { justify-self: stretch; max-width: none; }\n}\n@keyframes hb-qh4-rise { to { opacity: 1; transform: none; } }\n@keyframes hb-qh4-turn { to { transform: rotate(360deg); } }\n@keyframes hb-qh4-load { from { transform: scaleX(0); } to { transform: scaleX(1); } }\n@media (prefers-reduced-motion: reduce) {\n  .hb-qh4 *, .hb-qh4 *::before, .hb-qh4 *::after { animation: none !important; transition: none !important; }\n  .hb-qh4-word { opacity: 1; transform: none; }\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 LoginMinimalLine({\n  brand = \"Folio\",\n  greeting = \"Good to see you *again.*\",\n  note = \"Your drafts, notes and reading list are right where you left them. Sign in to keep writing.\",\n  submitLabel = \"Sign in\",\n  onSubmit,\n  forgot = { label: \"Forgot?\", href: \"#forgot\" },\n  signup = { label: \"Create one\", href: \"#signup\" },\n  accent = \"#c2410c\",\n  className = \"\",\n  style,\n  ...rest\n}: LoginMinimalLineProps) {\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  const words = greeting.split(\" \").filter(Boolean);\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 email.\";\n    if (!password) next.password = \"Enter your password.\";\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-qh4 ${className}`} style={{ \"--hb-qh4-accent\": accent, ...style } as React.CSSProperties} {...rest}>\n      <style href=\"hb-login-minimal-line\" precedence=\"default\">{css}</style>\n      <div className=\"hb-qh4-inner\">\n        <div>\n          <div className=\"hb-qh4-brand\"><i aria-hidden=\"true\" />{brand}</div>\n          <h2 className=\"hb-qh4-greet\" aria-label={greeting.replaceAll(\"*\", \"\")}>\n            {words.map((w, i) => {\n              const italic = w.startsWith(\"*\") && w.endsWith(\"*\");\n              return (\n                <React.Fragment key={i}>\n                  <span className=\"hb-qh4-word\" aria-hidden=\"true\" style={{ animationDelay: `${(0.1 + i * 0.09).toFixed(2)}s` }}>\n                    {italic ? <em>{w.slice(1, -1)}</em> : w}\n                  </span>\n                  {i < words.length - 1 ? \" \" : null}\n                </React.Fragment>\n              );\n            })}\n          </h2>\n          <p className=\"hb-qh4-note\">{note}</p>\n        </div>\n        {status === \"success\" ? (\n          <div className=\"hb-qh4-done\" role=\"status\">\n            <p>Welcome back.</p>\n            <span>Opening your desk</span>\n            <div className=\"hb-qh4-bar\" aria-hidden=\"true\"><i /></div>\n          </div>\n        ) : (\n          <form className=\"hb-qh4-form\" noValidate onSubmit={handleSubmit}>\n            {status === \"error\" && <p className=\"hb-qh4-alert\" role=\"alert\">That combination didn&apos;t work. Try again.</p>}\n            <div className=\"hb-qh4-field\">\n              <input id={`${uid}-e`} className=\"hb-qh4-input\" type=\"email\" autoComplete=\"email\" placeholder=\" \" value={email} aria-invalid={errors.email ? true : undefined} aria-describedby={errors.email ? `${uid}-ee` : undefined} onChange={(e) => setEmail(e.target.value)} />\n              <label className=\"hb-qh4-label\" htmlFor={`${uid}-e`}>Email address</label>\n              <span className=\"hb-qh4-line\" aria-hidden=\"true\" />\n              {errors.email && <p className=\"hb-qh4-err\" id={`${uid}-ee`}>{errors.email}</p>}\n            </div>\n            <div className=\"hb-qh4-field\">\n              <input id={`${uid}-p`} className=\"hb-qh4-input\" type=\"password\" autoComplete=\"current-password\" placeholder=\" \" style={{ paddingRight: 64 }} value={password} aria-invalid={errors.password ? true : undefined} aria-describedby={errors.password ? `${uid}-pe` : undefined} onChange={(e) => setPassword(e.target.value)} />\n              <label className=\"hb-qh4-label\" htmlFor={`${uid}-p`}>Password</label>\n              <span className=\"hb-qh4-line\" aria-hidden=\"true\" />\n              <a className=\"hb-qh4-forgot\" href={forgot.href}>{forgot.label}</a>\n              {errors.password && <p className=\"hb-qh4-err\" id={`${uid}-pe`}>{errors.password}</p>}\n            </div>\n            <div className=\"hb-qh4-actions\">\n              <span className=\"hb-qh4-signup\">No account? <a href={signup.href}>{signup.label}</a></span>\n              <button type=\"submit\" className=\"hb-qh4-btn\" disabled={status === \"loading\"} aria-busy={status === \"loading\"}>\n                {status === \"loading\" ? \"Signing in\" : submitLabel}\n                <i aria-hidden=\"true\">\n                  {status === \"loading\" ? <span className=\"hb-qh4-spin\" /> : (\n                    <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"><path d=\"M3 8h10M9 4l4 4-4 4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>\n                  )}\n                </i>\n              </button>\n            </div>\n          </form>\n        )}\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}