- Changed modal close event from `@click.away` to `@click.self` for better control over closing modals. - Updated various modal button styles for consistency and improved accessibility. - Adjusted transition durations for modal animations to enhance user experience. - Added aria-labels to close buttons for better screen reader support.
84 lines
3.1 KiB
PHP
84 lines
3.1 KiB
PHP
{{--
|
|
Help Modal Trigger Component - AdminLTE style
|
|
Question mark button that opens an info modal
|
|
|
|
Usage:
|
|
<x-proxmox::ui.help-modal title="Server Details" icon="ri-server-line">
|
|
<x-slot:description>
|
|
Displays comprehensive information about your virtual machine...
|
|
</x-slot:description>
|
|
<x-slot:details>
|
|
<p><span class="font-semibold">Status:</span> Shows the current power state...</p>
|
|
</x-slot:details>
|
|
</x-proxmox::ui.help-modal>
|
|
--}}
|
|
|
|
@props([
|
|
'title',
|
|
'icon' => 'ri-question-line',
|
|
])
|
|
|
|
<div class="relative" x-data="{ open: false }" x-cloak {{ $attributes }}>
|
|
<button type="button" @click="open = true" class="text-base/50 hover:text-base/70 transition-colors">
|
|
<x-ri-question-line class="size-4" />
|
|
</button>
|
|
|
|
<!-- Modal Backdrop -->
|
|
<div
|
|
x-show="open"
|
|
x-transition:enter="transition ease-out duration-150"
|
|
x-transition:enter-start="opacity-0"
|
|
x-transition:enter-end="opacity-100"
|
|
x-transition:leave="transition ease-in duration-100"
|
|
x-transition:leave-start="opacity-100"
|
|
x-transition:leave-end="opacity-0"
|
|
@click="open = false"
|
|
@keydown.escape.window="open = false"
|
|
class="fixed inset-0 z-50 bg-black/50 backdrop-blur-sm"
|
|
style="display: none;"
|
|
></div>
|
|
|
|
<!-- Modal Content -->
|
|
<div
|
|
x-show="open"
|
|
x-transition:enter="transition ease-out duration-150"
|
|
x-transition:enter-start="opacity-0 scale-95"
|
|
x-transition:enter-end="opacity-100 scale-100"
|
|
x-transition:leave="transition ease-in duration-100"
|
|
x-transition:leave-start="opacity-100 scale-100"
|
|
x-transition:leave-end="opacity-0 scale-95"
|
|
@click.self="open = false"
|
|
class="fixed inset-0 z-50 flex items-center justify-center p-4"
|
|
style="display: none;"
|
|
>
|
|
<div class="relative w-full max-w-2xl max-h-[90vh] overflow-y-auto bg-background-secondary rounded-xl border border-neutral/20 shadow-2xl p-6">
|
|
<button @click="open = false" class="absolute top-4 right-4 text-base/50 hover:text-base transition-colors">
|
|
<x-ri-close-line class="size-5" />
|
|
</button>
|
|
|
|
<div class="flex items-center gap-3 mb-4 pr-8">
|
|
<div class="flex items-center justify-center w-10 h-10 rounded-lg bg-primary/10">
|
|
<x-dynamic-component :component="$icon" class="size-5 text-primary" />
|
|
</div>
|
|
<h6 class="font-sans text-lg font-semibold leading-tight">
|
|
{{ $title }}
|
|
</h6>
|
|
</div>
|
|
|
|
@if(isset($description))
|
|
<p class="block font-sans text-sm font-normal leading-relaxed text-base/90 mb-4">
|
|
{{ $description }}
|
|
</p>
|
|
@endif
|
|
|
|
@if(isset($details))
|
|
<div class="pt-4 mt-4 border-t border-neutral/30 text-sm text-base/75 leading-relaxed">
|
|
{{ $details }}
|
|
</div>
|
|
@endif
|
|
|
|
{{ $slot }}
|
|
</div>
|
|
</div>
|
|
</div>
|