@nice2dev/ui-3d 1.0.6 → 1.1.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 (79) hide show
  1. package/dist/cjs/core/i18n.js +3 -3
  2. package/dist/cjs/dance/DanceBridge.js +13 -13
  3. package/dist/cjs/dance/DanceScoreEngine.js +8 -8
  4. package/dist/cjs/dance/PoseDetector.js +20 -20
  5. package/dist/cjs/material/NiceMaterialEditor.js +19 -19
  6. package/dist/cjs/model/ModelEditorLeftPanel.js +5 -5
  7. package/dist/cjs/model/ModelEditorMenuBar.js +6 -6
  8. package/dist/cjs/model/ModelEditorRightPanel.js +19 -19
  9. package/dist/cjs/model/ModelEditorSubComponents.js +10 -10
  10. package/dist/cjs/model/ModelEditorTimeline.js +6 -6
  11. package/dist/cjs/model/ModelEditorToolbar.js +4 -4
  12. package/dist/cjs/model/ModelEditorViewport.js +2 -2
  13. package/dist/cjs/model/ModelViewer.js +14 -14
  14. package/dist/cjs/model/NiceArmatureEditor.js +18 -18
  15. package/dist/cjs/model/NiceMorphTargetEditor.js +18 -18
  16. package/dist/cjs/model/NiceOctree.js +16 -16
  17. package/dist/cjs/model/NicePhysicsSimulation.js +24 -24
  18. package/dist/cjs/model/NiceProceduralGeometry.js +8 -8
  19. package/dist/cjs/model/NiceTerrainEditor.js +19 -19
  20. package/dist/cjs/model/NiceWeightPainter.js +14 -14
  21. package/dist/cjs/model/NiceXRPreview.js +18 -18
  22. package/dist/cjs/model/useModelEditor.js +127 -127
  23. package/dist/cjs/model/useModelViewer.js +61 -61
  24. package/dist/cjs/particle/NiceParticleEditor.js +11 -11
  25. package/dist/cjs/rendering/NiceCascadedShadows.js +12 -12
  26. package/dist/cjs/rendering/NiceRenderExport.js +5 -5
  27. package/dist/cjs/rendering/NiceSSAO.js +18 -18
  28. package/dist/cjs/rendering/NiceSSR.js +14 -14
  29. package/dist/cjs/rendering/NiceWebGPURenderer.js +21 -21
  30. package/dist/cjs/ui/dist/NiceButton-D9l39Rs7.js +598 -0
  31. package/dist/cjs/ui/dist/NiceButton-D9l39Rs7.js.map +1 -0
  32. package/dist/cjs/ui/dist/NiceErrorBoundary-niMx1aSJ.js +647 -0
  33. package/dist/cjs/ui/dist/NiceErrorBoundary-niMx1aSJ.js.map +1 -0
  34. package/dist/cjs/ui/dist/NiceModuleLifecyclePanel-I_TXRiiY.js +5048 -0
  35. package/dist/cjs/ui/dist/NiceModuleLifecyclePanel-I_TXRiiY.js.map +1 -0
  36. package/dist/cjs/ui/dist/NicePinCodeInput-CrMfdxxc.js +13081 -0
  37. package/dist/cjs/ui/dist/NicePinCodeInput-CrMfdxxc.js.map +1 -0
  38. package/dist/cjs/ui/dist/NiceSavedQueryPanel-CUAsdOjJ.js +6054 -0
  39. package/dist/cjs/ui/dist/NiceSavedQueryPanel-CUAsdOjJ.js.map +1 -0
  40. package/dist/cjs/ui/dist/NiceToggle-CaY1u82g.js +280 -0
  41. package/dist/cjs/ui/dist/NiceToggle-CaY1u82g.js.map +1 -0
  42. package/dist/cjs/ui/dist/NiceWindow-SiCaREbq.js +806 -0
  43. package/dist/cjs/ui/dist/NiceWindow-SiCaREbq.js.map +1 -0
  44. package/dist/cjs/ui/dist/charts-Bx_kNBsE.js +3508 -0
  45. package/dist/cjs/ui/dist/charts-Bx_kNBsE.js.map +1 -0
  46. package/dist/cjs/ui/dist/core-BpghV7Ls.js +10249 -0
  47. package/dist/cjs/ui/dist/core-BpghV7Ls.js.map +1 -0
  48. package/dist/cjs/ui/dist/index-CIl98Vbm.js +40039 -0
  49. package/dist/cjs/ui/dist/index-CIl98Vbm.js.map +1 -0
  50. package/dist/cjs/uv/NiceUVEditor.js +24 -24
  51. package/dist/esm/model/ModelEditorLeftPanel.js +4 -4
  52. package/dist/esm/model/ModelEditorMenuBar.js +4 -4
  53. package/dist/esm/model/ModelEditorRightPanel.js +5 -5
  54. package/dist/esm/model/ModelEditorSubComponents.js +2 -2
  55. package/dist/esm/model/ModelEditorTimeline.js +5 -5
  56. package/dist/esm/model/ModelEditorToolbar.js +3 -3
  57. package/dist/esm/model/ModelEditorViewport.js +2 -2
  58. package/dist/esm/model/ModelViewer.js +2 -2
  59. package/dist/esm/ui/dist/NiceButton-D9l39Rs7.js +593 -0
  60. package/dist/esm/ui/dist/NiceButton-D9l39Rs7.js.map +1 -0
  61. package/dist/esm/ui/dist/NiceErrorBoundary-niMx1aSJ.js +637 -0
  62. package/dist/esm/ui/dist/NiceErrorBoundary-niMx1aSJ.js.map +1 -0
  63. package/dist/esm/ui/dist/NiceModuleLifecyclePanel-I_TXRiiY.js +5007 -0
  64. package/dist/esm/ui/dist/NiceModuleLifecyclePanel-I_TXRiiY.js.map +1 -0
  65. package/dist/esm/ui/dist/NicePinCodeInput-CrMfdxxc.js +13011 -0
  66. package/dist/esm/ui/dist/NicePinCodeInput-CrMfdxxc.js.map +1 -0
  67. package/dist/esm/ui/dist/NiceSavedQueryPanel-CUAsdOjJ.js +6037 -0
  68. package/dist/esm/ui/dist/NiceSavedQueryPanel-CUAsdOjJ.js.map +1 -0
  69. package/dist/esm/ui/dist/NiceToggle-CaY1u82g.js +276 -0
  70. package/dist/esm/ui/dist/NiceToggle-CaY1u82g.js.map +1 -0
  71. package/dist/esm/ui/dist/NiceWindow-SiCaREbq.js +795 -0
  72. package/dist/esm/ui/dist/NiceWindow-SiCaREbq.js.map +1 -0
  73. package/dist/esm/ui/dist/charts-Bx_kNBsE.js +3483 -0
  74. package/dist/esm/ui/dist/charts-Bx_kNBsE.js.map +1 -0
  75. package/dist/esm/ui/dist/core-BpghV7Ls.js +10071 -0
  76. package/dist/esm/ui/dist/core-BpghV7Ls.js.map +1 -0
  77. package/dist/esm/ui/dist/index-CIl98Vbm.js +39917 -0
  78. package/dist/esm/ui/dist/index-CIl98Vbm.js.map +1 -0
  79. package/package.json +1 -1
