@anoki/fse-ui 1.0.525 → 1.0.526

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 (247) hide show
  1. package/dist/components/ui/TabsGlossary/TabsGlossary.css +1 -1
  2. package/dist/index.cjs161.js +1 -1
  3. package/dist/index.cjs161.js.map +1 -1
  4. package/dist/index.cjs162.js +1 -1
  5. package/dist/index.cjs162.js.map +1 -1
  6. package/dist/index.cjs166.js +1 -1
  7. package/dist/index.cjs166.js.map +1 -1
  8. package/dist/index.cjs175.js +1 -1
  9. package/dist/index.cjs175.js.map +1 -1
  10. package/dist/index.cjs179.js +1 -1
  11. package/dist/index.cjs179.js.map +1 -1
  12. package/dist/index.cjs208.js +1 -1
  13. package/dist/index.cjs212.js +1 -1
  14. package/dist/index.cjs219.js +1 -1
  15. package/dist/index.cjs230.js +1 -1
  16. package/dist/index.cjs237.js +1 -1
  17. package/dist/index.cjs242.js +1 -1
  18. package/dist/index.cjs249.js +1 -1
  19. package/dist/index.cjs257.js +1 -1
  20. package/dist/index.cjs296.js +1 -1
  21. package/dist/index.cjs317.js +12 -3
  22. package/dist/index.cjs317.js.map +1 -1
  23. package/dist/index.cjs324.js +1 -1
  24. package/dist/index.cjs324.js.map +1 -1
  25. package/dist/index.cjs327.js +1 -1
  26. package/dist/index.cjs327.js.map +1 -1
  27. package/dist/index.cjs328.js +1 -1
  28. package/dist/index.cjs328.js.map +1 -1
  29. package/dist/index.cjs329.js +1 -1
  30. package/dist/index.cjs329.js.map +1 -1
  31. package/dist/index.cjs33.js +1 -1
  32. package/dist/index.cjs33.js.map +1 -1
  33. package/dist/index.cjs330.js +1 -1
  34. package/dist/index.cjs330.js.map +1 -1
  35. package/dist/index.cjs331.js +1 -1
  36. package/dist/index.cjs331.js.map +1 -1
  37. package/dist/index.cjs332.js +2 -0
  38. package/dist/index.cjs332.js.map +1 -0
  39. package/dist/index.cjs333.js +2 -0
  40. package/dist/index.cjs333.js.map +1 -0
  41. package/dist/index.cjs334.js +1 -1
  42. package/dist/index.cjs334.js.map +1 -1
  43. package/dist/index.cjs335.js +1 -1
  44. package/dist/index.cjs335.js.map +1 -1
  45. package/dist/index.cjs336.js +1 -1
  46. package/dist/index.cjs336.js.map +1 -1
  47. package/dist/index.cjs337.js +1 -1
  48. package/dist/index.cjs337.js.map +1 -1
  49. package/dist/index.cjs338.js +1 -1
  50. package/dist/index.cjs338.js.map +1 -1
  51. package/dist/index.cjs339.js +1 -1
  52. package/dist/index.cjs339.js.map +1 -1
  53. package/dist/index.cjs340.js +1 -1
  54. package/dist/index.cjs340.js.map +1 -1
  55. package/dist/index.cjs341.js +1 -1
  56. package/dist/index.cjs341.js.map +1 -1
  57. package/dist/index.cjs342.js +1 -1
  58. package/dist/index.cjs342.js.map +1 -1
  59. package/dist/index.cjs343.js +1 -1
  60. package/dist/index.cjs343.js.map +1 -1
  61. package/dist/index.cjs344.js +1 -1
  62. package/dist/index.cjs344.js.map +1 -1
  63. package/dist/index.cjs345.js +1 -1
  64. package/dist/index.cjs345.js.map +1 -1
  65. package/dist/index.cjs346.js +1 -1
  66. package/dist/index.cjs346.js.map +1 -1
  67. package/dist/index.cjs347.js +1 -1
  68. package/dist/index.cjs347.js.map +1 -1
  69. package/dist/index.cjs348.js +1 -1
  70. package/dist/index.cjs348.js.map +1 -1
  71. package/dist/index.cjs349.js +1 -1
  72. package/dist/index.cjs349.js.map +1 -1
  73. package/dist/index.cjs350.js +1 -1
  74. package/dist/index.cjs352.js +1 -1
  75. package/dist/index.cjs353.js +1 -1
  76. package/dist/{index.cjs354.js → index.cjs362.js} +1 -1
  77. package/dist/{index.cjs354.js.map → index.cjs362.js.map} +1 -1
  78. package/dist/{index.cjs355.js → index.cjs363.js} +2 -2
  79. package/dist/{index.cjs355.js.map → index.cjs363.js.map} +1 -1
  80. package/dist/index.cjs364.js +2 -0
  81. package/dist/{index.cjs356.js.map → index.cjs364.js.map} +1 -1
  82. package/dist/index.cjs372.js +1 -1
  83. package/dist/index.cjs372.js.map +1 -1
  84. package/dist/index.cjs373.js +1 -1
  85. package/dist/index.cjs373.js.map +1 -1
  86. package/dist/index.cjs374.js +1 -4
  87. package/dist/index.cjs374.js.map +1 -1
  88. package/dist/index.cjs375.js +4 -1
  89. package/dist/index.cjs375.js.map +1 -1
  90. package/dist/index.cjs376.js +1 -1
  91. package/dist/index.cjs376.js.map +1 -1
  92. package/dist/index.cjs377.js +1 -1
  93. package/dist/index.cjs377.js.map +1 -1
  94. package/dist/index.cjs378.js +1 -1
  95. package/dist/index.cjs378.js.map +1 -1
  96. package/dist/index.cjs379.js +2 -0
  97. package/dist/index.cjs379.js.map +1 -0
  98. package/dist/index.cjs380.js +1 -38
  99. package/dist/index.cjs380.js.map +1 -1
  100. package/dist/index.cjs381.js +38 -1
  101. package/dist/index.cjs381.js.map +1 -1
  102. package/dist/index.cjs382.js +1 -1
  103. package/dist/index.cjs382.js.map +1 -1
  104. package/dist/index.cjs383.js +1 -1
  105. package/dist/index.cjs383.js.map +1 -1
  106. package/dist/index.cjs384.js +1 -1
  107. package/dist/index.cjs384.js.map +1 -1
  108. package/dist/index.cjs387.js +1 -1
  109. package/dist/index.cjs387.js.map +1 -1
  110. package/dist/index.cjs388.js +1 -1
  111. package/dist/index.cjs388.js.map +1 -1
  112. package/dist/index.cjs389.js +1 -1
  113. package/dist/index.cjs389.js.map +1 -1
  114. package/dist/index.cjs390.js +1 -1
  115. package/dist/index.cjs390.js.map +1 -1
  116. package/dist/index.cjs400.js +1 -1
  117. package/dist/index.es161.js +71 -76
  118. package/dist/index.es161.js.map +1 -1
  119. package/dist/index.es162.js +1 -11
  120. package/dist/index.es162.js.map +1 -1
  121. package/dist/index.es166.js +58 -63
  122. package/dist/index.es166.js.map +1 -1
  123. package/dist/index.es175.js +26 -29
  124. package/dist/index.es175.js.map +1 -1
  125. package/dist/index.es179.js +15 -18
  126. package/dist/index.es179.js.map +1 -1
  127. package/dist/index.es208.js +7 -7
  128. package/dist/index.es212.js +1 -1
  129. package/dist/index.es219.js +8 -8
  130. package/dist/index.es230.js +14 -14
  131. package/dist/index.es237.js +1 -1
  132. package/dist/index.es242.js +1 -1
  133. package/dist/index.es249.js +1 -1
  134. package/dist/index.es257.js +7 -7
  135. package/dist/index.es296.js +4 -4
  136. package/dist/index.es317.js +307 -146
  137. package/dist/index.es317.js.map +1 -1
  138. package/dist/index.es324.js +15 -7
  139. package/dist/index.es324.js.map +1 -1
  140. package/dist/index.es327.js +6 -29
  141. package/dist/index.es327.js.map +1 -1
  142. package/dist/index.es328.js +26 -32
  143. package/dist/index.es328.js.map +1 -1
  144. package/dist/index.es329.js +63 -617
  145. package/dist/index.es329.js.map +1 -1
  146. package/dist/index.es33.js +40 -32
  147. package/dist/index.es33.js.map +1 -1
  148. package/dist/index.es330.js +29 -10
  149. package/dist/index.es330.js.map +1 -1
  150. package/dist/index.es331.js +33 -15
  151. package/dist/index.es331.js.map +1 -1
  152. package/dist/index.es332.js +625 -0
  153. package/dist/index.es332.js.map +1 -0
  154. package/dist/index.es333.js +14 -0
  155. package/dist/index.es333.js.map +1 -0
  156. package/dist/index.es334.js +5 -10
  157. package/dist/index.es334.js.map +1 -1
  158. package/dist/index.es335.js +24 -52
  159. package/dist/index.es335.js.map +1 -1
  160. package/dist/index.es336.js +66 -43
  161. package/dist/index.es336.js.map +1 -1
  162. package/dist/index.es337.js +10 -7
  163. package/dist/index.es337.js.map +1 -1
  164. package/dist/index.es338.js +48 -120
  165. package/dist/index.es338.js.map +1 -1
  166. package/dist/index.es339.js +45 -14
  167. package/dist/index.es339.js.map +1 -1
  168. package/dist/index.es340.js +7 -134
  169. package/dist/index.es340.js.map +1 -1
  170. package/dist/index.es341.js +113 -206
  171. package/dist/index.es341.js.map +1 -1
  172. package/dist/index.es342.js +14 -13
  173. package/dist/index.es342.js.map +1 -1
  174. package/dist/index.es343.js +126 -60
  175. package/dist/index.es343.js.map +1 -1
  176. package/dist/index.es344.js +203 -163
  177. package/dist/index.es344.js.map +1 -1
  178. package/dist/index.es345.js +14 -50
  179. package/dist/index.es345.js.map +1 -1
  180. package/dist/index.es346.js +178 -9
  181. package/dist/index.es346.js.map +1 -1
  182. package/dist/index.es347.js +49 -3
  183. package/dist/index.es347.js.map +1 -1
  184. package/dist/index.es348.js +9 -6
  185. package/dist/index.es348.js.map +1 -1
  186. package/dist/index.es349.js +4 -25
  187. package/dist/index.es349.js.map +1 -1
  188. package/dist/index.es350.js +1 -1
  189. package/dist/index.es352.js +1 -1
  190. package/dist/index.es353.js +3 -3
  191. package/dist/{index.es354.js → index.es362.js} +1 -1
  192. package/dist/{index.es354.js.map → index.es362.js.map} +1 -1
  193. package/dist/{index.es355.js → index.es363.js} +5 -5
  194. package/dist/{index.es355.js.map → index.es363.js.map} +1 -1
  195. package/dist/index.es364.js +8 -0
  196. package/dist/{index.es356.js.map → index.es364.js.map} +1 -1
  197. package/dist/index.es372.js +5 -3
  198. package/dist/index.es372.js.map +1 -1
  199. package/dist/index.es373.js +3 -24
  200. package/dist/index.es373.js.map +1 -1
  201. package/dist/index.es374.js +22 -108
  202. package/dist/index.es374.js.map +1 -1
  203. package/dist/index.es375.js +108 -14
  204. package/dist/index.es375.js.map +1 -1
  205. package/dist/index.es376.js +14 -521
  206. package/dist/index.es376.js.map +1 -1
  207. package/dist/index.es377.js +509 -113
  208. package/dist/index.es377.js.map +1 -1
  209. package/dist/index.es378.js +121 -123
  210. package/dist/index.es378.js.map +1 -1
  211. package/dist/index.es379.js +132 -0
  212. package/dist/index.es379.js.map +1 -0
  213. package/dist/index.es380.js +65 -69
  214. package/dist/index.es380.js.map +1 -1
  215. package/dist/index.es381.js +68 -8
  216. package/dist/index.es381.js.map +1 -1
  217. package/dist/index.es382.js +9 -14
  218. package/dist/index.es382.js.map +1 -1
  219. package/dist/index.es383.js +14 -62
  220. package/dist/index.es383.js.map +1 -1
  221. package/dist/index.es384.js +61 -64
  222. package/dist/index.es384.js.map +1 -1
  223. package/dist/index.es387.js +21 -11
  224. package/dist/index.es387.js.map +1 -1
  225. package/dist/index.es388.js +11 -26
  226. package/dist/index.es388.js.map +1 -1
  227. package/dist/index.es389.js +27 -4
  228. package/dist/index.es389.js.map +1 -1
  229. package/dist/index.es390.js +4 -22
  230. package/dist/index.es390.js.map +1 -1
  231. package/dist/index.es400.js +8 -8
  232. package/package.json +1 -1
  233. package/dist/index.cjs325.js +0 -2
  234. package/dist/index.cjs325.js.map +0 -1
  235. package/dist/index.cjs326.js +0 -2
  236. package/dist/index.cjs326.js.map +0 -1
  237. package/dist/index.cjs356.js +0 -2
  238. package/dist/index.cjs371.js +0 -2
  239. package/dist/index.cjs371.js.map +0 -1
  240. package/dist/index.es325.js +0 -30
  241. package/dist/index.es325.js.map +0 -1
  242. package/dist/index.es326.js +0 -71
  243. package/dist/index.es326.js.map +0 -1
  244. package/dist/index.es356.js +0 -8
  245. package/dist/index.es371.js +0 -8
  246. package/dist/index.es371.js.map +0 -1
  247. /package/dist/components/ui/{ConsentModal/ConsentModalFooter/ConsentModalFooter.css → DoctorModal/DoctorModalFooter/DoctorModalFooter.css} +0 -0
