@nice2dev/ui 1.2.0 → 1.2.1

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 (191) hide show
  1. package/CHANGELOG.md +107 -0
  2. package/dist/NiceApiExplorer.doc-CFJndg5h.js +25 -0
  3. package/dist/NiceApiExplorer.doc-TEx67kV5.cjs +1 -0
  4. package/dist/NiceBPMNDesigner.doc-6lK1pXRq.js +32 -0
  5. package/dist/NiceBPMNDesigner.doc-BY8t7qOi.cjs +8 -0
  6. package/dist/NiceBackupDiffViewer.doc-CYvOeX19.js +25 -0
  7. package/dist/NiceBackupDiffViewer.doc-ChQaZCg1.cjs +1 -0
  8. package/dist/NiceBackupList.doc-BdQCw0_D.cjs +1 -0
  9. package/dist/NiceBackupList.doc-BwjIAoqz.js +25 -0
  10. package/dist/NiceBackupRestoreDialog.doc-B2iiqTps.cjs +1 -0
  11. package/dist/NiceBackupRestoreDialog.doc-DuXSGJiD.js +25 -0
  12. package/dist/NiceBackupScheduler.doc-BpY45181.js +31 -0
  13. package/dist/NiceBackupScheduler.doc-ByeL3iH1.cjs +7 -0
  14. package/dist/NiceBackupStatusBadge.doc-BA3dYgiW.cjs +1 -0
  15. package/dist/NiceBackupStatusBadge.doc-CxwkVarP.js +25 -0
  16. package/dist/NiceBackupTagEditor.doc-Bej1KHco.cjs +7 -0
  17. package/dist/NiceBackupTagEditor.doc-CNy4uNws.js +31 -0
  18. package/dist/NiceBottomSheet.doc-keq-Fzlz.cjs +8 -0
  19. package/dist/NiceBottomSheet.doc-v-UPUKQk.js +32 -0
  20. package/dist/NiceBranchManager.doc-BTyRjX7X.cjs +6 -0
  21. package/dist/NiceBranchManager.doc-Cz4SyEqE.js +30 -0
  22. package/dist/NiceButton-3AcJJ15c.cjs +1 -0
  23. package/dist/NiceButton-vkI07DP0.js +88 -0
  24. package/dist/NiceCodeEditor-VGIDWSkS.js +1181 -0
  25. package/dist/NiceCodeEditor-qX39PSnQ.cjs +260 -0
  26. package/dist/NiceColorPicker-CQhhjZ8w.cjs +1 -0
  27. package/dist/NiceColorPicker-Cbop7VMu.js +491 -0
  28. package/dist/NiceConnectorConfigForm.doc-BKrDuhXw.cjs +7 -0
  29. package/dist/NiceConnectorConfigForm.doc-BsHeXz3M.js +31 -0
  30. package/dist/NiceDataBranchGraph.doc-Axidz41W.js +29 -0
  31. package/dist/NiceDataBranchGraph.doc-sjLmrrtE.cjs +5 -0
  32. package/dist/NiceDataBranchManager.doc-B1-Rp2X4.cjs +6 -0
  33. package/dist/NiceDataBranchManager.doc-GUqfTFvW.js +30 -0
  34. package/dist/NiceDataConflictResolver.doc-CjQryrTu.cjs +5 -0
  35. package/dist/NiceDataConflictResolver.doc-L-TcnQMX.js +29 -0
  36. package/dist/NiceDataDiffViewer.doc-BzGrf0U-.cjs +6 -0
  37. package/dist/NiceDataDiffViewer.doc-goxhSldH.js +30 -0
  38. package/dist/NiceDataGrid-BDEIbuBS.js +2218 -0
  39. package/dist/NiceDataGrid-CS5aB-EN.cjs +10 -0
  40. package/dist/NiceDataMapper.doc-QmnmnvVq.js +30 -0
  41. package/dist/NiceDataMapper.doc-ytGVtYVr.cjs +6 -0
  42. package/dist/NiceDataMergeBuilder.doc-BcmzKxh2.cjs +6 -0
  43. package/dist/NiceDataMergeBuilder.doc-BvYa4aUJ.js +30 -0
  44. package/dist/NiceDataSnapshot.doc-C73K1biG.cjs +6 -0
  45. package/dist/NiceDataSnapshot.doc-hU7wnOzM.js +30 -0
  46. package/dist/NiceDesktopViews.doc-DJjYlyP2.cjs +1 -0
  47. package/dist/NiceDesktopViews.doc-ly-VUAJj.js +25 -0
  48. package/dist/NiceDeviceControlCard.doc-BZIo92-w.cjs +1 -0
  49. package/dist/NiceDeviceControlCard.doc-DIzZcW9L.js +25 -0
  50. package/dist/NiceDocumentViewer-B9VIVKyw.js +726 -0
  51. package/dist/NiceDocumentViewer-CDXAmPp7.cjs +180 -0
  52. package/dist/NiceDocumentationViewer.doc-BSNGa7a_.js +25 -0
  53. package/dist/NiceDocumentationViewer.doc-CrwlvPFg.cjs +1 -0
  54. package/dist/NiceEnergyChart.doc-DW-jllDV.cjs +1 -0
  55. package/dist/NiceEnergyChart.doc-DnEehTff.js +25 -0
  56. package/dist/NiceFeatureGate.doc-DN17uS_B.cjs +3 -0
  57. package/dist/NiceFeatureGate.doc-DNfFSRrh.js +27 -0
  58. package/dist/NiceForm-BcN4p2kG.cjs +1 -0
  59. package/dist/NiceForm-tIXS-M6b.js +4770 -0
  60. package/dist/NiceFormItem.doc-BJwEnDz2.js +36 -0
  61. package/dist/NiceFormItem.doc-Ck3PgaPD.cjs +12 -0
  62. package/dist/NiceGantt-CTbqCuwv.cjs +1 -0
  63. package/dist/NiceGantt-Dao7pN9z.js +328 -0
  64. package/dist/NiceGantt.doc-B6YZcJvG.cjs +11 -0
  65. package/dist/NiceGantt.doc-DsI1QXly.js +48 -0
  66. package/dist/NiceGitBlame.doc-BQ2KvGkD.js +30 -0
  67. package/dist/NiceGitBlame.doc-DuTSjZVN.cjs +6 -0
  68. package/dist/NiceGitDiffViewer.doc-D24AGos_.js +30 -0
  69. package/dist/NiceGitDiffViewer.doc-D9FVquBC.cjs +6 -0
  70. package/dist/NiceGitGraph.doc-C-8VGMIz.js +29 -0
  71. package/dist/NiceGitGraph.doc-eRvTmefl.cjs +5 -0
  72. package/dist/NiceGitHooks.doc-DCTVw7HX.cjs +5 -0
  73. package/dist/NiceGitHooks.doc-OCFj5w6v.js +29 -0
  74. package/dist/NiceHtmlEditor-DUwcqj5N.cjs +10 -0
  75. package/dist/NiceHtmlEditor-DiAphF1k.js +889 -0
  76. package/dist/NiceInstanceMonitor.doc-BSDZp5xa.js +31 -0
  77. package/dist/NiceInstanceMonitor.doc-HVbLufnh.cjs +7 -0
  78. package/dist/NiceLocaleManager.doc-CbVHDEWu.js +25 -0
  79. package/dist/NiceLocaleManager.doc-XH6hMW0Z.cjs +1 -0
  80. package/dist/NiceLockButton.doc-BMhSj3TB.cjs +1 -0
  81. package/dist/NiceLockButton.doc-DvHGhcfm.js +25 -0
  82. package/dist/NiceLoginForm-DQe77Isv.js +747 -0
  83. package/dist/NiceLoginForm-NBCo-DUZ.cjs +1 -0
  84. package/dist/NiceLoginForm.css +1 -1
  85. package/dist/NiceMAM.doc-CsQ57saR.cjs +8 -0
  86. package/dist/NiceMAM.doc-hjW7buTH.js +32 -0
  87. package/dist/NiceMention--3P3vO-W.cjs +430 -0
  88. package/dist/NiceMention-Co2cqkVM.js +11316 -0
  89. package/dist/NiceMention.css +1 -1
  90. package/dist/NiceModuleLifecyclePanel-DV3F_QdI.cjs +1 -0
  91. package/dist/NiceModuleLifecyclePanel-gaZkIEtK.js +6825 -0
  92. package/dist/NiceModuleLifecyclePanel.css +1 -1
  93. package/dist/NiceNetworkDiscoveryPanel.doc-B0RtGaS3.js +25 -0
  94. package/dist/NiceNetworkDiscoveryPanel.doc-BFgFZI5G.cjs +1 -0
  95. package/dist/NicePagination-B3nZDZem.js +165 -0
  96. package/dist/NicePagination-B8rg1Y67.cjs +1 -0
  97. package/dist/NicePipelineEditor.doc-CjqDKe2x.js +29 -0
  98. package/dist/NicePipelineEditor.doc-DZ0pTVTp.cjs +5 -0
  99. package/dist/NicePipelineMonitor.doc-C88-TagI.cjs +5 -0
  100. package/dist/NicePipelineMonitor.doc-CFtH4XJx.js +29 -0
  101. package/dist/NicePivotGrid-BaZa2YZW.js +1157 -0
  102. package/dist/NicePivotGrid-DyOPhPO8.cjs +152 -0
  103. package/dist/NiceRoomGrid.doc-DJPVUQVg.cjs +8 -0
  104. package/dist/NiceRoomGrid.doc-DLHJS_Wb.js +32 -0
  105. package/dist/NiceSavedQueryPanel-BC84uRfh.cjs +586 -0
  106. package/dist/NiceSavedQueryPanel-CMfcODIO.js +5120 -0
  107. package/dist/NiceSavedQueryPanel.css +1 -1
  108. package/dist/NiceSceneBar.doc-09sc3yuF.cjs +1 -0
  109. package/dist/NiceSceneBar.doc-DLePMuVU.js +25 -0
  110. package/dist/NiceSceneSelector.doc-CPzCAy-d.cjs +7 -0
  111. package/dist/NiceSceneSelector.doc-FCLZvPc0.js +31 -0
  112. package/dist/NiceScheduler-BAJRzFQN.js +1690 -0
  113. package/dist/NiceScheduler-dJ7gHDv7.cjs +5 -0
  114. package/dist/NiceSchedulerViews.doc-C9opZpgg.cjs +1 -0
  115. package/dist/NiceSchedulerViews.doc-Dy7ZH1iL.js +25 -0
  116. package/dist/NiceSelect-CZR8Zu_k.js +420 -0
  117. package/dist/NiceSelect-DIKGbaJo.cjs +1 -0
  118. package/dist/NiceSensorGaugePanel.doc-BHirbWLn.cjs +8 -0
  119. package/dist/NiceSensorGaugePanel.doc-DjKmooI6.js +32 -0
  120. package/dist/NiceSpotlight.doc-BVZFfDVI.cjs +10 -0
  121. package/dist/NiceSpotlight.doc-JqwkzrEm.js +34 -0
  122. package/dist/NiceStateDesigner.doc-CfnwiwfU.js +29 -0
  123. package/dist/NiceStateDesigner.doc-DV4zEC50.cjs +5 -0
  124. package/dist/NiceStepper.doc-5VjaLM6r.js +31 -0
  125. package/dist/NiceStepper.doc-f8lYpr33.cjs +7 -0
  126. package/dist/NiceTaskInbox.doc-CHrxthqp.js +32 -0
  127. package/dist/NiceTaskInbox.doc-CdCTfgBq.cjs +8 -0
  128. package/dist/NiceTestBuilder.doc-BoBzLfa0.js +30 -0
  129. package/dist/NiceTestBuilder.doc-Cj1fNTvk.cjs +6 -0
  130. package/dist/NiceTranscoder.doc-Dnirl3wg.cjs +7 -0
  131. package/dist/NiceTranscoder.doc-cInCYZh7.js +31 -0
  132. package/dist/NiceVideoAnnotator.doc-C1iEi7OM.cjs +7 -0
  133. package/dist/NiceVideoAnnotator.doc-C8zyfKH_.js +31 -0
  134. package/dist/NiceVideoEditor.doc-C6mhEb-q.cjs +7 -0
  135. package/dist/NiceVideoEditor.doc-lrwmKjqj.js +31 -0
  136. package/dist/NiceWindow-CWN8OCHF.js +2109 -0
  137. package/dist/NiceWindow-Dd8qjkIW.cjs +1 -0
  138. package/dist/NiceWindow.css +1 -1
  139. package/dist/charts-Bo2WAI5T.cjs +768 -0
  140. package/dist/charts-ByrdMeQP.js +4767 -0
  141. package/dist/charts.cjs +1 -1
  142. package/dist/charts.css +1 -1
  143. package/dist/charts.d.ts +28 -18
  144. package/dist/charts.mjs +1 -1
  145. package/dist/core-B8eBUE4m.js +438 -0
  146. package/dist/core-lBFqvT0V.cjs +1 -0
  147. package/dist/core-lazy-Bh2yg4Et.js +351 -0
  148. package/dist/core-lazy-CkWKjfc6.cjs +1 -0
  149. package/dist/data-branching-Dak1_ZKR.cjs +1 -0
  150. package/dist/data-branching-DiLAO4Qt.js +6386 -0
  151. package/dist/data-branching.cjs +1 -1
  152. package/dist/data-branching.mjs +1 -1
  153. package/dist/data.cjs +1 -1
  154. package/dist/data.d.ts +22 -18
  155. package/dist/data.mjs +3 -3
  156. package/dist/devops-DkVluHBp.cjs +17 -0
  157. package/dist/devops-zsMUueTd.js +8648 -0
  158. package/dist/devops.cjs +1 -1
  159. package/dist/devops.d.ts +3 -3
  160. package/dist/devops.mjs +1 -1
  161. package/dist/editors.cjs +1 -1
  162. package/dist/editors.d.ts +100 -38
  163. package/dist/editors.mjs +8 -8
  164. package/dist/feedback.cjs +1 -1
  165. package/dist/feedback.d.ts +71 -2
  166. package/dist/feedback.mjs +10 -9
  167. package/dist/index.cjs +193 -193
  168. package/dist/index.css +1 -1
  169. package/dist/index.d.ts +637 -225
  170. package/dist/index.mjs +26403 -26405
  171. package/dist/injectStyleOnce-BzC_BCs_.js +9 -0
  172. package/dist/injectStyleOnce-DeWaxcdf.cjs +1 -0
  173. package/dist/lazy.cjs +1 -1
  174. package/dist/lazy.d.ts +9 -7
  175. package/dist/lazy.mjs +51 -51
  176. package/dist/navigation.cjs +1 -1
  177. package/dist/navigation.css +1 -0
  178. package/dist/navigation.d.ts +99 -43
  179. package/dist/navigation.mjs +504 -547
  180. package/dist/no-code-DiTEnuRv.js +8288 -0
  181. package/dist/no-code-wG9c0z_T.cjs +331 -0
  182. package/dist/no-code.cjs +1 -1
  183. package/dist/no-code.css +1 -1
  184. package/dist/no-code.mjs +1 -1
  185. package/dist/overlays.cjs +1 -1
  186. package/dist/overlays.d.ts +12 -6
  187. package/dist/overlays.mjs +1 -1
  188. package/dist/pickerCommons-BCRiHDE_.cjs +1 -0
  189. package/dist/pickerCommons-DkumQ3KE.js +548 -0
  190. package/dist/style.css +12 -9
  191. package/package.json +3 -3