@@ -0,0 +1,647 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var coreBpghV7Ls = require('./core-BpghV7Ls.js');
5
+ var ke = require('react');
6
+
7
+ const Q = {
8
+ info: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("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" }) }),
9
+ success: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("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" }) }),
10
+ warning: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("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" }) }),
11
+ error: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("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" }) })
12
+ }, he = ({
13
+ variant: n = "info",
14
+ title: t,
15
+ children: s,
16
+ closable: r,
17
+ onClose: i,
18
+ icon: c,
19
+ size: l = "md",
20
+ className: u,
21
+ style: d,
22
+ displayStyle: p
23
+ }) => {
24
+ const m = coreBpghV7Ls.i("card", p);
25
+ return /* @__PURE__ */ jsxRuntime.jsxs(
26
+ "div",
27
+ {
28
+ className: `nice-alert nice-alert--${n} nice-alert--${l} nice-alert--ds-${m} ${u || ""}`,
29
+ style: d,
30
+ role: "alert",
31
+ children: [
32
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: `nice-alert__icon nice-alert__icon--${n}`, children: c || Q[n] }),
33
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-alert__content", children: [
34
+ t && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-alert__title", children: t }),
35
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: s })
36
+ ] }),
37
+ r && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "nice-alert__close", onClick: i, "aria-label": "Close", children: "✕" })
38
+ ]
39
+ }
40
+ );
41
+ }, fe = ({
42
+ open: n,
43
+ onClose: t,
44
+ title: s,
45
+ size: r = "md",
46
+ children: i,
47
+ footer: c,
48
+ closeOnOverlay: l = true,
49
+ closeOnEscape: u = true,
50
+ fullscreenable: d,
51
+ zIndex: p,
52
+ className: m,
53
+ style: y,
54
+ displayStyle: v
55
+ }) => {
56
+ const { t: _ } = coreBpghV7Ls.g(), g = ke.useRef(null), [h, o] = ke.useState(false), $ = coreBpghV7Ls.h("modal", v), w = coreBpghV7Ls.i("modal", v);
57
+ return coreBpghV7Ls.c(g, n), ke.useEffect(() => {
58
+ if (!n || !u)
59
+ return;
60
+ const f = (C) => {
61
+ C.key === "Escape" && t();
62
+ };
63
+ return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
64
+ }, [n, u, t]), ke.useEffect(() => (n ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
65
+ document.body.style.overflow = "";
66
+ }), [n]), n ? /* @__PURE__ */ jsxRuntime.jsx(
67
+ "div",
68
+ {
69
+ className: "nice-modal-overlay",
70
+ style: p ? { zIndex: p } : void 0,
71
+ onClick: l ? t : void 0,
72
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
73
+ "div",
74
+ {
75
+ ref: g,
76
+ className: `nice-modal nice-modal--${h ? "full" : r} nice-modal--ds-${w} ${m || ""}`,
77
+ style: { ...$, ...y },
78
+ role: "dialog",
79
+ "aria-modal": "true",
80
+ "aria-label": s,
81
+ onClick: (f) => f.stopPropagation(),
82
+ children: [
83
+ s && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-modal__header", children: [
84
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "nice-modal__title", children: s }),
85
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-modal__header-actions", children: [
86
+ d && /* @__PURE__ */ jsxRuntime.jsx(
87
+ "button",
88
+ {
89
+ type: "button",
90
+ className: "nice-modal__fullscreen",
91
+ onClick: () => o((f) => !f),
92
+ "aria-label": h ? "Exit fullscreen" : "Fullscreen",
93
+ children: h ? "⇲" : "⇱"
94
+ }
95
+ ),
96
+ /* @__PURE__ */ jsxRuntime.jsx(
97
+ "button",
98
+ {
99
+ type: "button",
100
+ className: "nice-modal__close",
101
+ onClick: t,
102
+ "aria-label": _("controls.close", "Close"),
103
+ children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("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" }) })
104
+ }
105
+ )
106
+ ] })
107
+ ] }),
108
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-modal__body", children: i }),
109
+ c && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-modal__footer", children: c })
110
+ ]
111
+ }
112
+ )
113
+ }
114
+ ) : null;
115
+ }, _e = ({
116
+ open: n,
117
+ onClose: t,
118
+ title: s,
119
+ position: r = "right",
120
+ size: i = "md",
121
+ children: c,
122
+ footer: l,
123
+ transitionDuration: u,
124
+ className: d,
125
+ style: p,
126
+ displayStyle: m
127
+ }) => {
128
+ const y = coreBpghV7Ls.h("modal", m), v = coreBpghV7Ls.i("modal", m), { t: _ } = coreBpghV7Ls.g(), g = ke.useRef(null);
129
+ return coreBpghV7Ls.c(g, n), ke.useEffect(() => {
130
+ if (!n)
131
+ return;
132
+ const h = (o) => {
133
+ o.key === "Escape" && t();
134
+ };
135
+ return document.addEventListener("keydown", h), document.body.style.overflow = "hidden", () => {
136
+ document.removeEventListener("keydown", h), document.body.style.overflow = "";
137
+ };
138
+ }, [n, t]), n ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
139
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-drawer-overlay", onClick: t }),
140
+ /* @__PURE__ */ jsxRuntime.jsxs(
141
+ "div",
142
+ {
143
+ ref: g,
144
+ className: `nice-drawer nice-drawer--${r} nice-drawer--${i} nice-drawer--ds-${v} ${d || ""}`,
145
+ style: {
146
+ ...y,
147
+ ...p,
148
+ ...u != null ? { transitionDuration: `${u}ms` } : {}
149
+ },
150
+ role: "dialog",
151
+ "aria-modal": "true",
152
+ "aria-label": s,
153
+ children: [
154
+ s && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-drawer__header", children: [
155
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "nice-drawer__title", children: s }),
156
+ /* @__PURE__ */ jsxRuntime.jsx(
157
+ "button",
158
+ {
159
+ type: "button",
160
+ className: "nice-drawer__close",
161
+ onClick: t,
162
+ "aria-label": _("controls.close", "Close"),
163
+ children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("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" }) })
164
+ }
165
+ )
166
+ ] }),
167
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-drawer__body", children: c }),
168
+ l && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-drawer__footer", children: l })
169
+ ]
170
+ }
171
+ )
172
+ ] }) : null;
173
+ }, be = ({
174
+ toasts: n,
175
+ onDismiss: t,
176
+ position: s = "top-right"
177
+ }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: `nice-toast-container nice-toast-container--${s}`, children: n.map((r) => /* @__PURE__ */ jsxRuntime.jsx(ne, { toast: r, onDismiss: t }, r.id)) }), ne = ({
178
+ toast: n,
179
+ onDismiss: t
180
+ }) => {
181
+ const [s, r] = ke.useState(false);
182
+ return ke.useEffect(() => {
183
+ if (!n.duration && n.duration !== 0) {
184
+ const i = setTimeout(() => r(true), 4e3);
185
+ return () => clearTimeout(i);
186
+ }
187
+ if (n.duration > 0) {
188
+ const i = setTimeout(() => r(true), n.duration);
189
+ return () => clearTimeout(i);
190
+ }
191
+ }, [n.duration]), ke.useEffect(() => {
192
+ if (s) {
193
+ const i = setTimeout(() => t(n.id), 200);
194
+ return () => clearTimeout(i);
195
+ }
196
+ }, [s, n.id, t]), /* @__PURE__ */ jsxRuntime.jsxs(
197
+ "div",
198
+ {
199
+ className: `nice-toast nice-toast--${n.variant} ${s ? "nice-toast--exiting" : ""}`,
200
+ role: "alert",
201
+ style: { position: "relative" },
202
+ children: [
203
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-toast__icon", children: Q[n.variant] }),
204
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-toast__content", children: [
205
+ n.title && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-toast__title", children: n.title }),
206
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-toast__message", children: n.message })
207
+ ] }),
208
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "nice-toast__close", onClick: () => r(true), children: "✕" })
209
+ ]
210
+ }
211
+ );
212
+ };
213
+ let ie = 0;
214
+ function pe() {
215
+ const [n, t] = ke.useState([]), s = ke.useCallback(
216
+ (i, c, l) => {
217
+ const u = `toast-${++ie}`;
218
+ return t((d) => [
219
+ ...d,
220
+ { id: u, variant: i, message: c, title: l?.title, duration: l?.duration }
221
+ ]), u;
222
+ },
223
+ []
224
+ ), r = ke.useCallback((i) => {
225
+ t((c) => c.filter((l) => l.id !== i));
226
+ }, []);
227
+ return {
228
+ toasts: n,
229
+ dismiss: r,
230
+ info: (i, c) => s("info", i, c),
231
+ success: (i, c) => s("success", i, c),
232
+ warning: (i, c) => s("warning", i, c),
233
+ error: (i, c) => s("error", i, c)
234
+ };
235
+ }
236
+ const te = {
237
+ info: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("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" }) }),
238
+ warning: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" }) }),
239
+ error: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("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" }) }),
240
+ success: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("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" }) })
241
+ }, ve = ({
242
+ visible: n,
243
+ message: t,
244
+ header: s,
245
+ icon: r,
246
+ variant: i = "warning",
247
+ acceptLabel: c,
248
+ rejectLabel: l,
249
+ onAccept: u,
250
+ onReject: d,
251
+ closeOnOverlay: p = false,
252
+ closeOnEscape: m = true,
253
+ size: y = "md",
254
+ className: v,
255
+ style: _
256
+ }) => {
257
+ const { t: g } = coreBpghV7Ls.g();
258
+ if (ke.useEffect(() => {
259
+ if (!n || !m)
260
+ return;
261
+ const w = (f) => {
262
+ f.key === "Escape" && d();
263
+ };
264
+ return document.addEventListener("keydown", w), () => document.removeEventListener("keydown", w);
265
+ }, [n, m, d]), ke.useEffect(() => (n ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
266
+ document.body.style.overflow = "";
267
+ }), [n]), !n)
268
+ return null;
269
+ const h = r ?? te[i], o = c ?? g("confirm.accept", "Yes"), $ = l ?? g("confirm.reject", "No");
270
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-modal-overlay", onClick: p ? d : void 0, children: /* @__PURE__ */ jsxRuntime.jsxs(
271
+ "div",
272
+ {
273
+ className: `nice-confirm nice-confirm--${i} nice-confirm--${y} ${v || ""}`,
274
+ style: _,
275
+ role: "alertdialog",
276
+ "aria-modal": "true",
277
+ "aria-label": s,
278
+ "aria-describedby": "nice-confirm-message",
279
+ onClick: (w) => w.stopPropagation(),
280
+ children: [
281
+ s && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-confirm__header", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "nice-confirm__title", children: s }) }),
282
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-confirm__body", children: [
283
+ h && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `nice-confirm__icon nice-confirm__icon--${i}`, children: h }),
284
+ /* @__PURE__ */ jsxRuntime.jsx("div", { id: "nice-confirm-message", className: "nice-confirm__message", children: t })
285
+ ] }),
286
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-confirm__footer", children: [
287
+ /* @__PURE__ */ jsxRuntime.jsx(
288
+ "button",
289
+ {
290
+ type: "button",
291
+ className: "nice-btn nice-btn--ghost nice-btn--md",
292
+ onClick: d,
293
+ children: $
294
+ }
295
+ ),
296
+ /* @__PURE__ */ jsxRuntime.jsx(
297
+ "button",
298
+ {
299
+ type: "button",
300
+ className: `nice-btn nice-btn--${i === "error" ? "error" : "primary"} nice-btn--md`,
301
+ onClick: u,
302
+ autoFocus: true,
303
+ children: o
304
+ }
305
+ )
306
+ ] })
307
+ ]
308
+ }
309
+ ) });
310
+ };
311
+ const oe = ke.forwardRef(
312
+ ({
313
+ visible: n,
314
+ onAcceptAll: t,
315
+ onRejectAll: s,
316
+ onSave: r,
317
+ categories: i = ["necessary", "analytics", "marketing", "preferences"],
318
+ defaults: c,
319
+ position: l = "bottom",
320
+ size: u = "md",
321
+ policyUrl: d,
322
+ showDetails: p = false,
323
+ className: m,
324
+ style: y,
325
+ id: v,
326
+ ..._
327
+ }, g) => {
328
+ const h = coreBpghV7Ls.b(v), { t: o } = coreBpghV7Ls.g(), [$, w] = ke.useState(true), f = n ?? $, [C, z] = ke.useState(p), [b, T] = ke.useState(() => {
329
+ const N = {
330
+ necessary: true,
331
+ analytics: false,
332
+ marketing: false,
333
+ preferences: false
334
+ };
335
+ return c && Object.assign(N, c), N.necessary = true, N;
336
+ }), M = {
337
+ necessary: o("cookie.necessary", "Necessary"),
338
+ analytics: o("cookie.analytics", "Analytics"),
339
+ marketing: o("cookie.marketing", "Marketing"),
340
+ preferences: o("cookie.preferences", "Preferences")
341
+ }, D = {
342
+ necessary: o(
343
+ "cookie.necessaryDesc",
344
+ "Required for the website to function. Cannot be disabled."
345
+ ),
346
+ analytics: o(
347
+ "cookie.analyticsDesc",
348
+ "Help us understand how visitors interact with the website."
349
+ ),
350
+ marketing: o("cookie.marketingDesc", "Used to deliver relevant advertisements."),
351
+ preferences: o("cookie.preferencesDesc", "Allow the website to remember your choices.")
352
+ }, R = ke.useCallback(() => {
353
+ const N = {
354
+ necessary: true,
355
+ analytics: true,
356
+ marketing: true,
357
+ preferences: true
358
+ };
359
+ t?.(), r?.(N), w(false);
360
+ }, [t, r]), S = ke.useCallback(() => {
361
+ const N = {
362
+ necessary: true,
363
+ analytics: false,
364
+ marketing: false,
365
+ preferences: false
366
+ };
367
+ s?.(), r?.(N), w(false);
368
+ }, [s, r]), A = ke.useCallback(() => {
369
+ r?.({ ...b, necessary: true }), w(false);
370
+ }, [b, r]);
371
+ return f ? /* @__PURE__ */ jsxRuntime.jsx(
372
+ "div",
373
+ {
374
+ ref: g,
375
+ id: h,
376
+ className: `nice-cookie-consent nice-cookie-consent--${l} nice-cookie-consent--${u} ${m ?? ""}`,
377
+ style: y,
378
+ role: "dialog",
379
+ "aria-label": o("cookie.label", "Cookie Consent"),
380
+ "aria-modal": "true",
381
+ ..._,
382
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-cookie-consent__content", children: [
383
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "nice-cookie-consent__message", children: [
384
+ o(
385
+ "cookie.message",
386
+ "We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies."
387
+ ),
388
+ d && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
389
+ " ",
390
+ /* @__PURE__ */ jsxRuntime.jsx(
391
+ "a",
392
+ {
393
+ href: d,
394
+ className: "nice-cookie-consent__link",
395
+ target: "_blank",
396
+ rel: "noopener noreferrer",
397
+ children: o("cookie.learnMore", "Learn more")
398
+ }
399
+ )
400
+ ] })
401
+ ] }),
402
+ C && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-cookie-consent__details", children: i.map((N) => /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "nice-cookie-consent__category", children: [
403
+ /* @__PURE__ */ jsxRuntime.jsx(
404
+ "input",
405
+ {
406
+ type: "checkbox",
407
+ checked: b[N],
408
+ disabled: N === "necessary",
409
+ onChange: (B) => T((F) => ({ ...F, [N]: B.target.checked })),
410
+ className: "nice-cookie-consent__checkbox"
411
+ }
412
+ ),
413
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-cookie-consent__cat-info", children: [
414
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: M[N] }),
415
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-cookie-consent__cat-desc", children: D[N] })
416
+ ] })
417
+ ] }, N)) }),
418
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-cookie-consent__actions", children: [
419
+ !C && /* @__PURE__ */ jsxRuntime.jsx(
420
+ "button",
421
+ {
422
+ type: "button",
423
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--details",
424
+ onClick: () => z(true),
425
+ children: o("cookie.customize", "Customize")
426
+ }
427
+ ),
428
+ C && /* @__PURE__ */ jsxRuntime.jsx(
429
+ "button",
430
+ {
431
+ type: "button",
432
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--save",
433
+ onClick: A,
434
+ children: o("cookie.savePreferences", "Save preferences")
435
+ }
436
+ ),
437
+ /* @__PURE__ */ jsxRuntime.jsx(
438
+ "button",
439
+ {
440
+ type: "button",
441
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--reject",
442
+ onClick: S,
443
+ children: o("cookie.rejectAll", "Reject all")
444
+ }
445
+ ),
446
+ /* @__PURE__ */ jsxRuntime.jsx(
447
+ "button",
448
+ {
449
+ type: "button",
450
+ className: "nice-cookie-consent__btn nice-cookie-consent__btn--accept",
451
+ onClick: R,
452
+ children: o("cookie.acceptAll", "Accept all")
453
+ }
454
+ )
455
+ ] })
456
+ ] })
457
+ }
458
+ ) : null;
459
+ }
460
+ );
461
+ oe.displayName = "NiceCookieConsent";
462
+ const le = ke.forwardRef(
463
+ ({
464
+ onSubmit: n,
465
+ onForgotPassword: t,
466
+ onRegister: s,
467
+ loading: r = false,
468
+ error: i,
469
+ variant: c = "primary",
470
+ size: l = "md",
471
+ showRememberMe: u = true,
472
+ showForgotPassword: d = true,
473
+ showRegister: p = false,
474
+ title: m,
475
+ logo: y,
476
+ usernameLabel: v,
477
+ passwordLabel: _,
478
+ usernamePlaceholder: g,
479
+ passwordPlaceholder: h,
480
+ className: o,
481
+ style: $,
482
+ id: w,
483
+ ...f
484
+ }, C) => {
485
+ const z = coreBpghV7Ls.b(w), { t: b } = coreBpghV7Ls.g(), [T, M] = ke.useState(""), [D, R] = ke.useState(""), [S, A] = ke.useState(false), [N, B] = ke.useState(false), F = `${z}-user`, H = `${z}-pass`, V = `${z}-remember`, X = ke.useCallback(
486
+ (E) => {
487
+ E.preventDefault(), !r && n?.({ username: T, password: D, rememberMe: S });
488
+ },
489
+ [r, T, D, S, n]
490
+ );
491
+ return /* @__PURE__ */ jsxRuntime.jsxs(
492
+ "form",
493
+ {
494
+ ref: C,
495
+ id: z,
496
+ className: `nice-login nice-login--${c} nice-login--${l} ${o ?? ""}`,
497
+ style: $,
498
+ onSubmit: X,
499
+ noValidate: true,
500
+ ...f,
501
+ children: [
502
+ y && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-login__logo", children: y }),
503
+ m && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "nice-login__title", children: m ?? b("login.title", "Sign In") }),
504
+ i && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-login__error", role: "alert", children: i }),
505
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-login__field", children: [
506
+ /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: F, className: "nice-login__label", children: v ?? b("login.username", "Username") }),
507
+ /* @__PURE__ */ jsxRuntime.jsx(
508
+ "input",
509
+ {
510
+ id: F,
511
+ className: "nice-login__input",
512
+ type: "text",
513
+ value: T,
514
+ onChange: (E) => M(E.target.value),
515
+ placeholder: g ?? b("login.usernamePlaceholder", "Enter your username"),
516
+ autoComplete: "username",
517
+ required: true,
518
+ disabled: r,
519
+ "aria-required": "true"
520
+ }
521
+ )
522
+ ] }),
523
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-login__field", children: [
524
+ /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: H, className: "nice-login__label", children: _ ?? b("login.password", "Password") }),
525
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-login__password-wrap", children: [
526
+ /* @__PURE__ */ jsxRuntime.jsx(
527
+ "input",
528
+ {
529
+ id: H,
530
+ className: "nice-login__input",
531
+ type: N ? "text" : "password",
532
+ value: D,
533
+ onChange: (E) => R(E.target.value),
534
+ placeholder: h ?? b("login.passwordPlaceholder", "Enter your password"),
535
+ autoComplete: "current-password",
536
+ required: true,
537
+ disabled: r,
538
+ "aria-required": "true"
539
+ }
540
+ ),
541
+ /* @__PURE__ */ jsxRuntime.jsx(
542
+ "button",
543
+ {
544
+ type: "button",
545
+ className: "nice-login__toggle-password",
546
+ onClick: () => B(!N),
547
+ "aria-label": N ? b("login.hidePassword", "Hide password") : b("login.showPassword", "Show password"),
548
+ tabIndex: -1,
549
+ children: N ? "🙈" : "👁"
550
+ }
551
+ )
552
+ ] })
553
+ ] }),
554
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-login__options", children: [
555
+ u && /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "nice-login__remember", htmlFor: V, children: [
556
+ /* @__PURE__ */ jsxRuntime.jsx(
557
+ "input",
558
+ {
559
+ id: V,
560
+ type: "checkbox",
561
+ checked: S,
562
+ onChange: (E) => A(E.target.checked),
563
+ disabled: r
564
+ }
565
+ ),
566
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: b("login.rememberMe", "Remember me") })
567
+ ] }),
568
+ d && t && /* @__PURE__ */ jsxRuntime.jsx(
569
+ "button",
570
+ {
571
+ type: "button",
572
+ className: "nice-login__forgot",
573
+ onClick: t,
574
+ disabled: r,
575
+ children: b("login.forgotPassword", "Forgot password?")
576
+ }
577
+ )
578
+ ] }),
579
+ /* @__PURE__ */ jsxRuntime.jsx(
580
+ "button",
581
+ {
582
+ type: "submit",
583
+ className: `nice-login__submit nice-login__submit--${c}`,
584
+ disabled: r || !T || !D,
585
+ children: r ? b("login.loading", "Signing in...") : b("login.submit", "Sign In")
586
+ }
587
+ ),
588
+ p && s && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "nice-login__register", children: [
589
+ b("login.noAccount", "Don't have an account?"),
590
+ " ",
591
+ /* @__PURE__ */ jsxRuntime.jsx(
592
+ "button",
593
+ {
594
+ type: "button",
595
+ className: "nice-login__register-link",
596
+ onClick: s,
597
+ disabled: r,
598
+ children: b("login.register", "Register")
599
+ }
600
+ )
601
+ ] })
602
+ ]
603
+ }
604
+ );
605
+ }
606
+ );
607
+ le.displayName = "NiceLoginForm";
608
+ const q = class q extends ke.Component {
609
+ constructor() {
610
+ super(...arguments), this.state = {
611
+ hasError: false,
612
+ error: null
613
+ }, this.handleReset = () => {
614
+ this.setState({ hasError: false, error: null });
615
+ };
616
+ }
617
+ static getDerivedStateFromError(t) {
618
+ return { hasError: true, error: t };
619
+ }
620
+ componentDidCatch(t, s) {
621
+ this.props.onError?.(t, s);
622
+ }
623
+ render() {
624
+ if (this.state.hasError && this.state.error) {
625
+ const { fallback: t, showRetry: s = true, retryLabel: r = "Retry", title: i = "Something went wrong" } = this.props;
626
+ return typeof t == "function" ? t(this.state.error, this.handleReset) : t || /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-error-boundary", role: "alert", children: [
627
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-error-boundary__icon", children: "⚠️" }),
628
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "nice-error-boundary__title", children: i }),
629
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "nice-error-boundary__message", children: this.state.error.message }),
630
+ s && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "nice-btn nice-btn--primary", onClick: this.handleReset, children: r })
631
+ ] });
632
+ }
633
+ return this.props.children;
634
+ }
635
+ };
636
+ q.displayName = "NiceErrorBoundary";
637
+
638
+ exports.N = he;
639
+ exports.a = ve;
640
+ exports.b = oe;
641
+ exports.c = _e;
642
+ exports.e = le;
643
+ exports.f = fe;
644
+ exports.j = be;
645
+ exports.k = Q;
646
+ exports.u = pe;
647
+ //# sourceMappingURL=NiceErrorBoundary-niMx1aSJ.js.map