konsolpro-custom-ui 0.0.373 → 0.0.374

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.
Files changed (52) hide show
  1. package/dist/chunks/tooltip-BpSOXQpC.js +887 -0
  2. package/dist/chunks/{uploader-BZOH5w5t.js → uploader-CjKnaZHc.js} +1 -1
  3. package/dist/lib/index.js +2 -2
  4. package/dist/lib/ui/accordion.js +2 -2
  5. package/dist/lib/ui/alert.js +1 -1
  6. package/dist/lib/ui/autocomplete.js +1 -1
  7. package/dist/lib/ui/banner.js +1 -1
  8. package/dist/lib/ui/button.js +2 -2
  9. package/dist/lib/ui/calendar.js +1 -1
  10. package/dist/lib/ui/combobox-base/combobox-base.js +1 -1
  11. package/dist/lib/ui/combobox-base/index.js +1 -1
  12. package/dist/lib/ui/combobox-multiselect/combobox-multiselect.js +1 -1
  13. package/dist/lib/ui/combobox-multiselect/index.js +1 -1
  14. package/dist/lib/ui/combobox-primitive/components/combobox-actions.js +2 -2
  15. package/dist/lib/ui/combobox-primitive/components/index.js +1 -1
  16. package/dist/lib/ui/combobox-primitive/index.js +1 -1
  17. package/dist/lib/ui/combobox.js +1 -1
  18. package/dist/lib/ui/date-picker.js +2 -2
  19. package/dist/lib/ui/date-range-picker.js +2 -2
  20. package/dist/lib/ui/dialog/dialog-base/dialog-base.js +1 -1
  21. package/dist/lib/ui/dialog/dialog-base/index.js +1 -1
  22. package/dist/lib/ui/dialog/dialog-primitive/dialog-primitive.js +1 -1
  23. package/dist/lib/ui/dialog/dialog-primitive/index.js +1 -1
  24. package/dist/lib/ui/dialog/index.js +1 -1
  25. package/dist/lib/ui/dropdown.js +1 -1
  26. package/dist/lib/ui/input-number/index.js +1 -1
  27. package/dist/lib/ui/input-number/input-number.js +1 -1
  28. package/dist/lib/ui/input.js +1 -1
  29. package/dist/lib/ui/masked-input.js +1 -1
  30. package/dist/lib/ui/modal.js +2 -2
  31. package/dist/lib/ui/otp-input.js +1 -1
  32. package/dist/lib/ui/pagination/pagination.js +1 -1
  33. package/dist/lib/ui/phone-input/phone-input.js +1 -1
  34. package/dist/lib/ui/radio.js +1 -1
  35. package/dist/lib/ui/schedule-calendar/calendar-day-card.js +1 -1
  36. package/dist/lib/ui/schedule-calendar/embla-calendar-card.js +1 -1
  37. package/dist/lib/ui/schedule-calendar/schedule-calendar-strip.js +1 -1
  38. package/dist/lib/ui/schedule-calendar/schedule-header.js +1 -1
  39. package/dist/lib/ui/select.js +1 -1
  40. package/dist/lib/ui/stepper.js +1 -1
  41. package/dist/lib/ui/table/table-empty-state.js +1 -1
  42. package/dist/lib/ui/table/table-settings.js +1 -1
  43. package/dist/lib/ui/textarea.js +1 -1
  44. package/dist/lib/ui/time-picker.js +2 -2
  45. package/dist/lib/ui/time-range-picker.js +2 -2
  46. package/dist/lib/ui/timeline.js +1 -1
  47. package/dist/lib/ui/tooltip.js +1 -1
  48. package/dist/lib/ui/typography.js +2 -2
  49. package/dist/lib/ui/uploader.js +1 -1
  50. package/dist/types/components/ui/tooltip.d.ts +3 -2
  51. package/package.json +1 -1
  52. package/dist/chunks/tooltip-BtM6elkS.js +0 -836
