@nice2dev/ui 1.0.8 → 1.0.11

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 (92) hide show
  1. package/dist/NiceErrorBoundary-B5nF-OVn.cjs +1 -0
  2. package/dist/NiceErrorBoundary-BZEHCXNM.cjs +1 -0
  3. package/dist/NiceErrorBoundary-D6jw6wwD.js +762 -0
  4. package/dist/NiceErrorBoundary-D75yr_WE.js +762 -0
  5. package/dist/NiceForm-BgR-m8T9.cjs +382 -0
  6. package/dist/NiceForm-CKoJA6NG.js +5131 -0
  7. package/dist/NiceForm-D7xnpnRJ.cjs +382 -0
  8. package/dist/NiceForm-DYKciCeR.js +5131 -0
  9. package/dist/NiceForm.css +1 -0
  10. package/dist/NiceModal-1QX7NhyH.js +95 -0
  11. package/dist/NiceModal-Br3J9jOV.cjs +1 -0
  12. package/dist/NiceModal-CAwsKVQ2.cjs +1 -0
  13. package/dist/NiceModal-DVAsBzHP.js +95 -0
  14. package/dist/NiceModuleLifecyclePanel-C9xMSjOF.cjs +1 -0
  15. package/dist/NiceModuleLifecyclePanel-CMrPbSw9.js +5249 -0
  16. package/dist/NiceModuleLifecyclePanel-D3azLDdj.js +5249 -0
  17. package/dist/NiceModuleLifecyclePanel-DEfAIhFf.cjs +1 -0
  18. package/dist/NiceModuleLifecyclePanel.css +1 -0
  19. package/dist/NicePagination-CbB5P1N_.js +171 -0
  20. package/dist/NicePagination-DbE-uOkl.js +171 -0
  21. package/dist/NicePagination-DlealakT.cjs +1 -0
  22. package/dist/NicePagination-UGjzvRUS.cjs +1 -0
  23. package/dist/NicePinCodeInput-B8cI8zu8.js +11830 -0
  24. package/dist/NicePinCodeInput-BmRO9HSQ.js +11830 -0
  25. package/dist/NicePinCodeInput-D91uvVsF.cjs +419 -0
  26. package/dist/NicePinCodeInput-SGQaHvpE.cjs +419 -0
  27. package/dist/NicePinCodeInput.css +1 -1
  28. package/dist/NiceSavedQueryPanel-7nZe46t8.cjs +596 -0
  29. package/dist/NiceSavedQueryPanel-BSGzs7Oc.js +6449 -0
  30. package/dist/NiceSavedQueryPanel-CZ5bYOe_.js +6449 -0
  31. package/dist/NiceSavedQueryPanel-Ce2s060j.cjs +596 -0
  32. package/dist/NiceTabs-BeaxZzAO.js +1636 -0
  33. package/dist/NiceTabs-DcbYFIWR.cjs +1 -0
  34. package/dist/NiceTabs-DvOmxKyQ.cjs +1 -0
  35. package/dist/NiceTabs-DzLHzwuA.js +1636 -0
  36. package/dist/NiceWindow-Bga9fOkg.js +1409 -0
  37. package/dist/NiceWindow-CVgkxcCz.cjs +1 -0
  38. package/dist/NiceWindow-CxWTj5xH.cjs +1 -0
  39. package/dist/NiceWindow-DeC83yfE.js +1409 -0
  40. package/dist/charts-BAS21jkC.js +4621 -0
  41. package/dist/charts-BcvKWYUl.cjs +759 -0
  42. package/dist/charts-DShUbWrP.cjs +759 -0
  43. package/dist/charts-DZvmvfhM.js +4621 -0
  44. package/dist/charts.cjs +1 -1
  45. package/dist/charts.d.ts +42 -45
  46. package/dist/charts.mjs +1 -1
  47. package/dist/core-B4b1BmHt.js +22177 -0
  48. package/dist/core-C2ZmWe_u.cjs +96 -0
  49. package/dist/core-CjmLbclt.cjs +96 -0
  50. package/dist/core-Da43q-pO.js +22094 -0
  51. package/dist/data-branching-CJlrg8qf.cjs +1 -0
  52. package/dist/data-branching-DCUwI53s.js +6121 -0
  53. package/dist/data-branching.cjs +1 -1
  54. package/dist/data-branching.d.ts +1 -38
  55. package/dist/data-branching.mjs +1 -1
  56. package/dist/data.cjs +1 -1
  57. package/dist/data.d.ts +206 -192
  58. package/dist/data.mjs +1 -1
  59. package/dist/devops-CXynFG3X.cjs +17 -0
  60. package/dist/devops-D0TfzV5B.js +7660 -0
  61. package/dist/devops.cjs +1 -1
  62. package/dist/devops.d.ts +1 -38
  63. package/dist/devops.mjs +1 -1
  64. package/dist/editors.cjs +1 -1
  65. package/dist/editors.d.ts +311 -393
  66. package/dist/editors.mjs +61 -64
  67. package/dist/feedback.cjs +1 -1
  68. package/dist/feedback.d.ts +3 -44
  69. package/dist/feedback.mjs +11 -10
  70. package/dist/index-B8wxZ8Ps.cjs +5192 -0
  71. package/dist/index-DlHlXz8e.js +57319 -0
  72. package/dist/index-Dx726U90.cjs +5192 -0
  73. package/dist/index-pAuGTbuB.js +57319 -0
  74. package/dist/index.cjs +1 -1
  75. package/dist/index.css +1 -1
  76. package/dist/index.d.ts +2249 -11141
  77. package/dist/index.mjs +880 -1018
  78. package/dist/lazy.cjs +1 -1
  79. package/dist/lazy.d.ts +7 -39
  80. package/dist/lazy.mjs +24 -24
  81. package/dist/navigation.cjs +1 -1
  82. package/dist/navigation.d.ts +151 -216
  83. package/dist/navigation.mjs +52 -46
  84. package/dist/no-code-B5bzduNP.cjs +332 -0
  85. package/dist/no-code-D8RJ7lx0.js +7064 -0
  86. package/dist/no-code.cjs +1 -1
  87. package/dist/no-code.d.ts +1 -38
  88. package/dist/no-code.mjs +1 -1
  89. package/dist/overlays.cjs +1 -1
  90. package/dist/overlays.d.ts +13 -45
  91. package/dist/overlays.mjs +243 -233
  92. package/package.json +5 -3
