import { IconType } from '@autoguru/icons'; import React, { type ChangeEventHandler, type ComponentProps, type ComponentType, type FocusEventHandler, type ForwardedRef, type InputHTMLAttributes, type KeyboardEventHandler, type MouseEventHandler, type ReactNode, type Ref, type RefObject } from 'react'; import { type Sprinkles } from '../../../styles/sprinkles.css'; import type { TestIdProp } from '../../../types'; import { NotchedBase } from './NotchedBase'; import type { InputSize } from './withEnhancedInput.css'; type ElementTypes = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement; type NativeAttributes = Omit, 'as' | 'color' | 'height' | 'is' | 'placeholder' | 'size' | 'width'>; export interface EventHandlers { onChange?: ChangeEventHandler; onBlur?: FocusEventHandler; onFocus?: FocusEventHandler; onKeyDown?: KeyboardEventHandler; onClick?: MouseEventHandler; onMouseEnter?: MouseEventHandler; onMouseLeave?: MouseEventHandler; onReset?(): void; } export interface EnhanceInputPrimitiveProps extends NativeAttributes, Pick, 'notch' | 'placeholder' | 'attach' | 'borderMerged' | 'isFocused'>, Pick, TestIdProp { name: string; id?: string; className?: string; value?: string; hintText?: ReactNode; autoFocus?: boolean; disabled?: boolean; reserveHintSpace?: boolean; size?: InputSize; fieldIcon?: IconType; prefixIcon?: IconType; suffixIcon?: IconType; wrapperRef?: Ref; isLoading?: boolean; } export interface ValidationProps { isTouched?: boolean; isValid?: boolean; } export type EnhanceInputProps = IncomingProps & EnhanceInputPrimitiveProps & EventHandlers & ValidationProps; export type WrappedComponentProps = { size: InputSize; validation: ValidationProps; eventHandlers: EventHandlers; field: Omit, 'placeholder' | 'hintText' | 'fieldIcon' | 'size'> & { ref: ForwardedRef | RefObject; }; fieldIcon?: EnhanceInputPrimitiveProps['fieldIcon']; className?: boolean; prefixed: boolean; suffixed: boolean; isLoading: boolean; } & IncomingProps & Pick, 'attach' | 'borderMerged' | 'isFocused'>; interface EnhancedInputConfigs { defaultValue?: ValueType; withPrefixIcon?: boolean; withSuffixIcon?: boolean; primitiveType: 'textarea' | 'text' | 'number' | 'date' | 'select' | 'color'; } export declare const withEnhancedInput: (WrappingComponent: ComponentType>, { primitiveType, withPrefixIcon, withSuffixIcon, defaultValue, }?: EnhancedInputConfigs) => React.ForwardRefExoticComponent> & React.RefAttributes>; export {}; //# sourceMappingURL=withEnhancedInput.d.ts.map