@drjoshcsimmons/scl 0.1.12 → 0.1.14
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 +12 -47
- package/dist/index101.js +8 -54
- package/dist/index102.js +30 -11
- package/dist/index103.js +4 -30
- package/dist/index104.js +24 -12
- package/dist/index105.js +6 -30
- package/dist/index107.js +1 -1
- package/dist/index108.js +30 -650
- package/dist/index109.js +1 -1
- package/dist/index11.js +2 -2
- package/dist/index110.js +647 -27
- package/dist/index112.js +14 -8
- package/dist/index113.js +11 -47
- package/dist/index114.js +200 -42
- package/dist/index115.js +21 -20
- package/dist/index116.js +400 -9
- package/dist/index117.js +48 -38
- package/dist/index118.js +48 -18
- package/dist/index119.js +21 -12
- package/dist/index12.js +1 -1
- package/dist/index120.js +9 -206
- package/dist/index121.js +37 -21
- package/dist/index122.js +17 -399
- package/dist/index124.js +1 -1
- package/dist/index126.js +3 -3
- package/dist/index127.js +3 -3
- package/dist/index129.js +1 -1
- package/dist/index13.js +2 -2
- package/dist/index130.js +1 -1
- package/dist/index131.js +5 -2
- package/dist/index132.js +3 -2
- package/dist/index133.js +24 -5
- package/dist/index134.js +113 -3
- package/dist/index135.js +15 -23
- package/dist/index136.js +519 -107
- package/dist/index137.js +126 -14
- package/dist/index138.js +125 -516
- package/dist/index139.js +2 -128
- package/dist/index14.js +2 -2
- package/dist/index140.js +2 -134
- package/dist/index141.js +69 -65
- package/dist/index142.js +8 -68
- package/dist/index143.js +14 -9
- package/dist/index144.js +66 -14
- package/dist/index145.js +64 -65
- package/dist/index15.js +2 -2
- package/dist/index17.js +4 -4
- package/dist/index18.js +2 -2
- package/dist/index20.js +2 -2
- 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 +3 -3
- package/dist/index29.js +1 -1
- package/dist/index31.js +1 -1
- package/dist/index33.js +1 -1
- package/dist/index36.js +2 -2
- package/dist/index37.js +1 -1
- package/dist/index4.js +2 -2
- package/dist/index45.js +33 -237
- package/dist/index46.js +241 -11
- package/dist/index47.js +212 -211
- package/dist/index48.js +4 -4
- package/dist/index49.js +246 -104
- package/dist/index5.js +1 -1
- package/dist/index50.js +12 -33
- package/dist/index51.js +509 -109
- package/dist/index52.js +20 -433
- package/dist/index53.js +158 -57
- package/dist/index54.js +66 -247
- package/dist/index55.js +334 -16
- package/dist/index56.js +236 -31
- package/dist/index57.js +11 -310
- package/dist/index58.js +82 -12
- package/dist/index59.js +221 -232
- package/dist/index6.js +1 -1
- package/dist/index60.js +3 -6
- package/dist/index61.js +112 -143
- package/dist/index62.js +16 -247
- package/dist/index63.js +860 -9
- package/dist/index64.js +9 -241
- package/dist/index65.js +30 -72
- package/dist/index66.js +433 -20
- package/dist/index67.js +53 -75
- package/dist/index68.js +102 -209
- package/dist/index69.js +225 -11
- package/dist/index7.js +1 -1
- package/dist/index70.js +4 -5
- package/dist/index71.js +12 -860
- package/dist/index72.js +125 -9
- package/dist/index73.js +283 -503
- package/dist/index74.js +12 -125
- package/dist/index75.js +241 -323
- package/dist/index76.js +5 -66
- package/dist/index77.js +25 -44
- package/dist/index78.js +64 -23
- package/dist/index79.js +123 -5
- package/dist/index8.js +1 -1
- package/dist/index80.js +13 -50
- package/dist/index81.js +133 -32
- package/dist/index82.js +1 -1
- package/dist/index83.js +218 -7
- package/dist/index84.js +14 -181
- package/dist/index85.js +67 -23
- package/dist/index86.js +33 -5
- package/dist/index87.js +42 -63
- package/dist/index88.js +52 -4
- package/dist/index89.js +50 -4
- package/dist/index9.js +2 -2
- package/dist/index90.js +9 -30
- package/dist/index91.js +45 -14
- package/dist/index92.js +7 -124
- package/dist/index93.js +40 -127
- package/dist/index94.js +30 -14
- package/dist/index95.js +179 -13
- package/dist/index96.js +55 -9
- package/dist/index97.js +11 -50
- package/dist/index98.js +4 -48
- package/dist/index99.js +30 -219
- package/package.json +1 -1
package/dist/index83.js
CHANGED
|
@@ -1,10 +1,221 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import "
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import * as p 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 "./index114.js";
|
|
3
|
+
import { Root as Oe } from "./index115.js";
|
|
4
|
+
import { useComposedRefs as j } from "./index77.js";
|
|
5
|
+
import { createContextScope as Re } from "./index78.js";
|
|
6
|
+
import { Primitive as z } from "./index86.js";
|
|
7
|
+
import { useCallbackRef as Ee } from "./index97.js";
|
|
8
|
+
import { useLayoutEffect as T } from "./index98.js";
|
|
9
|
+
import { useSize as Ne } from "./index104.js";
|
|
10
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
11
|
+
import { autoUpdate as _e } from "./index116.js";
|
|
12
|
+
var N = "Popper", [L, Ue] = Re(N), [$e, Z] = L(N), U = (e) => {
|
|
13
|
+
const { __scopePopper: s, children: a } = e, [t, i] = p.useState(null);
|
|
14
|
+
return /* @__PURE__ */ f($e, { scope: s, anchor: t, onAnchorChange: i, children: a });
|
|
15
|
+
};
|
|
16
|
+
U.displayName = N;
|
|
17
|
+
var q = "PopperAnchor", G = p.forwardRef(
|
|
18
|
+
(e, s) => {
|
|
19
|
+
const { __scopePopper: a, virtualRef: t, ...i } = e, r = Z(q, a), o = p.useRef(null), w = j(s, o), n = p.useRef(null);
|
|
20
|
+
return p.useEffect(() => {
|
|
21
|
+
const c = n.current;
|
|
22
|
+
n.current = (t == null ? void 0 : t.current) || o.current, c !== n.current && r.onAnchorChange(n.current);
|
|
23
|
+
}), t ? null : /* @__PURE__ */ f(z.div, { ...i, ref: w });
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
G.displayName = q;
|
|
27
|
+
var _ = "PopperContent", [He, We] = L(_), J = p.forwardRef(
|
|
28
|
+
(e, s) => {
|
|
29
|
+
var Y, M, X, D, F, k;
|
|
30
|
+
const {
|
|
31
|
+
__scopePopper: a,
|
|
32
|
+
side: t = "bottom",
|
|
33
|
+
sideOffset: i = 0,
|
|
34
|
+
align: r = "center",
|
|
35
|
+
alignOffset: o = 0,
|
|
36
|
+
arrowPadding: w = 0,
|
|
37
|
+
avoidCollisions: n = !0,
|
|
38
|
+
collisionBoundary: c = [],
|
|
39
|
+
collisionPadding: x = 0,
|
|
40
|
+
sticky: m = "partial",
|
|
41
|
+
hideWhenDetached: y = !1,
|
|
42
|
+
updatePositionStrategy: A = "optimized",
|
|
43
|
+
onPlaced: l,
|
|
44
|
+
...d
|
|
45
|
+
} = e, v = Z(_, a), [h, C] = p.useState(null), ee = j(s, (P) => C(P)), [E, te] = p.useState(null), u = Ne(E), re = (u == null ? void 0 : u.width) ?? 0, $ = (u == null ? void 0 : u.height) ?? 0, oe = t + (r !== "center" ? "-" + r : ""), ne = typeof x == "number" ? x : { top: 0, right: 0, bottom: 0, left: 0, ...x }, H = Array.isArray(c) ? c : [c], ae = H.length > 0, b = {
|
|
46
|
+
padding: ne,
|
|
47
|
+
boundary: H.filter(Ye),
|
|
48
|
+
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
49
|
+
altBoundary: ae
|
|
50
|
+
}, { refs: ie, floatingStyles: W, placement: se, isPositioned: S, middlewareData: g } = xe({
|
|
51
|
+
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
52
|
+
strategy: "fixed",
|
|
53
|
+
placement: oe,
|
|
54
|
+
whileElementsMounted: (...P) => _e(...P, {
|
|
55
|
+
animationFrame: A === "always"
|
|
56
|
+
}),
|
|
57
|
+
elements: {
|
|
58
|
+
reference: v.anchor
|
|
59
|
+
},
|
|
60
|
+
middleware: [
|
|
61
|
+
Pe({ mainAxis: i + $, alignmentAxis: o }),
|
|
62
|
+
n && ye({
|
|
63
|
+
mainAxis: !0,
|
|
64
|
+
crossAxis: !1,
|
|
65
|
+
limiter: m === "partial" ? Se() : void 0,
|
|
66
|
+
...b
|
|
67
|
+
}),
|
|
68
|
+
n && Ae({ ...b }),
|
|
69
|
+
ve({
|
|
70
|
+
...b,
|
|
71
|
+
apply: ({ elements: P, rects: B, availableWidth: he, availableHeight: ue }) => {
|
|
72
|
+
const { width: ge, height: we } = B.reference, R = P.floating.style;
|
|
73
|
+
R.setProperty("--radix-popper-available-width", `${he}px`), R.setProperty("--radix-popper-available-height", `${ue}px`), R.setProperty("--radix-popper-anchor-width", `${ge}px`), R.setProperty("--radix-popper-anchor-height", `${we}px`);
|
|
74
|
+
}
|
|
75
|
+
}),
|
|
76
|
+
E && Ce({ element: E, padding: w }),
|
|
77
|
+
Me({ arrowWidth: re, arrowHeight: $ }),
|
|
78
|
+
y && be({ strategy: "referenceHidden", ...b })
|
|
79
|
+
]
|
|
80
|
+
}), [I, ce] = V(se), O = Ee(l);
|
|
81
|
+
T(() => {
|
|
82
|
+
S && (O == null || O());
|
|
83
|
+
}, [S, O]);
|
|
84
|
+
const pe = (Y = g.arrow) == null ? void 0 : Y.x, de = (M = g.arrow) == null ? void 0 : M.y, le = ((X = g.arrow) == null ? void 0 : X.centerOffset) !== 0, [fe, me] = p.useState();
|
|
85
|
+
return T(() => {
|
|
86
|
+
h && me(window.getComputedStyle(h).zIndex);
|
|
87
|
+
}, [h]), /* @__PURE__ */ f(
|
|
88
|
+
"div",
|
|
89
|
+
{
|
|
90
|
+
ref: ie.setFloating,
|
|
91
|
+
"data-radix-popper-content-wrapper": "",
|
|
92
|
+
style: {
|
|
93
|
+
...W,
|
|
94
|
+
transform: S ? W.transform : "translate(0, -200%)",
|
|
95
|
+
// keep off the page when measuring
|
|
96
|
+
minWidth: "max-content",
|
|
97
|
+
zIndex: fe,
|
|
98
|
+
"--radix-popper-transform-origin": [
|
|
99
|
+
(D = g.transformOrigin) == null ? void 0 : D.x,
|
|
100
|
+
(F = g.transformOrigin) == null ? void 0 : F.y
|
|
101
|
+
].join(" "),
|
|
102
|
+
// hide the content if using the hide middleware and should be hidden
|
|
103
|
+
// set visibility to hidden and disable pointer events so the UI behaves
|
|
104
|
+
// as if the PopperContent isn't there at all
|
|
105
|
+
...((k = g.hide) == null ? void 0 : k.referenceHidden) && {
|
|
106
|
+
visibility: "hidden",
|
|
107
|
+
pointerEvents: "none"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
dir: e.dir,
|
|
111
|
+
children: /* @__PURE__ */ f(
|
|
112
|
+
He,
|
|
113
|
+
{
|
|
114
|
+
scope: a,
|
|
115
|
+
placedSide: I,
|
|
116
|
+
onArrowChange: te,
|
|
117
|
+
arrowX: pe,
|
|
118
|
+
arrowY: de,
|
|
119
|
+
shouldHideArrow: le,
|
|
120
|
+
children: /* @__PURE__ */ f(
|
|
121
|
+
z.div,
|
|
122
|
+
{
|
|
123
|
+
"data-side": I,
|
|
124
|
+
"data-align": ce,
|
|
125
|
+
...d,
|
|
126
|
+
ref: ee,
|
|
127
|
+
style: {
|
|
128
|
+
...d.style,
|
|
129
|
+
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
130
|
+
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
131
|
+
animation: S ? void 0 : "none"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
J.displayName = _;
|
|
142
|
+
var K = "PopperArrow", Ie = {
|
|
143
|
+
top: "bottom",
|
|
144
|
+
right: "left",
|
|
145
|
+
bottom: "top",
|
|
146
|
+
left: "right"
|
|
147
|
+
}, Q = p.forwardRef(function(s, a) {
|
|
148
|
+
const { __scopePopper: t, ...i } = s, r = We(K, t), o = Ie[r.placedSide];
|
|
149
|
+
return (
|
|
150
|
+
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
151
|
+
// doesn't report size as we'd expect on SVG elements.
|
|
152
|
+
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
153
|
+
/* @__PURE__ */ f(
|
|
154
|
+
"span",
|
|
155
|
+
{
|
|
156
|
+
ref: r.onArrowChange,
|
|
157
|
+
style: {
|
|
158
|
+
position: "absolute",
|
|
159
|
+
left: r.arrowX,
|
|
160
|
+
top: r.arrowY,
|
|
161
|
+
[o]: 0,
|
|
162
|
+
transformOrigin: {
|
|
163
|
+
top: "",
|
|
164
|
+
right: "0 0",
|
|
165
|
+
bottom: "center 0",
|
|
166
|
+
left: "100% 0"
|
|
167
|
+
}[r.placedSide],
|
|
168
|
+
transform: {
|
|
169
|
+
top: "translateY(100%)",
|
|
170
|
+
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
|
171
|
+
bottom: "rotate(180deg)",
|
|
172
|
+
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
|
173
|
+
}[r.placedSide],
|
|
174
|
+
visibility: r.shouldHideArrow ? "hidden" : void 0
|
|
175
|
+
},
|
|
176
|
+
children: /* @__PURE__ */ f(
|
|
177
|
+
Oe,
|
|
178
|
+
{
|
|
179
|
+
...i,
|
|
180
|
+
ref: a,
|
|
181
|
+
style: {
|
|
182
|
+
...i.style,
|
|
183
|
+
// ensures the element can be measured correctly (mostly for if SVG)
|
|
184
|
+
display: "block"
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
}
|
|
189
|
+
)
|
|
190
|
+
);
|
|
191
|
+
});
|
|
192
|
+
Q.displayName = K;
|
|
193
|
+
function Ye(e) {
|
|
194
|
+
return e !== null;
|
|
195
|
+
}
|
|
196
|
+
var Me = (e) => ({
|
|
197
|
+
name: "transformOrigin",
|
|
198
|
+
options: e,
|
|
199
|
+
fn(s) {
|
|
200
|
+
var v, h, C;
|
|
201
|
+
const { placement: a, rects: t, middlewareData: i } = s, o = ((v = i.arrow) == null ? void 0 : v.centerOffset) !== 0, w = o ? 0 : e.arrowWidth, n = o ? 0 : e.arrowHeight, [c, x] = V(a), m = { start: "0%", center: "50%", end: "100%" }[x], y = (((h = i.arrow) == null ? void 0 : h.x) ?? 0) + w / 2, A = (((C = i.arrow) == null ? void 0 : C.y) ?? 0) + n / 2;
|
|
202
|
+
let l = "", d = "";
|
|
203
|
+
return c === "bottom" ? (l = o ? m : `${y}px`, d = `${-n}px`) : c === "top" ? (l = o ? m : `${y}px`, d = `${t.floating.height + n}px`) : c === "right" ? (l = `${-n}px`, d = o ? m : `${A}px`) : c === "left" && (l = `${t.floating.width + n}px`, d = o ? m : `${A}px`), { data: { x: l, y: d } };
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
function V(e) {
|
|
207
|
+
const [s, a = "center"] = e.split("-");
|
|
208
|
+
return [s, a];
|
|
7
209
|
}
|
|
210
|
+
var qe = U, Ge = G, Je = J, Ke = Q;
|
|
8
211
|
export {
|
|
9
|
-
|
|
212
|
+
Ge as Anchor,
|
|
213
|
+
Ke as Arrow,
|
|
214
|
+
Je as Content,
|
|
215
|
+
U as Popper,
|
|
216
|
+
G as PopperAnchor,
|
|
217
|
+
Q as PopperArrow,
|
|
218
|
+
J as PopperContent,
|
|
219
|
+
qe as Root,
|
|
220
|
+
Ue as createPopperScope
|
|
10
221
|
};
|
package/dist/index84.js
CHANGED
|
@@ -1,183 +1,16 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
[Z]
|
|
15
|
-
), [ee, oe] = $(I), O = c.forwardRef(
|
|
16
|
-
(e, r) => /* @__PURE__ */ d(D.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d(D.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d(te, { ...e, ref: r }) }) })
|
|
17
|
-
);
|
|
18
|
-
O.displayName = I;
|
|
19
|
-
var te = c.forwardRef((e, r) => {
|
|
20
|
-
const {
|
|
21
|
-
__scopeRovingFocusGroup: s,
|
|
22
|
-
orientation: o,
|
|
23
|
-
loop: T = !1,
|
|
24
|
-
dir: w,
|
|
25
|
-
currentTabStopId: v,
|
|
26
|
-
defaultCurrentTabStopId: C,
|
|
27
|
-
onCurrentTabStopIdChange: S,
|
|
28
|
-
onEntryFocus: m,
|
|
29
|
-
preventScrollOnEntryFocus: u = !1,
|
|
30
|
-
...b
|
|
31
|
-
} = e, F = c.useRef(null), g = j(r, F), R = W(w), [E, t] = Q({
|
|
32
|
-
prop: v,
|
|
33
|
-
defaultProp: C ?? null,
|
|
34
|
-
onChange: S,
|
|
35
|
-
caller: I
|
|
36
|
-
}), [i, h] = c.useState(!1), a = J(m), l = N(s), A = c.useRef(!1), [L, P] = c.useState(0);
|
|
37
|
-
return c.useEffect(() => {
|
|
38
|
-
const n = F.current;
|
|
39
|
-
if (n)
|
|
40
|
-
return n.addEventListener(y, a), () => n.removeEventListener(y, a);
|
|
41
|
-
}, [a]), /* @__PURE__ */ d(
|
|
42
|
-
ee,
|
|
43
|
-
{
|
|
44
|
-
scope: s,
|
|
45
|
-
orientation: o,
|
|
46
|
-
dir: R,
|
|
47
|
-
loop: T,
|
|
48
|
-
currentTabStopId: E,
|
|
49
|
-
onItemFocus: c.useCallback(
|
|
50
|
-
(n) => t(n),
|
|
51
|
-
[t]
|
|
52
|
-
),
|
|
53
|
-
onItemShiftTab: c.useCallback(() => h(!0), []),
|
|
54
|
-
onFocusableItemAdd: c.useCallback(
|
|
55
|
-
() => P((n) => n + 1),
|
|
56
|
-
[]
|
|
57
|
-
),
|
|
58
|
-
onFocusableItemRemove: c.useCallback(
|
|
59
|
-
() => P((n) => n - 1),
|
|
60
|
-
[]
|
|
61
|
-
),
|
|
62
|
-
children: /* @__PURE__ */ d(
|
|
63
|
-
G.div,
|
|
64
|
-
{
|
|
65
|
-
tabIndex: i || L === 0 ? -1 : 0,
|
|
66
|
-
"data-orientation": o,
|
|
67
|
-
...b,
|
|
68
|
-
ref: g,
|
|
69
|
-
style: { outline: "none", ...e.style },
|
|
70
|
-
onMouseDown: p(e.onMouseDown, () => {
|
|
71
|
-
A.current = !0;
|
|
72
|
-
}),
|
|
73
|
-
onFocus: p(e.onFocus, (n) => {
|
|
74
|
-
const U = !A.current;
|
|
75
|
-
if (n.target === n.currentTarget && U && !i) {
|
|
76
|
-
const x = new CustomEvent(y, X);
|
|
77
|
-
if (n.currentTarget.dispatchEvent(x), !x.defaultPrevented) {
|
|
78
|
-
const _ = l().filter((f) => f.focusable), B = _.find((f) => f.active), Y = _.find((f) => f.id === E), H = [B, Y, ..._].filter(
|
|
79
|
-
Boolean
|
|
80
|
-
).map((f) => f.ref.current);
|
|
81
|
-
k(H, u);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
A.current = !1;
|
|
85
|
-
}),
|
|
86
|
-
onBlur: p(e.onBlur, () => h(!1))
|
|
87
|
-
}
|
|
88
|
-
)
|
|
89
|
-
}
|
|
90
|
-
);
|
|
91
|
-
}), K = "RovingFocusGroupItem", M = c.forwardRef(
|
|
92
|
-
(e, r) => {
|
|
93
|
-
const {
|
|
94
|
-
__scopeRovingFocusGroup: s,
|
|
95
|
-
focusable: o = !0,
|
|
96
|
-
active: T = !1,
|
|
97
|
-
tabStopId: w,
|
|
98
|
-
children: v,
|
|
99
|
-
...C
|
|
100
|
-
} = e, S = q(), m = w || S, u = oe(K, s), b = u.currentTabStopId === m, F = N(s), { onFocusableItemAdd: g, onFocusableItemRemove: R, currentTabStopId: E } = u;
|
|
101
|
-
return c.useEffect(() => {
|
|
102
|
-
if (o)
|
|
103
|
-
return g(), () => R();
|
|
104
|
-
}, [o, g, R]), /* @__PURE__ */ d(
|
|
105
|
-
D.ItemSlot,
|
|
106
|
-
{
|
|
107
|
-
scope: s,
|
|
108
|
-
id: m,
|
|
109
|
-
focusable: o,
|
|
110
|
-
active: T,
|
|
111
|
-
children: /* @__PURE__ */ d(
|
|
112
|
-
G.span,
|
|
113
|
-
{
|
|
114
|
-
tabIndex: b ? 0 : -1,
|
|
115
|
-
"data-orientation": u.orientation,
|
|
116
|
-
...C,
|
|
117
|
-
ref: r,
|
|
118
|
-
onMouseDown: p(e.onMouseDown, (t) => {
|
|
119
|
-
o ? u.onItemFocus(m) : t.preventDefault();
|
|
120
|
-
}),
|
|
121
|
-
onFocus: p(e.onFocus, () => u.onItemFocus(m)),
|
|
122
|
-
onKeyDown: p(e.onKeyDown, (t) => {
|
|
123
|
-
if (t.key === "Tab" && t.shiftKey) {
|
|
124
|
-
u.onItemShiftTab();
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
if (t.target !== t.currentTarget) return;
|
|
128
|
-
const i = ce(t, u.orientation, u.dir);
|
|
129
|
-
if (i !== void 0) {
|
|
130
|
-
if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey) return;
|
|
131
|
-
t.preventDefault();
|
|
132
|
-
let a = F().filter((l) => l.focusable).map((l) => l.ref.current);
|
|
133
|
-
if (i === "last") a.reverse();
|
|
134
|
-
else if (i === "prev" || i === "next") {
|
|
135
|
-
i === "prev" && a.reverse();
|
|
136
|
-
const l = a.indexOf(t.currentTarget);
|
|
137
|
-
a = u.loop ? se(a, l + 1) : a.slice(l + 1);
|
|
138
|
-
}
|
|
139
|
-
setTimeout(() => k(a));
|
|
140
|
-
}
|
|
141
|
-
}),
|
|
142
|
-
children: typeof v == "function" ? v({ isCurrentTabStop: b, hasTabStop: E != null }) : v
|
|
143
|
-
}
|
|
144
|
-
)
|
|
145
|
-
}
|
|
146
|
-
);
|
|
147
|
-
}
|
|
148
|
-
);
|
|
149
|
-
M.displayName = K;
|
|
150
|
-
var re = {
|
|
151
|
-
ArrowLeft: "prev",
|
|
152
|
-
ArrowUp: "prev",
|
|
153
|
-
ArrowRight: "next",
|
|
154
|
-
ArrowDown: "next",
|
|
155
|
-
PageUp: "first",
|
|
156
|
-
Home: "first",
|
|
157
|
-
PageDown: "last",
|
|
158
|
-
End: "last"
|
|
159
|
-
};
|
|
160
|
-
function ne(e, r) {
|
|
161
|
-
return r !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
|
|
162
|
-
}
|
|
163
|
-
function ce(e, r, s) {
|
|
164
|
-
const o = ne(e.key, s);
|
|
165
|
-
if (!(r === "vertical" && ["ArrowLeft", "ArrowRight"].includes(o)) && !(r === "horizontal" && ["ArrowUp", "ArrowDown"].includes(o)))
|
|
166
|
-
return re[o];
|
|
167
|
-
}
|
|
168
|
-
function k(e, r = !1) {
|
|
169
|
-
const s = document.activeElement;
|
|
170
|
-
for (const o of e)
|
|
171
|
-
if (o === s || (o.focus({ preventScroll: r }), document.activeElement !== s)) return;
|
|
172
|
-
}
|
|
173
|
-
function se(e, r) {
|
|
174
|
-
return e.map((s, o) => e[(r + o) % e.length]);
|
|
175
|
-
}
|
|
176
|
-
var ge = O, Re = M;
|
|
1
|
+
import * as r from "react";
|
|
2
|
+
import s from "react-dom";
|
|
3
|
+
import { Primitive as c } from "./index86.js";
|
|
4
|
+
import { useLayoutEffect as u } from "./index98.js";
|
|
5
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
6
|
+
var p = "Portal", d = r.forwardRef((e, a) => {
|
|
7
|
+
var o;
|
|
8
|
+
const { container: f, ...i } = e, [m, n] = r.useState(!1);
|
|
9
|
+
u(() => n(!0), []);
|
|
10
|
+
const t = f || m && ((o = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : o.body);
|
|
11
|
+
return t ? s.createPortal(/* @__PURE__ */ l(c.div, { ...i, ref: a }), t) : null;
|
|
12
|
+
});
|
|
13
|
+
d.displayName = p;
|
|
177
14
|
export {
|
|
178
|
-
|
|
179
|
-
ge as Root,
|
|
180
|
-
O as RovingFocusGroup,
|
|
181
|
-
M as RovingFocusGroupItem,
|
|
182
|
-
Fe as createRovingFocusGroupScope
|
|
15
|
+
d as Portal
|
|
183
16
|
};
|
package/dist/index85.js
CHANGED
|
@@ -1,27 +1,71 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import * as a from "react";
|
|
2
|
+
import { useComposedRefs as E } from "./index77.js";
|
|
3
|
+
import { useLayoutEffect as A } from "./index98.js";
|
|
4
|
+
function T(n, e) {
|
|
5
|
+
return a.useReducer((r, t) => e[r][t] ?? r, n);
|
|
6
|
+
}
|
|
7
|
+
var R = (n) => {
|
|
8
|
+
const { present: e, children: r } = n, t = v(e), i = typeof r == "function" ? r({ present: t.isPresent }) : a.Children.only(r), c = E(t.ref, P(i));
|
|
9
|
+
return typeof r == "function" || t.isPresent ? a.cloneElement(i, { ref: c }) : null;
|
|
10
|
+
};
|
|
11
|
+
R.displayName = "Presence";
|
|
12
|
+
function v(n) {
|
|
13
|
+
const [e, r] = a.useState(), t = a.useRef(null), i = a.useRef(n), c = a.useRef("none"), p = n ? "mounted" : "unmounted", [N, s] = T(p, {
|
|
14
|
+
mounted: {
|
|
15
|
+
UNMOUNT: "unmounted",
|
|
16
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
17
|
+
},
|
|
18
|
+
unmountSuspended: {
|
|
19
|
+
MOUNT: "mounted",
|
|
20
|
+
ANIMATION_END: "unmounted"
|
|
21
|
+
},
|
|
22
|
+
unmounted: {
|
|
23
|
+
MOUNT: "mounted"
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return a.useEffect(() => {
|
|
27
|
+
const o = l(t.current);
|
|
28
|
+
c.current = N === "mounted" ? o : "none";
|
|
29
|
+
}, [N]), A(() => {
|
|
30
|
+
const o = t.current, m = i.current;
|
|
31
|
+
if (m !== n) {
|
|
32
|
+
const f = c.current, u = l(o);
|
|
33
|
+
n ? s("MOUNT") : u === "none" || (o == null ? void 0 : o.display) === "none" ? s("UNMOUNT") : s(m && f !== u ? "ANIMATION_OUT" : "UNMOUNT"), i.current = n;
|
|
34
|
+
}
|
|
35
|
+
}, [n, s]), A(() => {
|
|
36
|
+
if (e) {
|
|
37
|
+
let o;
|
|
38
|
+
const m = e.ownerDocument.defaultView ?? window, d = (u) => {
|
|
39
|
+
const g = l(t.current).includes(CSS.escape(u.animationName));
|
|
40
|
+
if (u.target === e && g && (s("ANIMATION_END"), !i.current)) {
|
|
41
|
+
const O = e.style.animationFillMode;
|
|
42
|
+
e.style.animationFillMode = "forwards", o = m.setTimeout(() => {
|
|
43
|
+
e.style.animationFillMode === "forwards" && (e.style.animationFillMode = O);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}, f = (u) => {
|
|
47
|
+
u.target === e && (c.current = l(t.current));
|
|
48
|
+
};
|
|
49
|
+
return e.addEventListener("animationstart", f), e.addEventListener("animationcancel", d), e.addEventListener("animationend", d), () => {
|
|
50
|
+
m.clearTimeout(o), e.removeEventListener("animationstart", f), e.removeEventListener("animationcancel", d), e.removeEventListener("animationend", d);
|
|
51
|
+
};
|
|
21
52
|
} else
|
|
22
|
-
|
|
23
|
-
}, [
|
|
53
|
+
s("ANIMATION_END");
|
|
54
|
+
}, [e, s]), {
|
|
55
|
+
isPresent: ["mounted", "unmountSuspended"].includes(N),
|
|
56
|
+
ref: a.useCallback((o) => {
|
|
57
|
+
t.current = o ? getComputedStyle(o) : null, r(o);
|
|
58
|
+
}, [])
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function l(n) {
|
|
62
|
+
return (n == null ? void 0 : n.animationName) || "none";
|
|
63
|
+
}
|
|
64
|
+
function P(n) {
|
|
65
|
+
var t, i;
|
|
66
|
+
let e = (t = Object.getOwnPropertyDescriptor(n.props, "ref")) == null ? void 0 : t.get, r = e && "isReactWarning" in e && e.isReactWarning;
|
|
67
|
+
return r ? n.ref : (e = (i = Object.getOwnPropertyDescriptor(n, "ref")) == null ? void 0 : i.get, r = e && "isReactWarning" in e && e.isReactWarning, r ? n.props.ref : n.props.ref || n.ref);
|
|
24
68
|
}
|
|
25
69
|
export {
|
|
26
|
-
|
|
70
|
+
R as Presence
|
|
27
71
|
};
|
package/dist/index86.js
CHANGED
|
@@ -1,8 +1,36 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import * as f from "react";
|
|
2
|
+
import * as p from "react-dom";
|
|
3
|
+
import { createSlot as c } from "./index117.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 });
|
|
27
|
+
});
|
|
28
|
+
return r.displayName = `Primitive.${i}`, { ...t, [i]: r };
|
|
29
|
+
}, {});
|
|
30
|
+
function w(t, i) {
|
|
31
|
+
t && p.flushSync(() => t.dispatchEvent(i));
|
|
5
32
|
}
|
|
6
33
|
export {
|
|
7
|
-
|
|
34
|
+
h as Primitive,
|
|
35
|
+
w as dispatchDiscreteCustomEvent
|
|
8
36
|
};
|