{{-- Tombol pemicu + dialog konfirmasi. Dirender sebagai
(atribut tambahan ke form). Tanpa JS pemicu adalah tombol kirim biasa: formulir langsung terkirim (progressive enhancement). Jangan taruh di dalam lain. --}} @props([ 'action', 'method' => 'POST', 'title', 'message' => null, 'confirmLabel' => 'Ya, lanjutkan', 'cancelLabel' => 'Batal', 'tone' => 'primary', 'icon' => null, 'iconOnly' => false, 'triggerLabel' => null, 'label' => null, 'variant' => 'ghost', ]) @php $method = strtoupper($method); $method = in_array($method, ['POST', 'PUT', 'PATCH', 'DELETE'], true) ? $method : 'POST'; $tone = $tone === 'danger' ? 'danger' : 'primary'; $variant = $variant === 'secondary' ? 'secondary' : 'ghost'; $uid = 'confirm-'.\Illuminate\Support\Str::random(8); @endphp class('confirm') }} > @csrf @if ($method !== 'POST') @method($method) @endif {{ $triggerLabel ?? $title }} $tone === 'danger']) aria-labelledby="{{ $uid }}-title" @if ($message) aria-describedby="{{ $uid }}-message" @endif x-on:click="backdrop($event)" x-on:close="restore()" >

{{ $title }}

@if ($message)

{{ $message }}

@endif
{{ $confirmLabel }} {{ $cancelLabel }}