@@ -1,72 +1,138 @@
1
- import * as a from "react";
2
- import { useComposedRefs as E } from "./index.es325.js";
3
- import { useLayoutEffect as A } from "./index.es347.js";
4
- function T(n, e) {
5
- return a.useReducer((r, t) => e[r][t] ?? r, n);
6
- }
7
- var R = (n) => {
8
- const { present: e, children: r } = n, t = v(e), i = typeof r == "function" ? r({ present: t.isPresent }) : a.Children.only(r), c = E(t.ref, P(i));
9
- return typeof r == "function" || t.isPresent ? a.cloneElement(i, { ref: c }) : null;
10
- };
11
- R.displayName = "Presence";
12
- function v(n) {
13
- const [e, r] = a.useState(), t = a.useRef({}), i = a.useRef(n), c = a.useRef("none"), p = n ? "mounted" : "unmounted", [N, s] = T(p, {
14
- mounted: {
15
- UNMOUNT: "unmounted",
16
- ANIMATION_OUT: "unmountSuspended"
1
+ import * as d from "react";
2
+ import { useComposedRefs as P } from "./index.es328.js";
3
+ import { Primitive as M } from "./index.es331.js";
4
+ import { useCallbackRef as y } from "./index.es337.js";
5
+ import { j as _ } from "./index.es180.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
17
  },
18
- unmountSuspended: {
19
- MOUNT: "mounted",
20
- ANIMATION_END: "unmounted"
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
+ }
21
67
  },
22
- unmounted: {
23
- MOUNT: "mounted"
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;
24
87
  }
25
88
  });
