- Introduced AdminLTE CSS variables for color palette, body colors, card styles, and button styles. - Implemented card components with variants for primary, success, warning, danger, and info. - Added button styles including sizes and outline variants. - Created form controls, select inputs, and input groups with consistent styling. - Included utility classes for text and background colors, gradients, and shadows. - Developed components for badges, alerts, callouts, progress bars, tables, small boxes, and info boxes. - Integrated modal, dropdown, spinner, tooltip, and direct chat styles. - Established timeline and close button styles, with dark mode support for specific components.
116 lines
3.9 KiB
PHP
116 lines
3.9 KiB
PHP
{{--
|
|
Modal Component - AdminLTE Theme
|
|
Based on AdminLTE v4 Modal styling patterns
|
|
|
|
Usage:
|
|
<x-proxmox::ui.modal name="my-modal" title="Modal Title">Content</x-proxmox::ui.modal>
|
|
|
|
Open with: $dispatch('open-modal', { name: 'my-modal' })
|
|
Close with: $dispatch('close-modal', { name: 'my-modal' })
|
|
--}}
|
|
|
|
@props([
|
|
'name',
|
|
'title' => null,
|
|
'subtitle' => null,
|
|
'icon' => null,
|
|
'iconColor' => 'lte-text-primary',
|
|
'maxWidth' => 'md',
|
|
'closeable' => true,
|
|
'footer' => null,
|
|
])
|
|
|
|
@php
|
|
$maxWidthClasses = [
|
|
'sm' => 'max-w-sm',
|
|
'md' => 'max-w-md',
|
|
'lg' => 'max-w-lg',
|
|
'xl' => 'max-w-xl',
|
|
'2xl' => 'max-w-2xl',
|
|
'3xl' => 'max-w-3xl',
|
|
'4xl' => 'max-w-4xl',
|
|
'5xl' => 'max-w-5xl',
|
|
'full' => 'max-w-full mx-4',
|
|
];
|
|
$maxWidthClass = $maxWidthClasses[$maxWidth] ?? $maxWidthClasses['md'];
|
|
@endphp
|
|
|
|
<div
|
|
x-data="{ show: false }"
|
|
x-on:open-modal.window="if ($event.detail.name === '{{ $name }}') show = true"
|
|
x-on:close-modal.window="if ($event.detail.name === '{{ $name }}') show = false"
|
|
x-on:keydown.escape.window="@if($closeable) show = false @endif"
|
|
x-show="show"
|
|
x-cloak
|
|
class="fixed inset-0 z-99999 overflow-y-auto"
|
|
{{ $attributes }}
|
|
>
|
|
{{-- Backdrop --}}
|
|
<div
|
|
x-show="show"
|
|
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"
|
|
@if($closeable) @click="show = false" @endif
|
|
class="lte-modal-backdrop"
|
|
></div>
|
|
|
|
{{-- Modal Panel --}}
|
|
<div class="fixed inset-0 flex items-center justify-center p-4">
|
|
<div
|
|
x-show="show"
|
|
x-transition:enter="transition ease-out duration-200"
|
|
x-transition:enter-start="opacity-0 scale-95"
|
|
x-transition:enter-end="opacity-100 scale-100"
|
|
x-transition:leave="transition ease-in duration-150"
|
|
x-transition:leave-start="opacity-100 scale-100"
|
|
x-transition:leave-end="opacity-0 scale-95"
|
|
@click.stop
|
|
class="lte-modal-content lte-slide-in-up w-full {{ $maxWidthClass }} max-h-[90vh] overflow-y-auto"
|
|
>
|
|
{{-- Header --}}
|
|
@if($title || $closeable)
|
|
<div class="lte-modal-header">
|
|
<div class="flex items-center gap-3">
|
|
@if($icon)
|
|
<span class="lte-info-box-icon lte-bg-light rounded" style="width: 40px; height: 40px; font-size: 1rem;">
|
|
<x-dynamic-component :component="$icon" class="size-5 {{ $iconColor }}" />
|
|
</span>
|
|
@endif
|
|
<div>
|
|
@if($title)
|
|
<h5 class="lte-modal-title">{{ $title }}</h5>
|
|
@endif
|
|
@if($subtitle)
|
|
<p class="lte-text-muted" style="font-size: 0.875rem; margin: 0;">{{ $subtitle }}</p>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
@if($closeable)
|
|
<button
|
|
@click="show = false"
|
|
class="lte-btn-close"
|
|
aria-label="Close"
|
|
></button>
|
|
@endif
|
|
</div>
|
|
@endif
|
|
|
|
{{-- Content --}}
|
|
<div class="lte-modal-body">
|
|
{{ $slot }}
|
|
</div>
|
|
|
|
{{-- Footer --}}
|
|
@if($footer)
|
|
<div class="lte-modal-footer">
|
|
{{ $footer }}
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</div>
|