{{-- Same layout as x-modal, but visibility is Alpine-only (no Livewire wire:model / @entangle). Open/close via window CustomEvent add-customer-modal-open / add-customer-modal-close. --}} @props(['id' => null, 'maxWidth' => null, 'maxHeight' => null]) @php $id = $id ?? 'js-dialog-modal'; $maxWidth = [ 'sm' => 'sm:max-w-sm', 'md' => 'sm:max-w-md', 'lg' => 'sm:max-w-lg', 'xl' => 'sm:max-w-xl', '2xl' => 'sm:max-w-2xl', '3xl' => 'sm:max-w-3xl', '4xl' => 'sm:max-w-4xl', ][$maxWidth ?? '2xl']; $maxHeightKey = $maxHeight ?? '2xl'; $maxHeightClasses = [ 'sm' => 'sm:max-h-sm', 'md' => 'sm:max-h-md', 'lg' => 'sm:max-h-lg', 'xl' => 'sm:max-h-xl', '2xl' => 'sm:max-h-2xl', '3xl' => 'sm:max-h-3xl', '4xl' => 'sm:max-h-4xl', '5xl' => 'sm:max-h-5xl', '6xl' => 'sm:max-h-6xl', 'full' => 'sm:max-h-full', 'none' => '', 'auto' => '', ]; $resolvedMaxHeight = $maxHeightClasses[$maxHeightKey] ?? $maxHeightClasses['2xl']; $modalPanelOverflow = in_array($maxHeightKey, ['none', 'auto'], true) ? 'overflow-visible' : 'overflow-hidden overflow-y-auto'; @endphp