@cimpress/react-components
Version:
React components to support the MCP styleguide
34 lines • 1.74 kB
TypeScript
import React, { CSSProperties, ReactElement, ReactNode } from 'react';
import { PublicComponentProps } from './types';
type Status = 'success' | 'warning' | 'error';
interface TextInputBaseProps<T> extends PublicComponentProps {
status?: Status;
helpText?: ReactNode;
id?: string;
inputStyle?: CSSProperties;
label?: string;
onChange?: (event: React.ChangeEvent<T> & {
isValid: boolean;
}) => void;
rightAddon?: ReactElement;
type?: 'text' | 'number' | 'password' | 'url' | 'search' | 'email' | 'tel' | 'textarea';
}
export declare const formGroupCss: string;
export declare const formGroupActiveCss: string;
export declare const controlLabelCss: string;
export interface TextFieldProps extends TextInputBaseProps<HTMLInputElement>, Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'onChange'> {
/** Determines the HTML5 input type of the input. One of text, number, password, url, search, email, or tel. */
type?: 'text' | 'number' | 'password' | 'url' | 'search' | 'email' | 'tel';
}
export interface TextAreaProps extends TextInputBaseProps<HTMLTextAreaElement>, Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'type' | 'onChange' | 'cols'> {
/** @deprecated */
rightAddon?: ReactElement;
/**
* Applies validation to `onChange` event. If the pattern is not matched, the `isValid` property will be `false`.
* @deprecated */
pattern?: string;
}
export declare const TextField: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<HTMLInputElement>>;
export declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
export {};
//# sourceMappingURL=TextInput.d.ts.map