'use client'; import { ComboBox as AriaComboBox, type ComboBoxProps as AriaComboBoxProps, ComboBoxValue, Input, type ListBoxItemProps, type ListBoxProps, type ValidationResult } from 'react-aria-components/ComboBox'; import {Label, FieldError, FieldButton, Description} from './Form'; import {DropdownItem, DropdownListBox} from './ListBox'; import {Popover} from './Popover'; import {ChevronDown} from 'lucide-react'; import './ComboBox.css'; export interface ComboBoxProps extends Omit< AriaComboBoxProps, 'children' > { label?: string; description?: string | null; errorMessage?: string | ((validation: ValidationResult) => string); children: React.ReactNode | ((item: T) => React.ReactNode); placeholder?: string; } export function ComboBox({ label, description, errorMessage, children, placeholder, ...props }: ComboBoxProps) { return ( {label && }
{props.selectionMode === 'multiple' && } {description && {description}} {errorMessage} {children}
); } export function ComboBoxListBox(props: ListBoxProps) { return ; } export function ComboBoxItem(props: ListBoxItemProps) { return ; }