@wonderflow/react-components
Version:
UI components from Wonderflow's Wanda design system
68 lines • 2.56 kB
TypeScript
import { ChangeEvent } from 'react';
import { SymbolProps } from '../..';
import { BaseFieldProps, PrimitiveInputType } from './base-field';
export declare type TextfieldProps<T = Record<string, unknown>> = BaseFieldProps<{
/**
* Set the icon to show on the left or right side of the input.
*/
icon?: SymbolProps['source'];
/**
* Set in which side of the field the icon should be displayed.
*/
iconPosition?: 'left' | 'right';
/**
* Define the accessible label of the input. While this is not
* mandatory, an input should always have a label. If not using this property
* you can bind a custom label to the input by using an id.
*/
label?: string;
/**
* Optional hint text field, it provides additional help or context
* to the user, it is often used to explain the correct format of the textfield data.
*/
message?: string;
/**
* Set the input type. The value can be anything that
* is supported by the HTML input element.
*
* Read more: https://developer.mozilla.org/en-US/docs/Learn/Forms/HTML5_input_types
*/
type?: string;
/**
* Set the input to be a textarea instead of a single line field.
* This property completely changes the rendered element from an input to a textarea.
*/
textarea?: boolean;
/**
* Set the size of the field
*/
dimension?: 'regular' | 'small' | 'big';
/**
* Set the field into a readonly state. When readonly, the field value
* cannot be edited but it can still be selected and copied.
*/
readOnly?: boolean;
/**
* Set the field into a disabled state. When disabled, the field value cannot be
* edited, selected or copied, but it can still be focused and navigated by AT.
*/
disabled?: boolean;
/**
* The callback function that is called when the input value changes.
*/
onChange?: (event: ChangeEvent<PrimitiveInputType>) => void;
/**
* Make the textfield full width, filling the available space.
*/
fullWidth?: boolean;
/**
* Set a minimum number of rows for the textarea only.
*/
minRows?: number;
/**
* Set a maximum number of rows for the textarea only. The rest of the content will be scrollable.
*/
maxRows?: number;
}> & T;
export declare const Textfield: import("react").ForwardRefExoticComponent<Pick<TextfieldProps<Record<string, unknown>>, string> & import("react").RefAttributes<PrimitiveInputType>>;
//# sourceMappingURL=textfield.d.ts.map