UNPKG

goobs-frontend

Version:

A comprehensive React-based libary for building modern web applications

34 lines 1.48 kB
import { default as React } from 'react'; import { FieldStyleOverrides } from '../../Shell'; export interface DropdownOption { value: string | number; _id?: string; } export interface SearchableSimpleProps { label: string; options: DropdownOption[]; /** Controlled value. Pair with `onChange` for fully-controlled mode. */ value?: string | number; /** Uncontrolled initial value. Ignored when `value` is provided. */ defaultValue?: string | number; /** * Canonical onChange shape — receives the full option object (or * null when cleared). Object payload is preserved here because the * value is structural (`{ value, _id }`), not a primitive. */ onChange?: (value: DropdownOption | null) => void; placeholder?: string; helperText?: string; /** Error message rendered below the trigger; 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; /** HTML-style field name. Alias for dataFieldName so the test contract can target the field by either; data-field-name is emitted from dataFieldName ?? name. */ name?: string; styles?: FieldStyleOverrides; } declare const SearchableSimple: React.FC<SearchableSimpleProps>; export default SearchableSimple; //# sourceMappingURL=index.d.ts.map