@alixpartners/ui-components 2.6.0 → 2.6.2

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 (100) hide show
  1. package/dist/{RichTextEditor-JH6YBGiw.js → RichTextEditor-xCakhho7.js} +1 -1
  2. package/dist/{ToastProvider-DVycF0zU.js → ToastProvider-D5LImZ-Q.js} +26 -26
  3. package/dist/assets/Dialog.css +1 -1
  4. package/dist/components/Banner/Banner.d.ts +1 -1
  5. package/dist/components/Banner/Banner.test.js +1 -1
  6. package/dist/components/Button/Button.d.ts +1 -1
  7. package/dist/components/Button/Button.test.js +2 -2
  8. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  9. package/dist/components/Checkbox/Checkbox.js +3 -3
  10. package/dist/components/Checkbox/Checkbox.test.js +1 -1
  11. package/dist/components/CorusHeader/CorusHeader.d.ts +1 -1
  12. package/dist/components/CorusHeader/CorusHeader.js +1 -1
  13. package/dist/components/CorusHeader/DropdownItemContent.d.ts +1 -1
  14. package/dist/components/CorusHeader/DropdownItemContent.js +5 -5
  15. package/dist/components/CorusHeader/DropdownMenu.d.ts +1 -1
  16. package/dist/components/CorusHeader/DropdownMenu.js +1 -1
  17. package/dist/components/CorusHeader/MegaMenuContent.d.ts +1 -1
  18. package/dist/components/CorusHeader/MegaMenuContent.js +14 -14
  19. package/dist/components/CorusHeader/UserProfileIcon.d.ts +1 -1
  20. package/dist/components/Creatable/Creatable.d.ts +1 -1
  21. package/dist/components/Creatable/Creatable.js +1 -1
  22. package/dist/components/Datepicker/Datepicker.d.ts +1 -1
  23. package/dist/components/Datepicker/Datepicker.js +1 -1
  24. package/dist/components/Datepicker/Datepicker.test.js +1 -1
  25. package/dist/components/Dialog/Dialog.d.ts +8 -2
  26. package/dist/components/Dialog/Dialog.js +227 -195
  27. package/dist/components/Dialog/Dialog.test.js +227 -202
  28. package/dist/components/DragAndDrop/DragAndDrop.d.ts +1 -1
  29. package/dist/components/DragAndDrop/DragAndDrop.test.js +2 -2
  30. package/dist/components/Dropdown/Dropdown.d.ts +1 -1
  31. package/dist/components/Dropdown/Dropdown.js +1 -1
  32. package/dist/components/FilePicker/FilePicker.d.ts +9 -9
  33. package/dist/components/FilePicker/FilePicker.test.js +2 -2
  34. package/dist/components/Ghost/Ghost.d.ts +1 -1
  35. package/dist/components/Ghost/Ghost.test.js +1 -1
  36. package/dist/components/Icon/Icon.d.ts +1 -1
  37. package/dist/components/Icons/IconsGallery.d.ts +1 -1
  38. package/dist/components/Illustration/Illustration.d.ts +1 -1
  39. package/dist/components/Illustration/Illustration.test.js +1 -1
  40. package/dist/components/Input/Input.test.js +1 -1
  41. package/dist/components/Logo/Logo.d.ts +1 -1
  42. package/dist/components/Logos/LogosGallery.d.ts +1 -1
  43. package/dist/components/NavBar/NavBar.d.ts +1 -1
  44. package/dist/components/NavBar/NavBar.js +1 -1
  45. package/dist/components/Radio/Radio.d.ts +1 -1
  46. package/dist/components/Radio/Radio.js +9 -9
  47. package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
  48. package/dist/components/RadioGroup/RadioGroup.js +11 -11
  49. package/dist/components/RadioGroup/RadioGroup.test.js +1 -1
  50. package/dist/components/RichTextEditor/RichTextEditor.d.ts +1 -1
  51. package/dist/components/RichTextEditor/RichTextEditor.js +2 -2
  52. package/dist/components/RichTextEditor/RichTextEditor.test.js +2 -2
  53. package/dist/components/Search/Search.d.ts +1 -1
  54. package/dist/components/Search/Search.test.js +1 -1
  55. package/dist/components/Spinner/Spinner.d.ts +1 -1
  56. package/dist/components/SplitButton/SplitButton.d.ts +1 -1
  57. package/dist/components/SplitButton/SplitButton.js +3 -3
  58. package/dist/components/SplitButton/SplitButton.test.js +1 -1
  59. package/dist/components/Tab/Tab.d.ts +1 -1
  60. package/dist/components/TabNavigation/TabNavigation.d.ts +1 -1
  61. package/dist/components/Tag/Tag.d.ts +1 -1
  62. package/dist/components/Tag/Tag.test.js +1 -1
  63. package/dist/components/TagsFields/TagsFields.d.ts +1 -1
  64. package/dist/components/TagsFields/TagsFields.js +1 -1
  65. package/dist/components/Textarea/Textarea.d.ts +1 -1
  66. package/dist/components/Textarea/Textarea.test.js +1 -1
  67. package/dist/components/Toast/Toast.test.js +1 -1
  68. package/dist/components/ToastProvider/ToastProvider.d.ts +1 -2
  69. package/dist/components/ToastProvider/ToastProvider.js +1 -1
  70. package/dist/components/ToastProvider/ToastProvider.test.js +4 -4
  71. package/dist/components/Toggle/Toggle.d.ts +1 -1
  72. package/dist/components/Toggle/Toggle.js +126 -211
  73. package/dist/components/Toggle/Toggle.test.js +1 -1
  74. package/dist/components/Tooltip/Tooltip.d.ts +1 -1
  75. package/dist/components/Tooltip/Tooltip.js +61 -60
  76. package/dist/{index-6DGSlWJb.js → index-C2s_VtSb.js} +3 -3
  77. package/dist/index-C8H9A55g.js +222 -0
  78. package/dist/{index-CcsZYEYy.js → index-CCFDXH-J.js} +28 -29
  79. package/dist/index-CCnm5-ML.js +230 -0
  80. package/dist/{index-BVZdJVFB.js → index-CFqDEbIR.js} +191 -192
  81. package/dist/index-CfIcUHKK.js +70 -0
  82. package/dist/index-ChQc_Cm6.js +1544 -0
  83. package/dist/index-CmGGeUr0.js +142 -0
  84. package/dist/{index-IR8HlW5P.js → index-D_L0ncPJ.js} +4 -4
  85. package/dist/{index-banDzeKa.js → index-DkTDHhag.js} +1 -1
  86. package/dist/index-Ii4UOx3H.js +599 -0
  87. package/dist/{index-6j3vTf--.js → index-Nyh2Wa71.js} +5 -5
  88. package/dist/index-z_kiwVc3.js +237 -0
  89. package/dist/main.js +3 -3
  90. package/dist/storybook-docs-page.d.ts +1 -1
  91. package/dist/{useToast-CpwrYPvx.js → useToast-Cz5MGKnw.js} +1 -1
  92. package/dist/{vi.bdSIJ99Y-DWCVXj6K.js → vi.bdSIJ99Y-017e_Pkz.js} +3 -3
  93. package/package.json +1 -1
  94. package/dist/index-B4szHVNJ.js +0 -248
  95. package/dist/index-Bq1FiX6B.js +0 -93
  96. package/dist/index-CE9NpYQR.js +0 -604
  97. package/dist/index-CHy8gqvu.js +0 -353
  98. package/dist/index-CarlZuEo.js +0 -1610
  99. package/dist/index-DH9SO8qV.js +0 -221
  100. package/dist/index-kgC_DL6e.js +0 -216
