@alixpartners/ui-components 2.1.2 → 2.3.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 (71) hide show
  1. package/README.md +99 -99
  2. package/dist/DragAndDrop.utils-D3xTV9EK.js +30 -0
  3. package/dist/ToastProvider-D5LImZ-Q.js +1136 -0
  4. package/dist/assets/Dialog.css +1 -1
  5. package/dist/assets/NavBar.css +1 -1
  6. package/dist/assets/SplitButton.css +1 -1
  7. package/dist/assets/Tooltip.css +1 -1
  8. package/dist/components/Banner/Banner.test.js +1 -1
  9. package/dist/components/Button/Button.test.js +124 -3217
  10. package/dist/components/Checkbox/Checkbox.js +7 -6
  11. package/dist/components/Checkbox/Checkbox.test.js +47 -47
  12. package/dist/components/Creatable/Creatable.js +107 -108
  13. package/dist/components/Dialog/Dialog.d.ts +21 -7
  14. package/dist/components/Dialog/Dialog.js +296 -61
  15. package/dist/components/Dialog/Dialog.test.d.ts +1 -0
  16. package/dist/components/Dialog/Dialog.test.js +368 -0
  17. package/dist/components/DragAndDrop/DragAndDrop.d.ts +56 -1
  18. package/dist/components/DragAndDrop/DragAndDrop.js +144 -83
  19. package/dist/components/DragAndDrop/DragAndDrop.test.d.ts +1 -0
  20. package/dist/components/DragAndDrop/DragAndDrop.test.js +606 -0
  21. package/dist/components/DragAndDrop/DragAndDrop.utils.d.ts +30 -0
  22. package/dist/components/Dropdown/Dropdown.js +80 -81
  23. package/dist/components/FilePicker/FilePicker.test.js +1 -1
  24. package/dist/components/Ghost/Ghost.test.js +6 -6
  25. package/dist/components/Input/Input.test.js +2 -2
  26. package/dist/components/NavBar/NavBar.js +16 -16
  27. package/dist/components/Radio/Radio.js +1 -1
  28. package/dist/components/RadioGroup/RadioGroup.js +1 -1
  29. package/dist/components/RadioGroup/RadioGroup.test.js +1 -1
  30. package/dist/components/Search/Search.test.js +1 -1
  31. package/dist/components/SplitButton/SplitButton.js +8 -9
  32. package/dist/components/SplitButton/SplitButton.test.js +1 -1
  33. package/dist/components/Tag/Tag.test.js +1 -1
  34. package/dist/components/TagsFields/TagsFields.js +3 -4
  35. package/dist/components/Textarea/Textarea.js +68 -70
  36. package/dist/components/Textarea/Textarea.test.js +2 -2
  37. package/dist/components/Toast/Toast.d.ts +5 -19
  38. package/dist/components/Toast/Toast.js +65 -62
  39. package/dist/components/Toast/Toast.test.js +47 -30
  40. package/dist/components/ToastProvider/ToastContext.d.ts +11 -0
  41. package/dist/components/ToastProvider/ToastProvider.d.ts +19 -0
  42. package/dist/components/ToastProvider/ToastProvider.js +7 -0
  43. package/dist/components/ToastProvider/ToastProvider.test.d.ts +1 -0
  44. package/dist/components/ToastProvider/ToastProvider.test.js +264 -0
  45. package/dist/components/ToastProvider/types.d.ts +54 -0
  46. package/dist/components/ToastProvider/useToast.d.ts +28 -0
  47. package/dist/components/Toggle/Toggle.js +31 -30
  48. package/dist/components/Toggle/Toggle.test.js +9 -9
  49. package/dist/components/Tooltip/Tooltip.js +20 -19
  50. package/dist/{index-2H7slGYV.js → index-7CBv-Jx6.js} +1 -1
  51. package/dist/{index-DpfPnSMn.js → index-BymOxiM6.js} +2 -2
  52. package/dist/index-C-3_YVJ1.js +1539 -0
  53. package/dist/{index-BKtdMA_j.js → index-C4ffg1vf.js} +24 -23
  54. package/dist/{index-BGZDIjm9.js → index-Chv2KjIL.js} +171 -168
  55. package/dist/{index-BJXIvJs4.js → index-CpsmI33B.js} +24 -23
  56. package/dist/index-CxAtPSMM.js +27 -0
  57. package/dist/{index-CjQV7MmW.js → index-DEphED6n.js} +11 -11
  58. package/dist/index-DM51yNMI.js +237 -0
  59. package/dist/{index-CVWHq7Pr.js → index-D_3jWVyV.js} +37 -36
  60. package/dist/index-DkTDHhag.js +3098 -0
  61. package/dist/index-DrR82jOT.js +142 -0
  62. package/dist/magic-string.es-uPKorP4O.js +663 -0
  63. package/dist/main.d.ts +5 -1
  64. package/dist/main.js +47 -40
  65. package/dist/useToast-Cz5MGKnw.js +11 -0
  66. package/dist/{vi.ClIskdbk-CFW_9sOK.js → vi.bdSIJ99Y-017e_Pkz.js} +9494 -10227
  67. package/dist/web.config +8 -8
  68. package/package.json +87 -84
  69. package/dist/index-DWydnyjJ.js +0 -245
  70. package/dist/index-DieLVN0p.js +0 -1664
  71. package/dist/magic-string.es-D4UQQyt0.js +0 -859
