@alixpartners/ui-components 2.4.2 → 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.
@@ -1,14 +1,14 @@
1
- import { jsx as u, jsxs as k } from "react/jsx-runtime";
2
- import * as i from "react";
3
- import { useState as Z } from "react";
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 ee from "../Icon/Icon.js";
6
- import { P as G, u as te, d as F, c as C, b as oe, h as re } from "../../index-DM51yNMI.js";
7
- import { P as ne, D as le } from "../../index-DrR82jOT.js";
8
- import { u as ie } from "../../index-7CBv-Jx6.js";
9
- import { R as se, A as ae, a as ce, c as B, C as ue } from "../../index-C-3_YVJ1.js";
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 pe = Object.freeze({
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
- }), de = "VisuallyHidden", U = i.forwardRef(
24
- (t, o) => /* @__PURE__ */ u(
25
- G.span,
23
+ }), fe = "VisuallyHidden", U = l.forwardRef(
24
+ (e, o) => /* @__PURE__ */ c(
25
+ F.span,
26
26
  {
27
- ...t,
27
+ ...e,
28
28
  ref: o,
29
- style: { ...pe, ...t.style }
29
+ style: { ...de, ...e.style }
30
30
  }
31
31
  )
32
32
  );
33
- U.displayName = de;
34
- var fe = U, [D] = oe("Tooltip", [
33
+ U.displayName = fe;
34
+ var he = U, [D] = re("Tooltip", [
35
35
  B
36
- ]), L = B(), V = "TooltipProvider", he = 700, A = "tooltip.open", [ve, I] = D(V), $ = (t) => {
36
+ ]), L = B(), V = "TooltipProvider", ve = 700, A = "tooltip.open", [_e, I] = D(V), $ = (e) => {
37
37
  const {
38
38
  __scopeTooltip: o,
39
- delayDuration: e = he,
39
+ delayDuration: t = ve,
40
40
  skipDelayDuration: r = 300,
41
41
  disableHoverableContent: n = !1,
42
42
  children: s
43
- } = t, a = i.useRef(!0), h = i.useRef(!1), l = i.useRef(0);
44
- return i.useEffect(() => {
45
- const f = l.current;
46
- return () => window.clearTimeout(f);
47
- }, []), /* @__PURE__ */ u(
48
- ve,
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: e,
53
- onOpen: i.useCallback(() => {
54
- window.clearTimeout(l.current), a.current = !1;
52
+ delayDuration: t,
53
+ onOpen: l.useCallback(() => {
54
+ window.clearTimeout(i.current), a.current = !1;
55
55
  }, []),
56
- onClose: i.useCallback(() => {
57
- window.clearTimeout(l.current), l.current = window.setTimeout(
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: h,
63
- onPointerInTransitChange: i.useCallback((f) => {
64
- h.current = f;
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", [_e, O] = D(R), Y = (t) => {
72
+ var R = "Tooltip", [me, O] = D(R), Y = (e) => {
73
73
  const {
74
74
  __scopeTooltip: o,
75
- children: e,
75
+ children: t,
76
76
  open: r,
77
77
  defaultOpen: n,
78
78
  onOpenChange: s,
79
79
  disableHoverableContent: a,
80
- delayDuration: h
81
- } = t, l = I(R, t.__scopeTooltip), f = L(o), [c, d] = i.useState(null), v = ie(), p = i.useRef(0), m = a ?? l.disableHoverableContent, _ = h ?? l.delayDuration, T = i.useRef(!1), [g, x] = te({
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 ? (l.onOpen(), document.dispatchEvent(new CustomEvent(A))) : l.onClose(), s == null || s(S);
85
+ S ? (i.onOpen(), document.dispatchEvent(new CustomEvent(A))) : i.onClose(), s == null || s(S);
86
86
  },
87
87
  caller: R
88
- }), w = i.useMemo(() => g ? T.current ? "delayed-open" : "instant-open" : "closed", [g]), E = i.useCallback(() => {
89
- window.clearTimeout(p.current), p.current = 0, T.current = !1, x(!0);
90
- }, [x]), P = i.useCallback(() => {
91
- window.clearTimeout(p.current), p.current = 0, x(!1);
92
- }, [x]), H = i.useCallback(() => {
93
- window.clearTimeout(p.current), p.current = window.setTimeout(() => {
94
- T.current = !0, x(!0), p.current = 0;
95
- }, _);
96
- }, [_, x]);
97
- return i.useEffect(() => () => {
98
- p.current && (window.clearTimeout(p.current), p.current = 0);
99
- }, []), /* @__PURE__ */ u(se, { ...f, children: /* @__PURE__ */ u(
100
- _e,
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: v,
103
+ contentId: f,
104
104
  open: g,
105
105
  stateAttribute: w,
106
- trigger: c,
107
- onTriggerChange: d,
108
- onTriggerEnter: i.useCallback(() => {
109
- l.isOpenDelayedRef.current ? H() : E();
110
- }, [l.isOpenDelayedRef, H, E]),
111
- onTriggerLeave: i.useCallback(() => {
112
- m ? P() : (window.clearTimeout(p.current), p.current = 0);
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: e
117
+ children: t
118
118
  }
119
119
  ) });
120
120
  };
121
121
  Y.displayName = R;
122
- var N = "TooltipTrigger", X = i.forwardRef(
123
- (t, o) => {
124
- const { __scopeTooltip: e, ...r } = t, n = O(N, e), s = I(N, e), a = L(e), h = i.useRef(null), l = F(o, h, n.onTriggerChange), f = i.useRef(!1), c = i.useRef(!1), d = i.useCallback(() => f.current = !1, []);
125
- return i.useEffect(() => () => document.removeEventListener("pointerup", d), [d]), /* @__PURE__ */ u(ae, { asChild: !0, ...a, children: /* @__PURE__ */ u(
126
- G.button,
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: l,
132
- onPointerMove: C(t.onPointerMove, (v) => {
133
- v.pointerType !== "touch" && !c.current && !s.isPointerInTransitRef.current && (n.onTriggerEnter(), c.current = !0);
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(t.onPointerLeave, () => {
136
- n.onTriggerLeave(), c.current = !1;
135
+ onPointerLeave: C(e.onPointerLeave, () => {
136
+ n.onTriggerLeave(), u.current = !1;
137
137
  }),
138
- onPointerDown: C(t.onPointerDown, () => {
139
- n.open && n.onClose(), f.current = !0, document.addEventListener("pointerup", d, { once: !0 });
138
+ onPointerDown: C(e.onPointerDown, () => {
139
+ n.open && n.onClose(), p.current = !0, document.addEventListener("pointerup", h, { once: !0 });
140
140
  }),
141
- onFocus: C(t.onFocus, () => {
142
- f.current || n.onOpen();
141
+ onFocus: C(e.onFocus, () => {
142
+ p.current || n.onOpen();
143
143
  }),
144
- onBlur: C(t.onBlur, n.onClose),
145
- onClick: C(t.onClick, n.onClose)
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", [me, Te] = D(M, {
151
+ var M = "TooltipPortal", [Te, ye] = D(M, {
152
152
  forceMount: void 0
153
- }), q = (t) => {
154
- const { __scopeTooltip: o, forceMount: e, children: r, container: n } = t, s = O(M, o);
155
- return /* @__PURE__ */ u(me, { scope: o, forceMount: e, children: /* @__PURE__ */ u(K, { present: e || s.open, children: /* @__PURE__ */ u(ne, { asChild: !0, container: n, children: r }) }) });
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 = i.forwardRef(
159
- (t, o) => {
160
- const e = Te(b, t.__scopeTooltip), { forceMount: r = e.forceMount, side: n = "top", ...s } = t, a = O(b, t.__scopeTooltip);
161
- return /* @__PURE__ */ u(K, { present: r || a.open, children: a.disableHoverableContent ? /* @__PURE__ */ u(z, { side: n, ...s, ref: o }) : /* @__PURE__ */ u(ye, { side: n, ...s, ref: o }) });
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
- ), ye = i.forwardRef((t, o) => {
164
- const e = O(b, t.__scopeTooltip), r = I(b, t.__scopeTooltip), n = i.useRef(null), s = F(o, n), [a, h] = i.useState(null), { trigger: l, onClose: f } = e, c = n.current, { onPointerInTransitChange: d } = r, v = i.useCallback(() => {
165
- h(null), d(!1);
166
- }, [d]), p = i.useCallback(
167
- (m, _) => {
168
- const T = m.currentTarget, g = { x: m.clientX, y: m.clientY }, x = be(g, T.getBoundingClientRect()), w = we(g, x), E = Ee(_.getBoundingClientRect()), P = Re([...w, ...E]);
169
- h(P), d(!0);
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
- [d]
171
+ [h]
172
172
  );
173
- return i.useEffect(() => () => v(), [v]), i.useEffect(() => {
174
- if (l && c) {
175
- const m = (T) => p(T, c), _ = (T) => p(T, l);
176
- return l.addEventListener("pointerleave", m), c.addEventListener("pointerleave", _), () => {
177
- l.removeEventListener("pointerleave", m), c.removeEventListener("pointerleave", _);
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
- }, [l, c, p, v]), i.useEffect(() => {
180
+ }, [i, u, d, f]), l.useEffect(() => {
181
181
  if (a) {
182
- const m = (_) => {
183
- const T = _.target, g = { x: _.clientX, y: _.clientY }, x = (l == null ? void 0 : l.contains(T)) || (c == null ? void 0 : c.contains(T)), w = !Pe(g, a);
184
- x ? v() : w && (v(), f());
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
- }, [l, c, a, f, v]), /* @__PURE__ */ u(z, { ...t, ref: s });
189
- }), [xe, ge] = D(R, { isInside: !1 }), Ce = re("TooltipContent"), z = i.forwardRef(
190
- (t, o) => {
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: e,
192
+ __scopeTooltip: t,
193
193
  children: r,
194
194
  "aria-label": n,
195
195
  onEscapeKeyDown: s,
196
196
  onPointerDownOutside: a,
197
- ...h
198
- } = t, l = O(b, e), f = L(e), { onClose: c } = l;
199
- return i.useEffect(() => (document.addEventListener(A, c), () => document.removeEventListener(A, c)), [c]), i.useEffect(() => {
200
- if (l.trigger) {
201
- const d = (v) => {
202
- const p = v.target;
203
- p != null && p.contains(l.trigger) && c();
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", d, { capture: !0 }), () => window.removeEventListener("scroll", d, { capture: !0 });
205
+ return window.addEventListener("scroll", h, { capture: !0 }), () => window.removeEventListener("scroll", h, { capture: !0 });
206
206
  }
207
- }, [l.trigger, c]), /* @__PURE__ */ u(
208
- le,
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: (d) => d.preventDefault(),
215
- onDismiss: c,
214
+ onFocusOutside: (h) => h.preventDefault(),
215
+ onDismiss: u,
216
216
  children: /* @__PURE__ */ k(
217
- ue,
217
+ pe,
218
218
  {
219
- "data-state": l.stateAttribute,
220
- ...f,
221
- ...h,
219
+ "data-state": i.stateAttribute,
220
+ ...p,
221
+ ...v,
222
222
  ref: o,
223
223
  style: {
224
- ...h.style,
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__ */ u(Ce, { children: r }),
233
- /* @__PURE__ */ u(xe, { scope: e, isInside: !0, children: /* @__PURE__ */ u(fe, { id: l.contentId, role: "tooltip", children: n || r }) })
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 = i.forwardRef(
243
- (t, o) => {
244
- const { __scopeTooltip: e, ...r } = t, n = L(e);
245
- return ge(
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
- e
248
- ).isInside ? null : /* @__PURE__ */ u(ce, { ...n, ...r, ref: o });
247
+ t
248
+ ).isInside ? null : /* @__PURE__ */ c(ue, { ...n, ...r, ref: o });
249
249
  }
250
250
  );
251
251
  Q.displayName = J;
252
- function be(t, o) {
253
- const e = Math.abs(o.top - t.y), r = Math.abs(o.bottom - t.y), n = Math.abs(o.right - t.x), s = Math.abs(o.left - t.x);
254
- switch (Math.min(e, r, n, s)) {
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 e:
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 we(t, o, e = 5) {
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: t.x - e, y: t.y + e },
273
- { x: t.x + e, y: t.y + e }
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: t.x - e, y: t.y - e },
279
- { x: t.x + e, y: t.y - e }
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: t.x + e, y: t.y - e },
285
- { x: t.x + e, y: t.y + e }
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: t.x - e, y: t.y - e },
291
- { x: t.x - e, y: t.y + e }
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 Ee(t) {
298
- const { top: o, right: e, bottom: r, left: n } = t;
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: e, y: o },
302
- { x: e, y: r },
301
+ { x: t, y: o },
302
+ { x: t, y: r },
303
303
  { x: n, y: r }
304
304
  ];
305
305
  }
306
- function Pe(t, o) {
307
- const { x: e, y: r } = t;
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 h = o[s], l = o[a], f = h.x, c = h.y, d = l.x, v = l.y;
311
- c > r != v > r && e < (d - f) * (r - c) / (v - c) + f && (n = !n);
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 Re(t) {
316
- const o = t.slice();
317
- return o.sort((e, r) => e.x < r.x ? -1 : e.x > r.x ? 1 : e.y < r.y ? -1 : e.y > r.y ? 1 : 0), Oe(o);
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 Oe(t) {
320
- if (t.length <= 1) return t.slice();
319
+ function De(e) {
320
+ if (e.length <= 1) return e.slice();
321
321
  const o = [];
322
- for (let r = 0; r < t.length; r++) {
323
- const n = t[r];
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 e = [];
333
- for (let r = t.length - 1; r >= 0; r--) {
334
- const n = t[r];
335
- for (; e.length >= 2; ) {
336
- const s = e[e.length - 1], a = e[e.length - 2];
337
- if ((s.x - a.x) * (n.y - a.y) >= (s.y - a.y) * (n.x - a.x)) e.pop();
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
- e.push(n);
340
+ t.push(n);
341
341
  }
342
- return e.pop(), o.length === 1 && e.length === 1 && o[0].x === e[0].x && o[0].y === e[0].y ? o : o.concat(e);
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 De = $, Le = Y, ke = X, Ae = q, Ne = W, Ie = Q;
345
- const Me = "Tooltip-module__tooltip___LjRUX", He = "Tooltip-module__closable___MjoEb", y = {
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: Me,
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: He,
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 Ye({
363
- children: t,
362
+ function Xe({
363
+ children: e,
364
364
  content: o,
365
- size: e = "md",
366
- theme: r = "dark",
367
- tipSide: n = "top",
368
- tipAlignment: s = "center",
369
- keepVisible: a = !1,
370
- startVisible: h = !1,
371
- onClose: l,
372
- className: f
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 [c, d] = Z(h), v = () => {
375
- d(!1);
376
- }, p = (_) => {
377
- _.key === "Escape" && d(!1);
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__ */ u(De, { children: /* @__PURE__ */ u(Le, { defaultOpen: h, open: c, onOpenChange: (_) => {
380
- if (a)
381
- return d(!0);
382
- d(_), _ || l == null || l();
383
- }, children: /* @__PURE__ */ k("div", { className: j(y["tooltip-container"], f), children: [
384
- /* @__PURE__ */ u(ke, { asChild: !0, children: /* @__PURE__ */ u("div", { onKeyDown: p, role: "button", style: {
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: t }) }),
389
- /* @__PURE__ */ u(Ae, { children: /* @__PURE__ */ u(Ne, { style: {
392
+ }, className: y["tooltip-trigger"], children: e }) }),
393
+ /* @__PURE__ */ c(Ne, { children: /* @__PURE__ */ c(Ie, { style: {
390
394
  zIndex: 9999
391
- }, align: s, side: n, sideOffset: 0, children: /* @__PURE__ */ k("div", { id: "tooltip", role: "tooltip", className: j(y.tooltip, y[`tooltip-${e}`], y[`tooltip-${r}`], y[`tooltip-${n}`], y[`tooltip-${s}`], l && y.closable), children: [
392
- /* @__PURE__ */ u("div", { className: y["tooltip-content"], children: o }),
393
- (l || a) && e === "md" && /* @__PURE__ */ u("button", { className: y["tooltip-close-button"], onClick: v, children: /* @__PURE__ */ u(ee, { icon: "ap-icon-close", className: y["tooltip-close-icon"] }) }),
394
- /* @__PURE__ */ u(Ie, { width: 12, height: 6, className: y["tooltip-arrow"] })
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
- Ye as default
403
+ Xe as default
400
404
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alixpartners/ui-components",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"