Files
Virtnet.bond/extensions/Servers/Proxmox/views/components/ui/modal.blade.php
Joseph.Rawlings abff5a381f Migrate UI components from AdminLTE to LucentUI Theme using Tailwind CSS
- Updated tab-panel component to use Tailwind for styling and transitions.
- Refactored table-row component to implement Tailwind classes for hover effects and borders.
- Converted table-td component to utilize Tailwind for alignment and text styles.
- Changed table-th component to apply Tailwind for header styling and sorting indicators.
- Revised table component to adopt Tailwind for layout, borders, and responsive design.
- Enhanced tabs component with Tailwind for navigation styles and transitions.
- Updated toggle component to use Tailwind for switch styles and accessibility.
- Refactored tooltip component to implement Tailwind for positioning and styling.
- Added visual enhancements to app.css for improved UI interactions and animations.
2026-02-01 14:16:57 -05:00

118 lines
4.5 KiB
PHP

{{--
Modal Component - LucentUI Theme
Migrated from AdminLTE to Tailwind
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' => '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-300"
x-transition:enter-start="opacity-0"
x-transition:enter-end="opacity-100"
x-transition:leave="transition ease-in duration-200"
x-transition:leave-start="opacity-100"
x-transition:leave-end="opacity-0"
@if($closeable) @click="show = false" @endif
class="fixed inset-0 bg-black/50 backdrop-blur-sm"
></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-300"
x-transition:enter-start="opacity-0 scale-95 translate-y-4"
x-transition:enter-end="opacity-100 scale-100 translate-y-0"
x-transition:leave="transition ease-in duration-200"
x-transition:leave-start="opacity-100 scale-100 translate-y-0"
x-transition:leave-end="opacity-0 scale-95 translate-y-4"
@click.stop
class="w-full {{ $maxWidthClass }} max-h-[90vh] overflow-y-auto bg-background dark:bg-gray-800 border border-neutral dark:border-gray-700 rounded-xl shadow-2xl"
>
{{-- Header --}}
@if($title || $closeable)
<div class="flex items-center justify-between p-5 border-b border-neutral dark:border-gray-700">
<div class="flex items-center gap-3">
@if($icon)
<span class="flex items-center justify-center w-10 h-10 bg-background-secondary dark:bg-gray-700 rounded-lg">
<x-dynamic-component :component="$icon" class="size-5 {{ $iconColor }}" />
</span>
@endif
<div>
@if($title)
<h5 class="text-lg font-semibold text-primary dark:text-gray-100">{{ $title }}</h5>
@endif
@if($subtitle)
<p class="text-sm text-secondary dark:text-gray-400 mt-0.5">{{ $subtitle }}</p>
@endif
</div>
</div>
@if($closeable)
<button
@click="show = false"
class="flex items-center justify-center w-8 h-8 rounded-lg text-secondary dark:text-gray-400 hover:bg-background-secondary dark:hover:bg-gray-700 hover:text-primary dark:hover:text-gray-100 transition-all duration-200"
aria-label="Close"
>
<x-ri-close-line class="size-5" />
</button>
@endif
</div>
@endif
{{-- Content --}}
<div class="p-5">
{{ $slot }}
</div>
{{-- Footer --}}
@if($footer)
<div class="flex items-center justify-end gap-3 p-5 border-t border-neutral dark:border-gray-700">
{{ $footer }}
</div>
@endif
</div>
</div>
</div>