diff --git a/src/lib/components/Modal.svelte b/src/lib/components/Modal.svelte index 99558c69..176e6117 100644 --- a/src/lib/components/Modal.svelte +++ b/src/lib/components/Modal.svelte @@ -2,13 +2,27 @@ let { open = $bindable(false), children, + variant = 'default', class: className = '' }: { open: boolean; children: import('svelte').Snippet; + /** + * - `default` — DaisyUI's centred `modal`, paired with a `modal-box` child. + * - `fullscreen` — edge-to-edge sheet; the child owns the whole viewport. + */ + variant?: 'default' | 'fullscreen'; + /** Extra classes, appended to the variant's own. */ class?: string; } = $props(); + const variantClass = { + default: 'modal', + fullscreen: 'bg-base-100 fixed inset-0 z-40 size-full max-h-full max-w-full p-0' + } as const; + + const dialogClass = $derived(`${variantClass[variant]} ${className}`.trim()); + let dialogEl = $state(undefined); // Sync the `open` prop with the native open/close state. @@ -34,7 +48,12 @@ } - + {#if open} {@render children()} {/if} diff --git a/src/lib/components/TabBar.svelte b/src/lib/components/TabBar.svelte index d7f9e351..8c61e616 100644 --- a/src/lib/components/TabBar.svelte +++ b/src/lib/components/TabBar.svelte @@ -1,5 +1,7 @@ {#snippet chevronIcon(isOpen: boolean)} - + /> {/snippet} {#snippet nodeIcon(type: string)} {#if type === 'catalog'} - +