import { Textbox } from '../textbox/Textbox';
import cx from '@src/cx.mjs';
function IncButton({ children, className, ...buttonProps }) {
return (
);
}
export function Incrementor({ onChange, value, min = -Infinity, max = Infinity, className, ...incrementorProps }) {
value = parseInt(value);
value = isNaN(value) ? '' : value;
return (
rounded-md', className)}>
{
if (v.length && v < min) {
return;
}
onChange(v);
}}
type="number"
placeholder=""
value={value}
className="w-32 mb-0 mt-0 border-none rounded-r-none bg-transparent appearance-none [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"
{...incrementorProps}
/>
onChange(value - 1)}>
= max} onClick={() => onChange(value + 1)}>
);
}