@alixpartners/ui-components 2.5.7 → 2.6.1

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 (112) hide show
  1. package/README.md +97 -97
  2. package/dist/RichTextEditor-JH6YBGiw.js +541 -0
  3. package/dist/{ToastProvider-D5LImZ-Q.js → ToastProvider-DVycF0zU.js} +26 -26
  4. package/dist/assets/CorusHeader.css +1 -1
  5. package/dist/assets/Dialog.css +1 -1
  6. package/dist/assets/Tab.css +1 -1
  7. package/dist/assets/Tag.css +1 -1
  8. package/dist/assets/ap-icons-types.d.ts +1 -1
  9. package/dist/assets/ap-icons.d.ts +1 -1
  10. package/dist/assets/main.css +1 -1
  11. package/dist/components/Banner/Banner.d.ts +1 -1
  12. package/dist/components/Banner/Banner.test.js +1 -1
  13. package/dist/components/Button/Button.d.ts +1 -1
  14. package/dist/components/Button/Button.test.js +2 -2
  15. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  16. package/dist/components/Checkbox/Checkbox.js +3 -3
  17. package/dist/components/Checkbox/Checkbox.test.js +1 -1
  18. package/dist/components/CorusHeader/CorusHeader.d.ts +1 -1
  19. package/dist/components/CorusHeader/CorusHeader.js +45 -44
  20. package/dist/components/CorusHeader/CorusHeader.types.d.ts +1 -0
  21. package/dist/components/CorusHeader/DropdownItemContent.d.ts +1 -1
  22. package/dist/components/CorusHeader/DropdownMenu.d.ts +2 -1
  23. package/dist/components/CorusHeader/DropdownMenu.js +6 -5
  24. package/dist/components/CorusHeader/MegaMenuContent.d.ts +2 -1
  25. package/dist/components/CorusHeader/MegaMenuContent.js +11 -10
  26. package/dist/components/CorusHeader/UserProfileIcon.d.ts +1 -1
  27. package/dist/components/Creatable/Creatable.d.ts +1 -1
  28. package/dist/components/Creatable/Creatable.js +1 -1
  29. package/dist/components/Datepicker/Datepicker.d.ts +1 -1
  30. package/dist/components/Datepicker/Datepicker.js +1 -1
  31. package/dist/components/Datepicker/Datepicker.test.js +1 -1
  32. package/dist/components/Dialog/Dialog.d.ts +8 -2
  33. package/dist/components/Dialog/Dialog.js +183 -203
  34. package/dist/components/Dialog/Dialog.test.js +227 -202
  35. package/dist/components/DragAndDrop/DragAndDrop.d.ts +1 -1
  36. package/dist/components/DragAndDrop/DragAndDrop.test.js +2 -2
  37. package/dist/components/Dropdown/Dropdown.d.ts +3 -1
  38. package/dist/components/Dropdown/Dropdown.js +179 -172
  39. package/dist/components/FilePicker/FilePicker.d.ts +9 -9
  40. package/dist/components/FilePicker/FilePicker.test.js +2 -2
  41. package/dist/components/Ghost/Ghost.d.ts +1 -1
  42. package/dist/components/Ghost/Ghost.test.js +1 -1
  43. package/dist/components/Icon/Icon.d.ts +1 -1
  44. package/dist/components/Icons/IconsGallery.d.ts +1 -1
  45. package/dist/components/Icons/IconsGallery.js +1 -1
  46. package/dist/components/Illustration/Illustration.d.ts +1 -1
  47. package/dist/components/Illustration/Illustration.test.js +1 -1
  48. package/dist/components/Input/Input.test.js +1 -1
  49. package/dist/components/Logo/Logo.d.ts +1 -1
  50. package/dist/components/Logos/LogosGallery.d.ts +1 -1
  51. package/dist/components/NavBar/NavBar.d.ts +1 -1
  52. package/dist/components/NavBar/NavBar.js +1 -1
  53. package/dist/components/Radio/Radio.d.ts +1 -1
  54. package/dist/components/Radio/Radio.js +9 -9
  55. package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
  56. package/dist/components/RadioGroup/RadioGroup.js +11 -11
  57. package/dist/components/RadioGroup/RadioGroup.test.js +1 -1
  58. package/dist/components/RichTextEditor/RichTextEditor.d.ts +1 -1
  59. package/dist/components/RichTextEditor/RichTextEditor.js +2 -2
  60. package/dist/components/RichTextEditor/RichTextEditor.test.js +2 -2
  61. package/dist/components/Search/Search.d.ts +1 -1
  62. package/dist/components/Search/Search.test.js +1 -1
  63. package/dist/components/Spinner/Spinner.d.ts +1 -1
  64. package/dist/components/SplitButton/SplitButton.d.ts +1 -1
  65. package/dist/components/SplitButton/SplitButton.js +3 -3
  66. package/dist/components/SplitButton/SplitButton.test.js +1 -1
  67. package/dist/components/Tab/Tab.d.ts +5 -1
  68. package/dist/components/Tab/Tab.js +28 -24
  69. package/dist/components/TabNavigation/TabNavigation.d.ts +1 -1
  70. package/dist/components/Tag/Tag.d.ts +1 -1
  71. package/dist/components/Tag/Tag.js +1 -1
  72. package/dist/components/Tag/Tag.test.js +1 -1
  73. package/dist/components/TagsFields/TagsFields.d.ts +1 -1
  74. package/dist/components/TagsFields/TagsFields.js +1 -1
  75. package/dist/components/Textarea/Textarea.d.ts +1 -1
  76. package/dist/components/Textarea/Textarea.test.js +1 -1
  77. package/dist/components/Toast/Toast.test.js +1 -1
  78. package/dist/components/ToastProvider/ToastProvider.d.ts +2 -1
  79. package/dist/components/ToastProvider/ToastProvider.js +1 -1
  80. package/dist/components/ToastProvider/ToastProvider.test.js +4 -4
  81. package/dist/components/Toggle/Toggle.d.ts +1 -1
  82. package/dist/components/Toggle/Toggle.js +211 -126
  83. package/dist/components/Toggle/Toggle.test.js +1 -1
  84. package/dist/components/Tooltip/Tooltip.d.ts +1 -1
  85. package/dist/components/Tooltip/Tooltip.js +60 -61
  86. package/dist/{index-C2s_VtSb.js → index-6DGSlWJb.js} +3 -3
  87. package/dist/{index-Nyh2Wa71.js → index-6j3vTf--.js} +5 -5
  88. package/dist/index-B4szHVNJ.js +248 -0
  89. package/dist/{index-CFqDEbIR.js → index-BVZdJVFB.js} +192 -191
  90. package/dist/index-Bq1FiX6B.js +93 -0
  91. package/dist/index-CE9NpYQR.js +604 -0
  92. package/dist/index-CHy8gqvu.js +353 -0
  93. package/dist/index-CarlZuEo.js +1610 -0
  94. package/dist/{index-CCFDXH-J.js → index-CcsZYEYy.js} +29 -28
  95. package/dist/index-DH9SO8qV.js +221 -0
  96. package/dist/{index-D_L0ncPJ.js → index-IR8HlW5P.js} +4 -4
  97. package/dist/{index-DkTDHhag.js → index-banDzeKa.js} +1 -1
  98. package/dist/index-kgC_DL6e.js +216 -0
  99. package/dist/main.js +3 -3
  100. package/dist/storybook-docs-page.d.ts +1 -1
  101. package/dist/{useToast-Cz5MGKnw.js → useToast-CpwrYPvx.js} +1 -1
  102. package/dist/{vi.bdSIJ99Y-017e_Pkz.js → vi.bdSIJ99Y-DWCVXj6K.js} +3 -3
  103. package/dist/web.config +8 -8
  104. package/package.json +94 -94
  105. package/dist/RichTextEditor-kTQEDSL0.js +0 -477
  106. package/dist/index-C8H9A55g.js +0 -222
  107. package/dist/index-CCnm5-ML.js +0 -230
  108. package/dist/index-CfIcUHKK.js +0 -70
  109. package/dist/index-ChQc_Cm6.js +0 -1544
  110. package/dist/index-CmGGeUr0.js +0 -142
  111. package/dist/index-Ii4UOx3H.js +0 -599
  112. package/dist/index-z_kiwVc3.js +0 -237
