@alixpartners/ui-components 2.1.2 → 2.2.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 (63) hide show
  1. package/dist/ToastProvider-D5LImZ-Q.js +1136 -0
  2. package/dist/assets/Dialog.css +1 -1
  3. package/dist/assets/NavBar.css +1 -1
  4. package/dist/assets/SplitButton.css +1 -1
  5. package/dist/assets/Tooltip.css +1 -1
  6. package/dist/components/Banner/Banner.test.js +1 -1
  7. package/dist/components/Button/Button.test.js +124 -3217
  8. package/dist/components/Checkbox/Checkbox.js +7 -6
  9. package/dist/components/Checkbox/Checkbox.test.js +47 -47
  10. package/dist/components/Creatable/Creatable.js +107 -108
  11. package/dist/components/Dialog/Dialog.d.ts +21 -7
  12. package/dist/components/Dialog/Dialog.js +296 -61
  13. package/dist/components/Dialog/Dialog.test.d.ts +1 -0
  14. package/dist/components/Dialog/Dialog.test.js +368 -0
  15. package/dist/components/Dropdown/Dropdown.js +80 -81
  16. package/dist/components/FilePicker/FilePicker.test.js +1 -1
  17. package/dist/components/Ghost/Ghost.test.js +6 -6
  18. package/dist/components/Input/Input.test.js +2 -2
  19. package/dist/components/NavBar/NavBar.js +16 -16
  20. package/dist/components/Radio/Radio.js +1 -1
  21. package/dist/components/RadioGroup/RadioGroup.js +1 -1
  22. package/dist/components/RadioGroup/RadioGroup.test.js +1 -1
  23. package/dist/components/Search/Search.test.js +1 -1
  24. package/dist/components/SplitButton/SplitButton.js +8 -9
  25. package/dist/components/SplitButton/SplitButton.test.js +1 -1
  26. package/dist/components/Tag/Tag.test.js +1 -1
  27. package/dist/components/TagsFields/TagsFields.js +3 -4
  28. package/dist/components/Textarea/Textarea.js +68 -70
  29. package/dist/components/Textarea/Textarea.test.js +2 -2
  30. package/dist/components/Toast/Toast.d.ts +5 -19
  31. package/dist/components/Toast/Toast.js +65 -62
  32. package/dist/components/Toast/Toast.test.js +47 -30
  33. package/dist/components/ToastProvider/ToastContext.d.ts +11 -0
  34. package/dist/components/ToastProvider/ToastProvider.d.ts +19 -0
  35. package/dist/components/ToastProvider/ToastProvider.js +7 -0
  36. package/dist/components/ToastProvider/ToastProvider.test.d.ts +1 -0
  37. package/dist/components/ToastProvider/ToastProvider.test.js +264 -0
  38. package/dist/components/ToastProvider/types.d.ts +54 -0
  39. package/dist/components/ToastProvider/useToast.d.ts +28 -0
  40. package/dist/components/Toggle/Toggle.js +31 -30
  41. package/dist/components/Toggle/Toggle.test.js +9 -9
  42. package/dist/components/Tooltip/Tooltip.js +20 -19
  43. package/dist/{index-2H7slGYV.js → index-7CBv-Jx6.js} +1 -1
  44. package/dist/{index-DpfPnSMn.js → index-BymOxiM6.js} +2 -2
  45. package/dist/index-C-3_YVJ1.js +1539 -0
  46. package/dist/{index-BKtdMA_j.js → index-C4ffg1vf.js} +24 -23
  47. package/dist/{index-BGZDIjm9.js → index-Chv2KjIL.js} +171 -168
  48. package/dist/{index-BJXIvJs4.js → index-CpsmI33B.js} +24 -23
  49. package/dist/index-CxAtPSMM.js +27 -0
  50. package/dist/{index-CjQV7MmW.js → index-DEphED6n.js} +11 -11
  51. package/dist/index-DM51yNMI.js +237 -0
  52. package/dist/{index-CVWHq7Pr.js → index-D_3jWVyV.js} +37 -36
  53. package/dist/index-DkTDHhag.js +3098 -0
  54. package/dist/index-DrR82jOT.js +142 -0
  55. package/dist/magic-string.es-uPKorP4O.js +663 -0
  56. package/dist/main.d.ts +3 -0
  57. package/dist/main.js +38 -34
  58. package/dist/useToast-Cz5MGKnw.js +11 -0
  59. package/dist/{vi.ClIskdbk-CFW_9sOK.js → vi.bdSIJ99Y-017e_Pkz.js} +9494 -10227
  60. package/package.json +6 -3
  61. package/dist/index-DWydnyjJ.js +0 -245
  62. package/dist/index-DieLVN0p.js +0 -1664
  63. package/dist/magic-string.es-D4UQQyt0.js +0 -859
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alixpartners/ui-components",
3
- "version": "2.1.2",
3
+ "version": "2.2.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -34,7 +34,8 @@
34
34
  "peerDependencies": {
35
35
  "react": "^18.3.1",
36
36
  "react-dom": "^18.3.1",
37
- "radix-ui": "^1.4.2"
37
+ "radix-ui": "^1.4.2",
38
+ "notistack": "^3.0.1"
38
39
  },
