import { useState } from "react"; import AccessibleInput from "../../components/AccessibleInput"; import { Eye, EyeOff, LockKeyhole, UserRound, X } from "lucide-react"; export interface StarterPasswordInputProps { value: string; onChange: (value: string) => void; placeholder: string; ariaLabel: string; autocomplete?: string; disabled?: boolean; ariaInvalid?: boolean; ariaDescribedby?: string; } /** Starter-style password field with clear and show/hide affordances. */ export function StarterPasswordInput({ value, onChange, placeholder, ariaLabel, autocomplete, disabled = false, ariaInvalid, ariaDescribedby, }: StarterPasswordInputProps) { const [visible, setVisible] = useState(false); const toggle = () => setVisible((current) => !current); return ( onChange(String(next))} type={visible ? "text" : "password"} disabled={disabled} autocomplete={autocomplete} prefixIcon={} // A defined (empty) suffix prevents TDesign's password icon from being // added in addition to the Starter-style control below. suffixIcon={