{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "login-01",
  "title": "Sign-in Form",
  "author": "VenusUI",
  "description": "A centered sign-in card with password show/hide that you connect to your auth provider.",
  "registryDependencies": [
    "button",
    "https://venusui.com/r/password-input.json"
  ],
  "files": [
    {
      "path": "registry/default/blocks/login-01/components/login-01.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { Button } from \"@/components/ui/button\"\nimport { PasswordInput } from \"@/registry/default/ui/password-input\"\n\ninterface Login01Props {\n  /**\n   * Signs the user in, e.g. by calling your auth provider. Throw an Error with\n   * a user-facing message to show it. Without it, the form says it isn't connected.\n   */\n  onSubmit?: (credentials: { email: string; password: string }) => Promise<void> | void\n}\n\n/**\n * A centered sign-in card with email, password (show/hide), a forgot-password\n * link and a sign-up prompt. Uses native validation and announces errors.\n */\nexport function Login01({ onSubmit }: Login01Props) {\n  const [status, setStatus] = React.useState<{ busy: boolean; message?: string }>({ busy: false })\n  const emailId = React.useId()\n  const passwordId = React.useId()\n\n  async function handleSubmit(event: React.FormEvent<HTMLFormElement>) {\n    event.preventDefault()\n    const data = new FormData(event.currentTarget)\n    if (!onSubmit) {\n      setStatus({ busy: false, message: \"This form isn’t connected yet. Pass an onSubmit handler to sign people in.\" })\n      return\n    }\n    setStatus({ busy: true })\n    try {\n      await onSubmit({ email: String(data.get(\"email\") ?? \"\"), password: String(data.get(\"password\") ?? \"\") })\n      setStatus({ busy: false })\n    } catch (error) {\n      setStatus({ busy: false, message: error instanceof Error ? error.message : \"Sign-in failed. Please try again.\" })\n    }\n  }\n\n  return (\n    <section className=\"flex min-h-[36rem] items-center justify-center bg-background px-4 py-16\">\n      <div className=\"w-full max-w-sm rounded-xl border bg-card p-6 shadow-sm sm:p-8\">\n        <span aria-hidden=\"true\" className=\"mx-auto block size-8 rounded-lg bg-foreground\" />\n        <h1 className=\"mt-5 text-center text-xl font-semibold tracking-tight\">Welcome back</h1>\n        <p className=\"mt-1 text-center text-sm text-muted-foreground\">Sign in to your account</p>\n        <form onSubmit={handleSubmit} className=\"mt-6 space-y-4\">\n          <div className=\"space-y-1.5\">\n            <label htmlFor={emailId} className=\"text-sm font-medium\">\n              Email\n            </label>\n            <input\n              id={emailId}\n              name=\"email\"\n              type=\"email\"\n              autoComplete=\"email\"\n              required\n              className=\"h-10 w-full rounded-lg border bg-transparent px-3 text-sm outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50\"\n            />\n          </div>\n          <div className=\"space-y-1.5\">\n            <div className=\"flex items-center justify-between\">\n              <label htmlFor={passwordId} className=\"text-sm font-medium\">\n                Password\n              </label>\n              <a href=\"#\" className=\"text-xs text-muted-foreground underline-offset-4 hover:text-foreground hover:underline\">\n                Forgot password?\n              </a>\n            </div>\n            <PasswordInput id={passwordId} name=\"password\" autoComplete=\"current-password\" required />\n          </div>\n          <Button type=\"submit\" className=\"w-full\" disabled={status.busy}>\n            {status.busy ? \"Signing in…\" : \"Sign in\"}\n          </Button>\n          <p role=\"status\" className=\"min-h-5 text-sm text-muted-foreground\">\n            {status.message ?? \"\"}\n          </p>\n        </form>\n        <p className=\"text-center text-sm text-muted-foreground\">\n          No account?{\" \"}\n          <a href=\"#\" className=\"font-medium text-foreground underline-offset-4 hover:underline\">\n            Sign up\n          </a>\n        </p>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "version": "0.1.0"
  },
  "categories": [
    "auth"
  ],
  "type": "registry:block"
}