@php use Filament\Support\Enums\IconPosition; use Filament\Support\Facades\FilamentView; $chartColor = $getChartColor() ?? 'gray'; $descriptionColor = $getDescriptionColor() ?? 'gray'; $descriptionIcon = $getDescriptionIcon(); $descriptionIconPosition = $getDescriptionIconPosition(); $url = $getUrl(); $tag = $url ? 'a' : 'div'; $dataChecksum = $generateDataChecksum(); $descriptionIconClasses = \Illuminate\Support\Arr::toCssClasses([ 'fi-wi-stats-overview-stat-description-icon h-5 w-5', match ($descriptionColor) { 'gray' => 'text-gray-400 dark:text-gray-500', default => 'text-custom-500', }, ]); $descriptionIconStyles = \Illuminate\Support\Arr::toCssStyles([ \Filament\Support\get_color_css_variables( $descriptionColor, shades: [500], alias: 'widgets::stats-overview-widget.stat.description.icon', ) => $descriptionColor !== 'gray', ]); @endphp <{!! $tag !!} @if ($url) {{ \Filament\Support\generate_href_html($url, $shouldOpenUrlInNewTab()) }} @endif {{ $getExtraAttributeBag() ->class([ 'fi-wi-stats-overview-stat relative rounded-xl bg-white p-6 shadow-sm ring-1 ring-gray-950/5 dark:bg-gray-900 dark:ring-white/10', ]) }} >
@if ($icon = $getIcon()) @endif {{ $getLabel() }}
{{ $getValue() }}
@if ($description = $getDescription())
@if ($descriptionIcon && in_array($descriptionIconPosition, [IconPosition::Before, 'before'])) @endif 'fi-color-gray text-gray-500 dark:text-gray-400', default => 'fi-color-custom text-custom-600 dark:text-custom-400', }, ]) @style([ \Filament\Support\get_color_css_variables( $descriptionColor, shades: [400, 600], alias: 'widgets::stats-overview-widget.stat.description', ) => $descriptionColor !== 'gray', ]) > {{ $description }} @if ($descriptionIcon && in_array($descriptionIconPosition, [IconPosition::After, 'after'])) @endif
@endif
@if ($chart = $getChart()) {{-- An empty function to initialize the Alpine component with until it's loaded with `ax-load`. This removes the need for `x-ignore`, allowing the chart to be updated via Livewire polling. --}}
'fi-color-gray', default => 'fi-color-custom', }, ]) @style([ \Filament\Support\get_color_css_variables( $chartColor, shades: [50, 400, 500], alias: 'widgets::stats-overview-widget.stat.chart', ) => $chartColor !== 'gray', ]) > 'text-gray-100 dark:text-gray-800', default => 'text-custom-50 dark:text-custom-400/10', }, ]) > 'text-gray-400', default => 'text-custom-500 dark:text-custom-400', }, ]) >
@endif