@nice2dev/ui 1.0.16 → 1.0.18

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 (172) hide show
  1. package/CHANGELOG.md +252 -0
  2. package/dist/NiceAlertDialog.doc-BST0-aVs.cjs +14 -0
  3. package/dist/NiceAlertDialog.doc-GRpJU_5Y.js +38 -0
  4. package/dist/NiceAnimatePresence.doc-BrttRpeS.js +36 -0
  5. package/dist/NiceAnimatePresence.doc-IdEWrSnT.cjs +12 -0
  6. package/dist/NiceCalendarScheduler.doc-Cc-DFMhR.js +33 -0
  7. package/dist/NiceCalendarScheduler.doc-TPe0kRBN.cjs +9 -0
  8. package/dist/NiceCameraFeed.doc-BJl0gdWv.js +31 -0
  9. package/dist/NiceCameraFeed.doc-Bt4eZ8MH.cjs +7 -0
  10. package/dist/NiceChip.doc-Bccf4IQe.cjs +7 -0
  11. package/dist/NiceChip.doc-DEsqjL7z.js +31 -0
  12. package/dist/NiceCombobox.doc-8hMzrsdM.js +34 -0
  13. package/dist/NiceCombobox.doc-C5IPnVuz.cjs +10 -0
  14. package/dist/NiceConfigProvider.doc-CKIudO44.js +32 -0
  15. package/dist/NiceConfigProvider.doc-bMLQj3Zx.cjs +8 -0
  16. package/dist/NiceCronEditor.doc-BThdELxx.js +31 -0
  17. package/dist/NiceCronEditor.doc-w_TbOWFo.cjs +7 -0
  18. package/dist/NiceDataList.doc-DHXrpTPT.cjs +9 -0
  19. package/dist/NiceDataList.doc-R8SchHqZ.js +33 -0
  20. package/dist/NiceDiagram.doc-CASS0Tnj.cjs +8 -0
  21. package/dist/NiceDiagram.doc-DGX-Hwhg.js +32 -0
  22. package/dist/NiceDocPage.doc-BVBe27kj.cjs +1 -0
  23. package/dist/NiceDocPage.doc-CDcL3Sqt.js +25 -0
  24. package/dist/NiceDrawingCanvas.doc-DYYFKKMW.js +32 -0
  25. package/dist/NiceDrawingCanvas.doc-wa684gbC.cjs +8 -0
  26. package/dist/NiceDropdown.doc-D2NS9hBT.js +35 -0
  27. package/dist/NiceDropdown.doc-dAgER8da.cjs +11 -0
  28. package/dist/NiceDropzone.doc-CVVNc9SE.cjs +9 -0
  29. package/dist/NiceDropzone.doc-aeajYWqU.js +33 -0
  30. package/dist/NiceEnergyMonitor.doc-BBnVKuwf.js +32 -0
  31. package/dist/NiceEnergyMonitor.doc-lf6CCIYi.cjs +8 -0
  32. package/dist/NiceErrorBoundary-B1Y6X3Ya.js +762 -0
  33. package/dist/NiceErrorBoundary-COY0cEsF.js +762 -0
  34. package/dist/NiceErrorBoundary-CR-_ZScD.cjs +1 -0
  35. package/dist/NiceErrorBoundary-DM5IMdOr.cjs +1 -0
  36. package/dist/NiceExpressionBuilder.doc-CTjqEcZR.cjs +8 -0
  37. package/dist/NiceExpressionBuilder.doc-Cu_ORFhd.js +32 -0
  38. package/dist/NiceFileExplorer.doc-B0aN041v.js +32 -0
  39. package/dist/NiceFileExplorer.doc-DNHYQF_t.cjs +8 -0
  40. package/dist/NiceFloatingActionButton.doc-BOlJwq4S.cjs +7 -0
  41. package/dist/NiceFloatingActionButton.doc-oYnwvMP9.js +31 -0
  42. package/dist/NiceFontPicker.doc-B10vOqeF.cjs +8 -0
  43. package/dist/NiceFontPicker.doc-DuPp0cDP.js +32 -0
  44. package/dist/NiceForm-BSkm9-yP.js +5357 -0
  45. package/dist/NiceForm-COk1rNVa.js +5357 -0
  46. package/dist/NiceForm-CU8Dldq-.cjs +382 -0
  47. package/dist/NiceForm-DDN-yf30.cjs +382 -0
  48. package/dist/NiceGestureHandler.doc-9GGvVnM5.cjs +8 -0
  49. package/dist/NiceGestureHandler.doc-BduQU3SA.js +32 -0
  50. package/dist/NiceHeader.doc-Cxoy_f_k.cjs +6 -0
  51. package/dist/NiceHeader.doc-DjAVl-T4.js +30 -0
  52. package/dist/NiceImage.doc-COy4iVy1.js +34 -0
  53. package/dist/NiceImage.doc-CvnaTRj8.cjs +10 -0
  54. package/dist/NiceInPlaceEditor.doc-8nC6Kqvn.cjs +1 -0
  55. package/dist/NiceInPlaceEditor.doc-gF1XPyu5.js +25 -0
  56. package/dist/NiceInteractiveTimeline.doc-BTeASFR4.js +50 -0
  57. package/dist/NiceInteractiveTimeline.doc-WMOVQhMe.cjs +11 -0
  58. package/dist/NiceJsonEditor.doc-BpVa-AlY.js +31 -0
  59. package/dist/NiceJsonEditor.doc-DeyoVDQw.cjs +7 -0
  60. package/dist/NiceMegaMenu.doc-CO34gN43.cjs +7 -0
  61. package/dist/NiceMegaMenu.doc-DpchTBL6.js +31 -0
  62. package/dist/NiceMentionInput.doc-O0W58Unu.js +32 -0
  63. package/dist/NiceMentionInput.doc-ZSPjBsZc.cjs +8 -0
  64. package/dist/NiceModal-9uxWPAE_.cjs +1 -0
  65. package/dist/NiceModal-BPDP1Fi-.js +95 -0
  66. package/dist/NiceModal-CIITx65V.cjs +1 -0
  67. package/dist/NiceModal-CN23FZsc.js +95 -0
  68. package/dist/NiceModuleLifecyclePanel-BDnsr5ZW.js +6349 -0
  69. package/dist/NiceModuleLifecyclePanel-DF0Ay1oH.js +6349 -0
  70. package/dist/NiceModuleLifecyclePanel-F1uN0gMh.cjs +1 -0
  71. package/dist/NiceModuleLifecyclePanel-g_ZVFzoE.cjs +1 -0
  72. package/dist/NiceMotion.doc-COF5BldG.cjs +9 -0
  73. package/dist/NiceMotion.doc-utheTBgM.js +33 -0
  74. package/dist/NiceMultiColumnComboBox.doc-Ben0Q0J0.cjs +1 -0
  75. package/dist/NiceMultiColumnComboBox.doc-CK1DppZI.js +25 -0
  76. package/dist/NiceNotificationList.doc-CBWusjJX.cjs +7 -0
  77. package/dist/NiceNotificationList.doc-D7lQIxK0.js +31 -0
  78. package/dist/NiceOfflineSync.doc-BLQFyOf2.cjs +8 -0
  79. package/dist/NiceOfflineSync.doc-CKWFmR3b.js +32 -0
  80. package/dist/NicePagination-B4U0LwZy.js +171 -0
  81. package/dist/NicePagination-CGQf54a9.cjs +1 -0
  82. package/dist/NicePagination-D829pF7A.cjs +1 -0
  83. package/dist/NicePagination-D89Kst8b.js +171 -0
  84. package/dist/NicePinCodeInput-Bf_QcaPW.cjs +419 -0
  85. package/dist/NicePinCodeInput-Co42gC9R.js +11875 -0
  86. package/dist/NicePinCodeInput-DG_-eXXJ.cjs +419 -0
  87. package/dist/NicePinCodeInput-g-yUiepm.js +11875 -0
  88. package/dist/NicePreview.doc-Cl7_5MVR.js +30 -0
  89. package/dist/NicePreview.doc-atKISvmp.cjs +6 -0
  90. package/dist/NicePropertyGrid.doc-D6xljYe1.cjs +7 -0
  91. package/dist/NicePropertyGrid.doc-nX2etusg.js +31 -0
  92. package/dist/NiceRadio.doc-BTURz62X.js +27 -0
  93. package/dist/NiceRadio.doc-Cc8-1vbn.cjs +3 -0
  94. package/dist/NiceRecurrencePicker.doc-78HjPJm0.js +31 -0
  95. package/dist/NiceRecurrencePicker.doc-vC2YmCXF.cjs +7 -0
  96. package/dist/NiceRichTextEditor.doc-ClPCkzCd.cjs +6 -0
  97. package/dist/NiceRichTextEditor.doc-CtmV9UvX.js +30 -0
  98. package/dist/NiceSavedQueryPanel-BuvMBwIf.cjs +596 -0
  99. package/dist/NiceSavedQueryPanel-CE3QR4RY.js +6446 -0
  100. package/dist/NiceSavedQueryPanel-DR-j6eA5.js +6446 -0
  101. package/dist/NiceSavedQueryPanel-DSnj-3Es.cjs +596 -0
  102. package/dist/NiceSceneSelector.doc-CY2OmaWQ.cjs +7 -0
  103. package/dist/NiceSceneSelector.doc-UsVgDrw1.js +31 -0
  104. package/dist/NiceScrollArea.doc-C6Y-odUa.js +27 -0
  105. package/dist/NiceScrollArea.doc-LdxDrGDY.cjs +3 -0
  106. package/dist/NiceSheet.doc-CsIu3Y1G.cjs +11 -0
  107. package/dist/NiceSheet.doc-DLfSY-MA.js +35 -0
  108. package/dist/NiceSpeedDial.doc-CSWvNR9n.cjs +7 -0
  109. package/dist/NiceSpeedDial.doc-DqnpBcMy.js +31 -0
  110. package/dist/NiceSplitPane.doc-Ck_FvdL6.cjs +9 -0
  111. package/dist/NiceSplitPane.doc-Di68JZuy.js +33 -0
  112. package/dist/NiceSpotlight.doc-CM4PnsHE.js +34 -0
  113. package/dist/NiceSpotlight.doc-Dm_B-kUJ.cjs +10 -0
  114. package/dist/NiceStepNavigation.doc-DXraCs7t.js +31 -0
  115. package/dist/NiceStepNavigation.doc-TSy2dWmf.cjs +7 -0
  116. package/dist/NiceSteps.doc-C_mkhnez.cjs +10 -0
  117. package/dist/NiceSteps.doc-PW1zubHM.js +34 -0
  118. package/dist/NiceSwitch.doc-CLc7OxrE.cjs +6 -0
  119. package/dist/NiceSwitch.doc-dGMMY4es.js +30 -0
  120. package/dist/NiceTabs-32xjguOv.cjs +1 -0
  121. package/dist/NiceTabs-B6E7-er3.cjs +1 -0
  122. package/dist/NiceTabs-Blk0h4jY.js +1624 -0
  123. package/dist/NiceTabs-J2zAw8vC.js +1624 -0
  124. package/dist/NiceTransition.doc-BmImVoB8.js +35 -0
  125. package/dist/NiceTransition.doc-GA1N91ON.cjs +11 -0
  126. package/dist/NiceTree.doc-D7SCXljC.js +40 -0
  127. package/dist/NiceTree.doc-DZx3hUwY.cjs +16 -0
  128. package/dist/NiceUnitConverter.doc-DmiyYOH_.cjs +10 -0
  129. package/dist/NiceUnitConverter.doc-YnzD3uKT.js +34 -0
  130. package/dist/NiceVirtualGrid.doc-DI2c9ckY.js +35 -0
  131. package/dist/NiceVirtualGrid.doc-rtwudxTG.cjs +11 -0
  132. package/dist/NiceVirtualList.doc-BpoTiXoV.js +31 -0
  133. package/dist/NiceVirtualList.doc-C8q-Hfl0.cjs +7 -0
  134. package/dist/NiceWindow-6F_z4_18.js +1409 -0
  135. package/dist/NiceWindow-B4jA_-hi.js +1409 -0
  136. package/dist/NiceWindow-Bnh6rKt4.cjs +1 -0
  137. package/dist/NiceWindow-UpKllge7.cjs +1 -0
  138. package/dist/charts-0BEMJ0Xt.js +4657 -0
  139. package/dist/charts-CbxmU6Z2.cjs +761 -0
  140. package/dist/charts-DXkFBiD4.cjs +761 -0
  141. package/dist/charts-SHnY1_oD.js +4645 -0
  142. package/dist/charts.cjs +1 -1
  143. package/dist/charts.d.ts +19 -19
  144. package/dist/charts.mjs +1 -1
  145. package/dist/core-BIA5_uSq.js +22316 -0
  146. package/dist/core-DQYnL6uf.cjs +96 -0
  147. package/dist/core-Dpfb_THi.js +22316 -0
  148. package/dist/core-DqlrEV-9.cjs +96 -0
  149. package/dist/data.cjs +1 -1
  150. package/dist/data.mjs +1 -1
  151. package/dist/editors.cjs +1 -1
  152. package/dist/editors.mjs +3 -3
  153. package/dist/feedback.cjs +1 -1
  154. package/dist/feedback.d.ts +10 -10
  155. package/dist/feedback.mjs +2 -2
  156. package/dist/index-BjBsn6ad.cjs +5194 -0
  157. package/dist/index-C2Uoywo9.js +63852 -0
  158. package/dist/index-GIkNMdRp.js +61439 -0
  159. package/dist/index-pQGuLKEE.cjs +5194 -0
  160. package/dist/index.cjs +1 -1
  161. package/dist/index.css +1 -1
  162. package/dist/index.d.ts +1631 -53
  163. package/dist/index.mjs +943 -895
  164. package/dist/lazy.cjs +1 -1
  165. package/dist/lazy.d.ts +4 -3
  166. package/dist/lazy.mjs +3 -3
  167. package/dist/navigation.cjs +1 -1
  168. package/dist/navigation.mjs +4 -4
  169. package/dist/overlays.cjs +1 -1
  170. package/dist/overlays.mjs +2 -2
  171. package/dist/style.css +22 -7
  172. package/package.json +3 -3
