{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "authentication-07",
  "type": "registry:block",
  "description": "Identifier-first sign-in that checks the work email and routes to SSO or a password step.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "button",
    "input",
    "label"
  ],
  "files": [
    {
      "path": "registry/designali/blocks/authentication/authentication-07.tsx",
      "content": "\"use client\"\n\nimport { useState } from \"react\"\nimport {\n  ArrowLeft,\n  ArrowRight,\n  Building2,\n  KeyRound,\n  ShieldCheck,\n} from \"@designali/icons\"\n\nimport { Button } from \"@workspace/ui/components/button\"\nimport { Input } from \"@workspace/ui/components/input\"\nimport { Label } from \"@workspace/ui/components/label\"\n\nconst ssoDomains: Record<string, { org: string; provider: string }> = {\n  \"designali.com\": { org: \"Designali Studio\", provider: \"Google Workspace\" },\n  \"example.com\": { org: \"Example Client\", provider: \"Okta\" },\n}\n\nexport default function Authentication07() {\n  const [email, setEmail] = useState(\"\")\n  const [stage, setStage] = useState<\"email\" | \"sso\" | \"password\">(\"email\")\n\n  const domain = email.split(\"@\")[1]?.toLowerCase() ?? \"\"\n  const match = ssoDomains[domain]\n\n  return (\n    <section className=\"w-full bg-background py-20 md:py-28\">\n      <div className=\"mx-auto max-w-md px-6\">\n        <div className=\"flex items-center gap-2 font-semibold\">\n          <ShieldCheck className=\"size-5\" />\n          designali\n        </div>\n\n        {stage === \"email\" && (\n          <form\n            className=\"mt-10 space-y-6\"\n            onSubmit={(event) => {\n              event.preventDefault()\n              if (!email.includes(\"@\")) return\n              setStage(match ? \"sso\" : \"password\")\n            }}\n          >\n            <div>\n              <h2 className=\"text-3xl font-semibold tracking-tight\">Sign in</h2>\n              <p className=\"mt-2 text-sm text-muted-foreground\">\n                Enter your work email. We&apos;ll route you to your company&apos;s sign-in if it uses single sign-on.\n              </p>\n            </div>\n            <div className=\"space-y-2\">\n              <Label htmlFor=\"auth-07-email\">Work email</Label>\n              <Input\n                id=\"auth-07-email\"\n                type=\"email\"\n                value={email}\n                onChange={(event) => setEmail(event.target.value)}\n                placeholder=\"you@designali.com\"\n                className=\"h-11\"\n              />\n              {match && (\n                <p className=\"flex items-center gap-2 text-xs text-chart-3 dark:text-primary\">\n                  <Building2 className=\"size-3.5\" />\n                  {match.org} uses single sign-on\n                </p>\n              )}\n            </div>\n            <Button type=\"submit\" size=\"lg\" className=\"w-full\">\n              Continue\n              <ArrowRight />\n            </Button>\n            <p className=\"text-xs text-muted-foreground\">\n              Try <button type=\"button\" className=\"underline underline-offset-4\" onClick={() => setEmail(\"ali@designali.com\")}>ali@designali.com</button> to see the SSO flow.\n            </p>\n          </form>\n        )}\n\n        {stage === \"sso\" && match && (\n          <div className=\"mt-10 space-y-6\">\n            <button type=\"button\" onClick={() => setStage(\"email\")} className=\"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground\">\n              <ArrowLeft className=\"size-4\" />\n              {email}\n            </button>\n            <div className=\"border\">\n              <div className=\"flex items-center gap-4 border-b p-5\">\n                <span className=\"flex size-12 items-center justify-center bg-gradient-to-br from-primary to-chart-3 text-sm font-semibold text-white\">\n                  {match.org.split(\" \").map((word) => word[0]).join(\"\")}\n                </span>\n                <div>\n                  <p className=\"font-medium\">{match.org}</p>\n                  <p className=\"text-sm text-muted-foreground\">Managed by your IT team</p>\n                </div>\n              </div>\n              <div className=\"space-y-4 p-5\">\n                <p className=\"text-sm text-muted-foreground\">\n                  You&apos;ll be redirected to {match.provider} to finish signing in. Password login is disabled for this organization.\n                </p>\n                <Button size=\"lg\" className=\"w-full\">\n                  Continue with {match.provider}\n                </Button>\n              </div>\n            </div>\n            <p className=\"text-xs text-muted-foreground\">\n              Having trouble? Contact your administrator or <a href=\"#\" className=\"underline underline-offset-4\">read the SSO guide</a>.\n            </p>\n          </div>\n        )}\n\n        {stage === \"password\" && (\n          <form className=\"mt-10 space-y-6\" onSubmit={(event) => event.preventDefault()}>\n            <button type=\"button\" onClick={() => setStage(\"email\")} className=\"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground\">\n              <ArrowLeft className=\"size-4\" />\n              {email}\n            </button>\n            <h2 className=\"text-3xl font-semibold tracking-tight\">Enter your password</h2>\n            <div className=\"space-y-2\">\n              <div className=\"flex items-center justify-between\">\n                <Label htmlFor=\"auth-07-password\">Password</Label>\n                <a href=\"#\" className=\"text-xs text-muted-foreground hover:text-foreground\">Forgot?</a>\n              </div>\n              <Input id=\"auth-07-password\" type=\"password\" className=\"h-11\" autoFocus />\n            </div>\n            <Button type=\"submit\" size=\"lg\" className=\"w-full\">Sign in</Button>\n            <Button type=\"button\" variant=\"outline\" size=\"lg\" className=\"w-full\">\n              <KeyRound />\n              Use a passkey instead\n            </Button>\n          </form>\n        )}\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "iframeHeight": "600px"
  },
  "categories": [
    "authentication"
  ]
}