@alixpartners/ui-components 2.5.6 → 2.6.0

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 (109) hide show
  1. package/dist/RichTextEditor-JH6YBGiw.js +541 -0
  2. package/dist/{ToastProvider-D5LImZ-Q.js → ToastProvider-DVycF0zU.js} +26 -26
  3. package/dist/assets/CorusHeader.css +1 -1
  4. package/dist/assets/Tab.css +1 -1
  5. package/dist/assets/Tag.css +1 -1
  6. package/dist/assets/ap-icons-types.d.ts +1 -1
  7. package/dist/assets/ap-icons.d.ts +1 -1
  8. package/dist/assets/main.css +1 -1
  9. package/dist/components/Banner/Banner.d.ts +1 -1
  10. package/dist/components/Banner/Banner.test.js +1 -1
  11. package/dist/components/Button/Button.d.ts +1 -1
  12. package/dist/components/Button/Button.test.js +2 -2
  13. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  14. package/dist/components/Checkbox/Checkbox.js +3 -3
  15. package/dist/components/Checkbox/Checkbox.test.js +1 -1
  16. package/dist/components/CorusHeader/CorusHeader.d.ts +1 -1
  17. package/dist/components/CorusHeader/CorusHeader.js +45 -44
  18. package/dist/components/CorusHeader/CorusHeader.types.d.ts +1 -0
  19. package/dist/components/CorusHeader/DropdownItemContent.d.ts +1 -1
  20. package/dist/components/CorusHeader/DropdownMenu.d.ts +2 -1
  21. package/dist/components/CorusHeader/DropdownMenu.js +6 -5
  22. package/dist/components/CorusHeader/MegaMenuContent.d.ts +2 -1
  23. package/dist/components/CorusHeader/MegaMenuContent.js +11 -10
  24. package/dist/components/CorusHeader/UserProfileIcon.d.ts +1 -1
  25. package/dist/components/Creatable/Creatable.d.ts +1 -1
  26. package/dist/components/Creatable/Creatable.js +1 -1
  27. package/dist/components/Datepicker/Datepicker.d.ts +1 -1
  28. package/dist/components/Datepicker/Datepicker.js +1 -1
  29. package/dist/components/Datepicker/Datepicker.test.js +1 -1
  30. package/dist/components/Dialog/Dialog.d.ts +1 -1
  31. package/dist/components/Dialog/Dialog.js +188 -214
  32. package/dist/components/Dialog/Dialog.test.js +1 -1
  33. package/dist/components/DragAndDrop/DragAndDrop.d.ts +1 -1
  34. package/dist/components/DragAndDrop/DragAndDrop.test.js +2 -2
  35. package/dist/components/Dropdown/Dropdown.d.ts +3 -1
  36. package/dist/components/Dropdown/Dropdown.js +179 -172
  37. package/dist/components/FilePicker/FilePicker.d.ts +9 -9
  38. package/dist/components/FilePicker/FilePicker.test.js +2 -2
  39. package/dist/components/Ghost/Ghost.d.ts +1 -1
  40. package/dist/components/Ghost/Ghost.test.js +1 -1
  41. package/dist/components/Icon/Icon.d.ts +1 -1
  42. package/dist/components/Icons/IconsGallery.d.ts +1 -1
  43. package/dist/components/Icons/IconsGallery.js +1 -1
  44. package/dist/components/Illustration/Illustration.d.ts +1 -1
  45. package/dist/components/Illustration/Illustration.test.js +1 -1
  46. package/dist/components/Input/Input.test.js +1 -1
  47. package/dist/components/Logo/Logo.d.ts +1 -1
  48. package/dist/components/Logos/LogosGallery.d.ts +1 -1
  49. package/dist/components/NavBar/NavBar.d.ts +1 -1
  50. package/dist/components/NavBar/NavBar.js +1 -1
  51. package/dist/components/Radio/Radio.d.ts +1 -1
  52. package/dist/components/Radio/Radio.js +9 -9
  53. package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
  54. package/dist/components/RadioGroup/RadioGroup.js +11 -11
  55. package/dist/components/RadioGroup/RadioGroup.test.js +1 -1
  56. package/dist/components/RichTextEditor/RichTextEditor.d.ts +1 -1
  57. package/dist/components/RichTextEditor/RichTextEditor.js +2 -2
  58. package/dist/components/RichTextEditor/RichTextEditor.test.js +2 -2
  59. package/dist/components/Search/Search.d.ts +1 -1
  60. package/dist/components/Search/Search.test.js +1 -1
  61. package/dist/components/Spinner/Spinner.d.ts +1 -1
  62. package/dist/components/SplitButton/SplitButton.d.ts +1 -1
  63. package/dist/components/SplitButton/SplitButton.js +3 -3
  64. package/dist/components/SplitButton/SplitButton.test.js +1 -1
  65. package/dist/components/Tab/Tab.d.ts +5 -1
  66. package/dist/components/Tab/Tab.js +28 -24
  67. package/dist/components/TabNavigation/TabNavigation.d.ts +1 -1
  68. package/dist/components/Tag/Tag.d.ts +1 -1
  69. package/dist/components/Tag/Tag.js +1 -1
  70. package/dist/components/Tag/Tag.test.js +1 -1
  71. package/dist/components/TagsFields/TagsFields.d.ts +1 -1
  72. package/dist/components/TagsFields/TagsFields.js +1 -1
  73. package/dist/components/Textarea/Textarea.d.ts +1 -1
  74. package/dist/components/Textarea/Textarea.test.js +1 -1
  75. package/dist/components/Toast/Toast.test.js +1 -1
  76. package/dist/components/ToastProvider/ToastProvider.d.ts +2 -1
  77. package/dist/components/ToastProvider/ToastProvider.js +1 -1
  78. package/dist/components/ToastProvider/ToastProvider.test.js +4 -4
  79. package/dist/components/Toggle/Toggle.d.ts +1 -1
  80. package/dist/components/Toggle/Toggle.js +211 -126
  81. package/dist/components/Toggle/Toggle.test.js +1 -1
  82. package/dist/components/Tooltip/Tooltip.d.ts +1 -1
  83. package/dist/components/Tooltip/Tooltip.js +60 -61
  84. package/dist/{index-C2s_VtSb.js → index-6DGSlWJb.js} +3 -3
  85. package/dist/{index-Nyh2Wa71.js → index-6j3vTf--.js} +5 -5
  86. package/dist/index-B4szHVNJ.js +248 -0
  87. package/dist/{index-CFqDEbIR.js → index-BVZdJVFB.js} +192 -191
  88. package/dist/index-Bq1FiX6B.js +93 -0
  89. package/dist/index-CE9NpYQR.js +604 -0
  90. package/dist/index-CHy8gqvu.js +353 -0
  91. package/dist/index-CarlZuEo.js +1610 -0
  92. package/dist/{index-CCFDXH-J.js → index-CcsZYEYy.js} +29 -28
  93. package/dist/index-DH9SO8qV.js +221 -0
  94. package/dist/{index-D_L0ncPJ.js → index-IR8HlW5P.js} +4 -4
  95. package/dist/{index-DkTDHhag.js → index-banDzeKa.js} +1 -1
  96. package/dist/index-kgC_DL6e.js +216 -0
  97. package/dist/main.js +3 -3
  98. package/dist/storybook-docs-page.d.ts +1 -1
  99. package/dist/{useToast-Cz5MGKnw.js → useToast-CpwrYPvx.js} +1 -1
  100. package/dist/{vi.bdSIJ99Y-017e_Pkz.js → vi.bdSIJ99Y-DWCVXj6K.js} +3 -3
  101. package/package.json +1 -1
  102. package/dist/RichTextEditor-cvtLFe4t.js +0 -443
  103. package/dist/index-C8H9A55g.js +0 -222
  104. package/dist/index-CCnm5-ML.js +0 -230
  105. package/dist/index-CfIcUHKK.js +0 -70
  106. package/dist/index-ChQc_Cm6.js +0 -1544
  107. package/dist/index-CmGGeUr0.js +0 -142
  108. package/dist/index-Ii4UOx3H.js +0 -599
  109. package/dist/index-z_kiwVc3.js +0 -237
