@react-aria/focus 3.21.5 → 3.22.0

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.
Files changed (40) hide show
  1. package/dist/import.mjs +16 -8
  2. package/dist/main.js +32 -24
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +16 -8
  5. package/dist/module.js.map +1 -1
  6. package/dist/types/src/index.d.ts +16 -0
  7. package/package.json +14 -14
  8. package/src/index.ts +16 -13
  9. package/dist/FocusRing.main.js +0 -44
  10. package/dist/FocusRing.main.js.map +0 -1
  11. package/dist/FocusRing.mjs +0 -35
  12. package/dist/FocusRing.module.js +0 -35
  13. package/dist/FocusRing.module.js.map +0 -1
  14. package/dist/FocusScope.main.js +0 -760
  15. package/dist/FocusScope.main.js.map +0 -1
  16. package/dist/FocusScope.mjs +0 -747
  17. package/dist/FocusScope.module.js +0 -747
  18. package/dist/FocusScope.module.js.map +0 -1
  19. package/dist/types.d.ts +0 -133
  20. package/dist/types.d.ts.map +0 -1
  21. package/dist/useFocusRing.main.js +0 -55
  22. package/dist/useFocusRing.main.js.map +0 -1
  23. package/dist/useFocusRing.mjs +0 -50
  24. package/dist/useFocusRing.module.js +0 -50
  25. package/dist/useFocusRing.module.js.map +0 -1
  26. package/dist/useHasTabbableChild.main.js +0 -62
  27. package/dist/useHasTabbableChild.main.js.map +0 -1
  28. package/dist/useHasTabbableChild.mjs +0 -57
  29. package/dist/useHasTabbableChild.module.js +0 -57
  30. package/dist/useHasTabbableChild.module.js.map +0 -1
  31. package/dist/virtualFocus.main.js +0 -46
  32. package/dist/virtualFocus.main.js.map +0 -1
  33. package/dist/virtualFocus.mjs +0 -38
  34. package/dist/virtualFocus.module.js +0 -38
  35. package/dist/virtualFocus.module.js.map +0 -1
  36. package/src/FocusRing.tsx +0 -55
  37. package/src/FocusScope.tsx +0 -1039
  38. package/src/useFocusRing.ts +0 -79
  39. package/src/useHasTabbableChild.ts +0 -66
  40. package/src/virtualFocus.ts +0 -33
package/dist/import.mjs CHANGED
@@ -1,10 +1,14 @@
1
- import {createFocusManager as $9bf71ea28793e738$export$c5251b9e124bf29, FocusScope as $9bf71ea28793e738$export$20e40289641fbbb6, getFocusableTreeWalker as $9bf71ea28793e738$export$2d6ec8fc375ceafa, isElementInChildOfActiveScope as $9bf71ea28793e738$export$1258395f99bf9cbf, useFocusManager as $9bf71ea28793e738$export$10c5169755ce7bd7} from "./FocusScope.mjs";
2
- import {FocusRing as $907718708eab68af$export$1a38b4ad7f578e1d} from "./FocusRing.mjs";
3
- import {useFocusRing as $f7dceffc5ad7768b$export$4e328f61c538687f} from "./useFocusRing.mjs";
4
- import {useHasTabbableChild as $83013635b024ae3d$export$eac1895992b9f3d6} from "./useHasTabbableChild.mjs";
5
- import {dispatchVirtualBlur as $55f9b1ae81f22853$export$6c5dc7e81d2cc29a, dispatchVirtualFocus as $55f9b1ae81f22853$export$2b35b76d2e30e129, getVirtuallyFocusedElement as $55f9b1ae81f22853$export$759df0d867455a91, moveVirtualFocus as $55f9b1ae81f22853$export$76e4e37e5339496d} from "./virtualFocus.mjs";
6
- import {isFocusable as $d48f97c9d1a8e323$re_export$isFocusable} from "@react-aria/utils";
7
- import {FocusableProvider as $d48f97c9d1a8e323$re_export$FocusableProvider, Focusable as $d48f97c9d1a8e323$re_export$Focusable, useFocusable as $d48f97c9d1a8e323$re_export$useFocusable, focusSafely as $d48f97c9d1a8e323$re_export$focusSafely} from "@react-aria/interactions";
1
+ import {FocusScope as $32daac5f69beb98a$re_export$FocusScope, useFocusManager as $32daac5f69beb98a$re_export$useFocusManager} from "react-aria/FocusScope";
2
+ import {getFocusableTreeWalker as $32daac5f69beb98a$re_export$getFocusableTreeWalker, createFocusManager as $32daac5f69beb98a$re_export$createFocusManager, isElementInChildOfActiveScope as $32daac5f69beb98a$re_export$isElementInChildOfActiveScope} from "react-aria/private/focus/FocusScope";
3
+ import {FocusRing as $32daac5f69beb98a$re_export$FocusRing} from "react-aria/FocusRing";
4
+ import {useFocusRing as $32daac5f69beb98a$re_export$useFocusRing} from "react-aria/useFocusRing";
5
+ import {useHasTabbableChild as $32daac5f69beb98a$re_export$useHasTabbableChild} from "react-aria/private/focus/useHasTabbableChild";
6
+ import {moveVirtualFocus as $32daac5f69beb98a$re_export$moveVirtualFocus, dispatchVirtualBlur as $32daac5f69beb98a$re_export$dispatchVirtualBlur, dispatchVirtualFocus as $32daac5f69beb98a$re_export$dispatchVirtualFocus, getVirtuallyFocusedElement as $32daac5f69beb98a$re_export$getVirtuallyFocusedElement} from "react-aria/private/focus/virtualFocus";
7
+ import {isFocusable as $32daac5f69beb98a$re_export$isFocusable} from "react-aria/private/utils/isFocusable";
8
+ import {FocusableProvider as $32daac5f69beb98a$re_export$FocusableProvider} from "react-aria/private/interactions/useFocusable";
9
+ import {useFocusable as $32daac5f69beb98a$re_export$useFocusable} from "react-aria/useFocusable";
10
+ import {Focusable as $32daac5f69beb98a$re_export$Focusable} from "react-aria/Focusable";
11
+ import {focusSafely as $32daac5f69beb98a$re_export$focusSafely} from "react-aria/private/interactions/focusSafely";
8
12
 