26
- return a.useEffect(() => {
27
- const o = l(t.current);
28
- c.current = N === "mounted" ? o : "none";
29
- }, [N]), A(() => {
30
- const o = t.current, m = i.current;
31
- if (m !== n) {
32
- const f = c.current, u = l(o);
33
- n ? s("MOUNT") : u === "none" || (o == null ? void 0 : o.display) === "none" ? s("UNMOUNT") : s(m && f !== u ? "ANIMATION_OUT" : "UNMOUNT"), i.current = n;
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();
34
125
  }
35
- }, [n, s]), A(() => {
36
- if (e) {
37
- let o;
38
- const m = e.ownerDocument.defaultView ?? window, d = (u) => {
39
- const g = l(t.current).includes(u.animationName);
40
- if (u.target === e && g && (s("ANIMATION_END"), !i.current)) {
41
- const O = e.style.animationFillMode;
42
- e.style.animationFillMode = "forwards", o = m.setTimeout(() => {
43
- e.style.animationFillMode === "forwards" && (e.style.animationFillMode = O);
44
- });
45
- }
46
- }, f = (u) => {
47
- u.target === e && (c.current = l(t.current));
48
- };
49
- return e.addEventListener("animationstart", f), e.addEventListener("animationcancel", d), e.addEventListener("animationend", d), () => {
50
- m.clearTimeout(o), e.removeEventListener("animationstart", f), e.removeEventListener("animationcancel", d), e.removeEventListener("animationend", d);
51
- };
52
- } else
53
- s("ANIMATION_END");
54
- }, [e, s]), {
55
- isPresent: ["mounted", "unmountSuspended"].includes(N),
56
- ref: a.useCallback((o) => {
57
- o && (t.current = getComputedStyle(o)), r(o);
58
- }, [])
59
126
  };
