@nice2dev/ui 1.4.20 → 1.4.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/dist/NiceGantt-Drl4gvw9.cjs +1 -0
  3. package/dist/{NiceGantt.doc-B6YZcJvG.cjs → NiceGantt.doc-DTv0r7bP.cjs} +2 -2
  4. package/dist/NiceModuleLifecyclePanel-jckyVqqt.cjs +1 -0
  5. package/dist/NiceWindow-DQyf5wat.cjs +1 -0
  6. package/dist/{core-lazy-BhQxFuLf.cjs → core-lazy-DirbU7jp.cjs} +1 -1
  7. package/dist/display/NiceDocumentApprovalFlow.mjs +67 -89
  8. package/dist/display/NiceLeaderboard.mjs +47 -40
  9. package/dist/display/NiceQuestCard.mjs +93 -76
  10. package/dist/docs/NiceGantt.doc.json.mjs +9 -9
  11. package/dist/documentation/utils.mjs +1 -1
  12. package/dist/index.cjs +94 -94
  13. package/dist/index.d.ts +58 -2
  14. package/dist/index.mjs +778 -776
  15. package/dist/navigation/NiceMenu.mjs +249 -248
  16. package/dist/navigation.cjs +1 -1
  17. package/dist/navigation.d.ts +6 -0
  18. package/dist/overlays/NiceResponsiveBox.mjs +51 -24
  19. package/dist/overlays/NiceTutorial.mjs +136 -127
  20. package/dist/overlays.cjs +1 -1
  21. package/dist/overlays.d.ts +25 -2
  22. package/dist/planning/NiceGantt.mjs +130 -121
  23. package/dist/planning/NiceStepper.mjs +36 -35
  24. package/dist/style.css +2 -2
  25. package/dist/tools/NiceDraggable.mjs +44 -29
  26. package/dist/tools/NiceSortable.mjs +66 -48
  27. package/dist/tools/NiceSpeechToText.mjs +67 -52
  28. package/dist/tools/NiceValidationBuilder.mjs +210 -119
  29. package/dist/tools/NiceViewRegistry.mjs +67 -34
  30. package/package.json +4 -4
  31. package/dist/NiceBottomSheet.doc-keq-Fzlz.cjs +0 -8
  32. package/dist/NiceGantt-BygumlaY.cjs +0 -1
  33. package/dist/NiceModuleLifecyclePanel-DAIbzfZd.cjs +0 -1
  34. package/dist/NiceWindow-BklnkBpu.cjs +0 -1
  35. package/dist/docs/NiceBottomSheet.doc.json.mjs +0 -32
@@ -1,239 +1,240 @@
1
- import { jsxs as N, jsx as s, Fragment as $e } from "react/jsx-runtime";
2
- import { useNiceTranslation as Ve, useComponentDisplayClass as Je, useComponentDisplayStyle as Qe, NiceThemeContext as We, useNiceAccessMode as Ze, NiceIcon as ke } from "@nice2dev/ui-core";
3
- import { useContext as Ye, useId as Ge, useState as B, useRef as O, useEffect as se, useCallback as I, useLayoutEffect as Xe, useMemo as en } from "react";
4
- import { createPortal as nn } from "react-dom";
1
+ import { jsxs as x, jsx as s, Fragment as Le } from "react/jsx-runtime";
2
+ import { useNiceTranslation as Je, useComponentDisplayClass as Qe, useComponentDisplayStyle as We, NiceThemeContext as Ze, useNiceAccessMode as Ye, NiceIcon as $e } from "@nice2dev/ui-core";
3
+ import { useContext as Ge, useId as Xe, useState as K, useRef as q, useEffect as oe, useCallback as R, useLayoutEffect as en, useMemo as nn } from "react";
4
+ import { createPortal as tn } from "react-dom";
5
5
  /* empty css */
