UNPKG

goobs-frontend

Version:

A comprehensive React-based libary for building modern web applications

51 lines 2.39 kB
import { default as React } from 'react'; import { FieldStyleOverrides } from '../../Shell'; export interface AccountNumberProps { /** * Fires on every edit with the (possibly partial) account-number string. * Validation status now flows through `onValidityChange` so consumers * who don't care about validity can stay value-only. */ onChange?: (value: string) => void; /** * Optional side-channel for validity changes. Replaces the legacy * tuple-position `(value, isValid)` shape. */ onValidityChange?: (isValid: boolean) => void; /** Minimum digit count for validity (default 8). */ minLength?: number; /** Maximum digit count for validity (default 17); also caps the input length. */ maxLength?: number; /** Marks the value as prefilled: it renders masked to its last 4 digits until the field is focused or edited. */ isDefaultValue?: boolean; /** Controlled value. Omit inside a `<Form>` with `name` to let the engine drive it. */ value?: string; /** Field label (default 'Account Number'). */ label?: React.ReactNode; /** Placeholder text. Overridden to '1234567890' under the sacred theme. */ placeholder?: string; id?: string; /** Forwarded to the input as `name` for native form submission. */ name?: string; onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void; onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void; helperText?: string; /** Error message rendered below the input; sets aria-invalid. */ error?: string | boolean; /** Stable test selector — emitted as `data-field` on the wrapper. */ dataField?: string; /** Stable test selector — emitted as `data-field-name` on the wrapper. */ dataFieldName?: string; styles?: FieldStyleOverrides; } /** * Bank-account-number input built on FieldShell with a '#' prefix adornment. * Input is restricted to digits and dashes; `onChange` emits the plain string * — not a DOM event — and `onValidityChange` reports the digits/length check. * With `isDefaultValue`, a prefilled value renders masked to its last 4 * digits until focused or edited. Auto-binds by `name` inside a goobs * `<Form>` when no explicit `value` is passed. */ declare const AccountNumber: React.FC<AccountNumberProps>; export default AccountNumber; //# sourceMappingURL=index.d.ts.map