60
127
  }
61
- function l(n) {
62
- return (n == null ? void 0 : n.animationName) || "none";
128
+ function C(e, n) {
129
+ const t = [...e], u = t.indexOf(n);
130
+ return u !== -1 && t.splice(u, 1), t;
63
131
  }
64
- function P(n) {
65
- var t, i;
66
- let e = (t = Object.getOwnPropertyDescriptor(n.props, "ref")) == null ? void 0 : t.get, r = e && "isReactWarning" in e && e.isReactWarning;
67
- return r ? n.ref : (e = (i = Object.getOwnPropertyDescriptor(n, "ref")) == null ? void 0 : i.get, r = e && "isReactWarning" in e && e.isReactWarning, r ? n.props.ref : n.props.ref || n.ref);
132
+ function V(e) {
133
+ return e.filter((n) => n.tagName !== "A");
68
134
  }
69
135
  export {
70
- R as Presence
136
+ k as FocusScope
71
137
  };
72
138
  //# sourceMappingURL=index.es343.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es343.js","sources":["../node_modules/@radix-ui/react-presence/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/presence/src/presence.tsx\nimport * as React2 from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\n\n// packages/react/presence/src/use-state-machine.tsx\nimport * as React from \"react\";\nfunction useStateMachine(initialState, machine) {\n return React.useReducer((state, event) => {\n const nextState = machine[state][event];\n return nextState ?? state;\n }, initialState);\n}\n\n// packages/react/presence/src/presence.tsx\nvar Presence = (props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n const child = typeof children === \"function\" ? children({ present: presence.isPresent }) : React2.Children.only(children);\n const ref = useComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === \"function\";\n return forceMount || presence.isPresent ? React2.cloneElement(child, { ref }) : null;\n};\nPresence.displayName = \"Presence\";\nfunction usePresence(present) {\n const [node, setNode] = React2.useState();\n const stylesRef = React2.useRef({});\n const prevPresentRef = React2.useRef(present);\n const prevAnimationNameRef = React2.useRef(\"none\");\n const initialState = present ? \"mounted\" : \"unmounted\";\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: \"unmounted\",\n ANIMATION_OUT: \"unmountSuspended\"\n },\n unmountSuspended: {\n MOUNT: \"mounted\",\n ANIMATION_END: \"unmounted\"\n },\n unmounted: {\n MOUNT: \"mounted\"\n }\n });\n React2.useEffect(() => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === \"mounted\" ? currentAnimationName : \"none\";\n }, [state]);\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n if (present) {\n send(\"MOUNT\");\n } else if (currentAnimationName === \"none\" || styles?.display === \"none\") {\n send(\"UNMOUNT\");\n } else {\n const isAnimating = prevAnimationName !== currentAnimationName;\n if (wasPresent && isAnimating) {\n send(\"ANIMATION_OUT\");\n } else {\n send(\"UNMOUNT\");\n }\n }\n prevPresentRef.current = present;\n }\n }, [present, send]);\n useLayoutEffect(() => {\n if (node) {\n let timeoutId;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n const handleAnimationEnd = (event) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n const isCurrentAnimation = currentAnimationName.includes(event.animationName);\n if (event.target === node && isCurrentAnimation) {\n send(\"ANIMATION_END\");\n if (!prevPresentRef.current) {\n const currentFillMode = node.style.animationFillMode;\n node.style.animationFillMode = \"forwards\";\n timeoutId = ownerWindow.setTimeout(() => {\n if (node.style.animationFillMode === \"forwards\") {\n node.style.animationFillMode = currentFillMode;\n }\n });\n }\n }\n };\n const handleAnimationStart = (event) => {\n if (event.target === node) {\n prevAnimationNameRef.current = getAnimationName(stylesRef.current);\n }\n };\n node.addEventListener(\"animationstart\", handleAnimationStart);\n node.addEventListener(\"animationcancel\", handleAnimationEnd);\n node.addEventListener(\"animationend\", handleAnimationEnd);\n return () => {\n ownerWindow.clearTimeout(timeoutId);\n node.removeEventListener(\"animationstart\", handleAnimationStart);\n node.removeEventListener(\"animationcancel\", handleAnimationEnd);\n node.removeEventListener(\"animationend\", handleAnimationEnd);\n };\n } else {\n send(\"ANIMATION_END\");\n }\n }, [node, send]);\n return {\n isPresent: [\"mounted\", \"unmountSuspended\"].includes(state),\n ref: React2.useCallback((node2) => {\n if (node2) stylesRef.current = getComputedStyle(node2);\n setNode(node2);\n }, [])\n };\n}\nfunction getAnimationName(styles) {\n return styles?.animationName || \"none\";\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nvar Root = Presence;\nexport {\n Presence,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useStateMachine","initialState","machine","React","state","event","Presence","props","present","children","presence","usePresence","child","React2","ref","useComposedRefs","getElementRef","node","setNode","stylesRef","prevPresentRef","prevAnimationNameRef","send","currentAnimationName","getAnimationName","useLayoutEffect","styles","wasPresent","prevAnimationName","timeoutId","ownerWindow","handleAnimationEnd","isCurrentAnimation","currentFillMode","handleAnimationStart","node2","element","getter","_a","mayWarn","_b"],"mappings":";;;AASA,SAASA,EAAgBC,GAAcC,GAAS;AAC9C,SAAOC,EAAM,WAAW,CAACC,GAAOC,MACZH,EAAQE,CAAK,EAAEC,CAAK,KAClBD,GACnBH,CAAY;AACjB;AAGG,IAACK,IAAW,CAACC,MAAU;AACxB,QAAM,EAAE,SAAAC,GAAS,UAAAC,EAAQ,IAAKF,GACxBG,IAAWC,EAAYH,CAAO,GAC9BI,IAA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A,SAASX,EAAiBE,GAAQ;AAChC,UAAOA,KAAA,gBAAAA,EAAQ,kBAAiB;AAClC;AACA,SAASV,EAAcoB,GAAS;;AAC9B,MAAIC,KAASC,IAAA,OAAO,yBAAyBF,EAAQ,OAAO,KAAK,MAApD,gBAAAE,EAAuD,KAChEC,IAAUF,KAAU,oBAAoBA,KAAUA,EAAO;AAC7D,SAAIE,IACKH,EAAQ,OAEjBC,KAASG,IAAA,OAAO,yBAAyBJ,GAAS,KAAK,MAA9C,gBAAAI,EAAiD,KAC1DD,IAAUF,KAAU,oBAAoBA,KAAUA,EAAO,gBACrDE,IACKH,EAAQ,MAAM,MAEhBA,EAAQ,MAAM,OAAOA,EAAQ;AACtC;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es343.js","sources":["../node_modules/@radix-ui/react-focus-scope/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/focus-scope/src/focus-scope.tsx\nimport * as React from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { jsx } from \"react/jsx-runtime\";\nvar AUTOFOCUS_ON_MOUNT = \"focusScope.autoFocusOnMount\";\nvar AUTOFOCUS_ON_UNMOUNT = \"focusScope.autoFocusOnUnmount\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar FOCUS_SCOPE_NAME = \"FocusScope\";\nvar FocusScope = React.forwardRef((props, forwardedRef) => {\n const {\n loop = false,\n trapped = false,\n onMountAutoFocus: onMountAutoFocusProp,\n onUnmountAutoFocus: onUnmountAutoFocusProp,\n ...scopeProps\n } = props;\n const [container, setContainer] = React.useState(null);\n const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);\n const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);\n const lastFocusedElementRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));\n const focusScope = React.useRef({\n paused: false,\n pause() {\n this.paused = true;\n },\n resume() {\n this.paused = false;\n }\n }).current;\n React.useEffect(() => {\n if (trapped) {\n let handleFocusIn2 = function(event) {\n if (focusScope.paused || !container) return;\n const target = event.target;\n if (container.contains(target)) {\n lastFocusedElementRef.current = target;\n } else {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }, handleFocusOut2 = function(event) {\n if (focusScope.paused || !container) return;\n const relatedTarget = event.relatedTarget;\n if (relatedTarget === null) return;\n if (!container.contains(relatedTarget)) {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }, handleMutations2 = function(mutations) {\n const focusedElement = document.activeElement;\n if (focusedElement !== document.body) return;\n for (const mutation of mutations) {\n if (mutation.removedNodes.length > 0) focus(container);\n }\n };\n var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2;\n document.addEventListener(\"focusin\", handleFocusIn2);\n document.addEventListener(\"focusout\", handleFocusOut2);\n const mutationObserver = new MutationObserver(handleMutations2);\n if (container) mutationObserver.observe(container, { childList: true, subtree: true });\n return () => {\n document.removeEventListener(\"focusin\", handleFocusIn2);\n document.removeEventListener(\"focusout\", handleFocusOut2);\n mutationObserver.disconnect();\n };\n }\n }, [trapped, container, focusScope.paused]);\n React.useEffect(() => {\n if (container) {\n focusScopesStack.add(focusScope);\n const previouslyFocusedElement = document.activeElement;\n const hasFocusedCandidate = container.contains(previouslyFocusedElement);\n if (!hasFocusedCandidate) {\n const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n container.dispatchEvent(mountEvent);\n if (!mountEvent.defaultPrevented) {\n focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });\n if (document.activeElement === previouslyFocusedElement) {\n focus(container);\n }\n }\n }\n return () => {\n container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n setTimeout(() => {\n const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n container.dispatchEvent(unmountEvent);\n if (!unmountEvent.defaultPrevented) {\n focus(previouslyFocusedElement ?? document.body, { select: true });\n }\n container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n focusScopesStack.remove(focusScope);\n }, 0);\n };\n }\n }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);\n const handleKeyDown = React.useCallback(\n (event) => {\n if (!loop && !trapped) return;\n if (focusScope.paused) return;\n const isTabKey = event.key === \"Tab\" && !event.altKey && !event.ctrlKey && !event.metaKey;\n const focusedElement = document.activeElement;\n if (isTabKey && focusedElement) {\n const container2 = event.currentTarget;\n const [first, last] = getTabbableEdges(container2);\n const hasTabbableElementsInside = first && last;\n if (!hasTabbableElementsInside) {\n if (focusedElement === container2) event.preventDefault();\n } else {\n if (!event.shiftKey && focusedElement === last) {\n event.preventDefault();\n if (loop) focus(first, { select: true });\n } else if (event.shiftKey && focusedElement === first) {\n event.preventDefault();\n if (loop) focus(last, { select: true });\n }\n }\n }\n },\n [loop, trapped, focusScope.paused]\n );\n return /* @__PURE__ */ jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });\n});\nFocusScope.displayName = FOCUS_SCOPE_NAME;\nfunction focusFirst(candidates, { select = false } = {}) {\n const previouslyFocusedElement = document.activeElement;\n for (const candidate of candidates) {\n focus(candidate, { select });\n if (document.activeElement !== previouslyFocusedElement) return;\n }\n}\nfunction getTabbableEdges(container) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates, container);\n const last = findVisible(candidates.reverse(), container);\n return [first, last];\n}\nfunction getTabbableCandidates(container) {\n const nodes = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node) => {\n const isHiddenInput = node.tagName === \"INPUT\" && node.type === \"hidden\";\n if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n }\n });\n while (walker.nextNode()) nodes.push(walker.currentNode);\n return nodes;\n}\nfunction findVisible(elements, container) {\n for (const element of elements) {\n if (!isHidden(element, { upTo: container })) return element;\n }\n}\nfunction isHidden(node, { upTo }) {\n if (getComputedStyle(node).visibility === \"hidden\") return true;\n while (node) {\n if (upTo !== void 0 && node === upTo) return false;\n if (getComputedStyle(node).display === \"none\") return true;\n node = node.parentElement;\n }\n return false;\n}\nfunction isSelectableInput(element) {\n return element instanceof HTMLInputElement && \"select\" in element;\n}\nfunction focus(element, { select = false } = {}) {\n if (element && element.focus) {\n const previouslyFocusedElement = document.activeElement;\n element.focus({ preventScroll: true });\n if (element !== previouslyFocusedElement && isSelectableInput(element) && select)\n element.select();\n }\n}\nvar focusScopesStack = createFocusScopesStack();\nfunction createFocusScopesStack() {\n let stack = [];\n return {\n add(focusScope) {\n const activeFocusScope = stack[0];\n if (focusScope !== activeFocusScope) {\n activeFocusScope?.pause();\n }\n stack = arrayRemove(stack, focusScope);\n stack.unshift(focusScope);\n },\n remove(focusScope) {\n stack = arrayRemove(stack, focusScope);\n stack[0]?.resume();\n }\n };\n}\nfunction arrayRemove(array, item) {\n const updatedArray = [...array];\n const index = updatedArray.indexOf(item);\n if (index !== -1) {\n updatedArray.splice(index, 1);\n }\n return updatedArray;\n}\nfunction removeLinks(items) {\n return items.filter((item) => item.tagName !== \"A\");\n}\nvar Root = FocusScope;\nexport {\n FocusScope,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["AUTOFOCUS_ON_MOUNT","AUTOFOCUS_ON_UNMOUNT","EVENT_OPTIONS","FOCUS_SCOPE_NAME","FocusScope","React","props","forwardedRef","loop","trapped","onMountAutoFocusProp","onUnmountAutoFocusProp","scopeProps","container","setContainer","onMountAutoFocus","useCallbackRef","onUnmountAutoFocus","lastFocusedElementRef","composedRefs","useComposedRefs","node","focusScope","handleFocusIn2","event","target","focus","handleFocusOut2","relatedTarget","handleMutations2","mutations","mutation","mutationObserver","focusScopesStack","previouslyFocusedElement","mountEvent","focusFirst","removeLinks","getTabbableCandidates","unmountEvent","handleKeyDown","isTabKey","focusedElement","container2","first","last","getTabbableEdges","jsx","Primitive","candidates","select","candidate","findVisible","nodes","walker","isHiddenInput","elements","element","isHidden","upTo","isSelectableInput","createFocusScopesStack","stack","activeFocusScope","arrayRemove","_a","array","item","updatedArray","index","items"],"mappings":";;;;;AAQA,IAAIA,IAAqB,+BACrBC,IAAuB,iCACvBC,IAAgB,EAAE,SAAS,IAAO,YAAY,GAAM,GACpDC,IAAmB,cACnBC,IAAaC,EAAM,WAAW,CAACC,GAAOC,MAAiB;AACzD,QAAM;AAAA,IACJ,MAAAC,IAAO;AAAA,IACP,SAAAC,IAAU;AAAA,IACV,kBAAkBC;AAAA,IAClB,oBAAoBC;AAAA,IACpB,GAAGC;AAAA,EACP,IAAMN,GACE,CAACO,GAAWC,CAAY,IAAIT,EAAM,SAAS,IAAI,GAC/CU,IAAmBC,EAAeN,CAAoB,GACtDO,IAAqBD,EAAeL,CAAsB,GAC1DO,IAAwBb,EAAM,OAAO,IAAI,GACzCc,IAAeC,EAAgBb,GAAc,CAACc,MAASP,EAAaO,CAAI,CAAC,GACzEC,IAAajB,EAAM,OAAO;AAAA,IAC9B,QAAQ;AAAA,IACR,QAAQ;AACN,WAAK,SAAS;AAAA,IACf;AAAA,IACD,SAAS;AACP,WAAK,SAAS;AAAA,IACpB;AAAA,EACG,CAAA,EAAE;AACH,EAAAA,EAAM,UAAU,MAAM;AACpB,QAAII,GAAS;AACX,UAAIc,IAAiB,SAASC,GAAO;AACnC,YAAIF,EAAW,UAAU,CAACT,EAAW;AACrC,cAAMY,IAASD,EAAM;AACrB,QAAIX,EAAU,SAASY,CAAM,IAC3BP,EAAsB,UAAUO,IAEhCC,EAAMR,EAAsB,SAAS,EAAE,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AAoB,YAAYA;AAC5D;AACA,SAAS/B,EAAM+B,GAAS,EAAE,QAAAP,IAAS,GAAK,IAAK,CAAA,GAAI;AAC/C,MAAIO,KAAWA,EAAQ,OAAO;AAC5B,UAAMvB,IAA2B,SAAS;AAC1C,IAAAuB,EAAQ,MAAM,EAAE,eAAe,GAAI,CAAE,GACjCA,MAAYvB,KAA4B0B,EAAkBH,CAAO,KAAKP,KACxEO,EAAQ,OAAQ;AAAA,EACtB;AACA;AACA,IAAIxB,IAAmB4B,EAAwB;AAC/C,SAASA,IAAyB;AAChC,MAAIC,IAAQ,CAAE;AACd,SAAO;AAAA,IACL,IAAIxC,GAAY;AACd,YAAMyC,IAAmBD,EAAM,CAAC;AAChC,MAAIxC,MAAeyC,MACjBA,KAAA,QAAAA,EAAkB,UAEpBD,IAAQE,EAAYF,GAAOxC,CAAU,GACrCwC,EAAM,QAAQxC,CAAU;AAAA,IACzB;AAAA,IACD,OAAOA,GAAY;;AACjB,MAAAwC,IAAQE,EAAYF,GAAOxC,CAAU,IACrC2C,IAAAH,EAAM,CAAC,MAAP,QAAAG,EAAU;AAAA,IAChB;AAAA,EACG;AACH;AACA,SAASD,EAAYE,GAAOC,GAAM;AAChC,QAAMC,IAAe,CAAC,GAAGF,CAAK,GACxBG,IAAQD,EAAa,QAAQD,CAAI;AACvC,SAAIE,MAAU,MACZD,EAAa,OAAOC,GAAO,CAAC,GAEvBD;AACT;AACA,SAAS/B,EAAYiC,GAAO;AAC1B,SAAOA,EAAM,OAAO,CAACH,MAASA,EAAK,YAAY,GAAG;AACpD;","x_google_ignoreList":[0]}
@@ -1,181 +1,221 @@
1
1
  import * as s from "react";
2
- import { composeEventHandlers as p } from "./index.es324.js";
3
- import { createCollection as H } from "./index.es336.js";
4
- import { useComposedRefs as V } from "./index.es325.js";
5
- import { createContextScope as z } from "./index.es326.js";
6
- import { useId as q } from "./index.es330.js";
7
- import { Primitive as P } from "./index.es328.js";
8
- import { useCallbackRef as J } from "./index.es334.js";
9
- import { useControllableState as Q } from "./index.es327.js";
10
- import { useDirection as W } from "./index.es337.js";
11
- import { j as d } from "./index.es180.js";
12
- var _ = "rovingFocusGroup.onEntryFocus", X = { bubbles: !1, cancelable: !0 }, b = "RovingFocusGroup", [h, G, Z] = H(b), [$, Fe] = z(
13
- b,
14
- [Z]
15
- ), [ee, oe] = $(b), N = s.forwardRef(
16
- (e, r) => /* @__PURE__ */ d.jsx(h.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d.jsx(h.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d.jsx(te, { ...e, ref: r }) }) })
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.es351.js";
3
+ import { Root as Oe } from "./index.es352.js";
4
+ import { useComposedRefs as T } from "./index.es328.js";
5
+ import { createContextScope as Re } from "./index.es329.js";
6
+ import { Primitive as z } from "./index.es331.js";
7
+ import { useCallbackRef as Ee } from "./index.es337.js";
8
+ import { useLayoutEffect as B } from "./index.es349.js";
9
+ import { useSize as Ne } from "./index.es335.js";
10
+ import { j as f } from "./index.es180.js";
11
+ import { autoUpdate as _e } from "./index.es353.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
+ }
17
24
  );
