chore: add roles to edges
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Position } from './utils';
|
||||
import { Position, AriaRole } from './utils';
|
||||
|
||||
export type EdgeBase<
|
||||
EdgeData extends Record<string, unknown> = Record<string, unknown>,
|
||||
@@ -40,6 +40,17 @@ export type EdgeBase<
|
||||
* This property sets the width of that invisible path.
|
||||
*/
|
||||
interactionWidth?: number;
|
||||
/**
|
||||
* The ARIA role attribute for the edge, used for accessibility.
|
||||
* @default "group"
|
||||
*/
|
||||
|
||||
ariaRole?: AriaRole;
|
||||
/**
|
||||
* A description of the edge's, used for accessibility.
|
||||
* @default "node"
|
||||
*/
|
||||
ariaRoleDescription?: string;
|
||||
};
|
||||
|
||||
export type SmoothStepPathOptions = {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { XYPosition, Position, CoordinateExtent, Handle } from '.';
|
||||
import { Optional } from '../utils/types';
|
||||
import { AriaRole } from './utils';
|
||||
|
||||
/**
|
||||
* Framework independent node data structure.
|
||||
@@ -191,4 +192,3 @@ export type Align = 'center' | 'start' | 'end';
|
||||
|
||||
export type NodeLookup<NodeType extends InternalNodeBase = InternalNodeBase> = Map<string, NodeType>;
|
||||
export type ParentLookup<NodeType extends InternalNodeBase = InternalNodeBase> = Map<string, Map<string, NodeType>>;
|
||||
export type AriaRole = 'button' | 'group' | 'listitem' | 'application' | 'region' | 'none' | null;
|
||||
|
||||
@@ -56,3 +56,8 @@ export type Transform = [number, number, number];
|
||||
* to represent an unbounded extent.
|
||||
*/
|
||||
export type CoordinateExtent = [[number, number], [number, number]];
|
||||
|
||||
/**
|
||||
* The `AriaRole` type is used to define the role of an element in the accessibility tree.
|
||||
*/
|
||||
export type AriaRole = 'button' | 'group' | 'listitem' | 'application' | 'region' | 'none' | null;
|
||||
|
||||
Reference in New Issue
Block a user