@nice2dev/ui 1.0.27 → 1.0.28

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 (60) hide show
  1. package/dist/NiceConfirmDialog-BIppqGad.cjs +1 -0
  2. package/dist/NiceConfirmDialog-CtU3paTe.js +81 -0
  3. package/dist/NiceErrorBoundary-C9ZPRC1v.js +695 -0
  4. package/dist/NiceErrorBoundary-CNsxmX4m.cjs +1 -0
  5. package/dist/NiceForm-B-T7vnE3.cjs +382 -0
  6. package/dist/NiceForm-D3g3RUzs.js +5000 -0
  7. package/dist/NiceModal-Cg7Eo9Ig.cjs +1 -0
  8. package/dist/NiceModal-IHk7nfRN.js +95 -0
  9. package/dist/NiceModuleLifecyclePanel-BY3zmDOy.js +7582 -0
  10. package/dist/NiceModuleLifecyclePanel-Dmbqjb8W.cjs +1 -0
  11. package/dist/NicePagination-BAxcfqnE.js +171 -0
  12. package/dist/NicePagination-BONcK9M_.cjs +1 -0
  13. package/dist/NicePinCodeInput-BDR2PSoo.cjs +696 -0
  14. package/dist/NicePinCodeInput-xJwHHpeS.js +13102 -0
  15. package/dist/NiceSavedQueryPanel-CbE-wQLO.js +6893 -0
  16. package/dist/NiceSavedQueryPanel-DuE2wgV_.cjs +596 -0
  17. package/dist/NiceWindow--TIJTyxg.cjs +1 -0
  18. package/dist/NiceWindow-vqhh0tb_.js +1592 -0
  19. package/dist/charts-C877HM7d.js +4657 -0
  20. package/dist/charts-CjHdhW3E.cjs +761 -0
  21. package/dist/charts.cjs +1 -1
  22. package/dist/charts.mjs +1 -1
  23. package/dist/core-BbGBF3q0.js +25364 -0
  24. package/dist/core-DwOyxP1F.cjs +122 -0
  25. package/dist/data-branching-7B25ogCm.cjs +1 -0
  26. package/dist/data-branching-B_jX2zDY.js +6133 -0
  27. package/dist/data-branching.cjs +1 -1
  28. package/dist/data-branching.mjs +1 -1
  29. package/dist/data.cjs +1 -1
  30. package/dist/data.mjs +1 -1
  31. package/dist/devops-DbKWJZmr.cjs +17 -0
  32. package/dist/devops-nYQjPDoH.js +7684 -0
  33. package/dist/devops.cjs +1 -1
  34. package/dist/devops.mjs +1 -1
  35. package/dist/editors.cjs +1 -1
  36. package/dist/editors.mjs +3 -3
  37. package/dist/feedback.cjs +1 -1
  38. package/dist/feedback.mjs +15 -14
  39. package/dist/index-By5F3DMu.js +67607 -0
  40. package/dist/index-aAc_1dLg.cjs +5518 -0
  41. package/dist/index.cjs +1 -1
  42. package/dist/index.css +1 -1
  43. package/dist/index.d.ts +76 -5
  44. package/dist/index.mjs +986 -985
  45. package/dist/lazy.cjs +1 -1
  46. package/dist/lazy.mjs +24 -24
  47. package/dist/navigation.cjs +1 -1
  48. package/dist/navigation.d.ts +332 -5
  49. package/dist/navigation.mjs +4 -4
  50. package/dist/no-code-C4DPSqYz.cjs +332 -0
  51. package/dist/no-code-zo1dWOLX.js +7133 -0
  52. package/dist/no-code.cjs +1 -1
  53. package/dist/no-code.mjs +1 -1
  54. package/dist/overlays.cjs +1 -1
  55. package/dist/overlays.mjs +2 -2
  56. package/dist/pickerCommons-BRJZMI3n.cjs +1 -0
  57. package/dist/pickerCommons-DWhw7aWu.js +2043 -0
  58. package/dist/pickerCommons.css +1 -0
  59. package/dist/style.css +4 -4
  60. package/package.json +2 -2
