@drjoshcsimmons/scl 0.1.15 → 0.2.1
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/LICENSE +1 -1
- package/dist/components/ui/accordion/accordion.d.ts +1 -1
- package/dist/components/ui/accordion/accordion.d.ts.map +1 -1
- package/dist/components/ui/accordion/index.d.ts +1 -1
- package/dist/components/ui/accordion/index.d.ts.map +1 -1
- package/dist/components/ui/alert/alert.d.ts.map +1 -1
- package/dist/components/ui/alert/index.d.ts +1 -1
- package/dist/components/ui/alert/index.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog.d.ts +2 -2
- package/dist/components/ui/alert-dialog/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog/index.d.ts +1 -1
- package/dist/components/ui/alert-dialog/index.d.ts.map +1 -1
- package/dist/components/ui/avatar/avatar.d.ts +1 -1
- package/dist/components/ui/avatar/avatar.d.ts.map +1 -1
- package/dist/components/ui/avatar/index.d.ts +1 -1
- package/dist/components/ui/avatar/index.d.ts.map +1 -1
- package/dist/components/ui/badge/badge.d.ts +1 -1
- package/dist/components/ui/badge/badge.d.ts.map +1 -1
- package/dist/components/ui/badge/index.d.ts +1 -1
- package/dist/components/ui/badge/index.d.ts.map +1 -1
- package/dist/components/ui/button/button.d.ts.map +1 -1
- package/dist/components/ui/button/index.d.ts +1 -1
- package/dist/components/ui/button/index.d.ts.map +1 -1
- package/dist/components/ui/card/card.d.ts.map +1 -1
- package/dist/components/ui/card/index.d.ts +1 -1
- package/dist/components/ui/card/index.d.ts.map +1 -1
- package/dist/components/ui/checkbox/checkbox.d.ts +1 -1
- package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox/index.d.ts.map +1 -1
- package/dist/components/ui/collapsible/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible/index.d.ts +1 -1
- package/dist/components/ui/collapsible/index.d.ts.map +1 -1
- package/dist/components/ui/combobox/combobox.d.ts.map +1 -1
- package/dist/components/ui/combobox/index.d.ts +1 -1
- package/dist/components/ui/combobox/index.d.ts.map +1 -1
- package/dist/components/ui/command/command.d.ts.map +1 -1
- package/dist/components/ui/command/index.d.ts +1 -1
- package/dist/components/ui/command/index.d.ts.map +1 -1
- package/dist/components/ui/dialog/dialog.d.ts +1 -1
- package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog/index.d.ts +1 -1
- package/dist/components/ui/dialog/index.d.ts.map +1 -1
- package/dist/components/ui/dithered-image/dithered-image.d.ts.map +1 -1
- package/dist/components/ui/dithered-image/index.d.ts +1 -1
- package/dist/components/ui/dithered-image/index.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu/index.d.ts +1 -1
- package/dist/components/ui/dropdown-menu/index.d.ts.map +1 -1
- package/dist/components/ui/form/form.d.ts +1 -1
- package/dist/components/ui/form/form.d.ts.map +1 -1
- package/dist/components/ui/form/index.d.ts +1 -1
- package/dist/components/ui/form/index.d.ts.map +1 -1
- package/dist/components/ui/input/index.d.ts.map +1 -1
- package/dist/components/ui/input/input.d.ts.map +1 -1
- package/dist/components/ui/label/index.d.ts.map +1 -1
- package/dist/components/ui/label/label.d.ts +1 -1
- package/dist/components/ui/label/label.d.ts.map +1 -1
- package/dist/components/ui/popover/index.d.ts +1 -1
- package/dist/components/ui/popover/index.d.ts.map +1 -1
- package/dist/components/ui/popover/popover.d.ts +1 -1
- package/dist/components/ui/popover/popover.d.ts.map +1 -1
- package/dist/components/ui/progress/index.d.ts.map +1 -1
- package/dist/components/ui/progress/progress.d.ts +1 -1
- package/dist/components/ui/progress/progress.d.ts.map +1 -1
- package/dist/components/ui/radio-group/index.d.ts.map +1 -1
- package/dist/components/ui/radio-group/radio-group.d.ts +1 -1
- package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/ui/scroll-area/index.d.ts.map +1 -1
- package/dist/components/ui/scroll-area/scroll-area.d.ts +1 -1
- package/dist/components/ui/scroll-area/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/select/index.d.ts +1 -1
- package/dist/components/ui/select/index.d.ts.map +1 -1
- package/dist/components/ui/select/select.d.ts +1 -1
- package/dist/components/ui/select/select.d.ts.map +1 -1
- package/dist/components/ui/separator/index.d.ts.map +1 -1
- package/dist/components/ui/separator/separator.d.ts +1 -1
- package/dist/components/ui/separator/separator.d.ts.map +1 -1
- package/dist/components/ui/sheet/index.d.ts +1 -1
- package/dist/components/ui/sheet/index.d.ts.map +1 -1
- package/dist/components/ui/sheet/sheet.d.ts +2 -2
- package/dist/components/ui/sheet/sheet.d.ts.map +1 -1
- package/dist/components/ui/skeleton/index.d.ts.map +1 -1
- package/dist/components/ui/skeleton/skeleton.d.ts.map +1 -1
- package/dist/components/ui/slider/index.d.ts.map +1 -1
- package/dist/components/ui/slider/slider.d.ts +1 -1
- package/dist/components/ui/slider/slider.d.ts.map +1 -1
- package/dist/components/ui/statusline/index.d.ts.map +1 -1
- package/dist/components/ui/statusline/statusline.d.ts.map +1 -1
- package/dist/components/ui/switch/index.d.ts.map +1 -1
- package/dist/components/ui/switch/switch.d.ts +1 -1
- package/dist/components/ui/switch/switch.d.ts.map +1 -1
- package/dist/components/ui/table/index.d.ts +1 -1
- package/dist/components/ui/table/index.d.ts.map +1 -1
- package/dist/components/ui/table/table.d.ts +1 -1
- package/dist/components/ui/table/table.d.ts.map +1 -1
- package/dist/components/ui/tabs/index.d.ts +1 -1
- package/dist/components/ui/tabs/index.d.ts.map +1 -1
- package/dist/components/ui/tabs/tabs.d.ts +1 -1
- package/dist/components/ui/tabs/tabs.d.ts.map +1 -1
- package/dist/components/ui/terminal-textarea/index.d.ts.map +1 -1
- package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea/index.d.ts.map +1 -1
- package/dist/components/ui/textarea/textarea.d.ts.map +1 -1
- package/dist/components/ui/toggle/index.d.ts.map +1 -1
- package/dist/components/ui/toggle/toggle.d.ts +1 -1
- package/dist/components/ui/toggle/toggle.d.ts.map +1 -1
- package/dist/components/ui/tooltip/index.d.ts +1 -1
- package/dist/components/ui/tooltip/index.d.ts.map +1 -1
- package/dist/components/ui/tooltip/tooltip.d.ts +1 -1
- package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -12
- package/dist/index10.js +42 -44
- package/dist/index100.js +4 -25
- package/dist/index101.js +30 -9
- package/dist/index102.js +10 -178
- package/dist/index103.js +646 -44
- package/dist/index104.js +1 -1
- package/dist/index105.js +3 -54
- package/dist/index106.js +47 -29
- package/dist/index107.js +30 -30
- package/dist/index108.js +50 -645
- package/dist/index109.js +29 -47
- package/dist/index11.js +5 -11
- package/dist/index110.js +47 -29
- package/dist/index113.js +48 -6
- package/dist/index115.js +11 -47
- package/dist/index116.js +204 -10
- package/dist/index117.js +20 -204
- package/dist/index118.js +399 -21
- package/dist/index119.js +6 -400
- package/dist/index12.js +2 -2
- package/dist/index120.js +48 -21
- package/dist/index121.js +15 -3
- package/dist/index122.js +3 -32
- package/dist/index123.js +32 -12
- package/dist/index124.js +18 -48
- package/dist/index125.js +25 -2
- package/dist/index126.js +29 -53
- package/dist/index127.js +5 -65
- package/dist/index128.js +2 -25
- package/dist/index129.js +53 -29
- package/dist/index13.js +2 -2
- package/dist/index130.js +65 -5
- package/dist/index136.js +1 -1
- package/dist/index137.js +1 -1
- package/dist/index14.js +5 -14
- package/dist/index141.js +1 -1
- package/dist/index142.js +1 -1
- package/dist/index143.js +1 -1
- package/dist/index148.js +21 -11
- package/dist/index149.js +11 -26
- package/dist/index15.js +15 -39
- package/dist/index150.js +27 -4
- package/dist/index151.js +4 -22
- package/dist/index16.js +3 -30
- package/dist/index17.js +24 -28
- package/dist/index18.js +11 -13
- package/dist/index20.js +5 -12
- package/dist/index21.js +3 -3
- package/dist/index22.js +10 -13
- package/dist/index23.js +7 -14
- package/dist/index24.js +8 -8
- package/dist/index25.js +23 -29
- package/dist/index26.js +15 -17
- package/dist/index27.js +50 -44
- package/dist/index28.js +2 -10
- package/dist/index29.js +6 -9
- package/dist/index3.js +18 -18
- package/dist/index30.js +27 -60
- package/dist/index31.js +4 -4
- package/dist/index32.js +16 -39
- package/dist/index33.js +7 -7
- package/dist/index34.js +1 -4
- package/dist/index36.js +5 -5
- package/dist/index37.js +7 -4
- package/dist/index38.js +99 -38
- package/dist/index39.js +37 -64
- package/dist/index4.js +6 -13
- package/dist/index40.js +10 -48
- package/dist/index41.js +48 -99
- package/dist/index42.js +65 -10
- package/dist/index45.js +4 -4
- package/dist/index46.js +1 -1
- package/dist/index48.js +228 -60
- package/dist/index49.js +15 -238
- package/dist/index5.js +13 -26
- package/dist/index50.js +109 -419
- package/dist/index51.js +30 -124
- package/dist/index52.js +61 -237
- package/dist/index53.js +236 -9
- package/dist/index54.js +11 -118
- package/dist/index55.js +58 -128
- package/dist/index56.js +249 -231
- package/dist/index57.js +225 -11
- package/dist/index58.js +9 -60
- package/dist/index59.js +11 -254
- package/dist/index6.js +44 -14
- package/dist/index60.js +115 -245
- package/dist/index61.js +22 -12
- package/dist/index62.js +811 -481
- package/dist/index63.js +9 -18
- package/dist/index64.js +67 -146
- package/dist/index65.js +249 -71
- package/dist/index66.js +12 -22
- package/dist/index67.js +212 -823
- package/dist/index68.js +118 -9
- package/dist/index69.js +511 -206
- package/dist/index7.js +5 -5
- package/dist/index70.js +5 -4
- package/dist/index71.js +407 -308
- package/dist/index72.js +318 -292
- package/dist/index73.js +310 -12
- package/dist/index74.js +12 -31
- package/dist/index75.js +161 -12
- package/dist/index77.js +1 -1
- package/dist/index80.js +1 -1
- package/dist/index81.js +1 -1
- package/dist/index82.js +1 -1
- package/dist/index84.js +118 -48
- package/dist/index85.js +12 -8
- package/dist/index86.js +135 -4
- package/dist/index87.js +219 -30
- package/dist/index88.js +14 -13
- package/dist/index89.js +64 -120
- package/dist/index9.js +6 -13
- package/dist/index90.js +46 -13
- package/dist/index91.js +48 -133
- package/dist/index92.js +8 -218
- package/dist/index93.js +30 -14
- package/dist/index94.js +8 -68
- package/dist/index95.js +176 -43
- package/dist/index96.js +25 -50
- package/dist/index97.js +6 -9
- package/dist/index98.js +54 -3
- package/dist/index99.js +10 -5
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/tokens/animations.d.ts.map +1 -1
- package/dist/tokens/colors.d.ts.map +1 -1
- package/dist/tokens/index.d.ts +3 -3
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/shadows.d.ts.map +1 -1
- package/dist/tokens/spacing.d.ts.map +1 -1
- package/dist/tokens/typography.d.ts.map +1 -1
- package/package.json +19 -9
package/dist/index72.js
CHANGED
|
@@ -1,312 +1,338 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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 "./index84.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 "./index87.js";
|
|
8
|
+
import { Portal as ee } from "./index88.js";
|
|
9
|
+
import { Presence as G } from "./index89.js";
|
|
10
|
+
import { Primitive as te } from "./index81.js";
|
|
11
|
+
import { createSlottable as oe } from "./index111.js";
|
|
12
|
+
import { useControllableState as re } from "./index80.js";
|
|
13
|
+
import { Root as ne } from "./index107.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
|
|
16
49
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
|
39
99
|
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
let E = e.get(C);
|
|
70
|
-
p = Math.max(E, p);
|
|
71
|
-
}), u.push([l, p]);
|
|
72
|
-
});
|
|
73
|
-
let o = A.current;
|
|
74
|
-
L().sort((l, f) => {
|
|
75
|
-
var p, C;
|
|
76
|
-
let E = l.getAttribute("id"), N = f.getAttribute("id");
|
|
77
|
-
return ((p = e.get(N)) != null ? p : 0) - ((C = e.get(E)) != null ? C : 0);
|
|
78
|
-
}).forEach((l) => {
|
|
79
|
-
let f = l.closest(X);
|
|
80
|
-
f ? f.appendChild(l.parentElement === f ? l : l.closest(`${X} > *`)) : o.appendChild(l.parentElement === o ? l : l.closest(`${X} > *`));
|
|
81
|
-
}), u.sort((l, f) => f[1] - l[1]).forEach((l) => {
|
|
82
|
-
var f;
|
|
83
|
-
let p = (f = A.current) == null ? void 0 : f.querySelector(`${$}[${D}="${encodeURIComponent(l[0])}"]`);
|
|
84
|
-
p == null || p.parentElement.appendChild(p);
|
|
85
|
-
});
|
|
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
|
+
) });
|
|
86
129
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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 }) });
|
|
90
143
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
+
};
|
|
102
160
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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);
|
|
106
168
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
function Q(e) {
|
|
127
|
-
var u;
|
|
128
|
-
let o = P(), l = L(), f = l.findIndex((C) => C === o), p = l[f + e];
|
|
129
|
-
(u = m.current) != null && u.loop && (p = f + e < 0 ? l[l.length - 1] : f + e === l.length ? l[0] : l[f + e]), p && y.setState("value", p.getAttribute(D));
|
|
130
|
-
}
|
|
131
|
-
function ne(e) {
|
|
132
|
-
let u = P(), o = u == null ? void 0 : u.closest($), l;
|
|
133
|
-
for (; o && !l; ) o = e > 0 ? Pe(o, $) : De(o, $), l = o == null ? void 0 : o.querySelector(ie);
|
|
134
|
-
l ? y.setState("value", l.getAttribute(D)) : Q(e);
|
|
135
|
-
}
|
|
136
|
-
let le = () => J(L().length - 1), ae = (e) => {
|
|
137
|
-
e.preventDefault(), e.metaKey ? le() : e.altKey ? ne(1) : Q(1);
|
|
138
|
-
}, ue = (e) => {
|
|
139
|
-
e.preventDefault(), e.metaKey ? J(0) : e.altKey ? ne(-1) : Q(-1);
|
|
140
|
-
};
|
|
141
|
-
return n.createElement(I.div, { ref: a, tabIndex: -1, ...j, "cmdk-root": "", onKeyDown: (e) => {
|
|
142
|
-
var u;
|
|
143
|
-
(u = j.onKeyDown) == null || u.call(j, e);
|
|
144
|
-
let o = e.nativeEvent.isComposing || e.keyCode === 229;
|
|
145
|
-
if (!(e.defaultPrevented || o)) switch (e.key) {
|
|
146
|
-
case "n":
|
|
147
|
-
case "j": {
|
|
148
|
-
x && e.ctrlKey && ae(e);
|
|
149
|
-
break;
|
|
150
|
-
}
|
|
151
|
-
case "ArrowDown": {
|
|
152
|
-
ae(e);
|
|
153
|
-
break;
|
|
154
|
-
}
|
|
155
|
-
case "p":
|
|
156
|
-
case "k": {
|
|
157
|
-
x && e.ctrlKey && ue(e);
|
|
158
|
-
break;
|
|
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 });
|
|
159
187
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
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
|
+
)
|
|
163
218
|
}
|
|
164
|
-
|
|
165
|
-
e.preventDefault(), J(0);
|
|
166
|
-
break;
|
|
167
|
-
}
|
|
168
|
-
case "End": {
|
|
169
|
-
e.preventDefault(), le();
|
|
170
|
-
break;
|
|
171
|
-
}
|
|
172
|
-
case "Enter": {
|
|
173
|
-
e.preventDefault();
|
|
174
|
-
let l = P();
|
|
175
|
-
if (l) {
|
|
176
|
-
let f = new Event(Y);
|
|
177
|
-
l.dispatchEvent(f);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
} }, n.createElement("label", { "cmdk-label": "", htmlFor: _.inputId, id: _.labelId, style: Le }, b), z(t, (e) => n.createElement(de.Provider, { value: y }, n.createElement(ce.Provider, { value: _ }, e))));
|
|
182
|
-
}), we = n.forwardRef((t, a) => {
|
|
183
|
-
var r, v;
|
|
184
|
-
let i = K(), c = n.useRef(null), d = n.useContext(se), m = O(), b = me(t), s = (v = (r = b.current) == null ? void 0 : r.forceMount) != null ? v : d == null ? void 0 : d.forceMount;
|
|
185
|
-
M(() => {
|
|
186
|
-
if (!s) return m.item(i, d == null ? void 0 : d.id);
|
|
187
|
-
}, [s]);
|
|
188
|
-
let h = ve(i, c, [t.value, t.children, c], t.keywords), R = Z(), k = S((g) => g.value && g.value === h.current), w = S((g) => s || m.filter() === !1 ? !0 : g.search ? g.filtered.items.get(i) > 0 : !0);
|
|
189
|
-
n.useEffect(() => {
|
|
190
|
-
let g = c.current;
|
|
191
|
-
if (!(!g || t.disabled)) return g.addEventListener(Y, V), () => g.removeEventListener(Y, V);
|
|
192
|
-
}, [w, t.onSelect, t.disabled]);
|
|
193
|
-
function V() {
|
|
194
|
-
var g, y;
|
|
195
|
-
B(), (y = (g = b.current).onSelect) == null || y.call(g, h.current);
|
|
219
|
+
);
|
|
196
220
|
}
|
|
197
|
-
|
|
198
|
-
|
|
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 });
|
|
199
230
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}, [t.value]), n.createElement(I.input, { ref: a, ...v, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": b.listId, "aria-labelledby": b.labelId, "aria-activedescendant": m, id: b.inputId, type: "text", value: i ? t.value : d, onChange: (s) => {
|
|
216
|
-
i || c.setState("search", s.target.value), r == null || r(s.target.value);
|
|
217
|
-
} });
|
|
218
|
-
}), Re = n.forwardRef((t, a) => {
|
|
219
|
-
let { children: r, label: v = "Suggestions", ...i } = t, c = n.useRef(null), d = n.useRef(null), m = S((s) => s.selectedItemId), b = O();
|
|
220
|
-
return n.useEffect(() => {
|
|
221
|
-
if (d.current && c.current) {
|
|
222
|
-
let s = d.current, h = c.current, R, k = new ResizeObserver(() => {
|
|
223
|
-
R = requestAnimationFrame(() => {
|
|
224
|
-
let w = s.offsetHeight;
|
|
225
|
-
h.style.setProperty("--cmdk-list-height", w.toFixed(1) + "px");
|
|
226
|
-
});
|
|
227
|
-
});
|
|
228
|
-
return k.observe(s), () => {
|
|
229
|
-
cancelAnimationFrame(R), k.unobserve(s);
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
}, []), n.createElement(I.div, { ref: q(c, a), ...i, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": m, "aria-label": v, id: b.listId }, z(t, (s) => n.createElement("div", { ref: q(d, b.listInnerRef), "cmdk-list-sizer": "" }, s)));
|
|
233
|
-
}), xe = n.forwardRef((t, a) => {
|
|
234
|
-
let { open: r, onOpenChange: v, overlayClassName: i, contentClassName: c, container: d, ...m } = t;
|
|
235
|
-
return n.createElement(ge, { open: r, onOpenChange: v }, n.createElement(he, { container: d }, n.createElement(be, { "cmdk-overlay": "", className: i }), n.createElement(Ee, { "aria-label": t.label, "cmdk-dialog": "", className: c }, n.createElement(fe, { ref: a, ...m }))));
|
|
236
|
-
}), Ae = n.forwardRef((t, a) => S((r) => r.filtered.count === 0) ? n.createElement(I.div, { ref: a, ...t, "cmdk-empty": "", role: "presentation" }) : null), Me = n.forwardRef((t, a) => {
|
|
237
|
-
let { progress: r, children: v, label: i = "Loading...", ...c } = t;
|
|
238
|
-
return n.createElement(I.div, { ref: a, ...c, "cmdk-loading": "", role: "progressbar", "aria-valuenow": r, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": i }, z(t, (d) => n.createElement("div", { "aria-hidden": !0 }, d)));
|
|
239
|
-
}), Ne = Object.assign(fe, { List: Re, Item: we, Input: Ie, Group: ke, Separator: Se, Dialog: xe, Empty: Ae, Loading: Me });
|
|
240
|
-
function Pe(t, a) {
|
|
241
|
-
let r = t.nextElementSibling;
|
|
242
|
-
for (; r; ) {
|
|
243
|
-
if (r.matches(a)) return r;
|
|
244
|
-
r = r.nextElementSibling;
|
|
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");
|
|
245
246
|
}
|
|
246
247
|
}
|
|
247
|
-
function
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
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;
|
|
252
275
|
}
|
|
276
|
+
return r;
|
|
253
277
|
}
|
|
254
|
-
function
|
|
255
|
-
|
|
256
|
-
return
|
|
257
|
-
|
|
258
|
-
|
|
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
|
+
];
|
|
259
286
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
let
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
return n
|
|
268
|
-
}
|
|
269
|
-
function ve(t, a, r, v = []) {
|
|
270
|
-
let i = n.useRef(), c = O();
|
|
271
|
-
return M(() => {
|
|
272
|
-
var d;
|
|
273
|
-
let m = (() => {
|
|
274
|
-
var s;
|
|
275
|
-
for (let h of r) {
|
|
276
|
-
if (typeof h == "string") return h.trim();
|
|
277
|
-
if (typeof h == "object" && "current" in h) return h.current ? (s = h.current.textContent) == null ? void 0 : s.trim() : i.current;
|
|
278
|
-
}
|
|
279
|
-
})(), b = v.map((s) => s.trim());
|
|
280
|
-
c.value(t, m, b), (d = a.current) == null || d.setAttribute(D, m), i.current = m;
|
|
281
|
-
}), i;
|
|
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;
|
|
282
295
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
return
|
|
286
|
-
r.current.forEach((v) => v()), r.current = /* @__PURE__ */ new Map();
|
|
287
|
-
}, [t]), (v, i) => {
|
|
288
|
-
r.current.set(v, i), a({});
|
|
289
|
-
};
|
|
290
|
-
};
|
|
291
|
-
function Ke(t) {
|
|
292
|
-
let a = t.type;
|
|
293
|
-
return typeof a == "function" ? a(t.props) : "render" in a ? a.render(t.props) : t;
|
|
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);
|
|
294
299
|
}
|
|
295
|
-
function
|
|
296
|
-
|
|
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);
|
|
297
324
|
}
|
|
298
|
-
var
|
|
325
|
+
var He = F, Ne = B, Se = U, Ge = V, je = Y;
|
|
299
326
|
export {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
S as useCommandState
|
|
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
|
|
312
338
|
};
|