{{-- ShiftBridge Card Component Usage:

Card content

Card with title

Card with title and subtitle

Action

Card with actions

Card with footer

Card with header image

Bordered card

Shadow card

Small card

Large card

Loading card

Collapsible card (starts collapsed)

Props: - title: string (card title) - subtitle: string (card subtitle) - actions: boolean (show actions slot) - footer: string (footer content) - header-image: string (URL for header image) - variant: string (default, bordered, shadow, ghost) - size: string (sm, md, lg) - loading: boolean (show loading overlay) - collapsible: boolean (make card collapsible) - collapsed: boolean (start collapsed) - no-padding: boolean (remove body padding) - class: string (additional CSS classes) --}} @props([ 'title' => null, 'subtitle' => null, 'actions' => false, 'footer' => null, 'headerImage' => null, 'variant' => 'default', 'size' => 'md', 'loading' => false, 'collapsible' => false, 'collapsed' => false, 'noPadding' => false, 'id' => null, ]) @php // Generate unique ID for collapsible cards $cardId = $id ?? 'card-' . uniqid(); $bodyId = $cardId . '-body'; // Base classes $baseClasses = 'bg-[var(--sb-card-bg)] rounded-lg overflow-hidden transition-all duration-200'; // Variant classes $variantClasses = match($variant) { 'bordered' => 'border border-[var(--sb-border)]', 'shadow' => 'shadow-lg hover:shadow-xl', 'ghost' => 'border border-transparent bg-transparent', default => 'border border-[var(--sb-border)] shadow-sm hover:shadow-md', }; // Size classes for padding $headerPadding = match($size) { 'sm' => 'px-3 py-2', 'md' => 'px-4 py-3', 'lg' => 'px-6 py-4', default => 'px-4 py-3', }; $bodyPadding = $noPadding ? '' : match($size) { 'sm' => 'p-3', 'md' => 'p-4', 'lg' => 'p-6', default => 'p-4', }; $footerPadding = match($size) { 'sm' => 'px-3 py-2', 'md' => 'px-4 py-3', 'lg' => 'px-6 py-4', default => 'px-4 py-3', }; // Title size $titleSize = match($size) { 'sm' => 'text-sm', 'md' => 'text-base', 'lg' => 'text-lg', default => 'text-base', }; // Subtitle size $subtitleSize = match($size) { 'sm' => 'text-xs', 'md' => 'text-sm', 'lg' => 'text-base', default => 'text-sm', }; // Collapse/expand icon $collapseIcon = $collapsed ? '' : ''; // Combine card classes $cardClasses = implode(' ', array_filter([$baseClasses, $variantClasses])); @endphp
merge(['class' => $cardClasses, 'id' => $cardId]) }}> {{-- Header Image --}} @if($headerImage)
@endif {{-- Header --}} @if($title || $actions || $collapsible)
@if($title)

{{ $title }}

@endif @if($subtitle)

{{ $subtitle }}

@endif
{{-- Actions Slot --}} @if($actions)
{{ $actionsSlot ?? '' }}
@endif {{-- Collapsible Toggle --}} @if($collapsible) @endif
@endif {{-- Body --}}
{{-- Loading Overlay --}} @if($loading)
@endif {{ $slot }}
{{-- Footer --}} @if($footer || isset($footerSlot))
@if($footer)

{{ $footer }}

@else {{ $footerSlot ?? '' }} @endif
@endif