@octopusdeploy/design-system-components
Version:
The design systems component library.
39 lines (38 loc) • 2.16 kB
TypeScript
import * as React from "react";
import { type TextFieldProps } from "../TextField/TextField";
type TextFieldNumberProps = Extract<TextFieldProps<number | undefined>, {
type: "number";
}>;
export type NumberFieldProps = Omit<TextFieldNumberProps, "type" | "validationState">;
/**
* NumberField A form input for entering numbers.
*
* @remarks Rollout currently paused — do not use in new code until further notice.
* Use `<Text>` instead.
* @see <DeprecatedNumber> from @octopusdeploy/design-system-octopus-components
*
* @param props - NumberFieldProps
* @param props.label - The label for the input field
* @param props.value - The current value of the input
* @param props.placeholder - The placeholder text to display when input is empty
* @param props.description - The description text to display below the input
* @param props.validationMessage - Validation message to display
* @param props.disabled - Whether the field is disabled
* @param props.hasRequiredMarker - Whether the field is required
* @param props.hasOptionalMarker - Whether to show optional marker
* @param props.hasDefaultMarker - Whether this field has a default value marker
* @param props.popover - PopoverBasicHelp component to display additional help information e.g. <PopoverBasicHelp placement="right-start" description="A popover" />
* @param props.autoFocus - Whether to autofocus the input
* @param props.readOnly - Whether the input is readonly
* @param props.name - The name attribute for the input
* @param props.prefix - The prefix to display before the input - can be a string or a icon it cannot be interactive
* @param props.suffix - The suffix to display after the input - can be a string or a button with ghost importance and medium size only
* @param props.min - The minimum value allowed
* @param props.max - The maximum value allowed
* @param props.step - The step value for the number input
* @param props.onChange - The action to perform when the form control field is changed
*
* @returns NumberField component
*/
export declare function NumberField(props: NumberFieldProps): React.ReactElement;
export default NumberField;