9
13
  /*
10
14
  * Copyright 2020 Adobe. All rights reserved.
@@ -25,5 +29,9 @@ import {FocusableProvider as $d48f97c9d1a8e323$re_export$FocusableProvider, Focu
25
29
 
26
30
 
27
31
 
28
- export {$9bf71ea28793e738$export$20e40289641fbbb6 as FocusScope, $9bf71ea28793e738$export$10c5169755ce7bd7 as useFocusManager, $9bf71ea28793e738$export$2d6ec8fc375ceafa as getFocusableTreeWalker, $9bf71ea28793e738$export$c5251b9e124bf29 as createFocusManager, $9bf71ea28793e738$export$1258395f99bf9cbf as isElementInChildOfActiveScope, $907718708eab68af$export$1a38b4ad7f578e1d as FocusRing, $f7dceffc5ad7768b$export$4e328f61c538687f as useFocusRing, $83013635b024ae3d$export$eac1895992b9f3d6 as useHasTabbableChild, $55f9b1ae81f22853$export$76e4e37e5339496d as moveVirtualFocus, $55f9b1ae81f22853$export$6c5dc7e81d2cc29a as dispatchVirtualBlur, $55f9b1ae81f22853$export$2b35b76d2e30e129 as dispatchVirtualFocus, $55f9b1ae81f22853$export$759df0d867455a91 as getVirtuallyFocusedElement, $d48f97c9d1a8e323$re_export$isFocusable as isFocusable, $d48f97c9d1a8e323$re_export$FocusableProvider as FocusableProvider, $d48f97c9d1a8e323$re_export$Focusable as Focusable, $d48f97c9d1a8e323$re_export$useFocusable as useFocusable, $d48f97c9d1a8e323$re_export$focusSafely as focusSafely};
32
+
33
+
34
+
35
+
36
+ export {$32daac5f69beb98a$re_export$FocusScope as FocusScope, $32daac5f69beb98a$re_export$useFocusManager as useFocusManager, $32daac5f69beb98a$re_export$getFocusableTreeWalker as getFocusableTreeWalker, $32daac5f69beb98a$re_export$createFocusManager as createFocusManager, $32daac5f69beb98a$re_export$isElementInChildOfActiveScope as isElementInChildOfActiveScope, $32daac5f69beb98a$re_export$FocusRing as FocusRing, $32daac5f69beb98a$re_export$useFocusRing as useFocusRing, $32daac5f69beb98a$re_export$useHasTabbableChild as useHasTabbableChild, $32daac5f69beb98a$re_export$moveVirtualFocus as moveVirtualFocus, $32daac5f69beb98a$re_export$dispatchVirtualBlur as dispatchVirtualBlur, $32daac5f69beb98a$re_export$dispatchVirtualFocus as dispatchVirtualFocus, $32daac5f69beb98a$re_export$getVirtuallyFocusedElement as getVirtuallyFocusedElement, $32daac5f69beb98a$re_export$isFocusable as isFocusable, $32daac5f69beb98a$re_export$FocusableProvider as FocusableProvider, $32daac5f69beb98a$re_export$useFocusable as useFocusable, $32daac5f69beb98a$re_export$Focusable as Focusable, $32daac5f69beb98a$re_export$focusSafely as focusSafely};
29
37
  //# sourceMappingURL=module.js.map
package/dist/main.js CHANGED
@@ -1,33 +1,37 @@
1
- var $a7a032acae3ddda9$exports = require("./FocusScope.main.js");
2
- var $dfd8c70b928eb1b3$exports = require("./FocusRing.main.js");
3
- var $581a96d6eb128c1b$exports = require("./useFocusRing.main.js");
4
- var $259c6413a286f2e6$exports = require("./useHasTabbableChild.main.js");
5
- var $a756eb2d3b28d089$exports = require("./virtualFocus.main.js");
6
- var $aB6Cp$reactariautils = require("@react-aria/utils");
7
- var $aB6Cp$reactariainteractions = require("@react-aria/interactions");
1
+ var $l7E0u$reactariaFocusScope = require("react-aria/FocusScope");
2
+ var $l7E0u$reactariaprivatefocusFocusScope = require("react-aria/private/focus/FocusScope");
3
+ var $l7E0u$reactariaFocusRing = require("react-aria/FocusRing");
4
+ var $l7E0u$reactariauseFocusRing = require("react-aria/useFocusRing");
5
+ var $l7E0u$reactariaprivatefocususeHasTabbableChild = require("react-aria/private/focus/useHasTabbableChild");
6
+ var $l7E0u$reactariaprivatefocusvirtualFocus = require("react-aria/private/focus/virtualFocus");
7
+ var $l7E0u$reactariaprivateutilsisFocusable = require("react-aria/private/utils/isFocusable");
8
+ var $l7E0u$reactariaprivateinteractionsuseFocusable = require("react-aria/private/interactions/useFocusable");
9
+ var $l7E0u$reactariauseFocusable = require("react-aria/useFocusable");
10
+ var $l7E0u$reactariaFocusable = require("react-aria/Focusable");
11
+ var $l7E0u$reactariaprivateinteractionsfocusSafely = require("react-aria/private/interactions/focusSafely");
8
12
 
9
13
 
10
14
  function $parcel$export(e, n, v, s) {
11
15
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
12
16
  }
13
17
 
14
- $parcel$export(module.exports, "FocusScope", () => $a7a032acae3ddda9$exports.FocusScope);
15
- $parcel$export(module.exports, "useFocusManager", () => $a7a032acae3ddda9$exports.useFocusManager);
16
- $parcel$export(module.exports, "getFocusableTreeWalker", () => $a7a032acae3ddda9$exports.getFocusableTreeWalker);
17
- $parcel$export(module.exports, "createFocusManager", () => $a7a032acae3ddda9$exports.createFocusManager);
18
- $parcel$export(module.exports, "isElementInChildOfActiveScope", () => $a7a032acae3ddda9$exports.isElementInChildOfActiveScope);
19
- $parcel$export(module.exports, "FocusRing", () => $dfd8c70b928eb1b3$exports.FocusRing);
20
- $parcel$export(module.exports, "useFocusRing", () => $581a96d6eb128c1b$exports.useFocusRing);
21
- $parcel$export(module.exports, "useHasTabbableChild", () => $259c6413a286f2e6$exports.useHasTabbableChild);
22
- $parcel$export(module.exports, "moveVirtualFocus", () => $a756eb2d3b28d089$exports.moveVirtualFocus);
23
- $parcel$export(module.exports, "dispatchVirtualBlur", () => $a756eb2d3b28d089$exports.dispatchVirtualBlur);
24
- $parcel$export(module.exports, "dispatchVirtualFocus", () => $a756eb2d3b28d089$exports.dispatchVirtualFocus);
25
- $parcel$export(module.exports, "getVirtuallyFocusedElement", () => $a756eb2d3b28d089$exports.getVirtuallyFocusedElement);
26
- $parcel$export(module.exports, "isFocusable", () => $aB6Cp$reactariautils.isFocusable);
27
- $parcel$export(module.exports, "FocusableProvider", () => $aB6Cp$reactariainteractions.FocusableProvider);
28
- $parcel$export(module.exports, "Focusable", () => $aB6Cp$reactariainteractions.Focusable);
29
- $parcel$export(module.exports, "useFocusable", () => $aB6Cp$reactariainteractions.useFocusable);
30
- $parcel$export(module.exports, "focusSafely", () => $aB6Cp$reactariainteractions.focusSafely);
18
+ $parcel$export(module.exports, "FocusScope", function () { return $l7E0u$reactariaFocusScope.FocusScope; });
19
+ $parcel$export(module.exports, "useFocusManager", function () { return $l7E0u$reactariaFocusScope.useFocusManager; });
20
+ $parcel$export(module.exports, "getFocusableTreeWalker", function () { return $l7E0u$reactariaprivatefocusFocusScope.getFocusableTreeWalker; });
21
+ $parcel$export(module.exports, "createFocusManager", function () { return $l7E0u$reactariaprivatefocusFocusScope.createFocusManager; });
22
+ $parcel$export(module.exports, "isElementInChildOfActiveScope", function () { return $l7E0u$reactariaprivatefocusFocusScope.isElementInChildOfActiveScope; });
23
+ $parcel$export(module.exports, "FocusRing", function () { return $l7E0u$reactariaFocusRing.FocusRing; });
24
+ $parcel$export(module.exports, "useFocusRing", function () { return $l7E0u$reactariauseFocusRing.useFocusRing; });
25
+ $parcel$export(module.exports, "useHasTabbableChild", function () { return $l7E0u$reactariaprivatefocususeHasTabbableChild.useHasTabbableChild; });
26
+ $parcel$export(module.exports, "moveVirtualFocus", function () { return $l7E0u$reactariaprivatefocusvirtualFocus.moveVirtualFocus; });
27
+ $parcel$export(module.exports, "dispatchVirtualBlur", function () { return $l7E0u$reactariaprivatefocusvirtualFocus.dispatchVirtualBlur; });
28
+ $parcel$export(module.exports, "dispatchVirtualFocus", function () { return $l7E0u$reactariaprivatefocusvirtualFocus.dispatchVirtualFocus; });
29
+ $parcel$export(module.exports, "getVirtuallyFocusedElement", function () { return $l7E0u$reactariaprivatefocusvirtualFocus.getVirtuallyFocusedElement; });
30
+ $parcel$export(module.exports, "isFocusable", function () { return $l7E0u$reactariaprivateutilsisFocusable.isFocusable; });
31
+ $parcel$export(module.exports, "FocusableProvider", function () { return $l7E0u$reactariaprivateinteractionsuseFocusable.FocusableProvider; });
32
+ $parcel$export(module.exports, "useFocusable", function () { return $l7E0u$reactariauseFocusable.useFocusable; });
33
+ $parcel$export(module.exports, "Focusable", function () { return $l7E0u$reactariaFocusable.Focusable; });
34
+ $parcel$export(module.exports, "focusSafely", function () { return $l7E0u$reactariaprivateinteractionsfocusSafely.focusSafely; });
31
35
  /*
32
36
  * Copyright 2020 Adobe. All rights reserved.
33
37
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -47,4 +51,8 @@ $parcel$export(module.exports, "focusSafely", () => $aB6Cp$reactariainteractions
47
51
 
48
52
 
49
53
 
54
+
55
+
56
+
57
+
50
58
  //# sourceMappingURL=main.js.map
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/focus/src/index.ts"],"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 {FocusScope, useFocusManager, getFocusableTreeWalker, createFocusManager, isElementInChildOfActiveScope} from './FocusScope';\nexport {FocusRing} from './FocusRing';\nexport {useFocusRing} from './useFocusRing';\nexport {useHasTabbableChild} from './useHasTabbableChild';\nexport {moveVirtualFocus, dispatchVirtualBlur, dispatchVirtualFocus, getVirtuallyFocusedElement} from './virtualFocus';\n// For backward compatibility.\nexport {isFocusable} from '@react-aria/utils';\nexport {FocusableProvider, Focusable, useFocusable, focusSafely} from '@react-aria/interactions';\n\nexport type {FocusScopeProps, FocusManager, FocusManagerOptions} from './FocusScope';\nexport type {FocusRingProps} from './FocusRing';\nexport type {FocusableAria, FocusableOptions, FocusableProviderProps} from '@react-aria/interactions';\nexport type {AriaFocusRingProps, FocusRingAria} from './useFocusRing';\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/focus/src/index.ts"],"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 {FocusScope, useFocusManager} from 'react-aria/FocusScope';\nexport {getFocusableTreeWalker, createFocusManager, isElementInChildOfActiveScope} from 'react-aria/private/focus/FocusScope';\nexport {FocusRing} from 'react-aria/FocusRing';\nexport {useFocusRing} from 'react-aria/useFocusRing';\nexport {useHasTabbableChild} from 'react-aria/private/focus/useHasTabbableChild';\nexport {moveVirtualFocus, dispatchVirtualBlur, dispatchVirtualFocus, getVirtuallyFocusedElement} from 'react-aria/private/focus/virtualFocus';\nexport type {FocusScopeProps, FocusManager, FocusManagerOptions} from 'react-aria/FocusScope';\nexport type {FocusRingProps} from 'react-aria/FocusRing';\nexport type {AriaFocusRingProps, FocusRingAria} from 'react-aria/useFocusRing';\nexport {isFocusable} from 'react-aria/private/utils/isFocusable';\nexport {FocusableProvider} from 'react-aria/private/interactions/useFocusable';\nexport {useFocusable} from 'react-aria/useFocusable';\nexport {Focusable} from 'react-aria/Focusable';\nexport {focusSafely} from 'react-aria/private/interactions/focusSafely';\nexport type {FocusableProviderProps} from 'react-aria/private/interactions/useFocusable';\nexport type {FocusableAria, FocusableOptions} from 'react-aria/useFocusable';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,10 +1,14 @@
1
- import {createFocusManager as $9bf71ea28793e738$export$c5251b9e124bf29, FocusScope as $9bf71ea28793e738$export$20e40289641fbbb6, getFocusableTreeWalker as $9bf71ea28793e738$export$2d6ec8fc375ceafa, isElementInChildOfActiveScope as $9bf71ea28793e738$export$1258395f99bf9cbf, useFocusManager as $9bf71ea28793e738$export$10c5169755ce7bd7} from "./FocusScope.module.js";
2
- import {FocusRing as $907718708eab68af$export$1a38b4ad7f578e1d} from "./FocusRing.module.js";
3
- import {useFocusRing as $f7dceffc5ad7768b$export$4e328f61c538687f} from "./useFocusRing.module.js";
4
- import {useHasTabbableChild as $83013635b024ae3d$export$eac1895992b9f3d6} from "./useHasTabbableChild.module.js";
5
- import {dispatchVirtualBlur as $55f9b1ae81f22853$export$6c5dc7e81d2cc29a, dispatchVirtualFocus as $55f9b1ae81f22853$export$2b35b76d2e30e129, getVirtuallyFocusedElement as $55f9b1ae81f22853$export$759df0d867455a91, moveVirtualFocus as $55f9b1ae81f22853$export$76e4e37e5339496d} from "./virtualFocus.module.js";
6
- import {isFocusable as $d48f97c9d1a8e323$re_export$isFocusable} from "@react-aria/utils";
7
- import {FocusableProvider as $d48f97c9d1a8e323$re_export$FocusableProvider, Focusable as $d48f97c9d1a8e323$re_export$Focusable, useFocusable as $d48f97c9d1a8e323$re_export$useFocusable, focusSafely as $d48f97c9d1a8e323$re_export$focusSafely} from "@react-aria/interactions";
1
+ import {FocusScope as $32daac5f69beb98a$re_export$FocusScope, useFocusManager as $32daac5f69beb98a$re_export$useFocusManager} from "react-aria/FocusScope";
2
+ import {getFocusableTreeWalker as $32daac5f69beb98a$re_export$getFocusableTreeWalker, createFocusManager as $32daac5f69beb98a$re_export$createFocusManager, isElementInChildOfActiveScope as $32daac5f69beb98a$re_export$isElementInChildOfActiveScope} from "react-aria/private/focus/FocusScope";
3
+ import {FocusRing as $32daac5f69beb98a$re_export$FocusRing} from "react-aria/FocusRing";
4
+ import {useFocusRing as $32daac5f69beb98a$re_export$useFocusRing} from "react-aria/useFocusRing";
5
+ import {useHasTabbableChild as $32daac5f69beb98a$re_export$useHasTabbableChild} from "react-aria/private/focus/useHasTabbableChild";
6
+ import {moveVirtualFocus as $32daac5f69beb98a$re_export$moveVirtualFocus, dispatchVirtualBlur as $32daac5f69beb98a$re_export$dispatchVirtualBlur, dispatchVirtualFocus as $32daac5f69beb98a$re_export$dispatchVirtualFocus, getVirtuallyFocusedElement as $32daac5f69beb98a$re_export$getVirtuallyFocusedElement} from "react-aria/private/focus/virtualFocus";
7
+ import {isFocusable as $32daac5f69beb98a$re_export$isFocusable} from "react-aria/private/utils/isFocusable";
8
+ import {FocusableProvider as $32daac5f69beb98a$re_export$FocusableProvider} from "react-aria/private/interactions/useFocusable";
9
+ import {useFocusable as $32daac5f69beb98a$re_export$useFocusable} from "react-aria/useFocusable";
10
+ import {Focusable as $32daac5f69beb98a$re_export$Focusable} from "react-aria/Focusable";
11
+ import {focusSafely as $32daac5f69beb98a$re_export$focusSafely} from "react-aria/private/interactions/focusSafely";
8
12
 
9
13
  /*
10
14
  * Copyright 2020 Adobe. All rights reserved.
@@ -25,5 +29,9 @@ import {FocusableProvider as $d48f97c9d1a8e323$re_export$FocusableProvider, Focu
25
29
 
26
30
 
27
31
 
28
- export {$9bf71ea28793e738$export$20e40289641fbbb6 as FocusScope, $9bf71ea28793e738$export$10c5169755ce7bd7 as useFocusManager, $9bf71ea28793e738$export$2d6ec8fc375ceafa as getFocusableTreeWalker, $9bf71ea28793e738$export$c5251b9e124bf29 as createFocusManager, $9bf71ea28793e738$export$1258395f99bf9cbf as isElementInChildOfActiveScope, $907718708eab68af$export$1a38b4ad7f578e1d as FocusRing, $f7dceffc5ad7768b$export$4e328f61c538687f as useFocusRing, $83013635b024ae3d$export$eac1895992b9f3d6 as useHasTabbableChild, $55f9b1ae81f22853$export$76e4e37e5339496d as moveVirtualFocus, $55f9b1ae81f22853$export$6c5dc7e81d2cc29a as dispatchVirtualBlur, $55f9b1ae81f22853$export$2b35b76d2e30e129 as dispatchVirtualFocus, $55f9b1ae81f22853$export$759df0d867455a91 as getVirtuallyFocusedElement, $d48f97c9d1a8e323$re_export$isFocusable as isFocusable, $d48f97c9d1a8e323$re_export$FocusableProvider as FocusableProvider, $d48f97c9d1a8e323$re_export$Focusable as Focusable, $d48f97c9d1a8e323$re_export$useFocusable as useFocusable, $d48f97c9d1a8e323$re_export$focusSafely as focusSafely};
32
+
33
+
34
+
35
+
36
+ export {$32daac5f69beb98a$re_export$FocusScope as FocusScope, $32daac5f69beb98a$re_export$useFocusManager as useFocusManager, $32daac5f69beb98a$re_export$getFocusableTreeWalker as getFocusableTreeWalker, $32daac5f69beb98a$re_export$createFocusManager as createFocusManager, $32daac5f69beb98a$re_export$isElementInChildOfActiveScope as isElementInChildOfActiveScope, $32daac5f69beb98a$re_export$FocusRing as FocusRing, $32daac5f69beb98a$re_export$useFocusRing as useFocusRing, $32daac5f69beb98a$re_export$useHasTabbableChild as useHasTabbableChild, $32daac5f69beb98a$re_export$moveVirtualFocus as moveVirtualFocus, $32daac5f69beb98a$re_export$dispatchVirtualBlur as dispatchVirtualBlur, $32daac5f69beb98a$re_export$dispatchVirtualFocus as dispatchVirtualFocus, $32daac5f69beb98a$re_export$getVirtuallyFocusedElement as getVirtuallyFocusedElement, $32daac5f69beb98a$re_export$isFocusable as isFocusable, $32daac5f69beb98a$re_export$FocusableProvider as FocusableProvider, $32daac5f69beb98a$re_export$useFocusable as useFocusable, $32daac5f69beb98a$re_export$Focusable as Focusable, $32daac5f69beb98a$re_export$focusSafely as focusSafely};
29
37
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/focus/src/index.ts"],"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 {FocusScope, useFocusManager, getFocusableTreeWalker, createFocusManager, isElementInChildOfActiveScope} from './FocusScope';\nexport {FocusRing} from './FocusRing';\nexport {useFocusRing} from './useFocusRing';\nexport {useHasTabbableChild} from './useHasTabbableChild';\nexport {moveVirtualFocus, dispatchVirtualBlur, dispatchVirtualFocus, getVirtuallyFocusedElement} from './virtualFocus';\n// For backward compatibility.\nexport {isFocusable} from '@react-aria/utils';\nexport {FocusableProvider, Focusable, useFocusable, focusSafely} from '@react-aria/interactions';\n\nexport type {FocusScopeProps, FocusManager, FocusManagerOptions} from './FocusScope';\nexport type {FocusRingProps} from './FocusRing';\nexport type {FocusableAria, FocusableOptions, FocusableProviderProps} from '@react-aria/interactions';\nexport type {AriaFocusRingProps, FocusRingAria} from './useFocusRing';\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/focus/src/index.ts"],"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 {FocusScope, useFocusManager} from 'react-aria/FocusScope';\nexport {getFocusableTreeWalker, createFocusManager, isElementInChildOfActiveScope} from 'react-aria/private/focus/FocusScope';\nexport {FocusRing} from 'react-aria/FocusRing';\nexport {useFocusRing} from 'react-aria/useFocusRing';\nexport {useHasTabbableChild} from 'react-aria/private/focus/useHasTabbableChild';\nexport {moveVirtualFocus, dispatchVirtualBlur, dispatchVirtualFocus, getVirtuallyFocusedElement} from 'react-aria/private/focus/virtualFocus';\nexport type {FocusScopeProps, FocusManager, FocusManagerOptions} from 'react-aria/FocusScope';\nexport type {FocusRingProps} from 'react-aria/FocusRing';\nexport type {AriaFocusRingProps, FocusRingAria} from 'react-aria/useFocusRing';\nexport {isFocusable} from 'react-aria/private/utils/isFocusable';\nexport {FocusableProvider} from 'react-aria/private/interactions/useFocusable';\nexport {useFocusable} from 'react-aria/useFocusable';\nexport {Focusable} from 'react-aria/Focusable';\nexport {focusSafely} from 'react-aria/private/interactions/focusSafely';\nexport type {FocusableProviderProps} from 'react-aria/private/interactions/useFocusable';\nexport type {FocusableAria, FocusableOptions} from 'react-aria/useFocusable';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,16 @@
1
+ export { FocusScope, useFocusManager } from 'react-aria/FocusScope';
2
+ export { getFocusableTreeWalker, createFocusManager, isElementInChildOfActiveScope } from 'react-aria/private/focus/FocusScope';
3
+ export { FocusRing } from 'react-aria/FocusRing';
4
+ export { useFocusRing } from 'react-aria/useFocusRing';
5
+ export { useHasTabbableChild } from 'react-aria/private/focus/useHasTabbableChild';
6
+ export { moveVirtualFocus, dispatchVirtualBlur, dispatchVirtualFocus, getVirtuallyFocusedElement } from 'react-aria/private/focus/virtualFocus';
7
+ export type { FocusScopeProps, FocusManager, FocusManagerOptions } from 'react-aria/FocusScope';
8
+ export type { FocusRingProps } from 'react-aria/FocusRing';
9
+ export type { AriaFocusRingProps, FocusRingAria } from 'react-aria/useFocusRing';
10
+ export { isFocusable } from 'react-aria/private/utils/isFocusable';
11
+ export { FocusableProvider } from 'react-aria/private/interactions/useFocusable';
12
+ export { useFocusable } from 'react-aria/useFocusable';
13
+ export { Focusable } from 'react-aria/Focusable';
14
+ export { focusSafely } from 'react-aria/private/interactions/focusSafely';
15
+ export type { FocusableProviderProps } from 'react-aria/private/interactions/useFocusable';
16
+ export type { FocusableAria, FocusableOptions } from 'react-aria/useFocusable';
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@react-aria/focus",
3
- "version": "3.21.5",
3
+ "version": "3.22.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/module.js",
8
8
  "exports": {
9
- "source": "./src/index.ts",
10
- "types": [
11
- "./dist/types.d.ts",
12
- "./src/index.ts"
13
- ],
14
- "import": "./dist/import.mjs",
15
- "require": "./dist/main.js"
9
+ ".": {
10
+ "source": "./src/index.ts",
11
+ "types": "./dist/types/src/index.d.ts",
12
+ "import": "./dist/import.mjs",
13
+ "require": "./dist/main.js"
14
+ },
15
+ "./package.json": "./package.json"
16
16
  },
17
- "types": "dist/types.d.ts",
17
+ "types": "dist/types/src/index.d.ts",
18
18
  "source": "src/index.ts",
19
19
  "files": [
20
20
  "dist",
@@ -26,11 +26,8 @@
26
26
  "url": "https://github.com/adobe/react-spectrum"
27
27
  },
28
28
  "dependencies": {
29
- "@react-aria/interactions": "^3.27.1",
30
- "@react-aria/utils": "^3.33.1",
31
- "@react-types/shared": "^3.33.1",
32
29
  "@swc/helpers": "^0.5.0",
33
- "clsx": "^2.0.0"
30
+ "react-aria": "3.48.0"
34
31
  },
35
32
  "peerDependencies": {
36
33
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
@@ -39,5 +36,8 @@
39
36
  "publishConfig": {
40
37
  "access": "public"
41
38
  },
42
- "gitHead": "8df187370053aa35f553cb388ad670f65e1ab371"
39
+ "targets": {
40
+ "types": false
41
+ },
42
+ "gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
43
43
  }
package/src/index.ts CHANGED
@@ -10,16 +10,19 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- export {FocusScope, useFocusManager, getFocusableTreeWalker, createFocusManager, isElementInChildOfActiveScope} from './FocusScope';
14
- export {FocusRing} from './FocusRing';
15
- export {useFocusRing} from './useFocusRing';
16
- export {useHasTabbableChild} from './useHasTabbableChild';
17
- export {moveVirtualFocus, dispatchVirtualBlur, dispatchVirtualFocus, getVirtuallyFocusedElement} from './virtualFocus';
18
- // For backward compatibility.
19
- export {isFocusable} from '@react-aria/utils';
20
- export {FocusableProvider, Focusable, useFocusable, focusSafely} from '@react-aria/interactions';
21
-
22
- export type {FocusScopeProps, FocusManager, FocusManagerOptions} from './FocusScope';
23
- export type {FocusRingProps} from './FocusRing';
24
- export type {FocusableAria, FocusableOptions, FocusableProviderProps} from '@react-aria/interactions';
25
- export type {AriaFocusRingProps, FocusRingAria} from './useFocusRing';
13
+ export {FocusScope, useFocusManager} from 'react-aria/FocusScope';
14
+ export {getFocusableTreeWalker, createFocusManager, isElementInChildOfActiveScope} from 'react-aria/private/focus/FocusScope';
15
+ export {FocusRing} from 'react-aria/FocusRing';
16
+ export {useFocusRing} from 'react-aria/useFocusRing';
17
+ export {useHasTabbableChild} from 'react-aria/private/focus/useHasTabbableChild';
18
+ export {moveVirtualFocus, dispatchVirtualBlur, dispatchVirtualFocus, getVirtuallyFocusedElement} from 'react-aria/private/focus/virtualFocus';
19
+ export type {FocusScopeProps, FocusManager, FocusManagerOptions} from 'react-aria/FocusScope';
20
+ export type {FocusRingProps} from 'react-aria/FocusRing';
21
+ export type {AriaFocusRingProps, FocusRingAria} from 'react-aria/useFocusRing';
22
+ export {isFocusable} from 'react-aria/private/utils/isFocusable';
23
+ export {FocusableProvider} from 'react-aria/private/interactions/useFocusable';
24
+ export {useFocusable} from 'react-aria/useFocusable';
25
+ export {Focusable} from 'react-aria/Focusable';
26
+ export {focusSafely} from 'react-aria/private/interactions/focusSafely';
27
+ export type {FocusableProviderProps} from 'react-aria/private/interactions/useFocusable';
28
+ export type {FocusableAria, FocusableOptions} from 'react-aria/useFocusable';
@@ -1,44 +0,0 @@
1
- var $581a96d6eb128c1b$exports = require("./useFocusRing.main.js");
2
- var $hE1Ku$clsx = require("clsx");
3
- var $hE1Ku$reactariautils = require("@react-aria/utils");
4
- var $hE1Ku$react = require("react");
5
-
6
-
7
- function $parcel$interopDefault(a) {
8
- return a && a.__esModule ? a.default : a;
9
- }
10
-
11
- function $parcel$export(e, n, v, s) {
12
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
13
- }
14
-
15
- $parcel$export(module.exports, "FocusRing", () => $dfd8c70b928eb1b3$export$1a38b4ad7f578e1d);
16
- /*
17
- * Copyright 2020 Adobe. All rights reserved.
18
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
19
- * you may not use this file except in compliance with the License. You may obtain a copy
20
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
21
- *
22
- * Unless required by applicable law or agreed to in writing, software distributed under
23
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
24
- * OF ANY KIND, either express or implied. See the License for the specific language
25
- * governing permissions and limitations under the License.
26
- */
27
-
28
-
29
-
30
- function $dfd8c70b928eb1b3$export$1a38b4ad7f578e1d(props) {
31
- let { children: children, focusClass: focusClass, focusRingClass: focusRingClass } = props;
32
- let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $581a96d6eb128c1b$exports.useFocusRing)(props);
33
- let child = (0, ($parcel$interopDefault($hE1Ku$react))).Children.only(children);
34
- return /*#__PURE__*/ (0, ($parcel$interopDefault($hE1Ku$react))).cloneElement(child, (0, $hE1Ku$reactariautils.mergeProps)(child.props, {
35
- ...focusProps,
36
- className: (0, ($parcel$interopDefault($hE1Ku$clsx)))({
37
- [focusClass || '']: isFocused,
38
- [focusRingClass || '']: isFocusVisible
39
- })
40
- }));
41
- }
42
-
43
-
44
- //# sourceMappingURL=FocusRing.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAgCM,SAAS,0CAAU,KAAqB;IAC7C,IAAI,YAAC,QAAQ,cAAE,UAAU,kBAAE,cAAc,EAAC,GAAG;IAC7C,IAAI,aAAC,SAAS,kBAAE,cAAc,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,sCAAW,EAAE;IAC3D,IAAI,QAAQ,CAAA,GAAA,sCAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IAEhC,qBAAO,CAAA,GAAA,sCAAI,EAAE,YAAY,CAAC,OAAO,CAAA,GAAA,gCAAS,EAAE,MAAM,KAAK,EAAS;QAC9D,GAAG,UAAU;QACb,WAAW,CAAA,GAAA,qCAAG,EAAE;YACd,CAAC,cAAc,GAAG,EAAE;YACpB,CAAC,kBAAkB,GAAG,EAAE;QAC1B;IACF;AACF","sources":["packages/@react-aria/focus/src/FocusRing.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\nimport clsx from 'clsx';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {ReactElement} from 'react';\nimport {useFocusRing} from './useFocusRing';\n\nexport interface 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): React.ReactElement<unknown, string | React.JSXElementConstructor<any>> {\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 as any, {\n ...focusProps,\n className: clsx({\n [focusClass || '']: isFocused,\n [focusRingClass || '']: isFocusVisible\n })\n }));\n}\n"],"names":[],"version":3,"file":"FocusRing.main.js.map"}
@@ -1,35 +0,0 @@
1
- import {useFocusRing as $f7dceffc5ad7768b$export$4e328f61c538687f} from "./useFocusRing.mjs";
2
- import $hAmeg$clsx from "clsx";
3
- import {mergeProps as $hAmeg$mergeProps} from "@react-aria/utils";
4
- import $hAmeg$react from "react";
5
-
6
- /*
7
- * Copyright 2020 Adobe. All rights reserved.
8
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
9
- * you may not use this file except in compliance with the License. You may obtain a copy
10
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software distributed under
13
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
14
- * OF ANY KIND, either express or implied. See the License for the specific language
15
- * governing permissions and limitations under the License.
16
- */
17
-
18
-
19
-
20
- function $907718708eab68af$export$1a38b4ad7f578e1d(props) {
21
- let { children: children, focusClass: focusClass, focusRingClass: focusRingClass } = props;
22
- let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $f7dceffc5ad7768b$export$4e328f61c538687f)(props);
23
- let child = (0, $hAmeg$react).Children.only(children);
24
- return /*#__PURE__*/ (0, $hAmeg$react).cloneElement(child, (0, $hAmeg$mergeProps)(child.props, {
25
- ...focusProps,
26
- className: (0, $hAmeg$clsx)({
27
- [focusClass || '']: isFocused,
28
- [focusRingClass || '']: isFocusVisible
29
- })
30
- }));
31
- }
32
-
33
-
34
- export {$907718708eab68af$export$1a38b4ad7f578e1d as FocusRing};
35
- //# sourceMappingURL=FocusRing.module.js.map
@@ -1,35 +0,0 @@
1
- import {useFocusRing as $f7dceffc5ad7768b$export$4e328f61c538687f} from "./useFocusRing.module.js";
2
- import $hAmeg$clsx from "clsx";
3
- import {mergeProps as $hAmeg$mergeProps} from "@react-aria/utils";
4
- import $hAmeg$react from "react";
5
-
6
- /*
7
- * Copyright 2020 Adobe. All rights reserved.
8
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
9
- * you may not use this file except in compliance with the License. You may obtain a copy
10
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software distributed under
13
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
14
- * OF ANY KIND, either express or implied. See the License for the specific language
15
- * governing permissions and limitations under the License.
16
- */
17
-
18
-
19
-
20
- function $907718708eab68af$export$1a38b4ad7f578e1d(props) {
21
- let { children: children, focusClass: focusClass, focusRingClass: focusRingClass } = props;
22
- let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $f7dceffc5ad7768b$export$4e328f61c538687f)(props);
23
- let child = (0, $hAmeg$react).Children.only(children);
24
- return /*#__PURE__*/ (0, $hAmeg$react).cloneElement(child, (0, $hAmeg$mergeProps)(child.props, {
25
- ...focusProps,
26
- className: (0, $hAmeg$clsx)({
27
- [focusClass || '']: isFocused,
28
- [focusRingClass || '']: isFocusVisible
29
- })
30
- }));
31
- }
32
-
33
-
34
- export {$907718708eab68af$export$1a38b4ad7f578e1d as FocusRing};
35
- //# sourceMappingURL=FocusRing.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AAgCM,SAAS,0CAAU,KAAqB;IAC7C,IAAI,YAAC,QAAQ,cAAE,UAAU,kBAAE,cAAc,EAAC,GAAG;IAC7C,IAAI,aAAC,SAAS,kBAAE,cAAc,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,yCAAW,EAAE;IAC3D,IAAI,QAAQ,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IAEhC,qBAAO,CAAA,GAAA,YAAI,EAAE,YAAY,CAAC,OAAO,CAAA,GAAA,iBAAS,EAAE,MAAM,KAAK,EAAS;QAC9D,GAAG,UAAU;QACb,WAAW,CAAA,GAAA,WAAG,EAAE;YACd,CAAC,cAAc,GAAG,EAAE;YACpB,CAAC,kBAAkB,GAAG,EAAE;QAC1B;IACF;AACF","sources":["packages/@react-aria/focus/src/FocusRing.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\nimport clsx from 'clsx';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {ReactElement} from 'react';\nimport {useFocusRing} from './useFocusRing';\n\nexport interface 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): React.ReactElement<unknown, string | React.JSXElementConstructor<any>> {\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 as any, {\n ...focusProps,\n className: clsx({\n [focusClass || '']: isFocused,\n [focusRingClass || '']: isFocusVisible\n })\n }));\n}\n"],"names":[],"version":3,"file":"FocusRing.module.js.map"}