"use client"; import { useState } from "react"; import { Eye, EyeOff } from "lucide-react"; import { Input } from "@/components/ui/input"; import { cn } from "@/lib/utils"; import { useTranslations } from "@/lib/i18n/context"; /** * Password input with a built-in show/hide toggle. Lives in the shared UI * layer so every surface that needs a masked secret (Withings, moodLog, * ntfy, Telegram, AI provider keys, account password, auth login / * register) can share the same UX without duplicating the * visibility-toggle plumbing. * * v1.4.27 R3d MB2 — the icon-only toggle wraps in an `inline-flex h-11 * w-11` hit area so the 44 px WCAG 2.5.5 floor is honoured on touch. * The icon stays at 16 px; the surrounding padding does the work. The * input itself gets `pr-12` so user input never collides with the * toggle glyph. */ export function PasswordInput({ className, ...props }: React.ComponentProps) { const [visible, setVisible] = useState(false); const { t } = useTranslations(); return (
); }