- Updated alert component to use AdminLTE variant classes and added callout support. - Refined badge component with AdminLTE base and variant classes, including size adjustments. - Modified button component to implement AdminLTE button styles and improved loading indicators. - Enhanced card component with AdminLTE variant classes and improved header/footer structure. - Adjusted input component to follow AdminLTE design, including size classes and icon handling. - Updated layout component to streamline button styles and loading indicators. - Refined progress component to utilize AdminLTE styles for size and variant classes. - Enhanced table component with AdminLTE table classes and improved loading state representation.
115 lines
3.8 KiB
PHP
115 lines
3.8 KiB
PHP
@props([
|
|
'title' => null,
|
|
'subtitle' => null,
|
|
'icon' => null,
|
|
'iconClass' => 'size-5',
|
|
'iconColor' => 'lte-text-primary',
|
|
'actions' => null,
|
|
'padding' => true,
|
|
'flush' => false,
|
|
'collapsible' => false,
|
|
'collapsed' => false,
|
|
'storageKey' => null,
|
|
'variant' => null,
|
|
'outline' => false,
|
|
])
|
|
|
|
@php
|
|
// AdminLTE Card variant classes
|
|
$variantClasses = match($variant) {
|
|
'primary' => $outline ? 'lte-card-outline-primary' : 'lte-card-primary',
|
|
'success' => $outline ? 'lte-card-outline-success' : 'lte-card-success',
|
|
'warning' => $outline ? 'lte-card-outline-warning' : 'lte-card-warning',
|
|
'danger' => $outline ? 'lte-card-outline-danger' : 'lte-card-danger',
|
|
'info' => $outline ? 'lte-card-outline-info' : 'lte-card-info',
|
|
default => '',
|
|
};
|
|
|
|
$cardClasses = "lte-card lte-slide-in-up $variantClasses";
|
|
@endphp
|
|
|
|
<div {{ $attributes->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))
|
|
<div class="lte-card-header">
|
|
<h3 class="lte-card-title">
|
|
@if($icon)
|
|
<span class="lte-info-box-icon lte-bg-light rounded" style="width: 36px; height: 36px; font-size: 1rem;">
|
|
<x-dynamic-component :component="$icon" class="{{ $iconClass }} {{ $iconColor }}" />
|
|
</span>
|
|
@endif
|
|
<span>
|
|
{{ $title }}
|
|
@if($subtitle)
|
|
<small class="lte-text-muted d-block" style="font-size: 0.8rem; font-weight: normal;">{{ $subtitle }}</small>
|
|
@endif
|
|
</span>
|
|
</h3>
|
|
@if($actions || $collapsible)
|
|
<div class="lte-card-tools">
|
|
@if($actions)
|
|
{{ $actions }}
|
|
@endif
|
|
@if($collapsible)
|
|
<button
|
|
type="button"
|
|
@click="toggle()"
|
|
class="lte-btn lte-btn-sm lte-btn-outline-secondary"
|
|
style="padding: 0.25rem 0.5rem;"
|
|
>
|
|
<x-ri-arrow-down-s-line
|
|
class="size-4 transition-transform duration-200"
|
|
x-bind:class="isCollapsed ? 'rotate-180' : ''"
|
|
/>
|
|
</button>
|
|
@endif
|
|
</div>
|
|
@endif
|
|
@if(isset($header))
|
|
{{ $header }}
|
|
@endif
|
|
</div>
|
|
@endif
|
|
|
|
@if($collapsible)
|
|
<div
|
|
class="lte-card-body"
|
|
x-show="!isCollapsed"
|
|
x-transition:enter="transition ease-out duration-200"
|
|
x-transition:enter-start="opacity-0"
|
|
x-transition:enter-end="opacity-100"
|
|
x-transition:leave="transition ease-in duration-150"
|
|
x-transition:leave-start="opacity-100"
|
|
x-transition:leave-end="opacity-0"
|
|
>
|
|
{{ $slot }}
|
|
</div>
|
|
@else
|
|
<div class="lte-card-body">
|
|
{{ $slot }}
|
|
</div>
|
|
@endif
|
|
|
|
@if(isset($footer))
|
|
<div class="lte-card-footer">
|
|
{{ $footer }}
|
|
</div>
|
|
@endif
|
|
</div>
|