UNPKG

@tiller-ds/formik-elements

Version:

Formik elements module of Tiller Design System

29 lines (28 loc) 1.3 kB
/// <reference types="react" /> import { InputProps } from "@tiller-ds/form-elements"; import { ComponentTokens } from "@tiller-ds/theme"; declare type InputOnlyPropsUnion = "value" | "onChange" | "onBlur" | "error"; export declare type InputFieldProps = { /** * The accessor value for the input field component (for validation, fetching, etc.). */ name: string; /** * Determines whether a clear button (X) is shown in the field. */ allowClear?: boolean; /** * Determines whether the components auto trim whitespace after typing */ autoTrim?: boolean; /** * Function or a string that determines how the input value should be transformed when the user types into the input field. * In case it's a function, it will be called every time the input value changes. The function can then modify the value as needed and return the modified value. */ valueTransform?: "uppercase" | "lowercase" | "capitalize" | ((value: string) => void); } & Omit<InputProps, InputOnlyPropsUnion> & InputTokensProps; declare type InputTokensProps = { tokens?: ComponentTokens<"Input">; }; export default function InputField({ name, autoTrim, valueTransform, ...props }: InputFieldProps): JSX.Element; export {};