@boxcustodia/library 0.3.0 → 0.3.3

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 (356) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.es.js +206 -204
  3. package/dist/index.es10.js +1 -1
  4. package/dist/index.es100.js +40 -301
  5. package/dist/index.es101.js +30 -12
  6. package/dist/index.es102.js +29 -34
  7. package/dist/index.es103.js +53 -44
  8. package/dist/index.es104.js +54 -29
  9. package/dist/index.es105.js +92 -30
  10. package/dist/index.es106.js +35 -257
  11. package/dist/index.es107.js +24 -12
  12. package/dist/index.es108.js +30 -9
  13. package/dist/index.es109.js +7 -3672
  14. package/dist/index.es110.js +258 -3
  15. package/dist/index.es111.js +4 -6
  16. package/dist/index.es112.js +3 -4
  17. package/dist/index.es113.js +14 -57
  18. package/dist/index.es114.js +5 -19
  19. package/dist/index.es115.js +54 -1059
  20. package/dist/index.es116.js +12 -4
  21. package/dist/index.es117.js +19 -4
  22. package/dist/index.es118.js +37 -25
  23. package/dist/index.es119.js +13 -39
  24. package/dist/index.es120.js +1062 -13
  25. package/dist/index.es121.js +4 -12
  26. package/dist/index.es122.js +4 -22
  27. package/dist/index.es123.js +27 -11
  28. package/dist/index.es124.js +23 -237
  29. package/dist/index.es125.js +19 -23
  30. package/dist/index.es126.js +11 -21
  31. package/dist/index.es127.js +224 -12
  32. package/dist/index.es128.js +4 -4
  33. package/dist/index.es129.js +4 -4
  34. package/dist/index.es13.js +1 -1
  35. package/dist/index.es130.js +41 -12
  36. package/dist/index.es131.js +12 -817
  37. package/dist/index.es132.js +44 -9
  38. package/dist/index.es133.js +6 -4
  39. package/dist/index.es134.js +9 -64
  40. package/dist/index.es135.js +11 -224
  41. package/dist/index.es136.js +822 -11
  42. package/dist/index.es137.js +20 -40
  43. package/dist/index.es138.js +12 -4
  44. package/dist/index.es139.js +11 -17
  45. package/dist/index.es140.js +12 -44
  46. package/dist/index.es141.js +63 -17
  47. package/dist/index.es142.js +240 -13
  48. package/dist/index.es144.js +4 -33
  49. package/dist/index.es145.js +6 -13
  50. package/dist/index.es146.js +2 -61
  51. package/dist/index.es147.js +32 -43
  52. package/dist/index.es148.js +13 -216
  53. package/dist/index.es149.js +61 -2
  54. package/dist/index.es15.js +1 -1
  55. package/dist/index.es150.js +43 -25
  56. package/dist/index.es151.js +211 -601
  57. package/dist/index.es152.js +2 -21
  58. package/dist/index.es153.js +25 -36
  59. package/dist/index.es154.js +605 -10
  60. package/dist/index.es156.js +1 -1
  61. package/dist/index.es159.js +8 -8
  62. package/dist/index.es16.js +1 -1
  63. package/dist/index.es161.js +19 -5
  64. package/dist/index.es162.js +35 -63
  65. package/dist/index.es163.js +10 -10
  66. package/dist/index.es164.js +5 -123
  67. package/dist/index.es165.js +58 -128
  68. package/dist/index.es166.js +11 -14
  69. package/dist/index.es167.js +122 -30
  70. package/dist/index.es168.js +134 -14
  71. package/dist/index.es169.js +12 -7
  72. package/dist/index.es17.js +1 -1
  73. package/dist/index.es170.js +32 -49
  74. package/dist/index.es171.js +15 -8
  75. package/dist/index.es172.js +9 -6
  76. package/dist/index.es173.js +50 -2
  77. package/dist/index.es174.js +43 -217
  78. package/dist/index.es175.js +646 -40
  79. package/dist/index.es178.js +3 -3
  80. package/dist/index.es179.js +1 -1
  81. package/dist/index.es180.js +217 -5
  82. package/dist/index.es181.js +6 -28
  83. package/dist/index.es182.js +24 -646
  84. package/dist/index.es184.js +2 -118
  85. package/dist/index.es185.js +6 -2
  86. package/dist/index.es186.js +3 -8
  87. package/dist/index.es187.js +2056 -3
  88. package/dist/index.es188.js +114 -2050
  89. package/dist/index.es189.js +2 -2
  90. package/dist/index.es196.js +1 -1
  91. package/dist/index.es197.js +1 -1
  92. package/dist/index.es198.js +2 -2
  93. package/dist/index.es199.js +1 -1
  94. package/dist/index.es201.js +1 -1
  95. package/dist/index.es203.js +1 -1
  96. package/dist/index.es205.js +21 -14
  97. package/dist/index.es206.js +9 -7
  98. package/dist/index.es207.js +38 -7
  99. package/dist/index.es208.js +17 -18
  100. package/dist/index.es209.js +12 -52
  101. package/dist/index.es210.js +7 -6
  102. package/dist/index.es211.js +5 -6
  103. package/dist/index.es212.js +4 -6
  104. package/dist/index.es213.js +17 -7
  105. package/dist/index.es214.js +6 -16
  106. package/dist/index.es215.js +5 -8
  107. package/dist/index.es216.js +8 -6
  108. package/dist/index.es217.js +6 -7
  109. package/dist/index.es218.js +6 -13
  110. package/dist/index.es219.js +15 -10
  111. package/dist/index.es220.js +13 -84
  112. package/dist/index.es221.js +13 -5
  113. package/dist/index.es222.js +6 -17
  114. package/dist/index.es223.js +6 -5
  115. package/dist/index.es224.js +6 -6
  116. package/dist/index.es225.js +4 -6
  117. package/dist/index.es226.js +515 -9
  118. package/dist/index.es227.js +50 -7
  119. package/dist/index.es228.js +18 -21
  120. package/dist/index.es229.js +10 -9
  121. package/dist/index.es230.js +19 -38
  122. package/dist/index.es231.js +9 -18
  123. package/dist/index.es232.js +7 -11
  124. package/dist/index.es233.js +7 -7
  125. package/dist/index.es234.js +5 -5
  126. package/dist/index.es235.js +6 -4
  127. package/dist/index.es236.js +9 -5
  128. package/dist/index.es237.js +5 -8
  129. package/dist/index.es238.js +9 -6
  130. package/dist/index.es239.js +12 -15
  131. package/dist/index.es24.js +7 -55
  132. package/dist/index.es240.js +9 -4
  133. package/dist/index.es241.js +8 -515
  134. package/dist/index.es242.js +11 -50
  135. package/dist/index.es243.js +14 -17
  136. package/dist/index.es244.js +6 -9
  137. package/dist/index.es245.js +7 -19
  138. package/dist/index.es246.js +6 -8
  139. package/dist/index.es247.js +6 -7
  140. package/dist/index.es248.js +6 -7
  141. package/dist/index.es249.js +9 -5
  142. package/dist/index.es25.js +54 -114
  143. package/dist/index.es250.js +84 -6
  144. package/dist/index.es251.js +65 -10
  145. package/dist/index.es252.js +37 -5
  146. package/dist/index.es253.js +9 -8
  147. package/dist/index.es254.js +8 -12
  148. package/dist/index.es255.js +7 -9
  149. package/dist/index.es256.js +10 -10
  150. package/dist/index.es257.js +7 -14
  151. package/dist/index.es258.js +8 -65
  152. package/dist/index.es259.js +6 -37
  153. package/dist/index.es26.js +112 -40
  154. package/dist/index.es260.js +5 -9
  155. package/dist/index.es261.js +15 -8
  156. package/dist/index.es262.js +15 -8
  157. package/dist/index.es263.js +3 -8
  158. package/dist/index.es264.js +19 -16
  159. package/dist/index.es265.js +50 -199
  160. package/dist/index.es266.js +16 -22
  161. package/dist/index.es267.js +177 -24
  162. package/dist/index.es268.js +189 -359
  163. package/dist/index.es269.js +22 -25
  164. package/dist/index.es27.js +41 -40
  165. package/dist/index.es270.js +24 -177
  166. package/dist/index.es271.js +371 -2
  167. package/dist/index.es272.js +2 -398
  168. package/dist/index.es273.js +366 -691
  169. package/dist/index.es274.js +720 -280
  170. package/dist/index.es275.js +277 -55
  171. package/dist/index.es276.js +59 -8
  172. package/dist/index.es277.js +9 -28
  173. package/dist/index.es278.js +29 -199
  174. package/dist/index.es279.js +198 -15
  175. package/dist/index.es28.js +39 -19
  176. package/dist/index.es280.js +25 -8
  177. package/dist/index.es281.js +16 -4
  178. package/dist/index.es282.js +8 -14
  179. package/dist/index.es283.js +4 -15
  180. package/dist/index.es284.js +13 -9
  181. package/dist/index.es285.js +14 -4
  182. package/dist/index.es286.js +25 -13
  183. package/dist/index.es287.js +29 -5
  184. package/dist/index.es288.js +5 -7
  185. package/dist/index.es289.js +4 -333
  186. package/dist/index.es29.js +18 -13
  187. package/dist/index.es290.js +57 -19
  188. package/dist/index.es291.js +28 -4
  189. package/dist/index.es292.js +46 -4
  190. package/dist/index.es293.js +67 -3
  191. package/dist/index.es294.js +35 -69
  192. package/dist/index.es295.js +19 -4
  193. package/dist/index.es296.js +66 -23
  194. package/dist/index.es297.js +68 -29
  195. package/dist/index.es298.js +69 -5
  196. package/dist/index.es299.js +68 -4
  197. package/dist/index.es30.js +16 -21
  198. package/dist/index.es300.js +43 -54
  199. package/dist/index.es301.js +39 -20
  200. package/dist/index.es302.js +50 -38
  201. package/dist/index.es303.js +30 -48
  202. package/dist/index.es304.js +37 -32
  203. package/dist/index.es305.js +66 -13
  204. package/dist/index.es306.js +47 -43
  205. package/dist/index.es307.js +76 -47
  206. package/dist/index.es308.js +32 -54
  207. package/dist/index.es309.js +35 -57
  208. package/dist/index.es31.js +22 -70
  209. package/dist/index.es310.js +39 -38
  210. package/dist/index.es311.js +21 -37
  211. package/dist/index.es312.js +21 -50
  212. package/dist/index.es313.js +21 -40
  213. package/dist/index.es314.js +22 -34
  214. package/dist/index.es315.js +21 -63
  215. package/dist/index.es316.js +20 -62
  216. package/dist/index.es317.js +14 -91
  217. package/dist/index.es318.js +37 -38
  218. package/dist/index.es319.js +38 -39
  219. package/dist/index.es32.js +70 -24
  220. package/dist/index.es320.js +14 -41
  221. package/dist/index.es321.js +14 -25
  222. package/dist/index.es322.js +9 -29
  223. package/dist/index.es323.js +4 -29
  224. package/dist/index.es324.js +13 -31
  225. package/dist/index.es325.js +4 -29
  226. package/dist/index.es326.js +6 -29
  227. package/dist/index.es327.js +332 -18
  228. package/dist/index.es328.js +19 -46
  229. package/dist/index.es329.js +4 -46
  230. package/dist/index.es33.js +24 -62
  231. package/dist/index.es330.js +4 -19
  232. package/dist/index.es331.js +3 -20
  233. package/dist/index.es332.js +72 -15
  234. package/dist/index.es333.js +4 -3
  235. package/dist/index.es34.js +59 -10
  236. package/dist/index.es35.js +12 -71
  237. package/dist/index.es36.js +82 -102
  238. package/dist/index.es366.js +3 -3
  239. package/dist/index.es367.js +1 -1
  240. package/dist/index.es37.js +94 -66
  241. package/dist/index.es371.js +5 -6
  242. package/dist/index.es372.js +3 -2
  243. package/dist/index.es373.js +23 -7
  244. package/dist/index.es374.js +108 -325
  245. package/dist/index.es375.js +15 -49
  246. package/dist/index.es376.js +68 -4
  247. package/dist/index.es377.js +30 -67
  248. package/dist/index.es378.js +9 -31
  249. package/dist/index.es379.js +153 -9
  250. package/dist/index.es38.js +74 -99
  251. package/dist/index.es380.js +97 -142
  252. package/dist/index.es381.js +19 -107
  253. package/dist/index.es382.js +100 -67
  254. package/dist/index.es383.js +46 -30
  255. package/dist/index.es384.js +6 -16
  256. package/dist/index.es385.js +2 -141
  257. package/dist/index.es386.js +8 -114
  258. package/dist/index.es387.js +327 -5
  259. package/dist/index.es388.js +50 -3
  260. package/dist/index.es389.js +3 -23
  261. package/dist/index.es39.js +99 -46
  262. package/dist/index.es390.js +68 -110
  263. package/dist/index.es391.js +30 -15
  264. package/dist/index.es392.js +16 -20
  265. package/dist/index.es393.js +139 -99
  266. package/dist/index.es394.js +113 -46
  267. package/dist/index.es40.js +47 -18
  268. package/dist/index.es41.js +15 -171
  269. package/dist/index.es418.js +2 -2
  270. package/dist/index.es42.js +170 -73
  271. package/dist/index.es421.js +1 -1
  272. package/dist/index.es422.js +5 -5
  273. package/dist/index.es423.js +65 -2
  274. package/dist/index.es424.js +67 -74
  275. package/dist/index.es425.js +9 -93
  276. package/dist/index.es426.js +13 -51
  277. package/dist/index.es427.js +60 -8
  278. package/dist/index.es428.js +6 -4
  279. package/dist/index.es429.js +14 -50
  280. package/dist/index.es43.js +76 -54
  281. package/dist/index.es430.js +27 -14
  282. package/dist/index.es431.js +11 -27
  283. package/dist/index.es432.js +2 -13
  284. package/dist/index.es433.js +75 -6
  285. package/dist/index.es434.js +89 -61
  286. package/dist/index.es435.js +50 -67
  287. package/dist/index.es436.js +8 -9
  288. package/dist/index.es437.js +5 -14
  289. package/dist/index.es438.js +51 -59
  290. package/dist/index.es44.js +55 -29
  291. package/dist/index.es45.js +28 -47
  292. package/dist/index.es46.js +46 -108
  293. package/dist/index.es47.js +110 -9
  294. package/dist/index.es48.js +9 -18
  295. package/dist/index.es49.js +17 -20
  296. package/dist/index.es50.js +21 -37
  297. package/dist/index.es51.js +37 -6
  298. package/dist/index.es52.js +6 -18
  299. package/dist/index.es53.js +17 -27
  300. package/dist/index.es54.js +28 -150
  301. package/dist/index.es55.js +150 -29
  302. package/dist/index.es56.js +29 -219
  303. package/dist/index.es57.js +218 -85
  304. package/dist/index.es58.js +79 -89
  305. package/dist/index.es59.js +93 -33
  306. package/dist/index.es60.js +34 -36
  307. package/dist/index.es61.js +38 -46
  308. package/dist/index.es62.js +46 -125
  309. package/dist/index.es63.js +125 -6
  310. package/dist/index.es64.js +6 -30
  311. package/dist/index.es65.js +30 -24
  312. package/dist/index.es66.js +24 -68
  313. package/dist/index.es67.js +65 -77
  314. package/dist/index.es68.js +76 -96
  315. package/dist/index.es69.js +96 -79
  316. package/dist/index.es7.js +1 -1
  317. package/dist/index.es70.js +83 -2
  318. package/dist/index.es71.js +2 -81
  319. package/dist/index.es72.js +77 -26
  320. package/dist/index.es723.js +22 -2
  321. package/dist/index.es724.js +83 -2
  322. package/dist/index.es725.js +14 -22
  323. package/dist/index.es726.js +59 -82
  324. package/dist/index.es727.js +4 -14
  325. package/dist/index.es728.js +23 -60
  326. package/dist/index.es729.js +2 -4
  327. package/dist/index.es73.js +28 -16
  328. package/dist/index.es730.js +2 -23
  329. package/dist/index.es74.js +16 -18
  330. package/dist/index.es75.js +19 -48
  331. package/dist/index.es76.js +49 -26
  332. package/dist/index.es77.js +25 -26
  333. package/dist/index.es78.js +26 -34
  334. package/dist/index.es79.js +34 -8
  335. package/dist/index.es80.js +8 -47
  336. package/dist/index.es81.js +45 -56
  337. package/dist/index.es82.js +59 -10
  338. package/dist/index.es83.js +10 -2
  339. package/dist/index.es84.js +2 -8
  340. package/dist/index.es85.js +8 -11
  341. package/dist/index.es86.js +10 -10
  342. package/dist/index.es87.js +10 -8
  343. package/dist/index.es88.js +9 -3
  344. package/dist/index.es89.js +3 -5
  345. package/dist/index.es90.js +5 -15
  346. package/dist/index.es91.js +12 -2279
  347. package/dist/index.es92.js +2282 -6
  348. package/dist/index.es93.js +3674 -22
  349. package/dist/index.es94.js +8 -55
  350. package/dist/index.es95.js +6 -55
  351. package/dist/index.es96.js +21 -91
  352. package/dist/index.es97.js +306 -36
  353. package/dist/index.es98.js +12 -24
  354. package/dist/index.es99.js +34 -29
  355. package/dist/style.css +15 -0
  356. package/package.json +1 -1
