{{-- A large modal work area on the native element (see for why not ): focus moves in, Escape closes it and closing returns focus to the opening button. Slots: `header` (replaces the plain title bar, must contain an element with id "-title"), the default slot (scrolling body) and `footer`. Open it with document.getElementById('').showModal(), from Livewire with $this->js(...). `locked` (an Alpine expression) keeps it open while true, e.g. while a timer runs: Escape and the close button do nothing. --}} @props([ 'id', 'title' => null, 'width' => 'max-w-5xl', 'locked' => 'false', ]) class(['m-auto max-h-[calc(100dvh-2rem)] w-[calc(100%-1rem)] overflow-hidden rounded-2xl border border-neutral-300 bg-white p-0 text-neutral-900 shadow-2xl backdrop:bg-black/70 dark:border-[#3e4249] dark:bg-[#222427] dark:text-neutral-100', $width]) }} > {{-- Only the body scrolls: the dialog itself never does (one scrollbar), and its border takes 2px. --}}
@isset($header) {{ $header }} @else

{{ $title }}

@endisset
{{ $slot }}
@isset($footer)
{{ $footer }}
@endisset