{{-- resources/views/components/dashboard-widget.blade.php --}} @props([ 'title', 'value' => null, 'icon' => null, 'gradient' => 'primary', 'trend' => null, 'trendValue' => null, 'trendDirection' => 'up', 'href' => null, 'subtitle' => null, 'badge' => null, ]) @php $gradientClass = match($gradient) { 'primary' => 'gradient-primary', 'secondary' => 'gradient-secondary', 'success' => 'bg-gradient-to-r from-green-500 to-green-600', 'warning' => 'bg-gradient-to-r from-yellow-500 to-orange-600', 'danger' => 'bg-gradient-to-r from-red-500 to-red-600', 'info' => 'bg-gradient-to-r from-blue-500 to-blue-600', default => 'gradient-primary', }; $trendVariant = match($trendDirection) { 'up' => 'success', 'down' => 'danger', 'stable' => 'info', default => 'info', }; $trendIcon = match($trendDirection) { 'up' => 'trending-up', 'down' => 'trending-down', 'stable' => 'minus', default => 'minus', }; $wrapperTag = $href ? 'a' : 'div'; $wrapperAttributes = $href ? "href=\"{$href}\"" : ''; @endphp <{{ $wrapperTag }} {!! $wrapperAttributes !!} class="card hover:shadow-xl transition-all hover:-translate-y-1 {{ $href ? 'cursor-pointer' : '' }}" {{ $attributes }}>

{{ $title }}

@if($badge) {{ $badge['text'] }} @endif
@if($value)

{{ $value }}

@endif @if($subtitle)

{{ $subtitle }}

@endif
@if($icon)
@endif
@if($trend || $slot->isNotEmpty())
@if($trend)
{{ $trendValue ?? abs($trend) }}{{ is_numeric($trend) ? '%' : '' }} {{ $trend }}
@endif {{ $slot }}
@endif {{-- Chart Widget Component --}} {{-- resources/views/components/dashboard-chart.blade.php --}} @props([ 'title', 'chartId', 'type' => 'line', // line, bar, doughnut, pie 'height' => '300px', 'badge' => null, 'description' => null, ])

{{ $title }}

@if($description)

{{ $description }}

@endif
@if($badge) {{ $badge['text'] }} @endif
{{ $slot }}
{{-- Activity Item Component --}} {{-- resources/views/components/dashboard-activity.blade.php --}} @props([ 'icon', 'iconColor' => 'primary', 'title', 'description', 'time', 'href' => null, ]) @php $iconBgColor = match($iconColor) { 'primary' => 'var(--color-primary-light)', 'secondary' => 'var(--color-secondary-light)', 'success' => 'var(--color-success-50)', 'warning' => 'rgba(251, 191, 36, 0.1)', 'danger' => 'var(--color-danger-50)', 'info' => 'var(--color-info-50)', 'purple' => 'rgba(139, 92, 246, 0.1)', default => 'var(--color-primary-light)', }; $iconTextColor = match($iconColor) { 'primary' => 'var(--color-primary)', 'secondary' => 'var(--color-secondary)', 'success' => 'var(--color-success-500)', 'warning' => '#FBBF24', 'danger' => 'var(--color-danger-500)', 'info' => 'var(--color-info-500)', 'purple' => '#8B5CF6', default => 'var(--color-primary)', }; $wrapperTag = $href ? 'a' : 'div'; $wrapperAttributes = $href ? "href=\"{$href}\"" : ''; @endphp <{{ $wrapperTag }} {!! $wrapperAttributes !!} class="flex items-start gap-4 p-4 rounded-xl transition-all {{ $href ? 'cursor-pointer hover:bg-primary-light' : '' }}" {{ $attributes }}>

{{ $title }}

{{ $description }}

{{ $time }}

{{ $slot }}
{{-- Quick Action Component --}} {{-- resources/views/components/dashboard-action.blade.php --}} @props([ 'title', 'description', 'count' => null, 'icon', 'variant' => 'primary', 'href', ]) @php $borderColor = match($variant) { 'primary' => 'var(--color-primary)', 'secondary' => 'var(--color-secondary)', 'success' => 'var(--color-success-500)', 'warning' => 'var(--color-warning-500)', 'danger' => 'var(--color-danger-500)', 'info' => 'var(--color-info-500)', default => 'var(--color-primary)', }; $bgColor = match($variant) { 'primary' => 'var(--color-primary-50)', 'secondary' => 'var(--color-secondary-50)', 'success' => 'var(--color-success-50)', 'warning' => 'var(--color-warning-50)', 'danger' => 'var(--color-danger-50)', 'info' => 'var(--color-info-50)', default => 'var(--color-primary-50)', }; $iconColor = match($variant) { 'primary' => 'var(--color-primary-500)', 'secondary' => 'var(--color-secondary-500)', 'success' => 'var(--color-success-500)', 'warning' => 'var(--color-warning-500)', 'danger' => 'var(--color-danger-500)', 'info' => 'var(--color-info-500)', default => 'var(--color-primary-500)', }; @endphp

{{ $title }}

{{ $description }}

@if($count) {{ $count }} @endif
{{ $slot }}