18
- N.displayName = b;
19
- var te = s.forwardRef((e, r) => {
20
- const {
21
- __scopeRovingFocusGroup: c,
22
- orientation: o,
23
- loop: F = !1,
24
- dir: g,
25
- currentTabStopId: R,
26
- defaultCurrentTabStopId: E,
27
- onCurrentTabStopIdChange: m,
28
- onEntryFocus: u,
29
- preventScrollOnEntryFocus: w = !1,
30
- ...C
31
- } = e, v = s.useRef(null), I = V(r, v), t = W(g), [f = null, T] = Q({
32
- prop: R,
33
- defaultProp: E,
34
- onChange: m
35
- }), [a, i] = s.useState(!1), S = J(u), M = G(c), x = s.useRef(!1), [k, y] = s.useState(0);
36
- return s.useEffect(() => {
37
- const n = v.current;
38
- if (n)
39
- return n.addEventListener(_, S), () => n.removeEventListener(_, S);
40
- }, [S]), /* @__PURE__ */ d.jsx(
41
- ee,
42
- {
43
- scope: c,
44
- orientation: o,
45
- dir: t,
46
- loop: F,
47
- currentTabStopId: f,
48
- onItemFocus: s.useCallback(
49
- (n) => T(n),
50
- [T]
51
- ),
52
- onItemShiftTab: s.useCallback(() => i(!0), []),
53
- onFocusableItemAdd: s.useCallback(
54
- () => y((n) => n + 1),
55
- []
56
- ),
57
- onFocusableItemRemove: s.useCallback(
58
- () => y((n) => n - 1),
59
- []
60
- ),
61
- children: /* @__PURE__ */ d.jsx(
62
- P.div,
63
- {
64
- tabIndex: a || k === 0 ? -1 : 0,
65
- "data-orientation": o,
66
- ...C,
67
- ref: I,
68
- style: { outline: "none", ...e.style },
69
- onMouseDown: p(e.onMouseDown, () => {
70
- x.current = !0;
71
- }),
72
- onFocus: p(e.onFocus, (n) => {
73
- const L = !x.current;
74
- if (n.target === n.currentTarget && L && !a) {
75
- const D = new CustomEvent(_, X);
76
- if (n.currentTarget.dispatchEvent(D), !D.defaultPrevented) {
77
- const A = M().filter((l) => l.focusable), U = A.find((l) => l.active), B = A.find((l) => l.id === f), Y = [U, B, ...A].filter(
78
- Boolean
79
- ).map((l) => l.ref.current);
80
- j(Y, w);
81
- }
82
- }
83
- x.current = !1;
84
- }),
85
- onBlur: p(e.onBlur, () => i(!1))
86
- }
87
- )
88
- }
89
- );
90
- }), O = "RovingFocusGroupItem", K = s.forwardRef(
91
- (e, r) => {
25
+ G.displayName = q;
26
+ var _ = "PopperContent", [je, He] = L(_), J = s.forwardRef(
27
+ (e, i) => {
28
+ var I, Y, M, X, D, F;
92
29
  const {
93
- __scopeRovingFocusGroup: c,
94
- focusable: o = !0,
95
- active: F = !1,
96
- tabStopId: g,
97
- ...R
98
- } = e, E = q(), m = g || E, u = oe(O, c), w = u.currentTabStopId === m, C = G(c), { onFocusableItemAdd: v, onFocusableItemRemove: I } = u;
99
- return s.useEffect(() => {
100
- if (o)
101
- return v(), () => I();
102
- }, [o, v, I]), /* @__PURE__ */ d.jsx(
103
- h.ItemSlot,
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",
104
88
  {
105
- scope: c,
106
- id: m,
107
- focusable: o,
108
- active: F,
109
- children: /* @__PURE__ */ d.jsx(
110
- P.span,
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,
111
112
  {
112
- tabIndex: w ? 0 : -1,
113
- "data-orientation": u.orientation,
114
- ...R,
115
- ref: r,
116
- onMouseDown: p(e.onMouseDown, (t) => {
117
- o ? u.onItemFocus(m) : t.preventDefault();
118
- }),
119
- onFocus: p(e.onFocus, () => u.onItemFocus(m)),
120
- onKeyDown: p(e.onKeyDown, (t) => {
121
- if (t.key === "Tab" && t.shiftKey) {
122
- u.onItemShiftTab();
123
- return;
124
- }
125
- if (t.target !== t.currentTarget) return;
126
- const f = se(t, u.orientation, u.dir);
127
- if (f !== void 0) {
128
- if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey) return;
129
- t.preventDefault();
130
- let a = C().filter((i) => i.focusable).map((i) => i.ref.current);
131
- if (f === "last") a.reverse();
132
- else if (f === "prev" || f === "next") {
133
- f === "prev" && a.reverse();
134
- const i = a.indexOf(t.currentTarget);
135
- a = u.loop ? ce(a, i + 1) : a.slice(i + 1);
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"
136
131
  }
137
- setTimeout(() => j(a));
138
132
  }
139
- })
133
+ )
140
134
  }
141
135
  )
142
136
  }
143
137
  );
144
138
  }
145
139
  );
