{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "authentication-13",
  "type": "registry:block",
  "description": "Passkey manager with an explainer beside a list of registered devices and add or remove actions.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "button"
  ],
  "files": [
    {
      "path": "registry/designali/blocks/authentication/authentication-13.tsx",
      "content": "\"use client\"\n\nimport { useEffect, useState } from \"react\"\nimport {\n  Check,\n  FingerprintPattern as Fingerprint,\n  Laptop,\n  Smartphone,\n  Trash2,\n} from \"@designali/icons\"\n\nimport { Button } from \"@workspace/ui/components/button\"\nimport { cn } from \"@workspace/ui/lib/utils\"\n\ntype Passkey = { id: number; name: string; device: \"laptop\" | \"phone\"; added: string; used: string }\n\nconst initial: Passkey[] = [\n  { id: 1, name: \"MacBook Air\", device: \"laptop\", added: \"Mar 2, 2025\", used: \"Today\" },\n  { id: 2, name: \"iPhone 18 Pro\", device: \"phone\", added: \"Jan 18, 2025\", used: \"3 days ago\" },\n]\n\nexport default function Authentication13() {\n  const [keys, setKeys] = useState(initial)\n  const [state, setState] = useState<\"idle\" | \"waiting\" | \"done\">(\"idle\")\n\n  useEffect(() => {\n    if (state !== \"waiting\") return\n    const timer = setTimeout(() => {\n      setKeys((current) => [\n        ...current,\n        { id: Date.now(), name: \"This browser\", device: \"laptop\", added: \"Just now\", used: \"Never\" },\n      ])\n      setState(\"done\")\n    }, 1800)\n    return () => clearTimeout(timer)\n  }, [state])\n\n  return (\n    <section className=\"w-full bg-background py-20 md:py-28\">\n      <div className=\"mx-auto grid max-w-5xl gap-10 px-6 md:grid-cols-[1fr_1.2fr]\">\n        <div className=\"flex flex-col items-start gap-6 border bg-muted/30 p-8\">\n          <span className=\"relative flex size-20 items-center justify-center\">\n            <span\n              className={cn(\n                \"absolute inset-0 rounded-full border-2 border-foreground/20\",\n                state === \"waiting\" && \"animate-ping\"\n              )}\n            />\n            <span\n              className={cn(\n                \"relative flex size-16 items-center justify-center rounded-full transition-colors\",\n                state === \"done\" ? \"bg-chart-2 text-white\" : \"bg-foreground text-background\"\n              )}\n            >\n              {state === \"done\" ? <Check className=\"size-7\" /> : <Fingerprint className=\"size-7\" />}\n            </span>\n          </span>\n          <div>\n            <h2 className=\"text-2xl font-semibold tracking-tight\">\n              {state === \"idle\" && \"Create a passkey\"}\n              {state === \"waiting\" && \"Waiting for your device...\"}\n              {state === \"done\" && \"Passkey saved\"}\n            </h2>\n            <p className=\"mt-2 text-sm text-muted-foreground\">\n              {state === \"idle\" &&\n                \"Sign in to Designali with your fingerprint, face or screen lock. Passkeys can't be phished or reused.\"}\n              {state === \"waiting\" && \"Follow the prompt from your browser or operating system to confirm.\"}\n              {state === \"done\" && \"Next time, just choose your passkey on the sign-in screen.\"}\n            </p>\n          </div>\n          <Button\n            size=\"lg\"\n            disabled={state === \"waiting\"}\n            onClick={() => setState(state === \"done\" ? \"idle\" : \"waiting\")}\n          >\n            {state === \"done\" ? \"Add another\" : state === \"waiting\" ? \"Confirming...\" : \"Create passkey\"}\n          </Button>\n        </div>\n\n        <div>\n          <div className=\"flex items-baseline justify-between border-b pb-3\">\n            <h3 className=\"font-medium\">Your passkeys</h3>\n            <span className=\"text-sm text-muted-foreground tabular-nums\">{keys.length} registered</span>\n          </div>\n          <ul className=\"divide-y\">\n            {keys.map((key) => (\n              <li key={key.id} className=\"flex items-center gap-4 py-4\">\n                <span className=\"flex size-10 shrink-0 items-center justify-center border\">\n                  {key.device === \"laptop\" ? <Laptop className=\"size-4\" /> : <Smartphone className=\"size-4\" />}\n                </span>\n                <div className=\"min-w-0 flex-1\">\n                  <p className=\"truncate text-sm font-medium\">{key.name}</p>\n                  <p className=\"text-xs text-muted-foreground\">\n                    Added {key.added} &middot; Last used {key.used}\n                  </p>\n                </div>\n                <button\n                  type=\"button\"\n                  aria-label={`Remove ${key.name}`}\n                  onClick={() => setKeys(keys.filter((item) => item.id !== key.id))}\n                  className=\"flex size-8 items-center justify-center text-muted-foreground hover:text-foreground\"\n                >\n                  <Trash2 className=\"size-4\" />\n                </button>\n              </li>\n            ))}\n            {keys.length === 0 && (\n              <li className=\"py-6 text-sm text-muted-foreground\">No passkeys yet. You&apos;re using a password only.</li>\n            )}\n          </ul>\n        </div>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "iframeHeight": "600px"
  },
  "categories": [
    "authentication"
  ]
}