@@ -3,10 +3,11 @@ import * as i from "react";
3
3
  import { useState as Z } from "react";
4
4
  import { c as j } from "../../clsx-OuTLNxxd.js";
5
5
  import ee from "../Icon/Icon.js";
6
- import { P as G, c as te, u as oe, d as F, a as C, h as re } from "../../index-DWydnyjJ.js";
7
- import { c as B, R as ne, A as le, P as ie, a as se, D as ae, C as ce } from "../../index-DieLVN0p.js";
8
- import { u as ue } from "../../index-2H7slGYV.js";
9
- import { P as K } from "../../index-DpfPnSMn.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";
10
+ import { P as K } from "../../index-BymOxiM6.js";
10
11
  import '../../assets/Tooltip.css';var pe = Object.freeze({
11
12
  // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
12
13
  position: "absolute",
@@ -30,7 +31,7 @@ import '../../assets/Tooltip.css';var pe = Object.freeze({
30
31
  )
31
32
  );
32
33
  U.displayName = de;
33
- var fe = U, [D, $e] = te("Tooltip", [
34
+ var fe = U, [D] = oe("Tooltip", [
34
35
  B
35
36
  ]), L = B(), V = "TooltipProvider", he = 700, A = "tooltip.open", [ve, I] = D(V), $ = (t) => {
36
37
  const {
@@ -77,25 +78,25 @@ var R = "Tooltip", [_e, O] = D(R), Y = (t) => {
77
78
  onOpenChange: s,
78
79
  disableHoverableContent: a,
79
80
  delayDuration: h
80
- } = t, l = I(R, t.__scopeTooltip), f = L(o), [c, d] = i.useState(null), v = ue(), p = i.useRef(0), m = a ?? l.disableHoverableContent, _ = h ?? l.delayDuration, T = i.useRef(!1), [g, x] = oe({
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({
81
82
  prop: r,
82
83
  defaultProp: n ?? !1,
83
- onChange: (H) => {
84
- H ? (l.onOpen(), document.dispatchEvent(new CustomEvent(A))) : l.onClose(), s == null || s(H);
84
+ onChange: (S) => {
85
+ S ? (l.onOpen(), document.dispatchEvent(new CustomEvent(A))) : l.onClose(), s == null || s(S);
85
86
  },
86
87
  caller: R
87
88
  }), w = i.useMemo(() => g ? T.current ? "delayed-open" : "instant-open" : "closed", [g]), E = i.useCallback(() => {
88
89
  window.clearTimeout(p.current), p.current = 0, T.current = !1, x(!0);
89
90
  }, [x]), P = i.useCallback(() => {
90
91
  window.clearTimeout(p.current), p.current = 0, x(!1);
91
- }, [x]), S = i.useCallback(() => {
92
+ }, [x]), H = i.useCallback(() => {
92
93
  window.clearTimeout(p.current), p.current = window.setTimeout(() => {
93
94
  T.current = !0, x(!0), p.current = 0;
94
95
  }, _);
95
96
  }, [_, x]);
96
97
  return i.useEffect(() => () => {
97
98
  p.current && (window.clearTimeout(p.current), p.current = 0);
98
- }, []), /* @__PURE__ */ u(ne, { ...f, children: /* @__PURE__ */ u(
99
+ }, []), /* @__PURE__ */ u(se, { ...f, children: /* @__PURE__ */ u(
99
100
  _e,
100
101
  {
101
102
  scope: o,
@@ -105,8 +106,8 @@ var R = "Tooltip", [_e, O] = D(R), Y = (t) => {
105
106
  trigger: c,
106
107
  onTriggerChange: d,
107
108
  onTriggerEnter: i.useCallback(() => {
108
- l.isOpenDelayedRef.current ? S() : E();
109
- }, [l.isOpenDelayedRef, S, E]),
109
+ l.isOpenDelayedRef.current ? H() : E();
110
+ }, [l.isOpenDelayedRef, H, E]),
110
111
  onTriggerLeave: i.useCallback(() => {
111
112
  m ? P() : (window.clearTimeout(p.current), p.current = 0);
112
113
  }, [P, m]),
@@ -121,7 +122,7 @@ Y.displayName = R;
121
122
  var N = "TooltipTrigger", X = i.forwardRef(
122
123
  (t, o) => {
123
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, []);
124
- return i.useEffect(() => () => document.removeEventListener("pointerup", d), [d]), /* @__PURE__ */ u(le, { asChild: !0, ...a, children: /* @__PURE__ */ u(
125
+ return i.useEffect(() => () => document.removeEventListener("pointerup", d), [d]), /* @__PURE__ */ u(ae, { asChild: !0, ...a, children: /* @__PURE__ */ u(
125
126
  G.button,
126
127
  {
127
128
  "aria-describedby": n.open ? n.contentId : void 0,
@@ -151,7 +152,7 @@ var M = "TooltipPortal", [me, Te] = D(M, {
151
152
  forceMount: void 0
152
153
  }), q = (t) => {
153
154
  const { __scopeTooltip: o, forceMount: e, children: r, container: n } = t, s = O(M, o);
154
- return /* @__PURE__ */ u(me, { scope: o, forceMount: e, children: /* @__PURE__ */ u(K, { present: e || s.open, children: /* @__PURE__ */ u(ie, { asChild: !0, container: n, children: r }) }) });
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 }) }) });
155
156
  };
156
157
  q.displayName = M;
157
158
  var b = "TooltipContent", W = i.forwardRef(
@@ -204,7 +205,7 @@ var b = "TooltipContent", W = i.forwardRef(
204
205
  return window.addEventListener("scroll", d, { capture: !0 }), () => window.removeEventListener("scroll", d, { capture: !0 });
205
206
  }
206
207
  }, [l.trigger, c]), /* @__PURE__ */ u(
207
- ae,
208
+ le,
208
209
  {
209
210
  asChild: !0,
210
211
  disableOutsidePointerEvents: !1,
@@ -213,7 +214,7 @@ var b = "TooltipContent", W = i.forwardRef(
213
214
  onFocusOutside: (d) => d.preventDefault(),
214
215
  onDismiss: c,
215
216
  children: /* @__PURE__ */ k(
216
- ce,
217
+ ue,
217
218
  {
218
219
  "data-state": l.stateAttribute,
219
220
  ...f,
@@ -244,7 +245,7 @@ var J = "TooltipArrow", Q = i.forwardRef(
244
245
  return ge(
245
246
  J,
246
247
  e
247
- ).isInside ? null : /* @__PURE__ */ u(se, { ...n, ...r, ref: o });
248
+ ).isInside ? null : /* @__PURE__ */ u(ce, { ...n, ...r, ref: o });
248
249
  }
249
250
  );
250
251
  Q.displayName = J;
@@ -341,7 +342,7 @@ function Oe(t) {
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
343
  }
343
344
  var De = $, Le = Y, ke = X, Ae = q, Ne = W, Ie = Q;
344
- const Me = "Tooltip-module__tooltip___LjRUX", Se = "Tooltip-module__closable___MjoEb", y = {
345
+ const Me = "Tooltip-module__tooltip___LjRUX", He = "Tooltip-module__closable___MjoEb", y = {
345
346
  "tooltip-container": "Tooltip-module__tooltip-container___X4jVa",
346
347
  tooltip: Me,
347
348
  "tooltip-md": "Tooltip-module__tooltip-md___v79jI",
@@ -352,7 +353,7 @@ const Me = "Tooltip-module__tooltip___LjRUX", Se = "Tooltip-module__closable___M
352
353
  "tooltip-light": "Tooltip-module__tooltip-light___f9BKo",
353
354
  "tooltip-close-icon": "Tooltip-module__tooltip-close-icon___EceS-",
354
355
  "tooltip-content": "Tooltip-module__tooltip-content___fjJv5",
355
- closable: Se,
356
+ closable: He,
356
357
  "tooltip-enter": "Tooltip-module__tooltip-enter___KfwAg",
357
358
  "tooltip-enter-active": "Tooltip-module__tooltip-enter-active___L7FtU",
358
359
  "tooltip-exit": "Tooltip-module__tooltip-exit___RLxZG",
@@ -1,5 +1,5 @@
1
1
  import * as e from "react";
2
- import { i as o } from "./index-DWydnyjJ.js";
2
+ import { i as o } from "./index-DM51yNMI.js";
3
3
  var n = e[" useId ".trim().toString()] || (() => {
4
4
  }), i = 0;
5
5
  function f(r) {
@@ -1,5 +1,5 @@
1
1
  import * as a from "react";
2
- import { d as T, i as A } from "./index-DWydnyjJ.js";
2
+ import { d as T, i as A } from "./index-DM51yNMI.js";
3
3
  function E(n, e) {
4
4
  return a.useReducer((r, t) => e[r][t] ?? r, n);
5
5
  }
@@ -35,7 +35,7 @@ function P(n) {
35
35
  if (e) {
36
36
  let i;
37
37
  const m = e.ownerDocument.defaultView ?? window, d = (u) => {
38
- const g = l(t.current).includes(u.animationName);
38
+ const g = l(t.current).includes(CSS.escape(u.animationName));
39
39
  if (u.target === e && g && (s("ANIMATION_END"), !o.current)) {
40
40
  const O = e.style.animationFillMode;
41
41
  e.style.animationFillMode = "forwards", i = m.setTimeout(() => {