refactor: replace native confirm() dialogs with shared ConfirmService modal #228

Merged
marcel merged 15 commits from feat/issue-207-confirm-modal-service into main 2026-04-12 14:42:20 +02:00
Showing only changes of commit 3a316bc382 - Show all commits

View File

@@ -18,7 +18,7 @@ $effect(() => {
<dialog <dialog
bind:this={dialogEl} bind:this={dialogEl}
class="max-w-sm rounded-sm border border-line bg-surface p-6 shadow-lg" class="m-auto w-full max-w-sm rounded-sm border border-line bg-surface p-6 shadow-lg backdrop:bg-black/50"
aria-labelledby="confirm-title" aria-labelledby="confirm-title"
oncancel={(e) => { oncancel={(e) => {
e.preventDefault(); e.preventDefault();
@@ -42,16 +42,16 @@ $effect(() => {
<div class="flex items-center justify-end gap-3"> <div class="flex items-center justify-end gap-3">
<button <button
type="button" type="button"
class="min-h-[44px] rounded-sm border border-line px-4 py-2 text-sm font-medium text-ink-2 transition-colors hover:bg-muted" class="min-h-[44px] cursor-pointer rounded-sm border border-line px-4 py-2 text-sm font-medium text-ink-2 transition-colors hover:bg-muted"
onclick={() => service.settle(false)} onclick={() => service.settle(false)}
> >
{opts.cancelLabel ?? m.btn_cancel()} {opts.cancelLabel ?? m.btn_cancel()}
</button> </button>
<button <button
type="button" type="button"
class="min-h-[44px] rounded-sm px-4 py-2 text-sm font-medium transition-colors {opts.destructive class="min-h-[44px] cursor-pointer rounded-sm px-4 py-2 text-sm font-medium transition-colors {opts.destructive
? 'bg-danger text-danger-fg' ? 'bg-danger text-danger-fg hover:bg-danger/80'
: 'bg-primary text-primary-fg'}" : 'bg-primary text-primary-fg hover:bg-primary/80'}"
onclick={() => service.settle(true)} onclick={() => service.settle(true)}
> >
{opts.confirmLabel ?? m.btn_confirm()} {opts.confirmLabel ?? m.btn_confirm()}