From 13b64afbaf331bb00e7b8fcc7e2a4f30e71412af Mon Sep 17 00:00:00 2001 From: Abbey Yacoe Date: Tue, 3 Jun 2025 15:42:57 +0200 Subject: [PATCH] chore: rename LabelConfig -> AriaLabelConfig, update dict names --- .changeset/quiet-forks-visit.md | 2 +- examples/react/src/examples/A11y/index.tsx | 20 ++++++++--------- .../src/routes/examples/a11y/+page.svelte | 16 +++++++------- .../Controls/Controls.tsx | 22 +++++++++---------- .../additional-components/MiniMap/MiniMap.tsx | 6 ++--- .../src/components/A11yDescriptions/index.tsx | 10 ++++----- .../src/components/NodeWrapper/index.tsx | 4 ++-- .../src/components/StoreUpdater/index.tsx | 8 +++---- .../react/src/container/ReactFlow/index.tsx | 4 ++-- packages/react/src/index.ts | 2 +- packages/react/src/store/initialState.ts | 4 ++-- packages/react/src/types/component-props.ts | 4 ++-- packages/react/src/types/store.ts | 4 ++-- .../A11yDescriptions/A11yDescriptions.svelte | 6 ++--- .../src/lib/components/Handle/Handle.svelte | 4 ++-- .../components/NodeWrapper/NodeWrapper.svelte | 4 ++-- .../lib/container/SvelteFlow/Wrapper.svelte | 2 +- .../src/lib/container/SvelteFlow/types.ts | 4 ++-- packages/svelte/src/lib/index.ts | 2 +- .../src/lib/plugins/Controls/Controls.svelte | 20 ++++++++--------- .../src/lib/plugins/Minimap/Minimap.svelte | 6 ++--- .../src/lib/store/initial-store.svelte.ts | 8 ++++--- packages/system/src/constants.ts | 18 +++++++-------- packages/system/src/utils/general.ts | 6 ++--- 24 files changed, 94 insertions(+), 92 deletions(-) diff --git a/.changeset/quiet-forks-visit.md b/.changeset/quiet-forks-visit.md index 5706b767..89c3a0ee 100644 --- a/.changeset/quiet-forks-visit.md +++ b/.changeset/quiet-forks-visit.md @@ -4,5 +4,5 @@ "@xyflow/system": patch --- -Add `labelConfig` prop for customizing UI text like aria labels and descriptions. +Add `ariaLabelConfig` prop for customizing UI text like aria labels and descriptions. diff --git a/examples/react/src/examples/A11y/index.tsx b/examples/react/src/examples/A11y/index.tsx index cafa3d7f..b0e5e429 100644 --- a/examples/react/src/examples/A11y/index.tsx +++ b/examples/react/src/examples/A11y/index.tsx @@ -9,7 +9,7 @@ import { Node, Edge, OnNodeDrag, - LabelConfig, + AriaLabelConfig, } from '@xyflow/react'; const onNodeDrag: OnNodeDrag = (_, node: Node, nodes: Node[]) => console.log('drag', node, nodes); @@ -44,17 +44,17 @@ const initialEdges: Edge[] = [ { id: 'e1-3', source: '1', target: '3' }, ]; -const labelConfig: Partial = { - 'a11yDescription.node.default': 'Custom Node Desc.', - 'a11yDescription.node.keyboardDisabled': 'Custom Keyboard Desc.', - 'a11yDescription.edge.default': 'Custom Edge Desc.', +const ariaLabelConfig: Partial = { + 'node.a11yDescription.default': 'Custom Node Desc.', + 'node.a11yDescription.keyboardDisabled': 'Custom Keyboard Desc.', + 'edge.a11yDescription.default': 'Custom Edge Desc.', 'a11yDescription.ariaLiveMessage': ({ direction, x, y }) => `Custom Moved selected node ${direction}. New position, x: ${x}, y: ${y}`, 'controls.ariaLabel': 'Custom Controls Aria Label', - 'controls.zoomin.title': 'Custom Zoom in', - 'controls.zoomout.title': 'Custom Zoom Out', - // 'controls.fitview.title': 'Custom Fit View', - 'controls.interactive.title': 'Custom Toggle Interactivity', + 'controls.zoomin.ariaLabel': 'Custom Zoom in', + 'controls.zoomout.ariaLabel': 'Custom Zoom Out', + // 'controls.fitview.ariaLabel': 'Custom Fit View', + 'controls.interactive.ariaLabel': 'Custom Toggle Interactivity', 'minimap.ariaLabel': 'Custom Aria Label', }; @@ -76,7 +76,7 @@ const A11y = () => { elevateEdgesOnSelect elevateNodesOnSelect={false} nodeDragThreshold={0} - labelConfig={labelConfig} + ariaLabelConfig={ariaLabelConfig} > diff --git a/examples/svelte/src/routes/examples/a11y/+page.svelte b/examples/svelte/src/routes/examples/a11y/+page.svelte index 98f0bc23..a4a5afd8 100644 --- a/examples/svelte/src/routes/examples/a11y/+page.svelte +++ b/examples/svelte/src/routes/examples/a11y/+page.svelte @@ -25,17 +25,17 @@ bind:nodes bind:edges fitView - labelConfig={{ - 'a11yDescription.node.default': 'Svelte Custom Node Desc.', - 'a11yDescription.node.keyboardDisabled': 'Svelte Custom Keyboard Desc.', - 'a11yDescription.edge.default': 'Svelte Custom Edge Desc.', + ariaLabelConfig={{ + 'node.a11yDescription.default': 'Svelte Custom Node Desc.', + 'node.a11yDescription.keyboardDisabled': 'Svelte Custom Keyboard Desc.', + 'edge.a11yDescription.default': 'Svelte Custom Edge Desc.', 'a11yDescription.ariaLiveMessage': ({ direction, x, y }) => `Custom Moved selected node ${direction}. New position, x: ${x}, y: ${y}`, 'controls.ariaLabel': 'Svelte Custom Control Aria Label', - 'controls.zoomin.title': 'Svelte Custom Zoom in', - 'controls.zoomout.title': 'Svelte Custom Zoom Out', - // 'controls.fitview.title': 'Svelte Custom Fit View', - 'controls.interactive.title': 'Svelte Custom Toggle Interactivity', + 'controls.zoomin.ariaLabel': 'Svelte Custom Zoom in', + 'controls.zoomout.ariaLabel': 'Svelte Custom Zoom Out', + // 'controls.fitview.ariaLabel': 'Svelte Custom Fit View', + 'controls.interactive.ariaLabel': 'Svelte Custom Toggle Interactivity', 'minimap.ariaLabel': 'Svelte Custom Minimap' }} > diff --git a/packages/react/src/additional-components/Controls/Controls.tsx b/packages/react/src/additional-components/Controls/Controls.tsx index d92cff99..ccf9c29b 100644 --- a/packages/react/src/additional-components/Controls/Controls.tsx +++ b/packages/react/src/additional-components/Controls/Controls.tsx @@ -19,7 +19,7 @@ const selector = (s: ReactFlowState) => ({ isInteractive: s.nodesDraggable || s.nodesConnectable || s.elementsSelectable, minZoomReached: s.transform[2] <= s.minZoom, maxZoomReached: s.transform[2] >= s.maxZoom, - labelConfig: s.labelConfig, + ariaLabelConfig: s.ariaLabelConfig, }); function ControlsComponent({ @@ -39,7 +39,7 @@ function ControlsComponent({ 'aria-label': ariaLabel, }: ControlProps) { const store = useStoreApi(); - const { isInteractive, minZoomReached, maxZoomReached, labelConfig } = useStore(selector, shallow); + const { isInteractive, minZoomReached, maxZoomReached, ariaLabelConfig } = useStore(selector, shallow); const { zoomIn, zoomOut, fitView } = useReactFlow(); const onZoomInHandler = () => { @@ -74,15 +74,15 @@ function ControlsComponent({ position={position} style={style} data-testid="rf__controls" - aria-label={ariaLabel ?? labelConfig['controls.ariaLabel']} + aria-label={ariaLabel ?? ariaLabelConfig['controls.ariaLabel']} > {showZoom && ( <> @@ -90,8 +90,8 @@ function ControlsComponent({ @@ -102,8 +102,8 @@ function ControlsComponent({ @@ -112,8 +112,8 @@ function ControlsComponent({ {isInteractive ? : } diff --git a/packages/react/src/additional-components/MiniMap/MiniMap.tsx b/packages/react/src/additional-components/MiniMap/MiniMap.tsx index f23ff60f..891f280e 100644 --- a/packages/react/src/additional-components/MiniMap/MiniMap.tsx +++ b/packages/react/src/additional-components/MiniMap/MiniMap.tsx @@ -36,7 +36,7 @@ const selector = (s: ReactFlowState) => { translateExtent: s.translateExtent, flowWidth: s.width, flowHeight: s.height, - labelConfig: s.labelConfig, + ariaLabelConfig: s.ariaLabelConfig, }; }; @@ -70,7 +70,7 @@ function MiniMapComponent({ }: MiniMapProps) { const store = useStoreApi(); const svg = useRef(null); - const { boundingRect, viewBB, rfId, panZoom, translateExtent, flowWidth, flowHeight, labelConfig } = useStore( + const { boundingRect, viewBB, rfId, panZoom, translateExtent, flowWidth, flowHeight, ariaLabelConfig } = useStore( selector, shallow ); @@ -133,7 +133,7 @@ function MiniMapComponent({ }, []) : undefined; - const _ariaLabel = ariaLabel ?? labelConfig['minimap.ariaLabel']; + const _ariaLabel = ariaLabel ?? ariaLabelConfig['minimap.ariaLabel']; return ( s.ariaLiveMessage; -const labelConfigSelector = (s: ReactFlowState) => s.labelConfig; +const ariaLabelConfigSelector = (s: ReactFlowState) => s.ariaLabelConfig; function AriaLiveMessage({ rfId }: { rfId: string }) { const ariaLiveMessage = useStore(ariaLiveSelector); @@ -34,17 +34,17 @@ function AriaLiveMessage({ rfId }: { rfId: string }) { } export function A11yDescriptions({ rfId, disableKeyboardA11y }: { rfId: string; disableKeyboardA11y: boolean }) { - const labelConfig = useStore(labelConfigSelector); + const ariaLabelConfig = useStore(ariaLabelConfigSelector); return ( <>
{disableKeyboardA11y - ? labelConfig['a11yDescription.node.default'] - : labelConfig['a11yDescription.node.keyboardDisabled']} + ? ariaLabelConfig['node.a11yDescription.default'] + : ariaLabelConfig['node.a11yDescription.keyboardDisabled']}
- {labelConfig['a11yDescription.edge.default']} + {ariaLabelConfig['edge.a11yDescription.default']}
{!disableKeyboardA11y && } diff --git a/packages/react/src/components/NodeWrapper/index.tsx b/packages/react/src/components/NodeWrapper/index.tsx index 8ac50a09..93152a98 100644 --- a/packages/react/src/components/NodeWrapper/index.tsx +++ b/packages/react/src/components/NodeWrapper/index.tsx @@ -142,10 +142,10 @@ export function NodeWrapper({ // prevent default scrolling behavior on arrow key press when node is moved event.preventDefault(); - const { labelConfig } = store.getState(); + const { ariaLabelConfig } = store.getState(); store.setState({ - ariaLiveMessage: labelConfig['a11yDescription.ariaLiveMessage']({ + ariaLiveMessage: ariaLabelConfig['a11yDescription.ariaLiveMessage']({ direction: event.key.replace('Arrow', '').toLowerCase(), x: ~~internals.positionAbsolute.x, y: ~~internals.positionAbsolute.y, diff --git a/packages/react/src/components/StoreUpdater/index.tsx b/packages/react/src/components/StoreUpdater/index.tsx index d2fb3cae..95b713af 100644 --- a/packages/react/src/components/StoreUpdater/index.tsx +++ b/packages/react/src/components/StoreUpdater/index.tsx @@ -5,7 +5,7 @@ */ import { useEffect, useRef } from 'react'; import { shallow } from 'zustand/shallow'; -import { infiniteExtent, type CoordinateExtent, mergeLabelConfig, LabelConfig } from '@xyflow/system'; +import { infiniteExtent, type CoordinateExtent, mergeAriaLabelConfig, AriaLabelConfig } from '@xyflow/system'; import { useStore, useStoreApi } from '../../hooks/useStore'; import type { Node, Edge, ReactFlowState, ReactFlowProps, FitViewOptions } from '../../types'; @@ -68,7 +68,7 @@ const reactFlowFieldsToTrack = [ 'debug', 'autoPanSpeed', 'paneClickDistance', - 'labelConfig', + 'ariaLabelConfig', ] as const; type ReactFlowFieldsToTrack = (typeof reactFlowFieldsToTrack)[number]; @@ -158,8 +158,8 @@ export function StoreUpdater( colorMode = 'light', debug, onScroll, - labelConfig, + ariaLabelConfig, ...rest }: ReactFlowProps, ref: ForwardedRef @@ -306,7 +306,7 @@ function ReactFlow( onBeforeDelete={onBeforeDelete} paneClickDistance={paneClickDistance} debug={debug} - labelConfig={labelConfig} + ariaLabelConfig={ariaLabelConfig} /> onSelectionChange={onSelectionChange} /> {children} diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index f27dcd4a..305acea7 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -108,7 +108,7 @@ export { type NoConnection, type NodeConnection, type OnReconnect, - type LabelConfig, + type AriaLabelConfig, } from '@xyflow/system'; // we need this workaround to prevent a duplicate identifier error diff --git a/packages/react/src/store/initialState.ts b/packages/react/src/store/initialState.ts index 186f1eca..15bfc1d8 100644 --- a/packages/react/src/store/initialState.ts +++ b/packages/react/src/store/initialState.ts @@ -10,7 +10,7 @@ import { NodeOrigin, initialConnection, CoordinateExtent, - defaultLabelConfig, + defaultAriaLabelConfig, } from '@xyflow/system'; import type { Edge, FitViewOptions, InternalNode, Node, ReactFlowStore } from '../types'; @@ -142,7 +142,7 @@ const getInitialState = ({ lib: 'react', debug: false, - labelConfig: defaultLabelConfig, + ariaLabelConfig: defaultAriaLabelConfig, }; }; diff --git a/packages/react/src/types/component-props.ts b/packages/react/src/types/component-props.ts index 315168a9..d088c26b 100644 --- a/packages/react/src/types/component-props.ts +++ b/packages/react/src/types/component-props.ts @@ -21,7 +21,7 @@ import type { ColorMode, SnapGrid, OnReconnect, - LabelConfig, + AriaLabelConfig, } from '@xyflow/system'; import type { @@ -671,5 +671,5 @@ export interface ReactFlowProps; + ariaLabelConfig?: Partial; } diff --git a/packages/react/src/types/store.ts b/packages/react/src/types/store.ts index 5b3dec5b..ba909869 100644 --- a/packages/react/src/types/store.ts +++ b/packages/react/src/types/store.ts @@ -28,7 +28,7 @@ import { type NodeChange, type EdgeChange, type ParentLookup, - type LabelConfig, + type AriaLabelConfig, } from '@xyflow/system'; import type { @@ -148,7 +148,7 @@ export type ReactFlowStore = { diff --git a/packages/svelte/src/lib/components/A11yDescriptions/A11yDescriptions.svelte b/packages/svelte/src/lib/components/A11yDescriptions/A11yDescriptions.svelte index dcfbf93f..24b49111 100644 --- a/packages/svelte/src/lib/components/A11yDescriptions/A11yDescriptions.svelte +++ b/packages/svelte/src/lib/components/A11yDescriptions/A11yDescriptions.svelte @@ -8,11 +8,11 @@
{store.disableKeyboardA11y - ? store.labelConfig['a11yDescription.node.default'] - : store.labelConfig['a11yDescription.node.keyboardDisabled']} + ? store.ariaLabelConfig['node.a11yDescription.default'] + : store.ariaLabelConfig['node.a11yDescription.keyboardDisabled']}
- {store.labelConfig['a11yDescription.edge.default']} + {store.ariaLabelConfig['edge.a11yDescription.default']}
{#if !store.disableKeyboardA11y} diff --git a/packages/svelte/src/lib/components/Handle/Handle.svelte b/packages/svelte/src/lib/components/Handle/Handle.svelte index 055012bb..71ccbd5a 100644 --- a/packages/svelte/src/lib/components/Handle/Handle.svelte +++ b/packages/svelte/src/lib/components/Handle/Handle.svelte @@ -44,7 +44,7 @@ ); let store = useStore(); - let labelConfig = $derived(store.labelConfig); + let ariaLabelConfig = $derived(store.ariaLabelConfig); let prevConnections: Map | null = null; @@ -229,7 +229,7 @@ The Handle component is the part of a node that can be used to connect nodes. onkeypress={() => {}} {style} role="button" - aria-label={labelConfig[`handle.ariaLabel`]} + aria-label={ariaLabelConfig[`handle.ariaLabel`]} tabindex="-1" {...rest} > diff --git a/packages/svelte/src/lib/components/NodeWrapper/NodeWrapper.svelte b/packages/svelte/src/lib/components/NodeWrapper/NodeWrapper.svelte index b7c33ae0..850d1d8d 100644 --- a/packages/svelte/src/lib/components/NodeWrapper/NodeWrapper.svelte +++ b/packages/svelte/src/lib/components/NodeWrapper/NodeWrapper.svelte @@ -85,7 +85,7 @@ let prevTargetPosition: Position | undefined = targetPosition; let NodeComponent = $derived(store.nodeTypes[type] ?? DefaultNode); - let labelConfig = $derived(store.labelConfig); + let ariaLabelConfig = $derived(store.ariaLabelConfig); let connectableContext: ConnectableContext = { get value() { @@ -189,7 +189,7 @@ ) { // prevent default scrolling behavior on arrow key press when node is moved event.preventDefault(); - store.ariaLiveMessage = labelConfig['a11yDescription.ariaLiveMessage']({ + store.ariaLiveMessage = ariaLabelConfig['a11yDescription.ariaLiveMessage']({ direction: event.key.replace('Arrow', '').toLowerCase(), x: ~~node.internals.positionAbsolute.x, y: ~~node.internals.positionAbsolute.y diff --git a/packages/svelte/src/lib/container/SvelteFlow/Wrapper.svelte b/packages/svelte/src/lib/container/SvelteFlow/Wrapper.svelte index 3734cb25..0f7e39f6 100644 --- a/packages/svelte/src/lib/container/SvelteFlow/Wrapper.svelte +++ b/packages/svelte/src/lib/container/SvelteFlow/Wrapper.svelte @@ -92,7 +92,7 @@ noDragClass, noPanClass, noWheelClass, - labelConfig, + ariaLabelConfig, ...divAttributes } = $derived(rest); /* eslint-enable @typescript-eslint/no-unused-vars */ diff --git a/packages/svelte/src/lib/container/SvelteFlow/types.ts b/packages/svelte/src/lib/container/SvelteFlow/types.ts index 331bee8d..38e07f4a 100644 --- a/packages/svelte/src/lib/container/SvelteFlow/types.ts +++ b/packages/svelte/src/lib/container/SvelteFlow/types.ts @@ -21,7 +21,7 @@ import type { OnReconnect, OnReconnectStart, OnReconnectEnd, - LabelConfig + AriaLabelConfig } from '@xyflow/system'; import type { @@ -476,5 +476,5 @@ export type SvelteFlowProps< * Configuration for customizable labels, descriptions, and UI text. Provided keys will override the corresponding defaults. * Allows localization, customization of ARIA descriptions, control labels, minimap labels, and other UI strings. */ - labelConfig?: Partial; + ariaLabelConfig?: Partial; }; diff --git a/packages/svelte/src/lib/index.ts b/packages/svelte/src/lib/index.ts index 57f0c86e..2fc0befc 100644 --- a/packages/svelte/src/lib/index.ts +++ b/packages/svelte/src/lib/index.ts @@ -113,7 +113,7 @@ export { type ResizeDragEvent, type IsValidConnection, type NodeConnection, - type LabelConfig + type AriaLabelConfig } from '@xyflow/system'; // system utils diff --git a/packages/svelte/src/lib/plugins/Controls/Controls.svelte b/packages/svelte/src/lib/plugins/Controls/Controls.svelte index db1f2a57..4225bd4e 100644 --- a/packages/svelte/src/lib/plugins/Controls/Controls.svelte +++ b/packages/svelte/src/lib/plugins/Controls/Controls.svelte @@ -46,7 +46,7 @@ ); let minZoomReached = $derived(store.viewport.zoom <= store.minZoom); let maxZoomReached = $derived(store.viewport.zoom >= store.maxZoom); - let labelConfig = $derived(store.labelConfig); + let ariaLabelConfig = $derived(store.ariaLabelConfig); let orientationClass = $derived(orientation === 'horizontal' ? 'horizontal' : 'vertical'); const onZoomInHandler = () => { @@ -73,7 +73,7 @@ class={['svelte-flow__controls', orientationClass, className]} {position} data-testid="svelte-flow__controls" - aria-label={labelConfig['controls.ariaLabel']} + aria-label={ariaLabelConfig['controls.ariaLabel']} {style} {...rest} > @@ -84,8 +84,8 @@ @@ -94,8 +94,8 @@ @@ -106,8 +106,8 @@ @@ -117,8 +117,8 @@ {#if isInteractive}{:else}{/if} diff --git a/packages/svelte/src/lib/plugins/Minimap/Minimap.svelte b/packages/svelte/src/lib/plugins/Minimap/Minimap.svelte index d31f5771..ac346066 100644 --- a/packages/svelte/src/lib/plugins/Minimap/Minimap.svelte +++ b/packages/svelte/src/lib/plugins/Minimap/Minimap.svelte @@ -42,7 +42,7 @@ }: MiniMapProps = $props(); let store = $derived(useStore()); - let labelConfig = $derived(store.labelConfig); + let ariaLabelConfig = $derived(store.ariaLabelConfig); const nodeColorFunc = nodeColor === undefined ? undefined : getAttrFunction(nodeColor); const nodeStrokeColorFunc = getAttrFunction(nodeStrokeColor); @@ -114,8 +114,8 @@ zoomable }} > - {#if ariaLabel ?? labelConfig['minimap.ariaLabel']} - {ariaLabel ?? labelConfig['minimap.ariaLabel']} + {#if ariaLabel ?? ariaLabelConfig['minimap.ariaLabel']} + {ariaLabel ?? ariaLabelConfig['minimap.ariaLabel']} {/if} {#each store.nodes as userNode (userNode.id)} diff --git a/packages/svelte/src/lib/store/initial-store.svelte.ts b/packages/svelte/src/lib/store/initial-store.svelte.ts index f5f0a356..7971f320 100644 --- a/packages/svelte/src/lib/store/initial-store.svelte.ts +++ b/packages/svelte/src/lib/store/initial-store.svelte.ts @@ -7,7 +7,7 @@ import { getViewportForBounds, updateConnectionLookup, initialConnection, - mergeLabelConfig, + mergeAriaLabelConfig, type SelectionRect, type SnapGrid, type MarkerProps, @@ -34,7 +34,7 @@ import { type OnReconnect, type OnReconnectStart, type OnReconnectEnd, - type LabelConfig + type AriaLabelConfig } from '@xyflow/system'; import DefaultNode from '$lib/components/nodes/DefaultNode.svelte'; @@ -291,7 +291,9 @@ export function getInitialStore `Moved selected node ${direction}. New position, x: ${x}, y: ${y}`, // Control elements 'controls.ariaLabel': 'Control Panel', - 'controls.zoomin.title': 'Zoom In', - 'controls.zoomout.title': 'Zoom Out', - 'controls.fitview.title': 'Fit View', - 'controls.interactive.title': 'Toggle Interactivity', + 'controls.zoomin.ariaLabel': 'Zoom In', + 'controls.zoomout.ariaLabel': 'Zoom Out', + 'controls.fitview.ariaLabel': 'Fit View', + 'controls.interactive.ariaLabel': 'Toggle Interactivity', // Mini map 'minimap.ariaLabel': 'Mini Map', @@ -61,4 +61,4 @@ export const defaultLabelConfig = { 'handle.ariaLabel': 'Handle', }; -export type LabelConfig = typeof defaultLabelConfig; +export type AriaLabelConfig = typeof defaultAriaLabelConfig; diff --git a/packages/system/src/utils/general.ts b/packages/system/src/utils/general.ts index 32623057..fdfd6b75 100644 --- a/packages/system/src/utils/general.ts +++ b/packages/system/src/utils/general.ts @@ -16,7 +16,7 @@ import type { import { type Viewport } from '../types'; import { getNodePositionWithOrigin, isInternalNodeBase } from './graph'; -import { defaultLabelConfig, type LabelConfig } from '../constants'; +import { defaultAriaLabelConfig, type AriaLabelConfig } from '../constants'; export const clamp = (val: number, min = 0, max = 1): number => Math.min(Math.max(val, min), max); @@ -421,6 +421,6 @@ export function withResolvers(): { return { promise, resolve, reject }; } -export function mergeLabelConfig(partial?: Partial): LabelConfig { - return { ...defaultLabelConfig, ...(partial || {}) }; +export function mergeAriaLabelConfig(partial?: Partial): AriaLabelConfig { + return { ...defaultAriaLabelConfig, ...(partial || {}) }; }