@props([ 'title' => null, 'subtitle' => null, 'icon' => null, 'iconClass' => 'size-5', 'actions' => null, 'padding' => true, 'flush' => false, 'collapsible' => false, 'collapsed' => false, 'storageKey' => null, ]) @php $cardClasses = 'bg-background-secondary rounded-xl border border-neutral/20 shadow-sm'; $headerClasses = 'flex items-center justify-between gap-4'; $bodyClasses = $padding ? 'p-5' : ''; $headerPadding = $flush ? 'px-5 py-4' : ($padding ? 'pb-4' : 'p-5 pb-4'); @endphp
merge(['class' => $cardClasses]) }} @if($collapsible) x-data="{ isCollapsed: {{ $collapsed ? 'true' : 'false' }}, init() { @if($storageKey) this.isCollapsed = localStorage.getItem('{{ $storageKey }}') === 'true'; @endif }, toggle() { this.isCollapsed = !this.isCollapsed; @if($storageKey) localStorage.setItem('{{ $storageKey }}', this.isCollapsed); @endif } }" @endif > @if($title || $icon || $actions || isset($header))
@if($icon)
@endif
@if($title)

{{ $title }}

@endif @if($subtitle)

{{ $subtitle }}

@endif
@if($actions) {{ $actions }} @endif @if($collapsible) @endif
@if(isset($header)) {{ $header }} @endif
@endif @if($collapsible)
{{ $slot }}
@else
{{ $slot }}
@endif @if(isset($footer))
{{ $footer }}
@endif