{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "login-form",
  "title": "Login Form",
  "description": "A standard login card with email and password fields.",
  "registryDependencies": [
    "@buzzform/email",
    "@buzzform/password",
    "@buzzform/checkbox",
    "card",
    "sonner"
  ],
  "files": [
    {
      "path": "registry/shadcn/examples/login-form.tsx",
      "content": "\"use client\";\n\nimport { toast } from \"sonner\";\nimport { defineSchema, type InferType } from \"@buildnbuzz/form-react\";\nimport {\n  Form,\n  FormContent,\n  FormFields,\n  FormSubmit,\n} from \"@/registry/shadcn/form\";\nimport {\n  Card,\n  CardContent,\n  CardDescription,\n  CardHeader,\n  CardTitle,\n} from \"@/components/ui/card\";\nimport {\n  Tooltip,\n  TooltipContent,\n  TooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { IconPlaceholder } from \"@/components/icon-placeholder\";\nimport Link from \"next/link\";\n\n// Login form with password\nconst loginSchema = defineSchema({\n  fields: [\n    {\n      type: \"email\",\n      name: \"email\",\n      label: \"Email\",\n      placeholder: \"you@example.com\",\n      required: true,\n      autoComplete: \"email\",\n      ui: {\n        asterisk: false, // Hides the red required * asterisk\n      },\n    },\n    {\n      type: \"password\",\n      name: \"password\",\n      label: (\n        <span className=\"flex items-center gap-1.5\">\n          Password\n          <Tooltip>\n            <TooltipTrigger\n              render={\n                <button\n                  type=\"button\"\n                  tabIndex={-1}\n                  className=\"text-muted-foreground hover:text-foreground\"\n                >\n                  <IconPlaceholder\n                    hugeicons=\"InformationCircleIcon\"\n                    tabler=\"IconInfoCircle\"\n                    phosphor=\"Info\"\n                    remixicon=\"RiInformationLine\"\n                    className=\"size-4\"\n                  />\n                  <span className=\"sr-only\">More info</span>\n                </button>\n              }\n            />\n            <TooltipContent side=\"right\">\n              <p className=\"text-xs font-normal\">\n                Must be at least 8 characters.\n              </p>\n            </TooltipContent>\n          </Tooltip>\n        </span>\n      ),\n      placeholder: \"Enter your password\",\n      required: true,\n      minLength: 8,\n      autoComplete: \"current-password\",\n    },\n    {\n      type: \"checkbox\",\n      name: \"rememberMe\",\n      label: \"Remember me for 30 days\",\n    },\n  ],\n});\n\ntype LoginSchema = InferType<typeof loginSchema.fields>;\n\nexport default function LoginFormCard() {\n  const handleSubmit = async ({ value }: { value: unknown }) => {\n    const data = value as LoginSchema;\n    await new Promise((resolve) => setTimeout(resolve, 1000));\n    toast(\"Welcome back!\", {\n      description: (\n        <pre className=\"mt-2 max-h-48 overflow-auto rounded-md bg-muted text-muted-foreground p-3 text-xs\">\n          <code>{JSON.stringify(data, null, 2)}</code>\n        </pre>\n      ),\n    });\n  };\n\n  return (\n    <Card className=\"w-full max-w-sm\">\n      <CardHeader>\n        <CardTitle>Sign In</CardTitle>\n        <CardDescription>\n          Secure login with email and password authentication\n        </CardDescription>\n      </CardHeader>\n      <CardContent>\n        <Form schema={loginSchema} onSubmit={handleSubmit}>\n          <FormContent>\n            <FormFields />\n            <div className=\"flex items-center justify-between\">\n              <Link\n                href=\"#\"\n                className=\"text-sm text-muted-foreground hover:text-primary underline-offset-4 hover:underline\"\n              >\n                Forgot password?\n              </Link>\n            </div>\n            <FormSubmit className=\"w-full\">Sign In</FormSubmit>\n          </FormContent>\n        </Form>\n      </CardContent>\n    </Card>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/buzzform/examples/login-form.tsx"
    }
  ],
  "type": "registry:block"
}