@wrdagency/blockout 0.0.19 → 0.1.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.
- package/dist/2NBKRL7C-7XoDiJp9.js +85 -0
- package/dist/2RSXSRCN-qt84MtKs.js +61 -0
- package/dist/4CMBR7SL-BHIN8rB4.js +308 -0
- package/dist/5JTVDSTH-CG1NL6Fw.js +174 -0
- package/dist/5VQZOHHZ-CscZGerP.js +59 -0
- package/dist/6VRAQV3D-Clhw_nNS.js +201 -0
- package/dist/7PRQYBBV-91wrWGjk.js +17 -0
- package/dist/ArrowRight.es-xyNbtVOa.js +60 -0
- package/dist/DG5U6ZEL-CVj-Czp2.js +17 -0
- package/dist/F5MUBM3I-87B2_4WK.js +54 -0
- package/dist/LMDWO4NN--KEvZePp.js +610 -0
- package/dist/MTZPJQMC-DyCWBG18.js +14 -0
- package/dist/P7GR5CS5-BoOYUfSQ.js +19 -0
- package/dist/PFRGBC2K-BEg8ahbY.js +303 -0
- package/dist/RS7LB2H4-D0fWv5qu.js +15 -0
- package/dist/RZ4GPYOB-13-5LlEb.js +37 -0
- package/dist/S43UC3DV-Dn8EFLaT.js +22 -0
- package/dist/Square.es-KJLdY11q.js +72 -0
- package/dist/T7VMP3TM-DeRMoW8g.js +77 -0
- package/dist/TP7N7UIH-BHb1rEeb.js +34 -0
- package/dist/UQQRIHDV-Bu8e1bYU.js +69 -0
- package/dist/UYGDZTLQ-DcCmv5SE.js +12 -0
- package/dist/VIIRIBF3-D5DmZNtI.js +26 -0
- package/dist/WMYDSCNQ-DECXdiUT.js +1346 -0
- package/dist/WYCIER3C-8jmp2F15.js +175 -0
- package/dist/YV4JVR4I-LkUIiJWj.js +351 -0
- package/dist/assets/button.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/index10.css +1 -1
- package/dist/assets/index11.css +1 -1
- package/dist/assets/index12.css +1 -1
- package/dist/assets/index13.css +1 -1
- package/dist/assets/index14.css +1 -0
- package/dist/assets/index15.css +1 -0
- package/dist/assets/index16.css +1 -0
- package/dist/assets/index17.css +1 -0
- package/dist/assets/index18.css +1 -0
- package/dist/assets/index19.css +1 -0
- package/dist/assets/index2.css +1 -1
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index5.css +1 -1
- package/dist/assets/index6.css +1 -1
- package/dist/assets/index7.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/assets/style.css +1 -1
- package/dist/assets/style2.css +1 -0
- package/dist/assets/style3.css +1 -0
- package/dist/assets/style4.css +1 -0
- package/dist/assets/styles.css +1 -1
- package/dist/components/block-editor/editor.d.ts +5 -0
- package/dist/components/block-editor/editor.js +6 -0
- package/dist/components/block-editor/index.d.ts +1 -0
- package/dist/components/block-editor/index.js +4 -0
- package/dist/components/breadcrumbs/index.js +87 -31
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/button.js +5 -5
- package/dist/components/button/icon.d.ts +1 -2
- package/dist/components/button/icon.js +10 -3
- package/dist/components/button/index.d.ts +4 -0
- package/dist/components/controls/base-control/affix.js +7 -7
- package/dist/components/controls/base-control/index.js +11 -11
- package/dist/components/controls/base-popover-control/index.d.ts +9 -0
- package/dist/components/controls/base-popover-control/index.js +47 -0
- package/dist/components/controls/checkbox-control/index.d.ts +8 -0
- package/dist/components/controls/checkbox-control/index.js +57 -0
- package/dist/components/controls/choice-control/choice.js +13 -11
- package/dist/components/controls/choice-control/index.js +1 -1
- package/dist/components/controls/index.d.ts +4 -1
- package/dist/components/controls/index.js +25 -16
- package/dist/components/controls/number-control/index.js +29 -27
- package/dist/components/controls/password-control/index.js +1 -1
- package/dist/components/controls/recurrence-control/index.d.ts +8 -0
- package/dist/components/controls/recurrence-control/index.js +208 -0
- package/dist/components/controls/select-control/component.d.ts +12 -0
- package/dist/components/controls/select-control/component.js +1879 -0
- package/dist/components/controls/select-control/index.d.ts +2 -12
- package/dist/components/controls/select-control/index.js +5 -1860
- package/dist/components/controls/select-control/options.d.ts +7 -0
- package/dist/components/controls/select-control/options.js +9 -0
- package/dist/components/controls/textarea-control/index.js +1 -1
- package/dist/components/controls/toggle-control/index.js +11 -9
- package/dist/components/controls/toggle-group-control/index.d.ts +19 -0
- package/dist/components/controls/toggle-group-control/index.js +50 -0
- package/dist/components/data-table/header.js +120 -171
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/filesystem/file.d.ts +7 -0
- package/dist/components/filesystem/file.js +44 -0
- package/dist/components/filesystem/folder.d.ts +6 -0
- package/dist/components/filesystem/folder.js +160 -0
- package/dist/components/filesystem/icon.d.ts +7 -0
- package/dist/components/filesystem/icon.js +908 -0
- package/dist/components/filesystem/index.js +14 -0
- package/dist/components/filesystem/list.d.ts +4 -0
- package/dist/components/filesystem/list.js +18 -0
- package/dist/components/filesystem/root.d.ts +3 -0
- package/dist/components/filesystem/root.js +7 -0
- package/dist/components/form/components/index.js +12 -12
- package/dist/components/form/components/pagination.js +23 -16
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.js +50 -31
- package/dist/components/markdown/{index.d.ts → editor/component.d.ts} +2 -2
- package/dist/components/markdown/editor/component.js +25583 -0
- package/dist/components/markdown/editor/index.d.ts +1 -0
- package/dist/components/markdown/editor/index.js +4 -0
- package/dist/components/markdown/formats.js +29 -27
- package/dist/components/markdown/index.js +5 -25842
- package/dist/components/markdown/prose.d.ts +3 -0
- package/dist/components/markdown/prose.js +15 -0
- package/dist/components/menu/index.js +24 -23
- package/dist/components/menu/item.js +1 -1
- package/dist/components/menu/items/action.js +1 -1
- package/dist/components/menu/items/spacer.js +14 -42
- package/dist/components/menu/items/submenu.js +2 -2
- package/dist/components/menu/items/toggle.js +25 -91
- package/dist/components/progress/index.js +1 -1
- package/dist/components/tabs/index.js +12 -0
- package/dist/components/tabs/list.d.ts +7 -0
- package/dist/components/tabs/list.js +42 -0
- package/dist/components/tabs/panel.d.ts +8 -0
- package/dist/components/tabs/panel.js +132 -0
- package/dist/components/tabs/root.d.ts +9 -0
- package/dist/components/tabs/root.js +173 -0
- package/dist/components/tabs/tab.d.ts +7 -0
- package/dist/components/tabs/tab.js +81 -0
- package/dist/components/toolbar/index.js +27 -0
- package/dist/components/toolbar/root.d.ts +6 -0
- package/dist/components/toolbar/root.js +6 -0
- package/dist/composite-provider-DxKEAxsZ.js +10 -0
- package/dist/floating-ui.dom-BqewRPVB.js +1124 -0
- package/dist/hooks/state.d.ts +4 -0
- package/dist/hooks/state.js +7 -0
- package/dist/hooks/theme.js +7 -38
- package/dist/index-1AjPIqTN.js +73 -0
- package/dist/index-B5y9bioP.js +258 -0
- package/dist/index-BI5rPXbu.js +391 -0
- package/dist/index.js +63 -40
- package/dist/{item-D9r2-3fk.js → item-BrZqCoM7.js} +240 -234
- package/dist/options-Cfoqhxw2.js +96 -0
- package/dist/primitives/index.d.ts +2 -0
- package/dist/primitives/index.js +4 -0
- package/dist/primitives/resizable/index.js +1 -1
- package/dist/primitives/scroll-area/index.d.ts +7 -0
- package/dist/primitives/scroll-area/index.js +545 -0
- package/dist/primitives/truncate/index.d.ts +7 -0
- package/dist/primitives/truncate/index.js +46 -0
- package/dist/primitives/visually-hidden/index.d.ts +2 -2
- package/dist/primitives/visually-hidden/index.js +13 -3
- package/dist/root-CdR32nP9.js +73 -0
- package/dist/tslib.es6-DN7pKd6F.js +44 -0
- package/dist/types/date.d.ts +39 -0
- package/dist/types/date.js +1749 -0
- package/dist/types/options.d.ts +8 -6
- package/dist/utils/components.d.ts +5 -0
- package/dist/utils/components.js +14 -0
- package/dist/utils/date.d.ts +1 -0
- package/dist/utils/date.js +15 -0
- package/dist/utils/string.d.ts +4 -0
- package/dist/utils/string.js +18 -0
- package/package.json +4 -1
- package/dist/2NBKRL7C-D-Q0qGRV.js +0 -81
- package/dist/P7GR5CS5-qyeuZVEs.js +0 -640
- package/dist/T7VMP3TM-BxgFbvdx.js +0 -2106
- package/dist/UQQRIHDV-BGs025hb.js +0 -1046
- package/dist/VIIRIBF3-D9clDhln.js +0 -21
- package/dist/floating-ui.dom-9sqP7IwC.js +0 -1512
|
@@ -1,63 +1,42 @@
|
|
|
1
1
|
import { jsx as y, jsxs as oe } from "react/jsx-runtime";
|
|
2
|
-
import { ActionMenuItem as
|
|
3
|
-
import { SeparatorMenuItem as
|
|
2
|
+
import { ActionMenuItem as Ie } from "./components/menu/items/action.js";
|
|
3
|
+
import { SeparatorMenuItem as Le } from "./components/menu/items/spacer.js";
|
|
4
4
|
import * as S from "react";
|
|
5
|
-
import { useRef as U, useState as ue, useEffect as B, useContext as
|
|
6
|
-
import { w as
|
|
7
|
-
import { EmptyIcon as
|
|
8
|
-
import { ToggleMenuItem as
|
|
9
|
-
import { b as
|
|
10
|
-
import { u as
|
|
11
|
-
import { c as
|
|
12
|
-
import { c as
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/* @__PURE__ */ S.createElement(S.Fragment, null, /* @__PURE__ */ S.createElement("path", { d: "M176,128,96,208V48Z", opacity: "0.2" }), /* @__PURE__ */ S.createElement("path", { d: "M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z" }))
|
|
22
|
-
],
|
|
23
|
-
[
|
|
24
|
-
"fill",
|
|
25
|
-
/* @__PURE__ */ S.createElement(S.Fragment, null, /* @__PURE__ */ S.createElement("path", { d: "M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z" }))
|
|
26
|
-
],
|
|
27
|
-
[
|
|
28
|
-
"light",
|
|
29
|
-
/* @__PURE__ */ S.createElement(S.Fragment, null, /* @__PURE__ */ S.createElement("path", { d: "M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z" }))
|
|
30
|
-
],
|
|
31
|
-
[
|
|
32
|
-
"regular",
|
|
33
|
-
/* @__PURE__ */ S.createElement(S.Fragment, null, /* @__PURE__ */ S.createElement("path", { d: "M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z" }))
|
|
34
|
-
],
|
|
35
|
-
[
|
|
36
|
-
"thin",
|
|
37
|
-
/* @__PURE__ */ S.createElement(S.Fragment, null, /* @__PURE__ */ S.createElement("path", { d: "M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z" }))
|
|
38
|
-
]
|
|
39
|
-
]), He = S.forwardRef((n, o) => /* @__PURE__ */ S.createElement(Ke, { ref: o, ...n, weights: Et }));
|
|
40
|
-
He.displayName = "CaretRightIcon";
|
|
41
|
-
function St(n = {}) {
|
|
5
|
+
import { useRef as U, useState as ue, useEffect as B, useContext as ke, createContext as Ve, useCallback as ge, createRef as Be, useMemo as je } from "react";
|
|
6
|
+
import { w as Ze } from "./SSRBase.es-BUXS72ra.js";
|
|
7
|
+
import { EmptyIcon as $e } from "./components/menu/icon.js";
|
|
8
|
+
import { ToggleMenuItem as Ke } from "./components/menu/items/toggle.js";
|
|
9
|
+
import { b as de, H as Ue, u as qe, c as ae, M as We, d as Ee } from "./VIIRIBF3-D5DmZNtI.js";
|
|
10
|
+
import { u as Xe, M as Ye } from "./2NBKRL7C-7XoDiJp9.js";
|
|
11
|
+
import { c as ze, b as Ge, d as Je, e as Se, R as Qe, f as et } from "./WMYDSCNQ-DECXdiUT.js";
|
|
12
|
+
import { c as Pe, f as re, b as ce, m as tt, o as nt, p as ot, t as rt, s as pe, e as st, a as W } from "./YV4JVR4I-LkUIiJWj.js";
|
|
13
|
+
import { c as ut, b as at } from "./4CMBR7SL-BHIN8rB4.js";
|
|
14
|
+
import { a as it } from "./S43UC3DV-Dn8EFLaT.js";
|
|
15
|
+
import { Y as $, X as k, U as I, a as J, _ as K, i as Q, a8 as ct, L as _e, j as le, a0 as ve, V as z, a7 as lt, b as mt, l as fe, m as L, n as ee, o as E, a9 as Oe, M as me, e as q, f as te, q as ne, t as ye, $ as dt, a5 as ft, Z as pt, s as Ae, aa as vt, R as ht, ab as bt } from "./LMDWO4NN--KEvZePp.js";
|
|
16
|
+
import { a as se, u as wt } from "./PFRGBC2K-BEg8ahbY.js";
|
|
17
|
+
import { u as Fe } from "./T7VMP3TM-DeRMoW8g.js";
|
|
18
|
+
import { i as Mt } from "./WYCIER3C-8jmp2F15.js";
|
|
19
|
+
import { u as gt } from "./5JTVDSTH-CG1NL6Fw.js";
|
|
20
|
+
function Et(n = {}) {
|
|
42
21
|
var o;
|
|
43
|
-
const t = (o = n.store) == null ? void 0 : o.getState(), e =
|
|
44
|
-
placement:
|
|
22
|
+
const t = (o = n.store) == null ? void 0 : o.getState(), e = ze($(I({}, n), {
|
|
23
|
+
placement: k(
|
|
45
24
|
n.placement,
|
|
46
25
|
t == null ? void 0 : t.placement,
|
|
47
26
|
"bottom"
|
|
48
27
|
)
|
|
49
|
-
})), i =
|
|
28
|
+
})), i = k(n.timeout, t == null ? void 0 : t.timeout, 500), u = $(I({}, e.getState()), {
|
|
50
29
|
timeout: i,
|
|
51
|
-
showTimeout:
|
|
52
|
-
hideTimeout:
|
|
53
|
-
autoFocusOnShow:
|
|
54
|
-
}), a =
|
|
55
|
-
return
|
|
30
|
+
showTimeout: k(n.showTimeout, t == null ? void 0 : t.showTimeout),
|
|
31
|
+
hideTimeout: k(n.hideTimeout, t == null ? void 0 : t.hideTimeout),
|
|
32
|
+
autoFocusOnShow: k(t == null ? void 0 : t.autoFocusOnShow, !1)
|
|
33
|
+
}), a = Pe(u, e, n.store);
|
|
34
|
+
return $(I(I({}, e), a), {
|
|
56
35
|
setAutoFocusOnShow: (s) => a.setState("autoFocusOnShow", s)
|
|
57
36
|
});
|
|
58
37
|
}
|
|
59
|
-
function
|
|
60
|
-
return re(n, t, "timeout"), re(n, t, "showTimeout"), re(n, t, "hideTimeout"),
|
|
38
|
+
function St(n, o, t) {
|
|
39
|
+
return re(n, t, "timeout"), re(n, t, "showTimeout"), re(n, t, "hideTimeout"), Ge(n, o, t);
|
|
61
40
|
}
|
|
62
41
|
function ie(n) {
|
|
63
42
|
return [n.clientX, n.clientY];
|
|
@@ -67,38 +46,38 @@ function he(n, o) {
|
|
|
67
46
|
let i = !1;
|
|
68
47
|
const u = o.length;
|
|
69
48
|
for (let a = u, s = 0, l = a - 1; s < a; l = s++) {
|
|
70
|
-
const [r, c] = o[s], [b,
|
|
71
|
-
if (
|
|
72
|
-
if (e >=
|
|
49
|
+
const [r, c] = o[s], [b, d] = o[l], [, m] = o[l === 0 ? a - 1 : l - 1] || [0, 0], g = (c - d) * (t - r) - (r - b) * (e - c);
|
|
50
|
+
if (d < c) {
|
|
51
|
+
if (e >= d && e < c) {
|
|
73
52
|
if (g === 0) return !0;
|
|
74
|
-
g > 0 && (e ===
|
|
53
|
+
g > 0 && (e === d ? e > m && (i = !i) : i = !i);
|
|
75
54
|
}
|
|
76
|
-
} else if (c <
|
|
77
|
-
if (e > c && e <=
|
|
55
|
+
} else if (c < d) {
|
|
56
|
+
if (e > c && e <= d) {
|
|
78
57
|
if (g === 0) return !0;
|
|
79
|
-
g < 0 && (e ===
|
|
58
|
+
g < 0 && (e === d ? e < m && (i = !i) : i = !i);
|
|
80
59
|
}
|
|
81
60
|
} else if (e === c && (t >= b && t <= r || t >= r && t <= b))
|
|
82
61
|
return !0;
|
|
83
62
|
}
|
|
84
63
|
return i;
|
|
85
64
|
}
|
|
86
|
-
function
|
|
65
|
+
function Pt(n, o) {
|
|
87
66
|
const { top: t, right: e, bottom: i, left: u } = o, [a, s] = n, l = a < u ? "left" : a > e ? "right" : null, r = s < t ? "top" : s > i ? "bottom" : null;
|
|
88
67
|
return [l, r];
|
|
89
68
|
}
|
|
90
69
|
function be(n, o) {
|
|
91
|
-
const t = n.getBoundingClientRect(), { top: e, right: i, bottom: u, left: a } = t, [s, l] =
|
|
70
|
+
const t = n.getBoundingClientRect(), { top: e, right: i, bottom: u, left: a } = t, [s, l] = Pt(o, t), r = [o];
|
|
92
71
|
return s ? (l !== "top" && r.push([s === "left" ? a : i, e]), r.push([s === "left" ? i : a, e]), r.push([s === "left" ? i : a, u]), l !== "bottom" && r.push([s === "left" ? a : i, u])) : l === "top" ? (r.push([a, e]), r.push([a, u]), r.push([i, u]), r.push([i, e])) : (r.push([a, u]), r.push([a, e]), r.push([i, e]), r.push([i, u])), r;
|
|
93
72
|
}
|
|
94
|
-
var
|
|
95
|
-
function
|
|
96
|
-
return se(o) ? !0 : n ? !!(
|
|
73
|
+
var _t = "div";
|
|
74
|
+
function He(n, o, t, e) {
|
|
75
|
+
return se(o) ? !0 : n ? !!(me(o, n) || t && me(t, n) || e != null && e.some((i) => He(n, i, t))) : !1;
|
|
97
76
|
}
|
|
98
|
-
function
|
|
77
|
+
function Ot(n) {
|
|
99
78
|
var o = n, {
|
|
100
79
|
store: t
|
|
101
|
-
} = o, e =
|
|
80
|
+
} = o, e = K(o, [
|
|
102
81
|
"store"
|
|
103
82
|
]);
|
|
104
83
|
const [i, u] = ue(!1), a = t.useState("mounted");
|
|
@@ -110,14 +89,14 @@ function yt(n) {
|
|
|
110
89
|
}), r = U(null);
|
|
111
90
|
return B(() => ce(t, ["anchorElement"], (c) => {
|
|
112
91
|
r.current = c.anchorElement;
|
|
113
|
-
}), []), e =
|
|
92
|
+
}), []), e = L(E({
|
|
114
93
|
autoFocusOnHide: i,
|
|
115
94
|
finalFocus: r
|
|
116
95
|
}, e), {
|
|
117
96
|
onFocus: l
|
|
118
97
|
}), e;
|
|
119
98
|
}
|
|
120
|
-
var we = Ve(null),
|
|
99
|
+
var we = Ve(null), xe = J(
|
|
121
100
|
function(o) {
|
|
122
101
|
var t = o, {
|
|
123
102
|
store: e,
|
|
@@ -126,7 +105,7 @@ var we = Ve(null), Ce = J(
|
|
|
126
105
|
hideOnEscape: a = !0,
|
|
127
106
|
hideOnHoverOutside: s = !0,
|
|
128
107
|
disablePointerEventsOnApproach: l = !!s
|
|
129
|
-
} = t, r =
|
|
108
|
+
} = t, r = K(t, [
|
|
130
109
|
"store",
|
|
131
110
|
"modal",
|
|
132
111
|
"portal",
|
|
@@ -134,37 +113,37 @@ var we = Ve(null), Ce = J(
|
|
|
134
113
|
"hideOnHoverOutside",
|
|
135
114
|
"disablePointerEventsOnApproach"
|
|
136
115
|
]);
|
|
137
|
-
const c =
|
|
116
|
+
const c = de();
|
|
138
117
|
e = e || c, Q(
|
|
139
118
|
e,
|
|
140
119
|
process.env.NODE_ENV !== "production" && "Hovercard must receive a `store` prop or be wrapped in a HovercardProvider component."
|
|
141
120
|
);
|
|
142
|
-
const b = U(null), [
|
|
121
|
+
const b = U(null), [d, m] = ue([]), g = U(0), w = U(null), { portalRef: M, domReady: f } = ct(u, r.portalRef), F = _e(), V = !!s, C = le(s), H = !!l, T = le(
|
|
143
122
|
l
|
|
144
123
|
), h = e.useState("open"), N = e.useState("mounted");
|
|
145
124
|
B(() => {
|
|
146
125
|
if (!f || !N || !V && !H) return;
|
|
147
126
|
const v = b.current;
|
|
148
127
|
return v ? ve(
|
|
149
|
-
|
|
128
|
+
z("mousemove", (P) => {
|
|
150
129
|
if (!e || !F()) return;
|
|
151
|
-
const { anchorElement: O, hideTimeout: _, timeout:
|
|
152
|
-
if (
|
|
153
|
-
w.current =
|
|
130
|
+
const { anchorElement: O, hideTimeout: _, timeout: X } = e.getState(), G = w.current, [Y] = P.composedPath(), j = O;
|
|
131
|
+
if (He(Y, v, j, d)) {
|
|
132
|
+
w.current = Y && j && me(j, Y) ? ie(P) : null, window.clearTimeout(g.current), g.current = 0;
|
|
154
133
|
return;
|
|
155
134
|
}
|
|
156
135
|
if (!g.current) {
|
|
157
|
-
if (
|
|
158
|
-
const
|
|
159
|
-
if (he(
|
|
160
|
-
if (w.current =
|
|
136
|
+
if (G) {
|
|
137
|
+
const Z = ie(P), De = be(v, G);
|
|
138
|
+
if (he(Z, De)) {
|
|
139
|
+
if (w.current = Z, !T(P)) return;
|
|
161
140
|
P.preventDefault(), P.stopPropagation();
|
|
162
141
|
return;
|
|
163
142
|
}
|
|
164
143
|
}
|
|
165
144
|
C(P) && (g.current = window.setTimeout(() => {
|
|
166
145
|
g.current = 0, e == null || e.hide();
|
|
167
|
-
}, _ ??
|
|
146
|
+
}, _ ?? X));
|
|
168
147
|
}
|
|
169
148
|
}, !0),
|
|
170
149
|
() => clearTimeout(g.current)
|
|
@@ -176,7 +155,7 @@ var we = Ve(null), Ce = J(
|
|
|
176
155
|
N,
|
|
177
156
|
V,
|
|
178
157
|
H,
|
|
179
|
-
|
|
158
|
+
d,
|
|
180
159
|
T,
|
|
181
160
|
C
|
|
182
161
|
]), B(() => {
|
|
@@ -194,23 +173,23 @@ var we = Ve(null), Ce = J(
|
|
|
194
173
|
};
|
|
195
174
|
return ve(
|
|
196
175
|
// Note: we may need to add pointer events here in the future.
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
176
|
+
z("mouseenter", v, !0),
|
|
177
|
+
z("mouseover", v, !0),
|
|
178
|
+
z("mouseout", v, !0),
|
|
179
|
+
z("mouseleave", v, !0)
|
|
201
180
|
);
|
|
202
181
|
}, [f, N, H, T]), B(() => {
|
|
203
182
|
f && (h || e == null || e.setAutoFocusOnShow(!1));
|
|
204
183
|
}, [e, f, h]);
|
|
205
|
-
const
|
|
184
|
+
const R = lt(h);
|
|
206
185
|
B(() => {
|
|
207
186
|
if (f)
|
|
208
187
|
return () => {
|
|
209
|
-
|
|
188
|
+
R.current || e == null || e.setAutoFocusOnShow(!1);
|
|
210
189
|
};
|
|
211
190
|
}, [e, f]);
|
|
212
|
-
const x =
|
|
213
|
-
|
|
191
|
+
const x = ke(we);
|
|
192
|
+
mt(() => {
|
|
214
193
|
if (i || !u || !N || !f) return;
|
|
215
194
|
const v = b.current;
|
|
216
195
|
if (v)
|
|
@@ -218,10 +197,10 @@ var we = Ve(null), Ce = J(
|
|
|
218
197
|
}, [i, u, N, f]);
|
|
219
198
|
const p = ge(
|
|
220
199
|
(v) => {
|
|
221
|
-
|
|
200
|
+
m((P) => [...P, v]);
|
|
222
201
|
const A = x == null ? void 0 : x(v);
|
|
223
202
|
return () => {
|
|
224
|
-
|
|
203
|
+
m(
|
|
225
204
|
(P) => P.filter((O) => O !== v)
|
|
226
205
|
), A == null || A();
|
|
227
206
|
};
|
|
@@ -232,21 +211,21 @@ var we = Ve(null), Ce = J(
|
|
|
232
211
|
r,
|
|
233
212
|
(v) => /* @__PURE__ */ y(Ue, { value: e, children: /* @__PURE__ */ y(we.Provider, { value: p, children: v }) }),
|
|
234
213
|
[e, p]
|
|
235
|
-
), r =
|
|
214
|
+
), r = L(E({}, r), {
|
|
236
215
|
ref: ee(b, r.ref)
|
|
237
|
-
}), r =
|
|
238
|
-
const
|
|
216
|
+
}), r = Ot(E({ store: e }, r));
|
|
217
|
+
const D = e.useState(
|
|
239
218
|
(v) => i || v.autoFocusOnShow
|
|
240
219
|
);
|
|
241
|
-
return r = Je(
|
|
220
|
+
return r = Je(L(E({
|
|
242
221
|
store: e,
|
|
243
222
|
modal: i,
|
|
244
223
|
portal: u,
|
|
245
|
-
autoFocusOnShow:
|
|
224
|
+
autoFocusOnShow: D
|
|
246
225
|
}, r), {
|
|
247
226
|
portalRef: M,
|
|
248
227
|
hideOnEscape(v) {
|
|
249
|
-
return
|
|
228
|
+
return Oe(a, v) ? !1 : (requestAnimationFrame(() => {
|
|
250
229
|
requestAnimationFrame(() => {
|
|
251
230
|
e == null || e.hide();
|
|
252
231
|
});
|
|
@@ -257,26 +236,26 @@ var we = Ve(null), Ce = J(
|
|
|
257
236
|
);
|
|
258
237
|
Se(
|
|
259
238
|
te(function(o) {
|
|
260
|
-
const t =
|
|
261
|
-
return ne(
|
|
239
|
+
const t = xe(o);
|
|
240
|
+
return ne(_t, t);
|
|
262
241
|
}),
|
|
263
|
-
|
|
242
|
+
de
|
|
264
243
|
);
|
|
265
|
-
var
|
|
244
|
+
var yt = "a", Ce = J(
|
|
266
245
|
function(o) {
|
|
267
|
-
var t = o, { store: e, showOnHover: i = !0 } = t, u =
|
|
268
|
-
const a =
|
|
246
|
+
var t = o, { store: e, showOnHover: i = !0 } = t, u = K(t, ["store", "showOnHover"]);
|
|
247
|
+
const a = de();
|
|
269
248
|
e = e || a, Q(
|
|
270
249
|
e,
|
|
271
250
|
process.env.NODE_ENV !== "production" && "HovercardAnchor must receive a `store` prop or be wrapped in a HovercardProvider component."
|
|
272
251
|
);
|
|
273
|
-
const s =
|
|
274
|
-
B(() => () => window.clearTimeout(l.current), []), B(() =>
|
|
252
|
+
const s = ye(u), l = U(0);
|
|
253
|
+
B(() => () => window.clearTimeout(l.current), []), B(() => z("mouseleave", (f) => {
|
|
275
254
|
if (!e) return;
|
|
276
255
|
const { anchorElement: F } = e.getState();
|
|
277
256
|
F && f.target === F && (window.clearTimeout(l.current), l.current = 0);
|
|
278
257
|
}, !0), [e]);
|
|
279
|
-
const r = u.onMouseMove, c = le(i), b =
|
|
258
|
+
const r = u.onMouseMove, c = le(i), b = _e(), d = q((M) => {
|
|
280
259
|
if (r == null || r(M), s || !e || M.defaultPrevented || l.current || !b() || !c(M)) return;
|
|
281
260
|
const f = M.currentTarget;
|
|
282
261
|
e.setAnchorElement(f), e.setDisclosureElement(f);
|
|
@@ -286,8 +265,8 @@ var At = "a", Te = J(
|
|
|
286
265
|
}));
|
|
287
266
|
}, H = F ?? V;
|
|
288
267
|
H === 0 ? C() : l.current = window.setTimeout(C, H);
|
|
289
|
-
}),
|
|
290
|
-
|
|
268
|
+
}), m = u.onClick, g = q((M) => {
|
|
269
|
+
m == null || m(M), e && (window.clearTimeout(l.current), l.current = 0);
|
|
291
270
|
}), w = ge(
|
|
292
271
|
(M) => {
|
|
293
272
|
if (!e) return;
|
|
@@ -296,31 +275,31 @@ var At = "a", Te = J(
|
|
|
296
275
|
},
|
|
297
276
|
[e]
|
|
298
277
|
);
|
|
299
|
-
return u =
|
|
278
|
+
return u = L(E({}, u), {
|
|
300
279
|
ref: ee(w, u.ref),
|
|
301
|
-
onMouseMove:
|
|
280
|
+
onMouseMove: d,
|
|
302
281
|
onClick: g
|
|
303
|
-
}), u =
|
|
282
|
+
}), u = wt(u), u;
|
|
304
283
|
}
|
|
305
284
|
);
|
|
306
285
|
te(function(o) {
|
|
307
|
-
const t =
|
|
308
|
-
return ne(
|
|
286
|
+
const t = Ce(o);
|
|
287
|
+
return ne(yt, t);
|
|
309
288
|
});
|
|
310
|
-
function
|
|
289
|
+
function At(n = {}) {
|
|
311
290
|
var o = n, {
|
|
312
291
|
combobox: t,
|
|
313
292
|
parent: e,
|
|
314
293
|
menubar: i
|
|
315
|
-
} = o, u =
|
|
294
|
+
} = o, u = dt(o, [
|
|
316
295
|
"combobox",
|
|
317
296
|
"parent",
|
|
318
297
|
"menubar"
|
|
319
298
|
]);
|
|
320
|
-
const a = !!i && !e, s =
|
|
299
|
+
const a = !!i && !e, s = tt(
|
|
321
300
|
u.store,
|
|
322
|
-
|
|
323
|
-
|
|
301
|
+
ot(e, ["values"]),
|
|
302
|
+
nt(t, [
|
|
324
303
|
"arrowElement",
|
|
325
304
|
"anchorElement",
|
|
326
305
|
"contentElement",
|
|
@@ -328,72 +307,72 @@ function Ft(n = {}) {
|
|
|
328
307
|
"disclosureElement"
|
|
329
308
|
])
|
|
330
309
|
);
|
|
331
|
-
|
|
332
|
-
const l = s.getState(), r =
|
|
310
|
+
rt(u, s);
|
|
311
|
+
const l = s.getState(), r = ut($(I({}, u), {
|
|
333
312
|
store: s,
|
|
334
|
-
orientation:
|
|
313
|
+
orientation: k(
|
|
335
314
|
u.orientation,
|
|
336
315
|
l.orientation,
|
|
337
316
|
"vertical"
|
|
338
317
|
)
|
|
339
|
-
})), c =
|
|
318
|
+
})), c = Et($(I({}, u), {
|
|
340
319
|
store: s,
|
|
341
|
-
placement:
|
|
320
|
+
placement: k(
|
|
342
321
|
u.placement,
|
|
343
322
|
l.placement,
|
|
344
323
|
"bottom-start"
|
|
345
324
|
),
|
|
346
|
-
timeout:
|
|
325
|
+
timeout: k(
|
|
347
326
|
u.timeout,
|
|
348
327
|
l.timeout,
|
|
349
328
|
a ? 0 : 150
|
|
350
329
|
),
|
|
351
|
-
hideTimeout:
|
|
352
|
-
})), b =
|
|
353
|
-
initialFocus:
|
|
354
|
-
values:
|
|
330
|
+
hideTimeout: k(u.hideTimeout, l.hideTimeout, 0)
|
|
331
|
+
})), b = $(I(I({}, r.getState()), c.getState()), {
|
|
332
|
+
initialFocus: k(l.initialFocus, "container"),
|
|
333
|
+
values: k(
|
|
355
334
|
u.values,
|
|
356
335
|
l.values,
|
|
357
336
|
u.defaultValues,
|
|
358
337
|
{}
|
|
359
338
|
)
|
|
360
|
-
}),
|
|
339
|
+
}), d = Pe(b, r, c, s);
|
|
361
340
|
return pe(
|
|
362
|
-
|
|
363
|
-
() => ce(
|
|
364
|
-
|
|
341
|
+
d,
|
|
342
|
+
() => ce(d, ["mounted"], (m) => {
|
|
343
|
+
m.mounted || d.setState("activeId", null);
|
|
365
344
|
})
|
|
366
345
|
), pe(
|
|
367
|
-
|
|
368
|
-
() => ce(e, ["orientation"], (
|
|
369
|
-
|
|
346
|
+
d,
|
|
347
|
+
() => ce(e, ["orientation"], (m) => {
|
|
348
|
+
d.setState(
|
|
370
349
|
"placement",
|
|
371
|
-
|
|
350
|
+
m.orientation === "vertical" ? "right-start" : "bottom-start"
|
|
372
351
|
);
|
|
373
352
|
})
|
|
374
|
-
),
|
|
353
|
+
), $(I(I(I({}, r), c), d), {
|
|
375
354
|
combobox: t,
|
|
376
355
|
parent: e,
|
|
377
356
|
menubar: i,
|
|
378
357
|
hideAll: () => {
|
|
379
358
|
c.hide(), e == null || e.hideAll();
|
|
380
359
|
},
|
|
381
|
-
setInitialFocus: (
|
|
382
|
-
setValues: (
|
|
383
|
-
setValue: (
|
|
384
|
-
|
|
385
|
-
const M = w[
|
|
386
|
-
return f === M ? w :
|
|
387
|
-
[
|
|
360
|
+
setInitialFocus: (m) => d.setState("initialFocus", m),
|
|
361
|
+
setValues: (m) => d.setState("values", m),
|
|
362
|
+
setValue: (m, g) => {
|
|
363
|
+
m !== "__proto__" && m !== "constructor" && (Array.isArray(m) || d.setState("values", (w) => {
|
|
364
|
+
const M = w[m], f = ft(g, M);
|
|
365
|
+
return f === M ? w : $(I({}, w), {
|
|
366
|
+
[m]: f !== void 0 && f
|
|
388
367
|
});
|
|
389
368
|
}));
|
|
390
369
|
}
|
|
391
370
|
});
|
|
392
371
|
}
|
|
393
|
-
function
|
|
394
|
-
return
|
|
395
|
-
|
|
396
|
-
|
|
372
|
+
function Ft(n, o, t) {
|
|
373
|
+
return pt(o, [t.combobox, t.parent, t.menubar]), re(n, t, "values", "setValues"), Object.assign(
|
|
374
|
+
St(
|
|
375
|
+
at(n, o, t),
|
|
397
376
|
o,
|
|
398
377
|
t
|
|
399
378
|
),
|
|
@@ -404,19 +383,19 @@ function Ht(n, o, t) {
|
|
|
404
383
|
}
|
|
405
384
|
);
|
|
406
385
|
}
|
|
407
|
-
function
|
|
408
|
-
const o = qe(), t =
|
|
409
|
-
n =
|
|
386
|
+
function Te(n = {}) {
|
|
387
|
+
const o = qe(), t = Xe(), e = it();
|
|
388
|
+
n = L(E({}, n), {
|
|
410
389
|
parent: n.parent !== void 0 ? n.parent : o,
|
|
411
390
|
menubar: n.menubar !== void 0 ? n.menubar : t,
|
|
412
391
|
combobox: n.combobox !== void 0 ? n.combobox : e
|
|
413
392
|
});
|
|
414
|
-
const [i, u] =
|
|
415
|
-
return
|
|
393
|
+
const [i, u] = st(At, n);
|
|
394
|
+
return Ft(i, u, n);
|
|
416
395
|
}
|
|
417
|
-
var
|
|
418
|
-
function
|
|
419
|
-
var o = n, { store: t } = o, e =
|
|
396
|
+
var Ht = "div";
|
|
397
|
+
function xt(n) {
|
|
398
|
+
var o = n, { store: t } = o, e = K(o, ["store"]);
|
|
420
399
|
const [i, u] = ue(void 0), a = e["aria-label"], s = W(t, "disclosureElement"), l = W(t, "contentElement");
|
|
421
400
|
return B(() => {
|
|
422
401
|
const r = s;
|
|
@@ -426,15 +405,15 @@ function Ct(n) {
|
|
|
426
405
|
a || c.hasAttribute("aria-label") ? u(void 0) : r.id && u(r.id);
|
|
427
406
|
}, [a, s, l]), i;
|
|
428
407
|
}
|
|
429
|
-
var
|
|
408
|
+
var Ne = J(
|
|
430
409
|
function(o) {
|
|
431
|
-
var t = o, { store: e, alwaysVisible: i, composite: u } = t, a =
|
|
410
|
+
var t = o, { store: e, alwaysVisible: i, composite: u } = t, a = K(t, ["store", "alwaysVisible", "composite"]);
|
|
432
411
|
const s = ae();
|
|
433
412
|
e = e || s, Q(
|
|
434
413
|
e,
|
|
435
414
|
process.env.NODE_ENV !== "production" && "MenuList must receive a `store` prop or be wrapped in a MenuProvider component."
|
|
436
415
|
);
|
|
437
|
-
const l = e.parent, r = e.menubar, c = !!l, b =
|
|
416
|
+
const l = e.parent, r = e.menubar, c = !!l, b = Ae(a.id), d = a.onKeyDown, m = e.useState(
|
|
438
417
|
(h) => h.placement.split("-")[0]
|
|
439
418
|
), g = e.useState(
|
|
440
419
|
(h) => h.orientation === "both" ? void 0 : h.orientation
|
|
@@ -442,19 +421,19 @@ var De = J(
|
|
|
442
421
|
r,
|
|
443
422
|
(h) => !!h && h.orientation !== "vertical"
|
|
444
423
|
), f = q((h) => {
|
|
445
|
-
if (
|
|
424
|
+
if (d == null || d(h), !h.defaultPrevented) {
|
|
446
425
|
if (c || r && !w) {
|
|
447
|
-
const
|
|
448
|
-
ArrowRight: () =>
|
|
449
|
-
ArrowLeft: () =>
|
|
450
|
-
ArrowUp: () =>
|
|
451
|
-
ArrowDown: () =>
|
|
426
|
+
const R = {
|
|
427
|
+
ArrowRight: () => m === "left" && !w,
|
|
428
|
+
ArrowLeft: () => m === "right" && !w,
|
|
429
|
+
ArrowUp: () => m === "bottom" && w,
|
|
430
|
+
ArrowDown: () => m === "top" && w
|
|
452
431
|
}[h.key];
|
|
453
|
-
if (
|
|
432
|
+
if (R != null && R())
|
|
454
433
|
return h.stopPropagation(), h.preventDefault(), e == null ? void 0 : e.hide();
|
|
455
434
|
}
|
|
456
435
|
if (r) {
|
|
457
|
-
const
|
|
436
|
+
const R = {
|
|
458
437
|
ArrowRight: () => {
|
|
459
438
|
if (M)
|
|
460
439
|
return r.next();
|
|
@@ -471,7 +450,7 @@ var De = J(
|
|
|
471
450
|
if (!M)
|
|
472
451
|
return r.previous();
|
|
473
452
|
}
|
|
474
|
-
}[h.key], x =
|
|
453
|
+
}[h.key], x = R == null ? void 0 : R();
|
|
475
454
|
x !== void 0 && (h.stopPropagation(), h.preventDefault(), r.move(x));
|
|
476
455
|
}
|
|
477
456
|
}
|
|
@@ -481,8 +460,8 @@ var De = J(
|
|
|
481
460
|
(h) => /* @__PURE__ */ y(We, { value: e, children: h }),
|
|
482
461
|
[e]
|
|
483
462
|
);
|
|
484
|
-
const F =
|
|
485
|
-
a =
|
|
463
|
+
const F = xt(E({ store: e }, a)), V = e.useState("mounted"), C = Mt(V, a.hidden, i), H = C ? L(E({}, a.style), { display: "none" }) : a.style;
|
|
464
|
+
a = L(E({
|
|
486
465
|
id: b,
|
|
487
466
|
"aria-labelledby": F,
|
|
488
467
|
hidden: C
|
|
@@ -495,14 +474,14 @@ var De = J(
|
|
|
495
474
|
return u = u ?? !T, u && (a = E({
|
|
496
475
|
role: "menu",
|
|
497
476
|
"aria-orientation": g
|
|
498
|
-
}, a)), a =
|
|
477
|
+
}, a)), a = gt(E({ store: e, composite: u }, a)), a = Fe(E({ store: e, typeahead: !T }, a)), a;
|
|
499
478
|
}
|
|
500
479
|
);
|
|
501
480
|
te(function(o) {
|
|
502
|
-
const t =
|
|
503
|
-
return ne(
|
|
481
|
+
const t = Ne(o);
|
|
482
|
+
return ne(Ht, t);
|
|
504
483
|
});
|
|
505
|
-
var
|
|
484
|
+
var Ct = "div", Tt = J(function(o) {
|
|
506
485
|
var t = o, {
|
|
507
486
|
store: e,
|
|
508
487
|
modal: i = !1,
|
|
@@ -511,7 +490,7 @@ var Tt = "div", Nt = J(function(o) {
|
|
|
511
490
|
autoFocusOnShow: s = !0,
|
|
512
491
|
hideOnHoverOutside: l,
|
|
513
492
|
alwaysVisible: r
|
|
514
|
-
} = t, c =
|
|
493
|
+
} = t, c = K(t, [
|
|
515
494
|
"store",
|
|
516
495
|
"modal",
|
|
517
496
|
"portal",
|
|
@@ -525,30 +504,30 @@ var Tt = "div", Nt = J(function(o) {
|
|
|
525
504
|
e,
|
|
526
505
|
process.env.NODE_ENV !== "production" && "Menu must receive a `store` prop or be wrapped in a MenuProvider component."
|
|
527
506
|
);
|
|
528
|
-
const
|
|
529
|
-
c =
|
|
530
|
-
ref: ee(
|
|
507
|
+
const d = U(null), m = e.parent, g = e.menubar, w = !!m, M = !!g && !w;
|
|
508
|
+
c = L(E({}, c), {
|
|
509
|
+
ref: ee(d, c.ref)
|
|
531
510
|
});
|
|
532
|
-
const f =
|
|
511
|
+
const f = Ne(E({
|
|
533
512
|
store: e,
|
|
534
513
|
alwaysVisible: r
|
|
535
514
|
}, c)), { "aria-labelledby": F } = f;
|
|
536
|
-
c =
|
|
537
|
-
const [C, H] = ue(), T = e.useState("autoFocusOnShow"), h = e.useState("initialFocus"), N = e.useState("baseElement"),
|
|
515
|
+
c = K(f, ["aria-labelledby"]);
|
|
516
|
+
const [C, H] = ue(), T = e.useState("autoFocusOnShow"), h = e.useState("initialFocus"), N = e.useState("baseElement"), R = e.useState("renderedItems");
|
|
538
517
|
B(() => {
|
|
539
518
|
let O = !1;
|
|
540
519
|
return H((_) => {
|
|
541
|
-
var
|
|
520
|
+
var X, G, Y;
|
|
542
521
|
if (O || !T) return;
|
|
543
|
-
if ((
|
|
522
|
+
if ((X = _ == null ? void 0 : _.current) != null && X.isConnected) return _;
|
|
544
523
|
const j = Be();
|
|
545
524
|
switch (h) {
|
|
546
525
|
// TODO: Refactor
|
|
547
526
|
case "first":
|
|
548
|
-
j.current = ((
|
|
527
|
+
j.current = ((G = R.find((Z) => !Z.disabled && Z.element)) == null ? void 0 : G.element) || null;
|
|
549
528
|
break;
|
|
550
529
|
case "last":
|
|
551
|
-
j.current = ((
|
|
530
|
+
j.current = ((Y = [...R].reverse().find((Z) => !Z.disabled && Z.element)) == null ? void 0 : Y.element) || null;
|
|
552
531
|
break;
|
|
553
532
|
default:
|
|
554
533
|
j.current = N;
|
|
@@ -557,12 +536,12 @@ var Tt = "div", Nt = J(function(o) {
|
|
|
557
536
|
}), () => {
|
|
558
537
|
O = !0;
|
|
559
538
|
};
|
|
560
|
-
}, [e, T, h,
|
|
561
|
-
const x = w ? !1 : i, p = !!s,
|
|
539
|
+
}, [e, T, h, R, N]);
|
|
540
|
+
const x = w ? !1 : i, p = !!s, D = !!C || !!c.initialFocus || !!x, v = W(
|
|
562
541
|
e.combobox || e,
|
|
563
542
|
"contentElement"
|
|
564
543
|
), A = W(
|
|
565
|
-
(
|
|
544
|
+
(m == null ? void 0 : m.combobox) || m,
|
|
566
545
|
"contentElement"
|
|
567
546
|
), P = je(() => {
|
|
568
547
|
if (!A || !v) return;
|
|
@@ -572,18 +551,18 @@ var Tt = "div", Nt = J(function(o) {
|
|
|
572
551
|
}, [v, A]);
|
|
573
552
|
return P !== void 0 && (c = E({
|
|
574
553
|
preserveTabOrderAnchor: P
|
|
575
|
-
}, c)), c =
|
|
554
|
+
}, c)), c = xe(L(E({
|
|
576
555
|
store: e,
|
|
577
556
|
alwaysVisible: r,
|
|
578
557
|
initialFocus: C,
|
|
579
|
-
autoFocusOnShow: p ?
|
|
558
|
+
autoFocusOnShow: p ? D && s : T || !!x
|
|
580
559
|
}, c), {
|
|
581
560
|
hideOnEscape(O) {
|
|
582
|
-
return
|
|
561
|
+
return Oe(a, O) ? !1 : (e == null || e.hideAll(), !0);
|
|
583
562
|
},
|
|
584
563
|
hideOnHoverOutside(O) {
|
|
585
564
|
const _ = e == null ? void 0 : e.getState().disclosureElement;
|
|
586
|
-
return (typeof l == "function" ? l(O) : l ?? (w ? !0 : M ? _ ? !se(_) : !0 : !1)) ? O.defaultPrevented || !w || !_ || (
|
|
565
|
+
return (typeof l == "function" ? l(O) : l ?? (w ? !0 : M ? _ ? !se(_) : !0 : !1)) ? O.defaultPrevented || !w || !_ || (vt(_, "mouseout", O), !se(_)) ? !0 : (requestAnimationFrame(() => {
|
|
587
566
|
se(_) || e == null || e.hide();
|
|
588
567
|
}), !1) : !1;
|
|
589
568
|
},
|
|
@@ -593,19 +572,19 @@ var Tt = "div", Nt = J(function(o) {
|
|
|
593
572
|
})), c = E({
|
|
594
573
|
"aria-labelledby": F
|
|
595
574
|
}, c), c;
|
|
596
|
-
}),
|
|
575
|
+
}), Nt = Se(
|
|
597
576
|
te(function(o) {
|
|
598
|
-
const t =
|
|
599
|
-
return ne(
|
|
577
|
+
const t = Tt(o);
|
|
578
|
+
return ne(Ct, t);
|
|
600
579
|
}),
|
|
601
580
|
ae
|
|
602
581
|
);
|
|
603
|
-
function
|
|
604
|
-
const o =
|
|
582
|
+
function Rt(n = {}) {
|
|
583
|
+
const o = Te(n);
|
|
605
584
|
return /* @__PURE__ */ y(Ee, { value: o, children: n.children });
|
|
606
585
|
}
|
|
607
|
-
var
|
|
608
|
-
function
|
|
586
|
+
var Dt = "button";
|
|
587
|
+
function It(n, o) {
|
|
609
588
|
return {
|
|
610
589
|
ArrowDown: o === "bottom" || o === "top" ? "first" : !1,
|
|
611
590
|
ArrowUp: o === "bottom" || o === "top" ? "last" : !1,
|
|
@@ -623,7 +602,7 @@ var Lt = J(
|
|
|
623
602
|
focusable: i,
|
|
624
603
|
accessibleWhenDisabled: u,
|
|
625
604
|
showOnHover: a
|
|
626
|
-
} = t, s =
|
|
605
|
+
} = t, s = K(t, [
|
|
627
606
|
"store",
|
|
628
607
|
"focusable",
|
|
629
608
|
"accessibleWhenDisabled",
|
|
@@ -634,46 +613,46 @@ var Lt = J(
|
|
|
634
613
|
e,
|
|
635
614
|
process.env.NODE_ENV !== "production" && "MenuButton must receive a `store` prop or be wrapped in a MenuProvider component."
|
|
636
615
|
);
|
|
637
|
-
const r = U(null), c = e.parent, b = e.menubar,
|
|
616
|
+
const r = U(null), c = e.parent, b = e.menubar, d = !!c, m = !!b && !d, g = ye(s), w = () => {
|
|
638
617
|
const p = r.current;
|
|
639
618
|
p && (e == null || e.setDisclosureElement(p), e == null || e.setAnchorElement(p), e == null || e.show());
|
|
640
619
|
}, M = s.onFocus, f = q((p) => {
|
|
641
|
-
if (M == null || M(p), g || p.defaultPrevented || (e == null || e.setAutoFocusOnShow(!1), e == null || e.setActiveId(null), !b) || !
|
|
642
|
-
const { items:
|
|
643
|
-
Me(
|
|
620
|
+
if (M == null || M(p), g || p.defaultPrevented || (e == null || e.setAutoFocusOnShow(!1), e == null || e.setActiveId(null), !b) || !m) return;
|
|
621
|
+
const { items: D } = b.getState();
|
|
622
|
+
Me(D, p.currentTarget) && w();
|
|
644
623
|
}), F = W(
|
|
645
624
|
e,
|
|
646
625
|
(p) => p.placement.split("-")[0]
|
|
647
626
|
), V = s.onKeyDown, C = q((p) => {
|
|
648
627
|
if (V == null || V(p), g || p.defaultPrevented) return;
|
|
649
|
-
const
|
|
650
|
-
|
|
628
|
+
const D = It(p, F);
|
|
629
|
+
D && (p.preventDefault(), w(), e == null || e.setAutoFocusOnShow(!0), e == null || e.setInitialFocus(D));
|
|
651
630
|
}), H = s.onClick, T = q((p) => {
|
|
652
631
|
if (H == null || H(p), p.defaultPrevented || !e) return;
|
|
653
|
-
const
|
|
654
|
-
(!v ||
|
|
632
|
+
const D = !p.detail, { open: v } = e.getState();
|
|
633
|
+
(!v || D) && ((!d || D) && e.setAutoFocusOnShow(!0), e.setInitialFocus(D ? "first" : "container")), d && w();
|
|
655
634
|
});
|
|
656
635
|
s = fe(
|
|
657
636
|
s,
|
|
658
637
|
(p) => /* @__PURE__ */ y(Ee, { value: e, children: p }),
|
|
659
638
|
[e]
|
|
660
|
-
),
|
|
661
|
-
render: /* @__PURE__ */ y(
|
|
639
|
+
), d && (s = L(E({}, s), {
|
|
640
|
+
render: /* @__PURE__ */ y(Qe.div, { render: s.render })
|
|
662
641
|
}));
|
|
663
|
-
const h =
|
|
642
|
+
const h = Ae(s.id), N = W(
|
|
664
643
|
(c == null ? void 0 : c.combobox) || c,
|
|
665
644
|
"contentElement"
|
|
666
|
-
),
|
|
667
|
-
return s =
|
|
645
|
+
), R = d || m ? ht(N, "menuitem") : void 0, x = e.useState("contentElement");
|
|
646
|
+
return s = L(E({
|
|
668
647
|
id: h,
|
|
669
|
-
role:
|
|
670
|
-
"aria-haspopup":
|
|
648
|
+
role: R,
|
|
649
|
+
"aria-haspopup": bt(x, "menu")
|
|
671
650
|
}, s), {
|
|
672
651
|
ref: ee(r, s.ref),
|
|
673
652
|
onFocus: f,
|
|
674
653
|
onKeyDown: C,
|
|
675
654
|
onClick: T
|
|
676
|
-
}), s =
|
|
655
|
+
}), s = Ce(L(E({
|
|
677
656
|
store: e,
|
|
678
657
|
focusable: i,
|
|
679
658
|
accessibleWhenDisabled: u
|
|
@@ -682,42 +661,69 @@ var Lt = J(
|
|
|
682
661
|
if (!(() => {
|
|
683
662
|
if (typeof a == "function") return a(p);
|
|
684
663
|
if (a != null) return a;
|
|
685
|
-
if (
|
|
664
|
+
if (d) return !0;
|
|
686
665
|
if (!b) return !1;
|
|
687
666
|
const { items: P } = b.getState();
|
|
688
|
-
return
|
|
667
|
+
return m && Me(P);
|
|
689
668
|
})()) return !1;
|
|
690
|
-
const A =
|
|
669
|
+
const A = m ? b : c;
|
|
691
670
|
return A && A.setActiveId(p.currentTarget.id), !0;
|
|
692
671
|
}
|
|
693
|
-
})), s =
|
|
672
|
+
})), s = et(E({
|
|
694
673
|
store: e,
|
|
695
|
-
toggleOnClick: !
|
|
674
|
+
toggleOnClick: !d,
|
|
696
675
|
focusable: i,
|
|
697
676
|
accessibleWhenDisabled: u
|
|
698
|
-
}, s)), s =
|
|
677
|
+
}, s)), s = Fe(E({
|
|
699
678
|
store: e,
|
|
700
|
-
typeahead:
|
|
679
|
+
typeahead: m
|
|
701
680
|
}, s)), s;
|
|
702
681
|
}
|
|
703
|
-
),
|
|
682
|
+
), kt = te(function(o) {
|
|
704
683
|
const t = Lt(o);
|
|
705
|
-
return ne(
|
|
684
|
+
return ne(Dt, t);
|
|
706
685
|
});
|
|
686
|
+
const Vt = /* @__PURE__ */ new Map([
|
|
687
|
+
[
|
|
688
|
+
"bold",
|
|
689
|
+
/* @__PURE__ */ S.createElement(S.Fragment, null, /* @__PURE__ */ S.createElement("path", { d: "M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z" }))
|
|
690
|
+
],
|
|
691
|
+
[
|
|
692
|
+
"duotone",
|
|
693
|
+
/* @__PURE__ */ S.createElement(S.Fragment, null, /* @__PURE__ */ S.createElement("path", { d: "M176,128,96,208V48Z", opacity: "0.2" }), /* @__PURE__ */ S.createElement("path", { d: "M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z" }))
|
|
694
|
+
],
|
|
695
|
+
[
|
|
696
|
+
"fill",
|
|
697
|
+
/* @__PURE__ */ S.createElement(S.Fragment, null, /* @__PURE__ */ S.createElement("path", { d: "M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z" }))
|
|
698
|
+
],
|
|
699
|
+
[
|
|
700
|
+
"light",
|
|
701
|
+
/* @__PURE__ */ S.createElement(S.Fragment, null, /* @__PURE__ */ S.createElement("path", { d: "M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z" }))
|
|
702
|
+
],
|
|
703
|
+
[
|
|
704
|
+
"regular",
|
|
705
|
+
/* @__PURE__ */ S.createElement(S.Fragment, null, /* @__PURE__ */ S.createElement("path", { d: "M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z" }))
|
|
706
|
+
],
|
|
707
|
+
[
|
|
708
|
+
"thin",
|
|
709
|
+
/* @__PURE__ */ S.createElement(S.Fragment, null, /* @__PURE__ */ S.createElement("path", { d: "M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z" }))
|
|
710
|
+
]
|
|
711
|
+
]), Re = S.forwardRef((n, o) => /* @__PURE__ */ S.createElement(Ze, { ref: o, ...n, weights: Vt }));
|
|
712
|
+
Re.displayName = "CaretRightIcon";
|
|
707
713
|
const Bt = ({ item: n }) => {
|
|
708
|
-
const o = n.icon ||
|
|
709
|
-
return /* @__PURE__ */ oe(
|
|
714
|
+
const o = n.icon || $e, t = Te();
|
|
715
|
+
return /* @__PURE__ */ oe(Rt, { store: t, children: [
|
|
710
716
|
/* @__PURE__ */ oe(
|
|
711
|
-
|
|
717
|
+
kt,
|
|
712
718
|
{
|
|
713
719
|
className: "component-menu__item component-menu__item--submenu",
|
|
714
|
-
render: /* @__PURE__ */ y(
|
|
720
|
+
render: /* @__PURE__ */ y(Ye, {}),
|
|
715
721
|
children: [
|
|
716
722
|
/* @__PURE__ */ y(o, { className: "component-menu__item__icon component-menu__item__icon--pictoral" }),
|
|
717
723
|
/* @__PURE__ */ oe("div", { className: "component-menu__item__text", children: [
|
|
718
724
|
/* @__PURE__ */ oe("div", { className: "component-menu__item__text__header", children: [
|
|
719
725
|
/* @__PURE__ */ y("div", { className: "component-menu__item__label", children: n.label }),
|
|
720
|
-
/* @__PURE__ */ y(
|
|
726
|
+
/* @__PURE__ */ y(Re, { className: "component-menu__item__icon component-menu__item__icon--submenu-indicator" })
|
|
721
727
|
] }),
|
|
722
728
|
/* @__PURE__ */ y("p", { className: "component-menu__item__description", children: n.description })
|
|
723
729
|
] })
|
|
@@ -725,7 +731,7 @@ const Bt = ({ item: n }) => {
|
|
|
725
731
|
}
|
|
726
732
|
),
|
|
727
733
|
/* @__PURE__ */ y(
|
|
728
|
-
|
|
734
|
+
Nt,
|
|
729
735
|
{
|
|
730
736
|
gutter: 12,
|
|
731
737
|
shift: 0,
|
|
@@ -740,19 +746,19 @@ const Bt = ({ item: n }) => {
|
|
|
740
746
|
}, jt = ({ item: n }) => {
|
|
741
747
|
switch (n.type) {
|
|
742
748
|
case "action":
|
|
743
|
-
return /* @__PURE__ */ y(
|
|
749
|
+
return /* @__PURE__ */ y(Ie, { item: n });
|
|
744
750
|
case "toggle":
|
|
745
|
-
return /* @__PURE__ */ y(
|
|
751
|
+
return /* @__PURE__ */ y(Ke, { item: n });
|
|
746
752
|
case "submenu":
|
|
747
753
|
return /* @__PURE__ */ y(Bt, { item: n });
|
|
748
754
|
case "separator":
|
|
749
|
-
return /* @__PURE__ */ y(
|
|
755
|
+
return /* @__PURE__ */ y(Le, {});
|
|
750
756
|
}
|
|
751
757
|
};
|
|
752
758
|
export {
|
|
753
|
-
|
|
759
|
+
Rt as M,
|
|
754
760
|
Bt as S,
|
|
755
|
-
|
|
756
|
-
|
|
761
|
+
kt as a,
|
|
762
|
+
Nt as b,
|
|
757
763
|
jt as c
|
|
758
764
|
};
|