@okam/stack-ui 1.33.0 → 1.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 (459) hide show
  1. package/components/Button/interface.d.ts +3 -0
  2. package/index.d.ts +1 -0
  3. package/index101.js +1 -1
  4. package/index101.mjs +1 -1
  5. package/index102.js +1 -1
  6. package/index102.mjs +3 -3
  7. package/index103.js +1 -1
  8. package/index103.mjs +1 -1
  9. package/index108.js +1 -1
  10. package/index108.mjs +1 -1
  11. package/index110.js +1 -1
  12. package/index110.mjs +3 -3
  13. package/index111.js +1 -1
  14. package/index111.mjs +3 -3
  15. package/index112.js +1 -1
  16. package/index112.mjs +1 -1
  17. package/index113.js +1 -1
  18. package/index113.mjs +1 -1
  19. package/index114.js +1 -1
  20. package/index114.mjs +1 -1
  21. package/index116.js +1 -1
  22. package/index116.mjs +5 -5
  23. package/index117.js +1 -1
  24. package/index117.mjs +1 -1
  25. package/index119.js +1 -1
  26. package/index119.mjs +3 -3
  27. package/index120.js +1 -1
  28. package/index120.mjs +3 -3
  29. package/index121.js +1 -1
  30. package/index121.mjs +5 -5
  31. package/index122.js +1 -1
  32. package/index122.mjs +1 -1
  33. package/index123.js +1 -1
  34. package/index123.mjs +2 -2
  35. package/index124.js +1 -1
  36. package/index124.mjs +8 -8
  37. package/index125.js +1 -1
  38. package/index125.mjs +1 -1
  39. package/index126.js +1 -1
  40. package/index126.mjs +3 -3
  41. package/index127.js +1 -1
  42. package/index127.mjs +3 -3
  43. package/index131.js +1 -1
  44. package/index131.mjs +1 -1
  45. package/index134.js +1 -1
  46. package/index134.mjs +1 -1
  47. package/index139.js +1 -1
  48. package/index139.mjs +10 -46
  49. package/index140.js +1 -1
  50. package/index140.mjs +12 -241
  51. package/index141.js +1 -2
  52. package/index141.mjs +46 -13
  53. package/index142.js +1 -1
  54. package/index142.mjs +239 -28
  55. package/index143.js +2 -1
  56. package/index143.mjs +13 -52
  57. package/index144.js +1 -1
  58. package/index144.mjs +29 -11
  59. package/index145.js +1 -1
  60. package/index145.mjs +51 -9
  61. package/index146.js +1 -1
  62. package/index146.mjs +20 -21
  63. package/index147.js +1 -1
  64. package/index147.mjs +21 -38
  65. package/index148.js +1 -1
  66. package/index148.mjs +39 -25
  67. package/index149.js +1 -1
  68. package/index149.mjs +24 -254
  69. package/index150.js +1 -1
  70. package/index150.mjs +246 -97
  71. package/index151.js +1 -1
  72. package/index151.mjs +100 -327
  73. package/index152.js +1 -1
  74. package/index152.mjs +332 -23
  75. package/index153.js +1 -1
  76. package/index153.mjs +102 -109
  77. package/index154.js +1 -1
  78. package/index154.mjs +83 -107
  79. package/index155.js +1 -1
  80. package/index155.mjs +26 -83
  81. package/index156.js +1 -1
  82. package/index156.mjs +24 -26
  83. package/index157.js +1 -1
  84. package/index157.mjs +112 -19
  85. package/index159.js +1 -1
  86. package/index159.mjs +69 -23
  87. package/index160.js +1 -1
  88. package/index160.mjs +338 -62
  89. package/index161.js +1 -1
  90. package/index161.mjs +42 -346
  91. package/index162.js +1 -1
  92. package/index162.mjs +4 -46
  93. package/index163.js +1 -1
  94. package/index163.mjs +25 -4
  95. package/index164.js +1 -1
  96. package/index164.mjs +46 -23
  97. package/index165.js +1 -1
  98. package/index165.mjs +4 -46
  99. package/index166.js +1 -1
  100. package/index166.mjs +6 -6
  101. package/index167.js +1 -1
  102. package/index167.mjs +15 -6
  103. package/index168.js +1 -1
  104. package/index168.mjs +21 -14
  105. package/index169.js +1 -1
  106. package/index169.mjs +42 -21
  107. package/index170.js +1 -1
  108. package/index170.mjs +23 -41
  109. package/index171.js +1 -1
  110. package/index171.mjs +37 -24
  111. package/index172.js +1 -1
  112. package/index172.mjs +27 -36
  113. package/index173.js +1 -1
  114. package/index173.mjs +30 -27
  115. package/index174.js +1 -1
  116. package/index174.mjs +13 -30
  117. package/index175.js +1 -1
  118. package/index175.mjs +9 -14
  119. package/index176.js +1 -1
  120. package/index176.mjs +28 -9
  121. package/index177.js +1 -1
  122. package/index177.mjs +9 -28
  123. package/index178.js +1 -1
  124. package/index178.mjs +6 -9
  125. package/index179.js +1 -1
  126. package/index179.mjs +5 -6
  127. package/index180.js +1 -1
  128. package/index180.mjs +7 -5
  129. package/index181.js +1 -1
  130. package/index181.mjs +29 -7
  131. package/index182.js +1 -1
  132. package/index182.mjs +16 -27
  133. package/index183.js +1 -1
  134. package/index183.mjs +12 -17
  135. package/index184.js +1 -1
  136. package/index184.mjs +43 -13
  137. package/index185.js +1 -1
  138. package/index185.mjs +7 -42
  139. package/index186.js +1 -1
  140. package/index186.mjs +5 -8
  141. package/index187.js +1 -1
  142. package/index187.mjs +17 -5
  143. package/index188.js +1 -1
  144. package/index188.mjs +28 -14
  145. package/index189.js +1 -1
  146. package/index189.mjs +24 -28
  147. package/index191.js +1 -1
  148. package/index191.mjs +1 -1
  149. package/index192.js +1 -1
  150. package/index192.mjs +2 -2
  151. package/index194.js +1 -1
  152. package/index194.mjs +4 -4
  153. package/index195.js +1 -1
  154. package/index195.mjs +2 -2
  155. package/index197.js +1 -1
  156. package/index197.mjs +3 -3
  157. package/index198.js +1 -1
  158. package/index198.mjs +1 -1
  159. package/index2.js +1 -1
  160. package/index2.mjs +1 -0
  161. package/index200.js +1 -1
  162. package/index200.mjs +1 -1
  163. package/index202.js +1 -1
  164. package/index202.mjs +1 -1
  165. package/index203.js +1 -1
  166. package/index203.mjs +205 -197
  167. package/index204.js +1 -1
  168. package/index204.mjs +24 -64
  169. package/index205.js +1 -1
  170. package/index205.mjs +4 -143
  171. package/index206.js +1 -1
  172. package/index206.mjs +3 -124
  173. package/index207.js +1 -1
  174. package/index207.mjs +116 -215
  175. package/index208.js +1 -1
  176. package/index208.mjs +23 -184
  177. package/index209.js +1 -1
  178. package/index209.mjs +51 -69
  179. package/index210.js +1 -1
  180. package/index210.mjs +43 -278
  181. package/index211.js +1 -1
  182. package/index211.mjs +31 -92
  183. package/index212.js +1 -1
  184. package/index212.mjs +109 -184
  185. package/index213.js +1 -1
  186. package/index213.mjs +77 -84
  187. package/index214.js +1 -1
  188. package/index214.mjs +101 -58
  189. package/index215.js +1 -1
  190. package/index215.mjs +98 -127
  191. package/index216.js +1 -1
  192. package/index216.mjs +70 -114
  193. package/index217.js +1 -1
  194. package/index217.mjs +91 -118
  195. package/index218.js +1 -1
  196. package/index218.mjs +152 -69
  197. package/index219.js +1 -1
  198. package/index219.mjs +72 -111
  199. package/index220.js +1 -1
  200. package/index220.mjs +60 -51
  201. package/index221.js +1 -1
  202. package/index221.mjs +57 -91
  203. package/index222.js +1 -1
  204. package/index222.mjs +196 -63
  205. package/index223.js +1 -1
  206. package/index223.mjs +59 -51
  207. package/index224.js +1 -1
  208. package/index224.mjs +137 -93
  209. package/index225.js +1 -5
  210. package/index225.mjs +121 -77
  211. package/index226.js +1 -1
  212. package/index226.mjs +208 -2009
  213. package/index227.js +1 -1
  214. package/index227.mjs +188 -57
  215. package/index228.js +1 -1
  216. package/index228.mjs +67 -186
  217. package/index229.js +1 -1
  218. package/index229.mjs +271 -203
  219. package/index230.js +1 -1
  220. package/index230.mjs +98 -24
  221. package/index231.js +1 -1
  222. package/index231.mjs +188 -4
  223. package/index232.js +1 -1
  224. package/index232.mjs +84 -3
  225. package/index233.js +1 -1
  226. package/index233.mjs +56 -123
  227. package/index234.js +1 -1
  228. package/index234.mjs +125 -28
  229. package/index235.js +1 -1
  230. package/index235.mjs +113 -48
  231. package/index236.js +1 -1
  232. package/index236.mjs +119 -41
  233. package/index237.js +1 -1
  234. package/index237.mjs +71 -36
  235. package/index238.js +1 -1
  236. package/index238.mjs +105 -108
  237. package/index239.js +1 -1
  238. package/index239.mjs +52 -77
  239. package/index240.js +1 -1
  240. package/index240.mjs +93 -101
  241. package/index241.js +1 -1
  242. package/index241.mjs +71 -98
  243. package/index242.js +1 -1
  244. package/index242.mjs +54 -70
  245. package/index243.js +1 -1
  246. package/index243.mjs +96 -92
  247. package/index244.js +5 -1
  248. package/index244.mjs +76 -151
  249. package/index245.js +1 -1
  250. package/index245.mjs +2025 -71
  251. package/index246.js +1 -1
  252. package/index246.mjs +59 -61
  253. package/index247.js +1 -1
  254. package/index247.mjs +187 -58
  255. package/index27.js +1 -1
  256. package/index27.mjs +3 -3
  257. package/index286.js +1 -1
  258. package/index286.mjs +4 -130
  259. package/index287.js +1 -1
  260. package/index287.mjs +42 -184
  261. package/index288.js +1 -1
  262. package/index288.mjs +16 -10
  263. package/index289.js +1 -1
  264. package/index289.mjs +16 -4
  265. package/index290.js +1 -1
  266. package/index290.mjs +16 -37
  267. package/index291.js +1 -1
  268. package/index291.mjs +16 -6
  269. package/index292.js +1 -1
  270. package/index292.mjs +16 -30
  271. package/index293.js +1 -1
  272. package/index293.mjs +16 -7
  273. package/index294.js +1 -1
  274. package/index294.mjs +16 -5
  275. package/index295.js +1 -1
  276. package/index295.mjs +16 -49
  277. package/index296.js +1 -1
  278. package/index296.mjs +15 -15
  279. package/index297.js +1 -1
  280. package/index297.mjs +15 -15
  281. package/index298.js +1 -1
  282. package/index298.mjs +12 -12
  283. package/index299.js +1 -1
  284. package/index299.mjs +15 -15
  285. package/index300.js +1 -1
  286. package/index300.mjs +15 -15
  287. package/index301.js +1 -1
  288. package/index301.mjs +15 -15
  289. package/index302.js +1 -1
  290. package/index302.mjs +15 -15
  291. package/index303.js +1 -1
  292. package/index303.mjs +15 -15
  293. package/index304.js +1 -1
  294. package/index304.mjs +15 -15
  295. package/index305.js +1 -1
  296. package/index305.mjs +15 -15
  297. package/index306.js +1 -1
  298. package/index306.mjs +12 -12
  299. package/index307.js +1 -1
  300. package/index307.mjs +15 -15
  301. package/index308.js +1 -1
  302. package/index308.mjs +15 -15
  303. package/index309.js +1 -1
  304. package/index309.mjs +15 -15
  305. package/index310.js +1 -1
  306. package/index310.mjs +12 -12
  307. package/index311.js +1 -1
  308. package/index311.mjs +15 -15
  309. package/index312.js +1 -1
  310. package/index312.mjs +15 -15
  311. package/index313.js +1 -1
  312. package/index313.mjs +15 -15
  313. package/index314.js +1 -1
  314. package/index314.mjs +12 -12
  315. package/index315.js +1 -1
  316. package/index315.mjs +15 -15
  317. package/index316.js +1 -1
  318. package/index316.mjs +15 -15
  319. package/index317.js +1 -1
  320. package/index317.mjs +15 -15
  321. package/index318.js +1 -1
  322. package/index318.mjs +12 -12
  323. package/index319.js +1 -1
  324. package/index319.mjs +15 -15
  325. package/index320.js +1 -1
  326. package/index320.mjs +15 -15
  327. package/index321.js +1 -1
  328. package/index321.mjs +12 -12
  329. package/index322.js +1 -1
  330. package/index322.mjs +130 -15
  331. package/index323.js +1 -1
  332. package/index323.mjs +191 -16
  333. package/index324.js +1 -1
  334. package/index324.mjs +10 -16
  335. package/index325.js +1 -1
  336. package/index325.mjs +4 -16
  337. package/index326.js +1 -1
  338. package/index326.mjs +37 -16
  339. package/index327.js +1 -1
  340. package/index327.mjs +6 -16
  341. package/index328.js +1 -1
  342. package/index328.mjs +30 -16
  343. package/index329.js +1 -1
  344. package/index329.mjs +7 -16
  345. package/index330.js +1 -1
  346. package/index330.mjs +10 -139
  347. package/index331.js +1 -1
  348. package/index331.mjs +6 -197
  349. package/index332.js +1 -1
  350. package/index332.mjs +64 -18
  351. package/index333.js +1 -1
  352. package/index333.mjs +46 -44
  353. package/index334.js +1 -1
  354. package/index334.mjs +27 -45
  355. package/index335.js +1 -1
  356. package/index335.mjs +6 -100
  357. package/index336.js +1 -1
  358. package/index336.mjs +7 -72
  359. package/index337.js +1 -1
  360. package/index337.mjs +5 -58
  361. package/index338.js +1 -1
  362. package/index338.mjs +140 -7
  363. package/index339.js +1 -1
  364. package/index339.mjs +197 -11
  365. package/index340.js +1 -1
  366. package/index340.mjs +23 -7
  367. package/index341.js +1 -1
  368. package/index341.mjs +44 -66
  369. package/index342.js +1 -1
  370. package/index342.mjs +97 -27
  371. package/index343.js +1 -1
  372. package/index343.mjs +72 -7
  373. package/index344.js +1 -1
  374. package/index344.mjs +58 -6
  375. package/index345.js +1 -1
  376. package/index345.mjs +7 -20
  377. package/index346.js +1 -1
  378. package/index346.mjs +20 -5
  379. package/index383.js +1 -1
  380. package/index383.mjs +4 -5
  381. package/index384.js +1 -1
  382. package/index384.mjs +5 -5
  383. package/index385.js +1 -1
  384. package/index385.mjs +9 -5
  385. package/index386.js +1 -1
  386. package/index386.mjs +4 -4
  387. package/index387.js +1 -1
  388. package/index387.mjs +4 -4
  389. package/index388.js +1 -1
  390. package/index388.mjs +4 -4
  391. package/index389.js +1 -1
  392. package/index389.mjs +4 -4
  393. package/index390.js +1 -1
  394. package/index390.mjs +4 -4
  395. package/index391.js +1 -1
  396. package/index391.mjs +4 -4
  397. package/index392.js +1 -1
  398. package/index392.mjs +4 -4
  399. package/index393.js +1 -1
  400. package/index393.mjs +4 -4
  401. package/index394.js +1 -1
  402. package/index394.mjs +4 -4
  403. package/index395.js +1 -1
  404. package/index395.mjs +4 -4
  405. package/index396.js +1 -1
  406. package/index396.mjs +4 -4
  407. package/index397.js +1 -1
  408. package/index397.mjs +4 -4
  409. package/index398.js +1 -1
  410. package/index398.mjs +4 -4
  411. package/index399.js +1 -1
  412. package/index399.mjs +1 -1
  413. package/index400.js +1 -1
  414. package/index400.mjs +1 -1
  415. package/index401.js +1 -1
  416. package/index401.mjs +4 -4
  417. package/index402.js +1 -1
  418. package/index402.mjs +1 -1
  419. package/index403.js +1 -1
  420. package/index403.mjs +4 -4
  421. package/index404.js +1 -1
  422. package/index404.mjs +1 -1
  423. package/index405.js +1 -1
  424. package/index405.mjs +4 -4
  425. package/index406.js +1 -1
  426. package/index406.mjs +4 -4
  427. package/index407.js +1 -1
  428. package/index407.mjs +1 -1
  429. package/index408.js +1 -1
  430. package/index408.mjs +4 -4
  431. package/index409.js +1 -1
  432. package/index409.mjs +1 -1
  433. package/index410.js +1 -1
  434. package/index410.mjs +4 -4
  435. package/index411.js +1 -1
  436. package/index411.mjs +4 -4
  437. package/index412.js +1 -1
  438. package/index412.mjs +1 -1
  439. package/index413.js +1 -1
  440. package/index413.mjs +4 -4
  441. package/index414.js +1 -1
  442. package/index414.mjs +4 -4
  443. package/index415.js +1 -1
  444. package/index415.mjs +4 -4
  445. package/index416.js +1 -1
  446. package/index416.mjs +4 -4
  447. package/index417.js +1 -1
  448. package/index417.mjs +5 -4
  449. package/index418.js +1 -1
  450. package/index418.mjs +5 -5
  451. package/index419.js +1 -1
  452. package/index419.mjs +5 -9
  453. package/index8.js +1 -1
  454. package/index8.mjs +8 -8
  455. package/index99.js +1 -1
  456. package/index99.mjs +1 -1
  457. package/package.json +1 -1
  458. package/providers/SidePanel/interface.d.ts +17 -5
  459. package/types/next-link.d.ts +2 -1
