import { NumberField } from "@base-ui/react/number-field"; import { Minus, Plus } from "lucide-react"; import cn from "~/utils/cn"; export interface NumberInputProps { label?: string; name?: string; description?: string; required?: boolean; disabled?: boolean; min?: number; max?: number; step?: number; defaultValue?: number; value?: number; onValueChange?: (value: number | null) => void; } export default function NumberInput(props: NumberInputProps) { const { label, name, description } = props; return ( // `name` belongs on the Root, not the Input. The Input is a text field that // holds the locale-formatted value ("365,000", "365 000", "365.000"), while // the Root renders a hidden number input carrying the raw value. Naming the // Input would submit the formatted string and break server-side parsing. {label && ( )} {description && (
{description}
)}
); }