@drjoshcsimmons/scl 0.1.9 → 0.1.11
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/index10.js +21 -21
- package/dist/index100.js +48 -14
- package/dist/index101.js +51 -44
- package/dist/index102.js +29 -49
- package/dist/index103.js +4 -9
- package/dist/index104.js +218 -3
- package/dist/index107.js +7 -46
- package/dist/index108.js +181 -30
- package/dist/index109.js +43 -176
- package/dist/index11.js +2 -2
- package/dist/index110.js +30 -9
- package/dist/index111.js +8 -8
- package/dist/index112.js +1 -1
- package/dist/index116.js +12 -21
- package/dist/index117.js +15 -3
- package/dist/index118.js +3 -32
- package/dist/index119.js +32 -12
- package/dist/index12.js +1 -1
- package/dist/index120.js +18 -12
- package/dist/index126.js +1 -1
- package/dist/index127.js +1 -1
- package/dist/index128.js +25 -2
- package/dist/index129.js +29 -2
- package/dist/index13.js +2 -2
- package/dist/index130.js +5 -25
- package/dist/index131.js +2 -29
- package/dist/index132.js +2 -5
- package/dist/index136.js +1 -1
- package/dist/index137.js +1 -1
- package/dist/index14.js +2 -2
- package/dist/index141.js +1 -1
- package/dist/index15.js +2 -2
- package/dist/index17.js +1 -1
- 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 +1 -1
- package/dist/index24.js +1 -1
- package/dist/index25.js +3 -3
- 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/index45.js +1 -1
- package/dist/index46.js +1 -1
- package/dist/index48.js +302 -65
- package/dist/index49.js +12 -125
- package/dist/index50.js +112 -236
- package/dist/index51.js +73 -9
- package/dist/index52.js +57 -307
- package/dist/index53.js +260 -12
- package/dist/index54.js +12 -60
- package/dist/index55.js +249 -12
- package/dist/index56.js +9 -118
- package/dist/index57.js +107 -71
- package/dist/index58.js +12 -241
- package/dist/index59.js +26 -855
- package/dist/index6.js +1 -1
- package/dist/index60.js +82 -9
- package/dist/index61.js +848 -242
- package/dist/index62.js +9 -260
- package/dist/index63.js +161 -12
- package/dist/index64.js +308 -407
- package/dist/index65.js +433 -16
- package/dist/index66.js +224 -113
- package/dist/index67.js +18 -526
- package/dist/index69.js +1 -1
- package/dist/index7.js +1 -1
- package/dist/index70.js +1 -1
- package/dist/index71.js +91 -197
- package/dist/index72.js +216 -316
- package/dist/index73.js +524 -25
- package/dist/index74.js +16 -159
- package/dist/index75.js +252 -20
- package/dist/index84.js +14 -8
- package/dist/index88.js +1 -1
- package/dist/index9.js +1 -1
- package/dist/index90.js +8 -5
- package/dist/index91.js +5 -24
- package/dist/index92.js +23 -67
- package/dist/index93.js +66 -12
- package/dist/index94.js +118 -48
- package/dist/index95.js +134 -29
- package/dist/index96.js +13 -124
- package/dist/index98.js +8 -134
- package/dist/index99.js +49 -218
- package/package.json +1 -1
package/dist/index64.js
CHANGED
|
@@ -1,437 +1,338 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { Primitive as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
V(R, x);
|
|
50
|
-
}
|
|
51
|
-
function se(R) {
|
|
52
|
-
V(R, f.current);
|
|
1
|
+
import * as s from "react";
|
|
2
|
+
import { composeEventHandlers as g } from "./index79.js";
|
|
3
|
+
import { useComposedRefs as N } from "./index78.js";
|
|
4
|
+
import { createContextScope as K } from "./index76.js";
|
|
5
|
+
import { DismissableLayer as W } from "./index94.js";
|
|
6
|
+
import { useId as $ } from "./index82.js";
|
|
7
|
+
import { createPopperScope as S, Root as z, Anchor as J, Content as Q, Arrow as Z } from "./index104.js";
|
|
8
|
+
import { Portal as ee } from "./index96.js";
|
|
9
|
+
import { Presence as G } from "./index93.js";
|
|
10
|
+
import { Primitive as te } from "./index81.js";
|
|
11
|
+
import { createSlottable as oe } from "./index107.js";
|
|
12
|
+
import { useControllableState as re } from "./index80.js";
|
|
13
|
+
import { Root as ne } from "./index106.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,
|
|
30
|
+
{
|
|
31
|
+
scope: o,
|
|
32
|
+
isOpenDelayedRef: l,
|
|
33
|
+
delayDuration: e,
|
|
34
|
+
onOpen: s.useCallback(() => {
|
|
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
|
|
53
49
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
F.displayName = j;
|
|
53
|
+
var R = "Tooltip", [le, _] = D(R), B = (t) => {
|
|
54
|
+
const {
|
|
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
|
|
69
99
|
}
|
|
70
|
-
|
|
71
|
-
|
|
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,
|
|
72
108
|
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
s || (k.current = p);
|
|
92
|
-
}),
|
|
93
|
-
min: n,
|
|
94
|
-
max: a,
|
|
95
|
-
inverted: w,
|
|
96
|
-
onSlideStart: s ? void 0 : H,
|
|
97
|
-
onSlideMove: s ? void 0 : se,
|
|
98
|
-
onSlideEnd: s ? void 0 : ae,
|
|
99
|
-
onHomeKeyDown: () => !s && V(n, 0, { commit: !0 }),
|
|
100
|
-
onEndKeyDown: () => !s && V(a, p.length - 1, { commit: !0 }),
|
|
101
|
-
onStepKeyDown: ({ event: R, direction: x }) => {
|
|
102
|
-
if (!s) {
|
|
103
|
-
const N = j.includes(R.key) || R.shiftKey && X.includes(R.key) ? 10 : 1, B = f.current, _ = p[B], y = c * N * x;
|
|
104
|
-
V(_ + y, B, { commit: !0 });
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
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)
|
|
109
127
|
}
|
|
110
|
-
);
|
|
128
|
+
) });
|
|
111
129
|
}
|
|
112
130
|
);
|
|
113
|
-
|
|
114
|
-
var [
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
inverted: c,
|
|
126
|
-
onSlideStart: r,
|
|
127
|
-
onSlideMove: s,
|
|
128
|
-
onSlideEnd: l,
|
|
129
|
-
onStepKeyDown: h,
|
|
130
|
-
...S
|
|
131
|
-
} = e, [i, u] = d.useState(null), w = M(t, (b) => u(b)), P = d.useRef(void 0), g = de(a), m = g === "ltr", f = m && !c || !m && c;
|
|
132
|
-
function D(b) {
|
|
133
|
-
const p = P.current || i.getBoundingClientRect(), A = [0, p.width], H = U(A, f ? [o, n] : [n, o]);
|
|
134
|
-
return P.current = p, H(b - p.left);
|
|
135
|
-
}
|
|
136
|
-
return /* @__PURE__ */ v(
|
|
137
|
-
J,
|
|
138
|
-
{
|
|
139
|
-
scope: e.__scopeSlider,
|
|
140
|
-
startEdge: f ? "left" : "right",
|
|
141
|
-
endEdge: f ? "right" : "left",
|
|
142
|
-
direction: f ? 1 : -1,
|
|
143
|
-
size: "width",
|
|
144
|
-
children: /* @__PURE__ */ v(
|
|
145
|
-
Z,
|
|
146
|
-
{
|
|
147
|
-
dir: g,
|
|
148
|
-
"data-orientation": "horizontal",
|
|
149
|
-
...S,
|
|
150
|
-
ref: w,
|
|
151
|
-
style: {
|
|
152
|
-
...S.style,
|
|
153
|
-
"--radix-slider-thumb-transform": "translateX(-50%)"
|
|
154
|
-
},
|
|
155
|
-
onSlideStart: (b) => {
|
|
156
|
-
const p = D(b.clientX);
|
|
157
|
-
r == null || r(p);
|
|
158
|
-
},
|
|
159
|
-
onSlideMove: (b) => {
|
|
160
|
-
const p = D(b.clientX);
|
|
161
|
-
s == null || s(p);
|
|
162
|
-
},
|
|
163
|
-
onSlideEnd: () => {
|
|
164
|
-
P.current = void 0, l == null || l();
|
|
165
|
-
},
|
|
166
|
-
onStepKeyDown: (b) => {
|
|
167
|
-
const A = G[f ? "from-left" : "from-right"].includes(b.key);
|
|
168
|
-
h == null || h({ event: b, direction: A ? -1 : 1 });
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
)
|
|
172
|
-
}
|
|
173
|
-
);
|
|
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 }) });
|
|
174
143
|
}
|
|
175
|
-
),
|
|
176
|
-
(
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
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
|
+
};
|
|
190
160
|
}
|
|
191
|
-
|
|
192
|
-
|
|
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,
|
|
193
190
|
{
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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,
|
|
201
199
|
{
|
|
202
|
-
"data-
|
|
203
|
-
...
|
|
204
|
-
|
|
200
|
+
"data-state": i.stateAttribute,
|
|
201
|
+
...p,
|
|
202
|
+
...v,
|
|
203
|
+
ref: o,
|
|
205
204
|
style: {
|
|
206
|
-
...
|
|
207
|
-
"--radix-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
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)"
|
|
212
211
|
},
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
onSlideEnd: () => {
|
|
218
|
-
u.current = void 0, s == null || s();
|
|
219
|
-
},
|
|
220
|
-
onStepKeyDown: (g) => {
|
|
221
|
-
const f = G[w ? "from-bottom" : "from-top"].includes(g.key);
|
|
222
|
-
l == null || l({ event: g, direction: f ? -1 : 1 });
|
|
223
|
-
}
|
|
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
|
+
]
|
|
224
216
|
}
|
|
225
217
|
)
|
|
226
218
|
}
|
|
227
219
|
);
|
|
228
220
|
}
|
|
229
|
-
), Z = d.forwardRef(
|
|
230
|
-
(e, t) => {
|
|
231
|
-
const {
|
|
232
|
-
__scopeSlider: o,
|
|
233
|
-
onSlideStart: n,
|
|
234
|
-
onSlideMove: a,
|
|
235
|
-
onSlideEnd: c,
|
|
236
|
-
onHomeKeyDown: r,
|
|
237
|
-
onEndKeyDown: s,
|
|
238
|
-
onStepKeyDown: l,
|
|
239
|
-
...h
|
|
240
|
-
} = e, S = T(I, o);
|
|
241
|
-
return /* @__PURE__ */ v(
|
|
242
|
-
K.span,
|
|
243
|
-
{
|
|
244
|
-
...h,
|
|
245
|
-
ref: t,
|
|
246
|
-
onKeyDown: C(e.onKeyDown, (i) => {
|
|
247
|
-
i.key === "Home" ? (r(i), i.preventDefault()) : i.key === "End" ? (s(i), i.preventDefault()) : j.concat(X).includes(i.key) && (l(i), i.preventDefault());
|
|
248
|
-
}),
|
|
249
|
-
onPointerDown: C(e.onPointerDown, (i) => {
|
|
250
|
-
const u = i.target;
|
|
251
|
-
u.setPointerCapture(i.pointerId), i.preventDefault(), S.thumbs.has(u) ? u.focus() : n(i);
|
|
252
|
-
}),
|
|
253
|
-
onPointerMove: C(e.onPointerMove, (i) => {
|
|
254
|
-
i.target.hasPointerCapture(i.pointerId) && a(i);
|
|
255
|
-
}),
|
|
256
|
-
onPointerUp: C(e.onPointerUp, (i) => {
|
|
257
|
-
const u = i.target;
|
|
258
|
-
u.hasPointerCapture(i.pointerId) && (u.releasePointerCapture(i.pointerId), c(i));
|
|
259
|
-
})
|
|
260
|
-
}
|
|
261
|
-
);
|
|
262
|
-
}
|
|
263
|
-
), ee = "SliderTrack", te = d.forwardRef(
|
|
264
|
-
(e, t) => {
|
|
265
|
-
const { __scopeSlider: o, ...n } = e, a = T(ee, o);
|
|
266
|
-
return /* @__PURE__ */ v(
|
|
267
|
-
K.span,
|
|
268
|
-
{
|
|
269
|
-
"data-disabled": a.disabled ? "" : void 0,
|
|
270
|
-
"data-orientation": a.orientation,
|
|
271
|
-
...n,
|
|
272
|
-
ref: t
|
|
273
|
-
}
|
|
274
|
-
);
|
|
275
|
-
}
|
|
276
221
|
);
|
|
277
|
-
|
|
278
|
-
var
|
|
279
|
-
(
|
|
280
|
-
const {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
{
|
|
286
|
-
"data-orientation": a.orientation,
|
|
287
|
-
"data-disabled": a.disabled ? "" : void 0,
|
|
288
|
-
...n,
|
|
289
|
-
ref: s,
|
|
290
|
-
style: {
|
|
291
|
-
...e.style,
|
|
292
|
-
[c.startEdge]: S + "%",
|
|
293
|
-
[c.endEdge]: i + "%"
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
);
|
|
297
|
-
}
|
|
298
|
-
);
|
|
299
|
-
ne.displayName = L;
|
|
300
|
-
var O = "SliderThumb", oe = d.forwardRef(
|
|
301
|
-
(e, t) => {
|
|
302
|
-
const o = he(e.__scopeSlider), [n, a] = d.useState(null), c = M(t, (s) => a(s)), r = d.useMemo(
|
|
303
|
-
() => n ? o().findIndex((s) => s.ref.current === n) : -1,
|
|
304
|
-
[o, n]
|
|
305
|
-
);
|
|
306
|
-
return /* @__PURE__ */ v(be, { ...e, ref: c, index: r });
|
|
307
|
-
}
|
|
308
|
-
), be = d.forwardRef(
|
|
309
|
-
(e, t) => {
|
|
310
|
-
const { __scopeSlider: o, index: n, name: a, ...c } = e, r = T(O, o), s = Q(O, o), [l, h] = d.useState(null), S = M(t, (D) => h(D)), i = l ? r.form || !!l.closest("form") : !0, u = fe(l), w = r.values[n], P = w === void 0 ? 0 : ie(w, r.min, r.max), g = xe(n, r.values.length), m = u == null ? void 0 : u[s.size], f = m ? De(m, P, s.direction) : 0;
|
|
311
|
-
return d.useEffect(() => {
|
|
312
|
-
if (l)
|
|
313
|
-
return r.thumbs.add(l), () => {
|
|
314
|
-
r.thumbs.delete(l);
|
|
315
|
-
};
|
|
316
|
-
}, [l, r.thumbs]), /* @__PURE__ */ pe(
|
|
317
|
-
"span",
|
|
318
|
-
{
|
|
319
|
-
style: {
|
|
320
|
-
transform: "var(--radix-slider-thumb-transform)",
|
|
321
|
-
position: "absolute",
|
|
322
|
-
[s.startEdge]: `calc(${P}% + ${f}px)`
|
|
323
|
-
},
|
|
324
|
-
children: [
|
|
325
|
-
/* @__PURE__ */ v(z.ItemSlot, { scope: e.__scopeSlider, children: /* @__PURE__ */ v(
|
|
326
|
-
K.span,
|
|
327
|
-
{
|
|
328
|
-
role: "slider",
|
|
329
|
-
"aria-label": e["aria-label"] || g,
|
|
330
|
-
"aria-valuemin": r.min,
|
|
331
|
-
"aria-valuenow": w,
|
|
332
|
-
"aria-valuemax": r.max,
|
|
333
|
-
"aria-orientation": r.orientation,
|
|
334
|
-
"data-orientation": r.orientation,
|
|
335
|
-
"data-disabled": r.disabled ? "" : void 0,
|
|
336
|
-
tabIndex: r.disabled ? void 0 : 0,
|
|
337
|
-
...c,
|
|
338
|
-
ref: S,
|
|
339
|
-
style: w === void 0 ? { display: "none" } : e.style,
|
|
340
|
-
onFocus: C(e.onFocus, () => {
|
|
341
|
-
r.valueIndexToChangeRef.current = n;
|
|
342
|
-
})
|
|
343
|
-
}
|
|
344
|
-
) }),
|
|
345
|
-
i && /* @__PURE__ */ v(
|
|
346
|
-
re,
|
|
347
|
-
{
|
|
348
|
-
name: a ?? (r.name ? r.name + (r.values.length > 1 ? "[]" : "") : void 0),
|
|
349
|
-
form: r.form,
|
|
350
|
-
value: w
|
|
351
|
-
},
|
|
352
|
-
n
|
|
353
|
-
)
|
|
354
|
-
]
|
|
355
|
-
}
|
|
356
|
-
);
|
|
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 });
|
|
357
230
|
}
|
|
358
231
|
);
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
(
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
{
|
|
374
|
-
style: { display: "none" },
|
|
375
|
-
...o,
|
|
376
|
-
ref: c,
|
|
377
|
-
defaultValue: t
|
|
378
|
-
}
|
|
379
|
-
);
|
|
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");
|
|
380
246
|
}
|
|
381
|
-
);
|
|
382
|
-
re.displayName = Re;
|
|
383
|
-
function Pe(e = [], t, o) {
|
|
384
|
-
const n = [...e];
|
|
385
|
-
return n[o] = t, n.sort((a, c) => a - c);
|
|
386
247
|
}
|
|
387
|
-
function
|
|
388
|
-
const
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
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;
|
|
402
277
|
}
|
|
403
|
-
function
|
|
404
|
-
|
|
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
|
+
];
|
|
405
286
|
}
|
|
406
|
-
function
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
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);
|
|
410
293
|
}
|
|
411
|
-
return
|
|
412
|
-
}
|
|
413
|
-
function U(e, t) {
|
|
414
|
-
return (o) => {
|
|
415
|
-
if (e[0] === e[1] || t[0] === t[1]) return t[0];
|
|
416
|
-
const n = (t[1] - t[0]) / (e[1] - e[0]);
|
|
417
|
-
return t[0] + n * (o - e[0]);
|
|
418
|
-
};
|
|
294
|
+
return n;
|
|
419
295
|
}
|
|
420
|
-
function
|
|
421
|
-
|
|
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);
|
|
422
299
|
}
|
|
423
|
-
function
|
|
424
|
-
|
|
425
|
-
|
|
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);
|
|
426
324
|
}
|
|
427
|
-
var
|
|
325
|
+
var He = F, Ne = B, Se = U, Ge = V, je = Y;
|
|
428
326
|
export {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
327
|
+
je as Content,
|
|
328
|
+
Ge as Portal,
|
|
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
|
|
437
338
|
};
|