import { CommonProps, Refable } from "@trackunit/react-components"; import { MappedOmit } from "@trackunit/shared-utils"; import { InputHTMLAttributes, ReactElement, ReactNode } from "react"; import { FormComponentSizes } from "../../types"; import { LockedForReasons } from "./InputLockReasonTooltip"; import { BaseInputActionTypes } from "./components/GenericActionsRenderer"; type FilteredInputProps = MappedOmit, "prefix" | "disabled" | "readOnly">; export interface BaseInputProps extends FilteredInputProps, CommonProps, Refable { /** * A React element to render before the text in the input. */ prefix?: ReactNode; /** * A React element to render after the text in the input. */ suffix?: ReactNode; /** * A React element to render in a separate container before the text in the input. */ addonBefore?: ReactNode; /** * A React element to render in a separate container after the text in the input. */ addonAfter?: ReactNode; /** * A ReactNode to render at the end of the input field before the addonAfter. */ actions?: ReactNode; /** * The size of the input field. */ fieldSize?: FormComponentSizes; /** * If true the field is rendered in its invalid state. */ isInvalid?: boolean; /** * The Placeholder text for the input. */ placeholder?: string; /** * Custom css classes for the inner Input element. */ inputClassName?: string; /** * If true, shows the input in warning state. */ isWarning?: boolean; /** * Render a generic action, like "copy". */ genericAction?: BaseInputActionTypes; /** * Flag or object to disable the input. If an object, shows a tooltip with the reason. */ disabled?: boolean | LockedForReasons; /** * Flag or object to set the input as readOnly. If an object, shows a tooltip with the reason. */ readOnly?: boolean | LockedForReasons; } /** * A base input component that can be used for text inputs, password inputs, etc. * A reference to the input element is provided as the `ref` prop. * Extends props from [React.InputHTMLAttributes](https://reactjs.org/docs/dom-elements.html#input) * * For specific input types make sure to use the corresponding input component. * This is a base used by our other input components such as TextBaseInput, NumberBaseInput, PasswordBaseInput, etc. */ export declare const BaseInput: { ({ className, isInvalid, "data-testid": dataTestId, prefix, suffix, addonBefore, addonAfter, actions, fieldSize, inputClassName, placeholder, isWarning, type, genericAction, style, ref, required, readOnly, disabled, ...rest }: BaseInputProps): ReactElement; displayName: string; }; export {};