chore: use svelte and react types for AriaRole

This commit is contained in:
Abbey Yacoe
2025-06-03 14:41:25 +02:00
parent 416f533622
commit 96eba257aa
7 changed files with 28 additions and 22 deletions
+1
View File
@@ -46,6 +46,7 @@ export type BaseEdgeProps = Pick<
* @example 'url(#arrow)'
*/
markerEnd?: string;
ariaRole?: HTMLAttributes<HTMLElement>['role'];
class?: ClassValue;
} & HTMLAttributes<SVGPathElement>;
+6 -1
View File
@@ -1,5 +1,5 @@
import type { Component } from 'svelte';
import type { ClassValue } from 'svelte/elements';
import type { ClassValue, HTMLAttributes } from 'svelte/elements';
import type { InternalNodeBase, NodeBase, NodeProps as NodePropsBase } from '@xyflow/system';
/**
@@ -21,6 +21,11 @@ export type Node<
class?: ClassValue;
style?: string;
focusable?: boolean;
/**
* The ARIA role attribute for the node element, used for accessibility.
* @default "group"
*/
ariaRole?: HTMLAttributes<HTMLElement>['role'];
};
// @todo: currently generics for nodes are not really supported