package/dist/overlays.mjs CHANGED
@@ -1,66 +1,72 @@
1
- import { N as ie, a as ae, b as ce, c as le, d as se, e as de, f as ue, g as he, h as me, i as fe, j as ve, k as ge, l as be, u as we, m as ye } from "./NiceWindow-SiCaREbq.js";
2
- import { jsxs as Y, Fragment as W, jsx as a } from "react/jsx-runtime";
3
- import { useRef as E, useState as L, useEffect as I, useCallback as g } from "react";
4
- import { createPortal as C } from "react-dom";
5
- import { c as K, t as X, d as O, e as z } from "./core-BpghV7Ls.js";
1
+ import { N as se, a as de, b as ue, c as he, d as fe, e as me, f as ve, g as ge, h as we, i as be, j as ye, k as pe, l as _e, u as Ne, m as ke } from "./NiceWindow-Bga9fOkg.js";
2
+ import { jsxs as H, Fragment as O, jsx as a } from "react/jsx-runtime";
3
+ import { f as j, L as K, a as Q, T as A, Q as U } from "./core-B4b1BmHt.js";
4
+ import { useRef as E, useState as L, useEffect as Y, useCallback as b, useContext as V } from "react";
5
+ import { createPortal as X } from "react-dom";
6
+ function W() {
7
+ const e = V(U);
8
+ return e?.portalTarget ? e.portalTarget : typeof document < "u" ? document.body : null;
9
+ }
6
10
  const F = ({
7
11
  open: e,
8
12
  onClose: o,
9
13
  children: m,
10
14
  title: r,
11
- size: f = "md",
12
- closeOnBackdropClick: s = !0,
13
- closeOnEscape: d = !0,
14
- disableFocusTrap: u = !1,
15
- disableBodyScroll: k = !0,
15
+ size: v = "md",
16
+ closeOnBackdropClick: l = !0,
17
+ closeOnEscape: s = !0,
18
+ disableFocusTrap: d = !1,
19
+ disableBodyScroll: x = !0,
16
20
  zIndex: N = 1e3,
17
- className: p,
21
+ className: k,
18
22
  style: M
19
23
  }) => {
20
- const b = E(null);
21
- K(b, e && !u), I(() => {
22
- if (!k && e) {
23
- const n = document.body.style.overflow;
24
+ const y = E(null);
25
+ j(y, e && !d);
26
+ const p = W();
27
+ Y(() => {
28
+ if (!x && e) {
29
+ const t = document.body.style.overflow;
24
30
  return document.body.style.overflow = "hidden", () => {
25
- document.body.style.overflow = n;
31
+ document.body.style.overflow = t;
26
32
  };
27
33
  }
28
- }, [e, k]), I(() => {
29
- if (!d || !e)
34
+ }, [e, x]), Y(() => {
35
+ if (!s || !e)
30
36
  return;
31
- const n = (l) => {
32
- l.key === "Escape" && (l.preventDefault(), o());
37
+ const t = (g) => {
38
+ g.key === "Escape" && (g.preventDefault(), o());
33
39
  };
34
- return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
35
- }, [d, e, o]);
36
- const w = g(
37
- (n) => {
38
- s && n.target === n.currentTarget && o();
40
+ return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
41
+ }, [s, e, o]);
42
+ const u = b(
43
+ (t) => {
44
+ l && t.target === t.currentTarget && o();
39
45
  },
40
- [s, o]
46
+ [l, o]
41
47
  );
42
48
  if (!e)
43
49
  return null;
44
- const i = {
50
+ const c = {
45
51
  sm: "nice-modal--sm",
46
52
  md: "nice-modal--md",
47
53
  lg: "nice-modal--lg",
48
54
  xl: "nice-modal--xl",
49
55
  full: "nice-modal--full"
50
- }[f];
51
- return C(
56
+ }[v];
57
+ return X(
52
58
  /* @__PURE__ */ a(
53
59
  "div",
54
60
  {
55
61
  className: "nice-modal__overlay",
56
62
  style: { zIndex: N },
57
- onClick: w,
63
+ onClick: u,
58
64
  role: "presentation",
59
65
  children: /* @__PURE__ */ a(
60
66
  "div",
61
67
  {
62
- ref: b,
63
- className: `nice-modal ${i} ${p || ""}`,
68
+ ref: y,
69
+ className: `nice-modal ${c} ${k || ""}`,
64
70
  role: "dialog",
65
71
  "aria-modal": "true",
66
72
  "aria-label": r,
@@ -71,14 +77,14 @@ const F = ({
71
77
  )
72
78
  }
73
79
  ),
74
- document.body
80
+ p
75
81
  );
76
- }, G = ({
82
+ }, ee = ({
77
83
  children: e,
78
84
  showClose: o = !0,
79
85
  onClose: m,
80
86
  className: r
81
- }) => /* @__PURE__ */ Y("div", { className: `nice-modal__header ${r || ""}`, children: [
87
+ }) => /* @__PURE__ */ H("div", { className: `nice-modal__header ${r || ""}`, children: [
82
88
  /* @__PURE__ */ a("div", { className: "nice-modal__title", children: e }),
83
89
  o && m && /* @__PURE__ */ a("button", { type: "button", className: "nice-modal__close", onClick: m, "aria-label": "Close", children: /* @__PURE__ */ a(
84
90
  "svg",
@@ -92,88 +98,90 @@ const F = ({
92
98
  children: /* @__PURE__ */ a("path", { d: "M4 4l12 12M4 16L16 4" })
93
99
  }
94
100
  ) })
95
- ] }), J = ({ children: e, className: o }) => /* @__PURE__ */ a("div", { className: `nice-modal__body ${o || ""}`, children: e }), Q = ({ children: e, className: o }) => /* @__PURE__ */ a("div", { className: `nice-modal__footer ${o || ""}`, children: e }), Z = ({
101
+ ] }), te = ({ children: e, className: o }) => /* @__PURE__ */ a("div", { className: `nice-modal__body ${o || ""}`, children: e }), ne = ({ children: e, className: o }) => /* @__PURE__ */ a("div", { className: `nice-modal__footer ${o || ""}`, children: e }), re = ({
96
102
  open: e,
97
103
  onClose: o,
98
104
  children: m,
99
105
  position: r = "right",
100
- size: f = 320,
101
- title: s,
102
- closeOnBackdropClick: d = !0,
103
- closeOnEscape: u = !0,
104
- swipeToClose: k = !0,
106
+ size: v = 320,
107
+ title: l,
108
+ closeOnBackdropClick: s = !0,
109
+ closeOnEscape: d = !0,
110
+ swipeToClose: x = !0,
105
111
  zIndex: N = 1e3,
106
- className: p,
112
+ className: k,
107
113
  style: M
108
114
  }) => {
109
- const b = E(null), [w, i] = L(!1), [n, l] = L(0);
110
- K(b, e), I(() => {
111
- if (!u || !e)
115
+ const y = E(null), [p, u] = L(!1), [c, t] = L(0);
116
+ j(y, e);
117
+ const g = W();
118
+ Y(() => {
119
+ if (!d || !e)
112
120
  return;
113
- const t = (_) => {
121
+ const n = (_) => {
114
122
  _.key === "Escape" && (_.preventDefault(), o());
115
123
  };
116
- return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
117
- }, [u, e, o]);
118
- const y = g(
119
- (t) => {
124
+ return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
125
+ }, [d, e, o]);
126
+ const h = b(
127
+ (n) => {
120
128
  let _ = 0;
121
129
  switch (r) {
122
130
  case "left":
123
- _ = Math.min(0, t.deltaX);
131
+ _ = Math.min(0, n.deltaX);
124
132
  break;
125
133
  case "right":
126
- _ = Math.max(0, t.deltaX);
134
+ _ = Math.max(0, n.deltaX);
127
135
  break;
128
136
  case "top":
129
- _ = Math.min(0, t.deltaY);
137
+ _ = Math.min(0, n.deltaY);
130
138
  break;
131
139
  case "bottom":
132
- _ = Math.max(0, t.deltaY);
140
+ _ = Math.max(0, n.deltaY);
133
141
  break;
134
142
  }
135
- l(_);
143
+ t(_);
136
144
  },
137
145
  [r]
138
- ), T = g(
139
- (t) => {
140
- let D = !1;
146
+ ), S = b(
147
+ (n) => {
148
+ let R = !1;
141
149
  switch (r) {
142
150
  case "left":
143
- D = t.deltaX < -100;
151
+ R = n.deltaX < -100;
144
152
  break;
145
153
  case "right":
146
- D = t.deltaX > 100;
154
+ R = n.deltaX > 100;
147
155
  break;
148
156
  case "top":
149
- D = t.deltaY < -100;
157
+ R = n.deltaY < -100;
150
158
  break;
151
159
  case "bottom":
152
- D = t.deltaY > 100;
160
+ R = n.deltaY > 100;
153
161
  break;
154
162
  }
155
- D && (X("light"), o()), l(0), i(!1);
163
+ R && (K("light"), o()), t(0), u(!1);
156
164
  },
157
165
  [r, o]
158
- ), { ref: H } = z({
159
- enabled: k && e,
160
- onPanStart: () => i(!0),
161
- onPan: y,
162
- onPanEnd: T
163
- }), P = g(
164
- (t) => {
165
- d && t.target === t.currentTarget && o();
166
+ ), { ref: D } = A({
167
+ enabled: x && e,
168
+ onPanStart: () => u(!0),
169
+ onPan: h,
170
+ onPanEnd: S
171
+ }), P = b(
172
+ (n) => {
173
+ s && n.target === n.currentTarget && o();
166
174
  },
167
- [d, o]
175
+ [s, o]
168
176
  );
169
177
  if (!e)
170
178
  return null;
171
- const R = r === "left" || r === "right", S = R ? { width: typeof f == "number" ? `${f}px` : f } : { height: typeof f == "number" ? `${f}px` : f }, c = () => {
172
- if (w)
173
- return R ? `translateX(${n}px)` : `translateY(${n}px)`;
179
+ const I = r === "left" || r === "right", B = I ? { width: typeof v == "number" ? `${v}px` : v } : { height: typeof v == "number" ? `${v}px` : v }, i = () => {
180
+ if (p)
181
+ return I ? `translateX(${c}px)` : `translateY(${c}px)`;
174
182
  };
175
- return C(
176
- /* @__PURE__ */ Y(W, { children: [
183
+ return X(
184
+ /* @__PURE__ */ H(O, { children: [
177
185
  /* @__PURE__ */ a(
178
186
  "div",
179
187
  {
@@ -185,199 +193,201 @@ const F = ({
185
193
  /* @__PURE__ */ a(
186
194
  "div",
187
195
  {
188
- ref: (t) => {
189
- b.current = t, H.current = t;
196
+ ref: (n) => {
197
+ y.current = n, D.current = n;
190
198
  },
191
- className: `nice-drawer nice-drawer--${r} ${e ? "nice-drawer--open" : ""} ${p || ""}`,
199
+ className: `nice-drawer nice-drawer--${r} ${e ? "nice-drawer--open" : ""} ${k || ""}`,
192
200
  style: {
193
- ...S,
201
+ ...B,
194
202
  zIndex: N + 1,
195
- transform: c(),
196
- transition: w ? "none" : void 0,
203
+ transform: i(),
204
+ transition: p ? "none" : void 0,
197
205
  ...M
198
206
  },
199
207
  role: "dialog",
200
208
  "aria-modal": "true",
201
- "aria-label": s,
209
+ "aria-label": l,
202
210
  tabIndex: -1,
203
211
  children: m
204
212
  }
205
213
  )
206
214
  ] }),
207
- document.body
215
+ g
208
216
  );
209
- }, ee = ({
217
+ }, oe = ({
210
218
  open: e,
211
219
  onClose: o,
212
220
  children: m,
213
221
  title: r,
214
- showHandle: f = !0,
215
- snapPoints: s = [0.5, 0.9],
216
- initialSnap: d = 0,
217
- expandable: u = !0,
218
- closeOnBackdropClick: k = !0,
222
+ showHandle: v = !0,
223
+ snapPoints: l = [0.5, 0.9],
224
+ initialSnap: s = 0,
225
+ expandable: d = !0,
226
+ closeOnBackdropClick: x = !0,
219
227
  closeOnEscape: N = !0,
220
- hapticFeedback: p = !0,
228
+ hapticFeedback: k = !0,
221
229
  zIndex: M = 1e3,
222
- className: b,
223
- style: w
230
+ className: y,
231
+ style: p
224
232
  }) => {
225
- const i = E(null), n = E(null), [l, y] = L(d), [T, H] = L(!1), [P, R] = L(0), S = E(0);
226
- I(() => {
227
- e && (y(d), R(0));
228
- }, [e, d]), K(i, e), I(() => {
233
+ const u = E(null), c = E(null), [t, g] = L(s), [h, S] = L(!1), [D, P] = L(0), I = E(0);
234
+ Y(() => {
235
+ e && (g(s), P(0));
236
+ }, [e, s]), j(u, e);
237
+ const B = W();
238
+ Y(() => {
229
239
  if (!N || !e)
230
240
  return;
231
- const h = (v) => {
232
- v.key === "Escape" && (v.preventDefault(), o());
241
+ const f = (w) => {
242
+ w.key === "Escape" && (w.preventDefault(), o());
233
243
  };
234
- return document.addEventListener("keydown", h), () => document.removeEventListener("keydown", h);
235
- }, [N, e, o]), I(() => {
244
+ return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
245
+ }, [N, e, o]), Y(() => {
236
246
  if (e) {
237
- const h = document.body.style.overflow;
247
+ const f = document.body.style.overflow;
238
248
  return document.body.style.overflow = "hidden", () => {
239
- document.body.style.overflow = h;
249
+ document.body.style.overflow = f;
240
250
  };
241
251
  }
242
252
  }, [e]);
243
- const c = g((h) => {
244
- const v = h.target.closest(".nice-bottom-sheet__handle"), B = n.current, j = !B || B.scrollTop <= 0;
245
- !v && !j || (H(!0), S.current = h.touches[0].clientY);
246
- }, []), t = g(
247
- (h) => {
248
- if (!T)
253
+ const i = b((f) => {
254
+ const w = f.target.closest(".nice-bottom-sheet__handle"), C = c.current, z = !C || C.scrollTop <= 0;
255
+ !w && !z || (S(!0), I.current = f.touches[0].clientY);
256
+ }, []), n = b(
257
+ (f) => {
258
+ if (!h)
249
259
  return;
250
- const v = h.touches[0].clientY - S.current;
251
- (v > 0 || l < s.length - 1) && R(v);
260
+ const w = f.touches[0].clientY - I.current;
261
+ (w > 0 || t < l.length - 1) && P(w);
252
262
  },
253
- [T, l, s.length]
254
- ), _ = g(() => {
255
- if (!T)
263
+ [h, t, l.length]
264
+ ), _ = b(() => {
265
+ if (!h)
256
266
  return;
257
- const h = window.innerHeight;
258
- s[l] * h;
259
- const v = -P, B = h * 0.15;
260
- v > B && u && l < s.length - 1 ? (y(l + 1), p && X("selection")) : v < -B && (l > 0 ? (y(l - 1), p && X("selection")) : (p && X("light"), o())), H(!1), R(0);
261
- }, [T, P, l, s, u, p, o]), D = g(() => {
262
- k && o();
263
- }, [k, o]);
267
+ const f = window.innerHeight;
268
+ l[t] * f;
269
+ const w = -D, C = f * 0.15;
270
+ w > C && d && t < l.length - 1 ? (g(t + 1), k && K("selection")) : w < -C && (t > 0 ? (g(t - 1), k && K("selection")) : (k && K("light"), o())), S(!1), P(0);
271
+ }, [h, D, t, l, d, k, o]), R = b(() => {
272
+ x && o();
273
+ }, [x, o]);
264
274
  if (!e)
265
275
  return null;
266
- const x = s[l] * 100, $ = T ? P : 0;
267
- return C(
268
- /* @__PURE__ */ Y(W, { children: [
276
+ const T = l[t] * 100, $ = h ? D : 0;
277
+ return X(
278
+ /* @__PURE__ */ H(O, { children: [
269
279
  /* @__PURE__ */ a(
270
280
  "div",
271
281
  {
272
282
  className: `nice-bottom-sheet__overlay ${e ? "nice-bottom-sheet__overlay--visible" : ""}`,
273
283
  style: { zIndex: M },
274
- onClick: D
284
+ onClick: R
275
285
  }
276
286
  ),
277
- /* @__PURE__ */ Y(
287
+ /* @__PURE__ */ H(
278
288
  "div",
279
289
  {
280
- ref: i,
281
- className: `nice-bottom-sheet ${e ? "nice-bottom-sheet--open" : ""} ${b || ""}`,
290
+ ref: u,
291
+ className: `nice-bottom-sheet ${e ? "nice-bottom-sheet--open" : ""} ${y || ""}`,
282
292
  style: {
283
293
  zIndex: M + 1,
284
- height: `${x}vh`,
294
+ height: `${T}vh`,
285
295
  transform: `translateY(${Math.max(0, $)}px)`,
286
- transition: T ? "none" : "transform 0.3s ease-out, height 0.3s ease-out",
287
- ...w
296
+ transition: h ? "none" : "transform 0.3s ease-out, height 0.3s ease-out",
297
+ ...p
288
298
  },
289
299
  role: "dialog",
290
300
  "aria-modal": "true",
291
301
  "aria-label": r,
292
302
  tabIndex: -1,
293
- onTouchStart: c,
294
- onTouchMove: t,
303
+ onTouchStart: i,
304
+ onTouchMove: n,
295
305
  onTouchEnd: _,
296
306
  children: [
297
- f && /* @__PURE__ */ a("div", { className: "nice-bottom-sheet__handle", "aria-hidden": "true" }),
307
+ v && /* @__PURE__ */ a("div", { className: "nice-bottom-sheet__handle", "aria-hidden": "true" }),
298
308
  r && /* @__PURE__ */ a("div", { className: "nice-bottom-sheet__title", children: r }),
299
- /* @__PURE__ */ a("div", { ref: n, className: "nice-bottom-sheet__content", children: m })
309
+ /* @__PURE__ */ a("div", { ref: c, className: "nice-bottom-sheet__content", children: m })
300
310
  ]
301
311
  }
302
312
  )
303
313
  ] }),
304
- document.body
314
+ B
305
315
  );
306
- }, te = ({
316
+ }, ae = ({
307
317
  trigger: e,
308
318
  children: o,
309
319
  placement: m = "bottom",
310
320
  triggerMode: r = "click",
311
- open: f,
312
- onOpenChange: s,
313
- hoverDelay: d = 200,
314
- offset: u = 8,
315
- className: k,
321
+ open: v,
322
+ onOpenChange: l,
323
+ hoverDelay: s = 200,
324
+ offset: d = 8,
325
+ className: x,
316
326
  showArrow: N = !0
317
327
  }) => {
318
- const [p, M] = L(!1), b = E(null), w = E(null), i = E(null), n = f !== void 0, l = n ? f : p, y = g(
319
- (c) => {
320
- n || M(c), s?.(c);
328
+ const [k, M] = L(!1), y = E(null), p = E(null), u = E(null), c = W(), t = v !== void 0, g = t ? v : k, h = b(
329
+ (i) => {
330
+ t || M(i), l?.(i);
321
331
  },
322
- [n, s]
332
+ [t, l]
323
333
  );
324
- O(w, () => {
325
- r !== "manual" && l && y(!1);
334
+ Q(p, () => {
335
+ r !== "manual" && g && h(!1);
326
336
  });
327
- const T = g(() => {
328
- r === "click" && y(!l);
329
- }, [r, l, y]), H = g(() => {
330
- r === "hover" && (i.current && window.clearTimeout(i.current), i.current = window.setTimeout(() => y(!0), d));
331
- }, [r, d, y]), P = g(() => {
332
- r === "hover" && (i.current && window.clearTimeout(i.current), i.current = window.setTimeout(() => y(!1), d));
333
- }, [r, d, y]), [R, S] = L({ top: 0, left: 0 });
334
- return I(() => {
335
- if (!l || !b.current || !w.current)
337
+ const S = b(() => {
338
+ r === "click" && h(!g);
339
+ }, [r, g, h]), D = b(() => {
340
+ r === "hover" && (u.current && window.clearTimeout(u.current), u.current = window.setTimeout(() => h(!0), s));
341
+ }, [r, s, h]), P = b(() => {
342
+ r === "hover" && (u.current && window.clearTimeout(u.current), u.current = window.setTimeout(() => h(!1), s));
343
+ }, [r, s, h]), [I, B] = L({ top: 0, left: 0 });
344
+ return Y(() => {
345
+ if (!g || !y.current || !p.current)
336
346
  return;
337
- const c = b.current.getBoundingClientRect(), t = w.current.getBoundingClientRect(), _ = window.innerWidth, D = window.innerHeight;
338
- let x = 0, $ = 0;
339
- const [h, v = "center"] = m.split("-");
340
- switch (h) {
347
+ const i = y.current.getBoundingClientRect(), n = p.current.getBoundingClientRect(), _ = window.innerWidth, R = window.innerHeight;
348
+ let T = 0, $ = 0;
349
+ const [f, w = "center"] = m.split("-");
350
+ switch (f) {
341
351
  case "top":
342
- x = c.top - t.height - u, $ = c.left + (c.width - t.width) / 2;
352
+ T = i.top - n.height - d, $ = i.left + (i.width - n.width) / 2;
343
353
  break;
344
354
  case "bottom":
345
- x = c.bottom + u, $ = c.left + (c.width - t.width) / 2;
355
+ T = i.bottom + d, $ = i.left + (i.width - n.width) / 2;
346
356
  break;
347
357
  case "left":
348
- x = c.top + (c.height - t.height) / 2, $ = c.left - t.width - u;
358
+ T = i.top + (i.height - n.height) / 2, $ = i.left - n.width - d;
349
359
  break;
350
360
  case "right":
351
- x = c.top + (c.height - t.height) / 2, $ = c.right + u;
361
+ T = i.top + (i.height - n.height) / 2, $ = i.right + d;
352
362
  break;
353
363
  }
354
- h === "top" || h === "bottom" ? (v === "start" && ($ = c.left), v === "end" && ($ = c.right - t.width)) : (v === "start" && (x = c.top), v === "end" && (x = c.bottom - t.height)), $ = Math.max(8, Math.min(_ - t.width - 8, $)), x = Math.max(8, Math.min(D - t.height - 8, x)), S({ top: x, left: $ });
355
- }, [l, m, u]), /* @__PURE__ */ Y(W, { children: [
364
+ f === "top" || f === "bottom" ? (w === "start" && ($ = i.left), w === "end" && ($ = i.right - n.width)) : (w === "start" && (T = i.top), w === "end" && (T = i.bottom - n.height)), $ = Math.max(8, Math.min(_ - n.width - 8, $)), T = Math.max(8, Math.min(R - n.height - 8, T)), B({ top: T, left: $ });
365
+ }, [g, m, d]), /* @__PURE__ */ H(O, { children: [
356
366
  /* @__PURE__ */ a(
357
367
  "div",
358
368
  {
359
- ref: b,
369
+ ref: y,
360
370
  className: "nice-popover__trigger",
361
- onClick: T,
362
- onMouseEnter: H,
371
+ onClick: S,
372
+ onMouseEnter: D,
363
373
  onMouseLeave: P,
364
374
  style: { display: "inline-block" },
365
375
  children: e
366
376
  }
367
377
  ),
368
- l && C(
369
- /* @__PURE__ */ Y(
378
+ g && X(
379
+ /* @__PURE__ */ H(
370
380
  "div",
371
381
  {
372
- ref: w,
373
- className: `nice-popover nice-popover--${m} ${k || ""}`,
382
+ ref: p,
383
+ className: `nice-popover nice-popover--${m} ${x || ""}`,
374
384
  style: {
375
385
  position: "fixed",
376
- top: R.top,
377
- left: R.left,
386
+ top: I.top,
387
+ left: I.left,
378
388
  zIndex: 1100
379
389
  },
380
- onMouseEnter: H,
390
+ onMouseEnter: D,
381
391
  onMouseLeave: P,
382
392
  role: "tooltip",
383
393
  children: [
@@ -386,97 +396,97 @@ const F = ({
386
396
  ]
387
397
  }
388
398
  ),
389
- document.body
399
+ c
390
400
  )
391
401
  ] });
392
- }, ne = ({
402
+ }, ie = ({
393
403
  items: e,
394
404
  children: o,
395
405
  onOpen: m,
396
406
  onClose: r,
397
- className: f
407
+ className: v
398
408
  }) => {
399
- const [s, d] = L(!1), [u, k] = L({ x: 0, y: 0 }), N = E(null), p = E(null);
400
- O(N, () => {
401
- s && (d(!1), r?.());
409
+ const [l, s] = L(!1), [d, x] = L({ x: 0, y: 0 }), N = E(null), k = E(null), M = W();
410
+ Q(N, () => {
411
+ l && (s(!1), r?.());
402
412
  });
403
- const M = g(
404
- (i) => {
405
- i.preventDefault(), k({ x: i.clientX, y: i.clientY }), d(!0), m?.();
413
+ const y = b(
414
+ (c) => {
415
+ c.preventDefault(), x({ x: c.clientX, y: c.clientY }), s(!0), m?.();
406
416
  },
407
417
  [m]
408
- ), b = g(
409
- (i) => {
410
- !i.disabled && i.onClick && (i.onClick(), d(!1), r?.());
418
+ ), p = b(
419
+ (c) => {
420
+ !c.disabled && c.onClick && (c.onClick(), s(!1), r?.());
411
421
  },
412
422
  [r]
413
423
  );
414
- I(() => {
415
- if (!s)
424
+ Y(() => {
425
+ if (!l)
416
426
  return;
417
- const i = (n) => {
418
- n.key === "Escape" && (d(!1), r?.());
427
+ const c = (t) => {
428
+ t.key === "Escape" && (s(!1), r?.());
419
429
  };
420
- return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
421
- }, [s, r]);
422
- const w = (i) => /* @__PURE__ */ a("ul", { className: "nice-context-menu__list", role: "menu", children: i.map((n) => n.divider ? /* @__PURE__ */ a("li", { className: "nice-context-menu__divider", role: "separator" }, n.key) : /* @__PURE__ */ a("li", { role: "presentation", children: /* @__PURE__ */ Y(
430
+ return document.addEventListener("keydown", c), () => document.removeEventListener("keydown", c);
431
+ }, [l, r]);
432
+ const u = (c) => /* @__PURE__ */ a("ul", { className: "nice-context-menu__list", role: "menu", children: c.map((t) => t.divider ? /* @__PURE__ */ a("li", { className: "nice-context-menu__divider", role: "separator" }, t.key) : /* @__PURE__ */ a("li", { role: "presentation", children: /* @__PURE__ */ H(
423
433
  "button",
424
434
  {
425
435
  type: "button",
426
- className: `nice-context-menu__item ${n.disabled ? "nice-context-menu__item--disabled" : ""} ${n.danger ? "nice-context-menu__item--danger" : ""}`,
436
+ className: `nice-context-menu__item ${t.disabled ? "nice-context-menu__item--disabled" : ""} ${t.danger ? "nice-context-menu__item--danger" : ""}`,
427
437
  role: "menuitem",
428
- disabled: n.disabled,
429
- onClick: () => b(n),
438
+ disabled: t.disabled,
439
+ onClick: () => p(t),
430
440
  children: [
431
- n.icon && /* @__PURE__ */ a("span", { className: "nice-context-menu__icon", children: n.icon }),
432
- /* @__PURE__ */ a("span", { className: "nice-context-menu__label", children: n.label })
441
+ t.icon && /* @__PURE__ */ a("span", { className: "nice-context-menu__icon", children: t.icon }),
442
+ /* @__PURE__ */ a("span", { className: "nice-context-menu__label", children: t.label })
433
443
  ]
434
444
  }
435
- ) }, n.key)) });
436
- return /* @__PURE__ */ Y(W, { children: [
437
- /* @__PURE__ */ a("div", { ref: p, onContextMenu: M, style: { display: "contents" }, children: o }),
438
- s && C(
445
+ ) }, t.key)) });
446
+ return /* @__PURE__ */ H(O, { children: [
447
+ /* @__PURE__ */ a("div", { ref: k, onContextMenu: y, style: { display: "contents" }, children: o }),
448
+ l && X(
439
449
  /* @__PURE__ */ a(
440
450
  "div",
441
451
  {
442
452
  ref: N,
443
- className: `nice-context-menu ${f || ""}`,
453
+ className: `nice-context-menu ${v || ""}`,
444
454
  style: {
445
455
  position: "fixed",
446
- left: u.x,
447
- top: u.y,
456
+ left: d.x,
457
+ top: d.y,
448
458
  zIndex: 1200
449
459
  },
450
460
  role: "menu",
451
- children: w(e)
461
+ children: u(e)
452
462
  }
453
463
  ),
454
- document.body
464
+ M
455
465
  )
456
466
  ] });
457
467
  };
458
468
  export {
459
- ie as NiceActionSheet,
460
- ae as NiceBlockUI,
461
- ee as NiceBottomSheet,
462
- ce as NiceBox,
463
- le as NiceCommandPaletteProvider,
464
- ne as NiceContextMenu,
465
- Z as NiceDrawer,
466
- se as NiceLoadPanel,
469
+ se as NiceActionSheet,
470
+ de as NiceBlockUI,
471
+ oe as NiceBottomSheet,
472
+ ue as NiceBox,
473
+ he as NiceCommandPaletteProvider,
474
+ ie as NiceContextMenu,
475
+ re as NiceDrawer,
476
+ fe as NiceLoadPanel,
467
477
  F as NiceModal,
468
- J as NiceModalBody,
469
- Q as NiceModalFooter,
470
- G as NiceModalHeader,
471
- te as NiceOverlayPopover,
472
- de as NicePopover,
473
- ue as NiceResizable,
474
- he as NiceResponsiveBox,
475
- me as NiceScrollView,
476
- fe as NiceTutorial,
477
- ve as NiceTutorialProvider,
478
- ge as NiceWindow,
479
- be as NiceWindowManager,
480
- we as useCommandPalette,
481
- ye as useRegisterCommands
478
+ te as NiceModalBody,
479
+ ne as NiceModalFooter,
480
+ ee as NiceModalHeader,
481
+ ae as NiceOverlayPopover,
482
+ me as NicePopover,
483
+ ve as NiceResizable,
484
+ ge as NiceResponsiveBox,
485
+ we as NiceScrollView,
486
+ be as NiceTutorial,
487
+ ye as NiceTutorialProvider,
488
+ pe as NiceWindow,
489
+ _e as NiceWindowManager,
490
+ Ne as useCommandPalette,
491
+ ke as useRegisterCommands
482
492
  };