@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.
@@ -1,43 +1,43 @@
1
- import { jsx as n, jsxs as t } from "react/jsx-runtime";
2
- import { useControlId as D, useNiceAccessMode as E, useNiceTranslation as K, useMenuButton as P, useRovingFocus as F, NiceIcon as L, useOverlayFocus as z } from "@nice2dev/ui-core";
3
- import { forwardRef as S, useState as T, useCallback as A, useRef as I, useLayoutEffect as H } from "react";
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 B = [], J = /* @__PURE__ */ Object.assign(
6
- /* @__PURE__ */ S(
5
+ const K = [], U = /* @__PURE__ */ Object.assign(
6
+ /* @__PURE__ */ j(
7
7
  ({
8
- items: _ = B,
9
- activeKey: f,
8
+ items: m = K,
9
+ activeKey: g,
10
10
  collapsed: r = !1,
11
- width: y = 240,
12
- collapsedWidth: o = 52,
13
- onItemClick: k,
14
- onCollapseChange: C,
15
- header: h,
16
- footer: m,
17
- size: N = "md",
18
- className: M,
19
- style: O,
20
- id: g,
21
- accessMode: w,
22
- ...$
23
- }, d) => {
24
- const v = D(g), x = E(w, g), [p, b] = T(/* @__PURE__ */ new Set()), a = A((e) => {
25
- b((i) => {
26
- const c = new Set(i);
27
- return c.has(e) ? c.delete(e) : c.add(e), c;
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 l = (e, i = 0) => {
33
- const c = e.children && e.children.length > 0, s = p.has(e.key), R = e.key === f;
34
- return /* @__PURE__ */ t("li", { className: "nice-sidebar-menu__item", children: [
35
- /* @__PURE__ */ t(
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 ${R ? "nice-sidebar-menu__btn--active" : ""} ${e.disabled ? "nice-sidebar-menu__btn--disabled" : ""}`,
39
- style: { paddingLeft: r ? void 0 : 12 + i * 16 },
40
- onClick: () => c ? a(e.key) : k?.(e),
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 && c && /* @__PURE__ */ n("span", { className: "nice-sidebar-menu__chevron", children: /* @__PURE__ */ n(L, { name: s ? "chevron-down" : "chevron-right", size: 14 }) })
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
- c && s && !r && /* @__PURE__ */ n("ul", { className: "nice-sidebar-menu__children", children: e.children.map((j) => l(j, i + 1)) })
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__ */ t(
55
+ return /* @__PURE__ */ l(
56
56
  "nav",
57
57
  {
58
- ref: d,
59
- id: v,
60
- className: `nice-sidebar-menu nice-sidebar-menu--${N} ${r ? "nice-sidebar-menu--collapsed" : ""} ${M ?? ""}`,
61
- style: { ...O, width: r ? o : y },
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
- h && /* @__PURE__ */ n("div", { className: "nice-sidebar-menu__header", children: h }),
65
- /* @__PURE__ */ n("ul", { className: "nice-sidebar-menu__list", role: "list", children: _.map((e) => l(e)) }),
66
- m && /* @__PURE__ */ n("div", { className: "nice-sidebar-menu__footer", children: m })
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
- ), Q = /* @__PURE__ */ Object.assign(
74
- /* @__PURE__ */ S(
73
+ ), V = /* @__PURE__ */ Object.assign(
74
+ /* @__PURE__ */ j(
75
75
  ({
76
- items: _ = B,
77
- activeKey: f,
76
+ items: m = K,
77
+ activeKey: g,
78
78
  onItemClick: r,
79
- brand: y,
80
- actions: o,
81
- size: k = "md",
82
- className: C,
83
- style: h,
84
- id: m,
85
- accessMode: N,
86
- ...M
87
- }, O) => {
88
- const g = D(m), w = E(N, m), [$, d] = T(null), [v, x] = T(!1), p = I(null), b = I(null);
89
- F(p, { orientation: "horizontal", wrap: !0, typeahead: !0 }), F(b, { orientation: "vertical", wrap: !0, typeahead: !0 }), z(b, {
90
- open: $ != null && !v,
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: () => d(null)
92
+ onClose: () => u(null)
93
93
  });
94
- const a = (e) => {
95
- x(!1), d(e);
96
- }, l = (e) => {
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 i = [
101
- ...p.current?.querySelectorAll(".nice-top-menu__btn") ?? []
102
- ], c = i.findIndex((R) => R.getAttribute("aria-expanded") === "true"), s = i[(c + (e.key === "ArrowRight" ? 1 : -1) + i.length) % i.length];
103
- d(null), s?.focus();
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 w === "hidden" ? null : /* @__PURE__ */ t(
105
+ return f === "hidden" ? null : /* @__PURE__ */ l(
106
106
  "nav",
107
107
  {
108
- ref: O,
109
- id: g,
110
- className: `nice-top-menu nice-top-menu--${k} ${C ?? ""}`,
111
- style: h,
112
- ...M,
108
+ ref: M,
109
+ id: _,
110
+ className: `nice-top-menu nice-top-menu--${$} ${R ?? ""}`,
111
+ style: p,
112
+ ...C,
113
113
  children: [
114
- y && /* @__PURE__ */ n("div", { className: "nice-top-menu__brand", children: y }),
115
- /* @__PURE__ */ n("ul", { className: "nice-top-menu__items", role: "menubar", ref: p, children: _.map((e) => {
116
- const i = e.children && e.children.length > 0, c = $ === e.key;
117
- return /* @__PURE__ */ t(
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
- i && (x(!0), d(e.key));
122
+ c && (x(!0), u(e.key));
123
123
  },
124
- onMouseLeave: () => i && d(null),
124
+ onMouseLeave: () => c && u(null),
125
125
  children: [
126
- /* @__PURE__ */ t(
126
+ /* @__PURE__ */ l(
127
127
  "button",
128
128
  {
129
- className: `nice-top-menu__btn ${e.key === f ? "nice-top-menu__btn--active" : ""}`,
130
- onClick: () => i ? c ? d(null) : a(e.key) : r?.(e),
131
- onKeyDown: (s) => {
132
- const R = s.nativeEvent.niceSource;
133
- i && s.key === "ArrowDown" && R !== "gamepad" && (s.preventDefault(), a(e.key));
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": i,
137
- "aria-expanded": c,
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
- i && /* @__PURE__ */ n("span", { className: "nice-top-menu__chevron", children: /* @__PURE__ */ n(L, { name: "chevron-down", size: 14 }) })
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
- i && c && /* @__PURE__ */ n(
147
+ c && a && /* @__PURE__ */ n(
148
148
  "ul",
149
149
  {
150
150
  className: "nice-top-menu__dropdown",
151
151
  role: "menu",
152
- ref: b,
153
- onKeyDown: l,
154
- children: e.children.map((s) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ t(
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 ${s.key === f ? "nice-top-menu__dropdown-btn--active" : ""}`,
157
+ className: `nice-top-menu__dropdown-btn ${i.key === g ? "nice-top-menu__dropdown-btn--active" : ""}`,
158
158
  onClick: () => {
159
- r?.(s), d(null);
159
+ r?.(i), u(null);
160
160
  },
161
- disabled: s.disabled,
161
+ disabled: i.disabled,
162
162
  role: "menuitem",
163
163
  type: "button",
164
164
  children: [
165
- s.icon && /* @__PURE__ */ n("span", { children: s.icon }),
166
- /* @__PURE__ */ n("span", { children: s.text }),
167
- s.badge !== void 0 && /* @__PURE__ */ n("span", { className: "nice-top-menu__badge", children: s.badge })
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
- ) }, s.key))
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
- o && /* @__PURE__ */ n("div", { className: "nice-top-menu__actions", children: o })
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
- ), W = [], U = /* @__PURE__ */ Object.assign(
186
- /* @__PURE__ */ S(
185
+ ), q = [], W = /* @__PURE__ */ Object.assign(
186
+ /* @__PURE__ */ j(
187
187
  ({
188
- tabs: _ = W,
189
- activeTab: f,
188
+ tabs: m = q,
189
+ activeTab: g,
190
190
  onTabChange: r,
191
- onItemClick: y,
192
- minimized: o = !1,
193
- onMinimizeToggle: k,
194
- size: C = "md",
195
- className: h,
196
- style: m,
197
- id: N,
198
- accessMode: M,
199
- ...O
200
- }, g) => {
201
- const w = I(null);
202
- F(w, { orientation: "horizontal", wrap: !0, activateOnMove: !0 });
203
- const $ = D(N), d = E(M, N), { t: v } = K(), [x, p] = T(void 0), b = f ?? x ?? _[0]?.key, a = _.find((e) => e.key === b), l = A(
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
- p(e), r?.(e);
205
+ h(e), r?.(e);
206
206
  },
207
207
  [r]
208
208
  );
209
- return d === "hidden" ? null : /* @__PURE__ */ t(
209
+ return u === "hidden" ? null : /* @__PURE__ */ l(
210
210
  "div",
211
211
  {
212
- ref: g,
213
- id: $,
214
- className: `nice-ribbon-menu nice-ribbon-menu--${C} ${o ? "nice-ribbon-menu--minimized" : ""} ${h ?? ""}`,
215
- style: m,
216
- ...O,
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__ */ t("div", { className: "nice-ribbon-menu__tabs", ref: w, role: "tablist", children: [
219
- _.map((e) => /* @__PURE__ */ n(
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 === b ? "nice-ribbon-menu__tab--active" : ""}`,
223
- onClick: () => l(e.key),
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 === b,
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: () => k?.(!o),
235
+ onClick: () => $?.(!t),
236
236
  type: "button",
237
- "aria-label": o ? v("nav.expand", "Expand") : v("nav.collapse", "Collapse"),
238
- children: /* @__PURE__ */ n(L, { name: o ? "chevron-down" : "chevron-up", size: 14 })
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
- !o && a && /* @__PURE__ */ n("div", { className: "nice-ribbon-menu__panel", role: "tabpanel", children: a.groups.map((e, i) => /* @__PURE__ */ t("div", { className: "nice-ribbon-menu__group", children: [
243
- /* @__PURE__ */ n("div", { className: "nice-ribbon-menu__group-items", children: e.items.map((c) => /* @__PURE__ */ t(
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: () => y?.(c),
248
- disabled: c.disabled,
247
+ onClick: () => v?.(a),
248
+ disabled: a.disabled,
249
249
  type: "button",
250
250
  children: [
251
- c.icon && /* @__PURE__ */ n("span", { className: "nice-ribbon-menu__item-icon", children: c.icon }),
252
- /* @__PURE__ */ n("span", { className: "nice-ribbon-menu__item-label", children: c.text })
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
- c.key
255
+ a.key
256
256
  )) }),
257
257
  /* @__PURE__ */ n("div", { className: "nice-ribbon-menu__group-label", children: e.label })
258
- ] }, i)) })
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__ */ S(
266
+ /* @__PURE__ */ j(
267
267
  ({
268
- items: _ = B,
269
- activeKey: f,
268
+ items: m = K,
269
+ activeKey: g,
270
270
  onItemClick: r,
271
- position: y = "bottom",
272
- autoHide: o = !1,
273
- iconSize: k = 40,
274
- size: C = "md",
275
- className: h,
276
- style: m,
277
- id: N,
278
- accessMode: M,
279
- ...O
280
- }, g) => {
281
- const w = D(N), $ = E(M, N), [d, v] = T(!1), [x, p] = T(!1), b = !o || d || x;
282
- return $ === "hidden" ? null : /* @__PURE__ */ n(
283
- "div",
284
- {
285
- ref: g,
286
- id: w,
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
- [o]
342
- ), i = A(() => e(!l), [l, e]), c = A(
343
- (u) => {
344
- r?.(u), e(!1);
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
- ), s = I(null), R = I(null), j = I(null);
294
+ ), i = I(null), O = I(null), E = I(null);
348
295
  return H(() => {
349
- j.current?.toggleAttribute("inert", !l);
350
- }, [l]), P(s, R, {
351
- open: l,
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__ */ t(
302
+ }), x === "hidden" ? null : /* @__PURE__ */ l(
356
303
  "div",
357
304
  {
358
- ref: d,
359
- id: v,
360
- className: `nice-hamburger-menu nice-hamburger-menu--${N} ${M ?? ""}`,
361
- style: O,
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: s,
314
+ ref: i,
368
315
  className: "nice-hamburger-menu__trigger",
369
- onClick: i,
370
- "aria-label": p("nav.menu", "Menu"),
316
+ onClick: c,
317
+ "aria-label": h("nav.menu", "Menu"),
371
318
  "aria-haspopup": "menu",
372
- "aria-expanded": l,
319
+ "aria-expanded": s,
373
320
  type: "button",
374
- children: /* @__PURE__ */ t(
321
+ children: /* @__PURE__ */ l(
375
322
  "span",
376
323
  {
377
- className: `nice-hamburger-menu__icon ${l ? "nice-hamburger-menu__icon--open" : ""}`,
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
- l && /* @__PURE__ */ n("div", { className: "nice-hamburger-menu__backdrop", onClick: i, "aria-hidden": !0 }),
388
- /* @__PURE__ */ t(
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: j,
392
- className: `nice-hamburger-menu__panel nice-hamburger-menu__panel--${k} ${l ? "nice-hamburger-menu__panel--open" : ""}`,
393
- style: { width: C },
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
- h && /* @__PURE__ */ n("div", { className: "nice-hamburger-menu__header", children: h }),
396
- /* @__PURE__ */ n("ul", { className: "nice-hamburger-menu__list", role: "menu", ref: R, children: _.map((u) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ t(
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 ${u.key === f ? "nice-hamburger-menu__item--active" : ""}`,
400
- onClick: () => c(u),
401
- disabled: u.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
- u.icon && /* @__PURE__ */ n("span", { className: "nice-hamburger-menu__item-icon", children: u.icon }),
406
- /* @__PURE__ */ n("span", { children: u.text }),
407
- u.badge !== void 0 && /* @__PURE__ */ n("span", { className: "nice-hamburger-menu__item-badge", children: u.badge })
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
- ) }, u.key)) }),
411
- m && /* @__PURE__ */ n("div", { className: "nice-hamburger-menu__footer", children: m })
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 NiceDockMenu,
424
- Z as NiceHamburgerMenu,
425
- U as NiceRibbonMenu,
426
- J as NiceSidebarMenu,
427
- Q as NiceTopMenu
370
+ X as NiceHamburgerMenu,
371
+ W as NiceRibbonMenu,
372
+ U as NiceSidebarMenu,
373
+ V as NiceTopMenu
428
374
  };