@php use Filament\Support\Enums\Alignment; use Filament\Support\Enums\IconSize; @endphp @props([ 'aside' => false, 'collapsed' => false, 'collapsible' => false, 'compact' => false, 'contained' => true, 'contentBefore' => false, 'description' => null, 'footerActions' => [], 'footerActionsAlignment' => Alignment::Start, 'headerActions' => [], 'headerEnd' => null, 'heading' => null, 'icon' => null, 'iconColor' => 'gray', 'iconSize' => IconSize::Large, 'persistCollapsed' => false, ]) @php $hasDescription = filled((string) $description); $hasHeading = filled($heading); $hasIcon = filled($icon); if (is_array($headerActions)) { $headerActions = array_filter( $headerActions, fn ($headerAction): bool => $headerAction->isVisible(), ); } if (is_array($footerActions)) { $footerActions = array_filter( $footerActions, fn ($footerAction): bool => $footerAction->isVisible(), ); } $hasHeaderActions = $headerActions instanceof \Illuminate\Contracts\Support\Htmlable ? ! \Filament\Support\is_slot_empty($headerActions) : filled($headerActions); $hasFooterActions = $footerActions instanceof \Illuminate\Contracts\Support\Htmlable ? ! \Filament\Support\is_slot_empty($footerActions) : filled($footerActions); $hasHeader = $hasIcon || $hasHeading || $hasDescription || $collapsible || $hasHeaderActions || filled((string) $headerEnd); @endphp
class([ 'fi-custom-section', 'fi-section-not-contained' => ! $contained, 'fi-section-has-content-before' => $contentBefore, 'fi-section-has-header' => $hasHeader, 'fi-aside' => $aside, 'fi-compact' => $compact, 'fi-collapsible' => $collapsible, ]) }} > @if ($hasHeader)
@if ($hasIcon) null, default => 'fi-color-custom', }, is_string($iconColor) ? "fi-color-{$iconColor}" : null, ($iconSize instanceof IconSize) ? "fi-size-{$iconSize->value}" : (is_string($iconSize) ? $iconSize : null), ]) @style([ \Filament\Support\get_color_css_variables( $iconColor, shades: [400, 500], alias: 'section.header.icon', ) => $iconColor !== 'gray', ]) /> @endif @if ($hasHeading || $hasDescription)
@if ($hasHeading) {{ $heading }} @endif @if ($hasDescription) {{ $description }} @endif
@endif @if ($hasHeaderActions) @endif {{ $headerEnd }} @if ($collapsible) @endif
@if ($hasHeaderActions)
@endif
@endif
{{ $slot }}
@if ($hasFooterActions) @endif