@nice2dev/ui 1.0.31 → 1.1.5

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 (84) hide show
  1. package/CHANGELOG.md +353 -0
  2. package/dist/NiceCodeEditor-BVUwp9yX.js +1134 -0
  3. package/dist/NiceCodeEditor-cIqUSk3j.cjs +260 -0
  4. package/dist/NiceColorPicker-C8NZZcXE.js +596 -0
  5. package/dist/NiceColorPicker-CKVbjicN.cjs +1 -0
  6. package/dist/NiceConfirmDialog-DmBX1Iea.js +81 -0
  7. package/dist/NiceConfirmDialog-oSxVpsCs.cjs +1 -0
  8. package/dist/NiceDataGrid-3AIf2D3t.cjs +10 -0
  9. package/dist/NiceDataGrid-CXCUAkRb.js +1736 -0
  10. package/dist/NiceDocumentViewer-B-uEPZAf.js +672 -0
  11. package/dist/NiceDocumentViewer-BE0gKBlw.cjs +180 -0
  12. package/dist/NiceForm-C6F0HvrX.cjs +1 -0
  13. package/dist/NiceForm-CCyfWgIs.js +4805 -0
  14. package/dist/NiceGantt-CSFLZD2y.js +328 -0
  15. package/dist/NiceGantt-_ysNSVYR.cjs +1 -0
  16. package/dist/NiceHtmlEditor-B8B8AcSC.js +841 -0
  17. package/dist/NiceHtmlEditor-D8RQcBNp.cjs +10 -0
  18. package/dist/NiceLoginForm-Bai7aN8V.js +708 -0
  19. package/dist/NiceLoginForm-BrvIc-wq.cjs +1 -0
  20. package/dist/NiceMention-CWoLD0SE.js +11082 -0
  21. package/dist/NiceMention-J1lUDLhg.cjs +430 -0
  22. package/dist/NiceMention.css +1 -0
  23. package/dist/NiceModal-0UxviEYE.cjs +1 -0
  24. package/dist/NiceModal-D-iOonog.js +95 -0
  25. package/dist/NiceModuleLifecyclePanel-4hzDw6it.js +6999 -0
  26. package/dist/NiceModuleLifecyclePanel-Df_1k5qW.cjs +1 -0
  27. package/dist/NiceModuleLifecyclePanel.css +1 -1
  28. package/dist/NicePagination-CPn-Q1h_.js +172 -0
  29. package/dist/NicePagination-EEQ6o1dF.cjs +1 -0
  30. package/dist/NicePivotGrid-Cmiolup9.cjs +152 -0
  31. package/dist/NicePivotGrid-DX_iUj2X.js +1167 -0
  32. package/dist/NiceSavedQueryPanel-BhjFJBvn.cjs +586 -0
  33. package/dist/NiceSavedQueryPanel-KvyXTnFx.js +5129 -0
  34. package/dist/NiceScheduler-DuxPzQQZ.js +1645 -0
  35. package/dist/NiceScheduler-nW7fMzKL.cjs +5 -0
  36. package/dist/NiceSelect-BVoqtfYN.cjs +1 -0
  37. package/dist/NiceSelect-DHowflmX.js +433 -0
  38. package/dist/NiceWindow-DdD9k4nc.cjs +1 -0
  39. package/dist/NiceWindow-xnTSHdHv.js +1623 -0
  40. package/dist/charts-B-sl1V9y.cjs +882 -0
  41. package/dist/charts-DO2z6Ziu.js +31920 -0
  42. package/dist/charts.cjs +1 -1
  43. package/dist/charts.mjs +7 -7
  44. package/dist/core-C2KhqEaU.cjs +1 -0
  45. package/dist/core-K2DIxXLn.js +795 -0
  46. package/dist/data-branching-DC6hcBQN.cjs +1 -0
  47. package/dist/data-branching-DykdTpjJ.js +6255 -0
  48. package/dist/data-branching.cjs +1 -1
  49. package/dist/data-branching.mjs +1 -1
  50. package/dist/data.cjs +1 -1
  51. package/dist/data.d.ts +29 -7
  52. package/dist/data.mjs +18 -16
  53. package/dist/devops-CU0sOVEA.cjs +17 -0
  54. package/dist/devops-CXyEwQeM.js +8165 -0
  55. package/dist/devops.cjs +1 -1
  56. package/dist/devops.mjs +1 -1
  57. package/dist/editors.cjs +1 -1
  58. package/dist/editors.d.ts +73 -1
  59. package/dist/editors.mjs +58 -54
  60. package/dist/feedback.cjs +1 -1
  61. package/dist/feedback.d.ts +1 -1
  62. package/dist/feedback.mjs +3 -3
  63. package/dist/index.cjs +5137 -1
  64. package/dist/index.css +1 -1
  65. package/dist/index.d.ts +115 -13
  66. package/dist/index.mjs +66371 -992
  67. package/dist/lazy.cjs +1 -1
  68. package/dist/lazy.mjs +24 -24
  69. package/dist/navigation.cjs +1 -1
  70. package/dist/navigation.d.ts +6 -0
  71. package/dist/navigation.mjs +4 -4
  72. package/dist/no-code-C58g8_fb.cjs +332 -0
  73. package/dist/no-code-Cj4xJ3w9.js +7425 -0
  74. package/dist/no-code.cjs +1 -1
  75. package/dist/no-code.mjs +1 -1
  76. package/dist/overlays.cjs +1 -1
  77. package/dist/overlays.d.ts +2 -0
  78. package/dist/overlays.mjs +2 -2
  79. package/dist/pickerCommons-B-wOzHFh.cjs +1 -0
  80. package/dist/pickerCommons-COiSUiP2.js +1122 -0
  81. package/dist/style.css +6 -6
  82. package/dist/vendor-BPVpdtPp.js +271 -0
  83. package/dist/vendor-Bo2Q64AF.cjs +1 -0
  84. package/package.json +17 -17
