import type { ChangeEvent, InputHTMLAttributes, ReactNode } from 'react';
import { DefaultAttributes } from '../types';
export declare type Variant = 'small' | 'medium' | 'large';
export declare type InputType = 'text' | 'email' | 'password' | 'tel' | 'search';
export declare type Value = string | number | symbol;
export declare type SelectOption = DefaultAttributes & {
value: V;
label: string;
dataTestId?: string;
altText?: string;
isDisabled?: boolean;
isHidden?: boolean;
};
export declare type InputProps = {
variant?: Variant;
disabled?: boolean;
hasError?: boolean;
hasFocus?: boolean;
hasPrefix?: boolean;
hasSuffix?: boolean;
hasLabel?: boolean;
height?: string;
};
export declare type FieldProps = DefaultAttributes & {
id?: string;
name?: string;
label?: string;
required?: boolean;
placeholder?: string;
hasError?: boolean;
errorText?: string;
assistText?: ReactNode;
optionalText?: string;
value?: Value;
disabled?: boolean;
minChar?: number;
maxChar?: number;
showCharCount?: boolean;
autoComplete?: boolean;
touched?: boolean;
};
export declare type TextFieldProps = DefaultAttributes & {
variant?: Variant;
type?: InputType;
prefix?: ReactNode;
suffix?: ReactNode;
width?: string;
onSuffixClick?: (event: React.MouseEvent) => void;
onChange: (event: React.ChangeEvent) => void;
onKeyUp?: (event: React.KeyboardEvent) => void;
onBlur?: (event: React.FocusEvent) => void;
onFocus?: (event: React.FocusEvent) => void;
onPaste?: (event: React.ClipboardEvent) => void;
};
export declare type TextAreaProps = DefaultAttributes & {
variant?: Variant;
width?: string;
onChange: (event: React.ChangeEvent) => void;
onKeyUp?: (event: React.KeyboardEvent) => void;
onBlur?: (event: React.FocusEvent) => void;
onFocus?: (event: React.FocusEvent) => void;
};
export declare type DropdownBaseProps = DefaultAttributes & {
variant: Variant;
id?: string;
name?: string;
label?: string;
required?: boolean;
placeholder?: string;
hasError?: boolean;
errorText?: string;
assistText?: ReactNode;
optionalText?: string;
prefix?: ReactNode;
width?: string;
options: SelectOption[];
disabled?: boolean;
maxHeight?: number;
onOpen?: () => void;
onClose?: () => void;
onBlur?: () => void;
onFocus?: () => void;
touched?: boolean;
noMargin?: boolean;
};
export declare type DropdownDefaultProps = DropdownBaseProps & {
multivalue?: false;
value: SelectOption;
onChange: (v: SelectOption) => void;
};
export declare type DropdownMultiValueProps = DropdownBaseProps & {
multivalue: true;
value: SelectOption[];
onChange: (v: SelectOption[]) => void;
};
export declare type DropdownProps = DropdownDefaultProps | DropdownMultiValueProps;
export declare type MultiValueDropdownProps = Omit, 'value' | 'onChange'> & {
values: SelectOption[];
onChange: (v: SelectOption[]) => void;
};
export declare type SearchableDropdownBaseProps = DefaultAttributes & {
variant: Variant;
options: SelectOption[];
noResultsText: string;
debounceDelay?: number;
name?: string;
label?: string;
required?: boolean;
optionalText?: string;
errorText?: string;
assistText?: ReactNode;
id?: string;
width?: string;
className?: string;
placeholder?: string;
hasError?: boolean;
disabled?: boolean;
maxHeight?: number;
onOpen?: () => void;
onClose?: () => void;
onBlur?: () => void;
onFocus?: () => void;
onTextChange?: (text: string) => void;
touched?: boolean;
};
export declare type SearchableDropdownDefaultProps = SearchableDropdownBaseProps & {
multivalue?: false;
value: SelectOption | null;
onChange: (opt: SelectOption | null) => void;
};
export declare type SearchableDropdownMultiValueProps = Omit, 'value' | 'onChange'> & {
multivalue: true;
value: SelectOption[];
onChange: (v: SelectOption[]) => void;
};
export declare type SearchableDropdownProps = SearchableDropdownDefaultProps | SearchableDropdownMultiValueProps;
export declare type CheckRadioGroupOrientation = 'row' | 'column';
export declare type CheckRadioButtonProps = DefaultAttributes & {
value: string | number;
name: string;
label?: string;
checked?: boolean;
onChange: (event: ChangeEvent) => void;
disabled?: boolean;
id?: string;
hasError?: boolean;
errorText?: string;
assistText?: string;
tabIndex?: number;
};
export declare type CheckboxButtonProps = CheckRadioButtonProps & {
indeterminate?: boolean;
};
export declare type CheckRadioProps = DefaultAttributes & InputHTMLAttributes & Pick;
export declare type CheckboxProps = CheckRadioProps & {
indeterminate?: boolean;
};
export declare type CheckRadioCssProps = Pick;
export declare type CheckRadioOptionsProps = DefaultAttributes & {
value: string | number;
label: string;
id?: string;
disabled?: boolean;
hasError?: boolean;
indeterminate?: boolean;
checked?: boolean;
};
export declare type CheckRadioGroupProps = DefaultAttributes & {
name: string;
onChange: (event: ChangeEvent) => void;
orientation?: CheckRadioGroupOrientation;
value?: string | number | boolean;
id?: string;
options: CheckRadioOptionsProps[];
groupLabel?: string;
hasError?: boolean;
errorText?: string;
assistText?: string;
disabled?: boolean;
};
export declare type CheckRadioGroupCSSProps = Pick;