goobs-frontend
Version:
A comprehensive React-based libary for building modern web applications
42 lines • 1.63 kB
TypeScript
import { default as React } from 'react';
import { FieldStyleOverrides } from '../Shell';
export interface SearchbarProps {
label?: string;
/** Placeholder text (default 'Search...'). */
placeholder?: string;
/** Controlled query string; the input always mirrors this prop. */
value: string;
/**
* Canonical value-shape onChange. Receives the raw input string —
* consumers wire this directly into setState without unwrapping a
* synthetic event.
*/
onChange: (value: string) => void;
helperText?: string;
/** Error message rendered below the input; sets aria-invalid. */
error?: string | boolean;
className?: string;
/** 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;
/**
* Form-engine binding key. When set inside a `<Form>`, the field auto-binds
* value/onChange to the engine and FieldShell derives error/required and
* emits `data-field-name`. Inert outside a `<Form>`.
*/
name?: string;
styles?: FieldStyleOverrides & {
color?: string;
adornmentColor?: string;
};
}
/**
* Search input built on FieldShell with a leading magnifier icon inside the
* frame. `onChange` emits the plain string value — not a DOM event.
* Controlled via `value`; inside a goobs `<Form>` a `name` lets the form
* engine drive value/onChange instead.
*/
declare const Searchbar: React.FC<SearchbarProps>;
export default Searchbar;
//# sourceMappingURL=index.d.ts.map