Removed classcat and reworked class types from string to ClassValue
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
<script lang="ts">
|
||||
import cc from 'classcat';
|
||||
|
||||
import type { ControlButtonProps } from './types';
|
||||
|
||||
let {
|
||||
@@ -19,7 +17,7 @@
|
||||
<button
|
||||
type="button"
|
||||
{onclick}
|
||||
class={cc(['svelte-flow__controls-button', className])}
|
||||
class={['svelte-flow__controls-button', className]}
|
||||
style:--xy-controls-button-background-color-props={bgColor}
|
||||
style:--xy-controls-button-background-color-hover-props={bgColorHover}
|
||||
style:--xy-controls-button-color-props={color}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
<script lang="ts">
|
||||
import cc from 'classcat';
|
||||
|
||||
import Panel from '$lib/container/Panel/Panel.svelte';
|
||||
import { useStore } from '$lib/store';
|
||||
import Panel from '$lib/container/Panel/Panel.svelte';
|
||||
import ControlButton from './ControlButton.svelte';
|
||||
import PlusIcon from './Icons/Plus.svelte';
|
||||
import MinusIcon from './Icons/Minus.svelte';
|
||||
@@ -71,7 +69,7 @@
|
||||
</script>
|
||||
|
||||
<Panel
|
||||
class={cc(['svelte-flow__controls', orientationClass, className])}
|
||||
class={['svelte-flow__controls', orientationClass, className]}
|
||||
{position}
|
||||
data-testid="svelte-flow__controls"
|
||||
aria-label={ariaLabel ?? 'Svelte Flow controls'}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Snippet } from 'svelte';
|
||||
import type { HTMLButtonAttributes } from 'svelte/elements';
|
||||
import type { ClassValue, HTMLButtonAttributes } from 'svelte/elements';
|
||||
import type { PanelPosition } from '@xyflow/system';
|
||||
|
||||
import type { FitViewOptions } from '$lib/types';
|
||||
@@ -23,7 +23,7 @@ export type ControlsProps = {
|
||||
buttonBorderColor?: string;
|
||||
'aria-label'?: string;
|
||||
style?: string;
|
||||
class?: string;
|
||||
class?: ClassValue;
|
||||
orientation?: 'horizontal' | 'vertical';
|
||||
children?: Snippet;
|
||||
before?: Snippet;
|
||||
@@ -32,7 +32,7 @@ export type ControlsProps = {
|
||||
};
|
||||
|
||||
export type ControlButtonProps = HTMLButtonAttributes & {
|
||||
class?: string;
|
||||
class?: ClassValue;
|
||||
bgColor?: string;
|
||||
bgColorHover?: string;
|
||||
color?: string;
|
||||
|
||||
Reference in New Issue
Block a user