import * as React from "react"; import type { Icon as BaseIcon } from "../Icon/index.js"; import { type VariantProps } from "../utils.js"; interface InputIconProps extends React.HTMLAttributes { icon: React.ReactElement; inputSize?: VariantProps["size"]; } declare const InputIcon: ({ icon, inputSize, className }: InputIconProps) => React.JSX.Element; /** * Input * * We support both `disabled` and `data-disabled` as well as `focused` and `data-focused` variants * because these variants can be used by both input and div elements. The last one is used by `MultiAutocomplete` component, * where the `inputVariants` is used to style a div that wraps multiple elements (input, Tags, icons, etc.) */ declare const inputVariants: (props?: ({ size?: "md" | "lg" | "xl" | null | undefined; variant?: "primary" | "secondary" | "ghost" | "ghost-negative" | null | undefined; invalid?: boolean | null | undefined; } & import("class-variance-authority/types").ClassProp) | undefined) => string; type InputPrimitiveProps = Omit, "size" | "onChange"> & VariantProps & { /** * Icon to be displayed at the start of the input field. */ startIcon?: React.ReactElement | React.ReactElement; /** * Icon to be displayed at the end of the input field. */ endIcon?: React.ReactElement | React.ReactElement; /** * Maximum length of the input field. */ maxLength?: React.InputHTMLAttributes["size"]; /** * Reference to the input element. */ inputRef?: React.Ref; /** * If true, it will pass the native `event` to the `onChange` callback */ forwardEventOnChange?: boolean; /** * Callback function to be called when the Enter key is pressed. */ onEnter?: InputPrimitiveProps["onKeyDown"]; /** * Callback function to be called when the Esc key is pressed. */ onEscape?: InputPrimitiveProps["onKeyDown"]; /** * A callback that is executed each time a value is changed. */ onChange?: (value: TValue) => void; /** * If true, will select the value in the input on focus. */ autoSelect?: boolean; }; declare const InputPrimitive: (({ autoSelect, className, disabled, endIcon, forwardEventOnChange, inputRef, invalid, maxLength, onChange: originalOnChange, onEnter, onEscape, onKeyDown: originalOnKeyDown, onFocus: originalOnFocus, size, startIcon, value, variant, ...props }: InputPrimitiveProps) => React.JSX.Element) & { original: ({ autoSelect, className, disabled, endIcon, forwardEventOnChange, inputRef, invalid, maxLength, onChange: originalOnChange, onEnter, onEscape, onKeyDown: originalOnKeyDown, onFocus: originalOnFocus, size, startIcon, value, variant, ...props }: InputPrimitiveProps) => React.JSX.Element; originalName: string; displayName: string; } & { original: (({ autoSelect, className, disabled, endIcon, forwardEventOnChange, inputRef, invalid, maxLength, onChange: originalOnChange, onEnter, onEscape, onKeyDown: originalOnKeyDown, onFocus: originalOnFocus, size, startIcon, value, variant, ...props }: InputPrimitiveProps) => React.JSX.Element) & { original: ({ autoSelect, className, disabled, endIcon, forwardEventOnChange, inputRef, invalid, maxLength, onChange: originalOnChange, onEnter, onEscape, onKeyDown: originalOnKeyDown, onFocus: originalOnFocus, size, startIcon, value, variant, ...props }: InputPrimitiveProps) => React.JSX.Element; originalName: string; displayName: string; }; originalName: string; displayName: string; } & { createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<(({ autoSelect, className, disabled, endIcon, forwardEventOnChange, inputRef, invalid, maxLength, onChange: originalOnChange, onEnter, onEscape, onKeyDown: originalOnKeyDown, onFocus: originalOnFocus, size, startIcon, value, variant, ...props }: InputPrimitiveProps) => React.JSX.Element) & { original: ({ autoSelect, className, disabled, endIcon, forwardEventOnChange, inputRef, invalid, maxLength, onChange: originalOnChange, onEnter, onEscape, onKeyDown: originalOnKeyDown, onFocus: originalOnFocus, size, startIcon, value, variant, ...props }: InputPrimitiveProps) => React.JSX.Element; originalName: string; displayName: string; }>) => (props: unknown) => React.JSX.Element; }; export { InputIcon, InputPrimitive, inputVariants, type InputIconProps, type InputPrimitiveProps };