{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"auth-card","type":"registry:component","title":"Auth Card","description":"Sign-in and sign-up card with OAuth buttons, email/password validation, and instant mode switching.","dependencies":["lucide-react"],"files":[{"path":"components/incepture/auth-card.tsx","type":"registry:component","target":"components/incepture/auth-card.tsx","content":"\"use client\";\n\nimport { useState, type FormEvent } from \"react\";\nimport { ArrowRight, Mail } from \"lucide-react\";\n\nexport interface AuthCardProps {\n  onSubmit?: (data: { mode: \"signin\" | \"signup\"; email: string; password: string }) => void;\n}\n\nexport function AuthCard({ onSubmit }: AuthCardProps) {\n  const [mode, setMode] = useState<\"signin\" | \"signup\">(\"signin\");\n  const [email, setEmail] = useState(\"\");\n  const [password, setPassword] = useState(\"\");\n  const [submitted, setSubmitted] = useState(false);\n\n  function handleSubmit(e: FormEvent) {\n    e.preventDefault();\n    if (!email.trim() || password.length < 6) return;\n    onSubmit?.({ mode, email, password });\n    setSubmitted(true);\n  }\n\n  return (\n    <div className=\"mx-auto w-full max-w-md rounded-xl border border-stone-200 bg-white p-7 text-stone-900 shadow-sm dark:border-stone-800 dark:bg-stone-900 dark:text-stone-100\">\n      <div className=\"space-y-1.5\">\n        <p className=\"font-mono text-[11px] uppercase tracking-[0.14em] text-orange-700 dark:text-orange-400\">\n          {mode === \"signin\" ? \"Welcome back\" : \"Create account\"}\n        </p>\n        <h2 className=\"text-2xl font-semibold tracking-tight\">\n          {mode === \"signin\" ? \"Sign in to continue\" : \"Start building today\"}\n        </h2>\n        <p className=\"text-sm text-stone-600 dark:text-stone-400\">\n          {mode === \"signin\"\n            ? \"Use your GitHub account or email credentials.\"\n            : \"Set up your workspace in under a minute.\"}\n        </p>\n      </div>\n\n      <div className=\"mt-6 grid grid-cols-2 gap-2.5\">\n        <button\n          type=\"button\"\n          className=\"inline-flex items-center justify-center gap-2 rounded-lg border border-stone-200 bg-stone-50 px-3 py-2.5 text-xs font-medium transition hover:bg-stone-100 dark:border-stone-700 dark:bg-stone-950 dark:hover:bg-stone-800\"\n        >\n          <svg className=\"h-4 w-4\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n            <path\n              fill=\"currentColor\"\n              d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z\"\n            />\n          </svg>\n          <span>GitHub</span>\n        </button>\n        <button\n          type=\"button\"\n          className=\"inline-flex items-center justify-center gap-2 rounded-lg border border-stone-200 bg-stone-50 px-3 py-2.5 text-xs font-medium transition hover:bg-stone-100 dark:border-stone-700 dark:bg-stone-950 dark:hover:bg-stone-800\"\n        >\n          <Mail className=\"h-4 w-4\" />\n          <span>Magic Link</span>\n        </button>\n      </div>\n\n      <div className=\"my-5 flex items-center gap-3 text-xs text-stone-400\">\n        <span className=\"h-px flex-1 bg-stone-200 dark:bg-stone-800\" />\n        <span className=\"font-mono uppercase tracking-wider text-[10px]\">or</span>\n        <span className=\"h-px flex-1 bg-stone-200 dark:bg-stone-800\" />\n      </div>\n\n      <form onSubmit={handleSubmit} className=\"space-y-4\">\n        <div>\n          <label htmlFor=\"auth-email\" className=\"block text-xs font-medium text-stone-700 dark:text-stone-300\">\n            Email address\n          </label>\n          <input\n            id=\"auth-email\"\n            type=\"email\"\n            required\n            value={email}\n            onChange={(e) => {\n              setEmail(e.target.value);\n              setSubmitted(false);\n            }}\n            placeholder=\"you@domain.dev\"\n            className=\"mt-1.5 w-full rounded-lg border border-stone-300 bg-transparent px-3.5 py-2.5 text-sm outline-none transition focus:border-stone-900 dark:border-stone-700 dark:focus:border-stone-200\"\n          />\n        </div>\n\n        <div>\n          <label htmlFor=\"auth-password\" className=\"block text-xs font-medium text-stone-700 dark:text-stone-300\">\n            Password\n          </label>\n          <input\n            id=\"auth-password\"\n            type=\"password\"\n            required\n            minLength={6}\n            value={password}\n            onChange={(e) => {\n              setPassword(e.target.value);\n              setSubmitted(false);\n            }}\n            placeholder=\"••••••••\"\n            className=\"mt-1.5 w-full rounded-lg border border-stone-300 bg-transparent px-3.5 py-2.5 text-sm outline-none transition focus:border-stone-900 dark:border-stone-700 dark:focus:border-stone-200\"\n          />\n        </div>\n\n        <button\n          type=\"submit\"\n          className=\"inline-flex w-full items-center justify-center gap-2 rounded-lg bg-stone-900 px-4 py-2.5 text-sm font-medium text-stone-50 transition hover:bg-stone-800 dark:bg-stone-100 dark:text-stone-950 dark:hover:bg-white\"\n        >\n          <span>{mode === \"signin\" ? \"Sign in\" : \"Create account\"}</span>\n          <ArrowRight className=\"h-4 w-4\" />\n        </button>\n\n        {submitted && (\n          <p className=\"rounded-lg bg-emerald-50 px-3 py-2 text-xs text-emerald-800 dark:bg-emerald-950/60 dark:text-emerald-300\">\n            Form validated for <strong>{email}</strong> ({mode}). Wire to your auth provider.\n          </p>\n        )}\n      </form>\n\n      <p className=\"mt-5 text-center text-xs text-stone-500\">\n        {mode === \"signin\" ? \"No account yet?\" : \"Already have an account?\"}{\" \"}\n        <button\n          type=\"button\"\n          onClick={() => {\n            setMode(mode === \"signin\" ? \"signup\" : \"signin\");\n            setSubmitted(false);\n          }}\n          className=\"font-medium text-stone-900 underline underline-offset-4 dark:text-stone-100\"\n        >\n          {mode === \"signin\" ? \"Sign up\" : \"Sign in\"}\n        </button>\n      </p>\n    </div>\n  );\n}\n"}]}