@nice2dev/ui 1.0.6 → 1.0.8

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 (99) hide show
  1. package/dist/NiceAPIFlow.doc-DnQLPUie.js +30 -0
  2. package/dist/NiceAPIFlow.doc-Dx4qw1lm.cjs +6 -0
  3. package/dist/NiceBranchManager.doc-BXjiENlD.cjs +6 -0
  4. package/dist/NiceBranchManager.doc-xLB82YwU.js +30 -0
  5. package/dist/NiceButton-CDiS45Ya.cjs +1 -0
  6. package/dist/NiceButton-D9l39Rs7.js +595 -0
  7. package/dist/NiceCodeTemplate.doc-BWxTE4C_.cjs +6 -0
  8. package/dist/NiceCodeTemplate.doc-CA2U5F-v.js +30 -0
  9. package/dist/NiceDataBranchGraph.doc-CkitupWc.js +29 -0
  10. package/dist/NiceDataBranchGraph.doc-DDUgipqH.cjs +5 -0
  11. package/dist/NiceDataBranchManager.doc-B0ODKOs4.js +30 -0
  12. package/dist/NiceDataBranchManager.doc-CC5o8ihs.cjs +6 -0
  13. package/dist/NiceDataConflictResolver.doc-CdzScNie.cjs +5 -0
  14. package/dist/NiceDataConflictResolver.doc-V8vxYAeo.js +29 -0
  15. package/dist/NiceDataDiffViewer.doc-CR14Bq3A.cjs +6 -0
  16. package/dist/NiceDataDiffViewer.doc-w2I2QjhX.js +30 -0
  17. package/dist/NiceDataMapper.doc-C7jSyHRM.js +30 -0
  18. package/dist/NiceDataMapper.doc-DXjQHz87.cjs +6 -0
  19. package/dist/NiceDataMergeBuilder.doc-CV32WC_w.cjs +6 -0
  20. package/dist/NiceDataMergeBuilder.doc-DtuYb3nx.js +30 -0
  21. package/dist/NiceDataSnapshot.doc-CFLkY3ry.js +30 -0
  22. package/dist/NiceDataSnapshot.doc-CpZyQ17u.cjs +6 -0
  23. package/dist/NiceErrorBoundary-BAeqfoSc.cjs +1 -0
  24. package/dist/NiceErrorBoundary-niMx1aSJ.js +837 -0
  25. package/dist/NiceEventOrchestrator.doc-C4SJfIDV.js +30 -0
  26. package/dist/NiceEventOrchestrator.doc-CxjsLxBG.cjs +6 -0
  27. package/dist/NiceGitBlame.doc-BG3_K9_0.cjs +6 -0
  28. package/dist/NiceGitBlame.doc-DrJABEat.js +30 -0
  29. package/dist/NiceGitConflictResolver.doc-BK7hAfz6.js +30 -0
  30. package/dist/NiceGitConflictResolver.doc-CgroGM9_.cjs +6 -0
  31. package/dist/NiceGitDiffViewer.doc-BAwgcY_3.cjs +6 -0
  32. package/dist/NiceGitDiffViewer.doc-BXKJeP-E.js +30 -0
  33. package/dist/NiceGitGraph.doc-B-WtGuzn.cjs +5 -0
  34. package/dist/NiceGitGraph.doc-DxnDPCgC.js +29 -0
  35. package/dist/NiceGitHooks.doc-BrEizvMp.js +29 -0
  36. package/dist/NiceGitHooks.doc-C4EdV5zj.cjs +5 -0
  37. package/dist/NiceMergeRequestBuilder.doc-C5p8mYuh.cjs +6 -0
  38. package/dist/NiceMergeRequestBuilder.doc-Ct9RCmU8.js +30 -0
  39. package/dist/NiceModuleLifecyclePanel-Brg1RLwi.cjs +1 -0
  40. package/dist/NiceModuleLifecyclePanel-I_TXRiiY.js +5053 -0
  41. package/dist/NicePinCodeInput-CrMfdxxc.js +15287 -0
  42. package/dist/NicePinCodeInput-D0aF9MK8.cjs +692 -0
  43. package/dist/NicePipelineEditor.doc-0eGt8zbX.cjs +5 -0
  44. package/dist/NicePipelineEditor.doc-DTmaOebn.js +29 -0
  45. package/dist/NicePipelineMonitor.doc-67CmsRcf.cjs +5 -0
  46. package/dist/NicePipelineMonitor.doc-mSMdhuG8.js +29 -0
  47. package/dist/NiceSavedQueryPanel-BZNvqSQW.cjs +596 -0
  48. package/dist/NiceSavedQueryPanel-CUAsdOjJ.js +6190 -0
  49. package/dist/NiceStateDesigner.doc-B36u0hNU.js +29 -0
  50. package/dist/NiceStateDesigner.doc-MPmvNHSx.cjs +5 -0
  51. package/dist/NiceTestBuilder.doc-BFInj8GJ.js +30 -0
  52. package/dist/NiceTestBuilder.doc-CB03U_uR.cjs +6 -0
  53. package/dist/NiceToggle-CaY1u82g.js +277 -0
  54. package/dist/NiceToggle-DFJFQv_Z.cjs +1 -0
  55. package/dist/NiceWindow-IdHAcP70.cjs +1 -0
  56. package/dist/NiceWindow-SiCaREbq.js +1408 -0
  57. package/dist/charts-Bx_kNBsE.js +4280 -0
  58. package/dist/charts-DECVsCHX.cjs +754 -0
  59. package/dist/charts.cjs +1 -1
  60. package/dist/charts.css +1 -0
  61. package/dist/charts.d.ts +3 -3
  62. package/dist/charts.mjs +1 -1
  63. package/dist/core-BZBTsGWN.cjs +96 -0
  64. package/dist/core-BpghV7Ls.js +17555 -0
  65. package/dist/data-branching-De4ExX-S.cjs +1 -0
  66. package/dist/data-branching-DiRfob1f.js +6071 -0
  67. package/dist/data-branching.cjs +1 -0
  68. package/dist/data-branching.d.ts +401 -0
  69. package/dist/data-branching.mjs +9 -0
  70. package/dist/data.cjs +1 -1
  71. package/dist/data.mjs +1 -1
  72. package/dist/devops-BnYinjkT.cjs +17 -0
  73. package/dist/devops-Ckh57eti.js +7198 -0
  74. package/dist/devops.cjs +1 -0
  75. package/dist/devops.d.ts +758 -0
  76. package/dist/devops.mjs +12 -0
  77. package/dist/editors.cjs +1 -1
  78. package/dist/editors.mjs +3 -3
  79. package/dist/feedback.cjs +1 -1
  80. package/dist/feedback.mjs +1 -1
  81. package/dist/index-CBIZ6mTQ.cjs +5734 -0
  82. package/dist/index-CIl98Vbm.js +72951 -0
  83. package/dist/index.cjs +1 -1
  84. package/dist/index.css +1 -1
  85. package/dist/index.d.ts +3643 -93
  86. package/dist/index.mjs +1001 -952
  87. package/dist/lazy.cjs +1 -0
  88. package/dist/lazy.d.ts +1880 -0
  89. package/dist/lazy.mjs +98 -0
  90. package/dist/navigation.cjs +1 -1
  91. package/dist/navigation.mjs +69 -12
  92. package/dist/no-code-BCuadkm4.cjs +332 -0
  93. package/dist/no-code-TL7PyulA.js +7005 -0
  94. package/dist/no-code.cjs +1 -0
  95. package/dist/no-code.d.ts +870 -0
  96. package/dist/no-code.mjs +13 -0
  97. package/dist/overlays.cjs +1 -1
  98. package/dist/overlays.mjs +480 -24
  99. package/package.json +21 -1