@@ -1,222 +0,0 @@
1
- import * as i from "react";
2
- import g from "react";
3
- import { b as L, d as P, e as G, P as K, c as A, u as $ } from "./index-z_kiwVc3.js";
4
- import { jsx as m } from "react/jsx-runtime";
5
- import { u as J, a as Q } from "./index-C2s_VtSb.js";
6
- function W(e) {
7
- const o = e + "CollectionProvider", [u, n] = L(o), [_, v] = u(
8
- o,
9
- { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
10
- ), I = (f) => {
11
- const { scope: t, children: a } = f, d = g.useRef(null), r = g.useRef(/* @__PURE__ */ new Map()).current;
12
- return /* @__PURE__ */ m(_, { scope: t, itemMap: r, collectionRef: d, children: a });
13
- };
14
- I.displayName = o;
15
- const C = e + "CollectionSlot", h = G(C), p = g.forwardRef(
16
- (f, t) => {
17
- const { scope: a, children: d } = f, r = v(C, a), c = P(t, r.collectionRef);
18
- return /* @__PURE__ */ m(h, { ref: c, children: d });
19
- }
20
- );
21
- p.displayName = C;
22
- const s = e + "CollectionItemSlot", R = "data-radix-collection-item", F = G(s), b = g.forwardRef(
23
- (f, t) => {
24
- const { scope: a, children: d, ...r } = f, c = g.useRef(null), T = P(t, c), w = v(s, a);
25
- return g.useEffect(() => (w.itemMap.set(c, { ref: c, ...r }), () => void w.itemMap.delete(c))), /* @__PURE__ */ m(F, { [R]: "", ref: T, children: d });
26
- }
27
- );
28
- b.displayName = s;
29
- function E(f) {
30
- const t = v(e + "CollectionConsumer", f);
31
- return g.useCallback(() => {
32
- const d = t.collectionRef.current;
33
- if (!d) return [];
34
- const r = Array.from(d.querySelectorAll(`[${R}]`));
35
- return Array.from(t.itemMap.values()).sort(
36
- (w, y) => r.indexOf(w.ref.current) - r.indexOf(y.ref.current)
37
- );
38
- }, [t.collectionRef, t.itemMap]);
39
- }
40
- return [
41
- { Provider: I, Slot: p, ItemSlot: b },
42
- E,
43
- n
44
- ];
45
- }
46
- var X = i.createContext(void 0);
47
- function Z(e) {
48
- const o = i.useContext(X);
49
- return e || o || "ltr";
50
- }
51
- var N = "rovingFocusGroup.onEntryFocus", ee = { bubbles: !1, cancelable: !0 }, x = "RovingFocusGroup", [D, k, te] = W(x), [oe, Ie] = L(
52
- x,
53
- [te]
54
- ), [re, ne] = oe(x), U = i.forwardRef(
55
- (e, o) => /* @__PURE__ */ m(D.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ m(D.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ m(ce, { ...e, ref: o }) }) })
56
- );
57
- U.displayName = x;
58
- var ce = i.forwardRef((e, o) => {
59
- const {
60
- __scopeRovingFocusGroup: u,
61
- orientation: n,
62
- loop: _ = !1,
63
- dir: v,
64
- currentTabStopId: I,
65
- defaultCurrentTabStopId: C,
66
- onCurrentTabStopIdChange: h,
67
- onEntryFocus: p,
68
- preventScrollOnEntryFocus: s = !1,
69
- ...R
70
- } = e, F = i.useRef(null), b = P(o, F), E = Z(v), [f, t] = $({
71
- prop: I,
72
- defaultProp: C ?? null,
73
- onChange: h,
74
- caller: x
75
- }), [a, d] = i.useState(!1), r = Q(p), c = k(u), T = i.useRef(!1), [w, y] = i.useState(0);
76
- return i.useEffect(() => {
77
- const l = F.current;
78
- if (l)
79
- return l.addEventListener(N, r), () => l.removeEventListener(N, r);
80
- }, [r]), /* @__PURE__ */ m(
81
- re,
82
- {
83
- scope: u,
84
- orientation: n,
85
- dir: E,
86
- loop: _,
87
- currentTabStopId: f,
88
- onItemFocus: i.useCallback(
89
- (l) => t(l),
90
- [t]
91
- ),
92
- onItemShiftTab: i.useCallback(() => d(!0), []),
93
- onFocusableItemAdd: i.useCallback(
94
- () => y((l) => l + 1),
95
- []
96
- ),
97
- onFocusableItemRemove: i.useCallback(
98
- () => y((l) => l - 1),
99
- []
100
- ),
101
- children: /* @__PURE__ */ m(
102
- K.div,
103
- {
104
- tabIndex: a || w === 0 ? -1 : 0,
105
- "data-orientation": n,
106
- ...R,
107
- ref: b,
108
- style: { outline: "none", ...e.style },
109
- onMouseDown: A(e.onMouseDown, () => {
110
- T.current = !0;
111
- }),
112
- onFocus: A(e.onFocus, (l) => {
113
- const H = !T.current;
114
- if (l.target === l.currentTarget && H && !a) {
115
- const O = new CustomEvent(N, ee);
116
- if (l.currentTarget.dispatchEvent(O), !O.defaultPrevented) {
117
- const M = c().filter((S) => S.focusable), j = M.find((S) => S.active), q = M.find((S) => S.id === f), z = [j, q, ...M].filter(
118
- Boolean
119
- ).map((S) => S.ref.current);
120
- Y(z, s);
121
- }
122
- }
123
- T.current = !1;
124
- }),
125
- onBlur: A(e.onBlur, () => d(!1))
126
- }
127
- )
128
- }
129
- );
130
- }), B = "RovingFocusGroupItem", V = i.forwardRef(
131
- (e, o) => {
132
- const {
133
- __scopeRovingFocusGroup: u,
134
- focusable: n = !0,
135
- active: _ = !1,
136
- tabStopId: v,
137
- children: I,
138
- ...C
139
- } = e, h = J(), p = v || h, s = ne(B, u), R = s.currentTabStopId === p, F = k(u), { onFocusableItemAdd: b, onFocusableItemRemove: E, currentTabStopId: f } = s;
140
- return i.useEffect(() => {
141
- if (n)
142
- return b(), () => E();
143
- }, [n, b, E]), /* @__PURE__ */ m(
144
- D.ItemSlot,
145
- {
146
- scope: u,
147
- id: p,
148
- focusable: n,
149
- active: _,
150
- children: /* @__PURE__ */ m(
151
- K.span,
152
- {
153
- tabIndex: R ? 0 : -1,
154
- "data-orientation": s.orientation,
155
- ...C,
156
- ref: o,
157
- onMouseDown: A(e.onMouseDown, (t) => {
158
- n ? s.onItemFocus(p) : t.preventDefault();
159
- }),
160
- onFocus: A(e.onFocus, () => s.onItemFocus(p)),
161
- onKeyDown: A(e.onKeyDown, (t) => {
162
- if (t.key === "Tab" && t.shiftKey) {
163
- s.onItemShiftTab();
164
- return;
165
- }
166
- if (t.target !== t.currentTarget) return;
167
- const a = ie(t, s.orientation, s.dir);
168
- if (a !== void 0) {
169
- if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey) return;
170
- t.preventDefault();
171
- let r = F().filter((c) => c.focusable).map((c) => c.ref.current);
172
- if (a === "last") r.reverse();
173
- else if (a === "prev" || a === "next") {
174
- a === "prev" && r.reverse();
175
- const c = r.indexOf(t.currentTarget);
176
- r = s.loop ? ue(r, c + 1) : r.slice(c + 1);
177
- }
178
- setTimeout(() => Y(r));
179
- }
180
- }),
181
- children: typeof I == "function" ? I({ isCurrentTabStop: R, hasTabStop: f != null }) : I
182
- }
183
- )
184
- }
185
- );
186
- }
187
- );
188
- V.displayName = B;
189
- var se = {
190
- ArrowLeft: "prev",
191
- ArrowUp: "prev",
192
- ArrowRight: "next",
193
- ArrowDown: "next",
194
- PageUp: "first",
195
- Home: "first",
196
- PageDown: "last",
197
- End: "last"
198
- };
199
- function ae(e, o) {
200
- return o !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
201
- }
202
- function ie(e, o, u) {
203
- const n = ae(e.key, u);
204
- if (!(o === "vertical" && ["ArrowLeft", "ArrowRight"].includes(n)) && !(o === "horizontal" && ["ArrowUp", "ArrowDown"].includes(n)))
205
- return se[n];
206
- }
207
- function Y(e, o = !1) {
208
- const u = document.activeElement;
209
- for (const n of e)
210
- if (n === u || (n.focus({ preventScroll: o }), document.activeElement !== u)) return;
211
- }
212
- function ue(e, o) {
213
- return e.map((u, n) => e[(o + n) % e.length]);
214
- }
215
- var ve = U, Ce = V;
216
- export {
217
- Ce as I,
218
- ve as R,
219
- W as a,
220
- Ie as c,
221
- Z as u
222
- };
@@ -1,230 +0,0 @@
1
- import * as s from "react";
2
- import { d as P, c as C, u as B, P as b, b as _ } from "./index-z_kiwVc3.js";
3
- import { I as q, u as K, R as T, c as w } from "./index-C8H9A55g.js";
4
- import { u as U } from "./index-Nyh2Wa71.js";
5
- import { u as V } from "./index-BZPx6jYI.js";
6
- import { P as j } from "./index-CfIcUHKK.js";
7
- import { jsx as p, jsxs as z } from "react/jsx-runtime";
8
- var E = "Radio", [H, g] = _(E), [W, X] = H(E), k = s.forwardRef(
9
- (a, d) => {
10
- const {
11
- __scopeRadio: o,
12
- name: i,
13
- checked: e = !1,
14
- required: r,
15
- disabled: n,
16
- value: f = "on",
17
- onCheck: c,
18
- form: R,
19
- ...v
20
- } = a, [l, m] = s.useState(null), t = P(d, (y) => m(y)), u = s.useRef(!1), h = l ? R || !!l.closest("form") : !0;
21
- return /* @__PURE__ */ z(W, { scope: o, checked: e, disabled: n, children: [
22
- /* @__PURE__ */ p(
23
- b.button,
24
- {
25
- type: "button",
26
- role: "radio",
27
- "aria-checked": e,
28
- "data-state": N(e),
29
- "data-disabled": n ? "" : void 0,
30
- disabled: n,
31
- value: f,
32
- ...v,
33
- ref: t,
34
- onClick: C(a.onClick, (y) => {
35
- e || c == null || c(), h && (u.current = y.isPropagationStopped(), u.current || y.stopPropagation());
36
- })
37
- }
38
- ),
39
- h && /* @__PURE__ */ p(
40
- A,
41
- {
42
- control: l,
43
- bubbles: !u.current,
44
- name: i,
45
- value: f,
46
- checked: e,
47
- required: r,
48
- disabled: n,
49
- form: R,
50
- style: { transform: "translateX(-100%)" }
51
- }
52
- )
53
- ] });
54
- }
55
- );
56
- k.displayName = E;
57
- var G = "RadioIndicator", S = s.forwardRef(
58
- (a, d) => {
59
- const { __scopeRadio: o, forceMount: i, ...e } = a, r = X(G, o);
60
- return /* @__PURE__ */ p(j, { present: i || r.checked, children: /* @__PURE__ */ p(
61
- b.span,
62
- {
63
- "data-state": N(r.checked),
64
- "data-disabled": r.disabled ? "" : void 0,
65
- ...e,
66
- ref: d
67
- }
68
- ) });
69
- }
70
- );
71
- S.displayName = G;
72
- var Y = "RadioBubbleInput", A = s.forwardRef(
73
- ({
74
- __scopeRadio: a,
75
- control: d,
76
- checked: o,
77
- bubbles: i = !0,
78
- ...e
79
- }, r) => {
80
- const n = s.useRef(null), f = P(n, r), c = V(o), R = U(d);
81
- return s.useEffect(() => {
82
- const v = n.current;
83
- if (!v) return;
84
- const l = window.HTMLInputElement.prototype, t = Object.getOwnPropertyDescriptor(
85
- l,
86
- "checked"
87
- ).set;
88
- if (c !== o && t) {
89
- const u = new Event("click", { bubbles: i });
90
- t.call(v, o), v.dispatchEvent(u);
91
- }
92
- }, [c, o, i]), /* @__PURE__ */ p(
93
- b.input,
94
- {
95
- type: "radio",
96
- "aria-hidden": !0,
97
- defaultChecked: o,
98
- ...e,
99
- tabIndex: -1,
100
- ref: f,
101
- style: {
102
- ...e.style,
103
- ...R,
104
- position: "absolute",
105
- pointerEvents: "none",
106
- opacity: 0,
107
- margin: 0
108
- }
109
- }
110
- );
111
- }
112
- );
113
- A.displayName = Y;
114
- function N(a) {
115
- return a ? "checked" : "unchecked";
116
- }
117
- var J = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], I = "RadioGroup", [Q] = _(I, [
118
- w,
119
- g
120
- ]), x = w(), D = g(), [Z, $] = Q(I), M = s.forwardRef(
121
- (a, d) => {
122
- const {
123
- __scopeRadioGroup: o,
124
- name: i,
125
- defaultValue: e,
126
- value: r,
127
- required: n = !1,
128
- disabled: f = !1,
129
- orientation: c,
130
- dir: R,
131
- loop: v = !0,
132
- onValueChange: l,
133
- ...m
134
- } = a, t = x(o), u = K(R), [h, y] = B({
135
- prop: r,
136
- defaultProp: e ?? null,
137
- onChange: l,
138
- caller: I
139
- });
140
- return /* @__PURE__ */ p(
141
- Z,
142
- {
143
- scope: o,
144
- name: i,
145
- required: n,
146
- disabled: f,
147
- value: h,
148
- onValueChange: y,
149
- children: /* @__PURE__ */ p(
150
- T,
151
- {
152
- asChild: !0,
153
- ...t,
154
- orientation: c,
155
- dir: u,
156
- loop: v,
157
- children: /* @__PURE__ */ p(
158
- b.div,
159
- {
160
- role: "radiogroup",
161
- "aria-required": n,
162
- "aria-orientation": c,
163
- "data-disabled": f ? "" : void 0,
164
- dir: u,
165
- ...m,
166
- ref: d
167
- }
168
- )
169
- }
170
- )
171
- }
172
- );
173
- }
174
- );
175
- M.displayName = I;
176
- var O = "RadioGroupItem", F = s.forwardRef(
177
- (a, d) => {
178
- const { __scopeRadioGroup: o, disabled: i, ...e } = a, r = $(O, o), n = r.disabled || i, f = x(o), c = D(o), R = s.useRef(null), v = P(d, R), l = r.value === e.value, m = s.useRef(!1);
179
- return s.useEffect(() => {
180
- const t = (h) => {
181
- J.includes(h.key) && (m.current = !0);
182
- }, u = () => m.current = !1;
183
- return document.addEventListener("keydown", t), document.addEventListener("keyup", u), () => {
184
- document.removeEventListener("keydown", t), document.removeEventListener("keyup", u);
185
- };
186
- }, []), /* @__PURE__ */ p(
187
- q,
188
- {
189
- asChild: !0,
190
- ...f,
191
- focusable: !n,
192
- active: l,
193
- children: /* @__PURE__ */ p(
194
- k,
195
- {
196
- disabled: n,
197
- required: r.required,
198
- checked: l,
199
- ...c,
200
- ...e,
201
- name: r.name,
202
- ref: v,
203
- onCheck: () => r.onValueChange(e.value),
204
- onKeyDown: C((t) => {
205
- t.key === "Enter" && t.preventDefault();
206
- }),
207
- onFocus: C(e.onFocus, () => {
208
- var t;
209
- m.current && ((t = R.current) == null || t.click());
210
- })
211
- }
212
- )
213
- }
214
- );
215
- }
216
- );
217
- F.displayName = O;
218
- var ee = "RadioGroupIndicator", L = s.forwardRef(
219
- (a, d) => {
220
- const { __scopeRadioGroup: o, ...i } = a, e = D(o);
221
- return /* @__PURE__ */ p(S, { ...e, ...i, ref: d });
222
- }
223
- );
224
- L.displayName = ee;
225
- var ie = M, de = F, ce = L;
226
- export {
227
- de as I,
228
- ie as R,
229
- ce as a
230
- };
@@ -1,70 +0,0 @@
1
- import * as a from "react";
2
- import { d as T, h as A } from "./index-z_kiwVc3.js";
3
- function E(n, e) {
4
- return a.useReducer((r, t) => e[r][t] ?? r, n);
5
- }
6
- var R = (n) => {
7
- const { present: e, children: r } = n, t = P(e), o = typeof r == "function" ? r({ present: t.isPresent }) : a.Children.only(r), c = T(t.ref, v(o));
8
- return typeof r == "function" || t.isPresent ? a.cloneElement(o, { ref: c }) : null;
9
- };
10
- R.displayName = "Presence";
11
- function P(n) {
12
- const [e, r] = a.useState(), t = a.useRef(null), o = a.useRef(n), c = a.useRef("none"), p = n ? "mounted" : "unmounted", [N, s] = E(p, {
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 = l(t.current);
27
- c.current = N === "mounted" ? i : "none";
28
- }, [N]), A(() => {
29
- const i = t.current, m = o.current;
30
- if (m !== n) {
31
- const f = c.current, u = l(i);
32
- n ? s("MOUNT") : u === "none" || (i == null ? void 0 : i.display) === "none" ? s("UNMOUNT") : s(m && f !== u ? "ANIMATION_OUT" : "UNMOUNT"), o.current = n;
33
- }
34
- }, [n, s]), A(() => {
35
- if (e) {
36
- let i;
37
- const m = e.ownerDocument.defaultView ?? window, d = (u) => {
38
- const g = l(t.current).includes(CSS.escape(u.animationName));
39
- if (u.target === e && g && (s("ANIMATION_END"), !o.current)) {
40
- const O = e.style.animationFillMode;
41
- e.style.animationFillMode = "forwards", i = m.setTimeout(() => {
42
- e.style.animationFillMode === "forwards" && (e.style.animationFillMode = O);
43
- });
44
- }
45
- }, f = (u) => {
46
- u.target === e && (c.current = l(t.current));
47
- };
48
- return e.addEventListener("animationstart", f), e.addEventListener("animationcancel", d), e.addEventListener("animationend", d), () => {
49
- m.clearTimeout(i), e.removeEventListener("animationstart", f), e.removeEventListener("animationcancel", d), e.removeEventListener("animationend", d);
50
- };
51
- } else
52
- s("ANIMATION_END");
53
- }, [e, s]), {
54
- isPresent: ["mounted", "unmountSuspended"].includes(N),
55
- ref: a.useCallback((i) => {
56
- t.current = i ? getComputedStyle(i) : null, r(i);
57
- }, [])
58
- };
59
- }
60
- function l(n) {
61
- return (n == null ? void 0 : n.animationName) || "none";
62
- }
63
- function v(n) {
64
- var t, o;
65
- let e = (t = Object.getOwnPropertyDescriptor(n.props, "ref")) == null ? void 0 : t.get, r = e && "isReactWarning" in e && e.isReactWarning;
66
- return r ? n.ref : (e = (o = Object.getOwnPropertyDescriptor(n, "ref")) == null ? void 0 : o.get, r = e && "isReactWarning" in e && e.isReactWarning, r ? n.props.ref : n.props.ref || n.ref);
67
- }
68
- export {
69
- R as P
70
- };