146
- K.displayName = O;
147
- var re = {
148
- ArrowLeft: "prev",
149
- ArrowUp: "prev",
150
- ArrowRight: "next",
151
- ArrowDown: "next",
152
- PageUp: "first",
153
- Home: "first",
154
- PageDown: "last",
155
- End: "last"
156
- };
157
- function ne(e, r) {
158
- return r !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
159
- }
160
- function se(e, r, c) {
161
- const o = ne(e.key, c);
162
- if (!(r === "vertical" && ["ArrowLeft", "ArrowRight"].includes(o)) && !(r === "horizontal" && ["ArrowUp", "ArrowDown"].includes(o)))
163
- return re[o];
164
- }
165
- function j(e, r = !1) {
166
- const c = document.activeElement;
167
- for (const o of e)
168
- if (o === c || (o.focus({ preventScroll: r }), document.activeElement !== c)) return;
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;
169
194
  }
170
- function ce(e, r) {
171
- return e.map((c, o) => e[(r + o) % e.length]);
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];
172
208
  }
173
- var ge = N, Re = K;
209
+ var qe = U, Ge = G, Je = J, Ke = Q;
174
210
  export {
175
- Re as Item,
176
- ge as Root,
177
- N as RovingFocusGroup,
178
- K as RovingFocusGroupItem,
179
- Fe as createRovingFocusGroupScope
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
180
220
  };
181
221
  //# sourceMappingURL=index.es344.js.map