@@ -0,0 +1,762 @@
1
+ import { jsx as e, jsxs as a, Fragment as F } from "react/jsx-runtime";
2
+ import { l as Y, c as Q, $ as P, A as X, k as W } from "./core-BIA5_uSq.js";
3
+ import V, { useRef as I, useEffect as S, useState as y, useCallback as L, useSyncExternalStore as Z, forwardRef as G, Component as ee } from "react";
4
+ const J = {
5
+ info: /* @__PURE__ */ e("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z", clipRule: "evenodd" }) }),
6
+ success: /* @__PURE__ */ e("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z", clipRule: "evenodd" }) }),
7
+ warning: /* @__PURE__ */ e("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e("path", { fillRule: "evenodd", d: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z", clipRule: "evenodd" }) }),
8
+ error: /* @__PURE__ */ e("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z", clipRule: "evenodd" }) })
9
+ }, he = ({
10
+ variant: n = "info",
11
+ title: t,
12
+ children: s,
13
+ closable: r,
14
+ onClose: i,
15
+ icon: c,
16
+ size: l = "md",
17
+ className: m,
18
+ style: d,
19
+ displayStyle: p
20
+ }) => {
21
+ const h = Y("card", p);
22
+ return /* @__PURE__ */ a(
23
+ "div",
24
+ {
25
+ className: `nice-alert nice-alert--${n} nice-alert--${l} nice-alert--ds-${h} ${m || ""}`,
26
+ style: d,
27
+ role: "alert",
28
+ children: [
29
+ /* @__PURE__ */ e("div", { className: `nice-alert__icon nice-alert__icon--${n}`, children: c || J[n] }),
30
+ /* @__PURE__ */ a("div", { className: "nice-alert__content", children: [
31
+ t && /* @__PURE__ */ e("div", { className: "nice-alert__title", children: t }),
32
+ /* @__PURE__ */ e("div", { children: s })
33
+ ] }),
34
+ r && /* @__PURE__ */ e("button", { type: "button", className: "nice-alert__close", onClick: i, "aria-label": "Close", children: "✕" })
35
+ ]
36
+ }
37
+ );
38
+ }, fe = ({
39
+ open: n,
40
+ onClose: t,
41
+ title: s,
42
+ position: r = "right",
43
+ size: i = "md",
44
+ children: c,
45
+ footer: l,
46
+ transitionDuration: m,
47
+ className: d,
48
+ style: p,
49
+ displayStyle: h
50
+ }) => {
51
+ const v = Q("modal", h), g = Y("modal", h), { t: f } = P(), N = I(null);
52
+ return X(N, n), S(() => {
53
+ if (!n)
54
+ return;
55
+ const b = (o) => {
56
+ o.key === "Escape" && t();
57
+ };
58
+ return document.addEventListener("keydown", b), document.body.style.overflow = "hidden", () => {
59
+ document.removeEventListener("keydown", b), document.body.style.overflow = "";
60
+ };
61
+ }, [n, t]), n ? /* @__PURE__ */ a(F, { children: [
62
+ /* @__PURE__ */ e("div", { className: "nice-drawer-overlay", onClick: t }),
63
+ /* @__PURE__ */ a(
64
+ "div",
65
+ {
66
+ ref: N,
67
+ className: `nice-drawer nice-drawer--${r} nice-drawer--${i} nice-drawer--ds-${g} ${d || ""}`,
68
+ style: {
69
+ ...v,
70
+ ...p,
71
+ ...m != null ? { transitionDuration: `${m}ms` } : {}
72
+ },
73
+ role: "dialog",
74
+ "aria-modal": "true",
75
+ "aria-label": s,
76
+ children: [
77
+ s && /* @__PURE__ */ a("div", { className: "nice-drawer__header", children: [
78
+ /* @__PURE__ */ e("h3", { className: "nice-drawer__title", children: s }),
79
+ /* @__PURE__ */ e(
80
+ "button",
81
+ {
82
+ type: "button",
83
+ className: "nice-drawer__close",
84
+ onClick: t,
85
+ "aria-label": f("controls.close", "Close"),
86
+ 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" }) })
87
+ }
88
+ )
89
+ ] }),
90
+ /* @__PURE__ */ e("div", { className: "nice-drawer__body", children: c }),
91
+ l && /* @__PURE__ */ e("div", { className: "nice-drawer__footer", children: l })
92
+ ]
93
+ }
94
+ )
95
+ ] }) : null;
96
+ }, _e = ({
97
+ toasts: n,
98
+ onDismiss: t,
99
+ position: s = "top-right"
100
+ }) => /* @__PURE__ */ e("div", { className: `nice-toast-container nice-toast-container--${s}`, children: n.map((r) => /* @__PURE__ */ e(ne, { toast: r, onDismiss: t }, r.id)) }), ne = ({
101
+ toast: n,
102
+ onDismiss: t
103
+ }) => {
104
+ const [s, r] = y(!1);
105
+ return S(() => {
106
+ if (!n.duration && n.duration !== 0) {
107
+ const i = setTimeout(() => r(!0), 4e3);
108
+ return () => clearTimeout(i);
109
+ }
110
+ if (n.duration > 0) {
111
+ const i = setTimeout(() => r(!0), n.duration);
112
+ return () => clearTimeout(i);
113
+ }
114
+ }, [n.duration]), S(() => {
115
+ if (s) {
116
+ const i = setTimeout(() => t(n.id), 200);
117
+ return () => clearTimeout(i);
118
+ }
119
+ }, [s, n.id, t]), /* @__PURE__ */ a(
120
+ "div",
121
+ {
122
+ className: `nice-toast nice-toast--${n.variant} ${s ? "nice-toast--exiting" : ""}`,
123
+ role: "alert",
124
+ style: { position: "relative" },
125
+ children: [
126
+ /* @__PURE__ */ e("div", { className: "nice-toast__icon", children: J[n.variant] }),
127
+ /* @__PURE__ */ a("div", { className: "nice-toast__content", children: [
128
+ n.title && /* @__PURE__ */ e("div", { className: "nice-toast__title", children: n.title }),
129
+ /* @__PURE__ */ e("div", { className: "nice-toast__message", children: n.message })
130
+ ] }),
131
+ /* @__PURE__ */ e("button", { type: "button", className: "nice-toast__close", onClick: () => r(!0), children: "✕" })
132
+ ]
133
+ }
134
+ );
135
+ };
136
+ let ie = 0;
137
+ function be() {
138
+ const [n, t] = y([]), s = L(
139
+ (i, c, l) => {
140
+ const m = `toast-${++ie}`;
141
+ return t((d) => [
142
+ ...d,
143
+ { id: m, variant: i, message: c, title: l?.title, duration: l?.duration }
144
+ ]), m;
145
+ },
146
+ []
147
+ ), r = L((i) => {
148
+ t((c) => c.filter((l) => l.id !== i));
149
+ }, []);
150
+ return {
151
+ toasts: n,
152
+ dismiss: r,
153
+ info: (i, c) => s("info", i, c),
154
+ success: (i, c) => s("success", i, c),
155
+ warning: (i, c) => s("warning", i, c),
156
+ error: (i, c) => s("error", i, c)
157
+ };
158
+ }
159
+ const te = {
160
+ info: /* @__PURE__ */ e("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" }) }),
161
+ warning: /* @__PURE__ */ e("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" }) }),
162
+ error: /* @__PURE__ */ e("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" }) }),
163
+ success: /* @__PURE__ */ e("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" }) })
164
+ }, pe = ({
165
+ visible: n,
166
+ message: t,
167
+ header: s,
168
+ icon: r,
169
+ variant: i = "warning",
170
+ acceptLabel: c,
171
+ rejectLabel: l,
172
+ onAccept: m,
173
+ onReject: d,
174
+ closeOnOverlay: p = !1,
175
+ closeOnEscape: h = !0,
176
+ size: v = "md",
177
+ className: g,
178
+ style: f
179
+ }) => {
180
+ const { t: N } = P();
181
+ if (V.useEffect(() => {
182
+ if (!n || !h)
183
+ return;
184
+ const k = (w) => {
185
+ w.key === "Escape" && d();
186
+ };
187
+ return document.addEventListener("keydown", k), () => document.removeEventListener("keydown", k);
188
+ }, [n, h, d]), V.useEffect(() => (n ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
189
+ document.body.style.overflow = "";
190
+ }), [n]), !n)
191
+ return null;
192
+ const b = r ?? te[i], o = c ?? N("confirm.accept", "Yes"), $ = l ?? N("confirm.reject", "No");
193
+ return /* @__PURE__ */ e("div", { className: "nice-modal-overlay", onClick: p ? d : void 0, children: /* @__PURE__ */ a(
194
+ "div",
195
+ {
196
+ className: `nice-confirm nice-confirm--${i} nice-confirm--${v} ${g || ""}`,
197
+ style: f,
198
+ role: "alertdialog",
199
+ "aria-modal": "true",
200
+ "aria-label": s,
201
+ "aria-describedby": "nice-confirm-message",
202
+ onClick: (k) => k.stopPropagation(),
203
+ children: [
204
+ s && /* @__PURE__ */ e("div", { className: "nice-confirm__header", children: /* @__PURE__ */ e("h3", { className: "nice-confirm__title", children: s }) }),
205
+ /* @__PURE__ */ a("div", { className: "nice-confirm__body", children: [
206
+ b && /* @__PURE__ */ e("div", { className: `nice-confirm__icon nice-confirm__icon--${i}`, children: b }),
207
+ /* @__PURE__ */ e("div", { id: "nice-confirm-message", className: "nice-confirm__message", children: t })
208
+ ] }),
209
+ /* @__PURE__ */ a("div", { className: "nice-confirm__footer", children: [
210
+ /* @__PURE__ */ e(
211
+ "button",
212
+ {
213
+ type: "button",
214
+ className: "nice-btn nice-btn--ghost nice-btn--md",
215
+ onClick: d,
216
+ children: $
217
+ }
218
+ ),
219
+ /* @__PURE__ */ e(
220
+ "button",
221
+ {
222
+ type: "button",
223
+ className: `nice-btn nice-btn--${i === "error" ? "error" : "primary"} nice-btn--md`,
224
+ onClick: m,
225
+ autoFocus: !0,
226
+ children: o
227
+ }
228
+ )
229
+ ] })
230
+ ]
231
+ }
232
+ ) });
233
+ }, ge = ({
234
+ error: n,
235
+ onRetry: t,
236
+ retryLabel: s = "Retry",
237
+ title: r = "Operation failed",
238
+ autoRetrySeconds: i,
239
+ variant: c = "error",
240
+ icon: l,
241
+ size: m = "md",
242
+ className: d,
243
+ style: p,
244
+ "data-testid": h
245
+ }) => {
246
+ const [v, g] = y(i ?? 0), f = I(), N = typeof n == "string" ? n : n.message, b = L(() => {
247
+ g(i ?? 0), t();
248
+ }, [t, i]);
249
+ return S(() => {
250
+ if (!(!i || i <= 0))
251
+ return g(i), f.current = setInterval(() => {
252
+ g((o) => o <= 1 ? (clearInterval(f.current), t(), 0) : o - 1);
253
+ }, 1e3), () => clearInterval(f.current);
254
+ }, [i, t]), /* @__PURE__ */ a(
255
+ "div",
256
+ {
257
+ className: `nice-retry-panel nice-retry-panel--${c} nice-retry-panel--${m} ${d || ""}`,
258
+ style: p,
259
+ role: "alert",
260
+ "data-testid": h,
261
+ children: [
262
+ /* @__PURE__ */ e("div", { className: "nice-retry-panel__icon", children: l ?? "⚠️" }),
263
+ /* @__PURE__ */ a("div", { className: "nice-retry-panel__content", children: [
264
+ /* @__PURE__ */ e("div", { className: "nice-retry-panel__title", children: r }),
265
+ /* @__PURE__ */ e("p", { className: "nice-retry-panel__message", children: N })
266
+ ] }),
267
+ /* @__PURE__ */ a("div", { className: "nice-retry-panel__actions", children: [
268
+ /* @__PURE__ */ e(
269
+ "button",
270
+ {
271
+ type: "button",
272
+ className: "nice-btn nice-btn--primary nice-btn--sm",
273
+ onClick: b,
274
+ children: s
275
+ }
276
+ ),
277
+ i && v > 0 && /* @__PURE__ */ a("span", { className: "nice-retry-panel__countdown", children: [
278
+ "Auto-retry in ",
279
+ v,
280
+ "s"
281
+ ] })
282
+ ] })
283
+ ]
284
+ }
285
+ );
286
+ };
287
+ function re(n) {
288
+ return window.addEventListener("online", n), window.addEventListener("offline", n), () => {
289
+ window.removeEventListener("online", n), window.removeEventListener("offline", n);
290
+ };
291
+ }
292
+ function se() {
293
+ return navigator.onLine;
294
+ }
295
+ function ce() {
296
+ return !0;
297
+ }
298
+ const ve = ({
299
+ message: n = "You are offline. Some features may be unavailable.",
300
+ variant: t = "warning",
301
+ icon: s,
302
+ size: r = "md",
303
+ className: i,
304
+ style: c,
305
+ "data-testid": l
306
+ }) => Z(re, se, ce) ? null : /* @__PURE__ */ a(
307
+ "div",
308
+ {
309
+ className: `nice-offline-banner nice-offline-banner--${t} nice-offline-banner--${r} ${i || ""}`,
310
+ style: c,
311
+ role: "alert",
312
+ "aria-live": "assertive",
313
+ "data-testid": l,
314
+ children: [
315
+ /* @__PURE__ */ e("span", { className: "nice-offline-banner__icon", children: s ?? "📡" }),
316
+ /* @__PURE__ */ e("span", { className: "nice-offline-banner__message", children: n })
317
+ ]
318
+ }
319
+ );
320
+ function ae({
321
+ timeoutMs: n = 1e4,
322
+ slowThresholdMs: t = 3e3,
323
+ onTimeout: s,
324
+ autoRetry: r = !1,
325
+ autoRetryCount: i = 3
326
+ } = {}) {
327
+ const [c, l] = y(!1), [m, d] = y(!1), [p, h] = y(!1), [v, g] = y(0), [f, N] = y(0), b = I(null), o = I(null), $ = I(null), k = I(0), w = L(() => {
328
+ b.current && clearTimeout(b.current), o.current && clearTimeout(o.current), $.current && clearInterval($.current);
329
+ }, []), C = L(() => {
330
+ w(), l(!0), d(!1), h(!1), g(0), k.current = Date.now(), $.current = setInterval(() => {
331
+ g(Date.now() - k.current);
332
+ }, 200), b.current = setTimeout(() => {
333
+ d(!0);
334
+ }, t), o.current = setTimeout(() => {
335
+ h(!0), l(!1), d(!1), w(), s?.();
336
+ }, n);
337
+ }, [w, t, n, s]), T = L(() => {
338
+ w(), l(!1), d(!1);
339
+ }, [w]), u = L(() => {
340
+ N((z) => z + 1), h(!1), C();
341
+ }, [C]);
342
+ return S(() => () => w(), [w]), S(() => {
343
+ if (r && p && f < i) {
344
+ const z = Math.pow(2, f) * 1e3, D = setTimeout(() => u(), z);
345
+ return () => clearTimeout(D);
346
+ }
347
+ }, [r, i, p, f, u]), { isLoading: c, isSlow: m, isTimedOut: p, elapsed: v, retryCount: f, start: C, stop: T, retry: u };
348
+ }
349
+ const Ne = ({
350
+ timeoutMs: n = 1e4,
351
+ slowThresholdMs: t = 3e3,
352
+ onTimeout: s,
353
+ onRetry: r,
354
+ autoRetry: i = !1,
355
+ autoRetryCount: c = 3,
356
+ showProgress: l = !0,
357
+ slowMessage: m = "Operacja trwa dłużej niż zwykle…",
358
+ timeoutMessage: d = "Przekroczono limit czasu. Spróbuj ponownie.",
359
+ loading: p,
360
+ children: h,
361
+ size: v = "md",
362
+ className: g,
363
+ style: f,
364
+ "data-testid": N
365
+ }) => {
366
+ const { isSlow: b, isTimedOut: o, elapsed: $, retry: k } = ae({
367
+ timeoutMs: n,
368
+ slowThresholdMs: t,
369
+ onTimeout: s,
370
+ autoRetry: i,
371
+ autoRetryCount: c
372
+ }), w = () => {
373
+ k(), r?.();
374
+ };
375
+ if (!p)
376
+ return /* @__PURE__ */ e(F, { children: h });
377
+ if (o)
378
+ return /* @__PURE__ */ a(
379
+ "div",
380
+ {
381
+ className: `nice-timeout-feedback nice-timeout-feedback--timeout nice-timeout-feedback--${v} ${g ?? ""}`,
382
+ style: f,
383
+ role: "alert",
384
+ "data-testid": N,
385
+ children: [
386
+ /* @__PURE__ */ e("p", { className: "nice-timeout-feedback__message", children: d }),
387
+ /* @__PURE__ */ e("button", { className: "nice-timeout-feedback__retry-btn", onClick: w, type: "button", children: "Spróbuj ponownie" })
388
+ ]
389
+ }
390
+ );
391
+ const C = Math.min(100, $ / n * 100);
392
+ return /* @__PURE__ */ a(
393
+ "div",
394
+ {
395
+ className: `nice-timeout-feedback nice-timeout-feedback--${v} ${b ? "nice-timeout-feedback--slow" : ""} ${g ?? ""}`,
396
+ style: f,
397
+ "data-testid": N,
398
+ children: [
399
+ /* @__PURE__ */ e("div", { className: "nice-timeout-feedback__spinner", "aria-busy": "true" }),
400
+ b && /* @__PURE__ */ e("p", { className: "nice-timeout-feedback__slow-msg", children: m }),
401
+ l && /* @__PURE__ */ e(
402
+ "div",
403
+ {
404
+ className: "nice-timeout-feedback__progress",
405
+ role: "progressbar",
406
+ "aria-valuenow": C,
407
+ "aria-valuemin": 0,
408
+ "aria-valuemax": 100,
409
+ children: /* @__PURE__ */ e(
410
+ "div",
411
+ {
412
+ className: "nice-timeout-feedback__progress-bar",
413
+ style: { width: `${C}%` }
414
+ }
415
+ )
416
+ }
417
+ )
418
+ ]
419
+ }
420
+ );
421
+ }, oe = G(
422
+ ({
423
+ visible: n,
424
+ onAcceptAll: t,
425
+ onRejectAll: s,
426
+ onSave: r,
427
+ categories: i = ["necessary", "analytics", "marketing", "preferences"],
428
+ defaults: c,
429
+ position: l = "bottom",
430
+ size: m = "md",
431
+ policyUrl: d,
432
+ showDetails: p = !1,
433
+ className: h,
434
+ style: v,
435
+ id: g,
436
+ ...f
437
+ }, N) => {
438
+ const b = W(g), { t: o } = P(), [$, k] = y(!0), w = n ?? $, [C, T] = y(p), [u, z] = y(() => {
439
+ const _ = {
440
+ necessary: !0,
441
+ analytics: !1,
442
+ marketing: !1,
443
+ preferences: !1
444
+ };
445
+ return c && Object.assign(_, c), _.necessary = !0, _;
446
+ }), D = {
447
+ necessary: o("cookie.necessary", "Necessary"),
448
+ analytics: o("cookie.analytics", "Analytics"),
449
+ marketing: o("cookie.marketing", "Marketing"),
450
+ preferences: o("cookie.preferences", "Preferences")
451
+ }, E = {
452
+ necessary: o(
453
+ "cookie.necessaryDesc",
454
+ "Required for the website to function. Cannot be disabled."
455
+ ),
456
+ analytics: o(
457
+ "cookie.analyticsDesc",
458
+ "Help us understand how visitors interact with the website."
459
+ ),
460
+ marketing: o("cookie.marketingDesc", "Used to deliver relevant advertisements."),
461
+ preferences: o("cookie.preferencesDesc", "Allow the website to remember your choices.")
462
+ }, R = L(() => {
463
+ const _ = {
464
+ necessary: !0,
465
+ analytics: !0,
466
+ marketing: !0,
467
+ preferences: !0
468
+ };
469
+ t?.(), r?.(_), k(!1);
470
+ }, [t, r]), M = L(() => {
471
+ const _ = {
472
+ necessary: !0,
473
+ analytics: !1,
474
+ marketing: !1,
475
+ preferences: !1
476
+ };
477
+ s?.(), r?.(_), k(!1);
478
+ }, [s, r]), j = L(() => {
479
+ r?.({ ...u, necessary: !0 }), k(!1);
480
+ }, [u, r]);
481
+ return w ? /* @__PURE__ */ e(
482
+ "div",
483
+ {
484
+ ref: N,
485
+ id: b,
486
+ className: `nice-cookie-consent nice-cookie-consent--${l} nice-cookie-consent--${m} ${h ?? ""}`,
487
+ style: v,
488
+ role: "dialog",
489
+ "aria-label": o("cookie.label", "Cookie Consent"),
490
+ "aria-modal": "true",
491
+ ...f,
492
+ children: /* @__PURE__ */ a("div", { className: "nice-cookie-consent__content", children: [
493
+ /* @__PURE__ */ a("p", { className: "nice-cookie-consent__message", children: [
494
+ o(
495
+ "cookie.message",
496
+ "We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies."
497
+ ),
498
+ d && /* @__PURE__ */ a(F, { children: [
499
+ " ",
500
+ /* @__PURE__ */ e(
501
+ "a",
502
+ {
503
+ href: d,
504
+ className: "nice-cookie-consent__link",
505
+ target: "_blank",
506
+ rel: "noopener noreferrer",
507
+ children: o("cookie.learnMore", "Learn more")
508
+ }
509
+ )
510
+ ] })
511
+ ] }),
512
+ C && /* @__PURE__ */ e("div", { className: "nice-cookie-consent__details", children: i.map((_) => /* @__PURE__ */ a("label", { className: "nice-cookie-consent__category", children: [
513
+ /* @__PURE__ */ e(
514
+ "input",
515
+ {
516
+ type: "checkbox",
517
+ checked: u[_],
518
+ disabled: _ === "necessary",
519
+ onChange: (B) => z((A) => ({ ...A, [_]: B.target.checked })),
520
+ className: "nice-cookie-consent__checkbox"
521
+ }
522
+ ),
523
+ /* @__PURE__ */ a("div", { className: "nice-cookie-consent__cat-info", children: [
524
+ /* @__PURE__ */ e("strong", { children: D[_] }),
525
+ /* @__PURE__ */ e("span", { className: "nice-cookie-consent__cat-desc", children: E[_] })
526
+ ] })
527
+ ] }, _)) }),
528
+ /* @__PURE__ */ a("div", { className: "nice-cookie-consent__actions", children: [
529
+ !C && /* @__PURE__ */ e(
530
+ "button",
531
+ {
532
+ type: "button",
533
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--details",
534
+ onClick: () => T(!0),
535
+ children: o("cookie.customize", "Customize")
536
+ }
537
+ ),
538
+ C && /* @__PURE__ */ e(
539
+ "button",
540
+ {
541
+ type: "button",
542
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--save",
543
+ onClick: j,
544
+ children: o("cookie.savePreferences", "Save preferences")
545
+ }
546
+ ),
547
+ /* @__PURE__ */ e(
548
+ "button",
549
+ {
550
+ type: "button",
551
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--reject",
552
+ onClick: M,
553
+ children: o("cookie.rejectAll", "Reject all")
554
+ }
555
+ ),
556
+ /* @__PURE__ */ e(
557
+ "button",
558
+ {
559
+ type: "button",
560
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--accept",
561
+ onClick: R,
562
+ children: o("cookie.acceptAll", "Accept all")
563
+ }
564
+ )
565
+ ] })
566
+ ] })
567
+ }
568
+ ) : null;
569
+ }
570
+ );
571
+ oe.displayName = "NiceCookieConsent";
572
+ const le = G(
573
+ ({
574
+ onSubmit: n,
575
+ onForgotPassword: t,
576
+ onRegister: s,
577
+ loading: r = !1,
578
+ error: i,
579
+ variant: c = "primary",
580
+ size: l = "md",
581
+ showRememberMe: m = !0,
582
+ showForgotPassword: d = !0,
583
+ showRegister: p = !1,
584
+ title: h,
585
+ logo: v,
586
+ usernameLabel: g,
587
+ passwordLabel: f,
588
+ usernamePlaceholder: N,
589
+ passwordPlaceholder: b,
590
+ className: o,
591
+ style: $,
592
+ id: k,
593
+ ...w
594
+ }, C) => {
595
+ const T = W(k), { t: u } = P(), [z, D] = y(""), [E, R] = y(""), [M, j] = y(!1), [_, B] = y(!1), A = `${T}-user`, q = `${T}-pass`, H = `${T}-remember`, K = L(
596
+ (x) => {
597
+ x.preventDefault(), !r && n?.({ username: z, password: E, rememberMe: M });
598
+ },
599
+ [r, z, E, M, n]
600
+ );
601
+ return /* @__PURE__ */ a(
602
+ "form",
603
+ {
604
+ ref: C,
605
+ id: T,
606
+ className: `nice-login nice-login--${c} nice-login--${l} ${o ?? ""}`,
607
+ style: $,
608
+ onSubmit: K,
609
+ noValidate: !0,
610
+ ...w,
611
+ children: [
612
+ v && /* @__PURE__ */ e("div", { className: "nice-login__logo", children: v }),
613
+ h && /* @__PURE__ */ e("h2", { className: "nice-login__title", children: h ?? u("login.title", "Sign In") }),
614
+ i && /* @__PURE__ */ e("div", { className: "nice-login__error", role: "alert", children: i }),
615
+ /* @__PURE__ */ a("div", { className: "nice-login__field", children: [
616
+ /* @__PURE__ */ e("label", { htmlFor: A, className: "nice-login__label", children: g ?? u("login.username", "Username") }),
617
+ /* @__PURE__ */ e(
618
+ "input",
619
+ {
620
+ id: A,
621
+ className: "nice-login__input",
622
+ type: "text",
623
+ value: z,
624
+ onChange: (x) => D(x.target.value),
625
+ placeholder: N ?? u("login.usernamePlaceholder", "Enter your username"),
626
+ autoComplete: "username",
627
+ required: !0,
628
+ disabled: r,
629
+ "aria-required": "true"
630
+ }
631
+ )
632
+ ] }),
633
+ /* @__PURE__ */ a("div", { className: "nice-login__field", children: [
634
+ /* @__PURE__ */ e("label", { htmlFor: q, className: "nice-login__label", children: f ?? u("login.password", "Password") }),
635
+ /* @__PURE__ */ a("div", { className: "nice-login__password-wrap", children: [
636
+ /* @__PURE__ */ e(
637
+ "input",
638
+ {
639
+ id: q,
640
+ className: "nice-login__input",
641
+ type: _ ? "text" : "password",
642
+ value: E,
643
+ onChange: (x) => R(x.target.value),
644
+ placeholder: b ?? u("login.passwordPlaceholder", "Enter your password"),
645
+ autoComplete: "current-password",
646
+ required: !0,
647
+ disabled: r,
648
+ "aria-required": "true"
649
+ }
650
+ ),
651
+ /* @__PURE__ */ e(
652
+ "button",
653
+ {
654
+ type: "button",
655
+ className: "nice-login__toggle-password",
656
+ onClick: () => B(!_),
657
+ "aria-label": _ ? u("login.hidePassword", "Hide password") : u("login.showPassword", "Show password"),
658
+ tabIndex: -1,
659
+ children: _ ? "🙈" : "👁"
660
+ }
661
+ )
662
+ ] })
663
+ ] }),
664
+ /* @__PURE__ */ a("div", { className: "nice-login__options", children: [
665
+ m && /* @__PURE__ */ a("label", { className: "nice-login__remember", htmlFor: H, children: [
666
+ /* @__PURE__ */ e(
667
+ "input",
668
+ {
669
+ id: H,
670
+ type: "checkbox",
671
+ checked: M,
672
+ onChange: (x) => j(x.target.checked),
673
+ disabled: r
674
+ }
675
+ ),
676
+ /* @__PURE__ */ e("span", { children: u("login.rememberMe", "Remember me") })
677
+ ] }),
678
+ d && t && /* @__PURE__ */ e(
679
+ "button",
680
+ {
681
+ type: "button",
682
+ className: "nice-login__forgot",
683
+ onClick: t,
684
+ disabled: r,
685
+ children: u("login.forgotPassword", "Forgot password?")
686
+ }
687
+ )
688
+ ] }),
689
+ /* @__PURE__ */ e(
690
+ "button",
691
+ {
692
+ type: "submit",
693
+ className: `nice-login__submit nice-login__submit--${c}`,
694
+ disabled: r || !z || !E,
695
+ children: r ? u("login.loading", "Signing in...") : u("login.submit", "Sign In")
696
+ }
697
+ ),
698
+ p && s && /* @__PURE__ */ a("p", { className: "nice-login__register", children: [
699
+ u("login.noAccount", "Don't have an account?"),
700
+ " ",
701
+ /* @__PURE__ */ e(
702
+ "button",
703
+ {
704
+ type: "button",
705
+ className: "nice-login__register-link",
706
+ onClick: s,
707
+ disabled: r,
708
+ children: u("login.register", "Register")
709
+ }
710
+ )
711
+ ] })
712
+ ]
713
+ }
714
+ );
715
+ }
716
+ );
717
+ le.displayName = "NiceLoginForm";
718
+ const O = class O extends ee {
719
+ constructor() {
720
+ super(...arguments), this.state = {
721
+ hasError: !1,
722
+ error: null
723
+ }, this.handleReset = () => {
724
+ this.setState({ hasError: !1, error: null });
725
+ };
726
+ }
727
+ static getDerivedStateFromError(t) {
728
+ return { hasError: !0, error: t };
729
+ }
730
+ componentDidCatch(t, s) {
731
+ this.props.onError?.(t, s);
732
+ }
733
+ render() {
734
+ if (this.state.hasError && this.state.error) {
735
+ const { fallback: t, showRetry: s = !0, retryLabel: r = "Retry", title: i = "Something went wrong" } = this.props;
736
+ return typeof t == "function" ? t(this.state.error, this.handleReset) : t || /* @__PURE__ */ a("div", { className: "nice-error-boundary", role: "alert", children: [
737
+ /* @__PURE__ */ e("div", { className: "nice-error-boundary__icon", children: "⚠️" }),
738
+ /* @__PURE__ */ e("h2", { className: "nice-error-boundary__title", children: i }),
739
+ /* @__PURE__ */ e("p", { className: "nice-error-boundary__message", children: this.state.error.message }),
740
+ s && /* @__PURE__ */ e("button", { type: "button", className: "nice-btn nice-btn--primary", onClick: this.handleReset, children: r })
741
+ ] });
742
+ }
743
+ return this.props.children;
744
+ }
745
+ };
746
+ O.displayName = "NiceErrorBoundary";
747
+ let U = O;
748
+ export {
749
+ he as N,
750
+ pe as a,
751
+ oe as b,
752
+ fe as c,
753
+ U as d,
754
+ le as e,
755
+ ve as f,
756
+ ge as g,
757
+ Ne as h,
758
+ _e as i,
759
+ J as j,
760
+ ae as k,
761
+ be as u
762
+ };