@props([ 'clearable' => true, 'closable' => null, 'loading' => null, 'icon' => null, ]) @php // Clerable or closable, not both... if ($closable !== null) $clearable = null; $classes = Flux::classes() ->add('h-10 w-full flex items-center px-3 py-2') ->add('font-medium text-base sm:text-sm text-zinc-800 dark:text-white') ->add('ps-9') // Make room for magnifying glass icon... ->add('pe-9') // Make room for clear/clos button and loading indicator... ->add('outline-hidden') ->add('border-b border-zinc-200 dark:border-zinc-600') ->add('bg-white dark:bg-zinc-700') // The below reverts styles added by Tailwind Forms plugin ->add('border-t-0 border-s-0 border-e-0 focus:ring-0 focus:border-zinc-200 dark:focus:border-zinc-600') ; $loading ??= $loading ?? $attributes->whereStartsWith('wire:model.live')->isNotEmpty(); if ($loading) { $attributes = $attributes->merge(['wire:loading.attr' => 'data-flux-loading']); } @endphp
class($classes)->merge(['placeholder' => __('Search...')]) }} autofocus />