@nice2dev/ui 1.1.5 → 1.1.7

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