@@ -0,0 +1,695 @@
1
+ import { jsx as e, jsxs as o, Fragment as F } from "react/jsx-runtime";
2
+ import { H as G, F as Y, Z as H, Q as J, G as Q } from "./core-BbGBF3q0.js";
3
+ import { useRef as z, useEffect as D, useState as v, useCallback as C, useSyncExternalStore as K, forwardRef as U, Component as X } from "react";
4
+ const Z = {
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
+ }, ue = ({
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: b
20
+ }) => {
21
+ const _ = G("card", b);
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 || Z[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: "✕" })
35
+ ]
36
+ }
37
+ );
38
+ }, me = ({
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: b,
49
+ displayStyle: _
50
+ }) => {
51
+ const N = Y("modal", _), g = G("modal", _), { t: p } = H(), k = z(null);
52
+ return J(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(F, { 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
+ ...b,
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": p("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
+ }, he = ({
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(ee, { toast: r, onDismiss: i }, r.id)) }), ee = ({
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: Z[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("button", { type: "button", className: "nice-toast__close", onClick: () => r(!0), children: "✕" })
140
+ ]
141
+ }
142
+ );
143
+ };
144
+ let ne = 0;
145
+ function fe() {
146
+ const [n, i] = v([]), s = C(
147
+ (t, a, l) => {
148
+ const h = `toast-${++ne}`;
149
+ return i((u) => [
150
+ ...u,
151
+ { id: h, variant: t, message: a, title: l?.title, duration: l?.duration }
152
+ ]), h;
153
+ },
154
+ []
155
+ ), r = C((t) => {
156
+ i((a) => a.filter((l) => l.id !== t));
157
+ }, []);
158
+ return {
159
+ toasts: n,
160
+ dismiss: r,
161
+ info: (t, a) => s("info", t, a),
162
+ success: (t, a) => s("success", t, a),
163
+ warning: (t, a) => s("warning", t, a),
164
+ error: (t, a) => s("error", t, a)
165
+ };
166
+ }
167
+ const _e = ({
168
+ error: n,
169
+ onRetry: i,
170
+ retryLabel: s = "Retry",
171
+ title: r = "Operation failed",
172
+ autoRetrySeconds: t,
173
+ variant: a = "error",
174
+ icon: l,
175
+ size: h = "md",
176
+ className: u,
177
+ style: b,
178
+ "data-testid": _
179
+ }) => {
180
+ const [N, g] = v(t ?? 0), p = z(), k = typeof n == "string" ? n : n.message, f = C(() => {
181
+ g(t ?? 0), i();
182
+ }, [i, t]);
183
+ return D(() => {
184
+ if (!(!t || t <= 0))
185
+ return g(t), p.current = setInterval(() => {
186
+ g((c) => c <= 1 ? (clearInterval(p.current), i(), 0) : c - 1);
187
+ }, 1e3), () => clearInterval(p.current);
188
+ }, [t, i]), /* @__PURE__ */ o(
189
+ "div",
190
+ {
191
+ className: `nice-retry-panel nice-retry-panel--${a} nice-retry-panel--${h} ${u || ""}`,
192
+ style: b,
193
+ role: "alert",
194
+ "data-testid": _,
195
+ children: [
196
+ /* @__PURE__ */ e("div", { className: "nice-retry-panel__icon", children: l ?? "⚠️" }),
197
+ /* @__PURE__ */ o("div", { className: "nice-retry-panel__content", children: [
198
+ /* @__PURE__ */ e("div", { className: "nice-retry-panel__title", children: r }),
199
+ /* @__PURE__ */ e("p", { className: "nice-retry-panel__message", children: k })
200
+ ] }),
201
+ /* @__PURE__ */ o("div", { className: "nice-retry-panel__actions", children: [
202
+ /* @__PURE__ */ e(
203
+ "button",
204
+ {
205
+ type: "button",
206
+ className: "nice-btn nice-btn--primary nice-btn--sm",
207
+ onClick: f,
208
+ children: s
209
+ }
210
+ ),
211
+ t && N > 0 && /* @__PURE__ */ o("span", { className: "nice-retry-panel__countdown", children: [
212
+ "Auto-retry in ",
213
+ N,
214
+ "s"
215
+ ] })
216
+ ] })
217
+ ]
218
+ }
219
+ );
220
+ };
221
+ function te(n) {
222
+ return window.addEventListener("online", n), window.addEventListener("offline", n), () => {
223
+ window.removeEventListener("online", n), window.removeEventListener("offline", n);
224
+ };
225
+ }
226
+ function ie() {
227
+ return navigator.onLine;
228
+ }
229
+ function re() {
230
+ return !0;
231
+ }
232
+ const pe = ({
233
+ message: n = "You are offline. Some features may be unavailable.",
234
+ variant: i = "warning",
235
+ icon: s,
236
+ size: r = "md",
237
+ className: t,
238
+ style: a,
239
+ "data-testid": l
240
+ }) => K(te, ie, re) ? null : /* @__PURE__ */ o(
241
+ "div",
242
+ {
243
+ className: `nice-offline-banner nice-offline-banner--${i} nice-offline-banner--${r} ${t || ""}`,
244
+ style: a,
245
+ role: "alert",
246
+ "aria-live": "assertive",
247
+ "data-testid": l,
248
+ children: [
249
+ /* @__PURE__ */ e("span", { className: "nice-offline-banner__icon", children: s ?? "📡" }),
250
+ /* @__PURE__ */ e("span", { className: "nice-offline-banner__message", children: n })
251
+ ]
252
+ }
253
+ );
254
+ function se({
255
+ timeoutMs: n = 1e4,
256
+ slowThresholdMs: i = 3e3,
257
+ onTimeout: s,
258
+ autoRetry: r = !1,
259
+ autoRetryCount: t = 3
260
+ } = {}) {
261
+ const [a, l] = v(!1), [h, u] = v(!1), [b, _] = v(!1), [N, g] = v(0), [p, k] = v(0), f = z(null), c = z(null), L = z(null), $ = z(0), w = C(() => {
262
+ f.current && clearTimeout(f.current), c.current && clearTimeout(c.current), L.current && clearInterval(L.current);
263
+ }, []), y = C(() => {
264
+ w(), l(!0), u(!1), _(!1), g(0), $.current = Date.now(), L.current = setInterval(() => {
265
+ g(Date.now() - $.current);
266
+ }, 200), f.current = setTimeout(() => {
267
+ u(!0);
268
+ }, i), c.current = setTimeout(() => {
269
+ _(!0), l(!1), u(!1), w(), s?.();
270
+ }, n);
271
+ }, [w, i, n, s]), x = C(() => {
272
+ w(), l(!1), u(!1);
273
+ }, [w]), d = C(() => {
274
+ k((T) => T + 1), _(!1), y();
275
+ }, [y]);
276
+ return D(() => () => w(), [w]), D(() => {
277
+ if (r && b && p < t) {
278
+ const T = Math.pow(2, p) * 1e3, R = setTimeout(() => d(), T);
279
+ return () => clearTimeout(R);
280
+ }
281
+ }, [r, t, b, p, d]), { isLoading: a, isSlow: h, isTimedOut: b, elapsed: N, retryCount: p, start: y, stop: x, retry: d };
282
+ }
283
+ const be = ({
284
+ timeoutMs: n = 1e4,
285
+ slowThresholdMs: i = 3e3,
286
+ onTimeout: s,
287
+ onRetry: r,
288
+ autoRetry: t = !1,
289
+ autoRetryCount: a = 3,
290
+ showProgress: l = !0,
291
+ slowMessage: h = "Operacja trwa dłużej niż zwykle…",
292
+ timeoutMessage: u = "Przekroczono limit czasu. Spróbuj ponownie.",
293
+ loading: b,
294
+ children: _,
295
+ size: N = "md",
296
+ className: g,
297
+ style: p,
298
+ "data-testid": k
299
+ }) => {
300
+ const { isSlow: f, isTimedOut: c, elapsed: L, retry: $ } = se({
301
+ timeoutMs: n,
302
+ slowThresholdMs: i,
303
+ onTimeout: s,
304
+ autoRetry: t,
305
+ autoRetryCount: a
306
+ }), w = () => {
307
+ $(), r?.();
308
+ };
309
+ if (!b)
310
+ return /* @__PURE__ */ e(F, { children: _ });
311
+ if (c)
312
+ return /* @__PURE__ */ o(
313
+ "div",
314
+ {
315
+ className: `nice-timeout-feedback nice-timeout-feedback--timeout nice-timeout-feedback--${N} ${g ?? ""}`,
316
+ style: p,
317
+ role: "alert",
318
+ "data-testid": k,
319
+ children: [
320
+ /* @__PURE__ */ e("p", { className: "nice-timeout-feedback__message", children: u }),
321
+ /* @__PURE__ */ e("button", { className: "nice-timeout-feedback__retry-btn", onClick: w, type: "button", children: "Spróbuj ponownie" })
322
+ ]
323
+ }
324
+ );
325
+ const y = Math.min(100, L / n * 100);
326
+ return /* @__PURE__ */ o(
327
+ "div",
328
+ {
329
+ className: `nice-timeout-feedback nice-timeout-feedback--${N} ${f ? "nice-timeout-feedback--slow" : ""} ${g ?? ""}`,
330
+ style: p,
331
+ "data-testid": k,
332
+ children: [
333
+ /* @__PURE__ */ e("div", { className: "nice-timeout-feedback__spinner", "aria-busy": "true" }),
334
+ f && /* @__PURE__ */ e("p", { className: "nice-timeout-feedback__slow-msg", children: h }),
335
+ l && /* @__PURE__ */ e(
336
+ "div",
337
+ {
338
+ className: "nice-timeout-feedback__progress",
339
+ role: "progressbar",
340
+ "aria-valuenow": y,
341
+ "aria-valuemin": 0,
342
+ "aria-valuemax": 100,
343
+ children: /* @__PURE__ */ e(
344
+ "div",
345
+ {
346
+ className: "nice-timeout-feedback__progress-bar",
347
+ style: { width: `${y}%` }
348
+ }
349
+ )
350
+ }
351
+ )
352
+ ]
353
+ }
354
+ );
355
+ }, ae = U(
356
+ ({
357
+ visible: n,
358
+ onAcceptAll: i,
359
+ onRejectAll: s,
360
+ onSave: r,
361
+ categories: t = ["necessary", "analytics", "marketing", "preferences"],
362
+ defaults: a,
363
+ position: l = "bottom",
364
+ size: h = "md",
365
+ policyUrl: u,
366
+ showDetails: b = !1,
367
+ className: _,
368
+ style: N,
369
+ id: g,
370
+ ...p
371
+ }, k) => {
372
+ const f = Q(g), { t: c } = H(), [L, $] = v(!0), w = n ?? L, [y, x] = v(b), [d, T] = v(() => {
373
+ const m = {
374
+ necessary: !0,
375
+ analytics: !1,
376
+ marketing: !1,
377
+ preferences: !1
378
+ };
379
+ return a && Object.assign(m, a), m.necessary = !0, m;
380
+ }), R = {
381
+ necessary: c("cookie.necessary", "Necessary"),
382
+ analytics: c("cookie.analytics", "Analytics"),
383
+ marketing: c("cookie.marketing", "Marketing"),
384
+ preferences: c("cookie.preferences", "Preferences")
385
+ }, I = {
386
+ necessary: c(
387
+ "cookie.necessaryDesc",
388
+ "Required for the website to function. Cannot be disabled."
389
+ ),
390
+ analytics: c(
391
+ "cookie.analyticsDesc",
392
+ "Help us understand how visitors interact with the website."
393
+ ),
394
+ marketing: c("cookie.marketingDesc", "Used to deliver relevant advertisements."),
395
+ preferences: c("cookie.preferencesDesc", "Allow the website to remember your choices.")
396
+ }, S = C(() => {
397
+ const m = {
398
+ necessary: !0,
399
+ analytics: !0,
400
+ marketing: !0,
401
+ preferences: !0
402
+ };
403
+ i?.(), r?.(m), $(!1);
404
+ }, [i, r]), M = C(() => {
405
+ const m = {
406
+ necessary: !0,
407
+ analytics: !1,
408
+ marketing: !1,
409
+ preferences: !1
410
+ };
411
+ s?.(), r?.(m), $(!1);
412
+ }, [s, r]), j = C(() => {
413
+ r?.({ ...d, necessary: !0 }), $(!1);
414
+ }, [d, r]);
415
+ return w ? /* @__PURE__ */ e(
416
+ "div",
417
+ {
418
+ ref: k,
419
+ id: f,
420
+ className: `nice-cookie-consent nice-cookie-consent--${l} nice-cookie-consent--${h} ${_ ?? ""}`,
421
+ style: N,
422
+ role: "dialog",
423
+ "aria-label": c("cookie.label", "Cookie Consent"),
424
+ "aria-modal": "true",
425
+ ...p,
426
+ children: /* @__PURE__ */ o("div", { className: "nice-cookie-consent__content", children: [
427
+ /* @__PURE__ */ o("p", { className: "nice-cookie-consent__message", children: [
428
+ c(
429
+ "cookie.message",
430
+ "We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies."
431
+ ),
432
+ u && /* @__PURE__ */ o(F, { children: [
433
+ " ",
434
+ /* @__PURE__ */ e(
435
+ "a",
436
+ {
437
+ href: u,
438
+ className: "nice-cookie-consent__link",
439
+ target: "_blank",
440
+ rel: "noopener noreferrer",
441
+ children: c("cookie.learnMore", "Learn more")
442
+ }
443
+ )
444
+ ] })
445
+ ] }),
446
+ y && /* @__PURE__ */ e("div", { className: "nice-cookie-consent__details", children: t.map((m) => /* @__PURE__ */ o("label", { className: "nice-cookie-consent__category", children: [
447
+ /* @__PURE__ */ e(
448
+ "input",
449
+ {
450
+ type: "checkbox",
451
+ checked: d[m],
452
+ disabled: m === "necessary",
453
+ onChange: (A) => T((P) => ({ ...P, [m]: A.target.checked })),
454
+ className: "nice-cookie-consent__checkbox"
455
+ }
456
+ ),
457
+ /* @__PURE__ */ o("div", { className: "nice-cookie-consent__cat-info", children: [
458
+ /* @__PURE__ */ e("strong", { children: R[m] }),
459
+ /* @__PURE__ */ e("span", { className: "nice-cookie-consent__cat-desc", children: I[m] })
460
+ ] })
461
+ ] }, m)) }),
462
+ /* @__PURE__ */ o("div", { className: "nice-cookie-consent__actions", children: [
463
+ !y && /* @__PURE__ */ e(
464
+ "button",
465
+ {
466
+ type: "button",
467
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--details",
468
+ onClick: () => x(!0),
469
+ children: c("cookie.customize", "Customize")
470
+ }
471
+ ),
472
+ y && /* @__PURE__ */ e(
473
+ "button",
474
+ {
475
+ type: "button",
476
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--save",
477
+ onClick: j,
478
+ children: c("cookie.savePreferences", "Save preferences")
479
+ }
480
+ ),
481
+ /* @__PURE__ */ e(
482
+ "button",
483
+ {
484
+ type: "button",
485
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--reject",
486
+ onClick: M,
487
+ children: c("cookie.rejectAll", "Reject all")
488
+ }
489
+ ),
490
+ /* @__PURE__ */ e(
491
+ "button",
492
+ {
493
+ type: "button",
494
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--accept",
495
+ onClick: S,
496
+ children: c("cookie.acceptAll", "Accept all")
497
+ }
498
+ )
499
+ ] })
500
+ ] })
501
+ }
502
+ ) : null;
503
+ }
504
+ );
505
+ ae.displayName = "NiceCookieConsent";
506
+ const ce = U(
507
+ ({
508
+ onSubmit: n,
509
+ onForgotPassword: i,
510
+ onRegister: s,
511
+ loading: r = !1,
512
+ error: t,
513
+ variant: a = "primary",
514
+ size: l = "md",
515
+ showRememberMe: h = !0,
516
+ showForgotPassword: u = !0,
517
+ showRegister: b = !1,
518
+ title: _,
519
+ logo: N,
520
+ usernameLabel: g,
521
+ passwordLabel: p,
522
+ usernamePlaceholder: k,
523
+ passwordPlaceholder: f,
524
+ className: c,
525
+ style: L,
526
+ id: $,
527
+ ...w
528
+ }, y) => {
529
+ const x = Q($), { t: d } = H(), [T, R] = v(""), [I, S] = v(""), [M, j] = v(!1), [m, A] = v(!1), P = `${x}-user`, B = `${x}-pass`, q = `${x}-remember`, W = C(
530
+ (E) => {
531
+ E.preventDefault(), !r && n?.({ username: T, password: I, rememberMe: M });
532
+ },
533
+ [r, T, I, M, n]
534
+ );
535
+ return /* @__PURE__ */ o(
536
+ "form",
537
+ {
538
+ ref: y,
539
+ id: x,
540
+ className: `nice-login nice-login--${a} nice-login--${l} ${c ?? ""}`,
541
+ style: L,
542
+ onSubmit: W,
543
+ noValidate: !0,
544
+ ...w,
545
+ children: [
546
+ N && /* @__PURE__ */ e("div", { className: "nice-login__logo", children: N }),
547
+ _ && /* @__PURE__ */ e("h2", { className: "nice-login__title", children: _ ?? d("login.title", "Sign In") }),
548
+ t && /* @__PURE__ */ e("div", { className: "nice-login__error", role: "alert", children: t }),
549
+ /* @__PURE__ */ o("div", { className: "nice-login__field", children: [
550
+ /* @__PURE__ */ e("label", { htmlFor: P, className: "nice-login__label", children: g ?? d("login.username", "Username") }),
551
+ /* @__PURE__ */ e(
552
+ "input",
553
+ {
554
+ id: P,
555
+ className: "nice-login__input",
556
+ type: "text",
557
+ value: T,
558
+ onChange: (E) => R(E.target.value),
559
+ placeholder: k ?? d("login.usernamePlaceholder", "Enter your username"),
560
+ autoComplete: "username",
561
+ required: !0,
562
+ disabled: r,
563
+ "aria-required": "true"
564
+ }
565
+ )
566
+ ] }),
567
+ /* @__PURE__ */ o("div", { className: "nice-login__field", children: [
568
+ /* @__PURE__ */ e("label", { htmlFor: B, className: "nice-login__label", children: p ?? d("login.password", "Password") }),
569
+ /* @__PURE__ */ o("div", { className: "nice-login__password-wrap", children: [
570
+ /* @__PURE__ */ e(
571
+ "input",
572
+ {
573
+ id: B,
574
+ className: "nice-login__input",
575
+ type: m ? "text" : "password",
576
+ value: I,
577
+ onChange: (E) => S(E.target.value),
578
+ placeholder: f ?? d("login.passwordPlaceholder", "Enter your password"),
579
+ autoComplete: "current-password",
580
+ required: !0,
581
+ disabled: r,
582
+ "aria-required": "true"
583
+ }
584
+ ),
585
+ /* @__PURE__ */ e(
586
+ "button",
587
+ {
588
+ type: "button",
589
+ className: "nice-login__toggle-password",
590
+ onClick: () => A(!m),
591
+ "aria-label": m ? d("login.hidePassword", "Hide password") : d("login.showPassword", "Show password"),
592
+ tabIndex: -1,
593
+ children: m ? "🙈" : "👁"
594
+ }
595
+ )
596
+ ] })
597
+ ] }),
598
+ /* @__PURE__ */ o("div", { className: "nice-login__options", children: [
599
+ h && /* @__PURE__ */ o("label", { className: "nice-login__remember", htmlFor: q, children: [
600
+ /* @__PURE__ */ e(
601
+ "input",
602
+ {
603
+ id: q,
604
+ type: "checkbox",
605
+ checked: M,
606
+ onChange: (E) => j(E.target.checked),
607
+ disabled: r
608
+ }
609
+ ),
610
+ /* @__PURE__ */ e("span", { children: d("login.rememberMe", "Remember me") })
611
+ ] }),
612
+ u && i && /* @__PURE__ */ e(
613
+ "button",
614
+ {
615
+ type: "button",
616
+ className: "nice-login__forgot",
617
+ onClick: i,
618
+ disabled: r,
619
+ children: d("login.forgotPassword", "Forgot password?")
620
+ }
621
+ )
622
+ ] }),
623
+ /* @__PURE__ */ e(
624
+ "button",
625
+ {
626
+ type: "submit",
627
+ className: `nice-login__submit nice-login__submit--${a}`,
628
+ disabled: r || !T || !I,
629
+ children: r ? d("login.loading", "Signing in...") : d("login.submit", "Sign In")
630
+ }
631
+ ),
632
+ b && s && /* @__PURE__ */ o("p", { className: "nice-login__register", children: [
633
+ d("login.noAccount", "Don't have an account?"),
634
+ " ",
635
+ /* @__PURE__ */ e(
636
+ "button",
637
+ {
638
+ type: "button",
639
+ className: "nice-login__register-link",
640
+ onClick: s,
641
+ disabled: r,
642
+ children: d("login.register", "Register")
643
+ }
644
+ )
645
+ ] })
646
+ ]
647
+ }
648
+ );
649
+ }
650
+ );
651
+ ce.displayName = "NiceLoginForm";
652
+ const O = class O extends X {
653
+ constructor() {
654
+ super(...arguments), this.state = {
655
+ hasError: !1,
656
+ error: null
657
+ }, this.handleReset = () => {
658
+ this.setState({ hasError: !1, error: null });
659
+ };
660
+ }
661
+ static getDerivedStateFromError(i) {
662
+ return { hasError: !0, error: i };
663
+ }
664
+ componentDidCatch(i, s) {
665
+ this.props.onError?.(i, s);
666
+ }
667
+ render() {
668
+ if (this.state.hasError && this.state.error) {
669
+ const { fallback: i, showRetry: s = !0, retryLabel: r = "Retry", title: t = "Something went wrong" } = this.props;
670
+ return typeof i == "function" ? i(this.state.error, this.handleReset) : i || /* @__PURE__ */ o("div", { className: "nice-error-boundary", role: "alert", children: [
671
+ /* @__PURE__ */ e("div", { className: "nice-error-boundary__icon", children: "⚠️" }),
672
+ /* @__PURE__ */ e("h2", { className: "nice-error-boundary__title", children: t }),
673
+ /* @__PURE__ */ e("p", { className: "nice-error-boundary__message", children: this.state.error.message }),
674
+ s && /* @__PURE__ */ e("button", { type: "button", className: "nice-btn nice-btn--primary", onClick: this.handleReset, children: r })
675
+ ] });
676
+ }
677
+ return this.props.children;
678
+ }
679
+ };
680
+ O.displayName = "NiceErrorBoundary";
681
+ let V = O;
682
+ export {
683
+ ue as N,
684
+ ae as a,
685
+ me as b,
686
+ V as c,
687
+ ce as d,
688
+ pe as e,
689
+ _e as f,
690
+ be as g,
691
+ he as h,
692
+ Z as i,
693
+ se as j,
694
+ fe as u
695
+ };