@react-aria/utils 3.33.1 → 3.34.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 (262) hide show
  1. package/dist/import.mjs +47 -43
  2. package/dist/main.js +120 -115
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +47 -43
  5. package/dist/module.js.map +1 -1
  6. package/dist/types/src/index.d.ts +45 -0
  7. package/package.json +15 -15
  8. package/src/index.ts +45 -43
  9. package/dist/DOMFunctions.main.js +0 -57
  10. package/dist/DOMFunctions.main.js.map +0 -1
  11. package/dist/DOMFunctions.mjs +0 -49
  12. package/dist/DOMFunctions.module.js +0 -49
  13. package/dist/DOMFunctions.module.js.map +0 -1
  14. package/dist/ShadowTreeWalker.main.js +0 -200
  15. package/dist/ShadowTreeWalker.main.js.map +0 -1
  16. package/dist/ShadowTreeWalker.mjs +0 -194
  17. package/dist/ShadowTreeWalker.module.js +0 -194
  18. package/dist/ShadowTreeWalker.module.js.map +0 -1
  19. package/dist/animation.main.js +0 -97
  20. package/dist/animation.main.js.map +0 -1
  21. package/dist/animation.mjs +0 -91
  22. package/dist/animation.module.js +0 -91
  23. package/dist/animation.module.js.map +0 -1
  24. package/dist/chain.main.js +0 -26
  25. package/dist/chain.main.js.map +0 -1
  26. package/dist/chain.mjs +0 -21
  27. package/dist/chain.module.js +0 -21
  28. package/dist/chain.module.js.map +0 -1
  29. package/dist/constants.main.js +0 -23
  30. package/dist/constants.main.js.map +0 -1
  31. package/dist/constants.mjs +0 -17
  32. package/dist/constants.module.js +0 -17
  33. package/dist/constants.module.js.map +0 -1
  34. package/dist/domHelpers.main.js +0 -28
  35. package/dist/domHelpers.main.js.map +0 -1
  36. package/dist/domHelpers.mjs +0 -21
  37. package/dist/domHelpers.module.js +0 -21
  38. package/dist/domHelpers.module.js.map +0 -1
  39. package/dist/filterDOMProps.main.js +0 -88
  40. package/dist/filterDOMProps.main.js.map +0 -1
  41. package/dist/filterDOMProps.mjs +0 -83
  42. package/dist/filterDOMProps.module.js +0 -83
  43. package/dist/filterDOMProps.module.js.map +0 -1
  44. package/dist/focusWithoutScrolling.main.js +0 -72
  45. package/dist/focusWithoutScrolling.main.js.map +0 -1
  46. package/dist/focusWithoutScrolling.mjs +0 -67
  47. package/dist/focusWithoutScrolling.module.js +0 -67
  48. package/dist/focusWithoutScrolling.module.js.map +0 -1
  49. package/dist/getOffset.main.js +0 -24
  50. package/dist/getOffset.main.js.map +0 -1
  51. package/dist/getOffset.mjs +0 -19
  52. package/dist/getOffset.module.js +0 -19
  53. package/dist/getOffset.module.js.map +0 -1
  54. package/dist/getScrollParent.main.js +0 -28
  55. package/dist/getScrollParent.main.js.map +0 -1
  56. package/dist/getScrollParent.mjs +0 -23
  57. package/dist/getScrollParent.module.js +0 -23
  58. package/dist/getScrollParent.module.js.map +0 -1
  59. package/dist/getScrollParents.main.js +0 -31
  60. package/dist/getScrollParents.main.js.map +0 -1
  61. package/dist/getScrollParents.mjs +0 -26
  62. package/dist/getScrollParents.module.js +0 -26
  63. package/dist/getScrollParents.module.js.map +0 -1
  64. package/dist/inertValue.main.js +0 -19
  65. package/dist/inertValue.main.js.map +0 -1
  66. package/dist/inertValue.mjs +0 -14
  67. package/dist/inertValue.module.js +0 -14
  68. package/dist/inertValue.module.js.map +0 -1
  69. package/dist/isElementVisible.main.js +0 -45
  70. package/dist/isElementVisible.main.js.map +0 -1
  71. package/dist/isElementVisible.mjs +0 -40
  72. package/dist/isElementVisible.module.js +0 -40
  73. package/dist/isElementVisible.module.js.map +0 -1
  74. package/dist/isFocusable.main.js +0 -56
  75. package/dist/isFocusable.main.js.map +0 -1
  76. package/dist/isFocusable.mjs +0 -50
  77. package/dist/isFocusable.module.js +0 -50
  78. package/dist/isFocusable.module.js.map +0 -1
  79. package/dist/isScrollable.main.js +0 -29
  80. package/dist/isScrollable.main.js.map +0 -1
  81. package/dist/isScrollable.mjs +0 -24
  82. package/dist/isScrollable.module.js +0 -24
  83. package/dist/isScrollable.module.js.map +0 -1
  84. package/dist/isVirtualEvent.main.js +0 -41
  85. package/dist/isVirtualEvent.main.js.map +0 -1
  86. package/dist/isVirtualEvent.mjs +0 -35
  87. package/dist/isVirtualEvent.module.js +0 -35
  88. package/dist/isVirtualEvent.module.js.map +0 -1
  89. package/dist/keyboard.main.js +0 -42
  90. package/dist/keyboard.main.js.map +0 -1
  91. package/dist/keyboard.mjs +0 -36
  92. package/dist/keyboard.module.js +0 -36
  93. package/dist/keyboard.module.js.map +0 -1
  94. package/dist/mergeProps.main.js +0 -54
  95. package/dist/mergeProps.main.js.map +0 -1
  96. package/dist/mergeProps.mjs +0 -45
  97. package/dist/mergeProps.module.js +0 -45
  98. package/dist/mergeProps.module.js.map +0 -1
  99. package/dist/mergeRefs.main.js +0 -40
  100. package/dist/mergeRefs.main.js.map +0 -1
  101. package/dist/mergeRefs.mjs +0 -35
  102. package/dist/mergeRefs.module.js +0 -35
  103. package/dist/mergeRefs.module.js.map +0 -1
  104. package/dist/openLink.main.js +0 -169
  105. package/dist/openLink.main.js.map +0 -1
  106. package/dist/openLink.mjs +0 -153
  107. package/dist/openLink.module.js +0 -153
  108. package/dist/openLink.module.js.map +0 -1
  109. package/dist/platform.main.js +0 -73
  110. package/dist/platform.main.js.map +0 -1
  111. package/dist/platform.mjs +0 -60
  112. package/dist/platform.module.js +0 -60
  113. package/dist/platform.module.js.map +0 -1
  114. package/dist/runAfterTransition.main.js +0 -97
  115. package/dist/runAfterTransition.main.js.map +0 -1
  116. package/dist/runAfterTransition.mjs +0 -92
  117. package/dist/runAfterTransition.module.js +0 -92
  118. package/dist/runAfterTransition.module.js.map +0 -1
  119. package/dist/scrollIntoView.main.js +0 -138
  120. package/dist/scrollIntoView.main.js.map +0 -1
  121. package/dist/scrollIntoView.mjs +0 -132
  122. package/dist/scrollIntoView.module.js +0 -132
  123. package/dist/scrollIntoView.module.js.map +0 -1
  124. package/dist/types.d.ts +0 -299
  125. package/dist/types.d.ts.map +0 -1
  126. package/dist/useDeepMemo.main.js +0 -30
  127. package/dist/useDeepMemo.main.js.map +0 -1
  128. package/dist/useDeepMemo.mjs +0 -25
  129. package/dist/useDeepMemo.module.js +0 -25
  130. package/dist/useDeepMemo.module.js.map +0 -1
  131. package/dist/useDescription.main.js +0 -59
  132. package/dist/useDescription.main.js.map +0 -1
  133. package/dist/useDescription.mjs +0 -54
  134. package/dist/useDescription.module.js +0 -54
  135. package/dist/useDescription.module.js.map +0 -1
  136. package/dist/useDrag1D.main.js +0 -141
  137. package/dist/useDrag1D.main.js.map +0 -1
  138. package/dist/useDrag1D.mjs +0 -136
  139. package/dist/useDrag1D.module.js +0 -136
  140. package/dist/useDrag1D.module.js.map +0 -1
  141. package/dist/useEffectEvent.main.js +0 -45
  142. package/dist/useEffectEvent.main.js.map +0 -1
  143. package/dist/useEffectEvent.mjs +0 -36
  144. package/dist/useEffectEvent.module.js +0 -36
  145. package/dist/useEffectEvent.module.js.map +0 -1
  146. package/dist/useEvent.main.js +0 -41
  147. package/dist/useEvent.main.js.map +0 -1
  148. package/dist/useEvent.mjs +0 -36
  149. package/dist/useEvent.module.js +0 -36
  150. package/dist/useEvent.module.js.map +0 -1
  151. package/dist/useFormReset.main.js +0 -39
  152. package/dist/useFormReset.main.js.map +0 -1
  153. package/dist/useFormReset.mjs +0 -34
  154. package/dist/useFormReset.module.js +0 -34
  155. package/dist/useFormReset.module.js.map +0 -1
  156. package/dist/useGlobalListeners.main.js +0 -62
  157. package/dist/useGlobalListeners.main.js.map +0 -1
  158. package/dist/useGlobalListeners.mjs +0 -57
  159. package/dist/useGlobalListeners.module.js +0 -57
  160. package/dist/useGlobalListeners.module.js.map +0 -1
  161. package/dist/useId.main.js +0 -108
  162. package/dist/useId.main.js.map +0 -1
  163. package/dist/useId.mjs +0 -101
  164. package/dist/useId.module.js +0 -101
  165. package/dist/useId.module.js.map +0 -1
  166. package/dist/useLabels.main.js +0 -44
  167. package/dist/useLabels.main.js.map +0 -1
  168. package/dist/useLabels.mjs +0 -39
  169. package/dist/useLabels.module.js +0 -39
  170. package/dist/useLabels.module.js.map +0 -1
  171. package/dist/useLayoutEffect.main.js +0 -27
  172. package/dist/useLayoutEffect.main.js.map +0 -1
  173. package/dist/useLayoutEffect.mjs +0 -18
  174. package/dist/useLayoutEffect.module.js +0 -18
  175. package/dist/useLayoutEffect.module.js.map +0 -1
  176. package/dist/useLoadMore.main.js +0 -73
  177. package/dist/useLoadMore.main.js.map +0 -1
  178. package/dist/useLoadMore.mjs +0 -68
  179. package/dist/useLoadMore.module.js +0 -68
  180. package/dist/useLoadMore.module.js.map +0 -1
  181. package/dist/useLoadMoreSentinel.main.js +0 -58
  182. package/dist/useLoadMoreSentinel.main.js.map +0 -1
  183. package/dist/useLoadMoreSentinel.mjs +0 -53
  184. package/dist/useLoadMoreSentinel.module.js +0 -53
  185. package/dist/useLoadMoreSentinel.module.js.map +0 -1
  186. package/dist/useObjectRef.main.js +0 -58
  187. package/dist/useObjectRef.main.js.map +0 -1
  188. package/dist/useObjectRef.mjs +0 -53
  189. package/dist/useObjectRef.module.js +0 -53
  190. package/dist/useObjectRef.module.js.map +0 -1
  191. package/dist/useResizeObserver.main.js +0 -47
  192. package/dist/useResizeObserver.main.js.map +0 -1
  193. package/dist/useResizeObserver.mjs +0 -42
  194. package/dist/useResizeObserver.module.js +0 -42
  195. package/dist/useResizeObserver.module.js.map +0 -1
  196. package/dist/useSyncRef.main.js +0 -32
  197. package/dist/useSyncRef.main.js.map +0 -1
  198. package/dist/useSyncRef.mjs +0 -27
  199. package/dist/useSyncRef.module.js +0 -27
  200. package/dist/useSyncRef.module.js.map +0 -1
  201. package/dist/useUpdateEffect.main.js +0 -42
  202. package/dist/useUpdateEffect.main.js.map +0 -1
  203. package/dist/useUpdateEffect.mjs +0 -37
  204. package/dist/useUpdateEffect.module.js +0 -37
  205. package/dist/useUpdateEffect.module.js.map +0 -1
  206. package/dist/useUpdateLayoutEffect.main.js +0 -40
  207. package/dist/useUpdateLayoutEffect.main.js.map +0 -1
  208. package/dist/useUpdateLayoutEffect.mjs +0 -35
  209. package/dist/useUpdateLayoutEffect.module.js +0 -35
  210. package/dist/useUpdateLayoutEffect.module.js.map +0 -1
  211. package/dist/useValueEffect.main.js +0 -63
  212. package/dist/useValueEffect.main.js.map +0 -1
  213. package/dist/useValueEffect.mjs +0 -58
  214. package/dist/useValueEffect.module.js +0 -58
  215. package/dist/useValueEffect.module.js.map +0 -1
  216. package/dist/useViewportSize.main.js +0 -84
  217. package/dist/useViewportSize.main.js.map +0 -1
  218. package/dist/useViewportSize.mjs +0 -79
  219. package/dist/useViewportSize.module.js +0 -79
  220. package/dist/useViewportSize.module.js.map +0 -1
  221. package/src/animation.ts +0 -103
  222. package/src/chain.ts +0 -24
  223. package/src/constants.ts +0 -15
  224. package/src/domHelpers.ts +0 -33
  225. package/src/filterDOMProps.ts +0 -127
  226. package/src/focusWithoutScrolling.ts +0 -96
  227. package/src/getOffset.ts +0 -21
  228. package/src/getScrollParent.ts +0 -27
  229. package/src/getScrollParents.ts +0 -27
  230. package/src/inertValue.ts +0 -11
  231. package/src/isElementVisible.ts +0 -75
  232. package/src/isFocusable.ts +0 -56
  233. package/src/isScrollable.ts +0 -31
  234. package/src/isVirtualEvent.ts +0 -58
  235. package/src/keyboard.tsx +0 -48
  236. package/src/mergeProps.ts +0 -77
  237. package/src/mergeRefs.ts +0 -52
  238. package/src/openLink.tsx +0 -201
  239. package/src/platform.ts +0 -78
  240. package/src/runAfterTransition.ts +0 -124
  241. package/src/scrollIntoView.ts +0 -168
  242. package/src/shadowdom/DOMFunctions.ts +0 -100
  243. package/src/shadowdom/ShadowTreeWalker.ts +0 -319
  244. package/src/useDeepMemo.ts +0 -27
  245. package/src/useDescription.ts +0 -56
  246. package/src/useDrag1D.ts +0 -191
  247. package/src/useEffectEvent.ts +0 -30
  248. package/src/useEvent.ts +0 -37
  249. package/src/useFormReset.ts +0 -36
  250. package/src/useGlobalListeners.ts +0 -52
  251. package/src/useId.ts +0 -129
  252. package/src/useLabels.ts +0 -48
  253. package/src/useLayoutEffect.ts +0 -20
  254. package/src/useLoadMore.ts +0 -82
  255. package/src/useLoadMoreSentinel.ts +0 -63
  256. package/src/useObjectRef.ts +0 -69
  257. package/src/useResizeObserver.ts +0 -52
  258. package/src/useSyncRef.ts +0 -33
  259. package/src/useUpdateEffect.ts +0 -39
  260. package/src/useUpdateLayoutEffect.ts +0 -37
  261. package/src/useValueEffect.ts +0 -68
  262. package/src/useViewportSize.ts +0 -103
