@alixpartners/ui-components 2.4.1 → 2.4.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/FilePicker.css +1 -1
- package/dist/assets/SplitButton.css +1 -1
- package/dist/assets/ap-icons-types.d.ts +1 -1
- package/dist/assets/ap-icons.d.ts +1 -1
- package/dist/assets/main.css +1 -1
- package/dist/components/DragAndDrop/DragAndDrop.d.ts +5 -3
- package/dist/components/DragAndDrop/DragAndDrop.js +103 -101
- package/dist/components/FilePicker/FilePicker.d.ts +6 -2
- package/dist/components/FilePicker/FilePicker.js +197 -189
- package/dist/components/Icons/IconsGallery.js +1 -1
- package/dist/components/SplitButton/SplitButton.js +132 -127
- package/dist/components/Tooltip/Tooltip.d.ts +3 -1
- package/dist/components/Tooltip/Tooltip.js +200 -196
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { useState as
|
|
1
|
+
import { jsx as c, jsxs as k, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
+
import * as l from "react";
|
|
3
|
+
import { useState as ee } from "react";
|
|
4
4
|
import { c as j } from "../../clsx-OuTLNxxd.js";
|
|
5
|
-
import
|
|
6
|
-
import { P as
|
|
7
|
-
import { P as
|
|
8
|
-
import { u as
|
|
9
|
-
import { R as
|
|
5
|
+
import te from "../Icon/Icon.js";
|
|
6
|
+
import { P as F, u as oe, d as G, c as C, b as re, h as ne } from "../../index-DM51yNMI.js";
|
|
7
|
+
import { P as le, D as ie } from "../../index-DrR82jOT.js";
|
|
8
|
+
import { u as se } from "../../index-7CBv-Jx6.js";
|
|
9
|
+
import { R as ae, A as ce, a as ue, c as B, C as pe } from "../../index-C-3_YVJ1.js";
|
|
10
10
|
import { P as K } from "../../index-BymOxiM6.js";
|
|
11
|
-
import '../../assets/Tooltip.css';var
|
|
11
|
+
import '../../assets/Tooltip.css';var de = Object.freeze({
|
|
12
12
|
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
13
13
|
position: "absolute",
|
|
14
14
|
border: 0,
|
|
@@ -20,48 +20,48 @@ import '../../assets/Tooltip.css';var pe = Object.freeze({
|
|
|
20
20
|
clip: "rect(0, 0, 0, 0)",
|
|
21
21
|
whiteSpace: "nowrap",
|
|
22
22
|
wordWrap: "normal"
|
|
23
|
-
}),
|
|
24
|
-
(
|
|
25
|
-
|
|
23
|
+
}), fe = "VisuallyHidden", U = l.forwardRef(
|
|
24
|
+
(e, o) => /* @__PURE__ */ c(
|
|
25
|
+
F.span,
|
|
26
26
|
{
|
|
27
|
-
...
|
|
27
|
+
...e,
|
|
28
28
|
ref: o,
|
|
29
|
-
style: { ...
|
|
29
|
+
style: { ...de, ...e.style }
|
|
30
30
|
}
|
|
31
31
|
)
|
|
32
32
|
);
|
|
33
|
-
U.displayName =
|
|
34
|
-
var
|
|
33
|
+
U.displayName = fe;
|
|
34
|
+
var he = U, [D] = re("Tooltip", [
|
|
35
35
|
B
|
|
36
|
-
]), L = B(), V = "TooltipProvider",
|
|
36
|
+
]), L = B(), V = "TooltipProvider", ve = 700, A = "tooltip.open", [_e, I] = D(V), $ = (e) => {
|
|
37
37
|
const {
|
|
38
38
|
__scopeTooltip: o,
|
|
39
|
-
delayDuration:
|
|
39
|
+
delayDuration: t = ve,
|
|
40
40
|
skipDelayDuration: r = 300,
|
|
41
41
|
disableHoverableContent: n = !1,
|
|
42
42
|
children: s
|
|
43
|
-
} =
|
|
44
|
-
return
|
|
45
|
-
const
|
|
46
|
-
return () => window.clearTimeout(
|
|
47
|
-
}, []), /* @__PURE__ */
|
|
48
|
-
|
|
43
|
+
} = e, a = l.useRef(!0), v = l.useRef(!1), i = l.useRef(0);
|
|
44
|
+
return l.useEffect(() => {
|
|
45
|
+
const p = i.current;
|
|
46
|
+
return () => window.clearTimeout(p);
|
|
47
|
+
}, []), /* @__PURE__ */ c(
|
|
48
|
+
_e,
|
|
49
49
|
{
|
|
50
50
|
scope: o,
|
|
51
51
|
isOpenDelayedRef: a,
|
|
52
|
-
delayDuration:
|
|
53
|
-
onOpen:
|
|
54
|
-
window.clearTimeout(
|
|
52
|
+
delayDuration: t,
|
|
53
|
+
onOpen: l.useCallback(() => {
|
|
54
|
+
window.clearTimeout(i.current), a.current = !1;
|
|
55
55
|
}, []),
|
|
56
|
-
onClose:
|
|
57
|
-
window.clearTimeout(
|
|
56
|
+
onClose: l.useCallback(() => {
|
|
57
|
+
window.clearTimeout(i.current), i.current = window.setTimeout(
|
|
58
58
|
() => a.current = !0,
|
|
59
59
|
r
|
|
60
60
|
);
|
|
61
61
|
}, [r]),
|
|
62
|
-
isPointerInTransitRef:
|
|
63
|
-
onPointerInTransitChange:
|
|
64
|
-
|
|
62
|
+
isPointerInTransitRef: v,
|
|
63
|
+
onPointerInTransitChange: l.useCallback((p) => {
|
|
64
|
+
v.current = p;
|
|
65
65
|
}, []),
|
|
66
66
|
disableHoverableContent: n,
|
|
67
67
|
children: s
|
|
@@ -69,159 +69,159 @@ var fe = U, [D] = oe("Tooltip", [
|
|
|
69
69
|
);
|
|
70
70
|
};
|
|
71
71
|
$.displayName = V;
|
|
72
|
-
var R = "Tooltip", [
|
|
72
|
+
var R = "Tooltip", [me, O] = D(R), Y = (e) => {
|
|
73
73
|
const {
|
|
74
74
|
__scopeTooltip: o,
|
|
75
|
-
children:
|
|
75
|
+
children: t,
|
|
76
76
|
open: r,
|
|
77
77
|
defaultOpen: n,
|
|
78
78
|
onOpenChange: s,
|
|
79
79
|
disableHoverableContent: a,
|
|
80
|
-
delayDuration:
|
|
81
|
-
} =
|
|
80
|
+
delayDuration: v
|
|
81
|
+
} = e, i = I(R, e.__scopeTooltip), p = L(o), [u, h] = l.useState(null), f = se(), d = l.useRef(0), m = a ?? i.disableHoverableContent, T = v ?? i.delayDuration, _ = l.useRef(!1), [g, x] = oe({
|
|
82
82
|
prop: r,
|
|
83
83
|
defaultProp: n ?? !1,
|
|
84
84
|
onChange: (S) => {
|
|
85
|
-
S ? (
|
|
85
|
+
S ? (i.onOpen(), document.dispatchEvent(new CustomEvent(A))) : i.onClose(), s == null || s(S);
|
|
86
86
|
},
|
|
87
87
|
caller: R
|
|
88
|
-
}), w =
|
|
89
|
-
window.clearTimeout(
|
|
90
|
-
}, [x]), P =
|
|
91
|
-
window.clearTimeout(
|
|
92
|
-
}, [x]), H =
|
|
93
|
-
window.clearTimeout(
|
|
94
|
-
|
|
95
|
-
},
|
|
96
|
-
}, [
|
|
97
|
-
return
|
|
98
|
-
|
|
99
|
-
}, []), /* @__PURE__ */
|
|
100
|
-
|
|
88
|
+
}), w = l.useMemo(() => g ? _.current ? "delayed-open" : "instant-open" : "closed", [g]), E = l.useCallback(() => {
|
|
89
|
+
window.clearTimeout(d.current), d.current = 0, _.current = !1, x(!0);
|
|
90
|
+
}, [x]), P = l.useCallback(() => {
|
|
91
|
+
window.clearTimeout(d.current), d.current = 0, x(!1);
|
|
92
|
+
}, [x]), H = l.useCallback(() => {
|
|
93
|
+
window.clearTimeout(d.current), d.current = window.setTimeout(() => {
|
|
94
|
+
_.current = !0, x(!0), d.current = 0;
|
|
95
|
+
}, T);
|
|
96
|
+
}, [T, x]);
|
|
97
|
+
return l.useEffect(() => () => {
|
|
98
|
+
d.current && (window.clearTimeout(d.current), d.current = 0);
|
|
99
|
+
}, []), /* @__PURE__ */ c(ae, { ...p, children: /* @__PURE__ */ c(
|
|
100
|
+
me,
|
|
101
101
|
{
|
|
102
102
|
scope: o,
|
|
103
|
-
contentId:
|
|
103
|
+
contentId: f,
|
|
104
104
|
open: g,
|
|
105
105
|
stateAttribute: w,
|
|
106
|
-
trigger:
|
|
107
|
-
onTriggerChange:
|
|
108
|
-
onTriggerEnter:
|
|
109
|
-
|
|
110
|
-
}, [
|
|
111
|
-
onTriggerLeave:
|
|
112
|
-
m ? P() : (window.clearTimeout(
|
|
106
|
+
trigger: u,
|
|
107
|
+
onTriggerChange: h,
|
|
108
|
+
onTriggerEnter: l.useCallback(() => {
|
|
109
|
+
i.isOpenDelayedRef.current ? H() : E();
|
|
110
|
+
}, [i.isOpenDelayedRef, H, E]),
|
|
111
|
+
onTriggerLeave: l.useCallback(() => {
|
|
112
|
+
m ? P() : (window.clearTimeout(d.current), d.current = 0);
|
|
113
113
|
}, [P, m]),
|
|
114
114
|
onOpen: E,
|
|
115
115
|
onClose: P,
|
|
116
116
|
disableHoverableContent: m,
|
|
117
|
-
children:
|
|
117
|
+
children: t
|
|
118
118
|
}
|
|
119
119
|
) });
|
|
120
120
|
};
|
|
121
121
|
Y.displayName = R;
|
|
122
|
-
var N = "TooltipTrigger", X =
|
|
123
|
-
(
|
|
124
|
-
const { __scopeTooltip:
|
|
125
|
-
return
|
|
126
|
-
|
|
122
|
+
var N = "TooltipTrigger", X = l.forwardRef(
|
|
123
|
+
(e, o) => {
|
|
124
|
+
const { __scopeTooltip: t, ...r } = e, n = O(N, t), s = I(N, t), a = L(t), v = l.useRef(null), i = G(o, v, n.onTriggerChange), p = l.useRef(!1), u = l.useRef(!1), h = l.useCallback(() => p.current = !1, []);
|
|
125
|
+
return l.useEffect(() => () => document.removeEventListener("pointerup", h), [h]), /* @__PURE__ */ c(ce, { asChild: !0, ...a, children: /* @__PURE__ */ c(
|
|
126
|
+
F.button,
|
|
127
127
|
{
|
|
128
128
|
"aria-describedby": n.open ? n.contentId : void 0,
|
|
129
129
|
"data-state": n.stateAttribute,
|
|
130
130
|
...r,
|
|
131
|
-
ref:
|
|
132
|
-
onPointerMove: C(
|
|
133
|
-
|
|
131
|
+
ref: i,
|
|
132
|
+
onPointerMove: C(e.onPointerMove, (f) => {
|
|
133
|
+
f.pointerType !== "touch" && !u.current && !s.isPointerInTransitRef.current && (n.onTriggerEnter(), u.current = !0);
|
|
134
134
|
}),
|
|
135
|
-
onPointerLeave: C(
|
|
136
|
-
n.onTriggerLeave(),
|
|
135
|
+
onPointerLeave: C(e.onPointerLeave, () => {
|
|
136
|
+
n.onTriggerLeave(), u.current = !1;
|
|
137
137
|
}),
|
|
138
|
-
onPointerDown: C(
|
|
139
|
-
n.open && n.onClose(),
|
|
138
|
+
onPointerDown: C(e.onPointerDown, () => {
|
|
139
|
+
n.open && n.onClose(), p.current = !0, document.addEventListener("pointerup", h, { once: !0 });
|
|
140
140
|
}),
|
|
141
|
-
onFocus: C(
|
|
142
|
-
|
|
141
|
+
onFocus: C(e.onFocus, () => {
|
|
142
|
+
p.current || n.onOpen();
|
|
143
143
|
}),
|
|
144
|
-
onBlur: C(
|
|
145
|
-
onClick: C(
|
|
144
|
+
onBlur: C(e.onBlur, n.onClose),
|
|
145
|
+
onClick: C(e.onClick, n.onClose)
|
|
146
146
|
}
|
|
147
147
|
) });
|
|
148
148
|
}
|
|
149
149
|
);
|
|
150
150
|
X.displayName = N;
|
|
151
|
-
var M = "TooltipPortal", [
|
|
151
|
+
var M = "TooltipPortal", [Te, ye] = D(M, {
|
|
152
152
|
forceMount: void 0
|
|
153
|
-
}), q = (
|
|
154
|
-
const { __scopeTooltip: o, forceMount:
|
|
155
|
-
return /* @__PURE__ */
|
|
153
|
+
}), q = (e) => {
|
|
154
|
+
const { __scopeTooltip: o, forceMount: t, children: r, container: n } = e, s = O(M, o);
|
|
155
|
+
return /* @__PURE__ */ c(Te, { scope: o, forceMount: t, children: /* @__PURE__ */ c(K, { present: t || s.open, children: /* @__PURE__ */ c(le, { asChild: !0, container: n, children: r }) }) });
|
|
156
156
|
};
|
|
157
157
|
q.displayName = M;
|
|
158
|
-
var b = "TooltipContent", W =
|
|
159
|
-
(
|
|
160
|
-
const
|
|
161
|
-
return /* @__PURE__ */
|
|
158
|
+
var b = "TooltipContent", W = l.forwardRef(
|
|
159
|
+
(e, o) => {
|
|
160
|
+
const t = ye(b, e.__scopeTooltip), { forceMount: r = t.forceMount, side: n = "top", ...s } = e, a = O(b, e.__scopeTooltip);
|
|
161
|
+
return /* @__PURE__ */ c(K, { present: r || a.open, children: a.disableHoverableContent ? /* @__PURE__ */ c(z, { side: n, ...s, ref: o }) : /* @__PURE__ */ c(xe, { side: n, ...s, ref: o }) });
|
|
162
162
|
}
|
|
163
|
-
),
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
}, [
|
|
167
|
-
(m,
|
|
168
|
-
const
|
|
169
|
-
|
|
163
|
+
), xe = l.forwardRef((e, o) => {
|
|
164
|
+
const t = O(b, e.__scopeTooltip), r = I(b, e.__scopeTooltip), n = l.useRef(null), s = G(o, n), [a, v] = l.useState(null), { trigger: i, onClose: p } = t, u = n.current, { onPointerInTransitChange: h } = r, f = l.useCallback(() => {
|
|
165
|
+
v(null), h(!1);
|
|
166
|
+
}, [h]), d = l.useCallback(
|
|
167
|
+
(m, T) => {
|
|
168
|
+
const _ = m.currentTarget, g = { x: m.clientX, y: m.clientY }, x = we(g, _.getBoundingClientRect()), w = Ee(g, x), E = Pe(T.getBoundingClientRect()), P = Oe([...w, ...E]);
|
|
169
|
+
v(P), h(!0);
|
|
170
170
|
},
|
|
171
|
-
[
|
|
171
|
+
[h]
|
|
172
172
|
);
|
|
173
|
-
return
|
|
174
|
-
if (
|
|
175
|
-
const m = (
|
|
176
|
-
return
|
|
177
|
-
|
|
173
|
+
return l.useEffect(() => () => f(), [f]), l.useEffect(() => {
|
|
174
|
+
if (i && u) {
|
|
175
|
+
const m = (_) => d(_, u), T = (_) => d(_, i);
|
|
176
|
+
return i.addEventListener("pointerleave", m), u.addEventListener("pointerleave", T), () => {
|
|
177
|
+
i.removeEventListener("pointerleave", m), u.removeEventListener("pointerleave", T);
|
|
178
178
|
};
|
|
179
179
|
}
|
|
180
|
-
}, [
|
|
180
|
+
}, [i, u, d, f]), l.useEffect(() => {
|
|
181
181
|
if (a) {
|
|
182
|
-
const m = (
|
|
183
|
-
const
|
|
184
|
-
x ?
|
|
182
|
+
const m = (T) => {
|
|
183
|
+
const _ = T.target, g = { x: T.clientX, y: T.clientY }, x = (i == null ? void 0 : i.contains(_)) || (u == null ? void 0 : u.contains(_)), w = !Re(g, a);
|
|
184
|
+
x ? f() : w && (f(), p());
|
|
185
185
|
};
|
|
186
186
|
return document.addEventListener("pointermove", m), () => document.removeEventListener("pointermove", m);
|
|
187
187
|
}
|
|
188
|
-
}, [
|
|
189
|
-
}), [
|
|
190
|
-
(
|
|
188
|
+
}, [i, u, a, p, f]), /* @__PURE__ */ c(z, { ...e, ref: s });
|
|
189
|
+
}), [ge, Ce] = D(R, { isInside: !1 }), be = ne("TooltipContent"), z = l.forwardRef(
|
|
190
|
+
(e, o) => {
|
|
191
191
|
const {
|
|
192
|
-
__scopeTooltip:
|
|
192
|
+
__scopeTooltip: t,
|
|
193
193
|
children: r,
|
|
194
194
|
"aria-label": n,
|
|
195
195
|
onEscapeKeyDown: s,
|
|
196
196
|
onPointerDownOutside: a,
|
|
197
|
-
...
|
|
198
|
-
} =
|
|
199
|
-
return
|
|
200
|
-
if (
|
|
201
|
-
const
|
|
202
|
-
const
|
|
203
|
-
|
|
197
|
+
...v
|
|
198
|
+
} = e, i = O(b, t), p = L(t), { onClose: u } = i;
|
|
199
|
+
return l.useEffect(() => (document.addEventListener(A, u), () => document.removeEventListener(A, u)), [u]), l.useEffect(() => {
|
|
200
|
+
if (i.trigger) {
|
|
201
|
+
const h = (f) => {
|
|
202
|
+
const d = f.target;
|
|
203
|
+
d != null && d.contains(i.trigger) && u();
|
|
204
204
|
};
|
|
205
|
-
return window.addEventListener("scroll",
|
|
205
|
+
return window.addEventListener("scroll", h, { capture: !0 }), () => window.removeEventListener("scroll", h, { capture: !0 });
|
|
206
206
|
}
|
|
207
|
-
}, [
|
|
208
|
-
|
|
207
|
+
}, [i.trigger, u]), /* @__PURE__ */ c(
|
|
208
|
+
ie,
|
|
209
209
|
{
|
|
210
210
|
asChild: !0,
|
|
211
211
|
disableOutsidePointerEvents: !1,
|
|
212
212
|
onEscapeKeyDown: s,
|
|
213
213
|
onPointerDownOutside: a,
|
|
214
|
-
onFocusOutside: (
|
|
215
|
-
onDismiss:
|
|
214
|
+
onFocusOutside: (h) => h.preventDefault(),
|
|
215
|
+
onDismiss: u,
|
|
216
216
|
children: /* @__PURE__ */ k(
|
|
217
|
-
|
|
217
|
+
pe,
|
|
218
218
|
{
|
|
219
|
-
"data-state":
|
|
220
|
-
...
|
|
221
|
-
...
|
|
219
|
+
"data-state": i.stateAttribute,
|
|
220
|
+
...p,
|
|
221
|
+
...v,
|
|
222
222
|
ref: o,
|
|
223
223
|
style: {
|
|
224
|
-
...
|
|
224
|
+
...v.style,
|
|
225
225
|
"--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
226
226
|
"--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
|
|
227
227
|
"--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
|
|
@@ -229,8 +229,8 @@ var b = "TooltipContent", W = i.forwardRef(
|
|
|
229
229
|
"--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
|
|
230
230
|
},
|
|
231
231
|
children: [
|
|
232
|
-
/* @__PURE__ */
|
|
233
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ c(be, { children: r }),
|
|
233
|
+
/* @__PURE__ */ c(ge, { scope: t, isInside: !0, children: /* @__PURE__ */ c(he, { id: i.contentId, role: "tooltip", children: n || r }) })
|
|
234
234
|
]
|
|
235
235
|
}
|
|
236
236
|
)
|
|
@@ -239,24 +239,24 @@ var b = "TooltipContent", W = i.forwardRef(
|
|
|
239
239
|
}
|
|
240
240
|
);
|
|
241
241
|
W.displayName = b;
|
|
242
|
-
var J = "TooltipArrow", Q =
|
|
243
|
-
(
|
|
244
|
-
const { __scopeTooltip:
|
|
245
|
-
return
|
|
242
|
+
var J = "TooltipArrow", Q = l.forwardRef(
|
|
243
|
+
(e, o) => {
|
|
244
|
+
const { __scopeTooltip: t, ...r } = e, n = L(t);
|
|
245
|
+
return Ce(
|
|
246
246
|
J,
|
|
247
|
-
|
|
248
|
-
).isInside ? null : /* @__PURE__ */
|
|
247
|
+
t
|
|
248
|
+
).isInside ? null : /* @__PURE__ */ c(ue, { ...n, ...r, ref: o });
|
|
249
249
|
}
|
|
250
250
|
);
|
|
251
251
|
Q.displayName = J;
|
|
252
|
-
function
|
|
253
|
-
const
|
|
254
|
-
switch (Math.min(
|
|
252
|
+
function we(e, o) {
|
|
253
|
+
const t = Math.abs(o.top - e.y), r = Math.abs(o.bottom - e.y), n = Math.abs(o.right - e.x), s = Math.abs(o.left - e.x);
|
|
254
|
+
switch (Math.min(t, r, n, s)) {
|
|
255
255
|
case s:
|
|
256
256
|
return "left";
|
|
257
257
|
case n:
|
|
258
258
|
return "right";
|
|
259
|
-
case
|
|
259
|
+
case t:
|
|
260
260
|
return "top";
|
|
261
261
|
case r:
|
|
262
262
|
return "bottom";
|
|
@@ -264,63 +264,63 @@ function be(t, o) {
|
|
|
264
264
|
throw new Error("unreachable");
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function Ee(e, o, t = 5) {
|
|
268
268
|
const r = [];
|
|
269
269
|
switch (o) {
|
|
270
270
|
case "top":
|
|
271
271
|
r.push(
|
|
272
|
-
{ x:
|
|
273
|
-
{ x:
|
|
272
|
+
{ x: e.x - t, y: e.y + t },
|
|
273
|
+
{ x: e.x + t, y: e.y + t }
|
|
274
274
|
);
|
|
275
275
|
break;
|
|
276
276
|
case "bottom":
|
|
277
277
|
r.push(
|
|
278
|
-
{ x:
|
|
279
|
-
{ x:
|
|
278
|
+
{ x: e.x - t, y: e.y - t },
|
|
279
|
+
{ x: e.x + t, y: e.y - t }
|
|
280
280
|
);
|
|
281
281
|
break;
|
|
282
282
|
case "left":
|
|
283
283
|
r.push(
|
|
284
|
-
{ x:
|
|
285
|
-
{ x:
|
|
284
|
+
{ x: e.x + t, y: e.y - t },
|
|
285
|
+
{ x: e.x + t, y: e.y + t }
|
|
286
286
|
);
|
|
287
287
|
break;
|
|
288
288
|
case "right":
|
|
289
289
|
r.push(
|
|
290
|
-
{ x:
|
|
291
|
-
{ x:
|
|
290
|
+
{ x: e.x - t, y: e.y - t },
|
|
291
|
+
{ x: e.x - t, y: e.y + t }
|
|
292
292
|
);
|
|
293
293
|
break;
|
|
294
294
|
}
|
|
295
295
|
return r;
|
|
296
296
|
}
|
|
297
|
-
function
|
|
298
|
-
const { top: o, right:
|
|
297
|
+
function Pe(e) {
|
|
298
|
+
const { top: o, right: t, bottom: r, left: n } = e;
|
|
299
299
|
return [
|
|
300
300
|
{ x: n, y: o },
|
|
301
|
-
{ x:
|
|
302
|
-
{ x:
|
|
301
|
+
{ x: t, y: o },
|
|
302
|
+
{ x: t, y: r },
|
|
303
303
|
{ x: n, y: r }
|
|
304
304
|
];
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
const { x:
|
|
306
|
+
function Re(e, o) {
|
|
307
|
+
const { x: t, y: r } = e;
|
|
308
308
|
let n = !1;
|
|
309
309
|
for (let s = 0, a = o.length - 1; s < o.length; a = s++) {
|
|
310
|
-
const
|
|
311
|
-
|
|
310
|
+
const v = o[s], i = o[a], p = v.x, u = v.y, h = i.x, f = i.y;
|
|
311
|
+
u > r != f > r && t < (h - p) * (r - u) / (f - u) + p && (n = !n);
|
|
312
312
|
}
|
|
313
313
|
return n;
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
const o =
|
|
317
|
-
return o.sort((
|
|
315
|
+
function Oe(e) {
|
|
316
|
+
const o = e.slice();
|
|
317
|
+
return o.sort((t, r) => t.x < r.x ? -1 : t.x > r.x ? 1 : t.y < r.y ? -1 : t.y > r.y ? 1 : 0), De(o);
|
|
318
318
|
}
|
|
319
|
-
function
|
|
320
|
-
if (
|
|
319
|
+
function De(e) {
|
|
320
|
+
if (e.length <= 1) return e.slice();
|
|
321
321
|
const o = [];
|
|
322
|
-
for (let r = 0; r <
|
|
323
|
-
const n =
|
|
322
|
+
for (let r = 0; r < e.length; r++) {
|
|
323
|
+
const n = e[r];
|
|
324
324
|
for (; o.length >= 2; ) {
|
|
325
325
|
const s = o[o.length - 1], a = o[o.length - 2];
|
|
326
326
|
if ((s.x - a.x) * (n.y - a.y) >= (s.y - a.y) * (n.x - a.x)) o.pop();
|
|
@@ -329,22 +329,22 @@ function Oe(t) {
|
|
|
329
329
|
o.push(n);
|
|
330
330
|
}
|
|
331
331
|
o.pop();
|
|
332
|
-
const
|
|
333
|
-
for (let r =
|
|
334
|
-
const n =
|
|
335
|
-
for (;
|
|
336
|
-
const s =
|
|
337
|
-
if ((s.x - a.x) * (n.y - a.y) >= (s.y - a.y) * (n.x - a.x))
|
|
332
|
+
const t = [];
|
|
333
|
+
for (let r = e.length - 1; r >= 0; r--) {
|
|
334
|
+
const n = e[r];
|
|
335
|
+
for (; t.length >= 2; ) {
|
|
336
|
+
const s = t[t.length - 1], a = t[t.length - 2];
|
|
337
|
+
if ((s.x - a.x) * (n.y - a.y) >= (s.y - a.y) * (n.x - a.x)) t.pop();
|
|
338
338
|
else break;
|
|
339
339
|
}
|
|
340
|
-
|
|
340
|
+
t.push(n);
|
|
341
341
|
}
|
|
342
|
-
return
|
|
342
|
+
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);
|
|
343
343
|
}
|
|
344
|
-
var
|
|
345
|
-
const
|
|
344
|
+
var Le = $, ke = Y, Ae = X, Ne = q, Ie = W, Me = Q;
|
|
345
|
+
const He = "Tooltip-module__tooltip___LjRUX", Se = "Tooltip-module__closable___MjoEb", y = {
|
|
346
346
|
"tooltip-container": "Tooltip-module__tooltip-container___X4jVa",
|
|
347
|
-
tooltip:
|
|
347
|
+
tooltip: He,
|
|
348
348
|
"tooltip-md": "Tooltip-module__tooltip-md___v79jI",
|
|
349
349
|
"tooltip-sm": "Tooltip-module__tooltip-sm___yOh4k",
|
|
350
350
|
"tooltip-dark": "Tooltip-module__tooltip-dark___PHEuo",
|
|
@@ -353,48 +353,52 @@ const Me = "Tooltip-module__tooltip___LjRUX", He = "Tooltip-module__closable___M
|
|
|
353
353
|
"tooltip-light": "Tooltip-module__tooltip-light___f9BKo",
|
|
354
354
|
"tooltip-close-icon": "Tooltip-module__tooltip-close-icon___EceS-",
|
|
355
355
|
"tooltip-content": "Tooltip-module__tooltip-content___fjJv5",
|
|
356
|
-
closable:
|
|
356
|
+
closable: Se,
|
|
357
357
|
"tooltip-enter": "Tooltip-module__tooltip-enter___KfwAg",
|
|
358
358
|
"tooltip-enter-active": "Tooltip-module__tooltip-enter-active___L7FtU",
|
|
359
359
|
"tooltip-exit": "Tooltip-module__tooltip-exit___RLxZG",
|
|
360
360
|
"tooltip-exit-active": "Tooltip-module__tooltip-exit-active___BsVba"
|
|
361
361
|
};
|
|
362
|
-
function
|
|
363
|
-
children:
|
|
362
|
+
function Xe({
|
|
363
|
+
children: e,
|
|
364
364
|
content: o,
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
365
|
+
disabled: t = !1,
|
|
366
|
+
size: r = "md",
|
|
367
|
+
theme: n = "dark",
|
|
368
|
+
tipSide: s = "top",
|
|
369
|
+
tipAlignment: a = "center",
|
|
370
|
+
keepVisible: v = !1,
|
|
371
|
+
startVisible: i = !1,
|
|
372
|
+
onClose: p,
|
|
373
|
+
className: u
|
|
373
374
|
}) {
|
|
374
|
-
const [
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
375
|
+
const [h, f] = ee(i);
|
|
376
|
+
if (t)
|
|
377
|
+
return /* @__PURE__ */ c(Z, { children: e });
|
|
378
|
+
const d = () => {
|
|
379
|
+
f(!1);
|
|
380
|
+
}, m = (_) => {
|
|
381
|
+
_.key === "Escape" && f(!1);
|
|
378
382
|
};
|
|
379
|
-
return /* @__PURE__ */
|
|
380
|
-
if (
|
|
381
|
-
return
|
|
382
|
-
|
|
383
|
-
}, children: /* @__PURE__ */ k("div", { className: j(y["tooltip-container"],
|
|
384
|
-
/* @__PURE__ */
|
|
383
|
+
return /* @__PURE__ */ c(Le, { children: /* @__PURE__ */ c(ke, { defaultOpen: i, open: h, onOpenChange: (_) => {
|
|
384
|
+
if (v)
|
|
385
|
+
return f(!0);
|
|
386
|
+
f(_), _ || p == null || p();
|
|
387
|
+
}, children: /* @__PURE__ */ k("div", { className: j(y["tooltip-container"], u), children: [
|
|
388
|
+
/* @__PURE__ */ c(Ae, { asChild: !0, children: /* @__PURE__ */ c("div", { onKeyDown: m, role: "button", style: {
|
|
385
389
|
display: "flex",
|
|
386
390
|
alignItems: "center",
|
|
387
391
|
justifyContent: "center"
|
|
388
|
-
}, className: y["tooltip-trigger"], children:
|
|
389
|
-
/* @__PURE__ */
|
|
392
|
+
}, className: y["tooltip-trigger"], children: e }) }),
|
|
393
|
+
/* @__PURE__ */ c(Ne, { children: /* @__PURE__ */ c(Ie, { style: {
|
|
390
394
|
zIndex: 9999
|
|
391
|
-
}, align:
|
|
392
|
-
/* @__PURE__ */
|
|
393
|
-
(
|
|
394
|
-
/* @__PURE__ */
|
|
395
|
+
}, align: a, side: s, sideOffset: 0, children: /* @__PURE__ */ k("div", { id: "tooltip", role: "tooltip", className: j(y.tooltip, y[`tooltip-${r}`], y[`tooltip-${n}`], y[`tooltip-${s}`], y[`tooltip-${a}`], p && y.closable), children: [
|
|
396
|
+
/* @__PURE__ */ c("div", { className: y["tooltip-content"], children: o }),
|
|
397
|
+
(p || v) && r === "md" && /* @__PURE__ */ c("button", { className: y["tooltip-close-button"], onClick: d, children: /* @__PURE__ */ c(te, { icon: "ap-icon-close", className: y["tooltip-close-icon"] }) }),
|
|
398
|
+
/* @__PURE__ */ c(Me, { width: 12, height: 6, className: y["tooltip-arrow"] })
|
|
395
399
|
] }) }) })
|
|
396
400
|
] }) }) });
|
|
397
401
|
}
|
|
398
402
|
export {
|
|
399
|
-
|
|
403
|
+
Xe as default
|
|
400
404
|
};
|