6
- const tn = [];
7
- function H(a) {
8
- return (a.id ?? a.key ?? "") + "";
6
+ const rn = [];
7
+ function U(c) {
8
+ return (c.id ?? c.key ?? "") + "";
9
9
  }
10
- function Le(a) {
11
- return a.label ?? a.text ?? "";
10
+ function Me(c) {
11
+ return c.label ?? c.text ?? "";
12
12
  }
13
- function oe(a) {
14
- return a.children ?? a.items;
13
+ function ae(c) {
14
+ return c.children ?? c.items;
15
15
  }
16
- function _e(a) {
17
- const o = oe(a);
16
+ function _e(c) {
17
+ const o = ae(c);
18
18
  return !o || o.length === 0;
19
19
  }
20
- function we(a, o) {
20
+ function we(c, o) {
21
21
  if (!o)
22
22
  return !1;
23
- if (H(a) === o)
23
+ if (U(c) === o)
24
24
  return !0;
25
- const b = oe(a);
26
- return b ? b.some((C) => we(C, o)) : !1;
25
+ const p = ae(c);
26
+ return p ? p.some((C) => we(C, o)) : !1;
27
27
  }
28
- const rn = ({
29
- items: a = tn,
28
+ const sn = ({
29
+ items: c = rn,
30
30
  orientation: o = "horizontal",
31
- variant: b = "ghost",
31
+ variant: p = "ghost",
32
32
  density: C = "normal",
33
- size: D = "md",
34
- loading: _ = !1,
35
- fullWidth: z = !1,
36
- showDividers: F = !1,
33
+ size: z = "md",
34
+ loading: v = !1,
35
+ fullWidth: F = !1,
36
+ showDividers: P = !1,
37
37
  panelAlign: m = "start",
38
- panelMinWidth: h = 200,
39
- panelMaxWidth: K = 360,
38
+ panelAnchor: N = "item",
39
+ panelMinWidth: g = 200,
40
+ panelMaxWidth: V = 360,
40
41
  itemGap: E,
41
- paddingX: g,
42
- paddingY: k,
43
- portal: w = !0,
44
- panelZIndex: q = 1100,
45
- arrowIcon: ae = /* @__PURE__ */ s(ke, { name: "chevron-down", size: 14 }),
46
- flyoutArrowIcon: ce = /* @__PURE__ */ s(ke, { name: "chevron-right", size: 14 }),
47
- closeOnSelect: v = !0,
48
- openTrigger: f = "click",
49
- openDelay: A = 120,
50
- closeDelay: ie = 180,
51
- onOpenChange: U,
52
- activeId: ye,
53
- activeKey: r,
54
- onItemClick: y,
55
- ariaLabel: $,
56
- renderTriggerLabel: le,
57
- renderEntryLabel: p,
58
- maxDepth: V = 3,
59
- className: ue,
60
- "data-testid": J,
61
- style: Q,
62
- id: R,
63
- accessMode: W,
64
- displayStyle: Z
42
+ paddingX: k,
43
+ paddingY: $,
44
+ portal: h = !0,
45
+ panelZIndex: A = 1100,
46
+ arrowIcon: ce = /* @__PURE__ */ s($e, { name: "chevron-down", size: 14 }),
47
+ flyoutArrowIcon: b = /* @__PURE__ */ s($e, { name: "chevron-right", size: 14 }),
48
+ closeOnSelect: L = !0,
49
+ openTrigger: _ = "click",
50
+ openDelay: ie = 120,
51
+ closeDelay: J = 180,
52
+ onOpenChange: le,
53
+ activeId: r,
54
+ activeKey: M,
55
+ onItemClick: w,
56
+ ariaLabel: ye,
57
+ renderTriggerLabel: f,
58
+ renderEntryLabel: Q,
59
+ maxDepth: ue = 3,
60
+ className: W,
61
+ "data-testid": Z,
62
+ style: Y,
63
+ id: T,
64
+ accessMode: de,
65
+ displayStyle: xe
65
66
  }) => {
66
- const { t: Ie } = Ve(), De = $ ?? Ie("menu.menu", "Menu"), ze = Je("menu", Z), Fe = Qe("menu", Z), xe = Ye(We)?.portalTarget ?? (typeof document < "u" ? document.body : null), de = Ze(W, R), Re = de === "hidden", me = de === "disabled" || de === "readOnly" || _, Ne = Ge(), fe = ye ?? r, Pe = Math.min(10, Math.max(1, V)), [i, Y] = B(null), [Te, P] = B([]), G = O(null), X = O(null);
67
- se(() => {
68
- U?.(i);
69
- }, [i, U]);
70
- const x = I(() => {
71
- G.current != null && (window.clearTimeout(G.current), G.current = null), X.current != null && (window.clearTimeout(X.current), X.current = null);
67
+ const { t: De } = Je(), Re = ye ?? De("menu.menu", "Menu"), ze = Qe("menu", xe), Fe = We("menu", xe), Ce = Ge(Ze)?.portalTarget ?? (typeof document < "u" ? document.body : null), me = Ye(de, T), Pe = me === "hidden", fe = me === "disabled" || me === "readOnly" || v, Ne = Xe(), pe = r ?? M, Te = Math.min(10, Math.max(1, ue)), [i, G] = K(null), [Se, S] = K([]), X = q(null), ee = q(null);
68
+ oe(() => {
69
+ le?.(i);
70
+ }, [i, le]);
71
+ const y = R(() => {
72
+ X.current != null && (window.clearTimeout(X.current), X.current = null), ee.current != null && (window.clearTimeout(ee.current), ee.current = null);
72
73
  }, []);
73
- se(() => () => x(), [x]);
74
- const Se = I(
74
+ oe(() => () => y(), [y]);
75
+ const je = R(
75
76
  (e) => {
76
- x(), i !== e && (G.current = window.setTimeout(
77
+ y(), i !== e && (X.current = window.setTimeout(
77
78
  () => {
78
- Y(e), P([]);
79
+ G(e), S([]);
79
80
  },
80
- Math.max(0, A)
81
+ Math.max(0, ie)
81
82
  ));
82
83
  },
83
- [x, i, A]
84
- ), Ce = I(() => {
85
- x(), X.current = window.setTimeout(
84
+ [y, i, ie]
85
+ ), ge = R(() => {
86
+ y(), ee.current = window.setTimeout(
86
87
  () => {
87
- Y(null), P([]);
88
+ G(null), S([]);
88
89
  },
89
- Math.max(0, ie)
90
+ Math.max(0, J)
90
91
  );
91
- }, [x, ie]), [ee, L] = B(-1), [je, pe] = B(-1), [ne, he] = B(null), ve = O(null), te = O(null), T = O(/* @__PURE__ */ new Map()), S = I(() => {
92
+ }, [y, J]), [ne, I] = K(-1), [Be, ve] = K(-1), [te, he] = K(null), j = q(null), re = q(null), B = q(/* @__PURE__ */ new Map()), O = R(() => {
92
93
  if (!i) {
93
94
  he(null);
94
95
  return;
95
96
  }
96
- const e = T.current.get(i);
97
+ const e = B.current.get(i);
97
98
  if (!e)
98
99
  return;
99
100
  const n = e.getBoundingClientRect();
100
101
  if (o === "vertical")
101
102
  he({ left: n.right, top: n.top, width: n.width });
102
103
  else {
103
- const t = te.current?.offsetWidth ?? Math.max(h, n.width);
104
- let c = n.left;
105
- m === "end" ? c = n.right - t : m === "center" && (c = n.left + n.width / 2 - t / 2), he({ left: c, top: n.bottom, width: n.width });
104
+ const t = re.current?.offsetWidth ?? Math.max(g, n.width), a = N === "menu" && j.current ? j.current.getBoundingClientRect() : n;
105
+ let l = a.left;
106
+ m === "end" ? l = a.right - t : m === "center" && (l = a.left + a.width / 2 - t / 2), he({ left: l, top: n.bottom, width: n.width });
106
107
  }
107
- }, [i, o, m, h]);
108
- Xe(() => {
109
- if (w && (S(), i && (m === "end" || m === "center"))) {
110
- const e = requestAnimationFrame(S);
108
+ }, [i, o, m, N, g]);
109
+ en(() => {
110
+ if (h && (O(), i && (m === "end" || m === "center"))) {
111
+ const e = requestAnimationFrame(O);
111
112
  return () => cancelAnimationFrame(e);
112
113
  }
113
- }, [w, S, i, m]), se(() => {
114
- if (!w || !i)
114
+ }, [h, O, i, m]), oe(() => {
115
+ if (!h || !i)
115
116
  return;
116
- const e = () => S();
117
+ const e = () => O();
117
118
  return window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
118
119
  window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
119
120
  };
120
- }, [w, i, S]);
121
- const j = en(() => a.filter((e) => H(e).length > 0), [a]), M = I(() => {
122
- Y(null), P([]), pe(-1);
121
+ }, [h, i, O]);
122
+ const H = nn(() => c.filter((e) => U(e).length > 0), [c]), D = R(() => {
123
+ G(null), S([]), ve(-1);
123
124
  }, []);
124
- se(() => {
125
+ oe(() => {
125
126
  if (!i)
126
127
  return;
127
128
  const e = (t) => {
128
- const c = t.target;
129
- ve.current && ve.current.contains(c) || te.current && te.current.contains(c) || M();
129
+ const a = t.target;
130
+ j.current && j.current.contains(a) || re.current && re.current.contains(a) || D();
130
131
  }, n = (t) => {
131
- t.key === "Escape" && M();
132
+ t.key === "Escape" && D();
132
133
  };
133
134
  return document.addEventListener("mousedown", e), document.addEventListener("keydown", n), () => {
134
135
  document.removeEventListener("mousedown", e), document.removeEventListener("keydown", n);
135
136
  };
136
- }, [i, M]);
137
+ }, [i, D]);
137
138
  const be = (e, n) => {
138
- if (e.disabled || me)
139
+ if (e.disabled || fe)
139
140
  return;
140
- const t = H(e);
141
+ const t = U(e);
141
142
  if (_e(e)) {
142
- e.onClick?.(n), y?.(e, n), v && M();
143
+ e.onClick?.(n), w?.(e, n), L && D();
143
144
  return;
144
145
  }
145
- P([]), Y(i === t ? null : t), pe(-1);
146
- }, Be = I((e, n) => {
147
- P((t) => {
148
- const c = e - 2;
149
- if (c < 0)
146
+ S([]), G(i === t ? null : t), ve(-1);
147
+ }, Oe = R((e, n) => {
148
+ S((t) => {
149
+ const a = e - 2;
150
+ if (a < 0)
150
151
  return t;
151
- if (t[c] === n)
152
- return t.slice(0, c);
153
- const u = t.slice(0, c);
154
- return u[c] = n, u;
152
+ if (t[a] === n)
153
+ return t.slice(0, a);
154
+ const d = t.slice(0, a);
155
+ return d[a] = n, d;
155
156
  });
156
- }, []), Oe = (e, n) => {
157
- e.disabled || (e.onClick?.(n), y?.(e, n), v && M());
158
- }, He = (e) => {
159
- if (me)
157
+ }, []), He = (e, n) => {
158
+ e.disabled || (e.onClick?.(n), w?.(e, n), L && D());
159
+ }, Ke = (e) => {
160
+ if (fe)
160
161
  return;
161
- const n = o === "horizontal", t = n ? "ArrowLeft" : "ArrowUp", c = n ? "ArrowRight" : "ArrowDown";
162
+ const n = o === "horizontal", t = n ? "ArrowLeft" : "ArrowUp", a = n ? "ArrowRight" : "ArrowDown";
162
163
  if (e.key === t)
163
- e.preventDefault(), L((d) => d <= 0 ? j.length - 1 : d - 1);
164
- else if (e.key === c)
165
- e.preventDefault(), L((d) => d >= j.length - 1 ? 0 : d + 1);
164
+ e.preventDefault(), I((l) => l <= 0 ? H.length - 1 : l - 1);
165
+ else if (e.key === a)
166
+ e.preventDefault(), I((l) => l >= H.length - 1 ? 0 : l + 1);
166
167
  else if (e.key === "Home")
167
- e.preventDefault(), L(0);
168
+ e.preventDefault(), I(0);
168
169
  else if (e.key === "End")
169
- e.preventDefault(), L(j.length - 1);
170
+ e.preventDefault(), I(H.length - 1);
170
171
  else if (e.key === "Enter" || e.key === " ") {
171
172
  e.preventDefault();
172
- const d = j[ee];
173
- d && be(d, e);
174
- } else e.key === "Escape" && M();
173
+ const l = H[ne];
174
+ l && be(l, e);
175
+ } else e.key === "Escape" && D();
175
176
  };
176
- if (Re)
177
+ if (Pe)
177
178
  return null;
178
- const Ke = [
179
+ const qe = [
179
180
  "nice-menu",
180
181
  `nice-menu--orientation-${o}`,
181
- `nice-menu--variant-${b}`,
182
+ `nice-menu--variant-${p}`,
182
183
  `nice-menu--density-${C}`,
183
- `nice-menu--size-${D}`,
184
- z ? "nice-menu--full-width" : "",
185
- F ? "nice-menu--show-dividers" : "",
186
- _ ? "nice-menu--loading" : "",
184
+ `nice-menu--size-${z}`,
185
+ F ? "nice-menu--full-width" : "",
186
+ P ? "nice-menu--show-dividers" : "",
187
+ v ? "nice-menu--loading" : "",
187
188
  ze ?? "",
188
- ue ?? ""
189
- ].filter(Boolean).join(" "), re = {
189
+ W ?? ""
190
+ ].filter(Boolean).join(" "), se = {
190
191
  ...Fe,
191
- ...Q,
192
- "--nice-menu-panel-min-w": `${h}px`,
193
- "--nice-menu-panel-max-w": `${K}px`
192
+ ...Y,
193
+ "--nice-menu-panel-min-w": `${g}px`,
194
+ "--nice-menu-panel-max-w": `${V}px`
194
195
  };
195
- return E !== void 0 && (re["--nice-menu-gap"] = typeof E == "number" ? `${E}px` : E), g !== void 0 && (re["--nice-menu-padding-x"] = typeof g == "number" ? `${g}px` : g), k !== void 0 && (re["--nice-menu-padding-y"] = typeof k == "number" ? `${k}px` : k), /* @__PURE__ */ N(
196
+ return E !== void 0 && (se["--nice-menu-gap"] = typeof E == "number" ? `${E}px` : E), k !== void 0 && (se["--nice-menu-padding-x"] = typeof k == "number" ? `${k}px` : k), $ !== void 0 && (se["--nice-menu-padding-y"] = typeof $ == "number" ? `${$}px` : $), /* @__PURE__ */ x(
196
197
  "nav",
197
198
  {
198
- id: R,
199
- ref: ve,
200
- className: Ke,
201
- style: re,
202
- "data-testid": J,
203
- "aria-label": De,
204
- "aria-busy": _ || void 0,
199
+ id: T,
200
+ ref: j,
201
+ className: qe,
202
+ style: se,
203
+ "data-testid": Z,
204
+ "aria-label": Re,
205
+ "aria-busy": v || void 0,
205
206
  children: [
206
- _ && /* @__PURE__ */ s("span", { className: "nice-menu__spinner", "aria-hidden": "true", children: /* @__PURE__ */ s("span", { className: "nice-spinner nice-spinner--sm" }) }),
207
- /* @__PURE__ */ s("ul", { className: "nice-menu__list", role: "menubar", onKeyDown: He, tabIndex: 0, children: j.map((e, n) => {
208
- const t = H(e), c = i === t, d = !!fe && we(e, fe), u = !_e(e), qe = [
207
+ v && /* @__PURE__ */ s("span", { className: "nice-menu__spinner", "aria-hidden": "true", children: /* @__PURE__ */ s("span", { className: "nice-spinner nice-spinner--sm" }) }),
208
+ /* @__PURE__ */ s("ul", { className: "nice-menu__list", role: "menubar", onKeyDown: Ke, tabIndex: 0, children: H.map((e, n) => {
209
+ const t = U(e), a = i === t, l = !!pe && we(e, pe), d = !_e(e), Ue = [
209
210
  "nice-menu__item",
210
- c ? "nice-menu__item--open" : "",
211
- d ? "nice-menu__item--active" : "",
211
+ a ? "nice-menu__item--open" : "",
212
+ l ? "nice-menu__item--active" : "",
212
213
  e.disabled ? "nice-menu__item--disabled" : "",
213
214
  e.danger ? "nice-menu__item--danger" : "",
214
- u ? "nice-menu__item--has-children" : "",
215
- ee === n ? "nice-menu__item--focused" : ""
216
- ].filter(Boolean).join(" "), Ae = le ? le(e) : Le(e), Ee = /* @__PURE__ */ N($e, { children: [
215
+ d ? "nice-menu__item--has-children" : "",
216
+ ne === n ? "nice-menu__item--focused" : ""
217
+ ].filter(Boolean).join(" "), Ve = f ? f(e) : Me(e), Ee = /* @__PURE__ */ x(Le, { children: [
217
218
  e.icon ? /* @__PURE__ */ s("span", { className: "nice-menu__icon", children: e.icon }) : null,
218
- /* @__PURE__ */ s("span", { className: "nice-menu__label", children: Ae }),
219
+ /* @__PURE__ */ s("span", { className: "nice-menu__label", children: Ve }),
219
220
  e.badge != null ? /* @__PURE__ */ s("span", { className: "nice-menu__badge", children: e.badge }) : null,
220
- u ? /* @__PURE__ */ s("span", { className: "nice-menu__arrow", "aria-hidden": !0, children: ae }) : null
221
+ d ? /* @__PURE__ */ s("span", { className: "nice-menu__arrow", "aria-hidden": !0, children: ce }) : null
221
222
  ] });
222
- return /* @__PURE__ */ N(
223
+ return /* @__PURE__ */ x(
223
224
  "li",
224
225
  {
225
- className: qe,
226
+ className: Ue,
226
227
  role: "none",
227
228
  "data-nice-menu-id": t,
228
229
  "data-nice-depth": 1,
229
- onMouseEnter: u && (f === "hover" || f === "both") ? () => Se(t) : void 0,
230
- onMouseLeave: u && (f === "hover" || f === "both") ? () => Ce() : void 0,
230
+ onMouseEnter: d && (_ === "hover" || _ === "both") ? () => je(t) : void 0,
231
+ onMouseLeave: d && (_ === "hover" || _ === "both") ? () => ge() : void 0,
231
232
  children: [
232
- e.href && !u ? /* @__PURE__ */ s(
233
+ e.href && !d ? /* @__PURE__ */ s(
233
234
  "a",
234
235
  {
235
- ref: (l) => {
236
- l ? T.current.set(t, l) : T.current.delete(t);
236
+ ref: (u) => {
237
+ u ? B.current.set(t, u) : B.current.delete(t);
237
238
  },
238
239
  className: "nice-menu__btn",
239
240
  href: e.href,
@@ -242,67 +243,67 @@ const rn = ({
242
243
  role: "menuitem",
243
244
  "aria-disabled": e.disabled || void 0,
244
245
  "aria-label": e.ariaLabel,
245
- tabIndex: ee === n ? 0 : -1,
246
- onClick: (l) => be(e, l),
247
- onFocus: () => L(n),
246
+ tabIndex: ne === n ? 0 : -1,
247
+ onClick: (u) => be(e, u),
248
+ onFocus: () => I(n),
248
249
  children: Ee
249
250
  }
250
251
  ) : /* @__PURE__ */ s(
251
252
  "button",
252
253
  {
253
- ref: (l) => {
254
- l ? T.current.set(t, l) : T.current.delete(t);
254
+ ref: (u) => {
255
+ u ? B.current.set(t, u) : B.current.delete(t);
255
256
  },
256
257
  type: "button",
257
258
  className: "nice-menu__btn",
258
- disabled: e.disabled || me,
259
+ disabled: e.disabled || fe,
259
260
  role: "menuitem",
260
- "aria-haspopup": u || void 0,
261
- "aria-expanded": u ? c : void 0,
262
- "aria-controls": u ? `${Ne}-panel-${t}` : void 0,
261
+ "aria-haspopup": d || void 0,
262
+ "aria-expanded": d ? a : void 0,
263
+ "aria-controls": d ? `${Ne}-panel-${t}` : void 0,
263
264
  "aria-label": e.ariaLabel,
264
- tabIndex: ee === n ? 0 : -1,
265
- onClick: (l) => be(e, l),
266
- onFocus: () => L(n),
265
+ tabIndex: ne === n ? 0 : -1,
266
+ onClick: (u) => be(e, u),
267
+ onFocus: () => I(n),
267
268
  children: Ee
268
269
  }
269
270
  ),
270
- u && c ? (() => {
271
- const l = w && typeof document < "u" && !!ne && !!xe, Ue = l ? {
271
+ d && a ? (() => {
272
+ const u = h && typeof document < "u" && !!te && !!Ce, Ae = u ? {
272
273
  position: "fixed",
273
- left: ne.left,
274
- top: ne.top,
275
- minWidth: Math.max(h, ne.width),
276
- maxWidth: K,
277
- zIndex: q
278
- } : { zIndex: q }, ge = /* @__PURE__ */ s(
279
- Me,
274
+ left: te.left,
275
+ top: te.top,
276
+ minWidth: Math.max(g, te.width),
277
+ maxWidth: V,
278
+ zIndex: A
279
+ } : { zIndex: A }, ke = /* @__PURE__ */ s(
280
+ Ie,
280
281
  {
281
- items: oe(e) ?? [],
282
+ items: ae(e) ?? [],
282
283
  depth: 2,
283
- maxDepth: Pe,
284
- openPath: Te,
285
- onToggleBranch: Be,
286
- onLeafClick: Oe,
287
- effectiveActiveId: fe,
288
- renderEntryLabel: p,
289
- flyoutArrowIcon: ce,
290
- openTrigger: f,
291
- onPanelEnter: () => x(),
292
- onPanelLeave: () => Ce(),
284
+ maxDepth: Te,
285
+ openPath: Se,
286
+ onToggleBranch: Oe,
287
+ onLeafClick: He,
288
+ effectiveActiveId: pe,
289
+ renderEntryLabel: Q,
290
+ flyoutArrowIcon: b,
291
+ openTrigger: _,
292
+ onPanelEnter: () => y(),
293
+ onPanelLeave: () => ge(),
293
294
  panelClassName: [
294
295
  "nice-menu__panel",
295
296
  `nice-menu__panel--align-${m}`,
296
- l ? "nice-menu__panel--portal" : ""
297
+ u ? "nice-menu__panel--portal" : ""
297
298
  ].filter(Boolean).join(" "),
298
- panelStyle: Ue,
299
+ panelStyle: Ae,
299
300
  panelId: `${Ne}-panel-${t}`,
300
- panelRef: l ? te : void 0,
301
- focusedEntryIdx: je,
302
- setFocusedEntryIdx: pe
301
+ panelRef: u ? re : void 0,
302
+ focusedEntryIdx: Be,
303
+ setFocusedEntryIdx: ve
303
304
  }
304
305
  );
305
- return l ? nn(ge, xe) : ge;
306
+ return u ? tn(ke, Ce) : ke;
306
307
  })() : null
307
308
  ]
308
309
  },
@@ -313,124 +314,124 @@ const rn = ({
313
314
  }
314
315
  );
315
316
  };
316
- process.env.NODE_ENV !== "production" && (rn.displayName = "NiceMenu");
317
- function Me({
318
- items: a,
317
+ process.env.NODE_ENV !== "production" && (sn.displayName = "NiceMenu");
318
+ function Ie({
319
+ items: c,
319
320
  depth: o,
320
- maxDepth: b,
321
+ maxDepth: p,
321
322
  openPath: C,
322
- onToggleBranch: D,
323
- onLeafClick: _,
324
- effectiveActiveId: z,
325
- renderEntryLabel: F,
323
+ onToggleBranch: z,
324
+ onLeafClick: v,
325
+ effectiveActiveId: F,
326
+ renderEntryLabel: P,
326
327
  flyoutArrowIcon: m,
327
- openTrigger: h,
328
- onPanelEnter: K,
329
- onPanelLeave: E,
330
- panelClassName: g,
328
+ openTrigger: N,
329
+ onPanelEnter: g,
330
+ onPanelLeave: V,
331
+ panelClassName: E,
331
332
  panelStyle: k,
332
- panelId: w,
333
- panelRef: q,
334
- focusedEntryIdx: ae,
333
+ panelId: $,
334
+ panelRef: h,
335
+ focusedEntryIdx: A,
335
336
  setFocusedEntryIdx: ce
336
337
  }) {
337
- const v = Math.min(Math.max(o, 1), 10), f = o === 2, A = g ?? (f ? "nice-menu__panel" : "nice-menu__subpanel"), U = { ...{
338
- "--nice-row-bg": `var(--nice-menu-level-${v}-bg, var(--nice-bg-elevated, var(--nice-bg-primary)))`,
339
- "--nice-row-text": `var(--nice-menu-level-${v}-text, var(--nice-text-primary))`,
340
- "--nice-row-border": `var(--nice-menu-level-${v}-border, var(--nice-border-color))`,
341
- "--nice-row-hover-bg": `var(--nice-menu-level-${v}-hover-bg, var(--nice-hover-bg))`,
342
- "--nice-row-active-bg": `var(--nice-menu-level-${v}-active-bg, var(--nice-selected-bg))`
338
+ const b = Math.min(Math.max(o, 1), 10), L = o === 2, _ = E ?? (L ? "nice-menu__panel" : "nice-menu__subpanel"), J = { ...{
339
+ "--nice-row-bg": `var(--nice-menu-level-${b}-bg, var(--nice-bg-elevated, var(--nice-bg-primary)))`,
340
+ "--nice-row-text": `var(--nice-menu-level-${b}-text, var(--nice-text-primary))`,
341
+ "--nice-row-border": `var(--nice-menu-level-${b}-border, var(--nice-border-color))`,
342
+ "--nice-row-hover-bg": `var(--nice-menu-level-${b}-hover-bg, var(--nice-hover-bg))`,
343
+ "--nice-row-active-bg": `var(--nice-menu-level-${b}-active-bg, var(--nice-selected-bg))`
343
344
  }, ...k ?? {} };
344
345
  return /* @__PURE__ */ s(
345
346
  "div",
346
347
  {
347
- ref: q,
348
- id: w,
349
- className: A,
350
- style: U,
348
+ ref: h,
349
+ id: $,
350
+ className: _,
351
+ style: J,
351
352
  role: "menu",
352
353
  "data-nice-depth": o,
353
- ...h === "hover" || h === "both" ? { onMouseEnter: K, onMouseLeave: E } : {},
354
- children: a.map((r, y) => {
354
+ ...N === "hover" || N === "both" ? { onMouseEnter: g, onMouseLeave: V } : {},
355
+ children: c.map((r, M) => {
355
356
  if (r.divider)
356
- return /* @__PURE__ */ s("hr", { className: "nice-menu__divider" }, `d-${y}`);
357
- const $ = H(r), p = !_e(r) && o < b, V = C[o - 2] === $, ue = !!z && we(r, z), J = [
357
+ return /* @__PURE__ */ s("hr", { className: "nice-menu__divider" }, `d-${M}`);
358
+ const w = U(r), f = !_e(r) && o < p, Q = C[o - 2] === w, ue = !!F && we(r, F), W = [
358
359
  "nice-menu__entry",
359
360
  r.disabled ? "nice-menu__entry--disabled" : "",
360
361
  r.danger ? "nice-menu__entry--danger" : "",
361
362
  ue ? "nice-menu__entry--active" : "",
362
- f && ae === y ? "nice-menu__entry--focused" : ""
363
- ].filter(Boolean).join(" "), Q = /* @__PURE__ */ N($e, { children: [
363
+ L && A === M ? "nice-menu__entry--focused" : ""
364
+ ].filter(Boolean).join(" "), Z = /* @__PURE__ */ x(Le, { children: [
364
365
  r.icon ? /* @__PURE__ */ s("span", { className: "nice-menu__icon", children: r.icon }) : null,
365
- /* @__PURE__ */ N("span", { className: "nice-menu__entry-content", children: [
366
- /* @__PURE__ */ N("span", { className: "nice-menu__entry-label", children: [
367
- F ? F(r) : Le(r),
366
+ /* @__PURE__ */ x("span", { className: "nice-menu__entry-content", children: [
367
+ /* @__PURE__ */ x("span", { className: "nice-menu__entry-label", children: [
368
+ P ? P(r) : Me(r),
368
369
  r.badge != null ? /* @__PURE__ */ s("span", { className: "nice-menu__badge", children: r.badge }) : null
369
370
  ] }),
370
371
  r.description ? /* @__PURE__ */ s("span", { className: "nice-menu__entry-desc", children: r.description }) : null
371
372
  ] }),
372
- p ? /* @__PURE__ */ s("span", { className: "nice-menu__entry-arrow", "aria-hidden": !0, children: m }) : null
373
- ] }), R = (Z) => {
374
- p ? D(o, $) : _(r, Z);
375
- }, W = f ? () => ce?.(y) : void 0;
376
- return /* @__PURE__ */ N(
373
+ f ? /* @__PURE__ */ s("span", { className: "nice-menu__entry-arrow", "aria-hidden": !0, children: m }) : null
374
+ ] }), Y = (de) => {
375
+ f ? z(o, w) : v(r, de);
376
+ }, T = L ? () => ce?.(M) : void 0;
377
+ return /* @__PURE__ */ x(
377
378
  "div",
378
379
  {
379
380
  style: { position: "relative" },
380
- onMouseEnter: p ? () => D(o, $) : void 0,
381
+ onMouseEnter: f ? () => z(o, w) : void 0,
381
382
  children: [
382
- r.href && !p ? /* @__PURE__ */ s(
383
+ r.href && !f ? /* @__PURE__ */ s(
383
384
  "a",
384
385
  {
385
- className: J,
386
+ className: W,
386
387
  href: r.href,
387
388
  target: r.target,
388
389
  rel: r.rel,
389
390
  role: "menuitem",
390
391
  "aria-disabled": r.disabled || void 0,
391
392
  "aria-label": r.ariaLabel,
392
- onClick: R,
393
- onFocus: W,
394
- children: Q
393
+ onClick: Y,
394
+ onFocus: T,
395
+ children: Z
395
396
  }
396
397
  ) : /* @__PURE__ */ s(
397
398
  "button",
398
399
  {
399
400
  type: "button",
400
- className: J,
401
+ className: W,
401
402
  disabled: r.disabled,
402
403
  role: "menuitem",
403
- "aria-haspopup": p || void 0,
404
- "aria-expanded": p ? V : void 0,
404
+ "aria-haspopup": f || void 0,
405
+ "aria-expanded": f ? Q : void 0,
405
406
  "aria-label": r.ariaLabel,
406
- onClick: R,
407
- onFocus: W,
408
- children: Q
407
+ onClick: Y,
408
+ onFocus: T,
409
+ children: Z
409
410
  }
410
411
  ),
411
- p && V ? /* @__PURE__ */ s(
412
- Me,
412
+ f && Q ? /* @__PURE__ */ s(
413
+ Ie,
413
414
  {
414
- items: oe(r) ?? [],
415
+ items: ae(r) ?? [],
415
416
  depth: o + 1,
416
- maxDepth: b,
417
+ maxDepth: p,
417
418
  openPath: C,
418
- onToggleBranch: D,
419
- onLeafClick: _,
420
- effectiveActiveId: z,
421
- renderEntryLabel: F,
419
+ onToggleBranch: z,
420
+ onLeafClick: v,
421
+ effectiveActiveId: F,
422
+ renderEntryLabel: P,
422
423
  flyoutArrowIcon: m,
423
- openTrigger: h
424
+ openTrigger: N
424
425
  }
425
426
  ) : null
426
427
  ]
427
428
  },
428
- $ || `c-${y}`
429
+ w || `c-${M}`
429
430
  );
430
431
  })
431
432
  }
432
433
  );
433
434
  }
434
435
  export {
435
- rn as NiceMenu
436
+ sn as NiceMenu
436
437
  };