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
@@ -27,7 +27,8 @@
fitViewOptions,
children,
before,
after
after,
...rest
}: ControlsProps = $props();
const store = useStore();
@@ -74,6 +75,7 @@
data-testid="svelte-flow__controls"
aria-label={ariaLabel ?? 'Svelte Flow controls'}
{style}
{...rest}
>
{#if before}
{@render before()}
@@ -1,5 +1,5 @@
import type { Snippet } from 'svelte';
import type { ClassValue, HTMLButtonAttributes } from 'svelte/elements';
import type { ClassValue, HTMLAttributes, HTMLButtonAttributes } from 'svelte/elements';
import type { PanelPosition } from '@xyflow/system';
import type { FitViewOptions } from '$lib/types';
@@ -29,7 +29,7 @@ export type ControlsProps = {
before?: Snippet;
after?: Snippet;
fitViewOptions?: FitViewOptions;
};
} & HTMLAttributes<HTMLDivElement>;
export type ControlButtonProps = HTMLButtonAttributes & {
class?: ClassValue;