export htmlattributes as props where possible

This commit is contained in:
peterkogo
2025-04-14 18:59:31 +02:00
parent 6be1b7822b
commit 2ca682c6f2
33 changed files with 173 additions and 197 deletions
@@ -1,11 +1,10 @@
<script lang="ts">
import type { Snippet } from 'svelte';
import { portal } from '$lib/actions/portal';
import type { ViewportPortalProps } from './types';
let { children }: { children?: Snippet } = $props();
let { children, ...rest }: ViewportPortalProps = $props();
</script>
<div use:portal={'viewport'}>
<div use:portal={'viewport'} {...rest}>
{@render children?.()}
</div>
@@ -1 +1,2 @@
export { default as ViewportPortal } from './ViewportPortal.svelte';
export * from './types';
@@ -0,0 +1,6 @@
import type { Snippet } from 'svelte';
import type { HTMLAttributes } from 'svelte/elements';
export type ViewportPortalProps = {
children?: Snippet;
} & HTMLAttributes<HTMLDivElement>;