@@ -1,17 +1,137 @@
1
- import * as r from "react";
2
- var t = 0;
3
- function a() {
4
- r.useEffect(() => {
5
- const e = document.querySelectorAll("[data-radix-focus-guard]");
6
- return document.body.insertAdjacentElement("afterbegin", e[0] ?? n()), document.body.insertAdjacentElement("beforeend", e[1] ?? n()), t++, () => {
7
- t === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((o) => o.remove()), t--;
8
- };
9
- }, []);
10
- }
11
- function n() {
12
- const e = document.createElement("span");
13
- return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none", e;
1
+ import * as d from "react";
2
+ import { useComposedRefs as P } from "./index.es158.js";
3
+ import { Primitive as M } from "./index.es170.js";
4
+ import { useCallbackRef as y } from "./index.es160.js";
5
+ import { j as _ } from "./index.es95.js";
6
+ var F = "focusScope.autoFocusOnMount", T = "focusScope.autoFocusOnUnmount", N = { bubbles: !1, cancelable: !0 }, K = "FocusScope", k = d.forwardRef((e, n) => {
7
+ const {
8
+ loop: t = !1,
9
+ trapped: u = !1,
10
+ onMountAutoFocus: p,
11
+ onUnmountAutoFocus: L,
12
+ ...g
13
+ } = e, [o, R] = d.useState(null), E = y(p), v = y(L), b = d.useRef(null), U = P(n, (s) => R(s)), a = d.useRef({
14
+ paused: !1,
15
+ pause() {
16
+ this.paused = !0;
17
+ },
18
+ resume() {
19
+ this.paused = !1;
20
+ }
21
+ }).current;
22
+ d.useEffect(() => {
23
+ if (u) {
24
+ let s = function(i) {
25
+ if (a.paused || !o) return;
26
+ const c = i.target;
27
+ o.contains(c) ? b.current = c : f(b.current, { select: !0 });
28
+ }, l = function(i) {
29
+ if (a.paused || !o) return;
30
+ const c = i.relatedTarget;
31
+ c !== null && (o.contains(c) || f(b.current, { select: !0 }));
32
+ }, r = function(i) {
33
+ if (document.activeElement === document.body)
34
+ for (const h of i)
35
+ h.removedNodes.length > 0 && f(o);
36
+ };
37
+ document.addEventListener("focusin", s), document.addEventListener("focusout", l);
38
+ const m = new MutationObserver(r);
39
+ return o && m.observe(o, { childList: !0, subtree: !0 }), () => {
40
+ document.removeEventListener("focusin", s), document.removeEventListener("focusout", l), m.disconnect();
41
+ };
42
+ }
43
+ }, [u, o, a.paused]), d.useEffect(() => {
44
+ if (o) {
45
+ S.add(a);
46
+ const s = document.activeElement;
47
+ if (!o.contains(s)) {
48
+ const r = new CustomEvent(F, N);
49
+ o.addEventListener(F, E), o.dispatchEvent(r), r.defaultPrevented || (w(V(I(o)), { select: !0 }), document.activeElement === s && f(o));
50
+ }
51
+ return () => {
52
+ o.removeEventListener(F, E), setTimeout(() => {
53
+ const r = new CustomEvent(T, N);
54
+ o.addEventListener(T, v), o.dispatchEvent(r), r.defaultPrevented || f(s ?? document.body, { select: !0 }), o.removeEventListener(T, v), S.remove(a);
55
+ }, 0);
56
+ };
57
+ }
58
+ }, [o, E, v, a]);
59
+ const A = d.useCallback(
60
+ (s) => {
61
+ if (!t && !u || a.paused) return;
62
+ const l = s.key === "Tab" && !s.altKey && !s.ctrlKey && !s.metaKey, r = document.activeElement;
63
+ if (l && r) {
64
+ const m = s.currentTarget, [i, c] = x(m);
65
+ i && c ? !s.shiftKey && r === c ? (s.preventDefault(), t && f(i, { select: !0 })) : s.shiftKey && r === i && (s.preventDefault(), t && f(c, { select: !0 })) : r === m && s.preventDefault();
66
+ }
67
+ },
68
+ [t, u, a.paused]
69
+ );
70
+ return /* @__PURE__ */ _.jsx(M.div, { tabIndex: -1, ...g, ref: U, onKeyDown: A });
71
+ });
72
+ k.displayName = K;
73
+ function w(e, { select: n = !1 } = {}) {
74
+ const t = document.activeElement;
75
+ for (const u of e)
76
+ if (f(u, { select: n }), document.activeElement !== t) return;
77
+ }
78
+ function x(e) {
79
+ const n = I(e), t = O(n, e), u = O(n.reverse(), e);
80
+ return [t, u];
81
+ }
82
+ function I(e) {
83
+ const n = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
84
+ acceptNode: (u) => {
85
+ const p = u.tagName === "INPUT" && u.type === "hidden";
86
+ return u.disabled || u.hidden || p ? NodeFilter.FILTER_SKIP : u.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
87
+ }
88
+ });
89
+ for (; t.nextNode(); ) n.push(t.currentNode);
90
+ return n;
91
+ }
92
+ function O(e, n) {
93
+ for (const t of e)
94
+ if (!D(t, { upTo: n })) return t;
95
+ }
96
+ function D(e, { upTo: n }) {
97
+ if (getComputedStyle(e).visibility === "hidden") return !0;
98
+ for (; e; ) {
99
+ if (n !== void 0 && e === n) return !1;
100
+ if (getComputedStyle(e).display === "none") return !0;
101
+ e = e.parentElement;
102
+ }
103
+ return !1;
104
+ }
105
+ function H(e) {
106
+ return e instanceof HTMLInputElement && "select" in e;
107
+ }
108
+ function f(e, { select: n = !1 } = {}) {
109
+ if (e && e.focus) {
110
+ const t = document.activeElement;
111
+ e.focus({ preventScroll: !0 }), e !== t && H(e) && n && e.select();
112
+ }
113
+ }
114
+ var S = j();
115
+ function j() {
116
+ let e = [];
117
+ return {
118
+ add(n) {
119
+ const t = e[0];
120
+ n !== t && (t == null || t.pause()), e = C(e, n), e.unshift(n);
121
+ },
122
+ remove(n) {
123
+ var t;
124
+ e = C(e, n), (t = e[0]) == null || t.resume();
125
+ }
126
+ };
127
+ }
128
+ function C(e, n) {
129
+ const t = [...e], u = t.indexOf(n);
130
+ return u !== -1 && t.splice(u, 1), t;
131
+ }
132
+ function V(e) {
133
+ return e.filter((n) => n.tagName !== "A");
14
134
  }
