import { FormGroupProps } from "../FormGroup/FormGroup"; import { PasswordBaseInputProps } from "./PasswordBaseInput/PasswordBaseInput"; type FormGroupExposedProps = Pick; export interface PasswordFieldProps extends Omit, FormGroupExposedProps { /** * If a value is set, the field is rendered in its invalid state. */ errorMessage?: string; } /** * The `` component is used to enter passwords or other confidential information. * Characters are masked as they are typed, with an option to toggle visibility. * * ### When to use * - Password input for login or registration forms * - Entering sensitive data that should be obfuscated (API keys, secrets) * - Any confidential text input * * ### When not to use * - Confirming user actions like deletion - use a Checkbox instead * - Non-sensitive text input - use `TextField` instead * - PIN codes - consider a specialized PIN input * * @example Basic usage * ```tsx * import { PasswordField } from "@trackunit/react-form-components"; * * const [password, setPassword] = useState(""); * * setPassword(e.target.value)} * required * /> * ``` * @example With validation * ```tsx * import { PasswordField } from "@trackunit/react-form-components"; * * setPassword(e.target.value)} * helpText="Must be at least 8 characters" * errorMessage={password.length < 8 ? "Password too short" : undefined} * /> * ``` * @example Confirm password pattern * ```tsx * import { PasswordField } from "@trackunit/react-form-components"; * * setPassword(e.target.value)} * /> * setConfirmPassword(e.target.value)} * errorMessage={confirmPassword !== password ? "Passwords do not match" : undefined} * /> * ``` */ export declare const PasswordField: { ({ id, label, tip, helpText, helpAddon, errorMessage, isInvalid, maxLength, onChange, className, value, "data-testid": dataTestId, ref, required, ...rest }: PasswordFieldProps): import("react/jsx-runtime").JSX.Element; displayName: string; }; export {};