{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "password-input",
  "title": "Password Input",
  "description": "A password input with a show/hide toggle that always renders LTR, regardless of the surrounding document direction.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "utils",
    "@persianlabsui/button",
    "@persianlabsui/input-group"
  ],
  "files": [
    {
      "path": "registry/base/ui/password-input.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { EyeIcon, EyeOffIcon } from \"lucide-react\"\n\nimport { Button } from \"@/components/ui/button\"\nimport {\n  InputGroup,\n  InputGroupAddon,\n  InputGroupInput,\n} from \"@/components/ui/input-group\"\nimport { cn } from \"@/lib/utils\"\n\nexport type PasswordInputProps = Omit<\n  React.ComponentProps<typeof InputGroupInput>,\n  \"type\" | \"dir\"\n>\n\nfunction PasswordInput({ className, ...props }: PasswordInputProps) {\n  const [showPassword, setShowPassword] = React.useState(false)\n\n  return (\n    // Passwords are opaque strings, not RTL-meaningful text, so the field\n    // (and the toggle button's position within it) always renders LTR\n    // regardless of the surrounding document direction — same rationale as\n    // CardNumberInput/ShabaInput in bank-input.tsx.\n    <InputGroup className={cn(\"h-auto\", className)} dir=\"ltr\">\n      <InputGroupInput\n        {...props}\n        dir=\"ltr\"\n        spellCheck={false}\n        type={showPassword ? \"text\" : \"password\"}\n      />\n      {/* `align=\"inline-end\"` resolves relative to the InputGroup's own\n          forced `dir=\"ltr\"`, so it always lands on the physical right,\n          independent of the host page's direction. */}\n      <InputGroupAddon align=\"inline-end\">\n        <Button\n          type=\"button\"\n          variant=\"ghost\"\n          size=\"icon-sm\"\n          aria-label={showPassword ? \"مخفی کردن رمز عبور\" : \"نمایش رمز عبور\"}\n          onClick={() => setShowPassword((v) => !v)}\n        >\n          {showPassword ? (\n            <EyeOffIcon className=\"size-4\" aria-hidden=\"true\" />\n          ) : (\n            <EyeIcon className=\"size-4\" aria-hidden=\"true\" />\n          )}\n        </Button>\n      </InputGroupAddon>\n    </InputGroup>\n  )\n}\n\nexport { PasswordInput }\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}