import { ReactNode } from 'react'; import { OutlinedInputProps } from '@mui/material/OutlinedInput'; import { BaseComponentProps } from '../../types'; /** * Input size variants */ export type InputSize = 'small' | 'medium' | 'large'; export interface InputProps extends Omit, Omit { /** * Label text displayed above the input field. * @example * */ label?: string; /** * When true, displays a red asterisk (*) next to the label indicating the field is required. * This is for visual indication only - add HTML required attribute for form validation. * @default false * @example * */ isRequired?: boolean; /** * Icon element displayed on the left side of the input. * When provided, the input automatically uses the icon-enhanced layout. * @example * import SearchIcon from '@mui/icons-material/Search'; * } /> */ leftIcon?: ReactNode; /** * Icon element displayed on the right side of the input. * When provided, the input automatically uses the icon-enhanced layout. * @example * import VisibilityIcon from '@mui/icons-material/Visibility'; * } /> */ rightIcon?: ReactNode; /** * Click handler for the left icon. * @example * } leftIconClick={() => performSearch()} /> */ leftIconClick?: () => void; /** * Click handler for the right icon. * @example * } rightIconClick={() => clearInput()} /> */ rightIconClick?: () => void; /** * Helper text displayed below the input field. * Useful for providing hints, validation messages, or additional context. * Requires isHelperText to be true. * @example * */ helperText?: string; /** * When true, displays the helperText below the input. * @default false * @example * */ isHelperText?: boolean; /** * Helper text displayed when the input is focused. * Replaces helperText temporarily while the input has focus. * @example * */ focusedText?: string; /** * When true, displays the input in an error state with red styling. * Use for validation errors. * @default false * @example * */ isError?: boolean; /** * When true, disables the input field. * @default false * @example * */ isDisabled?: boolean; /** * HTML for attribute to associate the label with the input. * Should match the id of the input for accessibility. * @example * */ htmlFor?: string; /** * When true, allows icon clicks even when the input is disabled. * Useful for actions like showing password or clearing the field. * @default false * @example * } * rightIconClick={toggleVisibility} * iconClickOnDisabled * /> */ iconClickOnDisabled?: boolean; /** * Size of the input field. * - 'small': 24px height * - 'medium': 28px height * - 'large': 32px height (default) * @default 'large' * @example * */ size?: InputSize; /** * Autocomplete attribute for browser autofill behavior. * @example * */ autoComplete?: string; } /** * Props for the internal VanillaInput component */ export type VanillaInputProps = Omit; /** * Props for the internal InputWithIcon component */ export type InputWithIconProps = InputProps; /** * Props for the HelperText component */ export interface HelperTextProps { /** * Default helper text to display */ helper?: string; /** * Text to display when input is focused */ focusedText?: string; } //# sourceMappingURL=Input.types.d.ts.map