import { IStylableProps } from '../Generic.types'; import { ChangeEvent } from 'react'; export interface ITextFieldProps extends IStylableProps { /** * The ID to be used for the input and htmlFor/for */ id?: string; /** * THe provided onChange functon is run when the value is changed. */ onChange?: (e: ChangeEvent) => any; /** * The onSubmit is triggered on enter key in input elements (not on text area due to line break) */ onSubmit?: (e: HTMLInputElement | HTMLTextAreaElement) => any; /** * Color style to acheive sufficient contrast to background. Valid for TextFieldType.Transparent * @default ColorStyle.dark */ colorStyle?: ColorStyle; /** * If the field is valid. Used for controlling aria tags on input * @default true */ isValid?: boolean; /** * The id to the error message. To be used in aria-describedby attribute on input. */ errorMessageId?: string; /** * Any additional props are passed through to the underlying element. */ [key: string]: any; } export declare enum TextFieldType { /** * A regular textBox aka input field * @default textBox */ textBox = "textBox", /** * Renders a html textarea */ textArea = "textArea", /** * Renders a transparent input field */ transparent = "transparent" } export declare enum ColorStyle { /** * To be used on a dark background */ light = "light", /** * To be used on a light background */ dark = "dark" } export default ITextFieldProps;