@@ -0,0 +1,887 @@
1
+ var dt = Object.defineProperty, ft = Object.defineProperties;
2
+ var pt = Object.getOwnPropertyDescriptors;
3
+ var V = Object.getOwnPropertySymbols;
4
+ var Te = Object.prototype.hasOwnProperty, Pe = Object.prototype.propertyIsEnumerable;
5
+ var we = (e, t, n) => t in e ? dt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, m = (e, t) => {
6
+ for (var n in t || (t = {}))
7
+ Te.call(t, n) && we(e, n, t[n]);
8
+ if (V)
9
+ for (var n of V(t))
10
+ Pe.call(t, n) && we(e, n, t[n]);
11
+ return e;
12
+ }, T = (e, t) => ft(e, pt(t));
13
+ var R = (e, t) => {
14
+ var n = {};
15
+ for (var r in e)
16
+ Te.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
17
+ if (e != null && V)
18
+ for (var r of V(e))
19
+ t.indexOf(r) < 0 && Pe.call(e, r) && (n[r] = e[r]);
20
+ return n;
21
+ };
22
+ import { jsx as v, jsxs as be } from "react/jsx-runtime";
23
+ import * as i from "react";
24
+ import N from "react";
25
+ import { u as L } from "./index-DLcqcWxM.js";
26
+ import { c as Ae } from "./index-E4d_Gd-w.js";
27
+ import { P as k, d as ht } from "./index-BJD1rYeT.js";
28
+ import { u as te } from "./index-DwYXX2sM.js";
29
+ import { u as mt } from "./index-NPrw3_0K.js";
30
+ import { u as vt } from "./index-1Er1dKQf.js";
31
+ import { R as yt, u as gt, o as wt, s as Tt, f as Pt, a as Ct, b as Et, h as xt, l as bt, c as At, P as Rt } from "./index-Ctjv6tIJ.js";
32
+ import { u as q } from "./index-DuekHEmj.js";
33
+ import { u as Nt } from "./index-CHDs-SiB.js";
34
+ import { a as Ot } from "./index-CN5JEZ5H.js";
35
+ import { u as Dt } from "./index-DYfkNB0n.js";
36
+ import { c as Ce } from "./utils-TbLXCoKm.js";
37
+ var _t = Object.freeze({
38
+ // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
39
+ position: "absolute",
40
+ border: 0,
41
+ width: 1,
42
+ height: 1,
43
+ padding: 0,
44
+ margin: -1,
45
+ overflow: "hidden",
46
+ clip: "rect(0, 0, 0, 0)",
47
+ whiteSpace: "nowrap",
48
+ wordWrap: "normal"
49
+ }), Lt = "VisuallyHidden", Re = i.forwardRef(
50
+ (e, t) => /* @__PURE__ */ v(
51
+ k.span,
52
+ T(m({}, e), {
53
+ ref: t,
54
+ style: m(m({}, _t), e.style)
55
+ })
56
+ )
57
+ );
58
+ Re.displayName = Lt;
59
+ var St = Re;
60
+ function D(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
61
+ return function(o) {
62
+ if (e == null || e(o), n === !1 || !o.defaultPrevented)
63
+ return t == null ? void 0 : t(o);
64
+ };
65
+ }
66
+ var Mt = "DismissableLayer", Q = "dismissableLayer.update", It = "dismissableLayer.pointerDownOutside", kt = "dismissableLayer.focusOutside", Ee, Ne = i.createContext({
67
+ layers: /* @__PURE__ */ new Set(),
68
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
69
+ branches: /* @__PURE__ */ new Set()
70
+ }), Oe = i.forwardRef(
71
+ (e, t) => {
72
+ var F;
73
+ const _ = e, {
74
+ disableOutsidePointerEvents: n = !1,
75
+ onEscapeKeyDown: r,
76
+ onPointerDownOutside: o,
77
+ onFocusOutside: s,
78
+ onInteractOutside: c,
79
+ onDismiss: d
80
+ } = _, a = R(_, [
81
+ "disableOutsidePointerEvents",
82
+ "onEscapeKeyDown",
83
+ "onPointerDownOutside",
84
+ "onFocusOutside",
85
+ "onInteractOutside",
86
+ "onDismiss"
87
+ ]), l = i.useContext(Ne), [u, y] = i.useState(null), f = (F = u == null ? void 0 : u.ownerDocument) != null ? F : globalThis == null ? void 0 : globalThis.document, [, p] = i.useState({}), h = L(t, (P) => y(P)), g = Array.from(l.layers), [w] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), C = g.indexOf(w), E = u ? g.indexOf(u) : -1, b = l.layersWithOutsidePointerEventsDisabled.size > 0, x = E >= C, O = Wt((P) => {
88
+ const S = P.target, U = [...l.branches].some((W) => W.contains(S));
89
+ !x || U || (o == null || o(P), c == null || c(P), P.defaultPrevented || d == null || d());
90
+ }, f), A = Bt((P) => {
91
+ const S = P.target;
92
+ [...l.branches].some((W) => W.contains(S)) || (s == null || s(P), c == null || c(P), P.defaultPrevented || d == null || d());
93
+ }, f);
94
+ return mt((P) => {
95
+ E === l.layers.size - 1 && (r == null || r(P), !P.defaultPrevented && d && (P.preventDefault(), d()));
96
+ }, f), i.useEffect(() => {
97
+ if (u)
98
+ return n && (l.layersWithOutsidePointerEventsDisabled.size === 0 && (Ee = f.body.style.pointerEvents, f.body.style.pointerEvents = "none"), l.layersWithOutsidePointerEventsDisabled.add(u)), l.layers.add(u), xe(), () => {
99
+ n && l.layersWithOutsidePointerEventsDisabled.size === 1 && (f.body.style.pointerEvents = Ee);
100
+ };
101
+ }, [u, f, n, l]), i.useEffect(() => () => {
102
+ u && (l.layers.delete(u), l.layersWithOutsidePointerEventsDisabled.delete(u), xe());
103
+ }, [u, l]), i.useEffect(() => {
104
+ const P = () => p({});
105
+ return document.addEventListener(Q, P), () => document.removeEventListener(Q, P);
106
+ }, []), /* @__PURE__ */ v(
107
+ k.div,
108
+ T(m({}, a), {
109
+ ref: h,
110
+ style: m({
111
+ pointerEvents: b ? x ? "auto" : "none" : void 0
112
+ }, e.style),
113
+ onFocusCapture: D(e.onFocusCapture, A.onFocusCapture),
114
+ onBlurCapture: D(e.onBlurCapture, A.onBlurCapture),
115
+ onPointerDownCapture: D(
116
+ e.onPointerDownCapture,
117
+ O.onPointerDownCapture
118
+ )
119
+ })
120
+ );
121
+ }
122
+ );
123
+ Oe.displayName = Mt;
124
+ var Ft = "DismissableLayerBranch", Ut = i.forwardRef((e, t) => {
125
+ const n = i.useContext(Ne), r = i.useRef(null), o = L(t, r);
126
+ return i.useEffect(() => {
127
+ const s = r.current;
128
+ if (s)
129
+ return n.branches.add(s), () => {
130
+ n.branches.delete(s);
131
+ };
132
+ }, [n.branches]), /* @__PURE__ */ v(k.div, T(m({}, e), { ref: o }));
133
+ });
134
+ Ut.displayName = Ft;
135
+ function Wt(e, t = globalThis == null ? void 0 : globalThis.document) {
136
+ const n = te(e), r = i.useRef(!1), o = i.useRef(() => {
137
+ });
138
+ return i.useEffect(() => {
139
+ const s = (d) => {
140
+ if (d.target && !r.current) {
141
+ let a = function() {
142
+ De(
143
+ It,
144
+ n,
145
+ l,
146
+ { discrete: !0 }
147
+ );
148
+ };
149
+ const l = { originalEvent: d };
150
+ d.pointerType === "touch" ? (t.removeEventListener("click", o.current), o.current = a, t.addEventListener("click", o.current, { once: !0 })) : a();
151
+ } else
152
+ t.removeEventListener("click", o.current);
153
+ r.current = !1;
154
+ }, c = window.setTimeout(() => {
155
+ t.addEventListener("pointerdown", s);
156
+ }, 0);
157
+ return () => {
158
+ window.clearTimeout(c), t.removeEventListener("pointerdown", s), t.removeEventListener("click", o.current);
159
+ };
160
+ }, [t, n]), {
161
+ // ensures we check React component tree (not just DOM tree)
162
+ onPointerDownCapture: () => r.current = !0
163
+ };
164
+ }
165
+ function Bt(e, t = globalThis == null ? void 0 : globalThis.document) {
166
+ const n = te(e), r = i.useRef(!1);
167
+ return i.useEffect(() => {
168
+ const o = (s) => {
169
+ s.target && !r.current && De(kt, n, { originalEvent: s }, {
170
+ discrete: !1
171
+ });
172
+ };
173
+ return t.addEventListener("focusin", o), () => t.removeEventListener("focusin", o);
174
+ }, [t, n]), {
175
+ onFocusCapture: () => r.current = !0,
176
+ onBlurCapture: () => r.current = !1
177
+ };
178
+ }
179
+ function xe() {
180
+ const e = new CustomEvent(Q);
181
+ document.dispatchEvent(e);
182
+ }
183
+ function De(e, t, n, { discrete: r }) {
184
+ const o = n.originalEvent.target, s = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
185
+ t && o.addEventListener(e, t, { once: !0 }), r ? ht(o, s) : o.dispatchEvent(s);
186
+ }
187
+ var ne = "Popper", [_e, Le] = Ae(ne), [Ht, Se] = _e(ne), Me = (e) => {
188
+ const { __scopePopper: t, children: n } = e, [r, o] = i.useState(null);
189
+ return /* @__PURE__ */ v(Ht, { scope: t, anchor: r, onAnchorChange: o, children: n });
190
+ };
191
+ Me.displayName = ne;
192
+ var Ie = "PopperAnchor", ke = i.forwardRef(
193
+ (e, t) => {
194
+ const l = e, { __scopePopper: n, virtualRef: r } = l, o = R(l, ["__scopePopper", "virtualRef"]), s = Se(Ie, n), c = i.useRef(null), d = L(t, c), a = i.useRef(null);
195
+ return i.useEffect(() => {
196
+ const u = a.current;
197
+ a.current = (r == null ? void 0 : r.current) || c.current, u !== a.current && s.onAnchorChange(a.current);
198
+ }), r ? null : /* @__PURE__ */ v(k.div, T(m({}, o), { ref: d }));
199
+ }
200
+ );
201
+ ke.displayName = Ie;
202
+ var re = "PopperContent", [$t, Yt] = _e(re), Fe = i.forwardRef(
203
+ (e, t) => {
204
+ var ue, de, fe, pe, he, me, ve, ye;
205
+ const le = e, {
206
+ __scopePopper: n,
207
+ side: r = "bottom",
208
+ sideOffset: o = 0,
209
+ align: s = "center",
210
+ alignOffset: c = 0,
211
+ arrowPadding: d = 0,
212
+ avoidCollisions: a = !0,
213
+ collisionBoundary: l = [],
214
+ collisionPadding: u = 0,
215
+ sticky: y = "partial",
216
+ hideWhenDetached: f = !1,
217
+ updatePositionStrategy: p = "optimized",
218
+ onPlaced: h
219
+ } = le, g = R(le, [
220
+ "__scopePopper",
221
+ "side",
222
+ "sideOffset",
223
+ "align",
224
+ "alignOffset",
225
+ "arrowPadding",
226
+ "avoidCollisions",
227
+ "collisionBoundary",
228
+ "collisionPadding",
229
+ "sticky",
230
+ "hideWhenDetached",
231
+ "updatePositionStrategy",
232
+ "onPlaced"
233
+ ]), w = Se(re, n), [C, E] = i.useState(null), b = L(t, (B) => E(B)), [x, O] = i.useState(null), A = Nt(x), _ = (ue = A == null ? void 0 : A.width) != null ? ue : 0, F = (de = A == null ? void 0 : A.height) != null ? de : 0, P = r + (s !== "center" ? "-" + s : ""), S = typeof u == "number" ? u : m({ top: 0, right: 0, bottom: 0, left: 0 }, u), U = Array.isArray(l) ? l : [l], W = U.length > 0, Y = {
234
+ padding: S,
235
+ boundary: U.filter(zt),
236
+ // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
237
+ altBoundary: W
238
+ }, { refs: Je, floatingStyles: ae, placement: et, isPositioned: j, middlewareData: M } = gt({
239
+ // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
240
+ strategy: "fixed",
241
+ placement: P,
242
+ whileElementsMounted: (...B) => At(...B, {
243
+ animationFrame: p === "always"
244
+ }),
245
+ elements: {
246
+ reference: w.anchor
247
+ },
248
+ middleware: [
249
+ wt({ mainAxis: o + F, alignmentAxis: c }),
250
+ a && Tt(m({
251
+ mainAxis: !0,
252
+ crossAxis: !1,
253
+ limiter: y === "partial" ? bt() : void 0
254
+ }, Y)),
255
+ a && Pt(m({}, Y)),
256
+ Ct(T(m({}, Y), {
257
+ apply: ({ elements: B, rects: ge, availableWidth: at, availableHeight: ct }) => {
258
+ const { width: lt, height: ut } = ge.reference, G = B.floating.style;
259
+ G.setProperty("--radix-popper-available-width", `${at}px`), G.setProperty("--radix-popper-available-height", `${ct}px`), G.setProperty("--radix-popper-anchor-width", `${lt}px`), G.setProperty("--radix-popper-anchor-height", `${ut}px`);
260
+ }
261
+ })),
262
+ x && Et({ element: x, padding: d }),
263
+ Gt({ arrowWidth: _, arrowHeight: F }),
264
+ f && xt(m({ strategy: "referenceHidden" }, Y))
265
+ ]
266
+ }), [ce, tt] = Be(et), z = te(h);
267
+ q(() => {
268
+ j && (z == null || z());
269
+ }, [j, z]);
270
+ const nt = (fe = M.arrow) == null ? void 0 : fe.x, rt = (pe = M.arrow) == null ? void 0 : pe.y, ot = ((he = M.arrow) == null ? void 0 : he.centerOffset) !== 0, [st, it] = i.useState();
271
+ return q(() => {
272
+ C && it(window.getComputedStyle(C).zIndex);
273
+ }, [C]), /* @__PURE__ */ v(
274
+ "div",
275
+ {
276
+ ref: Je.setFloating,
277
+ "data-radix-popper-content-wrapper": "",
278
+ style: m(T(m({}, ae), {
279
+ transform: j ? ae.transform : "translate(0, -200%)",
280
+ // keep off the page when measuring
281
+ minWidth: "max-content",
282
+ zIndex: st,
283
+ "--radix-popper-transform-origin": [
284
+ (me = M.transformOrigin) == null ? void 0 : me.x,
285
+ (ve = M.transformOrigin) == null ? void 0 : ve.y
286
+ ].join(" ")
287
+ }), ((ye = M.hide) == null ? void 0 : ye.referenceHidden) && {
288
+ visibility: "hidden",
289
+ pointerEvents: "none"
290
+ }),
291
+ dir: e.dir,
292
+ children: /* @__PURE__ */ v(
293
+ $t,
294
+ {
295
+ scope: n,
296
+ placedSide: ce,
297
+ onArrowChange: O,
298
+ arrowX: nt,
299
+ arrowY: rt,
300
+ shouldHideArrow: ot,
301
+ children: /* @__PURE__ */ v(
302
+ k.div,
303
+ T(m({
304
+ "data-side": ce,
305
+ "data-align": tt
306
+ }, g), {
307
+ ref: b,
308
+ style: T(m({}, g.style), {
309
+ // if the PopperContent hasn't been placed yet (not all measurements done)
310
+ // we prevent animations so that users's animation don't kick in too early referring wrong sides
311
+ animation: j ? void 0 : "none"
312
+ })
313
+ })
314
+ )
315
+ }
316
+ )
317
+ }
318
+ );
319
+ }
320
+ );
321
+ Fe.displayName = re;
322
+ var Ue = "PopperArrow", jt = {
323
+ top: "bottom",
324
+ right: "left",
325
+ bottom: "top",
326
+ left: "right"
327
+ }, We = i.forwardRef(function(t, n) {
328
+ const d = t, { __scopePopper: r } = d, o = R(d, ["__scopePopper"]), s = Yt(Ue, r), c = jt[s.placedSide];
329
+ return (
330
+ // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
331
+ // doesn't report size as we'd expect on SVG elements.
332
+ // it reports their bounding box which is effectively the largest path inside the SVG.
333
+ /* @__PURE__ */ v(
334
+ "span",
335
+ {
336
+ ref: s.onArrowChange,
337
+ style: {
338
+ position: "absolute",
339
+ left: s.arrowX,
340
+ top: s.arrowY,
341
+ [c]: 0,
342
+ transformOrigin: {
343
+ top: "",
344
+ right: "0 0",
345
+ bottom: "center 0",
346
+ left: "100% 0"
347
+ }[s.placedSide],
348
+ transform: {
349
+ top: "translateY(100%)",
350
+ right: "translateY(50%) rotate(90deg) translateX(-50%)",
351
+ bottom: "rotate(180deg)",
352
+ left: "translateY(50%) rotate(-90deg) translateX(50%)"
353
+ }[s.placedSide],
354
+ visibility: s.shouldHideArrow ? "hidden" : void 0
355
+ },
356
+ children: /* @__PURE__ */ v(
357
+ yt,
358
+ T(m({}, o), {
359
+ ref: n,
360
+ style: T(m({}, o.style), {
361
+ // ensures the element can be measured correctly (mostly for if SVG)
362
+ display: "block"
363
+ })
364
+ })
365
+ )
366
+ }
367
+ )
368
+ );
369
+ });
370
+ We.displayName = Ue;
371
+ function zt(e) {
372
+ return e !== null;
373
+ }
374
+ var Gt = (e) => ({
375
+ name: "transformOrigin",
376
+ options: e,
377
+ fn(t) {
378
+ var w, C, E, b, x;
379
+ const { placement: n, rects: r, middlewareData: o } = t, c = ((w = o.arrow) == null ? void 0 : w.centerOffset) !== 0, d = c ? 0 : e.arrowWidth, a = c ? 0 : e.arrowHeight, [l, u] = Be(n), y = { start: "0%", center: "50%", end: "100%" }[u], f = ((E = (C = o.arrow) == null ? void 0 : C.x) != null ? E : 0) + d / 2, p = ((x = (b = o.arrow) == null ? void 0 : b.y) != null ? x : 0) + a / 2;
380
+ let h = "", g = "";
381
+ return l === "bottom" ? (h = c ? y : `${f}px`, g = `${-a}px`) : l === "top" ? (h = c ? y : `${f}px`, g = `${r.floating.height + a}px`) : l === "right" ? (h = `${-a}px`, g = c ? y : `${p}px`) : l === "left" && (h = `${r.floating.width + a}px`, g = c ? y : `${p}px`), { data: { x: h, y: g } };
382
+ }
383
+ });
384
+ function Be(e) {
385
+ const [t, n = "center"] = e.split("-");
386
+ return [t, n];
387
+ }
388
+ var Vt = Me, Xt = ke, qt = Fe, Zt = We;
389
+ function Kt(e, t) {
390
+ return i.useReducer((n, r) => {
391
+ const o = t[n][r];
392
+ return o != null ? o : n;
393
+ }, e);
394
+ }
395
+ var oe = (e) => {
396
+ const { present: t, children: n } = e, r = Qt(t), o = typeof n == "function" ? n({ present: r.isPresent }) : i.Children.only(n), s = L(r.ref, Jt(o));
397
+ return typeof n == "function" || r.isPresent ? i.cloneElement(o, { ref: s }) : null;
398
+ };
399
+ oe.displayName = "Presence";
400
+ function Qt(e) {
401
+ const [t, n] = i.useState(), r = i.useRef(null), o = i.useRef(e), s = i.useRef("none"), c = e ? "mounted" : "unmounted", [d, a] = Kt(c, {
402
+ mounted: {
403
+ UNMOUNT: "unmounted",
404
+ ANIMATION_OUT: "unmountSuspended"
405
+ },
406
+ unmountSuspended: {
407
+ MOUNT: "mounted",
408
+ ANIMATION_END: "unmounted"
409
+ },
410
+ unmounted: {
411
+ MOUNT: "mounted"
412
+ }
413
+ });
414
+ return i.useEffect(() => {
415
+ const l = X(r.current);
416
+ s.current = d === "mounted" ? l : "none";
417
+ }, [d]), q(() => {
418
+ const l = r.current, u = o.current;
419
+ if (u !== e) {
420
+ const f = s.current, p = X(l);
421
+ e ? a("MOUNT") : p === "none" || (l == null ? void 0 : l.display) === "none" ? a("UNMOUNT") : a(u && f !== p ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
422
+ }
423
+ }, [e, a]), q(() => {
424
+ var l;
425
+ if (t) {
426
+ let u;
427
+ const y = (l = t.ownerDocument.defaultView) != null ? l : window, f = (h) => {
428
+ const w = X(r.current).includes(CSS.escape(h.animationName));
429
+ if (h.target === t && w && (a("ANIMATION_END"), !o.current)) {
430
+ const C = t.style.animationFillMode;
431
+ t.style.animationFillMode = "forwards", u = y.setTimeout(() => {
432
+ t.style.animationFillMode === "forwards" && (t.style.animationFillMode = C);
433
+ });
434
+ }
435
+ }, p = (h) => {
436
+ h.target === t && (s.current = X(r.current));
437
+ };
438
+ return t.addEventListener("animationstart", p), t.addEventListener("animationcancel", f), t.addEventListener("animationend", f), () => {
439
+ y.clearTimeout(u), t.removeEventListener("animationstart", p), t.removeEventListener("animationcancel", f), t.removeEventListener("animationend", f);
440
+ };
441
+ } else
442
+ a("ANIMATION_END");
443
+ }, [t, a]), {
444
+ isPresent: ["mounted", "unmountSuspended"].includes(d),
445
+ ref: i.useCallback((l) => {
446
+ r.current = l ? getComputedStyle(l) : null, n(l);
447
+ }, [])
448
+ };
449
+ }
450
+ function X(e) {
451
+ return (e == null ? void 0 : e.animationName) || "none";
452
+ }
453
+ function Jt(e) {
454
+ var r, o;
455
+ let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
456
+ return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
457
+ }
458
+ var [Z, Wn] = Ae("Tooltip", [
459
+ Le
460
+ ]), K = Le(), He = "TooltipProvider", en = 700, J = "tooltip.open", [tn, se] = Z(He), $e = (e) => {
461
+ const {
462
+ __scopeTooltip: t,
463
+ delayDuration: n = en,
464
+ skipDelayDuration: r = 300,
465
+ disableHoverableContent: o = !1,
466
+ children: s
467
+ } = e, c = i.useRef(!0), d = i.useRef(!1), a = i.useRef(0);
468
+ return i.useEffect(() => {
469
+ const l = a.current;
470
+ return () => window.clearTimeout(l);
471
+ }, []), /* @__PURE__ */ v(
472
+ tn,
473
+ {
474
+ scope: t,
475
+ isOpenDelayedRef: c,
476
+ delayDuration: n,
477
+ onOpen: i.useCallback(() => {
478
+ window.clearTimeout(a.current), c.current = !1;
479
+ }, []),
480
+ onClose: i.useCallback(() => {
481
+ window.clearTimeout(a.current), a.current = window.setTimeout(
482
+ () => c.current = !0,
483
+ r
484
+ );
485
+ }, [r]),
486
+ isPointerInTransitRef: d,
487
+ onPointerInTransitChange: i.useCallback((l) => {
488
+ d.current = l;
489
+ }, []),
490
+ disableHoverableContent: o,
491
+ children: s
492
+ }
493
+ );
494
+ };
495
+ $e.displayName = He;
496
+ var H = "Tooltip", [nn, $] = Z(H), Ye = (e) => {
497
+ const {
498
+ __scopeTooltip: t,
499
+ children: n,
500
+ open: r,
501
+ defaultOpen: o,
502
+ onOpenChange: s,
503
+ disableHoverableContent: c,
504
+ delayDuration: d
505
+ } = e, a = se(H, e.__scopeTooltip), l = K(t), [u, y] = i.useState(null), f = vt(), p = i.useRef(0), h = c != null ? c : a.disableHoverableContent, g = d != null ? d : a.delayDuration, w = i.useRef(!1), [C, E] = Dt({
506
+ prop: r,
507
+ defaultProp: o != null ? o : !1,
508
+ onChange: (_) => {
509
+ _ ? (a.onOpen(), document.dispatchEvent(new CustomEvent(J))) : a.onClose(), s == null || s(_);
510
+ },
511
+ caller: H
512
+ }), b = i.useMemo(() => C ? w.current ? "delayed-open" : "instant-open" : "closed", [C]), x = i.useCallback(() => {
513
+ window.clearTimeout(p.current), p.current = 0, w.current = !1, E(!0);
514
+ }, [E]), O = i.useCallback(() => {
515
+ window.clearTimeout(p.current), p.current = 0, E(!1);
516
+ }, [E]), A = i.useCallback(() => {
517
+ window.clearTimeout(p.current), p.current = window.setTimeout(() => {
518
+ w.current = !0, E(!0), p.current = 0;
519
+ }, g);
520
+ }, [g, E]);
521
+ return i.useEffect(() => () => {
522
+ p.current && (window.clearTimeout(p.current), p.current = 0);
523
+ }, []), /* @__PURE__ */ v(Vt, T(m({}, l), { children: /* @__PURE__ */ v(
524
+ nn,
525
+ {
526
+ scope: t,
527
+ contentId: f,
528
+ open: C,
529
+ stateAttribute: b,
530
+ trigger: u,
531
+ onTriggerChange: y,
532
+ onTriggerEnter: i.useCallback(() => {
533
+ a.isOpenDelayedRef.current ? A() : x();
534
+ }, [a.isOpenDelayedRef, A, x]),
535
+ onTriggerLeave: i.useCallback(() => {
536
+ h ? O() : (window.clearTimeout(p.current), p.current = 0);
537
+ }, [O, h]),
538
+ onOpen: x,
539
+ onClose: O,
540
+ disableHoverableContent: h,
541
+ children: n
542
+ }
543
+ ) }));
544
+ };
545
+ Ye.displayName = H;
546
+ var ee = "TooltipTrigger", je = i.forwardRef(
547
+ (e, t) => {
548
+ const f = e, { __scopeTooltip: n } = f, r = R(f, ["__scopeTooltip"]), o = $(ee, n), s = se(ee, n), c = K(n), d = i.useRef(null), a = L(t, d, o.onTriggerChange), l = i.useRef(!1), u = i.useRef(!1), y = i.useCallback(() => l.current = !1, []);
549
+ return i.useEffect(() => () => document.removeEventListener("pointerup", y), [y]), /* @__PURE__ */ v(Xt, T(m({ asChild: !0 }, c), { children: /* @__PURE__ */ v(
550
+ k.button,
551
+ T(m({
552
+ "aria-describedby": o.open ? o.contentId : void 0,
553
+ "data-state": o.stateAttribute
554
+ }, r), {
555
+ ref: a,
556
+ onPointerMove: D(e.onPointerMove, (p) => {
557
+ p.pointerType !== "touch" && !u.current && !s.isPointerInTransitRef.current && (o.onTriggerEnter(), u.current = !0);
558
+ }),
559
+ onPointerLeave: D(e.onPointerLeave, () => {
560
+ o.onTriggerLeave(), u.current = !1;
561
+ }),
562
+ onPointerDown: D(e.onPointerDown, () => {
563
+ o.open && o.onClose(), l.current = !0, document.addEventListener("pointerup", y, { once: !0 });
564
+ }),
565
+ onFocus: D(e.onFocus, () => {
566
+ l.current || o.onOpen();
567
+ }),
568
+ onBlur: D(e.onBlur, o.onClose),
569
+ onClick: D(e.onClick, o.onClose)
570
+ })
571
+ ) }));
572
+ }
573
+ );
574
+ je.displayName = ee;
575
+ var ie = "TooltipPortal", [rn, on] = Z(ie, {
576
+ forceMount: void 0
577
+ }), ze = (e) => {
578
+ const { __scopeTooltip: t, forceMount: n, children: r, container: o } = e, s = $(ie, t);
579
+ return /* @__PURE__ */ v(rn, { scope: t, forceMount: n, children: /* @__PURE__ */ v(oe, { present: n || s.open, children: /* @__PURE__ */ v(Rt, { asChild: !0, container: o, children: r }) }) });
580
+ };
581
+ ze.displayName = ie;
582
+ var I = "TooltipContent", Ge = i.forwardRef(
583
+ (e, t) => {
584
+ const n = on(I, e.__scopeTooltip), d = e, { forceMount: r = n.forceMount, side: o = "top" } = d, s = R(d, ["forceMount", "side"]), c = $(I, e.__scopeTooltip);
585
+ return /* @__PURE__ */ v(oe, { present: r || c.open, children: c.disableHoverableContent ? /* @__PURE__ */ v(Ve, T(m({ side: o }, s), { ref: t })) : /* @__PURE__ */ v(sn, T(m({ side: o }, s), { ref: t })) });
586
+ }
587
+ ), sn = i.forwardRef((e, t) => {
588
+ const n = $(I, e.__scopeTooltip), r = se(I, e.__scopeTooltip), o = i.useRef(null), s = L(t, o), [c, d] = i.useState(null), { trigger: a, onClose: l } = n, u = o.current, { onPointerInTransitChange: y } = r, f = i.useCallback(() => {
589
+ d(null), y(!1);
590
+ }, [y]), p = i.useCallback(
591
+ (h, g) => {
592
+ const w = h.currentTarget, C = { x: h.clientX, y: h.clientY }, E = un(C, w.getBoundingClientRect()), b = dn(C, E), x = fn(g.getBoundingClientRect()), O = hn([...b, ...x]);
593
+ d(O), y(!0);
594
+ },
595
+ [y]
596
+ );
597
+ return i.useEffect(() => () => f(), [f]), i.useEffect(() => {
598
+ if (a && u) {
599
+ const h = (w) => p(w, u), g = (w) => p(w, a);
600
+ return a.addEventListener("pointerleave", h), u.addEventListener("pointerleave", g), () => {
601
+ a.removeEventListener("pointerleave", h), u.removeEventListener("pointerleave", g);
602
+ };
603
+ }
604
+ }, [a, u, p, f]), i.useEffect(() => {
605
+ if (c) {
606
+ const h = (g) => {
607
+ const w = g.target, C = { x: g.clientX, y: g.clientY }, E = (a == null ? void 0 : a.contains(w)) || (u == null ? void 0 : u.contains(w)), b = !pn(C, c);
608
+ E ? f() : b && (f(), l());
609
+ };
610
+ return document.addEventListener("pointermove", h), () => document.removeEventListener("pointermove", h);
611
+ }
612
+ }, [a, u, c, l, f]), /* @__PURE__ */ v(Ve, T(m({}, e), { ref: s }));
613
+ }), [an, cn] = Z(H, { isInside: !1 }), ln = Ot("TooltipContent"), Ve = i.forwardRef(
614
+ (e, t) => {
615
+ const y = e, {
616
+ __scopeTooltip: n,
617
+ children: r,
618
+ "aria-label": o,
619
+ onEscapeKeyDown: s,
620
+ onPointerDownOutside: c
621
+ } = y, d = R(y, [
622
+ "__scopeTooltip",
623
+ "children",
624
+ "aria-label",
625
+ "onEscapeKeyDown",
626
+ "onPointerDownOutside"
627
+ ]), a = $(I, n), l = K(n), { onClose: u } = a;
628
+ return i.useEffect(() => (document.addEventListener(J, u), () => document.removeEventListener(J, u)), [u]), i.useEffect(() => {
629
+ if (a.trigger) {
630
+ const f = (p) => {
631
+ const h = p.target;
632
+ h != null && h.contains(a.trigger) && u();
633
+ };
634
+ return window.addEventListener("scroll", f, { capture: !0 }), () => window.removeEventListener("scroll", f, { capture: !0 });
635
+ }
636
+ }, [a.trigger, u]), /* @__PURE__ */ v(
637
+ Oe,
638
+ {
639
+ asChild: !0,
640
+ disableOutsidePointerEvents: !1,
641
+ onEscapeKeyDown: s,
642
+ onPointerDownOutside: c,
643
+ onFocusOutside: (f) => f.preventDefault(),
644
+ onDismiss: u,
645
+ children: /* @__PURE__ */ be(
646
+ qt,
647
+ T(m(m({
648
+ "data-state": a.stateAttribute
649
+ }, l), d), {
650
+ ref: t,
651
+ style: T(m({}, d.style), {
652
+ "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
653
+ "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
654
+ "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
655
+ "--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
656
+ "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
657
+ }),
658
+ children: [
659
+ /* @__PURE__ */ v(ln, { children: r }),
660
+ /* @__PURE__ */ v(an, { scope: n, isInside: !0, children: /* @__PURE__ */ v(St, { id: a.contentId, role: "tooltip", children: o || r }) })
661
+ ]
662
+ })
663
+ )
664
+ }
665
+ );
666
+ }
667
+ );
668
+ Ge.displayName = I;
669
+ var Xe = "TooltipArrow", qe = i.forwardRef(
670
+ (e, t) => {
671
+ const c = e, { __scopeTooltip: n } = c, r = R(c, ["__scopeTooltip"]), o = K(n);
672
+ return cn(
673
+ Xe,
674
+ n
675
+ ).isInside ? null : /* @__PURE__ */ v(Zt, T(m(m({}, o), r), { ref: t }));
676
+ }
677
+ );
678
+ qe.displayName = Xe;
679
+ function un(e, t) {
680
+ const n = Math.abs(t.top - e.y), r = Math.abs(t.bottom - e.y), o = Math.abs(t.right - e.x), s = Math.abs(t.left - e.x);
681
+ switch (Math.min(n, r, o, s)) {
682
+ case s:
683
+ return "left";
684
+ case o:
685
+ return "right";
686
+ case n:
687
+ return "top";
688
+ case r:
689
+ return "bottom";
690
+ default:
691
+ throw new Error("unreachable");
692
+ }
693
+ }
694
+ function dn(e, t, n = 5) {
695
+ const r = [];
696
+ switch (t) {
697
+ case "top":
698
+ r.push(
699
+ { x: e.x - n, y: e.y + n },
700
+ { x: e.x + n, y: e.y + n }
701
+ );
702
+ break;
703
+ case "bottom":
704
+ r.push(
705
+ { x: e.x - n, y: e.y - n },
706
+ { x: e.x + n, y: e.y - n }
707
+ );
708
+ break;
709
+ case "left":
710
+ r.push(
711
+ { x: e.x + n, y: e.y - n },
712
+ { x: e.x + n, y: e.y + n }
713
+ );
714
+ break;
715
+ case "right":
716
+ r.push(
717
+ { x: e.x - n, y: e.y - n },
718
+ { x: e.x - n, y: e.y + n }
719
+ );
720
+ break;
721
+ }
722
+ return r;
723
+ }
724
+ function fn(e) {
725
+ const { top: t, right: n, bottom: r, left: o } = e;
726
+ return [
727
+ { x: o, y: t },
728
+ { x: n, y: t },
729
+ { x: n, y: r },
730
+ { x: o, y: r }
731
+ ];
732
+ }
733
+ function pn(e, t) {
734
+ const { x: n, y: r } = e;
735
+ let o = !1;
736
+ for (let s = 0, c = t.length - 1; s < t.length; c = s++) {
737
+ const d = t[s], a = t[c], l = d.x, u = d.y, y = a.x, f = a.y;
738
+ u > r != f > r && n < (y - l) * (r - u) / (f - u) + l && (o = !o);
739
+ }
740
+ return o;
741
+ }
742
+ function hn(e) {
743
+ const t = e.slice();
744
+ return t.sort((n, r) => n.x < r.x ? -1 : n.x > r.x ? 1 : n.y < r.y ? -1 : n.y > r.y ? 1 : 0), mn(t);
745
+ }
746
+ function mn(e) {
747
+ if (e.length <= 1) return e.slice();
748
+ const t = [];
749
+ for (let r = 0; r < e.length; r++) {
750
+ const o = e[r];
751
+ for (; t.length >= 2; ) {
752
+ const s = t[t.length - 1], c = t[t.length - 2];
753
+ if ((s.x - c.x) * (o.y - c.y) >= (s.y - c.y) * (o.x - c.x)) t.pop();
754
+ else break;
755
+ }
756
+ t.push(o);
757
+ }
758
+ t.pop();
759
+ const n = [];
760
+ for (let r = e.length - 1; r >= 0; r--) {
761
+ const o = e[r];
762
+ for (; n.length >= 2; ) {
763
+ const s = n[n.length - 1], c = n[n.length - 2];
764
+ if ((s.x - c.x) * (o.y - c.y) >= (s.y - c.y) * (o.x - c.x)) n.pop();
765
+ else break;
766
+ }
767
+ n.push(o);
768
+ }
769
+ return n.pop(), t.length === 1 && n.length === 1 && t[0].x === n[0].x && t[0].y === n[0].y ? t : t.concat(n);
770
+ }
771
+ var vn = $e, yn = Ye, Ze = je, gn = ze, Ke = Ge, wn = qe;
772
+ const Bn = vn, Tn = 120, Qe = N.createContext(null);
773
+ function Pn() {
774
+ const [e, t] = N.useState(!1);
775
+ return N.useEffect(() => {
776
+ if (typeof window == "undefined") return;
777
+ const n = window.matchMedia("(hover: none), (pointer: coarse)"), r = () => {
778
+ t(n.matches || navigator.maxTouchPoints > 0);
779
+ };
780
+ return r(), n.addEventListener("change", r), () => n.removeEventListener("change", r);
781
+ }, []), e;
782
+ }
783
+ function Hn(o) {
784
+ var s = o, {
785
+ open: e,
786
+ defaultOpen: t,
787
+ onOpenChange: n
788
+ } = s, r = R(s, [
789
+ "open",
790
+ "defaultOpen",
791
+ "onOpenChange"
792
+ ]);
793
+ const [c, d] = N.useState(!!t), a = e !== void 0, l = a ? e : c, u = Pn(), y = N.useRef(0), f = N.useCallback(
794
+ (g) => {
795
+ a || d(g), n == null || n(g);
796
+ },
797
+ [a, n]
798
+ ), p = N.useCallback(
799
+ (g) => {
800
+ u && !g && Date.now() - y.current < Tn || f(g);
801
+ },
802
+ [u, f]
803
+ ), h = N.useCallback(() => {
804
+ y.current = Date.now(), f(!l);
805
+ }, [l, f]);
806
+ return /* @__PURE__ */ v(Qe.Provider, { value: { isTouchDevice: u, open: l, toggleByTouch: h }, children: /* @__PURE__ */ v(
807
+ yn,
808
+ m({
809
+ open: u ? l : e,
810
+ defaultOpen: u ? void 0 : t,
811
+ onOpenChange: u ? p : n
812
+ }, r)
813
+ ) });
814
+ }
815
+ const Cn = N.forwardRef((r, n) => {
816
+ var o = r, { onPointerDown: e } = o, t = R(o, ["onPointerDown"]);
817
+ const s = N.useContext(Qe);
818
+ return /* @__PURE__ */ v(Ze, m({ ref: n, onPointerDown: (d) => {
819
+ e == null || e(d), !d.defaultPrevented && s != null && s.isTouchDevice && d.pointerType === "touch" && s.toggleByTouch();
820
+ } }, t));
821
+ });
822
+ Cn.displayName = Ze.displayName;
823
+ const En = N.forwardRef(
824
+ (d, c) => {
825
+ var a = d, {
826
+ className: e,
827
+ sideOffset: t = 6,
828
+ align: n = "center",
829
+ side: r = "top",
830
+ children: o
831
+ } = a, s = R(a, [
832
+ "className",
833
+ "sideOffset",
834
+ "align",
835
+ "side",
836
+ "children"
837
+ ]);
838
+ return /* @__PURE__ */ v(gn, { children: /* @__PURE__ */ be(
839
+ Ke,
840
+ T(m({
841
+ ref: c,
842
+ align: n,
843
+ side: r,
844
+ sideOffset: t,
845
+ className: Ce(
846
+ [
847
+ "font-graphik",
848
+ "z-58",
849
+ "max-w-80",
850
+ "rounded-xl",
851
+ "bg-spotlight-background",
852
+ "px-3 py-2",
853
+ "text-[13px] leading-5",
854
+ "text-primary-foreground",
855
+ "shadow-[0_8px_24px_rgba(0,0,0,0.18)]",
856
+ "select-none",
857
+ "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
858
+ "data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95",
859
+ "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
860
+ "outline-none"
861
+ ],
862
+ e
863
+ )
864
+ }, s), {
865
+ children: [
866
+ o,
867
+ /* @__PURE__ */ v(
868
+ wn,
869
+ {
870
+ className: Ce("fill-spotlight-background"),
871
+ width: 10,
872
+ height: 5
873
+ }
874
+ )
875
+ ]
876
+ })
877
+ ) });
878
+ }
879
+ );
880
+ En.displayName = Ke.displayName;
881
+ export {
882
+ Hn as T,
883
+ _t as V,
884
+ En as a,
885
+ Bn as b,
886
+ Cn as c
887
+ };