@aware([ 'placeholder', 'variant' ]) @props([ 'placeholder' => null, 'clearable' => null, 'invalid' => false, 'suffix' => null, 'size' => null, 'max' => null, ]) @php $classes = Flux::classes() ->add('group/listbox-button cursor-default') ->add('overflow-hidden') // Overflow hidden is here to prevent the button from growing when selected text is too long. ->add('flex items-center') ->add('shadow-xs') ->add('bg-white dark:bg-white/10 dark:disabled:bg-white/[7%]') // Make the placeholder match the text color of standard input placeholders... ->add('disabled:shadow-none') ->add(match($size) { default => 'min-h-10 text-base sm:text-sm rounded-lg ps-[calc(0.5rem-1px)] pe-3 py-[calc(0.5rem-1px)] block w-full', 'sm' => 'min-h-6 text-sm rounded-lg ps-[calc(0.25rem)] pe-2 py-[calc(0.25rem)] block w-full', }) ->add($invalid ? 'border border-red-500' : 'border border-zinc-200 border-b-zinc-300/80 dark:border-white/10' ) ->add('in-[data-target]:text-start') ->add($variant === 'combobox' ? 'has-focus-visible:outline-default' : '') ; @endphp class($classes) }} @if ($invalid) data-invalid @endif data-flux-group-target data-flux-pillbox-trigger> isNotEmpty()): ?> {{ $slot }}