{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sign-in-form",
  "title": "Sign In Form",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-native/blocks/sign-in-form/SignInForm.tsx",
      "content": "import * as React from 'react'\nimport { Pressable, View, type TextInput, type ViewProps } from 'react-native'\nimport { cn } from '@/lib/utils'\nimport { Button } from '@/components/ui/button'\nimport { Checkbox } from '@/components/ui/checkbox'\nimport { Input } from '@/components/ui/input'\nimport { Text } from '@/components/ui/text'\n\nexport interface SignInValues {\n  email: string\n  password: string\n  remember: boolean\n}\n\nexport interface SignInFormProps extends ViewProps {\n  className?: string\n  title?: string\n  description?: string\n  submitLabel?: string\n  /** Server or auth error shown above the submit button. Field errors are handled internally. */\n  error?: string | null\n  loading?: boolean\n  onSubmit: (values: SignInValues) => void\n  /** Receives the current (trimmed) email value so the consumer can start a reset for it. */\n  onForgotPassword?: (email: string) => void\n}\n\nconst EMAIL_PATTERN = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/\n\n/** Email + password sign-in section. The consumer owns the auth call:\n *  validate-and-submit happens here, credentials leave through onSubmit. */\nfunction SignInForm({\n  className,\n  title = 'Welcome back',\n  description = 'Sign in to your account to continue.',\n  submitLabel = 'Sign in',\n  error,\n  loading = false,\n  onSubmit,\n  onForgotPassword,\n  ...props\n}: SignInFormProps) {\n  const [email, setEmail] = React.useState('')\n  const [password, setPassword] = React.useState('')\n  const [remember, setRemember] = React.useState(true)\n  const [emailError, setEmailError] = React.useState<string | null>(null)\n  const [passwordError, setPasswordError] = React.useState<string | null>(null)\n  const emailRef = React.useRef<React.ComponentRef<typeof TextInput>>(null)\n  const passwordRef = React.useRef<React.ComponentRef<typeof TextInput>>(null)\n\n  function handleSubmit() {\n    if (loading) return\n    const nextEmailError = EMAIL_PATTERN.test(email.trim()) ? null : 'Enter a valid email address.'\n    const nextPasswordError = password.length > 0 ? null : 'Enter your password.'\n    setEmailError(nextEmailError)\n    setPasswordError(nextPasswordError)\n    if (nextEmailError || nextPasswordError) {\n      // Move focus to the first invalid field so keyboard and\n      // screen-reader users land on the problem, not on the button.\n      if (nextEmailError) emailRef.current?.focus()\n      else passwordRef.current?.focus()\n      return\n    }\n    onSubmit({ email: email.trim(), password, remember })\n  }\n\n  return (\n    <View className={cn('gap-5', className)} {...props}>\n      <View className=\"gap-1\">\n        <Text size=\"title\" accessibilityRole=\"header\">\n          {title}\n        </Text>\n        <Text variant=\"muted\" size=\"sm\">\n          {description}\n        </Text>\n      </View>\n\n      <View className=\"gap-2\">\n        <Text size=\"sm\" className=\"font-medium\">\n          Email\n        </Text>\n        <Input\n          ref={emailRef}\n          accessibilityLabel=\"Email\"\n          autoCapitalize=\"none\"\n          autoComplete=\"email\"\n          autoCorrect={false}\n          keyboardType=\"email-address\"\n          textContentType=\"emailAddress\"\n          returnKeyType=\"next\"\n          placeholder=\"you@example.com\"\n          value={email}\n          invalid={!!emailError}\n          onChangeText={(next) => {\n            setEmail(next)\n            if (emailError) setEmailError(null)\n          }}\n          onSubmitEditing={() => passwordRef.current?.focus()}\n        />\n        {emailError ? (\n          <Text size=\"sm\" className=\"text-destructive\" accessibilityRole=\"alert\">\n            {emailError}\n          </Text>\n        ) : null}\n      </View>\n\n      <View className=\"gap-2\">\n        <Text size=\"sm\" className=\"font-medium\">\n          Password\n        </Text>\n        <Input\n          ref={passwordRef}\n          accessibilityLabel=\"Password\"\n          autoCapitalize=\"none\"\n          autoComplete=\"current-password\"\n          autoCorrect={false}\n          textContentType=\"password\"\n          returnKeyType=\"done\"\n          secureTextEntry\n          placeholder=\"Your password\"\n          value={password}\n          invalid={!!passwordError}\n          onChangeText={(next) => {\n            setPassword(next)\n            if (passwordError) setPasswordError(null)\n          }}\n          onSubmitEditing={handleSubmit}\n        />\n        {passwordError ? (\n          <Text size=\"sm\" className=\"text-destructive\" accessibilityRole=\"alert\">\n            {passwordError}\n          </Text>\n        ) : null}\n      </View>\n\n      <View className=\"flex-row flex-wrap items-center justify-between gap-[8px]\">\n        <Pressable\n          accessibilityRole=\"checkbox\"\n          accessibilityState={{ checked: remember }}\n          accessibilityLabel=\"Keep me signed in\"\n          onPress={() => setRemember((value) => !value)}\n          className=\"min-h-[48px] max-w-full flex-row items-center gap-[8px] active:opacity-80\"\n        >\n          <Checkbox aria-hidden focusable={false} pointerEvents=\"none\" checked={remember} />\n          <Text size=\"sm\" className=\"shrink\">\n            Keep me signed in\n          </Text>\n        </Pressable>\n        {onForgotPassword ? (\n          <Button\n            variant=\"link\"\n            size=\"sm\"\n            accessibilityLabel=\"Forgot password\"\n            onPress={() => onForgotPassword(email.trim())}\n          >\n            Forgot password?\n          </Button>\n        ) : null}\n      </View>\n\n      {error ? (\n        <Text size=\"sm\" className=\"text-destructive\" accessibilityRole=\"alert\">\n          {error}\n        </Text>\n      ) : null}\n\n      <Button accessibilityLabel={submitLabel} loading={loading} onPress={handleSubmit}>\n        {submitLabel}\n      </Button>\n    </View>\n  )\n}\n\nexport { SignInForm }\n",
      "type": "registry:block",
      "target": "~/components/blocks/sign-in-form/SignInForm.tsx"
    },
    {
      "path": "packages/registry-native/blocks/sign-in-form/index.ts",
      "content": "export { SignInForm, type SignInFormProps, type SignInValues } from './SignInForm'\n",
      "type": "registry:block",
      "target": "~/components/blocks/sign-in-form/index.ts"
    }
  ],
  "dependencies": [],
  "devDependencies": [],
  "registryDependencies": [
    "https://native.uipkge.dev/r/native/button.json",
    "https://native.uipkge.dev/r/native/checkbox.json",
    "https://native.uipkge.dev/r/native/input.json",
    "https://native.uipkge.dev/r/native/text.json"
  ],
  "description": "Email and password sign-in section composed from Input, Checkbox, and Button primitives: inline field validation on submit, focus chaining, secure entry, and a busy submit state. Credentials leave through onSubmit; wire your own auth call.",
  "categories": [
    "auth"
  ]
}