{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "login-form",
  "type": "registry:item",
  "title": "Login Form",
  "description": "Clean and accessible login form with email/password authentication and Google OAuth option",
  "dependencies": [
    "@mui/material",
    "@emotion/react",
    "@emotion/styled"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "components/login-form/login-form.tsx",
      "target": "src/mui-treasury/components/login-form/login-form.tsx",
      "content": "'use client';\n\nimport { useState } from 'react';\n\nimport {\n  Box,\n  Button,\n  Card,\n  Link,\n  Stack,\n  TextField,\n  Typography,\n} from '@mui/material';\n\ninterface FormData {\n  email: string;\n  password: string;\n}\n\ninterface FormErrors {\n  email?: string;\n  password?: string;\n}\n\nexport function LoginForm() {\n  const [formData, setFormData] = useState<FormData>({\n    email: 'm@example.com',\n    password: '',\n  });\n  const [errors, setErrors] = useState<FormErrors>({});\n  const [isLoading, setIsLoading] = useState(false);\n\n  const handleInputChange =\n    (field: keyof FormData) => (event: React.ChangeEvent<HTMLInputElement>) => {\n      setFormData((prev) => ({\n        ...prev,\n        [field]: event.target.value,\n      }));\n      // Clear error when user starts typing\n      if (errors[field]) {\n        setErrors((prev) => ({\n          ...prev,\n          [field]: undefined,\n        }));\n      }\n    };\n\n  const validateForm = (): boolean => {\n    const newErrors: FormErrors = {};\n\n    if (!formData.email) {\n      newErrors.email = 'Email is required';\n    } else if (!/\\S+@\\S+\\.\\S+/.test(formData.email)) {\n      newErrors.email = 'Please enter a valid email address';\n    }\n\n    if (!formData.password) {\n      newErrors.password = 'Password is required';\n    } else if (formData.password.length < 6) {\n      newErrors.password = 'Password must be at least 6 characters';\n    }\n\n    setErrors(newErrors);\n    return Object.keys(newErrors).length === 0;\n  };\n\n  const handleSubmit = async (event: React.FormEvent) => {\n    event.preventDefault();\n\n    if (!validateForm()) {\n      return;\n    }\n\n    setIsLoading(true);\n    // Simulate API call\n    await new Promise((resolve) => setTimeout(resolve, 1000));\n    setIsLoading(false);\n\n    // Handle successful login\n    console.log('Login successful', formData);\n  };\n\n  const handleGoogleLogin = () => {\n    console.log('Login with Google');\n  };\n\n  return (\n    <Card\n      sx={(theme) => ({\n        mx: 'auto',\n        p: 4,\n        borderRadius: 2,\n        maxWidth: 400,\n        ...theme.applyStyles('dark', {\n          bgcolor: 'grey.900',\n        }),\n      })}\n    >\n      <Stack spacing={3}>\n        <Stack\n          spacing={1}\n          sx={{\n            textAlign: 'center',\n          }}\n        >\n          <Typography variant=\"h3\" component=\"h1\">\n            Login to your account\n          </Typography>\n          <Typography\n            variant=\"body1\"\n            sx={{\n              color: 'text.secondary',\n            }}\n          >\n            Enter your email below to login to your account\n          </Typography>\n        </Stack>\n\n        <Box component=\"form\" onSubmit={handleSubmit}>\n          <Stack spacing={2}>\n            <TextField\n              fullWidth\n              required\n              label=\"Email\"\n              type=\"email\"\n              variant=\"outlined\"\n              value={formData.email}\n              onChange={handleInputChange('email')}\n              error={!!errors.email}\n              helperText={errors.email}\n              autoComplete=\"email\"\n            />\n\n            <Box>\n              <Stack\n                direction=\"row\"\n                sx={{\n                  justifyContent: 'space-between',\n                  alignItems: 'center',\n                  mb: 1,\n                }}\n              >\n                <Typography\n                  variant=\"body2\"\n                  component=\"label\"\n                  htmlFor=\"password-input\"\n                >\n                  Password\n                </Typography>\n                <Link\n                  href=\"#\"\n                  variant=\"body2\"\n                  onClick={(e) => {\n                    e.preventDefault();\n                    console.log('Forgot password clicked');\n                  }}\n                  sx={{ textDecoration: 'none' }}\n                >\n                  Forgot your password?\n                </Link>\n              </Stack>\n              <TextField\n                id=\"password-input\"\n                fullWidth\n                required\n                type=\"password\"\n                variant=\"outlined\"\n                value={formData.password}\n                onChange={handleInputChange('password')}\n                error={!!errors.password}\n                helperText={errors.password}\n                autoComplete=\"current-password\"\n              />\n            </Box>\n\n            <Button\n              type=\"submit\"\n              variant=\"contained\"\n              size=\"large\"\n              fullWidth\n              disabled={isLoading}\n              sx={{ py: 1.5 }}\n            >\n              {isLoading ? 'Signing in...' : 'Login'}\n            </Button>\n\n            <Button\n              variant=\"outlined\"\n              size=\"large\"\n              fullWidth\n              onClick={handleGoogleLogin}\n              sx={{ py: 1.5 }}\n            >\n              Login with Google\n            </Button>\n          </Stack>\n        </Box>\n\n        <Typography\n          variant=\"body2\"\n          sx={{\n            textAlign: 'center',\n            color: 'text.secondary',\n          }}\n        >\n          Don&apos;t have an account?{' '}\n          <Link\n            href=\"#\"\n            onClick={(e) => {\n              e.preventDefault();\n              console.log('Sign up clicked');\n            }}\n            sx={{ textDecoration: 'underline' }}\n          >\n            Sign up\n          </Link>\n        </Typography>\n      </Stack>\n    </Card>\n  );\n}\n",
      "type": "registry:item"
    },
    {
      "path": "components/login-form/index.ts",
      "target": "src/mui-treasury/components/login-form/index.ts",
      "content": "export * from './login-form';\n",
      "type": "registry:item"
    }
  ],
  "meta": {
    "screenshot": "/og/login-form.png",
    "category": "block",
    "exportName": "LoginForm",
    "subcategory": "authentication"
  }
}