import React from 'react'; import { DarkModeProps, Either, LgIdProps } from '@leafygreen-ui/lib'; import { BaseFontSize } from '@leafygreen-ui/tokens'; export declare const State: { readonly None: "none"; readonly Error: "error"; readonly Valid: "valid"; }; export type State = (typeof State)[keyof typeof State]; export declare const TextInputType: { readonly Email: "email"; readonly Password: "password"; readonly Search: "search"; readonly Text: "text"; readonly Url: "url"; readonly Tel: "tel"; readonly Number: "number"; }; export type TextInputType = (typeof TextInputType)[keyof typeof TextInputType]; export declare const SizeVariant: { readonly XSmall: "xsmall"; readonly Small: "small"; readonly Default: "default"; readonly Large: "large"; }; export type SizeVariant = (typeof SizeVariant)[keyof typeof SizeVariant]; export declare const TextInputFontSize: { readonly Large: 18; readonly Body1: 13; readonly Body2: 16; }; export type TextInputFontSize = (typeof TextInputFontSize)[keyof typeof TextInputFontSize]; interface AriaLabelProps { /** * Text shown in bold above the input element. * * Optional if `aria-labelledby` or `aria-label` is provided */ label?: string; /** * Screen-reader label element. * * Optional if `label` or `aria-label` is provided */ ['aria-labelledby']?: string; /** * Screen reader label text * * Optional if `label` or `aria-labelledby` is provided * */ ['aria-label']?: string; } type AriaLabels = keyof AriaLabelProps; interface TextInputTypeProp { /** * The input type. */ type?: TextInputType; } export interface BaseTextInputProps extends Omit, AriaLabels>, DarkModeProps, LgIdProps { /** * id associated with the TextInput component. */ id?: string; /** * Text that gives more detail about the requirements for the input. */ description?: string; /** * Whether or not the field is optional. * Default: false */ optional?: boolean; /** * Whether or not the field is disabled. This will set the `aria-disabled` and `readonly` attributes on the input, not the `disabled` attribute. * Default: false */ disabled?: boolean; /** * Callback to be executed when the input stops being focused. */ onBlur?: React.FocusEventHandler; /** * Callback to be executed when the value of the input field changes. */ onChange?: React.ChangeEventHandler; /** * The placeholder text shown in the input field before the user begins typing. */ placeholder?: string; /** * The message shown below the input field if the value is invalid. */ errorMessage?: React.ReactNode; /** * The message shown below the input field if the value is valid. */ successMessage?: React.ReactNode; /** * The current state of the TextInput. This can be none, valid, or error. */ state?: State; /** * The current value of the input field. If a value is passed to this prop, component will be controlled by consumer. */ value?: string; /** * className supplied to the TextInput container. */ className?: string; /** * Callback called whenever validation should be run. * * See [Form Validation & Error Handling](https://www.mongodb.design/foundation/forms/#form-validation--error-handling) for more */ handleValidation?: (value: string) => void; /** * determines the font size and padding. */ sizeVariant?: SizeVariant; /** * determines the base font size if sizeVariant is set to default. */ baseFontSize?: BaseFontSize; } export type TextInputProps = Either; export type TextInputComponentType = React.ForwardRefExoticComponent; export {}; //# sourceMappingURL=TextInput.types.d.ts.map