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