@@ -0,0 +1,837 @@
1
+ import { jsx as e, jsxs as a, Fragment as j } from "react/jsx-runtime";
2
+ import { i as O, g as P, h as W, c as G, b as J } from "./core-BpghV7Ls.js";
3
+ import U, { useRef as I, useState as k, useEffect as x, useCallback as L, useSyncExternalStore as Z, forwardRef as K, Component as ee } from "react";
4
+ const Q = {
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
+ }, he = ({
10
+ variant: n = "info",
11
+ title: t,
12
+ children: s,
13
+ closable: r,
14
+ onClose: i,
15
+ icon: c,
16
+ size: l = "md",
17
+ className: u,
18
+ style: d,
19
+ displayStyle: p
20
+ }) => {
21
+ const m = O("card", p);
22
+ return /* @__PURE__ */ a(
23
+ "div",
24
+ {
25
+ className: `nice-alert nice-alert--${n} nice-alert--${l} nice-alert--ds-${m} ${u || ""}`,
26
+ style: d,
27
+ role: "alert",
28
+ children: [
29
+ /* @__PURE__ */ e("div", { className: `nice-alert__icon nice-alert__icon--${n}`, children: c || Q[n] }),
30
+ /* @__PURE__ */ a("div", { className: "nice-alert__content", children: [
31
+ t && /* @__PURE__ */ e("div", { className: "nice-alert__title", children: t }),
32
+ /* @__PURE__ */ e("div", { children: s })
33
+ ] }),
34
+ r && /* @__PURE__ */ e("button", { type: "button", className: "nice-alert__close", onClick: i, "aria-label": "Close", children: "✕" })
35
+ ]
36
+ }
37
+ );
38
+ }, fe = ({
39
+ open: n,
40
+ onClose: t,
41
+ title: s,
42
+ size: r = "md",
43
+ children: i,
44
+ footer: c,
45
+ closeOnOverlay: l = !0,
46
+ closeOnEscape: u = !0,
47
+ fullscreenable: d,
48
+ zIndex: p,
49
+ className: m,
50
+ style: y,
51
+ displayStyle: v
52
+ }) => {
53
+ const { t: _ } = P(), g = I(null), [h, o] = k(!1), $ = W("modal", v), w = O("modal", v);
54
+ return G(g, n), x(() => {
55
+ if (!n || !u)
56
+ return;
57
+ const f = (C) => {
58
+ C.key === "Escape" && t();
59
+ };
60
+ return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
61
+ }, [n, u, t]), x(() => (n ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
62
+ document.body.style.overflow = "";
63
+ }), [n]), n ? /* @__PURE__ */ e(
64
+ "div",
65
+ {
66
+ className: "nice-modal-overlay",
67
+ style: p ? { zIndex: p } : void 0,
68
+ onClick: l ? t : void 0,
69
+ children: /* @__PURE__ */ a(
70
+ "div",
71
+ {
72
+ ref: g,
73
+ className: `nice-modal nice-modal--${h ? "full" : r} nice-modal--ds-${w} ${m || ""}`,
74
+ style: { ...$, ...y },
75
+ role: "dialog",
76
+ "aria-modal": "true",
77
+ "aria-label": s,
78
+ onClick: (f) => f.stopPropagation(),
79
+ children: [
80
+ s && /* @__PURE__ */ a("div", { className: "nice-modal__header", children: [
81
+ /* @__PURE__ */ e("h2", { className: "nice-modal__title", children: s }),
82
+ /* @__PURE__ */ a("div", { className: "nice-modal__header-actions", children: [
83
+ d && /* @__PURE__ */ e(
84
+ "button",
85
+ {
86
+ type: "button",
87
+ className: "nice-modal__fullscreen",
88
+ onClick: () => o((f) => !f),
89
+ "aria-label": h ? "Exit fullscreen" : "Fullscreen",
90
+ children: h ? "⇲" : "⇱"
91
+ }
92
+ ),
93
+ /* @__PURE__ */ e(
94
+ "button",
95
+ {
96
+ type: "button",
97
+ className: "nice-modal__close",
98
+ onClick: t,
99
+ "aria-label": _("controls.close", "Close"),
100
+ 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" }) })
101
+ }
102
+ )
103
+ ] })
104
+ ] }),
105
+ /* @__PURE__ */ e("div", { className: "nice-modal__body", children: i }),
106
+ c && /* @__PURE__ */ e("div", { className: "nice-modal__footer", children: c })
107
+ ]
108
+ }
109
+ )
110
+ }
111
+ ) : null;
112
+ }, _e = ({
113
+ open: n,
114
+ onClose: t,
115
+ title: s,
116
+ position: r = "right",
117
+ size: i = "md",
118
+ children: c,
119
+ footer: l,
120
+ transitionDuration: u,
121
+ className: d,
122
+ style: p,
123
+ displayStyle: m
124
+ }) => {
125
+ const y = W("modal", m), v = O("modal", m), { t: _ } = P(), g = I(null);
126
+ return G(g, n), x(() => {
127
+ if (!n)
128
+ return;
129
+ const h = (o) => {
130
+ o.key === "Escape" && t();
131
+ };
132
+ return document.addEventListener("keydown", h), document.body.style.overflow = "hidden", () => {
133
+ document.removeEventListener("keydown", h), document.body.style.overflow = "";
134
+ };
135
+ }, [n, t]), n ? /* @__PURE__ */ a(j, { children: [
136
+ /* @__PURE__ */ e("div", { className: "nice-drawer-overlay", onClick: t }),
137
+ /* @__PURE__ */ a(
138
+ "div",
139
+ {
140
+ ref: g,
141
+ className: `nice-drawer nice-drawer--${r} nice-drawer--${i} nice-drawer--ds-${v} ${d || ""}`,
142
+ style: {
143
+ ...y,
144
+ ...p,
145
+ ...u != null ? { transitionDuration: `${u}ms` } : {}
146
+ },
147
+ role: "dialog",
148
+ "aria-modal": "true",
149
+ "aria-label": s,
150
+ children: [
151
+ s && /* @__PURE__ */ a("div", { className: "nice-drawer__header", children: [
152
+ /* @__PURE__ */ e("h3", { className: "nice-drawer__title", children: s }),
153
+ /* @__PURE__ */ e(
154
+ "button",
155
+ {
156
+ type: "button",
157
+ className: "nice-drawer__close",
158
+ onClick: t,
159
+ "aria-label": _("controls.close", "Close"),
160
+ 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" }) })
161
+ }
162
+ )
163
+ ] }),
164
+ /* @__PURE__ */ e("div", { className: "nice-drawer__body", children: c }),
165
+ l && /* @__PURE__ */ e("div", { className: "nice-drawer__footer", children: l })
166
+ ]
167
+ }
168
+ )
169
+ ] }) : null;
170
+ }, be = ({
171
+ toasts: n,
172
+ onDismiss: t,
173
+ position: s = "top-right"
174
+ }) => /* @__PURE__ */ e("div", { className: `nice-toast-container nice-toast-container--${s}`, children: n.map((r) => /* @__PURE__ */ e(ne, { toast: r, onDismiss: t }, r.id)) }), ne = ({
175
+ toast: n,
176
+ onDismiss: t
177
+ }) => {
178
+ const [s, r] = k(!1);
179
+ return x(() => {
180
+ if (!n.duration && n.duration !== 0) {
181
+ const i = setTimeout(() => r(!0), 4e3);
182
+ return () => clearTimeout(i);
183
+ }
184
+ if (n.duration > 0) {
185
+ const i = setTimeout(() => r(!0), n.duration);
186
+ return () => clearTimeout(i);
187
+ }
188
+ }, [n.duration]), x(() => {
189
+ if (s) {
190
+ const i = setTimeout(() => t(n.id), 200);
191
+ return () => clearTimeout(i);
192
+ }
193
+ }, [s, n.id, t]), /* @__PURE__ */ a(
194
+ "div",
195
+ {
196
+ className: `nice-toast nice-toast--${n.variant} ${s ? "nice-toast--exiting" : ""}`,
197
+ role: "alert",
198
+ style: { position: "relative" },
199
+ children: [
200
+ /* @__PURE__ */ e("div", { className: "nice-toast__icon", children: Q[n.variant] }),
201
+ /* @__PURE__ */ a("div", { className: "nice-toast__content", children: [
202
+ n.title && /* @__PURE__ */ e("div", { className: "nice-toast__title", children: n.title }),
203
+ /* @__PURE__ */ e("div", { className: "nice-toast__message", children: n.message })
204
+ ] }),
205
+ /* @__PURE__ */ e("button", { type: "button", className: "nice-toast__close", onClick: () => r(!0), children: "✕" })
206
+ ]
207
+ }
208
+ );
209
+ };
210
+ let ie = 0;
211
+ function pe() {
212
+ const [n, t] = k([]), s = L(
213
+ (i, c, l) => {
214
+ const u = `toast-${++ie}`;
215
+ return t((d) => [
216
+ ...d,
217
+ { id: u, variant: i, message: c, title: l?.title, duration: l?.duration }
218
+ ]), u;
219
+ },
220
+ []
221
+ ), r = L((i) => {
222
+ t((c) => c.filter((l) => l.id !== i));
223
+ }, []);
224
+ return {
225
+ toasts: n,
226
+ dismiss: r,
227
+ info: (i, c) => s("info", i, c),
228
+ success: (i, c) => s("success", i, c),
229
+ warning: (i, c) => s("warning", i, c),
230
+ error: (i, c) => s("error", i, c)
231
+ };
232
+ }
233
+ const te = {
234
+ info: /* @__PURE__ */ e("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" }) }),
235
+ warning: /* @__PURE__ */ e("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" }) }),
236
+ error: /* @__PURE__ */ e("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" }) }),
237
+ success: /* @__PURE__ */ e("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" }) })
238
+ }, ve = ({
239
+ visible: n,
240
+ message: t,
241
+ header: s,
242
+ icon: r,
243
+ variant: i = "warning",
244
+ acceptLabel: c,
245
+ rejectLabel: l,
246
+ onAccept: u,
247
+ onReject: d,
248
+ closeOnOverlay: p = !1,
249
+ closeOnEscape: m = !0,
250
+ size: y = "md",
251
+ className: v,
252
+ style: _
253
+ }) => {
254
+ const { t: g } = P();
255
+ if (U.useEffect(() => {
256
+ if (!n || !m)
257
+ return;
258
+ const w = (f) => {
259
+ f.key === "Escape" && d();
260
+ };
261
+ return document.addEventListener("keydown", w), () => document.removeEventListener("keydown", w);
262
+ }, [n, m, d]), U.useEffect(() => (n ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
263
+ document.body.style.overflow = "";
264
+ }), [n]), !n)
265
+ return null;
266
+ const h = r ?? te[i], o = c ?? g("confirm.accept", "Yes"), $ = l ?? g("confirm.reject", "No");
267
+ return /* @__PURE__ */ e("div", { className: "nice-modal-overlay", onClick: p ? d : void 0, children: /* @__PURE__ */ a(
268
+ "div",
269
+ {
270
+ className: `nice-confirm nice-confirm--${i} nice-confirm--${y} ${v || ""}`,
271
+ style: _,
272
+ role: "alertdialog",
273
+ "aria-modal": "true",
274
+ "aria-label": s,
275
+ "aria-describedby": "nice-confirm-message",
276
+ onClick: (w) => w.stopPropagation(),
277
+ children: [
278
+ s && /* @__PURE__ */ e("div", { className: "nice-confirm__header", children: /* @__PURE__ */ e("h3", { className: "nice-confirm__title", children: s }) }),
279
+ /* @__PURE__ */ a("div", { className: "nice-confirm__body", children: [
280
+ h && /* @__PURE__ */ e("div", { className: `nice-confirm__icon nice-confirm__icon--${i}`, children: h }),
281
+ /* @__PURE__ */ e("div", { id: "nice-confirm-message", className: "nice-confirm__message", children: t })
282
+ ] }),
283
+ /* @__PURE__ */ a("div", { className: "nice-confirm__footer", children: [
284
+ /* @__PURE__ */ e(
285
+ "button",
286
+ {
287
+ type: "button",
288
+ className: "nice-btn nice-btn--ghost nice-btn--md",
289
+ onClick: d,
290
+ children: $
291
+ }
292
+ ),
293
+ /* @__PURE__ */ e(
294
+ "button",
295
+ {
296
+ type: "button",
297
+ className: `nice-btn nice-btn--${i === "error" ? "error" : "primary"} nice-btn--md`,
298
+ onClick: u,
299
+ autoFocus: !0,
300
+ children: o
301
+ }
302
+ )
303
+ ] })
304
+ ]
305
+ }
306
+ ) });
307
+ }, ge = ({
308
+ error: n,
309
+ onRetry: t,
310
+ retryLabel: s = "Retry",
311
+ title: r = "Operation failed",
312
+ autoRetrySeconds: i,
313
+ variant: c = "error",
314
+ icon: l,
315
+ size: u = "md",
316
+ className: d,
317
+ style: p,
318
+ "data-testid": m
319
+ }) => {
320
+ const [y, v] = k(i ?? 0), _ = I(), g = typeof n == "string" ? n : n.message, h = L(() => {
321
+ v(i ?? 0), t();
322
+ }, [t, i]);
323
+ return x(() => {
324
+ if (!(!i || i <= 0))
325
+ return v(i), _.current = setInterval(() => {
326
+ v((o) => o <= 1 ? (clearInterval(_.current), t(), 0) : o - 1);
327
+ }, 1e3), () => clearInterval(_.current);
328
+ }, [i, t]), /* @__PURE__ */ a(
329
+ "div",
330
+ {
331
+ className: `nice-retry-panel nice-retry-panel--${c} nice-retry-panel--${u} ${d || ""}`,
332
+ style: p,
333
+ role: "alert",
334
+ "data-testid": m,
335
+ children: [
336
+ /* @__PURE__ */ e("div", { className: "nice-retry-panel__icon", children: l ?? "⚠️" }),
337
+ /* @__PURE__ */ a("div", { className: "nice-retry-panel__content", children: [
338
+ /* @__PURE__ */ e("div", { className: "nice-retry-panel__title", children: r }),
339
+ /* @__PURE__ */ e("p", { className: "nice-retry-panel__message", children: g })
340
+ ] }),
341
+ /* @__PURE__ */ a("div", { className: "nice-retry-panel__actions", children: [
342
+ /* @__PURE__ */ e(
343
+ "button",
344
+ {
345
+ type: "button",
346
+ className: "nice-btn nice-btn--primary nice-btn--sm",
347
+ onClick: h,
348
+ children: s
349
+ }
350
+ ),
351
+ i && y > 0 && /* @__PURE__ */ a("span", { className: "nice-retry-panel__countdown", children: [
352
+ "Auto-retry in ",
353
+ y,
354
+ "s"
355
+ ] })
356
+ ] })
357
+ ]
358
+ }
359
+ );
360
+ };
361
+ function re(n) {
362
+ return window.addEventListener("online", n), window.addEventListener("offline", n), () => {
363
+ window.removeEventListener("online", n), window.removeEventListener("offline", n);
364
+ };
365
+ }
366
+ function se() {
367
+ return navigator.onLine;
368
+ }
369
+ function ce() {
370
+ return !0;
371
+ }
372
+ const Ne = ({
373
+ message: n = "You are offline. Some features may be unavailable.",
374
+ variant: t = "warning",
375
+ icon: s,
376
+ size: r = "md",
377
+ className: i,
378
+ style: c,
379
+ "data-testid": l
380
+ }) => Z(re, se, ce) ? null : /* @__PURE__ */ a(
381
+ "div",
382
+ {
383
+ className: `nice-offline-banner nice-offline-banner--${t} nice-offline-banner--${r} ${i || ""}`,
384
+ style: c,
385
+ role: "alert",
386
+ "aria-live": "assertive",
387
+ "data-testid": l,
388
+ children: [
389
+ /* @__PURE__ */ e("span", { className: "nice-offline-banner__icon", children: s ?? "📡" }),
390
+ /* @__PURE__ */ e("span", { className: "nice-offline-banner__message", children: n })
391
+ ]
392
+ }
393
+ );
394
+ function ae({
395
+ timeoutMs: n = 1e4,
396
+ slowThresholdMs: t = 3e3,
397
+ onTimeout: s,
398
+ autoRetry: r = !1,
399
+ autoRetryCount: i = 3
400
+ } = {}) {
401
+ const [c, l] = k(!1), [u, d] = k(!1), [p, m] = k(!1), [y, v] = k(0), [_, g] = k(0), h = I(null), o = I(null), $ = I(null), w = I(0), f = L(() => {
402
+ h.current && clearTimeout(h.current), o.current && clearTimeout(o.current), $.current && clearInterval($.current);
403
+ }, []), C = L(() => {
404
+ f(), l(!0), d(!1), m(!1), v(0), w.current = Date.now(), $.current = setInterval(() => {
405
+ v(Date.now() - w.current);
406
+ }, 200), h.current = setTimeout(() => {
407
+ d(!0);
408
+ }, t), o.current = setTimeout(() => {
409
+ m(!0), l(!1), d(!1), f(), s?.();
410
+ }, n);
411
+ }, [f, t, n, s]), z = L(() => {
412
+ f(), l(!1), d(!1);
413
+ }, [f]), b = L(() => {
414
+ g((T) => T + 1), m(!1), C();
415
+ }, [C]);
416
+ return x(() => () => f(), [f]), x(() => {
417
+ if (r && p && _ < i) {
418
+ const T = Math.pow(2, _) * 1e3, M = setTimeout(() => b(), T);
419
+ return () => clearTimeout(M);
420
+ }
421
+ }, [r, i, p, _, b]), { isLoading: c, isSlow: u, isTimedOut: p, elapsed: y, retryCount: _, start: C, stop: z, retry: b };
422
+ }
423
+ const ye = ({
424
+ timeoutMs: n = 1e4,
425
+ slowThresholdMs: t = 3e3,
426
+ onTimeout: s,
427
+ onRetry: r,
428
+ autoRetry: i = !1,
429
+ autoRetryCount: c = 3,
430
+ showProgress: l = !0,
431
+ slowMessage: u = "Operacja trwa dłużej niż zwykle…",
432
+ timeoutMessage: d = "Przekroczono limit czasu. Spróbuj ponownie.",
433
+ loading: p,
434
+ children: m,
435
+ size: y = "md",
436
+ className: v,
437
+ style: _,
438
+ "data-testid": g
439
+ }) => {
440
+ const { isSlow: h, isTimedOut: o, elapsed: $, retry: w } = ae({
441
+ timeoutMs: n,
442
+ slowThresholdMs: t,
443
+ onTimeout: s,
444
+ autoRetry: i,
445
+ autoRetryCount: c
446
+ }), f = () => {
447
+ w(), r?.();
448
+ };
449
+ if (!p)
450
+ return /* @__PURE__ */ e(j, { children: m });
451
+ if (o)
452
+ return /* @__PURE__ */ a(
453
+ "div",
454
+ {
455
+ className: `nice-timeout-feedback nice-timeout-feedback--timeout nice-timeout-feedback--${y} ${v ?? ""}`,
456
+ style: _,
457
+ role: "alert",
458
+ "data-testid": g,
459
+ children: [
460
+ /* @__PURE__ */ e("p", { className: "nice-timeout-feedback__message", children: d }),
461
+ /* @__PURE__ */ e("button", { className: "nice-timeout-feedback__retry-btn", onClick: f, type: "button", children: "Spróbuj ponownie" })
462
+ ]
463
+ }
464
+ );
465
+ const C = Math.min(100, $ / n * 100);
466
+ return /* @__PURE__ */ a(
467
+ "div",
468
+ {
469
+ className: `nice-timeout-feedback nice-timeout-feedback--${y} ${h ? "nice-timeout-feedback--slow" : ""} ${v ?? ""}`,
470
+ style: _,
471
+ "data-testid": g,
472
+ children: [
473
+ /* @__PURE__ */ e("div", { className: "nice-timeout-feedback__spinner", "aria-busy": "true" }),
474
+ h && /* @__PURE__ */ e("p", { className: "nice-timeout-feedback__slow-msg", children: u }),
475
+ l && /* @__PURE__ */ e(
476
+ "div",
477
+ {
478
+ className: "nice-timeout-feedback__progress",
479
+ role: "progressbar",
480
+ "aria-valuenow": C,
481
+ "aria-valuemin": 0,
482
+ "aria-valuemax": 100,
483
+ children: /* @__PURE__ */ e(
484
+ "div",
485
+ {
486
+ className: "nice-timeout-feedback__progress-bar",
487
+ style: { width: `${C}%` }
488
+ }
489
+ )
490
+ }
491
+ )
492
+ ]
493
+ }
494
+ );
495
+ }, oe = K(
496
+ ({
497
+ visible: n,
498
+ onAcceptAll: t,
499
+ onRejectAll: s,
500
+ onSave: r,
501
+ categories: i = ["necessary", "analytics", "marketing", "preferences"],
502
+ defaults: c,
503
+ position: l = "bottom",
504
+ size: u = "md",
505
+ policyUrl: d,
506
+ showDetails: p = !1,
507
+ className: m,
508
+ style: y,
509
+ id: v,
510
+ ..._
511
+ }, g) => {
512
+ const h = J(v), { t: o } = P(), [$, w] = k(!0), f = n ?? $, [C, z] = k(p), [b, T] = k(() => {
513
+ const N = {
514
+ necessary: !0,
515
+ analytics: !1,
516
+ marketing: !1,
517
+ preferences: !1
518
+ };
519
+ return c && Object.assign(N, c), N.necessary = !0, N;
520
+ }), M = {
521
+ necessary: o("cookie.necessary", "Necessary"),
522
+ analytics: o("cookie.analytics", "Analytics"),
523
+ marketing: o("cookie.marketing", "Marketing"),
524
+ preferences: o("cookie.preferences", "Preferences")
525
+ }, D = {
526
+ necessary: o(
527
+ "cookie.necessaryDesc",
528
+ "Required for the website to function. Cannot be disabled."
529
+ ),
530
+ analytics: o(
531
+ "cookie.analyticsDesc",
532
+ "Help us understand how visitors interact with the website."
533
+ ),
534
+ marketing: o("cookie.marketingDesc", "Used to deliver relevant advertisements."),
535
+ preferences: o("cookie.preferencesDesc", "Allow the website to remember your choices.")
536
+ }, R = L(() => {
537
+ const N = {
538
+ necessary: !0,
539
+ analytics: !0,
540
+ marketing: !0,
541
+ preferences: !0
542
+ };
543
+ t?.(), r?.(N), w(!1);
544
+ }, [t, r]), S = L(() => {
545
+ const N = {
546
+ necessary: !0,
547
+ analytics: !1,
548
+ marketing: !1,
549
+ preferences: !1
550
+ };
551
+ s?.(), r?.(N), w(!1);
552
+ }, [s, r]), A = L(() => {
553
+ r?.({ ...b, necessary: !0 }), w(!1);
554
+ }, [b, r]);
555
+ return f ? /* @__PURE__ */ e(
556
+ "div",
557
+ {
558
+ ref: g,
559
+ id: h,
560
+ className: `nice-cookie-consent nice-cookie-consent--${l} nice-cookie-consent--${u} ${m ?? ""}`,
561
+ style: y,
562
+ role: "dialog",
563
+ "aria-label": o("cookie.label", "Cookie Consent"),
564
+ "aria-modal": "true",
565
+ ..._,
566
+ children: /* @__PURE__ */ a("div", { className: "nice-cookie-consent__content", children: [
567
+ /* @__PURE__ */ a("p", { className: "nice-cookie-consent__message", children: [
568
+ o(
569
+ "cookie.message",
570
+ "We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies."
571
+ ),
572
+ d && /* @__PURE__ */ a(j, { children: [
573
+ " ",
574
+ /* @__PURE__ */ e(
575
+ "a",
576
+ {
577
+ href: d,
578
+ className: "nice-cookie-consent__link",
579
+ target: "_blank",
580
+ rel: "noopener noreferrer",
581
+ children: o("cookie.learnMore", "Learn more")
582
+ }
583
+ )
584
+ ] })
585
+ ] }),
586
+ C && /* @__PURE__ */ e("div", { className: "nice-cookie-consent__details", children: i.map((N) => /* @__PURE__ */ a("label", { className: "nice-cookie-consent__category", children: [
587
+ /* @__PURE__ */ e(
588
+ "input",
589
+ {
590
+ type: "checkbox",
591
+ checked: b[N],
592
+ disabled: N === "necessary",
593
+ onChange: (B) => T((F) => ({ ...F, [N]: B.target.checked })),
594
+ className: "nice-cookie-consent__checkbox"
595
+ }
596
+ ),
597
+ /* @__PURE__ */ a("div", { className: "nice-cookie-consent__cat-info", children: [
598
+ /* @__PURE__ */ e("strong", { children: M[N] }),
599
+ /* @__PURE__ */ e("span", { className: "nice-cookie-consent__cat-desc", children: D[N] })
600
+ ] })
601
+ ] }, N)) }),
602
+ /* @__PURE__ */ a("div", { className: "nice-cookie-consent__actions", children: [
603
+ !C && /* @__PURE__ */ e(
604
+ "button",
605
+ {
606
+ type: "button",
607
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--details",
608
+ onClick: () => z(!0),
609
+ children: o("cookie.customize", "Customize")
610
+ }
611
+ ),
612
+ C && /* @__PURE__ */ e(
613
+ "button",
614
+ {
615
+ type: "button",
616
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--save",
617
+ onClick: A,
618
+ children: o("cookie.savePreferences", "Save preferences")
619
+ }
620
+ ),
621
+ /* @__PURE__ */ e(
622
+ "button",
623
+ {
624
+ type: "button",
625
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--reject",
626
+ onClick: S,
627
+ children: o("cookie.rejectAll", "Reject all")
628
+ }
629
+ ),
630
+ /* @__PURE__ */ e(
631
+ "button",
632
+ {
633
+ type: "button",
634
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--accept",
635
+ onClick: R,
636
+ children: o("cookie.acceptAll", "Accept all")
637
+ }
638
+ )
639
+ ] })
640
+ ] })
641
+ }
642
+ ) : null;
643
+ }
644
+ );
645
+ oe.displayName = "NiceCookieConsent";
646
+ const le = K(
647
+ ({
648
+ onSubmit: n,
649
+ onForgotPassword: t,
650
+ onRegister: s,
651
+ loading: r = !1,
652
+ error: i,
653
+ variant: c = "primary",
654
+ size: l = "md",
655
+ showRememberMe: u = !0,
656
+ showForgotPassword: d = !0,
657
+ showRegister: p = !1,
658
+ title: m,
659
+ logo: y,
660
+ usernameLabel: v,
661
+ passwordLabel: _,
662
+ usernamePlaceholder: g,
663
+ passwordPlaceholder: h,
664
+ className: o,
665
+ style: $,
666
+ id: w,
667
+ ...f
668
+ }, C) => {
669
+ const z = J(w), { t: b } = P(), [T, M] = k(""), [D, R] = k(""), [S, A] = k(!1), [N, B] = k(!1), F = `${z}-user`, H = `${z}-pass`, V = `${z}-remember`, X = L(
670
+ (E) => {
671
+ E.preventDefault(), !r && n?.({ username: T, password: D, rememberMe: S });
672
+ },
673
+ [r, T, D, S, n]
674
+ );
675
+ return /* @__PURE__ */ a(
676
+ "form",
677
+ {
678
+ ref: C,
679
+ id: z,
680
+ className: `nice-login nice-login--${c} nice-login--${l} ${o ?? ""}`,
681
+ style: $,
682
+ onSubmit: X,
683
+ noValidate: !0,
684
+ ...f,
685
+ children: [
686
+ y && /* @__PURE__ */ e("div", { className: "nice-login__logo", children: y }),
687
+ m && /* @__PURE__ */ e("h2", { className: "nice-login__title", children: m ?? b("login.title", "Sign In") }),
688
+ i && /* @__PURE__ */ e("div", { className: "nice-login__error", role: "alert", children: i }),
689
+ /* @__PURE__ */ a("div", { className: "nice-login__field", children: [
690
+ /* @__PURE__ */ e("label", { htmlFor: F, className: "nice-login__label", children: v ?? b("login.username", "Username") }),
691
+ /* @__PURE__ */ e(
692
+ "input",
693
+ {
694
+ id: F,
695
+ className: "nice-login__input",
696
+ type: "text",
697
+ value: T,
698
+ onChange: (E) => M(E.target.value),
699
+ placeholder: g ?? b("login.usernamePlaceholder", "Enter your username"),
700
+ autoComplete: "username",
701
+ required: !0,
702
+ disabled: r,
703
+ "aria-required": "true"
704
+ }
705
+ )
706
+ ] }),
707
+ /* @__PURE__ */ a("div", { className: "nice-login__field", children: [
708
+ /* @__PURE__ */ e("label", { htmlFor: H, className: "nice-login__label", children: _ ?? b("login.password", "Password") }),
709
+ /* @__PURE__ */ a("div", { className: "nice-login__password-wrap", children: [
710
+ /* @__PURE__ */ e(
711
+ "input",
712
+ {
713
+ id: H,
714
+ className: "nice-login__input",
715
+ type: N ? "text" : "password",
716
+ value: D,
717
+ onChange: (E) => R(E.target.value),
718
+ placeholder: h ?? b("login.passwordPlaceholder", "Enter your password"),
719
+ autoComplete: "current-password",
720
+ required: !0,
721
+ disabled: r,
722
+ "aria-required": "true"
723
+ }
724
+ ),
725
+ /* @__PURE__ */ e(
726
+ "button",
727
+ {
728
+ type: "button",
729
+ className: "nice-login__toggle-password",
730
+ onClick: () => B(!N),
731
+ "aria-label": N ? b("login.hidePassword", "Hide password") : b("login.showPassword", "Show password"),
732
+ tabIndex: -1,
733
+ children: N ? "🙈" : "👁"
734
+ }
735
+ )
736
+ ] })
737
+ ] }),
738
+ /* @__PURE__ */ a("div", { className: "nice-login__options", children: [
739
+ u && /* @__PURE__ */ a("label", { className: "nice-login__remember", htmlFor: V, children: [
740
+ /* @__PURE__ */ e(
741
+ "input",
742
+ {
743
+ id: V,
744
+ type: "checkbox",
745
+ checked: S,
746
+ onChange: (E) => A(E.target.checked),
747
+ disabled: r
748
+ }
749
+ ),
750
+ /* @__PURE__ */ e("span", { children: b("login.rememberMe", "Remember me") })
751
+ ] }),
752
+ d && t && /* @__PURE__ */ e(
753
+ "button",
754
+ {
755
+ type: "button",
756
+ className: "nice-login__forgot",
757
+ onClick: t,
758
+ disabled: r,
759
+ children: b("login.forgotPassword", "Forgot password?")
760
+ }
761
+ )
762
+ ] }),
763
+ /* @__PURE__ */ e(
764
+ "button",
765
+ {
766
+ type: "submit",
767
+ className: `nice-login__submit nice-login__submit--${c}`,
768
+ disabled: r || !T || !D,
769
+ children: r ? b("login.loading", "Signing in...") : b("login.submit", "Sign In")
770
+ }
771
+ ),
772
+ p && s && /* @__PURE__ */ a("p", { className: "nice-login__register", children: [
773
+ b("login.noAccount", "Don't have an account?"),
774
+ " ",
775
+ /* @__PURE__ */ e(
776
+ "button",
777
+ {
778
+ type: "button",
779
+ className: "nice-login__register-link",
780
+ onClick: s,
781
+ disabled: r,
782
+ children: b("login.register", "Register")
783
+ }
784
+ )
785
+ ] })
786
+ ]
787
+ }
788
+ );
789
+ }
790
+ );
791
+ le.displayName = "NiceLoginForm";
792
+ const q = class q extends ee {
793
+ constructor() {
794
+ super(...arguments), this.state = {
795
+ hasError: !1,
796
+ error: null
797
+ }, this.handleReset = () => {
798
+ this.setState({ hasError: !1, error: null });
799
+ };
800
+ }
801
+ static getDerivedStateFromError(t) {
802
+ return { hasError: !0, error: t };
803
+ }
804
+ componentDidCatch(t, s) {
805
+ this.props.onError?.(t, s);
806
+ }
807
+ render() {
808
+ if (this.state.hasError && this.state.error) {
809
+ const { fallback: t, showRetry: s = !0, retryLabel: r = "Retry", title: i = "Something went wrong" } = this.props;
810
+ return typeof t == "function" ? t(this.state.error, this.handleReset) : t || /* @__PURE__ */ a("div", { className: "nice-error-boundary", role: "alert", children: [
811
+ /* @__PURE__ */ e("div", { className: "nice-error-boundary__icon", children: "⚠️" }),
812
+ /* @__PURE__ */ e("h2", { className: "nice-error-boundary__title", children: i }),
813
+ /* @__PURE__ */ e("p", { className: "nice-error-boundary__message", children: this.state.error.message }),
814
+ s && /* @__PURE__ */ e("button", { type: "button", className: "nice-btn nice-btn--primary", onClick: this.handleReset, children: r })
815
+ ] });
816
+ }
817
+ return this.props.children;
818
+ }
819
+ };
820
+ q.displayName = "NiceErrorBoundary";
821
+ let Y = q;
822
+ export {
823
+ he as N,
824
+ ve as a,
825
+ oe as b,
826
+ _e as c,
827
+ Y as d,
828
+ le as e,
829
+ fe as f,
830
+ Ne as g,
831
+ ge as h,
832
+ ye as i,
833
+ be as j,
834
+ Q as k,
835
+ ae as l,
836
+ pe as u
837
+ };