{{-- Stat Card Component - LucentUI Theme Migrated from AdminLTE to Tailwind Usage: --}} @props([ 'value', 'label', 'suffix' => null, 'prefix' => null, 'icon' => null, 'iconClass' => '', 'variant' => null, // primary, success, warning, danger, info 'status' => null, 'statusText' => null, 'href' => null, 'progress' => null, 'progressColor' => 'primary', 'clickable' => false, 'compact' => false, 'change' => null, 'changeLabel' => null, ]) @php $tag = $href ? 'a' : 'div'; $variantClasses = [ 'primary' => 'bg-primary', 'success' => 'bg-success', 'warning' => 'bg-warning', 'danger' => 'bg-error', 'info' => 'bg-info', ]; $progressColors = [ 'primary' => 'bg-primary', 'success' => 'bg-success', 'warning' => 'bg-warning', 'danger' => 'bg-error', 'info' => 'bg-info', ]; $statusClasses = [ 'success' => 'text-success', 'warning' => 'text-warning', 'danger' => 'text-error', 'info' => 'text-info', 'muted' => 'text-secondary', ]; $statusClass = $statusClasses[$status] ?? ''; $progressBarColor = $progressColors[$progressColor] ?? $progressColors['primary']; @endphp @if($variant) {{-- Small Box Style (colored background) --}} <{{ $tag }} @if($href) href="{{ $href }}" @endif {{ $attributes->class([ 'relative block overflow-hidden rounded-xl text-white transition-all duration-300 hover:shadow-lg hover:-translate-y-0.5 hover:scale-[1.01]', $variantClasses[$variant] ?? 'bg-primary', ]) }} >

{{ $prefix }}{{ $value }}@if($suffix){{ $suffix }}@endif

{{ $label }}

@if($icon)
@endif @if($statusText)
{{ $statusText }}
@endif @else {{-- Info Box Style (white background with icon accent) --}} <{{ $tag }} @if($href) href="{{ $href }}" @endif {{ $attributes->class([ 'flex items-start gap-4 p-5 bg-background dark:bg-gray-800 border border-neutral dark:border-gray-700 rounded-xl shadow-sm group transition-all duration-300 hover:shadow-md hover:-translate-y-0.5', 'cursor-pointer' => $href || $clickable, ]) }} > @if($icon) @endif
{{ $label }} @if($prefix){{ $prefix }}@endif{{ $value }}@if($suffix){{ $suffix }}@endif @if($change !== null || $changeLabel)
@if($change !== null) {{ $change >= 0 ? '+' : '' }}{{ $change }}% @endif {{ $changeLabel ?? 'from last period' }}
@endif @if($progress !== null)
@endif @if($statusText) {{ $statusText }} @endif
@endif