@nice2dev/ui 1.1.9 → 1.2.0

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 (163) hide show
  1. package/CHANGELOG.md +150 -0
  2. package/README.md +27 -34
  3. package/dist/NiceButton-5tWvfXKl.cjs +1 -0
  4. package/dist/NiceButton-DHSgQT1_.js +112 -0
  5. package/dist/NiceCodeEditor-B8At55f5.js +1179 -0
  6. package/dist/NiceCodeEditor-BJSEzhcY.cjs +260 -0
  7. package/dist/NiceCodeEditor-BfkH1bsZ.cjs +260 -0
  8. package/dist/NiceCodeEditor-CduGYggj.js +1179 -0
  9. package/dist/NiceColorPicker-CdUnhM-A.cjs +1 -0
  10. package/dist/NiceColorPicker-DCgmE-3H.cjs +1 -0
  11. package/dist/NiceColorPicker-DK30kJgy.js +486 -0
  12. package/dist/NiceColorPicker-DpXwnDwL.js +598 -0
  13. package/dist/NiceColorPicker-DtPFxDKM.cjs +1 -0
  14. package/dist/NiceColorPicker-bNJBAU_c.js +598 -0
  15. package/dist/NiceConfirmDialog-B7aNRL2K.cjs +1 -0
  16. package/dist/NiceConfirmDialog-BdhWenrO.js +81 -0
  17. package/dist/NiceDataGrid-BOCJr6XF.js +2217 -0
  18. package/dist/NiceDataGrid-BV5Oh-gy.cjs +10 -0
  19. package/dist/NiceDataGrid-CVYEo_nv.cjs +10 -0
  20. package/dist/NiceDataGrid-D-rm4lu8.js +2217 -0
  21. package/dist/NiceDataGrid-Dd7SI-M6.cjs +10 -0
  22. package/dist/NiceDataGrid-DjZchXYG.js +2217 -0
  23. package/dist/NiceDocumentViewer-BgcgLWJ3.cjs +180 -0
  24. package/dist/NiceDocumentViewer-sukmGhRx.js +672 -0
  25. package/dist/NiceForm-BCEXovJR.cjs +1 -0
  26. package/dist/NiceForm-D7oyWHXg.js +4820 -0
  27. package/dist/NiceForm-DUhxXArr.js +4817 -0
  28. package/dist/NiceForm-DVc0Xoly.js +4819 -0
  29. package/dist/NiceForm-qD_RKPYz.cjs +1 -0
  30. package/dist/NiceForm-uCeVmTrD.cjs +1 -0
  31. package/dist/NiceGantt-4UBd4uJ8.cjs +1 -0
  32. package/dist/NiceGantt-B_1lwEsp.js +328 -0
  33. package/dist/NiceHtmlEditor-BYk1roA4.cjs +10 -0
  34. package/dist/NiceHtmlEditor-Bce9Vwe1.cjs +10 -0
  35. package/dist/NiceHtmlEditor-C5kLeF9H.cjs +10 -0
  36. package/dist/NiceHtmlEditor-CFVMIC5L.js +848 -0
  37. package/dist/NiceHtmlEditor-CGRgcu2h.js +848 -0
  38. package/dist/NiceHtmlEditor-mWebBmy1.js +849 -0
  39. package/dist/NiceLoginForm-BHyDY7br.cjs +1 -0
  40. package/dist/NiceLoginForm-BTuQ0eKk.cjs +1 -0
  41. package/dist/NiceLoginForm-BuxFY2Rk.js +750 -0
  42. package/dist/NiceLoginForm-o1A-TBcp.js +736 -0
  43. package/dist/NiceLoginForm.css +1 -0
  44. package/dist/NiceMention-CA7CL5BI.js +11263 -0
  45. package/dist/NiceMention-CHcKRl-L.cjs +430 -0
  46. package/dist/NiceMention-DJD0BLcp.js +11269 -0
  47. package/dist/NiceMention-DcaUEMSg.cjs +430 -0
  48. package/dist/NiceMention-Dds9GQzk.cjs +430 -0
  49. package/dist/NiceMention-DlLXWddO.js +11268 -0
  50. package/dist/NiceMention.css +1 -1
  51. package/dist/NiceModal-C4p8a82e.cjs +1 -0
  52. package/dist/NiceModal-Dr1e3nQZ.cjs +1 -0
  53. package/dist/NiceModal-TNlkaL_i.js +85 -0
  54. package/dist/NiceModal-sihGCfDy.js +95 -0
  55. package/dist/NiceModuleLifecyclePanel-BWbKdVC_.js +7054 -0
  56. package/dist/NiceModuleLifecyclePanel-CZHIzvkE.cjs +1 -0
  57. package/dist/NiceModuleLifecyclePanel-Du7G3-RG.js +7053 -0
  58. package/dist/NiceModuleLifecyclePanel-OC9YK2kG.js +7052 -0
  59. package/dist/NiceModuleLifecyclePanel-_OcfDmtC.cjs +1 -0
  60. package/dist/NiceModuleLifecyclePanel-js1p7LIY.cjs +1 -0
  61. package/dist/NicePagination-8XsBbMNx.js +165 -0
  62. package/dist/NicePagination-CkOoXf0f.js +165 -0
  63. package/dist/NicePagination-D44waj9o.cjs +1 -0
  64. package/dist/NicePagination-D7lek1G7.cjs +1 -0
  65. package/dist/NicePagination-DdxH8KMG.js +179 -0
  66. package/dist/NicePagination-OjTEfZJE.cjs +1 -0
  67. package/dist/NicePivotGrid-B2YHP3Z6.js +1183 -0
  68. package/dist/NicePivotGrid-BJRSciWl.js +1183 -0
  69. package/dist/NicePivotGrid-BtVUWiud.cjs +152 -0
  70. package/dist/NicePivotGrid-CS1dPmNI.cjs +152 -0
  71. package/dist/NicePivotGrid-D2AxqDzJ.js +1183 -0
  72. package/dist/NicePivotGrid-DxQ6Py9D.cjs +152 -0
  73. package/dist/NiceSavedQueryPanel-B5HhqlAI.cjs +586 -0
  74. package/dist/NiceSavedQueryPanel-C0A-eoYN.js +5142 -0
  75. package/dist/NiceSavedQueryPanel-CMStDOKe.js +5125 -0
  76. package/dist/NiceSavedQueryPanel-D2i34e_b.cjs +586 -0
  77. package/dist/NiceSavedQueryPanel-ZrilZRtf.cjs +586 -0
  78. package/dist/NiceSavedQueryPanel-mPO2THs7.js +5142 -0
  79. package/dist/NiceSavedQueryPanel.css +1 -1
  80. package/dist/NiceScheduler-7gP7vcLy.cjs +5 -0
  81. package/dist/NiceScheduler-Cy7F9tgH.js +1693 -0
  82. package/dist/NiceScheduler-DquRUZxD.cjs +5 -0
  83. package/dist/NiceScheduler-KSzaUQxC.js +1693 -0
  84. package/dist/NiceScheduler-O3AwmdGG.cjs +5 -0
  85. package/dist/NiceScheduler-l8N4yCWd.js +1716 -0
  86. package/dist/NiceSelect-BCbWtu1v.js +433 -0
  87. package/dist/NiceSelect-BqtiQbfD.cjs +1 -0
  88. package/dist/NiceSelect-DZB1Rs9x.js +435 -0
  89. package/dist/NiceSelect-tMz9QQUs.cjs +1 -0
  90. package/dist/NiceStreamDashboard.doc-74KUXya1.cjs +8 -0
  91. package/dist/NiceStreamDashboard.doc-k8PQfCM0.js +32 -0
  92. package/dist/NiceWindow-BEov3s9F.js +2094 -0
  93. package/dist/NiceWindow-BU1Ce7gS.js +1623 -0
  94. package/dist/NiceWindow-CDt6PCEg.cjs +1 -0
  95. package/dist/NiceWindow-jjdE6vGy.cjs +1 -0
  96. package/dist/NiceWindow.css +1 -1
  97. package/dist/charts-C047IMVn.cjs +768 -0
  98. package/dist/charts-C44vJber.cjs +768 -0
  99. package/dist/charts-CCXSb3xk.js +4752 -0
  100. package/dist/charts-CqETcUhH.js +4752 -0
  101. package/dist/charts-DouiiHOT.cjs +768 -0
  102. package/dist/charts-XVlDwU0y.js +4732 -0
  103. package/dist/charts.cjs +1 -1
  104. package/dist/charts.mjs +8 -8
  105. package/dist/core-BL-KmGYC.js +795 -0
  106. package/dist/core-BxiH7vkV.cjs +1 -0
  107. package/dist/core-Chg-oYCr.cjs +1 -0
  108. package/dist/core-CxBnKAhs.cjs +1 -0
  109. package/dist/core-DMV6_SEE.js +795 -0
  110. package/dist/core-D_LRh59n.js +795 -0
  111. package/dist/data-branching-Km4lc8P_.cjs +1 -0
  112. package/dist/data-branching-YQtJJEtn.js +6273 -0
  113. package/dist/data-branching-oEH04O3i.js +6273 -0
  114. package/dist/data-branching-wmsbLNfa.cjs +1 -0
  115. package/dist/data-branching.cjs +1 -1
  116. package/dist/data-branching.mjs +1 -1
  117. package/dist/data.cjs +1 -1
  118. package/dist/data.d.ts +2 -53
  119. package/dist/data.mjs +3 -3
  120. package/dist/devops-Bt6EsfPa.cjs +17 -0
  121. package/dist/devops-CnZQ1rU5.js +8312 -0
  122. package/dist/devops-D5yIDM3e.js +8312 -0
  123. package/dist/devops-rVpB0ZAX.cjs +17 -0
  124. package/dist/devops.cjs +1 -1
  125. package/dist/devops.mjs +1 -1
  126. package/dist/editors.cjs +1 -1
  127. package/dist/editors.d.ts +8 -26
  128. package/dist/editors.mjs +55 -54
  129. package/dist/feedback.cjs +1 -1
  130. package/dist/feedback.d.ts +5 -0
  131. package/dist/feedback.mjs +3 -3
  132. package/dist/index.cjs +290 -290
  133. package/dist/index.css +1 -1
  134. package/dist/index.d.ts +239 -234
  135. package/dist/index.mjs +20262 -19440
  136. package/dist/lazy.cjs +1 -1
  137. package/dist/lazy.mjs +29 -29
  138. package/dist/navigation.cjs +1 -1
  139. package/dist/navigation.d.ts +4 -4
  140. package/dist/navigation.mjs +69 -69
  141. package/dist/no-code-4GtIBr6f.js +7503 -0
  142. package/dist/no-code-6WyYb3hL.cjs +331 -0
  143. package/dist/no-code-BH5oVFC6.js +8186 -0
  144. package/dist/no-code-Bdwh1vyS.cjs +332 -0
  145. package/dist/no-code-CnHG5_Vn.js +8186 -0
  146. package/dist/no-code-DMKlg1Zl.cjs +331 -0
  147. package/dist/no-code.cjs +1 -1
  148. package/dist/no-code.css +1 -1
  149. package/dist/no-code.d.ts +25 -18
  150. package/dist/no-code.mjs +3 -3
  151. package/dist/overlays.cjs +1 -1
  152. package/dist/overlays.d.ts +24 -24
  153. package/dist/overlays.mjs +24 -490
  154. package/dist/pickerCommons-0vyK1Knv.js +547 -0
  155. package/dist/pickerCommons-31hyz1gs.js +1122 -0
  156. package/dist/pickerCommons-BFbItm8o.cjs +1 -0
  157. package/dist/pickerCommons-BHirHJyn.js +548 -0
  158. package/dist/pickerCommons-BifIkPdk.cjs +1 -0
  159. package/dist/pickerCommons-Bt8JIaTN.cjs +1 -0
  160. package/dist/pickerCommons.css +1 -1
  161. package/dist/style.css +10 -7
  162. package/package.json +5 -7
  163. package/css/legacy-bg-text-aliases.css +0 -87
