import React from 'react'; import { ListBox as AriaListBox, ListBoxItem as AriaListBoxItem, type ListBoxProps as AriaListBoxProps, Collection, Header, type ListBoxItemProps, ListBoxSection, type SectionProps, composeRenderProps, } from 'react-aria-components'; import { tv } from 'tailwind-variants'; import { composeTailwindRenderProps, focusRing } from '../utils'; import { CheckboxIcon } from '../icons/CheckboxIcon'; interface ListBoxProps extends Omit, 'layout' | 'orientation'> {} export function ListBox({ children, ...props }: ListBoxProps) { return ( {children} ); } export const itemStyles = tv({ extend: focusRing, base: ` group relative flex cursor-default items-center gap-8 rounded-md px-2.5 py-1.5 text-sm will-change-transform forced-color-adjust-none select-none `, variants: { isSelected: { false: ` text-slate-700 -outline-offset-2 hover:bg-slate-200 dark:text-zinc-300 dark:hover:bg-zinc-700 `, true: ` bg-blue-600 text-white -outline-offset-4 outline-white dark:outline-white forced-colors:bg-[Highlight] forced-colors:text-[HighlightText] forced-colors:outline-[HighlightText] [&+[data-selected]]:rounded-t-none [&:has(+[data-selected])]:rounded-b-none `, }, isDisabled: { true: ` text-slate-300 dark:text-zinc-600 forced-colors:text-[GrayText] `, }, }, }); export function ListBoxItem(props: ListBoxItemProps) { const textValue = props.textValue || (typeof props.children === 'string' ? props.children : undefined); return ( {composeRenderProps(props.children, (children) => ( <> {children}