@@ -0,0 +1,708 @@
1
+ import { jsx as e, jsxs as o, Fragment as O } from "react/jsx-runtime";
2
+ import { g as U, o as R, r as Q, G as B, x as X, c as W } from "./charts-DO2z6Ziu.js";
3
+ import { useRef as I, useEffect as D, useState as v, useCallback as C, Component as Z, useSyncExternalStore as ee, forwardRef as Y } from "react";
4
+ const J = {
5
+ info: /* @__PURE__ */ e("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z", clipRule: "evenodd" }) }),
6
+ success: /* @__PURE__ */ e("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z", clipRule: "evenodd" }) }),
7
+ warning: /* @__PURE__ */ e("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e("path", { fillRule: "evenodd", d: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z", clipRule: "evenodd" }) }),
8
+ error: /* @__PURE__ */ e("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z", clipRule: "evenodd" }) })
9
+ }, me = ({
10
+ variant: n = "info",
11
+ title: i,
12
+ children: s,
13
+ closable: r,
14
+ onClose: t,
15
+ icon: a,
16
+ size: l = "md",
17
+ className: h,
18
+ style: u,
19
+ displayStyle: p
20
+ }) => {
21
+ const _ = U("card", p);
22
+ return /* @__PURE__ */ o(
23
+ "div",
24
+ {
25
+ className: `nice-alert nice-alert--${n} nice-alert--${l} nice-alert--ds-${_} ${h || ""}`,
26
+ style: u,
27
+ role: "alert",
28
+ children: [
29
+ /* @__PURE__ */ e("div", { className: `nice-alert__icon nice-alert__icon--${n}`, children: a || J[n] }),
30
+ /* @__PURE__ */ o("div", { className: "nice-alert__content", children: [
31
+ i && /* @__PURE__ */ e("div", { className: "nice-alert__title", children: i }),
32
+ /* @__PURE__ */ e("div", { children: s })
33
+ ] }),
34
+ r && /* @__PURE__ */ e("button", { type: "button", className: "nice-alert__close", onClick: t, "aria-label": "Close", children: /* @__PURE__ */ e(R, { name: "close", size: 16 }) })
35
+ ]
36
+ }
37
+ );
38
+ }, he = ({
39
+ open: n,
40
+ onClose: i,
41
+ title: s,
42
+ position: r = "right",
43
+ size: t = "md",
44
+ children: a,
45
+ footer: l,
46
+ transitionDuration: h,
47
+ className: u,
48
+ style: p,
49
+ displayStyle: _
50
+ }) => {
51
+ const N = Q("modal", _), g = U("modal", _), { t: b } = B(), k = I(null);
52
+ return X(k, n), D(() => {
53
+ if (!n)
54
+ return;
55
+ const f = (c) => {
56
+ c.key === "Escape" && i();
57
+ };
58
+ return document.addEventListener("keydown", f), document.body.style.overflow = "hidden", () => {
59
+ document.removeEventListener("keydown", f), document.body.style.overflow = "";
60
+ };
61
+ }, [n, i]), n ? /* @__PURE__ */ o(O, { children: [
62
+ /* @__PURE__ */ e(
63
+ "div",
64
+ {
65
+ className: "nice-drawer-overlay",
66
+ onMouseDown: (f) => {
67
+ f.target === f.currentTarget && i();
68
+ }
69
+ }
70
+ ),
71
+ /* @__PURE__ */ o(
72
+ "div",
73
+ {
74
+ ref: k,
75
+ className: `nice-drawer nice-drawer--${r} nice-drawer--${t} nice-drawer--ds-${g} ${u || ""}`,
76
+ style: {
77
+ ...N,
78
+ ...p,
79
+ ...h != null ? { transitionDuration: `${h}ms` } : {}
80
+ },
81
+ role: "dialog",
82
+ "aria-modal": "true",
83
+ "aria-label": s,
84
+ children: [
85
+ s && /* @__PURE__ */ o("div", { className: "nice-drawer__header", children: [
86
+ /* @__PURE__ */ e("h3", { className: "nice-drawer__title", children: s }),
87
+ /* @__PURE__ */ e(
88
+ "button",
89
+ {
90
+ type: "button",
91
+ className: "nice-drawer__close",
92
+ onClick: i,
93
+ "aria-label": b("controls.close", "Close"),
94
+ children: /* @__PURE__ */ e("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) })
95
+ }
96
+ )
97
+ ] }),
98
+ /* @__PURE__ */ e("div", { className: "nice-drawer__body", children: a }),
99
+ l && /* @__PURE__ */ e("div", { className: "nice-drawer__footer", children: l })
100
+ ]
101
+ }
102
+ )
103
+ ] }) : null;
104
+ }, fe = ({
105
+ toasts: n,
106
+ onDismiss: i,
107
+ position: s = "top-right"
108
+ }) => /* @__PURE__ */ e("div", { className: `nice-toast-container nice-toast-container--${s}`, children: n.map((r) => /* @__PURE__ */ e(ne, { toast: r, onDismiss: i }, r.id)) }), ne = ({
109
+ toast: n,
110
+ onDismiss: i
111
+ }) => {
112
+ const [s, r] = v(!1);
113
+ return D(() => {
114
+ if (!n.duration && n.duration !== 0) {
115
+ const t = setTimeout(() => r(!0), 4e3);
116
+ return () => clearTimeout(t);
117
+ }
118
+ if (n.duration > 0) {
119
+ const t = setTimeout(() => r(!0), n.duration);
120
+ return () => clearTimeout(t);
121
+ }
122
+ }, [n.duration]), D(() => {
123
+ if (s) {
124
+ const t = setTimeout(() => i(n.id), 200);
125
+ return () => clearTimeout(t);
126
+ }
127
+ }, [s, n.id, i]), /* @__PURE__ */ o(
128
+ "div",
129
+ {
130
+ className: `nice-toast nice-toast--${n.variant} ${s ? "nice-toast--exiting" : ""}`,
131
+ role: "alert",
132
+ style: { position: "relative" },
133
+ children: [
134
+ /* @__PURE__ */ e("div", { className: "nice-toast__icon", children: J[n.variant] }),
135
+ /* @__PURE__ */ o("div", { className: "nice-toast__content", children: [
136
+ n.title && /* @__PURE__ */ e("div", { className: "nice-toast__title", children: n.title }),
137
+ /* @__PURE__ */ e("div", { className: "nice-toast__message", children: n.message })
138
+ ] }),
139
+ /* @__PURE__ */ e(
140
+ "button",
141
+ {
142
+ type: "button",
143
+ className: "nice-toast__close",
144
+ onClick: () => r(!0),
145
+ "aria-label": "Close",
146
+ children: /* @__PURE__ */ e(R, { name: "close", size: 16 })
147
+ }
148
+ )
149
+ ]
150
+ }
151
+ );
152
+ };
153
+ let te = 0;
154
+ function _e() {
155
+ const [n, i] = v([]), s = C(
156
+ (t, a, l) => {
157
+ const h = `toast-${++te}`;
158
+ return i((u) => [
159
+ ...u,
160
+ { id: h, variant: t, message: a, title: l?.title, duration: l?.duration }
161
+ ]), h;
162
+ },
163
+ []
164
+ ), r = C((t) => {
165
+ i((a) => a.filter((l) => l.id !== t));
166
+ }, []);
167
+ return {
168
+ toasts: n,
169
+ dismiss: r,
170
+ info: (t, a) => s("info", t, a),
171
+ success: (t, a) => s("success", t, a),
172
+ warning: (t, a) => s("warning", t, a),
173
+ error: (t, a) => s("error", t, a)
174
+ };
175
+ }
176
+ const q = class q extends Z {
177
+ constructor() {
178
+ super(...arguments), this.state = {
179
+ hasError: !1,
180
+ error: null
181
+ }, this.handleReset = () => {
182
+ this.setState({ hasError: !1, error: null });
183
+ };
184
+ }
185
+ static getDerivedStateFromError(i) {
186
+ return { hasError: !0, error: i };
187
+ }
188
+ componentDidCatch(i, s) {
189
+ this.props.onError?.(i, s);
190
+ }
191
+ render() {
192
+ if (this.state.hasError && this.state.error) {
193
+ const {
194
+ fallback: i,
195
+ showRetry: s = !0,
196
+ retryLabel: r = "Retry",
197
+ title: t = "Something went wrong"
198
+ } = this.props;
199
+ return typeof i == "function" ? i(this.state.error, this.handleReset) : i || /* @__PURE__ */ o("div", { className: "nice-error-boundary", role: "alert", children: [
200
+ /* @__PURE__ */ e("div", { className: "nice-error-boundary__icon", children: /* @__PURE__ */ e(R, { name: "warning", size: 32 }) }),
201
+ /* @__PURE__ */ e("h2", { className: "nice-error-boundary__title", children: t }),
202
+ /* @__PURE__ */ e("p", { className: "nice-error-boundary__message", children: this.state.error.message }),
203
+ s && /* @__PURE__ */ e("button", { type: "button", className: "nice-btn nice-btn--primary", onClick: this.handleReset, children: r })
204
+ ] });
205
+ }
206
+ return this.props.children;
207
+ }
208
+ };
209
+ q.displayName = "NiceErrorBoundary";
210
+ let G = q;
211
+ function ie(n) {
212
+ return window.addEventListener("online", n), window.addEventListener("offline", n), () => {
213
+ window.removeEventListener("online", n), window.removeEventListener("offline", n);
214
+ };
215
+ }
216
+ function re() {
217
+ return navigator.onLine;
218
+ }
219
+ function se() {
220
+ return !0;
221
+ }
222
+ const be = ({
223
+ message: n = "You are offline. Some features may be unavailable.",
224
+ variant: i = "warning",
225
+ icon: s,
226
+ size: r = "md",
227
+ className: t,
228
+ style: a,
229
+ "data-testid": l
230
+ }) => ee(ie, re, se) ? null : /* @__PURE__ */ o(
231
+ "div",
232
+ {
233
+ className: `nice-offline-banner nice-offline-banner--${i} nice-offline-banner--${r} ${t || ""}`,
234
+ style: a,
235
+ role: "alert",
236
+ "aria-live": "assertive",
237
+ "data-testid": l,
238
+ children: [
239
+ /* @__PURE__ */ e("span", { className: "nice-offline-banner__icon", children: s ?? /* @__PURE__ */ e(R, { name: "wifi", size: 18 }) }),
240
+ /* @__PURE__ */ e("span", { className: "nice-offline-banner__message", children: n })
241
+ ]
242
+ }
243
+ ), pe = ({
244
+ error: n,
245
+ onRetry: i,
246
+ retryLabel: s = "Retry",
247
+ title: r = "Operation failed",
248
+ autoRetrySeconds: t,
249
+ variant: a = "error",
250
+ icon: l,
251
+ size: h = "md",
252
+ className: u,
253
+ style: p,
254
+ "data-testid": _
255
+ }) => {
256
+ const [N, g] = v(t ?? 0), b = I(void 0), k = typeof n == "string" ? n : n.message, f = C(() => {
257
+ g(t ?? 0), i();
258
+ }, [i, t]);
259
+ return D(() => {
260
+ if (!(!t || t <= 0))
261
+ return g(t), b.current = setInterval(() => {
262
+ g((c) => c <= 1 ? (clearInterval(b.current), i(), 0) : c - 1);
263
+ }, 1e3), () => clearInterval(b.current);
264
+ }, [t, i]), /* @__PURE__ */ o(
265
+ "div",
266
+ {
267
+ className: `nice-retry-panel nice-retry-panel--${a} nice-retry-panel--${h} ${u || ""}`,
268
+ style: p,
269
+ role: "alert",
270
+ "data-testid": _,
271
+ children: [
272
+ /* @__PURE__ */ e("div", { className: "nice-retry-panel__icon", children: l ?? /* @__PURE__ */ e(R, { name: "warning", size: 24 }) }),
273
+ /* @__PURE__ */ o("div", { className: "nice-retry-panel__content", children: [
274
+ /* @__PURE__ */ e("div", { className: "nice-retry-panel__title", children: r }),
275
+ /* @__PURE__ */ e("p", { className: "nice-retry-panel__message", children: k })
276
+ ] }),
277
+ /* @__PURE__ */ o("div", { className: "nice-retry-panel__actions", children: [
278
+ /* @__PURE__ */ e(
279
+ "button",
280
+ {
281
+ type: "button",
282
+ className: "nice-btn nice-btn--primary nice-btn--sm",
283
+ onClick: f,
284
+ children: s
285
+ }
286
+ ),
287
+ t && N > 0 && /* @__PURE__ */ o("span", { className: "nice-retry-panel__countdown", children: [
288
+ "Auto-retry in ",
289
+ N,
290
+ "s"
291
+ ] })
292
+ ] })
293
+ ]
294
+ }
295
+ );
296
+ };
297
+ function ae({
298
+ timeoutMs: n = 1e4,
299
+ slowThresholdMs: i = 3e3,
300
+ onTimeout: s,
301
+ autoRetry: r = !1,
302
+ autoRetryCount: t = 3
303
+ } = {}) {
304
+ const [a, l] = v(!1), [h, u] = v(!1), [p, _] = v(!1), [N, g] = v(0), [b, k] = v(0), f = I(null), c = I(null), x = I(null), $ = I(0), w = C(() => {
305
+ f.current && clearTimeout(f.current), c.current && clearTimeout(c.current), x.current && clearInterval(x.current);
306
+ }, []), y = C(() => {
307
+ w(), l(!0), u(!1), _(!1), g(0), $.current = Date.now(), x.current = setInterval(() => {
308
+ g(Date.now() - $.current);
309
+ }, 200), f.current = setTimeout(() => {
310
+ u(!0);
311
+ }, i), c.current = setTimeout(() => {
312
+ _(!0), l(!1), u(!1), w(), s?.();
313
+ }, n);
314
+ }, [w, i, n, s]), L = C(() => {
315
+ w(), l(!1), u(!1);
316
+ }, [w]), d = C(() => {
317
+ k((T) => T + 1), _(!1), y();
318
+ }, [y]);
319
+ return D(() => () => w(), [w]), D(() => {
320
+ if (r && p && b < t) {
321
+ const T = Math.pow(2, b) * 1e3, M = setTimeout(() => d(), T);
322
+ return () => clearTimeout(M);
323
+ }
324
+ }, [r, t, p, b, d]), { isLoading: a, isSlow: h, isTimedOut: p, elapsed: N, retryCount: b, start: y, stop: L, retry: d };
325
+ }
326
+ const ge = ({
327
+ timeoutMs: n = 1e4,
328
+ slowThresholdMs: i = 3e3,
329
+ onTimeout: s,
330
+ onRetry: r,
331
+ autoRetry: t = !1,
332
+ autoRetryCount: a = 3,
333
+ showProgress: l = !0,
334
+ slowMessage: h = "Operacja trwa dłużej niż zwykle…",
335
+ timeoutMessage: u = "Przekroczono limit czasu. Spróbuj ponownie.",
336
+ loading: p,
337
+ children: _,
338
+ size: N = "md",
339
+ className: g,
340
+ style: b,
341
+ "data-testid": k
342
+ }) => {
343
+ const { isSlow: f, isTimedOut: c, elapsed: x, retry: $ } = ae({
344
+ timeoutMs: n,
345
+ slowThresholdMs: i,
346
+ onTimeout: s,
347
+ autoRetry: t,
348
+ autoRetryCount: a
349
+ }), w = () => {
350
+ $(), r?.();
351
+ };
352
+ if (!p)
353
+ return /* @__PURE__ */ e(O, { children: _ });
354
+ if (c)
355
+ return /* @__PURE__ */ o(
356
+ "div",
357
+ {
358
+ className: `nice-timeout-feedback nice-timeout-feedback--timeout nice-timeout-feedback--${N} ${g ?? ""}`,
359
+ style: b,
360
+ role: "alert",
361
+ "data-testid": k,
362
+ children: [
363
+ /* @__PURE__ */ e("p", { className: "nice-timeout-feedback__message", children: u }),
364
+ /* @__PURE__ */ e("button", { className: "nice-timeout-feedback__retry-btn", onClick: w, type: "button", children: "Spróbuj ponownie" })
365
+ ]
366
+ }
367
+ );
368
+ const y = Math.min(100, x / n * 100);
369
+ return /* @__PURE__ */ o(
370
+ "div",
371
+ {
372
+ className: `nice-timeout-feedback nice-timeout-feedback--${N} ${f ? "nice-timeout-feedback--slow" : ""} ${g ?? ""}`,
373
+ style: b,
374
+ "data-testid": k,
375
+ children: [
376
+ /* @__PURE__ */ e("div", { className: "nice-timeout-feedback__spinner", "aria-busy": "true" }),
377
+ f && /* @__PURE__ */ e("p", { className: "nice-timeout-feedback__slow-msg", children: h }),
378
+ l && /* @__PURE__ */ e(
379
+ "div",
380
+ {
381
+ className: "nice-timeout-feedback__progress",
382
+ role: "progressbar",
383
+ "aria-valuenow": y,
384
+ "aria-valuemin": 0,
385
+ "aria-valuemax": 100,
386
+ children: /* @__PURE__ */ e(
387
+ "div",
388
+ {
389
+ className: "nice-timeout-feedback__progress-bar",
390
+ style: { width: `${y}%` }
391
+ }
392
+ )
393
+ }
394
+ )
395
+ ]
396
+ }
397
+ );
398
+ }, ce = Y(
399
+ ({
400
+ visible: n,
401
+ onAcceptAll: i,
402
+ onRejectAll: s,
403
+ onSave: r,
404
+ categories: t = ["necessary", "analytics", "marketing", "preferences"],
405
+ defaults: a,
406
+ position: l = "bottom",
407
+ size: h = "md",
408
+ policyUrl: u,
409
+ showDetails: p = !1,
410
+ className: _,
411
+ style: N,
412
+ id: g,
413
+ ...b
414
+ }, k) => {
415
+ const f = W(g), { t: c } = B(), [x, $] = v(!0), w = n ?? x, [y, L] = v(p), [d, T] = v(() => {
416
+ const m = {
417
+ necessary: !0,
418
+ analytics: !1,
419
+ marketing: !1,
420
+ preferences: !1
421
+ };
422
+ return a && Object.assign(m, a), m.necessary = !0, m;
423
+ }), M = {
424
+ necessary: c("cookie.necessary", "Necessary"),
425
+ analytics: c("cookie.analytics", "Analytics"),
426
+ marketing: c("cookie.marketing", "Marketing"),
427
+ preferences: c("cookie.preferences", "Preferences")
428
+ }, E = {
429
+ necessary: c(
430
+ "cookie.necessaryDesc",
431
+ "Required for the website to function. Cannot be disabled."
432
+ ),
433
+ analytics: c(
434
+ "cookie.analyticsDesc",
435
+ "Help us understand how visitors interact with the website."
436
+ ),
437
+ marketing: c("cookie.marketingDesc", "Used to deliver relevant advertisements."),
438
+ preferences: c("cookie.preferencesDesc", "Allow the website to remember your choices.")
439
+ }, j = C(() => {
440
+ const m = {
441
+ necessary: !0,
442
+ analytics: !0,
443
+ marketing: !0,
444
+ preferences: !0
445
+ };
446
+ i?.(), r?.(m), $(!1);
447
+ }, [i, r]), P = C(() => {
448
+ const m = {
449
+ necessary: !0,
450
+ analytics: !1,
451
+ marketing: !1,
452
+ preferences: !1
453
+ };
454
+ s?.(), r?.(m), $(!1);
455
+ }, [s, r]), A = C(() => {
456
+ r?.({ ...d, necessary: !0 }), $(!1);
457
+ }, [d, r]);
458
+ return w ? /* @__PURE__ */ e(
459
+ "div",
460
+ {
461
+ ref: k,
462
+ id: f,
463
+ className: `nice-cookie-consent nice-cookie-consent--${l} nice-cookie-consent--${h} ${_ ?? ""}`,
464
+ style: N,
465
+ role: "dialog",
466
+ "aria-label": c("cookie.label", "Cookie Consent"),
467
+ "aria-modal": "true",
468
+ ...b,
469
+ children: /* @__PURE__ */ o("div", { className: "nice-cookie-consent__content", children: [
470
+ /* @__PURE__ */ o("p", { className: "nice-cookie-consent__message", children: [
471
+ c(
472
+ "cookie.message",
473
+ "We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies."
474
+ ),
475
+ u && /* @__PURE__ */ o(O, { children: [
476
+ " ",
477
+ /* @__PURE__ */ e(
478
+ "a",
479
+ {
480
+ href: u,
481
+ className: "nice-cookie-consent__link",
482
+ target: "_blank",
483
+ rel: "noopener noreferrer",
484
+ children: c("cookie.learnMore", "Learn more")
485
+ }
486
+ )
487
+ ] })
488
+ ] }),
489
+ y && /* @__PURE__ */ e("div", { className: "nice-cookie-consent__details", children: t.map((m) => /* @__PURE__ */ o("label", { className: "nice-cookie-consent__category", children: [
490
+ /* @__PURE__ */ e(
491
+ "input",
492
+ {
493
+ type: "checkbox",
494
+ checked: d[m],
495
+ disabled: m === "necessary",
496
+ onChange: (F) => T((S) => ({ ...S, [m]: F.target.checked })),
497
+ className: "nice-cookie-consent__checkbox"
498
+ }
499
+ ),
500
+ /* @__PURE__ */ o("div", { className: "nice-cookie-consent__cat-info", children: [
501
+ /* @__PURE__ */ e("strong", { children: M[m] }),
502
+ /* @__PURE__ */ e("span", { className: "nice-cookie-consent__cat-desc", children: E[m] })
503
+ ] })
504
+ ] }, m)) }),
505
+ /* @__PURE__ */ o("div", { className: "nice-cookie-consent__actions", children: [
506
+ !y && /* @__PURE__ */ e(
507
+ "button",
508
+ {
509
+ type: "button",
510
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--details",
511
+ onClick: () => L(!0),
512
+ children: c("cookie.customize", "Customize")
513
+ }
514
+ ),
515
+ y && /* @__PURE__ */ e(
516
+ "button",
517
+ {
518
+ type: "button",
519
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--save",
520
+ onClick: A,
521
+ children: c("cookie.savePreferences", "Save preferences")
522
+ }
523
+ ),
524
+ /* @__PURE__ */ e(
525
+ "button",
526
+ {
527
+ type: "button",
528
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--reject",
529
+ onClick: P,
530
+ children: c("cookie.rejectAll", "Reject all")
531
+ }
532
+ ),
533
+ /* @__PURE__ */ e(
534
+ "button",
535
+ {
536
+ type: "button",
537
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--accept",
538
+ onClick: j,
539
+ children: c("cookie.acceptAll", "Accept all")
540
+ }
541
+ )
542
+ ] })
543
+ ] })
544
+ }
545
+ ) : null;
546
+ }
547
+ );
548
+ ce.displayName = "NiceCookieConsent";
549
+ const oe = Y(
550
+ ({
551
+ onSubmit: n,
552
+ onForgotPassword: i,
553
+ onRegister: s,
554
+ loading: r = !1,
555
+ error: t,
556
+ variant: a = "primary",
557
+ size: l = "md",
558
+ showRememberMe: h = !0,
559
+ showForgotPassword: u = !0,
560
+ showRegister: p = !1,
561
+ title: _,
562
+ logo: N,
563
+ usernameLabel: g,
564
+ passwordLabel: b,
565
+ usernamePlaceholder: k,
566
+ passwordPlaceholder: f,
567
+ className: c,
568
+ style: x,
569
+ id: $,
570
+ ...w
571
+ }, y) => {
572
+ const L = W($), { t: d } = B(), [T, M] = v(""), [E, j] = v(""), [P, A] = v(!1), [m, F] = v(!1), S = `${L}-user`, H = `${L}-pass`, V = `${L}-remember`, K = C(
573
+ (z) => {
574
+ z.preventDefault(), !r && n?.({ username: T, password: E, rememberMe: P });
575
+ },
576
+ [r, T, E, P, n]
577
+ );
578
+ return /* @__PURE__ */ o(
579
+ "form",
580
+ {
581
+ ref: y,
582
+ id: L,
583
+ className: `nice-login nice-login--${a} nice-login--${l} ${c ?? ""}`,
584
+ style: x,
585
+ onSubmit: K,
586
+ noValidate: !0,
587
+ ...w,
588
+ children: [
589
+ N && /* @__PURE__ */ e("div", { className: "nice-login__logo", children: N }),
590
+ _ && /* @__PURE__ */ e("h2", { className: "nice-login__title", children: _ ?? d("login.title", "Sign In") }),
591
+ t && /* @__PURE__ */ e("div", { className: "nice-login__error", role: "alert", children: t }),
592
+ /* @__PURE__ */ o("div", { className: "nice-login__field", children: [
593
+ /* @__PURE__ */ e("label", { htmlFor: S, className: "nice-login__label", children: g ?? d("login.username", "Username") }),
594
+ /* @__PURE__ */ e(
595
+ "input",
596
+ {
597
+ id: S,
598
+ className: "nice-login__input",
599
+ type: "text",
600
+ value: T,
601
+ onChange: (z) => M(z.target.value),
602
+ placeholder: k ?? d("login.usernamePlaceholder", "Enter your username"),
603
+ autoComplete: "username",
604
+ required: !0,
605
+ disabled: r,
606
+ "aria-required": "true"
607
+ }
608
+ )
609
+ ] }),
610
+ /* @__PURE__ */ o("div", { className: "nice-login__field", children: [
611
+ /* @__PURE__ */ e("label", { htmlFor: H, className: "nice-login__label", children: b ?? d("login.password", "Password") }),
612
+ /* @__PURE__ */ o("div", { className: "nice-login__password-wrap", children: [
613
+ /* @__PURE__ */ e(
614
+ "input",
615
+ {
616
+ id: H,
617
+ className: "nice-login__input",
618
+ type: m ? "text" : "password",
619
+ value: E,
620
+ onChange: (z) => j(z.target.value),
621
+ placeholder: f ?? d("login.passwordPlaceholder", "Enter your password"),
622
+ autoComplete: "current-password",
623
+ required: !0,
624
+ disabled: r,
625
+ "aria-required": "true"
626
+ }
627
+ ),
628
+ /* @__PURE__ */ e(
629
+ "button",
630
+ {
631
+ type: "button",
632
+ className: "nice-login__toggle-password",
633
+ onClick: () => F(!m),
634
+ "aria-label": m ? d("login.hidePassword", "Hide password") : d("login.showPassword", "Show password"),
635
+ tabIndex: -1,
636
+ children: /* @__PURE__ */ e(R, { name: m ? "eye-off" : "eye", size: 16 })
637
+ }
638
+ )
639
+ ] })
640
+ ] }),
641
+ /* @__PURE__ */ o("div", { className: "nice-login__options", children: [
642
+ h && /* @__PURE__ */ o("label", { className: "nice-login__remember", htmlFor: V, children: [
643
+ /* @__PURE__ */ e(
644
+ "input",
645
+ {
646
+ id: V,
647
+ type: "checkbox",
648
+ checked: P,
649
+ onChange: (z) => A(z.target.checked),
650
+ disabled: r
651
+ }
652
+ ),
653
+ /* @__PURE__ */ e("span", { children: d("login.rememberMe", "Remember me") })
654
+ ] }),
655
+ u && i && /* @__PURE__ */ e(
656
+ "button",
657
+ {
658
+ type: "button",
659
+ className: "nice-login__forgot",
660
+ onClick: i,
661
+ disabled: r,
662
+ children: d("login.forgotPassword", "Forgot password?")
663
+ }
664
+ )
665
+ ] }),
666
+ /* @__PURE__ */ e(
667
+ "button",
668
+ {
669
+ type: "submit",
670
+ className: `nice-login__submit nice-login__submit--${a}`,
671
+ disabled: r || !T || !E,
672
+ children: r ? d("login.loading", "Signing in...") : d("login.submit", "Sign In")
673
+ }
674
+ ),
675
+ p && s && /* @__PURE__ */ o("p", { className: "nice-login__register", children: [
676
+ d("login.noAccount", "Don't have an account?"),
677
+ " ",
678
+ /* @__PURE__ */ e(
679
+ "button",
680
+ {
681
+ type: "button",
682
+ className: "nice-login__register-link",
683
+ onClick: s,
684
+ disabled: r,
685
+ children: d("login.register", "Register")
686
+ }
687
+ )
688
+ ] })
689
+ ]
690
+ }
691
+ );
692
+ }
693
+ );
694
+ oe.displayName = "NiceLoginForm";
695
+ export {
696
+ me as N,
697
+ ce as a,
698
+ he as b,
699
+ G as c,
700
+ oe as d,
701
+ be as e,
702
+ pe as f,
703
+ ge as g,
704
+ fe as h,
705
+ J as i,
706
+ ae as j,
707
+ _e as u
708
+ };