@arcadeai/design-system 0.7.2 → 0.7.3
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/assets/index.css +1 -1
- package/dist/{check-CxcShTlQ.js → check-B5h1DvDs.js} +2 -2
- package/dist/{chevron-down-D_a-ccxi.js → chevron-down-DmZMdOiC.js} +2 -2
- package/dist/{chevron-right-DriXIqe5.js → chevron-right-BYYHEJjK.js} +2 -2
- package/dist/components/ui/atoms/accordion.js +70 -74
- package/dist/components/ui/atoms/alert.js +2 -2
- package/dist/components/ui/atoms/avatar.js +5 -5
- package/dist/components/ui/atoms/badge.js +3 -3
- package/dist/components/ui/atoms/breadcrumb.js +5 -5
- package/dist/components/ui/atoms/button.js +3 -3
- package/dist/components/ui/atoms/card.js +1 -1
- package/dist/components/ui/atoms/chart.js +2153 -2154
- package/dist/components/ui/atoms/collapsible.js +1 -1
- package/dist/components/ui/atoms/command.js +15 -15
- package/dist/components/ui/atoms/dialog.js +2 -2
- package/dist/components/ui/atoms/dropdown-menu.js +367 -384
- package/dist/components/ui/atoms/form.d.ts +1 -1
- package/dist/components/ui/atoms/form.js +182 -199
- package/dist/components/ui/atoms/hover-card.js +40 -41
- package/dist/components/ui/atoms/input.js +1 -1
- package/dist/components/ui/atoms/label.js +18 -19
- package/dist/components/ui/atoms/popover.js +107 -110
- package/dist/components/ui/atoms/progress.js +3 -3
- package/dist/components/ui/atoms/resizable.js +8 -8
- package/dist/components/ui/atoms/scroll-area.js +82 -84
- package/dist/components/ui/atoms/select.js +393 -407
- package/dist/components/ui/atoms/separator.js +2 -2
- package/dist/components/ui/atoms/sheet.js +2 -2
- package/dist/components/ui/atoms/sidebar.js +17 -17
- package/dist/components/ui/atoms/skeleton.js +1 -1
- package/dist/components/ui/atoms/slider.js +213 -214
- package/dist/components/ui/atoms/sonner.js +28 -28
- package/dist/components/ui/atoms/switch.js +7 -7
- package/dist/components/ui/atoms/table.js +1 -1
- package/dist/components/ui/atoms/tabs.js +8 -8
- package/dist/components/ui/atoms/textarea.js +1 -1
- package/dist/components/ui/atoms/toggle.js +5 -5
- package/dist/components/ui/atoms/tooltip.js +103 -104
- package/dist/{createLucideIcon-B6fy1GTR.js → createLucideIcon-XRdN60yz.js} +4 -4
- package/dist/index-0ioNhtNM.js +10 -0
- package/dist/index-437EL2iq.js +52 -0
- package/dist/{index-CB1Wkg0G.js → index-5Bhkapwi.js} +2 -3
- package/dist/index-B695uy69.js +9 -0
- package/dist/{index-CHDs-SiB.js → index-BGQepRFJ.js} +1 -1
- package/dist/{index-BAhNQL1u.js → index-BvWMjxZ5.js} +22 -23
- package/dist/index-C8_QusYl.js +70 -0
- package/dist/index-CCKe-Mpx.js +6 -0
- package/dist/{index-DdnpnyX2.js → index-CQhYMnjT.js} +4 -4
- package/dist/{index-C9KW2H79.js → index-CpDnqHCm.js} +1 -1
- package/dist/{index-CxK6rt_N.js → index-CtSXVDca.js} +8 -8
- package/dist/{index-umR1UobZ.js → index-Cv867SGx.js} +1 -1
- package/dist/{index-CuMpq4Un.js → index-CxO14pcK.js} +2 -2
- package/dist/index-DFZozV_h.js +68 -0
- package/dist/index-DLfXSskr.js +255 -0
- package/dist/{index-D2uXV4lz.js → index-DMCYNwtg.js} +8 -8
- package/dist/index-DYHsXnnS.js +144 -0
- package/dist/{index-nluJZSbA.js → index-DfNPZZ8M.js} +1 -1
- package/dist/{index-Dy7YuPrV.js → index-f0YS5Ufh.js} +319 -321
- package/dist/lib/utils.js +1 -1
- package/dist/{utils-Dy2WjYNJ.js → utils-CRiPKpXj.js} +41 -42
- package/package.json +32 -26
- package/dist/index-CL4N9wMT.js +0 -259
- package/dist/index-DLeNytVF.js +0 -9
- package/dist/index-DYfkNB0n.js +0 -54
- package/dist/index-DuekHEmj.js +0 -6
- package/dist/index-DwYXX2sM.js +0 -13
- package/dist/index-QMp1pYFl.js +0 -145
- package/dist/index-UFb2E87s.js +0 -70
- package/dist/index-p7nYL7BU.js +0 -71
|
@@ -144,7 +144,7 @@ class le {
|
|
|
144
144
|
];
|
|
145
145
|
}, this.create = (o) => {
|
|
146
146
|
var e;
|
|
147
|
-
const { message: s, ...E } = o, l = typeof
|
|
147
|
+
const { message: s, ...E } = o, l = typeof o?.id == "number" || ((e = o.id) == null ? void 0 : e.length) > 0 ? o.id : wt++, b = this.toasts.find((f) => f.id === l), T = o.dismissible === void 0 ? !0 : o.dismissible;
|
|
148
148
|
return this.dismissedToasts.has(l) && this.dismissedToasts.delete(l), b ? this.toasts = this.toasts.map((f) => f.id === l ? (this.publish({
|
|
149
149
|
...f,
|
|
150
150
|
...o,
|
|
@@ -275,7 +275,7 @@ class le {
|
|
|
275
275
|
unwrap: f
|
|
276
276
|
});
|
|
277
277
|
}, this.custom = (o, e) => {
|
|
278
|
-
const s =
|
|
278
|
+
const s = e?.id || wt++;
|
|
279
279
|
return this.create({
|
|
280
280
|
jsx: o(s),
|
|
281
281
|
id: s,
|
|
@@ -285,7 +285,7 @@ class le {
|
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
const k = new le(), de = (n, o) => {
|
|
288
|
-
const e =
|
|
288
|
+
const e = o?.id || wt++;
|
|
289
289
|
return k.addToast({
|
|
290
290
|
title: n,
|
|
291
291
|
...o,
|
|
@@ -426,24 +426,24 @@ const Ee = (n) => {
|
|
|
426
426
|
]);
|
|
427
427
|
function Vt() {
|
|
428
428
|
var r;
|
|
429
|
-
if (I
|
|
429
|
+
if (I?.loading) {
|
|
430
430
|
var w;
|
|
431
431
|
return /* @__PURE__ */ a.createElement("div", {
|
|
432
|
-
className: L(d
|
|
432
|
+
className: L(d?.loader, t == null || (w = t.classNames) == null ? void 0 : w.loader, "sonner-loader"),
|
|
433
433
|
"data-visible": N === "loading"
|
|
434
434
|
}, I.loading);
|
|
435
435
|
}
|
|
436
436
|
return /* @__PURE__ */ a.createElement(ee, {
|
|
437
|
-
className: L(d
|
|
437
|
+
className: L(d?.loader, t == null || (r = t.classNames) == null ? void 0 : r.loader),
|
|
438
438
|
visible: N === "loading"
|
|
439
439
|
});
|
|
440
440
|
}
|
|
441
|
-
const Ut = t.icon ||
|
|
441
|
+
const Ut = t.icon || I?.[N] || Zt(N);
|
|
442
442
|
var Rt, Dt;
|
|
443
443
|
return /* @__PURE__ */ a.createElement("li", {
|
|
444
444
|
tabIndex: 0,
|
|
445
445
|
ref: $,
|
|
446
|
-
className: L(gt, Lt, d
|
|
446
|
+
className: L(gt, Lt, d?.toast, t == null || (o = t.classNames) == null ? void 0 : o.toast, d?.default, d?.[N], t == null || (e = t.classNames) == null ? void 0 : e[N]),
|
|
447
447
|
"data-sonner-toast": "",
|
|
448
448
|
"data-rich-colors": (Rt = t.richColors) != null ? Rt : O,
|
|
449
449
|
"data-styled": !(t.jsx || t.unstyled || R),
|
|
@@ -476,10 +476,10 @@ const Ee = (n) => {
|
|
|
476
476
|
K(!1), tt(null), J.current = null;
|
|
477
477
|
},
|
|
478
478
|
onPointerDown: (r) => {
|
|
479
|
-
yt || !q || (Tt.current = /* @__PURE__ */ new Date(), bt(G.current), r.target.setPointerCapture(r.pointerId), r.target.tagName !== "BUTTON" && (K(!0), J.current = {
|
|
479
|
+
r.button !== 2 && (yt || !q || (Tt.current = /* @__PURE__ */ new Date(), bt(G.current), r.target.setPointerCapture(r.pointerId), r.target.tagName !== "BUTTON" && (K(!0), J.current = {
|
|
480
480
|
x: r.clientX,
|
|
481
481
|
y: r.clientY
|
|
482
|
-
}));
|
|
482
|
+
})));
|
|
483
483
|
},
|
|
484
484
|
onPointerUp: () => {
|
|
485
485
|
var r, w, S;
|
|
@@ -532,19 +532,19 @@ const Ee = (n) => {
|
|
|
532
532
|
} : () => {
|
|
533
533
|
Y(), t.onDismiss == null || t.onDismiss.call(t, t);
|
|
534
534
|
},
|
|
535
|
-
className: L(d
|
|
536
|
-
}, (Dt = I
|
|
535
|
+
className: L(d?.closeButton, t == null || (s = t.classNames) == null ? void 0 : s.closeButton)
|
|
536
|
+
}, (Dt = I?.close) != null ? Dt : re) : null, (N || t.icon || t.promise) && t.icon !== null && (I?.[N] !== null || t.icon) ? /* @__PURE__ */ a.createElement("div", {
|
|
537
537
|
"data-icon": "",
|
|
538
|
-
className: L(d
|
|
538
|
+
className: L(d?.icon, t == null || (E = t.classNames) == null ? void 0 : E.icon)
|
|
539
539
|
}, t.promise || t.type === "loading" && !t.icon ? t.icon || Vt() : null, t.type !== "loading" ? Ut : null) : null, /* @__PURE__ */ a.createElement("div", {
|
|
540
540
|
"data-content": "",
|
|
541
|
-
className: L(d
|
|
541
|
+
className: L(d?.content, t == null || (l = t.classNames) == null ? void 0 : l.content)
|
|
542
542
|
}, /* @__PURE__ */ a.createElement("div", {
|
|
543
543
|
"data-title": "",
|
|
544
|
-
className: L(d
|
|
544
|
+
className: L(d?.title, t == null || (b = t.classNames) == null ? void 0 : b.title)
|
|
545
545
|
}, t.jsx ? t.jsx : typeof t.title == "function" ? t.title() : t.title), t.description ? /* @__PURE__ */ a.createElement("div", {
|
|
546
546
|
"data-description": "",
|
|
547
|
-
className: L(P, Pt, d
|
|
547
|
+
className: L(P, Pt, d?.description, t == null || (T = t.classNames) == null ? void 0 : T.description)
|
|
548
548
|
}, typeof t.description == "function" ? t.description() : t.description) : null), /* @__PURE__ */ a.isValidElement(t.cancel) ? t.cancel : t.cancel && ut(t.cancel) ? /* @__PURE__ */ a.createElement("button", {
|
|
549
549
|
"data-button": !0,
|
|
550
550
|
"data-cancel": !0,
|
|
@@ -552,7 +552,7 @@ const Ee = (n) => {
|
|
|
552
552
|
onClick: (r) => {
|
|
553
553
|
ut(t.cancel) && q && (t.cancel.onClick == null || t.cancel.onClick.call(t.cancel, r), Y());
|
|
554
554
|
},
|
|
555
|
-
className: L(d
|
|
555
|
+
className: L(d?.cancelButton, t == null || (f = t.classNames) == null ? void 0 : f.cancelButton)
|
|
556
556
|
}, t.cancel.label) : null, /* @__PURE__ */ a.isValidElement(t.action) ? t.action : t.action && ut(t.action) ? /* @__PURE__ */ a.createElement("button", {
|
|
557
557
|
"data-button": !0,
|
|
558
558
|
"data-action": !0,
|
|
@@ -560,7 +560,7 @@ const Ee = (n) => {
|
|
|
560
560
|
onClick: (r) => {
|
|
561
561
|
ut(t.action) && (t.action.onClick == null || t.action.onClick.call(t.action, r), !r.defaultPrevented && Y());
|
|
562
562
|
},
|
|
563
|
-
className: L(d
|
|
563
|
+
className: L(d?.actionButton, t == null || (i = t.classNames) == null ? void 0 : i.actionButton)
|
|
564
564
|
}, t.action.label) : null);
|
|
565
565
|
};
|
|
566
566
|
function It() {
|
|
@@ -742,20 +742,20 @@ const Se = /* @__PURE__ */ a.forwardRef(function(o, e) {
|
|
|
742
742
|
index: et,
|
|
743
743
|
toast: h,
|
|
744
744
|
defaultRichColors: R,
|
|
745
|
-
duration: (K = c
|
|
746
|
-
className: c
|
|
747
|
-
descriptionClassName: c
|
|
745
|
+
duration: (K = c?.duration) != null ? K : p,
|
|
746
|
+
className: c?.className,
|
|
747
|
+
descriptionClassName: c?.descriptionClassName,
|
|
748
748
|
invert: s,
|
|
749
749
|
visibleToasts: U,
|
|
750
|
-
closeButton: (at = c
|
|
750
|
+
closeButton: (at = c?.closeButton) != null ? at : T,
|
|
751
751
|
interacting: X,
|
|
752
752
|
position: u,
|
|
753
|
-
style: c
|
|
754
|
-
unstyled: c
|
|
755
|
-
classNames: c
|
|
756
|
-
cancelButtonStyle: c
|
|
757
|
-
actionButtonStyle: c
|
|
758
|
-
closeButtonAriaLabel: c
|
|
753
|
+
style: c?.style,
|
|
754
|
+
unstyled: c?.unstyled,
|
|
755
|
+
classNames: c?.classNames,
|
|
756
|
+
cancelButtonStyle: c?.cancelButtonStyle,
|
|
757
|
+
actionButtonStyle: c?.actionButtonStyle,
|
|
758
|
+
closeButtonAriaLabel: c?.closeButtonAriaLabel,
|
|
759
759
|
removeToast: tt,
|
|
760
760
|
toasts: O.filter((ot) => ot.position == h.position),
|
|
761
761
|
heights: it.filter((ot) => ot.position == h.position),
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as I, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import * as a from "react";
|
|
3
|
-
import { c as M } from "../../../index-
|
|
4
|
-
import { u as x } from "../../../index-
|
|
5
|
-
import { c as H } from "../../../index-
|
|
6
|
-
import { u as j } from "../../../index-
|
|
3
|
+
import { c as M } from "../../../index-B695uy69.js";
|
|
4
|
+
import { u as x } from "../../../index-5Bhkapwi.js";
|
|
5
|
+
import { c as H } from "../../../index-DFZozV_h.js";
|
|
6
|
+
import { u as j } from "../../../index-437EL2iq.js";
|
|
7
7
|
import { u as z } from "../../../index-BZPx6jYI.js";
|
|
8
|
-
import { u as A } from "../../../index-
|
|
9
|
-
import { P as y } from "../../../index-
|
|
10
|
-
import { c as C } from "../../../utils-
|
|
8
|
+
import { u as A } from "../../../index-BGQepRFJ.js";
|
|
9
|
+
import { P as y } from "../../../index-CpDnqHCm.js";
|
|
10
|
+
import { c as C } from "../../../utils-CRiPKpXj.js";
|
|
11
11
|
var m = "Switch", [U, Z] = H(m), [q, L] = U(m), P = a.forwardRef(
|
|
12
12
|
(e, r) => {
|
|
13
13
|
const {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as l, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
|
-
import { c as o } from "../../../utils-
|
|
3
|
+
import { c as o } from "../../../utils-CRiPKpXj.js";
|
|
4
4
|
import { ScrollArea as n, ScrollBar as c } from "./scroll-area.js";
|
|
5
5
|
const d = s.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ l(n, { className: "relative w-full", viewPortClassName: "px-0", children: [
|
|
6
6
|
/* @__PURE__ */ a(
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import * as f from "react";
|
|
3
|
-
import { c as T } from "../../../index-
|
|
4
|
-
import { c as M } from "../../../index-
|
|
5
|
-
import { c as h, R as k, I as E } from "../../../index-
|
|
6
|
-
import { P as F } from "../../../index-
|
|
7
|
-
import { P as m } from "../../../index-
|
|
3
|
+
import { c as T } from "../../../index-B695uy69.js";
|
|
4
|
+
import { c as M } from "../../../index-DFZozV_h.js";
|
|
5
|
+
import { c as h, R as k, I as E } from "../../../index-DMCYNwtg.js";
|
|
6
|
+
import { P as F } from "../../../index-C8_QusYl.js";
|
|
7
|
+
import { P as m } from "../../../index-CpDnqHCm.js";
|
|
8
8
|
import { u as $ } from "../../../index-ByaXH_ih.js";
|
|
9
|
-
import { u as D } from "../../../index-
|
|
10
|
-
import { u as V } from "../../../index-
|
|
11
|
-
import { c as p } from "../../../utils-
|
|
9
|
+
import { u as D } from "../../../index-437EL2iq.js";
|
|
10
|
+
import { u as V } from "../../../index-Cv867SGx.js";
|
|
11
|
+
import { c as p } from "../../../utils-CRiPKpXj.js";
|
|
12
12
|
var g = "Tabs", [G, ee] = M(g, [
|
|
13
13
|
h
|
|
14
14
|
]), C = h(), [L, x] = G(g), I = f.forwardRef(
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import * as u from "react";
|
|
3
|
-
import { c as f } from "../../../index-
|
|
4
|
-
import { u as g } from "../../../index-
|
|
5
|
-
import { P as m } from "../../../index-
|
|
6
|
-
import { c as v } from "../../../index-
|
|
7
|
-
import { c as p } from "../../../utils-
|
|
3
|
+
import { c as f } from "../../../index-B695uy69.js";
|
|
4
|
+
import { u as g } from "../../../index-437EL2iq.js";
|
|
5
|
+
import { P as m } from "../../../index-CpDnqHCm.js";
|
|
6
|
+
import { c as v } from "../../../index-CQhYMnjT.js";
|
|
7
|
+
import { c as p } from "../../../utils-CRiPKpXj.js";
|
|
8
8
|
var s = "Toggle", i = u.forwardRef((e, t) => {
|
|
9
9
|
const { pressed: r, defaultPressed: a, onPressedChange: d, ...l } = e, [o, c] = g({
|
|
10
10
|
prop: r,
|
|
@@ -1,94 +1,94 @@
|
|
|
1
1
|
import { jsx as u, jsxs as H } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import { c as C } from "../../../index-
|
|
4
|
-
import { u as S, a as K } from "../../../index-
|
|
5
|
-
import { c as W } from "../../../index-
|
|
6
|
-
import { P as J, D as Q } from "../../../index-
|
|
7
|
-
import { u as Z } from "../../../index-
|
|
8
|
-
import { c as G, R as ee, A as te, a as oe, C as re } from "../../../index-
|
|
9
|
-
import { P as j } from "../../../index-
|
|
10
|
-
import { P as ne } from "../../../index-
|
|
11
|
-
import { u as
|
|
12
|
-
import { R as
|
|
13
|
-
import { c as ie } from "../../../utils-
|
|
14
|
-
var [
|
|
2
|
+
import * as a from "react";
|
|
3
|
+
import { c as C } from "../../../index-B695uy69.js";
|
|
4
|
+
import { u as S, a as K } from "../../../index-5Bhkapwi.js";
|
|
5
|
+
import { c as W } from "../../../index-DFZozV_h.js";
|
|
6
|
+
import { P as J, D as Q } from "../../../index-DYHsXnnS.js";
|
|
7
|
+
import { u as Z } from "../../../index-Cv867SGx.js";
|
|
8
|
+
import { c as G, R as ee, A as te, a as oe, C as re } from "../../../index-f0YS5Ufh.js";
|
|
9
|
+
import { P as j } from "../../../index-C8_QusYl.js";
|
|
10
|
+
import { P as ne } from "../../../index-CpDnqHCm.js";
|
|
11
|
+
import { u as ae } from "../../../index-437EL2iq.js";
|
|
12
|
+
import { R as se } from "../../../index-DfNPZZ8M.js";
|
|
13
|
+
import { c as ie } from "../../../utils-CRiPKpXj.js";
|
|
14
|
+
var [O, $e] = W("Tooltip", [
|
|
15
15
|
G
|
|
16
|
-
]),
|
|
16
|
+
]), D = G(), F = "TooltipProvider", le = 700, A = "tooltip.open", [ce, k] = O(F), z = (e) => {
|
|
17
17
|
const {
|
|
18
18
|
__scopeTooltip: o,
|
|
19
19
|
delayDuration: t = le,
|
|
20
20
|
skipDelayDuration: r = 300,
|
|
21
21
|
disableHoverableContent: n = !1,
|
|
22
|
-
children:
|
|
23
|
-
} = e,
|
|
24
|
-
return
|
|
25
|
-
const d =
|
|
22
|
+
children: l
|
|
23
|
+
} = e, i = a.useRef(!0), v = a.useRef(!1), s = a.useRef(0);
|
|
24
|
+
return a.useEffect(() => {
|
|
25
|
+
const d = s.current;
|
|
26
26
|
return () => window.clearTimeout(d);
|
|
27
27
|
}, []), /* @__PURE__ */ u(
|
|
28
28
|
ce,
|
|
29
29
|
{
|
|
30
30
|
scope: o,
|
|
31
|
-
isOpenDelayedRef:
|
|
31
|
+
isOpenDelayedRef: i,
|
|
32
32
|
delayDuration: t,
|
|
33
|
-
onOpen:
|
|
34
|
-
window.clearTimeout(
|
|
33
|
+
onOpen: a.useCallback(() => {
|
|
34
|
+
window.clearTimeout(s.current), i.current = !1;
|
|
35
35
|
}, []),
|
|
36
|
-
onClose:
|
|
37
|
-
window.clearTimeout(
|
|
38
|
-
() =>
|
|
36
|
+
onClose: a.useCallback(() => {
|
|
37
|
+
window.clearTimeout(s.current), s.current = window.setTimeout(
|
|
38
|
+
() => i.current = !0,
|
|
39
39
|
r
|
|
40
40
|
);
|
|
41
41
|
}, [r]),
|
|
42
42
|
isPointerInTransitRef: v,
|
|
43
|
-
onPointerInTransitChange:
|
|
43
|
+
onPointerInTransitChange: a.useCallback((d) => {
|
|
44
44
|
v.current = d;
|
|
45
45
|
}, []),
|
|
46
46
|
disableHoverableContent: n,
|
|
47
|
-
children:
|
|
47
|
+
children: l
|
|
48
48
|
}
|
|
49
49
|
);
|
|
50
50
|
};
|
|
51
51
|
z.displayName = F;
|
|
52
|
-
var R = "Tooltip", [ue, _] =
|
|
52
|
+
var R = "Tooltip", [ue, _] = O(R), $ = (e) => {
|
|
53
53
|
const {
|
|
54
54
|
__scopeTooltip: o,
|
|
55
55
|
children: t,
|
|
56
56
|
open: r,
|
|
57
57
|
defaultOpen: n,
|
|
58
|
-
onOpenChange:
|
|
59
|
-
disableHoverableContent:
|
|
58
|
+
onOpenChange: l,
|
|
59
|
+
disableHoverableContent: i,
|
|
60
60
|
delayDuration: v
|
|
61
|
-
} = e,
|
|
61
|
+
} = e, s = k(R, e.__scopeTooltip), d = D(o), [c, f] = a.useState(null), m = Z(), p = a.useRef(0), h = i ?? s.disableHoverableContent, g = v ?? s.delayDuration, T = a.useRef(!1), [x, y] = ae({
|
|
62
62
|
prop: r,
|
|
63
63
|
defaultProp: n ?? !1,
|
|
64
64
|
onChange: (N) => {
|
|
65
|
-
N ? (
|
|
65
|
+
N ? (s.onOpen(), document.dispatchEvent(new CustomEvent(A))) : s.onClose(), l?.(N);
|
|
66
66
|
},
|
|
67
67
|
caller: R
|
|
68
|
-
}), w =
|
|
69
|
-
window.clearTimeout(p.current), p.current = 0, T.current = !1,
|
|
70
|
-
}, [
|
|
71
|
-
window.clearTimeout(p.current), p.current = 0,
|
|
72
|
-
}, [
|
|
68
|
+
}), w = a.useMemo(() => x ? T.current ? "delayed-open" : "instant-open" : "closed", [x]), P = a.useCallback(() => {
|
|
69
|
+
window.clearTimeout(p.current), p.current = 0, T.current = !1, y(!0);
|
|
70
|
+
}, [y]), E = a.useCallback(() => {
|
|
71
|
+
window.clearTimeout(p.current), p.current = 0, y(!1);
|
|
72
|
+
}, [y]), I = a.useCallback(() => {
|
|
73
73
|
window.clearTimeout(p.current), p.current = window.setTimeout(() => {
|
|
74
|
-
T.current = !0,
|
|
75
|
-
},
|
|
76
|
-
}, [
|
|
77
|
-
return
|
|
74
|
+
T.current = !0, y(!0), p.current = 0;
|
|
75
|
+
}, g);
|
|
76
|
+
}, [g, y]);
|
|
77
|
+
return a.useEffect(() => () => {
|
|
78
78
|
p.current && (window.clearTimeout(p.current), p.current = 0);
|
|
79
79
|
}, []), /* @__PURE__ */ u(ee, { ...d, children: /* @__PURE__ */ u(
|
|
80
80
|
ue,
|
|
81
81
|
{
|
|
82
82
|
scope: o,
|
|
83
83
|
contentId: m,
|
|
84
|
-
open:
|
|
84
|
+
open: x,
|
|
85
85
|
stateAttribute: w,
|
|
86
86
|
trigger: c,
|
|
87
87
|
onTriggerChange: f,
|
|
88
|
-
onTriggerEnter:
|
|
89
|
-
|
|
90
|
-
}, [
|
|
91
|
-
onTriggerLeave:
|
|
88
|
+
onTriggerEnter: a.useCallback(() => {
|
|
89
|
+
s.isOpenDelayedRef.current ? I() : P();
|
|
90
|
+
}, [s.isOpenDelayedRef, I, P]),
|
|
91
|
+
onTriggerLeave: a.useCallback(() => {
|
|
92
92
|
h ? E() : (window.clearTimeout(p.current), p.current = 0);
|
|
93
93
|
}, [E, h]),
|
|
94
94
|
onOpen: P,
|
|
@@ -99,18 +99,18 @@ var R = "Tooltip", [ue, _] = D(R), $ = (e) => {
|
|
|
99
99
|
) });
|
|
100
100
|
};
|
|
101
101
|
$.displayName = R;
|
|
102
|
-
var L = "TooltipTrigger", B =
|
|
102
|
+
var L = "TooltipTrigger", B = a.forwardRef(
|
|
103
103
|
(e, o) => {
|
|
104
|
-
const { __scopeTooltip: t, ...r } = e, n = _(L, t),
|
|
105
|
-
return
|
|
104
|
+
const { __scopeTooltip: t, ...r } = e, n = _(L, t), l = k(L, t), i = D(t), v = a.useRef(null), s = S(o, v, n.onTriggerChange), d = a.useRef(!1), c = a.useRef(!1), f = a.useCallback(() => d.current = !1, []);
|
|
105
|
+
return a.useEffect(() => () => document.removeEventListener("pointerup", f), [f]), /* @__PURE__ */ u(te, { asChild: !0, ...i, children: /* @__PURE__ */ u(
|
|
106
106
|
ne.button,
|
|
107
107
|
{
|
|
108
108
|
"aria-describedby": n.open ? n.contentId : void 0,
|
|
109
109
|
"data-state": n.stateAttribute,
|
|
110
110
|
...r,
|
|
111
|
-
ref:
|
|
111
|
+
ref: s,
|
|
112
112
|
onPointerMove: C(e.onPointerMove, (m) => {
|
|
113
|
-
m.pointerType !== "touch" && !c.current && !
|
|
113
|
+
m.pointerType !== "touch" && !c.current && !l.isPointerInTransitRef.current && (n.onTriggerEnter(), c.current = !0);
|
|
114
114
|
}),
|
|
115
115
|
onPointerLeave: C(e.onPointerLeave, () => {
|
|
116
116
|
n.onTriggerLeave(), c.current = !1;
|
|
@@ -128,75 +128,74 @@ var L = "TooltipTrigger", B = s.forwardRef(
|
|
|
128
128
|
}
|
|
129
129
|
);
|
|
130
130
|
B.displayName = L;
|
|
131
|
-
var M = "TooltipPortal", [pe, de] =
|
|
131
|
+
var M = "TooltipPortal", [pe, de] = O(M, {
|
|
132
132
|
forceMount: void 0
|
|
133
133
|
}), U = (e) => {
|
|
134
|
-
const { __scopeTooltip: o, forceMount: t, children: r, container: n } = e,
|
|
135
|
-
return /* @__PURE__ */ u(pe, { scope: o, forceMount: t, children: /* @__PURE__ */ u(j, { present: t ||
|
|
134
|
+
const { __scopeTooltip: o, forceMount: t, children: r, container: n } = e, l = _(M, o);
|
|
135
|
+
return /* @__PURE__ */ u(pe, { scope: o, forceMount: t, children: /* @__PURE__ */ u(j, { present: t || l.open, children: /* @__PURE__ */ u(J, { asChild: !0, container: n, children: r }) }) });
|
|
136
136
|
};
|
|
137
137
|
U.displayName = M;
|
|
138
|
-
var b = "TooltipContent", V =
|
|
138
|
+
var b = "TooltipContent", V = a.forwardRef(
|
|
139
139
|
(e, o) => {
|
|
140
|
-
const t = de(b, e.__scopeTooltip), { forceMount: r = t.forceMount, side: n = "top", ...
|
|
141
|
-
return /* @__PURE__ */ u(j, { present: r ||
|
|
140
|
+
const t = de(b, e.__scopeTooltip), { forceMount: r = t.forceMount, side: n = "top", ...l } = e, i = _(b, e.__scopeTooltip);
|
|
141
|
+
return /* @__PURE__ */ u(j, { present: r || i.open, children: i.disableHoverableContent ? /* @__PURE__ */ u(Y, { side: n, ...l, ref: o }) : /* @__PURE__ */ u(fe, { side: n, ...l, ref: o }) });
|
|
142
142
|
}
|
|
143
|
-
), fe =
|
|
144
|
-
const t = _(b, e.__scopeTooltip), r = k(b, e.__scopeTooltip), n =
|
|
143
|
+
), fe = a.forwardRef((e, o) => {
|
|
144
|
+
const t = _(b, e.__scopeTooltip), r = k(b, e.__scopeTooltip), n = a.useRef(null), l = S(o, n), [i, v] = a.useState(null), { trigger: s, onClose: d } = t, c = n.current, { onPointerInTransitChange: f } = r, m = a.useCallback(() => {
|
|
145
145
|
v(null), f(!1);
|
|
146
|
-
}, [f]), p =
|
|
147
|
-
(h,
|
|
148
|
-
const T = h.currentTarget,
|
|
146
|
+
}, [f]), p = a.useCallback(
|
|
147
|
+
(h, g) => {
|
|
148
|
+
const T = h.currentTarget, x = { x: h.clientX, y: h.clientY }, y = Te(x, T.getBoundingClientRect()), w = ge(x, y), P = ye(g.getBoundingClientRect()), E = Ce([...w, ...P]);
|
|
149
149
|
v(E), f(!0);
|
|
150
150
|
},
|
|
151
151
|
[f]
|
|
152
152
|
);
|
|
153
|
-
return
|
|
154
|
-
if (
|
|
155
|
-
const h = (T) => p(T, c),
|
|
156
|
-
return
|
|
157
|
-
|
|
153
|
+
return a.useEffect(() => () => m(), [m]), a.useEffect(() => {
|
|
154
|
+
if (s && c) {
|
|
155
|
+
const h = (T) => p(T, c), g = (T) => p(T, s);
|
|
156
|
+
return s.addEventListener("pointerleave", h), c.addEventListener("pointerleave", g), () => {
|
|
157
|
+
s.removeEventListener("pointerleave", h), c.removeEventListener("pointerleave", g);
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
|
-
}, [
|
|
161
|
-
if (
|
|
162
|
-
const h = (
|
|
163
|
-
const T =
|
|
164
|
-
|
|
160
|
+
}, [s, c, p, m]), a.useEffect(() => {
|
|
161
|
+
if (i) {
|
|
162
|
+
const h = (g) => {
|
|
163
|
+
const T = g.target, x = { x: g.clientX, y: g.clientY }, y = s?.contains(T) || c?.contains(T), w = !xe(x, i);
|
|
164
|
+
y ? m() : w && (m(), d());
|
|
165
165
|
};
|
|
166
166
|
return document.addEventListener("pointermove", h), () => document.removeEventListener("pointermove", h);
|
|
167
167
|
}
|
|
168
|
-
}, [
|
|
169
|
-
}), [ve, me] =
|
|
168
|
+
}, [s, c, i, d, m]), /* @__PURE__ */ u(Y, { ...e, ref: l });
|
|
169
|
+
}), [ve, me] = O(R, { isInside: !1 }), he = K("TooltipContent"), Y = a.forwardRef(
|
|
170
170
|
(e, o) => {
|
|
171
171
|
const {
|
|
172
172
|
__scopeTooltip: t,
|
|
173
173
|
children: r,
|
|
174
174
|
"aria-label": n,
|
|
175
|
-
onEscapeKeyDown:
|
|
176
|
-
onPointerDownOutside:
|
|
175
|
+
onEscapeKeyDown: l,
|
|
176
|
+
onPointerDownOutside: i,
|
|
177
177
|
...v
|
|
178
|
-
} = e,
|
|
179
|
-
return
|
|
180
|
-
if (
|
|
178
|
+
} = e, s = _(b, t), d = D(t), { onClose: c } = s;
|
|
179
|
+
return a.useEffect(() => (document.addEventListener(A, c), () => document.removeEventListener(A, c)), [c]), a.useEffect(() => {
|
|
180
|
+
if (s.trigger) {
|
|
181
181
|
const f = (m) => {
|
|
182
|
-
|
|
183
|
-
p != null && p.contains(a.trigger) && c();
|
|
182
|
+
m.target?.contains(s.trigger) && c();
|
|
184
183
|
};
|
|
185
184
|
return window.addEventListener("scroll", f, { capture: !0 }), () => window.removeEventListener("scroll", f, { capture: !0 });
|
|
186
185
|
}
|
|
187
|
-
}, [
|
|
186
|
+
}, [s.trigger, c]), /* @__PURE__ */ u(
|
|
188
187
|
Q,
|
|
189
188
|
{
|
|
190
189
|
asChild: !0,
|
|
191
190
|
disableOutsidePointerEvents: !1,
|
|
192
|
-
onEscapeKeyDown:
|
|
193
|
-
onPointerDownOutside:
|
|
191
|
+
onEscapeKeyDown: l,
|
|
192
|
+
onPointerDownOutside: i,
|
|
194
193
|
onFocusOutside: (f) => f.preventDefault(),
|
|
195
194
|
onDismiss: c,
|
|
196
195
|
children: /* @__PURE__ */ H(
|
|
197
196
|
re,
|
|
198
197
|
{
|
|
199
|
-
"data-state":
|
|
198
|
+
"data-state": s.stateAttribute,
|
|
200
199
|
...d,
|
|
201
200
|
...v,
|
|
202
201
|
ref: o,
|
|
@@ -210,7 +209,7 @@ var b = "TooltipContent", V = s.forwardRef(
|
|
|
210
209
|
},
|
|
211
210
|
children: [
|
|
212
211
|
/* @__PURE__ */ u(he, { children: r }),
|
|
213
|
-
/* @__PURE__ */ u(ve, { scope: t, isInside: !0, children: /* @__PURE__ */ u(
|
|
212
|
+
/* @__PURE__ */ u(ve, { scope: t, isInside: !0, children: /* @__PURE__ */ u(se, { id: s.contentId, role: "tooltip", children: n || r }) })
|
|
214
213
|
]
|
|
215
214
|
}
|
|
216
215
|
)
|
|
@@ -219,9 +218,9 @@ var b = "TooltipContent", V = s.forwardRef(
|
|
|
219
218
|
}
|
|
220
219
|
);
|
|
221
220
|
V.displayName = b;
|
|
222
|
-
var q = "TooltipArrow", X =
|
|
221
|
+
var q = "TooltipArrow", X = a.forwardRef(
|
|
223
222
|
(e, o) => {
|
|
224
|
-
const { __scopeTooltip: t, ...r } = e, n =
|
|
223
|
+
const { __scopeTooltip: t, ...r } = e, n = D(t);
|
|
225
224
|
return me(
|
|
226
225
|
q,
|
|
227
226
|
t
|
|
@@ -230,9 +229,9 @@ var q = "TooltipArrow", X = s.forwardRef(
|
|
|
230
229
|
);
|
|
231
230
|
X.displayName = q;
|
|
232
231
|
function Te(e, o) {
|
|
233
|
-
const t = Math.abs(o.top - e.y), r = Math.abs(o.bottom - e.y), n = Math.abs(o.right - e.x),
|
|
234
|
-
switch (Math.min(t, r, n,
|
|
235
|
-
case
|
|
232
|
+
const t = Math.abs(o.top - e.y), r = Math.abs(o.bottom - e.y), n = Math.abs(o.right - e.x), l = Math.abs(o.left - e.x);
|
|
233
|
+
switch (Math.min(t, r, n, l)) {
|
|
234
|
+
case l:
|
|
236
235
|
return "left";
|
|
237
236
|
case n:
|
|
238
237
|
return "right";
|
|
@@ -244,7 +243,7 @@ function Te(e, o) {
|
|
|
244
243
|
throw new Error("unreachable");
|
|
245
244
|
}
|
|
246
245
|
}
|
|
247
|
-
function
|
|
246
|
+
function ge(e, o, t = 5) {
|
|
248
247
|
const r = [];
|
|
249
248
|
switch (o) {
|
|
250
249
|
case "top":
|
|
@@ -274,7 +273,7 @@ function ye(e, o, t = 5) {
|
|
|
274
273
|
}
|
|
275
274
|
return r;
|
|
276
275
|
}
|
|
277
|
-
function
|
|
276
|
+
function ye(e) {
|
|
278
277
|
const { top: o, right: t, bottom: r, left: n } = e;
|
|
279
278
|
return [
|
|
280
279
|
{ x: n, y: o },
|
|
@@ -283,11 +282,11 @@ function xe(e) {
|
|
|
283
282
|
{ x: n, y: r }
|
|
284
283
|
];
|
|
285
284
|
}
|
|
286
|
-
function
|
|
285
|
+
function xe(e, o) {
|
|
287
286
|
const { x: t, y: r } = e;
|
|
288
287
|
let n = !1;
|
|
289
|
-
for (let
|
|
290
|
-
const v = o[
|
|
288
|
+
for (let l = 0, i = o.length - 1; l < o.length; i = l++) {
|
|
289
|
+
const v = o[l], s = o[i], d = v.x, c = v.y, f = s.x, m = s.y;
|
|
291
290
|
c > r != m > r && t < (f - d) * (r - c) / (m - c) + d && (n = !n);
|
|
292
291
|
}
|
|
293
292
|
return n;
|
|
@@ -302,8 +301,8 @@ function be(e) {
|
|
|
302
301
|
for (let r = 0; r < e.length; r++) {
|
|
303
302
|
const n = e[r];
|
|
304
303
|
for (; o.length >= 2; ) {
|
|
305
|
-
const
|
|
306
|
-
if ((
|
|
304
|
+
const l = o[o.length - 1], i = o[o.length - 2];
|
|
305
|
+
if ((l.x - i.x) * (n.y - i.y) >= (l.y - i.y) * (n.x - i.x)) o.pop();
|
|
307
306
|
else break;
|
|
308
307
|
}
|
|
309
308
|
o.push(n);
|
|
@@ -313,16 +312,16 @@ function be(e) {
|
|
|
313
312
|
for (let r = e.length - 1; r >= 0; r--) {
|
|
314
313
|
const n = e[r];
|
|
315
314
|
for (; t.length >= 2; ) {
|
|
316
|
-
const
|
|
317
|
-
if ((
|
|
315
|
+
const l = t[t.length - 1], i = t[t.length - 2];
|
|
316
|
+
if ((l.x - i.x) * (n.y - i.y) >= (l.y - i.y) * (n.x - i.x)) t.pop();
|
|
318
317
|
else break;
|
|
319
318
|
}
|
|
320
319
|
t.push(n);
|
|
321
320
|
}
|
|
322
321
|
return t.pop(), o.length === 1 && t.length === 1 && o[0].x === t[0].x && o[0].y === t[0].y ? o : o.concat(t);
|
|
323
322
|
}
|
|
324
|
-
var we = z, Pe = $, Ee = B, Re = U, _e = V,
|
|
325
|
-
function
|
|
323
|
+
var we = z, Pe = $, Ee = B, Re = U, _e = V, Oe = X;
|
|
324
|
+
function De({
|
|
326
325
|
delayDuration: e = 0,
|
|
327
326
|
...o
|
|
328
327
|
}) {
|
|
@@ -338,7 +337,7 @@ function Ae({
|
|
|
338
337
|
function Be({
|
|
339
338
|
...e
|
|
340
339
|
}) {
|
|
341
|
-
return /* @__PURE__ */ u(
|
|
340
|
+
return /* @__PURE__ */ u(De, { children: /* @__PURE__ */ u(Pe, { "data-slot": "tooltip", ...e }) });
|
|
342
341
|
}
|
|
343
342
|
function Ue({
|
|
344
343
|
...e
|
|
@@ -363,7 +362,7 @@ function Ve({
|
|
|
363
362
|
...r,
|
|
364
363
|
children: [
|
|
365
364
|
t,
|
|
366
|
-
/* @__PURE__ */ u(
|
|
365
|
+
/* @__PURE__ */ u(Oe, { className: "z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-primary fill-primary" })
|
|
367
366
|
]
|
|
368
367
|
}
|
|
369
368
|
) });
|
|
@@ -371,6 +370,6 @@ function Ve({
|
|
|
371
370
|
export {
|
|
372
371
|
Be as Tooltip,
|
|
373
372
|
Ve as TooltipContent,
|
|
374
|
-
|
|
373
|
+
De as TooltipProvider,
|
|
375
374
|
Ue as TooltipTrigger
|
|
376
375
|
};
|