@nice2dev/ui 1.4.24 → 1.4.26
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/CHANGELOG.md +51 -0
- package/README.md +2 -4
- package/dist/NiceModuleLifecyclePanel-bsHwj1pO.cjs +1 -0
- package/dist/{NiceStreamDashboard.doc-74KUXya1.cjs → NiceStreamDashboard.doc-CdkHFf4Y.cjs} +2 -2
- package/dist/demo/docs/docPreviews.mjs +347 -373
- package/dist/demo/docs/docRegistry.mjs +4 -59
- package/dist/docs/NiceStreamDashboard.doc.json.mjs +1 -1
- package/dist/documentation/utils.mjs +1 -1
- package/dist/index.cjs +94 -113
- package/dist/index.d.ts +5 -45
- package/dist/index.mjs +778 -780
- package/dist/navigation/NiceDock.mjs +55 -48
- package/dist/navigation/NiceMenuTypes.mjs +197 -251
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +5 -16
- package/dist/navigation.mjs +53 -54
- package/dist/style.css +2 -2
- package/dist/tools/NiceShowcase.mjs +1 -2
- package/package.json +4 -4
- package/dist/NiceDiagram.doc-CASS0Tnj.cjs +0 -8
- package/dist/NiceModuleLifecyclePanel-jckyVqqt.cjs +0 -1
- package/dist/docs/NiceDiagram.doc.json.mjs +0 -32
- package/dist/tools/NiceChat.mjs +0 -98
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useControlId as
|
|
3
|
-
import { forwardRef as
|
|
1
|
+
import { jsxs as l, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useControlId as S, useNiceAccessMode as D, useNiceTranslation as L, useMenuButton as P, useRovingFocus as B, NiceIcon as F, useOverlayFocus as z } from "@nice2dev/ui-core";
|
|
3
|
+
import { forwardRef as j, useState as A, useCallback as T, useRef as I, useLayoutEffect as H } from "react";
|
|
4
4
|
/* empty css */
|
|
5
|
-
const
|
|
6
|
-
/* @__PURE__ */
|
|
5
|
+
const K = [], U = /* @__PURE__ */ Object.assign(
|
|
6
|
+
/* @__PURE__ */ j(
|
|
7
7
|
({
|
|
8
|
-
items:
|
|
9
|
-
activeKey:
|
|
8
|
+
items: m = K,
|
|
9
|
+
activeKey: g,
|
|
10
10
|
collapsed: r = !1,
|
|
11
|
-
width:
|
|
12
|
-
collapsedWidth:
|
|
13
|
-
onItemClick:
|
|
14
|
-
onCollapseChange:
|
|
15
|
-
header:
|
|
16
|
-
footer:
|
|
17
|
-
size:
|
|
18
|
-
className:
|
|
19
|
-
style:
|
|
20
|
-
id:
|
|
21
|
-
accessMode:
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
return
|
|
11
|
+
width: v = 240,
|
|
12
|
+
collapsedWidth: t = 52,
|
|
13
|
+
onItemClick: $,
|
|
14
|
+
onCollapseChange: R,
|
|
15
|
+
header: p,
|
|
16
|
+
footer: b,
|
|
17
|
+
size: y = "md",
|
|
18
|
+
className: C,
|
|
19
|
+
style: M,
|
|
20
|
+
id: _,
|
|
21
|
+
accessMode: f,
|
|
22
|
+
...k
|
|
23
|
+
}, u) => {
|
|
24
|
+
const w = S(_), x = D(f, _), [h, d] = A(/* @__PURE__ */ new Set()), N = T((e) => {
|
|
25
|
+
d((c) => {
|
|
26
|
+
const a = new Set(c);
|
|
27
|
+
return a.has(e) ? a.delete(e) : a.add(e), a;
|
|
28
28
|
});
|
|
29
29
|
}, []);
|
|
30
30
|
if (x === "hidden")
|
|
31
31
|
return null;
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
32
|
+
const s = (e, c = 0) => {
|
|
33
|
+
const a = e.children && e.children.length > 0, i = h.has(e.key), O = e.key === g;
|
|
34
|
+
return /* @__PURE__ */ l("li", { className: "nice-sidebar-menu__item", children: [
|
|
35
|
+
/* @__PURE__ */ l(
|
|
36
36
|
"button",
|
|
37
37
|
{
|
|
38
|
-
className: `nice-sidebar-menu__btn ${
|
|
39
|
-
style: { paddingLeft: r ? void 0 : 12 +
|
|
40
|
-
onClick: () =>
|
|
38
|
+
className: `nice-sidebar-menu__btn ${O ? "nice-sidebar-menu__btn--active" : ""} ${e.disabled ? "nice-sidebar-menu__btn--disabled" : ""}`,
|
|
39
|
+
style: { paddingLeft: r ? void 0 : 12 + c * 16 },
|
|
40
|
+
onClick: () => a ? N(e.key) : $?.(e),
|
|
41
41
|
disabled: e.disabled,
|
|
42
42
|
title: r ? e.text : void 0,
|
|
43
43
|
type: "button",
|
|
@@ -45,129 +45,129 @@ const B = [], J = /* @__PURE__ */ Object.assign(
|
|
|
45
45
|
e.icon && /* @__PURE__ */ n("span", { className: "nice-sidebar-menu__icon", children: e.icon }),
|
|
46
46
|
!r && /* @__PURE__ */ n("span", { className: "nice-sidebar-menu__label", children: e.text }),
|
|
47
47
|
!r && e.badge !== void 0 && /* @__PURE__ */ n("span", { className: "nice-sidebar-menu__badge", children: e.badge }),
|
|
48
|
-
!r &&
|
|
48
|
+
!r && a && /* @__PURE__ */ n("span", { className: "nice-sidebar-menu__chevron", children: /* @__PURE__ */ n(F, { name: i ? "chevron-down" : "chevron-right", size: 14 }) })
|
|
49
49
|
]
|
|
50
50
|
}
|
|
51
51
|
),
|
|
52
|
-
|
|
52
|
+
a && i && !r && /* @__PURE__ */ n("ul", { className: "nice-sidebar-menu__children", children: e.children.map((E) => s(E, c + 1)) })
|
|
53
53
|
] }, e.key);
|
|
54
54
|
};
|
|
55
|
-
return /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ l(
|
|
56
56
|
"nav",
|
|
57
57
|
{
|
|
58
|
-
ref:
|
|
59
|
-
id:
|
|
60
|
-
className: `nice-sidebar-menu nice-sidebar-menu--${
|
|
61
|
-
style: { ...
|
|
62
|
-
|
|
58
|
+
ref: u,
|
|
59
|
+
id: w,
|
|
60
|
+
className: `nice-sidebar-menu nice-sidebar-menu--${y} ${r ? "nice-sidebar-menu--collapsed" : ""} ${C ?? ""}`,
|
|
61
|
+
style: { ...M, width: r ? t : v },
|
|
62
|
+
...k,
|
|
63
63
|
children: [
|
|
64
|
-
|
|
65
|
-
/* @__PURE__ */ n("ul", { className: "nice-sidebar-menu__list", role: "list", children:
|
|
66
|
-
|
|
64
|
+
p && /* @__PURE__ */ n("div", { className: "nice-sidebar-menu__header", children: p }),
|
|
65
|
+
/* @__PURE__ */ n("ul", { className: "nice-sidebar-menu__list", role: "list", children: m.map((e) => s(e)) }),
|
|
66
|
+
b && /* @__PURE__ */ n("div", { className: "nice-sidebar-menu__footer", children: b })
|
|
67
67
|
]
|
|
68
68
|
}
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
71
|
),
|
|
72
72
|
{ displayName: "NiceSidebarMenu" }
|
|
73
|
-
),
|
|
74
|
-
/* @__PURE__ */
|
|
73
|
+
), V = /* @__PURE__ */ Object.assign(
|
|
74
|
+
/* @__PURE__ */ j(
|
|
75
75
|
({
|
|
76
|
-
items:
|
|
77
|
-
activeKey:
|
|
76
|
+
items: m = K,
|
|
77
|
+
activeKey: g,
|
|
78
78
|
onItemClick: r,
|
|
79
|
-
brand:
|
|
80
|
-
actions:
|
|
81
|
-
size:
|
|
82
|
-
className:
|
|
83
|
-
style:
|
|
84
|
-
id:
|
|
85
|
-
accessMode:
|
|
86
|
-
...
|
|
87
|
-
},
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
open:
|
|
79
|
+
brand: v,
|
|
80
|
+
actions: t,
|
|
81
|
+
size: $ = "md",
|
|
82
|
+
className: R,
|
|
83
|
+
style: p,
|
|
84
|
+
id: b,
|
|
85
|
+
accessMode: y,
|
|
86
|
+
...C
|
|
87
|
+
}, M) => {
|
|
88
|
+
const _ = S(b), f = D(y, b), [k, u] = A(null), [w, x] = A(!1), h = I(null), d = I(null);
|
|
89
|
+
B(h, { orientation: "horizontal", wrap: !0, typeahead: !0 }), B(d, { orientation: "vertical", wrap: !0, typeahead: !0 }), z(d, {
|
|
90
|
+
open: k != null && !w,
|
|
91
91
|
modal: !1,
|
|
92
|
-
onClose: () =>
|
|
92
|
+
onClose: () => u(null)
|
|
93
93
|
});
|
|
94
|
-
const
|
|
95
|
-
x(!1),
|
|
96
|
-
},
|
|
94
|
+
const N = (e) => {
|
|
95
|
+
x(!1), u(e);
|
|
96
|
+
}, s = (e) => {
|
|
97
97
|
if (e.key !== "ArrowLeft" && e.key !== "ArrowRight")
|
|
98
98
|
return;
|
|
99
99
|
e.preventDefault();
|
|
100
|
-
const
|
|
101
|
-
...
|
|
102
|
-
],
|
|
103
|
-
|
|
100
|
+
const c = [
|
|
101
|
+
...h.current?.querySelectorAll(".nice-top-menu__btn") ?? []
|
|
102
|
+
], a = c.findIndex((O) => O.getAttribute("aria-expanded") === "true"), i = c[(a + (e.key === "ArrowRight" ? 1 : -1) + c.length) % c.length];
|
|
103
|
+
u(null), i?.focus();
|
|
104
104
|
};
|
|
105
|
-
return
|
|
105
|
+
return f === "hidden" ? null : /* @__PURE__ */ l(
|
|
106
106
|
"nav",
|
|
107
107
|
{
|
|
108
|
-
ref:
|
|
109
|
-
id:
|
|
110
|
-
className: `nice-top-menu nice-top-menu--${
|
|
111
|
-
style:
|
|
112
|
-
...
|
|
108
|
+
ref: M,
|
|
109
|
+
id: _,
|
|
110
|
+
className: `nice-top-menu nice-top-menu--${$} ${R ?? ""}`,
|
|
111
|
+
style: p,
|
|
112
|
+
...C,
|
|
113
113
|
children: [
|
|
114
|
-
|
|
115
|
-
/* @__PURE__ */ n("ul", { className: "nice-top-menu__items", role: "menubar", ref:
|
|
116
|
-
const
|
|
117
|
-
return /* @__PURE__ */
|
|
114
|
+
v && /* @__PURE__ */ n("div", { className: "nice-top-menu__brand", children: v }),
|
|
115
|
+
/* @__PURE__ */ n("ul", { className: "nice-top-menu__items", role: "menubar", ref: h, children: m.map((e) => {
|
|
116
|
+
const c = e.children && e.children.length > 0, a = k === e.key;
|
|
117
|
+
return /* @__PURE__ */ l(
|
|
118
118
|
"li",
|
|
119
119
|
{
|
|
120
120
|
className: "nice-top-menu__item",
|
|
121
121
|
onMouseEnter: () => {
|
|
122
|
-
|
|
122
|
+
c && (x(!0), u(e.key));
|
|
123
123
|
},
|
|
124
|
-
onMouseLeave: () =>
|
|
124
|
+
onMouseLeave: () => c && u(null),
|
|
125
125
|
children: [
|
|
126
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ l(
|
|
127
127
|
"button",
|
|
128
128
|
{
|
|
129
|
-
className: `nice-top-menu__btn ${e.key ===
|
|
130
|
-
onClick: () =>
|
|
131
|
-
onKeyDown: (
|
|
132
|
-
const
|
|
133
|
-
|
|
129
|
+
className: `nice-top-menu__btn ${e.key === g ? "nice-top-menu__btn--active" : ""}`,
|
|
130
|
+
onClick: () => c ? a ? u(null) : N(e.key) : r?.(e),
|
|
131
|
+
onKeyDown: (i) => {
|
|
132
|
+
const O = i.nativeEvent.niceSource;
|
|
133
|
+
c && i.key === "ArrowDown" && O !== "gamepad" && (i.preventDefault(), N(e.key));
|
|
134
134
|
},
|
|
135
135
|
role: "menuitem",
|
|
136
|
-
"aria-haspopup":
|
|
137
|
-
"aria-expanded":
|
|
136
|
+
"aria-haspopup": c,
|
|
137
|
+
"aria-expanded": a,
|
|
138
138
|
disabled: e.disabled,
|
|
139
139
|
type: "button",
|
|
140
140
|
children: [
|
|
141
141
|
e.icon && /* @__PURE__ */ n("span", { children: e.icon }),
|
|
142
142
|
/* @__PURE__ */ n("span", { children: e.text }),
|
|
143
|
-
|
|
143
|
+
c && /* @__PURE__ */ n("span", { className: "nice-top-menu__chevron", children: /* @__PURE__ */ n(F, { name: "chevron-down", size: 14 }) })
|
|
144
144
|
]
|
|
145
145
|
}
|
|
146
146
|
),
|
|
147
|
-
|
|
147
|
+
c && a && /* @__PURE__ */ n(
|
|
148
148
|
"ul",
|
|
149
149
|
{
|
|
150
150
|
className: "nice-top-menu__dropdown",
|
|
151
151
|
role: "menu",
|
|
152
|
-
ref:
|
|
153
|
-
onKeyDown:
|
|
154
|
-
children: e.children.map((
|
|
152
|
+
ref: d,
|
|
153
|
+
onKeyDown: s,
|
|
154
|
+
children: e.children.map((i) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ l(
|
|
155
155
|
"button",
|
|
156
156
|
{
|
|
157
|
-
className: `nice-top-menu__dropdown-btn ${
|
|
157
|
+
className: `nice-top-menu__dropdown-btn ${i.key === g ? "nice-top-menu__dropdown-btn--active" : ""}`,
|
|
158
158
|
onClick: () => {
|
|
159
|
-
r?.(
|
|
159
|
+
r?.(i), u(null);
|
|
160
160
|
},
|
|
161
|
-
disabled:
|
|
161
|
+
disabled: i.disabled,
|
|
162
162
|
role: "menuitem",
|
|
163
163
|
type: "button",
|
|
164
164
|
children: [
|
|
165
|
-
|
|
166
|
-
/* @__PURE__ */ n("span", { children:
|
|
167
|
-
|
|
165
|
+
i.icon && /* @__PURE__ */ n("span", { children: i.icon }),
|
|
166
|
+
/* @__PURE__ */ n("span", { children: i.text }),
|
|
167
|
+
i.badge !== void 0 && /* @__PURE__ */ n("span", { className: "nice-top-menu__badge", children: i.badge })
|
|
168
168
|
]
|
|
169
169
|
}
|
|
170
|
-
) },
|
|
170
|
+
) }, i.key))
|
|
171
171
|
}
|
|
172
172
|
)
|
|
173
173
|
]
|
|
@@ -175,54 +175,54 @@ const B = [], J = /* @__PURE__ */ Object.assign(
|
|
|
175
175
|
e.key
|
|
176
176
|
);
|
|
177
177
|
}) }),
|
|
178
|
-
|
|
178
|
+
t && /* @__PURE__ */ n("div", { className: "nice-top-menu__actions", children: t })
|
|
179
179
|
]
|
|
180
180
|
}
|
|
181
181
|
);
|
|
182
182
|
}
|
|
183
183
|
),
|
|
184
184
|
{ displayName: "NiceTopMenu" }
|
|
185
|
-
),
|
|
186
|
-
/* @__PURE__ */
|
|
185
|
+
), q = [], W = /* @__PURE__ */ Object.assign(
|
|
186
|
+
/* @__PURE__ */ j(
|
|
187
187
|
({
|
|
188
|
-
tabs:
|
|
189
|
-
activeTab:
|
|
188
|
+
tabs: m = q,
|
|
189
|
+
activeTab: g,
|
|
190
190
|
onTabChange: r,
|
|
191
|
-
onItemClick:
|
|
192
|
-
minimized:
|
|
193
|
-
onMinimizeToggle:
|
|
194
|
-
size:
|
|
195
|
-
className:
|
|
196
|
-
style:
|
|
197
|
-
id:
|
|
198
|
-
accessMode:
|
|
199
|
-
...
|
|
200
|
-
},
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
const
|
|
191
|
+
onItemClick: v,
|
|
192
|
+
minimized: t = !1,
|
|
193
|
+
onMinimizeToggle: $,
|
|
194
|
+
size: R = "md",
|
|
195
|
+
className: p,
|
|
196
|
+
style: b,
|
|
197
|
+
id: y,
|
|
198
|
+
accessMode: C,
|
|
199
|
+
...M
|
|
200
|
+
}, _) => {
|
|
201
|
+
const f = I(null);
|
|
202
|
+
B(f, { orientation: "horizontal", wrap: !0, activateOnMove: !0 });
|
|
203
|
+
const k = S(y), u = D(C, y), { t: w } = L(), [x, h] = A(void 0), d = g ?? x ?? m[0]?.key, N = m.find((e) => e.key === d), s = T(
|
|
204
204
|
(e) => {
|
|
205
|
-
|
|
205
|
+
h(e), r?.(e);
|
|
206
206
|
},
|
|
207
207
|
[r]
|
|
208
208
|
);
|
|
209
|
-
return
|
|
209
|
+
return u === "hidden" ? null : /* @__PURE__ */ l(
|
|
210
210
|
"div",
|
|
211
211
|
{
|
|
212
|
-
ref:
|
|
213
|
-
id:
|
|
214
|
-
className: `nice-ribbon-menu nice-ribbon-menu--${
|
|
215
|
-
style:
|
|
216
|
-
...
|
|
212
|
+
ref: _,
|
|
213
|
+
id: k,
|
|
214
|
+
className: `nice-ribbon-menu nice-ribbon-menu--${R} ${t ? "nice-ribbon-menu--minimized" : ""} ${p ?? ""}`,
|
|
215
|
+
style: b,
|
|
216
|
+
...M,
|
|
217
217
|
children: [
|
|
218
|
-
/* @__PURE__ */
|
|
219
|
-
|
|
218
|
+
/* @__PURE__ */ l("div", { className: "nice-ribbon-menu__tabs", ref: f, role: "tablist", children: [
|
|
219
|
+
m.map((e) => /* @__PURE__ */ n(
|
|
220
220
|
"button",
|
|
221
221
|
{
|
|
222
|
-
className: `nice-ribbon-menu__tab ${e.key ===
|
|
223
|
-
onClick: () =>
|
|
222
|
+
className: `nice-ribbon-menu__tab ${e.key === d ? "nice-ribbon-menu__tab--active" : ""}`,
|
|
223
|
+
onClick: () => s(e.key),
|
|
224
224
|
role: "tab",
|
|
225
|
-
"aria-selected": e.key ===
|
|
225
|
+
"aria-selected": e.key === d,
|
|
226
226
|
type: "button",
|
|
227
227
|
children: e.label
|
|
228
228
|
},
|
|
@@ -232,30 +232,30 @@ const B = [], J = /* @__PURE__ */ Object.assign(
|
|
|
232
232
|
"button",
|
|
233
233
|
{
|
|
234
234
|
className: "nice-ribbon-menu__minimize",
|
|
235
|
-
onClick: () =>
|
|
235
|
+
onClick: () => $?.(!t),
|
|
236
236
|
type: "button",
|
|
237
|
-
"aria-label":
|
|
238
|
-
children: /* @__PURE__ */ n(
|
|
237
|
+
"aria-label": t ? w("nav.expand", "Expand") : w("nav.collapse", "Collapse"),
|
|
238
|
+
children: /* @__PURE__ */ n(F, { name: t ? "chevron-down" : "chevron-up", size: 14 })
|
|
239
239
|
}
|
|
240
240
|
)
|
|
241
241
|
] }),
|
|
242
|
-
!
|
|
243
|
-
/* @__PURE__ */ n("div", { className: "nice-ribbon-menu__group-items", children: e.items.map((
|
|
242
|
+
!t && N && /* @__PURE__ */ n("div", { className: "nice-ribbon-menu__panel", role: "tabpanel", children: N.groups.map((e, c) => /* @__PURE__ */ l("div", { className: "nice-ribbon-menu__group", children: [
|
|
243
|
+
/* @__PURE__ */ n("div", { className: "nice-ribbon-menu__group-items", children: e.items.map((a) => /* @__PURE__ */ l(
|
|
244
244
|
"button",
|
|
245
245
|
{
|
|
246
246
|
className: "nice-ribbon-menu__item",
|
|
247
|
-
onClick: () =>
|
|
248
|
-
disabled:
|
|
247
|
+
onClick: () => v?.(a),
|
|
248
|
+
disabled: a.disabled,
|
|
249
249
|
type: "button",
|
|
250
250
|
children: [
|
|
251
|
-
|
|
252
|
-
/* @__PURE__ */ n("span", { className: "nice-ribbon-menu__item-label", children:
|
|
251
|
+
a.icon && /* @__PURE__ */ n("span", { className: "nice-ribbon-menu__item-icon", children: a.icon }),
|
|
252
|
+
/* @__PURE__ */ n("span", { className: "nice-ribbon-menu__item-label", children: a.text })
|
|
253
253
|
]
|
|
254
254
|
},
|
|
255
|
-
|
|
255
|
+
a.key
|
|
256
256
|
)) }),
|
|
257
257
|
/* @__PURE__ */ n("div", { className: "nice-ribbon-menu__group-label", children: e.label })
|
|
258
|
-
] },
|
|
258
|
+
] }, c)) })
|
|
259
259
|
]
|
|
260
260
|
}
|
|
261
261
|
);
|
|
@@ -263,118 +263,65 @@ const B = [], J = /* @__PURE__ */ Object.assign(
|
|
|
263
263
|
),
|
|
264
264
|
{ displayName: "NiceRibbonMenu" }
|
|
265
265
|
), X = /* @__PURE__ */ Object.assign(
|
|
266
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ j(
|
|
267
267
|
({
|
|
268
|
-
items:
|
|
269
|
-
activeKey:
|
|
268
|
+
items: m = K,
|
|
269
|
+
activeKey: g,
|
|
270
270
|
onItemClick: r,
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
className: `nice-dock-menu nice-dock-menu--${y} nice-dock-menu--${C} ${o && !b ? "nice-dock-menu--hidden" : ""} ${h ?? ""}`,
|
|
288
|
-
style: m,
|
|
289
|
-
onMouseEnter: () => v(!0),
|
|
290
|
-
onMouseLeave: () => v(!1),
|
|
291
|
-
onFocus: () => p(!0),
|
|
292
|
-
onBlur: (a) => {
|
|
293
|
-
a.currentTarget.contains(a.relatedTarget) || p(!1);
|
|
294
|
-
},
|
|
295
|
-
...O,
|
|
296
|
-
children: /* @__PURE__ */ n("div", { className: "nice-dock-menu__items", children: _.map((a) => /* @__PURE__ */ t(
|
|
297
|
-
"button",
|
|
298
|
-
{
|
|
299
|
-
className: `nice-dock-menu__item ${a.key === f ? "nice-dock-menu__item--active" : ""}`,
|
|
300
|
-
onClick: () => r?.(a),
|
|
301
|
-
disabled: a.disabled,
|
|
302
|
-
title: a.text,
|
|
303
|
-
"aria-label": a.text,
|
|
304
|
-
type: "button",
|
|
305
|
-
style: { width: k, height: k },
|
|
306
|
-
children: [
|
|
307
|
-
a.icon ? /* @__PURE__ */ n("span", { className: "nice-dock-menu__icon", children: a.icon }) : /* @__PURE__ */ n("span", { children: a.text[0] }),
|
|
308
|
-
a.badge !== void 0 && /* @__PURE__ */ n("span", { className: "nice-dock-menu__badge", children: a.badge })
|
|
309
|
-
]
|
|
310
|
-
},
|
|
311
|
-
a.key
|
|
312
|
-
)) })
|
|
313
|
-
}
|
|
314
|
-
);
|
|
315
|
-
}
|
|
316
|
-
),
|
|
317
|
-
{ displayName: "NiceDockMenu" }
|
|
318
|
-
), Z = /* @__PURE__ */ Object.assign(
|
|
319
|
-
/* @__PURE__ */ S(
|
|
320
|
-
({
|
|
321
|
-
items: _ = B,
|
|
322
|
-
activeKey: f,
|
|
323
|
-
onItemClick: r,
|
|
324
|
-
open: y,
|
|
325
|
-
onOpenChange: o,
|
|
326
|
-
position: k = "left",
|
|
327
|
-
panelWidth: C = 280,
|
|
328
|
-
header: h,
|
|
329
|
-
footer: m,
|
|
330
|
-
size: N = "md",
|
|
331
|
-
className: M,
|
|
332
|
-
style: O,
|
|
333
|
-
id: g,
|
|
334
|
-
accessMode: w,
|
|
335
|
-
...$
|
|
336
|
-
}, d) => {
|
|
337
|
-
const v = D(g), x = E(w, g), { t: p } = K(), [b, a] = T(!1), l = y ?? b, e = A(
|
|
338
|
-
(u) => {
|
|
339
|
-
a(u), o?.(u);
|
|
271
|
+
open: v,
|
|
272
|
+
onOpenChange: t,
|
|
273
|
+
position: $ = "left",
|
|
274
|
+
panelWidth: R = 280,
|
|
275
|
+
header: p,
|
|
276
|
+
footer: b,
|
|
277
|
+
size: y = "md",
|
|
278
|
+
className: C,
|
|
279
|
+
style: M,
|
|
280
|
+
id: _,
|
|
281
|
+
accessMode: f,
|
|
282
|
+
...k
|
|
283
|
+
}, u) => {
|
|
284
|
+
const w = S(_), x = D(f, _), { t: h } = L(), [d, N] = A(!1), s = v ?? d, e = T(
|
|
285
|
+
(o) => {
|
|
286
|
+
N(o), t?.(o);
|
|
340
287
|
},
|
|
341
|
-
[
|
|
342
|
-
),
|
|
343
|
-
(
|
|
344
|
-
r?.(
|
|
288
|
+
[t]
|
|
289
|
+
), c = T(() => e(!s), [s, e]), a = T(
|
|
290
|
+
(o) => {
|
|
291
|
+
r?.(o), e(!1);
|
|
345
292
|
},
|
|
346
293
|
[r, e]
|
|
347
|
-
),
|
|
294
|
+
), i = I(null), O = I(null), E = I(null);
|
|
348
295
|
return H(() => {
|
|
349
|
-
|
|
350
|
-
}, [
|
|
351
|
-
open:
|
|
296
|
+
E.current?.toggleAttribute("inert", !s);
|
|
297
|
+
}, [s]), P(i, O, {
|
|
298
|
+
open: s,
|
|
352
299
|
onOpenChange: e,
|
|
353
300
|
closeOnFocusOut: !1,
|
|
354
301
|
closeOnOutsidePress: !1
|
|
355
|
-
}), x === "hidden" ? null : /* @__PURE__ */
|
|
302
|
+
}), x === "hidden" ? null : /* @__PURE__ */ l(
|
|
356
303
|
"div",
|
|
357
304
|
{
|
|
358
|
-
ref:
|
|
359
|
-
id:
|
|
360
|
-
className: `nice-hamburger-menu nice-hamburger-menu--${
|
|
361
|
-
style:
|
|
362
|
-
|
|
305
|
+
ref: u,
|
|
306
|
+
id: w,
|
|
307
|
+
className: `nice-hamburger-menu nice-hamburger-menu--${y} ${C ?? ""}`,
|
|
308
|
+
style: M,
|
|
309
|
+
...k,
|
|
363
310
|
children: [
|
|
364
311
|
/* @__PURE__ */ n(
|
|
365
312
|
"button",
|
|
366
313
|
{
|
|
367
|
-
ref:
|
|
314
|
+
ref: i,
|
|
368
315
|
className: "nice-hamburger-menu__trigger",
|
|
369
|
-
onClick:
|
|
370
|
-
"aria-label":
|
|
316
|
+
onClick: c,
|
|
317
|
+
"aria-label": h("nav.menu", "Menu"),
|
|
371
318
|
"aria-haspopup": "menu",
|
|
372
|
-
"aria-expanded":
|
|
319
|
+
"aria-expanded": s,
|
|
373
320
|
type: "button",
|
|
374
|
-
children: /* @__PURE__ */
|
|
321
|
+
children: /* @__PURE__ */ l(
|
|
375
322
|
"span",
|
|
376
323
|
{
|
|
377
|
-
className: `nice-hamburger-menu__icon ${
|
|
324
|
+
className: `nice-hamburger-menu__icon ${s ? "nice-hamburger-menu__icon--open" : ""}`,
|
|
378
325
|
children: [
|
|
379
326
|
/* @__PURE__ */ n("span", {}),
|
|
380
327
|
/* @__PURE__ */ n("span", {}),
|
|
@@ -384,31 +331,31 @@ const B = [], J = /* @__PURE__ */ Object.assign(
|
|
|
384
331
|
)
|
|
385
332
|
}
|
|
386
333
|
),
|
|
387
|
-
|
|
388
|
-
/* @__PURE__ */
|
|
334
|
+
s && /* @__PURE__ */ n("div", { className: "nice-hamburger-menu__backdrop", onClick: c, "aria-hidden": !0 }),
|
|
335
|
+
/* @__PURE__ */ l(
|
|
389
336
|
"div",
|
|
390
337
|
{
|
|
391
|
-
ref:
|
|
392
|
-
className: `nice-hamburger-menu__panel nice-hamburger-menu__panel--${
|
|
393
|
-
style: { width:
|
|
338
|
+
ref: E,
|
|
339
|
+
className: `nice-hamburger-menu__panel nice-hamburger-menu__panel--${$} ${s ? "nice-hamburger-menu__panel--open" : ""}`,
|
|
340
|
+
style: { width: R },
|
|
394
341
|
children: [
|
|
395
|
-
|
|
396
|
-
/* @__PURE__ */ n("ul", { className: "nice-hamburger-menu__list", role: "menu", ref:
|
|
342
|
+
p && /* @__PURE__ */ n("div", { className: "nice-hamburger-menu__header", children: p }),
|
|
343
|
+
/* @__PURE__ */ n("ul", { className: "nice-hamburger-menu__list", role: "menu", ref: O, children: m.map((o) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ l(
|
|
397
344
|
"button",
|
|
398
345
|
{
|
|
399
|
-
className: `nice-hamburger-menu__item ${
|
|
400
|
-
onClick: () =>
|
|
401
|
-
disabled:
|
|
346
|
+
className: `nice-hamburger-menu__item ${o.key === g ? "nice-hamburger-menu__item--active" : ""}`,
|
|
347
|
+
onClick: () => a(o),
|
|
348
|
+
disabled: o.disabled,
|
|
402
349
|
role: "menuitem",
|
|
403
350
|
type: "button",
|
|
404
351
|
children: [
|
|
405
|
-
|
|
406
|
-
/* @__PURE__ */ n("span", { children:
|
|
407
|
-
|
|
352
|
+
o.icon && /* @__PURE__ */ n("span", { className: "nice-hamburger-menu__item-icon", children: o.icon }),
|
|
353
|
+
/* @__PURE__ */ n("span", { children: o.text }),
|
|
354
|
+
o.badge !== void 0 && /* @__PURE__ */ n("span", { className: "nice-hamburger-menu__item-badge", children: o.badge })
|
|
408
355
|
]
|
|
409
356
|
}
|
|
410
|
-
) },
|
|
411
|
-
|
|
357
|
+
) }, o.key)) }),
|
|
358
|
+
b && /* @__PURE__ */ n("div", { className: "nice-hamburger-menu__footer", children: b })
|
|
412
359
|
]
|
|
413
360
|
}
|
|
414
361
|
)
|
|
@@ -420,9 +367,8 @@ const B = [], J = /* @__PURE__ */ Object.assign(
|
|
|
420
367
|
{ displayName: "NiceHamburgerMenu" }
|
|
421
368
|
);
|
|
422
369
|
export {
|
|
423
|
-
X as
|
|
424
|
-
|
|
425
|
-
U as
|
|
426
|
-
|
|
427
|
-
Q as NiceTopMenu
|
|
370
|
+
X as NiceHamburgerMenu,
|
|
371
|
+
W as NiceRibbonMenu,
|
|
372
|
+
U as NiceSidebarMenu,
|
|
373
|
+
V as NiceTopMenu
|
|
428
374
|
};
|