@anoki/fse-ui 1.0.736 → 1.0.738

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 (154) hide show
  1. package/dist/index.cjs15.js +1 -1
  2. package/dist/index.cjs15.js.map +1 -1
  3. package/dist/index.cjs258.js +1 -1
  4. package/dist/index.cjs266.js +1 -1
  5. package/dist/index.cjs275.js +1 -1
  6. package/dist/index.cjs325.js +1 -1
  7. package/dist/index.cjs353.js +1 -1
  8. package/dist/index.cjs354.js +1 -1
  9. package/dist/index.cjs365.js +1 -1
  10. package/dist/index.cjs383.js +1 -1
  11. package/dist/index.cjs384.js +1 -1
  12. package/dist/index.cjs385.js +1 -1
  13. package/dist/index.cjs386.js +1 -1
  14. package/dist/index.cjs392.js +1 -1
  15. package/dist/index.cjs393.js +1 -1
  16. package/dist/index.cjs395.js +2 -0
  17. package/dist/index.cjs395.js.map +1 -0
  18. package/dist/index.cjs396.js +2 -0
  19. package/dist/index.cjs396.js.map +1 -0
  20. package/dist/{index.cjs402.js → index.cjs397.js} +2 -2
  21. package/dist/{index.cjs402.js.map → index.cjs397.js.map} +1 -1
  22. package/dist/{index.cjs403.js → index.cjs398.js} +1 -1
  23. package/dist/{index.cjs403.js.map → index.cjs398.js.map} +1 -1
  24. package/dist/{index.cjs404.js → index.cjs399.js} +1 -1
  25. package/dist/{index.cjs404.js.map → index.cjs399.js.map} +1 -1
  26. package/dist/index.cjs400.js +1 -1
  27. package/dist/index.cjs400.js.map +1 -1
  28. package/dist/index.cjs401.js +1 -1
  29. package/dist/index.cjs401.js.map +1 -1
  30. package/dist/index.cjs419.js +1 -1
  31. package/dist/index.cjs419.js.map +1 -1
  32. package/dist/index.cjs420.js +1 -1
  33. package/dist/index.cjs420.js.map +1 -1
  34. package/dist/index.cjs421.js +1 -1
  35. package/dist/index.cjs421.js.map +1 -1
  36. package/dist/index.cjs422.js +1 -1
  37. package/dist/index.cjs422.js.map +1 -1
  38. package/dist/index.cjs423.js +1 -1
  39. package/dist/index.cjs423.js.map +1 -1
  40. package/dist/index.cjs424.js +2 -0
  41. package/dist/index.cjs424.js.map +1 -0
  42. package/dist/index.cjs425.js +1 -1
  43. package/dist/index.cjs434.js +1 -1
  44. package/dist/index.cjs436.js +1 -1
  45. package/dist/index.cjs441.js +1 -38
  46. package/dist/index.cjs441.js.map +1 -1
  47. package/dist/index.cjs442.js +38 -1
  48. package/dist/index.cjs442.js.map +1 -1
  49. package/dist/index.cjs443.js +1 -1
  50. package/dist/index.cjs443.js.map +1 -1
  51. package/dist/index.cjs444.js +1 -1
  52. package/dist/index.cjs444.js.map +1 -1
  53. package/dist/index.cjs445.js +1 -1
  54. package/dist/index.cjs445.js.map +1 -1
  55. package/dist/index.cjs454.js +1 -1
  56. package/dist/index.cjs464.js +1 -1
  57. package/dist/index.cjs465.js +1 -27
  58. package/dist/index.cjs465.js.map +1 -1
  59. package/dist/index.cjs466.js +1 -1
  60. package/dist/index.cjs466.js.map +1 -1
  61. package/dist/index.cjs467.js +1 -1
  62. package/dist/index.cjs467.js.map +1 -1
  63. package/dist/index.cjs468.js +1 -1
  64. package/dist/index.cjs468.js.map +1 -1
  65. package/dist/index.cjs469.js +27 -1
  66. package/dist/index.cjs469.js.map +1 -1
  67. package/dist/index.cjs470.js +1 -1
  68. package/dist/index.cjs470.js.map +1 -1
  69. package/dist/index.cjs94.js +1 -1
  70. package/dist/index.cjs94.js.map +1 -1
  71. package/dist/index.es15.js +24 -24
  72. package/dist/index.es15.js.map +1 -1
  73. package/dist/index.es258.js +7 -7
  74. package/dist/index.es266.js +1 -1
  75. package/dist/index.es275.js +1 -1
  76. package/dist/index.es325.js +1 -1
  77. package/dist/index.es353.js +2 -2
  78. package/dist/index.es354.js +3 -3
  79. package/dist/index.es365.js +1 -1
  80. package/dist/index.es383.js +1 -1
  81. package/dist/index.es384.js +1 -1
  82. package/dist/index.es385.js +12 -12
  83. package/dist/index.es386.js +1 -1
  84. package/dist/index.es392.js +1 -1
  85. package/dist/index.es393.js +1 -1
  86. package/dist/index.es395.js +128 -0
  87. package/dist/index.es395.js.map +1 -0
  88. package/dist/index.es396.js +138 -0
  89. package/dist/index.es396.js.map +1 -0
  90. package/dist/{index.es402.js → index.es397.js} +2 -2
  91. package/dist/{index.es402.js.map → index.es397.js.map} +1 -1
  92. package/dist/{index.es403.js → index.es398.js} +1 -1
  93. package/dist/{index.es403.js.map → index.es398.js.map} +1 -1
  94. package/dist/{index.es404.js → index.es399.js} +1 -1
  95. package/dist/{index.es404.js.map → index.es399.js.map} +1 -1
  96. package/dist/index.es400.js +47 -122
  97. package/dist/index.es400.js.map +1 -1
  98. package/dist/index.es401.js +47 -129
  99. package/dist/index.es401.js.map +1 -1
  100. package/dist/index.es419.js +10 -45
  101. package/dist/index.es419.js.map +1 -1
  102. package/dist/index.es420.js +45 -7
  103. package/dist/index.es420.js.map +1 -1
  104. package/dist/index.es421.js +7 -217
  105. package/dist/index.es421.js.map +1 -1
  106. package/dist/index.es422.js +203 -163
  107. package/dist/index.es422.js.map +1 -1
  108. package/dist/index.es423.js +177 -3
  109. package/dist/index.es423.js.map +1 -1
  110. package/dist/index.es424.js +7 -0
  111. package/dist/index.es424.js.map +1 -0
  112. package/dist/index.es425.js +1 -1
  113. package/dist/index.es434.js +1 -1
  114. package/dist/index.es436.js +4 -4
  115. package/dist/index.es441.js +65 -69
  116. package/dist/index.es441.js.map +1 -1
  117. package/dist/index.es442.js +68 -8
  118. package/dist/index.es442.js.map +1 -1
  119. package/dist/index.es443.js +9 -14
  120. package/dist/index.es443.js.map +1 -1
  121. package/dist/index.es444.js +14 -62
  122. package/dist/index.es444.js.map +1 -1
  123. package/dist/index.es445.js +61 -64
  124. package/dist/index.es445.js.map +1 -1
  125. package/dist/index.es454.js +2 -2
  126. package/dist/index.es464.js +3 -3
  127. package/dist/index.es465.js +9 -3674
  128. package/dist/index.es465.js.map +1 -1
  129. package/dist/index.es466.js +178 -2
  130. package/dist/index.es466.js.map +1 -1
  131. package/dist/index.es467.js +3 -9
  132. package/dist/index.es467.js.map +1 -1
  133. package/dist/index.es468.js +126 -171
  134. package/dist/index.es468.js.map +1 -1
  135. package/dist/index.es469.js +3674 -3
  136. package/dist/index.es469.js.map +1 -1
  137. package/dist/index.es470.js +2 -133
  138. package/dist/index.es470.js.map +1 -1
  139. package/dist/index.es94.js +33 -32
  140. package/dist/index.es94.js.map +1 -1
  141. package/package.json +1 -1
  142. package/dist/index.cjs405.js +0 -2
  143. package/dist/index.cjs405.js.map +0 -1
  144. package/dist/index.cjs406.js +0 -2
  145. package/dist/index.cjs406.js.map +0 -1
  146. package/dist/index.cjs418.js +0 -2
  147. package/dist/index.cjs418.js.map +0 -1
  148. package/dist/index.es405.js +0 -53
  149. package/dist/index.es405.js.map +0 -1
  150. package/dist/index.es406.js +0 -56
  151. package/dist/index.es406.js.map +0 -1
  152. package/dist/index.es418.js +0 -14
  153. package/dist/index.es418.js.map +0 -1
  154. /package/dist/components/ui/{ConsentModal/ConsentModalContent/ConsentModalContent.css → DoctorConfirmModal/DoctorConfirmModalContent/DoctorConfirmModalContent.css} +0 -0
