@okam/stack-ui 1.42.1 → 1.42.2

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 (157) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/components/ShareButton/interface.d.ts +0 -1
  3. package/index151.js +1 -1
  4. package/index151.mjs +1 -1
  5. package/index153.js +1 -1
  6. package/index153.mjs +4 -4
  7. package/index154.js +1 -1
  8. package/index154.mjs +2 -2
  9. package/index155.js +1 -1
  10. package/index155.mjs +1 -1
  11. package/index156.js +1 -1
  12. package/index156.mjs +1 -1
  13. package/index161.js +1 -1
  14. package/index161.mjs +2 -2
  15. package/index163.js +1 -1
  16. package/index163.mjs +2 -2
  17. package/index164.js +1 -1
  18. package/index164.mjs +5 -5
  19. package/index165.js +1 -1
  20. package/index165.mjs +3 -3
  21. package/index167.js +1 -1
  22. package/index167.mjs +2 -2
  23. package/index172.js +1 -1
  24. package/index172.mjs +2 -2
  25. package/index176.js +1 -1
  26. package/index176.mjs +1 -1
  27. package/index178.js +1 -1
  28. package/index178.mjs +1 -1
  29. package/index179.js +1 -1
  30. package/index179.mjs +1 -1
  31. package/index181.js +1 -1
  32. package/index181.mjs +3 -3
  33. package/index187.js +1 -1
  34. package/index187.mjs +5 -11
  35. package/index188.js +2 -1
  36. package/index188.mjs +49 -5
  37. package/index189.js +1 -2
  38. package/index189.mjs +11 -49
  39. package/index232.js +1 -1
  40. package/index232.mjs +132 -117
  41. package/index233.js +1 -1
  42. package/index233.mjs +196 -26
  43. package/index234.js +1 -1
  44. package/index234.mjs +18 -69
  45. package/index235.js +1 -1
  46. package/index235.mjs +4 -382
  47. package/index236.js +1 -1
  48. package/index236.mjs +28 -46
  49. package/index237.js +1 -1
  50. package/index237.mjs +50 -4
  51. package/index238.js +1 -1
  52. package/index238.mjs +52 -22
  53. package/index239.js +1 -1
  54. package/index239.mjs +46 -45
  55. package/index240.js +1 -1
  56. package/index240.mjs +96 -4
  57. package/index241.js +1 -1
  58. package/index241.mjs +5 -24
  59. package/index242.js +1 -1
  60. package/index242.mjs +6 -12
  61. package/index243.js +1 -1
  62. package/index243.mjs +41 -4
  63. package/index244.js +1 -1
  64. package/index244.mjs +72 -15
  65. package/index245.js +1 -1
  66. package/index245.mjs +14 -42
  67. package/index246.js +1 -1
  68. package/index246.mjs +66 -55
  69. package/index247.js +1 -1
  70. package/index247.mjs +7 -41
  71. package/index248.js +1 -1
  72. package/index248.mjs +10 -27
  73. package/index249.js +1 -1
  74. package/index249.mjs +46 -30
  75. package/index250.js +1 -1
  76. package/index250.mjs +124 -13
  77. package/index251.js +1 -1
  78. package/index251.mjs +27 -10
  79. package/index252.js +1 -1
  80. package/index252.mjs +69 -24
  81. package/index253.js +1 -1
  82. package/index253.mjs +380 -8
  83. package/index254.js +1 -1
  84. package/index254.mjs +46 -6
  85. package/index255.js +1 -1
  86. package/index255.mjs +24 -5
  87. package/index256.js +1 -1
  88. package/index256.mjs +24 -7
  89. package/index257.js +1 -1
  90. package/index257.mjs +12 -29
  91. package/index258.js +1 -1
  92. package/index258.mjs +4 -18
  93. package/index259.js +1 -1
  94. package/index259.mjs +14 -13
  95. package/index260.js +1 -1
  96. package/index260.mjs +37 -38
  97. package/index261.js +1 -1
  98. package/index261.mjs +56 -7
  99. package/index262.js +1 -1
  100. package/index262.mjs +27 -16
  101. package/index263.js +1 -1
  102. package/index263.mjs +32 -3
  103. package/index264.js +1 -1
  104. package/index264.mjs +10 -4
  105. package/index265.js +1 -1
  106. package/index265.mjs +9 -19
  107. package/index266.js +1 -1
  108. package/index266.mjs +5 -54
  109. package/index267.js +1 -1
  110. package/index267.mjs +7 -140
  111. package/index268.js +1 -1
  112. package/index268.mjs +28 -196
  113. package/index269.js +1 -1
  114. package/index269.mjs +14 -18
  115. package/index270.js +1 -1
  116. package/index270.mjs +12 -48
  117. package/index271.js +1 -1
  118. package/index271.mjs +40 -45
  119. package/index272.js +1 -1
  120. package/index272.mjs +7 -96
  121. package/index273.js +1 -1
  122. package/index273.mjs +18 -72
  123. package/index274.js +1 -1
  124. package/index274.mjs +3 -69
  125. package/index275.js +1 -1
  126. package/index275.mjs +4 -7
  127. package/index276.js +1 -1
  128. package/index276.mjs +19 -11
  129. package/index278.js +1 -1
  130. package/index278.mjs +3 -3
  131. package/index280.js +1 -1
  132. package/index280.mjs +9 -9
  133. package/index281.js +1 -1
  134. package/index281.mjs +1 -1
  135. package/index324.js +1 -1
  136. package/index324.mjs +7 -63
  137. package/index325.js +1 -1
  138. package/index325.mjs +28 -7
  139. package/index326.js +1 -1
  140. package/index326.mjs +89 -24
  141. package/index327.js +1 -1
  142. package/index327.mjs +58 -88
  143. package/index330.js +1 -1
  144. package/index330.mjs +3 -3
  145. package/index333.js +1 -1
  146. package/index333.mjs +5 -5
  147. package/index334.js +1 -1
  148. package/index334.mjs +2 -2
  149. package/index335.js +1 -1
  150. package/index335.mjs +5 -5
  151. package/index336.js +1 -1
  152. package/index336.mjs +1 -1
  153. package/index340.js +1 -1
  154. package/index340.mjs +1 -1
  155. package/index8.js +1 -1
  156. package/index8.mjs +32 -32
  157. package/package.json +1 -1
