{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "password-input",
  "title": "Password Input",
  "description": "Password field with a button that shows what was typed.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "@corsair-ui/utils",
    "@corsair-ui/button",
    "@corsair-ui/input-group"
  ],
  "files": [
    {
      "path": "registry/default/ui/password-input.tsx",
      "content": "\"use client\";\n\nimport { EyeIcon, EyeOffIcon } from \"lucide-react\";\nimport { useState, type ComponentProps } from \"react\";\n\nimport { cn } from \"@/registry/default/lib/utils\";\nimport { Button } from \"@/registry/default/ui/button\";\nimport { InputGroup, InputGroupAddon, InputGroupInput } from \"@/registry/default/ui/input-group\";\n\ninterface PasswordInputProps extends Omit<ComponentProps<\"input\">, \"type\"> {\n  /** Accessible name of the reveal button; its pressed state says whether the password shows. */\n  toggleLabel?: string;\n  /** Classes for the bordered group around the input and the button. */\n  groupClassName?: string;\n}\n\n/**\n * A password field with a button that shows what was typed. Set\n * `autoComplete` to \"current-password\" or \"new-password\" so password\n * managers fill it.\n */\nfunction PasswordInput({\n  className,\n  groupClassName,\n  toggleLabel = \"Show password\",\n  disabled,\n  ...props\n}: PasswordInputProps) {\n  const [visible, setVisible] = useState(false);\n  const Icon = visible ? EyeOffIcon : EyeIcon;\n\n  return (\n    <InputGroup data-slot=\"password-input\" className={groupClassName}>\n      <InputGroupInput\n        {...props}\n        type={visible ? \"text\" : \"password\"}\n        disabled={disabled}\n        className={className}\n      />\n      <InputGroupAddon align=\"inline-end\" className=\"pr-1\">\n        <Button\n          type=\"button\"\n          variant=\"ghost\"\n          size=\"icon-sm\"\n          aria-label={toggleLabel}\n          aria-pressed={visible}\n          disabled={disabled}\n          onClick={() => setVisible((shown) => !shown)}\n          className={cn(\"size-7\", visible && \"text-foreground\")}\n        >\n          <Icon aria-hidden=\"true\" />\n        </Button>\n      </InputGroupAddon>\n    </InputGroup>\n  );\n}\n\nexport { PasswordInput, type PasswordInputProps };\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}