39
40
  "devDependencies": {
40
41
  "@chromatic-com/storybook": "^4.0.1",
@@ -57,7 +58,9 @@
57
58
  "eslint-plugin-react-refresh": "^0.4.19",
58
59
  "eslint-plugin-storybook": "^9.0.18",
59
60
  "globals": "^16.0.0",
61
+ "happy-dom": "^15.11.6",
60
62
  "jsdom": "^26.1.0",
63
+ "notistack": "^3.0.1",
61
64
  "playwright": "^1.52.0",
62
65
  "postcss-scss": "^4.0.9",
63
66
  "prettier": "^3.5.3",
@@ -81,4 +84,4 @@
81
84
  "plugin:storybook/recommended"
82
85
  ]
83
86
  }
84
- }
87
+ }
@@ -1,245 +0,0 @@
1
- import * as c from "react";
2
- import * as P from "react-dom";
3
- import { jsx as S, Fragment as R } from "react/jsx-runtime";
4
- function v(t, e) {
5
- if (typeof t == "function")
6
- return t(e);
7
- t != null && (t.current = e);
8
- }
9
- function C(...t) {
10
- return (e) => {
11
- let o = !1;
12
- const r = t.map((n) => {
13
- const s = v(n, e);
14
- return !o && typeof s == "function" && (o = !0), s;
15
- });
16
- if (o)
17
- return () => {
18
- for (let n = 0; n < r.length; n++) {
19
- const s = r[n];
20
- typeof s == "function" ? s() : v(t[n], null);
21
- }
22
- };
23
- };
24
- }
25
- function j(...t) {
26
- return c.useCallback(C(...t), t);
27
- }
28
- // @__NO_SIDE_EFFECTS__
29
- function E(t) {
30
- const e = /* @__PURE__ */ _(t), o = c.forwardRef((r, n) => {
31
- const { children: s, ...u } = r, i = c.Children.toArray(s), l = i.find($);
32
- if (l) {
33
- const f = l.props.children, d = i.map((a) => a === l ? c.Children.count(f) > 1 ? c.Children.only(null) : c.isValidElement(f) ? f.props.children : null : a);
34
- return /* @__PURE__ */ S(e, { ...u, ref: n, children: c.isValidElement(f) ? c.cloneElement(f, void 0, d) : null });
35
- }
36
- return /* @__PURE__ */ S(e, { ...u, ref: n, children: s });
37
- });
38
- return o.displayName = `${t}.Slot`, o;
39
- }
40
- // @__NO_SIDE_EFFECTS__
41
- function _(t) {
42
- const e = c.forwardRef((o, r) => {
43
- const { children: n, ...s } = o;
44
- if (c.isValidElement(n)) {
45
- const u = O(n), i = z(s, n.props);
46
- return n.type !== c.Fragment && (i.ref = r ? C(r, u) : u), c.cloneElement(n, i);
47
- }
48
- return c.Children.count(n) > 1 ? c.Children.only(null) : null;
49
- });
50
- return e.displayName = `${t}.SlotClone`, e;
51
- }
52
- var x = Symbol("radix.slottable");
53
- // @__NO_SIDE_EFFECTS__
54
- function B(t) {
55
- const e = ({ children: o }) => /* @__PURE__ */ S(R, { children: o });
56
- return e.displayName = `${t}.Slottable`, e.__radixId = x, e;
57
- }
58
- function $(t) {
59
- return c.isValidElement(t) && typeof t.type == "function" && "__radixId" in t.type && t.type.__radixId === x;
60
- }
61
- function z(t, e) {
62
- const o = { ...e };
63
- for (const r in e) {
64
- const n = t[r], s = e[r];
65
- /^on[A-Z]/.test(r) ? n && s ? o[r] = (...i) => {
66
- const l = s(...i);
67
- return n(...i), l;
68
- } : n && (o[r] = n) : r === "style" ? o[r] = { ...n, ...s } : r === "className" && (o[r] = [n, s].filter(Boolean).join(" "));
69
- }
70
- return { ...t, ...o };
71
- }
72
- function O(t) {
73
- var r, n;
74
- let e = (r = Object.getOwnPropertyDescriptor(t.props, "ref")) == null ? void 0 : r.get, o = e && "isReactWarning" in e && e.isReactWarning;
75
- return o ? t.ref : (e = (n = Object.getOwnPropertyDescriptor(t, "ref")) == null ? void 0 : n.get, o = e && "isReactWarning" in e && e.isReactWarning, o ? t.props.ref : t.props.ref || t.ref);
76
- }
77
- var N = [
78
- "a",
79
- "button",
80
- "div",
81
- "form",
82
- "h2",
83
- "h3",
84
- "img",
85
- "input",
86
- "label",
87
- "li",
88
- "nav",
89
- "ol",
90
- "p",
91
- "select",
92
- "span",
93
- "svg",
94
- "ul"
95
- ], k = N.reduce((t, e) => {
96
- const o = /* @__PURE__ */ E(`Primitive.${e}`), r = c.forwardRef((n, s) => {
97
- const { asChild: u, ...i } = n, l = u ? o : e;
98
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ S(l, { ...i, ref: s });
99
- });
100
- return r.displayName = `Primitive.${e}`, { ...t, [e]: r };
101
- }, {});
102
- function F(t, e) {
103
- t && P.flushSync(() => t.dispatchEvent(e));
104
- }
105
- function L(t, e = []) {
106
- let o = [];
107
- function r(s, u) {
108
- const i = c.createContext(u), l = o.length;
109
- o = [...o, u];
110
- const f = (a) => {
111
- var b;
112
- const { scope: p, children: h, ...m } = a, y = ((b = p == null ? void 0 : p[t]) == null ? void 0 : b[l]) || i, w = c.useMemo(() => m, Object.values(m));
113
- return /* @__PURE__ */ S(y.Provider, { value: w, children: h });
114
- };
115
- f.displayName = s + "Provider";
116
- function d(a, p) {
117
- var y;
118
- const h = ((y = p == null ? void 0 : p[t]) == null ? void 0 : y[l]) || i, m = c.useContext(h);
119
- if (m) return m;
120
- if (u !== void 0) return u;
121
- throw new Error(`\`${a}\` must be used within \`${s}\``);
122
- }
123
- return [f, d];
124
- }
125
- const n = () => {
126
- const s = o.map((u) => c.createContext(u));
127
- return function(i) {
128
- const l = (i == null ? void 0 : i[t]) || s;
129
- return c.useMemo(
130
- () => ({ [`__scope${t}`]: { ...i, [t]: l } }),
131
- [i, l]
132
- );
133
- };
134
- };
135
- return n.scopeName = t, [r, A(n, ...e)];
136
- }
137
- function A(...t) {
138
- const e = t[0];
139
- if (t.length === 1) return e;
140
- const o = () => {
141
- const r = t.map((n) => ({
142
- useScope: n(),
143
- scopeName: n.scopeName
144
- }));
145
- return function(s) {
146
- const u = r.reduce((i, { useScope: l, scopeName: f }) => {
147
- const a = l(s)[`__scope${f}`];
148
- return { ...i, ...a };
149
- }, {});
150
- return c.useMemo(() => ({ [`__scope${e.scopeName}`]: u }), [u]);
151
- };
152
- };
153
- return o.scopeName = e.scopeName, o;
154
- }
155
- function M(t, e, { checkForDefaultPrevented: o = !0 } = {}) {
156
- return function(n) {
157
- if (t == null || t(n), o === !1 || !n.defaultPrevented)
158
- return e == null ? void 0 : e(n);
159
- };
160
- }
161
- var g = globalThis != null && globalThis.document ? c.useLayoutEffect : () => {
162
- }, I = c[" useInsertionEffect ".trim().toString()] || g;
163
- function T({
164
- prop: t,
165
- defaultProp: e,
166
- onChange: o = () => {
167
- },
168
- caller: r
169
- }) {
170
- const [n, s, u] = D({
171
- defaultProp: e,
172
- onChange: o
173
- }), i = t !== void 0, l = i ? t : n;
174
- {
175
- const d = c.useRef(t !== void 0);
176
- c.useEffect(() => {
177
- const a = d.current;
178
- a !== i && console.warn(
179
- `${r} is changing from ${a ? "controlled" : "uncontrolled"} to ${i ? "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.`
180
- ), d.current = i;
181
- }, [i, r]);
182
- }
183
- const f = c.useCallback(
184
- (d) => {
185
- var a;
186
- if (i) {
187
- const p = W(d) ? d(t) : d;
188
- p !== t && ((a = u.current) == null || a.call(u, p));
189
- } else
190
- s(d);
191
- },
192
- [i, t, s, u]
193
- );
194
- return [l, f];
195
- }
196
- function D({
197
- defaultProp: t,
198
- onChange: e
199
- }) {
200
- const [o, r] = c.useState(t), n = c.useRef(o), s = c.useRef(e);
201
- return I(() => {
202
- s.current = e;
203
- }, [e]), c.useEffect(() => {
204
- var u;
205
- n.current !== o && ((u = s.current) == null || u.call(s, o), n.current = o);
206
- }, [o, n]), [o, r, s];
207
- }
208
- function W(t) {
209
- return typeof t == "function";
210
- }
211
- function U(t) {
212
- const [e, o] = c.useState(void 0);
213
- return g(() => {
214
- if (t) {
215
- o({ width: t.offsetWidth, height: t.offsetHeight });
216
- const r = new ResizeObserver((n) => {
217
- if (!Array.isArray(n) || !n.length)
218
- return;
219
- const s = n[0];
220
- let u, i;
221
- if ("borderBoxSize" in s) {
222
- const l = s.borderBoxSize, f = Array.isArray(l) ? l[0] : l;
223
- u = f.inlineSize, i = f.blockSize;
224
- } else
225
- u = t.offsetWidth, i = t.offsetHeight;
226
- o({ width: u, height: i });
227
- });
228
- return r.observe(t, { box: "border-box" }), () => r.unobserve(t);
229
- } else
230
- o(void 0);
231
- }, [t]), e;
232
- }
233
- export {
234
- k as P,
235
- M as a,
236
- C as b,
237
- L as c,
238
- j as d,
239
- U as e,
240
- F as f,
241
- E as g,
242
- B as h,
243
- g as i,
244
- T as u
245
- };