import { jsx as _jsx } from "react/jsx-runtime";
import { TextInput } from '@gravity-ui/uikit';
import isNumber from 'is-number';
export const NumberInput = (props) => {
    const { value, onUpdate, min, max, ...textInputProps } = props;
    return (_jsx(TextInput, { value: isNumber(value) ? String(value) : '', onUpdate: (v) => {
            if (isNumber(v)) {
                onUpdate(parseInt(v, 10));
            }
            else {
                onUpdate();
            }
        }, controlProps: { min, max }, type: "number", ...textInputProps }));
};
//# sourceMappingURL=NumberInput.js.map
