{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "login-form",
  "title": "Login Form",
  "description": "Reusable login form component with email/password fields, forgot password link, and signup link",
  "dependencies": [
    "@/components/ui/card",
    "@/components/ui/button",
    "@/components/ui/input",
    "@/components/ui/label",
    "@/components/ui/separator",
    "react-router-dom"
  ],
  "files": [
    {
      "path": "src/components/blocks/login-form.tsx",
      "content": "import * as React from \"react\"\nimport { Link } from \"react-router-dom\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n  Card,\n  CardContent,\n  CardDescription,\n  CardHeader,\n  CardTitle,\n} from \"@/components/ui/card\"\nimport { Input } from \"@/components/ui/input\"\nimport { Label } from \"@/components/ui/label\"\nimport { Chrome } from \"lucide-react\"\nimport { ICON_STROKE_WIDTH } from \"@/lib/constants\"\n\ninterface LoginFormProps {\n  onLogin?: (email: string, password: string) => void\n  onGoogleLogin?: () => void\n  showSignupLink?: boolean\n  signupLink?: string\n  showForgotPassword?: boolean\n  forgotPasswordLink?: string\n  title?: string\n  description?: string\n}\n\n/**\n * Login Form Block\n * \n * A reusable login form component with email/password fields.\n * Can be used in login pages or modals.\n * \n * @example\n * ```tsx\n * <LoginForm \n *   onLogin={(email, password) => handleLogin(email, password)}\n *   showSignupLink={true}\n *   signupLink=\"/signup\"\n * />\n * ```\n */\nexport function LoginForm({\n  onLogin,\n  onGoogleLogin,\n  showSignupLink = true,\n  signupLink = \"/signup\",\n  showForgotPassword = true,\n  forgotPasswordLink = \"/forgot-password\",\n  title = \"Login to your account\",\n  description = \"Enter your email below to login to your account\",\n}: LoginFormProps) {\n  const [email, setEmail] = React.useState(\"\")\n  const [password, setPassword] = React.useState(\"\")\n  const [isLoading, setIsLoading] = React.useState(false)\n\n  const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {\n    e.preventDefault()\n    setIsLoading(true)\n    \n    try {\n      if (onLogin) {\n        await onLogin(email, password)\n      } else {\n        // Default behavior - replace with your auth logic\n        console.log(\"Login:\", { email, password })\n      }\n    } finally {\n      setIsLoading(false)\n    }\n  }\n\n  return (\n    <Card className=\"w-full max-w-sm\">\n      <CardHeader>\n        <CardTitle>{title}</CardTitle>\n        <CardDescription>{description}</CardDescription>\n      </CardHeader>\n      <form onSubmit={handleSubmit}>\n        <CardContent>\n          <div className=\"grid gap-4\">\n            <div className=\"grid gap-2\">\n              <Label htmlFor=\"email\">Email</Label>\n              <Input\n                id=\"email\"\n                type=\"email\"\n                placeholder=\"m@example.com\"\n                value={email}\n                onChange={(e) => setEmail(e.target.value)}\n                required\n                disabled={isLoading}\n              />\n            </div>\n            <div className=\"grid gap-2\">\n              <div className=\"flex items-center justify-between\">\n                <Label htmlFor=\"password\">Password</Label>\n                {showForgotPassword && (\n                  <Link\n                    to={forgotPasswordLink}\n                    className=\"text-sm text-primary hover:underline\"\n                  >\n                    Forgot your password?\n                  </Link>\n                )}\n              </div>\n              <Input\n                id=\"password\"\n                type=\"password\"\n                value={password}\n                onChange={(e) => setPassword(e.target.value)}\n                required\n                disabled={isLoading}\n              />\n            </div>\n            <Button type=\"submit\" className=\"w-full\" disabled={isLoading}>\n              {isLoading ? \"Signing in...\" : \"Login\"}\n            </Button>\n            {onGoogleLogin && (\n              <Button\n                type=\"button\"\n                variant=\"outline\"\n                className=\"w-full\"\n                onClick={onGoogleLogin}\n                disabled={isLoading}\n              >\n                <Chrome strokeWidth={ICON_STROKE_WIDTH} className=\"mr-2 size-4\" />\n                Login with Google\n              </Button>\n            )}\n            {showSignupLink && (\n              <div className=\"text-center text-sm\">\n                Don't have an account?{\" \"}\n                <Link to={signupLink} className=\"text-primary hover:underline font-medium\">\n                  Sign up\n                </Link>\n              </div>\n            )}\n          </div>\n        </CardContent>\n      </form>\n    </Card>\n  )\n}\n\n",
      "type": "registry:block"
    }
  ],
  "type": "registry:block"
}