@props([ 'name' => 'check', 'variant' => 'outline', ]) @php $map = [ 'x' => 'x-mark', 'search' => 'magnifying-glass', 'info' => 'information-circle', 'warning' => 'exclamation-triangle', 'upload' => 'arrow-up-tray', 'dots' => 'ellipsis-horizontal', 'circle' => 'stop', 'prohibit' => 'empty', 'ban' => 'empty', ]; $icon = $map[$name] ?? $name; $class = $attributes->get('class', ''); $hasSize = is_string($class) && preg_match('/(?:^|\s)size-/', $class); @endphp {{-- Color via currentColor: inherit parent (buttons → accent-foreground / white on base). --}} @if ($icon === 'lab') class(['shrink-0', 'size-5' => ! $hasSize]) }} viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" > @elseif ($icon === 'github') class(['shrink-0', 'size-5' => ! $hasSize]) }} viewBox="0 0 640 640" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" > @elseif ($icon === 'empty') class(['shrink-0', 'size-5' => ! $hasSize]) }} viewBox="0 0 256 256" fill="currentColor" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" > @else @php $prefix = match ($variant) { 'solid' => 'heroicon-s-', 'mini' => 'heroicon-m-', default => 'heroicon-o-', }; $component = $prefix.$icon; @endphp class(['shrink-0', 'size-5' => ! $hasSize]) }} aria-hidden="true" /> @endif