@@ -0,0 +1,750 @@
1
+ import { jsx as e, jsxs as o, Fragment as O } from "react/jsx-runtime";
2
+ import { useComponentDisplayClass as W, NiceIcon as M, useComponentDisplayStyle as Q, useNiceTranslation as P, useFocusTrap as X, useControlId as Y } from "@nice2dev/ui-core";
3
+ import { useRef as z, useEffect as R, useState as v, useCallback as $, Component as Z, useSyncExternalStore as ee, forwardRef as G } from "react";
4
+ import { N as ne } from "./NiceButton-DHSgQT1_.js";
5
+ const J = {
6
+ info: /* @__PURE__ */ e("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e(
7
+ "path",
8
+ {
9
+ fillRule: "evenodd",
10
+ 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",
11
+ clipRule: "evenodd"
12
+ }
13
+ ) }),
14
+ success: /* @__PURE__ */ e("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e(
15
+ "path",
16
+ {
17
+ fillRule: "evenodd",
18
+ 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",
19
+ clipRule: "evenodd"
20
+ }
21
+ ) }),
22
+ warning: /* @__PURE__ */ e("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e(
23
+ "path",
24
+ {
25
+ fillRule: "evenodd",
26
+ 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",
27
+ clipRule: "evenodd"
28
+ }
29
+ ) }),
30
+ error: /* @__PURE__ */ e("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e(
31
+ "path",
32
+ {
33
+ fillRule: "evenodd",
34
+ 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",
35
+ clipRule: "evenodd"
36
+ }
37
+ ) })
38
+ }, fe = ({
39
+ variant: n = "info",
40
+ title: i,
41
+ children: s,
42
+ closable: r,
43
+ onClose: t,
44
+ icon: a,
45
+ size: d = "md",
46
+ className: h,
47
+ style: u,
48
+ displayStyle: f
49
+ }) => {
50
+ const p = W("card", f);
51
+ return /* @__PURE__ */ o(
52
+ "div",
53
+ {
54
+ className: `nice-alert nice-alert--${n} nice-alert--${d} nice-alert--ds-${p} ${h || ""}`,
55
+ style: u,
56
+ role: "alert",
57
+ children: [
58
+ /* @__PURE__ */ e("div", { className: `nice-alert__icon nice-alert__icon--${n}`, children: a || J[n] }),
59
+ /* @__PURE__ */ o("div", { className: "nice-alert__content", children: [
60
+ i && /* @__PURE__ */ e("div", { className: "nice-alert__title", children: i }),
61
+ /* @__PURE__ */ e("div", { children: s })
62
+ ] }),
63
+ r && /* @__PURE__ */ e("button", { type: "button", className: "nice-alert__close", onClick: t, "aria-label": "Close", children: /* @__PURE__ */ e(M, { name: "close", size: 16 }) })
64
+ ]
65
+ }
66
+ );
67
+ }, _e = ({
68
+ open: n,
69
+ onClose: i,
70
+ title: s,
71
+ position: r = "right",
72
+ size: t = "md",
73
+ children: a,
74
+ footer: d,
75
+ transitionDuration: h,
76
+ className: u,
77
+ style: f,
78
+ displayStyle: p
79
+ }) => {
80
+ const N = Q("modal", p), g = W("modal", p), { t: b } = P(), w = z(null);
81
+ return X(w, n), R(() => {
82
+ if (!n)
83
+ return;
84
+ const m = (c) => {
85
+ c.key === "Escape" && i();
86
+ };
87
+ return document.addEventListener("keydown", m), document.body.style.overflow = "hidden", () => {
88
+ document.removeEventListener("keydown", m), document.body.style.overflow = "";
89
+ };
90
+ }, [n, i]), n ? /* @__PURE__ */ o(O, { children: [
91
+ /* @__PURE__ */ e(
92
+ "div",
93
+ {
94
+ className: "nice-drawer-overlay",
95
+ onMouseDown: (m) => {
96
+ m.target === m.currentTarget && i();
97
+ }
98
+ }
99
+ ),
100
+ /* @__PURE__ */ o(
101
+ "div",
102
+ {
103
+ ref: w,
104
+ className: `nice-drawer nice-drawer--${r} nice-drawer--${t} nice-drawer--ds-${g} ${u || ""}`,
105
+ style: {
106
+ ...N,
107
+ ...f,
108
+ ...h != null ? { transitionDuration: `${h}ms` } : {}
109
+ },
110
+ role: "dialog",
111
+ "aria-modal": "true",
112
+ "aria-label": s,
113
+ children: [
114
+ s && /* @__PURE__ */ o("div", { className: "nice-drawer__header", children: [
115
+ /* @__PURE__ */ e("h3", { className: "nice-drawer__title", children: s }),
116
+ /* @__PURE__ */ e(
117
+ "button",
118
+ {
119
+ type: "button",
120
+ className: "nice-drawer__close",
121
+ onClick: i,
122
+ "aria-label": b("controls.close", "Close"),
123
+ 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" }) })
124
+ }
125
+ )
126
+ ] }),
127
+ /* @__PURE__ */ e("div", { className: "nice-drawer__body", children: a }),
128
+ d && /* @__PURE__ */ e("div", { className: "nice-drawer__footer", children: d })
129
+ ]
130
+ }
131
+ )
132
+ ] }) : null;
133
+ }, pe = ({
134
+ toasts: n,
135
+ onDismiss: i,
136
+ position: s = "top-right"
137
+ }) => /* @__PURE__ */ e("div", { className: `nice-toast-container nice-toast-container--${s}`, children: n.map((r) => /* @__PURE__ */ e(te, { toast: r, onDismiss: i }, r.id)) }), te = ({
138
+ toast: n,
139
+ onDismiss: i
140
+ }) => {
141
+ const [s, r] = v(!1);
142
+ return R(() => {
143
+ if (!n.duration && n.duration !== 0) {
144
+ const t = setTimeout(() => r(!0), 4e3);
145
+ return () => clearTimeout(t);
146
+ }
147
+ if (n.duration > 0) {
148
+ const t = setTimeout(() => r(!0), n.duration);
149
+ return () => clearTimeout(t);
150
+ }
151
+ }, [n.duration]), R(() => {
152
+ if (s) {
153
+ const t = setTimeout(() => i(n.id), 200);
154
+ return () => clearTimeout(t);
155
+ }
156
+ }, [s, n.id, i]), /* @__PURE__ */ o(
157
+ "div",
158
+ {
159
+ className: `nice-toast nice-toast--${n.variant} ${s ? "nice-toast--exiting" : ""}`,
160
+ role: "alert",
161
+ style: { position: "relative" },
162
+ children: [
163
+ /* @__PURE__ */ e("div", { className: "nice-toast__icon", children: J[n.variant] }),
164
+ /* @__PURE__ */ o("div", { className: "nice-toast__content", children: [
165
+ n.title && /* @__PURE__ */ e("div", { className: "nice-toast__title", children: n.title }),
166
+ /* @__PURE__ */ e("div", { className: "nice-toast__message", children: n.message })
167
+ ] }),
168
+ /* @__PURE__ */ e(
169
+ "button",
170
+ {
171
+ type: "button",
172
+ className: "nice-toast__close",
173
+ onClick: () => r(!0),
174
+ "aria-label": "Close",
175
+ children: /* @__PURE__ */ e(M, { name: "close", size: 16 })
176
+ }
177
+ )
178
+ ]
179
+ }
180
+ );
181
+ };
182
+ let ie = 0;
183
+ function be() {
184
+ const [n, i] = v([]), s = $(
185
+ (t, a, d) => {
186
+ const h = `toast-${++ie}`;
187
+ return i((u) => [
188
+ ...u,
189
+ { id: h, variant: t, message: a, title: d?.title, duration: d?.duration }
190
+ ]), h;
191
+ },
192
+ []
193
+ ), r = $((t) => {
194
+ i((a) => a.filter((d) => d.id !== t));
195
+ }, []);
196
+ return {
197
+ toasts: n,
198
+ dismiss: r,
199
+ info: (t, a) => s("info", t, a),
200
+ success: (t, a) => s("success", t, a),
201
+ warning: (t, a) => s("warning", t, a),
202
+ error: (t, a) => s("error", t, a)
203
+ };
204
+ }
205
+ const q = class q extends Z {
206
+ constructor() {
207
+ super(...arguments), this.state = {
208
+ hasError: !1,
209
+ error: null
210
+ }, this.handleReset = () => {
211
+ this.setState({ hasError: !1, error: null });
212
+ };
213
+ }
214
+ static getDerivedStateFromError(i) {
215
+ return { hasError: !0, error: i };
216
+ }
217
+ componentDidCatch(i, s) {
218
+ this.props.onError?.(i, s);
219
+ }
220
+ render() {
221
+ if (this.state.hasError && this.state.error) {
222
+ const {
223
+ fallback: i,
224
+ showRetry: s = !0,
225
+ retryLabel: r = "Retry",
226
+ title: t = "Something went wrong"
227
+ } = this.props;
228
+ return typeof i == "function" ? i(this.state.error, this.handleReset) : i || /* @__PURE__ */ o("div", { className: "nice-error-boundary", role: "alert", children: [
229
+ /* @__PURE__ */ e("div", { className: "nice-error-boundary__icon", children: /* @__PURE__ */ e(M, { name: "warning", size: 32 }) }),
230
+ /* @__PURE__ */ e("h2", { className: "nice-error-boundary__title", children: t }),
231
+ /* @__PURE__ */ e("p", { className: "nice-error-boundary__message", children: this.state.error.message }),
232
+ s && /* @__PURE__ */ e("button", { type: "button", className: "nice-btn nice-btn--primary", onClick: this.handleReset, children: r })
233
+ ] });
234
+ }
235
+ return this.props.children;
236
+ }
237
+ };
238
+ q.displayName = "NiceErrorBoundary";
239
+ let U = q;
240
+ function re(n) {
241
+ return window.addEventListener("online", n), window.addEventListener("offline", n), () => {
242
+ window.removeEventListener("online", n), window.removeEventListener("offline", n);
243
+ };
244
+ }
245
+ function se() {
246
+ return navigator.onLine;
247
+ }
248
+ function ae() {
249
+ return !0;
250
+ }
251
+ const ge = ({
252
+ message: n,
253
+ variant: i = "warning",
254
+ icon: s,
255
+ online: r,
256
+ size: t = "md",
257
+ className: a,
258
+ style: d,
259
+ "data-testid": h
260
+ }) => {
261
+ const { t: u } = P(), f = ee(re, se, ae);
262
+ return r ?? f ? null : /* @__PURE__ */ o(
263
+ "div",
264
+ {
265
+ className: `nice-offline-banner nice-offline-banner--${i} nice-offline-banner--${t} ${a || ""}`,
266
+ style: d,
267
+ role: "alert",
268
+ "aria-live": "assertive",
269
+ "data-testid": h,
270
+ children: [
271
+ /* @__PURE__ */ e("span", { className: "nice-offline-banner__icon", children: s ?? /* @__PURE__ */ e(M, { name: "wifi", size: 18 }) }),
272
+ /* @__PURE__ */ e("span", { className: "nice-offline-banner__message", children: n ?? u("offlineBanner.message", "You are offline. Some features may be unavailable.") })
273
+ ]
274
+ }
275
+ );
276
+ }, ve = ({
277
+ error: n,
278
+ onRetry: i,
279
+ retryLabel: s = "Retry",
280
+ title: r = "Operation failed",
281
+ autoRetrySeconds: t,
282
+ variant: a = "error",
283
+ icon: d,
284
+ size: h = "md",
285
+ className: u,
286
+ style: f,
287
+ "data-testid": p
288
+ }) => {
289
+ const [N, g] = v(t ?? 0), b = z(void 0), w = typeof n == "string" ? n : n.message, m = $(() => {
290
+ g(t ?? 0), i();
291
+ }, [i, t]);
292
+ return R(() => {
293
+ if (!(!t || t <= 0))
294
+ return g(t), b.current = setInterval(() => {
295
+ g((c) => c <= 1 ? (clearInterval(b.current), i(), 0) : c - 1);
296
+ }, 1e3), () => clearInterval(b.current);
297
+ }, [t, i]), /* @__PURE__ */ o(
298
+ "div",
299
+ {
300
+ className: `nice-retry-panel nice-retry-panel--${a} nice-retry-panel--${h} ${u || ""}`,
301
+ style: f,
302
+ role: "alert",
303
+ "data-testid": p,
304
+ children: [
305
+ /* @__PURE__ */ e("div", { className: "nice-retry-panel__icon", children: d ?? /* @__PURE__ */ e(M, { name: "warning", size: 24 }) }),
306
+ /* @__PURE__ */ o("div", { className: "nice-retry-panel__content", children: [
307
+ /* @__PURE__ */ e("div", { className: "nice-retry-panel__title", children: r }),
308
+ /* @__PURE__ */ e("p", { className: "nice-retry-panel__message", children: w })
309
+ ] }),
310
+ /* @__PURE__ */ o("div", { className: "nice-retry-panel__actions", children: [
311
+ /* @__PURE__ */ e(
312
+ "button",
313
+ {
314
+ type: "button",
315
+ className: "nice-btn nice-btn--primary nice-btn--sm",
316
+ onClick: m,
317
+ children: s
318
+ }
319
+ ),
320
+ t && N > 0 && /* @__PURE__ */ o("span", { className: "nice-retry-panel__countdown", children: [
321
+ "Auto-retry in ",
322
+ N,
323
+ "s"
324
+ ] })
325
+ ] })
326
+ ]
327
+ }
328
+ );
329
+ };
330
+ function ce({
331
+ timeoutMs: n = 1e4,
332
+ slowThresholdMs: i = 3e3,
333
+ onTimeout: s,
334
+ autoRetry: r = !1,
335
+ autoRetryCount: t = 3
336
+ } = {}) {
337
+ const [a, d] = v(!1), [h, u] = v(!1), [f, p] = v(!1), [N, g] = v(0), [b, w] = v(0), m = z(null), c = z(null), x = z(null), T = z(0), k = $(() => {
338
+ m.current && clearTimeout(m.current), c.current && clearTimeout(c.current), x.current && clearInterval(x.current);
339
+ }, []), C = $(() => {
340
+ k(), d(!0), u(!1), p(!1), g(0), T.current = Date.now(), x.current = setInterval(() => {
341
+ g(Date.now() - T.current);
342
+ }, 200), m.current = setTimeout(() => {
343
+ u(!0);
344
+ }, i), c.current = setTimeout(() => {
345
+ p(!0), d(!1), u(!1), k(), s?.();
346
+ }, n);
347
+ }, [k, i, n, s]), L = $(() => {
348
+ k(), d(!1), u(!1);
349
+ }, [k]), l = $(() => {
350
+ w((y) => y + 1), p(!1), C();
351
+ }, [C]);
352
+ return R(() => () => k(), [k]), R(() => {
353
+ if (r && f && b < t) {
354
+ const y = Math.pow(2, b) * 1e3, E = setTimeout(() => l(), y);
355
+ return () => clearTimeout(E);
356
+ }
357
+ }, [r, t, f, b, l]), { isLoading: a, isSlow: h, isTimedOut: f, elapsed: N, retryCount: b, start: C, stop: L, retry: l };
358
+ }
359
+ const Ne = ({
360
+ timeoutMs: n = 1e4,
361
+ slowThresholdMs: i = 3e3,
362
+ onTimeout: s,
363
+ onRetry: r,
364
+ autoRetry: t = !1,
365
+ autoRetryCount: a = 3,
366
+ showProgress: d = !0,
367
+ slowMessage: h,
368
+ timeoutMessage: u,
369
+ loading: f,
370
+ children: p,
371
+ size: N = "md",
372
+ className: g,
373
+ style: b,
374
+ "data-testid": w
375
+ }) => {
376
+ const { t: m } = P(), { isSlow: c, isTimedOut: x, elapsed: T, start: k, stop: C, retry: L } = ce({
377
+ timeoutMs: n,
378
+ slowThresholdMs: i,
379
+ onTimeout: s,
380
+ autoRetry: t,
381
+ autoRetryCount: a
382
+ }), l = z(k);
383
+ l.current = k;
384
+ const y = z(C);
385
+ y.current = C, R(() => {
386
+ f ? l.current() : y.current();
387
+ }, [f]);
388
+ const E = () => {
389
+ L(), r?.();
390
+ };
391
+ if (!f)
392
+ return /* @__PURE__ */ e(O, { children: p });
393
+ if (x)
394
+ return /* @__PURE__ */ o(
395
+ "div",
396
+ {
397
+ className: `nice-timeout-feedback nice-timeout-feedback--timeout nice-timeout-feedback--${N} ${g ?? ""}`,
398
+ style: b,
399
+ role: "alert",
400
+ "data-testid": w,
401
+ children: [
402
+ /* @__PURE__ */ e("p", { className: "nice-timeout-feedback__message", children: u ?? m("timeoutFeedback.timeout", "The operation timed out. Please try again.") }),
403
+ /* @__PURE__ */ e(ne, { size: "sm", className: "nice-timeout-feedback__retry-btn", onClick: E, children: m("timeoutFeedback.retry", "Try again") })
404
+ ]
405
+ }
406
+ );
407
+ const I = Math.min(100, T / n * 100);
408
+ return /* @__PURE__ */ o(
409
+ "div",
410
+ {
411
+ className: `nice-timeout-feedback nice-timeout-feedback--${N} ${c ? "nice-timeout-feedback--slow" : ""} ${g ?? ""}`,
412
+ style: b,
413
+ role: "status",
414
+ "aria-busy": "true",
415
+ "data-testid": w,
416
+ children: [
417
+ /* @__PURE__ */ e("div", { className: "nice-timeout-feedback__spinner", "aria-hidden": "true" }),
418
+ c && /* @__PURE__ */ e("p", { className: "nice-timeout-feedback__slow-msg", children: h ?? m("timeoutFeedback.slow", "This is taking longer than usual…") }),
419
+ d && /* @__PURE__ */ e(
420
+ "div",
421
+ {
422
+ className: "nice-timeout-feedback__progress",
423
+ role: "progressbar",
424
+ "aria-label": m("timeoutFeedback.progress", "Time until timeout"),
425
+ "aria-valuenow": Math.round(I),
426
+ "aria-valuemin": 0,
427
+ "aria-valuemax": 100,
428
+ children: /* @__PURE__ */ e(
429
+ "div",
430
+ {
431
+ className: "nice-timeout-feedback__progress-bar",
432
+ style: { width: `${I}%` }
433
+ }
434
+ )
435
+ }
436
+ )
437
+ ]
438
+ }
439
+ );
440
+ }, oe = G(
441
+ ({
442
+ visible: n,
443
+ onAcceptAll: i,
444
+ onRejectAll: s,
445
+ onSave: r,
446
+ categories: t = ["necessary", "analytics", "marketing", "preferences"],
447
+ defaults: a,
448
+ position: d = "bottom",
449
+ size: h = "md",
450
+ policyUrl: u,
451
+ showDetails: f = !1,
452
+ className: p,
453
+ style: N,
454
+ id: g,
455
+ ...b
456
+ }, w) => {
457
+ const m = Y(g), { t: c } = P(), [x, T] = v(!0), k = n ?? x, [C, L] = v(f), [l, y] = v(() => {
458
+ const _ = {
459
+ necessary: !0,
460
+ analytics: !1,
461
+ marketing: !1,
462
+ preferences: !1
463
+ };
464
+ return a && Object.assign(_, a), _.necessary = !0, _;
465
+ }), E = {
466
+ necessary: c("cookie.necessary", "Necessary"),
467
+ analytics: c("cookie.analytics", "Analytics"),
468
+ marketing: c("cookie.marketing", "Marketing"),
469
+ preferences: c("cookie.preferences", "Preferences")
470
+ }, I = {
471
+ necessary: c(
472
+ "cookie.necessaryDesc",
473
+ "Required for the website to function. Cannot be disabled."
474
+ ),
475
+ analytics: c(
476
+ "cookie.analyticsDesc",
477
+ "Help us understand how visitors interact with the website."
478
+ ),
479
+ marketing: c("cookie.marketingDesc", "Used to deliver relevant advertisements."),
480
+ preferences: c("cookie.preferencesDesc", "Allow the website to remember your choices.")
481
+ }, A = $(() => {
482
+ const _ = {
483
+ necessary: !0,
484
+ analytics: !0,
485
+ marketing: !0,
486
+ preferences: !0
487
+ };
488
+ i?.(), r?.(_), T(!1);
489
+ }, [i, r]), F = $(() => {
490
+ const _ = {
491
+ necessary: !0,
492
+ analytics: !1,
493
+ marketing: !1,
494
+ preferences: !1
495
+ };
496
+ s?.(), r?.(_), T(!1);
497
+ }, [s, r]), B = $(() => {
498
+ r?.({ ...l, necessary: !0 }), T(!1);
499
+ }, [l, r]);
500
+ return k ? /* @__PURE__ */ e(
501
+ "div",
502
+ {
503
+ ref: w,
504
+ id: m,
505
+ className: `nice-cookie-consent nice-cookie-consent--${d} nice-cookie-consent--${h} ${p ?? ""}`,
506
+ style: N,
507
+ role: "dialog",
508
+ "aria-label": c("cookie.label", "Cookie Consent"),
509
+ "aria-modal": "true",
510
+ ...b,
511
+ children: /* @__PURE__ */ o("div", { className: "nice-cookie-consent__content", children: [
512
+ /* @__PURE__ */ o("p", { className: "nice-cookie-consent__message", children: [
513
+ c(
514
+ "cookie.message",
515
+ "We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies."
516
+ ),
517
+ u && /* @__PURE__ */ o(O, { children: [
518
+ " ",
519
+ /* @__PURE__ */ e(
520
+ "a",
521
+ {
522
+ href: u,
523
+ className: "nice-cookie-consent__link",
524
+ target: "_blank",
525
+ rel: "noopener noreferrer",
526
+ children: c("cookie.learnMore", "Learn more")
527
+ }
528
+ )
529
+ ] })
530
+ ] }),
531
+ C && /* @__PURE__ */ e("div", { className: "nice-cookie-consent__details", children: t.map((_) => /* @__PURE__ */ o("label", { className: "nice-cookie-consent__category", children: [
532
+ /* @__PURE__ */ e(
533
+ "input",
534
+ {
535
+ type: "checkbox",
536
+ checked: l[_],
537
+ disabled: _ === "necessary",
538
+ onChange: (j) => y((S) => ({ ...S, [_]: j.target.checked })),
539
+ className: "nice-cookie-consent__checkbox"
540
+ }
541
+ ),
542
+ /* @__PURE__ */ o("div", { className: "nice-cookie-consent__cat-info", children: [
543
+ /* @__PURE__ */ e("strong", { children: E[_] }),
544
+ /* @__PURE__ */ e("span", { className: "nice-cookie-consent__cat-desc", children: I[_] })
545
+ ] })
546
+ ] }, _)) }),
547
+ /* @__PURE__ */ o("div", { className: "nice-cookie-consent__actions", children: [
548
+ !C && /* @__PURE__ */ e(
549
+ "button",
550
+ {
551
+ type: "button",
552
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--details",
553
+ onClick: () => L(!0),
554
+ children: c("cookie.customize", "Customize")
555
+ }
556
+ ),
557
+ C && /* @__PURE__ */ e(
558
+ "button",
559
+ {
560
+ type: "button",
561
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--save",
562
+ onClick: B,
563
+ children: c("cookie.savePreferences", "Save preferences")
564
+ }
565
+ ),
566
+ /* @__PURE__ */ e(
567
+ "button",
568
+ {
569
+ type: "button",
570
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--reject",
571
+ onClick: F,
572
+ children: c("cookie.rejectAll", "Reject all")
573
+ }
574
+ ),
575
+ /* @__PURE__ */ e(
576
+ "button",
577
+ {
578
+ type: "button",
579
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--accept",
580
+ onClick: A,
581
+ children: c("cookie.acceptAll", "Accept all")
582
+ }
583
+ )
584
+ ] })
585
+ ] })
586
+ }
587
+ ) : null;
588
+ }
589
+ );
590
+ oe.displayName = "NiceCookieConsent";
591
+ const le = G(
592
+ ({
593
+ onSubmit: n,
594
+ onForgotPassword: i,
595
+ onRegister: s,
596
+ loading: r = !1,
597
+ error: t,
598
+ variant: a = "primary",
599
+ size: d = "md",
600
+ showRememberMe: h = !0,
601
+ showForgotPassword: u = !0,
602
+ showRegister: f = !1,
603
+ title: p,
604
+ logo: N,
605
+ usernameLabel: g,
606
+ passwordLabel: b,
607
+ usernamePlaceholder: w,
608
+ passwordPlaceholder: m,
609
+ className: c,
610
+ style: x,
611
+ id: T,
612
+ ...k
613
+ }, C) => {
614
+ const L = Y(T), { t: l } = P(), [y, E] = v(""), [I, A] = v(""), [F, B] = v(!1), [_, j] = v(!1), S = `${L}-user`, H = `${L}-pass`, V = `${L}-remember`, K = $(
615
+ (D) => {
616
+ D.preventDefault(), !r && n?.({ username: y, password: I, rememberMe: F });
617
+ },
618
+ [r, y, I, F, n]
619
+ );
620
+ return /* @__PURE__ */ o(
621
+ "form",
622
+ {
623
+ ref: C,
624
+ id: L,
625
+ className: `nice-login nice-login--${a} nice-login--${d} ${c ?? ""}`,
626
+ style: x,
627
+ onSubmit: K,
628
+ noValidate: !0,
629
+ ...k,
630
+ children: [
631
+ N && /* @__PURE__ */ e("div", { className: "nice-login__logo", children: N }),
632
+ p && /* @__PURE__ */ e("h2", { className: "nice-login__title", children: p ?? l("login.title", "Sign In") }),
633
+ t && /* @__PURE__ */ e("div", { className: "nice-login__error", role: "alert", children: t }),
634
+ /* @__PURE__ */ o("div", { className: "nice-login__field", children: [
635
+ /* @__PURE__ */ e("label", { htmlFor: S, className: "nice-login__label", children: g ?? l("login.username", "Username") }),
636
+ /* @__PURE__ */ e(
637
+ "input",
638
+ {
639
+ id: S,
640
+ className: "nice-login__input",
641
+ type: "text",
642
+ value: y,
643
+ onChange: (D) => E(D.target.value),
644
+ placeholder: w ?? l("login.usernamePlaceholder", "Enter your username"),
645
+ autoComplete: "username",
646
+ required: !0,
647
+ disabled: r,
648
+ "aria-required": "true"
649
+ }
650
+ )
651
+ ] }),
652
+ /* @__PURE__ */ o("div", { className: "nice-login__field", children: [
653
+ /* @__PURE__ */ e("label", { htmlFor: H, className: "nice-login__label", children: b ?? l("login.password", "Password") }),
654
+ /* @__PURE__ */ o("div", { className: "nice-login__password-wrap", children: [
655
+ /* @__PURE__ */ e(
656
+ "input",
657
+ {
658
+ id: H,
659
+ className: "nice-login__input",
660
+ type: _ ? "text" : "password",
661
+ value: I,
662
+ onChange: (D) => A(D.target.value),
663
+ placeholder: m ?? l("login.passwordPlaceholder", "Enter your password"),
664
+ autoComplete: "current-password",
665
+ required: !0,
666
+ disabled: r,
667
+ "aria-required": "true"
668
+ }
669
+ ),
670
+ /* @__PURE__ */ e(
671
+ "button",
672
+ {
673
+ type: "button",
674
+ className: "nice-login__toggle-password",
675
+ onClick: () => j(!_),
676
+ "aria-label": _ ? l("login.hidePassword", "Hide password") : l("login.showPassword", "Show password"),
677
+ tabIndex: -1,
678
+ children: /* @__PURE__ */ e(M, { name: _ ? "eye-off" : "eye", size: 16 })
679
+ }
680
+ )
681
+ ] })
682
+ ] }),
683
+ /* @__PURE__ */ o("div", { className: "nice-login__options", children: [
684
+ h && /* @__PURE__ */ o("label", { className: "nice-login__remember", htmlFor: V, children: [
685
+ /* @__PURE__ */ e(
686
+ "input",
687
+ {
688
+ id: V,
689
+ type: "checkbox",
690
+ checked: F,
691
+ onChange: (D) => B(D.target.checked),
692
+ disabled: r
693
+ }
694
+ ),
695
+ /* @__PURE__ */ e("span", { children: l("login.rememberMe", "Remember me") })
696
+ ] }),
697
+ u && i && /* @__PURE__ */ e(
698
+ "button",
699
+ {
700
+ type: "button",
701
+ className: "nice-login__forgot",
702
+ onClick: i,
703
+ disabled: r,
704
+ children: l("login.forgotPassword", "Forgot password?")
705
+ }
706
+ )
707
+ ] }),
708
+ /* @__PURE__ */ e(
709
+ "button",
710
+ {
711
+ type: "submit",
712
+ className: `nice-login__submit nice-login__submit--${a}`,
713
+ disabled: r || !y || !I,
714
+ children: r ? l("login.loading", "Signing in...") : l("login.submit", "Sign In")
715
+ }
716
+ ),
717
+ f && s && /* @__PURE__ */ o("p", { className: "nice-login__register", children: [
718
+ l("login.noAccount", "Don't have an account?"),
719
+ " ",
720
+ /* @__PURE__ */ e(
721
+ "button",
722
+ {
723
+ type: "button",
724
+ className: "nice-login__register-link",
725
+ onClick: s,
726
+ disabled: r,
727
+ children: l("login.register", "Register")
728
+ }
729
+ )
730
+ ] })
731
+ ]
732
+ }
733
+ );
734
+ }
735
+ );
736
+ le.displayName = "NiceLoginForm";
737
+ export {
738
+ fe as N,
739
+ oe as a,
740
+ _e as b,
741
+ U as c,
742
+ le as d,
743
+ ge as e,
744
+ ve as f,
745
+ Ne as g,
746
+ pe as h,
747
+ J as i,
748
+ ce as j,
749
+ be as u
750
+ };