@react-aria/focus 3.0.0-nightly.1658 → 3.0.0-nightly.1663
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.
- package/dist/main.js +11 -41
- package/dist/main.js.map +1 -1
- package/dist/module.js +0 -22
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +15 -15
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/FocusScope.tsx +43 -42
- package/src/focusSafely.ts +2 -1
- package/src/index.ts +6 -6
- package/src/useFocusRing.ts +3 -2
- package/src/useFocusable.tsx +8 -8
package/dist/main.js
CHANGED
|
@@ -3,37 +3,22 @@ var $aB6Cp$reactariautils = require("@react-aria/utils");
|
|
|
3
3
|
var $aB6Cp$reactariainteractions = require("@react-aria/interactions");
|
|
4
4
|
var $aB6Cp$clsx = require("clsx");
|
|
5
5
|
|
|
6
|
-
function $parcel$
|
|
7
|
-
Object.
|
|
8
|
-
if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
Object.defineProperty(dest, key, {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return source[key];
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
return dest;
|
|
6
|
+
function $parcel$export(e, n, v, s) {
|
|
7
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
21
8
|
}
|
|
22
9
|
function $parcel$interopDefault(a) {
|
|
23
10
|
return a && a.__esModule ? a.default : a;
|
|
24
11
|
}
|
|
25
|
-
function $parcel$export(e, n, v, s) {
|
|
26
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
27
|
-
}
|
|
28
|
-
var $a7a032acae3ddda9$exports = {};
|
|
29
|
-
|
|
30
|
-
$parcel$export($a7a032acae3ddda9$exports, "FocusScope", () => $a7a032acae3ddda9$export$20e40289641fbbb6);
|
|
31
|
-
$parcel$export($a7a032acae3ddda9$exports, "useFocusManager", () => $a7a032acae3ddda9$export$10c5169755ce7bd7);
|
|
32
|
-
$parcel$export($a7a032acae3ddda9$exports, "getFocusableTreeWalker", () => $a7a032acae3ddda9$export$2d6ec8fc375ceafa);
|
|
33
|
-
$parcel$export($a7a032acae3ddda9$exports, "createFocusManager", () => $a7a032acae3ddda9$export$c5251b9e124bf29);
|
|
34
|
-
var $1c7f9157d722357d$exports = {};
|
|
35
12
|
|
|
36
|
-
$parcel$export(
|
|
13
|
+
$parcel$export(module.exports, "FocusScope", () => $a7a032acae3ddda9$export$20e40289641fbbb6);
|
|
14
|
+
$parcel$export(module.exports, "useFocusManager", () => $a7a032acae3ddda9$export$10c5169755ce7bd7);
|
|
15
|
+
$parcel$export(module.exports, "getFocusableTreeWalker", () => $a7a032acae3ddda9$export$2d6ec8fc375ceafa);
|
|
16
|
+
$parcel$export(module.exports, "createFocusManager", () => $a7a032acae3ddda9$export$c5251b9e124bf29);
|
|
17
|
+
$parcel$export(module.exports, "FocusRing", () => $dfd8c70b928eb1b3$export$1a38b4ad7f578e1d);
|
|
18
|
+
$parcel$export(module.exports, "FocusableProvider", () => $fb504d83237fd6ac$export$13f3202a3e5ddd5);
|
|
19
|
+
$parcel$export(module.exports, "useFocusable", () => $fb504d83237fd6ac$export$4c014de7c8940b4c);
|
|
20
|
+
$parcel$export(module.exports, "useFocusRing", () => $581a96d6eb128c1b$export$4e328f61c538687f);
|
|
21
|
+
$parcel$export(module.exports, "focusSafely", () => $1c7f9157d722357d$export$80f3e147d781571c);
|
|
37
22
|
|
|
38
23
|
|
|
39
24
|
function $1c7f9157d722357d$export$80f3e147d781571c(element) {
|
|
@@ -517,16 +502,10 @@ function $a7a032acae3ddda9$var$last(walker) {
|
|
|
517
502
|
}
|
|
518
503
|
|
|
519
504
|
|
|
520
|
-
var $dfd8c70b928eb1b3$exports = {};
|
|
521
505
|
|
|
522
|
-
$parcel$export($dfd8c70b928eb1b3$exports, "FocusRing", () => $dfd8c70b928eb1b3$export$1a38b4ad7f578e1d);
|
|
523
506
|
|
|
524
507
|
|
|
525
508
|
|
|
526
|
-
var $581a96d6eb128c1b$exports = {};
|
|
527
|
-
|
|
528
|
-
$parcel$export($581a96d6eb128c1b$exports, "useFocusRing", () => $581a96d6eb128c1b$export$4e328f61c538687f);
|
|
529
|
-
|
|
530
509
|
|
|
531
510
|
|
|
532
511
|
function $581a96d6eb128c1b$export$4e328f61c538687f(props = {
|
|
@@ -584,10 +563,6 @@ function $dfd8c70b928eb1b3$export$1a38b4ad7f578e1d(props) {
|
|
|
584
563
|
}
|
|
585
564
|
|
|
586
565
|
|
|
587
|
-
var $fb504d83237fd6ac$exports = {};
|
|
588
|
-
|
|
589
|
-
$parcel$export($fb504d83237fd6ac$exports, "FocusableProvider", () => $fb504d83237fd6ac$export$13f3202a3e5ddd5);
|
|
590
|
-
$parcel$export($fb504d83237fd6ac$exports, "useFocusable", () => $fb504d83237fd6ac$export$4c014de7c8940b4c);
|
|
591
566
|
|
|
592
567
|
|
|
593
568
|
|
|
@@ -639,11 +614,6 @@ function $fb504d83237fd6ac$export$4c014de7c8940b4c(props, domRef) {
|
|
|
639
614
|
|
|
640
615
|
|
|
641
616
|
|
|
642
|
-
$parcel$exportWildcard(module.exports, $a7a032acae3ddda9$exports);
|
|
643
|
-
$parcel$exportWildcard(module.exports, $dfd8c70b928eb1b3$exports);
|
|
644
|
-
$parcel$exportWildcard(module.exports, $fb504d83237fd6ac$exports);
|
|
645
|
-
$parcel$exportWildcard(module.exports, $581a96d6eb128c1b$exports);
|
|
646
|
-
$parcel$exportWildcard(module.exports, $1c7f9157d722357d$exports);
|
|
647
617
|
|
|
648
618
|
|
|
649
619
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAY,CAAC,OAAO,GAAG,KAAK;IAC9B,CAAC,EAAE,CAAC;QAAA,MAAM;IAAA,CAAC;IAEX,MAAM,CAAC,CAAC;QACN,cAAc,EAAE,gCAAU,CACxB,CAAC;eACI,YAAY;YACf,QAAQ,EAAE,KAAK,CAAC,mBAAmB,KAAK,KAAK,CAAC,UAAU,GAAG,EAAE,GAAG,SAAS;QAC3E,CAAC,EACD,gBAAgB;IAEpB,CAAC;AACH,CAAC;","sources":["packages/@react-aria/focus/src/index.ts","packages/@react-aria/focus/src/FocusScope.tsx","packages/@react-aria/focus/src/focusSafely.ts","packages/@react-aria/focus/src/isElementVisible.ts","packages/@react-aria/focus/src/FocusRing.tsx","packages/@react-aria/focus/src/useFocusRing.ts","packages/@react-aria/focus/src/useFocusable.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport * from './FocusScope';\nexport * from './FocusRing';\nexport * from './useFocusable';\nexport * from './useFocusRing';\nexport * from './focusSafely';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {focusSafely} from './focusSafely';\nimport {isElementVisible} from './isElementVisible';\nimport React, {ReactNode, RefObject, useContext, useEffect, useRef} from 'react';\nimport {useLayoutEffect} from '@react-aria/utils';\n\n// import {FocusScope, useFocusScope} from 'react-events/focus-scope';\n// export {FocusScope};\n\ninterface FocusScopeProps {\n /** The contents of the focus scope. */\n children: ReactNode,\n\n /**\n * Whether to contain focus inside the scope, so users cannot\n * move focus outside, for example in a modal dialog.\n */\n contain?: boolean,\n\n /**\n * Whether to restore focus back to the element that was focused\n * when the focus scope mounted, after the focus scope unmounts.\n */\n restoreFocus?: boolean,\n\n /** Whether to auto focus the first focusable element in the focus scope on mount. */\n autoFocus?: boolean\n}\n\ninterface FocusManagerOptions {\n /** The element to start searching from. The currently focused element by default. */\n from?: HTMLElement,\n /** Whether to only include tabbable elements, or all focusable elements. */\n tabbable?: boolean,\n /** Whether focus should wrap around when it reaches the end of the scope. */\n wrap?: boolean,\n /** A callback that determines whether the given element is focused. */\n accept?: (node: Element) => boolean\n}\n\nexport interface FocusManager {\n /** Moves focus to the next focusable or tabbable element in the focus scope. */\n focusNext(opts?: FocusManagerOptions): HTMLElement,\n /** Moves focus to the previous focusable or tabbable element in the focus scope. */\n focusPrevious(opts?: FocusManagerOptions): HTMLElement,\n /** Moves focus to the first focusable or tabbable element in the focus scope. */\n focusFirst(opts?: FocusManagerOptions): HTMLElement,\n /** Moves focus to the last focusable or tabbable element in the focus scope. */\n focusLast(opts?: FocusManagerOptions): HTMLElement\n}\n\ntype ScopeRef = RefObject<HTMLElement[]>;\ninterface IFocusContext {\n scopeRef: ScopeRef,\n focusManager: FocusManager\n}\n\nconst FocusContext = React.createContext<IFocusContext>(null);\n\nlet activeScope: ScopeRef = null;\nlet scopes: Map<ScopeRef, ScopeRef | null> = new Map();\n\n// This is a hacky DOM-based implementation of a FocusScope until this RFC lands in React:\n// https://github.com/reactjs/rfcs/pull/109\n// For now, it relies on the DOM tree order rather than the React tree order, and is probably\n// less optimized for performance.\n\n/**\n * A FocusScope manages focus for its descendants. It supports containing focus inside\n * the scope, restoring focus to the previously focused element on unmount, and auto\n * focusing children on mount. It also acts as a container for a programmatic focus\n * management interface that can be used to move focus forward and back in response\n * to user events.\n */\nexport function FocusScope(props: FocusScopeProps) {\n let {children, contain, restoreFocus, autoFocus} = props;\n let startRef = useRef<HTMLSpanElement>();\n let endRef = useRef<HTMLSpanElement>();\n let scopeRef = useRef<HTMLElement[]>([]);\n let ctx = useContext(FocusContext);\n let parentScope = ctx?.scopeRef;\n\n useLayoutEffect(() => {\n // Find all rendered nodes between the sentinels and add them to the scope.\n let node = startRef.current.nextSibling;\n let nodes = [];\n while (node && node !== endRef.current) {\n nodes.push(node);\n node = node.nextSibling;\n }\n\n scopeRef.current = nodes;\n }, [children, parentScope]);\n\n useLayoutEffect(() => {\n scopes.set(scopeRef, parentScope);\n return () => {\n // Restore the active scope on unmount if this scope or a descendant scope is active.\n // Parent effect cleanups run before children, so we need to check if the\n // parent scope actually still exists before restoring the active scope to it.\n if (\n (scopeRef === activeScope || isAncestorScope(scopeRef, activeScope)) &&\n (!parentScope || scopes.has(parentScope))\n ) {\n activeScope = parentScope;\n }\n scopes.delete(scopeRef);\n };\n }, [scopeRef, parentScope]);\n\n useFocusContainment(scopeRef, contain);\n useRestoreFocus(scopeRef, restoreFocus, contain);\n useAutoFocus(scopeRef, autoFocus);\n\n let focusManager = createFocusManagerForScope(scopeRef);\n\n return (\n <FocusContext.Provider value={{scopeRef, focusManager}}>\n <span data-focus-scope-start hidden ref={startRef} />\n {children}\n <span data-focus-scope-end hidden ref={endRef} />\n </FocusContext.Provider>\n );\n}\n\n/**\n * Returns a FocusManager interface for the parent FocusScope.\n * A FocusManager can be used to programmatically move focus within\n * a FocusScope, e.g. in response to user events like keyboard navigation.\n */\nexport function useFocusManager(): FocusManager {\n return useContext(FocusContext)?.focusManager;\n}\n\nfunction createFocusManagerForScope(scopeRef: React.RefObject<HTMLElement[]>): FocusManager {\n return {\n focusNext(opts: FocusManagerOptions = {}) {\n let scope = scopeRef.current;\n let {from, tabbable, wrap, accept} = opts;\n let node = from || document.activeElement;\n let sentinel = scope[0].previousElementSibling;\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable, accept}, scope);\n walker.currentNode = isElementInScope(node, scope) ? node : sentinel;\n let nextNode = walker.nextNode() as HTMLElement;\n if (!nextNode && wrap) {\n walker.currentNode = sentinel;\n nextNode = walker.nextNode() as HTMLElement;\n }\n if (nextNode) {\n focusElement(nextNode, true);\n }\n return nextNode;\n },\n focusPrevious(opts: FocusManagerOptions = {}) {\n let scope = scopeRef.current;\n let {from, tabbable, wrap, accept} = opts;\n let node = from || document.activeElement;\n let sentinel = scope[scope.length - 1].nextElementSibling;\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable, accept}, scope);\n walker.currentNode = isElementInScope(node, scope) ? node : sentinel;\n let previousNode = walker.previousNode() as HTMLElement;\n if (!previousNode && wrap) {\n walker.currentNode = sentinel;\n previousNode = walker.previousNode() as HTMLElement;\n }\n if (previousNode) {\n focusElement(previousNode, true);\n }\n return previousNode;\n },\n focusFirst(opts = {}) {\n let scope = scopeRef.current;\n let {tabbable, accept} = opts;\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable, accept}, scope);\n walker.currentNode = scope[0].previousElementSibling;\n let nextNode = walker.nextNode() as HTMLElement;\n if (nextNode) {\n focusElement(nextNode, true);\n }\n return nextNode;\n },\n focusLast(opts = {}) {\n let scope = scopeRef.current;\n let {tabbable, accept} = opts;\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable, accept}, scope);\n walker.currentNode = scope[scope.length - 1].nextElementSibling;\n let previousNode = walker.previousNode() as HTMLElement;\n if (previousNode) {\n focusElement(previousNode, true);\n }\n return previousNode;\n }\n };\n}\n\nconst focusableElements = [\n 'input:not([disabled]):not([type=hidden])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'button:not([disabled])',\n 'a[href]',\n 'area[href]',\n 'summary',\n 'iframe',\n 'object',\n 'embed',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]'\n];\n\nconst FOCUSABLE_ELEMENT_SELECTOR = focusableElements.join(':not([hidden]),') + ',[tabindex]:not([disabled]):not([hidden])';\n\nfocusableElements.push('[tabindex]:not([tabindex=\"-1\"]):not([disabled])');\nconst TABBABLE_ELEMENT_SELECTOR = focusableElements.join(':not([hidden]):not([tabindex=\"-1\"]),');\n\nfunction getScopeRoot(scope: HTMLElement[]) {\n return scope[0].parentElement;\n}\n\nfunction useFocusContainment(scopeRef: RefObject<HTMLElement[]>, contain: boolean) {\n let focusedNode = useRef<HTMLElement>();\n\n let raf = useRef(null);\n useLayoutEffect(() => {\n let scope = scopeRef.current;\n if (!contain) {\n // if contain was changed, then we should cancel any ongoing waits to pull focus back into containment\n if (raf.current) {\n cancelAnimationFrame(raf.current);\n raf.current = null;\n }\n return;\n }\n\n // Handle the Tab key to contain focus within the scope\n let onKeyDown = (e) => {\n if (e.key !== 'Tab' || e.altKey || e.ctrlKey || e.metaKey || scopeRef !== activeScope) {\n return;\n }\n\n let focusedElement = document.activeElement as HTMLElement;\n let scope = scopeRef.current;\n if (!isElementInScope(focusedElement, scope)) {\n return;\n }\n\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable: true}, scope);\n walker.currentNode = focusedElement;\n let nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as HTMLElement;\n if (!nextElement) {\n walker.currentNode = e.shiftKey ? scope[scope.length - 1].nextElementSibling : scope[0].previousElementSibling;\n nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as HTMLElement;\n }\n\n e.preventDefault();\n if (nextElement) {\n focusElement(nextElement, true);\n }\n };\n\n let onFocus = (e) => {\n // If focusing an element in a child scope of the currently active scope, the child becomes active.\n // Moving out of the active scope to an ancestor is not allowed.\n if (!activeScope || isAncestorScope(activeScope, scopeRef)) {\n activeScope = scopeRef;\n focusedNode.current = e.target;\n } else if (scopeRef === activeScope && !isElementInChildScope(e.target, scopeRef)) {\n // If a focus event occurs outside the active scope (e.g. user tabs from browser location bar),\n // restore focus to the previously focused node or the first tabbable element in the active scope.\n if (focusedNode.current) {\n focusedNode.current.focus();\n } else if (activeScope) {\n focusFirstInScope(activeScope.current);\n }\n } else if (scopeRef === activeScope) {\n focusedNode.current = e.target;\n }\n };\n\n let onBlur = (e) => {\n // Firefox doesn't shift focus back to the Dialog properly without this\n raf.current = requestAnimationFrame(() => {\n // Use document.activeElement instead of e.relatedTarget so we can tell if user clicked into iframe\n if (scopeRef === activeScope && !isElementInChildScope(document.activeElement, scopeRef)) {\n activeScope = scopeRef;\n focusedNode.current = e.target;\n focusedNode.current.focus();\n }\n });\n };\n\n document.addEventListener('keydown', onKeyDown, false);\n document.addEventListener('focusin', onFocus, false);\n scope.forEach(element => element.addEventListener('focusin', onFocus, false));\n scope.forEach(element => element.addEventListener('focusout', onBlur, false));\n return () => {\n document.removeEventListener('keydown', onKeyDown, false);\n document.removeEventListener('focusin', onFocus, false);\n scope.forEach(element => element.removeEventListener('focusin', onFocus, false));\n scope.forEach(element => element.removeEventListener('focusout', onBlur, false));\n };\n }, [scopeRef, contain]);\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n return () => {\n if (raf.current) {\n cancelAnimationFrame(raf.current);\n }\n };\n }, [raf]);\n}\n\nfunction isElementInAnyScope(element: Element) {\n for (let scope of scopes.keys()) {\n if (isElementInScope(element, scope.current)) {\n return true;\n }\n }\n return false;\n}\n\nfunction isElementInScope(element: Element, scope: HTMLElement[]) {\n return scope.some(node => node.contains(element));\n}\n\nfunction isElementInChildScope(element: Element, scope: ScopeRef) {\n // node.contains in isElementInScope covers child scopes that are also DOM children,\n // but does not cover child scopes in portals.\n for (let s of scopes.keys()) {\n if ((s === scope || isAncestorScope(scope, s)) && isElementInScope(element, s.current)) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction isAncestorScope(ancestor: ScopeRef, scope: ScopeRef) {\n let parent = scopes.get(scope);\n if (!parent) {\n return false;\n }\n\n if (parent === ancestor) {\n return true;\n }\n\n return isAncestorScope(ancestor, parent);\n}\n\nfunction focusElement(element: HTMLElement | null, scroll = false) {\n if (element != null && !scroll) {\n try {\n focusSafely(element);\n } catch (err) {\n // ignore\n }\n } else if (element != null) {\n try {\n element.focus();\n } catch (err) {\n // ignore\n }\n }\n}\n\nfunction focusFirstInScope(scope: HTMLElement[]) {\n let sentinel = scope[0].previousElementSibling;\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable: true}, scope);\n walker.currentNode = sentinel;\n focusElement(walker.nextNode() as HTMLElement);\n}\n\nfunction useAutoFocus(scopeRef: RefObject<HTMLElement[]>, autoFocus: boolean) {\n const autoFocusRef = React.useRef(autoFocus);\n useEffect(() => {\n if (autoFocusRef.current) {\n activeScope = scopeRef;\n if (!isElementInScope(document.activeElement, activeScope.current)) {\n focusFirstInScope(scopeRef.current);\n }\n }\n autoFocusRef.current = false;\n }, []);\n}\n\nfunction useRestoreFocus(scopeRef: RefObject<HTMLElement[]>, restoreFocus: boolean, contain: boolean) {\n // create a ref during render instead of useLayoutEffect so the active element is saved before a child with autoFocus=true mounts.\n const nodeToRestoreRef = useRef(typeof document !== 'undefined' ? document.activeElement as HTMLElement : null);\n\n // useLayoutEffect instead of useEffect so the active element is saved synchronously instead of asynchronously.\n useLayoutEffect(() => {\n let nodeToRestore = nodeToRestoreRef.current;\n if (!restoreFocus) {\n return;\n }\n\n // Handle the Tab key so that tabbing out of the scope goes to the next element\n // after the node that had focus when the scope mounted. This is important when\n // using portals for overlays, so that focus goes to the expected element when\n // tabbing out of the overlay.\n let onKeyDown = (e: KeyboardEvent) => {\n if (e.key !== 'Tab' || e.altKey || e.ctrlKey || e.metaKey) {\n return;\n }\n\n let focusedElement = document.activeElement as HTMLElement;\n if (!isElementInScope(focusedElement, scopeRef.current)) {\n return;\n }\n\n // Create a DOM tree walker that matches all tabbable elements\n let walker = getFocusableTreeWalker(document.body, {tabbable: true});\n\n // Find the next tabbable element after the currently focused element\n walker.currentNode = focusedElement;\n let nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as HTMLElement;\n\n if (!document.body.contains(nodeToRestore) || nodeToRestore === document.body) {\n nodeToRestore = null;\n }\n\n // If there is no next element, or it is outside the current scope, move focus to the\n // next element after the node to restore to instead.\n if ((!nextElement || !isElementInScope(nextElement, scopeRef.current)) && nodeToRestore) {\n walker.currentNode = nodeToRestore;\n\n // Skip over elements within the scope, in case the scope immediately follows the node to restore.\n do {\n nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as HTMLElement;\n } while (isElementInScope(nextElement, scopeRef.current));\n\n e.preventDefault();\n e.stopPropagation();\n if (nextElement) {\n focusElement(nextElement, true);\n } else {\n // If there is no next element and the nodeToRestore isn't within a FocusScope (i.e. we are leaving the top level focus scope)\n // then move focus to the body.\n // Otherwise restore focus to the nodeToRestore (e.g menu within a popover -> tabbing to close the menu should move focus to menu trigger)\n if (!isElementInAnyScope(nodeToRestore)) {\n focusedElement.blur();\n } else {\n focusElement(nodeToRestore, true);\n }\n }\n }\n };\n\n if (!contain) {\n document.addEventListener('keydown', onKeyDown, true);\n }\n\n return () => {\n if (!contain) {\n document.removeEventListener('keydown', onKeyDown, true);\n }\n\n if (restoreFocus && nodeToRestore && isElementInScope(document.activeElement, scopeRef.current)) {\n requestAnimationFrame(() => {\n // Only restore focus if we've lost focus to the body, the alternative is that focus has been purposefully moved elsewhere\n if (document.body.contains(nodeToRestore) && document.activeElement === document.body) {\n focusElement(nodeToRestore);\n }\n });\n }\n };\n }, [scopeRef, restoreFocus, contain]);\n}\n\n/**\n * Create a [TreeWalker]{@link https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker}\n * that matches all focusable/tabbable elements.\n */\nexport function getFocusableTreeWalker(root: HTMLElement, opts?: FocusManagerOptions, scope?: HTMLElement[]) {\n let selector = opts?.tabbable ? TABBABLE_ELEMENT_SELECTOR : FOCUSABLE_ELEMENT_SELECTOR;\n let walker = document.createTreeWalker(\n root,\n NodeFilter.SHOW_ELEMENT,\n {\n acceptNode(node) {\n // Skip nodes inside the starting node.\n if (opts?.from?.contains(node)) {\n return NodeFilter.FILTER_REJECT;\n }\n\n if ((node as HTMLElement).matches(selector)\n && isElementVisible(node as HTMLElement)\n && (!scope || isElementInScope(node as HTMLElement, scope))\n && (!opts?.accept || opts.accept(node as Element))\n ) {\n return NodeFilter.FILTER_ACCEPT;\n }\n\n return NodeFilter.FILTER_SKIP;\n }\n }\n );\n\n if (opts?.from) {\n walker.currentNode = opts.from;\n }\n\n return walker;\n}\n\n/**\n * Creates a FocusManager object that can be used to move focus within an element.\n */\nexport function createFocusManager(ref: RefObject<HTMLElement>, defaultOptions: FocusManagerOptions = {}): FocusManager {\n return {\n focusNext(opts: FocusManagerOptions = {}) {\n let root = ref.current;\n if (!root) {\n return;\n }\n let {from, tabbable = defaultOptions.tabbable, wrap = defaultOptions.wrap, accept = defaultOptions.accept} = opts;\n let node = from || document.activeElement;\n let walker = getFocusableTreeWalker(root, {tabbable, accept});\n if (root.contains(node)) {\n walker.currentNode = node;\n }\n let nextNode = walker.nextNode() as HTMLElement;\n if (!nextNode && wrap) {\n walker.currentNode = root;\n nextNode = walker.nextNode() as HTMLElement;\n }\n if (nextNode) {\n focusElement(nextNode, true);\n }\n return nextNode;\n },\n focusPrevious(opts: FocusManagerOptions = defaultOptions) {\n let root = ref.current;\n if (!root) {\n return;\n }\n let {from, tabbable = defaultOptions.tabbable, wrap = defaultOptions.wrap, accept = defaultOptions.accept} = opts;\n let node = from || document.activeElement;\n let walker = getFocusableTreeWalker(root, {tabbable, accept});\n if (root.contains(node)) {\n walker.currentNode = node;\n } else {\n let next = last(walker);\n if (next) {\n focusElement(next, true);\n }\n return next;\n }\n let previousNode = walker.previousNode() as HTMLElement;\n if (!previousNode && wrap) {\n walker.currentNode = root;\n previousNode = last(walker);\n }\n if (previousNode) {\n focusElement(previousNode, true);\n }\n return previousNode;\n },\n focusFirst(opts = defaultOptions) {\n let root = ref.current;\n if (!root) {\n return;\n }\n let {tabbable = defaultOptions.tabbable, accept = defaultOptions.accept} = opts;\n let walker = getFocusableTreeWalker(root, {tabbable, accept});\n let nextNode = walker.nextNode() as HTMLElement;\n if (nextNode) {\n focusElement(nextNode, true);\n }\n return nextNode;\n },\n focusLast(opts = defaultOptions) {\n let root = ref.current;\n if (!root) {\n return;\n }\n let {tabbable = defaultOptions.tabbable, accept = defaultOptions.accept} = opts;\n let walker = getFocusableTreeWalker(root, {tabbable, accept});\n let next = last(walker);\n if (next) {\n focusElement(next, true);\n }\n return next;\n }\n };\n}\n\nfunction last(walker: TreeWalker) {\n let next: HTMLElement;\n let last: HTMLElement;\n do {\n last = walker.lastChild() as HTMLElement;\n if (last) {\n next = last;\n }\n } while (last);\n return next;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the 'License');\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {focusWithoutScrolling, runAfterTransition} from '@react-aria/utils';\nimport {getInteractionModality} from '@react-aria/interactions';\n\n/**\n * A utility function that focuses an element while avoiding undesired side effects such\n * as page scrolling and screen reader issues with CSS transitions.\n */\nexport function focusSafely(element: HTMLElement) {\n // If the user is interacting with a virtual cursor, e.g. screen reader, then\n // wait until after any animated transitions that are currently occurring on\n // the page before shifting focus. This avoids issues with VoiceOver on iOS\n // causing the page to scroll when moving focus if the element is transitioning\n // from off the screen.\n if (getInteractionModality() === 'virtual') {\n let lastFocusedElement = document.activeElement;\n runAfterTransition(() => {\n // If focus did not move and the element is still in the document, focus it.\n if (document.activeElement === lastFocusedElement && document.contains(element)) {\n focusWithoutScrolling(element);\n }\n });\n } else {\n focusWithoutScrolling(element);\n }\n}\n","/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nfunction isStyleVisible(element: Element) {\n if (!(element instanceof HTMLElement) && !(element instanceof SVGElement)) {\n return false;\n }\n\n let {display, visibility} = element.style;\n\n let isVisible = (\n display !== 'none' &&\n visibility !== 'hidden' &&\n visibility !== 'collapse'\n );\n\n if (isVisible) {\n const {getComputedStyle} = element.ownerDocument.defaultView;\n let {display: computedDisplay, visibility: computedVisibility} = getComputedStyle(element);\n\n isVisible = (\n computedDisplay !== 'none' &&\n computedVisibility !== 'hidden' &&\n computedVisibility !== 'collapse'\n );\n }\n\n return isVisible;\n}\n\nfunction isAttributeVisible(element: Element, childElement?: Element) {\n return (\n !element.hasAttribute('hidden') &&\n (element.nodeName === 'DETAILS' &&\n childElement &&\n childElement.nodeName !== 'SUMMARY'\n ? element.hasAttribute('open')\n : true)\n );\n}\n\n/**\n * Adapted from https://github.com/testing-library/jest-dom and \n * https://github.com/vuejs/vue-test-utils-next/.\n * Licensed under the MIT License.\n * @param element - Element to evaluate for display or visibility.\n */ \nexport function isElementVisible(element: Element, childElement?: Element) {\n return (\n element.nodeName !== '#comment' &&\n isStyleVisible(element) &&\n isAttributeVisible(element, childElement) &&\n (!element.parentElement || isElementVisible(element.parentElement, element))\n );\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport clsx from 'clsx';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {ReactElement} from 'react';\nimport {useFocusRing} from './useFocusRing';\n\ninterface FocusRingProps {\n /** Child element to apply CSS classes to. */\n children: ReactElement,\n /** CSS class to apply when the element is focused. */\n focusClass?: string,\n /** CSS class to apply when the element has keyboard focus. */\n focusRingClass?: string,\n /**\n * Whether to show the focus ring when something\n * inside the container element has focus (true), or\n * only if the container itself has focus (false).\n * @default false\n */\n within?: boolean,\n /** Whether the element is a text input. */\n isTextInput?: boolean,\n /** Whether the element will be auto focused. */\n autoFocus?: boolean\n}\n\n/**\n * A utility component that applies a CSS class when an element has keyboard focus.\n * Focus rings are visible only when the user is interacting with a keyboard,\n * not with a mouse, touch, or other input methods.\n */\nexport function FocusRing(props: FocusRingProps) {\n let {children, focusClass, focusRingClass} = props;\n let {isFocused, isFocusVisible, focusProps} = useFocusRing(props);\n let child = React.Children.only(children);\n\n return React.cloneElement(child, mergeProps(child.props, {\n ...focusProps,\n className: clsx({\n [focusClass || '']: isFocused,\n [focusRingClass || '']: isFocusVisible\n })\n }));\n}\n","import {HTMLAttributes, useCallback, useState} from 'react';\nimport {isFocusVisible, useFocus, useFocusVisibleListener, useFocusWithin} from '@react-aria/interactions';\nimport {useRef} from 'react';\n\ninterface FocusRingProps {\n /**\n * Whether to show the focus ring when something\n * inside the container element has focus (true), or\n * only if the container itself has focus (false).\n * @default 'false'\n */\n within?: boolean,\n\n /** Whether the element is a text input. */\n isTextInput?: boolean,\n\n /** Whether the element will be auto focused. */\n autoFocus?: boolean\n}\n\ninterface FocusRingAria {\n /** Whether the element is currently focused. */\n isFocused: boolean,\n\n /** Whether keyboard focus should be visible. */\n isFocusVisible: boolean,\n\n /** Props to apply to the container element with the focus ring. */\n focusProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Determines whether a focus ring should be shown to indicate keyboard focus.\n * Focus rings are visible only when the user is interacting with a keyboard,\n * not with a mouse, touch, or other input methods.\n */\nexport function useFocusRing(props: FocusRingProps = {}): FocusRingAria {\n let {\n autoFocus = false,\n isTextInput,\n within\n } = props;\n let state = useRef({\n isFocused: false,\n isFocusVisible: autoFocus || isFocusVisible()\n });\n let [isFocused, setFocused] = useState(false);\n let [isFocusVisibleState, setFocusVisible] = useState(() => state.current.isFocused && state.current.isFocusVisible);\n\n let updateState = useCallback(() => setFocusVisible(state.current.isFocused && state.current.isFocusVisible), []);\n\n let onFocusChange = useCallback(isFocused => {\n state.current.isFocused = isFocused;\n setFocused(isFocused);\n updateState();\n }, [updateState]);\n\n useFocusVisibleListener((isFocusVisible) => {\n state.current.isFocusVisible = isFocusVisible;\n updateState();\n }, [], {isTextInput});\n\n let {focusProps} = useFocus({\n isDisabled: within,\n onFocusChange\n });\n\n let {focusWithinProps} = useFocusWithin({\n isDisabled: !within,\n onFocusWithinChange: onFocusChange\n });\n\n return {\n isFocused,\n isFocusVisible: state.current.isFocused && isFocusVisibleState,\n focusProps: within ? focusWithinProps : focusProps\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {FocusableDOMProps, FocusableProps} from '@react-types/shared';\nimport {focusSafely} from './';\nimport {mergeProps, useSyncRef} from '@react-aria/utils';\nimport React, {HTMLAttributes, MutableRefObject, ReactNode, RefObject, useContext, useEffect, useRef} from 'react';\nimport {useFocus, useKeyboard} from '@react-aria/interactions';\n\ninterface FocusableOptions extends FocusableProps, FocusableDOMProps {\n /** Whether focus should be disabled. */\n isDisabled?: boolean\n}\n\ninterface FocusableProviderProps extends HTMLAttributes<HTMLElement> {\n /** The child element to provide DOM props to. */\n children?: ReactNode\n}\n\ninterface FocusableContextValue extends FocusableProviderProps {\n ref?: MutableRefObject<HTMLElement>\n}\n\nlet FocusableContext = React.createContext<FocusableContextValue>(null);\n\nfunction useFocusableContext(ref: RefObject<HTMLElement>): FocusableContextValue {\n let context = useContext(FocusableContext) || {};\n useSyncRef(context, ref);\n\n // eslint-disable-next-line\n let {ref: _, ...otherProps} = context;\n return otherProps;\n}\n\n/**\n * Provides DOM props to the nearest focusable child.\n */\nfunction FocusableProvider(props: FocusableProviderProps, ref: RefObject<HTMLElement>) {\n let {children, ...otherProps} = props;\n let context = {\n ...otherProps,\n ref\n };\n\n return (\n <FocusableContext.Provider value={context}>\n {children}\n </FocusableContext.Provider>\n );\n}\n\nlet _FocusableProvider = React.forwardRef(FocusableProvider);\nexport {_FocusableProvider as FocusableProvider};\n\ninterface FocusableAria {\n /** Props for the focusable element. */\n focusableProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Used to make an element focusable and capable of auto focus.\n */\nexport function useFocusable(props: FocusableOptions, domRef: RefObject<HTMLElement>): FocusableAria {\n let {focusProps} = useFocus(props);\n let {keyboardProps} = useKeyboard(props);\n let interactions = mergeProps(focusProps, keyboardProps);\n let domProps = useFocusableContext(domRef);\n let interactionProps = props.isDisabled ? {} : domProps;\n let autoFocusRef = useRef(props.autoFocus);\n\n useEffect(() => {\n if (autoFocusRef.current && domRef.current) {\n focusSafely(domRef.current);\n }\n autoFocusRef.current = false;\n }, [domRef]);\n\n return {\n focusableProps: mergeProps(\n {\n ...interactions,\n tabIndex: props.excludeFromTabOrder && !props.isDisabled ? -1 : undefined\n },\n interactionProps\n )\n };\n}\n"],"names":[],"version":3,"file":"main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;SEoBgB,yCAAW,CAAC,OAAyB,EAAE,CAAC;IACtD,EAA6E,AAA7E,2EAA6E;IAC7E,EAA4E,AA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N,cAAc,EAAE,gCAAU,CACxB,CAAC;eACI,YAAY;YACf,QAAQ,EAAE,KAAK,CAAC,mBAAmB,KAAK,KAAK,CAAC,UAAU,GAAG,EAAE,GAAG,SAAS;QAC3E,CAAC,EACD,gBAAgB;IAEpB,CAAC;AACH,CAAC;","sources":["packages/@react-aria/focus/src/index.ts","packages/@react-aria/focus/src/FocusScope.tsx","packages/@react-aria/focus/src/focusSafely.ts","packages/@react-aria/focus/src/isElementVisible.ts","packages/@react-aria/focus/src/FocusRing.tsx","packages/@react-aria/focus/src/useFocusRing.ts","packages/@react-aria/focus/src/useFocusable.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport type {FocusManager} from './FocusScope';\nexport {FocusScope, useFocusManager, getFocusableTreeWalker, createFocusManager} from './FocusScope';\nexport {FocusRing} from './FocusRing';\nexport {FocusableProvider, useFocusable} from './useFocusable';\nexport {useFocusRing} from './useFocusRing';\nexport {focusSafely} from './focusSafely';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {FocusableElement} from '@react-types/shared';\nimport {focusSafely} from './focusSafely';\nimport {isElementVisible} from './isElementVisible';\nimport React, {ReactNode, RefObject, useContext, useEffect, useRef} from 'react';\nimport {useLayoutEffect} from '@react-aria/utils';\n\n// import {FocusScope, useFocusScope} from 'react-events/focus-scope';\n// export {FocusScope};\n\ninterface FocusScopeProps {\n /** The contents of the focus scope. */\n children: ReactNode,\n\n /**\n * Whether to contain focus inside the scope, so users cannot\n * move focus outside, for example in a modal dialog.\n */\n contain?: boolean,\n\n /**\n * Whether to restore focus back to the element that was focused\n * when the focus scope mounted, after the focus scope unmounts.\n */\n restoreFocus?: boolean,\n\n /** Whether to auto focus the first focusable element in the focus scope on mount. */\n autoFocus?: boolean\n}\n\ninterface FocusManagerOptions {\n /** The element to start searching from. The currently focused element by default. */\n from?: Element,\n /** Whether to only include tabbable elements, or all focusable elements. */\n tabbable?: boolean,\n /** Whether focus should wrap around when it reaches the end of the scope. */\n wrap?: boolean,\n /** A callback that determines whether the given element is focused. */\n accept?: (node: Element) => boolean\n}\n\nexport interface FocusManager {\n /** Moves focus to the next focusable or tabbable element in the focus scope. */\n focusNext(opts?: FocusManagerOptions): FocusableElement,\n /** Moves focus to the previous focusable or tabbable element in the focus scope. */\n focusPrevious(opts?: FocusManagerOptions): FocusableElement,\n /** Moves focus to the first focusable or tabbable element in the focus scope. */\n focusFirst(opts?: FocusManagerOptions): FocusableElement,\n /** Moves focus to the last focusable or tabbable element in the focus scope. */\n focusLast(opts?: FocusManagerOptions): FocusableElement\n}\n\ntype ScopeRef = RefObject<Element[]>;\ninterface IFocusContext {\n scopeRef: ScopeRef,\n focusManager: FocusManager\n}\n\nconst FocusContext = React.createContext<IFocusContext>(null);\n\nlet activeScope: ScopeRef = null;\nlet scopes: Map<ScopeRef, ScopeRef | null> = new Map();\n\n// This is a hacky DOM-based implementation of a FocusScope until this RFC lands in React:\n// https://github.com/reactjs/rfcs/pull/109\n// For now, it relies on the DOM tree order rather than the React tree order, and is probably\n// less optimized for performance.\n\n/**\n * A FocusScope manages focus for its descendants. It supports containing focus inside\n * the scope, restoring focus to the previously focused element on unmount, and auto\n * focusing children on mount. It also acts as a container for a programmatic focus\n * management interface that can be used to move focus forward and back in response\n * to user events.\n */\nexport function FocusScope(props: FocusScopeProps) {\n let {children, contain, restoreFocus, autoFocus} = props;\n let startRef = useRef<HTMLSpanElement>();\n let endRef = useRef<HTMLSpanElement>();\n let scopeRef = useRef<Element[]>([]);\n let ctx = useContext(FocusContext);\n let parentScope = ctx?.scopeRef;\n\n useLayoutEffect(() => {\n // Find all rendered nodes between the sentinels and add them to the scope.\n let node = startRef.current.nextSibling;\n let nodes = [];\n while (node && node !== endRef.current) {\n nodes.push(node);\n node = node.nextSibling;\n }\n\n scopeRef.current = nodes;\n }, [children, parentScope]);\n\n useLayoutEffect(() => {\n scopes.set(scopeRef, parentScope);\n return () => {\n // Restore the active scope on unmount if this scope or a descendant scope is active.\n // Parent effect cleanups run before children, so we need to check if the\n // parent scope actually still exists before restoring the active scope to it.\n if (\n (scopeRef === activeScope || isAncestorScope(scopeRef, activeScope)) &&\n (!parentScope || scopes.has(parentScope))\n ) {\n activeScope = parentScope;\n }\n scopes.delete(scopeRef);\n };\n }, [scopeRef, parentScope]);\n\n useFocusContainment(scopeRef, contain);\n useRestoreFocus(scopeRef, restoreFocus, contain);\n useAutoFocus(scopeRef, autoFocus);\n\n let focusManager = createFocusManagerForScope(scopeRef);\n\n return (\n <FocusContext.Provider value={{scopeRef, focusManager}}>\n <span data-focus-scope-start hidden ref={startRef} />\n {children}\n <span data-focus-scope-end hidden ref={endRef} />\n </FocusContext.Provider>\n );\n}\n\n/**\n * Returns a FocusManager interface for the parent FocusScope.\n * A FocusManager can be used to programmatically move focus within\n * a FocusScope, e.g. in response to user events like keyboard navigation.\n */\nexport function useFocusManager(): FocusManager {\n return useContext(FocusContext)?.focusManager;\n}\n\nfunction createFocusManagerForScope(scopeRef: React.RefObject<Element[]>): FocusManager {\n return {\n focusNext(opts: FocusManagerOptions = {}) {\n let scope = scopeRef.current;\n let {from, tabbable, wrap, accept} = opts;\n let node = from || document.activeElement;\n let sentinel = scope[0].previousElementSibling;\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable, accept}, scope);\n walker.currentNode = isElementInScope(node, scope) ? node : sentinel;\n let nextNode = walker.nextNode() as FocusableElement;\n if (!nextNode && wrap) {\n walker.currentNode = sentinel;\n nextNode = walker.nextNode() as FocusableElement;\n }\n if (nextNode) {\n focusElement(nextNode, true);\n }\n return nextNode;\n },\n focusPrevious(opts: FocusManagerOptions = {}) {\n let scope = scopeRef.current;\n let {from, tabbable, wrap, accept} = opts;\n let node = from || document.activeElement;\n let sentinel = scope[scope.length - 1].nextElementSibling;\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable, accept}, scope);\n walker.currentNode = isElementInScope(node, scope) ? node : sentinel;\n let previousNode = walker.previousNode() as FocusableElement;\n if (!previousNode && wrap) {\n walker.currentNode = sentinel;\n previousNode = walker.previousNode() as FocusableElement;\n }\n if (previousNode) {\n focusElement(previousNode, true);\n }\n return previousNode;\n },\n focusFirst(opts = {}) {\n let scope = scopeRef.current;\n let {tabbable, accept} = opts;\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable, accept}, scope);\n walker.currentNode = scope[0].previousElementSibling;\n let nextNode = walker.nextNode() as FocusableElement;\n if (nextNode) {\n focusElement(nextNode, true);\n }\n return nextNode;\n },\n focusLast(opts = {}) {\n let scope = scopeRef.current;\n let {tabbable, accept} = opts;\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable, accept}, scope);\n walker.currentNode = scope[scope.length - 1].nextElementSibling;\n let previousNode = walker.previousNode() as FocusableElement;\n if (previousNode) {\n focusElement(previousNode, true);\n }\n return previousNode;\n }\n };\n}\n\nconst focusableElements = [\n 'input:not([disabled]):not([type=hidden])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'button:not([disabled])',\n 'a[href]',\n 'area[href]',\n 'summary',\n 'iframe',\n 'object',\n 'embed',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]'\n];\n\nconst FOCUSABLE_ELEMENT_SELECTOR = focusableElements.join(':not([hidden]),') + ',[tabindex]:not([disabled]):not([hidden])';\n\nfocusableElements.push('[tabindex]:not([tabindex=\"-1\"]):not([disabled])');\nconst TABBABLE_ELEMENT_SELECTOR = focusableElements.join(':not([hidden]):not([tabindex=\"-1\"]),');\n\nfunction getScopeRoot(scope: Element[]) {\n return scope[0].parentElement;\n}\n\nfunction useFocusContainment(scopeRef: RefObject<Element[]>, contain: boolean) {\n let focusedNode = useRef<FocusableElement>();\n\n let raf = useRef(null);\n useLayoutEffect(() => {\n let scope = scopeRef.current;\n if (!contain) {\n // if contain was changed, then we should cancel any ongoing waits to pull focus back into containment\n if (raf.current) {\n cancelAnimationFrame(raf.current);\n raf.current = null;\n }\n return;\n }\n\n // Handle the Tab key to contain focus within the scope\n let onKeyDown = (e) => {\n if (e.key !== 'Tab' || e.altKey || e.ctrlKey || e.metaKey || scopeRef !== activeScope) {\n return;\n }\n\n let focusedElement = document.activeElement;\n let scope = scopeRef.current;\n if (!isElementInScope(focusedElement, scope)) {\n return;\n }\n\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable: true}, scope);\n walker.currentNode = focusedElement;\n let nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as FocusableElement;\n if (!nextElement) {\n walker.currentNode = e.shiftKey ? scope[scope.length - 1].nextElementSibling : scope[0].previousElementSibling;\n nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as FocusableElement;\n }\n\n e.preventDefault();\n if (nextElement) {\n focusElement(nextElement, true);\n }\n };\n\n let onFocus = (e) => {\n // If focusing an element in a child scope of the currently active scope, the child becomes active.\n // Moving out of the active scope to an ancestor is not allowed.\n if (!activeScope || isAncestorScope(activeScope, scopeRef)) {\n activeScope = scopeRef;\n focusedNode.current = e.target;\n } else if (scopeRef === activeScope && !isElementInChildScope(e.target, scopeRef)) {\n // If a focus event occurs outside the active scope (e.g. user tabs from browser location bar),\n // restore focus to the previously focused node or the first tabbable element in the active scope.\n if (focusedNode.current) {\n focusedNode.current.focus();\n } else if (activeScope) {\n focusFirstInScope(activeScope.current);\n }\n } else if (scopeRef === activeScope) {\n focusedNode.current = e.target;\n }\n };\n\n let onBlur = (e) => {\n // Firefox doesn't shift focus back to the Dialog properly without this\n raf.current = requestAnimationFrame(() => {\n // Use document.activeElement instead of e.relatedTarget so we can tell if user clicked into iframe\n if (scopeRef === activeScope && !isElementInChildScope(document.activeElement, scopeRef)) {\n activeScope = scopeRef;\n focusedNode.current = e.target;\n focusedNode.current.focus();\n }\n });\n };\n\n document.addEventListener('keydown', onKeyDown, false);\n document.addEventListener('focusin', onFocus, false);\n scope.forEach(element => element.addEventListener('focusin', onFocus, false));\n scope.forEach(element => element.addEventListener('focusout', onBlur, false));\n return () => {\n document.removeEventListener('keydown', onKeyDown, false);\n document.removeEventListener('focusin', onFocus, false);\n scope.forEach(element => element.removeEventListener('focusin', onFocus, false));\n scope.forEach(element => element.removeEventListener('focusout', onBlur, false));\n };\n }, [scopeRef, contain]);\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n return () => {\n if (raf.current) {\n cancelAnimationFrame(raf.current);\n }\n };\n }, [raf]);\n}\n\nfunction isElementInAnyScope(element: Element) {\n for (let scope of scopes.keys()) {\n if (isElementInScope(element, scope.current)) {\n return true;\n }\n }\n return false;\n}\n\nfunction isElementInScope(element: Element, scope: Element[]) {\n return scope.some(node => node.contains(element));\n}\n\nfunction isElementInChildScope(element: Element, scope: ScopeRef) {\n // node.contains in isElementInScope covers child scopes that are also DOM children,\n // but does not cover child scopes in portals.\n for (let s of scopes.keys()) {\n if ((s === scope || isAncestorScope(scope, s)) && isElementInScope(element, s.current)) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction isAncestorScope(ancestor: ScopeRef, scope: ScopeRef) {\n let parent = scopes.get(scope);\n if (!parent) {\n return false;\n }\n\n if (parent === ancestor) {\n return true;\n }\n\n return isAncestorScope(ancestor, parent);\n}\n\nfunction focusElement(element: FocusableElement | null, scroll = false) {\n if (element != null && !scroll) {\n try {\n focusSafely(element);\n } catch (err) {\n // ignore\n }\n } else if (element != null) {\n try {\n element.focus();\n } catch (err) {\n // ignore\n }\n }\n}\n\nfunction focusFirstInScope(scope: Element[]) {\n let sentinel = scope[0].previousElementSibling;\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable: true}, scope);\n walker.currentNode = sentinel;\n focusElement(walker.nextNode() as FocusableElement);\n}\n\nfunction useAutoFocus(scopeRef: RefObject<Element[]>, autoFocus: boolean) {\n const autoFocusRef = React.useRef(autoFocus);\n useEffect(() => {\n if (autoFocusRef.current) {\n activeScope = scopeRef;\n if (!isElementInScope(document.activeElement, activeScope.current)) {\n focusFirstInScope(scopeRef.current);\n }\n }\n autoFocusRef.current = false;\n }, []);\n}\n\nfunction useRestoreFocus(scopeRef: RefObject<Element[]>, restoreFocus: boolean, contain: boolean) {\n // create a ref during render instead of useLayoutEffect so the active element is saved before a child with autoFocus=true mounts.\n const nodeToRestoreRef = useRef(typeof document !== 'undefined' ? document.activeElement as FocusableElement : null);\n\n // useLayoutEffect instead of useEffect so the active element is saved synchronously instead of asynchronously.\n useLayoutEffect(() => {\n let nodeToRestore = nodeToRestoreRef.current;\n if (!restoreFocus) {\n return;\n }\n\n // Handle the Tab key so that tabbing out of the scope goes to the next element\n // after the node that had focus when the scope mounted. This is important when\n // using portals for overlays, so that focus goes to the expected element when\n // tabbing out of the overlay.\n let onKeyDown = (e: KeyboardEvent) => {\n if (e.key !== 'Tab' || e.altKey || e.ctrlKey || e.metaKey) {\n return;\n }\n\n let focusedElement = document.activeElement as FocusableElement;\n if (!isElementInScope(focusedElement, scopeRef.current)) {\n return;\n }\n\n // Create a DOM tree walker that matches all tabbable elements\n let walker = getFocusableTreeWalker(document.body, {tabbable: true});\n\n // Find the next tabbable element after the currently focused element\n walker.currentNode = focusedElement;\n let nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as FocusableElement;\n\n if (!document.body.contains(nodeToRestore) || nodeToRestore === document.body) {\n nodeToRestore = null;\n }\n\n // If there is no next element, or it is outside the current scope, move focus to the\n // next element after the node to restore to instead.\n if ((!nextElement || !isElementInScope(nextElement, scopeRef.current)) && nodeToRestore) {\n walker.currentNode = nodeToRestore;\n\n // Skip over elements within the scope, in case the scope immediately follows the node to restore.\n do {\n nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as FocusableElement;\n } while (isElementInScope(nextElement, scopeRef.current));\n\n e.preventDefault();\n e.stopPropagation();\n if (nextElement) {\n focusElement(nextElement, true);\n } else {\n // If there is no next element and the nodeToRestore isn't within a FocusScope (i.e. we are leaving the top level focus scope)\n // then move focus to the body.\n // Otherwise restore focus to the nodeToRestore (e.g menu within a popover -> tabbing to close the menu should move focus to menu trigger)\n if (!isElementInAnyScope(nodeToRestore)) {\n focusedElement.blur();\n } else {\n focusElement(nodeToRestore, true);\n }\n }\n }\n };\n\n if (!contain) {\n document.addEventListener('keydown', onKeyDown, true);\n }\n\n return () => {\n if (!contain) {\n document.removeEventListener('keydown', onKeyDown, true);\n }\n\n if (restoreFocus && nodeToRestore && isElementInScope(document.activeElement, scopeRef.current)) {\n requestAnimationFrame(() => {\n // Only restore focus if we've lost focus to the body, the alternative is that focus has been purposefully moved elsewhere\n if (document.body.contains(nodeToRestore) && document.activeElement === document.body) {\n focusElement(nodeToRestore);\n }\n });\n }\n };\n }, [scopeRef, restoreFocus, contain]);\n}\n\n/**\n * Create a [TreeWalker]{@link https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker}\n * that matches all focusable/tabbable elements.\n */\nexport function getFocusableTreeWalker(root: Element, opts?: FocusManagerOptions, scope?: Element[]) {\n let selector = opts?.tabbable ? TABBABLE_ELEMENT_SELECTOR : FOCUSABLE_ELEMENT_SELECTOR;\n let walker = document.createTreeWalker(\n root,\n NodeFilter.SHOW_ELEMENT,\n {\n acceptNode(node) {\n // Skip nodes inside the starting node.\n if (opts?.from?.contains(node)) {\n return NodeFilter.FILTER_REJECT;\n }\n\n if ((node as Element).matches(selector)\n && isElementVisible(node as Element)\n && (!scope || isElementInScope(node as Element, scope))\n && (!opts?.accept || opts.accept(node as Element))\n ) {\n return NodeFilter.FILTER_ACCEPT;\n }\n\n return NodeFilter.FILTER_SKIP;\n }\n }\n );\n\n if (opts?.from) {\n walker.currentNode = opts.from;\n }\n\n return walker;\n}\n\n/**\n * Creates a FocusManager object that can be used to move focus within an element.\n */\nexport function createFocusManager(ref: RefObject<Element>, defaultOptions: FocusManagerOptions = {}): FocusManager {\n return {\n focusNext(opts: FocusManagerOptions = {}) {\n let root = ref.current;\n if (!root) {\n return;\n }\n let {from, tabbable = defaultOptions.tabbable, wrap = defaultOptions.wrap, accept = defaultOptions.accept} = opts;\n let node = from || document.activeElement;\n let walker = getFocusableTreeWalker(root, {tabbable, accept});\n if (root.contains(node)) {\n walker.currentNode = node;\n }\n let nextNode = walker.nextNode() as FocusableElement;\n if (!nextNode && wrap) {\n walker.currentNode = root;\n nextNode = walker.nextNode() as FocusableElement;\n }\n if (nextNode) {\n focusElement(nextNode, true);\n }\n return nextNode;\n },\n focusPrevious(opts: FocusManagerOptions = defaultOptions) {\n let root = ref.current;\n if (!root) {\n return;\n }\n let {from, tabbable = defaultOptions.tabbable, wrap = defaultOptions.wrap, accept = defaultOptions.accept} = opts;\n let node = from || document.activeElement;\n let walker = getFocusableTreeWalker(root, {tabbable, accept});\n if (root.contains(node)) {\n walker.currentNode = node;\n } else {\n let next = last(walker);\n if (next) {\n focusElement(next, true);\n }\n return next;\n }\n let previousNode = walker.previousNode() as FocusableElement;\n if (!previousNode && wrap) {\n walker.currentNode = root;\n previousNode = last(walker);\n }\n if (previousNode) {\n focusElement(previousNode, true);\n }\n return previousNode;\n },\n focusFirst(opts = defaultOptions) {\n let root = ref.current;\n if (!root) {\n return;\n }\n let {tabbable = defaultOptions.tabbable, accept = defaultOptions.accept} = opts;\n let walker = getFocusableTreeWalker(root, {tabbable, accept});\n let nextNode = walker.nextNode() as FocusableElement;\n if (nextNode) {\n focusElement(nextNode, true);\n }\n return nextNode;\n },\n focusLast(opts = defaultOptions) {\n let root = ref.current;\n if (!root) {\n return;\n }\n let {tabbable = defaultOptions.tabbable, accept = defaultOptions.accept} = opts;\n let walker = getFocusableTreeWalker(root, {tabbable, accept});\n let next = last(walker);\n if (next) {\n focusElement(next, true);\n }\n return next;\n }\n };\n}\n\nfunction last(walker: TreeWalker) {\n let next: FocusableElement;\n let last: FocusableElement;\n do {\n last = walker.lastChild() as FocusableElement;\n if (last) {\n next = last;\n }\n } while (last);\n return next;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the 'License');\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {FocusableElement} from '@react-types/shared';\nimport {focusWithoutScrolling, runAfterTransition} from '@react-aria/utils';\nimport {getInteractionModality} from '@react-aria/interactions';\n\n/**\n * A utility function that focuses an element while avoiding undesired side effects such\n * as page scrolling and screen reader issues with CSS transitions.\n */\nexport function focusSafely(element: FocusableElement) {\n // If the user is interacting with a virtual cursor, e.g. screen reader, then\n // wait until after any animated transitions that are currently occurring on\n // the page before shifting focus. This avoids issues with VoiceOver on iOS\n // causing the page to scroll when moving focus if the element is transitioning\n // from off the screen.\n if (getInteractionModality() === 'virtual') {\n let lastFocusedElement = document.activeElement;\n runAfterTransition(() => {\n // If focus did not move and the element is still in the document, focus it.\n if (document.activeElement === lastFocusedElement && document.contains(element)) {\n focusWithoutScrolling(element);\n }\n });\n } else {\n focusWithoutScrolling(element);\n }\n}\n","/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nfunction isStyleVisible(element: Element) {\n if (!(element instanceof HTMLElement) && !(element instanceof SVGElement)) {\n return false;\n }\n\n let {display, visibility} = element.style;\n\n let isVisible = (\n display !== 'none' &&\n visibility !== 'hidden' &&\n visibility !== 'collapse'\n );\n\n if (isVisible) {\n const {getComputedStyle} = element.ownerDocument.defaultView;\n let {display: computedDisplay, visibility: computedVisibility} = getComputedStyle(element);\n\n isVisible = (\n computedDisplay !== 'none' &&\n computedVisibility !== 'hidden' &&\n computedVisibility !== 'collapse'\n );\n }\n\n return isVisible;\n}\n\nfunction isAttributeVisible(element: Element, childElement?: Element) {\n return (\n !element.hasAttribute('hidden') &&\n (element.nodeName === 'DETAILS' &&\n childElement &&\n childElement.nodeName !== 'SUMMARY'\n ? element.hasAttribute('open')\n : true)\n );\n}\n\n/**\n * Adapted from https://github.com/testing-library/jest-dom and \n * https://github.com/vuejs/vue-test-utils-next/.\n * Licensed under the MIT License.\n * @param element - Element to evaluate for display or visibility.\n */ \nexport function isElementVisible(element: Element, childElement?: Element) {\n return (\n element.nodeName !== '#comment' &&\n isStyleVisible(element) &&\n isAttributeVisible(element, childElement) &&\n (!element.parentElement || isElementVisible(element.parentElement, element))\n );\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport clsx from 'clsx';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {ReactElement} from 'react';\nimport {useFocusRing} from './useFocusRing';\n\ninterface FocusRingProps {\n /** Child element to apply CSS classes to. */\n children: ReactElement,\n /** CSS class to apply when the element is focused. */\n focusClass?: string,\n /** CSS class to apply when the element has keyboard focus. */\n focusRingClass?: string,\n /**\n * Whether to show the focus ring when something\n * inside the container element has focus (true), or\n * only if the container itself has focus (false).\n * @default false\n */\n within?: boolean,\n /** Whether the element is a text input. */\n isTextInput?: boolean,\n /** Whether the element will be auto focused. */\n autoFocus?: boolean\n}\n\n/**\n * A utility component that applies a CSS class when an element has keyboard focus.\n * Focus rings are visible only when the user is interacting with a keyboard,\n * not with a mouse, touch, or other input methods.\n */\nexport function FocusRing(props: FocusRingProps) {\n let {children, focusClass, focusRingClass} = props;\n let {isFocused, isFocusVisible, focusProps} = useFocusRing(props);\n let child = React.Children.only(children);\n\n return React.cloneElement(child, mergeProps(child.props, {\n ...focusProps,\n className: clsx({\n [focusClass || '']: isFocused,\n [focusRingClass || '']: isFocusVisible\n })\n }));\n}\n","import {DOMAttributes} from '@react-types/shared';\nimport {isFocusVisible, useFocus, useFocusVisibleListener, useFocusWithin} from '@react-aria/interactions';\nimport {useCallback, useState} from 'react';\nimport {useRef} from 'react';\n\ninterface FocusRingProps {\n /**\n * Whether to show the focus ring when something\n * inside the container element has focus (true), or\n * only if the container itself has focus (false).\n * @default 'false'\n */\n within?: boolean,\n\n /** Whether the element is a text input. */\n isTextInput?: boolean,\n\n /** Whether the element will be auto focused. */\n autoFocus?: boolean\n}\n\ninterface FocusRingAria {\n /** Whether the element is currently focused. */\n isFocused: boolean,\n\n /** Whether keyboard focus should be visible. */\n isFocusVisible: boolean,\n\n /** Props to apply to the container element with the focus ring. */\n focusProps: DOMAttributes\n}\n\n/**\n * Determines whether a focus ring should be shown to indicate keyboard focus.\n * Focus rings are visible only when the user is interacting with a keyboard,\n * not with a mouse, touch, or other input methods.\n */\nexport function useFocusRing(props: FocusRingProps = {}): FocusRingAria {\n let {\n autoFocus = false,\n isTextInput,\n within\n } = props;\n let state = useRef({\n isFocused: false,\n isFocusVisible: autoFocus || isFocusVisible()\n });\n let [isFocused, setFocused] = useState(false);\n let [isFocusVisibleState, setFocusVisible] = useState(() => state.current.isFocused && state.current.isFocusVisible);\n\n let updateState = useCallback(() => setFocusVisible(state.current.isFocused && state.current.isFocusVisible), []);\n\n let onFocusChange = useCallback(isFocused => {\n state.current.isFocused = isFocused;\n setFocused(isFocused);\n updateState();\n }, [updateState]);\n\n useFocusVisibleListener((isFocusVisible) => {\n state.current.isFocusVisible = isFocusVisible;\n updateState();\n }, [], {isTextInput});\n\n let {focusProps} = useFocus({\n isDisabled: within,\n onFocusChange\n });\n\n let {focusWithinProps} = useFocusWithin({\n isDisabled: !within,\n onFocusWithinChange: onFocusChange\n });\n\n return {\n isFocused,\n isFocusVisible: state.current.isFocused && isFocusVisibleState,\n focusProps: within ? focusWithinProps : focusProps\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes, FocusableDOMProps, FocusableElement, FocusableProps} from '@react-types/shared';\nimport {focusSafely} from './';\nimport {mergeProps, useSyncRef} from '@react-aria/utils';\nimport React, {MutableRefObject, ReactNode, RefObject, useContext, useEffect, useRef} from 'react';\nimport {useFocus, useKeyboard} from '@react-aria/interactions';\n\ninterface FocusableOptions extends FocusableProps, FocusableDOMProps {\n /** Whether focus should be disabled. */\n isDisabled?: boolean\n}\n\ninterface FocusableProviderProps extends DOMAttributes {\n /** The child element to provide DOM props to. */\n children?: ReactNode\n}\n\ninterface FocusableContextValue extends FocusableProviderProps {\n ref?: MutableRefObject<FocusableElement>\n}\n\nlet FocusableContext = React.createContext<FocusableContextValue>(null);\n\nfunction useFocusableContext(ref: RefObject<FocusableElement>): FocusableContextValue {\n let context = useContext(FocusableContext) || {};\n useSyncRef(context, ref);\n\n // eslint-disable-next-line\n let {ref: _, ...otherProps} = context;\n return otherProps;\n}\n\n/**\n * Provides DOM props to the nearest focusable child.\n */\nfunction FocusableProvider(props: FocusableProviderProps, ref: RefObject<FocusableElement>) {\n let {children, ...otherProps} = props;\n let context = {\n ...otherProps,\n ref\n };\n\n return (\n <FocusableContext.Provider value={context}>\n {children}\n </FocusableContext.Provider>\n );\n}\n\nlet _FocusableProvider = React.forwardRef(FocusableProvider);\nexport {_FocusableProvider as FocusableProvider};\n\ninterface FocusableAria {\n /** Props for the focusable element. */\n focusableProps: DOMAttributes\n}\n\n/**\n * Used to make an element focusable and capable of auto focus.\n */\nexport function useFocusable(props: FocusableOptions, domRef: RefObject<FocusableElement>): FocusableAria {\n let {focusProps} = useFocus(props);\n let {keyboardProps} = useKeyboard(props);\n let interactions = mergeProps(focusProps, keyboardProps);\n let domProps = useFocusableContext(domRef);\n let interactionProps = props.isDisabled ? {} : domProps;\n let autoFocusRef = useRef(props.autoFocus);\n\n useEffect(() => {\n if (autoFocusRef.current && domRef.current) {\n focusSafely(domRef.current);\n }\n autoFocusRef.current = false;\n }, [domRef]);\n\n return {\n focusableProps: mergeProps(\n {\n ...interactions,\n tabIndex: props.excludeFromTabOrder && !props.isDisabled ? -1 : undefined\n },\n interactionProps\n )\n };\n}\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -3,18 +3,6 @@ import {useLayoutEffect as $6nfFC$useLayoutEffect, runAfterTransition as $6nfFC$
|
|
|
3
3
|
import {getInteractionModality as $6nfFC$getInteractionModality, isFocusVisible as $6nfFC$isFocusVisible, useFocusVisibleListener as $6nfFC$useFocusVisibleListener, useFocus as $6nfFC$useFocus, useFocusWithin as $6nfFC$useFocusWithin, useKeyboard as $6nfFC$useKeyboard} from "@react-aria/interactions";
|
|
4
4
|
import $6nfFC$clsx from "clsx";
|
|
5
5
|
|
|
6
|
-
function $parcel$export(e, n, v, s) {
|
|
7
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
8
|
-
}
|
|
9
|
-
var $9bf71ea28793e738$exports = {};
|
|
10
|
-
|
|
11
|
-
$parcel$export($9bf71ea28793e738$exports, "FocusScope", () => $9bf71ea28793e738$export$20e40289641fbbb6);
|
|
12
|
-
$parcel$export($9bf71ea28793e738$exports, "useFocusManager", () => $9bf71ea28793e738$export$10c5169755ce7bd7);
|
|
13
|
-
$parcel$export($9bf71ea28793e738$exports, "getFocusableTreeWalker", () => $9bf71ea28793e738$export$2d6ec8fc375ceafa);
|
|
14
|
-
$parcel$export($9bf71ea28793e738$exports, "createFocusManager", () => $9bf71ea28793e738$export$c5251b9e124bf29);
|
|
15
|
-
var $6a99195332edec8b$exports = {};
|
|
16
|
-
|
|
17
|
-
$parcel$export($6a99195332edec8b$exports, "focusSafely", () => $6a99195332edec8b$export$80f3e147d781571c);
|
|
18
6
|
|
|
19
7
|
|
|
20
8
|
function $6a99195332edec8b$export$80f3e147d781571c(element) {
|
|
@@ -498,16 +486,10 @@ function $9bf71ea28793e738$var$last(walker) {
|
|
|
498
486
|
}
|
|
499
487
|
|
|
500
488
|
|
|
501
|
-
var $907718708eab68af$exports = {};
|
|
502
489
|
|
|
503
|
-
$parcel$export($907718708eab68af$exports, "FocusRing", () => $907718708eab68af$export$1a38b4ad7f578e1d);
|
|
504
490
|
|
|
505
491
|
|
|
506
492
|
|
|
507
|
-
var $f7dceffc5ad7768b$exports = {};
|
|
508
|
-
|
|
509
|
-
$parcel$export($f7dceffc5ad7768b$exports, "useFocusRing", () => $f7dceffc5ad7768b$export$4e328f61c538687f);
|
|
510
|
-
|
|
511
493
|
|
|
512
494
|
|
|
513
495
|
function $f7dceffc5ad7768b$export$4e328f61c538687f(props = {
|
|
@@ -565,10 +547,6 @@ function $907718708eab68af$export$1a38b4ad7f578e1d(props) {
|
|
|
565
547
|
}
|
|
566
548
|
|
|
567
549
|
|
|
568
|
-
var $e6afbd83fe6ebbd2$exports = {};
|
|
569
|
-
|
|
570
|
-
$parcel$export($e6afbd83fe6ebbd2$exports, "FocusableProvider", () => $e6afbd83fe6ebbd2$export$13f3202a3e5ddd5);
|
|
571
|
-
$parcel$export($e6afbd83fe6ebbd2$exports, "useFocusable", () => $e6afbd83fe6ebbd2$export$4c014de7c8940b4c);
|
|
572
550
|
|
|
573
551
|
|
|
574
552
|
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;SEmBgB,yCAAW,CAAC,OAAoB,EAAE,CAAC;IACjD,EAA6E,AAA7E,2EAA6E;IAC7E,EAA4E,AAA5E,0EAA4E;IAC5E,EAA2E,AAA3E,yEAA2E;IAC3E,EAA+E,AAA/E,6EAA+E;IAC/E,EAAuB,AAAvB,qBAAuB;IACvB,EAAE,EAAE,6BAAsB,OAAO,CAAS,UAAE,CAAC;QAC3C,GAAG,CAAC,kBAAkB,GAAG,QAAQ,CAAC,aAAa;QAC/C,yBAAkB,KAAO,CAAC;YACxB,EAA4E,AAA5E,0EAA4E;YAC5E,EAAE,EAAE,QAAQ,CAAC,aAAa,KAAK,kBAAkB,IAAI,QAAQ,CAAC,QAAQ,CAAC,OAAO,GAC5E,4BAAqB,CAAC,OAAO;QAEjC,CAAC;IACH,CAAC,MACC,4BAAqB,CAAC,OAAO;AAEjC,CAAC;;;ACpCD,EAUG,AAVH;;;;;;;;;;CAUG,AAVH,EAUG,UAEM,oCAAc,CAAC,OAAgB,EAAE,CAAC;IACzC,EAAE,IAAI,OAAO,YAAY,WAAW,OAAO,OAAO,YAAY,UAAU,GACtE,MAAM,CAAC,KAAK;IAGd,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AAC,GAAG,eAAQ,CAAC,KAAK;IACjC,GAAG,CAAC,CAAC,gBAAA,aAAa,EAAA,CAAC,GAAG,kBAAW,CAAC,KAAK;IACvC,GAAG,CAAC,YAAY,GAAG,iBAAU,CAAC,UAAU,EAAE,aAAa;IACvD,GAAG,CAAC,QAAQ,GAAG,yCAAmB,CAAC,MAAM;IACzC,GAAG,CAAC,gBAAgB,GAAG,KAAK,CAAC,UAAU,GAAG,CAAC;IAAA,CAAC,GAAG,QAAQ;IACvD,GAAG,CAAC,YAAY,GAAG,aAAM,CAAC,KAAK,CAAC,SAAS;IAEzC,gBAAS,KAAO,CAAC;QACf,EAAE,EAAE,YAAY,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,EACxC,yCAAW,CAAC,MAAM,CAAC,OAAO;QAE5B,YAAY,CAAC,OAAO,GAAG,KAAK;IAC9B,CAAC,EAAE,CAAC;QAAA,MAAM;IAAA,CAAC;IAEX,MAAM,CAAC,CAAC;QACN,cAAc,EAAE,iBAAU,CACxB,CAAC;eACI,YAAY;YACf,QAAQ,EAAE,KAAK,CAAC,mBAAmB,KAAK,KAAK,CAAC,UAAU,GAAG,EAAE,GAAG,SAAS;QAC3E,CAAC,EACD,gBAAgB;IAEpB,CAAC;AACH,CAAC;","sources":["packages/@react-aria/focus/src/index.ts","packages/@react-aria/focus/src/FocusScope.tsx","packages/@react-aria/focus/src/focusSafely.ts","packages/@react-aria/focus/src/isElementVisible.ts","packages/@react-aria/focus/src/FocusRing.tsx","packages/@react-aria/focus/src/useFocusRing.ts","packages/@react-aria/focus/src/useFocusable.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport * from './FocusScope';\nexport * from './FocusRing';\nexport * from './useFocusable';\nexport * from './useFocusRing';\nexport * from './focusSafely';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {focusSafely} from './focusSafely';\nimport {isElementVisible} from './isElementVisible';\nimport React, {ReactNode, RefObject, useContext, useEffect, useRef} from 'react';\nimport {useLayoutEffect} from '@react-aria/utils';\n\n// import {FocusScope, useFocusScope} from 'react-events/focus-scope';\n// export {FocusScope};\n\ninterface FocusScopeProps {\n /** The contents of the focus scope. */\n children: ReactNode,\n\n /**\n * Whether to contain focus inside the scope, so users cannot\n * move focus outside, for example in a modal dialog.\n */\n contain?: boolean,\n\n /**\n * Whether to restore focus back to the element that was focused\n * when the focus scope mounted, after the focus scope unmounts.\n */\n restoreFocus?: boolean,\n\n /** Whether to auto focus the first focusable element in the focus scope on mount. */\n autoFocus?: boolean\n}\n\ninterface FocusManagerOptions {\n /** The element to start searching from. The currently focused element by default. */\n from?: HTMLElement,\n /** Whether to only include tabbable elements, or all focusable elements. */\n tabbable?: boolean,\n /** Whether focus should wrap around when it reaches the end of the scope. */\n wrap?: boolean,\n /** A callback that determines whether the given element is focused. */\n accept?: (node: Element) => boolean\n}\n\nexport interface FocusManager {\n /** Moves focus to the next focusable or tabbable element in the focus scope. */\n focusNext(opts?: FocusManagerOptions): HTMLElement,\n /** Moves focus to the previous focusable or tabbable element in the focus scope. */\n focusPrevious(opts?: FocusManagerOptions): HTMLElement,\n /** Moves focus to the first focusable or tabbable element in the focus scope. */\n focusFirst(opts?: FocusManagerOptions): HTMLElement,\n /** Moves focus to the last focusable or tabbable element in the focus scope. */\n focusLast(opts?: FocusManagerOptions): HTMLElement\n}\n\ntype ScopeRef = RefObject<HTMLElement[]>;\ninterface IFocusContext {\n scopeRef: ScopeRef,\n focusManager: FocusManager\n}\n\nconst FocusContext = React.createContext<IFocusContext>(null);\n\nlet activeScope: ScopeRef = null;\nlet scopes: Map<ScopeRef, ScopeRef | null> = new Map();\n\n// This is a hacky DOM-based implementation of a FocusScope until this RFC lands in React:\n// https://github.com/reactjs/rfcs/pull/109\n// For now, it relies on the DOM tree order rather than the React tree order, and is probably\n// less optimized for performance.\n\n/**\n * A FocusScope manages focus for its descendants. It supports containing focus inside\n * the scope, restoring focus to the previously focused element on unmount, and auto\n * focusing children on mount. It also acts as a container for a programmatic focus\n * management interface that can be used to move focus forward and back in response\n * to user events.\n */\nexport function FocusScope(props: FocusScopeProps) {\n let {children, contain, restoreFocus, autoFocus} = props;\n let startRef = useRef<HTMLSpanElement>();\n let endRef = useRef<HTMLSpanElement>();\n let scopeRef = useRef<HTMLElement[]>([]);\n let ctx = useContext(FocusContext);\n let parentScope = ctx?.scopeRef;\n\n useLayoutEffect(() => {\n // Find all rendered nodes between the sentinels and add them to the scope.\n let node = startRef.current.nextSibling;\n let nodes = [];\n while (node && node !== endRef.current) {\n nodes.push(node);\n node = node.nextSibling;\n }\n\n scopeRef.current = nodes;\n }, [children, parentScope]);\n\n useLayoutEffect(() => {\n scopes.set(scopeRef, parentScope);\n return () => {\n // Restore the active scope on unmount if this scope or a descendant scope is active.\n // Parent effect cleanups run before children, so we need to check if the\n // parent scope actually still exists before restoring the active scope to it.\n if (\n (scopeRef === activeScope || isAncestorScope(scopeRef, activeScope)) &&\n (!parentScope || scopes.has(parentScope))\n ) {\n activeScope = parentScope;\n }\n scopes.delete(scopeRef);\n };\n }, [scopeRef, parentScope]);\n\n useFocusContainment(scopeRef, contain);\n useRestoreFocus(scopeRef, restoreFocus, contain);\n useAutoFocus(scopeRef, autoFocus);\n\n let focusManager = createFocusManagerForScope(scopeRef);\n\n return (\n <FocusContext.Provider value={{scopeRef, focusManager}}>\n <span data-focus-scope-start hidden ref={startRef} />\n {children}\n <span data-focus-scope-end hidden ref={endRef} />\n </FocusContext.Provider>\n );\n}\n\n/**\n * Returns a FocusManager interface for the parent FocusScope.\n * A FocusManager can be used to programmatically move focus within\n * a FocusScope, e.g. in response to user events like keyboard navigation.\n */\nexport function useFocusManager(): FocusManager {\n return useContext(FocusContext)?.focusManager;\n}\n\nfunction createFocusManagerForScope(scopeRef: React.RefObject<HTMLElement[]>): FocusManager {\n return {\n focusNext(opts: FocusManagerOptions = {}) {\n let scope = scopeRef.current;\n let {from, tabbable, wrap, accept} = opts;\n let node = from || document.activeElement;\n let sentinel = scope[0].previousElementSibling;\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable, accept}, scope);\n walker.currentNode = isElementInScope(node, scope) ? node : sentinel;\n let nextNode = walker.nextNode() as HTMLElement;\n if (!nextNode && wrap) {\n walker.currentNode = sentinel;\n nextNode = walker.nextNode() as HTMLElement;\n }\n if (nextNode) {\n focusElement(nextNode, true);\n }\n return nextNode;\n },\n focusPrevious(opts: FocusManagerOptions = {}) {\n let scope = scopeRef.current;\n let {from, tabbable, wrap, accept} = opts;\n let node = from || document.activeElement;\n let sentinel = scope[scope.length - 1].nextElementSibling;\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable, accept}, scope);\n walker.currentNode = isElementInScope(node, scope) ? node : sentinel;\n let previousNode = walker.previousNode() as HTMLElement;\n if (!previousNode && wrap) {\n walker.currentNode = sentinel;\n previousNode = walker.previousNode() as HTMLElement;\n }\n if (previousNode) {\n focusElement(previousNode, true);\n }\n return previousNode;\n },\n focusFirst(opts = {}) {\n let scope = scopeRef.current;\n let {tabbable, accept} = opts;\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable, accept}, scope);\n walker.currentNode = scope[0].previousElementSibling;\n let nextNode = walker.nextNode() as HTMLElement;\n if (nextNode) {\n focusElement(nextNode, true);\n }\n return nextNode;\n },\n focusLast(opts = {}) {\n let scope = scopeRef.current;\n let {tabbable, accept} = opts;\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable, accept}, scope);\n walker.currentNode = scope[scope.length - 1].nextElementSibling;\n let previousNode = walker.previousNode() as HTMLElement;\n if (previousNode) {\n focusElement(previousNode, true);\n }\n return previousNode;\n }\n };\n}\n\nconst focusableElements = [\n 'input:not([disabled]):not([type=hidden])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'button:not([disabled])',\n 'a[href]',\n 'area[href]',\n 'summary',\n 'iframe',\n 'object',\n 'embed',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]'\n];\n\nconst FOCUSABLE_ELEMENT_SELECTOR = focusableElements.join(':not([hidden]),') + ',[tabindex]:not([disabled]):not([hidden])';\n\nfocusableElements.push('[tabindex]:not([tabindex=\"-1\"]):not([disabled])');\nconst TABBABLE_ELEMENT_SELECTOR = focusableElements.join(':not([hidden]):not([tabindex=\"-1\"]),');\n\nfunction getScopeRoot(scope: HTMLElement[]) {\n return scope[0].parentElement;\n}\n\nfunction useFocusContainment(scopeRef: RefObject<HTMLElement[]>, contain: boolean) {\n let focusedNode = useRef<HTMLElement>();\n\n let raf = useRef(null);\n useLayoutEffect(() => {\n let scope = scopeRef.current;\n if (!contain) {\n // if contain was changed, then we should cancel any ongoing waits to pull focus back into containment\n if (raf.current) {\n cancelAnimationFrame(raf.current);\n raf.current = null;\n }\n return;\n }\n\n // Handle the Tab key to contain focus within the scope\n let onKeyDown = (e) => {\n if (e.key !== 'Tab' || e.altKey || e.ctrlKey || e.metaKey || scopeRef !== activeScope) {\n return;\n }\n\n let focusedElement = document.activeElement as HTMLElement;\n let scope = scopeRef.current;\n if (!isElementInScope(focusedElement, scope)) {\n return;\n }\n\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable: true}, scope);\n walker.currentNode = focusedElement;\n let nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as HTMLElement;\n if (!nextElement) {\n walker.currentNode = e.shiftKey ? scope[scope.length - 1].nextElementSibling : scope[0].previousElementSibling;\n nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as HTMLElement;\n }\n\n e.preventDefault();\n if (nextElement) {\n focusElement(nextElement, true);\n }\n };\n\n let onFocus = (e) => {\n // If focusing an element in a child scope of the currently active scope, the child becomes active.\n // Moving out of the active scope to an ancestor is not allowed.\n if (!activeScope || isAncestorScope(activeScope, scopeRef)) {\n activeScope = scopeRef;\n focusedNode.current = e.target;\n } else if (scopeRef === activeScope && !isElementInChildScope(e.target, scopeRef)) {\n // If a focus event occurs outside the active scope (e.g. user tabs from browser location bar),\n // restore focus to the previously focused node or the first tabbable element in the active scope.\n if (focusedNode.current) {\n focusedNode.current.focus();\n } else if (activeScope) {\n focusFirstInScope(activeScope.current);\n }\n } else if (scopeRef === activeScope) {\n focusedNode.current = e.target;\n }\n };\n\n let onBlur = (e) => {\n // Firefox doesn't shift focus back to the Dialog properly without this\n raf.current = requestAnimationFrame(() => {\n // Use document.activeElement instead of e.relatedTarget so we can tell if user clicked into iframe\n if (scopeRef === activeScope && !isElementInChildScope(document.activeElement, scopeRef)) {\n activeScope = scopeRef;\n focusedNode.current = e.target;\n focusedNode.current.focus();\n }\n });\n };\n\n document.addEventListener('keydown', onKeyDown, false);\n document.addEventListener('focusin', onFocus, false);\n scope.forEach(element => element.addEventListener('focusin', onFocus, false));\n scope.forEach(element => element.addEventListener('focusout', onBlur, false));\n return () => {\n document.removeEventListener('keydown', onKeyDown, false);\n document.removeEventListener('focusin', onFocus, false);\n scope.forEach(element => element.removeEventListener('focusin', onFocus, false));\n scope.forEach(element => element.removeEventListener('focusout', onBlur, false));\n };\n }, [scopeRef, contain]);\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n return () => {\n if (raf.current) {\n cancelAnimationFrame(raf.current);\n }\n };\n }, [raf]);\n}\n\nfunction isElementInAnyScope(element: Element) {\n for (let scope of scopes.keys()) {\n if (isElementInScope(element, scope.current)) {\n return true;\n }\n }\n return false;\n}\n\nfunction isElementInScope(element: Element, scope: HTMLElement[]) {\n return scope.some(node => node.contains(element));\n}\n\nfunction isElementInChildScope(element: Element, scope: ScopeRef) {\n // node.contains in isElementInScope covers child scopes that are also DOM children,\n // but does not cover child scopes in portals.\n for (let s of scopes.keys()) {\n if ((s === scope || isAncestorScope(scope, s)) && isElementInScope(element, s.current)) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction isAncestorScope(ancestor: ScopeRef, scope: ScopeRef) {\n let parent = scopes.get(scope);\n if (!parent) {\n return false;\n }\n\n if (parent === ancestor) {\n return true;\n }\n\n return isAncestorScope(ancestor, parent);\n}\n\nfunction focusElement(element: HTMLElement | null, scroll = false) {\n if (element != null && !scroll) {\n try {\n focusSafely(element);\n } catch (err) {\n // ignore\n }\n } else if (element != null) {\n try {\n element.focus();\n } catch (err) {\n // ignore\n }\n }\n}\n\nfunction focusFirstInScope(scope: HTMLElement[]) {\n let sentinel = scope[0].previousElementSibling;\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable: true}, scope);\n walker.currentNode = sentinel;\n focusElement(walker.nextNode() as HTMLElement);\n}\n\nfunction useAutoFocus(scopeRef: RefObject<HTMLElement[]>, autoFocus: boolean) {\n const autoFocusRef = React.useRef(autoFocus);\n useEffect(() => {\n if (autoFocusRef.current) {\n activeScope = scopeRef;\n if (!isElementInScope(document.activeElement, activeScope.current)) {\n focusFirstInScope(scopeRef.current);\n }\n }\n autoFocusRef.current = false;\n }, []);\n}\n\nfunction useRestoreFocus(scopeRef: RefObject<HTMLElement[]>, restoreFocus: boolean, contain: boolean) {\n // create a ref during render instead of useLayoutEffect so the active element is saved before a child with autoFocus=true mounts.\n const nodeToRestoreRef = useRef(typeof document !== 'undefined' ? document.activeElement as HTMLElement : null);\n\n // useLayoutEffect instead of useEffect so the active element is saved synchronously instead of asynchronously.\n useLayoutEffect(() => {\n let nodeToRestore = nodeToRestoreRef.current;\n if (!restoreFocus) {\n return;\n }\n\n // Handle the Tab key so that tabbing out of the scope goes to the next element\n // after the node that had focus when the scope mounted. This is important when\n // using portals for overlays, so that focus goes to the expected element when\n // tabbing out of the overlay.\n let onKeyDown = (e: KeyboardEvent) => {\n if (e.key !== 'Tab' || e.altKey || e.ctrlKey || e.metaKey) {\n return;\n }\n\n let focusedElement = document.activeElement as HTMLElement;\n if (!isElementInScope(focusedElement, scopeRef.current)) {\n return;\n }\n\n // Create a DOM tree walker that matches all tabbable elements\n let walker = getFocusableTreeWalker(document.body, {tabbable: true});\n\n // Find the next tabbable element after the currently focused element\n walker.currentNode = focusedElement;\n let nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as HTMLElement;\n\n if (!document.body.contains(nodeToRestore) || nodeToRestore === document.body) {\n nodeToRestore = null;\n }\n\n // If there is no next element, or it is outside the current scope, move focus to the\n // next element after the node to restore to instead.\n if ((!nextElement || !isElementInScope(nextElement, scopeRef.current)) && nodeToRestore) {\n walker.currentNode = nodeToRestore;\n\n // Skip over elements within the scope, in case the scope immediately follows the node to restore.\n do {\n nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as HTMLElement;\n } while (isElementInScope(nextElement, scopeRef.current));\n\n e.preventDefault();\n e.stopPropagation();\n if (nextElement) {\n focusElement(nextElement, true);\n } else {\n // If there is no next element and the nodeToRestore isn't within a FocusScope (i.e. we are leaving the top level focus scope)\n // then move focus to the body.\n // Otherwise restore focus to the nodeToRestore (e.g menu within a popover -> tabbing to close the menu should move focus to menu trigger)\n if (!isElementInAnyScope(nodeToRestore)) {\n focusedElement.blur();\n } else {\n focusElement(nodeToRestore, true);\n }\n }\n }\n };\n\n if (!contain) {\n document.addEventListener('keydown', onKeyDown, true);\n }\n\n return () => {\n if (!contain) {\n document.removeEventListener('keydown', onKeyDown, true);\n }\n\n if (restoreFocus && nodeToRestore && isElementInScope(document.activeElement, scopeRef.current)) {\n requestAnimationFrame(() => {\n // Only restore focus if we've lost focus to the body, the alternative is that focus has been purposefully moved elsewhere\n if (document.body.contains(nodeToRestore) && document.activeElement === document.body) {\n focusElement(nodeToRestore);\n }\n });\n }\n };\n }, [scopeRef, restoreFocus, contain]);\n}\n\n/**\n * Create a [TreeWalker]{@link https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker}\n * that matches all focusable/tabbable elements.\n */\nexport function getFocusableTreeWalker(root: HTMLElement, opts?: FocusManagerOptions, scope?: HTMLElement[]) {\n let selector = opts?.tabbable ? TABBABLE_ELEMENT_SELECTOR : FOCUSABLE_ELEMENT_SELECTOR;\n let walker = document.createTreeWalker(\n root,\n NodeFilter.SHOW_ELEMENT,\n {\n acceptNode(node) {\n // Skip nodes inside the starting node.\n if (opts?.from?.contains(node)) {\n return NodeFilter.FILTER_REJECT;\n }\n\n if ((node as HTMLElement).matches(selector)\n && isElementVisible(node as HTMLElement)\n && (!scope || isElementInScope(node as HTMLElement, scope))\n && (!opts?.accept || opts.accept(node as Element))\n ) {\n return NodeFilter.FILTER_ACCEPT;\n }\n\n return NodeFilter.FILTER_SKIP;\n }\n }\n );\n\n if (opts?.from) {\n walker.currentNode = opts.from;\n }\n\n return walker;\n}\n\n/**\n * Creates a FocusManager object that can be used to move focus within an element.\n */\nexport function createFocusManager(ref: RefObject<HTMLElement>, defaultOptions: FocusManagerOptions = {}): FocusManager {\n return {\n focusNext(opts: FocusManagerOptions = {}) {\n let root = ref.current;\n if (!root) {\n return;\n }\n let {from, tabbable = defaultOptions.tabbable, wrap = defaultOptions.wrap, accept = defaultOptions.accept} = opts;\n let node = from || document.activeElement;\n let walker = getFocusableTreeWalker(root, {tabbable, accept});\n if (root.contains(node)) {\n walker.currentNode = node;\n }\n let nextNode = walker.nextNode() as HTMLElement;\n if (!nextNode && wrap) {\n walker.currentNode = root;\n nextNode = walker.nextNode() as HTMLElement;\n }\n if (nextNode) {\n focusElement(nextNode, true);\n }\n return nextNode;\n },\n focusPrevious(opts: FocusManagerOptions = defaultOptions) {\n let root = ref.current;\n if (!root) {\n return;\n }\n let {from, tabbable = defaultOptions.tabbable, wrap = defaultOptions.wrap, accept = defaultOptions.accept} = opts;\n let node = from || document.activeElement;\n let walker = getFocusableTreeWalker(root, {tabbable, accept});\n if (root.contains(node)) {\n walker.currentNode = node;\n } else {\n let next = last(walker);\n if (next) {\n focusElement(next, true);\n }\n return next;\n }\n let previousNode = walker.previousNode() as HTMLElement;\n if (!previousNode && wrap) {\n walker.currentNode = root;\n previousNode = last(walker);\n }\n if (previousNode) {\n focusElement(previousNode, true);\n }\n return previousNode;\n },\n focusFirst(opts = defaultOptions) {\n let root = ref.current;\n if (!root) {\n return;\n }\n let {tabbable = defaultOptions.tabbable, accept = defaultOptions.accept} = opts;\n let walker = getFocusableTreeWalker(root, {tabbable, accept});\n let nextNode = walker.nextNode() as HTMLElement;\n if (nextNode) {\n focusElement(nextNode, true);\n }\n return nextNode;\n },\n focusLast(opts = defaultOptions) {\n let root = ref.current;\n if (!root) {\n return;\n }\n let {tabbable = defaultOptions.tabbable, accept = defaultOptions.accept} = opts;\n let walker = getFocusableTreeWalker(root, {tabbable, accept});\n let next = last(walker);\n if (next) {\n focusElement(next, true);\n }\n return next;\n }\n };\n}\n\nfunction last(walker: TreeWalker) {\n let next: HTMLElement;\n let last: HTMLElement;\n do {\n last = walker.lastChild() as HTMLElement;\n if (last) {\n next = last;\n }\n } while (last);\n return next;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the 'License');\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {focusWithoutScrolling, runAfterTransition} from '@react-aria/utils';\nimport {getInteractionModality} from '@react-aria/interactions';\n\n/**\n * A utility function that focuses an element while avoiding undesired side effects such\n * as page scrolling and screen reader issues with CSS transitions.\n */\nexport function focusSafely(element: HTMLElement) {\n // If the user is interacting with a virtual cursor, e.g. screen reader, then\n // wait until after any animated transitions that are currently occurring on\n // the page before shifting focus. This avoids issues with VoiceOver on iOS\n // causing the page to scroll when moving focus if the element is transitioning\n // from off the screen.\n if (getInteractionModality() === 'virtual') {\n let lastFocusedElement = document.activeElement;\n runAfterTransition(() => {\n // If focus did not move and the element is still in the document, focus it.\n if (document.activeElement === lastFocusedElement && document.contains(element)) {\n focusWithoutScrolling(element);\n }\n });\n } else {\n focusWithoutScrolling(element);\n }\n}\n","/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nfunction isStyleVisible(element: Element) {\n if (!(element instanceof HTMLElement) && !(element instanceof SVGElement)) {\n return false;\n }\n\n let {display, visibility} = element.style;\n\n let isVisible = (\n display !== 'none' &&\n visibility !== 'hidden' &&\n visibility !== 'collapse'\n );\n\n if (isVisible) {\n const {getComputedStyle} = element.ownerDocument.defaultView;\n let {display: computedDisplay, visibility: computedVisibility} = getComputedStyle(element);\n\n isVisible = (\n computedDisplay !== 'none' &&\n computedVisibility !== 'hidden' &&\n computedVisibility !== 'collapse'\n );\n }\n\n return isVisible;\n}\n\nfunction isAttributeVisible(element: Element, childElement?: Element) {\n return (\n !element.hasAttribute('hidden') &&\n (element.nodeName === 'DETAILS' &&\n childElement &&\n childElement.nodeName !== 'SUMMARY'\n ? element.hasAttribute('open')\n : true)\n );\n}\n\n/**\n * Adapted from https://github.com/testing-library/jest-dom and \n * https://github.com/vuejs/vue-test-utils-next/.\n * Licensed under the MIT License.\n * @param element - Element to evaluate for display or visibility.\n */ \nexport function isElementVisible(element: Element, childElement?: Element) {\n return (\n element.nodeName !== '#comment' &&\n isStyleVisible(element) &&\n isAttributeVisible(element, childElement) &&\n (!element.parentElement || isElementVisible(element.parentElement, element))\n );\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport clsx from 'clsx';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {ReactElement} from 'react';\nimport {useFocusRing} from './useFocusRing';\n\ninterface FocusRingProps {\n /** Child element to apply CSS classes to. */\n children: ReactElement,\n /** CSS class to apply when the element is focused. */\n focusClass?: string,\n /** CSS class to apply when the element has keyboard focus. */\n focusRingClass?: string,\n /**\n * Whether to show the focus ring when something\n * inside the container element has focus (true), or\n * only if the container itself has focus (false).\n * @default false\n */\n within?: boolean,\n /** Whether the element is a text input. */\n isTextInput?: boolean,\n /** Whether the element will be auto focused. */\n autoFocus?: boolean\n}\n\n/**\n * A utility component that applies a CSS class when an element has keyboard focus.\n * Focus rings are visible only when the user is interacting with a keyboard,\n * not with a mouse, touch, or other input methods.\n */\nexport function FocusRing(props: FocusRingProps) {\n let {children, focusClass, focusRingClass} = props;\n let {isFocused, isFocusVisible, focusProps} = useFocusRing(props);\n let child = React.Children.only(children);\n\n return React.cloneElement(child, mergeProps(child.props, {\n ...focusProps,\n className: clsx({\n [focusClass || '']: isFocused,\n [focusRingClass || '']: isFocusVisible\n })\n }));\n}\n","import {HTMLAttributes, useCallback, useState} from 'react';\nimport {isFocusVisible, useFocus, useFocusVisibleListener, useFocusWithin} from '@react-aria/interactions';\nimport {useRef} from 'react';\n\ninterface FocusRingProps {\n /**\n * Whether to show the focus ring when something\n * inside the container element has focus (true), or\n * only if the container itself has focus (false).\n * @default 'false'\n */\n within?: boolean,\n\n /** Whether the element is a text input. */\n isTextInput?: boolean,\n\n /** Whether the element will be auto focused. */\n autoFocus?: boolean\n}\n\ninterface FocusRingAria {\n /** Whether the element is currently focused. */\n isFocused: boolean,\n\n /** Whether keyboard focus should be visible. */\n isFocusVisible: boolean,\n\n /** Props to apply to the container element with the focus ring. */\n focusProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Determines whether a focus ring should be shown to indicate keyboard focus.\n * Focus rings are visible only when the user is interacting with a keyboard,\n * not with a mouse, touch, or other input methods.\n */\nexport function useFocusRing(props: FocusRingProps = {}): FocusRingAria {\n let {\n autoFocus = false,\n isTextInput,\n within\n } = props;\n let state = useRef({\n isFocused: false,\n isFocusVisible: autoFocus || isFocusVisible()\n });\n let [isFocused, setFocused] = useState(false);\n let [isFocusVisibleState, setFocusVisible] = useState(() => state.current.isFocused && state.current.isFocusVisible);\n\n let updateState = useCallback(() => setFocusVisible(state.current.isFocused && state.current.isFocusVisible), []);\n\n let onFocusChange = useCallback(isFocused => {\n state.current.isFocused = isFocused;\n setFocused(isFocused);\n updateState();\n }, [updateState]);\n\n useFocusVisibleListener((isFocusVisible) => {\n state.current.isFocusVisible = isFocusVisible;\n updateState();\n }, [], {isTextInput});\n\n let {focusProps} = useFocus({\n isDisabled: within,\n onFocusChange\n });\n\n let {focusWithinProps} = useFocusWithin({\n isDisabled: !within,\n onFocusWithinChange: onFocusChange\n });\n\n return {\n isFocused,\n isFocusVisible: state.current.isFocused && isFocusVisibleState,\n focusProps: within ? focusWithinProps : focusProps\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {FocusableDOMProps, FocusableProps} from '@react-types/shared';\nimport {focusSafely} from './';\nimport {mergeProps, useSyncRef} from '@react-aria/utils';\nimport React, {HTMLAttributes, MutableRefObject, ReactNode, RefObject, useContext, useEffect, useRef} from 'react';\nimport {useFocus, useKeyboard} from '@react-aria/interactions';\n\ninterface FocusableOptions extends FocusableProps, FocusableDOMProps {\n /** Whether focus should be disabled. */\n isDisabled?: boolean\n}\n\ninterface FocusableProviderProps extends HTMLAttributes<HTMLElement> {\n /** The child element to provide DOM props to. */\n children?: ReactNode\n}\n\ninterface FocusableContextValue extends FocusableProviderProps {\n ref?: MutableRefObject<HTMLElement>\n}\n\nlet FocusableContext = React.createContext<FocusableContextValue>(null);\n\nfunction useFocusableContext(ref: RefObject<HTMLElement>): FocusableContextValue {\n let context = useContext(FocusableContext) || {};\n useSyncRef(context, ref);\n\n // eslint-disable-next-line\n let {ref: _, ...otherProps} = context;\n return otherProps;\n}\n\n/**\n * Provides DOM props to the nearest focusable child.\n */\nfunction FocusableProvider(props: FocusableProviderProps, ref: RefObject<HTMLElement>) {\n let {children, ...otherProps} = props;\n let context = {\n ...otherProps,\n ref\n };\n\n return (\n <FocusableContext.Provider value={context}>\n {children}\n </FocusableContext.Provider>\n );\n}\n\nlet _FocusableProvider = React.forwardRef(FocusableProvider);\nexport {_FocusableProvider as FocusableProvider};\n\ninterface FocusableAria {\n /** Props for the focusable element. */\n focusableProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Used to make an element focusable and capable of auto focus.\n */\nexport function useFocusable(props: FocusableOptions, domRef: RefObject<HTMLElement>): FocusableAria {\n let {focusProps} = useFocus(props);\n let {keyboardProps} = useKeyboard(props);\n let interactions = mergeProps(focusProps, keyboardProps);\n let domProps = useFocusableContext(domRef);\n let interactionProps = props.isDisabled ? {} : domProps;\n let autoFocusRef = useRef(props.autoFocus);\n\n useEffect(() => {\n if (autoFocusRef.current && domRef.current) {\n focusSafely(domRef.current);\n }\n autoFocusRef.current = false;\n }, [domRef]);\n\n return {\n focusableProps: mergeProps(\n {\n ...interactions,\n tabIndex: props.excludeFromTabOrder && !props.isDisabled ? -1 : undefined\n },\n interactionProps\n )\n };\n}\n"],"names":[],"version":3,"file":"module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;SEoBgB,yCAAW,CAAC,OAAyB,EAAE,CAAC;IACtD,EAA6E,AAA7E,2EAA6E;IAC7E,EAA4E,AAA5E,0EAA4E;IAC5E,EAA2E,AAA3E,yEAA2E;IAC3E,EAA+E,AAA/E,6EAA+E;IAC/E,EAAuB,AAAvB,qBAAuB;IACvB,EAAE,EAAE,6BAAsB,OAAO,CAAS,UAAE,CAAC;QAC3C,GAAG,CAAC,kBAAkB,GAAG,QAAQ,CAAC,aAAa;QAC/C,yBAAkB,KAAO,CAAC;YACxB,EAA4E,AAA5E,0EAA4E;YAC5E,EAAE,EAAE,QAAQ,CAAC,aAAa,KAAK,kBAAkB,IAAI,QAAQ,CAAC,QAAQ,CAAC,OAAO,GAC5E,4BAAqB,CAAC,OAAO;QAEjC,CAAC;IACH,CAAC,MACC,4BAAqB,CAAC,OAAO;AAEjC,CAAC;;;ACrCD,EAUG,AAVH;;;;;;;;;;CAUG,AAVH,EAUG,UAEM,oCAAc,CAAC,OAAgB,EAAE,CAAC;IACzC,EAAE,IAAI,OAAO,YAAY,WAAW,OAAO,OAAO,YAAY,UAAU,GACtE,MAAM,CAAC,KAAK;IAGd,GAAG,CAAC,CAAC,UAAA,OAAO,eAAE,UAAU,EAAA,CAAC,GAAG,OAAO,CAAC,KAAK;IAEzC,GAAG,CAAC,SAAS,GACX,OAAO,KAAK,CAAM,SACl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,UAAU,EAAE,aAAa;IACvD,GAAG,CAAC,QAAQ,GAAG,yCAAmB,CAAC,MAAM;IACzC,GAAG,CAAC,gBAAgB,GAAG,KAAK,CAAC,UAAU,GAAG,CAAC;IAAA,CAAC,GAAG,QAAQ;IACvD,GAAG,CAAC,YAAY,GAAG,aAAM,CAAC,KAAK,CAAC,SAAS;IAEzC,gBAAS,KAAO,CAAC;QACf,EAAE,EAAE,YAAY,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,EACxC,yCAAW,CAAC,MAAM,CAAC,OAAO;QAE5B,YAAY,CAAC,OAAO,GAAG,KAAK;IAC9B,CAAC,EAAE,CAAC;QAAA,MAAM;IAAA,CAAC;IAEX,MAAM,CAAC,CAAC;QACN,cAAc,EAAE,iBAAU,CACxB,CAAC;eACI,YAAY;YACf,QAAQ,EAAE,KAAK,CAAC,mBAAmB,KAAK,KAAK,CAAC,UAAU,GAAG,EAAE,GAAG,SAAS;QAC3E,CAAC,EACD,gBAAgB;IAEpB,CAAC;AACH,CAAC;","sources":["packages/@react-aria/focus/src/index.ts","packages/@react-aria/focus/src/FocusScope.tsx","packages/@react-aria/focus/src/focusSafely.ts","packages/@react-aria/focus/src/isElementVisible.ts","packages/@react-aria/focus/src/FocusRing.tsx","packages/@react-aria/focus/src/useFocusRing.ts","packages/@react-aria/focus/src/useFocusable.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport type {FocusManager} from './FocusScope';\nexport {FocusScope, useFocusManager, getFocusableTreeWalker, createFocusManager} from './FocusScope';\nexport {FocusRing} from './FocusRing';\nexport {FocusableProvider, useFocusable} from './useFocusable';\nexport {useFocusRing} from './useFocusRing';\nexport {focusSafely} from './focusSafely';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {FocusableElement} from '@react-types/shared';\nimport {focusSafely} from './focusSafely';\nimport {isElementVisible} from './isElementVisible';\nimport React, {ReactNode, RefObject, useContext, useEffect, useRef} from 'react';\nimport {useLayoutEffect} from '@react-aria/utils';\n\n// import {FocusScope, useFocusScope} from 'react-events/focus-scope';\n// export {FocusScope};\n\ninterface FocusScopeProps {\n /** The contents of the focus scope. */\n children: ReactNode,\n\n /**\n * Whether to contain focus inside the scope, so users cannot\n * move focus outside, for example in a modal dialog.\n */\n contain?: boolean,\n\n /**\n * Whether to restore focus back to the element that was focused\n * when the focus scope mounted, after the focus scope unmounts.\n */\n restoreFocus?: boolean,\n\n /** Whether to auto focus the first focusable element in the focus scope on mount. */\n autoFocus?: boolean\n}\n\ninterface FocusManagerOptions {\n /** The element to start searching from. The currently focused element by default. */\n from?: Element,\n /** Whether to only include tabbable elements, or all focusable elements. */\n tabbable?: boolean,\n /** Whether focus should wrap around when it reaches the end of the scope. */\n wrap?: boolean,\n /** A callback that determines whether the given element is focused. */\n accept?: (node: Element) => boolean\n}\n\nexport interface FocusManager {\n /** Moves focus to the next focusable or tabbable element in the focus scope. */\n focusNext(opts?: FocusManagerOptions): FocusableElement,\n /** Moves focus to the previous focusable or tabbable element in the focus scope. */\n focusPrevious(opts?: FocusManagerOptions): FocusableElement,\n /** Moves focus to the first focusable or tabbable element in the focus scope. */\n focusFirst(opts?: FocusManagerOptions): FocusableElement,\n /** Moves focus to the last focusable or tabbable element in the focus scope. */\n focusLast(opts?: FocusManagerOptions): FocusableElement\n}\n\ntype ScopeRef = RefObject<Element[]>;\ninterface IFocusContext {\n scopeRef: ScopeRef,\n focusManager: FocusManager\n}\n\nconst FocusContext = React.createContext<IFocusContext>(null);\n\nlet activeScope: ScopeRef = null;\nlet scopes: Map<ScopeRef, ScopeRef | null> = new Map();\n\n// This is a hacky DOM-based implementation of a FocusScope until this RFC lands in React:\n// https://github.com/reactjs/rfcs/pull/109\n// For now, it relies on the DOM tree order rather than the React tree order, and is probably\n// less optimized for performance.\n\n/**\n * A FocusScope manages focus for its descendants. It supports containing focus inside\n * the scope, restoring focus to the previously focused element on unmount, and auto\n * focusing children on mount. It also acts as a container for a programmatic focus\n * management interface that can be used to move focus forward and back in response\n * to user events.\n */\nexport function FocusScope(props: FocusScopeProps) {\n let {children, contain, restoreFocus, autoFocus} = props;\n let startRef = useRef<HTMLSpanElement>();\n let endRef = useRef<HTMLSpanElement>();\n let scopeRef = useRef<Element[]>([]);\n let ctx = useContext(FocusContext);\n let parentScope = ctx?.scopeRef;\n\n useLayoutEffect(() => {\n // Find all rendered nodes between the sentinels and add them to the scope.\n let node = startRef.current.nextSibling;\n let nodes = [];\n while (node && node !== endRef.current) {\n nodes.push(node);\n node = node.nextSibling;\n }\n\n scopeRef.current = nodes;\n }, [children, parentScope]);\n\n useLayoutEffect(() => {\n scopes.set(scopeRef, parentScope);\n return () => {\n // Restore the active scope on unmount if this scope or a descendant scope is active.\n // Parent effect cleanups run before children, so we need to check if the\n // parent scope actually still exists before restoring the active scope to it.\n if (\n (scopeRef === activeScope || isAncestorScope(scopeRef, activeScope)) &&\n (!parentScope || scopes.has(parentScope))\n ) {\n activeScope = parentScope;\n }\n scopes.delete(scopeRef);\n };\n }, [scopeRef, parentScope]);\n\n useFocusContainment(scopeRef, contain);\n useRestoreFocus(scopeRef, restoreFocus, contain);\n useAutoFocus(scopeRef, autoFocus);\n\n let focusManager = createFocusManagerForScope(scopeRef);\n\n return (\n <FocusContext.Provider value={{scopeRef, focusManager}}>\n <span data-focus-scope-start hidden ref={startRef} />\n {children}\n <span data-focus-scope-end hidden ref={endRef} />\n </FocusContext.Provider>\n );\n}\n\n/**\n * Returns a FocusManager interface for the parent FocusScope.\n * A FocusManager can be used to programmatically move focus within\n * a FocusScope, e.g. in response to user events like keyboard navigation.\n */\nexport function useFocusManager(): FocusManager {\n return useContext(FocusContext)?.focusManager;\n}\n\nfunction createFocusManagerForScope(scopeRef: React.RefObject<Element[]>): FocusManager {\n return {\n focusNext(opts: FocusManagerOptions = {}) {\n let scope = scopeRef.current;\n let {from, tabbable, wrap, accept} = opts;\n let node = from || document.activeElement;\n let sentinel = scope[0].previousElementSibling;\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable, accept}, scope);\n walker.currentNode = isElementInScope(node, scope) ? node : sentinel;\n let nextNode = walker.nextNode() as FocusableElement;\n if (!nextNode && wrap) {\n walker.currentNode = sentinel;\n nextNode = walker.nextNode() as FocusableElement;\n }\n if (nextNode) {\n focusElement(nextNode, true);\n }\n return nextNode;\n },\n focusPrevious(opts: FocusManagerOptions = {}) {\n let scope = scopeRef.current;\n let {from, tabbable, wrap, accept} = opts;\n let node = from || document.activeElement;\n let sentinel = scope[scope.length - 1].nextElementSibling;\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable, accept}, scope);\n walker.currentNode = isElementInScope(node, scope) ? node : sentinel;\n let previousNode = walker.previousNode() as FocusableElement;\n if (!previousNode && wrap) {\n walker.currentNode = sentinel;\n previousNode = walker.previousNode() as FocusableElement;\n }\n if (previousNode) {\n focusElement(previousNode, true);\n }\n return previousNode;\n },\n focusFirst(opts = {}) {\n let scope = scopeRef.current;\n let {tabbable, accept} = opts;\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable, accept}, scope);\n walker.currentNode = scope[0].previousElementSibling;\n let nextNode = walker.nextNode() as FocusableElement;\n if (nextNode) {\n focusElement(nextNode, true);\n }\n return nextNode;\n },\n focusLast(opts = {}) {\n let scope = scopeRef.current;\n let {tabbable, accept} = opts;\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable, accept}, scope);\n walker.currentNode = scope[scope.length - 1].nextElementSibling;\n let previousNode = walker.previousNode() as FocusableElement;\n if (previousNode) {\n focusElement(previousNode, true);\n }\n return previousNode;\n }\n };\n}\n\nconst focusableElements = [\n 'input:not([disabled]):not([type=hidden])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'button:not([disabled])',\n 'a[href]',\n 'area[href]',\n 'summary',\n 'iframe',\n 'object',\n 'embed',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]'\n];\n\nconst FOCUSABLE_ELEMENT_SELECTOR = focusableElements.join(':not([hidden]),') + ',[tabindex]:not([disabled]):not([hidden])';\n\nfocusableElements.push('[tabindex]:not([tabindex=\"-1\"]):not([disabled])');\nconst TABBABLE_ELEMENT_SELECTOR = focusableElements.join(':not([hidden]):not([tabindex=\"-1\"]),');\n\nfunction getScopeRoot(scope: Element[]) {\n return scope[0].parentElement;\n}\n\nfunction useFocusContainment(scopeRef: RefObject<Element[]>, contain: boolean) {\n let focusedNode = useRef<FocusableElement>();\n\n let raf = useRef(null);\n useLayoutEffect(() => {\n let scope = scopeRef.current;\n if (!contain) {\n // if contain was changed, then we should cancel any ongoing waits to pull focus back into containment\n if (raf.current) {\n cancelAnimationFrame(raf.current);\n raf.current = null;\n }\n return;\n }\n\n // Handle the Tab key to contain focus within the scope\n let onKeyDown = (e) => {\n if (e.key !== 'Tab' || e.altKey || e.ctrlKey || e.metaKey || scopeRef !== activeScope) {\n return;\n }\n\n let focusedElement = document.activeElement;\n let scope = scopeRef.current;\n if (!isElementInScope(focusedElement, scope)) {\n return;\n }\n\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable: true}, scope);\n walker.currentNode = focusedElement;\n let nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as FocusableElement;\n if (!nextElement) {\n walker.currentNode = e.shiftKey ? scope[scope.length - 1].nextElementSibling : scope[0].previousElementSibling;\n nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as FocusableElement;\n }\n\n e.preventDefault();\n if (nextElement) {\n focusElement(nextElement, true);\n }\n };\n\n let onFocus = (e) => {\n // If focusing an element in a child scope of the currently active scope, the child becomes active.\n // Moving out of the active scope to an ancestor is not allowed.\n if (!activeScope || isAncestorScope(activeScope, scopeRef)) {\n activeScope = scopeRef;\n focusedNode.current = e.target;\n } else if (scopeRef === activeScope && !isElementInChildScope(e.target, scopeRef)) {\n // If a focus event occurs outside the active scope (e.g. user tabs from browser location bar),\n // restore focus to the previously focused node or the first tabbable element in the active scope.\n if (focusedNode.current) {\n focusedNode.current.focus();\n } else if (activeScope) {\n focusFirstInScope(activeScope.current);\n }\n } else if (scopeRef === activeScope) {\n focusedNode.current = e.target;\n }\n };\n\n let onBlur = (e) => {\n // Firefox doesn't shift focus back to the Dialog properly without this\n raf.current = requestAnimationFrame(() => {\n // Use document.activeElement instead of e.relatedTarget so we can tell if user clicked into iframe\n if (scopeRef === activeScope && !isElementInChildScope(document.activeElement, scopeRef)) {\n activeScope = scopeRef;\n focusedNode.current = e.target;\n focusedNode.current.focus();\n }\n });\n };\n\n document.addEventListener('keydown', onKeyDown, false);\n document.addEventListener('focusin', onFocus, false);\n scope.forEach(element => element.addEventListener('focusin', onFocus, false));\n scope.forEach(element => element.addEventListener('focusout', onBlur, false));\n return () => {\n document.removeEventListener('keydown', onKeyDown, false);\n document.removeEventListener('focusin', onFocus, false);\n scope.forEach(element => element.removeEventListener('focusin', onFocus, false));\n scope.forEach(element => element.removeEventListener('focusout', onBlur, false));\n };\n }, [scopeRef, contain]);\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n return () => {\n if (raf.current) {\n cancelAnimationFrame(raf.current);\n }\n };\n }, [raf]);\n}\n\nfunction isElementInAnyScope(element: Element) {\n for (let scope of scopes.keys()) {\n if (isElementInScope(element, scope.current)) {\n return true;\n }\n }\n return false;\n}\n\nfunction isElementInScope(element: Element, scope: Element[]) {\n return scope.some(node => node.contains(element));\n}\n\nfunction isElementInChildScope(element: Element, scope: ScopeRef) {\n // node.contains in isElementInScope covers child scopes that are also DOM children,\n // but does not cover child scopes in portals.\n for (let s of scopes.keys()) {\n if ((s === scope || isAncestorScope(scope, s)) && isElementInScope(element, s.current)) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction isAncestorScope(ancestor: ScopeRef, scope: ScopeRef) {\n let parent = scopes.get(scope);\n if (!parent) {\n return false;\n }\n\n if (parent === ancestor) {\n return true;\n }\n\n return isAncestorScope(ancestor, parent);\n}\n\nfunction focusElement(element: FocusableElement | null, scroll = false) {\n if (element != null && !scroll) {\n try {\n focusSafely(element);\n } catch (err) {\n // ignore\n }\n } else if (element != null) {\n try {\n element.focus();\n } catch (err) {\n // ignore\n }\n }\n}\n\nfunction focusFirstInScope(scope: Element[]) {\n let sentinel = scope[0].previousElementSibling;\n let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable: true}, scope);\n walker.currentNode = sentinel;\n focusElement(walker.nextNode() as FocusableElement);\n}\n\nfunction useAutoFocus(scopeRef: RefObject<Element[]>, autoFocus: boolean) {\n const autoFocusRef = React.useRef(autoFocus);\n useEffect(() => {\n if (autoFocusRef.current) {\n activeScope = scopeRef;\n if (!isElementInScope(document.activeElement, activeScope.current)) {\n focusFirstInScope(scopeRef.current);\n }\n }\n autoFocusRef.current = false;\n }, []);\n}\n\nfunction useRestoreFocus(scopeRef: RefObject<Element[]>, restoreFocus: boolean, contain: boolean) {\n // create a ref during render instead of useLayoutEffect so the active element is saved before a child with autoFocus=true mounts.\n const nodeToRestoreRef = useRef(typeof document !== 'undefined' ? document.activeElement as FocusableElement : null);\n\n // useLayoutEffect instead of useEffect so the active element is saved synchronously instead of asynchronously.\n useLayoutEffect(() => {\n let nodeToRestore = nodeToRestoreRef.current;\n if (!restoreFocus) {\n return;\n }\n\n // Handle the Tab key so that tabbing out of the scope goes to the next element\n // after the node that had focus when the scope mounted. This is important when\n // using portals for overlays, so that focus goes to the expected element when\n // tabbing out of the overlay.\n let onKeyDown = (e: KeyboardEvent) => {\n if (e.key !== 'Tab' || e.altKey || e.ctrlKey || e.metaKey) {\n return;\n }\n\n let focusedElement = document.activeElement as FocusableElement;\n if (!isElementInScope(focusedElement, scopeRef.current)) {\n return;\n }\n\n // Create a DOM tree walker that matches all tabbable elements\n let walker = getFocusableTreeWalker(document.body, {tabbable: true});\n\n // Find the next tabbable element after the currently focused element\n walker.currentNode = focusedElement;\n let nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as FocusableElement;\n\n if (!document.body.contains(nodeToRestore) || nodeToRestore === document.body) {\n nodeToRestore = null;\n }\n\n // If there is no next element, or it is outside the current scope, move focus to the\n // next element after the node to restore to instead.\n if ((!nextElement || !isElementInScope(nextElement, scopeRef.current)) && nodeToRestore) {\n walker.currentNode = nodeToRestore;\n\n // Skip over elements within the scope, in case the scope immediately follows the node to restore.\n do {\n nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as FocusableElement;\n } while (isElementInScope(nextElement, scopeRef.current));\n\n e.preventDefault();\n e.stopPropagation();\n if (nextElement) {\n focusElement(nextElement, true);\n } else {\n // If there is no next element and the nodeToRestore isn't within a FocusScope (i.e. we are leaving the top level focus scope)\n // then move focus to the body.\n // Otherwise restore focus to the nodeToRestore (e.g menu within a popover -> tabbing to close the menu should move focus to menu trigger)\n if (!isElementInAnyScope(nodeToRestore)) {\n focusedElement.blur();\n } else {\n focusElement(nodeToRestore, true);\n }\n }\n }\n };\n\n if (!contain) {\n document.addEventListener('keydown', onKeyDown, true);\n }\n\n return () => {\n if (!contain) {\n document.removeEventListener('keydown', onKeyDown, true);\n }\n\n if (restoreFocus && nodeToRestore && isElementInScope(document.activeElement, scopeRef.current)) {\n requestAnimationFrame(() => {\n // Only restore focus if we've lost focus to the body, the alternative is that focus has been purposefully moved elsewhere\n if (document.body.contains(nodeToRestore) && document.activeElement === document.body) {\n focusElement(nodeToRestore);\n }\n });\n }\n };\n }, [scopeRef, restoreFocus, contain]);\n}\n\n/**\n * Create a [TreeWalker]{@link https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker}\n * that matches all focusable/tabbable elements.\n */\nexport function getFocusableTreeWalker(root: Element, opts?: FocusManagerOptions, scope?: Element[]) {\n let selector = opts?.tabbable ? TABBABLE_ELEMENT_SELECTOR : FOCUSABLE_ELEMENT_SELECTOR;\n let walker = document.createTreeWalker(\n root,\n NodeFilter.SHOW_ELEMENT,\n {\n acceptNode(node) {\n // Skip nodes inside the starting node.\n if (opts?.from?.contains(node)) {\n return NodeFilter.FILTER_REJECT;\n }\n\n if ((node as Element).matches(selector)\n && isElementVisible(node as Element)\n && (!scope || isElementInScope(node as Element, scope))\n && (!opts?.accept || opts.accept(node as Element))\n ) {\n return NodeFilter.FILTER_ACCEPT;\n }\n\n return NodeFilter.FILTER_SKIP;\n }\n }\n );\n\n if (opts?.from) {\n walker.currentNode = opts.from;\n }\n\n return walker;\n}\n\n/**\n * Creates a FocusManager object that can be used to move focus within an element.\n */\nexport function createFocusManager(ref: RefObject<Element>, defaultOptions: FocusManagerOptions = {}): FocusManager {\n return {\n focusNext(opts: FocusManagerOptions = {}) {\n let root = ref.current;\n if (!root) {\n return;\n }\n let {from, tabbable = defaultOptions.tabbable, wrap = defaultOptions.wrap, accept = defaultOptions.accept} = opts;\n let node = from || document.activeElement;\n let walker = getFocusableTreeWalker(root, {tabbable, accept});\n if (root.contains(node)) {\n walker.currentNode = node;\n }\n let nextNode = walker.nextNode() as FocusableElement;\n if (!nextNode && wrap) {\n walker.currentNode = root;\n nextNode = walker.nextNode() as FocusableElement;\n }\n if (nextNode) {\n focusElement(nextNode, true);\n }\n return nextNode;\n },\n focusPrevious(opts: FocusManagerOptions = defaultOptions) {\n let root = ref.current;\n if (!root) {\n return;\n }\n let {from, tabbable = defaultOptions.tabbable, wrap = defaultOptions.wrap, accept = defaultOptions.accept} = opts;\n let node = from || document.activeElement;\n let walker = getFocusableTreeWalker(root, {tabbable, accept});\n if (root.contains(node)) {\n walker.currentNode = node;\n } else {\n let next = last(walker);\n if (next) {\n focusElement(next, true);\n }\n return next;\n }\n let previousNode = walker.previousNode() as FocusableElement;\n if (!previousNode && wrap) {\n walker.currentNode = root;\n previousNode = last(walker);\n }\n if (previousNode) {\n focusElement(previousNode, true);\n }\n return previousNode;\n },\n focusFirst(opts = defaultOptions) {\n let root = ref.current;\n if (!root) {\n return;\n }\n let {tabbable = defaultOptions.tabbable, accept = defaultOptions.accept} = opts;\n let walker = getFocusableTreeWalker(root, {tabbable, accept});\n let nextNode = walker.nextNode() as FocusableElement;\n if (nextNode) {\n focusElement(nextNode, true);\n }\n return nextNode;\n },\n focusLast(opts = defaultOptions) {\n let root = ref.current;\n if (!root) {\n return;\n }\n let {tabbable = defaultOptions.tabbable, accept = defaultOptions.accept} = opts;\n let walker = getFocusableTreeWalker(root, {tabbable, accept});\n let next = last(walker);\n if (next) {\n focusElement(next, true);\n }\n return next;\n }\n };\n}\n\nfunction last(walker: TreeWalker) {\n let next: FocusableElement;\n let last: FocusableElement;\n do {\n last = walker.lastChild() as FocusableElement;\n if (last) {\n next = last;\n }\n } while (last);\n return next;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the 'License');\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {FocusableElement} from '@react-types/shared';\nimport {focusWithoutScrolling, runAfterTransition} from '@react-aria/utils';\nimport {getInteractionModality} from '@react-aria/interactions';\n\n/**\n * A utility function that focuses an element while avoiding undesired side effects such\n * as page scrolling and screen reader issues with CSS transitions.\n */\nexport function focusSafely(element: FocusableElement) {\n // If the user is interacting with a virtual cursor, e.g. screen reader, then\n // wait until after any animated transitions that are currently occurring on\n // the page before shifting focus. This avoids issues with VoiceOver on iOS\n // causing the page to scroll when moving focus if the element is transitioning\n // from off the screen.\n if (getInteractionModality() === 'virtual') {\n let lastFocusedElement = document.activeElement;\n runAfterTransition(() => {\n // If focus did not move and the element is still in the document, focus it.\n if (document.activeElement === lastFocusedElement && document.contains(element)) {\n focusWithoutScrolling(element);\n }\n });\n } else {\n focusWithoutScrolling(element);\n }\n}\n","/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nfunction isStyleVisible(element: Element) {\n if (!(element instanceof HTMLElement) && !(element instanceof SVGElement)) {\n return false;\n }\n\n let {display, visibility} = element.style;\n\n let isVisible = (\n display !== 'none' &&\n visibility !== 'hidden' &&\n visibility !== 'collapse'\n );\n\n if (isVisible) {\n const {getComputedStyle} = element.ownerDocument.defaultView;\n let {display: computedDisplay, visibility: computedVisibility} = getComputedStyle(element);\n\n isVisible = (\n computedDisplay !== 'none' &&\n computedVisibility !== 'hidden' &&\n computedVisibility !== 'collapse'\n );\n }\n\n return isVisible;\n}\n\nfunction isAttributeVisible(element: Element, childElement?: Element) {\n return (\n !element.hasAttribute('hidden') &&\n (element.nodeName === 'DETAILS' &&\n childElement &&\n childElement.nodeName !== 'SUMMARY'\n ? element.hasAttribute('open')\n : true)\n );\n}\n\n/**\n * Adapted from https://github.com/testing-library/jest-dom and \n * https://github.com/vuejs/vue-test-utils-next/.\n * Licensed under the MIT License.\n * @param element - Element to evaluate for display or visibility.\n */ \nexport function isElementVisible(element: Element, childElement?: Element) {\n return (\n element.nodeName !== '#comment' &&\n isStyleVisible(element) &&\n isAttributeVisible(element, childElement) &&\n (!element.parentElement || isElementVisible(element.parentElement, element))\n );\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport clsx from 'clsx';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {ReactElement} from 'react';\nimport {useFocusRing} from './useFocusRing';\n\ninterface FocusRingProps {\n /** Child element to apply CSS classes to. */\n children: ReactElement,\n /** CSS class to apply when the element is focused. */\n focusClass?: string,\n /** CSS class to apply when the element has keyboard focus. */\n focusRingClass?: string,\n /**\n * Whether to show the focus ring when something\n * inside the container element has focus (true), or\n * only if the container itself has focus (false).\n * @default false\n */\n within?: boolean,\n /** Whether the element is a text input. */\n isTextInput?: boolean,\n /** Whether the element will be auto focused. */\n autoFocus?: boolean\n}\n\n/**\n * A utility component that applies a CSS class when an element has keyboard focus.\n * Focus rings are visible only when the user is interacting with a keyboard,\n * not with a mouse, touch, or other input methods.\n */\nexport function FocusRing(props: FocusRingProps) {\n let {children, focusClass, focusRingClass} = props;\n let {isFocused, isFocusVisible, focusProps} = useFocusRing(props);\n let child = React.Children.only(children);\n\n return React.cloneElement(child, mergeProps(child.props, {\n ...focusProps,\n className: clsx({\n [focusClass || '']: isFocused,\n [focusRingClass || '']: isFocusVisible\n })\n }));\n}\n","import {DOMAttributes} from '@react-types/shared';\nimport {isFocusVisible, useFocus, useFocusVisibleListener, useFocusWithin} from '@react-aria/interactions';\nimport {useCallback, useState} from 'react';\nimport {useRef} from 'react';\n\ninterface FocusRingProps {\n /**\n * Whether to show the focus ring when something\n * inside the container element has focus (true), or\n * only if the container itself has focus (false).\n * @default 'false'\n */\n within?: boolean,\n\n /** Whether the element is a text input. */\n isTextInput?: boolean,\n\n /** Whether the element will be auto focused. */\n autoFocus?: boolean\n}\n\ninterface FocusRingAria {\n /** Whether the element is currently focused. */\n isFocused: boolean,\n\n /** Whether keyboard focus should be visible. */\n isFocusVisible: boolean,\n\n /** Props to apply to the container element with the focus ring. */\n focusProps: DOMAttributes\n}\n\n/**\n * Determines whether a focus ring should be shown to indicate keyboard focus.\n * Focus rings are visible only when the user is interacting with a keyboard,\n * not with a mouse, touch, or other input methods.\n */\nexport function useFocusRing(props: FocusRingProps = {}): FocusRingAria {\n let {\n autoFocus = false,\n isTextInput,\n within\n } = props;\n let state = useRef({\n isFocused: false,\n isFocusVisible: autoFocus || isFocusVisible()\n });\n let [isFocused, setFocused] = useState(false);\n let [isFocusVisibleState, setFocusVisible] = useState(() => state.current.isFocused && state.current.isFocusVisible);\n\n let updateState = useCallback(() => setFocusVisible(state.current.isFocused && state.current.isFocusVisible), []);\n\n let onFocusChange = useCallback(isFocused => {\n state.current.isFocused = isFocused;\n setFocused(isFocused);\n updateState();\n }, [updateState]);\n\n useFocusVisibleListener((isFocusVisible) => {\n state.current.isFocusVisible = isFocusVisible;\n updateState();\n }, [], {isTextInput});\n\n let {focusProps} = useFocus({\n isDisabled: within,\n onFocusChange\n });\n\n let {focusWithinProps} = useFocusWithin({\n isDisabled: !within,\n onFocusWithinChange: onFocusChange\n });\n\n return {\n isFocused,\n isFocusVisible: state.current.isFocused && isFocusVisibleState,\n focusProps: within ? focusWithinProps : focusProps\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes, FocusableDOMProps, FocusableElement, FocusableProps} from '@react-types/shared';\nimport {focusSafely} from './';\nimport {mergeProps, useSyncRef} from '@react-aria/utils';\nimport React, {MutableRefObject, ReactNode, RefObject, useContext, useEffect, useRef} from 'react';\nimport {useFocus, useKeyboard} from '@react-aria/interactions';\n\ninterface FocusableOptions extends FocusableProps, FocusableDOMProps {\n /** Whether focus should be disabled. */\n isDisabled?: boolean\n}\n\ninterface FocusableProviderProps extends DOMAttributes {\n /** The child element to provide DOM props to. */\n children?: ReactNode\n}\n\ninterface FocusableContextValue extends FocusableProviderProps {\n ref?: MutableRefObject<FocusableElement>\n}\n\nlet FocusableContext = React.createContext<FocusableContextValue>(null);\n\nfunction useFocusableContext(ref: RefObject<FocusableElement>): FocusableContextValue {\n let context = useContext(FocusableContext) || {};\n useSyncRef(context, ref);\n\n // eslint-disable-next-line\n let {ref: _, ...otherProps} = context;\n return otherProps;\n}\n\n/**\n * Provides DOM props to the nearest focusable child.\n */\nfunction FocusableProvider(props: FocusableProviderProps, ref: RefObject<FocusableElement>) {\n let {children, ...otherProps} = props;\n let context = {\n ...otherProps,\n ref\n };\n\n return (\n <FocusableContext.Provider value={context}>\n {children}\n </FocusableContext.Provider>\n );\n}\n\nlet _FocusableProvider = React.forwardRef(FocusableProvider);\nexport {_FocusableProvider as FocusableProvider};\n\ninterface FocusableAria {\n /** Props for the focusable element. */\n focusableProps: DOMAttributes\n}\n\n/**\n * Used to make an element focusable and capable of auto focus.\n */\nexport function useFocusable(props: FocusableOptions, domRef: RefObject<FocusableElement>): FocusableAria {\n let {focusProps} = useFocus(props);\n let {keyboardProps} = useKeyboard(props);\n let interactions = mergeProps(focusProps, keyboardProps);\n let domProps = useFocusableContext(domRef);\n let interactionProps = props.isDisabled ? {} : domProps;\n let autoFocusRef = useRef(props.autoFocus);\n\n useEffect(() => {\n if (autoFocusRef.current && domRef.current) {\n focusSafely(domRef.current);\n }\n autoFocusRef.current = false;\n }, [domRef]);\n\n return {\n focusableProps: mergeProps(\n {\n ...interactions,\n tabIndex: props.excludeFromTabOrder && !props.isDisabled ? -1 : undefined\n },\n interactionProps\n )\n };\n}\n"],"names":[],"version":3,"file":"module.js.map"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { FocusableElement, DOMAttributes, FocusableDOMProps, FocusableProps } from "@react-types/shared";
|
|
2
|
+
import React, { ReactNode, RefObject, ReactElement } from "react";
|
|
3
3
|
/**
|
|
4
4
|
* A utility function that focuses an element while avoiding undesired side effects such
|
|
5
5
|
* as page scrolling and screen reader issues with CSS transitions.
|
|
6
6
|
*/
|
|
7
|
-
export function focusSafely(element:
|
|
7
|
+
export function focusSafely(element: FocusableElement): void;
|
|
8
8
|
interface FocusScopeProps {
|
|
9
9
|
/** The contents of the focus scope. */
|
|
10
10
|
children: ReactNode;
|
|
@@ -23,7 +23,7 @@ interface FocusScopeProps {
|
|
|
23
23
|
}
|
|
24
24
|
interface FocusManagerOptions {
|
|
25
25
|
/** The element to start searching from. The currently focused element by default. */
|
|
26
|
-
from?:
|
|
26
|
+
from?: Element;
|
|
27
27
|
/** Whether to only include tabbable elements, or all focusable elements. */
|
|
28
28
|
tabbable?: boolean;
|
|
29
29
|
/** Whether focus should wrap around when it reaches the end of the scope. */
|
|
@@ -33,13 +33,13 @@ interface FocusManagerOptions {
|
|
|
33
33
|
}
|
|
34
34
|
export interface FocusManager {
|
|
35
35
|
/** Moves focus to the next focusable or tabbable element in the focus scope. */
|
|
36
|
-
focusNext(opts?: FocusManagerOptions):
|
|
36
|
+
focusNext(opts?: FocusManagerOptions): FocusableElement;
|
|
37
37
|
/** Moves focus to the previous focusable or tabbable element in the focus scope. */
|
|
38
|
-
focusPrevious(opts?: FocusManagerOptions):
|
|
38
|
+
focusPrevious(opts?: FocusManagerOptions): FocusableElement;
|
|
39
39
|
/** Moves focus to the first focusable or tabbable element in the focus scope. */
|
|
40
|
-
focusFirst(opts?: FocusManagerOptions):
|
|
40
|
+
focusFirst(opts?: FocusManagerOptions): FocusableElement;
|
|
41
41
|
/** Moves focus to the last focusable or tabbable element in the focus scope. */
|
|
42
|
-
focusLast(opts?: FocusManagerOptions):
|
|
42
|
+
focusLast(opts?: FocusManagerOptions): FocusableElement;
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* A FocusScope manages focus for its descendants. It supports containing focus inside
|
|
@@ -59,11 +59,11 @@ export function useFocusManager(): FocusManager;
|
|
|
59
59
|
* Create a [TreeWalker]{@link https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker}
|
|
60
60
|
* that matches all focusable/tabbable elements.
|
|
61
61
|
*/
|
|
62
|
-
export function getFocusableTreeWalker(root:
|
|
62
|
+
export function getFocusableTreeWalker(root: Element, opts?: FocusManagerOptions, scope?: Element[]): TreeWalker;
|
|
63
63
|
/**
|
|
64
64
|
* Creates a FocusManager object that can be used to move focus within an element.
|
|
65
65
|
*/
|
|
66
|
-
export function createFocusManager(ref: RefObject<
|
|
66
|
+
export function createFocusManager(ref: RefObject<Element>, defaultOptions?: FocusManagerOptions): FocusManager;
|
|
67
67
|
interface FocusRingProps {
|
|
68
68
|
/**
|
|
69
69
|
* Whether to show the focus ring when something
|
|
@@ -83,7 +83,7 @@ interface FocusRingAria {
|
|
|
83
83
|
/** Whether keyboard focus should be visible. */
|
|
84
84
|
isFocusVisible: boolean;
|
|
85
85
|
/** Props to apply to the container element with the focus ring. */
|
|
86
|
-
focusProps:
|
|
86
|
+
focusProps: DOMAttributes;
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
89
|
* Determines whether a focus ring should be shown to indicate keyboard focus.
|
|
@@ -120,18 +120,18 @@ interface FocusableOptions extends FocusableProps, FocusableDOMProps {
|
|
|
120
120
|
/** Whether focus should be disabled. */
|
|
121
121
|
isDisabled?: boolean;
|
|
122
122
|
}
|
|
123
|
-
interface FocusableProviderProps extends
|
|
123
|
+
interface FocusableProviderProps extends DOMAttributes {
|
|
124
124
|
/** The child element to provide DOM props to. */
|
|
125
125
|
children?: ReactNode;
|
|
126
126
|
}
|
|
127
|
-
export let FocusableProvider: React.ForwardRefExoticComponent<FocusableProviderProps & React.RefAttributes<
|
|
127
|
+
export let FocusableProvider: React.ForwardRefExoticComponent<FocusableProviderProps & React.RefAttributes<FocusableElement>>;
|
|
128
128
|
interface FocusableAria {
|
|
129
129
|
/** Props for the focusable element. */
|
|
130
|
-
focusableProps:
|
|
130
|
+
focusableProps: DOMAttributes;
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
133
133
|
* Used to make an element focusable and capable of auto focus.
|
|
134
134
|
*/
|
|
135
|
-
export function useFocusable(props: FocusableOptions, domRef: RefObject<
|
|
135
|
+
export function useFocusable(props: FocusableOptions, domRef: RefObject<FocusableElement>): FocusableAria;
|
|
136
136
|
|
|
137
137
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;
|
|
1
|
+
{"mappings":";;AAgBA;;;GAGG;AACH,4BAA4B,OAAO,EAAE,gBAAgB,QAiBpD;AEhBD;IACE,uCAAuC;IACvC,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,qFAAqF;IACrF,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED;IACE,qFAAqF;IACrF,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6EAA6E;IAC7E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf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A8D;IAC9D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,2CAA2C;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gDAAgD;IAChD,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED;;;;GAIG;AACH,0BAA0B,KAAK,EAAE,gBAAc,sEAY9C;ACpCD,0BAA2B,SAAQ,cAAc,EAAE,iBAAiB;IAClE,wCAAwC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,gCAAiC,SAAQ,aAAa;IACpD,iDAAiD;IACjD,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAkCD,OAAA,IAAI,kHAAwD,CAAC;AAG7D;IACE,uCAAuC;IACvC,cAAc,EAAE,aAAa,CAAA;CAC9B;AAED;;GAEG;AACH,6BAA6B,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,UAAU,gBAAgB,CAAC,GAAG,aAAa,CAwBxG","sources":["packages/@react-aria/focus/src/packages/@react-aria/focus/src/focusSafely.ts","packages/@react-aria/focus/src/packages/@react-aria/focus/src/isElementVisible.ts","packages/@react-aria/focus/src/packages/@react-aria/focus/src/FocusScope.tsx","packages/@react-aria/focus/src/packages/@react-aria/focus/src/useFocusRing.ts","packages/@react-aria/focus/src/packages/@react-aria/focus/src/FocusRing.tsx","packages/@react-aria/focus/src/packages/@react-aria/focus/src/useFocusable.tsx","packages/@react-aria/focus/src/packages/@react-aria/focus/src/index.ts","packages/@react-aria/focus/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport type {FocusManager} from './FocusScope';\nexport {FocusScope, useFocusManager, getFocusableTreeWalker, createFocusManager} from './FocusScope';\nexport {FocusRing} from './FocusRing';\nexport {FocusableProvider, useFocusable} from './useFocusable';\nexport {useFocusRing} from './useFocusRing';\nexport {focusSafely} from './focusSafely';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/focus",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.1663+2a6c48eb0",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/runtime": "^7.6.2",
|
|
21
|
-
"@react-aria/interactions": "3.0.0-nightly.
|
|
22
|
-
"@react-aria/utils": "3.0.0-nightly.
|
|
23
|
-
"@react-types/shared": "3.0.0-nightly.
|
|
21
|
+
"@react-aria/interactions": "3.0.0-nightly.1663+2a6c48eb0",
|
|
22
|
+
"@react-aria/utils": "3.0.0-nightly.1663+2a6c48eb0",
|
|
23
|
+
"@react-types/shared": "3.0.0-nightly.1663+2a6c48eb0",
|
|
24
24
|
"clsx": "^1.1.1"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "2a6c48eb0099671cf9b530ec3d75882c549e9cb5"
|
|
33
33
|
}
|
package/src/FocusScope.tsx
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import {FocusableElement} from '@react-types/shared';
|
|
13
14
|
import {focusSafely} from './focusSafely';
|
|
14
15
|
import {isElementVisible} from './isElementVisible';
|
|
15
16
|
import React, {ReactNode, RefObject, useContext, useEffect, useRef} from 'react';
|
|
@@ -40,7 +41,7 @@ interface FocusScopeProps {
|
|
|
40
41
|
|
|
41
42
|
interface FocusManagerOptions {
|
|
42
43
|
/** The element to start searching from. The currently focused element by default. */
|
|
43
|
-
from?:
|
|
44
|
+
from?: Element,
|
|
44
45
|
/** Whether to only include tabbable elements, or all focusable elements. */
|
|
45
46
|
tabbable?: boolean,
|
|
46
47
|
/** Whether focus should wrap around when it reaches the end of the scope. */
|
|
@@ -51,16 +52,16 @@ interface FocusManagerOptions {
|
|
|
51
52
|
|
|
52
53
|
export interface FocusManager {
|
|
53
54
|
/** Moves focus to the next focusable or tabbable element in the focus scope. */
|
|
54
|
-
focusNext(opts?: FocusManagerOptions):
|
|
55
|
+
focusNext(opts?: FocusManagerOptions): FocusableElement,
|
|
55
56
|
/** Moves focus to the previous focusable or tabbable element in the focus scope. */
|
|
56
|
-
focusPrevious(opts?: FocusManagerOptions):
|
|
57
|
+
focusPrevious(opts?: FocusManagerOptions): FocusableElement,
|
|
57
58
|
/** Moves focus to the first focusable or tabbable element in the focus scope. */
|
|
58
|
-
focusFirst(opts?: FocusManagerOptions):
|
|
59
|
+
focusFirst(opts?: FocusManagerOptions): FocusableElement,
|
|
59
60
|
/** Moves focus to the last focusable or tabbable element in the focus scope. */
|
|
60
|
-
focusLast(opts?: FocusManagerOptions):
|
|
61
|
+
focusLast(opts?: FocusManagerOptions): FocusableElement
|
|
61
62
|
}
|
|
62
63
|
|
|
63
|
-
type ScopeRef = RefObject<
|
|
64
|
+
type ScopeRef = RefObject<Element[]>;
|
|
64
65
|
interface IFocusContext {
|
|
65
66
|
scopeRef: ScopeRef,
|
|
66
67
|
focusManager: FocusManager
|
|
@@ -87,7 +88,7 @@ export function FocusScope(props: FocusScopeProps) {
|
|
|
87
88
|
let {children, contain, restoreFocus, autoFocus} = props;
|
|
88
89
|
let startRef = useRef<HTMLSpanElement>();
|
|
89
90
|
let endRef = useRef<HTMLSpanElement>();
|
|
90
|
-
let scopeRef = useRef<
|
|
91
|
+
let scopeRef = useRef<Element[]>([]);
|
|
91
92
|
let ctx = useContext(FocusContext);
|
|
92
93
|
let parentScope = ctx?.scopeRef;
|
|
93
94
|
|
|
@@ -143,7 +144,7 @@ export function useFocusManager(): FocusManager {
|
|
|
143
144
|
return useContext(FocusContext)?.focusManager;
|
|
144
145
|
}
|
|
145
146
|
|
|
146
|
-
function createFocusManagerForScope(scopeRef: React.RefObject<
|
|
147
|
+
function createFocusManagerForScope(scopeRef: React.RefObject<Element[]>): FocusManager {
|
|
147
148
|
return {
|
|
148
149
|
focusNext(opts: FocusManagerOptions = {}) {
|
|
149
150
|
let scope = scopeRef.current;
|
|
@@ -152,10 +153,10 @@ function createFocusManagerForScope(scopeRef: React.RefObject<HTMLElement[]>): F
|
|
|
152
153
|
let sentinel = scope[0].previousElementSibling;
|
|
153
154
|
let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable, accept}, scope);
|
|
154
155
|
walker.currentNode = isElementInScope(node, scope) ? node : sentinel;
|
|
155
|
-
let nextNode = walker.nextNode() as
|
|
156
|
+
let nextNode = walker.nextNode() as FocusableElement;
|
|
156
157
|
if (!nextNode && wrap) {
|
|
157
158
|
walker.currentNode = sentinel;
|
|
158
|
-
nextNode = walker.nextNode() as
|
|
159
|
+
nextNode = walker.nextNode() as FocusableElement;
|
|
159
160
|
}
|
|
160
161
|
if (nextNode) {
|
|
161
162
|
focusElement(nextNode, true);
|
|
@@ -169,10 +170,10 @@ function createFocusManagerForScope(scopeRef: React.RefObject<HTMLElement[]>): F
|
|
|
169
170
|
let sentinel = scope[scope.length - 1].nextElementSibling;
|
|
170
171
|
let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable, accept}, scope);
|
|
171
172
|
walker.currentNode = isElementInScope(node, scope) ? node : sentinel;
|
|
172
|
-
let previousNode = walker.previousNode() as
|
|
173
|
+
let previousNode = walker.previousNode() as FocusableElement;
|
|
173
174
|
if (!previousNode && wrap) {
|
|
174
175
|
walker.currentNode = sentinel;
|
|
175
|
-
previousNode = walker.previousNode() as
|
|
176
|
+
previousNode = walker.previousNode() as FocusableElement;
|
|
176
177
|
}
|
|
177
178
|
if (previousNode) {
|
|
178
179
|
focusElement(previousNode, true);
|
|
@@ -184,7 +185,7 @@ function createFocusManagerForScope(scopeRef: React.RefObject<HTMLElement[]>): F
|
|
|
184
185
|
let {tabbable, accept} = opts;
|
|
185
186
|
let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable, accept}, scope);
|
|
186
187
|
walker.currentNode = scope[0].previousElementSibling;
|
|
187
|
-
let nextNode = walker.nextNode() as
|
|
188
|
+
let nextNode = walker.nextNode() as FocusableElement;
|
|
188
189
|
if (nextNode) {
|
|
189
190
|
focusElement(nextNode, true);
|
|
190
191
|
}
|
|
@@ -195,7 +196,7 @@ function createFocusManagerForScope(scopeRef: React.RefObject<HTMLElement[]>): F
|
|
|
195
196
|
let {tabbable, accept} = opts;
|
|
196
197
|
let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable, accept}, scope);
|
|
197
198
|
walker.currentNode = scope[scope.length - 1].nextElementSibling;
|
|
198
|
-
let previousNode = walker.previousNode() as
|
|
199
|
+
let previousNode = walker.previousNode() as FocusableElement;
|
|
199
200
|
if (previousNode) {
|
|
200
201
|
focusElement(previousNode, true);
|
|
201
202
|
}
|
|
@@ -225,12 +226,12 @@ const FOCUSABLE_ELEMENT_SELECTOR = focusableElements.join(':not([hidden]),') + '
|
|
|
225
226
|
focusableElements.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
|
|
226
227
|
const TABBABLE_ELEMENT_SELECTOR = focusableElements.join(':not([hidden]):not([tabindex="-1"]),');
|
|
227
228
|
|
|
228
|
-
function getScopeRoot(scope:
|
|
229
|
+
function getScopeRoot(scope: Element[]) {
|
|
229
230
|
return scope[0].parentElement;
|
|
230
231
|
}
|
|
231
232
|
|
|
232
|
-
function useFocusContainment(scopeRef: RefObject<
|
|
233
|
-
let focusedNode = useRef<
|
|
233
|
+
function useFocusContainment(scopeRef: RefObject<Element[]>, contain: boolean) {
|
|
234
|
+
let focusedNode = useRef<FocusableElement>();
|
|
234
235
|
|
|
235
236
|
let raf = useRef(null);
|
|
236
237
|
useLayoutEffect(() => {
|
|
@@ -250,7 +251,7 @@ function useFocusContainment(scopeRef: RefObject<HTMLElement[]>, contain: boolea
|
|
|
250
251
|
return;
|
|
251
252
|
}
|
|
252
253
|
|
|
253
|
-
let focusedElement = document.activeElement
|
|
254
|
+
let focusedElement = document.activeElement;
|
|
254
255
|
let scope = scopeRef.current;
|
|
255
256
|
if (!isElementInScope(focusedElement, scope)) {
|
|
256
257
|
return;
|
|
@@ -258,10 +259,10 @@ function useFocusContainment(scopeRef: RefObject<HTMLElement[]>, contain: boolea
|
|
|
258
259
|
|
|
259
260
|
let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable: true}, scope);
|
|
260
261
|
walker.currentNode = focusedElement;
|
|
261
|
-
let nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as
|
|
262
|
+
let nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as FocusableElement;
|
|
262
263
|
if (!nextElement) {
|
|
263
264
|
walker.currentNode = e.shiftKey ? scope[scope.length - 1].nextElementSibling : scope[0].previousElementSibling;
|
|
264
|
-
nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as
|
|
265
|
+
nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as FocusableElement;
|
|
265
266
|
}
|
|
266
267
|
|
|
267
268
|
e.preventDefault();
|
|
@@ -332,7 +333,7 @@ function isElementInAnyScope(element: Element) {
|
|
|
332
333
|
return false;
|
|
333
334
|
}
|
|
334
335
|
|
|
335
|
-
function isElementInScope(element: Element, scope:
|
|
336
|
+
function isElementInScope(element: Element, scope: Element[]) {
|
|
336
337
|
return scope.some(node => node.contains(element));
|
|
337
338
|
}
|
|
338
339
|
|
|
@@ -361,7 +362,7 @@ function isAncestorScope(ancestor: ScopeRef, scope: ScopeRef) {
|
|
|
361
362
|
return isAncestorScope(ancestor, parent);
|
|
362
363
|
}
|
|
363
364
|
|
|
364
|
-
function focusElement(element:
|
|
365
|
+
function focusElement(element: FocusableElement | null, scroll = false) {
|
|
365
366
|
if (element != null && !scroll) {
|
|
366
367
|
try {
|
|
367
368
|
focusSafely(element);
|
|
@@ -377,14 +378,14 @@ function focusElement(element: HTMLElement | null, scroll = false) {
|
|
|
377
378
|
}
|
|
378
379
|
}
|
|
379
380
|
|
|
380
|
-
function focusFirstInScope(scope:
|
|
381
|
+
function focusFirstInScope(scope: Element[]) {
|
|
381
382
|
let sentinel = scope[0].previousElementSibling;
|
|
382
383
|
let walker = getFocusableTreeWalker(getScopeRoot(scope), {tabbable: true}, scope);
|
|
383
384
|
walker.currentNode = sentinel;
|
|
384
|
-
focusElement(walker.nextNode() as
|
|
385
|
+
focusElement(walker.nextNode() as FocusableElement);
|
|
385
386
|
}
|
|
386
387
|
|
|
387
|
-
function useAutoFocus(scopeRef: RefObject<
|
|
388
|
+
function useAutoFocus(scopeRef: RefObject<Element[]>, autoFocus: boolean) {
|
|
388
389
|
const autoFocusRef = React.useRef(autoFocus);
|
|
389
390
|
useEffect(() => {
|
|
390
391
|
if (autoFocusRef.current) {
|
|
@@ -397,9 +398,9 @@ function useAutoFocus(scopeRef: RefObject<HTMLElement[]>, autoFocus: boolean) {
|
|
|
397
398
|
}, []);
|
|
398
399
|
}
|
|
399
400
|
|
|
400
|
-
function useRestoreFocus(scopeRef: RefObject<
|
|
401
|
+
function useRestoreFocus(scopeRef: RefObject<Element[]>, restoreFocus: boolean, contain: boolean) {
|
|
401
402
|
// create a ref during render instead of useLayoutEffect so the active element is saved before a child with autoFocus=true mounts.
|
|
402
|
-
const nodeToRestoreRef = useRef(typeof document !== 'undefined' ? document.activeElement as
|
|
403
|
+
const nodeToRestoreRef = useRef(typeof document !== 'undefined' ? document.activeElement as FocusableElement : null);
|
|
403
404
|
|
|
404
405
|
// useLayoutEffect instead of useEffect so the active element is saved synchronously instead of asynchronously.
|
|
405
406
|
useLayoutEffect(() => {
|
|
@@ -417,7 +418,7 @@ function useRestoreFocus(scopeRef: RefObject<HTMLElement[]>, restoreFocus: boole
|
|
|
417
418
|
return;
|
|
418
419
|
}
|
|
419
420
|
|
|
420
|
-
let focusedElement = document.activeElement as
|
|
421
|
+
let focusedElement = document.activeElement as FocusableElement;
|
|
421
422
|
if (!isElementInScope(focusedElement, scopeRef.current)) {
|
|
422
423
|
return;
|
|
423
424
|
}
|
|
@@ -427,7 +428,7 @@ function useRestoreFocus(scopeRef: RefObject<HTMLElement[]>, restoreFocus: boole
|
|
|
427
428
|
|
|
428
429
|
// Find the next tabbable element after the currently focused element
|
|
429
430
|
walker.currentNode = focusedElement;
|
|
430
|
-
let nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as
|
|
431
|
+
let nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as FocusableElement;
|
|
431
432
|
|
|
432
433
|
if (!document.body.contains(nodeToRestore) || nodeToRestore === document.body) {
|
|
433
434
|
nodeToRestore = null;
|
|
@@ -440,7 +441,7 @@ function useRestoreFocus(scopeRef: RefObject<HTMLElement[]>, restoreFocus: boole
|
|
|
440
441
|
|
|
441
442
|
// Skip over elements within the scope, in case the scope immediately follows the node to restore.
|
|
442
443
|
do {
|
|
443
|
-
nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as
|
|
444
|
+
nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as FocusableElement;
|
|
444
445
|
} while (isElementInScope(nextElement, scopeRef.current));
|
|
445
446
|
|
|
446
447
|
e.preventDefault();
|
|
@@ -485,7 +486,7 @@ function useRestoreFocus(scopeRef: RefObject<HTMLElement[]>, restoreFocus: boole
|
|
|
485
486
|
* Create a [TreeWalker]{@link https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker}
|
|
486
487
|
* that matches all focusable/tabbable elements.
|
|
487
488
|
*/
|
|
488
|
-
export function getFocusableTreeWalker(root:
|
|
489
|
+
export function getFocusableTreeWalker(root: Element, opts?: FocusManagerOptions, scope?: Element[]) {
|
|
489
490
|
let selector = opts?.tabbable ? TABBABLE_ELEMENT_SELECTOR : FOCUSABLE_ELEMENT_SELECTOR;
|
|
490
491
|
let walker = document.createTreeWalker(
|
|
491
492
|
root,
|
|
@@ -497,9 +498,9 @@ export function getFocusableTreeWalker(root: HTMLElement, opts?: FocusManagerOpt
|
|
|
497
498
|
return NodeFilter.FILTER_REJECT;
|
|
498
499
|
}
|
|
499
500
|
|
|
500
|
-
if ((node as
|
|
501
|
-
&& isElementVisible(node as
|
|
502
|
-
&& (!scope || isElementInScope(node as
|
|
501
|
+
if ((node as Element).matches(selector)
|
|
502
|
+
&& isElementVisible(node as Element)
|
|
503
|
+
&& (!scope || isElementInScope(node as Element, scope))
|
|
503
504
|
&& (!opts?.accept || opts.accept(node as Element))
|
|
504
505
|
) {
|
|
505
506
|
return NodeFilter.FILTER_ACCEPT;
|
|
@@ -520,7 +521,7 @@ export function getFocusableTreeWalker(root: HTMLElement, opts?: FocusManagerOpt
|
|
|
520
521
|
/**
|
|
521
522
|
* Creates a FocusManager object that can be used to move focus within an element.
|
|
522
523
|
*/
|
|
523
|
-
export function createFocusManager(ref: RefObject<
|
|
524
|
+
export function createFocusManager(ref: RefObject<Element>, defaultOptions: FocusManagerOptions = {}): FocusManager {
|
|
524
525
|
return {
|
|
525
526
|
focusNext(opts: FocusManagerOptions = {}) {
|
|
526
527
|
let root = ref.current;
|
|
@@ -533,10 +534,10 @@ export function createFocusManager(ref: RefObject<HTMLElement>, defaultOptions:
|
|
|
533
534
|
if (root.contains(node)) {
|
|
534
535
|
walker.currentNode = node;
|
|
535
536
|
}
|
|
536
|
-
let nextNode = walker.nextNode() as
|
|
537
|
+
let nextNode = walker.nextNode() as FocusableElement;
|
|
537
538
|
if (!nextNode && wrap) {
|
|
538
539
|
walker.currentNode = root;
|
|
539
|
-
nextNode = walker.nextNode() as
|
|
540
|
+
nextNode = walker.nextNode() as FocusableElement;
|
|
540
541
|
}
|
|
541
542
|
if (nextNode) {
|
|
542
543
|
focusElement(nextNode, true);
|
|
@@ -560,7 +561,7 @@ export function createFocusManager(ref: RefObject<HTMLElement>, defaultOptions:
|
|
|
560
561
|
}
|
|
561
562
|
return next;
|
|
562
563
|
}
|
|
563
|
-
let previousNode = walker.previousNode() as
|
|
564
|
+
let previousNode = walker.previousNode() as FocusableElement;
|
|
564
565
|
if (!previousNode && wrap) {
|
|
565
566
|
walker.currentNode = root;
|
|
566
567
|
previousNode = last(walker);
|
|
@@ -577,7 +578,7 @@ export function createFocusManager(ref: RefObject<HTMLElement>, defaultOptions:
|
|
|
577
578
|
}
|
|
578
579
|
let {tabbable = defaultOptions.tabbable, accept = defaultOptions.accept} = opts;
|
|
579
580
|
let walker = getFocusableTreeWalker(root, {tabbable, accept});
|
|
580
|
-
let nextNode = walker.nextNode() as
|
|
581
|
+
let nextNode = walker.nextNode() as FocusableElement;
|
|
581
582
|
if (nextNode) {
|
|
582
583
|
focusElement(nextNode, true);
|
|
583
584
|
}
|
|
@@ -600,10 +601,10 @@ export function createFocusManager(ref: RefObject<HTMLElement>, defaultOptions:
|
|
|
600
601
|
}
|
|
601
602
|
|
|
602
603
|
function last(walker: TreeWalker) {
|
|
603
|
-
let next:
|
|
604
|
-
let last:
|
|
604
|
+
let next: FocusableElement;
|
|
605
|
+
let last: FocusableElement;
|
|
605
606
|
do {
|
|
606
|
-
last = walker.lastChild() as
|
|
607
|
+
last = walker.lastChild() as FocusableElement;
|
|
607
608
|
if (last) {
|
|
608
609
|
next = last;
|
|
609
610
|
}
|
package/src/focusSafely.ts
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import {FocusableElement} from '@react-types/shared';
|
|
13
14
|
import {focusWithoutScrolling, runAfterTransition} from '@react-aria/utils';
|
|
14
15
|
import {getInteractionModality} from '@react-aria/interactions';
|
|
15
16
|
|
|
@@ -17,7 +18,7 @@ import {getInteractionModality} from '@react-aria/interactions';
|
|
|
17
18
|
* A utility function that focuses an element while avoiding undesired side effects such
|
|
18
19
|
* as page scrolling and screen reader issues with CSS transitions.
|
|
19
20
|
*/
|
|
20
|
-
export function focusSafely(element:
|
|
21
|
+
export function focusSafely(element: FocusableElement) {
|
|
21
22
|
// If the user is interacting with a virtual cursor, e.g. screen reader, then
|
|
22
23
|
// wait until after any animated transitions that are currently occurring on
|
|
23
24
|
// the page before shifting focus. This avoids issues with VoiceOver on iOS
|
package/src/index.ts
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
12
|
+
export type {FocusManager} from './FocusScope';
|
|
13
|
+
export {FocusScope, useFocusManager, getFocusableTreeWalker, createFocusManager} from './FocusScope';
|
|
14
|
+
export {FocusRing} from './FocusRing';
|
|
15
|
+
export {FocusableProvider, useFocusable} from './useFocusable';
|
|
16
|
+
export {useFocusRing} from './useFocusRing';
|
|
17
|
+
export {focusSafely} from './focusSafely';
|
package/src/useFocusRing.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {DOMAttributes} from '@react-types/shared';
|
|
2
2
|
import {isFocusVisible, useFocus, useFocusVisibleListener, useFocusWithin} from '@react-aria/interactions';
|
|
3
|
+
import {useCallback, useState} from 'react';
|
|
3
4
|
import {useRef} from 'react';
|
|
4
5
|
|
|
5
6
|
interface FocusRingProps {
|
|
@@ -26,7 +27,7 @@ interface FocusRingAria {
|
|
|
26
27
|
isFocusVisible: boolean,
|
|
27
28
|
|
|
28
29
|
/** Props to apply to the container element with the focus ring. */
|
|
29
|
-
focusProps:
|
|
30
|
+
focusProps: DOMAttributes
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
/**
|
package/src/useFocusable.tsx
CHANGED
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {FocusableDOMProps, FocusableProps} from '@react-types/shared';
|
|
13
|
+
import {DOMAttributes, FocusableDOMProps, FocusableElement, FocusableProps} from '@react-types/shared';
|
|
14
14
|
import {focusSafely} from './';
|
|
15
15
|
import {mergeProps, useSyncRef} from '@react-aria/utils';
|
|
16
|
-
import React, {
|
|
16
|
+
import React, {MutableRefObject, ReactNode, RefObject, useContext, useEffect, useRef} from 'react';
|
|
17
17
|
import {useFocus, useKeyboard} from '@react-aria/interactions';
|
|
18
18
|
|
|
19
19
|
interface FocusableOptions extends FocusableProps, FocusableDOMProps {
|
|
@@ -21,18 +21,18 @@ interface FocusableOptions extends FocusableProps, FocusableDOMProps {
|
|
|
21
21
|
isDisabled?: boolean
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
interface FocusableProviderProps extends
|
|
24
|
+
interface FocusableProviderProps extends DOMAttributes {
|
|
25
25
|
/** The child element to provide DOM props to. */
|
|
26
26
|
children?: ReactNode
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
interface FocusableContextValue extends FocusableProviderProps {
|
|
30
|
-
ref?: MutableRefObject<
|
|
30
|
+
ref?: MutableRefObject<FocusableElement>
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
let FocusableContext = React.createContext<FocusableContextValue>(null);
|
|
34
34
|
|
|
35
|
-
function useFocusableContext(ref: RefObject<
|
|
35
|
+
function useFocusableContext(ref: RefObject<FocusableElement>): FocusableContextValue {
|
|
36
36
|
let context = useContext(FocusableContext) || {};
|
|
37
37
|
useSyncRef(context, ref);
|
|
38
38
|
|
|
@@ -44,7 +44,7 @@ function useFocusableContext(ref: RefObject<HTMLElement>): FocusableContextValue
|
|
|
44
44
|
/**
|
|
45
45
|
* Provides DOM props to the nearest focusable child.
|
|
46
46
|
*/
|
|
47
|
-
function FocusableProvider(props: FocusableProviderProps, ref: RefObject<
|
|
47
|
+
function FocusableProvider(props: FocusableProviderProps, ref: RefObject<FocusableElement>) {
|
|
48
48
|
let {children, ...otherProps} = props;
|
|
49
49
|
let context = {
|
|
50
50
|
...otherProps,
|
|
@@ -63,13 +63,13 @@ export {_FocusableProvider as FocusableProvider};
|
|
|
63
63
|
|
|
64
64
|
interface FocusableAria {
|
|
65
65
|
/** Props for the focusable element. */
|
|
66
|
-
focusableProps:
|
|
66
|
+
focusableProps: DOMAttributes
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
70
|
* Used to make an element focusable and capable of auto focus.
|
|
71
71
|
*/
|
|
72
|
-
export function useFocusable(props: FocusableOptions, domRef: RefObject<
|
|
72
|
+
export function useFocusable(props: FocusableOptions, domRef: RefObject<FocusableElement>): FocusableAria {
|
|
73
73
|
let {focusProps} = useFocus(props);
|
|
74
74
|
let {keyboardProps} = useKeyboard(props);
|
|
75
75
|
let interactions = mergeProps(focusProps, keyboardProps);
|