@props([ 'label' => '', 'value' => 0, 'icon' => 'fas fa-square', 'href' => null, 'title' => null, 'index' => 0, 'color' => null, ]) @php $palette = [ '#dce6f4', // blue '#dce9e3', // mint '#e6e0ef', // lilac '#efdfe6', // rose '#efe3d4', // apricot '#ede6d3', // sand ]; $namedColors = [ 'blue' => '#dce6f4', 'mint' => '#dce9e3', 'lilac' => '#e6e0ef', 'rose' => '#efdfe6', 'apricot' => '#efe3d4', 'sand' => '#ede6d3', ]; $index = max(0, (int) $index); $resolvedColor = $palette[$index % count($palette)]; if (is_string($color) && trim($color) !== '') { $colorKey = strtolower(trim($color)); if (isset($namedColors[$colorKey])) { $resolvedColor = $namedColors[$colorKey]; } elseif (preg_match('/^#([a-f0-9]{3}|[a-f0-9]{6})$/i', $colorKey)) { $resolvedColor = $colorKey; } else { $resolvedColor = trim($color); } } $tileTitle = is_string($title) && trim($title) !== '' ? trim($title) : trim((string) $label); @endphp @once @endonce @if(!empty($href))
{{ $label }}
{{ $value }}
@else
{{ $label }}
{{ $value }}
@endif