@baukit/a11y-core 0.7.1 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,173 @@
1
+ import { useCallback, useEffect, useRef, useState, type RefObject } from 'react';
2
+
3
+ import { activeFocusTarget, asFocusTarget } from './dom-boundary.js';
4
+ import { hasDocument } from './platform.js';
5
+
6
+ export interface RovingMenuOption {
7
+ readonly disabled?: boolean | undefined;
8
+ readonly selected?: boolean | undefined;
9
+ }
10
+
11
+ export interface RovingMenuOptions {
12
+ readonly active: boolean;
13
+ readonly options: readonly RovingMenuOption[];
14
+ }
15
+
16
+ export interface RovingMenuKeyEvent {
17
+ nativeEvent: { key: string; target?: unknown };
18
+ preventDefault: () => void;
19
+ }
20
+
21
+ export interface RovingMenuItemProps {
22
+ readonly onKeyDown: (event: RovingMenuKeyEvent) => void;
23
+ readonly ref: (node: object | null) => void;
24
+ readonly tabIndex: 0 | -1;
25
+ }
26
+
27
+ export interface RovingMenuResult {
28
+ /** The item holding the tab stop, or null when no item is enabled. */
29
+ readonly activeIndex: number | null;
30
+ /** A stable ref to the active item's host; its `current` is null when no item is enabled. */
31
+ readonly initialFocusRef: RefObject<object | null>;
32
+ readonly itemProps: (index: number) => RovingMenuItemProps;
33
+ }
34
+
35
+ type ItemRef = (node: object | null) => void;
36
+
37
+ function isEnabled(option: RovingMenuOption | undefined): boolean {
38
+ return option !== undefined && option.disabled !== true;
39
+ }
40
+
41
+ function enabledIndexes(options: readonly RovingMenuOption[]): number[] {
42
+ return options.flatMap((option, index) => (isEnabled(option) ? [index] : []));
43
+ }
44
+
45
+ function nextAfter(enabled: readonly number[], currentIndex: number): number | undefined {
46
+ return enabled.find((index) => index > currentIndex) ?? enabled[0];
47
+ }
48
+
49
+ function previousBefore(enabled: readonly number[], currentIndex: number): number | undefined {
50
+ const before = enabled.filter((index) => index < currentIndex);
51
+ return before[before.length - 1] ?? enabled[enabled.length - 1];
52
+ }
53
+
54
+ /**
55
+ * Maps an arrow, Home, or End key to the enabled item it moves to, or null to
56
+ * ignore the key. Movement is relative to `currentIndex` even when that item is
57
+ * disabled or gone, and wraps at both ends.
58
+ */
59
+ export function nextEnabledMenuIndex(
60
+ key: string,
61
+ currentIndex: number,
62
+ options: readonly RovingMenuOption[],
63
+ ): number | null {
64
+ const enabled = enabledIndexes(options);
65
+ if (enabled.length === 0) return null;
66
+
67
+ switch (key) {
68
+ case 'ArrowDown':
69
+ case 'ArrowRight':
70
+ return nextAfter(enabled, currentIndex) ?? null;
71
+ case 'ArrowLeft':
72
+ case 'ArrowUp':
73
+ return previousBefore(enabled, currentIndex) ?? null;
74
+ case 'Home':
75
+ return enabled[0] ?? null;
76
+ case 'End':
77
+ return enabled[enabled.length - 1] ?? null;
78
+ default:
79
+ return null;
80
+ }
81
+ }
82
+
83
+ function initialMenuIndex(options: readonly RovingMenuOption[]): number | null {
84
+ const selected = options.findIndex((option) => option.selected === true && isEnabled(option));
85
+ if (selected >= 0) return selected;
86
+ const firstEnabled = options.findIndex(isEnabled);
87
+ return firstEnabled >= 0 ? firstEnabled : null;
88
+ }
89
+
90
+ function resolveMenuIndex(
91
+ movedIndex: number | null,
92
+ options: readonly RovingMenuOption[],
93
+ ): number | null {
94
+ if (movedIndex !== null && isEnabled(options[movedIndex])) return movedIndex;
95
+ return initialMenuIndex(options);
96
+ }
97
+
98
+ /** True when the key came from a host nested inside the item, such as a field. */
99
+ function isNestedTarget(target: unknown, item: object | null): boolean {
100
+ return typeof target === 'object' && target !== null && item !== null && target !== item;
101
+ }
102
+
103
+ function focusFellToDocument(): boolean {
104
+ if (!hasDocument()) return false;
105
+ return document.activeElement === null || document.activeElement === document.body;
106
+ }
107
+
108
+ /**
109
+ * Keyboard and focus state for an action menu: one tab stop on an enabled item,
110
+ * arrow keys that skip disabled items, and Home and End. It renders nothing,
111
+ * invokes no action, and leaves Escape, focus containment, and restoration to
112
+ * `useOverlayA11y`. Call it before `useOverlayA11y` and pass `initialFocusRef` on.
113
+ */
114
+ export function useRovingMenu({ active, options }: RovingMenuOptions): RovingMenuResult {
115
+ const itemNodes = useRef<(object | null)[]>([]);
116
+ const itemRefs = useRef(new Map<number, ItemRef>());
117
+ const initialFocusRef = useRef<object | null>(null);
118
+ const focusedItemRemoved = useRef(false);
119
+ const [movedIndex, setMovedIndex] = useState<number | null>(null);
120
+ const [wasActive, setWasActive] = useState(active);
121
+
122
+ if (wasActive !== active) {
123
+ setWasActive(active);
124
+ setMovedIndex(null);
125
+ }
126
+
127
+ const activeIndex = resolveMenuIndex(movedIndex, options);
128
+
129
+ useEffect(() => {
130
+ initialFocusRef.current =
131
+ activeIndex === null ? null : (itemNodes.current[activeIndex] ?? null);
132
+ if (!focusedItemRemoved.current) return;
133
+ focusedItemRemoved.current = false;
134
+ if (active && focusFellToDocument()) asFocusTarget(initialFocusRef)?.focus();
135
+ });
136
+
137
+ const itemRef = useCallback((index: number): ItemRef => {
138
+ const cached = itemRefs.current.get(index);
139
+ if (cached !== undefined) return cached;
140
+
141
+ const attach: ItemRef = (node) => {
142
+ const previous = itemNodes.current[index] ?? null;
143
+ if (node === null && previous !== null && previous === activeFocusTarget()) {
144
+ focusedItemRemoved.current = true;
145
+ }
146
+ itemNodes.current[index] = node;
147
+ };
148
+ itemRefs.current.set(index, attach);
149
+ return attach;
150
+ }, []);
151
+
152
+ const onItemKeyDown = (event: RovingMenuKeyEvent, index: number) => {
153
+ if (isNestedTarget(event.nativeEvent.target, itemNodes.current[index] ?? null)) return;
154
+ const nextIndex = nextEnabledMenuIndex(event.nativeEvent.key, index, options);
155
+ if (nextIndex === null) return;
156
+
157
+ event.preventDefault();
158
+ setMovedIndex(nextIndex);
159
+ asFocusTarget({ current: itemNodes.current[nextIndex] ?? null })?.focus();
160
+ };
161
+
162
+ return {
163
+ activeIndex,
164
+ initialFocusRef,
165
+ itemProps: (index: number) => ({
166
+ onKeyDown: (event: RovingMenuKeyEvent) => {
167
+ onItemKeyDown(event, index);
168
+ },
169
+ ref: itemRef(index),
170
+ tabIndex: index === activeIndex ? 0 : -1,
171
+ }),
172
+ };
173
+ }
@@ -0,0 +1,223 @@
1
+ // @vitest-environment jsdom
2
+ import { act, cleanup, render, renderHook } from '@testing-library/react';
3
+ import { createElement } from 'react';
4
+ import { afterEach, describe, expect, it, vi } from 'vitest';
5
+
6
+ vi.mock('react-native', () => ({ Platform: { OS: 'web' } }));
7
+
8
+ import {
9
+ nextIndexFor,
10
+ useRovingRadioGroup,
11
+ type RovingKeyEvent,
12
+ } from './use-roving-radio-group.js';
13
+
14
+ const OPTIONS = ['low', 'medium', 'high'] as const;
15
+
16
+ function keyEvent(key: string) {
17
+ const preventDefault = vi.fn<() => void>();
18
+ const event: RovingKeyEvent = { nativeEvent: { key }, preventDefault };
19
+ return { ...event, preventDefault };
20
+ }
21
+
22
+ function byId(id: string): HTMLElement {
23
+ const element = document.querySelector<HTMLElement>(`#${id}`);
24
+ if (element === null) throw new Error(`no element with id ${id}`);
25
+ return element;
26
+ }
27
+
28
+ /** React Native Web hands a DOM element to a ref typed as a native View. */
29
+ function attachRef(attach: (node: never) => void, element: HTMLElement): void {
30
+ attach(element as never);
31
+ }
32
+
33
+ afterEach(() => {
34
+ cleanup();
35
+ document.body.innerHTML = '';
36
+ });
37
+
38
+ describe('nextIndexFor', () => {
39
+ it.each([
40
+ ['ArrowDown', 1, 2],
41
+ ['ArrowRight', 1, 2],
42
+ ['ArrowUp', 1, 0],
43
+ ['ArrowLeft', 1, 0],
44
+ ['Home', 1, 0],
45
+ ['End', 1, 3],
46
+ ])('maps %s from index %i to %i', (key, index, expected) => {
47
+ expect(nextIndexFor(key, index, 4)).toBe(expected);
48
+ });
49
+
50
+ it('wraps around both ends of the group', () => {
51
+ expect(nextIndexFor('ArrowDown', 3, 4)).toBe(0);
52
+ expect(nextIndexFor('ArrowUp', 0, 4)).toBe(3);
53
+ });
54
+
55
+ it('ignores keys that are not group movement', () => {
56
+ expect(nextIndexFor('Tab', 1, 4)).toBeNull();
57
+ expect(nextIndexFor('Enter', 1, 4)).toBeNull();
58
+ expect(nextIndexFor(' ', 1, 4)).toBeNull();
59
+ });
60
+
61
+ it('stays on the only option in a single-option group', () => {
62
+ expect(nextIndexFor('ArrowDown', 0, 1)).toBe(0);
63
+ expect(nextIndexFor('End', 0, 1)).toBe(0);
64
+ });
65
+ });
66
+
67
+ describe('useRovingRadioGroup', () => {
68
+ it('gives the group one tab stop on the selected option', () => {
69
+ const view = renderHook(() =>
70
+ useRovingRadioGroup({ onChange: vi.fn(), options: OPTIONS, value: 'medium' }),
71
+ );
72
+
73
+ expect(view.result.current.radioProps(0).tabIndex).toBe(-1);
74
+ expect(view.result.current.radioProps(1).tabIndex).toBe(0);
75
+ expect(view.result.current.radioProps(2).tabIndex).toBe(-1);
76
+ });
77
+
78
+ it('falls back to the first option when the value is not in the list', () => {
79
+ const view = renderHook(() =>
80
+ useRovingRadioGroup({ onChange: vi.fn(), options: OPTIONS, value: 'absent' }),
81
+ );
82
+
83
+ expect(view.result.current.radioProps(0).tabIndex).toBe(0);
84
+ });
85
+
86
+ it('ignores keys that do not move the group', () => {
87
+ const onChange = vi.fn();
88
+ const view = renderHook(() =>
89
+ useRovingRadioGroup({ onChange, options: OPTIONS, value: 'low' }),
90
+ );
91
+
92
+ const event = keyEvent('Tab');
93
+ act(() => {
94
+ view.result.current.radioProps(0).onKeyDown(event);
95
+ });
96
+
97
+ expect(event.preventDefault).not.toHaveBeenCalled();
98
+ expect(onChange).not.toHaveBeenCalled();
99
+ });
100
+
101
+ it('does nothing for an empty group', () => {
102
+ const onChange = vi.fn();
103
+ const view = renderHook(() =>
104
+ useRovingRadioGroup<string>({ onChange, options: [], value: 'low' }),
105
+ );
106
+
107
+ const event = keyEvent('ArrowDown');
108
+ act(() => {
109
+ view.result.current.radioProps(0).onKeyDown(event);
110
+ });
111
+
112
+ expect(event.preventDefault).not.toHaveBeenCalled();
113
+ expect(onChange).not.toHaveBeenCalled();
114
+ });
115
+
116
+ it('selects without focusing when the option has not mounted', () => {
117
+ const onChange = vi.fn();
118
+ const view = renderHook(() =>
119
+ useRovingRadioGroup({ onChange, options: OPTIONS, value: 'low' }),
120
+ );
121
+
122
+ expect(() => {
123
+ act(() => {
124
+ view.result.current.radioProps(0).onKeyDown(keyEvent('End'));
125
+ });
126
+ }).not.toThrow();
127
+ expect(onChange).toHaveBeenCalledWith('high');
128
+ });
129
+ });
130
+
131
+ describe('useRovingRadioGroup in a rendered group', () => {
132
+ function Group({ value, onChange }: { value: string; onChange: (next: string) => void }) {
133
+ const { radioProps } = useRovingRadioGroup({ onChange, options: OPTIONS, value });
134
+ return createElement(
135
+ 'div',
136
+ { role: 'radiogroup' },
137
+ OPTIONS.map((option, index) => {
138
+ const props = radioProps(index);
139
+ return createElement(
140
+ 'button',
141
+ {
142
+ key: option,
143
+ id: option,
144
+ role: 'radio',
145
+ 'aria-checked': option === value,
146
+ ref: props.ref as never,
147
+ tabIndex: props.tabIndex,
148
+ onKeyDown: props.onKeyDown as never,
149
+ },
150
+ option,
151
+ );
152
+ }),
153
+ );
154
+ }
155
+
156
+ it('exposes exactly one tab stop in the DOM', () => {
157
+ render(createElement(Group, { value: 'medium', onChange: vi.fn() }));
158
+
159
+ const stops = Array.from(document.querySelectorAll('[role="radio"]')).filter(
160
+ (radio) => radio.getAttribute('tabindex') === '0',
161
+ );
162
+
163
+ expect(stops.map((radio) => radio.id)).toEqual(['medium']);
164
+ });
165
+
166
+ it('moves real focus to the next option on an arrow key', () => {
167
+ const onChange = vi.fn();
168
+ const view = renderHook(() =>
169
+ useRovingRadioGroup({ onChange, options: OPTIONS, value: 'low' }),
170
+ );
171
+ render(createElement(Group, { value: 'low', onChange }));
172
+
173
+ // Attach the hook's refs to the rendered radios, as React Native Web does.
174
+ OPTIONS.forEach((option, index) => {
175
+ attachRef(view.result.current.radioProps(index).ref, byId(option));
176
+ });
177
+ byId('low').focus();
178
+
179
+ act(() => {
180
+ view.result.current.radioProps(0).onKeyDown(keyEvent('ArrowDown'));
181
+ });
182
+
183
+ expect(onChange).toHaveBeenCalledWith('medium');
184
+ expect(document.activeElement?.id).toBe('medium');
185
+ });
186
+
187
+ it('wraps focus from the last option back to the first', () => {
188
+ const onChange = vi.fn();
189
+ const view = renderHook(() =>
190
+ useRovingRadioGroup({ onChange, options: OPTIONS, value: 'high' }),
191
+ );
192
+ render(createElement(Group, { value: 'high', onChange }));
193
+ OPTIONS.forEach((option, index) => {
194
+ attachRef(view.result.current.radioProps(index).ref, byId(option));
195
+ });
196
+ byId('high').focus();
197
+
198
+ act(() => {
199
+ view.result.current.radioProps(2).onKeyDown(keyEvent('ArrowRight'));
200
+ });
201
+
202
+ expect(onChange).toHaveBeenCalledWith('low');
203
+ expect(document.activeElement?.id).toBe('low');
204
+ });
205
+
206
+ it('jumps to the last option on End', () => {
207
+ const onChange = vi.fn();
208
+ const view = renderHook(() =>
209
+ useRovingRadioGroup({ onChange, options: OPTIONS, value: 'low' }),
210
+ );
211
+ render(createElement(Group, { value: 'low', onChange }));
212
+ OPTIONS.forEach((option, index) => {
213
+ attachRef(view.result.current.radioProps(index).ref, byId(option));
214
+ });
215
+
216
+ act(() => {
217
+ view.result.current.radioProps(0).onKeyDown(keyEvent('End'));
218
+ });
219
+
220
+ expect(onChange).toHaveBeenCalledWith('high');
221
+ expect(document.activeElement?.id).toBe('high');
222
+ });
223
+ });
@@ -0,0 +1,79 @@
1
+ import { useRef } from 'react';
2
+ import type { View } from 'react-native';
3
+
4
+ import { asFocusTarget } from './dom-boundary.js';
5
+
6
+ export interface RovingKeyEvent {
7
+ nativeEvent: { key: string };
8
+ preventDefault: () => void;
9
+ }
10
+
11
+ export interface RovingRadioGroupOptions<T> {
12
+ onChange: (value: T) => void;
13
+ options: readonly T[];
14
+ value: T;
15
+ }
16
+
17
+ export interface RovingRadioProps {
18
+ onKeyDown: (event: RovingKeyEvent) => void;
19
+ ref: (node: View | null) => void;
20
+ tabIndex: 0 | -1;
21
+ }
22
+
23
+ export interface RovingRadioGroupResult {
24
+ radioProps: (index: number) => RovingRadioProps;
25
+ }
26
+
27
+ /** Maps an arrow/Home/End key to the option it should move to, or null to ignore it. */
28
+ export function nextIndexFor(key: string, index: number, length: number): number | null {
29
+ switch (key) {
30
+ case 'ArrowDown':
31
+ case 'ArrowRight':
32
+ return (index + 1) % length;
33
+ case 'ArrowLeft':
34
+ case 'ArrowUp':
35
+ return (index - 1 + length) % length;
36
+ case 'Home':
37
+ return 0;
38
+ case 'End':
39
+ return length - 1;
40
+ default:
41
+ return null;
42
+ }
43
+ }
44
+
45
+ /** Gives a radio group one tab stop and arrow-key movement between its options. */
46
+ export function useRovingRadioGroup<T>({
47
+ onChange,
48
+ options,
49
+ value,
50
+ }: RovingRadioGroupOptions<T>): RovingRadioGroupResult {
51
+ const optionRefs = useRef<(View | null)[]>([]);
52
+ const selectedIndex = Math.max(
53
+ 0,
54
+ options.findIndex((option) => Object.is(option, value)),
55
+ );
56
+
57
+ const onKeyDown = (event: RovingKeyEvent, index: number) => {
58
+ if (options.length === 0) return;
59
+ const nextIndex = nextIndexFor(event.nativeEvent.key, index, options.length);
60
+ if (nextIndex === null) return;
61
+
62
+ event.preventDefault();
63
+ const nextValue = options[nextIndex];
64
+ if (nextValue !== undefined) onChange(nextValue);
65
+ asFocusTarget({ current: optionRefs.current[nextIndex] ?? null })?.focus();
66
+ };
67
+
68
+ return {
69
+ radioProps: (index: number) => ({
70
+ onKeyDown: (event: RovingKeyEvent) => {
71
+ onKeyDown(event, index);
72
+ },
73
+ ref: (node: View | null) => {
74
+ optionRefs.current[index] = node;
75
+ },
76
+ tabIndex: index === selectedIndex ? 0 : -1,
77
+ }),
78
+ };
79
+ }
@@ -0,0 +1,74 @@
1
+ // @vitest-environment jsdom
2
+ import { act, cleanup, renderHook } from '@testing-library/react';
3
+ import { afterEach, describe, expect, it } from 'vitest';
4
+
5
+ import { useSingleFlight } from './use-single-flight.js';
6
+
7
+ function deferred<T>() {
8
+ let resolve!: (value: T) => void;
9
+ const promise = new Promise<T>((onResolve) => {
10
+ resolve = onResolve;
11
+ });
12
+ return { promise, resolve };
13
+ }
14
+
15
+ afterEach(() => {
16
+ cleanup();
17
+ });
18
+
19
+ describe('useSingleFlight', () => {
20
+ it('runs an operation and returns its value', async () => {
21
+ const view = renderHook(() => useSingleFlight());
22
+
23
+ await expect(view.result.current(() => Promise.resolve('saved'))).resolves.toBe('saved');
24
+ });
25
+
26
+ it('rejects a second call while the first is still running', async () => {
27
+ const view = renderHook(() => useSingleFlight());
28
+ const gate = deferred<string>();
29
+ let secondRan = false;
30
+
31
+ const first = view.result.current(() => gate.promise);
32
+ const second = await view.result.current(() => {
33
+ secondRan = true;
34
+ return Promise.resolve('ignored');
35
+ });
36
+
37
+ expect(second).toBeUndefined();
38
+ expect(secondRan).toBe(false);
39
+
40
+ await act(async () => {
41
+ gate.resolve('first');
42
+ await first;
43
+ });
44
+ await expect(first).resolves.toBe('first');
45
+ });
46
+
47
+ it('accepts the next call once the previous one settles', async () => {
48
+ const view = renderHook(() => useSingleFlight());
49
+
50
+ await view.result.current(() => Promise.resolve('one'));
51
+
52
+ await expect(view.result.current(() => Promise.resolve('two'))).resolves.toBe('two');
53
+ });
54
+
55
+ it('releases the lock after a failed operation', async () => {
56
+ const view = renderHook(() => useSingleFlight());
57
+ const failure = new Error('write rejected');
58
+
59
+ await expect(view.result.current(() => Promise.reject(failure))).rejects.toBe(failure);
60
+
61
+ await expect(view.result.current(() => Promise.resolve('recovered'))).resolves.toBe(
62
+ 'recovered',
63
+ );
64
+ });
65
+
66
+ it('keeps the same runner across re-renders', () => {
67
+ const view = renderHook(() => useSingleFlight());
68
+ const first = view.result.current;
69
+
70
+ view.rerender();
71
+
72
+ expect(view.result.current).toBe(first);
73
+ });
74
+ });
@@ -0,0 +1,22 @@
1
+ import { useCallback, useRef } from 'react';
2
+
3
+ export type SingleFlightRunner = <T>(operation: () => Promise<T>) => Promise<T | undefined>;
4
+
5
+ /**
6
+ * A synchronous mutex for async UI mutations. React state alone cannot lock the
7
+ * same tick, so a double tap would submit twice. A rejected call returns undefined.
8
+ */
9
+ export function useSingleFlight(): SingleFlightRunner {
10
+ const active = useRef(false);
11
+
12
+ return useCallback(async <T>(operation: () => Promise<T>) => {
13
+ if (active.current) return undefined;
14
+
15
+ active.current = true;
16
+ try {
17
+ return await operation();
18
+ } finally {
19
+ active.current = false;
20
+ }
21
+ }, []);
22
+ }
@@ -0,0 +1,40 @@
1
+ // @vitest-environment jsdom
2
+ import { describe, expect, it, vi } from 'vitest';
3
+
4
+ // A plain React web app has no React Native to resolve. Importing it here is an
5
+ // error, so the web entry fails this file if anything it reaches still does.
6
+ vi.mock('react-native', () => {
7
+ throw new Error('the web entry must not import react-native');
8
+ });
9
+
10
+ import * as web from './web.js';
11
+
12
+ describe('the web entry point', () => {
13
+ it('loads without react-native and exports the DOM behavior', () => {
14
+ expect(Object.keys(web).sort()).toEqual([
15
+ 'ARIA_HIDDEN_INERT_OPT_OUT',
16
+ 'DEFAULT_LIVE_REGION_ID',
17
+ 'activeFocusTarget',
18
+ 'announce',
19
+ 'applyFocusTrapKey',
20
+ 'asFocusContainer',
21
+ 'asFocusTarget',
22
+ 'asTreeElement',
23
+ 'createRouteFocusController',
24
+ 'focusOverlayEntry',
25
+ 'focusableElements',
26
+ 'hostElement',
27
+ 'makeOutsideSiblingsInert',
28
+ 'nextEnabledMenuIndex',
29
+ 'syncAriaHiddenInert',
30
+ 'useAriaHiddenInert',
31
+ 'useFocusTrap',
32
+ 'useInert',
33
+ 'useReducedMotion',
34
+ 'useReducedMotionPreference',
35
+ 'useRovingMenu',
36
+ 'useSingleFlight',
37
+ 'wrapFocusAtBoundary',
38
+ ]);
39
+ });
40
+ });
package/src/web.ts ADDED
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The entry point for a plain React web app. Nothing reachable from here
3
+ * imports `react-native` at runtime, so a product without React Native in its
4
+ * dependency tree can bundle it. React Native products import the package root
5
+ * instead and get these exports plus the native ones.
6
+ */
7
+
8
+ export * from './announce-web.js';
9
+ export * from './dom-boundary.js';
10
+ export * from './route-focus.js';
11
+ export * from './use-focus-trap.js';
12
+ export * from './use-inert.js';
13
+ export {
14
+ useReducedMotion,
15
+ useReducedMotionPreference,
16
+ type ReducedMotionPreference,
17
+ } from './use-reduced-motion-web.js';
18
+ export * from './use-roving-menu.js';
19
+ export * from './use-single-flight.js';