From 789494e773306c877fdee6b1bdd389452c2cbec1 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sat, 13 Dec 2025 14:55:46 -0800 Subject: [PATCH] migrate dialog consumers to ModalHeader/Body/Footer pattern --- .../collection/AddToCollectionModal.svelte | 75 ++++--- .../components/dialogs/ConflictDialog.svelte | 133 ++++++------ src/lib/components/party/Party.svelte | 81 ++++--- .../components/ui/Dialog.stories.svelte | 201 +++++++++++------- 4 files changed, 277 insertions(+), 213 deletions(-) diff --git a/src/lib/components/collection/AddToCollectionModal.svelte b/src/lib/components/collection/AddToCollectionModal.svelte index c6c9c6bb..a6de746a 100644 --- a/src/lib/components/collection/AddToCollectionModal.svelte +++ b/src/lib/components/collection/AddToCollectionModal.svelte @@ -12,6 +12,9 @@ useAddSummonsToCollection } from '$lib/api/mutations/collection.mutations' import Dialog from '$lib/components/ui/Dialog.svelte' + import ModalHeader from '$lib/components/ui/ModalHeader.svelte' + import ModalBody from '$lib/components/ui/ModalBody.svelte' + import ModalFooter from '$lib/components/ui/ModalFooter.svelte' import Button from '$lib/components/ui/Button.svelte' import Icon from '$lib/components/Icon.svelte' import CollectionFilters, { @@ -316,8 +319,9 @@ }) - + {#snippet children()} + - {/snippet} - - {#snippet footer()} - + + {#snippet children()} + + {/snippet} + {/snippet} diff --git a/src/lib/components/dialogs/ConflictDialog.svelte b/src/lib/components/dialogs/ConflictDialog.svelte index 6ebf67f7..37674e3e 100644 --- a/src/lib/components/dialogs/ConflictDialog.svelte +++ b/src/lib/components/dialogs/ConflictDialog.svelte @@ -18,6 +18,9 @@ --> - - {#if conflict} -
-

{conflictMessage}

+ + {#snippet children()} + + + {#snippet children()} + {#if conflict} +
+

{conflictMessage}

-
- -
    - {#if conflict.type === 'character'} - {#each conflict.conflicts as gridChar (gridChar.id)} -
  • - {gridChar.character.name[locale]} - {gridChar.character.name[locale]} -
  • - {/each} - {:else} - {#each conflict.conflicts as gridWeapon (gridWeapon.id)} -
  • - {gridWeapon.weapon.name[locale]} - {gridWeapon.weapon.name[locale]} -
  • - {/each} - {/if} -
+
+ +
    + {#if conflict.type === 'character'} + {#each conflict.conflicts as gridChar (gridChar.id)} +
  • + {gridChar.character.name[locale]} + {gridChar.character.name[locale]} +
  • + {/each} + {:else} + {#each conflict.conflicts as gridWeapon (gridWeapon.id)} +
  • + {gridWeapon.weapon.name[locale]} + {gridWeapon.weapon.name[locale]} +
  • + {/each} + {/if} +
- - + + - -
- {#if conflict.type === 'character'} -
- {conflict.incoming.name[locale]} - {conflict.incoming.name[locale]} + +
+ {#if conflict.type === 'character'} +
+ {conflict.incoming.name[locale]} + {conflict.incoming.name[locale]} +
+ {:else} +
+ {conflict.incoming.name[locale]} + {conflict.incoming.name[locale]} +
+ {/if} +
- {:else} -
- {conflict.incoming.name[locale]} - {conflict.incoming.name[locale]} -
- {/if} -
-
-
- {/if} - - {#snippet footer()} - - +
+ {/if} + {/snippet} +
+ + {#snippet children()} + + + {/snippet} + {/snippet}
diff --git a/src/lib/components/party/Party.svelte b/src/lib/components/party/Party.svelte index 957dcab0..ca2a8601 100644 --- a/src/lib/components/party/Party.svelte +++ b/src/lib/components/party/Party.svelte @@ -46,6 +46,9 @@ import type { AddItemResult } from '$lib/types/api/search' import { GridType } from '$lib/types/enums' import Dialog from '$lib/components/ui/Dialog.svelte' + import ModalHeader from '$lib/components/ui/ModalHeader.svelte' + import ModalBody from '$lib/components/ui/ModalBody.svelte' + import ModalFooter from '$lib/components/ui/ModalFooter.svelte' import Button from '$lib/components/ui/Button.svelte' import Icon from '$lib/components/Icon.svelte' import DescriptionRenderer from '$lib/components/DescriptionRenderer.svelte' @@ -1003,47 +1006,55 @@
- + {#snippet children()} -
- - -
- {/snippet} - - {#snippet footer()} - - + + +
+ + +
+
+ + {#snippet children()} + + + {/snippet} + {/snippet}
- + {#snippet children()} -
-

Are you sure you want to delete this party?

-

{party.name || 'Unnamed Party'}

-

⚠️ This action cannot be undone.

-
- {/snippet} - - {#snippet footer()} - - + + +
+

Are you sure you want to delete this party?

+

{party.name || 'Unnamed Party'}

+

⚠️ This action cannot be undone.

+
+
+ + {#snippet children()} + + + {/snippet} + {/snippet}
diff --git a/src/stories/components/ui/Dialog.stories.svelte b/src/stories/components/ui/Dialog.stories.svelte index 5c01f468..c0138105 100644 --- a/src/stories/components/ui/Dialog.stories.svelte +++ b/src/stories/components/ui/Dialog.stories.svelte @@ -1,6 +1,9 @@