@up-group-ui/react-controls
Version:
Up shared react controls
57 lines (56 loc) • 1.78 kB
TypeScript
import { Tooltip } from '../../Display/Tooltip';
import { IconName } from '../../../Common/theming/icons';
import { CommonInputTextProps } from '../_Common/BaseControl/BaseInput';
import { InputIconPosition } from '../_Common/Styled/Input/types';
export declare type WidthSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'fill';
export declare type HeightSize = 'normal' | 'large';
export declare type InputType = 'text' | 'email' | 'number' | 'integer' | 'phone' | 'search' | 'password';
export interface Validation {
pattern: RegExp;
errorMessage: string;
}
export interface UpInputStyledProps extends CommonProps<string> {
color?: string;
backgroundColor?: string;
borderColor?: string;
type?: InputType;
showError?: boolean;
onChange?: (data: any) => void;
className?: string;
value: string;
maxLength?: number;
focused?: boolean;
dataFor?: string;
autoFocus?: boolean;
hasClearOption: boolean;
onClear?: () => void;
isLoading?: boolean;
}
export interface CommonProps<VT> extends CommonInputTextProps<VT> {
disabled?: boolean;
placeholder?: string;
height?: HeightSize;
width?: WidthSize;
readonly?: boolean;
tooltip?: string | Tooltip;
showSuccess?: boolean;
iconName?: IconName;
iconPosition?: InputIconPosition;
rounded?: boolean;
autocomplete?: string;
id?: string;
autoFocus?: boolean;
}
export interface UpInputProps extends CommonProps<string> {
type?: InputType;
hasError?: boolean;
value?: string;
validation?: Array<Validation>;
maxLength?: number;
hasClearOption?: boolean;
onClear?: () => void;
isLoading?: boolean;
focused?: boolean;
className?: string;
showValidationStatus?: boolean;
}