import { ReactNode, InputHTMLAttributes, ChangeEvent, CSSProperties } from 'react';
/**
* Input Component Types
*/
export type InputType = 'text' | 'password' | 'email' | 'number' | 'search' | 'tel' | 'url';
export type InputSize = 'sm' | 'md';
export type InputVariant = 'default' | 'filled' | 'outlined' | 'display';
/**
* Font size value - can be a theme token key or a CSS value
*/
export type FontSizeValue = 'xs' | 'sm' | 'base' | 'md' | 'lg' | 'xl' | CSSProperties['fontSize'];
/**
* Input adornments for start/end of input
*/
export interface InputAdornments {
/** Element to display at the start of the input */
startAdornment?: ReactNode;
/** Element to display at the end of the input */
endAdornment?: ReactNode;
}
export interface InputProps extends Omit, 'size'> {
/** Input type */
type?: InputType;
/** Size variant */
size?: InputSize;
/** Visual variant */
variant?: InputVariant;
/** Label text */
label?: string;
/** Helper text displayed below input */
helperText?: string;
/** Error state */
error?: boolean;
/** Error message (overrides helperText when error is true) */
errorMessage?: string;
/** Left icon/addon */
leftElement?: ReactNode;
/** Right icon/addon (e.g., clear button, password toggle) */
rightElement?: ReactNode;
/** Full width */
fullWidth?: boolean;
/** Additional wrapper className */
wrapperClassName?: string;
/** Additional CSS classes for input element */
className?: string;
/** Test ID */
'data-testid'?: string;
/**
* Input adornments - alternative to leftElement/rightElement
* Provides compatibility with ib-ui InputProps pattern
*/
InputProps?: InputAdornments;
/**
* Debounce timeout in milliseconds for onChangeDebounced callback
* Set to 0 to disable debouncing
* @default 0
*/
debounceTimeout?: number;
/**
* Debounced change handler - called after debounceTimeout ms
* Only called when value actually changes
*/
onChangeDebounced?: (value: string) => void;
/**
* Input mask function - transforms input value
* Called on each change to format/filter the value
* @example mask={(v) => v.replace(/\D/g, '')} // Numbers only
*/
mask?: (value: string) => string;
/**
* Custom data-id attribute
*/
dataId?: string;
/**
* Whether to show the error message below the input
* @default true
*/
showErrorMessage?: boolean;
/**
* Input type variant (different from HTML type)
* Used for special handling like number input masking
*/
inputType?: 'text' | 'number' | 'password';
/**
* Custom container styles
*/
containerClassName?: string;
/**
* Custom border radius override
*/
borderRadius?: string;
/**
* Minimum value for number inputs
*/
min?: number | string;
/**
* Maximum value for number inputs
*/
max?: number | string;
/**
* Extended onChange handler providing the synthetic event
*/
onChange?: (event: ChangeEvent) => void;
/**
* Font size for the input text and placeholder
* Can be a theme token key ('xs', 'sm', 'base', 'md', 'lg', 'xl') or CSS value
* Default font size aligns with Button font size when not set
*/
inputFontSize?: FontSizeValue;
/**
* Custom focus color for the input border and box-shadow
* When provided, overrides the default theme-based focus styling
* Accepts any valid CSS color value (hex, rgb, hsl, etc.)
*/
focusColor?: string;
}
//# sourceMappingURL=Input.types.d.ts.map