@drjoshcsimmons/scl 0.1.6 → 0.1.7
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 +30 -4
- package/dist/index101.js +647 -12
- package/dist/index102.js +178 -27
- package/dist/index103.js +24 -180
- package/dist/index104.js +12 -647
- package/dist/index105.js +6 -12
- package/dist/index106.js +10 -204
- package/dist/index107.js +20 -21
- package/dist/index108.js +9 -400
- package/dist/index109.js +38 -6
- package/dist/index11.js +2 -2
- package/dist/index110.js +11 -14
- package/dist/index111.js +206 -9
- package/dist/index112.js +21 -37
- package/dist/index113.js +399 -17
- package/dist/index114.js +2 -25
- package/dist/index115.js +53 -29
- package/dist/index116.js +65 -5
- package/dist/index117.js +25 -2
- package/dist/index118.js +29 -53
- package/dist/index119.js +5 -65
- package/dist/index12.js +1 -1
- package/dist/index125.js +1 -1
- package/dist/index126.js +1 -1
- package/dist/index13.js +2 -2
- package/dist/index130.js +1 -1
- package/dist/index131.js +1 -1
- package/dist/index132.js +1 -1
- package/dist/index137.js +11 -21
- package/dist/index138.js +26 -11
- package/dist/index139.js +4 -27
- package/dist/index14.js +2 -2
- package/dist/index140.js +22 -4
- package/dist/index15.js +2 -2
- package/dist/index17.js +4 -4
- package/dist/index18.js +2 -2
- package/dist/index20.js +1 -1
- package/dist/index21.js +1 -1
- package/dist/index22.js +1 -1
- package/dist/index23.js +2 -2
- package/dist/index24.js +1 -1
- package/dist/index25.js +4 -4
- package/dist/index26.js +1 -1
- package/dist/index27.js +2 -2
- package/dist/index29.js +1 -1
- package/dist/index31.js +1 -1
- package/dist/index33.js +1 -1
- package/dist/index36.js +1 -1
- package/dist/index37.js +1 -1
- package/dist/index4.js +2 -2
- package/dist/index46.js +210 -214
- package/dist/index47.js +11 -249
- package/dist/index48.js +73 -9
- package/dist/index49.js +125 -12
- package/dist/index50.js +57 -257
- package/dist/index51.js +260 -12
- package/dist/index52.js +12 -73
- package/dist/index53.js +12 -237
- package/dist/index54.js +3 -5
- package/dist/index55.js +811 -481
- package/dist/index56.js +9 -125
- package/dist/index57.js +215 -300
- package/dist/index58.js +3 -4
- package/dist/index59.js +11 -435
- package/dist/index6.js +1 -1
- package/dist/index60.js +114 -56
- package/dist/index61.js +20 -252
- package/dist/index62.js +250 -126
- package/dist/index63.js +224 -70
- package/dist/index64.js +160 -21
- package/dist/index65.js +434 -30
- package/dist/index66.js +334 -16
- package/dist/index67.js +16 -234
- package/dist/index68.js +530 -11
- package/dist/index69.js +222 -134
- package/dist/index7.js +1 -1
- package/dist/index70.js +119 -325
- package/dist/index71.js +25 -219
- package/dist/index72.js +241 -11
- package/dist/index73.js +68 -846
- package/dist/index74.js +310 -9
- package/dist/index75.js +12 -118
- package/dist/index76.js +66 -5
- package/dist/index77.js +44 -25
- package/dist/index78.js +23 -64
- package/dist/index79.js +5 -123
- package/dist/index80.js +50 -13
- package/dist/index81.js +32 -133
- package/dist/index82.js +1 -1
- package/dist/index83.js +7 -218
- package/dist/index84.js +55 -14
- package/dist/index85.js +10 -68
- package/dist/index86.js +4 -34
- package/dist/index87.js +29 -53
- package/dist/index88.js +10 -49
- package/dist/index89.js +53 -49
- package/dist/index9.js +1 -1
- package/dist/index90.js +124 -8
- package/dist/index91.js +134 -5
- package/dist/index92.js +14 -25
- package/dist/index93.js +65 -51
- package/dist/index94.js +12 -8
- package/dist/index95.js +9 -4
- package/dist/index96.js +49 -29
- package/dist/index97.js +3 -12
- package/dist/index98.js +216 -43
- package/dist/index99.js +5 -7
- package/package.json +11 -19
package/dist/index78.js
CHANGED
|
@@ -1,70 +1,29 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return /* @__PURE__ */ h(o.Provider, { value: s, children: t });
|
|
7
|
-
};
|
|
8
|
-
a.displayName = e + "Provider";
|
|
9
|
-
function i(r) {
|
|
10
|
-
const t = u.useContext(o);
|
|
11
|
-
if (t) return t;
|
|
12
|
-
if (c !== void 0) return c;
|
|
13
|
-
throw new Error(`\`${r}\` must be used within \`${e}\``);
|
|
14
|
-
}
|
|
15
|
-
return [a, i];
|
|
1
|
+
import * as f from "react";
|
|
2
|
+
function l(n, o) {
|
|
3
|
+
if (typeof n == "function")
|
|
4
|
+
return n(o);
|
|
5
|
+
n != null && (n.current = o);
|
|
16
6
|
}
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (m) return m;
|
|
32
|
-
if (t !== void 0) return t;
|
|
33
|
-
throw new Error(`\`${d}\` must be used within \`${r}\``);
|
|
34
|
-
}
|
|
35
|
-
return [p, f];
|
|
36
|
-
}
|
|
37
|
-
const i = () => {
|
|
38
|
-
const r = o.map((t) => u.createContext(t));
|
|
39
|
-
return function(n) {
|
|
40
|
-
const s = (n == null ? void 0 : n[e]) || r;
|
|
41
|
-
return u.useMemo(
|
|
42
|
-
() => ({ [`__scope${e}`]: { ...n, [e]: s } }),
|
|
43
|
-
[n, s]
|
|
44
|
-
);
|
|
45
|
-
};
|
|
7
|
+
function i(...n) {
|
|
8
|
+
return (o) => {
|
|
9
|
+
let u = !1;
|
|
10
|
+
const c = n.map((t) => {
|
|
11
|
+
const e = l(t, o);
|
|
12
|
+
return !u && typeof e == "function" && (u = !0), e;
|
|
13
|
+
});
|
|
14
|
+
if (u)
|
|
15
|
+
return () => {
|
|
16
|
+
for (let t = 0; t < c.length; t++) {
|
|
17
|
+
const e = c[t];
|
|
18
|
+
typeof e == "function" ? e() : l(n[t], null);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
46
21
|
};
|
|
47
|
-
return i.scopeName = e, [a, l(i, ...c)];
|
|
48
22
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
51
|
-
if (e.length === 1) return c;
|
|
52
|
-
const o = () => {
|
|
53
|
-
const a = e.map((i) => ({
|
|
54
|
-
useScope: i(),
|
|
55
|
-
scopeName: i.scopeName
|
|
56
|
-
}));
|
|
57
|
-
return function(r) {
|
|
58
|
-
const t = a.reduce((n, { useScope: s, scopeName: p }) => {
|
|
59
|
-
const d = s(r)[`__scope${p}`];
|
|
60
|
-
return { ...n, ...d };
|
|
61
|
-
}, {});
|
|
62
|
-
return u.useMemo(() => ({ [`__scope${c.scopeName}`]: t }), [t]);
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
return o.scopeName = c.scopeName, o;
|
|
23
|
+
function s(...n) {
|
|
24
|
+
return f.useCallback(i(...n), n);
|
|
66
25
|
}
|
|
67
26
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
27
|
+
i as composeRefs,
|
|
28
|
+
s as useComposedRefs
|
|
70
29
|
};
|
package/dist/index79.js
CHANGED
|
@@ -1,127 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { useCallbackRef as w } from "./index94.js";
|
|
6
|
-
import { useEscapeKeydown as U } from "./index105.js";
|
|
7
|
-
import { jsx as T } from "react/jsx-runtime";
|
|
8
|
-
var z = "DismissableLayer", y = "dismissableLayer.update", H = "dismissableLayer.pointerDownOutside", M = "dismissableLayer.focusOutside", L, B = n.createContext({
|
|
9
|
-
layers: /* @__PURE__ */ new Set(),
|
|
10
|
-
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
11
|
-
branches: /* @__PURE__ */ new Set()
|
|
12
|
-
}), j = n.forwardRef(
|
|
13
|
-
(r, e) => {
|
|
14
|
-
const {
|
|
15
|
-
disableOutsidePointerEvents: i = !1,
|
|
16
|
-
onEscapeKeyDown: o,
|
|
17
|
-
onPointerDownOutside: t,
|
|
18
|
-
onFocusOutside: a,
|
|
19
|
-
onInteractOutside: l,
|
|
20
|
-
onDismiss: d,
|
|
21
|
-
...v
|
|
22
|
-
} = r, c = n.useContext(B), [u, S] = n.useState(null), f = (u == null ? void 0 : u.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, F] = n.useState({}), W = R(e, (s) => S(s)), p = Array.from(c.layers), [A] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), N = p.indexOf(A), b = u ? p.indexOf(u) : -1, I = c.layersWithOutsidePointerEventsDisabled.size > 0, P = b >= N, _ = q((s) => {
|
|
23
|
-
const E = s.target, C = [...c.branches].some((h) => h.contains(E));
|
|
24
|
-
!P || C || (t == null || t(s), l == null || l(s), s.defaultPrevented || d == null || d());
|
|
25
|
-
}, f), D = G((s) => {
|
|
26
|
-
const E = s.target;
|
|
27
|
-
[...c.branches].some((h) => h.contains(E)) || (a == null || a(s), l == null || l(s), s.defaultPrevented || d == null || d());
|
|
28
|
-
}, f);
|
|
29
|
-
return U((s) => {
|
|
30
|
-
b === c.layers.size - 1 && (o == null || o(s), !s.defaultPrevented && d && (s.preventDefault(), d()));
|
|
31
|
-
}, f), n.useEffect(() => {
|
|
32
|
-
if (u)
|
|
33
|
-
return i && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (L = f.body.style.pointerEvents, f.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(u)), c.layers.add(u), O(), () => {
|
|
34
|
-
i && c.layersWithOutsidePointerEventsDisabled.size === 1 && (f.body.style.pointerEvents = L);
|
|
35
|
-
};
|
|
36
|
-
}, [u, f, i, c]), n.useEffect(() => () => {
|
|
37
|
-
u && (c.layers.delete(u), c.layersWithOutsidePointerEventsDisabled.delete(u), O());
|
|
38
|
-
}, [u, c]), n.useEffect(() => {
|
|
39
|
-
const s = () => F({});
|
|
40
|
-
return document.addEventListener(y, s), () => document.removeEventListener(y, s);
|
|
41
|
-
}, []), /* @__PURE__ */ T(
|
|
42
|
-
g.div,
|
|
43
|
-
{
|
|
44
|
-
...v,
|
|
45
|
-
ref: W,
|
|
46
|
-
style: {
|
|
47
|
-
pointerEvents: I ? P ? "auto" : "none" : void 0,
|
|
48
|
-
...r.style
|
|
49
|
-
},
|
|
50
|
-
onFocusCapture: m(r.onFocusCapture, D.onFocusCapture),
|
|
51
|
-
onBlurCapture: m(r.onBlurCapture, D.onBlurCapture),
|
|
52
|
-
onPointerDownCapture: m(
|
|
53
|
-
r.onPointerDownCapture,
|
|
54
|
-
_.onPointerDownCapture
|
|
55
|
-
)
|
|
56
|
-
}
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
);
|
|
60
|
-
j.displayName = z;
|
|
61
|
-
var X = "DismissableLayerBranch", Y = n.forwardRef((r, e) => {
|
|
62
|
-
const i = n.useContext(B), o = n.useRef(null), t = R(e, o);
|
|
63
|
-
return n.useEffect(() => {
|
|
64
|
-
const a = o.current;
|
|
65
|
-
if (a)
|
|
66
|
-
return i.branches.add(a), () => {
|
|
67
|
-
i.branches.delete(a);
|
|
68
|
-
};
|
|
69
|
-
}, [i.branches]), /* @__PURE__ */ T(g.div, { ...r, ref: t });
|
|
70
|
-
});
|
|
71
|
-
Y.displayName = X;
|
|
72
|
-
function q(r, e = globalThis == null ? void 0 : globalThis.document) {
|
|
73
|
-
const i = w(r), o = n.useRef(!1), t = n.useRef(() => {
|
|
74
|
-
});
|
|
75
|
-
return n.useEffect(() => {
|
|
76
|
-
const a = (d) => {
|
|
77
|
-
if (d.target && !o.current) {
|
|
78
|
-
let v = function() {
|
|
79
|
-
x(
|
|
80
|
-
H,
|
|
81
|
-
i,
|
|
82
|
-
c,
|
|
83
|
-
{ discrete: !0 }
|
|
84
|
-
);
|
|
85
|
-
};
|
|
86
|
-
const c = { originalEvent: d };
|
|
87
|
-
d.pointerType === "touch" ? (e.removeEventListener("click", t.current), t.current = v, e.addEventListener("click", t.current, { once: !0 })) : v();
|
|
88
|
-
} else
|
|
89
|
-
e.removeEventListener("click", t.current);
|
|
90
|
-
o.current = !1;
|
|
91
|
-
}, l = window.setTimeout(() => {
|
|
92
|
-
e.addEventListener("pointerdown", a);
|
|
93
|
-
}, 0);
|
|
94
|
-
return () => {
|
|
95
|
-
window.clearTimeout(l), e.removeEventListener("pointerdown", a), e.removeEventListener("click", t.current);
|
|
96
|
-
};
|
|
97
|
-
}, [e, i]), {
|
|
98
|
-
// ensures we check React component tree (not just DOM tree)
|
|
99
|
-
onPointerDownCapture: () => o.current = !0
|
|
1
|
+
function h(f, c, { checkForDefaultPrevented: p = !0 } = {}) {
|
|
2
|
+
return function(s) {
|
|
3
|
+
if (f == null || f(s), p === !1 || !s.defaultPrevented)
|
|
4
|
+
return c == null ? void 0 : c(s);
|
|
100
5
|
};
|
|
101
6
|
}
|
|
102
|
-
function G(r, e = globalThis == null ? void 0 : globalThis.document) {
|
|
103
|
-
const i = w(r), o = n.useRef(!1);
|
|
104
|
-
return n.useEffect(() => {
|
|
105
|
-
const t = (a) => {
|
|
106
|
-
a.target && !o.current && x(M, i, { originalEvent: a }, {
|
|
107
|
-
discrete: !1
|
|
108
|
-
});
|
|
109
|
-
};
|
|
110
|
-
return e.addEventListener("focusin", t), () => e.removeEventListener("focusin", t);
|
|
111
|
-
}, [e, i]), {
|
|
112
|
-
onFocusCapture: () => o.current = !0,
|
|
113
|
-
onBlurCapture: () => o.current = !1
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
function O() {
|
|
117
|
-
const r = new CustomEvent(y);
|
|
118
|
-
document.dispatchEvent(r);
|
|
119
|
-
}
|
|
120
|
-
function x(r, e, i, { discrete: o }) {
|
|
121
|
-
const t = i.originalEvent.target, a = new CustomEvent(r, { bubbles: !1, cancelable: !0, detail: i });
|
|
122
|
-
e && t.addEventListener(r, e, { once: !0 }), o ? k(t, a) : t.dispatchEvent(a);
|
|
123
|
-
}
|
|
124
7
|
export {
|
|
125
|
-
|
|
126
|
-
Y as DismissableLayerBranch
|
|
8
|
+
h as composeEventHandlers
|
|
127
9
|
};
|
package/dist/index80.js
CHANGED
|
@@ -1,17 +1,54 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import * as n from "react";
|
|
2
|
+
import { useLayoutEffect as v } from "./index86.js";
|
|
3
|
+
var E = n[" useInsertionEffect ".trim().toString()] || v;
|
|
4
|
+
function y({
|
|
5
|
+
prop: t,
|
|
6
|
+
defaultProp: u,
|
|
7
|
+
onChange: o = () => {
|
|
8
|
+
},
|
|
9
|
+
caller: i
|
|
10
|
+
}) {
|
|
11
|
+
const [l, e, r] = w({
|
|
12
|
+
defaultProp: u,
|
|
13
|
+
onChange: o
|
|
14
|
+
}), c = t !== void 0, a = c ? t : l;
|
|
15
|
+
{
|
|
16
|
+
const s = n.useRef(t !== void 0);
|
|
17
|
+
n.useEffect(() => {
|
|
18
|
+
const f = s.current;
|
|
19
|
+
f !== c && console.warn(
|
|
20
|
+
`${i} is changing from ${f ? "controlled" : "uncontrolled"} to ${c ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
21
|
+
), s.current = c;
|
|
22
|
+
}, [c, i]);
|
|
23
|
+
}
|
|
24
|
+
const m = n.useCallback(
|
|
25
|
+
(s) => {
|
|
26
|
+
var f;
|
|
27
|
+
if (c) {
|
|
28
|
+
const d = R(s) ? s(t) : s;
|
|
29
|
+
d !== t && ((f = r.current) == null || f.call(r, d));
|
|
30
|
+
} else
|
|
31
|
+
e(s);
|
|
32
|
+
},
|
|
33
|
+
[c, t, e, r]
|
|
34
|
+
);
|
|
35
|
+
return [a, m];
|
|
10
36
|
}
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
|
|
37
|
+
function w({
|
|
38
|
+
defaultProp: t,
|
|
39
|
+
onChange: u
|
|
40
|
+
}) {
|
|
41
|
+
const [o, i] = n.useState(t), l = n.useRef(o), e = n.useRef(u);
|
|
42
|
+
return E(() => {
|
|
43
|
+
e.current = u;
|
|
44
|
+
}, [u]), n.useEffect(() => {
|
|
45
|
+
var r;
|
|
46
|
+
l.current !== o && ((r = e.current) == null || r.call(e, o), l.current = o);
|
|
47
|
+
}, [o, l]), [o, i, e];
|
|
48
|
+
}
|
|
49
|
+
function R(t) {
|
|
50
|
+
return typeof t == "function";
|
|
14
51
|
}
|
|
15
52
|
export {
|
|
16
|
-
|
|
53
|
+
y as useControllableState
|
|
17
54
|
};
|
package/dist/index81.js
CHANGED
|
@@ -1,137 +1,36 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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(W(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 P = 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__ */ _(M.div, { tabIndex: -1, ...g, ref: A, onKeyDown: P });
|
|
71
|
-
});
|
|
72
|
-
k.displayName = K;
|
|
73
|
-
function w(e, { select: n = !1 } = {}) {
|
|
74
|
-
const t = document.activeElement;
|
|
75
|
-
for (const u of e)
|
|
76
|
-
if (f(u, { select: n }), document.activeElement !== t) return;
|
|
77
|
-
}
|
|
78
|
-
function x(e) {
|
|
79
|
-
const n = I(e), t = O(n, e), u = O(n.reverse(), e);
|
|
80
|
-
return [t, u];
|
|
81
|
-
}
|
|
82
|
-
function I(e) {
|
|
83
|
-
const n = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
84
|
-
acceptNode: (u) => {
|
|
85
|
-
const p = u.tagName === "INPUT" && u.type === "hidden";
|
|
86
|
-
return u.disabled || u.hidden || p ? NodeFilter.FILTER_SKIP : u.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
87
|
-
}
|
|
1
|
+
import * as f from "react";
|
|
2
|
+
import * as p from "react-dom";
|
|
3
|
+
import { createSlot as c } from "./index89.js";
|
|
4
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
5
|
+
var u = [
|
|
6
|
+
"a",
|
|
7
|
+
"button",
|
|
8
|
+
"div",
|
|
9
|
+
"form",
|
|
10
|
+
"h2",
|
|
11
|
+
"h3",
|
|
12
|
+
"img",
|
|
13
|
+
"input",
|
|
14
|
+
"label",
|
|
15
|
+
"li",
|
|
16
|
+
"nav",
|
|
17
|
+
"ol",
|
|
18
|
+
"p",
|
|
19
|
+
"select",
|
|
20
|
+
"span",
|
|
21
|
+
"svg",
|
|
22
|
+
"ul"
|
|
23
|
+
], h = u.reduce((t, i) => {
|
|
24
|
+
const o = c(`Primitive.${i}`), r = f.forwardRef((e, m) => {
|
|
25
|
+
const { asChild: s, ...a } = e, n = s ? o : i;
|
|
26
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ l(n, { ...a, ref: m });
|
|
88
27
|
});
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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 = V();
|
|
115
|
-
function V() {
|
|
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 W(e) {
|
|
133
|
-
return e.filter((n) => n.tagName !== "A");
|
|
28
|
+
return r.displayName = `Primitive.${i}`, { ...t, [i]: r };
|
|
29
|
+
}, {});
|
|
30
|
+
function w(t, i) {
|
|
31
|
+
t && p.flushSync(() => t.dispatchEvent(i));
|
|
134
32
|
}
|
|
135
33
|
export {
|
|
136
|
-
|
|
34
|
+
h as Primitive,
|
|
35
|
+
w as dispatchDiscreteCustomEvent
|
|
137
36
|
};
|
package/dist/index82.js
CHANGED