@@ -3,11 +3,11 @@ import * as l from "react";
3
3
  import { useState as ee } from "react";
4
4
  import { c as j } from "../../clsx-OuTLNxxd.js";
5
5
  import te from "../Icon/Icon.js";
6
- import { P as F, u as oe, d as G, c as C, b as re, g as ne } from "../../index-z_kiwVc3.js";
7
- import { P as le, D as ie } from "../../index-CmGGeUr0.js";
8
- import { u as se } from "../../index-C2s_VtSb.js";
9
- import { R as ae, A as ce, a as ue, c as B, C as pe } from "../../index-ChQc_Cm6.js";
10
- import { P as K } from "../../index-CfIcUHKK.js";
6
+ import { P as F, u as oe, a as G, c as C, b as re, h as ne } from "../../index-B4szHVNJ.js";
7
+ import { P as le, D as ie } from "../../index-kgC_DL6e.js";
8
+ import { u as se } from "../../index-6DGSlWJb.js";
9
+ import { R as ae, A as ce, a as ue, c as B, C as pe } from "../../index-CarlZuEo.js";
10
+ import { P as K } from "../../index-Bq1FiX6B.js";
11
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",
@@ -31,16 +31,16 @@ import '../../assets/Tooltip.css';var de = Object.freeze({
31
31
  )
32
32
  );
