@drjoshcsimmons/scl 0.1.12 → 0.1.13
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 +29 -47
- package/dist/index101.js +10 -52
- package/dist/index102.js +54 -10
- package/dist/index103.js +1 -1
- package/dist/index104.js +3 -12
- package/dist/index105.js +219 -30
- package/dist/index106.js +44 -51
- package/dist/index107.js +30 -30
- package/dist/index108.js +30 -650
- package/dist/index11.js +2 -2
- package/dist/index110.js +9 -30
- package/dist/index111.js +180 -8
- package/dist/index112.js +30 -9
- package/dist/index115.js +12 -21
- package/dist/index116.js +48 -9
- package/dist/index117.js +6 -38
- package/dist/index118.js +206 -18
- package/dist/index119.js +22 -12
- package/dist/index12.js +1 -1
- package/dist/index120.js +388 -194
- package/dist/index121.js +20 -21
- package/dist/index122.js +9 -400
- package/dist/index123.js +38 -6
- package/dist/index124.js +18 -48
- package/dist/index13.js +2 -2
- package/dist/index14.js +2 -2
- 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 +3 -3
- 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/index45.js +1 -1
- package/dist/index46.js +1 -1
- package/dist/index47.js +33 -236
- package/dist/index48.js +260 -11
- package/dist/index49.js +12 -118
- package/dist/index5.js +1 -1
- package/dist/index50.js +308 -31
- package/dist/index51.js +12 -130
- package/dist/index52.js +216 -402
- package/dist/index53.js +9 -60
- package/dist/index54.js +219 -248
- package/dist/index55.js +11 -18
- package/dist/index56.js +11 -31
- package/dist/index57.js +118 -303
- package/dist/index58.js +73 -12
- package/dist/index59.js +71 -249
- package/dist/index6.js +1 -1
- package/dist/index60.js +860 -12
- package/dist/index61.js +9 -161
- package/dist/index62.js +103 -234
- package/dist/index63.js +18 -9
- package/dist/index64.js +57 -238
- package/dist/index65.js +228 -60
- package/dist/index66.js +433 -20
- package/dist/index67.js +320 -66
- package/dist/index68.js +148 -212
- package/dist/index69.js +31 -11
- package/dist/index7.js +1 -1
- package/dist/index70.js +236 -12
- package/dist/index71.js +105 -835
- package/dist/index72.js +6 -3
- package/dist/index73.js +242 -518
- package/dist/index74.js +517 -112
- package/dist/index75.js +18 -332
- package/dist/index8.js +1 -1
- package/dist/index80.js +1 -1
- package/dist/index82.js +1 -1
- package/dist/index84.js +114 -170
- package/dist/index85.js +134 -24
- package/dist/index86.js +14 -6
- package/dist/index87.js +1 -1
- package/dist/index88.js +15 -4
- package/dist/index89.js +9 -4
- package/dist/index9.js +2 -2
- package/dist/index90.js +49 -29
- package/dist/index91.js +45 -12
- package/dist/index92.js +5 -124
- package/dist/index93.js +24 -134
- package/dist/index94.js +15 -14
- package/dist/index95.js +646 -11
- package/dist/index96.js +9 -9
- package/dist/index97.js +53 -48
- package/dist/index98.js +10 -47
- package/dist/index99.js +3 -218
- package/package.json +1 -1
package/dist/index75.js
CHANGED
|
@@ -1,338 +1,24 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { Portal as ee } from "./index94.js";
|
|
9
|
-
import { Presence as G } from "./index87.js";
|
|
10
|
-
import { Primitive as te } from "./index81.js";
|
|
11
|
-
import { createSlottable as oe } from "./index112.js";
|
|
12
|
-
import { useControllableState as re } from "./index80.js";
|
|
13
|
-
import { Root as ne } from "./index110.js";
|
|
14
|
-
import { jsx as f, jsxs as se } from "react/jsx-runtime";
|
|
15
|
-
var [D] = K("Tooltip", [
|
|
16
|
-
S
|
|
17
|
-
]), O = S(), j = "TooltipProvider", ie = 700, L = "tooltip.open", [ae, k] = D(j), F = (t) => {
|
|
18
|
-
const {
|
|
19
|
-
__scopeTooltip: o,
|
|
20
|
-
delayDuration: e = ie,
|
|
21
|
-
skipDelayDuration: r = 300,
|
|
22
|
-
disableHoverableContent: n = !1,
|
|
23
|
-
children: a
|
|
24
|
-
} = t, l = s.useRef(!0), v = s.useRef(!1), i = s.useRef(0);
|
|
25
|
-
return s.useEffect(() => {
|
|
26
|
-
const p = i.current;
|
|
27
|
-
return () => window.clearTimeout(p);
|
|
28
|
-
}, []), /* @__PURE__ */ f(
|
|
29
|
-
ae,
|
|
1
|
+
import * as p from "react";
|
|
2
|
+
import { Primitive as v } from "./index112.js";
|
|
3
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
4
|
+
var d = "Separator", a = "horizontal", l = ["horizontal", "vertical"], i = p.forwardRef((r, n) => {
|
|
5
|
+
const { decorative: e, orientation: t = a, ...s } = r, o = f(t) ? t : a, c = e ? { role: "none" } : { "aria-orientation": o === "vertical" ? o : void 0, role: "separator" };
|
|
6
|
+
return /* @__PURE__ */ m(
|
|
7
|
+
v.div,
|
|
30
8
|
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
window.clearTimeout(i.current), l.current = !1;
|
|
36
|
-
}, []),
|
|
37
|
-
onClose: s.useCallback(() => {
|
|
38
|
-
window.clearTimeout(i.current), i.current = window.setTimeout(
|
|
39
|
-
() => l.current = !0,
|
|
40
|
-
r
|
|
41
|
-
);
|
|
42
|
-
}, [r]),
|
|
43
|
-
isPointerInTransitRef: v,
|
|
44
|
-
onPointerInTransitChange: s.useCallback((p) => {
|
|
45
|
-
v.current = p;
|
|
46
|
-
}, []),
|
|
47
|
-
disableHoverableContent: n,
|
|
48
|
-
children: a
|
|
9
|
+
"data-orientation": o,
|
|
10
|
+
...c,
|
|
11
|
+
...s,
|
|
12
|
+
ref: n
|
|
49
13
|
}
|
|
50
14
|
);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
__scopeTooltip: o,
|
|
56
|
-
children: e,
|
|
57
|
-
open: r,
|
|
58
|
-
defaultOpen: n,
|
|
59
|
-
onOpenChange: a,
|
|
60
|
-
disableHoverableContent: l,
|
|
61
|
-
delayDuration: v
|
|
62
|
-
} = t, i = k(R, t.__scopeTooltip), p = O(o), [c, d] = s.useState(null), h = $(), u = s.useRef(0), m = l ?? i.disableHoverableContent, y = v ?? i.delayDuration, T = s.useRef(!1), [x, C] = re({
|
|
63
|
-
prop: r,
|
|
64
|
-
defaultProp: n ?? !1,
|
|
65
|
-
onChange: (H) => {
|
|
66
|
-
H ? (i.onOpen(), document.dispatchEvent(new CustomEvent(L))) : i.onClose(), a == null || a(H);
|
|
67
|
-
},
|
|
68
|
-
caller: R
|
|
69
|
-
}), w = s.useMemo(() => x ? T.current ? "delayed-open" : "instant-open" : "closed", [x]), P = s.useCallback(() => {
|
|
70
|
-
window.clearTimeout(u.current), u.current = 0, T.current = !1, C(!0);
|
|
71
|
-
}, [C]), E = s.useCallback(() => {
|
|
72
|
-
window.clearTimeout(u.current), u.current = 0, C(!1);
|
|
73
|
-
}, [C]), I = s.useCallback(() => {
|
|
74
|
-
window.clearTimeout(u.current), u.current = window.setTimeout(() => {
|
|
75
|
-
T.current = !0, C(!0), u.current = 0;
|
|
76
|
-
}, y);
|
|
77
|
-
}, [y, C]);
|
|
78
|
-
return s.useEffect(() => () => {
|
|
79
|
-
u.current && (window.clearTimeout(u.current), u.current = 0);
|
|
80
|
-
}, []), /* @__PURE__ */ f(z, { ...p, children: /* @__PURE__ */ f(
|
|
81
|
-
le,
|
|
82
|
-
{
|
|
83
|
-
scope: o,
|
|
84
|
-
contentId: h,
|
|
85
|
-
open: x,
|
|
86
|
-
stateAttribute: w,
|
|
87
|
-
trigger: c,
|
|
88
|
-
onTriggerChange: d,
|
|
89
|
-
onTriggerEnter: s.useCallback(() => {
|
|
90
|
-
i.isOpenDelayedRef.current ? I() : P();
|
|
91
|
-
}, [i.isOpenDelayedRef, I, P]),
|
|
92
|
-
onTriggerLeave: s.useCallback(() => {
|
|
93
|
-
m ? E() : (window.clearTimeout(u.current), u.current = 0);
|
|
94
|
-
}, [E, m]),
|
|
95
|
-
onOpen: P,
|
|
96
|
-
onClose: E,
|
|
97
|
-
disableHoverableContent: m,
|
|
98
|
-
children: e
|
|
99
|
-
}
|
|
100
|
-
) });
|
|
101
|
-
};
|
|
102
|
-
B.displayName = R;
|
|
103
|
-
var A = "TooltipTrigger", U = s.forwardRef(
|
|
104
|
-
(t, o) => {
|
|
105
|
-
const { __scopeTooltip: e, ...r } = t, n = _(A, e), a = k(A, e), l = O(e), v = s.useRef(null), i = N(o, v, n.onTriggerChange), p = s.useRef(!1), c = s.useRef(!1), d = s.useCallback(() => p.current = !1, []);
|
|
106
|
-
return s.useEffect(() => () => document.removeEventListener("pointerup", d), [d]), /* @__PURE__ */ f(J, { asChild: !0, ...l, children: /* @__PURE__ */ f(
|
|
107
|
-
te.button,
|
|
108
|
-
{
|
|
109
|
-
"aria-describedby": n.open ? n.contentId : void 0,
|
|
110
|
-
"data-state": n.stateAttribute,
|
|
111
|
-
...r,
|
|
112
|
-
ref: i,
|
|
113
|
-
onPointerMove: g(t.onPointerMove, (h) => {
|
|
114
|
-
h.pointerType !== "touch" && !c.current && !a.isPointerInTransitRef.current && (n.onTriggerEnter(), c.current = !0);
|
|
115
|
-
}),
|
|
116
|
-
onPointerLeave: g(t.onPointerLeave, () => {
|
|
117
|
-
n.onTriggerLeave(), c.current = !1;
|
|
118
|
-
}),
|
|
119
|
-
onPointerDown: g(t.onPointerDown, () => {
|
|
120
|
-
n.open && n.onClose(), p.current = !0, document.addEventListener("pointerup", d, { once: !0 });
|
|
121
|
-
}),
|
|
122
|
-
onFocus: g(t.onFocus, () => {
|
|
123
|
-
p.current || n.onOpen();
|
|
124
|
-
}),
|
|
125
|
-
onBlur: g(t.onBlur, n.onClose),
|
|
126
|
-
onClick: g(t.onClick, n.onClose)
|
|
127
|
-
}
|
|
128
|
-
) });
|
|
129
|
-
}
|
|
130
|
-
);
|
|
131
|
-
U.displayName = A;
|
|
132
|
-
var M = "TooltipPortal", [ce, ue] = D(M, {
|
|
133
|
-
forceMount: void 0
|
|
134
|
-
}), V = (t) => {
|
|
135
|
-
const { __scopeTooltip: o, forceMount: e, children: r, container: n } = t, a = _(M, o);
|
|
136
|
-
return /* @__PURE__ */ f(ce, { scope: o, forceMount: e, children: /* @__PURE__ */ f(G, { present: e || a.open, children: /* @__PURE__ */ f(ee, { asChild: !0, container: n, children: r }) }) });
|
|
137
|
-
};
|
|
138
|
-
V.displayName = M;
|
|
139
|
-
var b = "TooltipContent", Y = s.forwardRef(
|
|
140
|
-
(t, o) => {
|
|
141
|
-
const e = ue(b, t.__scopeTooltip), { forceMount: r = e.forceMount, side: n = "top", ...a } = t, l = _(b, t.__scopeTooltip);
|
|
142
|
-
return /* @__PURE__ */ f(G, { present: r || l.open, children: l.disableHoverableContent ? /* @__PURE__ */ f(q, { side: n, ...a, ref: o }) : /* @__PURE__ */ f(pe, { side: n, ...a, ref: o }) });
|
|
143
|
-
}
|
|
144
|
-
), pe = s.forwardRef((t, o) => {
|
|
145
|
-
const e = _(b, t.__scopeTooltip), r = k(b, t.__scopeTooltip), n = s.useRef(null), a = N(o, n), [l, v] = s.useState(null), { trigger: i, onClose: p } = e, c = n.current, { onPointerInTransitChange: d } = r, h = s.useCallback(() => {
|
|
146
|
-
v(null), d(!1);
|
|
147
|
-
}, [d]), u = s.useCallback(
|
|
148
|
-
(m, y) => {
|
|
149
|
-
const T = m.currentTarget, x = { x: m.clientX, y: m.clientY }, C = me(x, T.getBoundingClientRect()), w = Te(x, C), P = ye(y.getBoundingClientRect()), E = xe([...w, ...P]);
|
|
150
|
-
v(E), d(!0);
|
|
151
|
-
},
|
|
152
|
-
[d]
|
|
153
|
-
);
|
|
154
|
-
return s.useEffect(() => () => h(), [h]), s.useEffect(() => {
|
|
155
|
-
if (i && c) {
|
|
156
|
-
const m = (T) => u(T, c), y = (T) => u(T, i);
|
|
157
|
-
return i.addEventListener("pointerleave", m), c.addEventListener("pointerleave", y), () => {
|
|
158
|
-
i.removeEventListener("pointerleave", m), c.removeEventListener("pointerleave", y);
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
}, [i, c, u, h]), s.useEffect(() => {
|
|
162
|
-
if (l) {
|
|
163
|
-
const m = (y) => {
|
|
164
|
-
const T = y.target, x = { x: y.clientX, y: y.clientY }, C = (i == null ? void 0 : i.contains(T)) || (c == null ? void 0 : c.contains(T)), w = !Ce(x, l);
|
|
165
|
-
C ? h() : w && (h(), p());
|
|
166
|
-
};
|
|
167
|
-
return document.addEventListener("pointermove", m), () => document.removeEventListener("pointermove", m);
|
|
168
|
-
}
|
|
169
|
-
}, [i, c, l, p, h]), /* @__PURE__ */ f(q, { ...t, ref: a });
|
|
170
|
-
}), [de, fe] = D(R, { isInside: !1 }), ve = oe("TooltipContent"), q = s.forwardRef(
|
|
171
|
-
(t, o) => {
|
|
172
|
-
const {
|
|
173
|
-
__scopeTooltip: e,
|
|
174
|
-
children: r,
|
|
175
|
-
"aria-label": n,
|
|
176
|
-
onEscapeKeyDown: a,
|
|
177
|
-
onPointerDownOutside: l,
|
|
178
|
-
...v
|
|
179
|
-
} = t, i = _(b, e), p = O(e), { onClose: c } = i;
|
|
180
|
-
return s.useEffect(() => (document.addEventListener(L, c), () => document.removeEventListener(L, c)), [c]), s.useEffect(() => {
|
|
181
|
-
if (i.trigger) {
|
|
182
|
-
const d = (h) => {
|
|
183
|
-
const u = h.target;
|
|
184
|
-
u != null && u.contains(i.trigger) && c();
|
|
185
|
-
};
|
|
186
|
-
return window.addEventListener("scroll", d, { capture: !0 }), () => window.removeEventListener("scroll", d, { capture: !0 });
|
|
187
|
-
}
|
|
188
|
-
}, [i.trigger, c]), /* @__PURE__ */ f(
|
|
189
|
-
W,
|
|
190
|
-
{
|
|
191
|
-
asChild: !0,
|
|
192
|
-
disableOutsidePointerEvents: !1,
|
|
193
|
-
onEscapeKeyDown: a,
|
|
194
|
-
onPointerDownOutside: l,
|
|
195
|
-
onFocusOutside: (d) => d.preventDefault(),
|
|
196
|
-
onDismiss: c,
|
|
197
|
-
children: /* @__PURE__ */ se(
|
|
198
|
-
Q,
|
|
199
|
-
{
|
|
200
|
-
"data-state": i.stateAttribute,
|
|
201
|
-
...p,
|
|
202
|
-
...v,
|
|
203
|
-
ref: o,
|
|
204
|
-
style: {
|
|
205
|
-
...v.style,
|
|
206
|
-
"--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
207
|
-
"--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
|
|
208
|
-
"--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
|
|
209
|
-
"--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
|
|
210
|
-
"--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
|
|
211
|
-
},
|
|
212
|
-
children: [
|
|
213
|
-
/* @__PURE__ */ f(ve, { children: r }),
|
|
214
|
-
/* @__PURE__ */ f(de, { scope: e, isInside: !0, children: /* @__PURE__ */ f(ne, { id: i.contentId, role: "tooltip", children: n || r }) })
|
|
215
|
-
]
|
|
216
|
-
}
|
|
217
|
-
)
|
|
218
|
-
}
|
|
219
|
-
);
|
|
220
|
-
}
|
|
221
|
-
);
|
|
222
|
-
Y.displayName = b;
|
|
223
|
-
var X = "TooltipArrow", he = s.forwardRef(
|
|
224
|
-
(t, o) => {
|
|
225
|
-
const { __scopeTooltip: e, ...r } = t, n = O(e);
|
|
226
|
-
return fe(
|
|
227
|
-
X,
|
|
228
|
-
e
|
|
229
|
-
).isInside ? null : /* @__PURE__ */ f(Z, { ...n, ...r, ref: o });
|
|
230
|
-
}
|
|
231
|
-
);
|
|
232
|
-
he.displayName = X;
|
|
233
|
-
function me(t, o) {
|
|
234
|
-
const e = Math.abs(o.top - t.y), r = Math.abs(o.bottom - t.y), n = Math.abs(o.right - t.x), a = Math.abs(o.left - t.x);
|
|
235
|
-
switch (Math.min(e, r, n, a)) {
|
|
236
|
-
case a:
|
|
237
|
-
return "left";
|
|
238
|
-
case n:
|
|
239
|
-
return "right";
|
|
240
|
-
case e:
|
|
241
|
-
return "top";
|
|
242
|
-
case r:
|
|
243
|
-
return "bottom";
|
|
244
|
-
default:
|
|
245
|
-
throw new Error("unreachable");
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
function Te(t, o, e = 5) {
|
|
249
|
-
const r = [];
|
|
250
|
-
switch (o) {
|
|
251
|
-
case "top":
|
|
252
|
-
r.push(
|
|
253
|
-
{ x: t.x - e, y: t.y + e },
|
|
254
|
-
{ x: t.x + e, y: t.y + e }
|
|
255
|
-
);
|
|
256
|
-
break;
|
|
257
|
-
case "bottom":
|
|
258
|
-
r.push(
|
|
259
|
-
{ x: t.x - e, y: t.y - e },
|
|
260
|
-
{ x: t.x + e, y: t.y - e }
|
|
261
|
-
);
|
|
262
|
-
break;
|
|
263
|
-
case "left":
|
|
264
|
-
r.push(
|
|
265
|
-
{ x: t.x + e, y: t.y - e },
|
|
266
|
-
{ x: t.x + e, y: t.y + e }
|
|
267
|
-
);
|
|
268
|
-
break;
|
|
269
|
-
case "right":
|
|
270
|
-
r.push(
|
|
271
|
-
{ x: t.x - e, y: t.y - e },
|
|
272
|
-
{ x: t.x - e, y: t.y + e }
|
|
273
|
-
);
|
|
274
|
-
break;
|
|
275
|
-
}
|
|
276
|
-
return r;
|
|
277
|
-
}
|
|
278
|
-
function ye(t) {
|
|
279
|
-
const { top: o, right: e, bottom: r, left: n } = t;
|
|
280
|
-
return [
|
|
281
|
-
{ x: n, y: o },
|
|
282
|
-
{ x: e, y: o },
|
|
283
|
-
{ x: e, y: r },
|
|
284
|
-
{ x: n, y: r }
|
|
285
|
-
];
|
|
286
|
-
}
|
|
287
|
-
function Ce(t, o) {
|
|
288
|
-
const { x: e, y: r } = t;
|
|
289
|
-
let n = !1;
|
|
290
|
-
for (let a = 0, l = o.length - 1; a < o.length; l = a++) {
|
|
291
|
-
const v = o[a], i = o[l], p = v.x, c = v.y, d = i.x, h = i.y;
|
|
292
|
-
c > r != h > r && e < (d - p) * (r - c) / (h - c) + p && (n = !n);
|
|
293
|
-
}
|
|
294
|
-
return n;
|
|
295
|
-
}
|
|
296
|
-
function xe(t) {
|
|
297
|
-
const o = t.slice();
|
|
298
|
-
return o.sort((e, r) => e.x < r.x ? -1 : e.x > r.x ? 1 : e.y < r.y ? -1 : e.y > r.y ? 1 : 0), ge(o);
|
|
299
|
-
}
|
|
300
|
-
function ge(t) {
|
|
301
|
-
if (t.length <= 1) return t.slice();
|
|
302
|
-
const o = [];
|
|
303
|
-
for (let r = 0; r < t.length; r++) {
|
|
304
|
-
const n = t[r];
|
|
305
|
-
for (; o.length >= 2; ) {
|
|
306
|
-
const a = o[o.length - 1], l = o[o.length - 2];
|
|
307
|
-
if ((a.x - l.x) * (n.y - l.y) >= (a.y - l.y) * (n.x - l.x)) o.pop();
|
|
308
|
-
else break;
|
|
309
|
-
}
|
|
310
|
-
o.push(n);
|
|
311
|
-
}
|
|
312
|
-
o.pop();
|
|
313
|
-
const e = [];
|
|
314
|
-
for (let r = t.length - 1; r >= 0; r--) {
|
|
315
|
-
const n = t[r];
|
|
316
|
-
for (; e.length >= 2; ) {
|
|
317
|
-
const a = e[e.length - 1], l = e[e.length - 2];
|
|
318
|
-
if ((a.x - l.x) * (n.y - l.y) >= (a.y - l.y) * (n.x - l.x)) e.pop();
|
|
319
|
-
else break;
|
|
320
|
-
}
|
|
321
|
-
e.push(n);
|
|
322
|
-
}
|
|
323
|
-
return e.pop(), o.length === 1 && e.length === 1 && o[0].x === e[0].x && o[0].y === e[0].y ? o : o.concat(e);
|
|
15
|
+
});
|
|
16
|
+
i.displayName = d;
|
|
17
|
+
function f(r) {
|
|
18
|
+
return l.includes(r);
|
|
324
19
|
}
|
|
325
|
-
var
|
|
20
|
+
var T = i;
|
|
326
21
|
export {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
He as Provider,
|
|
330
|
-
Ne as Root,
|
|
331
|
-
B as Tooltip,
|
|
332
|
-
he as TooltipArrow,
|
|
333
|
-
Y as TooltipContent,
|
|
334
|
-
V as TooltipPortal,
|
|
335
|
-
F as TooltipProvider,
|
|
336
|
-
U as TooltipTrigger,
|
|
337
|
-
Se as Trigger
|
|
22
|
+
T as Root,
|
|
23
|
+
i as Separator
|
|
338
24
|
};
|
package/dist/index8.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { cva as n } from "./
|
|
2
|
+
import { cva as n } from "./index47.js";
|
|
3
3
|
import { cn as a } from "./index2.js";
|
|
4
4
|
const i = n(
|
|
5
5
|
"inline-flex items-center border-2 px-2.5 py-0.5 text-xs font-semibold uppercase tracking-wider transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
package/dist/index80.js
CHANGED
package/dist/index82.js
CHANGED
package/dist/index84.js
CHANGED
|
@@ -1,183 +1,127 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { composeEventHandlers as
|
|
3
|
-
import {
|
|
4
|
-
import { useComposedRefs as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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) => {
|
|
1
|
+
import * as n from "react";
|
|
2
|
+
import { composeEventHandlers as m } from "./index79.js";
|
|
3
|
+
import { Primitive as g, dispatchDiscreteCustomEvent as k } from "./index81.js";
|
|
4
|
+
import { useComposedRefs as R } from "./index78.js";
|
|
5
|
+
import { useCallbackRef as w } from "./index98.js";
|
|
6
|
+
import { useEscapeKeydown as U } from "./index115.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) => {
|
|
93
14
|
const {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
},
|
|
105
|
-
|
|
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,
|
|
106
43
|
{
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
-
}
|
|
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
|
|
144
55
|
)
|
|
145
56
|
}
|
|
146
57
|
);
|
|
147
58
|
}
|
|
148
59
|
);
|
|
149
|
-
|
|
150
|
-
var
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
|
|
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
|
|
100
|
+
};
|
|
162
101
|
}
|
|
163
|
-
function
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
|
|
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
|
+
};
|
|
167
115
|
}
|
|
168
|
-
function
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
if (o === s || (o.focus({ preventScroll: r }), document.activeElement !== s)) return;
|
|
116
|
+
function O() {
|
|
117
|
+
const r = new CustomEvent(y);
|
|
118
|
+
document.dispatchEvent(r);
|
|
172
119
|
}
|
|
173
|
-
function
|
|
174
|
-
|
|
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);
|
|
175
123
|
}
|
|
176
|
-
var ge = O, Re = M;
|
|
177
124
|
export {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
O as RovingFocusGroup,
|
|
181
|
-
M as RovingFocusGroupItem,
|
|
182
|
-
Fe as createRovingFocusGroupScope
|
|
125
|
+
j as DismissableLayer,
|
|
126
|
+
Y as DismissableLayerBranch
|
|
183
127
|
};
|