@yselimcan/ui 0.0.4 → 0.0.6
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.
- package/dist/index100.js +32 -5
- package/dist/index101.js +19 -134
- package/dist/index102.js +4 -26
- package/dist/index103.js +4 -9
- package/dist/index104.js +5 -5
- package/dist/index105.js +7 -8
- package/dist/index106.js +16 -20
- package/dist/index107.js +13 -8
- package/dist/index108.js +291 -82
- package/dist/index109.js +4 -12
- package/dist/index110.js +37 -61
- package/dist/index111.js +126 -38
- package/dist/index112.js +5 -14
- package/dist/index113.js +21 -33
- package/dist/index114.js +77 -19
- package/dist/index115.js +63 -4
- package/dist/index116.js +46 -4
- package/dist/index117.js +67 -5
- package/dist/index118.js +8 -11
- package/dist/index119.js +13 -18
- package/dist/index120.js +4 -13
- package/dist/index121.js +3 -296
- package/dist/index122.js +5 -4
- package/dist/index123.js +131 -36
- package/dist/index124.js +24 -122
- package/dist/index125.js +8 -20
- package/dist/index126.js +5 -77
- package/dist/index127.js +11 -63
- package/dist/index128.js +22 -45
- package/dist/index132.js +2 -2
- package/dist/index133.js +1 -1
- package/dist/index134.js +2 -2
- package/dist/index135.js +1 -1
- package/dist/index136.js +4 -4
- package/dist/index137.js +1 -1
- package/dist/index139.js +1 -1
- package/dist/index140.js +3 -3
- package/dist/index141.js +1 -1
- package/dist/index143.js +2 -2
- package/dist/index144.js +1 -1
- package/dist/index145.js +3 -3
- package/dist/index146.js +5 -5
- package/dist/index147.js +6 -6
- package/dist/index148.js +4 -4
- package/dist/index149.js +3 -3
- package/dist/index152.js +1 -1
- package/dist/index155.js +1 -1
- package/dist/index157.js +3 -3
- package/dist/index158.js +3 -3
- package/dist/index159.js +2 -2
- package/dist/index160.js +1 -1
- package/dist/index164.js +1 -1
- package/dist/index167.js +2 -2
- package/dist/index168.js +1 -1
- package/dist/index169.js +1 -1
- package/dist/index17.js +4 -4
- package/dist/index170.js +3 -3
- package/dist/index171.js +1 -1
- package/dist/index172.js +1 -1
- package/dist/index173.js +3 -3
- package/dist/index174.js +1 -1
- package/dist/index175.js +2 -2
- package/dist/index176.js +1 -1
- package/dist/index177.js +1 -1
- package/dist/index178.js +6 -6
- package/dist/index179.js +1 -1
- package/dist/index18.js +5 -5
- package/dist/index180.js +1 -1
- package/dist/index181.js +2 -2
- package/dist/index182.js +1 -1
- package/dist/index183.js +1 -1
- package/dist/index184.js +1 -1
- package/dist/index187.js +2 -2
- package/dist/index189.js +3 -3
- package/dist/index19.js +10 -10
- package/dist/index190.js +1 -1
- package/dist/index191.js +1 -1
- package/dist/index192.js +3 -3
- package/dist/index193.js +1 -1
- package/dist/index194.js +1 -1
- package/dist/index195.js +1 -1
- package/dist/index196.js +5 -5
- package/dist/index197.js +1 -1
- package/dist/index198.js +3 -3
- package/dist/index20.js +3 -3
- package/dist/index200.js +2 -2
- package/dist/index201.js +3 -3
- package/dist/index202.js +1 -1
- package/dist/index203.js +2 -2
- package/dist/index204.js +26 -5
- package/dist/index205.js +5 -26
- package/dist/index206.js +9 -11
- package/dist/index207.js +11 -9
- package/dist/index21.js +4 -4
- package/dist/index217.js +2 -2
- package/dist/index218.js +1 -1
- package/dist/index219.js +4 -39
- package/dist/index22.js +5 -5
- package/dist/index220.js +4 -56
- package/dist/index221.js +14 -27
- package/dist/index222.js +32 -7
- package/dist/index223.js +37 -11
- package/dist/index224.js +57 -12
- package/dist/index225.js +27 -11
- package/dist/index226.js +6 -20
- package/dist/index227.js +11 -10
- package/dist/index228.js +11 -7
- package/dist/index229.js +11 -42
- package/dist/index23.js +3 -3
- package/dist/index230.js +17 -592
- package/dist/index231.js +6 -6
- package/dist/index232.js +7 -32
- package/dist/index233.js +43 -4
- package/dist/index234.js +597 -5
- package/dist/index235.js +11 -14
- package/dist/index239.js +1 -1
- package/dist/index24.js +10 -10
- package/dist/index242.js +2 -2
- package/dist/index244.js +1 -1
- package/dist/index246.js +2 -2
- package/dist/index247.js +14 -321
- package/dist/index248.js +322 -3
- package/dist/index249.js +3 -3
- package/dist/index250.js +3 -15
- package/dist/index26.js +1 -1
- package/dist/index27.js +1 -1
- package/dist/index28.js +2 -2
- package/dist/index32.js +1 -1
- package/dist/index33.js +11 -11
- package/dist/index34.js +4 -4
- package/dist/index35.js +11 -11
- package/dist/index36.js +8 -8
- package/dist/index37.js +6 -6
- package/dist/index38.js +7 -7
- package/dist/index39.js +4 -4
- package/dist/index40.js +3 -3
- package/dist/index41.js +4 -4
- package/dist/index42.js +2 -2
- package/dist/index43.js +2 -2
- package/dist/index44.js +1 -1
- package/dist/index45.js +4 -4
- package/dist/index46.js +8 -8
- package/dist/index47.js +8 -8
- package/dist/index48.js +10 -10
- package/dist/index49.js +2 -2
- package/dist/index50.js +9 -9
- package/dist/index52.js +8 -8
- package/dist/index53.js +1 -1
- package/dist/index54.js +15 -15
- package/dist/index55.js +7 -7
- package/dist/index56.js +8 -8
- package/dist/index57.js +1 -1
- package/dist/index58.js +3 -3
- package/dist/index59.js +2 -2
- package/dist/index60.js +5 -5
- package/dist/index61.js +2 -2
- package/dist/index62.js +2 -2
- package/dist/index63.js +5 -5
- package/dist/index64.js +2 -2
- package/dist/index66.js +7 -7
- package/dist/index67.js +1 -1
- package/dist/index69.js +10 -10
- package/dist/index70.js +1 -1
- package/dist/index71.js +9 -9
- package/dist/index72.js +11 -11
- package/dist/index73.js +2 -2
- package/dist/index74.js +1 -1
- package/dist/index75.js +5 -5
- package/dist/index76.js +1 -1
- package/dist/index77.js +3 -3
- package/dist/index78.js +3 -3
- package/dist/index81.js +7 -7
- package/dist/index82.js +2 -2
- package/dist/index83.js +1 -1
- package/dist/index86.js +11 -54
- package/dist/index87.js +54 -11
- package/dist/index88.js +87 -81
- package/dist/index89.js +81 -87
- package/dist/index94.js +7 -4
- package/dist/index95.js +86 -65
- package/dist/index96.js +12 -8
- package/dist/index97.js +61 -12
- package/dist/index98.js +38 -4
- package/dist/index99.js +14 -4
- package/dist/styles.css +1 -1
- package/package.json +4 -3
package/dist/index121.js
CHANGED
|
@@ -1,299 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { tabbable as we, isTabbable as De, focusable as Ke } from "./index236.js";
|
|
4
|
-
import { isHTMLElement as q, getNodeName as He, getWindow as _e, getComputedStyle as Ue } from "./index101.js";
|
|
5
|
-
import { useMergedRefs as Re } from "./index95.js";
|
|
6
|
-
import { useValueAsRef as H } from "./index132.js";
|
|
7
|
-
import { useStableCallback as _ } from "./index102.js";
|
|
8
|
-
import { useIsoLayoutEffect as U } from "./index104.js";
|
|
9
|
-
import { visuallyHidden as We } from "./index129.js";
|
|
10
|
-
import { useTimeout as ye } from "./index152.js";
|
|
11
|
-
import { useAnimationFrame as $e } from "./index164.js";
|
|
12
|
-
import { FocusGuard as Te } from "./index195.js";
|
|
13
|
-
import { createChangeEventDetails as ze } from "./index113.js";
|
|
14
|
-
import { createAttribute as Fe } from "./index237.js";
|
|
15
|
-
import { enqueueFocus as te } from "./index238.js";
|
|
16
|
-
import { markOthers as Je } from "./index239.js";
|
|
17
|
-
import { usePortalContext as Qe } from "./index124.js";
|
|
18
|
-
import { useFloatingTree as Xe } from "./index181.js";
|
|
19
|
-
import { CLICK_TRIGGER_IDENTIFIER as Ye } from "./index125.js";
|
|
20
|
-
import { resolveRef as D } from "./index240.js";
|
|
21
|
-
import { jsxs as Ze, jsx as xe } from "react/jsx-runtime";
|
|
22
|
-
import { isTypeableCombobox as he, getFloatingFocusElement as Ie, getDocument as I, activeElement as V, contains as m, getTarget as W } from "./index155.js";
|
|
23
|
-
import { getTabbableOptions as re, isOutsideEvent as Le, getNextTabbable as et, getPreviousTabbable as tt } from "./index199.js";
|
|
24
|
-
import { getNodeAncestors as ke, getNodeChildren as Ce } from "./index241.js";
|
|
25
|
-
import { isVirtualClick as nt, isVirtualPointerEvent as rt, stopEvent as ot } from "./index221.js";
|
|
26
|
-
import { triggerHover as st, outsidePress as ut, focusOut as it } from "./index114.js";
|
|
27
|
-
function ct(n, p) {
|
|
28
|
-
const h = _e(n.target);
|
|
29
|
-
return n instanceof h.KeyboardEvent ? "keyboard" : n instanceof h.FocusEvent ? p || "keyboard" : "pointerType" in n ? n.pointerType || "keyboard" : "touches" in n ? "touch" : n instanceof h.MouseEvent ? p || (n.detail === 0 ? "keyboard" : "mouse") : "";
|
|
30
|
-
}
|
|
31
|
-
const Ae = 20;
|
|
32
|
-
let L = [];
|
|
33
|
-
function oe() {
|
|
34
|
-
L = L.filter((n) => n.isConnected);
|
|
35
|
-
}
|
|
36
|
-
function at(n) {
|
|
37
|
-
oe(), n && He(n) !== "body" && (L.push(n), L.length > Ae && (L = L.slice(-Ae)));
|
|
38
|
-
}
|
|
39
|
-
function ne() {
|
|
40
|
-
return oe(), L[L.length - 1];
|
|
41
|
-
}
|
|
42
|
-
function ft(n) {
|
|
43
|
-
if (!n)
|
|
44
|
-
return null;
|
|
45
|
-
const p = re();
|
|
46
|
-
return De(n, p) ? n : we(n, p)[0] || n;
|
|
47
|
-
}
|
|
48
|
-
function lt(n) {
|
|
49
|
-
return !n || !n.isConnected ? !1 : typeof n.checkVisibility == "function" ? n.checkVisibility() : Ue(n).display !== "none";
|
|
50
|
-
}
|
|
51
|
-
function Oe(n, p) {
|
|
52
|
-
if (!p.current.includes("floating") && !n.getAttribute("role")?.includes("dialog"))
|
|
53
|
-
return;
|
|
54
|
-
const h = re(), $ = Ke(n, h).filter((S) => {
|
|
55
|
-
const P = S.getAttribute("data-tabindex") || "";
|
|
56
|
-
return De(S, h) || S.hasAttribute("data-tabindex") && !P.startsWith("-");
|
|
57
|
-
}), N = n.getAttribute("tabindex");
|
|
58
|
-
p.current.includes("floating") || $.length === 0 ? N !== "0" && n.setAttribute("tabindex", "0") : (N !== "-1" || n.hasAttribute("data-tabindex") && n.getAttribute("data-tabindex") !== "-1") && (n.setAttribute("tabindex", "-1"), n.setAttribute("data-tabindex", "-1"));
|
|
59
|
-
}
|
|
60
|
-
function Mt(n) {
|
|
61
|
-
const {
|
|
62
|
-
context: p,
|
|
63
|
-
children: h,
|
|
64
|
-
disabled: i = !1,
|
|
65
|
-
order: $ = ["content"],
|
|
66
|
-
initialFocus: N = !0,
|
|
67
|
-
returnFocus: S = !0,
|
|
68
|
-
restoreFocus: P = !1,
|
|
69
|
-
modal: E = !0,
|
|
70
|
-
closeOnFocusOut: M = !0,
|
|
71
|
-
openInteractionType: Ne = "",
|
|
72
|
-
getInsideElements: Se = () => [],
|
|
73
|
-
nextFocusableElement: z,
|
|
74
|
-
previousFocusableElement: J,
|
|
75
|
-
beforeContentFocusGuardRef: Pe,
|
|
76
|
-
externalTree: Me
|
|
77
|
-
} = n, F = "rootStore" in p ? p.rootStore : p, v = F.useState("open"), a = F.useState("domReferenceElement"), f = F.useState("floatingElement"), {
|
|
78
|
-
events: Q,
|
|
79
|
-
dataRef: k
|
|
80
|
-
} = F.context, O = _(() => k.current.floatingContext?.nodeId), se = _(Se), ue = N === !1, x = he(a) && ue, C = H($), ie = H(N), j = H(S), ce = H(Ne), R = Xe(Me), c = Qe(), Ge = b.useRef(null), qe = b.useRef(null), y = b.useRef(!1), B = b.useRef(!1), X = b.useRef(!1), ae = b.useRef(-1), fe = b.useRef(""), Y = b.useRef(""), le = ye(), de = ye(), be = $e(), Z = c != null, r = Ie(f), A = _((t = r) => t ? we(t, re()) : []), G = _((t) => {
|
|
81
|
-
const o = A(t);
|
|
82
|
-
return C.current.map(() => o).filter(Boolean).flat();
|
|
83
|
-
});
|
|
84
|
-
b.useEffect(() => {
|
|
85
|
-
if (i || !E)
|
|
86
|
-
return;
|
|
87
|
-
function t(l) {
|
|
88
|
-
l.key === "Tab" && m(r, V(I(r))) && A().length === 0 && !x && ot(l);
|
|
89
|
-
}
|
|
90
|
-
const o = I(r);
|
|
91
|
-
return o.addEventListener("keydown", t), () => {
|
|
92
|
-
o.removeEventListener("keydown", t);
|
|
93
|
-
};
|
|
94
|
-
}, [i, a, r, E, C, x, A, G]), b.useEffect(() => {
|
|
95
|
-
if (i || !f)
|
|
96
|
-
return;
|
|
97
|
-
function t(o) {
|
|
98
|
-
const l = W(o), d = A().indexOf(l);
|
|
99
|
-
d !== -1 && (ae.current = d);
|
|
100
|
-
}
|
|
101
|
-
return f.addEventListener("focusin", t), () => {
|
|
102
|
-
f.removeEventListener("focusin", t);
|
|
103
|
-
};
|
|
104
|
-
}, [i, f, A]), b.useEffect(() => {
|
|
105
|
-
if (i || !v)
|
|
106
|
-
return;
|
|
107
|
-
const t = I(r);
|
|
108
|
-
function o() {
|
|
109
|
-
X.current = !1;
|
|
110
|
-
}
|
|
111
|
-
function l(d) {
|
|
112
|
-
const e = W(d), s = m(f, e) || m(a, e) || m(c?.portalNode, e);
|
|
113
|
-
X.current = !s, Y.current = d.pointerType || "keyboard";
|
|
114
|
-
}
|
|
115
|
-
function u() {
|
|
116
|
-
Y.current = "keyboard";
|
|
117
|
-
}
|
|
118
|
-
return t.addEventListener("pointerdown", l, !0), t.addEventListener("pointerup", o, !0), t.addEventListener("pointercancel", o, !0), t.addEventListener("keydown", u, !0), () => {
|
|
119
|
-
t.removeEventListener("pointerdown", l, !0), t.removeEventListener("pointerup", o, !0), t.removeEventListener("pointercancel", o, !0), t.removeEventListener("keydown", u, !0);
|
|
120
|
-
};
|
|
121
|
-
}, [i, f, a, r, v, c]), b.useEffect(() => {
|
|
122
|
-
if (i || !M)
|
|
123
|
-
return;
|
|
124
|
-
function t() {
|
|
125
|
-
B.current = !0, de.start(0, () => {
|
|
126
|
-
B.current = !1;
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
function o(e) {
|
|
130
|
-
const s = e.relatedTarget, w = e.currentTarget, g = W(e);
|
|
131
|
-
queueMicrotask(() => {
|
|
132
|
-
const K = O(), ge = F.context.triggerElements, Be = !(m(a, s) || m(f, s) || m(s, f) || m(c?.portalNode, s) || s != null && ge.hasElement(s) || ge.hasMatchingElement((T) => m(T, s)) || s?.hasAttribute(Fe("focus-guard")) || R && (Ce(R.nodesRef.current, K).find((T) => m(T.context?.elements.floating, s) || m(T.context?.elements.domReference, s)) || ke(R.nodesRef.current, K).find((T) => [T.context?.elements.floating, Ie(T.context?.elements.floating)].includes(s) || T.context?.elements.domReference === s)));
|
|
133
|
-
if (w === a && r && Oe(r, C), P && w !== a && !lt(g) && V(I(r)) === I(r).body) {
|
|
134
|
-
if (q(r) && (r.focus(), P === "popup")) {
|
|
135
|
-
be.request(() => {
|
|
136
|
-
r.focus();
|
|
137
|
-
});
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
const T = ae.current, ee = A(), ve = ee[T] || ee[ee.length - 1] || r;
|
|
141
|
-
q(ve) && ve.focus();
|
|
142
|
-
}
|
|
143
|
-
if (k.current.insideReactTree) {
|
|
144
|
-
k.current.insideReactTree = !1;
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
(x || !E) && s && Be && !B.current && // Fix React 18 Strict Mode returnFocus due to double rendering.
|
|
148
|
-
// For an "untrapped" typeable combobox (input role=combobox with
|
|
149
|
-
// initialFocus=false), re-opening the popup and tabbing out should still close it even
|
|
150
|
-
// when the previously focused element (e.g. the next tabbable outside the popup) is
|
|
151
|
-
// focused again. Otherwise, the popup remains open on the second Tab sequence:
|
|
152
|
-
// click input -> Tab (closes) -> click input -> Tab.
|
|
153
|
-
// Allow closing when `isUntrappedTypeableCombobox` regardless of the previously focused element.
|
|
154
|
-
(x || s !== ne()) && (y.current = !0, F.setOpen(!1, ze(it, e)));
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
function l() {
|
|
158
|
-
X.current || (k.current.insideReactTree = !0, le.start(0, () => {
|
|
159
|
-
k.current.insideReactTree = !1;
|
|
160
|
-
}));
|
|
161
|
-
}
|
|
162
|
-
const u = q(a) ? a : null, d = [];
|
|
163
|
-
if (!(!f && !u))
|
|
164
|
-
return u && (u.addEventListener("focusout", o), u.addEventListener("pointerdown", t), d.push(() => {
|
|
165
|
-
u.removeEventListener("focusout", o), u.removeEventListener("pointerdown", t);
|
|
166
|
-
})), f && (f.addEventListener("focusout", o), c && (f.addEventListener("focusout", l, !0), d.push(() => {
|
|
167
|
-
f.removeEventListener("focusout", l, !0);
|
|
168
|
-
})), d.push(() => {
|
|
169
|
-
f.removeEventListener("focusout", o);
|
|
170
|
-
})), () => {
|
|
171
|
-
d.forEach((e) => {
|
|
172
|
-
e();
|
|
173
|
-
});
|
|
174
|
-
};
|
|
175
|
-
}, [i, a, f, r, E, R, c, F, M, P, A, x, O, C, k, le, de, be]);
|
|
176
|
-
const me = b.useRef(null), pe = b.useRef(null), Ve = Re(me, Pe, c?.beforeInsideRef), je = Re(pe, c?.afterInsideRef);
|
|
177
|
-
b.useEffect(() => {
|
|
178
|
-
if (i || !f || !v)
|
|
179
|
-
return;
|
|
180
|
-
const t = Array.from(c?.portalNode?.querySelectorAll(`[${Fe("portal")}]`) || []), l = (R ? ke(R.nodesRef.current, O()) : []).find((e) => he(e.context?.elements.domReference || null))?.context?.elements.domReference, u = [f, l, ...t, ...se(), Ge.current, qe.current, me.current, pe.current, c?.beforeOutsideRef.current, c?.afterOutsideRef.current, D(J), D(z), x ? a : null].filter((e) => e != null), d = Je(u, E || x);
|
|
181
|
-
return () => {
|
|
182
|
-
d();
|
|
183
|
-
};
|
|
184
|
-
}, [v, i, a, f, E, C, c, x, R, O, se, z, J]), U(() => {
|
|
185
|
-
if (!v || i || !q(r))
|
|
186
|
-
return;
|
|
187
|
-
const t = I(r), o = V(t);
|
|
188
|
-
queueMicrotask(() => {
|
|
189
|
-
const l = G(r), u = ie.current, d = typeof u == "function" ? u(ce.current || "") : u;
|
|
190
|
-
if (d === void 0 || d === !1)
|
|
191
|
-
return;
|
|
192
|
-
let e;
|
|
193
|
-
d === !0 || d === null ? e = l[0] || r : e = D(d), e = e || l[0] || r, !m(r, o) && te(e, {
|
|
194
|
-
preventScroll: e === r
|
|
195
|
-
});
|
|
196
|
-
});
|
|
197
|
-
}, [i, v, r, ue, G, ie, ce]), U(() => {
|
|
198
|
-
if (i || !r)
|
|
199
|
-
return;
|
|
200
|
-
const t = I(r), o = V(t);
|
|
201
|
-
at(o);
|
|
202
|
-
function l(e) {
|
|
203
|
-
if (e.open || (fe.current = ct(e.nativeEvent, Y.current)), e.reason === st && e.nativeEvent.type === "mouseleave" && (y.current = !0), e.reason === ut)
|
|
204
|
-
if (e.nested)
|
|
205
|
-
y.current = !1;
|
|
206
|
-
else if (nt(e.nativeEvent) || rt(e.nativeEvent))
|
|
207
|
-
y.current = !1;
|
|
208
|
-
else {
|
|
209
|
-
let s = !1;
|
|
210
|
-
document.createElement("div").focus({
|
|
211
|
-
get preventScroll() {
|
|
212
|
-
return s = !0, !1;
|
|
213
|
-
}
|
|
214
|
-
}), s ? y.current = !1 : y.current = !0;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
Q.on("openchange", l);
|
|
218
|
-
const u = t.createElement("span");
|
|
219
|
-
u.setAttribute("tabindex", "-1"), u.setAttribute("aria-hidden", "true"), Object.assign(u.style, We), Z && a && a.insertAdjacentElement("afterend", u);
|
|
220
|
-
function d() {
|
|
221
|
-
const e = j.current;
|
|
222
|
-
let s = typeof e == "function" ? e(fe.current) : e;
|
|
223
|
-
if (s === void 0 || s === !1)
|
|
224
|
-
return null;
|
|
225
|
-
if (s === null && (s = !0), typeof s == "boolean") {
|
|
226
|
-
const g = a || ne();
|
|
227
|
-
return g && g.isConnected ? g : u;
|
|
228
|
-
}
|
|
229
|
-
const w = a || ne() || u;
|
|
230
|
-
return D(s) || w;
|
|
231
|
-
}
|
|
232
|
-
return () => {
|
|
233
|
-
Q.off("openchange", l);
|
|
234
|
-
const e = V(t), s = m(f, e) || R && Ce(R.nodesRef.current, O(), !1).some((g) => m(g.context?.elements.floating, e)), w = d();
|
|
235
|
-
queueMicrotask(() => {
|
|
236
|
-
const g = ft(w), K = typeof j.current != "boolean";
|
|
237
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
238
|
-
j.current && !y.current && q(g) && // If the focus moved somewhere else after mount, avoid returning focus
|
|
239
|
-
// since it likely entered a different element which should be
|
|
240
|
-
// respected: https://github.com/floating-ui/floating-ui/issues/2607
|
|
241
|
-
(!(!K && g !== e && e !== t.body) || s) && g.focus({
|
|
242
|
-
preventScroll: !0
|
|
243
|
-
}), u.remove();
|
|
244
|
-
});
|
|
245
|
-
};
|
|
246
|
-
}, [i, f, r, j, k, Q, R, Z, a, O]), b.useEffect(() => {
|
|
247
|
-
queueMicrotask(() => {
|
|
248
|
-
y.current = !1;
|
|
249
|
-
});
|
|
250
|
-
}, [i]), b.useEffect(() => {
|
|
251
|
-
if (i || !v)
|
|
252
|
-
return;
|
|
253
|
-
function t(l) {
|
|
254
|
-
W(l)?.closest(`[${Ye}]`) && (B.current = !0);
|
|
255
|
-
}
|
|
256
|
-
const o = I(r);
|
|
257
|
-
return o.addEventListener("pointerdown", t, !0), () => {
|
|
258
|
-
o.removeEventListener("pointerdown", t, !0);
|
|
259
|
-
};
|
|
260
|
-
}, [i, v, r]), U(() => {
|
|
261
|
-
if (!i && c)
|
|
262
|
-
return c.setFocusManagerState({
|
|
263
|
-
modal: E,
|
|
264
|
-
closeOnFocusOut: M,
|
|
265
|
-
open: v,
|
|
266
|
-
onOpenChange: F.setOpen,
|
|
267
|
-
domReference: a
|
|
268
|
-
}), () => {
|
|
269
|
-
c.setFocusManagerState(null);
|
|
270
|
-
};
|
|
271
|
-
}, [i, c, E, v, F, M, a]), U(() => {
|
|
272
|
-
if (!(i || !r))
|
|
273
|
-
return Oe(r, C), () => {
|
|
274
|
-
queueMicrotask(oe);
|
|
275
|
-
};
|
|
276
|
-
}, [i, r, C]);
|
|
277
|
-
const Ee = !i && (E ? !x : !0) && (Z || E);
|
|
278
|
-
return /* @__PURE__ */ Ze(b.Fragment, {
|
|
279
|
-
children: [Ee && /* @__PURE__ */ xe(Te, {
|
|
280
|
-
"data-type": "inside",
|
|
281
|
-
ref: Ve,
|
|
282
|
-
onFocus: (t) => {
|
|
283
|
-
if (E) {
|
|
284
|
-
const o = G();
|
|
285
|
-
te(o[o.length - 1]);
|
|
286
|
-
} else c?.portalNode && (y.current = !1, Le(t, c.portalNode) ? et(a)?.focus() : D(J ?? c.beforeOutsideRef)?.focus());
|
|
287
|
-
}
|
|
288
|
-
}), h, Ee && /* @__PURE__ */ xe(Te, {
|
|
289
|
-
"data-type": "inside",
|
|
290
|
-
ref: je,
|
|
291
|
-
onFocus: (t) => {
|
|
292
|
-
E ? te(G()[0]) : c?.portalNode && (M && (y.current = !0), Le(t, c.portalNode) ? tt(a)?.focus() : D(z ?? c.afterOutsideRef)?.focus());
|
|
293
|
-
}
|
|
294
|
-
})]
|
|
295
|
-
});
|
|
1
|
+
function e(n, o) {
|
|
2
|
+
return typeof n == "function" ? n(o) : n;
|
|
296
3
|
}
|
|
297
4
|
export {
|
|
298
|
-
|
|
5
|
+
e as resolveStyle
|
|
299
6
|
};
|
package/dist/index122.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
function n(e) {
|
|
3
|
-
return r(19) ? e : e ? "true" : void 0;
|
|
1
|
+
function e() {
|
|
4
2
|
}
|
|
3
|
+
const t = Object.freeze([]), c = Object.freeze({});
|
|
5
4
|
export {
|
|
6
|
-
|
|
5
|
+
t as EMPTY_ARRAY,
|
|
6
|
+
c as EMPTY_OBJECT,
|
|
7
|
+
e as NOOP
|
|
7
8
|
};
|
package/dist/index123.js
CHANGED
|
@@ -1,41 +1,136 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
function c() {
|
|
2
|
+
return typeof window < "u";
|
|
3
|
+
}
|
|
4
|
+
function u(t) {
|
|
5
|
+
return p(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
6
|
+
}
|
|
7
|
+
function i(t) {
|
|
8
|
+
var e;
|
|
9
|
+
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
10
|
+
}
|
|
11
|
+
function N(t) {
|
|
12
|
+
var e;
|
|
13
|
+
return (e = (p(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
14
|
+
}
|
|
15
|
+
function p(t) {
|
|
16
|
+
return c() ? t instanceof Node || t instanceof i(t).Node : !1;
|
|
17
|
+
}
|
|
18
|
+
function m(t) {
|
|
19
|
+
return c() ? t instanceof Element || t instanceof i(t).Element : !1;
|
|
20
|
+
}
|
|
21
|
+
function w(t) {
|
|
22
|
+
return c() ? t instanceof HTMLElement || t instanceof i(t).HTMLElement : !1;
|
|
23
|
+
}
|
|
24
|
+
function f(t) {
|
|
25
|
+
return !c() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof i(t).ShadowRoot;
|
|
26
|
+
}
|
|
27
|
+
const E = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
28
|
+
function y(t) {
|
|
4
29
|
const {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
return /* @__PURE__ */ a("div", {
|
|
25
|
-
ref: n,
|
|
26
|
-
role: "presentation",
|
|
27
|
-
"data-base-ui-inert": "",
|
|
28
|
-
...p,
|
|
29
|
-
style: {
|
|
30
|
-
position: "fixed",
|
|
31
|
-
inset: 0,
|
|
32
|
-
userSelect: "none",
|
|
33
|
-
WebkitUserSelect: "none",
|
|
34
|
-
clipPath: o
|
|
30
|
+
overflow: e,
|
|
31
|
+
overflowX: n,
|
|
32
|
+
overflowY: o,
|
|
33
|
+
display: r
|
|
34
|
+
} = S(t);
|
|
35
|
+
return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !E.has(r);
|
|
36
|
+
}
|
|
37
|
+
const T = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
38
|
+
function A(t) {
|
|
39
|
+
return T.has(u(t));
|
|
40
|
+
}
|
|
41
|
+
const v = [":popover-open", ":modal"];
|
|
42
|
+
function L(t) {
|
|
43
|
+
return v.some((e) => {
|
|
44
|
+
try {
|
|
45
|
+
return t.matches(e);
|
|
46
|
+
} catch {
|
|
47
|
+
return !1;
|
|
35
48
|
}
|
|
36
49
|
});
|
|
37
|
-
}
|
|
38
|
-
|
|
50
|
+
}
|
|
51
|
+
const D = ["transform", "translate", "scale", "rotate", "perspective"], C = ["transform", "translate", "scale", "rotate", "perspective", "filter"], k = ["paint", "layout", "strict", "content"];
|
|
52
|
+
function V(t) {
|
|
53
|
+
const e = O(), n = m(t) ? S(t) : t;
|
|
54
|
+
return D.some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || C.some((o) => (n.willChange || "").includes(o)) || k.some((o) => (n.contain || "").includes(o));
|
|
55
|
+
}
|
|
56
|
+
function B(t) {
|
|
57
|
+
let e = s(t);
|
|
58
|
+
for (; w(e) && !h(e); ) {
|
|
59
|
+
if (V(e))
|
|
60
|
+
return e;
|
|
61
|
+
if (L(e))
|
|
62
|
+
return null;
|
|
63
|
+
e = s(e);
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
function O() {
|
|
68
|
+
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
69
|
+
}
|
|
70
|
+
const R = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
71
|
+
function h(t) {
|
|
72
|
+
return R.has(u(t));
|
|
73
|
+
}
|
|
74
|
+
function S(t) {
|
|
75
|
+
return i(t).getComputedStyle(t);
|
|
76
|
+
}
|
|
77
|
+
function F(t) {
|
|
78
|
+
return m(t) ? {
|
|
79
|
+
scrollLeft: t.scrollLeft,
|
|
80
|
+
scrollTop: t.scrollTop
|
|
81
|
+
} : {
|
|
82
|
+
scrollLeft: t.scrollX,
|
|
83
|
+
scrollTop: t.scrollY
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function s(t) {
|
|
87
|
+
if (u(t) === "html")
|
|
88
|
+
return t;
|
|
89
|
+
const e = (
|
|
90
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
91
|
+
t.assignedSlot || // DOM Element detected.
|
|
92
|
+
t.parentNode || // ShadowRoot detected.
|
|
93
|
+
f(t) && t.host || // Fallback.
|
|
94
|
+
N(t)
|
|
95
|
+
);
|
|
96
|
+
return f(e) ? e.host : e;
|
|
97
|
+
}
|
|
98
|
+
function b(t) {
|
|
99
|
+
const e = s(t);
|
|
100
|
+
return h(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : w(e) && y(e) ? e : b(e);
|
|
101
|
+
}
|
|
102
|
+
function d(t, e, n) {
|
|
103
|
+
var o;
|
|
104
|
+
e === void 0 && (e = []), n === void 0 && (n = !0);
|
|
105
|
+
const r = b(t), g = r === ((o = t.ownerDocument) == null ? void 0 : o.body), l = i(r);
|
|
106
|
+
if (g) {
|
|
107
|
+
const a = _(l);
|
|
108
|
+
return e.concat(l, l.visualViewport || [], y(r) ? r : [], a && n ? d(a) : []);
|
|
109
|
+
}
|
|
110
|
+
return e.concat(r, d(r, [], n));
|
|
111
|
+
}
|
|
112
|
+
function _(t) {
|
|
113
|
+
return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
|
|
114
|
+
}
|
|
39
115
|
export {
|
|
40
|
-
|
|
116
|
+
S as getComputedStyle,
|
|
117
|
+
B as getContainingBlock,
|
|
118
|
+
N as getDocumentElement,
|
|
119
|
+
_ as getFrameElement,
|
|
120
|
+
b as getNearestOverflowAncestor,
|
|
121
|
+
u as getNodeName,
|
|
122
|
+
F as getNodeScroll,
|
|
123
|
+
d as getOverflowAncestors,
|
|
124
|
+
s as getParentNode,
|
|
125
|
+
i as getWindow,
|
|
126
|
+
V as isContainingBlock,
|
|
127
|
+
m as isElement,
|
|
128
|
+
w as isHTMLElement,
|
|
129
|
+
h as isLastTraversableNode,
|
|
130
|
+
p as isNode,
|
|
131
|
+
y as isOverflowElement,
|
|
132
|
+
f as isShadowRoot,
|
|
133
|
+
A as isTableElement,
|
|
134
|
+
L as isTopLayer,
|
|
135
|
+
O as isWebKit
|
|
41
136
|
};
|
package/dist/index124.js
CHANGED
|
@@ -1,128 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const {
|
|
21
|
-
ref: f,
|
|
22
|
-
container: s,
|
|
23
|
-
componentProps: b = H,
|
|
24
|
-
elementProps: E,
|
|
25
|
-
elementState: x
|
|
26
|
-
} = N, d = D(), m = Y()?.portalNode, [e, c] = t.useState(null), [p, u] = t.useState(null), n = t.useRef(null);
|
|
27
|
-
V(() => {
|
|
28
|
-
if (s === null) {
|
|
29
|
-
n.current && (n.current = null, u(null), c(null));
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (d == null)
|
|
33
|
-
return;
|
|
34
|
-
const a = (s && (M(s) ? s : s.current)) ?? m ?? document.body;
|
|
35
|
-
if (a == null) {
|
|
36
|
-
n.current && (n.current = null, u(null), c(null));
|
|
37
|
-
return;
|
|
2
|
+
import * as a from "react";
|
|
3
|
+
import { useRefWithInit as c } from "./index94.js";
|
|
4
|
+
const n = a[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0, -3)], r = (
|
|
5
|
+
// React 17 doesn't have useInsertionEffect.
|
|
6
|
+
n && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late.
|
|
7
|
+
n !== a.useLayoutEffect ? n : (e) => e()
|
|
8
|
+
);
|
|
9
|
+
function f(e) {
|
|
10
|
+
const t = c(o).current;
|
|
11
|
+
return t.next = e, r(t.effect), t.trampoline;
|
|
12
|
+
}
|
|
13
|
+
function o() {
|
|
14
|
+
const e = {
|
|
15
|
+
next: void 0,
|
|
16
|
+
callback: l,
|
|
17
|
+
trampoline: (...t) => e.callback?.(...t),
|
|
18
|
+
effect: () => {
|
|
19
|
+
e.callback = e.next;
|
|
38
20
|
}
|
|
39
|
-
n.current !== a && (n.current = a, u(null), c(a));
|
|
40
|
-
}, [s, m, d]);
|
|
41
|
-
const i = _("div", b, {
|
|
42
|
-
ref: [f, u],
|
|
43
|
-
state: x,
|
|
44
|
-
props: [{
|
|
45
|
-
id: d,
|
|
46
|
-
[k]: ""
|
|
47
|
-
}, E]
|
|
48
|
-
});
|
|
49
|
-
return {
|
|
50
|
-
portalNode: p,
|
|
51
|
-
portalSubtree: e && i ? /* @__PURE__ */ h.createPortal(i, e) : null
|
|
52
21
|
};
|
|
22
|
+
return e;
|
|
23
|
+
}
|
|
24
|
+
function l() {
|
|
25
|
+
if (process.env.NODE_ENV !== "production")
|
|
26
|
+
throw new Error("Base UI: Cannot call an event handler while rendering.");
|
|
53
27
|
}
|
|
54
|
-
const K = /* @__PURE__ */ t.forwardRef(function(f, s) {
|
|
55
|
-
const {
|
|
56
|
-
children: b,
|
|
57
|
-
container: E,
|
|
58
|
-
className: x,
|
|
59
|
-
render: d,
|
|
60
|
-
renderGuards: R,
|
|
61
|
-
...m
|
|
62
|
-
} = f, {
|
|
63
|
-
portalNode: e,
|
|
64
|
-
portalSubtree: c
|
|
65
|
-
} = z({
|
|
66
|
-
container: E,
|
|
67
|
-
ref: s,
|
|
68
|
-
componentProps: f,
|
|
69
|
-
elementProps: m
|
|
70
|
-
}), p = t.useRef(null), u = t.useRef(null), n = t.useRef(null), i = t.useRef(null), [o, a] = t.useState(null), C = o?.modal, O = o?.open, v = typeof R == "boolean" ? R : !!o && !o.modal && o.open && !!e;
|
|
71
|
-
t.useEffect(() => {
|
|
72
|
-
if (!e || C)
|
|
73
|
-
return;
|
|
74
|
-
function r(l) {
|
|
75
|
-
e && g(l) && (l.type === "focusin" ? I : B)(e);
|
|
76
|
-
}
|
|
77
|
-
return e.addEventListener("focusin", r, !0), e.addEventListener("focusout", r, !0), () => {
|
|
78
|
-
e.removeEventListener("focusin", r, !0), e.removeEventListener("focusout", r, !0);
|
|
79
|
-
};
|
|
80
|
-
}, [e, C]), t.useEffect(() => {
|
|
81
|
-
!e || O || I(e);
|
|
82
|
-
}, [O, e]);
|
|
83
|
-
const L = t.useMemo(() => ({
|
|
84
|
-
beforeOutsideRef: p,
|
|
85
|
-
afterOutsideRef: u,
|
|
86
|
-
beforeInsideRef: n,
|
|
87
|
-
afterInsideRef: i,
|
|
88
|
-
portalNode: e,
|
|
89
|
-
setFocusManagerState: a
|
|
90
|
-
}), [e]);
|
|
91
|
-
return /* @__PURE__ */ T(t.Fragment, {
|
|
92
|
-
children: [c, /* @__PURE__ */ T(F.Provider, {
|
|
93
|
-
value: L,
|
|
94
|
-
children: [v && e && /* @__PURE__ */ P(S, {
|
|
95
|
-
"data-type": "outside",
|
|
96
|
-
ref: p,
|
|
97
|
-
onFocus: (r) => {
|
|
98
|
-
if (g(r, e))
|
|
99
|
-
n.current?.focus();
|
|
100
|
-
else {
|
|
101
|
-
const l = o ? o.domReference : null;
|
|
102
|
-
q(l)?.focus();
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}), v && e && /* @__PURE__ */ P("span", {
|
|
106
|
-
"aria-owns": e.id,
|
|
107
|
-
style: j
|
|
108
|
-
}), e && /* @__PURE__ */ h.createPortal(b, e), v && e && /* @__PURE__ */ P(S, {
|
|
109
|
-
"data-type": "outside",
|
|
110
|
-
ref: u,
|
|
111
|
-
onFocus: (r) => {
|
|
112
|
-
if (g(r, e))
|
|
113
|
-
i.current?.focus();
|
|
114
|
-
else {
|
|
115
|
-
const l = o ? o.domReference : null;
|
|
116
|
-
A(l)?.focus(), o?.closeOnFocusOut && o?.onOpenChange(!1, w(J, r.nativeEvent));
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
})]
|
|
120
|
-
})]
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
process.env.NODE_ENV !== "production" && (K.displayName = "FloatingPortal");
|
|
124
28
|
export {
|
|
125
|
-
|
|
126
|
-
z as useFloatingPortalNode,
|
|
127
|
-
Y as usePortalContext
|
|
29
|
+
f as useStableCallback
|
|
128
30
|
};
|
package/dist/index125.js
CHANGED
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
let o;
|
|
2
|
+
process.env.NODE_ENV !== "production" && (o = /* @__PURE__ */ new Set());
|
|
3
|
+
function s(...r) {
|
|
4
|
+
if (process.env.NODE_ENV !== "production") {
|
|
5
|
+
const e = r.join(" ");
|
|
6
|
+
o.has(e) || (o.add(e), console.error(`Base UI: ${e}`));
|
|
4
7
|
}
|
|
5
|
-
}
|
|
6
|
-
fallbackAxisSide: "none"
|
|
7
|
-
}, s = {
|
|
8
|
-
fallbackAxisSide: "end"
|
|
9
|
-
}, e = {
|
|
10
|
-
clipPath: "inset(50%)",
|
|
11
|
-
position: "fixed",
|
|
12
|
-
top: 0,
|
|
13
|
-
left: 0
|
|
14
|
-
};
|
|
8
|
+
}
|
|
15
9
|
export {
|
|
16
|
-
|
|
17
|
-
i as DISABLED_TRANSITIONS_STYLE,
|
|
18
|
-
o as DROPDOWN_COLLISION_AVOIDANCE,
|
|
19
|
-
t as PATIENT_CLICK_THRESHOLD,
|
|
20
|
-
s as POPUP_COLLISION_AVOIDANCE,
|
|
21
|
-
n as TYPEAHEAD_RESET_MS,
|
|
22
|
-
e as ownerVisuallyHidden
|
|
10
|
+
s as error
|
|
23
11
|
};
|