|
'use client'; |
|
|
|
import * as React from 'react'; |
|
|
|
|
|
|
|
import RCInputNumber from 'rc-input-number'; |
|
import * as InputNumberPrimitive from 'rc-input-number'; |
|
|
|
import { cn } from '../../utils/index.jsx'; |
|
|
|
|
|
|
|
|
|
|
|
const InputNumber = React.forwardRef< |
|
React.ElementRef<typeof RCInputNumber>, |
|
InputNumberPrimitive.InputNumberProps |
|
>(({ className, ...props }, ref) => { |
|
return ( |
|
<RCInputNumber |
|
className={cn( |
|
'flex h-10 w-full rounded-md border border-slate-300 bg-transparent px-3 py-2 text-sm placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-slate-400 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:border-slate-700 dark:text-slate-50 dark:focus:ring-slate-400 dark:focus:ring-offset-slate-900', |
|
className, |
|
)} |
|
ref={ref} |
|
{...props} |
|
/> |
|
); |
|
}); |
|
InputNumber.displayName = 'Input'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export { InputNumber }; |
|
|