package/index259.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index237.js"),r=require("react");function o(t){const u=r.useRef(null);return n.useLayoutEffect(()=>{u.current=t},[t]),r.useCallback((...c)=>{const e=u.current;return e==null?void 0:e(...c)},[])}exports.useEffectEvent=o;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function n(r){var o,e,t="";if(typeof r=="string"||typeof r=="number")t+=r;else if(typeof r=="object")if(Array.isArray(r)){var u=r.length;for(o=0;o<u;o++)r[o]&&(e=n(r[o]))&&(t&&(t+=" "),t+=e)}else for(e in r)r[e]&&(t&&(t+=" "),t+=e);return t}function f(){for(var r,o,e=0,t="",u=arguments.length;e<u;e++)(r=arguments[e])&&(o=n(r))&&(t&&(t+=" "),t+=o);return t}exports.clsx=f;exports.default=f;
package/index259.mjs CHANGED
@@ -1,16 +1,17 @@
1
- import { useLayoutEffect as f } from "./index237.mjs";
2
- import { useRef as o, useCallback as a } from "react";
3
- function s(r) {
4
- const t = o(null);
5
- return f(() => {
6
- t.current = r;
7
- }, [
8
- r
9
- ]), a((...c) => {
10
- const e = t.current;
11
- return e == null ? void 0 : e(...c);
12
- }, []);
1
+ function a(r) {
2
+ var n, f, t = "";
3
+ if (typeof r == "string" || typeof r == "number") t += r;
4
+ else if (typeof r == "object") if (Array.isArray(r)) {
5
+ var o = r.length;
6
+ for (n = 0; n < o; n++) r[n] && (f = a(r[n])) && (t && (t += " "), t += f);
7
+ } else for (f in r) r[f] && (t && (t += " "), t += f);
8
+ return t;
9
+ }
10
+ function i() {
11
+ for (var r, n, f = 0, t = "", o = arguments.length; f < o; f++) (r = arguments[f]) && (n = a(r)) && (t && (t += " "), t += n);
12
+ return t;
13
13
  }
14
14
  export {
15
- s as useEffectEvent
15
+ i as clsx,
16
+ i as default
16
17
  };
package/index260.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("./index256.js");function L(e,o){let d=T(e,o,"left"),t=T(e,o,"top"),l=o.offsetWidth,f=o.offsetHeight,r=e.scrollLeft,n=e.scrollTop,{borderTopWidth:i,borderLeftWidth:s,scrollPaddingTop:c,scrollPaddingRight:a,scrollPaddingBottom:$,scrollPaddingLeft:S}=getComputedStyle(e),I=r+parseInt(s,10),u=n+parseInt(i,10),b=I+e.clientWidth,P=u+e.clientHeight,p=parseInt(c,10)||0,v=parseInt($,10)||0,h=parseInt(a,10)||0,g=parseInt(S,10)||0;d<=r+g?r=d-parseInt(s,10)-g:d+l>b-h&&(r+=d+l-b+h),t<=u+p?n=t-parseInt(i,10)-p:t+f>P-v&&(n+=t+f-P+v),e.scrollLeft=r,e.scrollTop=n}function T(e,o,d){const t=d==="left"?"offsetLeft":"offsetTop";let l=0;for(;o.offsetParent&&(l+=o[t],o.offsetParent!==e);){if(o.offsetParent.contains(e)){l-=e[t];break}o=o.offsetParent}return l}function k(e,o){if(e&&document.contains(e)){let r=document.scrollingElement||document.documentElement;if(window.getComputedStyle(r).overflow==="hidden"){let i=W.getScrollParents(e);for(let s of i)L(s,e)}else{var d;let{left:i,top:s}=e.getBoundingClientRect();e==null||(d=e.scrollIntoView)===null||d===void 0||d.call(e,{block:"nearest"});let{left:c,top:a}=e.getBoundingClientRect();if(Math.abs(i-c)>1||Math.abs(s-a)>1){var t,l,f;o==null||(l=o.containingElement)===null||l===void 0||(t=l.scrollIntoView)===null||t===void 0||t.call(l,{block:"center",inline:"center"}),(f=e.scrollIntoView)===null||f===void 0||f.call(e,{block:"nearest"})}}}}exports.scrollIntoView=L;exports.scrollIntoViewport=k;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function c(l){if(n())l.focus({preventScroll:!0});else{let e=s(l);l.focus(),f(e)}}let r=null;function n(){if(r==null){r=!1;try{document.createElement("div").focus({get preventScroll(){return r=!0,!0}})}catch{}}return r}function s(l){let e=l.parentNode,o=[],t=document.scrollingElement||document.documentElement;for(;e instanceof HTMLElement&&e!==t;)(e.offsetHeight<e.scrollHeight||e.offsetWidth<e.scrollWidth)&&o.push({element:e,scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),e=e.parentNode;return t instanceof HTMLElement&&o.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),o}function f(l){for(let{element:e,scrollTop:o,scrollLeft:t}of l)e.scrollTop=o,e.scrollLeft=t}exports.focusWithoutScrolling=c;
package/index260.mjs CHANGED
@@ -1,46 +1,45 @@
1
- import { getScrollParents as I } from "./index256.mjs";
2
- function W(o, e) {
3
- let t = L(o, e, "left"), d = L(o, e, "top"), l = e.offsetWidth, r = e.offsetHeight, f = o.scrollLeft, c = o.scrollTop, { borderTopWidth: i, borderLeftWidth: s, scrollPaddingTop: n, scrollPaddingRight: a, scrollPaddingBottom: T, scrollPaddingLeft: g } = getComputedStyle(o), x = f + parseInt(s, 10), u = c + parseInt(i, 10), b = x + o.clientWidth, p = u + o.clientHeight, P = parseInt(n, 10) || 0, v = parseInt(T, 10) || 0, h = parseInt(a, 10) || 0, $ = parseInt(g, 10) || 0;
4
- t <= f + $ ? f = t - parseInt(s, 10) - $ : t + l > b - h && (f += t + l - b + h), d <= u + P ? c = d - parseInt(i, 10) - P : d + r > p - v && (c += d + r - p + v), o.scrollLeft = f, o.scrollTop = c;
5
- }
6
- function L(o, e, t) {
7
- const d = t === "left" ? "offsetLeft" : "offsetTop";
8
- let l = 0;
9
- for (; e.offsetParent && (l += e[d], e.offsetParent !== o); ) {
10
- if (e.offsetParent.contains(o)) {
11
- l -= o[d];
12
- break;
13
- }
14
- e = e.offsetParent;
1
+ function f(l) {
2
+ if (c()) l.focus({
3
+ preventScroll: !0
4
+ });
5
+ else {
6
+ let e = n(l);
7
+ l.focus(), s(e);
15
8
  }
16
- return l;
17
9
  }
18
- function B(o, e) {
19
- if (o && document.contains(o)) {
20
- let f = document.scrollingElement || document.documentElement;
21
- if (window.getComputedStyle(f).overflow === "hidden") {
22
- let i = I(o);
23
- for (let s of i) W(s, o);
24
- } else {
25
- var t;
26
- let { left: i, top: s } = o.getBoundingClientRect();
27
- o == null || (t = o.scrollIntoView) === null || t === void 0 || t.call(o, {
28
- block: "nearest"
10
+ let r = null;
11
+ function c() {
12
+ if (r == null) {
13
+ r = !1;
14
+ try {
15
+ document.createElement("div").focus({
16
+ get preventScroll() {
17
+ return r = !0, !0;
18
+ }
29
19
  });
30
- let { left: n, top: a } = o.getBoundingClientRect();
31
- if (Math.abs(i - n) > 1 || Math.abs(s - a) > 1) {
32
- var d, l, r;
33
- e == null || (l = e.containingElement) === null || l === void 0 || (d = l.scrollIntoView) === null || d === void 0 || d.call(l, {
34
- block: "center",
35
- inline: "center"
36
- }), (r = o.scrollIntoView) === null || r === void 0 || r.call(o, {
37
- block: "nearest"
38
- });
39
- }
20
+ } catch {
40
21
  }
41
22
  }
23
+ return r;
24
+ }
25
+ function n(l) {
26
+ let e = l.parentNode, o = [], t = document.scrollingElement || document.documentElement;
27
+ for (; e instanceof HTMLElement && e !== t; )
28
+ (e.offsetHeight < e.scrollHeight || e.offsetWidth < e.scrollWidth) && o.push({
29
+ element: e,
30
+ scrollTop: e.scrollTop,
31
+ scrollLeft: e.scrollLeft
32
+ }), e = e.parentNode;
33
+ return t instanceof HTMLElement && o.push({
34
+ element: t,
35
+ scrollTop: t.scrollTop,
36
+ scrollLeft: t.scrollLeft
37
+ }), o;
38
+ }
39
+ function s(l) {
40
+ for (let { element: e, scrollTop: o, scrollLeft: t } of l)
41
+ e.scrollTop = o, e.scrollLeft = t;
42
42
  }
43
43
  export {
44
- W as scrollIntoView,
45
- B as scrollIntoViewport
44
+ f as focusWithoutScrolling
46
45
  };
package/index261.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index247.js");function t(r){return r.mozInputSource===0&&r.isTrusted?!0:i.isAndroid()&&r.pointerType?r.type==="click"&&r.buttons===1:r.detail===0&&!r.pointerType}function o(r){return!i.isAndroid()&&r.width===0&&r.height===0||r.width===1&&r.height===1&&r.pressure===0&&r.detail===0&&r.pointerType==="mouse"}exports.isVirtualClick=t;exports.isVirtualPointerEvent=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./index260.js"),a=require("./index243.js"),f=require("react"),s=f.createContext({isNative:!0,open:K,useHref:e=>e});function b(){return f.useContext(s)}function l(e,i,t=!0){var n,d;let{metaKey:r,ctrlKey:o,altKey:u,shiftKey:c}=i;a.isFirefox()&&(!((d=window.event)===null||d===void 0||(n=d.type)===null||n===void 0)&&n.startsWith("key"))&&e.target==="_blank"&&(a.isMac()?r=!0:o=!0);let v=a.isWebKit()&&a.isMac()&&!a.isIPad()&&process.env.NODE_ENV!=="test"?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:r,ctrlKey:o,altKey:u,shiftKey:c}):new MouseEvent("click",{metaKey:r,ctrlKey:o,altKey:u,shiftKey:c,bubbles:!0,cancelable:!0});l.isOpening=t,y.focusWithoutScrolling(e),e.dispatchEvent(v),l.isOpening=!1}l.isOpening=!1;function h(e,i){if(e instanceof HTMLAnchorElement)i(e);else if(e.hasAttribute("data-href")){let t=document.createElement("a");t.href=e.getAttribute("data-href"),e.hasAttribute("data-target")&&(t.target=e.getAttribute("data-target")),e.hasAttribute("data-rel")&&(t.rel=e.getAttribute("data-rel")),e.hasAttribute("data-download")&&(t.download=e.getAttribute("data-download")),e.hasAttribute("data-ping")&&(t.ping=e.getAttribute("data-ping")),e.hasAttribute("data-referrer-policy")&&(t.referrerPolicy=e.getAttribute("data-referrer-policy")),e.appendChild(t),i(t),e.removeChild(t)}}function K(e,i){h(e,t=>l(t,i))}function $(e){let i=b();var t;const n=i.useHref((t=e==null?void 0:e.href)!==null&&t!==void 0?t:"");return{href:e!=null&&e.href?n:void 0,target:e==null?void 0:e.target,rel:e==null?void 0:e.rel,download:e==null?void 0:e.download,ping:e==null?void 0:e.ping,referrerPolicy:e==null?void 0:e.referrerPolicy}}exports.openLink=l;exports.useLinkProps=$;exports.useRouter=b;
package/index261.mjs CHANGED
@@ -1,11 +1,60 @@
1
- import { isAndroid as i } from "./index247.mjs";
2
- function o(r) {
3
- return r.mozInputSource === 0 && r.isTrusted ? !0 : i() && r.pointerType ? r.type === "click" && r.buttons === 1 : r.detail === 0 && !r.pointerType;
1
+ import { focusWithoutScrolling as b } from "./index260.mjs";
2
+ import { isFirefox as v, isMac as u, isWebKit as $, isIPad as s } from "./index243.mjs";
3
+ import { useContext as y, createContext as h } from "react";
4
+ const K = /* @__PURE__ */ h({
5
+ isNative: !0,
6
+ open: x,
7
+ useHref: (e) => e
8
+ });
9
+ function m() {
10
+ return y(K);
4
11
  }
5
- function u(r) {
6
- return !i() && r.width === 0 && r.height === 0 || r.width === 1 && r.height === 1 && r.pressure === 0 && r.detail === 0 && r.pointerType === "mouse";
12
+ function n(e, i, t = !0) {
13
+ var a, d;
14
+ let { metaKey: r, ctrlKey: l, altKey: o, shiftKey: c } = i;
15
+ v() && (!((d = window.event) === null || d === void 0 || (a = d.type) === null || a === void 0) && a.startsWith("key")) && e.target === "_blank" && (u() ? r = !0 : l = !0);
16
+ let f = $() && u() && !s() && process.env.NODE_ENV !== "test" ? new KeyboardEvent("keydown", {
17
+ keyIdentifier: "Enter",
18
+ metaKey: r,
19
+ ctrlKey: l,
20
+ altKey: o,
21
+ shiftKey: c
22
+ }) : new MouseEvent("click", {
23
+ metaKey: r,
24
+ ctrlKey: l,
25
+ altKey: o,
26
+ shiftKey: c,
27
+ bubbles: !0,
28
+ cancelable: !0
29
+ });
30
+ n.isOpening = t, b(e), e.dispatchEvent(f), n.isOpening = !1;
31
+ }
32
+ n.isOpening = !1;
33
+ function w(e, i) {
34
+ if (e instanceof HTMLAnchorElement) i(e);
35
+ else if (e.hasAttribute("data-href")) {
36
+ let t = document.createElement("a");
37
+ t.href = e.getAttribute("data-href"), e.hasAttribute("data-target") && (t.target = e.getAttribute("data-target")), e.hasAttribute("data-rel") && (t.rel = e.getAttribute("data-rel")), e.hasAttribute("data-download") && (t.download = e.getAttribute("data-download")), e.hasAttribute("data-ping") && (t.ping = e.getAttribute("data-ping")), e.hasAttribute("data-referrer-policy") && (t.referrerPolicy = e.getAttribute("data-referrer-policy")), e.appendChild(t), i(t), e.removeChild(t);
38
+ }
39
+ }
40
+ function x(e, i) {
41
+ w(e, (t) => n(t, i));
42
+ }
43
+ function E(e) {
44
+ let i = m();
45
+ var t;
46
+ const a = i.useHref((t = e == null ? void 0 : e.href) !== null && t !== void 0 ? t : "");
47
+ return {
48
+ href: e != null && e.href ? a : void 0,
49
+ target: e == null ? void 0 : e.target,
50
+ rel: e == null ? void 0 : e.rel,
51
+ download: e == null ? void 0 : e.download,
52
+ ping: e == null ? void 0 : e.ping,
53
+ referrerPolicy: e == null ? void 0 : e.referrerPolicy
54
+ };
7
55
  }
8
56
  export {
9
- o as isVirtualClick,
10
- u as isVirtualPointerEvent
57
+ n as openLink,
58
+ E as useLinkProps,
59
+ m as useRouter
11
60
  };
package/index262.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index259.js"),o=require("react");function s(t,d,u){let i=o.useRef(d),r=l.useEffectEvent(()=>{u&&u(i.current)});o.useEffect(()=>{var n;let e=t==null||(n=t.current)===null||n===void 0?void 0:n.form;return e==null||e.addEventListener("reset",r),()=>{e==null||e.removeEventListener("reset",r)}},[t,r])}exports.useFormReset=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let n=new Map,a=new Set;function o(){if(typeof window>"u")return;function r(e){return"propertyName"in e}let d=e=>{if(!r(e)||!e.target)return;let t=n.get(e.target);t||(t=new Set,n.set(e.target,t),e.target.addEventListener("transitioncancel",i,{once:!0})),t.add(e.propertyName)},i=e=>{if(!r(e)||!e.target)return;let t=n.get(e.target);if(t&&(t.delete(e.propertyName),t.size===0&&(e.target.removeEventListener("transitioncancel",i),n.delete(e.target)),n.size===0)){for(let s of a)s();a.clear()}};document.body.addEventListener("transitionrun",d),document.body.addEventListener("transitionend",i)}typeof document<"u"&&(document.readyState!=="loading"?o():document.addEventListener("DOMContentLoaded",o));function c(r){requestAnimationFrame(()=>{n.size===0?r():a.add(r)})}exports.runAfterTransition=c;
package/index262.mjs CHANGED
@@ -1,20 +1,31 @@
1
- import { useEffectEvent as u } from "./index259.mjs";
2
- import { useRef as a, useEffect as f } from "react";
3
- function s(t, n, d) {
4
- let i = a(n), r = u(() => {
5
- d && d(i.current);
1
+ let n = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
2
+ function o() {
3
+ if (typeof window > "u") return;
4
+ function r(t) {
5
+ return "propertyName" in t;
6
+ }
7
+ let d = (t) => {
8
+ if (!r(t) || !t.target) return;
9
+ let e = n.get(t.target);
10
+ e || (e = /* @__PURE__ */ new Set(), n.set(t.target, e), t.target.addEventListener("transitioncancel", i, {
11
+ once: !0
12
+ })), e.add(t.propertyName);
13
+ }, i = (t) => {
14
+ if (!r(t) || !t.target) return;
15
+ let e = n.get(t.target);
16
+ if (e && (e.delete(t.propertyName), e.size === 0 && (t.target.removeEventListener("transitioncancel", i), n.delete(t.target)), n.size === 0)) {
17
+ for (let s of a) s();
18
+ a.clear();
19
+ }
20
+ };
21
+ document.body.addEventListener("transitionrun", d), document.body.addEventListener("transitionend", i);
22
+ }
23
+ typeof document < "u" && (document.readyState !== "loading" ? o() : document.addEventListener("DOMContentLoaded", o));
24
+ function c(r) {
25
+ requestAnimationFrame(() => {
26
+ n.size === 0 ? r() : a.add(r);
6
27
  });
7
- f(() => {
8
- var o;
9
- let e = t == null || (o = t.current) === null || o === void 0 ? void 0 : o.form;
10
- return e == null || e.addEventListener("reset", r), () => {
11
- e == null || e.removeEventListener("reset", r);
12
- };
13
- }, [
14
- t,
15
- r
16
- ]);
17
28
  }
18
29
  export {
19
- s as useFormReset
30
+ c as runAfterTransition
20
31
  };
package/index263.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c="react-aria-clear-focus",e="react-aria-focus";exports.CLEAR_FOCUS_EVENT=c;exports.FOCUS_EVENT=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react");function b(){let a=o.useRef(new Map),d=o.useCallback((e,l,t,r)=>{let n=r!=null&&r.once?(...c)=>{a.current.delete(t),t(...c)}:t;a.current.set(t,{type:l,eventTarget:e,fn:n,options:r}),e.addEventListener(l,n,r)},[]),s=o.useCallback((e,l,t,r)=>{var n;let c=((n=a.current.get(t))===null||n===void 0?void 0:n.fn)||t;e.removeEventListener(l,c,r),a.current.delete(t)},[]),u=o.useCallback(()=>{a.current.forEach((e,l)=>{s(e.eventTarget,e.type,l,e.options)})},[s]);return o.useEffect(()=>u,[u]),{addGlobalListener:d,removeGlobalListener:s,removeAllGlobalListeners:u}}exports.useGlobalListeners=b;
package/index263.mjs CHANGED
@@ -1,5 +1,34 @@
1
- const a = "react-aria-clear-focus", c = "react-aria-focus";
1
+ import { useRef as c, useCallback as f, useEffect as b } from "react";
2
+ function L() {
3
+ let o = c(/* @__PURE__ */ new Map()), u = f((e, l, r, t) => {
4
+ let n = t != null && t.once ? (...d) => {
5
+ o.current.delete(r), r(...d);
6
+ } : r;
7
+ o.current.set(r, {
8
+ type: l,
9
+ eventTarget: e,
10
+ fn: n,
11
+ options: t
12
+ }), e.addEventListener(l, n, t);
13
+ }, []), a = f((e, l, r, t) => {
14
+ var n;
15
+ let d = ((n = o.current.get(r)) === null || n === void 0 ? void 0 : n.fn) || r;
16
+ e.removeEventListener(l, d, t), o.current.delete(r);
17
+ }, []), s = f(() => {
18
+ o.current.forEach((e, l) => {
19
+ a(e.eventTarget, e.type, l, e.options);
20
+ });
21
+ }, [
22
+ a
23
+ ]);
24
+ return b(() => s, [
25
+ s
26
+ ]), {
27
+ addGlobalListener: u,
28
+ removeGlobalListener: a,
29
+ removeAllGlobalListeners: s
30
+ };
31
+ }
2
32
  export {
3
- a as CLEAR_FOCUS_EVENT,
4
- c as FOCUS_EVENT
33
+ L as useGlobalListeners
5
34
  };
package/index264.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index247.js");function t(e){return r.isMac()?e.metaKey:e.ctrlKey}exports.isCtrlKeyPressed=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index235.js"),f=require("react");function a(c,t){const e=f.useRef(!0),u=f.useRef(null);r.useLayoutEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),r.useLayoutEffect(()=>{e.current?e.current=!1:(!u.current||t.some((s,o)=>!Object.is(s,u[o])))&&c(),u.current=t},t)}exports.useUpdateLayoutEffect=a;
package/index264.mjs CHANGED
@@ -1,7 +1,13 @@
1
- import { isMac as a } from "./index247.mjs";
2
- function t(e) {
3
- return a() ? e.metaKey : e.ctrlKey;
1
+ import { useLayoutEffect as f } from "./index235.mjs";
2
+ import { useRef as u } from "react";
3
+ function i(c, r) {
4
+ const t = u(!0), e = u(null);
5
+ f(() => (t.current = !0, () => {
6
+ t.current = !1;
7
+ }), []), f(() => {
8
+ t.current ? t.current = !1 : (!e.current || r.some((a, o) => !Object.is(a, e[o]))) && c(), e.current = r;
9
+ }, r);
4
10
  }
5
11
  export {
6
- t as isCtrlKeyPressed
12
+ i as useUpdateLayoutEffect
7
13
  };
package/index265.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])'],b=e.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";e.push('[tabindex]:not([tabindex="-1"]):not([disabled])');function n(t){return t.matches(b)}exports.isFocusable=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index235.js");function f(e,r){u.useLayoutEffect(()=>{if(e&&e.ref&&r)return e.ref.current=r.current,()=>{e.ref&&(e.ref.current=null)}})}exports.useSyncRef=f;
package/index265.mjs CHANGED
@@ -1,22 +1,12 @@
1
- const e = [
2
- "input:not([disabled]):not([type=hidden])",
3
- "select:not([disabled])",
4
- "textarea:not([disabled])",
5
- "button:not([disabled])",
6
- "a[href]",
7
- "area[href]",
8
- "summary",
9
- "iframe",
10
- "object",
11
- "embed",
12
- "audio[controls]",
13
- "video[controls]",
14
- '[contenteditable]:not([contenteditable^="false"])'
15
- ], b = e.join(":not([hidden]),") + ",[tabindex]:not([disabled]):not([hidden])";
16
- e.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
17
- function n(t) {
18
- return t.matches(b);
1
+ import { useLayoutEffect as f } from "./index235.mjs";
2
+ function u(r, e) {
3
+ f(() => {
4
+ if (r && r.ref && e)
5
+ return r.ref.current = e.current, () => {
6
+ r.ref && (r.ref.current = null);
7
+ };
8
+ });
19
9
  }
20
10
  export {
21
- n as isFocusable
11
+ u as useSyncRef
22
12
  };
package/index266.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index327.js"),c=require("react"),l=require("./index241.js"),m=require("./index242.js"),p=require("./index249.js");function B(b){let{isDisabled:v,onBlurWithin:i,onFocusWithin:s,onFocusWithinChange:t}=b,n=c.useRef({isFocusWithin:!1}),{addGlobalListener:a,removeAllGlobalListeners:f}=p.useGlobalListeners(),r=c.useCallback(e=>{e.currentTarget.contains(e.target)&&n.current.isFocusWithin&&!e.currentTarget.contains(e.relatedTarget)&&(n.current.isFocusWithin=!1,f(),i&&i(e),t&&t(!1))},[i,t,n,f]),g=o.useSyntheticBlurEvent(r),W=c.useCallback(e=>{if(!e.currentTarget.contains(e.target))return;const u=m.getOwnerDocument(e.target),T=l.getActiveElement(u);if(!n.current.isFocusWithin&&T===l.getEventTarget(e.nativeEvent)){s&&s(e),t&&t(!0),n.current.isFocusWithin=!0,g(e);let h=e.currentTarget;a(u,"focus",d=>{if(n.current.isFocusWithin&&!l.nodeContains(h,d.target)){let F=new u.defaultView.FocusEvent("blur",{relatedTarget:d.target});o.setEventTarget(F,h);let E=o.createSyntheticEvent(F);r(E)}},{capture:!0})}},[s,t,g,a,r]);return v?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:W,onBlur:r}}}exports.useFocusWithin=B;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function i(e,r){if(!e)return!1;let l=window.getComputedStyle(e),t=/(auto|scroll)/.test(l.overflow+l.overflowX+l.overflowY);return t&&r&&(t=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),t}exports.isScrollable=i;
package/index266.mjs CHANGED
@@ -1,57 +1,8 @@
1
- import { useSyntheticBlurEvent as F, setEventTarget as W, createSyntheticEvent as v } from "./index327.mjs";
2
- import { useRef as x, useCallback as $ } from "react";
3
- import { getActiveElement as E, getEventTarget as T, nodeContains as B } from "./index241.mjs";
4
- import { getOwnerDocument as G } from "./index242.mjs";
5
- import { useGlobalListeners as L } from "./index249.mjs";
6
- function S(b) {
7
- let { isDisabled: h, onBlurWithin: i, onFocusWithin: o, onFocusWithinChange: t } = b, r = x({
8
- isFocusWithin: !1
9
- }), { addGlobalListener: c, removeAllGlobalListeners: s } = L(), n = $((e) => {
10
- e.currentTarget.contains(e.target) && r.current.isFocusWithin && !e.currentTarget.contains(e.relatedTarget) && (r.current.isFocusWithin = !1, s(), i && i(e), t && t(!1));
11
- }, [
12
- i,
13
- t,
14
- r,
15
- s
16
- ]), u = F(n), g = $((e) => {
17
- if (!e.currentTarget.contains(e.target)) return;
18
- const a = G(e.target), p = E(a);
19
- if (!r.current.isFocusWithin && p === T(e.nativeEvent)) {
20
- o && o(e), t && t(!0), r.current.isFocusWithin = !0, u(e);
21
- let f = e.currentTarget;
22
- c(a, "focus", (l) => {
23
- if (r.current.isFocusWithin && !B(f, l.target)) {
24
- let d = new a.defaultView.FocusEvent("blur", {
25
- relatedTarget: l.target
26
- });
27
- W(d, f);
28
- let m = v(d);
29
- n(m);
30
- }
31
- }, {
32
- capture: !0
33
- });
34
- }
35
- }, [
36
- o,
37
- t,
38
- u,
39
- c,
40
- n
41
- ]);
42
- return h ? {
43
- focusWithinProps: {
44
- // These cannot be null, that would conflict in mergeProps
45
- onFocus: void 0,
46
- onBlur: void 0
47
- }
48
- } : {
49
- focusWithinProps: {
50
- onFocus: g,
51
- onBlur: n
52
- }
53
- };
1
+ function c(l, r) {
2
+ if (!l) return !1;
3
+ let t = window.getComputedStyle(l), e = /(auto|scroll)/.test(t.overflow + t.overflowX + t.overflowY);
4
+ return e && r && (e = l.scrollHeight !== l.clientHeight || l.scrollWidth !== l.clientWidth), e;
54
5
  }
55
6
  export {
56
- S as useFocusWithin
7
+ c as isScrollable
57
8
  };
package/index267.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("./index268.js"),A=require("./index269.js"),f=require("react"),P=require("./index237.js"),j=require("./index252.js"),D=require("@react-aria/i18n");let e=typeof document<"u"?window.visualViewport:null;function G(n){let{direction:h}=D.useLocale(),{arrowSize:$=0,targetRef:v,overlayRef:i,scrollRef:s=i,placement:w="bottom",containerPadding:C=12,shouldFlip:H=!0,boundaryElement:R=typeof document<"u"?document.body:null,offset:S=0,crossOffset:B=0,shouldUpdatePosition:q=!0,isOpen:p=!0,onClose:m,maxHeight:O,arrowBoundaryOffset:T=0}=n,[t,k]=f.useState(null),F=[q,w,i.current,v.current,s.current,C,H,R,S,B,p,h,O,T,$],N=f.useRef(e==null?void 0:e.scale);f.useEffect(()=>{p&&(N.current=e==null?void 0:e.scale)},[p]);let u=f.useCallback(()=>{if(q===!1||!p||!i.current||!v.current||!R||(e==null?void 0:e.scale)!==N.current)return;let o=null;if(s.current&&s.current.contains(document.activeElement)){var a;let r=(a=document.activeElement)===null||a===void 0?void 0:a.getBoundingClientRect(),g=s.current.getBoundingClientRect();var d;if(o={type:"top",offset:((d=r==null?void 0:r.top)!==null&&d!==void 0?d:0)-g.top},o.offset>g.height/2){o.type="bottom";var x;o.offset=((x=r==null?void 0:r.bottom)!==null&&x!==void 0?x:0)-g.bottom}}let l=i.current;if(!O&&i.current){var z;l.style.top="0px",l.style.bottom="";var L;l.style.maxHeight=((L=(z=window.visualViewport)===null||z===void 0?void 0:z.height)!==null&&L!==void 0?L:window.innerHeight)+"px"}let c=M.calculatePosition({placement:K(w,h),overlayNode:i.current,targetNode:v.current,scrollNode:s.current||i.current,padding:C,shouldFlip:H,boundaryElement:R,offset:S,crossOffset:B,maxHeight:O,arrowSize:$,arrowBoundaryOffset:T});if(c.position){if(l.style.top="",l.style.bottom="",l.style.left="",l.style.right="",Object.keys(c.position).forEach(r=>l.style[r]=c.position[r]+"px"),l.style.maxHeight=c.maxHeight!=null?c.maxHeight+"px":"",o&&document.activeElement&&s.current){let r=document.activeElement.getBoundingClientRect(),g=s.current.getBoundingClientRect(),I=r[o.type]-g[o.type];s.current.scrollTop+=I-o.offset}k(c)}},F);P.useLayoutEffect(u,F),J(u),j.useResizeObserver({ref:i,onResize:u}),j.useResizeObserver({ref:v,onResize:u});let y=f.useRef(!1);P.useLayoutEffect(()=>{let o,a=()=>{y.current=!0,clearTimeout(o),o=setTimeout(()=>{y.current=!1},500),u()},d=()=>{y.current&&a()};return e==null||e.addEventListener("resize",a),e==null||e.addEventListener("scroll",d),()=>{e==null||e.removeEventListener("resize",a),e==null||e.removeEventListener("scroll",d)}},[u]);let U=f.useCallback(()=>{y.current||m==null||m()},[m,y]);A.useCloseOnScroll({triggerRef:v,isOpen:p,onClose:m&&U});var b,E;return{overlayProps:{style:{position:"absolute",zIndex:1e5,...t==null?void 0:t.position,maxHeight:(b=t==null?void 0:t.maxHeight)!==null&&b!==void 0?b:"100vh"}},placement:(E=t==null?void 0:t.placement)!==null&&E!==void 0?E:null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:t==null?void 0:t.arrowOffsetLeft,top:t==null?void 0:t.arrowOffsetTop}},updatePosition:u}}function J(n){P.useLayoutEffect(()=>(window.addEventListener("resize",n,!1),()=>{window.removeEventListener("resize",n,!1)}),[n])}function K(n,h){return h==="rtl"?n.replace("start","right").replace("end","left"):n.replace("start","left").replace("end","right")}exports.useOverlayPosition=G;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index266.js");function r(e,c){const t=[];for(;e&&e!==document.documentElement;)l.isScrollable(e,c)&&t.push(e),e=e.parentElement;return t}exports.getScrollParents=r;
package/index267.mjs CHANGED
@@ -1,143 +1,10 @@
1
- import { calculatePosition as D } from "./index268.mjs";
2
- import { useCloseOnScroll as G } from "./index269.mjs";
3
- import { useState as J, useRef as U, useEffect as K, useCallback as j } from "react";
4
- import { useLayoutEffect as z } from "./index237.mjs";
5
- import { useResizeObserver as k } from "./index252.mjs";
6
- import { useLocale as M } from "@react-aria/i18n";
7
- let e = typeof document < "u" ? window.visualViewport : null;
8
- function te(n) {
9
- let { direction: y } = M(), { arrowSize: w = 0, targetRef: c, overlayRef: i, scrollRef: s = i, placement: H = "bottom", containerPadding: P = 12, shouldFlip: L = !0, boundaryElement: $ = typeof document < "u" ? document.body : null, offset: C = 0, crossOffset: B = 0, shouldUpdatePosition: S = !0, isOpen: v = !0, onClose: p, maxHeight: b, arrowBoundaryOffset: T = 0 } = n, [t, I] = J(null), F = [
10
- S,
11
- H,
12
- i.current,
13
- c.current,
14
- s.current,
15
- P,
16
- L,
17
- $,
18
- C,
19
- B,
20
- v,
21
- y,
22
- b,
23
- T,
24
- w
25
- ], N = U(e == null ? void 0 : e.scale);
26
- K(() => {
27
- v && (N.current = e == null ? void 0 : e.scale);
28
- }, [
29
- v
30
- ]);
31
- let a = j(() => {
32
- if (S === !1 || !v || !i.current || !c.current || !$ || (e == null ? void 0 : e.scale) !== N.current) return;
33
- let o = null;
34
- if (s.current && s.current.contains(document.activeElement)) {
35
- var d;
36
- let r = (d = document.activeElement) === null || d === void 0 ? void 0 : d.getBoundingClientRect(), g = s.current.getBoundingClientRect();
37
- var u;
38
- if (o = {
39
- type: "top",
40
- offset: ((u = r == null ? void 0 : r.top) !== null && u !== void 0 ? u : 0) - g.top
41
- }, o.offset > g.height / 2) {
42
- o.type = "bottom";
43
- var R;
44
- o.offset = ((R = r == null ? void 0 : r.bottom) !== null && R !== void 0 ? R : 0) - g.bottom;
45
- }
46
- }
47
- let l = i.current;
48
- if (!b && i.current) {
49
- var O;
50
- l.style.top = "0px", l.style.bottom = "";
51
- var E;
52
- l.style.maxHeight = ((E = (O = window.visualViewport) === null || O === void 0 ? void 0 : O.height) !== null && E !== void 0 ? E : window.innerHeight) + "px";
53
- }
54
- let f = D({
55
- placement: W(H, y),
56
- overlayNode: i.current,
57
- targetNode: c.current,
58
- scrollNode: s.current || i.current,
59
- padding: P,
60
- shouldFlip: L,
61
- boundaryElement: $,
62
- offset: C,
63
- crossOffset: B,
64
- maxHeight: b,
65
- arrowSize: w,
66
- arrowBoundaryOffset: T
67
- });
68
- if (f.position) {
69
- if (l.style.top = "", l.style.bottom = "", l.style.left = "", l.style.right = "", Object.keys(f.position).forEach((r) => l.style[r] = f.position[r] + "px"), l.style.maxHeight = f.maxHeight != null ? f.maxHeight + "px" : "", o && document.activeElement && s.current) {
70
- let r = document.activeElement.getBoundingClientRect(), g = s.current.getBoundingClientRect(), A = r[o.type] - g[o.type];
71
- s.current.scrollTop += A - o.offset;
72
- }
73
- I(f);
74
- }
75
- }, F);
76
- z(a, F), Q(a), k({
77
- ref: i,
78
- onResize: a
79
- }), k({
80
- ref: c,
81
- onResize: a
82
- });
83
- let m = U(!1);
84
- z(() => {
85
- let o, d = () => {
86
- m.current = !0, clearTimeout(o), o = setTimeout(() => {
87
- m.current = !1;
88
- }, 500), a();
89
- }, u = () => {
90
- m.current && d();
91
- };
92
- return e == null || e.addEventListener("resize", d), e == null || e.addEventListener("scroll", u), () => {
93
- e == null || e.removeEventListener("resize", d), e == null || e.removeEventListener("scroll", u);
94
- };
95
- }, [
96
- a
97
- ]);
98
- let q = j(() => {
99
- m.current || p == null || p();
100
- }, [
101
- p,
102
- m
103
- ]);
104
- G({
105
- triggerRef: c,
106
- isOpen: v,
107
- onClose: p && q
108
- });
109
- var h, x;
110
- return {
111
- overlayProps: {
112
- style: {
113
- position: "absolute",
114
- zIndex: 1e5,
115
- ...t == null ? void 0 : t.position,
116
- maxHeight: (h = t == null ? void 0 : t.maxHeight) !== null && h !== void 0 ? h : "100vh"
117
- }
118
- },
119
- placement: (x = t == null ? void 0 : t.placement) !== null && x !== void 0 ? x : null,
120
- arrowProps: {
121
- "aria-hidden": "true",
122
- role: "presentation",
123
- style: {
124
- left: t == null ? void 0 : t.arrowOffsetLeft,
125
- top: t == null ? void 0 : t.arrowOffsetTop
126
- }
127
- },
128
- updatePosition: a
129
- };
130
- }
131
- function Q(n) {
132
- z(() => (window.addEventListener("resize", n, !1), () => {
133
- window.removeEventListener("resize", n, !1);
134
- }), [
135
- n
136
- ]);
137
- }
138
- function W(n, y) {
139
- return y === "rtl" ? n.replace("start", "right").replace("end", "left") : n.replace("start", "left").replace("end", "right");
1
+ import { isScrollable as r } from "./index266.mjs";
2
+ function s(e, t) {
3
+ const c = [];
4
+ for (; e && e !== document.documentElement; )
5
+ r(e, t) && c.push(e), e = e.parentElement;
6
+ return c;
140
7
  }
141
8
  export {
142
- te as useOverlayPosition
9
+ s as getScrollParents
143
10
  };
package/index268.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const it=require("./index247.js"),q=require("./index289.js"),x={top:"top",bottom:"top",left:"left",right:"left"},z={top:"bottom",bottom:"top",left:"right",right:"left"},ct={top:"left",left:"top"},j={top:"height",left:"width"},B={width:"totalWidth",height:"totalHeight"},H={};let $=typeof document<"u"?window.visualViewport:null;function G(e){let t=0,o=0,c=0,i=0,r=0,f=0,l={};var v;let p=((v=$==null?void 0:$.scale)!==null&&v!==void 0?v:1)>1;if(e.tagName==="BODY"){let h=document.documentElement;c=h.clientWidth,i=h.clientHeight;var s;t=(s=$==null?void 0:$.width)!==null&&s!==void 0?s:c;var d;o=(d=$==null?void 0:$.height)!==null&&d!==void 0?d:i,l.top=h.scrollTop||e.scrollTop,l.left=h.scrollLeft||e.scrollLeft,$&&(r=$.offsetTop,f=$.offsetLeft)}else({width:t,height:o,top:r,left:f}=M(e)),l.top=e.scrollTop,l.left=e.scrollLeft,c=t,i=o;if(it.isWebKit()&&(e.tagName==="BODY"||e.tagName==="HTML")&&p){l.top=0,l.left=0;var g;r=(g=$==null?void 0:$.pageTop)!==null&&g!==void 0?g:0;var n;f=(n=$==null?void 0:$.pageLeft)!==null&&n!==void 0?n:0}return{width:t,height:o,totalWidth:c,totalHeight:i,scroll:l,top:r,left:f}}function nt(e){return{top:e.scrollTop,left:e.scrollLeft,width:e.scrollWidth,height:e.scrollHeight}}function K(e,t,o,c,i,r,f){var l;let v=(l=i.scroll[e])!==null&&l!==void 0?l:0,p=c[j[e]],s=c.scroll[x[e]]+r,d=p+c.scroll[x[e]]-r,g=t-v+f[e]-c[x[e]],n=t-v+o+f[e]-c[x[e]];return g<s?s-g:n>d?Math.max(d-n,s-g):0}function rt(e){let t=window.getComputedStyle(e);return{top:parseInt(t.marginTop,10)||0,bottom:parseInt(t.marginBottom,10)||0,left:parseInt(t.marginLeft,10)||0,right:parseInt(t.marginRight,10)||0}}function J(e){if(H[e])return H[e];let[t,o]=e.split(" "),c=x[t]||"right",i=ct[c];x[o]||(o="center");let r=j[c],f=j[i];return H[e]={placement:t,crossPlacement:o,axis:c,crossAxis:i,size:r,crossSize:f},H[e]}function Z(e,t,o,c,i,r,f,l,v,p){let{placement:s,crossPlacement:d,axis:g,crossAxis:n,size:h,crossSize:u}=c,a={};var w;a[n]=(w=e[n])!==null&&w!==void 0?w:0;var m,P,E,T;d==="center"?a[n]+=(((m=e[u])!==null&&m!==void 0?m:0)-((P=o[u])!==null&&P!==void 0?P:0))/2:d!==n&&(a[n]+=((E=e[u])!==null&&E!==void 0?E:0)-((T=o[u])!==null&&T!==void 0?T:0)),a[n]+=r;const _=e[n]-o[u]+v+p,S=e[n]+e[u]-v-p;if(a[n]=q.clamp(a[n],_,S),s===g){const L=l?f[h]:t[B[h]];a[z[g]]=Math.floor(L-e[g]+i)}else a[g]=Math.floor(e[g]+e[h]+i);return a}function at(e,t,o,c,i,r,f,l){const v=c?o.height:t[B.height];var p;let s=e.top!=null?o.top+e.top:o.top+(v-((p=e.bottom)!==null&&p!==void 0?p:0)-f);var d,g,n,h,u,a;let w=l!=="top"?Math.max(0,t.height+t.top+((d=t.scroll.top)!==null&&d!==void 0?d:0)-s-(((g=i.top)!==null&&g!==void 0?g:0)+((n=i.bottom)!==null&&n!==void 0?n:0)+r)):Math.max(0,s+f-(t.top+((h=t.scroll.top)!==null&&h!==void 0?h:0))-(((u=i.top)!==null&&u!==void 0?u:0)+((a=i.bottom)!==null&&a!==void 0?a:0)+r));return Math.min(t.height-r*2,w)}function Q(e,t,o,c,i,r){let{placement:f,axis:l,size:v}=r;var p,s;if(f===l)return Math.max(0,o[l]-e[l]-((p=e.scroll[l])!==null&&p!==void 0?p:0)+t[l]-((s=c[l])!==null&&s!==void 0?s:0)-c[z[l]]-i);var d;return Math.max(0,e[v]+e[l]+e.scroll[l]-t[l]-o[l]-o[v]-((d=c[l])!==null&&d!==void 0?d:0)-c[z[l]]-i)}function V(e,t,o,c,i,r,f,l,v,p,s,d,g,n,h,u){let a=J(e),{size:w,crossAxis:m,crossSize:P,placement:E,crossPlacement:T}=a,_=Z(t,l,o,a,s,d,p,g,h,u),S=s,L=Q(l,p,t,i,r+s,a);if(f&&c[w]>L){let X=J(`${z[E]} ${T}`),ot=Z(t,l,o,X,s,d,p,g,h,u);Q(l,p,t,i,r+s,X)>L&&(a=X,_=ot,S=s)}let b="bottom";a.axis==="top"?a.placement==="top"?b="top":a.placement==="bottom"&&(b="bottom"):a.crossAxis==="top"&&(a.crossPlacement==="top"?b="bottom":a.crossPlacement==="bottom"&&(b="top"));let I=K(m,_[m],o[P],l,v,r,p);_[m]+=I;let C=at(_,l,p,g,i,r,o.height,b);n&&n<C&&(C=n),o.height=Math.min(o.height,C),_=Z(t,l,o,a,S,d,p,g,h,u),I=K(m,_[m],o[P],l,v,r,p),_[m]+=I;let A={},k=t[m]+.5*t[P]-_[m]-i[x[m]];const D=h/2+u;var F,N,R,Y;const O=x[m]==="left"?((F=i.left)!==null&&F!==void 0?F:0)+((N=i.right)!==null&&N!==void 0?N:0):((R=i.top)!==null&&R!==void 0?R:0)+((Y=i.bottom)!==null&&Y!==void 0?Y:0),y=o[P]-O-h/2-u,tt=t[m]+h/2-(_[m]+i[x[m]]),et=t[m]+t[P]-h/2-(_[m]+i[x[m]]),lt=q.clamp(k,tt,et);return A[m]=q.clamp(lt,D,y),{position:_,maxHeight:C,arrowOffsetLeft:A.left,arrowOffsetTop:A.top,placement:a.placement}}function pt(e){let{placement:t,targetNode:o,overlayNode:c,scrollNode:i,padding:r,shouldFlip:f,boundaryElement:l,offset:v,crossOffset:p,maxHeight:s,arrowSize:d=0,arrowBoundaryOffset:g=0}=e,n=c instanceof HTMLElement?st(c):document.documentElement,h=n===document.documentElement;const u=window.getComputedStyle(n).position;let a=!!u&&u!=="static",w=h?M(o):U(o,n);if(!h){let{marginTop:A,marginLeft:k}=window.getComputedStyle(o);w.top+=parseInt(A,10)||0,w.left+=parseInt(k,10)||0}let m=M(c),P=rt(c);var E,T;m.width+=((E=P.left)!==null&&E!==void 0?E:0)+((T=P.right)!==null&&T!==void 0?T:0);var _,S;m.height+=((_=P.top)!==null&&_!==void 0?_:0)+((S=P.bottom)!==null&&S!==void 0?S:0);let L=nt(i),b=G(l),I=G(n),C=l.tagName==="BODY"?M(n):U(n,l);return n.tagName==="HTML"&&l.tagName==="BODY"&&(I.scroll.top=0,I.scroll.left=0),V(t,w,m,L,P,r,f,b,I,C,v,p,a,s,d,g)}function M(e){let{top:t,left:o,width:c,height:i}=e.getBoundingClientRect(),{scrollTop:r,scrollLeft:f,clientTop:l,clientLeft:v}=document.documentElement;return{top:t+r-l,left:o+f-v,width:c,height:i}}function U(e,t){let o=window.getComputedStyle(e),c;if(o.position==="fixed"){let{top:i,left:r,width:f,height:l}=e.getBoundingClientRect();c={top:i,left:r,width:f,height:l}}else{c=M(e);let i=M(t),r=window.getComputedStyle(t);i.top+=(parseInt(r.borderTopWidth,10)||0)-t.scrollTop,i.left+=(parseInt(r.borderLeftWidth,10)||0)-t.scrollLeft,c.top-=i.top,c.left-=i.left}return c.top-=parseInt(o.marginTop,10)||0,c.left-=parseInt(o.marginLeft,10)||0,c}function st(e){let t=e.offsetParent;if(t&&t===document.body&&window.getComputedStyle(t).position==="static"&&!W(t)&&(t=document.documentElement),t==null)for(t=e.parentElement;t&&!W(t);)t=t.parentElement;return t||document.documentElement}function W(e){let t=window.getComputedStyle(e);return t.transform!=="none"||/transform|perspective/.test(t.willChange)||t.filter!=="none"||t.contain==="paint"||"backdropFilter"in t&&t.backdropFilter!=="none"||"WebkitBackdropFilter"in t&&t.WebkitBackdropFilter!=="none"}exports.calculatePosition=pt;exports.calculatePositionInternal=V;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index235.js"),f=require("react");let l=0;const r=new Map;function i(t){let[u,a]=f.useState();return o.useLayoutEffect(()=>{if(!t)return;let e=r.get(t);if(e)a(e.element.id);else{let d=`react-aria-description-${l++}`;a(d);let n=document.createElement("div");n.id=d,n.style.display="none",n.textContent=t,document.body.appendChild(n),e={refCount:0,element:n},r.set(t,e)}return e.refCount++,()=>{e&&--e.refCount===0&&(e.element.remove(),r.delete(t))}},[t]),{"aria-describedby":t?u:void 0}}exports.useDescription=i;