Refactor modal close behavior and improve styling

- 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.
This commit is contained in:
2026-02-23 20:02:41 -05:00
parent f394483daa
commit af62a16354
45 changed files with 393 additions and 4700 deletions

View File

@@ -19,7 +19,7 @@
])
<div class="relative" x-data="{ open: false }" x-cloak {{ $attributes }}>
<button type="button" @click="open = true" style="color: #6c757d; background: transparent; border: none; cursor: pointer; padding: 0; transition: color .2s ease;" onmouseover="this.style.color='#495057'" onmouseout="this.style.color='#6c757d'">
<button type="button" @click="open = true" class="text-base/50 hover:text-base/70 transition-colors">
<x-ri-question-line class="size-4" />
</button>
@@ -34,8 +34,8 @@
x-transition:leave-end="opacity-0"
@click="open = false"
@keydown.escape.window="open = false"
class="fixed inset-0"
style="z-index: 9998; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(2px);"
class="fixed inset-0 z-50 bg-black/50 backdrop-blur-sm"
style="display: none;"
></div>
<!-- Modal Content -->
@@ -47,32 +47,32 @@
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.away="open = false"
class="fixed inset-0 flex items-center justify-center p-4"
style="z-index: 9999; pointer-events: none;"
@click.self="open = false"
class="fixed inset-0 z-50 flex items-center justify-center p-4"
style="display: none;"
>
<div class="modal-lte" style="position: relative; width: 100%; max-width: 42rem; max-height: 90vh; overflow-y: auto; background: #fff; border-radius: .375rem; box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15); padding: 1.5rem; pointer-events: auto;">
<button @click="open = false" style="position: absolute; top: 1rem; right: 1rem; padding: .25rem; border-radius: .25rem; color: #6c757d; background: transparent; border: none; cursor: pointer; transition: background .2s ease, color .2s ease;" onmouseover="this.style.background='#f8f9fa'; this.style.color='#495057'" onmouseout="this.style.background='transparent'; this.style.color='#6c757d'">
<x-ri-close-line class="size-4" />
<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 style="display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; padding-right: 2rem;">
<div style="display: flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: .5rem; background: rgba(13, 110, 253, 0.1);">
<x-dynamic-component :component="$icon" class="size-4" style="color: #0d6efd;" />
<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>
<h3 style="font-size: 1.125rem; font-weight: 600; line-height: 1; color: #212529; margin: 0;">
<h6 class="font-sans text-lg font-semibold leading-tight">
{{ $title }}
</h3>
</h6>
</div>
@if(isset($description))
<div style="font-size: .875rem; color: #6c757d; margin-bottom: 1rem; line-height: 1.5;">
<p class="block font-sans text-sm font-normal leading-relaxed text-base/90 mb-4">
{{ $description }}
</div>
</p>
@endif
@if(isset($details))
<div style="padding-top: 1rem; margin-top: 1rem; border-top: 1px solid #dee2e6; font-size: .875rem; color: #6c757d; line-height: 1.5;">
<div class="pt-4 mt-4 border-t border-neutral/30 text-sm text-base/75 leading-relaxed">
{{ $details }}
</div>
@endif