import { FormGroupProps } from "../FormGroup/FormGroup"; import { NumberBaseInputProps } from "./NumberBaseInput/NumberBaseInput"; type FormGroupExposedProps = Pick; export interface NumberFieldProps extends NumberBaseInputProps, FormGroupExposedProps { /** * If a value is set, the field is rendered in its invalid state. */ errorMessage?: string; } /** * The number field component is used for entering numeric values and includes controls for incrementally increasing or decreasing the value. * * ### When to use * Use NumberField when the controls to incrementally increase or decrease makes the task easier for the user, such as quantity selectors or numeric settings. * * ### When not to use * Do not use NumberField for non-serialized numbers or IDs. Use TextField instead. * * @example Basic number field * ```tsx * import { NumberField } from "@trackunit/react-form-components"; * import { useState } from "react"; * * const MyForm = () => { * const [quantity, setQuantity] = useState(1); * * return ( * setQuantity(Number(e.target.value))} * min={1} * max={100} * /> * ); * }; * ``` * @example Number field with validation * ```tsx * import { NumberField } from "@trackunit/react-form-components"; * import { useState } from "react"; * * const TemperatureInput = () => { * const [temp, setTemp] = useState(20); * * return ( * setTemp(Number(e.target.value))} * min={-40} * max={60} * step={0.5} * helpText="Enter a value between -40 and 60" * required * /> * ); * }; * ``` */ export declare const NumberField: { ({ label, id, tip, helpText, errorMessage, helpAddon, isInvalid, isWarning, maxLength, className, value, "data-testid": dataTestId, defaultValue, onBlur, onChange, ref, required, ...rest }: NumberFieldProps): import("react/jsx-runtime").JSX.Element; displayName: string; }; export {};