@@ -1,138 +1,56 @@
1
- import * as d from "react";
2
- import { useComposedRefs as P } from "./index.es381.js";
3
- import { Primitive as M } from "./index.es384.js";
4
- import { useCallbackRef as y } from "./index.es418.js";
5
- import { j as _ } from "./index.es212.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;
1
+ import * as l from "react";
2
+ import { composeRefs as y } from "./index.es381.js";
3
+ import { j as f } from "./index.es212.js";
4
+ // @__NO_SIDE_EFFECTS__
5
+ function b(e) {
6
+ const t = /* @__PURE__ */ S(e), o = l.forwardRef((n, r) => {
7
+ const { children: i, ...a } = n, s = l.Children.toArray(i), p = s.find(g);
8
+ if (p) {
9
+ const c = p.props.children, m = s.map((u) => u === p ? l.Children.count(c) > 1 ? l.Children.only(null) : l.isValidElement(c) ? c.props.children : null : u);
10
+ return /* @__PURE__ */ f.jsx(t, { ...a, ref: r, children: l.isValidElement(c) ? l.cloneElement(c, void 0, m) : null });
20
11
  }
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;
12
+ return /* @__PURE__ */ f.jsx(t, { ...a, ref: r, children: i });
13
+ });
14
+ return o.displayName = `${e}.Slot`, o;
15
+ }
16
+ // @__NO_SIDE_EFFECTS__
17
+ function S(e) {
18
+ const t = l.forwardRef((o, n) => {
19
+ const { children: r, ...i } = o;
20
+ if (l.isValidElement(r)) {
21
+ const a = x(r), s = E(i, r.props);
22
+ return r.type !== l.Fragment && (s.ref = n ? y(n, a) : a), l.cloneElement(r, s);
87
23
  }
24
+ return l.Children.count(r) > 1 ? l.Children.only(null) : null;
88
25
  });
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;
26
+ return t.displayName = `${e}.SlotClone`, t;
27
+ }
28
+ var d = Symbol("radix.slottable");
29
+ // @__NO_SIDE_EFFECTS__
30
+ function h(e) {
31
+ const t = ({ children: o }) => /* @__PURE__ */ f.jsx(f.Fragment, { children: o });
32
+ return t.displayName = `${e}.Slottable`, t.__radixId = d, t;
33
+ }
34
+ function g(e) {
35
+ return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === d;
36
+ }
37
+ function E(e, t) {
38
+ const o = { ...t };
39
+ for (const n in t) {
40
+ const r = e[n], i = t[n];
41
+ /^on[A-Z]/.test(n) ? r && i ? o[n] = (...s) => {
42
+ i(...s), r(...s);
43
+ } : r && (o[n] = r) : n === "style" ? o[n] = { ...r, ...i } : n === "className" && (o[n] = [r, i].filter(Boolean).join(" "));
102
44
  }
103
- return !1;
45
+ return { ...e, ...o };
104
46
  }
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");
47
+ function x(e) {
48
+ var n, r;
49
+ let t = (n = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : n.get, o = t && "isReactWarning" in t && t.isReactWarning;
50
+ return o ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, o = t && "isReactWarning" in t && t.isReactWarning, o ? e.props.ref : e.props.ref || e.ref);
134
51
  }