@@ -0,0 +1,747 @@
1
+ import { jsx as e, jsxs as o, Fragment as M } from "react/jsx-runtime";
2
+ import { NiceIcon as I, useNiceTranslation as P, useComponentDisplayClass as U, useComponentDisplayStyle as Q, useFocusTrap as X, useControlId as Y } from "@nice2dev/ui-core";
3
+ import { useRef as F, useEffect as z, useState as y, useCallback as E, Component as Z, useSyncExternalStore as ee, forwardRef as G } from "react";
4
+ import { N as ne } from "./NiceButton-vkI07DP0.js";
5
+ const J = {
6
+ info: /* @__PURE__ */ e(I, { name: "info", size: 20 }),
7
+ success: /* @__PURE__ */ e(I, { name: "success", size: 20 }),
8
+ warning: /* @__PURE__ */ e(I, { name: "warning", size: 20 }),
9
+ error: /* @__PURE__ */ e(I, { name: "error", size: 20 })
10
+ }, he = ({
11
+ variant: n = "info",
12
+ title: t,
13
+ children: a,
14
+ closable: r,
15
+ onClose: s,
16
+ icon: i,
17
+ size: d = "md",
18
+ className: h,
19
+ style: m,
20
+ displayStyle: f
21
+ }) => {
22
+ const { t: b } = P(), p = U("card", f);
23
+ return /* @__PURE__ */ o(
24
+ "div",
25
+ {
26
+ className: `nice-alert nice-alert--${n} nice-alert--${d} nice-alert--ds-${p} ${h || ""}`,
27
+ style: m,
28
+ role: "alert",
29
+ children: [
30
+ /* @__PURE__ */ e("div", { className: `nice-alert__icon nice-alert__icon--${n}`, children: i || J[n] }),
31
+ /* @__PURE__ */ o("div", { className: "nice-alert__content", children: [
32
+ t && /* @__PURE__ */ e("div", { className: "nice-alert__title", children: t }),
33
+ /* @__PURE__ */ e("div", { children: a })
34
+ ] }),
35
+ r && /* @__PURE__ */ e(
36
+ "button",
37
+ {
38
+ type: "button",
39
+ className: "nice-alert__close",
40
+ onClick: s,
41
+ "aria-label": b("alert.close", "Close"),
42
+ children: /* @__PURE__ */ e(I, { name: "close", size: 16 })
43
+ }
44
+ )
45
+ ]
46
+ }
47
+ );
48
+ }, fe = ({
49
+ open: n,
50
+ onClose: t,
51
+ title: a,
52
+ position: r = "right",
53
+ size: s = "md",
54
+ children: i,
55
+ footer: d,
56
+ transitionDuration: h,
57
+ className: m,
58
+ style: f,
59
+ displayStyle: b
60
+ }) => {
61
+ const p = Q("modal", b), w = U("modal", b), { t: g } = P(), N = F(null);
62
+ return X(N, n), z(() => {
63
+ if (!n)
64
+ return;
65
+ const u = (c) => {
66
+ c.key === "Escape" && t();
67
+ };
68
+ return document.addEventListener("keydown", u), document.body.style.overflow = "hidden", () => {
69
+ document.removeEventListener("keydown", u), document.body.style.overflow = "";
70
+ };
71
+ }, [n, t]), n ? /* @__PURE__ */ o(M, { children: [
72
+ /* @__PURE__ */ e(
73
+ "div",
74
+ {
75
+ className: "nice-drawer-overlay",
76
+ onMouseDown: (u) => {
77
+ u.target === u.currentTarget && t();
78
+ }
79
+ }
80
+ ),
81
+ /* @__PURE__ */ o(
82
+ "div",
83
+ {
84
+ ref: N,
85
+ className: `nice-drawer nice-drawer--${r} nice-drawer--${s} nice-drawer--ds-${w} ${m || ""}`,
86
+ style: {
87
+ ...p,
88
+ ...f,
89
+ ...h != null ? { transitionDuration: `${h}ms` } : {}
90
+ },
91
+ role: "dialog",
92
+ "aria-modal": "true",
93
+ "aria-label": a,
94
+ children: [
95
+ a && /* @__PURE__ */ o("div", { className: "nice-drawer__header", children: [
96
+ /* @__PURE__ */ e("h3", { className: "nice-drawer__title", children: a }),
97
+ /* @__PURE__ */ e(
98
+ "button",
99
+ {
100
+ type: "button",
101
+ className: "nice-drawer__close",
102
+ onClick: t,
103
+ "aria-label": g("controls.close", "Close"),
104
+ children: /* @__PURE__ */ e(I, { name: "close", size: 18 })
105
+ }
106
+ )
107
+ ] }),
108
+ /* @__PURE__ */ e("div", { className: "nice-drawer__body", children: i }),
109
+ d && /* @__PURE__ */ e("div", { className: "nice-drawer__footer", children: d })
110
+ ]
111
+ }
112
+ )
113
+ ] }) : null;
114
+ }, _e = ({
115
+ toasts: n,
116
+ onDismiss: t,
117
+ position: a = "top-right"
118
+ }) => /* @__PURE__ */ e("div", { className: `nice-toast-container nice-toast-container--${a}`, children: n.map((r) => /* @__PURE__ */ e(te, { toast: r, onDismiss: t }, r.id)) }), te = ({
119
+ toast: n,
120
+ onDismiss: t
121
+ }) => {
122
+ const { t: a } = P(), [r, s] = y(!1);
123
+ return z(() => {
124
+ if (!n.duration && n.duration !== 0) {
125
+ const i = setTimeout(() => s(!0), 4e3);
126
+ return () => clearTimeout(i);
127
+ }
128
+ if (n.duration > 0) {
129
+ const i = setTimeout(() => s(!0), n.duration);
130
+ return () => clearTimeout(i);
131
+ }
132
+ }, [n.duration]), z(() => {
133
+ if (r) {
134
+ const i = setTimeout(() => t(n.id), 200);
135
+ return () => clearTimeout(i);
136
+ }
137
+ }, [r, n.id, t]), /* @__PURE__ */ o(
138
+ "div",
139
+ {
140
+ className: `nice-toast nice-toast--${n.variant} ${r ? "nice-toast--exiting" : ""}`,
141
+ role: "alert",
142
+ style: { position: "relative" },
143
+ children: [
144
+ /* @__PURE__ */ e("div", { className: "nice-toast__icon", children: J[n.variant] }),
145
+ /* @__PURE__ */ o("div", { className: "nice-toast__content", children: [
146
+ n.title && /* @__PURE__ */ e("div", { className: "nice-toast__title", children: n.title }),
147
+ /* @__PURE__ */ e("div", { className: "nice-toast__message", children: n.message })
148
+ ] }),
149
+ /* @__PURE__ */ e(
150
+ "button",
151
+ {
152
+ type: "button",
153
+ className: "nice-toast__close",
154
+ onClick: () => s(!0),
155
+ "aria-label": a("toast.close", "Close"),
156
+ children: /* @__PURE__ */ e(I, { name: "close", size: 16 })
157
+ }
158
+ )
159
+ ]
160
+ }
161
+ );
162
+ };
163
+ let se = 0;
164
+ function be() {
165
+ const [n, t] = y([]), a = E(
166
+ (s, i, d) => {
167
+ const h = `toast-${++se}`;
168
+ return t((m) => [
169
+ ...m,
170
+ { id: h, variant: s, message: i, title: d?.title, duration: d?.duration }
171
+ ]), h;
172
+ },
173
+ []
174
+ ), r = E((s) => {
175
+ t((i) => i.filter((d) => d.id !== s));
176
+ }, []);
177
+ return {
178
+ toasts: n,
179
+ dismiss: r,
180
+ info: (s, i) => a("info", s, i),
181
+ success: (s, i) => a("success", s, i),
182
+ warning: (s, i) => a("warning", s, i),
183
+ error: (s, i) => a("error", s, i)
184
+ };
185
+ }
186
+ function re({
187
+ error: n,
188
+ showRetry: t,
189
+ retryLabel: a,
190
+ title: r,
191
+ onReset: s
192
+ }) {
193
+ const { t: i } = P();
194
+ return /* @__PURE__ */ o("div", { className: "nice-error-boundary", role: "alert", children: [
195
+ /* @__PURE__ */ e("div", { className: "nice-error-boundary__icon", children: /* @__PURE__ */ e(I, { name: "warning", size: 32 }) }),
196
+ /* @__PURE__ */ e("h2", { className: "nice-error-boundary__title", children: r ?? i("errorBoundary.somethingWentWrong", "Something went wrong") }),
197
+ /* @__PURE__ */ e("p", { className: "nice-error-boundary__message", children: n.message }),
198
+ t && /* @__PURE__ */ e("button", { type: "button", className: "nice-btn nice-btn--primary", onClick: s, children: a ?? i("errorBoundary.retry", "Retry") })
199
+ ] });
200
+ }
201
+ const q = class q extends Z {
202
+ constructor() {
203
+ super(...arguments), this.state = {
204
+ hasError: !1,
205
+ error: null
206
+ }, this.handleReset = () => {
207
+ this.setState({ hasError: !1, error: null });
208
+ };
209
+ }
210
+ static getDerivedStateFromError(t) {
211
+ return { hasError: !0, error: t };
212
+ }
213
+ componentDidCatch(t, a) {
214
+ this.props.onError?.(t, a);
215
+ }
216
+ render() {
217
+ if (this.state.hasError && this.state.error) {
218
+ const { fallback: t, showRetry: a = !0, retryLabel: r, title: s } = this.props;
219
+ return typeof t == "function" ? t(this.state.error, this.handleReset) : t || /* @__PURE__ */ e(
220
+ re,
221
+ {
222
+ error: this.state.error,
223
+ showRetry: a,
224
+ retryLabel: r,
225
+ title: s,
226
+ onReset: this.handleReset
227
+ }
228
+ );
229
+ }
230
+ return this.props.children;
231
+ }
232
+ };
233
+ q.displayName = "NiceErrorBoundary";
234
+ let H = q;
235
+ function ie(n) {
236
+ return window.addEventListener("online", n), window.addEventListener("offline", n), () => {
237
+ window.removeEventListener("online", n), window.removeEventListener("offline", n);
238
+ };
239
+ }
240
+ function ae() {
241
+ return navigator.onLine;
242
+ }
243
+ function ce() {
244
+ return !0;
245
+ }
246
+ const pe = ({
247
+ message: n,
248
+ variant: t = "warning",
249
+ icon: a,
250
+ online: r,
251
+ size: s = "md",
252
+ className: i,
253
+ style: d,
254
+ "data-testid": h
255
+ }) => {
256
+ const { t: m } = P(), f = ee(ie, ae, ce);
257
+ return r ?? f ? null : /* @__PURE__ */ o(
258
+ "div",
259
+ {
260
+ className: `nice-offline-banner nice-offline-banner--${t} nice-offline-banner--${s} ${i || ""}`,
261
+ style: d,
262
+ role: "alert",
263
+ "aria-live": "assertive",
264
+ "data-testid": h,
265
+ children: [
266
+ /* @__PURE__ */ e("span", { className: "nice-offline-banner__icon", children: a ?? /* @__PURE__ */ e(I, { name: "wifi", size: 18 }) }),
267
+ /* @__PURE__ */ e("span", { className: "nice-offline-banner__message", children: n ?? m("offlineBanner.message", "You are offline. Some features may be unavailable.") })
268
+ ]
269
+ }
270
+ );
271
+ }, ge = ({
272
+ error: n,
273
+ onRetry: t,
274
+ retryLabel: a = "Retry",
275
+ title: r,
276
+ autoRetrySeconds: s,
277
+ variant: i = "error",
278
+ icon: d,
279
+ size: h = "md",
280
+ className: m,
281
+ style: f,
282
+ "data-testid": b
283
+ }) => {
284
+ const { t: p } = P(), w = r ?? p("retryPanel.operationFailed", "Operation failed"), [g, N] = y(s ?? 0), u = F(void 0), c = typeof n == "string" ? n : n.message, T = E(() => {
285
+ N(s ?? 0), t();
286
+ }, [t, s]);
287
+ return z(() => {
288
+ if (!(!s || s <= 0))
289
+ return N(s), u.current = setInterval(() => {
290
+ N((v) => v <= 1 ? (clearInterval(u.current), t(), 0) : v - 1);
291
+ }, 1e3), () => clearInterval(u.current);
292
+ }, [s, t]), /* @__PURE__ */ o(
293
+ "div",
294
+ {
295
+ className: `nice-retry-panel nice-retry-panel--${i} nice-retry-panel--${h} ${m || ""}`,
296
+ style: f,
297
+ role: "alert",
298
+ "data-testid": b,
299
+ children: [
300
+ /* @__PURE__ */ e("div", { className: "nice-retry-panel__icon", children: d ?? /* @__PURE__ */ e(I, { name: "warning", size: 24 }) }),
301
+ /* @__PURE__ */ o("div", { className: "nice-retry-panel__content", children: [
302
+ /* @__PURE__ */ e("div", { className: "nice-retry-panel__title", children: w }),
303
+ /* @__PURE__ */ e("p", { className: "nice-retry-panel__message", children: c })
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: T,
312
+ children: a
313
+ }
314
+ ),
315
+ s && g > 0 && /* @__PURE__ */ e("span", { className: "nice-retry-panel__countdown", children: p("retryPanel.autoRetryInS", "Auto-retry in {countdown}s").replace(
316
+ "{countdown}",
317
+ String(g)
318
+ ) })
319
+ ] })
320
+ ]
321
+ }
322
+ );
323
+ };
324
+ function oe({
325
+ timeoutMs: n = 1e4,
326
+ slowThresholdMs: t = 3e3,
327
+ onTimeout: a,
328
+ autoRetry: r = !1,
329
+ autoRetryCount: s = 3
330
+ } = {}) {
331
+ const [i, d] = y(!1), [h, m] = y(!1), [f, b] = y(!1), [p, w] = y(0), [g, N] = y(0), u = F(null), c = F(null), T = F(null), v = F(0), k = E(() => {
332
+ u.current && clearTimeout(u.current), c.current && clearTimeout(c.current), T.current && clearInterval(T.current);
333
+ }, []), $ = E(() => {
334
+ k(), d(!0), m(!1), b(!1), w(0), v.current = Date.now(), T.current = setInterval(() => {
335
+ w(Date.now() - v.current);
336
+ }, 200), u.current = setTimeout(() => {
337
+ m(!0);
338
+ }, t), c.current = setTimeout(() => {
339
+ b(!0), d(!1), m(!1), k(), a?.();
340
+ }, n);
341
+ }, [k, t, n, a]), D = E(() => {
342
+ k(), d(!1), m(!1);
343
+ }, [k]), l = E(() => {
344
+ N((C) => C + 1), b(!1), $();
345
+ }, [$]);
346
+ return z(() => () => k(), [k]), z(() => {
347
+ if (r && f && g < s) {
348
+ const C = Math.pow(2, g) * 1e3, L = setTimeout(() => l(), C);
349
+ return () => clearTimeout(L);
350
+ }
351
+ }, [r, s, f, g, l]), { isLoading: i, isSlow: h, isTimedOut: f, elapsed: p, retryCount: g, start: $, stop: D, retry: l };
352
+ }
353
+ const Ne = ({
354
+ timeoutMs: n = 1e4,
355
+ slowThresholdMs: t = 3e3,
356
+ onTimeout: a,
357
+ onRetry: r,
358
+ autoRetry: s = !1,
359
+ autoRetryCount: i = 3,
360
+ showProgress: d = !0,
361
+ slowMessage: h,
362
+ timeoutMessage: m,
363
+ loading: f,
364
+ children: b,
365
+ size: p = "md",
366
+ className: w,
367
+ style: g,
368
+ "data-testid": N
369
+ }) => {
370
+ const { t: u } = P(), { isSlow: c, isTimedOut: T, elapsed: v, start: k, stop: $, retry: D } = oe({
371
+ timeoutMs: n,
372
+ slowThresholdMs: t,
373
+ onTimeout: a,
374
+ autoRetry: s,
375
+ autoRetryCount: i
376
+ }), l = F(k);
377
+ l.current = k;
378
+ const C = F($);
379
+ C.current = $, z(() => {
380
+ f ? l.current() : C.current();
381
+ }, [f]);
382
+ const L = () => {
383
+ D(), r?.();
384
+ };
385
+ if (!f)
386
+ return /* @__PURE__ */ e(M, { children: b });
387
+ if (T)
388
+ return /* @__PURE__ */ o(
389
+ "div",
390
+ {
391
+ className: `nice-timeout-feedback nice-timeout-feedback--timeout nice-timeout-feedback--${p} ${w ?? ""}`,
392
+ style: g,
393
+ role: "alert",
394
+ "data-testid": N,
395
+ children: [
396
+ /* @__PURE__ */ e("p", { className: "nice-timeout-feedback__message", children: m ?? u("timeoutFeedback.timeout", "The operation timed out. Please try again.") }),
397
+ /* @__PURE__ */ e(ne, { size: "sm", className: "nice-timeout-feedback__retry-btn", onClick: L, children: u("timeoutFeedback.retry", "Try again") })
398
+ ]
399
+ }
400
+ );
401
+ const x = Math.min(100, v / n * 100);
402
+ return /* @__PURE__ */ o(
403
+ "div",
404
+ {
405
+ className: `nice-timeout-feedback nice-timeout-feedback--${p} ${c ? "nice-timeout-feedback--slow" : ""} ${w ?? ""}`,
406
+ style: g,
407
+ role: "status",
408
+ "aria-busy": "true",
409
+ "data-testid": N,
410
+ children: [
411
+ /* @__PURE__ */ e("div", { className: "nice-timeout-feedback__spinner", "aria-hidden": "true" }),
412
+ c && /* @__PURE__ */ e("p", { className: "nice-timeout-feedback__slow-msg", children: h ?? u("timeoutFeedback.slow", "This is taking longer than usual…") }),
413
+ d && /* @__PURE__ */ e(
414
+ "div",
415
+ {
416
+ className: "nice-timeout-feedback__progress",
417
+ role: "progressbar",
418
+ "aria-label": u("timeoutFeedback.progress", "Time until timeout"),
419
+ "aria-valuenow": Math.round(x),
420
+ "aria-valuemin": 0,
421
+ "aria-valuemax": 100,
422
+ children: /* @__PURE__ */ e(
423
+ "div",
424
+ {
425
+ className: "nice-timeout-feedback__progress-bar",
426
+ style: { width: `${x}%` }
427
+ }
428
+ )
429
+ }
430
+ )
431
+ ]
432
+ }
433
+ );
434
+ }, ye = /* @__PURE__ */ Object.assign(
435
+ /* @__PURE__ */ G(
436
+ ({
437
+ visible: n,
438
+ onAcceptAll: t,
439
+ onRejectAll: a,
440
+ onSave: r,
441
+ categories: s = ["necessary", "analytics", "marketing", "preferences"],
442
+ defaults: i,
443
+ position: d = "bottom",
444
+ size: h = "md",
445
+ policyUrl: m,
446
+ showDetails: f = !1,
447
+ className: b,
448
+ style: p,
449
+ id: w,
450
+ ...g
451
+ }, N) => {
452
+ const u = Y(w), { t: c } = P(), [T, v] = y(!0), k = n ?? T, [$, D] = y(f), [l, C] = y(() => {
453
+ const _ = {
454
+ necessary: !0,
455
+ analytics: !1,
456
+ marketing: !1,
457
+ preferences: !1
458
+ };
459
+ return i && Object.assign(_, i), _.necessary = !0, _;
460
+ }), L = {
461
+ necessary: c("cookie.necessary", "Necessary"),
462
+ analytics: c("cookie.analytics", "Analytics"),
463
+ marketing: c("cookie.marketing", "Marketing"),
464
+ preferences: c("cookie.preferences", "Preferences")
465
+ }, x = {
466
+ necessary: c(
467
+ "cookie.necessaryDesc",
468
+ "Required for the website to function. Cannot be disabled."
469
+ ),
470
+ analytics: c(
471
+ "cookie.analyticsDesc",
472
+ "Help us understand how visitors interact with the website."
473
+ ),
474
+ marketing: c("cookie.marketingDesc", "Used to deliver relevant advertisements."),
475
+ preferences: c("cookie.preferencesDesc", "Allow the website to remember your choices.")
476
+ }, O = E(() => {
477
+ const _ = {
478
+ necessary: !0,
479
+ analytics: !0,
480
+ marketing: !0,
481
+ preferences: !0
482
+ };
483
+ t?.(), r?.(_), v(!1);
484
+ }, [t, r]), R = E(() => {
485
+ const _ = {
486
+ necessary: !0,
487
+ analytics: !1,
488
+ marketing: !1,
489
+ preferences: !1
490
+ };
491
+ a?.(), r?.(_), v(!1);
492
+ }, [a, r]), A = E(() => {
493
+ r?.({ ...l, necessary: !0 }), v(!1);
494
+ }, [l, r]);
495
+ return k ? /* @__PURE__ */ e(
496
+ "div",
497
+ {
498
+ ref: N,
499
+ id: u,
500
+ className: `nice-cookie-consent nice-cookie-consent--${d} nice-cookie-consent--${h} ${b ?? ""}`,
501
+ style: p,
502
+ role: "dialog",
503
+ "aria-label": c("cookie.label", "Cookie Consent"),
504
+ "aria-modal": "true",
505
+ ...g,
506
+ children: /* @__PURE__ */ o("div", { className: "nice-cookie-consent__content", children: [
507
+ /* @__PURE__ */ o("p", { className: "nice-cookie-consent__message", children: [
508
+ c(
509
+ "cookie.message",
510
+ "We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies."
511
+ ),
512
+ m && /* @__PURE__ */ o(M, { children: [
513
+ " ",
514
+ /* @__PURE__ */ e(
515
+ "a",
516
+ {
517
+ href: m,
518
+ className: "nice-cookie-consent__link",
519
+ target: "_blank",
520
+ rel: "noopener noreferrer",
521
+ children: c("cookie.learnMore", "Learn more")
522
+ }
523
+ )
524
+ ] })
525
+ ] }),
526
+ $ && /* @__PURE__ */ e("div", { className: "nice-cookie-consent__details", children: s.map((_) => /* @__PURE__ */ o("label", { className: "nice-cookie-consent__category", children: [
527
+ /* @__PURE__ */ e(
528
+ "input",
529
+ {
530
+ type: "checkbox",
531
+ checked: l[_],
532
+ disabled: _ === "necessary",
533
+ onChange: (B) => C((j) => ({ ...j, [_]: B.target.checked })),
534
+ className: "nice-cookie-consent__checkbox"
535
+ }
536
+ ),
537
+ /* @__PURE__ */ o("div", { className: "nice-cookie-consent__cat-info", children: [
538
+ /* @__PURE__ */ e("strong", { children: L[_] }),
539
+ /* @__PURE__ */ e("span", { className: "nice-cookie-consent__cat-desc", children: x[_] })
540
+ ] })
541
+ ] }, _)) }),
542
+ /* @__PURE__ */ o("div", { className: "nice-cookie-consent__actions", children: [
543
+ !$ && /* @__PURE__ */ e(
544
+ "button",
545
+ {
546
+ type: "button",
547
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--details",
548
+ onClick: () => D(!0),
549
+ children: c("cookie.customize", "Customize")
550
+ }
551
+ ),
552
+ $ && /* @__PURE__ */ e(
553
+ "button",
554
+ {
555
+ type: "button",
556
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--save",
557
+ onClick: A,
558
+ children: c("cookie.savePreferences", "Save preferences")
559
+ }
560
+ ),
561
+ /* @__PURE__ */ e(
562
+ "button",
563
+ {
564
+ type: "button",
565
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--reject",
566
+ onClick: R,
567
+ children: c("cookie.rejectAll", "Reject all")
568
+ }
569
+ ),
570
+ /* @__PURE__ */ e(
571
+ "button",
572
+ {
573
+ type: "button",
574
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--accept",
575
+ onClick: O,
576
+ children: c("cookie.acceptAll", "Accept all")
577
+ }
578
+ )
579
+ ] })
580
+ ] })
581
+ }
582
+ ) : null;
583
+ }
584
+ ),
585
+ { displayName: "NiceCookieConsent" }
586
+ ), ke = /* @__PURE__ */ Object.assign(
587
+ /* @__PURE__ */ G(
588
+ ({
589
+ onSubmit: n,
590
+ onForgotPassword: t,
591
+ onRegister: a,
592
+ loading: r = !1,
593
+ error: s,
594
+ variant: i = "primary",
595
+ size: d = "md",
596
+ showRememberMe: h = !0,
597
+ showForgotPassword: m = !0,
598
+ showRegister: f = !1,
599
+ title: b,
600
+ logo: p,
601
+ usernameLabel: w,
602
+ passwordLabel: g,
603
+ usernamePlaceholder: N,
604
+ passwordPlaceholder: u,
605
+ className: c,
606
+ style: T,
607
+ id: v,
608
+ ...k
609
+ }, $) => {
610
+ const D = Y(v), { t: l } = P(), [C, L] = y(""), [x, O] = y(""), [R, A] = y(!1), [_, B] = y(!1), j = `${D}-user`, V = `${D}-pass`, W = `${D}-remember`, K = E(
611
+ (S) => {
612
+ S.preventDefault(), !r && n?.({ username: C, password: x, rememberMe: R });
613
+ },
614
+ [r, C, x, R, n]
615
+ );
616
+ return /* @__PURE__ */ o(
617
+ "form",
618
+ {
619
+ ref: $,
620
+ id: D,
621
+ className: `nice-login nice-login--${i} nice-login--${d} ${c ?? ""}`,
622
+ style: T,
623
+ onSubmit: K,
624
+ noValidate: !0,
625
+ ...k,
626
+ children: [
627
+ p && /* @__PURE__ */ e("div", { className: "nice-login__logo", children: p }),
628
+ b && /* @__PURE__ */ e("h2", { className: "nice-login__title", children: b ?? l("login.title", "Sign In") }),
629
+ s && /* @__PURE__ */ e("div", { className: "nice-login__error", role: "alert", children: s }),
630
+ /* @__PURE__ */ o("div", { className: "nice-login__field", children: [
631
+ /* @__PURE__ */ e("label", { htmlFor: j, className: "nice-login__label", children: w ?? l("login.username", "Username") }),
632
+ /* @__PURE__ */ e(
633
+ "input",
634
+ {
635
+ id: j,
636
+ className: "nice-login__input",
637
+ type: "text",
638
+ value: C,
639
+ onChange: (S) => L(S.target.value),
640
+ placeholder: N ?? l("login.usernamePlaceholder", "Enter your username"),
641
+ autoComplete: "username",
642
+ required: !0,
643
+ disabled: r,
644
+ "aria-required": "true"
645
+ }
646
+ )
647
+ ] }),
648
+ /* @__PURE__ */ o("div", { className: "nice-login__field", children: [
649
+ /* @__PURE__ */ e("label", { htmlFor: V, className: "nice-login__label", children: g ?? l("login.password", "Password") }),
650
+ /* @__PURE__ */ o("div", { className: "nice-login__password-wrap", children: [
651
+ /* @__PURE__ */ e(
652
+ "input",
653
+ {
654
+ id: V,
655
+ className: "nice-login__input",
656
+ type: _ ? "text" : "password",
657
+ value: x,
658
+ onChange: (S) => O(S.target.value),
659
+ placeholder: u ?? l("login.passwordPlaceholder", "Enter your password"),
660
+ autoComplete: "current-password",
661
+ required: !0,
662
+ disabled: r,
663
+ "aria-required": "true"
664
+ }
665
+ ),
666
+ /* @__PURE__ */ e(
667
+ "button",
668
+ {
669
+ type: "button",
670
+ className: "nice-login__toggle-password",
671
+ onClick: () => B(!_),
672
+ "aria-label": _ ? l("login.hidePassword", "Hide password") : l("login.showPassword", "Show password"),
673
+ tabIndex: -1,
674
+ children: /* @__PURE__ */ e(I, { name: _ ? "eye-off" : "eye", size: 16 })
675
+ }
676
+ )
677
+ ] })
678
+ ] }),
679
+ /* @__PURE__ */ o("div", { className: "nice-login__options", children: [
680
+ h && /* @__PURE__ */ o("label", { className: "nice-login__remember", htmlFor: W, children: [
681
+ /* @__PURE__ */ e(
682
+ "input",
683
+ {
684
+ id: W,
685
+ type: "checkbox",
686
+ checked: R,
687
+ onChange: (S) => A(S.target.checked),
688
+ disabled: r
689
+ }
690
+ ),
691
+ /* @__PURE__ */ e("span", { children: l("login.rememberMe", "Remember me") })
692
+ ] }),
693
+ m && t && /* @__PURE__ */ e(
694
+ "button",
695
+ {
696
+ type: "button",
697
+ className: "nice-login__forgot",
698
+ onClick: t,
699
+ disabled: r,
700
+ children: l("login.forgotPassword", "Forgot password?")
701
+ }
702
+ )
703
+ ] }),
704
+ /* @__PURE__ */ e(
705
+ "button",
706
+ {
707
+ type: "submit",
708
+ className: `nice-login__submit nice-login__submit--${i}`,
709
+ disabled: r || !C || !x,
710
+ children: r ? l("login.loading", "Signing in...") : l("login.submit", "Sign In")
711
+ }
712
+ ),
713
+ f && a && /* @__PURE__ */ o("p", { className: "nice-login__register", children: [
714
+ l("login.noAccount", "Don't have an account?"),
715
+ " ",
716
+ /* @__PURE__ */ e(
717
+ "button",
718
+ {
719
+ type: "button",
720
+ className: "nice-login__register-link",
721
+ onClick: a,
722
+ disabled: r,
723
+ children: l("login.register", "Register")
724
+ }
725
+ )
726
+ ] })
727
+ ]
728
+ }
729
+ );
730
+ }
731
+ ),
732
+ { displayName: "NiceLoginForm" }
733
+ );
734
+ export {
735
+ he as N,
736
+ ye as a,
737
+ fe as b,
738
+ H as c,
739
+ ke as d,
740
+ pe as e,
741
+ ge as f,
742
+ Ne as g,
743
+ _e as h,
744
+ J as i,
745
+ oe as j,
746
+ be as u
747
+ };