package/index334.mjs CHANGED
@@ -1,51 +1,33 @@
1
- import { getOwnerDocument as p } from "./index167.mjs";
2
- import { useEffectEvent as E } from "./index184.mjs";
3
- import { useRef as w, useEffect as D } from "react";
4
- function $(r) {
5
- let { ref: n, onInteractOutside: i, isDisabled: d, onInteractOutsideStart: l } = r, m = w({
6
- isPointerDown: !1,
7
- ignoreEmulatedMouseEvents: !1
8
- }), o = E((e) => {
9
- i && c(e, n) && (l && l(e), m.current.isPointerDown = !0);
10
- }), f = E((e) => {
11
- i && i(e);
12
- });
13
- D(() => {
14
- let e = m.current;
15
- if (d) return;
16
- const v = n.current, t = p(v);
17
- if (typeof PointerEvent < "u") {
18
- let s = (u) => {
19
- e.isPointerDown && c(u, n) && f(u), e.isPointerDown = !1;
20
- };
21
- return t.addEventListener("pointerdown", o, !0), t.addEventListener("pointerup", s, !0), () => {
22
- t.removeEventListener("pointerdown", o, !0), t.removeEventListener("pointerup", s, !0);
23
- };
24
- } else {
25
- let s = (a) => {
26
- e.ignoreEmulatedMouseEvents ? e.ignoreEmulatedMouseEvents = !1 : e.isPointerDown && c(a, n) && f(a), e.isPointerDown = !1;
27
- }, u = (a) => {
28
- e.ignoreEmulatedMouseEvents = !0, e.isPointerDown && c(a, n) && f(a), e.isPointerDown = !1;
29
- };
30
- return t.addEventListener("mousedown", o, !0), t.addEventListener("mouseup", s, !0), t.addEventListener("touchstart", o, !0), t.addEventListener("touchend", u, !0), () => {
31
- t.removeEventListener("mousedown", o, !0), t.removeEventListener("mouseup", s, !0), t.removeEventListener("touchstart", o, !0), t.removeEventListener("touchend", u, !0);
32
- };
1
+ import { getOwnerDocument as c } from "./index166.mjs";
2
+ import { runAfterTransition as i } from "./index172.mjs";
3
+ import { isIOS as o } from "./index171.mjs";
4
+ let n = "default", l = "", s = /* @__PURE__ */ new WeakMap();
5
+ function r(e) {
6
+ if (o()) {
7
+ if (n === "default") {
8
+ const t = c(e);
9
+ l = t.documentElement.style.webkitUserSelect, t.documentElement.style.webkitUserSelect = "none";
33
10
  }
34
- }, [
35
- n,
36
- d,
37
- o,
38
- f
39
- ]);
11
+ n = "disabled";
12
+ } else (e instanceof HTMLElement || e instanceof SVGElement) && (s.set(e, e.style.userSelect), e.style.userSelect = "none");
40
13
  }
41
- function c(r, n) {
42
- if (r.button > 0) return !1;
43
- if (r.target) {
44
- const i = r.target.ownerDocument;
45
- if (!i || !i.documentElement.contains(r.target) || r.target.closest("[data-react-aria-top-layer]")) return !1;
14
+ function m(e) {
15
+ if (o()) {
16
+ if (n !== "disabled") return;
17
+ n = "restoring", setTimeout(() => {
18
+ i(() => {
19
+ if (n === "restoring") {
20
+ const t = c(e);
21
+ t.documentElement.style.webkitUserSelect === "none" && (t.documentElement.style.webkitUserSelect = l || ""), l = "", n = "default";
22
+ }
23
+ });
24
+ }, 300);
25
+ } else if ((e instanceof HTMLElement || e instanceof SVGElement) && e && s.has(e)) {
26
+ let t = s.get(e);
27
+ e.style.userSelect === "none" && (e.style.userSelect = t), e.getAttribute("style") === "" && e.removeAttribute("style"), s.delete(e);
46
28
  }
47
- return n.current && !n.current.contains(r.target);
48
29
  }
49
30
  export {
50
- $ as useInteractOutside
31
+ r as disableTextSelection,
32
+ m as restoreTextSelection
51
33
  };
package/index335.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index166.js"),y=require("./index163.js"),g=require("./index179.js"),S=require("./index172.js"),m=typeof document<"u"&&window.visualViewport,T=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let s=0,f;function b(e={}){let{isDisabled:t}=e;y.useLayoutEffect(()=>{if(!t)return s++,s===1&&(S.isIOS()?f=L():f=x()),()=>{s--,s===0&&f()}},[t])}function x(){return v.chain(l(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),l(document.documentElement,"overflow","hidden"))}function L(){let e,t,n=r=>{e=g.getScrollParent(r.target,!0),!(e===document.documentElement&&e===document.body)&&e instanceof HTMLElement&&window.getComputedStyle(e).overscrollBehavior==="auto"&&(t=l(e,"overscrollBehavior","contain"))},o=r=>{if(!e||e===document.documentElement||e===document.body){r.preventDefault();return}e.scrollHeight===e.clientHeight&&e.scrollWidth===e.clientWidth&&r.preventDefault()},u=r=>{let c=r.target;h(c)&&c!==document.activeElement&&(r.preventDefault(),p(),c.style.transform="translateY(-2000px)",c.focus(),requestAnimationFrame(()=>{c.style.transform=""})),t&&t()},a=r=>{let c=r.target;h(c)&&(p(),c.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{c.style.transform="",m&&(m.height<window.innerHeight?requestAnimationFrame(()=>{w(c)}):m.addEventListener("resize",()=>w(c),{once:!0}))}))},i=null,p=()=>{if(i)return;let r=()=>{window.scrollTo(0,0)},c=window.pageXOffset,$=window.pageYOffset;i=v.chain(d(window,"scroll",r),l(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),l(document.documentElement,"overflow","hidden"),l(document.body,"marginTop",`-${$}px`),()=>{window.scrollTo(c,$)}),window.scrollTo(0,0)},E=v.chain(d(document,"touchstart",n,{passive:!1,capture:!0}),d(document,"touchmove",o,{passive:!1,capture:!0}),d(document,"touchend",u,{passive:!1,capture:!0}),d(document,"focus",a,!0));return()=>{t==null||t(),i==null||i(),E()}}function l(e,t,n){let o=e.style[t];return e.style[t]=n,()=>{e.style[t]=o}}function d(e,t,n,o){return e.addEventListener(t,n,o),()=>{e.removeEventListener(t,n,o)}}function w(e){let t=document.scrollingElement||document.documentElement,n=e;for(;n&&n!==t;){let o=g.getScrollParent(n);if(o!==document.documentElement&&o!==document.body&&o!==n){let u=o.getBoundingClientRect().top,a=n.getBoundingClientRect().top;a>u+n.clientHeight&&(o.scrollTop+=a-u)}n=o.parentElement}}function h(e){return e instanceof HTMLInputElement&&!T.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}exports.usePreventScroll=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./index383.js"),s=require("./index384.js");function c(e,t){var r=s._(e,t,"get");return _._(e,r)}exports._=c;
package/index335.mjs CHANGED
@@ -1,103 +1,9 @@
1
- import { chain as $ } from "./index166.mjs";
2
- import { useLayoutEffect as b } from "./index163.mjs";
3
- import { getScrollParent as E } from "./index179.mjs";
4
- import { isIOS as y } from "./index172.mjs";
5
- const m = typeof document < "u" && window.visualViewport, T = /* @__PURE__ */ new Set([
6
- "checkbox",
7
- "radio",
8
- "range",
9
- "color",
10
- "file",
11
- "image",
12
- "button",
13
- "submit",
14
- "reset"
15
- ]);
16
- let s = 0, f;
17
- function C(e = {}) {
18
- let { isDisabled: t } = e;
19
- b(() => {
20
- if (!t)
21
- return s++, s === 1 && (y() ? f = x() : f = S()), () => {
22
- s--, s === 0 && f();
23
- };
24
- }, [
25
- t
26
- ]);
27
- }
28
- function S() {
29
- return $(l(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), l(document.documentElement, "overflow", "hidden"));
30
- }
31
- function x() {
32
- let e, t, n = (r) => {
33
- e = E(r.target, !0), !(e === document.documentElement && e === document.body) && e instanceof HTMLElement && window.getComputedStyle(e).overscrollBehavior === "auto" && (t = l(e, "overscrollBehavior", "contain"));
34
- }, o = (r) => {
35
- if (!e || e === document.documentElement || e === document.body) {
36
- r.preventDefault();
37
- return;
38
- }
39
- e.scrollHeight === e.clientHeight && e.scrollWidth === e.clientWidth && r.preventDefault();
40
- }, u = (r) => {
41
- let c = r.target;
42
- h(c) && c !== document.activeElement && (r.preventDefault(), p(), c.style.transform = "translateY(-2000px)", c.focus(), requestAnimationFrame(() => {
43
- c.style.transform = "";
44
- })), t && t();
45
- }, a = (r) => {
46
- let c = r.target;
47
- h(c) && (p(), c.style.transform = "translateY(-2000px)", requestAnimationFrame(() => {
48
- c.style.transform = "", m && (m.height < window.innerHeight ? requestAnimationFrame(() => {
49
- w(c);
50
- }) : m.addEventListener("resize", () => w(c), {
51
- once: !0
52
- }));
53
- }));
54
- }, i = null, p = () => {
55
- if (i) return;
56
- let r = () => {
57
- window.scrollTo(0, 0);
58
- }, c = window.pageXOffset, v = window.pageYOffset;
59
- i = $(d(window, "scroll", r), l(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), l(document.documentElement, "overflow", "hidden"), l(document.body, "marginTop", `-${v}px`), () => {
60
- window.scrollTo(c, v);
61
- }), window.scrollTo(0, 0);
62
- }, g = $(d(document, "touchstart", n, {
63
- passive: !1,
64
- capture: !0
65
- }), d(document, "touchmove", o, {
66
- passive: !1,
67
- capture: !0
68
- }), d(document, "touchend", u, {
69
- passive: !1,
70
- capture: !0
71
- }), d(document, "focus", a, !0));
72
- return () => {
73
- t == null || t(), i == null || i(), g();
74
- };
75
- }
76
- function l(e, t, n) {
77
- let o = e.style[t];
78
- return e.style[t] = n, () => {
79
- e.style[t] = o;
80
- };
81
- }
82
- function d(e, t, n, o) {
83
- return e.addEventListener(t, n, o), () => {
84
- e.removeEventListener(t, n, o);
85
- };
86
- }
87
- function w(e) {
88
- let t = document.scrollingElement || document.documentElement, n = e;
89
- for (; n && n !== t; ) {
90
- let o = E(n);
91
- if (o !== document.documentElement && o !== document.body && o !== n) {
92
- let u = o.getBoundingClientRect().top, a = n.getBoundingClientRect().top;
93
- a > u + n.clientHeight && (o.scrollTop += a - u);
94
- }
95
- n = o.parentElement;
96
- }
97
- }
98
- function h(e) {
99
- return e instanceof HTMLInputElement && !T.has(e.type) || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable;
1
+ import { _ as s } from "./index383.mjs";
2
+ import { _ as a } from "./index384.mjs";
3
+ function p(_, r) {
4
+ var t = a(_, r, "get");
5
+ return s(_, t);
100
6
  }
101
7
  export {
102
- C as usePreventScroll
8
+ p as _
103
9
  };
package/index336.js CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("./index383.js"),r=require("./index384.js"),t=require("./index385.js"),s=require("./index386.js"),u=require("./index387.js"),n=require("./index388.js"),i=require("./index389.js"),o=require("./index390.js"),c=require("./index391.js"),q=require("./index392.js"),R=require("./index393.js"),l=require("./index394.js"),E=require("./index395.js"),S=require("./index396.js"),h=require("./index397.js"),L=require("./index398.js"),T=require("./index399.js"),a=require("./index400.js"),I=require("./index401.js"),P=require("./index402.js"),U=require("./index403.js"),d=require("./index404.js"),f=require("./index405.js"),p=require("./index406.js"),k=require("./index407.js"),K=require("./index408.js"),N=require("./index409.js"),b=require("./index410.js"),v=require("./index411.js"),z=require("./index412.js"),A=require("./index413.js"),B=require("./index414.js"),C=require("./index415.js"),D=require("./index416.js");exports.default={};exports.default={"ar-AE":e,"bg-BG":r,"cs-CZ":t,"da-DK":s,"de-DE":u,"el-GR":n,"en-US":i,"es-ES":o,"et-EE":c,"fi-FI":q,"fr-FR":R,"he-IL":l,"hr-HR":E,"hu-HU":S,"it-IT":h,"ja-JP":L,"ko-KR":T,"lt-LT":a,"lv-LV":I,"nb-NO":P,"nl-NL":U,"pl-PL":d,"pt-BR":f,"pt-PT":p,"ro-RO":k,"ru-RU":K,"sk-SK":N,"sl-SI":b,"sr-SP":v,"sv-SE":z,"tr-TR":A,"uk-UA":B,"zh-CN":C,"zh-TW":D};module.exports=exports.default;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./index385.js"),c=require("./index384.js");function i(t,r,e){var s=c._(t,r,"set");return _._(t,s,e),e}exports._=i;
package/index336.mjs CHANGED
@@ -1,74 +1,9 @@
1
- import r from "./index383.mjs";
2
- import o from "./index384.mjs";
3
- import f from "./index385.mjs";
4
- import t from "./index386.mjs";
5
- import p from "./index387.mjs";
6
- import $ from "./index388.mjs";
7
- import e from "./index389.mjs";
8
- import m from "./index390.mjs";
9
- import s from "./index391.mjs";
10
- import d from "./index392.mjs";
11
- import c from "./index393.mjs";
12
- import i from "./index394.mjs";
13
- import x from "./index395.mjs";
14
- import a from "./index396.mjs";
15
- import b from "./index397.mjs";
16
- import R from "./index398.mjs";
17
- import l from "./index399.mjs";
18
- import E from "./index400.mjs";
19
- import S from "./index401.mjs";
20
- import h from "./index402.mjs";
21
- import L from "./index403.mjs";
22
- import T from "./index404.mjs";
23
- import u from "./index405.mjs";
24
- import I from "./index406.mjs";
25
- import P from "./index407.mjs";
26
- import U from "./index408.mjs";
27
- import k from "./index409.mjs";
28
- import n from "./index410.mjs";
29
- import v from "./index411.mjs";
30
- import K from "./index412.mjs";
31
- import N from "./index413.mjs";
32
- import z from "./index414.mjs";
33
- import A from "./index415.mjs";
34
- import B from "./index416.mjs";
35
- var C = {};
36
- C = {
37
- "ar-AE": r,
38
- "bg-BG": o,
39
- "cs-CZ": f,
40
- "da-DK": t,
41
- "de-DE": p,
42
- "el-GR": $,
43
- "en-US": e,
44
- "es-ES": m,
45
- "et-EE": s,
46
- "fi-FI": d,
47
- "fr-FR": c,
48
- "he-IL": i,
49
- "hr-HR": x,
50
- "hu-HU": a,
51
- "it-IT": b,
52
- "ja-JP": R,
53
- "ko-KR": l,
54
- "lt-LT": E,
55
- "lv-LV": S,
56
- "nb-NO": h,
57
- "nl-NL": L,
58
- "pl-PL": T,
59
- "pt-BR": u,
60
- "pt-PT": I,
61
- "ro-RO": P,
62
- "ru-RU": U,
63
- "sk-SK": k,
64
- "sl-SI": n,
65
- "sr-SP": v,
66
- "sv-SE": K,
67
- "tr-TR": N,
68
- "uk-UA": z,
69
- "zh-CN": A,
70
- "zh-TW": B
71
- };
1
+ import { _ as a } from "./index385.mjs";
2
+ import { _ as o } from "./index384.mjs";
3
+ function i(s, r, _) {
4
+ var t = o(s, r, "set");
5
+ return a(s, t, _), _;
6
+ }
72
7
  export {
73
- C as default
8
+ i as _
74
9
  };
package/index337.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let o=new WeakMap,n=[];function h(b,c=document.body){let i=new Set(b),a=new Set,u=t=>{for(let l of t.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))i.add(l);let r=l=>{if(i.has(l)||l.parentElement&&a.has(l.parentElement)&&l.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(let p of i)if(l.contains(p))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r}),E=r(t);if(E===NodeFilter.FILTER_ACCEPT&&f(t),E!==NodeFilter.FILTER_REJECT){let l=e.nextNode();for(;l!=null;)f(l),l=e.nextNode()}},f=t=>{var r;let e=(r=o.get(t))!==null&&r!==void 0?r:0;t.getAttribute("aria-hidden")==="true"&&e===0||(e===0&&t.setAttribute("aria-hidden","true"),a.add(t),o.set(t,e+1))};n.length&&n[n.length-1].disconnect(),u(c);let d=new MutationObserver(t=>{for(let r of t)if(!(r.type!=="childList"||r.addedNodes.length===0)&&![...i,...a].some(e=>e.contains(r.target))){for(let e of r.removedNodes)e instanceof Element&&(i.delete(e),a.delete(e));for(let e of r.addedNodes)(e instanceof HTMLElement||e instanceof SVGElement)&&(e.dataset.liveAnnouncer==="true"||e.dataset.reactAriaTopLayer==="true")?i.add(e):e instanceof Element&&u(e)}});d.observe(c,{childList:!0,subtree:!0});let s={observe(){d.observe(c,{childList:!0,subtree:!0})},disconnect(){d.disconnect()}};return n.push(s),()=>{d.disconnect();for(let t of a){let r=o.get(t);r!=null&&(r===1?(t.removeAttribute("aria-hidden"),o.delete(t)):o.set(t,r-1))}s===n[n.length-1]?(n.pop(),n.length&&n[n.length-1].observe()):n.splice(n.indexOf(s),1)}}exports.ariaHideOutside=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=new WeakMap;function a(t,e,f){return t?(typeof e=="string"&&(e=e.replace(/\s+/g,"")),`${r.get(t)}-${f}-${e}`):""}exports.generateId=a;exports.tabsIds=r;
package/index337.mjs CHANGED
@@ -1,61 +1,8 @@
1
- let o = /* @__PURE__ */ new WeakMap(), n = [];
2
- function b(p, c = document.body) {
3
- let i = new Set(p), a = /* @__PURE__ */ new Set(), f = (t) => {
4
- for (let l of t.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]")) i.add(l);
5
- let r = (l) => {
6
- if (i.has(l) || l.parentElement && a.has(l.parentElement) && l.parentElement.getAttribute("role") !== "row") return NodeFilter.FILTER_REJECT;
7
- for (let h of i)
8
- if (l.contains(h)) return NodeFilter.FILTER_SKIP;
9
- return NodeFilter.FILTER_ACCEPT;
10
- }, e = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, {
11
- acceptNode: r
12
- }), E = r(t);
13
- if (E === NodeFilter.FILTER_ACCEPT && u(t), E !== NodeFilter.FILTER_REJECT) {
14
- let l = e.nextNode();
15
- for (; l != null; )
16
- u(l), l = e.nextNode();
17
- }
18
- }, u = (t) => {
19
- var r;
20
- let e = (r = o.get(t)) !== null && r !== void 0 ? r : 0;
21
- t.getAttribute("aria-hidden") === "true" && e === 0 || (e === 0 && t.setAttribute("aria-hidden", "true"), a.add(t), o.set(t, e + 1));
22
- };
23
- n.length && n[n.length - 1].disconnect(), f(c);
24
- let d = new MutationObserver((t) => {
25
- for (let r of t)
26
- if (!(r.type !== "childList" || r.addedNodes.length === 0) && ![
27
- ...i,
28
- ...a
29
- ].some((e) => e.contains(r.target))) {
30
- for (let e of r.removedNodes) e instanceof Element && (i.delete(e), a.delete(e));
31
- for (let e of r.addedNodes)
32
- (e instanceof HTMLElement || e instanceof SVGElement) && (e.dataset.liveAnnouncer === "true" || e.dataset.reactAriaTopLayer === "true") ? i.add(e) : e instanceof Element && f(e);
33
- }
34
- });
35
- d.observe(c, {
36
- childList: !0,
37
- subtree: !0
38
- });
39
- let s = {
40
- observe() {
41
- d.observe(c, {
42
- childList: !0,
43
- subtree: !0
44
- });
45
- },
46
- disconnect() {
47
- d.disconnect();
48
- }
49
- };
50
- return n.push(s), () => {
51
- d.disconnect();
52
- for (let t of a) {
53
- let r = o.get(t);
54
- r != null && (r === 1 ? (t.removeAttribute("aria-hidden"), o.delete(t)) : o.set(t, r - 1));
55
- }
56
- s === n[n.length - 1] ? (n.pop(), n.length && n[n.length - 1].observe()) : n.splice(n.indexOf(s), 1);
57
- };
1
+ const f = /* @__PURE__ */ new WeakMap();
2
+ function $(t, e, a) {
3
+ return t ? (typeof e == "string" && (e = e.replace(/\s+/g, "")), `${f.get(t)}-${a}-${e}`) : "";
58
4
  }
59
5
  export {
60
- b as ariaHideOutside
6
+ $ as generateId,
7
+ f as tabsIds
61
8
  };
package/index338.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),o=t.createContext({});function r(){var e;return(e=t.useContext(o))!==null&&e!==void 0?e:{}}exports.PortalContext=o;exports.useUNSTABLE_PortalContext=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("./index339.js"),A=require("./index340.js"),f=require("react"),P=require("./index162.js"),j=require("./index176.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;
package/index338.mjs CHANGED
@@ -1,10 +1,143 @@
1
- import { useContext as e, createContext as o } from "react";
2
- const r = /* @__PURE__ */ o({});
3
- function a() {
4
- var t;
5
- return (t = e(r)) !== null && t !== void 0 ? t : {};
1
+ import { calculatePosition as D } from "./index339.mjs";
2
+ import { useCloseOnScroll as G } from "./index340.mjs";
3
+ import { useState as J, useRef as U, useEffect as K, useCallback as j } from "react";
4
+ import { useLayoutEffect as z } from "./index162.mjs";
5
+ import { useResizeObserver as k } from "./index176.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");
6
140
  }
7
141
  export {
8
- r as PortalContext,
9
- a as useUNSTABLE_PortalContext
142
+ te as useOverlayPosition
10
143
  };
package/index339.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index340.js"),e=require("react");function n({children:r}){let t=e.useMemo(()=>({register:()=>{}}),[]);return e.createElement(o.PressResponderContext.Provider,{value:t},r)}exports.ClearPressResponder=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const it=require("./index171.js"),q=require("./index248.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;