{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "authentication-05",
  "type": "registry:block",
  "description": "A reset password form with a live strength meter and requirements.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "button",
    "input",
    "label"
  ],
  "files": [
    {
      "path": "registry/designali/blocks/authentication/authentication-05.tsx",
      "content": "\"use client\"\n\nimport { useState } from \"react\"\nimport {\n  Check,\n  Eye,\n  EyeOff,\n  KeyRound,\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\"\nimport { cn } from \"@workspace/ui/lib/utils\"\n\nconst rules = [\n  { label: \"At least 10 characters\", test: (value: string) => value.length >= 10 },\n  { label: \"One uppercase letter\", test: (value: string) => /[A-Z]/.test(value) },\n  { label: \"One number\", test: (value: string) => /\\d/.test(value) },\n  { label: \"One symbol\", test: (value: string) => /[^A-Za-z0-9]/.test(value) },\n]\n\nconst strengthLabels = [\"Too weak\", \"Weak\", \"Fair\", \"Good\", \"Strong\"]\n\nexport default function Authentication05() {\n  const [password, setPassword] = useState(\"\")\n  const [visible, setVisible] = useState(false)\n  const passed = rules.filter((rule) => rule.test(password)).length\n\n  return (\n    <section className=\"flex min-h-[680px] w-full items-center justify-center bg-background px-6 py-16\">\n      <div className=\"w-full max-w-sm\">\n        <KeyRound className=\"size-6\" />\n        <h2 className=\"mt-6 text-3xl font-semibold tracking-tight\">Set a new password</h2>\n        <p className=\"mt-2 text-sm text-muted-foreground\">\n          Choose something you haven&apos;t used on your Designali account before.\n        </p>\n\n        <form className=\"mt-8 space-y-5\">\n          <div className=\"space-y-2\">\n            <Label htmlFor=\"auth-05-password\">New password</Label>\n            <div className=\"relative\">\n              <Input\n                id=\"auth-05-password\"\n                type={visible ? \"text\" : \"password\"}\n                value={password}\n                onChange={(event) => setPassword(event.target.value)}\n                className=\"h-10 pe-10\"\n              />\n              <button\n                type=\"button\"\n                onClick={() => setVisible(!visible)}\n                aria-label={visible ? \"Hide password\" : \"Show password\"}\n                className=\"absolute end-0 top-0 flex h-10 w-10 items-center justify-center text-muted-foreground hover:text-foreground\"\n              >\n                {visible ? <EyeOff className=\"size-4\" /> : <Eye className=\"size-4\" />}\n              </button>\n            </div>\n          </div>\n\n          <div className=\"space-y-2\">\n            <div className=\"grid grid-cols-4 gap-1\">\n              {rules.map((rule, index) => (\n                <span\n                  key={rule.label}\n                  className={cn(\"h-1 transition-colors\", index < passed ? \"bg-foreground\" : \"bg-muted\")}\n                />\n              ))}\n            </div>\n            <p className=\"text-xs text-muted-foreground\">\n              Strength: <span className=\"text-foreground\">{strengthLabels[passed]}</span>\n            </p>\n          </div>\n\n          <ul className=\"space-y-2 border-y py-4\">\n            {rules.map((rule) => {\n              const ok = rule.test(password)\n              return (\n                <li\n                  key={rule.label}\n                  className={cn(\"flex items-center gap-2 text-sm\", ok ? \"text-foreground\" : \"text-muted-foreground\")}\n                >\n                  <span\n                    className={cn(\n                      \"flex size-4 items-center justify-center border\",\n                      ok && \"border-foreground bg-foreground text-background\"\n                    )}\n                  >\n                    {ok && <Check className=\"size-3\" />}\n                  </span>\n                  {rule.label}\n                </li>\n              )\n            })}\n          </ul>\n\n          <Button type=\"submit\" size=\"lg\" className=\"w-full\" disabled={passed < rules.length}>\n            Update password\n          </Button>\n        </form>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "iframeHeight": "700px"
  },
  "categories": [
    "authentication"
  ]
}