@@ -1,97 +0,0 @@
1
- var $78605a5d7424e31b$exports = require("./useLayoutEffect.main.js");
2
- var $bsryd$reactdom = require("react-dom");
3
- var $bsryd$react = require("react");
4
-
5
-
6
- function $parcel$export(e, n, v, s) {
7
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
8
- }
9
-
10
- $parcel$export(module.exports, "useEnterAnimation", () => $5bd06107f98811f5$export$6d3443f2c48bfc20);
11
- $parcel$export(module.exports, "useExitAnimation", () => $5bd06107f98811f5$export$45fda7c47f93fd48);
12
- /*
13
- * Copyright 2020 Adobe. All rights reserved.
14
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
15
- * you may not use this file except in compliance with the License. You may obtain a copy
16
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
17
- *
18
- * Unless required by applicable law or agreed to in writing, software distributed under
19
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
20
- * OF ANY KIND, either express or implied. See the License for the specific language
21
- * governing permissions and limitations under the License.
22
- */
23
-
24
-
25
- function $5bd06107f98811f5$export$6d3443f2c48bfc20(ref, isReady = true) {
26
- let [isEntering, setEntering] = (0, $bsryd$react.useState)(true);
27
- let isAnimationReady = isEntering && isReady;
28
- // There are two cases for entry animations:
29
- // 1. CSS @keyframes. The `animation` property is set during the isEntering state, and it is removed after the animation finishes.
30
- // 2. CSS transitions. The initial styles are applied during the isEntering state, and removed immediately, causing the transition to occur.
31
- //
32
- // In the second case, cancel any transitions that were triggered prior to the isEntering = false state (when the transition is supposed to start).
33
- // This can happen when isReady starts as false (e.g. popovers prior to placement calculation).
34
- (0, $78605a5d7424e31b$exports.useLayoutEffect)(()=>{
35
- if (isAnimationReady && ref.current && 'getAnimations' in ref.current) {
36
- for (let animation of ref.current.getAnimations())if (animation instanceof CSSTransition) animation.cancel();
37
- }
38
- }, [
39
- ref,
40
- isAnimationReady
41
- ]);
42
- $5bd06107f98811f5$var$useAnimation(ref, isAnimationReady, (0, $bsryd$react.useCallback)(()=>setEntering(false), []));
43
- return isAnimationReady;
44
- }
45
- function $5bd06107f98811f5$export$45fda7c47f93fd48(ref, isOpen) {
46
- let [exitState, setExitState] = (0, $bsryd$react.useState)(isOpen ? 'open' : 'closed');
47
- switch(exitState){
48
- case 'open':
49
- // If isOpen becomes false, set the state to exiting.
50
- if (!isOpen) setExitState('exiting');
51
- break;
52
- case 'closed':
53
- case 'exiting':
54
- // If we are exiting and isOpen becomes true, the animation was interrupted.
55
- // Reset the state to open.
56
- if (isOpen) setExitState('open');
57
- break;
58
- }
59
- let isExiting = exitState === 'exiting';
60
- $5bd06107f98811f5$var$useAnimation(ref, isExiting, (0, $bsryd$react.useCallback)(()=>{
61
- // Set the state to closed, which will cause the element to be unmounted.
62
- setExitState((state)=>state === 'exiting' ? 'closed' : state);
63
- }, []));
64
- return isExiting;
65
- }
66
- function $5bd06107f98811f5$var$useAnimation(ref, isActive, onEnd) {
67
- (0, $78605a5d7424e31b$exports.useLayoutEffect)(()=>{
68
- if (isActive && ref.current) {
69
- if (!('getAnimations' in ref.current)) {
70
- // JSDOM
71
- onEnd();
72
- return;
73
- }
74
- let animations = ref.current.getAnimations();
75
- if (animations.length === 0) {
76
- onEnd();
77
- return;
78
- }
79
- let canceled = false;
80
- Promise.all(animations.map((a)=>a.finished)).then(()=>{
81
- if (!canceled) (0, $bsryd$reactdom.flushSync)(()=>{
82
- onEnd();
83
- });
84
- }).catch(()=>{});
85
- return ()=>{
86
- canceled = true;
87
- };
88
- }
89
- }, [
90
- ref,
91
- isActive,
92
- onEnd
93
- ]);
94
- }
95
-
96
-
97
- //# sourceMappingURL=animation.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAMM,SAAS,0CAAkB,GAAkC,EAAE,UAAmB,IAAI;IAC3F,IAAI,CAAC,YAAY,YAAY,GAAG,CAAA,GAAA,qBAAO,EAAE;IACzC,IAAI,mBAAmB,cAAc;IAErC,4CAA4C;IAC5C,kIAAkI;IAClI,4IAA4I;IAC5I,EAAE;IACF,mJAAmJ;IACnJ,+FAA+F;IAC/F,CAAA,GAAA,yCAAc,EAAE;QACd,IAAI,oBAAoB,IAAI,OAAO,IAAI,mBAAmB,IAAI,OAAO,EAAE;YACrE,KAAK,IAAI,aAAa,IAAI,OAAO,CAAC,aAAa,GAC7C,IAAI,qBAAqB,eACvB,UAAU,MAAM;QAGtB;IACF,GAAG;QAAC;QAAK;KAAiB;IAE1B,mCAAa,KAAK,kBAAkB,CAAA,GAAA,wBAAU,EAAE,IAAM,YAAY,QAAQ,EAAE;IAC5E,OAAO;AACT;AAEO,SAAS,0CAAiB,GAAkC,EAAE,MAAe;IAClF,IAAI,CAAC,WAAW,aAAa,GAAG,CAAA,GAAA,qBAAO,EAAiC,SAAS,SAAS;IAE1F,OAAQ;QACN,KAAK;YACH,qDAAqD;YACrD,IAAI,CAAC,QACH,aAAa;YAEf;QACF,KAAK;QACL,KAAK;YACH,4EAA4E;YAC5E,2BAA2B;YAC3B,IAAI,QACF,aAAa;YAEf;IACJ;IAEA,IAAI,YAAY,cAAc;IAC9B,mCACE,KACA,WACA,CAAA,GAAA,wBAAU,EAAE;QACV,yEAAyE;QACzE,aAAa,CAAA,QAAS,UAAU,YAAY,WAAW;IACzD,GAAG,EAAE;IAGP,OAAO;AACT;AAEA,SAAS,mCAAa,GAAkC,EAAE,QAAiB,EAAE,KAAiB;IAC5F,CAAA,GAAA,yCAAc,EAAE;QACd,IAAI,YAAY,IAAI,OAAO,EAAE;YAC3B,IAAI,CAAE,CAAA,mBAAmB,IAAI,OAAO,AAAD,GAAI;gBACrC,QAAQ;gBACR;gBACA;YACF;YAEA,IAAI,aAAa,IAAI,OAAO,CAAC,aAAa;YAC1C,IAAI,WAAW,MAAM,KAAK,GAAG;gBAC3B;gBACA;YACF;YAEA,IAAI,WAAW;YACf,QAAQ,GAAG,CAAC,WAAW,GAAG,CAAC,CAAA,IAAK,EAAE,QAAQ,GAAG,IAAI,CAAC;gBAChD,IAAI,CAAC,UACH,CAAA,GAAA,yBAAQ,EAAE;oBACR;gBACF;YAEJ,GAAG,KAAK,CAAC,KAAO;YAEhB,OAAO;gBACL,WAAW;YACb;QACF;IACF,GAAG;QAAC;QAAK;QAAU;KAAM;AAC3B","sources":["packages/@react-aria/utils/src/animation.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\nimport {flushSync} from 'react-dom';\nimport {RefObject, useCallback, useState} from 'react';\nimport {useLayoutEffect} from './useLayoutEffect';\n\nexport function useEnterAnimation(ref: RefObject<HTMLElement | null>, isReady: boolean = true): boolean {\n let [isEntering, setEntering] = useState(true);\n let isAnimationReady = isEntering && isReady;\n\n // There are two cases for entry animations:\n // 1. CSS @keyframes. The `animation` property is set during the isEntering state, and it is removed after the animation finishes.\n // 2. CSS transitions. The initial styles are applied during the isEntering state, and removed immediately, causing the transition to occur.\n //\n // In the second case, cancel any transitions that were triggered prior to the isEntering = false state (when the transition is supposed to start).\n // This can happen when isReady starts as false (e.g. popovers prior to placement calculation).\n useLayoutEffect(() => {\n if (isAnimationReady && ref.current && 'getAnimations' in ref.current) {\n for (let animation of ref.current.getAnimations()) {\n if (animation instanceof CSSTransition) {\n animation.cancel();\n }\n }\n }\n }, [ref, isAnimationReady]);\n\n useAnimation(ref, isAnimationReady, useCallback(() => setEntering(false), []));\n return isAnimationReady;\n}\n\nexport function useExitAnimation(ref: RefObject<HTMLElement | null>, isOpen: boolean): boolean {\n let [exitState, setExitState] = useState<'closed' | 'open' | 'exiting'>(isOpen ? 'open' : 'closed');\n\n switch (exitState) {\n case 'open':\n // If isOpen becomes false, set the state to exiting.\n if (!isOpen) {\n setExitState('exiting');\n }\n break;\n case 'closed':\n case 'exiting':\n // If we are exiting and isOpen becomes true, the animation was interrupted.\n // Reset the state to open.\n if (isOpen) {\n setExitState('open');\n }\n break;\n }\n\n let isExiting = exitState === 'exiting';\n useAnimation(\n ref,\n isExiting,\n useCallback(() => {\n // Set the state to closed, which will cause the element to be unmounted.\n setExitState(state => state === 'exiting' ? 'closed' : state);\n }, [])\n );\n\n return isExiting;\n}\n\nfunction useAnimation(ref: RefObject<HTMLElement | null>, isActive: boolean, onEnd: () => void): void {\n useLayoutEffect(() => {\n if (isActive && ref.current) {\n if (!('getAnimations' in ref.current)) {\n // JSDOM\n onEnd();\n return;\n }\n\n let animations = ref.current.getAnimations();\n if (animations.length === 0) {\n onEnd();\n return;\n }\n\n let canceled = false;\n Promise.all(animations.map(a => a.finished)).then(() => {\n if (!canceled) {\n flushSync(() => {\n onEnd();\n });\n }\n }).catch(() => {});\n\n return () => {\n canceled = true;\n };\n }\n }, [ref, isActive, onEnd]);\n}\n"],"names":[],"version":3,"file":"animation.main.js.map"}
@@ -1,91 +0,0 @@
1
- import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.mjs";
2
- import {flushSync as $jJMAe$flushSync} from "react-dom";
3
- import {useState as $jJMAe$useState, useCallback as $jJMAe$useCallback} from "react";
4
-
5
- /*
6
- * Copyright 2020 Adobe. All rights reserved.
7
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License. You may obtain a copy
9
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software distributed under
12
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13
- * OF ANY KIND, either express or implied. See the License for the specific language
14
- * governing permissions and limitations under the License.
15
- */
16
-
17
-
18
- function $d3f049242431219c$export$6d3443f2c48bfc20(ref, isReady = true) {
19
- let [isEntering, setEntering] = (0, $jJMAe$useState)(true);
20
- let isAnimationReady = isEntering && isReady;
21
- // There are two cases for entry animations:
22
- // 1. CSS @keyframes. The `animation` property is set during the isEntering state, and it is removed after the animation finishes.
23
- // 2. CSS transitions. The initial styles are applied during the isEntering state, and removed immediately, causing the transition to occur.
24
- //
25
- // In the second case, cancel any transitions that were triggered prior to the isEntering = false state (when the transition is supposed to start).
26
- // This can happen when isReady starts as false (e.g. popovers prior to placement calculation).
27
- (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
28
- if (isAnimationReady && ref.current && 'getAnimations' in ref.current) {
29
- for (let animation of ref.current.getAnimations())if (animation instanceof CSSTransition) animation.cancel();
30
- }
31
- }, [
32
- ref,
33
- isAnimationReady
34
- ]);
35
- $d3f049242431219c$var$useAnimation(ref, isAnimationReady, (0, $jJMAe$useCallback)(()=>setEntering(false), []));
36
- return isAnimationReady;
37
- }
38
- function $d3f049242431219c$export$45fda7c47f93fd48(ref, isOpen) {
39
- let [exitState, setExitState] = (0, $jJMAe$useState)(isOpen ? 'open' : 'closed');
40
- switch(exitState){
41
- case 'open':
42
- // If isOpen becomes false, set the state to exiting.
43
- if (!isOpen) setExitState('exiting');
44
- break;
45
- case 'closed':
46
- case 'exiting':
47
- // If we are exiting and isOpen becomes true, the animation was interrupted.
48
- // Reset the state to open.
49
- if (isOpen) setExitState('open');
50
- break;
51
- }
52
- let isExiting = exitState === 'exiting';
53
- $d3f049242431219c$var$useAnimation(ref, isExiting, (0, $jJMAe$useCallback)(()=>{
54
- // Set the state to closed, which will cause the element to be unmounted.
55
- setExitState((state)=>state === 'exiting' ? 'closed' : state);
56
- }, []));
57
- return isExiting;
58
- }
59
- function $d3f049242431219c$var$useAnimation(ref, isActive, onEnd) {
60
- (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
61
- if (isActive && ref.current) {
62
- if (!('getAnimations' in ref.current)) {
63
- // JSDOM
64
- onEnd();
65
- return;
66
- }
67
- let animations = ref.current.getAnimations();
68
- if (animations.length === 0) {
69
- onEnd();
70
- return;
71
- }
72
- let canceled = false;
73
- Promise.all(animations.map((a)=>a.finished)).then(()=>{
74
- if (!canceled) (0, $jJMAe$flushSync)(()=>{
75
- onEnd();
76
- });
77
- }).catch(()=>{});
78
- return ()=>{
79
- canceled = true;
80
- };
81
- }
82
- }, [
83
- ref,
84
- isActive,
85
- onEnd
86
- ]);
87
- }
88
-
89
-
90
- export {$d3f049242431219c$export$6d3443f2c48bfc20 as useEnterAnimation, $d3f049242431219c$export$45fda7c47f93fd48 as useExitAnimation};
91
- //# sourceMappingURL=animation.module.js.map
@@ -1,91 +0,0 @@
1
- import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.module.js";
2
- import {flushSync as $jJMAe$flushSync} from "react-dom";
3
- import {useState as $jJMAe$useState, useCallback as $jJMAe$useCallback} from "react";
4
-
5
- /*
6
- * Copyright 2020 Adobe. All rights reserved.
7
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License. You may obtain a copy
9
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software distributed under
12
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13
- * OF ANY KIND, either express or implied. See the License for the specific language
14
- * governing permissions and limitations under the License.
15
- */
16
-
17
-
18
- function $d3f049242431219c$export$6d3443f2c48bfc20(ref, isReady = true) {
19
- let [isEntering, setEntering] = (0, $jJMAe$useState)(true);
20
- let isAnimationReady = isEntering && isReady;
21
- // There are two cases for entry animations:
22
- // 1. CSS @keyframes. The `animation` property is set during the isEntering state, and it is removed after the animation finishes.
23
- // 2. CSS transitions. The initial styles are applied during the isEntering state, and removed immediately, causing the transition to occur.
24
- //
25
- // In the second case, cancel any transitions that were triggered prior to the isEntering = false state (when the transition is supposed to start).
26
- // This can happen when isReady starts as false (e.g. popovers prior to placement calculation).
27
- (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
28
- if (isAnimationReady && ref.current && 'getAnimations' in ref.current) {
29
- for (let animation of ref.current.getAnimations())if (animation instanceof CSSTransition) animation.cancel();
30
- }
31
- }, [
32
- ref,
33
- isAnimationReady
34
- ]);
35
- $d3f049242431219c$var$useAnimation(ref, isAnimationReady, (0, $jJMAe$useCallback)(()=>setEntering(false), []));
36
- return isAnimationReady;
37
- }
38
- function $d3f049242431219c$export$45fda7c47f93fd48(ref, isOpen) {
39
- let [exitState, setExitState] = (0, $jJMAe$useState)(isOpen ? 'open' : 'closed');
40
- switch(exitState){
41
- case 'open':
42
- // If isOpen becomes false, set the state to exiting.
43
- if (!isOpen) setExitState('exiting');
44
- break;
45
- case 'closed':
46
- case 'exiting':
47
- // If we are exiting and isOpen becomes true, the animation was interrupted.
48
- // Reset the state to open.
49
- if (isOpen) setExitState('open');
50
- break;
51
- }
52
- let isExiting = exitState === 'exiting';
53
- $d3f049242431219c$var$useAnimation(ref, isExiting, (0, $jJMAe$useCallback)(()=>{
54
- // Set the state to closed, which will cause the element to be unmounted.
55
- setExitState((state)=>state === 'exiting' ? 'closed' : state);
56
- }, []));
57
- return isExiting;
58
- }
59
- function $d3f049242431219c$var$useAnimation(ref, isActive, onEnd) {
60
- (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
61
- if (isActive && ref.current) {
62
- if (!('getAnimations' in ref.current)) {
63
- // JSDOM
64
- onEnd();
65
- return;
66
- }
67
- let animations = ref.current.getAnimations();
68
- if (animations.length === 0) {
69
- onEnd();
70
- return;
71
- }
72
- let canceled = false;
73
- Promise.all(animations.map((a)=>a.finished)).then(()=>{
74
- if (!canceled) (0, $jJMAe$flushSync)(()=>{
75
- onEnd();
76
- });
77
- }).catch(()=>{});
78
- return ()=>{
79
- canceled = true;
80
- };
81
- }
82
- }, [
83
- ref,
84
- isActive,
85
- onEnd
86
- ]);
87
- }
88
-
89
-
90
- export {$d3f049242431219c$export$6d3443f2c48bfc20 as useEnterAnimation, $d3f049242431219c$export$45fda7c47f93fd48 as useExitAnimation};
91
- //# sourceMappingURL=animation.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAMM,SAAS,0CAAkB,GAAkC,EAAE,UAAmB,IAAI;IAC3F,IAAI,CAAC,YAAY,YAAY,GAAG,CAAA,GAAA,eAAO,EAAE;IACzC,IAAI,mBAAmB,cAAc;IAErC,4CAA4C;IAC5C,kIAAkI;IAClI,4IAA4I;IAC5I,EAAE;IACF,mJAAmJ;IACnJ,+FAA+F;IAC/F,CAAA,GAAA,yCAAc,EAAE;QACd,IAAI,oBAAoB,IAAI,OAAO,IAAI,mBAAmB,IAAI,OAAO,EAAE;YACrE,KAAK,IAAI,aAAa,IAAI,OAAO,CAAC,aAAa,GAC7C,IAAI,qBAAqB,eACvB,UAAU,MAAM;QAGtB;IACF,GAAG;QAAC;QAAK;KAAiB;IAE1B,mCAAa,KAAK,kBAAkB,CAAA,GAAA,kBAAU,EAAE,IAAM,YAAY,QAAQ,EAAE;IAC5E,OAAO;AACT;AAEO,SAAS,0CAAiB,GAAkC,EAAE,MAAe;IAClF,IAAI,CAAC,WAAW,aAAa,GAAG,CAAA,GAAA,eAAO,EAAiC,SAAS,SAAS;IAE1F,OAAQ;QACN,KAAK;YACH,qDAAqD;YACrD,IAAI,CAAC,QACH,aAAa;YAEf;QACF,KAAK;QACL,KAAK;YACH,4EAA4E;YAC5E,2BAA2B;YAC3B,IAAI,QACF,aAAa;YAEf;IACJ;IAEA,IAAI,YAAY,cAAc;IAC9B,mCACE,KACA,WACA,CAAA,GAAA,kBAAU,EAAE;QACV,yEAAyE;QACzE,aAAa,CAAA,QAAS,UAAU,YAAY,WAAW;IACzD,GAAG,EAAE;IAGP,OAAO;AACT;AAEA,SAAS,mCAAa,GAAkC,EAAE,QAAiB,EAAE,KAAiB;IAC5F,CAAA,GAAA,yCAAc,EAAE;QACd,IAAI,YAAY,IAAI,OAAO,EAAE;YAC3B,IAAI,CAAE,CAAA,mBAAmB,IAAI,OAAO,AAAD,GAAI;gBACrC,QAAQ;gBACR;gBACA;YACF;YAEA,IAAI,aAAa,IAAI,OAAO,CAAC,aAAa;YAC1C,IAAI,WAAW,MAAM,KAAK,GAAG;gBAC3B;gBACA;YACF;YAEA,IAAI,WAAW;YACf,QAAQ,GAAG,CAAC,WAAW,GAAG,CAAC,CAAA,IAAK,EAAE,QAAQ,GAAG,IAAI,CAAC;gBAChD,IAAI,CAAC,UACH,CAAA,GAAA,gBAAQ,EAAE;oBACR;gBACF;YAEJ,GAAG,KAAK,CAAC,KAAO;YAEhB,OAAO;gBACL,WAAW;YACb;QACF;IACF,GAAG;QAAC;QAAK;QAAU;KAAM;AAC3B","sources":["packages/@react-aria/utils/src/animation.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\nimport {flushSync} from 'react-dom';\nimport {RefObject, useCallback, useState} from 'react';\nimport {useLayoutEffect} from './useLayoutEffect';\n\nexport function useEnterAnimation(ref: RefObject<HTMLElement | null>, isReady: boolean = true): boolean {\n let [isEntering, setEntering] = useState(true);\n let isAnimationReady = isEntering && isReady;\n\n // There are two cases for entry animations:\n // 1. CSS @keyframes. The `animation` property is set during the isEntering state, and it is removed after the animation finishes.\n // 2. CSS transitions. The initial styles are applied during the isEntering state, and removed immediately, causing the transition to occur.\n //\n // In the second case, cancel any transitions that were triggered prior to the isEntering = false state (when the transition is supposed to start).\n // This can happen when isReady starts as false (e.g. popovers prior to placement calculation).\n useLayoutEffect(() => {\n if (isAnimationReady && ref.current && 'getAnimations' in ref.current) {\n for (let animation of ref.current.getAnimations()) {\n if (animation instanceof CSSTransition) {\n animation.cancel();\n }\n }\n }\n }, [ref, isAnimationReady]);\n\n useAnimation(ref, isAnimationReady, useCallback(() => setEntering(false), []));\n return isAnimationReady;\n}\n\nexport function useExitAnimation(ref: RefObject<HTMLElement | null>, isOpen: boolean): boolean {\n let [exitState, setExitState] = useState<'closed' | 'open' | 'exiting'>(isOpen ? 'open' : 'closed');\n\n switch (exitState) {\n case 'open':\n // If isOpen becomes false, set the state to exiting.\n if (!isOpen) {\n setExitState('exiting');\n }\n break;\n case 'closed':\n case 'exiting':\n // If we are exiting and isOpen becomes true, the animation was interrupted.\n // Reset the state to open.\n if (isOpen) {\n setExitState('open');\n }\n break;\n }\n\n let isExiting = exitState === 'exiting';\n useAnimation(\n ref,\n isExiting,\n useCallback(() => {\n // Set the state to closed, which will cause the element to be unmounted.\n setExitState(state => state === 'exiting' ? 'closed' : state);\n }, [])\n );\n\n return isExiting;\n}\n\nfunction useAnimation(ref: RefObject<HTMLElement | null>, isActive: boolean, onEnd: () => void): void {\n useLayoutEffect(() => {\n if (isActive && ref.current) {\n if (!('getAnimations' in ref.current)) {\n // JSDOM\n onEnd();\n return;\n }\n\n let animations = ref.current.getAnimations();\n if (animations.length === 0) {\n onEnd();\n return;\n }\n\n let canceled = false;\n Promise.all(animations.map(a => a.finished)).then(() => {\n if (!canceled) {\n flushSync(() => {\n onEnd();\n });\n }\n }).catch(() => {});\n\n return () => {\n canceled = true;\n };\n }\n }, [ref, isActive, onEnd]);\n}\n"],"names":[],"version":3,"file":"animation.module.js.map"}
@@ -1,26 +0,0 @@
1
-
2
- function $parcel$export(e, n, v, s) {
3
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
4
- }
5
-
6
- $parcel$export(module.exports, "chain", () => $1e2191638e54f613$export$e08e3b67e392101e);
7
- /*
8
- * Copyright 2020 Adobe. All rights reserved.
9
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License. You may obtain a copy
11
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software distributed under
14
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
15
- * OF ANY KIND, either express or implied. See the License for the specific language
16
- * governing permissions and limitations under the License.
17
- */ /**
18
- * Calls all functions in the order they were chained with the same arguments.
19
- */ function $1e2191638e54f613$export$e08e3b67e392101e(...callbacks) {
20
- return (...args)=>{
21
- for (let callback of callbacks)if (typeof callback === 'function') callback(...args);
22
- };
23
- }
24
-
25
-
26
- //# sourceMappingURL=chain.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAED;;CAEC,GACM,SAAS,0CAAM,GAAG,SAAgB;IACvC,OAAO,CAAC,GAAG;QACT,KAAK,IAAI,YAAY,UACnB,IAAI,OAAO,aAAa,YACtB,YAAY;IAGlB;AACF","sources":["packages/@react-aria/utils/src/chain.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\n/**\n * Calls all functions in the order they were chained with the same arguments.\n */\nexport function chain(...callbacks: any[]): (...args: any[]) => void {\n return (...args: any[]) => {\n for (let callback of callbacks) {\n if (typeof callback === 'function') {\n callback(...args);\n }\n }\n };\n}\n"],"names":[],"version":3,"file":"chain.main.js.map"}
package/dist/chain.mjs DELETED
@@ -1,21 +0,0 @@
1
- /*
2
- * Copyright 2020 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */ /**
12
- * Calls all functions in the order they were chained with the same arguments.
13
- */ function $ff5963eb1fccf552$export$e08e3b67e392101e(...callbacks) {
14
- return (...args)=>{
15
- for (let callback of callbacks)if (typeof callback === 'function') callback(...args);
16
- };
17
- }
18
-
19
-
20
- export {$ff5963eb1fccf552$export$e08e3b67e392101e as chain};
21
- //# sourceMappingURL=chain.module.js.map
@@ -1,21 +0,0 @@
1
- /*
2
- * Copyright 2020 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */ /**
12
- * Calls all functions in the order they were chained with the same arguments.
13
- */ function $ff5963eb1fccf552$export$e08e3b67e392101e(...callbacks) {
14
- return (...args)=>{
15
- for (let callback of callbacks)if (typeof callback === 'function') callback(...args);
16
- };
17
- }
18
-
19
-
20
- export {$ff5963eb1fccf552$export$e08e3b67e392101e as chain};
21
- //# sourceMappingURL=chain.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA;;;;;;;;;;CAUC,GAED;;CAEC,GACM,SAAS,0CAAM,GAAG,SAAgB;IACvC,OAAO,CAAC,GAAG;QACT,KAAK,IAAI,YAAY,UACnB,IAAI,OAAO,aAAa,YACtB,YAAY;IAGlB;AACF","sources":["packages/@react-aria/utils/src/chain.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\n/**\n * Calls all functions in the order they were chained with the same arguments.\n */\nexport function chain(...callbacks: any[]): (...args: any[]) => void {\n return (...args: any[]) => {\n for (let callback of callbacks) {\n if (typeof callback === 'function') {\n callback(...args);\n }\n }\n };\n}\n"],"names":[],"version":3,"file":"chain.module.js.map"}
@@ -1,23 +0,0 @@
1
-
2
- function $parcel$export(e, n, v, s) {
3
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
4
- }
5
-
6
- $parcel$export(module.exports, "CLEAR_FOCUS_EVENT", () => $a0850d0add29d276$export$447a38995de2c711);
7
- $parcel$export(module.exports, "FOCUS_EVENT", () => $a0850d0add29d276$export$831c820ad60f9d12);
8
- /*
9
- * Copyright 2024 Adobe. All rights reserved.
10
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
11
- * you may not use this file except in compliance with the License. You may obtain a copy
12
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
13
- *
14
- * Unless required by applicable law or agreed to in writing, software distributed under
15
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
16
- * OF ANY KIND, either express or implied. See the License for the specific language
17
- * governing permissions and limitations under the License.
18
- */ // Custom event names for updating the autocomplete's aria-activedecendant.
19
- const $a0850d0add29d276$export$447a38995de2c711 = 'react-aria-clear-focus';
20
- const $a0850d0add29d276$export$831c820ad60f9d12 = 'react-aria-focus';
21
-
22
-
23
- //# sourceMappingURL=constants.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC,GAED,2EAA2E;AACpE,MAAM,4CAAoB;AAC1B,MAAM,4CAAc","sources":["packages/@react-aria/utils/src/constants.ts"],"sourcesContent":["/*\n * Copyright 2024 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\n// Custom event names for updating the autocomplete's aria-activedecendant.\nexport const CLEAR_FOCUS_EVENT = 'react-aria-clear-focus';\nexport const FOCUS_EVENT = 'react-aria-focus';\n"],"names":[],"version":3,"file":"constants.main.js.map"}
@@ -1,17 +0,0 @@
1
- /*
2
- * Copyright 2024 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */ // Custom event names for updating the autocomplete's aria-activedecendant.
12
- const $5671b20cf9b562b2$export$447a38995de2c711 = 'react-aria-clear-focus';
13
- const $5671b20cf9b562b2$export$831c820ad60f9d12 = 'react-aria-focus';
14
-
15
-
16
- export {$5671b20cf9b562b2$export$447a38995de2c711 as CLEAR_FOCUS_EVENT, $5671b20cf9b562b2$export$831c820ad60f9d12 as FOCUS_EVENT};
17
- //# sourceMappingURL=constants.module.js.map
@@ -1,17 +0,0 @@
1
- /*
2
- * Copyright 2024 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */ // Custom event names for updating the autocomplete's aria-activedecendant.
12
- const $5671b20cf9b562b2$export$447a38995de2c711 = 'react-aria-clear-focus';
13
- const $5671b20cf9b562b2$export$831c820ad60f9d12 = 'react-aria-focus';
14
-
15
-
16
- export {$5671b20cf9b562b2$export$447a38995de2c711 as CLEAR_FOCUS_EVENT, $5671b20cf9b562b2$export$831c820ad60f9d12 as FOCUS_EVENT};
17
- //# sourceMappingURL=constants.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA;;;;;;;;;;CAUC,GAED,2EAA2E;AACpE,MAAM,4CAAoB;AAC1B,MAAM,4CAAc","sources":["packages/@react-aria/utils/src/constants.ts"],"sourcesContent":["/*\n * Copyright 2024 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\n// Custom event names for updating the autocomplete's aria-activedecendant.\nexport const CLEAR_FOCUS_EVENT = 'react-aria-clear-focus';\nexport const FOCUS_EVENT = 'react-aria-focus';\n"],"names":[],"version":3,"file":"constants.module.js.map"}
@@ -1,28 +0,0 @@
1
-
2
- function $parcel$export(e, n, v, s) {
3
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
4
- }
5
-
6
- $parcel$export(module.exports, "getOwnerDocument", () => $aaa611146751592e$export$b204af158042fbac);
7
- $parcel$export(module.exports, "getOwnerWindow", () => $aaa611146751592e$export$f21a1ffae260145a);
8
- $parcel$export(module.exports, "isShadowRoot", () => $aaa611146751592e$export$af51f0f06c0f328a);
9
- const $aaa611146751592e$export$b204af158042fbac = (el)=>{
10
- var _el_ownerDocument;
11
- return (_el_ownerDocument = el === null || el === void 0 ? void 0 : el.ownerDocument) !== null && _el_ownerDocument !== void 0 ? _el_ownerDocument : document;
12
- };
13
- const $aaa611146751592e$export$f21a1ffae260145a = (el)=>{
14
- if (el && 'window' in el && el.window === el) return el;
15
- const doc = $aaa611146751592e$export$b204af158042fbac(el);
16
- return doc.defaultView || window;
17
- };
18
- /**
19
- * Type guard that checks if a value is a Node. Verifies the presence and type of the nodeType property.
20
- */ function $aaa611146751592e$var$isNode(value) {
21
- return value !== null && typeof value === 'object' && 'nodeType' in value && typeof value.nodeType === 'number';
22
- }
23
- function $aaa611146751592e$export$af51f0f06c0f328a(node) {
24
- return $aaa611146751592e$var$isNode(node) && node.nodeType === Node.DOCUMENT_FRAGMENT_NODE && 'host' in node;
25
- }
26
-
27
-
28
- //# sourceMappingURL=domHelpers.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;AAAO,MAAM,4CAAmB,CAAC;QACxB;IAAP,OAAO,CAAA,oBAAA,eAAA,yBAAA,GAAI,aAAa,cAAjB,+BAAA,oBAAqB;AAC9B;AAEO,MAAM,4CAAiB,CAC5B;IAEA,IAAI,MAAM,YAAY,MAAM,GAAG,MAAM,KAAK,IACxC,OAAO;IAGT,MAAM,MAAM,0CAAiB;IAC7B,OAAO,IAAI,WAAW,IAAI;AAC5B;AAEA;;CAEC,GACD,SAAS,6BAAO,KAAc;IAC5B,OAAO,UAAU,QACf,OAAO,UAAU,YACjB,cAAc,SACd,OAAO,AAAC,MAAe,QAAQ,KAAK;AACxC;AAKO,SAAS,0CAAa,IAAiB;IAC5C,OAAO,6BAAO,SACZ,KAAK,QAAQ,KAAK,KAAK,sBAAsB,IAC7C,UAAU;AACd","sources":["packages/@react-aria/utils/src/domHelpers.ts"],"sourcesContent":["export const getOwnerDocument = (el: Element | null | undefined): Document => {\n return el?.ownerDocument ?? document;\n};\n\nexport const getOwnerWindow = (\n el: (Window & typeof globalThis) | Element | null | undefined\n): Window & typeof globalThis => {\n if (el && 'window' in el && el.window === el) {\n return el;\n }\n\n const doc = getOwnerDocument(el as Element | null | undefined);\n return doc.defaultView || window;\n};\n\n/**\n * Type guard that checks if a value is a Node. Verifies the presence and type of the nodeType property.\n */\nfunction isNode(value: unknown): value is Node {\n return value !== null &&\n typeof value === 'object' &&\n 'nodeType' in value &&\n typeof (value as Node).nodeType === 'number';\n}\n/**\n * Type guard that checks if a node is a ShadowRoot. Uses nodeType and host property checks to\n * distinguish ShadowRoot from other DocumentFragments.\n */\nexport function isShadowRoot(node: Node | null): node is ShadowRoot {\n return isNode(node) &&\n node.nodeType === Node.DOCUMENT_FRAGMENT_NODE &&\n 'host' in node;\n}\n"],"names":[],"version":3,"file":"domHelpers.main.js.map"}
@@ -1,21 +0,0 @@
1
- const $431fbd86ca7dc216$export$b204af158042fbac = (el)=>{
2
- var _el_ownerDocument;
3
- return (_el_ownerDocument = el === null || el === void 0 ? void 0 : el.ownerDocument) !== null && _el_ownerDocument !== void 0 ? _el_ownerDocument : document;
4
- };
5
- const $431fbd86ca7dc216$export$f21a1ffae260145a = (el)=>{
6
- if (el && 'window' in el && el.window === el) return el;
7
- const doc = $431fbd86ca7dc216$export$b204af158042fbac(el);
8
- return doc.defaultView || window;
9
- };
10
- /**
11
- * Type guard that checks if a value is a Node. Verifies the presence and type of the nodeType property.
12
- */ function $431fbd86ca7dc216$var$isNode(value) {
13
- return value !== null && typeof value === 'object' && 'nodeType' in value && typeof value.nodeType === 'number';
14
- }
15
- function $431fbd86ca7dc216$export$af51f0f06c0f328a(node) {
16
- return $431fbd86ca7dc216$var$isNode(node) && node.nodeType === Node.DOCUMENT_FRAGMENT_NODE && 'host' in node;
17
- }
18
-
19
-
20
- export {$431fbd86ca7dc216$export$b204af158042fbac as getOwnerDocument, $431fbd86ca7dc216$export$f21a1ffae260145a as getOwnerWindow, $431fbd86ca7dc216$export$af51f0f06c0f328a as isShadowRoot};
21
- //# sourceMappingURL=domHelpers.module.js.map
@@ -1,21 +0,0 @@
1
- const $431fbd86ca7dc216$export$b204af158042fbac = (el)=>{
2
- var _el_ownerDocument;
3
- return (_el_ownerDocument = el === null || el === void 0 ? void 0 : el.ownerDocument) !== null && _el_ownerDocument !== void 0 ? _el_ownerDocument : document;
4
- };
5
- const $431fbd86ca7dc216$export$f21a1ffae260145a = (el)=>{
6
- if (el && 'window' in el && el.window === el) return el;
7
- const doc = $431fbd86ca7dc216$export$b204af158042fbac(el);
8
- return doc.defaultView || window;
9
- };
10
- /**
11
- * Type guard that checks if a value is a Node. Verifies the presence and type of the nodeType property.
12
- */ function $431fbd86ca7dc216$var$isNode(value) {
13
- return value !== null && typeof value === 'object' && 'nodeType' in value && typeof value.nodeType === 'number';
14
- }
15
- function $431fbd86ca7dc216$export$af51f0f06c0f328a(node) {
16
- return $431fbd86ca7dc216$var$isNode(node) && node.nodeType === Node.DOCUMENT_FRAGMENT_NODE && 'host' in node;
17
- }
18
-
19
-
20
- export {$431fbd86ca7dc216$export$b204af158042fbac as getOwnerDocument, $431fbd86ca7dc216$export$f21a1ffae260145a as getOwnerWindow, $431fbd86ca7dc216$export$af51f0f06c0f328a as isShadowRoot};
21
- //# sourceMappingURL=domHelpers.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAO,MAAM,4CAAmB,CAAC;QACxB;IAAP,OAAO,CAAA,oBAAA,eAAA,yBAAA,GAAI,aAAa,cAAjB,+BAAA,oBAAqB;AAC9B;AAEO,MAAM,4CAAiB,CAC5B;IAEA,IAAI,MAAM,YAAY,MAAM,GAAG,MAAM,KAAK,IACxC,OAAO;IAGT,MAAM,MAAM,0CAAiB;IAC7B,OAAO,IAAI,WAAW,IAAI;AAC5B;AAEA;;CAEC,GACD,SAAS,6BAAO,KAAc;IAC5B,OAAO,UAAU,QACf,OAAO,UAAU,YACjB,cAAc,SACd,OAAO,AAAC,MAAe,QAAQ,KAAK;AACxC;AAKO,SAAS,0CAAa,IAAiB;IAC5C,OAAO,6BAAO,SACZ,KAAK,QAAQ,KAAK,KAAK,sBAAsB,IAC7C,UAAU;AACd","sources":["packages/@react-aria/utils/src/domHelpers.ts"],"sourcesContent":["export const getOwnerDocument = (el: Element | null | undefined): Document => {\n return el?.ownerDocument ?? document;\n};\n\nexport const getOwnerWindow = (\n el: (Window & typeof globalThis) | Element | null | undefined\n): Window & typeof globalThis => {\n if (el && 'window' in el && el.window === el) {\n return el;\n }\n\n const doc = getOwnerDocument(el as Element | null | undefined);\n return doc.defaultView || window;\n};\n\n/**\n * Type guard that checks if a value is a Node. Verifies the presence and type of the nodeType property.\n */\nfunction isNode(value: unknown): value is Node {\n return value !== null &&\n typeof value === 'object' &&\n 'nodeType' in value &&\n typeof (value as Node).nodeType === 'number';\n}\n/**\n * Type guard that checks if a node is a ShadowRoot. Uses nodeType and host property checks to\n * distinguish ShadowRoot from other DocumentFragments.\n */\nexport function isShadowRoot(node: Node | null): node is ShadowRoot {\n return isNode(node) &&\n node.nodeType === Node.DOCUMENT_FRAGMENT_NODE &&\n 'host' in node;\n}\n"],"names":[],"version":3,"file":"domHelpers.module.js.map"}
@@ -1,88 +0,0 @@
1
-
2
- function $parcel$export(e, n, v, s) {
3
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
4
- }
5
-
6
- $parcel$export(module.exports, "filterDOMProps", () => $8d15d0e1797d4238$export$457c3d6518dd4c6f);
7
- /*
8
- * Copyright 2020 Adobe. All rights reserved.
9
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License. You may obtain a copy
11
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software distributed under
14
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
15
- * OF ANY KIND, either express or implied. See the License for the specific language
16
- * governing permissions and limitations under the License.
17
- */ const $8d15d0e1797d4238$var$DOMPropNames = new Set([
18
- 'id'
19
- ]);
20
- const $8d15d0e1797d4238$var$labelablePropNames = new Set([
21
- 'aria-label',
22
- 'aria-labelledby',
23
- 'aria-describedby',
24
- 'aria-details'
25
- ]);
26
- // See LinkDOMProps in dom.d.ts.
27
- const $8d15d0e1797d4238$var$linkPropNames = new Set([
28
- 'href',
29
- 'hrefLang',
30
- 'target',
31
- 'rel',
32
- 'download',
33
- 'ping',
34
- 'referrerPolicy'
35
- ]);
36
- const $8d15d0e1797d4238$var$globalAttrs = new Set([
37
- 'dir',
38
- 'lang',
39
- 'hidden',
40
- 'inert',
41
- 'translate'
42
- ]);
43
- const $8d15d0e1797d4238$var$globalEvents = new Set([
44
- 'onClick',
45
- 'onAuxClick',
46
- 'onContextMenu',
47
- 'onDoubleClick',
48
- 'onMouseDown',
49
- 'onMouseEnter',
50
- 'onMouseLeave',
51
- 'onMouseMove',
52
- 'onMouseOut',
53
- 'onMouseOver',
54
- 'onMouseUp',
55
- 'onTouchCancel',
56
- 'onTouchEnd',
57
- 'onTouchMove',
58
- 'onTouchStart',
59
- 'onPointerDown',
60
- 'onPointerMove',
61
- 'onPointerUp',
62
- 'onPointerCancel',
63
- 'onPointerEnter',
64
- 'onPointerLeave',
65
- 'onPointerOver',
66
- 'onPointerOut',
67
- 'onGotPointerCapture',
68
- 'onLostPointerCapture',
69
- 'onScroll',
70
- 'onWheel',
71
- 'onAnimationStart',
72
- 'onAnimationEnd',
73
- 'onAnimationIteration',
74
- 'onTransitionCancel',
75
- 'onTransitionEnd',
76
- 'onTransitionRun',
77
- 'onTransitionStart'
78
- ]);
79
- const $8d15d0e1797d4238$var$propRe = /^(data-.*)$/;
80
- function $8d15d0e1797d4238$export$457c3d6518dd4c6f(props, opts = {}) {
81
- let { labelable: labelable, isLink: isLink, global: global, events: events = global, propNames: propNames } = opts;
82
- let filteredProps = {};
83
- for(const prop in props)if (Object.prototype.hasOwnProperty.call(props, prop) && ($8d15d0e1797d4238$var$DOMPropNames.has(prop) || labelable && $8d15d0e1797d4238$var$labelablePropNames.has(prop) || isLink && $8d15d0e1797d4238$var$linkPropNames.has(prop) || global && $8d15d0e1797d4238$var$globalAttrs.has(prop) || events && ($8d15d0e1797d4238$var$globalEvents.has(prop) || prop.endsWith('Capture') && $8d15d0e1797d4238$var$globalEvents.has(prop.slice(0, -7))) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $8d15d0e1797d4238$var$propRe.test(prop))) filteredProps[prop] = props[prop];
84
- return filteredProps;
85
- }
86
-
87
-
88
- //# sourceMappingURL=filterDOMProps.main.js.map