33
33
  U.displayName = fe;
34
- var ve = U, [D] = re("Tooltip", [
34
+ var he = U, [D] = re("Tooltip", [
35
35
  B
36
- ]), L = B(), V = "TooltipProvider", he = 700, A = "tooltip.open", [_e, I] = D(V), $ = (e) => {
36
+ ]), L = B(), V = "TooltipProvider", ve = 700, A = "tooltip.open", [_e, I] = D(V), $ = (e) => {
37
37
  const {
38
38
  __scopeTooltip: o,
39
- delayDuration: t = he,
39
+ delayDuration: t = ve,
40
40
  skipDelayDuration: r = 300,
41
41
  disableHoverableContent: n = !1,
42
42
  children: s
43
- } = e, a = l.useRef(!0), h = l.useRef(!1), i = l.useRef(0);
43
+ } = e, a = l.useRef(!0), v = l.useRef(!1), i = l.useRef(0);
44
44
  return l.useEffect(() => {
45
45
  const p = i.current;
46
46
  return () => window.clearTimeout(p);
@@ -51,17 +51,17 @@ var ve = U, [D] = re("Tooltip", [
51
51
  isOpenDelayedRef: a,
52
52
  delayDuration: t,
53
53
  onOpen: l.useCallback(() => {
54
- window.clearTimeout(i.current), a.current = !1;
55
- }, []),
54
+ r <= 0 || (window.clearTimeout(i.current), a.current = !1);
55
+ }, [r]),
56
56
  onClose: l.useCallback(() => {
57
- window.clearTimeout(i.current), i.current = window.setTimeout(
57
+ r <= 0 || (window.clearTimeout(i.current), i.current = window.setTimeout(
58
58
  () => a.current = !0,
59
59
  r
60
- );
60
+ ));
61
61
  }, [r]),
62
- isPointerInTransitRef: h,
62
+ isPointerInTransitRef: v,
63
63
  onPointerInTransitChange: l.useCallback((p) => {
64
- h.current = p;
64
+ v.current = p;
65
65
  }, []),
66
66
  disableHoverableContent: n,
67
67
  children: s
@@ -77,8 +77,8 @@ var R = "Tooltip", [me, O] = D(R), Y = (e) => {
77
77
  defaultOpen: n,
78
78
  onOpenChange: s,
79
79
  disableHoverableContent: a,
80
- delayDuration: h
81
- } = e, i = I(R, e.__scopeTooltip), p = L(o), [u, v] = l.useState(null), f = se(), d = l.useRef(0), m = a ?? i.disableHoverableContent, T = h ?? i.delayDuration, _ = l.useRef(!1), [x, g] = oe({
80
+ delayDuration: v
81
+ } = e, i = I(R, e.__scopeTooltip), p = L(o), [u, f] = l.useState(null), d = se(), h = l.useRef(0), m = a ?? i.disableHoverableContent, T = v ?? i.delayDuration, _ = l.useRef(!1), [x, g] = oe({
82
82
  prop: r,
83
83
  defaultProp: n ?? !1,
84
84
  onChange: (S) => {
@@ -86,30 +86,30 @@ var R = "Tooltip", [me, O] = D(R), Y = (e) => {
86
86
  },
87
87
  caller: R
88
88
  }), w = l.useMemo(() => x ? _.current ? "delayed-open" : "instant-open" : "closed", [x]), E = l.useCallback(() => {
89
- window.clearTimeout(d.current), d.current = 0, _.current = !1, g(!0);
89
+ window.clearTimeout(h.current), h.current = 0, _.current = !1, g(!0);
90
90
  }, [g]), P = l.useCallback(() => {
91
- window.clearTimeout(d.current), d.current = 0, g(!1);
91
+ window.clearTimeout(h.current), h.current = 0, g(!1);
92
92
  }, [g]), H = l.useCallback(() => {
93
- window.clearTimeout(d.current), d.current = window.setTimeout(() => {
94
- _.current = !0, g(!0), d.current = 0;
93
+ window.clearTimeout(h.current), h.current = window.setTimeout(() => {
94
+ _.current = !0, g(!0), h.current = 0;
95
95
  }, T);
96
96
  }, [T, g]);
97
97
  return l.useEffect(() => () => {
98
- d.current && (window.clearTimeout(d.current), d.current = 0);
98
+ h.current && (window.clearTimeout(h.current), h.current = 0);
99
99
  }, []), /* @__PURE__ */ c(ae, { ...p, children: /* @__PURE__ */ c(
100
100
  me,
101
101
  {
102
102
  scope: o,
103
- contentId: f,
103
+ contentId: d,
104
104
  open: x,
105
105
  stateAttribute: w,
106
106
  trigger: u,
107
- onTriggerChange: v,
107
+ onTriggerChange: f,
108
108
  onTriggerEnter: l.useCallback(() => {
109
109
  i.isOpenDelayedRef.current ? H() : E();
110
110
  }, [i.isOpenDelayedRef, H, E]),
111
111
  onTriggerLeave: l.useCallback(() => {
112
- m ? P() : (window.clearTimeout(d.current), d.current = 0);
112
+ m ? P() : (window.clearTimeout(h.current), h.current = 0);
113
113
  }, [P, m]),
114
114
  onOpen: E,
115
115
  onClose: P,
@@ -121,22 +121,22 @@ var R = "Tooltip", [me, O] = D(R), Y = (e) => {
121
121
  Y.displayName = R;
122
122
  var N = "TooltipTrigger", X = l.forwardRef(
123
123
  (e, o) => {
124
- const { __scopeTooltip: t, ...r } = e, n = O(N, t), s = I(N, t), a = L(t), h = l.useRef(null), i = G(o, h, n.onTriggerChange), p = l.useRef(!1), u = l.useRef(!1), v = l.useCallback(() => p.current = !1, []);
125
- return l.useEffect(() => () => document.removeEventListener("pointerup", v), [v]), /* @__PURE__ */ c(ce, { asChild: !0, ...a, children: /* @__PURE__ */ c(
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), f = l.useCallback(() => p.current = !1, []);
125
+ return l.useEffect(() => () => document.removeEventListener("pointerup", f), [f]), /* @__PURE__ */ c(ce, { asChild: !0, ...a, children: /* @__PURE__ */ c(
126
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
131
  ref: i,
132
- onPointerMove: C(e.onPointerMove, (f) => {
133
- f.pointerType !== "touch" && !u.current && !s.isPointerInTransitRef.current && (n.onTriggerEnter(), u.current = !0);
132
+ onPointerMove: C(e.onPointerMove, (d) => {
133
+ d.pointerType !== "touch" && !u.current && !s.isPointerInTransitRef.current && (n.onTriggerEnter(), u.current = !0);
134
134
  }),
135
135
  onPointerLeave: C(e.onPointerLeave, () => {
136
136
  n.onTriggerLeave(), u.current = !1;
137
137
  }),
138
138
  onPointerDown: C(e.onPointerDown, () => {
139
- n.open && n.onClose(), p.current = !0, document.addEventListener("pointerup", v, { once: !0 });
139
+ n.open && n.onClose(), p.current = !0, document.addEventListener("pointerup", f, { once: !0 });
140
140
  }),
141
141
  onFocus: C(e.onFocus, () => {
142
142
  p.current || n.onOpen();
@@ -161,31 +161,31 @@ var b = "TooltipContent", W = l.forwardRef(
161
161
  return /* @__PURE__ */ c(K, { present: r || a.open, children: a.disableHoverableContent ? /* @__PURE__ */ c(z, { side: n, ...s, ref: o }) : /* @__PURE__ */ c(ge, { side: n, ...s, ref: o }) });
162
162
  }
163
163
  ), ge = 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, h] = l.useState(null), { trigger: i, onClose: p } = t, u = n.current, { onPointerInTransitChange: v } = r, f = l.useCallback(() => {
165
- h(null), v(!1);
166
- }, [v]), d = l.useCallback(
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: f } = r, d = l.useCallback(() => {
165
+ v(null), f(!1);
166
+ }, [f]), h = l.useCallback(
167
167
  (m, T) => {
168
168
  const _ = m.currentTarget, x = { x: m.clientX, y: m.clientY }, g = we(x, _.getBoundingClientRect()), w = Ee(x, g), E = Pe(T.getBoundingClientRect()), P = Oe([...w, ...E]);
169
- h(P), v(!0);
169
+ v(P), f(!0);
170
170
  },
171
- [v]
171
+ [f]
172
172
  );
173
- return l.useEffect(() => () => f(), [f]), l.useEffect(() => {
173
+ return l.useEffect(() => () => d(), [d]), l.useEffect(() => {
174
174
  if (i && u) {
175
- const m = (_) => d(_, u), T = (_) => d(_, i);
175
+ const m = (_) => h(_, u), T = (_) => h(_, i);
176
176
  return i.addEventListener("pointerleave", m), u.addEventListener("pointerleave", T), () => {
177
177
  i.removeEventListener("pointerleave", m), u.removeEventListener("pointerleave", T);
178
178
  };
179
179
  }
180
- }, [i, u, d, f]), l.useEffect(() => {
180
+ }, [i, u, h, d]), l.useEffect(() => {
181
181
  if (a) {
182
182
  const m = (T) => {
183
183
  const _ = T.target, x = { x: T.clientX, y: T.clientY }, g = (i == null ? void 0 : i.contains(_)) || (u == null ? void 0 : u.contains(_)), w = !Re(x, a);
184
- g ? f() : w && (f(), p());
184
+ g ? d() : w && (d(), p());
185
185
  };
186
186
  return document.addEventListener("pointermove", m), () => document.removeEventListener("pointermove", m);
187
187
  }
188
- }, [i, u, a, p, f]), /* @__PURE__ */ c(z, { ...e, ref: s });
188
+ }, [i, u, a, p, d]), /* @__PURE__ */ c(z, { ...e, ref: s });
189
189
  }), [xe, Ce] = D(R, { isInside: !1 }), be = ne("TooltipContent"), z = l.forwardRef(
190
190
  (e, o) => {
191
191
  const {
@@ -194,15 +194,14 @@ var b = "TooltipContent", W = l.forwardRef(
194
194
  "aria-label": n,
195
195
  onEscapeKeyDown: s,
196
196
  onPointerDownOutside: a,
197
- ...h
197
+ ...v
198
198
  } = e, i = O(b, t), p = L(t), { onClose: u } = i;
199
199
  return l.useEffect(() => (document.addEventListener(A, u), () => document.removeEventListener(A, u)), [u]), l.useEffect(() => {
200
200
  if (i.trigger) {
201
- const v = (f) => {
202
- const d = f.target;
203
- d != null && d.contains(i.trigger) && u();
201
+ const f = (d) => {
202
+ d.target instanceof Node && d.target.contains(i.trigger) && u();
204
203
  };
205
- return window.addEventListener("scroll", v, { capture: !0 }), () => window.removeEventListener("scroll", v, { capture: !0 });
204
+ return window.addEventListener("scroll", f, { capture: !0 }), () => window.removeEventListener("scroll", f, { capture: !0 });
206
205
  }
207
206
  }, [i.trigger, u]), /* @__PURE__ */ c(
208
207
  ie,
@@ -211,17 +210,17 @@ var b = "TooltipContent", W = l.forwardRef(
211
210
  disableOutsidePointerEvents: !1,
212
211
  onEscapeKeyDown: s,
213
212
  onPointerDownOutside: a,
214
- onFocusOutside: (v) => v.preventDefault(),
213
+ onFocusOutside: (f) => f.preventDefault(),
215
214
  onDismiss: u,
216
215
  children: /* @__PURE__ */ k(
217
216
  pe,
218
217
  {
219
218
  "data-state": i.stateAttribute,
220
219
  ...p,
221
- ...h,
220
+ ...v,
222
221
  ref: o,
223
222
  style: {
224
- ...h.style,
223
+ ...v.style,
225
224
  "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
226
225
  "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
227
226
  "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
@@ -230,7 +229,7 @@ var b = "TooltipContent", W = l.forwardRef(
230
229
  },
231
230
  children: [
232
231
  /* @__PURE__ */ c(be, { children: r }),
233
- /* @__PURE__ */ c(xe, { scope: t, isInside: !0, children: /* @__PURE__ */ c(ve, { id: i.contentId, role: "tooltip", children: n || r }) })
232
+ /* @__PURE__ */ c(xe, { scope: t, isInside: !0, children: /* @__PURE__ */ c(he, { id: i.contentId, role: "tooltip", children: n || r }) })
234
233
  ]
235
234
  }
236
235
  )
@@ -307,8 +306,8 @@ function Re(e, o) {
307
306
  const { x: t, y: r } = e;
308
307
  let n = !1;
309
308
  for (let s = 0, a = o.length - 1; s < o.length; a = s++) {
310
- const h = o[s], i = o[a], p = h.x, u = h.y, v = i.x, f = i.y;
311
- u > r != f > r && t < (v - p) * (r - u) / (f - u) + p && (n = !n);
309
+ const v = o[s], i = o[a], p = v.x, u = v.y, f = i.x, d = i.y;
310
+ u > r != d > r && t < (f - p) * (r - u) / (d - u) + p && (n = !n);
312
311
  }
313
312
  return n;
314
313
  }
@@ -367,23 +366,23 @@ function Xe({
367
366
  theme: n = "dark",
368
367
  tipSide: s = "top",
369
368
  tipAlignment: a = "center",
370
- keepVisible: h = !1,
369
+ keepVisible: v = !1,
371
370
  startVisible: i = !1,
372
371
  onClose: p,
373
372
  className: u
374
373
  }) {
375
- const [v, f] = ee(i);
374
+ const [f, d] = ee(i);
376
375
  if (t)
377
376
  return /* @__PURE__ */ c(Z, { children: e });
378
- const d = () => {
379
- f(!1);
377
+ const h = () => {
378
+ d(!1);
380
379
  }, m = (_) => {
381
- _.key === "Escape" && f(!1);
380
+ _.key === "Escape" && d(!1);
382
381
  };
383
- return /* @__PURE__ */ c(Le, { children: /* @__PURE__ */ c(ke, { defaultOpen: i, open: v, onOpenChange: (_) => {
384
- if (h)
385
- return f(!0);
386
- f(_), _ || p == null || p();
382
+ return /* @__PURE__ */ c(Le, { children: /* @__PURE__ */ c(ke, { defaultOpen: i, open: f, onOpenChange: (_) => {
383
+ if (v)
384
+ return d(!0);
385
+ d(_), _ || p == null || p();
387
386
  }, children: /* @__PURE__ */ k("div", { className: j(y["tooltip-container"], u), children: [
388
387
  /* @__PURE__ */ c(Ae, { asChild: !0, children: /* @__PURE__ */ c("div", { onKeyDown: m, role: "button", style: {
389
388
  display: "flex",
@@ -394,7 +393,7 @@ function Xe({
394
393
  zIndex: 9999
395
394
  }, 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
395
  /* @__PURE__ */ c("div", { className: y["tooltip-content"], children: o }),
397
- (p || h) && 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"] }) }),
396
+ (p || v) && r === "md" && /* @__PURE__ */ c("button", { className: y["tooltip-close-button"], onClick: h, children: /* @__PURE__ */ c(te, { icon: "ap-icon-close", className: y["tooltip-close-icon"] }) }),
398
397
  /* @__PURE__ */ c(Me, { width: 12, height: 6, className: y["tooltip-arrow"] })
399
398
  ] }) }) })
400
399
  ] }) }) });
@@ -1,5 +1,5 @@
1
1
  import * as e from "react";
2
- import { h as o } from "./index-z_kiwVc3.js";
2
+ import { d as o } from "./index-B4szHVNJ.js";
3
3
  var n = e[" useId ".trim().toString()] || (() => {
4
4
  }), a = 0;
5
5
  function f(r) {
@@ -12,10 +12,10 @@ function c(r) {
12
12
  const t = e.useRef(r);
13
13
  return e.useEffect(() => {
14
14
  t.current = r;
15
- }), e.useMemo(() => (...s) => {
15
+ }), e.useMemo(() => ((...s) => {
16
16
  var u;
17
17
  return (u = t.current) == null ? void 0 : u.call(t, ...s);
18
- }, []);
18
+ }), []);
19
19
  }
20
20
  export {
21
21
  c as a,
@@ -1,7 +1,7 @@
1
1
  import * as u from "react";
2
- import { h as z } from "./index-z_kiwVc3.js";
2
+ import { d as z } from "./index-B4szHVNJ.js";
3
3
  function n(r) {
4
- const [d, e] = u.useState(void 0);
4
+ const [h, e] = u.useState(void 0);
5
5
  return z(() => {
6
6
  if (r) {
7
7
  e({ width: r.offsetWidth, height: r.offsetHeight });
@@ -11,8 +11,8 @@ function n(r) {
11
11
  const b = i[0];
12
12
  let o, t;
13
13
  if ("borderBoxSize" in b) {
14
- const s = b.borderBoxSize, h = Array.isArray(s) ? s[0] : s;
15
- o = h.inlineSize, t = h.blockSize;
14
+ const s = b.borderBoxSize, d = Array.isArray(s) ? s[0] : s;
15
+ o = d.inlineSize, t = d.blockSize;
16
16
  } else
17
17
  o = r.offsetWidth, t = r.offsetHeight;
18
18
  e({ width: o, height: t });
@@ -20,7 +20,7 @@ function n(r) {
20
20
  return f.observe(r, { box: "border-box" }), () => f.unobserve(r);
21
21
  } else
22
22
  e(void 0);
23
- }, [r]), d;
23
+ }, [r]), h;
24
24
  }
25
25
  export {
26
26
  n as u
@@ -0,0 +1,248 @@
1
+ import * as c from "react";
2
+ import * as R from "react-dom";
3
+ import { jsx as C } from "react/jsx-runtime";
4
+ function b(t, e) {
5
+ if (typeof t == "function")
6
+ return t(e);
7
+ t != null && (t.current = e);
8
+ }
9
+ function _(...t) {
10
+ return (e) => {
11
+ let n = !1;
12
+ const s = t.map((o) => {
13
+ const i = b(o, e);
14
+ return !n && typeof i == "function" && (n = !0), i;
15
+ });
16
+ if (n)
17
+ return () => {
18
+ for (let o = 0; o < s.length; o++) {
19
+ const i = s[o];
20
+ typeof i == "function" ? i() : b(t[o], null);
21
+ }
22
+ };
23
+ };
24
+ }
25
+ function g(...t) {
26
+ return c.useCallback(_(...t), t);
27
+ }
28
+ // @__NO_SIDE_EFFECTS__
29
+ function $(t) {
30
+ const e = c.forwardRef((n, s) => {
31
+ let { children: o, ...i } = n, r = null, l = !1;
32
+ const u = [];
33
+ E(o) && typeof S == "function" && (o = S(o._payload)), c.Children.forEach(o, (f) => {
34
+ var y;
35
+ if (j(f)) {
36
+ l = !0;
37
+ const p = f;
38
+ let h = "child" in p.props ? p.props.child : p.props.children;
39
+ E(h) && typeof S == "function" && (h = S(h._payload)), r = w(p, h), u.push((y = r == null ? void 0 : r.props) == null ? void 0 : y.children);
40
+ } else
41
+ u.push(f);
42
+ }), r ? r = c.cloneElement(r, void 0, u) : (
43
+ // A `Slottable` was found but it didn't resolve to a single element (e.g.
44
+ // it wrapped multiple elements, text, or a render-prop `child` that
45
+ // wasn't an element). Don't fall back to treating the `Slottable` wrapper
46
+ // itself as the slot target — throw a descriptive error below instead.
47
+ !l && c.Children.count(o) === 1 && c.isValidElement(o) && (r = o)
48
+ );
49
+ const m = r ? O(r) : void 0, d = g(s, m);
50
+ if (!r) {
51
+ if (o || o === 0)
52
+ throw new Error(
53
+ l ? T(t) : N(t)
54
+ );
55
+ return o;
56
+ }
57
+ const a = I(i, r.props ?? {});
58
+ return r.type !== c.Fragment && (a.ref = s ? d : m), c.cloneElement(r, a);
59
+ });
60
+ return e.displayName = `${t}.Slot`, e;
61
+ }
62
+ var x = Symbol.for("radix.slottable");
63
+ // @__NO_SIDE_EFFECTS__
64
+ function z(t) {
65
+ const e = (n) => "child" in n ? n.children(n.child) : n.children;
66
+ return e.displayName = `${t}.Slottable`, e.__radixId = x, e;
67
+ }
68
+ var w = (t, e) => {
69
+ if ("child" in t.props) {
70
+ const n = t.props.child;
71
+ return c.isValidElement(n) ? c.cloneElement(n, void 0, t.props.children(n.props.children)) : null;
72
+ }
73
+ return c.isValidElement(e) ? e : null;
74
+ };
75
+ function I(t, e) {
76
+ const n = { ...e };
77
+ for (const s in e) {
78
+ const o = t[s], i = e[s];
79
+ /^on[A-Z]/.test(s) ? o && i ? n[s] = (...l) => {
80
+ const u = i(...l);
81
+ return o(...l), u;
82
+ } : o && (n[s] = o) : s === "style" ? n[s] = { ...o, ...i } : s === "className" && (n[s] = [o, i].filter(Boolean).join(" "));
83
+ }
84
+ return { ...t, ...n };
85
+ }
86
+ function O(t) {
87
+ var s, o;
88
+ let e = (s = Object.getOwnPropertyDescriptor(t.props, "ref")) == null ? void 0 : s.get, n = e && "isReactWarning" in e && e.isReactWarning;
89
+ return n ? t.ref : (e = (o = Object.getOwnPropertyDescriptor(t, "ref")) == null ? void 0 : o.get, n = e && "isReactWarning" in e && e.isReactWarning, n ? t.props.ref : t.props.ref || t.ref);
90
+ }
91
+ function j(t) {
92
+ return c.isValidElement(t) && typeof t.type == "function" && "__radixId" in t.type && t.type.__radixId === x;
93
+ }
94
+ var D = Symbol.for("react.lazy");
95
+ function E(t) {
96
+ return t != null && typeof t == "object" && "$$typeof" in t && t.$$typeof === D && "_payload" in t && L(t._payload);
97
+ }
98
+ function L(t) {
99
+ return typeof t == "object" && t !== null && "then" in t;
100
+ }
101
+ var N = (t) => `${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`, T = (t) => `${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`, S = c[" use ".trim().toString()], V = [
102
+ "a",
103
+ "button",
104
+ "div",
105
+ "form",
106
+ "h2",
107
+ "h3",
108
+ "img",
109
+ "input",
110
+ "label",
111
+ "li",
112
+ "nav",
113
+ "ol",
114
+ "p",
115
+ "select",
116
+ "span",
117
+ "svg",
118
+ "ul"
119
+ ], U = V.reduce((t, e) => {
120
+ const n = /* @__PURE__ */ $(`Primitive.${e}`), s = c.forwardRef((o, i) => {
121
+ const { asChild: r, ...l } = o, u = r ? n : e;
122
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ C(u, { ...l, ref: i });
123
+ });
124
+ return s.displayName = `Primitive.${e}`, { ...t, [e]: s };
125
+ }, {});
126
+ function Y(t, e) {
127
+ t && R.flushSync(() => t.dispatchEvent(e));
128
+ }
129
+ function Z(t, e = []) {
130
+ let n = [];
131
+ function s(i, r) {
132
+ const l = c.createContext(r);
133
+ l.displayName = i + "Context";
134
+ const u = n.length;
135
+ n = [...n, r];
136
+ const m = (a) => {
137
+ var v;
138
+ const { scope: f, children: y, ...p } = a, h = ((v = f == null ? void 0 : f[t]) == null ? void 0 : v[u]) || l, P = c.useMemo(() => p, Object.values(p));
139
+ return /* @__PURE__ */ C(h.Provider, { value: P, children: y });
140
+ };
141
+ m.displayName = i + "Provider";
142
+ function d(a, f) {
143
+ var h;
144
+ const y = ((h = f == null ? void 0 : f[t]) == null ? void 0 : h[u]) || l, p = c.useContext(y);
145
+ if (p) return p;
146
+ if (r !== void 0) return r;
147
+ throw new Error(`\`${a}\` must be used within \`${i}\``);
148
+ }
149
+ return [m, d];
150
+ }
151
+ const o = () => {
152
+ const i = n.map((r) => c.createContext(r));
153
+ return function(l) {
154
+ const u = (l == null ? void 0 : l[t]) || i;
155
+ return c.useMemo(
156
+ () => ({ [`__scope${t}`]: { ...l, [t]: u } }),
157
+ [l, u]
158
+ );
159
+ };
160
+ };
161
+ return o.scopeName = t, [s, W(o, ...e)];
162
+ }
163
+ function W(...t) {
164
+ const e = t[0];
165
+ if (t.length === 1) return e;
166
+ const n = () => {
167
+ const s = t.map((o) => ({
168
+ useScope: o(),
169
+ scopeName: o.scopeName
170
+ }));
171
+ return function(i) {
172
+ const r = s.reduce((l, { useScope: u, scopeName: m }) => {
173
+ const a = u(i)[`__scope${m}`];
174
+ return { ...l, ...a };
175
+ }, {});
176
+ return c.useMemo(() => ({ [`__scope${e.scopeName}`]: r }), [r]);
177
+ };
178
+ };
179
+ return n.scopeName = e.scopeName, n;
180
+ }
181
+ function q(t, e, { checkForDefaultPrevented: n = !0 } = {}) {
182
+ return function(o) {
183
+ if (t == null || t(o), n === !1 || !o.defaultPrevented)
184
+ return e == null ? void 0 : e(o);
185
+ };
186
+ }
187
+ var k = globalThis != null && globalThis.document ? c.useLayoutEffect : () => {
188
+ }, A = c[" useInsertionEffect ".trim().toString()] || k;
189
+ function G({
190
+ prop: t,
191
+ defaultProp: e,
192
+ onChange: n = () => {
193
+ },
194
+ caller: s
195
+ }) {
196
+ const [o, i, r] = F({
197
+ defaultProp: e,
198
+ onChange: n
199
+ }), l = t !== void 0, u = l ? t : o;
200
+ {
201
+ const d = c.useRef(t !== void 0);
202
+ c.useEffect(() => {
203
+ const a = d.current;
204
+ a !== l && console.warn(
205
+ `${s} is changing from ${a ? "controlled" : "uncontrolled"} to ${l ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
206
+ ), d.current = l;
207
+ }, [l, s]);
208
+ }
209
+ const m = c.useCallback(
210
+ (d) => {
211
+ var a;
212
+ if (l) {
213
+ const f = M(d) ? d(t) : d;
214
+ f !== t && ((a = r.current) == null || a.call(r, f));
215
+ } else
216
+ i(d);
217
+ },
218
+ [l, t, i, r]
219
+ );
220
+ return [u, m];
221
+ }
222
+ function F({
223
+ defaultProp: t,
224
+ onChange: e
225
+ }) {
226
+ const [n, s] = c.useState(t), o = c.useRef(n), i = c.useRef(e);
227
+ return A(() => {
228
+ i.current = e;
229
+ }, [e]), c.useEffect(() => {
230
+ var r;
231
+ o.current !== n && ((r = i.current) == null || r.call(i, n), o.current = n);
232
+ }, [n, o]), [n, s, i];
233
+ }
234
+ function M(t) {
235
+ return typeof t == "function";
236
+ }
237
+ export {
238
+ U as P,
239
+ g as a,
240
+ Z as b,
241
+ q as c,
242
+ k as d,
243
+ $ as e,
244
+ Y as f,
245
+ _ as g,
246
+ z as h,
247
+ G as u
248
+ };