@nice2dev/ui 1.0.29 → 1.0.31

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 (108) hide show
  1. package/CHANGELOG.md +512 -0
  2. package/README.md +30 -31
  3. package/dist/NiceBackupStatusBadge.doc-Bx2bFmBQ.cjs +1 -0
  4. package/dist/NiceBackupStatusBadge.doc-CdDxIQ-M.js +25 -0
  5. package/dist/NiceCalendarScheduler.doc-BEtQkZjV.cjs +9 -0
  6. package/dist/NiceCalendarScheduler.doc-D__LRgOx.js +33 -0
  7. package/dist/NiceConfirmDialog-B57cl_F7.cjs +1 -0
  8. package/dist/NiceConfirmDialog-BiTJVR4-.js +81 -0
  9. package/dist/NiceConfirmDialog-Bjw_rN4o.cjs +1 -0
  10. package/dist/NiceConfirmDialog-N9fBTLYm.js +81 -0
  11. package/dist/NiceDrawingCanvas.doc-Dv5vB4gY.js +32 -0
  12. package/dist/NiceDrawingCanvas.doc-Ww9zz17x.cjs +8 -0
  13. package/dist/NiceErrorBoundary-1H751jK7.cjs +1 -0
  14. package/dist/NiceErrorBoundary-B-txoU3Y.js +709 -0
  15. package/dist/NiceErrorBoundary-BD-uqk_q.js +709 -0
  16. package/dist/NiceErrorBoundary-CIPXaYik.cjs +1 -0
  17. package/dist/NiceFileManagerViews.doc-CKlnm6cX.cjs +1 -0
  18. package/dist/NiceFileManagerViews.doc-Cg21DArG.js +25 -0
  19. package/dist/NiceForm-BNZB31Pg.js +4499 -0
  20. package/dist/NiceForm-CPyAXxBO.cjs +1 -0
  21. package/dist/NiceForm-DGUTmaZT.js +5014 -0
  22. package/dist/NiceForm-DmU-gmyv.cjs +382 -0
  23. package/dist/NiceMegaMenu.doc-7UyOCd3l.cjs +7 -0
  24. package/dist/NiceMegaMenu.doc-zeIyVa65.js +31 -0
  25. package/dist/NiceModal-BClAtR5T.js +95 -0
  26. package/dist/NiceModal-Bj53SKLI.js +95 -0
  27. package/dist/NiceModal-DC0UlQhc.cjs +1 -0
  28. package/dist/NiceModal-iKwtagFB.cjs +1 -0
  29. package/dist/NiceModuleLifecyclePanel-BBOg9g0b.cjs +1 -0
  30. package/dist/NiceModuleLifecyclePanel-BO8Hw_W9.js +7619 -0
  31. package/dist/NiceModuleLifecyclePanel-Ch7HRRoy.cjs +1 -0
  32. package/dist/NiceModuleLifecyclePanel-DtuXRiLR.js +6991 -0
  33. package/dist/NiceModuleLifecyclePanel.css +1 -1
  34. package/dist/NicePagination-BVo-4KAD.js +172 -0
  35. package/dist/NicePagination-Bjxy9aEc.js +172 -0
  36. package/dist/NicePagination-CaohvQsY.cjs +1 -0
  37. package/dist/NicePagination-CfFfNwrg.cjs +1 -0
  38. package/dist/NicePinCodeInput-DsyLuc0b.cjs +696 -0
  39. package/dist/NicePinCodeInput-nuRCN-9R.js +13223 -0
  40. package/dist/NiceSavedQueryPanel-BBFV4qiF.js +6969 -0
  41. package/dist/NiceSavedQueryPanel-CH5c3rUG.js +6988 -0
  42. package/dist/NiceSavedQueryPanel-CsiVNkCT.cjs +596 -0
  43. package/dist/NiceSavedQueryPanel-aQrEmmcC.cjs +596 -0
  44. package/dist/NiceScannerControl-Cd5KXJA9.js +12769 -0
  45. package/dist/NiceScannerControl-DZsERSw_.cjs +698 -0
  46. package/dist/NiceScannerControl.css +1 -0
  47. package/dist/NiceWindow-BoDzlGk-.js +1621 -0
  48. package/dist/NiceWindow-Cm9E6EAi.cjs +1 -0
  49. package/dist/NiceWindow-DgONWxBm.cjs +1 -0
  50. package/dist/NiceWindow-FMrVS7zo.js +1603 -0
  51. package/dist/charts-B90sSFeJ.cjs +761 -0
  52. package/dist/charts-Bs0aDM0X.js +4671 -0
  53. package/dist/charts-DaLf19vS.js +4671 -0
  54. package/dist/charts-DjjKkw0q.cjs +761 -0
  55. package/dist/charts.cjs +1 -1
  56. package/dist/charts.mjs +1 -1
  57. package/dist/core-BUTtIHg0.js +27766 -0
  58. package/dist/core-BUsZ7_vI.js +27914 -0
  59. package/dist/core-CESNSRyS.cjs +122 -0
  60. package/dist/core-CLfcCDKc.cjs +122 -0
  61. package/dist/data-branching-ByQdcjKO.cjs +1 -0
  62. package/dist/data-branching-D7l_kILW.cjs +1 -0
  63. package/dist/data-branching-lJ07lDN-.js +6255 -0
  64. package/dist/data-branching-psTzlcrT.js +6255 -0
  65. package/dist/data-branching.cjs +1 -1
  66. package/dist/data-branching.mjs +1 -1
  67. package/dist/data.cjs +1 -1
  68. package/dist/data.d.ts +41 -37
  69. package/dist/data.mjs +18 -19
  70. package/dist/devops-Bi8MXtko.js +8165 -0
  71. package/dist/devops-D7bQ3rE4.cjs +17 -0
  72. package/dist/devops-On_1wRf9.cjs +17 -0
  73. package/dist/devops-jCmpD6O-.js +8165 -0
  74. package/dist/devops.cjs +1 -1
  75. package/dist/devops.mjs +3 -3
  76. package/dist/editors.cjs +1 -1
  77. package/dist/editors.d.ts +219 -431
  78. package/dist/editors.mjs +48 -56
  79. package/dist/feedback.cjs +1 -1
  80. package/dist/feedback.mjs +3 -3
  81. package/dist/index-BDH1yDSg.js +69235 -0
  82. package/dist/index-BpixglWg.js +69337 -0
  83. package/dist/index-C9njkNOD.cjs +5470 -0
  84. package/dist/index-DLR-aWZR.cjs +5506 -0
  85. package/dist/index.cjs +1 -1
  86. package/dist/index.css +1 -1
  87. package/dist/index.d.ts +798 -1059
  88. package/dist/index.mjs +741 -756
  89. package/dist/lazy.cjs +1 -1
  90. package/dist/lazy.mjs +24 -24
  91. package/dist/navigation.cjs +1 -1
  92. package/dist/navigation.d.ts +25 -213
  93. package/dist/navigation.mjs +143 -151
  94. package/dist/no-code-8lO7o6xi.js +7425 -0
  95. package/dist/no-code-BHo5WrXr.js +7425 -0
  96. package/dist/no-code-DyA_1_Th.cjs +332 -0
  97. package/dist/no-code-K8tOLNew.cjs +332 -0
  98. package/dist/no-code.cjs +1 -1
  99. package/dist/no-code.mjs +1 -1
  100. package/dist/overlays.cjs +1 -1
  101. package/dist/overlays.d.ts +12 -0
  102. package/dist/overlays.mjs +82 -82
  103. package/dist/pickerCommons-BEc3pZ_s.js +2044 -0
  104. package/dist/pickerCommons-CORo9j2a.js +2119 -0
  105. package/dist/pickerCommons-CrITwM88.cjs +1 -0
  106. package/dist/pickerCommons-D3WShRrR.cjs +1 -0
  107. package/dist/style.css +5 -5
  108. package/package.json +3 -3