135
52
  export {
136
- k as FocusScope
53
+ b as createSlot,
54
+ h as createSlottable
137
55
  };
138
56
  //# sourceMappingURL=index.es401.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es401.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,QAAQ,GAAI,CAAE;AAAA,MAE/D,GAASS,IAAkB,SAASH,GAAO;AACnC,YAAIF,EAAW,UAAU,CAACT,EAAW;AACrC,cAAMe,IAAgBJ,EAAM;AAC5B,QAAII,MAAkB,SACjBf,EAAU,SAASe,CAAa,KACnCF,EAAMR,EAAsB,SAAS,EAAE,QAAQ,G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CA,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
+ {"version":3,"file":"index.es401.js","sources":["../node_modules/@radix-ui/react-slot/dist/index.mjs"],"sourcesContent":["// packages/react/slot/src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n childPropValue(...args);\n slotPropValue(...args);\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\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}\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["createSlot","ownerName","SlotClone","createSlotClone","Slot2","React","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","jsx","childrenRef","getElementRef","props2","mergeProps","composeRefs","SLOTTABLE_IDENTIFIER","createSlottable","Slottable2","Fragment2","childProps","overrideProps","propName","slotPropValue","childPropValue","args","element","getter","_a","mayWarn","_b"],"mappings":";;;;AAKA,SAASA,EAAWC,GAAW;AAC7B,QAAMC,IAA4B,gBAAAC,EAAgBF,CAAS,GACrDG,IAAQC,EAAM,WAAW,CAACC,GAAOC,MAAiB;AACtD,UAAM,EAAE,UAAAC,GAAU,GAAGC,EAAS,IAAKH,GAC7BI,IAAgBL,EAAM,SAAS,QAAQG,CAAQ,GAC/CG,IAAYD,EAAc,KAAKE,CAAW;AAChD,QAAID,GAAW;AACb,YAAME,IAAaF,EAAU,MAAM,UAC7BG,IAAcJ,EAAc,IAAI,CAACK,MACjCA,MAAUJ,IACRN,EAAM,SAAS,MAAMQ,CAAU,IAAI,IAAUR,EAAM,SAAS,KAAK,IAAI,IAClEA,EAAM,eAAeQ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AAS,cAAc,eAAeA,EAAM,QAAQA,EAAM,KAAK,cAAcO;AAClI;AACA,SAASF,EAAWX,GAAWiB,GAAY;AACzC,QAAMC,IAAgB,EAAE,GAAGD,EAAY;AACvC,aAAWE,KAAYF,GAAY;AACjC,UAAMG,IAAgBpB,EAAUmB,CAAQ,GAClCE,IAAiBJ,EAAWE,CAAQ;AAE1C,IADkB,WAAW,KAAKA,CAAQ,IAEpCC,KAAiBC,IACnBH,EAAcC,CAAQ,IAAI,IAAIG,MAAS;AACrC,MAAAD,EAAe,GAAGC,CAAI,GACtBF,EAAc,GAAGE,CAAI;AAAA,IACtB,IACQF,MACTF,EAAcC,CAAQ,IAAIC,KAEnBD,MAAa,UACtBD,EAAcC,CAAQ,IAAI,EAAE,GAAGC,GAAe,GAAGC,EAAgB,IACxDF,MAAa,gBACtBD,EAAcC,CAAQ,IAAI,CAACC,GAAeC,CAAc,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,EAExF;AACE,SAAO,EAAE,GAAGrB,GAAW,GAAGkB,EAAe;AAC3C;AACA,SAAST,EAAcc,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,49 +1,14 @@
1
- import r from "react";
2
- import { createContextScope as y } from "./index.es382.js";
3
- import { useComposedRefs as S } from "./index.es381.js";
4
- import { createSlot as M } from "./index.es406.js";
5
- import { j as d } from "./index.es212.js";
6
- function D(s) {
7
- const m = s + "CollectionProvider", [A, E] = y(m), [N, f] = A(
8
- m,
9
- { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
10
- ), p = (c) => {
11
- const { scope: e, children: l } = c, o = r.useRef(null), t = r.useRef(/* @__PURE__ */ new Map()).current;
12
- return /* @__PURE__ */ d.jsx(N, { scope: e, itemMap: t, collectionRef: o, children: l });
13
- };
14
- p.displayName = m;
15
- const a = s + "CollectionSlot", _ = M(a), C = r.forwardRef(
16
- (c, e) => {
17
- const { scope: l, children: o } = c, t = f(a, l), n = S(e, t.collectionRef);
18
- return /* @__PURE__ */ d.jsx(_, { ref: n, children: o });
19
- }
20
- );
21
- C.displayName = a;
22
- const u = s + "CollectionItemSlot", R = "data-radix-collection-item", T = M(u), x = r.forwardRef(
23
- (c, e) => {
24
- const { scope: l, children: o, ...t } = c, n = r.useRef(null), I = S(e, n), i = f(u, l);
25
- return r.useEffect(() => (i.itemMap.set(n, { ref: n, ...t }), () => void i.itemMap.delete(n))), /* @__PURE__ */ d.jsx(T, { [R]: "", ref: I, children: o });
26
- }
27
- );
28
- x.displayName = u;
29
- function O(c) {
30
- const e = f(s + "CollectionConsumer", c);
31
- return r.useCallback(() => {
32
- const o = e.collectionRef.current;
33
- if (!o) return [];
34
- const t = Array.from(o.querySelectorAll(`[${R}]`));
35
- return Array.from(e.itemMap.values()).sort(
36
- (i, v) => t.indexOf(i.ref.current) - t.indexOf(v.ref.current)
37
- );
38
- }, [e.collectionRef, e.itemMap]);
39
- }
40
- return [
41
- { Provider: p, Slot: C, ItemSlot: x },
42
- O,
43
- E
44
- ];
1
+ import * as r from "react";
2
+ function o(t) {
3
+ const e = r.useRef(t);
4
+ return r.useEffect(() => {
5
+ e.current = t;
6
+ }), r.useMemo(() => (...n) => {
7
+ var u;
8
+ return (u = e.current) == null ? void 0 : u.call(e, ...n);
9
+ }, []);
45
10
  }
46
11
  export {
47
- D as createCollection
12
+ o as useCallbackRef
48
13
  };
49
14
  //# sourceMappingURL=index.es419.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es419.js","sources":["../node_modules/@radix-ui/react-collection/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/collection/src/collection.tsx\nimport React from \"react\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createCollection(name) {\n const PROVIDER_NAME = name + \"CollectionProvider\";\n const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);\n const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(\n PROVIDER_NAME,\n { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }\n );\n const CollectionProvider = (props) => {\n const { scope, children } = props;\n const ref = React.useRef(null);\n const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;\n return /* @__PURE__ */ jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });\n };\n CollectionProvider.displayName = PROVIDER_NAME;\n const COLLECTION_SLOT_NAME = name + \"CollectionSlot\";\n const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);\n const CollectionSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);\n return /* @__PURE__ */ jsx(CollectionSlotImpl, { ref: composedRefs, children });\n }\n );\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n const ITEM_SLOT_NAME = name + \"CollectionItemSlot\";\n const ITEM_DATA_ATTR = \"data-radix-collection-item\";\n const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);\n const CollectionItemSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n React.useEffect(() => {\n context.itemMap.set(ref, { ref, ...itemData });\n return () => void context.itemMap.delete(ref);\n });\n return /* @__PURE__ */ jsx(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: \"\" }, ref: composedRefs, children });\n }\n );\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n function useCollection(scope) {\n const context = useCollectionContext(name + \"CollectionConsumer\", scope);\n const getItems = React.useCallback(() => {\n const collectionNode = context.collectionRef.current;\n if (!collectionNode) return [];\n const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));\n const items = Array.from(context.itemMap.values());\n const orderedItems = items.sort(\n (a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)\n );\n return orderedItems;\n }, [context.collectionRef, context.itemMap]);\n return getItems;\n }\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n useCollection,\n createCollectionScope\n ];\n}\nexport {\n createCollection\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["createCollection","name","PROVIDER_NAME","createCollectionContext","createCollectionScope","createContextScope","CollectionProviderImpl","useCollectionContext","CollectionProvider","props","scope","children","ref","React","itemMap","jsx","COLLECTION_SLOT_NAME","CollectionSlotImpl","createSlot","CollectionSlot","forwardedRef","context","composedRefs","useComposedRefs","ITEM_SLOT_NAME","ITEM_DATA_ATTR","CollectionItemSlotImpl","CollectionItemSlot","itemData","useCollection","collectionNode","orderedNodes","a","b"],"mappings":";;;;;AAQA,SAASA,EAAiBC,GAAM;AAC9B,QAAMC,IAAgBD,IAAO,sBACvB,CAACE,GAAyBC,CAAqB,IAAIC,EAAmBH,CAAa,GACnF,CAACI,GAAwBC,CAAoB,IAAIJ;AAAA,IACrDD;AAAA,IACA,EAAE,eAAe,EAAE,SAAS,KAAI,GAAI,SAAyB,oBAAI,IAAK,EAAA;AAAA,EACvE,GACKM,IAAqB,CAACC,MAAU;AACpC,UAAM,EAAE,OAAAC,GAAO,UAAAC,EAAQ,IAAKF,GACtBG,IAAMC,EAAM,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Ud,EAAqBN,IAAO,sBAAsBS,CAAK;AAWvE,WAViBG,EAAM,YAAY,MAAM;AACvC,YAAMiB,IAAiBT,EAAQ,cAAc;AAC7C,UAAI,CAACS,EAAgB,QAAO,CAAE;AAC9B,YAAMC,IAAe,MAAM,KAAKD,EAAe,iBAAiB,IAAIL,CAAc,GAAG,CAAC;AAKtF,aAJc,MAAM,KAAKJ,EAAQ,QAAQ,QAAQ,EACtB;AAAA,QACzB,CAACW,GAAGC,MAAMF,EAAa,QAAQC,EAAE,IAAI,OAAO,IAAID,EAAa,QAAQE,EAAE,IAAI,OAAO;AAAA,MACnF;AAAA,IAEF,GAAE,CAACZ,EAAQ,eAAeA,EAAQ,OAAO,CAAC;AAAA,EAE/C;AACE,SAAO;AAAA,IACL,EAAE,UAAUb,GAAoB,MAAMW,GAAgB,UAAUQ,EAAoB;AAAA,IACpFE;AAAA,IACAzB;AAAA,EACD;AACH;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es419.js","sources":["../node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs"],"sourcesContent":["// packages/react/use-callback-ref/src/use-callback-ref.tsx\nimport * as React from \"react\";\nfunction useCallbackRef(callback) {\n const callbackRef = React.useRef(callback);\n React.useEffect(() => {\n callbackRef.current = callback;\n });\n return React.useMemo(() => (...args) => callbackRef.current?.(...args), []);\n}\nexport {\n useCallbackRef\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useCallbackRef","callback","callbackRef","React","args","_a"],"mappings":";AAEA,SAASA,EAAeC,GAAU;AAChC,QAAMC,IAAcC,EAAM,OAAOF,CAAQ;AACzC,SAAAE,EAAM,UAAU,MAAM;AACpB,IAAAD,EAAY,UAAUD;AAAA,EAC1B,CAAG,GACME,EAAM,QAAQ,MAAM,IAAIC;;AAAS,YAAAC,IAAAH,EAAY,YAAZ,gBAAAG,EAAA,KAAAH,GAAsB,GAAGE;AAAA,KAAO,EAAE;AAC5E;","x_google_ignoreList":[0]}
@@ -1,11 +1,49 @@
1
- import * as t from "react";
2
- import "./index.es212.js";
3
- var r = t.createContext(void 0);
4
- function n(o) {
5
- const e = t.useContext(r);
6
- return o || e || "ltr";
1
+ import r from "react";
2
+ import { createContextScope as y } from "./index.es382.js";
3
+ import { useComposedRefs as S } from "./index.es381.js";
4
+ import { createSlot as M } from "./index.es401.js";
5
+ import { j as d } from "./index.es212.js";
6
+ function D(s) {
7
+ const m = s + "CollectionProvider", [A, E] = y(m), [N, f] = A(
8
+ m,
9
+ { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
10
+ ), p = (c) => {
11
+ const { scope: e, children: l } = c, o = r.useRef(null), t = r.useRef(/* @__PURE__ */ new Map()).current;
12
+ return /* @__PURE__ */ d.jsx(N, { scope: e, itemMap: t, collectionRef: o, children: l });
13
+ };
14
+ p.displayName = m;
15
+ const a = s + "CollectionSlot", _ = M(a), C = r.forwardRef(
16
+ (c, e) => {
17
+ const { scope: l, children: o } = c, t = f(a, l), n = S(e, t.collectionRef);
18
+ return /* @__PURE__ */ d.jsx(_, { ref: n, children: o });
19
+ }
20
+ );
21
+ C.displayName = a;
22
+ const u = s + "CollectionItemSlot", R = "data-radix-collection-item", T = M(u), x = r.forwardRef(
23
+ (c, e) => {
24
+ const { scope: l, children: o, ...t } = c, n = r.useRef(null), I = S(e, n), i = f(u, l);
25
+ return r.useEffect(() => (i.itemMap.set(n, { ref: n, ...t }), () => void i.itemMap.delete(n))), /* @__PURE__ */ d.jsx(T, { [R]: "", ref: I, children: o });
26
+ }
27
+ );
28
+ x.displayName = u;
29
+ function O(c) {
30
+ const e = f(s + "CollectionConsumer", c);
31
+ return r.useCallback(() => {
32
+ const o = e.collectionRef.current;
33
+ if (!o) return [];
34
+ const t = Array.from(o.querySelectorAll(`[${R}]`));
35
+ return Array.from(e.itemMap.values()).sort(
36
+ (i, v) => t.indexOf(i.ref.current) - t.indexOf(v.ref.current)
37
+ );
38
+ }, [e.collectionRef, e.itemMap]);
39
+ }
40
+ return [
41
+ { Provider: p, Slot: C, ItemSlot: x },
42
+ O,
43
+ E
44
+ ];
7
45
  }
8
46
  export {
9
- n as useDirection
47
+ D as createCollection
10
48
  };
11
49
  //# sourceMappingURL=index.es420.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es420.js","sources":["../node_modules/@radix-ui/react-direction/dist/index.mjs"],"sourcesContent":["// packages/react/direction/src/direction.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DirectionContext = React.createContext(void 0);\nvar DirectionProvider = (props) => {\n const { dir, children } = props;\n return /* @__PURE__ */ jsx(DirectionContext.Provider, { value: dir, children });\n};\nfunction useDirection(localDir) {\n const globalDir = React.useContext(DirectionContext);\n return localDir || globalDir || \"ltr\";\n}\nvar Provider = DirectionProvider;\nexport {\n DirectionProvider,\n Provider,\n useDirection\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["DirectionContext","React","useDirection","localDir","globalDir"],"mappings":";;AAGA,IAAIA,IAAmBC,EAAM,cAAc,MAAM;AAKjD,SAASC,EAAaC,GAAU;AAC9B,QAAMC,IAAYH,EAAM,WAAWD,CAAgB;AACnD,SAAOG,KAAYC,KAAa;AAClC;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es420.js","sources":["../node_modules/@radix-ui/react-collection/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/collection/src/collection.tsx\nimport React from \"react\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createCollection(name) {\n const PROVIDER_NAME = name + \"CollectionProvider\";\n const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);\n const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(\n PROVIDER_NAME,\n { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }\n );\n const CollectionProvider = (props) => {\n const { scope, children } = props;\n const ref = React.useRef(null);\n const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;\n return /* @__PURE__ */ jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });\n };\n CollectionProvider.displayName = PROVIDER_NAME;\n const COLLECTION_SLOT_NAME = name + \"CollectionSlot\";\n const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);\n const CollectionSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);\n return /* @__PURE__ */ jsx(CollectionSlotImpl, { ref: composedRefs, children });\n }\n );\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n const ITEM_SLOT_NAME = name + \"CollectionItemSlot\";\n const ITEM_DATA_ATTR = \"data-radix-collection-item\";\n const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);\n const CollectionItemSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n React.useEffect(() => {\n context.itemMap.set(ref, { ref, ...itemData });\n return () => void context.itemMap.delete(ref);\n });\n return /* @__PURE__ */ jsx(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: \"\" }, ref: composedRefs, children });\n }\n );\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n function useCollection(scope) {\n const context = useCollectionContext(name + \"CollectionConsumer\", scope);\n const getItems = React.useCallback(() => {\n const collectionNode = context.collectionRef.current;\n if (!collectionNode) return [];\n const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));\n const items = Array.from(context.itemMap.values());\n const orderedItems = items.sort(\n (a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)\n );\n return orderedItems;\n }, [context.collectionRef, context.itemMap]);\n return getItems;\n }\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n useCollection,\n createCollectionScope\n ];\n}\nexport {\n createCollection\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["createCollection","name","PROVIDER_NAME","createCollectionContext","createCollectionScope","createContextScope","CollectionProviderImpl","useCollectionContext","CollectionProvider","props","scope","children","ref","React","itemMap","jsx","COLLECTION_SLOT_NAME","CollectionSlotImpl","createSlot","CollectionSlot","forwardedRef","context","composedRefs","useComposedRefs","ITEM_SLOT_NAME","ITEM_DATA_ATTR","CollectionItemSlotImpl","CollectionItemSlot","itemData","useCollection","collectionNode","orderedNodes","a","b"],"mappings":";;;;;AAQA,SAASA,EAAiBC,GAAM;AAC9B,QAAMC,IAAgBD,IAAO,sBACvB,CAACE,GAAyBC,CAAqB,IAAIC,EAAmBH,CAAa,GACnF,CAACI,GAAwBC,CAAoB,IAAIJ;AAAA,IACrDD;AAAA,IACA,EAAE,eAAe,EAAE,SAAS,KAAI,GAAI,SAAyB,oBAAI,IAAK,EAAA;AAAA,EACvE,GACKM,IAAqB,CAACC,MAAU;AACpC,UAAM,EAAE,OAAAC,GAAO,UAAAC,EAAQ,IAAKF,GACtBG,IAAMC,EAAM,OAAO,IAAI,GACvBC,IAAUD,EAAM,OAAuB,oBAAI,IAAG,CAAE,EAAE;AACxD,WAAuBE,gBAAAA,EAAG,IAACT,GAAwB,EAAE,OAAAI,GAAO,SAAAI,GAAS,eAAeF,GAAK,UAAAD,GAAU;AAAA,EACpG;AACD,EAAAH,EAAmB,cAAcN;AACjC,QAAMc,IAAuBf,IAAO,kBAC9BgB,IAAqBC,EAAWF,CAAoB,GACpDG,IAAiBN,EAAM;AAAA,IAC3B,CAACJ,GAAOW,MAAiB;AACvB,YAAM,EAAE,OAAAV,GAAO,UAAAC,EAAQ,IAAKF,GACtBY,IAAUd,EAAqBS,GAAsBN,CAAK,GAC1DY,IAAeC,EAAgBH,GAAcC,EAAQ,aAAa;AACxE,aAAuBN,gBA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,EAAE,UAAUb,GAAoB,MAAMW,GAAgB,UAAUQ,EAAoB;AAAA,IACpFE;AAAA,IACAzB;AAAA,EACD;AACH;","x_google_ignoreList":[0]}
@@ -1,221 +1,11 @@
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.es426.js";
3
- import { Root as Oe } from "./index.es427.js";
4
- import { useComposedRefs as T } from "./index.es381.js";
5
- import { createContextScope as Re } from "./index.es382.js";
6
- import { Primitive as z } from "./index.es384.js";
7
- import { useCallbackRef as Ee } from "./index.es418.js";
8
- import { useLayoutEffect as B } from "./index.es423.js";
9
- import { useSize as Ne } from "./index.es392.js";
10
- import { j as f } from "./index.es212.js";
11
- import { autoUpdate as _e } from "./index.es428.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
- );
138
- }
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];
1
+ import * as t from "react";
2
+ import "./index.es212.js";
3
+ var r = t.createContext(void 0);
4
+ function n(o) {
5
+ const e = t.useContext(r);
6
+ return o || e || "ltr";
208
7
  }
209
- var qe = U, Ge = G, Je = J, Ke = Q;
210
8
  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
9
+ n as useDirection
220
10
  };
221
11
  //# sourceMappingURL=index.es421.js.map