({
label,
description,
errorMessage,
children,
placeholder,
...props
}: ComboBoxProps<T, M>)
| 26 | } |
| 27 | |
| 28 | export function ComboBox<T, M extends 'single' | 'multiple' = 'single'>({ |
| 29 | label, |
| 30 | description, |
| 31 | errorMessage, |
| 32 | children, |
| 33 | placeholder, |
| 34 | ...props |
| 35 | }: ComboBoxProps<T, M>) { |
| 36 | return ( |
| 37 | <AriaComboBox {...props}> |
| 38 | {label && <Label>{label}</Label>} |
| 39 | <div className="combobox-field"> |
| 40 | <Input className="react-aria-Input inset" placeholder={placeholder} /> |
| 41 | <FieldButton> |
| 42 | <ChevronDown /> |
| 43 | </FieldButton> |
| 44 | </div> |
| 45 | {props.selectionMode === 'multiple' && <ComboBoxValue placeholder="No items selected" />} |
| 46 | {description && <Description>{description}</Description>} |
| 47 | <FieldError>{errorMessage}</FieldError> |
| 48 | <Popover hideArrow className="combobox-popover"> |
| 49 | <ComboBoxListBox>{children}</ComboBoxListBox> |
| 50 | </Popover> |
| 51 | </AriaComboBox> |
| 52 | ); |
| 53 | } |
| 54 | |
| 55 | export function ComboBoxListBox<T>(props: ListBoxProps<T>) { |
| 56 | return <DropdownListBox {...props} />; |
nothing calls this directly
no outgoing calls
no test coverage detected