@@ -0,0 +1,709 @@
1
+ import { jsx as e, jsxs as o, Fragment as O } from "react/jsx-runtime";
2
+ import { b as U, o as S, r as Q, G as B, S as X, a as W } from "./core-BUTtIHg0.js";
3
+ import { useRef as I, useEffect as D, useState as v, useCallback as C, useSyncExternalStore as Z, forwardRef as Y, Component as ee } 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(S, { 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(S, { 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 be = ({
177
+ error: n,
178
+ onRetry: i,
179
+ retryLabel: s = "Retry",
180
+ title: r = "Operation failed",
181
+ autoRetrySeconds: t,
182
+ variant: a = "error",
183
+ icon: l,
184
+ size: h = "md",
185
+ className: u,
186
+ style: p,
187
+ "data-testid": _
188
+ }) => {
189
+ const [N, g] = v(t ?? 0), b = I(), k = typeof n == "string" ? n : n.message, f = C(() => {
190
+ g(t ?? 0), i();
191
+ }, [i, t]);
192
+ return D(() => {
193
+ if (!(!t || t <= 0))
194
+ return g(t), b.current = setInterval(() => {
195
+ g((c) => c <= 1 ? (clearInterval(b.current), i(), 0) : c - 1);
196
+ }, 1e3), () => clearInterval(b.current);
197
+ }, [t, i]), /* @__PURE__ */ o(
198
+ "div",
199
+ {
200
+ className: `nice-retry-panel nice-retry-panel--${a} nice-retry-panel--${h} ${u || ""}`,
201
+ style: p,
202
+ role: "alert",
203
+ "data-testid": _,
204
+ children: [
205
+ /* @__PURE__ */ e("div", { className: "nice-retry-panel__icon", children: l ?? /* @__PURE__ */ e(S, { name: "warning", size: 24 }) }),
206
+ /* @__PURE__ */ o("div", { className: "nice-retry-panel__content", children: [
207
+ /* @__PURE__ */ e("div", { className: "nice-retry-panel__title", children: r }),
208
+ /* @__PURE__ */ e("p", { className: "nice-retry-panel__message", children: k })
209
+ ] }),
210
+ /* @__PURE__ */ o("div", { className: "nice-retry-panel__actions", children: [
211
+ /* @__PURE__ */ e(
212
+ "button",
213
+ {
214
+ type: "button",
215
+ className: "nice-btn nice-btn--primary nice-btn--sm",
216
+ onClick: f,
217
+ children: s
218
+ }
219
+ ),
220
+ t && N > 0 && /* @__PURE__ */ o("span", { className: "nice-retry-panel__countdown", children: [
221
+ "Auto-retry in ",
222
+ N,
223
+ "s"
224
+ ] })
225
+ ] })
226
+ ]
227
+ }
228
+ );
229
+ };
230
+ function ie(n) {
231
+ return window.addEventListener("online", n), window.addEventListener("offline", n), () => {
232
+ window.removeEventListener("online", n), window.removeEventListener("offline", n);
233
+ };
234
+ }
235
+ function re() {
236
+ return navigator.onLine;
237
+ }
238
+ function se() {
239
+ return !0;
240
+ }
241
+ const pe = ({
242
+ message: n = "You are offline. Some features may be unavailable.",
243
+ variant: i = "warning",
244
+ icon: s,
245
+ size: r = "md",
246
+ className: t,
247
+ style: a,
248
+ "data-testid": l
249
+ }) => Z(ie, re, se) ? null : /* @__PURE__ */ o(
250
+ "div",
251
+ {
252
+ className: `nice-offline-banner nice-offline-banner--${i} nice-offline-banner--${r} ${t || ""}`,
253
+ style: a,
254
+ role: "alert",
255
+ "aria-live": "assertive",
256
+ "data-testid": l,
257
+ children: [
258
+ /* @__PURE__ */ e("span", { className: "nice-offline-banner__icon", children: s ?? /* @__PURE__ */ e(S, { name: "wifi", size: 18 }) }),
259
+ /* @__PURE__ */ e("span", { className: "nice-offline-banner__message", children: n })
260
+ ]
261
+ }
262
+ );
263
+ function ae({
264
+ timeoutMs: n = 1e4,
265
+ slowThresholdMs: i = 3e3,
266
+ onTimeout: s,
267
+ autoRetry: r = !1,
268
+ autoRetryCount: t = 3
269
+ } = {}) {
270
+ 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), L = I(null), $ = I(0), w = C(() => {
271
+ f.current && clearTimeout(f.current), c.current && clearTimeout(c.current), L.current && clearInterval(L.current);
272
+ }, []), y = C(() => {
273
+ w(), l(!0), u(!1), _(!1), g(0), $.current = Date.now(), L.current = setInterval(() => {
274
+ g(Date.now() - $.current);
275
+ }, 200), f.current = setTimeout(() => {
276
+ u(!0);
277
+ }, i), c.current = setTimeout(() => {
278
+ _(!0), l(!1), u(!1), w(), s?.();
279
+ }, n);
280
+ }, [w, i, n, s]), z = C(() => {
281
+ w(), l(!1), u(!1);
282
+ }, [w]), d = C(() => {
283
+ k((T) => T + 1), _(!1), y();
284
+ }, [y]);
285
+ return D(() => () => w(), [w]), D(() => {
286
+ if (r && p && b < t) {
287
+ const T = Math.pow(2, b) * 1e3, R = setTimeout(() => d(), T);
288
+ return () => clearTimeout(R);
289
+ }
290
+ }, [r, t, p, b, d]), { isLoading: a, isSlow: h, isTimedOut: p, elapsed: N, retryCount: b, start: y, stop: z, retry: d };
291
+ }
292
+ const ge = ({
293
+ timeoutMs: n = 1e4,
294
+ slowThresholdMs: i = 3e3,
295
+ onTimeout: s,
296
+ onRetry: r,
297
+ autoRetry: t = !1,
298
+ autoRetryCount: a = 3,
299
+ showProgress: l = !0,
300
+ slowMessage: h = "Operacja trwa dłużej niż zwykle…",
301
+ timeoutMessage: u = "Przekroczono limit czasu. Spróbuj ponownie.",
302
+ loading: p,
303
+ children: _,
304
+ size: N = "md",
305
+ className: g,
306
+ style: b,
307
+ "data-testid": k
308
+ }) => {
309
+ const { isSlow: f, isTimedOut: c, elapsed: L, retry: $ } = ae({
310
+ timeoutMs: n,
311
+ slowThresholdMs: i,
312
+ onTimeout: s,
313
+ autoRetry: t,
314
+ autoRetryCount: a
315
+ }), w = () => {
316
+ $(), r?.();
317
+ };
318
+ if (!p)
319
+ return /* @__PURE__ */ e(O, { children: _ });
320
+ if (c)
321
+ return /* @__PURE__ */ o(
322
+ "div",
323
+ {
324
+ className: `nice-timeout-feedback nice-timeout-feedback--timeout nice-timeout-feedback--${N} ${g ?? ""}`,
325
+ style: b,
326
+ role: "alert",
327
+ "data-testid": k,
328
+ children: [
329
+ /* @__PURE__ */ e("p", { className: "nice-timeout-feedback__message", children: u }),
330
+ /* @__PURE__ */ e("button", { className: "nice-timeout-feedback__retry-btn", onClick: w, type: "button", children: "Spróbuj ponownie" })
331
+ ]
332
+ }
333
+ );
334
+ const y = Math.min(100, L / n * 100);
335
+ return /* @__PURE__ */ o(
336
+ "div",
337
+ {
338
+ className: `nice-timeout-feedback nice-timeout-feedback--${N} ${f ? "nice-timeout-feedback--slow" : ""} ${g ?? ""}`,
339
+ style: b,
340
+ "data-testid": k,
341
+ children: [
342
+ /* @__PURE__ */ e("div", { className: "nice-timeout-feedback__spinner", "aria-busy": "true" }),
343
+ f && /* @__PURE__ */ e("p", { className: "nice-timeout-feedback__slow-msg", children: h }),
344
+ l && /* @__PURE__ */ e(
345
+ "div",
346
+ {
347
+ className: "nice-timeout-feedback__progress",
348
+ role: "progressbar",
349
+ "aria-valuenow": y,
350
+ "aria-valuemin": 0,
351
+ "aria-valuemax": 100,
352
+ children: /* @__PURE__ */ e(
353
+ "div",
354
+ {
355
+ className: "nice-timeout-feedback__progress-bar",
356
+ style: { width: `${y}%` }
357
+ }
358
+ )
359
+ }
360
+ )
361
+ ]
362
+ }
363
+ );
364
+ }, ce = Y(
365
+ ({
366
+ visible: n,
367
+ onAcceptAll: i,
368
+ onRejectAll: s,
369
+ onSave: r,
370
+ categories: t = ["necessary", "analytics", "marketing", "preferences"],
371
+ defaults: a,
372
+ position: l = "bottom",
373
+ size: h = "md",
374
+ policyUrl: u,
375
+ showDetails: p = !1,
376
+ className: _,
377
+ style: N,
378
+ id: g,
379
+ ...b
380
+ }, k) => {
381
+ const f = W(g), { t: c } = B(), [L, $] = v(!0), w = n ?? L, [y, z] = v(p), [d, T] = v(() => {
382
+ const m = {
383
+ necessary: !0,
384
+ analytics: !1,
385
+ marketing: !1,
386
+ preferences: !1
387
+ };
388
+ return a && Object.assign(m, a), m.necessary = !0, m;
389
+ }), R = {
390
+ necessary: c("cookie.necessary", "Necessary"),
391
+ analytics: c("cookie.analytics", "Analytics"),
392
+ marketing: c("cookie.marketing", "Marketing"),
393
+ preferences: c("cookie.preferences", "Preferences")
394
+ }, E = {
395
+ necessary: c(
396
+ "cookie.necessaryDesc",
397
+ "Required for the website to function. Cannot be disabled."
398
+ ),
399
+ analytics: c(
400
+ "cookie.analyticsDesc",
401
+ "Help us understand how visitors interact with the website."
402
+ ),
403
+ marketing: c("cookie.marketingDesc", "Used to deliver relevant advertisements."),
404
+ preferences: c("cookie.preferencesDesc", "Allow the website to remember your choices.")
405
+ }, j = C(() => {
406
+ const m = {
407
+ necessary: !0,
408
+ analytics: !0,
409
+ marketing: !0,
410
+ preferences: !0
411
+ };
412
+ i?.(), r?.(m), $(!1);
413
+ }, [i, r]), M = C(() => {
414
+ const m = {
415
+ necessary: !0,
416
+ analytics: !1,
417
+ marketing: !1,
418
+ preferences: !1
419
+ };
420
+ s?.(), r?.(m), $(!1);
421
+ }, [s, r]), A = C(() => {
422
+ r?.({ ...d, necessary: !0 }), $(!1);
423
+ }, [d, r]);
424
+ return w ? /* @__PURE__ */ e(
425
+ "div",
426
+ {
427
+ ref: k,
428
+ id: f,
429
+ className: `nice-cookie-consent nice-cookie-consent--${l} nice-cookie-consent--${h} ${_ ?? ""}`,
430
+ style: N,
431
+ role: "dialog",
432
+ "aria-label": c("cookie.label", "Cookie Consent"),
433
+ "aria-modal": "true",
434
+ ...b,
435
+ children: /* @__PURE__ */ o("div", { className: "nice-cookie-consent__content", children: [
436
+ /* @__PURE__ */ o("p", { className: "nice-cookie-consent__message", children: [
437
+ c(
438
+ "cookie.message",
439
+ "We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies."
440
+ ),
441
+ u && /* @__PURE__ */ o(O, { children: [
442
+ " ",
443
+ /* @__PURE__ */ e(
444
+ "a",
445
+ {
446
+ href: u,
447
+ className: "nice-cookie-consent__link",
448
+ target: "_blank",
449
+ rel: "noopener noreferrer",
450
+ children: c("cookie.learnMore", "Learn more")
451
+ }
452
+ )
453
+ ] })
454
+ ] }),
455
+ y && /* @__PURE__ */ e("div", { className: "nice-cookie-consent__details", children: t.map((m) => /* @__PURE__ */ o("label", { className: "nice-cookie-consent__category", children: [
456
+ /* @__PURE__ */ e(
457
+ "input",
458
+ {
459
+ type: "checkbox",
460
+ checked: d[m],
461
+ disabled: m === "necessary",
462
+ onChange: (F) => T((P) => ({ ...P, [m]: F.target.checked })),
463
+ className: "nice-cookie-consent__checkbox"
464
+ }
465
+ ),
466
+ /* @__PURE__ */ o("div", { className: "nice-cookie-consent__cat-info", children: [
467
+ /* @__PURE__ */ e("strong", { children: R[m] }),
468
+ /* @__PURE__ */ e("span", { className: "nice-cookie-consent__cat-desc", children: E[m] })
469
+ ] })
470
+ ] }, m)) }),
471
+ /* @__PURE__ */ o("div", { className: "nice-cookie-consent__actions", children: [
472
+ !y && /* @__PURE__ */ e(
473
+ "button",
474
+ {
475
+ type: "button",
476
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--details",
477
+ onClick: () => z(!0),
478
+ children: c("cookie.customize", "Customize")
479
+ }
480
+ ),
481
+ y && /* @__PURE__ */ e(
482
+ "button",
483
+ {
484
+ type: "button",
485
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--save",
486
+ onClick: A,
487
+ children: c("cookie.savePreferences", "Save preferences")
488
+ }
489
+ ),
490
+ /* @__PURE__ */ e(
491
+ "button",
492
+ {
493
+ type: "button",
494
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--reject",
495
+ onClick: M,
496
+ children: c("cookie.rejectAll", "Reject all")
497
+ }
498
+ ),
499
+ /* @__PURE__ */ e(
500
+ "button",
501
+ {
502
+ type: "button",
503
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--accept",
504
+ onClick: j,
505
+ children: c("cookie.acceptAll", "Accept all")
506
+ }
507
+ )
508
+ ] })
509
+ ] })
510
+ }
511
+ ) : null;
512
+ }
513
+ );
514
+ ce.displayName = "NiceCookieConsent";
515
+ const oe = Y(
516
+ ({
517
+ onSubmit: n,
518
+ onForgotPassword: i,
519
+ onRegister: s,
520
+ loading: r = !1,
521
+ error: t,
522
+ variant: a = "primary",
523
+ size: l = "md",
524
+ showRememberMe: h = !0,
525
+ showForgotPassword: u = !0,
526
+ showRegister: p = !1,
527
+ title: _,
528
+ logo: N,
529
+ usernameLabel: g,
530
+ passwordLabel: b,
531
+ usernamePlaceholder: k,
532
+ passwordPlaceholder: f,
533
+ className: c,
534
+ style: L,
535
+ id: $,
536
+ ...w
537
+ }, y) => {
538
+ const z = W($), { t: d } = B(), [T, R] = v(""), [E, j] = v(""), [M, A] = v(!1), [m, F] = v(!1), P = `${z}-user`, H = `${z}-pass`, V = `${z}-remember`, K = C(
539
+ (x) => {
540
+ x.preventDefault(), !r && n?.({ username: T, password: E, rememberMe: M });
541
+ },
542
+ [r, T, E, M, n]
543
+ );
544
+ return /* @__PURE__ */ o(
545
+ "form",
546
+ {
547
+ ref: y,
548
+ id: z,
549
+ className: `nice-login nice-login--${a} nice-login--${l} ${c ?? ""}`,
550
+ style: L,
551
+ onSubmit: K,
552
+ noValidate: !0,
553
+ ...w,
554
+ children: [
555
+ N && /* @__PURE__ */ e("div", { className: "nice-login__logo", children: N }),
556
+ _ && /* @__PURE__ */ e("h2", { className: "nice-login__title", children: _ ?? d("login.title", "Sign In") }),
557
+ t && /* @__PURE__ */ e("div", { className: "nice-login__error", role: "alert", children: t }),
558
+ /* @__PURE__ */ o("div", { className: "nice-login__field", children: [
559
+ /* @__PURE__ */ e("label", { htmlFor: P, className: "nice-login__label", children: g ?? d("login.username", "Username") }),
560
+ /* @__PURE__ */ e(
561
+ "input",
562
+ {
563
+ id: P,
564
+ className: "nice-login__input",
565
+ type: "text",
566
+ value: T,
567
+ onChange: (x) => R(x.target.value),
568
+ placeholder: k ?? d("login.usernamePlaceholder", "Enter your username"),
569
+ autoComplete: "username",
570
+ required: !0,
571
+ disabled: r,
572
+ "aria-required": "true"
573
+ }
574
+ )
575
+ ] }),
576
+ /* @__PURE__ */ o("div", { className: "nice-login__field", children: [
577
+ /* @__PURE__ */ e("label", { htmlFor: H, className: "nice-login__label", children: b ?? d("login.password", "Password") }),
578
+ /* @__PURE__ */ o("div", { className: "nice-login__password-wrap", children: [
579
+ /* @__PURE__ */ e(
580
+ "input",
581
+ {
582
+ id: H,
583
+ className: "nice-login__input",
584
+ type: m ? "text" : "password",
585
+ value: E,
586
+ onChange: (x) => j(x.target.value),
587
+ placeholder: f ?? d("login.passwordPlaceholder", "Enter your password"),
588
+ autoComplete: "current-password",
589
+ required: !0,
590
+ disabled: r,
591
+ "aria-required": "true"
592
+ }
593
+ ),
594
+ /* @__PURE__ */ e(
595
+ "button",
596
+ {
597
+ type: "button",
598
+ className: "nice-login__toggle-password",
599
+ onClick: () => F(!m),
600
+ "aria-label": m ? d("login.hidePassword", "Hide password") : d("login.showPassword", "Show password"),
601
+ tabIndex: -1,
602
+ children: /* @__PURE__ */ e(S, { name: m ? "eye-off" : "eye", size: 16 })
603
+ }
604
+ )
605
+ ] })
606
+ ] }),
607
+ /* @__PURE__ */ o("div", { className: "nice-login__options", children: [
608
+ h && /* @__PURE__ */ o("label", { className: "nice-login__remember", htmlFor: V, children: [
609
+ /* @__PURE__ */ e(
610
+ "input",
611
+ {
612
+ id: V,
613
+ type: "checkbox",
614
+ checked: M,
615
+ onChange: (x) => A(x.target.checked),
616
+ disabled: r
617
+ }
618
+ ),
619
+ /* @__PURE__ */ e("span", { children: d("login.rememberMe", "Remember me") })
620
+ ] }),
621
+ u && i && /* @__PURE__ */ e(
622
+ "button",
623
+ {
624
+ type: "button",
625
+ className: "nice-login__forgot",
626
+ onClick: i,
627
+ disabled: r,
628
+ children: d("login.forgotPassword", "Forgot password?")
629
+ }
630
+ )
631
+ ] }),
632
+ /* @__PURE__ */ e(
633
+ "button",
634
+ {
635
+ type: "submit",
636
+ className: `nice-login__submit nice-login__submit--${a}`,
637
+ disabled: r || !T || !E,
638
+ children: r ? d("login.loading", "Signing in...") : d("login.submit", "Sign In")
639
+ }
640
+ ),
641
+ p && s && /* @__PURE__ */ o("p", { className: "nice-login__register", children: [
642
+ d("login.noAccount", "Don't have an account?"),
643
+ " ",
644
+ /* @__PURE__ */ e(
645
+ "button",
646
+ {
647
+ type: "button",
648
+ className: "nice-login__register-link",
649
+ onClick: s,
650
+ disabled: r,
651
+ children: d("login.register", "Register")
652
+ }
653
+ )
654
+ ] })
655
+ ]
656
+ }
657
+ );
658
+ }
659
+ );
660
+ oe.displayName = "NiceLoginForm";
661
+ const q = class q extends ee {
662
+ constructor() {
663
+ super(...arguments), this.state = {
664
+ hasError: !1,
665
+ error: null
666
+ }, this.handleReset = () => {
667
+ this.setState({ hasError: !1, error: null });
668
+ };
669
+ }
670
+ static getDerivedStateFromError(i) {
671
+ return { hasError: !0, error: i };
672
+ }
673
+ componentDidCatch(i, s) {
674
+ this.props.onError?.(i, s);
675
+ }
676
+ render() {
677
+ if (this.state.hasError && this.state.error) {
678
+ const {
679
+ fallback: i,
680
+ showRetry: s = !0,
681
+ retryLabel: r = "Retry",
682
+ title: t = "Something went wrong"
683
+ } = this.props;
684
+ return typeof i == "function" ? i(this.state.error, this.handleReset) : i || /* @__PURE__ */ o("div", { className: "nice-error-boundary", role: "alert", children: [
685
+ /* @__PURE__ */ e("div", { className: "nice-error-boundary__icon", children: /* @__PURE__ */ e(S, { name: "warning", size: 32 }) }),
686
+ /* @__PURE__ */ e("h2", { className: "nice-error-boundary__title", children: t }),
687
+ /* @__PURE__ */ e("p", { className: "nice-error-boundary__message", children: this.state.error.message }),
688
+ s && /* @__PURE__ */ e("button", { type: "button", className: "nice-btn nice-btn--primary", onClick: this.handleReset, children: r })
689
+ ] });
690
+ }
691
+ return this.props.children;
692
+ }
693
+ };
694
+ q.displayName = "NiceErrorBoundary";
695
+ let G = q;
696
+ export {
697
+ me as N,
698
+ ce as a,
699
+ he as b,
700
+ G as c,
701
+ oe as d,
702
+ pe as e,
703
+ be as f,
704
+ ge as g,
705
+ fe as h,
706
+ J as i,
707
+ ae as j,
708
+ _e as u
709
+ };