UNPKG

@trail-ui/react

Version:
30 lines (27 loc) 1.1 kB
import * as react_jsx_runtime from 'react/jsx-runtime'; import { NumberInputVariantProps, ButtonVariantProps, SlotsToClasses, NumberInputSlots } from '@trail-ui/theme'; import { ReactNode } from 'react'; import { NumberFieldProps, ValidationResult } from 'react-aria-components'; import { InputProps } from '../input/input.js'; interface NumberInputProps extends NumberFieldProps, NumberInputVariantProps { label?: string; description?: string; errorMessage?: string | ((validation: ValidationResult) => string); buttonProps?: ButtonVariantProps; inputProps?: InputProps; placeholder?: string; /** * The decrement content to display inside the button. */ decrementContent?: ReactNode; /** * The increment content to display inside the button. */ incrementContent?: ReactNode; /** * Classes object to style the number input and its children. */ classNames?: SlotsToClasses<NumberInputSlots>; } declare function NumberInput(props: NumberInputProps): react_jsx_runtime.JSX.Element; export { NumberInput, NumberInputProps };