@@ -0,0 +1,237 @@
1
+ import * as c from "react";
2
+ import * as w from "react-dom";
3
+ import { jsx as m, Fragment as E } from "react/jsx-runtime";
4
+ function h(t, e) {
5
+ if (typeof t == "function")
6
+ return t(e);
7
+ t != null && (t.current = e);
8
+ }
9
+ function b(...t) {
10
+ return (e) => {
11
+ let o = !1;
12
+ const s = t.map((n) => {
13
+ const r = h(n, e);
14
+ return !o && typeof r == "function" && (o = !0), r;
15
+ });
16
+ if (o)
17
+ return () => {
18
+ for (let n = 0; n < s.length; n++) {
19
+ const r = s[n];
20
+ typeof r == "function" ? r() : h(t[n], null);
21
+ }
22
+ };
23
+ };
24
+ }
25
+ function A(...t) {
26
+ return c.useCallback(b(...t), t);
27
+ }
28
+ // @__NO_SIDE_EFFECTS__
29
+ function R(t) {
30
+ const e = /* @__PURE__ */ $(t), o = c.forwardRef((s, n) => {
31
+ const { children: r, ...i } = s, u = c.Children.toArray(r), l = u.find(g);
32
+ if (l) {
33
+ const a = l.props.children, d = u.map((f) => f === l ? c.Children.count(a) > 1 ? c.Children.only(null) : c.isValidElement(a) ? a.props.children : null : f);
34
+ return /* @__PURE__ */ m(e, { ...i, ref: n, children: c.isValidElement(a) ? c.cloneElement(a, void 0, d) : null });
35
+ }
36
+ return /* @__PURE__ */ m(e, { ...i, ref: n, children: r });
37
+ });
38
+ return o.displayName = `${t}.Slot`, o;
39
+ }
40
+ // @__NO_SIDE_EFFECTS__
41
+ function $(t) {
42
+ const e = c.forwardRef((o, s) => {
43
+ const { children: n, ...r } = o;
44
+ if (c.isValidElement(n)) {
45
+ const i = N(n), u = _(r, n.props);
46
+ return n.type !== c.Fragment && (u.ref = s ? b(s, i) : i), c.cloneElement(n, u);
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 F(t) {
55
+ const e = ({ children: o }) => /* @__PURE__ */ m(E, { children: o });
56
+ return e.displayName = `${t}.Slottable`, e.__radixId = x, e;
57
+ }
58
+ function g(t) {
59
+ return c.isValidElement(t) && typeof t.type == "function" && "__radixId" in t.type && t.type.__radixId === x;
60
+ }
61
+ function _(t, e) {
62
+ const o = { ...e };
63
+ for (const s in e) {
64
+ const n = t[s], r = e[s];
65
+ /^on[A-Z]/.test(s) ? n && r ? o[s] = (...u) => {
66
+ const l = r(...u);
67
+ return n(...u), l;
68
+ } : n && (o[s] = n) : s === "style" ? o[s] = { ...n, ...r } : s === "className" && (o[s] = [n, r].filter(Boolean).join(" "));
69
+ }
70
+ return { ...t, ...o };
71
+ }
72
+ function N(t) {
73
+ var s, n;
74
+ let e = (s = Object.getOwnPropertyDescriptor(t.props, "ref")) == null ? void 0 : s.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 O = [
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
+ ], L = O.reduce((t, e) => {
96
+ const o = /* @__PURE__ */ R(`Primitive.${e}`), s = c.forwardRef((n, r) => {
97
+ const { asChild: i, ...u } = n, l = i ? o : e;
98
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ m(l, { ...u, ref: r });
99
+ });
100
+ return s.displayName = `Primitive.${e}`, { ...t, [e]: s };
101
+ }, {});
102
+ function T(t, e) {
103
+ t && w.flushSync(() => t.dispatchEvent(e));
104
+ }
105
+ function k(t, e) {
106
+ const o = c.createContext(e), s = (r) => {
107
+ const { children: i, ...u } = r, l = c.useMemo(() => u, Object.values(u));
108
+ return /* @__PURE__ */ m(o.Provider, { value: l, children: i });
109
+ };
110
+ s.displayName = t + "Provider";
111
+ function n(r) {
112
+ const i = c.useContext(o);
113
+ if (i) return i;
114
+ if (e !== void 0) return e;
115
+ throw new Error(`\`${r}\` must be used within \`${t}\``);
116
+ }
117
+ return [s, n];
118
+ }
119
+ function B(t, e = []) {
120
+ let o = [];
121
+ function s(r, i) {
122
+ const u = c.createContext(i), l = o.length;
123
+ o = [...o, i];
124
+ const a = (f) => {
125
+ var C;
126
+ const { scope: p, children: S, ...v } = f, y = ((C = p == null ? void 0 : p[t]) == null ? void 0 : C[l]) || u, P = c.useMemo(() => v, Object.values(v));
127
+ return /* @__PURE__ */ m(y.Provider, { value: P, children: S });
128
+ };
129
+ a.displayName = r + "Provider";
130
+ function d(f, p) {
131
+ var y;
132
+ const S = ((y = p == null ? void 0 : p[t]) == null ? void 0 : y[l]) || u, v = c.useContext(S);
133
+ if (v) return v;
134
+ if (i !== void 0) return i;
135
+ throw new Error(`\`${f}\` must be used within \`${r}\``);
136
+ }
137
+ return [a, d];
138
+ }
139
+ const n = () => {
140
+ const r = o.map((i) => c.createContext(i));
141
+ return function(u) {
142
+ const l = (u == null ? void 0 : u[t]) || r;
143
+ return c.useMemo(
144
+ () => ({ [`__scope${t}`]: { ...u, [t]: l } }),
145
+ [u, l]
146
+ );
147
+ };
148
+ };
149
+ return n.scopeName = t, [s, I(n, ...e)];
150
+ }
151
+ function I(...t) {
152
+ const e = t[0];
153
+ if (t.length === 1) return e;
154
+ const o = () => {
155
+ const s = t.map((n) => ({
156
+ useScope: n(),
157
+ scopeName: n.scopeName
158
+ }));
159
+ return function(r) {
160
+ const i = s.reduce((u, { useScope: l, scopeName: a }) => {
161
+ const f = l(r)[`__scope${a}`];
162
+ return { ...u, ...f };
163
+ }, {});
164
+ return c.useMemo(() => ({ [`__scope${e.scopeName}`]: i }), [i]);
165
+ };
166
+ };
167
+ return o.scopeName = e.scopeName, o;
168
+ }
169
+ function U(t, e, { checkForDefaultPrevented: o = !0 } = {}) {
170
+ return function(n) {
171
+ if (t == null || t(n), o === !1 || !n.defaultPrevented)
172
+ return e == null ? void 0 : e(n);
173
+ };
174
+ }
175
+ var D = globalThis != null && globalThis.document ? c.useLayoutEffect : () => {
176
+ }, j = c[" useInsertionEffect ".trim().toString()] || D;
177
+ function Z({
178
+ prop: t,
179
+ defaultProp: e,
180
+ onChange: o = () => {
181
+ },
182
+ caller: s
183
+ }) {
184
+ const [n, r, i] = V({
185
+ defaultProp: e,
186
+ onChange: o
187
+ }), u = t !== void 0, l = u ? t : n;
188
+ {
189
+ const d = c.useRef(t !== void 0);
190
+ c.useEffect(() => {
191
+ const f = d.current;
192
+ f !== u && console.warn(
193
+ `${s} is changing from ${f ? "controlled" : "uncontrolled"} to ${u ? "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.`
194
+ ), d.current = u;
195
+ }, [u, s]);
196
+ }
197
+ const a = c.useCallback(
198
+ (d) => {
199
+ var f;
200
+ if (u) {
201
+ const p = M(d) ? d(t) : d;
202
+ p !== t && ((f = i.current) == null || f.call(i, p));
203
+ } else
204
+ r(d);
205
+ },
206
+ [u, t, r, i]
207
+ );
208
+ return [l, a];
209
+ }
210
+ function V({
211
+ defaultProp: t,
212
+ onChange: e
213
+ }) {
214
+ const [o, s] = c.useState(t), n = c.useRef(o), r = c.useRef(e);
215
+ return j(() => {
216
+ r.current = e;
217
+ }, [e]), c.useEffect(() => {
218
+ var i;
219
+ n.current !== o && ((i = r.current) == null || i.call(r, o), n.current = o);
220
+ }, [o, n]), [o, s, r];
221
+ }
222
+ function M(t) {
223
+ return typeof t == "function";
224
+ }
225
+ export {
226
+ L as P,
227
+ b as a,
228
+ B as b,
229
+ U as c,
230
+ A as d,
231
+ R as e,
232
+ k as f,
233
+ F as g,
234
+ D as h,
235
+ T as i,
236
+ Z as u
237
+ };
package/dist/main.js CHANGED
@@ -12,10 +12,10 @@ import { default as B } from "./components/Dropdown/Dropdown.js";
12
12
  import { default as R, useFilePickerContext as v } from "./components/FilePicker/FilePicker.js";
13
13
  import { default as I } from "./components/Search/Search.js";
14
14
  import { default as S } from "./components/Datepicker/Datepicker.js";
15
- import { R as N } from "./RichTextEditor-JH6YBGiw.js";
15
+ import { R as N } from "./RichTextEditor-xCakhho7.js";
16
16
  import { default as w } from "./components/Toast/Toast.js";
17
- import { T as E } from "./ToastProvider-DVycF0zU.js";
18
- import { u as L } from "./useToast-CpwrYPvx.js";
17
+ import { T as E } from "./ToastProvider-D5LImZ-Q.js";
18
+ import { u as L } from "./useToast-Cz5MGKnw.js";
19
19
  import { default as q } from "./components/Creatable/Creatable.js";
20
20
  import { default as z } from "./components/SplitButton/SplitButton.js";
21
21
  import { default as K } from "./components/DragAndDrop/DragAndDrop.js";
@@ -1,5 +1,5 @@
1
1
  type StorybookDocsPageProps = {
2
2
  includePrimaryStory?: boolean;
3
3
  };
4
- declare const storybookDocsPage: ({ includePrimaryStory }: StorybookDocsPageProps) => import("react").JSX.Element;
4
+ declare const storybookDocsPage: ({ includePrimaryStory }: StorybookDocsPageProps) => import("react/jsx-runtime").JSX.Element;
5
5
  export default storybookDocsPage;
@@ -1,5 +1,5 @@
1
1
  import { useContext as o } from "react";
2
- import { a as r } from "./ToastProvider-DVycF0zU.js";
2
+ import { a as r } from "./ToastProvider-D5LImZ-Q.js";
3
3
  function n() {
4
4
  const t = o(r);
5
5
  if (!t)
@@ -23395,11 +23395,11 @@ function Or(e) {
23395
23395
  return (o == null ? void 0 : o.file) || "";
23396
23396
  }
23397
23397
  export {
23398
- je as a,
23398
+ HM as a,
23399
23399
  VM as b,
23400
- HM as c,
23400
+ Lr as c,
23401
23401
  WM as d,
23402
- Lr as e,
23402
+ je as e,
23403
23403
  Xe as f,
23404
23404
  cM as g,
23405
23405
  zM as i,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alixpartners/ui-components",
3
- "version": "2.6.0",
3
+ "version": "2.6.2",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -1,248 +0,0 @@
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
- };
@@ -1,93 +0,0 @@
1
- import * as a from "react";
2
- import { d as A } from "./index-B4szHVNJ.js";
3
- function T(e, n) {
4
- return a.useReducer((r, t) => n[r][t] ?? r, e);
5
- }
6
- var E = (e) => {
7
- const { present: n, children: r } = e, t = y(n), o = typeof r == "function" ? r({ present: t.isPresent }) : a.Children.only(r), c = P(t.ref, S(o));
8
- return typeof r == "function" || t.isPresent ? a.cloneElement(o, { ref: c }) : null;
9
- };
10
- E.displayName = "Presence";
11
- function y(e) {
12
- const [n, r] = a.useState(), t = a.useRef(null), o = a.useRef(e), c = a.useRef("none"), s = e ? "mounted" : "unmounted", [u, f] = T(s, {
13
- mounted: {
14
- UNMOUNT: "unmounted",
15
- ANIMATION_OUT: "unmountSuspended"
16
- },
17
- unmountSuspended: {
18
- MOUNT: "mounted",
19
- ANIMATION_END: "unmounted"
20
- },
21
- unmounted: {
22
- MOUNT: "mounted"
23
- }
24
- });
25
- return a.useEffect(() => {
26
- const i = p(t.current);
27
- c.current = u === "mounted" ? i : "none";
28
- }, [u]), A(() => {
29
- const i = t.current, l = o.current;
30
- if (l !== e) {
31
- const N = c.current, m = p(i);
32
- e ? f("MOUNT") : m === "none" || (i == null ? void 0 : i.display) === "none" ? f("UNMOUNT") : f(l && N !== m ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
33
- }
34
- }, [e, f]), A(() => {
35
- if (n) {
36
- let i;
37
- const l = n.ownerDocument.defaultView ?? window, d = (m) => {
38
- const R = p(t.current).includes(CSS.escape(m.animationName));
39
- if (m.target === n && R && (f("ANIMATION_END"), !o.current)) {
40
- const O = n.style.animationFillMode;
41
- n.style.animationFillMode = "forwards", i = l.setTimeout(() => {
42
- n.style.animationFillMode === "forwards" && (n.style.animationFillMode = O);
43
- });
44
- }
45
- }, N = (m) => {
46
- m.target === n && (c.current = p(t.current));
47
- };
48
- return n.addEventListener("animationstart", N), n.addEventListener("animationcancel", d), n.addEventListener("animationend", d), () => {
49
- l.clearTimeout(i), n.removeEventListener("animationstart", N), n.removeEventListener("animationcancel", d), n.removeEventListener("animationend", d);
50
- };
51
- } else
52
- f("ANIMATION_END");
53
- }, [n, f]), {
54
- isPresent: ["mounted", "unmountSuspended"].includes(u),
55
- ref: a.useCallback((i) => {
56
- t.current = i ? getComputedStyle(i) : null, r(i);
57
- }, [])
58
- };
59
- }
60
- function g(e, n) {
61
- if (typeof e == "function")
62
- return e(n);
63
- e != null && (e.current = n);
64
- }
65
- function P(...e) {
66
- const n = a.useRef(e);
67
- return n.current = e, a.useCallback((r) => {
68
- const t = n.current;
69
- let o = !1;
70
- const c = t.map((s) => {
71
- const u = g(s, r);
72
- return !o && typeof u == "function" && (o = !0), u;
73
- });
74
- if (o)
75
- return () => {
76
- for (let s = 0; s < c.length; s++) {
77
- const u = c[s];
78
- typeof u == "function" ? u() : g(t[s], null);
79
- }
80
- };
81
- }, []);
82
- }
83
- function p(e) {
84
- return (e == null ? void 0 : e.animationName) || "none";
85
- }
86
- function S(e) {
87
- var t, o;
88
- let n = (t = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : t.get, r = n && "isReactWarning" in n && n.isReactWarning;
89
- return r ? e.ref : (n = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, r = n && "isReactWarning" in n && n.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
90
- }
91
- export {
92
- E as P
93
- };