'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
export function NumberField({ label, value, onChange, min, max, required, helpText, error, }) {
    return (_jsxs("div", { children: [_jsxs("label", { className: "mb-1 block text-sm font-medium", children: [label, required && _jsx("span", { className: "ml-0.5 text-[var(--destructive)]", children: "*" })] }), _jsx("input", { type: "number", value: value ?? '', onChange: (e) => onChange(Number(e.target.value)), min: min, max: max, required: required, className: `w-full rounded-md border bg-[var(--input-background)] px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-[var(--ring)] ${error ? 'border-[var(--destructive)]' : 'border-[var(--border)]'}` }), min !== undefined && max !== undefined && (_jsxs("p", { className: "mt-1 text-xs text-[var(--muted-foreground)]", children: ["Range: ", min, " \u2013 ", max] })), helpText && !error && (_jsx("p", { className: "mt-1 text-xs text-[var(--muted-foreground)]", children: helpText })), error && _jsx("p", { className: "mt-1 text-xs text-[var(--destructive)]", children: error })] }));
}
//# sourceMappingURL=NumberField.js.map