prometeo-design-system 6.5.2 → 6.5.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/Popover.es.js +259 -238
- package/dist/PyrionLayout.es.js +698 -761
- package/dist/Scrollable-BkHXh-dH.js +742 -0
- package/dist/Scrollable.es.js +1 -1
- package/dist/TabSwitch-DozGcXGV.js +316 -0
- package/dist/TabSwitch.d.ts +6 -0
- package/dist/TabSwitch.es.js +5 -0
- package/dist/components/Popover/Popover.d.ts +2 -1
- package/dist/components/PyrionNavigationDrawer/PyrionLayout.d.ts +8 -0
- package/dist/components/PyrionNavigationDrawer/index.d.ts +2 -2
- package/dist/components/TabSwitch/TabSwitch.d.ts +23 -0
- package/dist/exports/PyrionLayout.d.ts +1 -1
- package/dist/exports/TabSwitch.d.ts +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/prometeo-design-system.es.js +220 -276
- package/package.json +5 -1
- package/dist/Scrollable-BzvgzSjX.js +0 -213
- package/dist/useScrollable-Bj79o803.js +0 -533
package/dist/Popover.es.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { c as
|
|
5
|
-
const
|
|
1
|
+
import { j as a } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
|
+
import { useRef as O, useState as x, useLayoutEffect as Q, useCallback as I, useEffect as b, useMemo as be } from "react";
|
|
3
|
+
import { createPortal as Ge } from "react-dom";
|
|
4
|
+
import { c as Me } from "./cn-B6yFEsav.js";
|
|
5
|
+
const ee = 300, Ve = 24, ge = 8, te = 12, E = 24, N = 24, qe = {
|
|
6
6
|
backgroundColor: "var(--neutral-800)",
|
|
7
7
|
border: "1px solid var(--neutral-600)",
|
|
8
8
|
transition: "all 0.3s ease-in-out"
|
|
9
|
-
},
|
|
9
|
+
}, R = (t, n, r) => Math.min(Math.max(t, n), r), Xe = (t) => {
|
|
10
10
|
if (!t.endsWith("%"))
|
|
11
11
|
return null;
|
|
12
12
|
const n = Number(t.replace("%", ""));
|
|
13
|
-
return Number.isNaN(n) ? null :
|
|
14
|
-
},
|
|
13
|
+
return Number.isNaN(n) ? null : R(n, 0, 100);
|
|
14
|
+
}, Ue = (t) => {
|
|
15
15
|
if (!t.endsWith("px"))
|
|
16
16
|
return null;
|
|
17
17
|
const n = Number(t.replace("px", ""));
|
|
18
18
|
return Number.isNaN(n) ? null : n;
|
|
19
|
-
},
|
|
19
|
+
}, we = (t, n) => {
|
|
20
20
|
if (n <= 0 || t === "left")
|
|
21
21
|
return 0;
|
|
22
22
|
if (t === "center")
|
|
@@ -24,50 +24,51 @@ const Y = 300, H = 24, Z = 12, E = 24, j = 24, De = {
|
|
|
24
24
|
if (t === "right")
|
|
25
25
|
return n;
|
|
26
26
|
if (typeof t == "number")
|
|
27
|
-
return
|
|
28
|
-
const r =
|
|
27
|
+
return R(t, 0, 100) / 100 * n;
|
|
28
|
+
const r = Xe(t);
|
|
29
29
|
if (r !== null)
|
|
30
30
|
return r / 100 * n;
|
|
31
|
-
const
|
|
32
|
-
return
|
|
33
|
-
},
|
|
34
|
-
const r =
|
|
31
|
+
const l = Ue(t);
|
|
32
|
+
return l !== null ? R(l, 0, n) : n / 2;
|
|
33
|
+
}, Ye = (t, n) => {
|
|
34
|
+
const r = we(n, t.width);
|
|
35
35
|
return t.left + r;
|
|
36
|
-
},
|
|
37
|
-
const
|
|
38
|
-
return
|
|
39
|
-
},
|
|
36
|
+
}, Ze = (t) => t === "left" || t === "right", Je = (t, n, r, l) => {
|
|
37
|
+
const C = t - n, h = l / 2;
|
|
38
|
+
return R(C, h, Math.max(r - h, 0));
|
|
39
|
+
}, Ke = (t) => typeof t == "function", Qe = (t, n) => n === "left" ? t === "below" ? "0,24 24,24 0,0" : "0,0 24,0 0,24" : n === "right" ? t === "below" ? "24,24 0,24 24,0" : "24,0 0,0 24,24" : t === "below" ? "12,0 0,24 24,24" : "0,0 24,0 12,24", et = (t) => t.startsWith("--") ? t : t.replace(/[A-Z]/g, (n) => `-${n.toLowerCase()}`), st = ({
|
|
40
40
|
triggerRef: t,
|
|
41
41
|
children: n,
|
|
42
42
|
trigger: r = "click",
|
|
43
|
-
xPosition:
|
|
44
|
-
hoverDelay:
|
|
45
|
-
attachToParent:
|
|
46
|
-
debugMode:
|
|
47
|
-
highLightTrigger:
|
|
48
|
-
highLightStyles:
|
|
49
|
-
highLightClassName:
|
|
50
|
-
className:
|
|
51
|
-
|
|
43
|
+
xPosition: l = "center",
|
|
44
|
+
hoverDelay: C = 200,
|
|
45
|
+
attachToParent: h = !1,
|
|
46
|
+
debugMode: f = !1,
|
|
47
|
+
highLightTrigger: F = !1,
|
|
48
|
+
highLightStyles: ne = qe,
|
|
49
|
+
highLightClassName: T,
|
|
50
|
+
className: re,
|
|
51
|
+
hideIndicator: $ = !1,
|
|
52
|
+
context: he
|
|
52
53
|
}) => {
|
|
53
|
-
const
|
|
54
|
+
const L = O(null), G = O(null), W = O(null), v = O(null), A = O(null), oe = O(""), H = O({}), [p, z] = x(!1), [u, se] = x(!1), [ve, M] = x(!1), [ie, V] = x(!1), [d, ye] = x({
|
|
54
55
|
left: 0,
|
|
55
56
|
top: 0,
|
|
56
57
|
placement: "below",
|
|
57
58
|
panelWidth: 0,
|
|
58
59
|
indicatorOffset: 0
|
|
59
|
-
}), [
|
|
60
|
+
}), [g, ce] = x(null), [s, xe] = x(t.current), P = p || f, [k, le] = x({
|
|
60
61
|
borderColor: "",
|
|
61
62
|
borderStyle: "",
|
|
62
63
|
borderWidth: "",
|
|
63
64
|
backgroundColor: ""
|
|
64
65
|
});
|
|
65
|
-
|
|
66
|
+
Q(() => {
|
|
66
67
|
const e = t.current;
|
|
67
|
-
|
|
68
|
-
}, [
|
|
69
|
-
if (!
|
|
70
|
-
|
|
68
|
+
s !== e && xe(e);
|
|
69
|
+
}, [s, t]), Q(() => {
|
|
70
|
+
if (!u || !L.current) {
|
|
71
|
+
le({
|
|
71
72
|
borderColor: "",
|
|
72
73
|
borderStyle: "",
|
|
73
74
|
borderWidth: "",
|
|
@@ -75,153 +76,162 @@ const Y = 300, H = 24, Z = 12, E = 24, j = 24, De = {
|
|
|
75
76
|
});
|
|
76
77
|
return;
|
|
77
78
|
}
|
|
78
|
-
const e = getComputedStyle(
|
|
79
|
-
|
|
79
|
+
const e = getComputedStyle(L.current);
|
|
80
|
+
le({
|
|
80
81
|
borderColor: e.borderColor,
|
|
81
82
|
borderStyle: e.borderStyle,
|
|
82
83
|
borderWidth: e.borderWidth,
|
|
83
84
|
backgroundColor: e.backgroundColor
|
|
84
85
|
});
|
|
85
|
-
}, [
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
}, []),
|
|
91
|
-
|
|
92
|
-
}, []),
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
},
|
|
96
|
-
}, [
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
},
|
|
100
|
-
}, [
|
|
101
|
-
|
|
102
|
-
}, []),
|
|
86
|
+
}, [u, re, f]);
|
|
87
|
+
const q = () => {
|
|
88
|
+
W.current && clearTimeout(W.current), v.current && clearTimeout(v.current);
|
|
89
|
+
}, D = I(() => {
|
|
90
|
+
q(), z(!0);
|
|
91
|
+
}, []), ue = I(() => {
|
|
92
|
+
q(), z(!1);
|
|
93
|
+
}, []), X = I(() => {
|
|
94
|
+
W.current && clearTimeout(W.current), W.current = setTimeout(() => {
|
|
95
|
+
z(!0);
|
|
96
|
+
}, C);
|
|
97
|
+
}, [C]), U = I(() => {
|
|
98
|
+
v.current && clearTimeout(v.current), v.current = setTimeout(() => {
|
|
99
|
+
z(!1);
|
|
100
|
+
}, C);
|
|
101
|
+
}, [C]), Y = I(() => {
|
|
102
|
+
v.current && (clearTimeout(v.current), v.current = null);
|
|
103
|
+
}, []), y = I(() => {
|
|
103
104
|
if (typeof window > "u")
|
|
104
105
|
return;
|
|
105
|
-
const e = t.current, i =
|
|
106
|
+
const e = t.current, i = L.current;
|
|
106
107
|
if (!e || !i)
|
|
107
108
|
return;
|
|
108
|
-
const
|
|
109
|
-
let
|
|
110
|
-
|
|
111
|
-
let
|
|
112
|
-
if (
|
|
113
|
-
const
|
|
114
|
-
|
|
109
|
+
const c = e.getBoundingClientRect(), o = i.getBoundingClientRect(), m = Ye(c, l), w = we(l, o.width), Z = m - w, ze = window.innerWidth, De = Math.max(te, ze - o.width - te), J = R(Z, te, De), Be = c.top, _e = window.innerHeight - c.bottom, B = $ ? ge : Ve;
|
|
110
|
+
let K = "below", j = c.bottom + B;
|
|
111
|
+
_e < o.height + B && Be >= o.height + B && (K = "above", j = c.top - o.height - B);
|
|
112
|
+
let _ = J;
|
|
113
|
+
if (h) {
|
|
114
|
+
const me = (e.offsetParent ?? document.body).getBoundingClientRect();
|
|
115
|
+
_ = J - me.left, j -= me.top;
|
|
115
116
|
}
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
left:
|
|
119
|
-
top:
|
|
120
|
-
placement:
|
|
121
|
-
panelWidth:
|
|
122
|
-
indicatorOffset:
|
|
117
|
+
const pe = Ze(l) ? 0 : Je(m, J, o.width, E);
|
|
118
|
+
G.current && (G.current.style.transform = `translate3d(${_}px, ${j}px, 0)`), ye((S) => S.left === _ && S.top === j && S.placement === K && S.panelWidth === o.width && S.indicatorOffset === pe ? S : {
|
|
119
|
+
left: _,
|
|
120
|
+
top: j,
|
|
121
|
+
placement: K,
|
|
122
|
+
panelWidth: o.width,
|
|
123
|
+
indicatorOffset: pe
|
|
123
124
|
});
|
|
124
|
-
}, [
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}, [
|
|
128
|
-
if (!
|
|
125
|
+
}, [h, l, t, $]);
|
|
126
|
+
Q(() => {
|
|
127
|
+
u && y();
|
|
128
|
+
}, [u, y]), b(() => {
|
|
129
|
+
if (!u || typeof window > "u")
|
|
129
130
|
return;
|
|
130
131
|
const e = () => {
|
|
131
|
-
|
|
132
|
+
y();
|
|
132
133
|
};
|
|
133
134
|
return window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
134
135
|
window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
135
136
|
};
|
|
136
|
-
}, [
|
|
137
|
-
if (!
|
|
137
|
+
}, [u, y]), b(() => {
|
|
138
|
+
if (!u || typeof window > "u")
|
|
139
|
+
return;
|
|
140
|
+
let e = window.requestAnimationFrame(function i() {
|
|
141
|
+
y(), e = window.requestAnimationFrame(i);
|
|
142
|
+
});
|
|
143
|
+
return () => {
|
|
144
|
+
window.cancelAnimationFrame(e);
|
|
145
|
+
};
|
|
146
|
+
}, [u, y]), b(() => {
|
|
147
|
+
if (!u || !L.current || typeof ResizeObserver > "u")
|
|
138
148
|
return;
|
|
139
149
|
const e = new ResizeObserver(() => {
|
|
140
|
-
|
|
150
|
+
y();
|
|
141
151
|
});
|
|
142
|
-
return e.observe(
|
|
143
|
-
}, [
|
|
152
|
+
return e.observe(L.current), () => e.disconnect();
|
|
153
|
+
}, [u, y]), b(() => {
|
|
144
154
|
if (P) {
|
|
145
|
-
|
|
155
|
+
se(!0), M(!1);
|
|
146
156
|
return;
|
|
147
157
|
}
|
|
148
|
-
if (
|
|
149
|
-
return
|
|
150
|
-
|
|
151
|
-
},
|
|
152
|
-
|
|
158
|
+
if (u)
|
|
159
|
+
return M(!0), A.current = setTimeout(() => {
|
|
160
|
+
M(!1), se(!1);
|
|
161
|
+
}, ee), () => {
|
|
162
|
+
A.current && clearTimeout(A.current);
|
|
153
163
|
};
|
|
154
|
-
}, [P,
|
|
155
|
-
if (!
|
|
156
|
-
|
|
164
|
+
}, [P, u]), b(() => {
|
|
165
|
+
if (!u || !P) {
|
|
166
|
+
V(!1);
|
|
157
167
|
return;
|
|
158
168
|
}
|
|
159
|
-
|
|
169
|
+
V(!1);
|
|
160
170
|
const e = requestAnimationFrame(() => {
|
|
161
171
|
requestAnimationFrame(() => {
|
|
162
|
-
|
|
172
|
+
V(!0);
|
|
163
173
|
});
|
|
164
174
|
});
|
|
165
175
|
return () => cancelAnimationFrame(e);
|
|
166
|
-
}, [
|
|
167
|
-
|
|
168
|
-
}, []),
|
|
169
|
-
if (!(!
|
|
170
|
-
return
|
|
171
|
-
|
|
176
|
+
}, [u, P]), b(() => () => {
|
|
177
|
+
q(), A.current && clearTimeout(A.current);
|
|
178
|
+
}, []), b(() => {
|
|
179
|
+
if (!(!s || !f))
|
|
180
|
+
return oe.current = s.style.outline ?? "", s.style.outline = "2px dashed var(--error-500)", () => {
|
|
181
|
+
s.style.outline = oe.current;
|
|
172
182
|
};
|
|
173
|
-
}, [
|
|
174
|
-
const e =
|
|
183
|
+
}, [f, s]), b(() => {
|
|
184
|
+
const e = s;
|
|
175
185
|
if (!e)
|
|
176
186
|
return;
|
|
177
|
-
const i = Object.entries(
|
|
178
|
-
([,
|
|
187
|
+
const i = Object.entries(ne).filter(
|
|
188
|
+
([, o]) => o != null
|
|
179
189
|
);
|
|
180
|
-
if (!
|
|
181
|
-
const
|
|
182
|
-
Object.entries(
|
|
183
|
-
if (
|
|
184
|
-
e.style.setProperty(
|
|
190
|
+
if (!F || !p || i.length === 0) {
|
|
191
|
+
const o = H.current;
|
|
192
|
+
Object.entries(o).forEach(([m, w]) => {
|
|
193
|
+
if (w) {
|
|
194
|
+
e.style.setProperty(m, w);
|
|
185
195
|
return;
|
|
186
196
|
}
|
|
187
|
-
e.style.removeProperty(
|
|
188
|
-
}),
|
|
197
|
+
e.style.removeProperty(m);
|
|
198
|
+
}), H.current = {};
|
|
189
199
|
return;
|
|
190
200
|
}
|
|
191
|
-
const
|
|
192
|
-
return i.forEach(([
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
}),
|
|
196
|
-
Object.entries(
|
|
197
|
-
if (
|
|
198
|
-
e.style.setProperty(
|
|
201
|
+
const c = {};
|
|
202
|
+
return i.forEach(([o, m]) => {
|
|
203
|
+
const w = et(o);
|
|
204
|
+
c[w] = e.style.getPropertyValue(w), e.style.setProperty(w, String(m));
|
|
205
|
+
}), H.current = c, () => {
|
|
206
|
+
Object.entries(c).forEach(([o, m]) => {
|
|
207
|
+
if (m) {
|
|
208
|
+
e.style.setProperty(o, m);
|
|
199
209
|
return;
|
|
200
210
|
}
|
|
201
|
-
e.style.removeProperty(
|
|
202
|
-
}),
|
|
211
|
+
e.style.removeProperty(o);
|
|
212
|
+
}), H.current = {};
|
|
203
213
|
};
|
|
204
|
-
}, [
|
|
205
|
-
const e =
|
|
206
|
-
if (!e || !
|
|
214
|
+
}, [ne, F, p, s]), b(() => {
|
|
215
|
+
const e = s;
|
|
216
|
+
if (!e || !T)
|
|
207
217
|
return;
|
|
208
|
-
if (!(
|
|
209
|
-
e.classList.remove(
|
|
218
|
+
if (!(F && p)) {
|
|
219
|
+
e.classList.remove(T);
|
|
210
220
|
return;
|
|
211
221
|
}
|
|
212
|
-
return e.classList.add(
|
|
213
|
-
e.classList.remove(
|
|
222
|
+
return e.classList.add(T), () => {
|
|
223
|
+
e.classList.remove(T);
|
|
214
224
|
};
|
|
215
|
-
}, [
|
|
216
|
-
if (!
|
|
217
|
-
|
|
225
|
+
}, [T, F, p, s]), b(() => {
|
|
226
|
+
if (!f) {
|
|
227
|
+
ce(null);
|
|
218
228
|
return;
|
|
219
229
|
}
|
|
220
230
|
const e = () => {
|
|
221
|
-
if (!
|
|
231
|
+
if (!s)
|
|
222
232
|
return;
|
|
223
|
-
const i =
|
|
224
|
-
|
|
233
|
+
const i = s.getBoundingClientRect();
|
|
234
|
+
ce({
|
|
225
235
|
top: i.top,
|
|
226
236
|
left: i.right + 8,
|
|
227
237
|
bottom: i.bottom
|
|
@@ -231,146 +241,157 @@ const Y = 300, H = 24, Z = 12, E = 24, j = 24, De = {
|
|
|
231
241
|
return window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
232
242
|
window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
233
243
|
};
|
|
234
|
-
}, [
|
|
235
|
-
const e =
|
|
244
|
+
}, [f, s]), b(() => {
|
|
245
|
+
const e = s;
|
|
236
246
|
if (!e)
|
|
237
247
|
return;
|
|
238
248
|
const i = () => {
|
|
239
|
-
r === "hover" && (
|
|
240
|
-
},
|
|
241
|
-
r === "hover" &&
|
|
242
|
-
},
|
|
243
|
-
r === "click" &&
|
|
244
|
-
},
|
|
245
|
-
r === "doubleClick" &&
|
|
246
|
-
},
|
|
247
|
-
r === "contextMenu" && (
|
|
249
|
+
r === "hover" && (Y(), X());
|
|
250
|
+
}, c = () => {
|
|
251
|
+
r === "hover" && U();
|
|
252
|
+
}, o = () => {
|
|
253
|
+
r === "click" && D();
|
|
254
|
+
}, m = () => {
|
|
255
|
+
r === "doubleClick" && D();
|
|
256
|
+
}, w = (Z) => {
|
|
257
|
+
r === "contextMenu" && (Z.preventDefault(), D());
|
|
248
258
|
};
|
|
249
|
-
return r === "hover" && (e.addEventListener("mouseenter", i), e.addEventListener("mouseleave",
|
|
250
|
-
r === "hover" && (e.removeEventListener("mouseenter", i), e.removeEventListener("mouseleave",
|
|
259
|
+
return r === "hover" && (e.addEventListener("mouseenter", i), e.addEventListener("mouseleave", c)), r === "click" && e.addEventListener("click", o), r === "doubleClick" && e.addEventListener("dblclick", m), r === "contextMenu" && e.addEventListener("contextmenu", w), () => {
|
|
260
|
+
r === "hover" && (e.removeEventListener("mouseenter", i), e.removeEventListener("mouseleave", c)), r === "click" && e.removeEventListener("click", o), r === "doubleClick" && e.removeEventListener("dblclick", m), r === "contextMenu" && e.removeEventListener("contextmenu", w);
|
|
251
261
|
};
|
|
252
|
-
}, [r,
|
|
253
|
-
if (r === "hover" || !
|
|
262
|
+
}, [r, s, Y, X, U, D]), b(() => {
|
|
263
|
+
if (r === "hover" || !p || typeof window > "u")
|
|
254
264
|
return;
|
|
255
265
|
const e = (i) => {
|
|
256
|
-
const
|
|
257
|
-
|
|
266
|
+
const c = i.target;
|
|
267
|
+
c && (L.current?.contains(c) || s?.contains(c) || ue());
|
|
258
268
|
};
|
|
259
269
|
return window.addEventListener("mousedown", e, !0), window.addEventListener("touchstart", e, !0), () => {
|
|
260
270
|
window.removeEventListener("mousedown", e, !0), window.removeEventListener("touchstart", e, !0);
|
|
261
271
|
};
|
|
262
|
-
}, [r,
|
|
263
|
-
const
|
|
264
|
-
r === "hover" && (
|
|
265
|
-
},
|
|
266
|
-
r === "hover" &&
|
|
267
|
-
},
|
|
268
|
-
if (
|
|
272
|
+
}, [r, s, ue, p]);
|
|
273
|
+
const Ee = () => {
|
|
274
|
+
r === "hover" && (Y(), X());
|
|
275
|
+
}, Ce = () => {
|
|
276
|
+
r === "hover" && U();
|
|
277
|
+
}, ae = be(() => {
|
|
278
|
+
if (l === "left")
|
|
269
279
|
return -1;
|
|
270
|
-
if (
|
|
271
|
-
return Math.max(
|
|
272
|
-
const e =
|
|
273
|
-
return
|
|
274
|
-
}, [
|
|
275
|
-
if (!
|
|
280
|
+
if (l === "right")
|
|
281
|
+
return Math.max(d.panelWidth - E - 1, 0);
|
|
282
|
+
const e = d.indicatorOffset - E / 2, i = Math.max(d.panelWidth - E, 0);
|
|
283
|
+
return R(e, 0, i);
|
|
284
|
+
}, [d.indicatorOffset, d.panelWidth, l]), de = be(() => typeof document > "u" ? null : h ? s?.offsetParent ?? document.body : document.body, [h, s]);
|
|
285
|
+
if (!de || !u)
|
|
276
286
|
return null;
|
|
277
|
-
const
|
|
278
|
-
position:
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
+
const Le = f && !p ? 0.35 : !p && !f || p && !ie ? 0 : 1, ke = f && !p || p && ie && !ve ? "0" : d.placement === "below" ? "-6px" : "6px", Se = p ? "auto" : "none", fe = parseFloat(k.borderWidth) || 0, Oe = {
|
|
288
|
+
position: h ? "absolute" : "fixed",
|
|
289
|
+
top: 0,
|
|
290
|
+
left: 0,
|
|
291
|
+
pointerEvents: Se,
|
|
292
|
+
zIndex: f ? 70 : 60,
|
|
293
|
+
willChange: "transform"
|
|
294
|
+
}, Ie = {
|
|
295
|
+
opacity: Le,
|
|
296
|
+
transform: `translate3d(0,${ke},0)`,
|
|
297
|
+
transition: `opacity ${ee}ms ease, transform ${ee}ms ease`
|
|
298
|
+
}, Re = Ke(n) ? n(he) : n, Te = {
|
|
287
299
|
width: E,
|
|
288
|
-
height:
|
|
289
|
-
left: `${
|
|
290
|
-
top:
|
|
291
|
-
bottom:
|
|
300
|
+
height: N,
|
|
301
|
+
left: `${ae}px`,
|
|
302
|
+
top: d.placement === "below" ? `-${N}px` : void 0,
|
|
303
|
+
bottom: d.placement === "above" ? `-${N}px` : void 0,
|
|
292
304
|
overflow: "visible"
|
|
293
|
-
},
|
|
305
|
+
}, We = k.backgroundColor || (f ? "var(--error-500)" : "var(--neutral-800)"), Ae = k.borderColor || void 0, Pe = parseFloat(k.borderWidth) || 0, je = k.borderStyle.includes("dash") ? "4 2" : k.borderStyle.includes("dot") ? "1 2" : void 0, Ne = $ ? "" : l === "left" ? d.placement === "below" ? "rounded-tl-none" : "rounded-bl-none" : l === "right" ? d.placement === "below" ? "rounded-tr-none" : "rounded-br-none" : "", Fe = Me(
|
|
294
306
|
"relative pointer-events-auto rounded-lg border shadow-2xl",
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
),
|
|
307
|
+
Ne,
|
|
308
|
+
f ? "bg-neutral-medium-default opacity-80! border-error-default-default border " : "bg-neutral-medium-default border-neutral-800/60",
|
|
309
|
+
re
|
|
310
|
+
), $e = /* @__PURE__ */ a.jsx(
|
|
299
311
|
"div",
|
|
300
312
|
{
|
|
301
|
-
ref:
|
|
302
|
-
|
|
303
|
-
style: Ce,
|
|
304
|
-
onMouseEnter: ve,
|
|
305
|
-
onMouseLeave: we,
|
|
306
|
-
"data-placement": c.placement,
|
|
313
|
+
ref: G,
|
|
314
|
+
style: Oe,
|
|
307
315
|
"aria-hidden": !P,
|
|
308
|
-
children:
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
316
|
+
children: /* @__PURE__ */ a.jsxs(
|
|
317
|
+
"div",
|
|
318
|
+
{
|
|
319
|
+
ref: L,
|
|
320
|
+
className: Fe,
|
|
321
|
+
style: Ie,
|
|
322
|
+
onMouseEnter: Ee,
|
|
323
|
+
onMouseLeave: Ce,
|
|
324
|
+
"data-placement": d.placement,
|
|
325
|
+
children: [
|
|
326
|
+
!$ && /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
327
|
+
/* @__PURE__ */ a.jsx("div", { className: "absolute", "aria-hidden": "true", style: Te, children: /* @__PURE__ */ a.jsx(
|
|
328
|
+
"svg",
|
|
329
|
+
{
|
|
330
|
+
width: E,
|
|
331
|
+
height: N,
|
|
332
|
+
viewBox: `0 0 ${E} ${N}`,
|
|
333
|
+
role: "presentation",
|
|
334
|
+
children: /* @__PURE__ */ a.jsx(
|
|
335
|
+
"polygon",
|
|
336
|
+
{
|
|
337
|
+
fill: We,
|
|
338
|
+
points: Qe(d.placement, l),
|
|
339
|
+
stroke: Ae,
|
|
340
|
+
strokeWidth: Pe,
|
|
341
|
+
vectorEffect: "non-scaling-stroke",
|
|
342
|
+
strokeDasharray: je
|
|
343
|
+
}
|
|
344
|
+
)
|
|
345
|
+
}
|
|
346
|
+
) }),
|
|
347
|
+
fe > 0 && /* @__PURE__ */ a.jsx(
|
|
348
|
+
"div",
|
|
349
|
+
{
|
|
350
|
+
"aria-hidden": "true",
|
|
351
|
+
style: {
|
|
352
|
+
position: "absolute",
|
|
353
|
+
left: `${ae}px`,
|
|
354
|
+
width: `${E}px`,
|
|
355
|
+
height: `${fe}px`,
|
|
356
|
+
background: k.backgroundColor || "transparent",
|
|
357
|
+
top: d.placement === "below" ? "-1px" : void 0,
|
|
358
|
+
bottom: d.placement === "above" ? "-1px" : void 0,
|
|
359
|
+
pointerEvents: "none",
|
|
360
|
+
zIndex: 1
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
)
|
|
364
|
+
] }),
|
|
365
|
+
Re
|
|
366
|
+
]
|
|
367
|
+
}
|
|
368
|
+
)
|
|
348
369
|
}
|
|
349
|
-
),
|
|
370
|
+
), He = f && g ? /* @__PURE__ */ a.jsxs(
|
|
350
371
|
"div",
|
|
351
372
|
{
|
|
352
373
|
className: "pointer-events-none text-center bg-red-500/90 text-red-200 rounded-lg px-2 py-1 text-[8px] font-semibold shadow-lg z-50",
|
|
353
374
|
style: {
|
|
354
375
|
position: "fixed",
|
|
355
|
-
top:
|
|
356
|
-
left:
|
|
376
|
+
top: g.top - 30,
|
|
377
|
+
left: g.left - 20
|
|
357
378
|
},
|
|
358
379
|
children: [
|
|
359
380
|
"Popover Trigger: ",
|
|
360
|
-
/* @__PURE__ */
|
|
381
|
+
/* @__PURE__ */ a.jsx("br", {}),
|
|
361
382
|
" ",
|
|
362
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ a.jsx("span", { className: "text-white text-[10px]", children: r })
|
|
363
384
|
]
|
|
364
385
|
}
|
|
365
386
|
) : null;
|
|
366
|
-
return /* @__PURE__ */
|
|
367
|
-
/* @__PURE__ */
|
|
368
|
-
|
|
369
|
-
|
|
387
|
+
return /* @__PURE__ */ a.jsx(a.Fragment, { children: Ge(
|
|
388
|
+
/* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
389
|
+
$e,
|
|
390
|
+
He
|
|
370
391
|
] }),
|
|
371
|
-
|
|
392
|
+
de
|
|
372
393
|
) });
|
|
373
394
|
};
|
|
374
395
|
export {
|
|
375
|
-
|
|
396
|
+
st as default
|
|
376
397
|
};
|