15
135
  export {
16
- a as useFocusGuards
136
+ k as FocusScope
17
137
  };
@@ -1,11 +1,16 @@
1
- import { __assign as m } from "./index.es296.js";
2
1
  import * as r from "react";
3
- import { RemoveScroll as e } from "./index.es297.js";
4
- import t from "./index.es298.js";
5
- var s = r.forwardRef(function(a, o) {
6
- return r.createElement(e, m({}, a, { ref: o, sideCar: t }));
2
+ import f from "react-dom";
3
+ import { Primitive as u } from "./index.es170.js";
4
+ import { useLayoutEffect as c } from "./index.es176.js";
5
+ import { j as l } from "./index.es95.js";
6
+ var p = "Portal", d = r.forwardRef((e, a) => {
7
+ var o;
8
+ const { container: s, ...i } = e, [m, n] = r.useState(!1);
9
+ c(() => n(!0), []);
10
+ const t = s || m && ((o = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : o.body);
11
+ return t ? f.createPortal(/* @__PURE__ */ l.jsx(u.div, { ...i, ref: a }), t) : null;
7
12
  });
8
- s.classNames = e.classNames;
13
+ d.displayName = p;
9
14
  export {
10
- s as default
15
+ d as Portal
11
16
  };
@@ -1,5 +1,5 @@
1
1
  import { useCallback as a } from "react";
2
- import { createListener as m } from "./index.es171.js";
2
+ import { createListener as m } from "./index.es94.js";
3
3
  import c from "./index.es9.js";
4
4
  function v(e, t, u = {}) {
5
5
  const {
@@ -1,52 +1,35 @@
1
- var S = function(r) {
2
- if (typeof document > "u")
3
- return null;
4
- var u = Array.isArray(r) ? r[0] : r;
5
- return u.ownerDocument.body;
6
- }, f = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), p = {}, h = 0, W = function(r) {
7
- return r && (r.host || W(r.parentNode));
8
- }, D = function(r, u) {
9
- return u.map(function(e) {
10
- if (r.contains(e))
11
- return e;
12
- var n = W(e);
13
- return n && r.contains(n) ? n : (console.error("aria-hidden", e, "in not contained inside", r, ". Doing nothing"), null);
14
- }).filter(function(e) {
15
- return !!e;
1
+ import * as n from "react";
2
+ import * as p from "react-dom";
3
+ import { Slot as f } from "./index.es100.js";
4
+ import { j as u } from "./index.es95.js";
5
+ var c = [
6
+ "a",
7
+ "button",
8
+ "div",
9
+ "form",
10
+ "h2",
11
+ "h3",
12
+ "img",
13
+ "input",
14
+ "label",
15
+ "li",
16
+ "nav",
17
+ "ol",
18
+ "p",
19
+ "span",
20
+ "svg",
21
+ "ul"
22
+ ], v = c.reduce((r, i) => {
23
+ const t = n.forwardRef((o, e) => {
24
+ const { asChild: s, ...m } = o, a = s ? f : i;
25
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ u.jsx(a, { ...m, ref: e });
16
26
  });
17
- }, E = function(r, u, e, n) {
18
- var i = D(u, Array.isArray(r) ? r : [r]);
19
- p[e] || (p[e] = /* @__PURE__ */ new WeakMap());
20
- var o = p[e], l = [], s = /* @__PURE__ */ new Set(), b = new Set(i), y = function(t) {
21
- !t || s.has(t) || (s.add(t), y(t.parentNode));
22
- };
23
- i.forEach(y);
24
- var A = function(t) {
25
- !t || b.has(t) || Array.prototype.forEach.call(t.children, function(a) {
26
- if (s.has(a))
27
- A(a);
28
- else
29
- try {
30
- var c = a.getAttribute(n), w = c !== null && c !== "false", d = (f.get(a) || 0) + 1, M = (o.get(a) || 0) + 1;
31
- f.set(a, d), o.set(a, M), l.push(a), d === 1 && w && v.set(a, !0), M === 1 && a.setAttribute(e, "true"), w || a.setAttribute(n, "true");
32
- } catch (k) {
33
- console.error("aria-hidden: cannot operate on ", a, k);
34
- }
35
- });
36
- };
37
- return A(u), s.clear(), h++, function() {
38
- l.forEach(function(t) {
39
- var a = f.get(t) - 1, c = o.get(t) - 1;
40
- f.set(t, a), o.set(t, c), a || (v.has(t) || t.removeAttribute(n), v.delete(t)), c || t.removeAttribute(e);
41
- }), h--, h || (f = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), p = {});
42
- };
43
- }, C = function(r, u, e) {
44
- e === void 0 && (e = "data-aria-hidden");
45
- var n = Array.from(Array.isArray(r) ? r : [r]), i = S(r);
46
- return i ? (n.push.apply(n, Array.from(i.querySelectorAll("[aria-live]"))), E(n, i, e, "aria-hidden")) : function() {
47
- return null;
48
- };
49
- };
27
+ return t.displayName = `Primitive.${i}`, { ...r, [i]: t };
28
+ }, {});
29
+ function h(r, i) {
30
+ r && p.flushSync(() => r.dispatchEvent(i));
31
+ }
50
32
  export {
51
- C as hideOthers
33
+ v as Primitive,
34
+ h as dispatchDiscreteCustomEvent
52
35
  };
@@ -1,10 +1,17 @@
1
- import { shouldIgnoreEvent as c } from "./index.es333.js";
2
- import { matchKeyModifiers as f } from "./index.es332.js";
3
- const h = (t, o, e, a, i) => (r) => {
4
- if (!i || c(r, a))
5
- return;
6
- (Array.isArray(t) ? t : [t]).some((m) => f(r, m)) && (e && r.preventDefault(), o(r));
7
- };
1
+ import * as r from "react";
2
+ var t = 0;
3
+ function a() {
4
+ r.useEffect(() => {
5
+ const e = document.querySelectorAll("[data-radix-focus-guard]");
6
+ return document.body.insertAdjacentElement("afterbegin", e[0] ?? n()), document.body.insertAdjacentElement("beforeend", e[1] ?? n()), t++, () => {
7
+ t === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((o) => o.remove()), t--;
8
+ };
9
+ }, []);
10
+ }
11
+ function n() {
12
+ const e = document.createElement("span");
13
+ return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none", e;
14
+ }
8
15
  export {
9
- h as createListener
16
+ a as useFocusGuards
10
17
  };
@@ -1,8 +1,11 @@
1
- var o = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2
- function l(e) {
3
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
4
- }
1
+ import { __assign as m } from "./index.es286.js";
2
+ import * as r from "react";
3
+ import { RemoveScroll as e } from "./index.es287.js";
4
+ import t from "./index.es288.js";
5
+ var s = r.forwardRef(function(a, o) {
6
+ return r.createElement(e, m({}, a, { ref: o, sideCar: t }));
7
+ });
8
+ s.classNames = e.classNames;
5
9
  export {
6
- o as commonjsGlobal,
7
- l as getDefaultExportFromCjs
10
+ s as default
8
11
  };
@@ -1,4 +1,52 @@
1
- var o = { exports: {} };
1
+ var S = function(r) {
2
+ if (typeof document > "u")
3
+ return null;
4
+ var u = Array.isArray(r) ? r[0] : r;
5
+ return u.ownerDocument.body;
6
+ }, f = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), p = {}, h = 0, W = function(r) {
7
+ return r && (r.host || W(r.parentNode));
8
+ }, D = function(r, u) {
9
+ return u.map(function(e) {
10
+ if (r.contains(e))
11
+ return e;
12
+ var n = W(e);
13
+ return n && r.contains(n) ? n : (console.error("aria-hidden", e, "in not contained inside", r, ". Doing nothing"), null);
14
+ }).filter(function(e) {
15
+ return !!e;
16
+ });
17
+ }, E = function(r, u, e, n) {
18
+ var i = D(u, Array.isArray(r) ? r : [r]);
19
+ p[e] || (p[e] = /* @__PURE__ */ new WeakMap());
20
+ var o = p[e], l = [], s = /* @__PURE__ */ new Set(), b = new Set(i), y = function(t) {
21
+ !t || s.has(t) || (s.add(t), y(t.parentNode));
22
+ };
23
+ i.forEach(y);
24
+ var A = function(t) {
25
+ !t || b.has(t) || Array.prototype.forEach.call(t.children, function(a) {
26
+ if (s.has(a))
27
+ A(a);
28
+ else
29
+ try {
30
+ var c = a.getAttribute(n), w = c !== null && c !== "false", d = (f.get(a) || 0) + 1, M = (o.get(a) || 0) + 1;
31
+ f.set(a, d), o.set(a, M), l.push(a), d === 1 && w && v.set(a, !0), M === 1 && a.setAttribute(e, "true"), w || a.setAttribute(n, "true");
32
+ } catch (k) {
33
+ console.error("aria-hidden: cannot operate on ", a, k);
34
+ }
35
+ });
36
+ };
37
+ return A(u), s.clear(), h++, function() {
38
+ l.forEach(function(t) {
39
+ var a = f.get(t) - 1, c = o.get(t) - 1;
40
+ f.set(t, a), o.set(t, c), a || (v.has(t) || t.removeAttribute(n), v.delete(t)), c || t.removeAttribute(e);
41
+ }), h--, h || (f = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), p = {});
42
+ };
43
+ }, C = function(r, u, e) {
44
+ e === void 0 && (e = "data-aria-hidden");
45
+ var n = Array.from(Array.isArray(r) ? r : [r]), i = S(r);
46
+ return i ? (n.push.apply(n, Array.from(i.querySelectorAll("[aria-live]"))), E(n, i, e, "aria-hidden")) : function() {
47
+ return null;
48
+ };
49
+ };
2
50
  export {
3
- o as __module
51
+ C as hideOthers
4
52
  };
@@ -1,220 +1,46 @@
1
- import * as s from "react";
2
- import { useFloating as xe, offset as Pe, shift as ye, flip as Ae, size as ve, arrow as Ce, hide as be, limitShift as Se } from "./index.es265.js";
3
- import { Root as Oe } from "./index.es266.js";
4
- import { useComposedRefs as T } from "./index.es158.js";
5
- import { createContextScope as Re } from "./index.es162.js";
6
- import { Primitive as z } from "./index.es167.js";
7
- import { useCallbackRef as Ee } from "./index.es160.js";
8
- import { useLayoutEffect as B } from "./index.es176.js";
9
- import { useSize as Ne } from "./index.es267.js";
10
- import { j as f } from "./index.es92.js";
11
- import { autoUpdate as _e } from "./index.es268.js";
12
- var N = "Popper", [L, Ue] = Re(N), [$e, Z] = L(N), U = (e) => {
13
- const { __scopePopper: i, children: n } = e, [t, a] = s.useState(null);
14
- return /* @__PURE__ */ f.jsx($e, { scope: i, anchor: t, onAnchorChange: a, children: n });
15
- };
16
- U.displayName = N;
17
- var q = "PopperAnchor", G = s.forwardRef(
18
- (e, i) => {
19
- const { __scopePopper: n, virtualRef: t, ...a } = e, r = Z(q, n), o = s.useRef(null), w = T(i, o);
20
- return s.useEffect(() => {
21
- r.onAnchorChange((t == null ? void 0 : t.current) || o.current);
22
- }), t ? null : /* @__PURE__ */ f.jsx(z.div, { ...a, ref: w });
23
- }
24
- );
25
- G.displayName = q;
26
- var _ = "PopperContent", [je, He] = L(_), J = s.forwardRef(
27
- (e, i) => {
28
- var I, Y, M, X, D, F;
29
- const {
30
- __scopePopper: n,
31
- side: t = "bottom",
32
- sideOffset: a = 0,
33
- align: r = "center",
34
- alignOffset: o = 0,
35
- arrowPadding: w = 0,
36
- avoidCollisions: p = !0,
37
- collisionBoundary: c = [],
38
- collisionPadding: x = 0,
39
- sticky: m = "partial",
40
- hideWhenDetached: y = !1,
41
- updatePositionStrategy: A = "optimized",
42
- onPlaced: l,
43
- ...d
44
- } = e, v = Z(_, n), [h, C] = s.useState(null), ee = T(i, (P) => C(P)), [E, te] = s.useState(null), g = Ne(E), re = (g == null ? void 0 : g.width) ?? 0, $ = (g == null ? void 0 : g.height) ?? 0, oe = t + (r !== "center" ? "-" + r : ""), ne = typeof x == "number" ? x : { top: 0, right: 0, bottom: 0, left: 0, ...x }, j = Array.isArray(c) ? c : [c], ae = j.length > 0, b = {
45
- padding: ne,
46
- boundary: j.filter(Ie),
47
- // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
48
- altBoundary: ae
49
- }, { refs: ie, floatingStyles: H, placement: se, isPositioned: S, middlewareData: u } = xe({
50
- // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
51
- strategy: "fixed",
52
- placement: oe,
53
- whileElementsMounted: (...P) => _e(...P, {
54
- animationFrame: A === "always"
55
- }),
56
- elements: {
57
- reference: v.anchor
58
- },
59
- middleware: [
60
- Pe({ mainAxis: a + $, alignmentAxis: o }),
61
- p && ye({
62
- mainAxis: !0,
63
- crossAxis: !1,
64
- limiter: m === "partial" ? Se() : void 0,
65
- ...b
66
- }),
67
- p && Ae({ ...b }),
68
- ve({
69
- ...b,
70
- apply: ({ elements: P, rects: k, availableWidth: he, availableHeight: ge }) => {
71
- const { width: ue, height: we } = k.reference, R = P.floating.style;
72
- R.setProperty("--radix-popper-available-width", `${he}px`), R.setProperty("--radix-popper-available-height", `${ge}px`), R.setProperty("--radix-popper-anchor-width", `${ue}px`), R.setProperty("--radix-popper-anchor-height", `${we}px`);
73
- }
74
- }),
75
- E && Ce({ element: E, padding: w }),
76
- Ye({ arrowWidth: re, arrowHeight: $ }),
77
- y && be({ strategy: "referenceHidden", ...b })
78
- ]
79
- }), [W, pe] = V(se), O = Ee(l);
80
- B(() => {
81
- S && (O == null || O());
82
- }, [S, O]);
83
- const ce = (I = u.arrow) == null ? void 0 : I.x, de = (Y = u.arrow) == null ? void 0 : Y.y, le = ((M = u.arrow) == null ? void 0 : M.centerOffset) !== 0, [fe, me] = s.useState();
84
- return B(() => {
85
- h && me(window.getComputedStyle(h).zIndex);
86
- }, [h]), /* @__PURE__ */ f.jsx(
87
- "div",
88
- {
89
- ref: ie.setFloating,
90
- "data-radix-popper-content-wrapper": "",
91
- style: {
92
- ...H,
93
- transform: S ? H.transform : "translate(0, -200%)",
94
- // keep off the page when measuring
95
- minWidth: "max-content",
96
- zIndex: fe,
97
- "--radix-popper-transform-origin": [
98
- (X = u.transformOrigin) == null ? void 0 : X.x,
99
- (D = u.transformOrigin) == null ? void 0 : D.y
100
- ].join(" "),
101
- // hide the content if using the hide middleware and should be hidden
102
- // set visibility to hidden and disable pointer events so the UI behaves
103
- // as if the PopperContent isn't there at all
104
- ...((F = u.hide) == null ? void 0 : F.referenceHidden) && {
105
- visibility: "hidden",
106
- pointerEvents: "none"
107
- }
108
- },
109
- dir: e.dir,
110
- children: /* @__PURE__ */ f.jsx(
111
- je,
112
- {
113
- scope: n,
114
- placedSide: W,
115
- onArrowChange: te,
116
- arrowX: ce,
117
- arrowY: de,
118
- shouldHideArrow: le,
119
- children: /* @__PURE__ */ f.jsx(
120
- z.div,
121
- {
122
- "data-side": W,
123
- "data-align": pe,
124
- ...d,
125
- ref: ee,
126
- style: {
127
- ...d.style,
128
- // if the PopperContent hasn't been placed yet (not all measurements done)
129
- // we prevent animations so that users's animation don't kick in too early referring wrong sides
130
- animation: S ? void 0 : "none"
131
- }
132
- }
133
- )
134
- }
135
- )
136
- }
137
- );
1
+ import { validateFieldsNatively as v, toNestErrors as d } from "./index.es280.js";
2
+ import { appendErrors as h } from "./index.es120.js";
3
+ var m = function(t, u) {
4
+ for (var o = {}; t.length; ) {
5
+ var r = t[0], c = r.code, n = r.message, e = r.path.join(".");
6
+ if (!o[e]) if ("unionErrors" in r) {
7
+ var s = r.unionErrors[0].errors[0];
8
+ o[e] = { message: s.message, type: s.code };
9
+ } else o[e] = { message: n, type: c };
10
+ if ("unionErrors" in r && r.unionErrors.forEach(function(f) {
11
+ return f.errors.forEach(function(l) {
12
+ return t.push(l);
13
+ });
14
+ }), u) {
15
+ var i = o[e].types, a = i && i[r.code];
16
+ o[e] = h(e, u, o, c, a ? [].concat(a, r.message) : r.message);
17
+ }
18
+ t.shift();
138
19
  }
139
- );
140
- J.displayName = _;
141
- var K = "PopperArrow", We = {
142
- top: "bottom",
143
- right: "left",
144
- bottom: "top",
145
- left: "right"
146
- }, Q = s.forwardRef(function(i, n) {
147
- const { __scopePopper: t, ...a } = i, r = He(K, t), o = We[r.placedSide];
148
- return (
149
- // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
150
- // doesn't report size as we'd expect on SVG elements.
151
- // it reports their bounding box which is effectively the largest path inside the SVG.
152
- /* @__PURE__ */ f.jsx(
153
- "span",
154
- {
155
- ref: r.onArrowChange,
156
- style: {
157
- position: "absolute",
158
- left: r.arrowX,
159
- top: r.arrowY,
160
- [o]: 0,
161
- transformOrigin: {
162
- top: "",
163
- right: "0 0",
164
- bottom: "center 0",
165
- left: "100% 0"
166
- }[r.placedSide],
167
- transform: {
168
- top: "translateY(100%)",
169
- right: "translateY(50%) rotate(90deg) translateX(-50%)",
170
- bottom: "rotate(180deg)",
171
- left: "translateY(50%) rotate(-90deg) translateX(50%)"
172
- }[r.placedSide],
173
- visibility: r.shouldHideArrow ? "hidden" : void 0
174
- },
175
- children: /* @__PURE__ */ f.jsx(
176
- Oe,
177
- {
178
- ...a,
179
- ref: n,
180
- style: {
181
- ...a.style,
182
- // ensures the element can be measured correctly (mostly for if SVG)
183
- display: "block"
184
- }
185
- }
186
- )
187
- }
188
- )
189
- );
190
- });
191
- Q.displayName = K;
192
- function Ie(e) {
193
- return e !== null;
194
- }
195
- var Ye = (e) => ({
196
- name: "transformOrigin",
197
- options: e,
198
- fn(i) {
199
- var v, h, C;
200
- const { placement: n, rects: t, middlewareData: a } = i, o = ((v = a.arrow) == null ? void 0 : v.centerOffset) !== 0, w = o ? 0 : e.arrowWidth, p = o ? 0 : e.arrowHeight, [c, x] = V(n), m = { start: "0%", center: "50%", end: "100%" }[x], y = (((h = a.arrow) == null ? void 0 : h.x) ?? 0) + w / 2, A = (((C = a.arrow) == null ? void 0 : C.y) ?? 0) + p / 2;
201
- let l = "", d = "";
202
- return c === "bottom" ? (l = o ? m : `${y}px`, d = `${-p}px`) : c === "top" ? (l = o ? m : `${y}px`, d = `${t.floating.height + p}px`) : c === "right" ? (l = `${-p}px`, d = o ? m : `${A}px`) : c === "left" && (l = `${t.floating.width + p}px`, d = o ? m : `${A}px`), { data: { x: l, y: d } };
203
- }
204
- });
205
- function V(e) {
206
- const [i, n = "center"] = e.split("-");
207
- return [i, n];
208
- }
209
- var qe = U, Ge = G, Je = J, Ke = Q;
20
+ return o;
21
+ }, E = function(t, u, o) {
22
+ return o === void 0 && (o = {}), function(r, c, n) {
23
+ try {
24
+ return Promise.resolve(function(e, s) {
25
+ try {
26
+ var i = Promise.resolve(t[o.mode === "sync" ? "parse" : "parseAsync"](r, u)).then(function(a) {
27
+ return n.shouldUseNativeValidation && v({}, n), { errors: {}, values: o.raw ? r : a };
28
+ });
29
+ } catch (a) {
30
+ return s(a);
31
+ }
32
+ return i && i.then ? i.then(void 0, s) : i;
33
+ }(0, function(e) {
34
+ if (function(s) {
35
+ return Array.isArray(s == null ? void 0 : s.errors);
36
+ }(e)) return { values: {}, errors: d(m(e.errors, !n.shouldUseNativeValidation && n.criteriaMode === "all"), n) };
37
+ throw e;
38
+ }));
39
+ } catch (e) {
40
+ return Promise.reject(e);
41
+ }
42
+ };
43
+ };
210
44
  export {
211
- Ge as Anchor,
212
- Ke as Arrow,
213
- Je as Content,
214
- U as Popper,
215
- G as PopperAnchor,
216
- Q as PopperArrow,
217
- J as PopperContent,
218
- qe as Root,
219
- Ue as createPopperScope
45
+ E as zodResolver
220
46
  };