({
label,
description,
errorMessage,
placeholder,
...props
}: NumberFieldProps)
| 19 | } |
| 20 | |
| 21 | export function NumberField({ |
| 22 | label, |
| 23 | description, |
| 24 | errorMessage, |
| 25 | placeholder, |
| 26 | ...props |
| 27 | }: NumberFieldProps) { |
| 28 | return ( |
| 29 | <AriaNumberField |
| 30 | {...props} |
| 31 | className={composeTailwindRenderProps( |
| 32 | props.className, |
| 33 | 'group flex flex-col gap-1 font-sans' |
| 34 | )}> |
| 35 | <Label>{label}</Label> |
| 36 | <FieldGroup> |
| 37 | {renderProps => ( |
| 38 | <> |
| 39 | <Input className="w-20" placeholder={placeholder} /> |
| 40 | <div |
| 41 | className={fieldBorderStyles({ |
| 42 | ...renderProps, |
| 43 | class: 'flex flex-col border-s h-full' |
| 44 | })}> |
| 45 | <StepperButton slot="increment"> |
| 46 | <ChevronUp aria-hidden className="w-4 h-4" /> |
| 47 | </StepperButton> |
| 48 | <div className={fieldBorderStyles({...renderProps, class: 'border-b'})} /> |
| 49 | <StepperButton slot="decrement"> |
| 50 | <ChevronDown aria-hidden className="w-4 h-4" /> |
| 51 | </StepperButton> |
| 52 | </div> |
| 53 | </> |
| 54 | )} |
| 55 | </FieldGroup> |
| 56 | {description && <Description>{description}</Description>} |
| 57 | <FieldError>{errorMessage}</FieldError> |
| 58 | </AriaNumberField> |
| 59 | ); |
| 60 | } |
| 61 | |
| 62 | function StepperButton(props: ButtonProps) { |
| 63 | return ( |
nothing calls this directly
no test coverage detected