@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.
- package/README.md +97 -97
- package/dist/RichTextEditor-JH6YBGiw.js +541 -0
- package/dist/{ToastProvider-D5LImZ-Q.js → ToastProvider-DVycF0zU.js} +26 -26
- package/dist/assets/CorusHeader.css +1 -1
- package/dist/assets/Dialog.css +1 -1
- package/dist/assets/Tab.css +1 -1
- package/dist/assets/Tag.css +1 -1
- package/dist/assets/ap-icons-types.d.ts +1 -1
- package/dist/assets/ap-icons.d.ts +1 -1
- package/dist/assets/main.css +1 -1
- package/dist/components/Banner/Banner.d.ts +1 -1
- package/dist/components/Banner/Banner.test.js +1 -1
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.test.js +2 -2
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.js +3 -3
- package/dist/components/Checkbox/Checkbox.test.js +1 -1
- package/dist/components/CorusHeader/CorusHeader.d.ts +1 -1
- package/dist/components/CorusHeader/CorusHeader.js +45 -44
- package/dist/components/CorusHeader/CorusHeader.types.d.ts +1 -0
- package/dist/components/CorusHeader/DropdownItemContent.d.ts +1 -1
- package/dist/components/CorusHeader/DropdownMenu.d.ts +2 -1
- package/dist/components/CorusHeader/DropdownMenu.js +6 -5
- package/dist/components/CorusHeader/MegaMenuContent.d.ts +2 -1
- package/dist/components/CorusHeader/MegaMenuContent.js +11 -10
- package/dist/components/CorusHeader/UserProfileIcon.d.ts +1 -1
- package/dist/components/Creatable/Creatable.d.ts +1 -1
- package/dist/components/Creatable/Creatable.js +1 -1
- package/dist/components/Datepicker/Datepicker.d.ts +1 -1
- package/dist/components/Datepicker/Datepicker.js +1 -1
- package/dist/components/Datepicker/Datepicker.test.js +1 -1
- package/dist/components/Dialog/Dialog.d.ts +8 -2
- package/dist/components/Dialog/Dialog.js +183 -203
- package/dist/components/Dialog/Dialog.test.js +227 -202
- package/dist/components/DragAndDrop/DragAndDrop.d.ts +1 -1
- package/dist/components/DragAndDrop/DragAndDrop.test.js +2 -2
- package/dist/components/Dropdown/Dropdown.d.ts +3 -1
- package/dist/components/Dropdown/Dropdown.js +179 -172
- package/dist/components/FilePicker/FilePicker.d.ts +9 -9
- package/dist/components/FilePicker/FilePicker.test.js +2 -2
- package/dist/components/Ghost/Ghost.d.ts +1 -1
- package/dist/components/Ghost/Ghost.test.js +1 -1
- package/dist/components/Icon/Icon.d.ts +1 -1
- package/dist/components/Icons/IconsGallery.d.ts +1 -1
- package/dist/components/Icons/IconsGallery.js +1 -1
- package/dist/components/Illustration/Illustration.d.ts +1 -1
- package/dist/components/Illustration/Illustration.test.js +1 -1
- package/dist/components/Input/Input.test.js +1 -1
- package/dist/components/Logo/Logo.d.ts +1 -1
- package/dist/components/Logos/LogosGallery.d.ts +1 -1
- package/dist/components/NavBar/NavBar.d.ts +1 -1
- package/dist/components/NavBar/NavBar.js +1 -1
- package/dist/components/Radio/Radio.d.ts +1 -1
- package/dist/components/Radio/Radio.js +9 -9
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +11 -11
- package/dist/components/RadioGroup/RadioGroup.test.js +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.d.ts +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.js +2 -2
- package/dist/components/RichTextEditor/RichTextEditor.test.js +2 -2
- package/dist/components/Search/Search.d.ts +1 -1
- package/dist/components/Search/Search.test.js +1 -1
- package/dist/components/Spinner/Spinner.d.ts +1 -1
- package/dist/components/SplitButton/SplitButton.d.ts +1 -1
- package/dist/components/SplitButton/SplitButton.js +3 -3
- package/dist/components/SplitButton/SplitButton.test.js +1 -1
- package/dist/components/Tab/Tab.d.ts +5 -1
- package/dist/components/Tab/Tab.js +28 -24
- package/dist/components/TabNavigation/TabNavigation.d.ts +1 -1
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/Tag/Tag.test.js +1 -1
- package/dist/components/TagsFields/TagsFields.d.ts +1 -1
- package/dist/components/TagsFields/TagsFields.js +1 -1
- package/dist/components/Textarea/Textarea.d.ts +1 -1
- package/dist/components/Textarea/Textarea.test.js +1 -1
- package/dist/components/Toast/Toast.test.js +1 -1
- package/dist/components/ToastProvider/ToastProvider.d.ts +2 -1
- package/dist/components/ToastProvider/ToastProvider.js +1 -1
- package/dist/components/ToastProvider/ToastProvider.test.js +4 -4
- package/dist/components/Toggle/Toggle.d.ts +1 -1
- package/dist/components/Toggle/Toggle.js +211 -126
- package/dist/components/Toggle/Toggle.test.js +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.js +60 -61
- package/dist/{index-C2s_VtSb.js → index-6DGSlWJb.js} +3 -3
- package/dist/{index-Nyh2Wa71.js → index-6j3vTf--.js} +5 -5
- package/dist/index-B4szHVNJ.js +248 -0
- package/dist/{index-CFqDEbIR.js → index-BVZdJVFB.js} +192 -191
- package/dist/index-Bq1FiX6B.js +93 -0
- package/dist/index-CE9NpYQR.js +604 -0
- package/dist/index-CHy8gqvu.js +353 -0
- package/dist/index-CarlZuEo.js +1610 -0
- package/dist/{index-CCFDXH-J.js → index-CcsZYEYy.js} +29 -28
- package/dist/index-DH9SO8qV.js +221 -0
- package/dist/{index-D_L0ncPJ.js → index-IR8HlW5P.js} +4 -4
- package/dist/{index-DkTDHhag.js → index-banDzeKa.js} +1 -1
- package/dist/index-kgC_DL6e.js +216 -0
- package/dist/main.js +3 -3
- package/dist/storybook-docs-page.d.ts +1 -1
- package/dist/{useToast-Cz5MGKnw.js → useToast-CpwrYPvx.js} +1 -1
- package/dist/{vi.bdSIJ99Y-017e_Pkz.js → vi.bdSIJ99Y-DWCVXj6K.js} +3 -3
- package/dist/web.config +8 -8
- package/package.json +94 -94
- package/dist/RichTextEditor-kTQEDSL0.js +0 -477
- package/dist/index-C8H9A55g.js +0 -222
- package/dist/index-CCnm5-ML.js +0 -230
- package/dist/index-CfIcUHKK.js +0 -70
- package/dist/index-ChQc_Cm6.js +0 -1544
- package/dist/index-CmGGeUr0.js +0 -142
- package/dist/index-Ii4UOx3H.js +0 -599
- package/dist/index-z_kiwVc3.js +0 -237
package/dist/index-Ii4UOx3H.js
DELETED
|
@@ -1,599 +0,0 @@
|
|
|
1
|
-
import * as r from "react";
|
|
2
|
-
import { d as N, c as v, b as je, P as F, i as He, e as We, a as ze } from "./index-z_kiwVc3.js";
|
|
3
|
-
import { u as Ze, c as pe, a as $e, I as qe, R as Je } from "./index-C8H9A55g.js";
|
|
4
|
-
import { P as Qe, D as et } from "./index-CmGGeUr0.js";
|
|
5
|
-
import { h as tt, u as nt, R as ot, F as rt } from "./index-CFqDEbIR.js";
|
|
6
|
-
import { R as ct, A as at, c as ve, C as st, a as ut } from "./index-ChQc_Cm6.js";
|
|
7
|
-
import { P as H } from "./index-CfIcUHKK.js";
|
|
8
|
-
import { a as Me } from "./index-C2s_VtSb.js";
|
|
9
|
-
import { jsx as u } from "react/jsx-runtime";
|
|
10
|
-
var Q = ["Enter", " "], it = ["ArrowDown", "PageUp", "Home"], he = ["ArrowUp", "PageDown", "End"], lt = [...it, ...he], dt = {
|
|
11
|
-
ltr: [...Q, "ArrowRight"],
|
|
12
|
-
rtl: [...Q, "ArrowLeft"]
|
|
13
|
-
}, ft = {
|
|
14
|
-
ltr: ["ArrowLeft"],
|
|
15
|
-
rtl: ["ArrowRight"]
|
|
16
|
-
}, L = "Menu", [O, mt, pt] = $e(L), [w, jt] = je(L, [
|
|
17
|
-
pt,
|
|
18
|
-
ve,
|
|
19
|
-
pe
|
|
20
|
-
]), W = ve(), Ce = pe(), [vt, I] = w(L), [Mt, K] = w(L), ge = (e) => {
|
|
21
|
-
const { __scopeMenu: n, open: t = !1, children: o, dir: s, onOpenChange: c, modal: d = !0 } = e, p = W(n), [M, m] = r.useState(null), f = r.useRef(!1), a = Me(c), l = Ze(s);
|
|
22
|
-
return r.useEffect(() => {
|
|
23
|
-
const C = () => {
|
|
24
|
-
f.current = !0, document.addEventListener("pointerdown", h, { capture: !0, once: !0 }), document.addEventListener("pointermove", h, { capture: !0, once: !0 });
|
|
25
|
-
}, h = () => f.current = !1;
|
|
26
|
-
return document.addEventListener("keydown", C, { capture: !0 }), () => {
|
|
27
|
-
document.removeEventListener("keydown", C, { capture: !0 }), document.removeEventListener("pointerdown", h, { capture: !0 }), document.removeEventListener("pointermove", h, { capture: !0 });
|
|
28
|
-
};
|
|
29
|
-
}, []), /* @__PURE__ */ u(ct, { ...p, children: /* @__PURE__ */ u(
|
|
30
|
-
vt,
|
|
31
|
-
{
|
|
32
|
-
scope: n,
|
|
33
|
-
open: t,
|
|
34
|
-
onOpenChange: a,
|
|
35
|
-
content: M,
|
|
36
|
-
onContentChange: m,
|
|
37
|
-
children: /* @__PURE__ */ u(
|
|
38
|
-
Mt,
|
|
39
|
-
{
|
|
40
|
-
scope: n,
|
|
41
|
-
onClose: r.useCallback(() => a(!1), [a]),
|
|
42
|
-
isUsingKeyboardRef: f,
|
|
43
|
-
dir: l,
|
|
44
|
-
modal: d,
|
|
45
|
-
children: o
|
|
46
|
-
}
|
|
47
|
-
)
|
|
48
|
-
}
|
|
49
|
-
) });
|
|
50
|
-
};
|
|
51
|
-
ge.displayName = L;
|
|
52
|
-
var ht = "MenuAnchor", ee = r.forwardRef(
|
|
53
|
-
(e, n) => {
|
|
54
|
-
const { __scopeMenu: t, ...o } = e, s = W(t);
|
|
55
|
-
return /* @__PURE__ */ u(at, { ...s, ...o, ref: n });
|
|
56
|
-
}
|
|
57
|
-
);
|
|
58
|
-
ee.displayName = ht;
|
|
59
|
-
var te = "MenuPortal", [Ct, _e] = w(te, {
|
|
60
|
-
forceMount: void 0
|
|
61
|
-
}), Re = (e) => {
|
|
62
|
-
const { __scopeMenu: n, forceMount: t, children: o, container: s } = e, c = I(te, n);
|
|
63
|
-
return /* @__PURE__ */ u(Ct, { scope: n, forceMount: t, children: /* @__PURE__ */ u(H, { present: t || c.open, children: /* @__PURE__ */ u(Qe, { asChild: !0, container: s, children: o }) }) });
|
|
64
|
-
};
|
|
65
|
-
Re.displayName = te;
|
|
66
|
-
var _ = "MenuContent", [gt, ne] = w(_), Pe = r.forwardRef(
|
|
67
|
-
(e, n) => {
|
|
68
|
-
const t = _e(_, e.__scopeMenu), { forceMount: o = t.forceMount, ...s } = e, c = I(_, e.__scopeMenu), d = K(_, e.__scopeMenu);
|
|
69
|
-
return /* @__PURE__ */ u(O.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ u(H, { present: o || c.open, children: /* @__PURE__ */ u(O.Slot, { scope: e.__scopeMenu, children: d.modal ? /* @__PURE__ */ u(_t, { ...s, ref: n }) : /* @__PURE__ */ u(Rt, { ...s, ref: n }) }) }) });
|
|
70
|
-
}
|
|
71
|
-
), _t = r.forwardRef(
|
|
72
|
-
(e, n) => {
|
|
73
|
-
const t = I(_, e.__scopeMenu), o = r.useRef(null), s = N(n, o);
|
|
74
|
-
return r.useEffect(() => {
|
|
75
|
-
const c = o.current;
|
|
76
|
-
if (c) return tt(c);
|
|
77
|
-
}, []), /* @__PURE__ */ u(
|
|
78
|
-
oe,
|
|
79
|
-
{
|
|
80
|
-
...e,
|
|
81
|
-
ref: s,
|
|
82
|
-
trapFocus: t.open,
|
|
83
|
-
disableOutsidePointerEvents: t.open,
|
|
84
|
-
disableOutsideScroll: !0,
|
|
85
|
-
onFocusOutside: v(
|
|
86
|
-
e.onFocusOutside,
|
|
87
|
-
(c) => c.preventDefault(),
|
|
88
|
-
{ checkForDefaultPrevented: !1 }
|
|
89
|
-
),
|
|
90
|
-
onDismiss: () => t.onOpenChange(!1)
|
|
91
|
-
}
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
), Rt = r.forwardRef((e, n) => {
|
|
95
|
-
const t = I(_, e.__scopeMenu);
|
|
96
|
-
return /* @__PURE__ */ u(
|
|
97
|
-
oe,
|
|
98
|
-
{
|
|
99
|
-
...e,
|
|
100
|
-
ref: n,
|
|
101
|
-
trapFocus: !1,
|
|
102
|
-
disableOutsidePointerEvents: !1,
|
|
103
|
-
disableOutsideScroll: !1,
|
|
104
|
-
onDismiss: () => t.onOpenChange(!1)
|
|
105
|
-
}
|
|
106
|
-
);
|
|
107
|
-
}), Pt = We("MenuContent.ScrollLock"), oe = r.forwardRef(
|
|
108
|
-
(e, n) => {
|
|
109
|
-
const {
|
|
110
|
-
__scopeMenu: t,
|
|
111
|
-
loop: o = !1,
|
|
112
|
-
trapFocus: s,
|
|
113
|
-
onOpenAutoFocus: c,
|
|
114
|
-
onCloseAutoFocus: d,
|
|
115
|
-
disableOutsidePointerEvents: p,
|
|
116
|
-
onEntryFocus: M,
|
|
117
|
-
onEscapeKeyDown: m,
|
|
118
|
-
onPointerDownOutside: f,
|
|
119
|
-
onFocusOutside: a,
|
|
120
|
-
onInteractOutside: l,
|
|
121
|
-
onDismiss: C,
|
|
122
|
-
disableOutsideScroll: h,
|
|
123
|
-
...S
|
|
124
|
-
} = e, y = I(_, t), T = K(_, t), G = W(t), U = Ce(t), se = mt(t), [Ge, ue] = r.useState(null), B = r.useRef(null), Ue = N(n, B, y.onContentChange), V = r.useRef(0), Y = r.useRef(""), Be = r.useRef(0), Z = r.useRef(null), ie = r.useRef("right"), $ = r.useRef(0), Ve = h ? ot : r.Fragment, Ye = h ? { as: Pt, allowPinchZoom: !0 } : void 0, Xe = (i) => {
|
|
125
|
-
var x, de;
|
|
126
|
-
const g = Y.current + i, R = se().filter((P) => !P.disabled), E = document.activeElement, q = (x = R.find((P) => P.ref.current === E)) == null ? void 0 : x.textValue, J = R.map((P) => P.textValue), le = kt(J, g, q), A = (de = R.find((P) => P.textValue === le)) == null ? void 0 : de.ref.current;
|
|
127
|
-
(function P(fe) {
|
|
128
|
-
Y.current = fe, window.clearTimeout(V.current), fe !== "" && (V.current = window.setTimeout(() => P(""), 1e3));
|
|
129
|
-
})(g), A && setTimeout(() => A.focus());
|
|
130
|
-
};
|
|
131
|
-
r.useEffect(() => () => window.clearTimeout(V.current), []), nt();
|
|
132
|
-
const b = r.useCallback((i) => {
|
|
133
|
-
var R, E;
|
|
134
|
-
return ie.current === ((R = Z.current) == null ? void 0 : R.side) && Ft(i, (E = Z.current) == null ? void 0 : E.area);
|
|
135
|
-
}, []);
|
|
136
|
-
return /* @__PURE__ */ u(
|
|
137
|
-
gt,
|
|
138
|
-
{
|
|
139
|
-
scope: t,
|
|
140
|
-
searchRef: Y,
|
|
141
|
-
onItemEnter: r.useCallback(
|
|
142
|
-
(i) => {
|
|
143
|
-
b(i) && i.preventDefault();
|
|
144
|
-
},
|
|
145
|
-
[b]
|
|
146
|
-
),
|
|
147
|
-
onItemLeave: r.useCallback(
|
|
148
|
-
(i) => {
|
|
149
|
-
var g;
|
|
150
|
-
b(i) || ((g = B.current) == null || g.focus(), ue(null));
|
|
151
|
-
},
|
|
152
|
-
[b]
|
|
153
|
-
),
|
|
154
|
-
onTriggerLeave: r.useCallback(
|
|
155
|
-
(i) => {
|
|
156
|
-
b(i) && i.preventDefault();
|
|
157
|
-
},
|
|
158
|
-
[b]
|
|
159
|
-
),
|
|
160
|
-
pointerGraceTimerRef: Be,
|
|
161
|
-
onPointerGraceIntentChange: r.useCallback((i) => {
|
|
162
|
-
Z.current = i;
|
|
163
|
-
}, []),
|
|
164
|
-
children: /* @__PURE__ */ u(Ve, { ...Ye, children: /* @__PURE__ */ u(
|
|
165
|
-
rt,
|
|
166
|
-
{
|
|
167
|
-
asChild: !0,
|
|
168
|
-
trapped: s,
|
|
169
|
-
onMountAutoFocus: v(c, (i) => {
|
|
170
|
-
var g;
|
|
171
|
-
i.preventDefault(), (g = B.current) == null || g.focus({ preventScroll: !0 });
|
|
172
|
-
}),
|
|
173
|
-
onUnmountAutoFocus: d,
|
|
174
|
-
children: /* @__PURE__ */ u(
|
|
175
|
-
et,
|
|
176
|
-
{
|
|
177
|
-
asChild: !0,
|
|
178
|
-
disableOutsidePointerEvents: p,
|
|
179
|
-
onEscapeKeyDown: m,
|
|
180
|
-
onPointerDownOutside: f,
|
|
181
|
-
onFocusOutside: a,
|
|
182
|
-
onInteractOutside: l,
|
|
183
|
-
onDismiss: C,
|
|
184
|
-
children: /* @__PURE__ */ u(
|
|
185
|
-
Je,
|
|
186
|
-
{
|
|
187
|
-
asChild: !0,
|
|
188
|
-
...U,
|
|
189
|
-
dir: T.dir,
|
|
190
|
-
orientation: "vertical",
|
|
191
|
-
loop: o,
|
|
192
|
-
currentTabStopId: Ge,
|
|
193
|
-
onCurrentTabStopIdChange: ue,
|
|
194
|
-
onEntryFocus: v(M, (i) => {
|
|
195
|
-
T.isUsingKeyboardRef.current || i.preventDefault();
|
|
196
|
-
}),
|
|
197
|
-
preventScrollOnEntryFocus: !0,
|
|
198
|
-
children: /* @__PURE__ */ u(
|
|
199
|
-
st,
|
|
200
|
-
{
|
|
201
|
-
role: "menu",
|
|
202
|
-
"aria-orientation": "vertical",
|
|
203
|
-
"data-state": Ke(y.open),
|
|
204
|
-
"data-radix-menu-content": "",
|
|
205
|
-
dir: T.dir,
|
|
206
|
-
...G,
|
|
207
|
-
...S,
|
|
208
|
-
ref: Ue,
|
|
209
|
-
style: { outline: "none", ...S.style },
|
|
210
|
-
onKeyDown: v(S.onKeyDown, (i) => {
|
|
211
|
-
const R = i.target.closest("[data-radix-menu-content]") === i.currentTarget, E = i.ctrlKey || i.altKey || i.metaKey, q = i.key.length === 1;
|
|
212
|
-
R && (i.key === "Tab" && i.preventDefault(), !E && q && Xe(i.key));
|
|
213
|
-
const J = B.current;
|
|
214
|
-
if (i.target !== J || !lt.includes(i.key)) return;
|
|
215
|
-
i.preventDefault();
|
|
216
|
-
const A = se().filter((x) => !x.disabled).map((x) => x.ref.current);
|
|
217
|
-
he.includes(i.key) && A.reverse(), Dt(A);
|
|
218
|
-
}),
|
|
219
|
-
onBlur: v(e.onBlur, (i) => {
|
|
220
|
-
i.currentTarget.contains(i.target) || (window.clearTimeout(V.current), Y.current = "");
|
|
221
|
-
}),
|
|
222
|
-
onPointerMove: v(
|
|
223
|
-
e.onPointerMove,
|
|
224
|
-
k((i) => {
|
|
225
|
-
const g = i.target, R = $.current !== i.clientX;
|
|
226
|
-
if (i.currentTarget.contains(g) && R) {
|
|
227
|
-
const E = i.clientX > $.current ? "right" : "left";
|
|
228
|
-
ie.current = E, $.current = i.clientX;
|
|
229
|
-
}
|
|
230
|
-
})
|
|
231
|
-
)
|
|
232
|
-
}
|
|
233
|
-
)
|
|
234
|
-
}
|
|
235
|
-
)
|
|
236
|
-
}
|
|
237
|
-
)
|
|
238
|
-
}
|
|
239
|
-
) })
|
|
240
|
-
}
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
);
|
|
244
|
-
Pe.displayName = _;
|
|
245
|
-
var Et = "MenuGroup", re = r.forwardRef(
|
|
246
|
-
(e, n) => {
|
|
247
|
-
const { __scopeMenu: t, ...o } = e;
|
|
248
|
-
return /* @__PURE__ */ u(F.div, { role: "group", ...o, ref: n });
|
|
249
|
-
}
|
|
250
|
-
);
|
|
251
|
-
re.displayName = Et;
|
|
252
|
-
var St = "MenuLabel", Ee = r.forwardRef(
|
|
253
|
-
(e, n) => {
|
|
254
|
-
const { __scopeMenu: t, ...o } = e;
|
|
255
|
-
return /* @__PURE__ */ u(F.div, { ...o, ref: n });
|
|
256
|
-
}
|
|
257
|
-
);
|
|
258
|
-
Ee.displayName = St;
|
|
259
|
-
var X = "MenuItem", me = "menu.itemSelect", z = r.forwardRef(
|
|
260
|
-
(e, n) => {
|
|
261
|
-
const { disabled: t = !1, onSelect: o, ...s } = e, c = r.useRef(null), d = K(X, e.__scopeMenu), p = ne(X, e.__scopeMenu), M = N(n, c), m = r.useRef(!1), f = () => {
|
|
262
|
-
const a = c.current;
|
|
263
|
-
if (!t && a) {
|
|
264
|
-
const l = new CustomEvent(me, { bubbles: !0, cancelable: !0 });
|
|
265
|
-
a.addEventListener(me, (C) => o == null ? void 0 : o(C), { once: !0 }), He(a, l), l.defaultPrevented ? m.current = !1 : d.onClose();
|
|
266
|
-
}
|
|
267
|
-
};
|
|
268
|
-
return /* @__PURE__ */ u(
|
|
269
|
-
Se,
|
|
270
|
-
{
|
|
271
|
-
...s,
|
|
272
|
-
ref: M,
|
|
273
|
-
disabled: t,
|
|
274
|
-
onClick: v(e.onClick, f),
|
|
275
|
-
onPointerDown: (a) => {
|
|
276
|
-
var l;
|
|
277
|
-
(l = e.onPointerDown) == null || l.call(e, a), m.current = !0;
|
|
278
|
-
},
|
|
279
|
-
onPointerUp: v(e.onPointerUp, (a) => {
|
|
280
|
-
var l;
|
|
281
|
-
m.current || (l = a.currentTarget) == null || l.click();
|
|
282
|
-
}),
|
|
283
|
-
onKeyDown: v(e.onKeyDown, (a) => {
|
|
284
|
-
const l = p.searchRef.current !== "";
|
|
285
|
-
t || l && a.key === " " || Q.includes(a.key) && (a.currentTarget.click(), a.preventDefault());
|
|
286
|
-
})
|
|
287
|
-
}
|
|
288
|
-
);
|
|
289
|
-
}
|
|
290
|
-
);
|
|
291
|
-
z.displayName = X;
|
|
292
|
-
var Se = r.forwardRef(
|
|
293
|
-
(e, n) => {
|
|
294
|
-
const { __scopeMenu: t, disabled: o = !1, textValue: s, ...c } = e, d = ne(X, t), p = Ce(t), M = r.useRef(null), m = N(n, M), [f, a] = r.useState(!1), [l, C] = r.useState("");
|
|
295
|
-
return r.useEffect(() => {
|
|
296
|
-
const h = M.current;
|
|
297
|
-
h && C((h.textContent ?? "").trim());
|
|
298
|
-
}, [c.children]), /* @__PURE__ */ u(
|
|
299
|
-
O.ItemSlot,
|
|
300
|
-
{
|
|
301
|
-
scope: t,
|
|
302
|
-
disabled: o,
|
|
303
|
-
textValue: s ?? l,
|
|
304
|
-
children: /* @__PURE__ */ u(qe, { asChild: !0, ...p, focusable: !o, children: /* @__PURE__ */ u(
|
|
305
|
-
F.div,
|
|
306
|
-
{
|
|
307
|
-
role: "menuitem",
|
|
308
|
-
"data-highlighted": f ? "" : void 0,
|
|
309
|
-
"aria-disabled": o || void 0,
|
|
310
|
-
"data-disabled": o ? "" : void 0,
|
|
311
|
-
...c,
|
|
312
|
-
ref: m,
|
|
313
|
-
onPointerMove: v(
|
|
314
|
-
e.onPointerMove,
|
|
315
|
-
k((h) => {
|
|
316
|
-
o ? d.onItemLeave(h) : (d.onItemEnter(h), h.defaultPrevented || h.currentTarget.focus({ preventScroll: !0 }));
|
|
317
|
-
})
|
|
318
|
-
),
|
|
319
|
-
onPointerLeave: v(
|
|
320
|
-
e.onPointerLeave,
|
|
321
|
-
k((h) => d.onItemLeave(h))
|
|
322
|
-
),
|
|
323
|
-
onFocus: v(e.onFocus, () => a(!0)),
|
|
324
|
-
onBlur: v(e.onBlur, () => a(!1))
|
|
325
|
-
}
|
|
326
|
-
) })
|
|
327
|
-
}
|
|
328
|
-
);
|
|
329
|
-
}
|
|
330
|
-
), wt = "MenuCheckboxItem", we = r.forwardRef(
|
|
331
|
-
(e, n) => {
|
|
332
|
-
const { checked: t = !1, onCheckedChange: o, ...s } = e;
|
|
333
|
-
return /* @__PURE__ */ u(Te, { scope: e.__scopeMenu, checked: t, children: /* @__PURE__ */ u(
|
|
334
|
-
z,
|
|
335
|
-
{
|
|
336
|
-
role: "menuitemcheckbox",
|
|
337
|
-
"aria-checked": j(t) ? "mixed" : t,
|
|
338
|
-
...s,
|
|
339
|
-
ref: n,
|
|
340
|
-
"data-state": ae(t),
|
|
341
|
-
onSelect: v(
|
|
342
|
-
s.onSelect,
|
|
343
|
-
() => o == null ? void 0 : o(j(t) ? !0 : !t),
|
|
344
|
-
{ checkForDefaultPrevented: !1 }
|
|
345
|
-
)
|
|
346
|
-
}
|
|
347
|
-
) });
|
|
348
|
-
}
|
|
349
|
-
);
|
|
350
|
-
we.displayName = wt;
|
|
351
|
-
var Ie = "MenuRadioGroup", [It, yt] = w(
|
|
352
|
-
Ie,
|
|
353
|
-
{ value: void 0, onValueChange: () => {
|
|
354
|
-
} }
|
|
355
|
-
), ye = r.forwardRef(
|
|
356
|
-
(e, n) => {
|
|
357
|
-
const { value: t, onValueChange: o, ...s } = e, c = Me(o);
|
|
358
|
-
return /* @__PURE__ */ u(It, { scope: e.__scopeMenu, value: t, onValueChange: c, children: /* @__PURE__ */ u(re, { ...s, ref: n }) });
|
|
359
|
-
}
|
|
360
|
-
);
|
|
361
|
-
ye.displayName = Ie;
|
|
362
|
-
var be = "MenuRadioItem", xe = r.forwardRef(
|
|
363
|
-
(e, n) => {
|
|
364
|
-
const { value: t, ...o } = e, s = yt(be, e.__scopeMenu), c = t === s.value;
|
|
365
|
-
return /* @__PURE__ */ u(Te, { scope: e.__scopeMenu, checked: c, children: /* @__PURE__ */ u(
|
|
366
|
-
z,
|
|
367
|
-
{
|
|
368
|
-
role: "menuitemradio",
|
|
369
|
-
"aria-checked": c,
|
|
370
|
-
...o,
|
|
371
|
-
ref: n,
|
|
372
|
-
"data-state": ae(c),
|
|
373
|
-
onSelect: v(
|
|
374
|
-
o.onSelect,
|
|
375
|
-
() => {
|
|
376
|
-
var d;
|
|
377
|
-
return (d = s.onValueChange) == null ? void 0 : d.call(s, t);
|
|
378
|
-
},
|
|
379
|
-
{ checkForDefaultPrevented: !1 }
|
|
380
|
-
)
|
|
381
|
-
}
|
|
382
|
-
) });
|
|
383
|
-
}
|
|
384
|
-
);
|
|
385
|
-
xe.displayName = be;
|
|
386
|
-
var ce = "MenuItemIndicator", [Te, bt] = w(
|
|
387
|
-
ce,
|
|
388
|
-
{ checked: !1 }
|
|
389
|
-
), Ae = r.forwardRef(
|
|
390
|
-
(e, n) => {
|
|
391
|
-
const { __scopeMenu: t, forceMount: o, ...s } = e, c = bt(ce, t);
|
|
392
|
-
return /* @__PURE__ */ u(
|
|
393
|
-
H,
|
|
394
|
-
{
|
|
395
|
-
present: o || j(c.checked) || c.checked === !0,
|
|
396
|
-
children: /* @__PURE__ */ u(
|
|
397
|
-
F.span,
|
|
398
|
-
{
|
|
399
|
-
...s,
|
|
400
|
-
ref: n,
|
|
401
|
-
"data-state": ae(c.checked)
|
|
402
|
-
}
|
|
403
|
-
)
|
|
404
|
-
}
|
|
405
|
-
);
|
|
406
|
-
}
|
|
407
|
-
);
|
|
408
|
-
Ae.displayName = ce;
|
|
409
|
-
var xt = "MenuSeparator", De = r.forwardRef(
|
|
410
|
-
(e, n) => {
|
|
411
|
-
const { __scopeMenu: t, ...o } = e;
|
|
412
|
-
return /* @__PURE__ */ u(
|
|
413
|
-
F.div,
|
|
414
|
-
{
|
|
415
|
-
role: "separator",
|
|
416
|
-
"aria-orientation": "horizontal",
|
|
417
|
-
...o,
|
|
418
|
-
ref: n
|
|
419
|
-
}
|
|
420
|
-
);
|
|
421
|
-
}
|
|
422
|
-
);
|
|
423
|
-
De.displayName = xt;
|
|
424
|
-
var Tt = "MenuArrow", Oe = r.forwardRef(
|
|
425
|
-
(e, n) => {
|
|
426
|
-
const { __scopeMenu: t, ...o } = e, s = W(t);
|
|
427
|
-
return /* @__PURE__ */ u(ut, { ...s, ...o, ref: n });
|
|
428
|
-
}
|
|
429
|
-
);
|
|
430
|
-
Oe.displayName = Tt;
|
|
431
|
-
var At = "MenuSub", [Ht, ke] = w(At), D = "MenuSubTrigger", Ne = r.forwardRef(
|
|
432
|
-
(e, n) => {
|
|
433
|
-
const t = I(D, e.__scopeMenu), o = K(D, e.__scopeMenu), s = ke(D, e.__scopeMenu), c = ne(D, e.__scopeMenu), d = r.useRef(null), { pointerGraceTimerRef: p, onPointerGraceIntentChange: M } = c, m = { __scopeMenu: e.__scopeMenu }, f = r.useCallback(() => {
|
|
434
|
-
d.current && window.clearTimeout(d.current), d.current = null;
|
|
435
|
-
}, []);
|
|
436
|
-
return r.useEffect(() => f, [f]), r.useEffect(() => {
|
|
437
|
-
const a = p.current;
|
|
438
|
-
return () => {
|
|
439
|
-
window.clearTimeout(a), M(null);
|
|
440
|
-
};
|
|
441
|
-
}, [p, M]), /* @__PURE__ */ u(ee, { asChild: !0, ...m, children: /* @__PURE__ */ u(
|
|
442
|
-
Se,
|
|
443
|
-
{
|
|
444
|
-
id: s.triggerId,
|
|
445
|
-
"aria-haspopup": "menu",
|
|
446
|
-
"aria-expanded": t.open,
|
|
447
|
-
"aria-controls": s.contentId,
|
|
448
|
-
"data-state": Ke(t.open),
|
|
449
|
-
...e,
|
|
450
|
-
ref: ze(n, s.onTriggerChange),
|
|
451
|
-
onClick: (a) => {
|
|
452
|
-
var l;
|
|
453
|
-
(l = e.onClick) == null || l.call(e, a), !(e.disabled || a.defaultPrevented) && (a.currentTarget.focus(), t.open || t.onOpenChange(!0));
|
|
454
|
-
},
|
|
455
|
-
onPointerMove: v(
|
|
456
|
-
e.onPointerMove,
|
|
457
|
-
k((a) => {
|
|
458
|
-
c.onItemEnter(a), !a.defaultPrevented && !e.disabled && !t.open && !d.current && (c.onPointerGraceIntentChange(null), d.current = window.setTimeout(() => {
|
|
459
|
-
t.onOpenChange(!0), f();
|
|
460
|
-
}, 100));
|
|
461
|
-
})
|
|
462
|
-
),
|
|
463
|
-
onPointerLeave: v(
|
|
464
|
-
e.onPointerLeave,
|
|
465
|
-
k((a) => {
|
|
466
|
-
var C, h;
|
|
467
|
-
f();
|
|
468
|
-
const l = (C = t.content) == null ? void 0 : C.getBoundingClientRect();
|
|
469
|
-
if (l) {
|
|
470
|
-
const S = (h = t.content) == null ? void 0 : h.dataset.side, y = S === "right", T = y ? -5 : 5, G = l[y ? "left" : "right"], U = l[y ? "right" : "left"];
|
|
471
|
-
c.onPointerGraceIntentChange({
|
|
472
|
-
area: [
|
|
473
|
-
// Apply a bleed on clientX to ensure that our exit point is
|
|
474
|
-
// consistently within polygon bounds
|
|
475
|
-
{ x: a.clientX + T, y: a.clientY },
|
|
476
|
-
{ x: G, y: l.top },
|
|
477
|
-
{ x: U, y: l.top },
|
|
478
|
-
{ x: U, y: l.bottom },
|
|
479
|
-
{ x: G, y: l.bottom }
|
|
480
|
-
],
|
|
481
|
-
side: S
|
|
482
|
-
}), window.clearTimeout(p.current), p.current = window.setTimeout(
|
|
483
|
-
() => c.onPointerGraceIntentChange(null),
|
|
484
|
-
300
|
|
485
|
-
);
|
|
486
|
-
} else {
|
|
487
|
-
if (c.onTriggerLeave(a), a.defaultPrevented) return;
|
|
488
|
-
c.onPointerGraceIntentChange(null);
|
|
489
|
-
}
|
|
490
|
-
})
|
|
491
|
-
),
|
|
492
|
-
onKeyDown: v(e.onKeyDown, (a) => {
|
|
493
|
-
var C;
|
|
494
|
-
const l = c.searchRef.current !== "";
|
|
495
|
-
e.disabled || l && a.key === " " || dt[o.dir].includes(a.key) && (t.onOpenChange(!0), (C = t.content) == null || C.focus(), a.preventDefault());
|
|
496
|
-
})
|
|
497
|
-
}
|
|
498
|
-
) });
|
|
499
|
-
}
|
|
500
|
-
);
|
|
501
|
-
Ne.displayName = D;
|
|
502
|
-
var Fe = "MenuSubContent", Le = r.forwardRef(
|
|
503
|
-
(e, n) => {
|
|
504
|
-
const t = _e(_, e.__scopeMenu), { forceMount: o = t.forceMount, ...s } = e, c = I(_, e.__scopeMenu), d = K(_, e.__scopeMenu), p = ke(Fe, e.__scopeMenu), M = r.useRef(null), m = N(n, M);
|
|
505
|
-
return /* @__PURE__ */ u(O.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ u(H, { present: o || c.open, children: /* @__PURE__ */ u(O.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ u(
|
|
506
|
-
oe,
|
|
507
|
-
{
|
|
508
|
-
id: p.contentId,
|
|
509
|
-
"aria-labelledby": p.triggerId,
|
|
510
|
-
...s,
|
|
511
|
-
ref: m,
|
|
512
|
-
align: "start",
|
|
513
|
-
side: d.dir === "rtl" ? "left" : "right",
|
|
514
|
-
disableOutsidePointerEvents: !1,
|
|
515
|
-
disableOutsideScroll: !1,
|
|
516
|
-
trapFocus: !1,
|
|
517
|
-
onOpenAutoFocus: (f) => {
|
|
518
|
-
var a;
|
|
519
|
-
d.isUsingKeyboardRef.current && ((a = M.current) == null || a.focus()), f.preventDefault();
|
|
520
|
-
},
|
|
521
|
-
onCloseAutoFocus: (f) => f.preventDefault(),
|
|
522
|
-
onFocusOutside: v(e.onFocusOutside, (f) => {
|
|
523
|
-
f.target !== p.trigger && c.onOpenChange(!1);
|
|
524
|
-
}),
|
|
525
|
-
onEscapeKeyDown: v(e.onEscapeKeyDown, (f) => {
|
|
526
|
-
d.onClose(), f.preventDefault();
|
|
527
|
-
}),
|
|
528
|
-
onKeyDown: v(e.onKeyDown, (f) => {
|
|
529
|
-
var C;
|
|
530
|
-
const a = f.currentTarget.contains(f.target), l = ft[d.dir].includes(f.key);
|
|
531
|
-
a && l && (c.onOpenChange(!1), (C = p.trigger) == null || C.focus(), f.preventDefault());
|
|
532
|
-
})
|
|
533
|
-
}
|
|
534
|
-
) }) }) });
|
|
535
|
-
}
|
|
536
|
-
);
|
|
537
|
-
Le.displayName = Fe;
|
|
538
|
-
function Ke(e) {
|
|
539
|
-
return e ? "open" : "closed";
|
|
540
|
-
}
|
|
541
|
-
function j(e) {
|
|
542
|
-
return e === "indeterminate";
|
|
543
|
-
}
|
|
544
|
-
function ae(e) {
|
|
545
|
-
return j(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
546
|
-
}
|
|
547
|
-
function Dt(e) {
|
|
548
|
-
const n = document.activeElement;
|
|
549
|
-
for (const t of e)
|
|
550
|
-
if (t === n || (t.focus(), document.activeElement !== n)) return;
|
|
551
|
-
}
|
|
552
|
-
function Ot(e, n) {
|
|
553
|
-
return e.map((t, o) => e[(n + o) % e.length]);
|
|
554
|
-
}
|
|
555
|
-
function kt(e, n, t) {
|
|
556
|
-
const s = n.length > 1 && Array.from(n).every((m) => m === n[0]) ? n[0] : n, c = t ? e.indexOf(t) : -1;
|
|
557
|
-
let d = Ot(e, Math.max(c, 0));
|
|
558
|
-
s.length === 1 && (d = d.filter((m) => m !== t));
|
|
559
|
-
const M = d.find(
|
|
560
|
-
(m) => m.toLowerCase().startsWith(s.toLowerCase())
|
|
561
|
-
);
|
|
562
|
-
return M !== t ? M : void 0;
|
|
563
|
-
}
|
|
564
|
-
function Nt(e, n) {
|
|
565
|
-
const { x: t, y: o } = e;
|
|
566
|
-
let s = !1;
|
|
567
|
-
for (let c = 0, d = n.length - 1; c < n.length; d = c++) {
|
|
568
|
-
const p = n[c], M = n[d], m = p.x, f = p.y, a = M.x, l = M.y;
|
|
569
|
-
f > o != l > o && t < (a - m) * (o - f) / (l - f) + m && (s = !s);
|
|
570
|
-
}
|
|
571
|
-
return s;
|
|
572
|
-
}
|
|
573
|
-
function Ft(e, n) {
|
|
574
|
-
if (!n) return !1;
|
|
575
|
-
const t = { x: e.clientX, y: e.clientY };
|
|
576
|
-
return Nt(t, n);
|
|
577
|
-
}
|
|
578
|
-
function k(e) {
|
|
579
|
-
return (n) => n.pointerType === "mouse" ? e(n) : void 0;
|
|
580
|
-
}
|
|
581
|
-
var Wt = ge, zt = ee, Zt = Re, $t = Pe, qt = re, Jt = Ee, Qt = z, en = we, tn = ye, nn = xe, on = Ae, rn = De, cn = Oe, an = Ne, sn = Le;
|
|
582
|
-
export {
|
|
583
|
-
zt as A,
|
|
584
|
-
$t as C,
|
|
585
|
-
qt as G,
|
|
586
|
-
Qt as I,
|
|
587
|
-
Jt as L,
|
|
588
|
-
Zt as P,
|
|
589
|
-
Wt as R,
|
|
590
|
-
rn as S,
|
|
591
|
-
en as a,
|
|
592
|
-
tn as b,
|
|
593
|
-
jt as c,
|
|
594
|
-
nn as d,
|
|
595
|
-
on as e,
|
|
596
|
-
cn as f,
|
|
597
|
-
an as g,
|
|
598
|
-
sn as h
|
|
599
|
-
};
|