@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,598 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var ke = require('react');
5
+ var coreBpghV7Ls = require('./core-BpghV7Ls.js');
6
+
7
+ const Re = ke.forwardRef(
8
+ ({
9
+ label: y,
10
+ helperText: v,
11
+ error: t,
12
+ required: A,
13
+ disabled: s,
14
+ readOnly: a,
15
+ size: B = "md",
16
+ name: M,
17
+ id: x,
18
+ className: R,
19
+ style: k,
20
+ accessMode: p,
21
+ displayStyle: g,
22
+ value: h,
23
+ defaultValue: _,
24
+ onChange: C,
25
+ onBlur: o,
26
+ onKeyDown: m,
27
+ placeholder: w,
28
+ type: D = "text",
29
+ maxLength: F,
30
+ prefix: I,
31
+ suffix: j,
32
+ clearable: c,
33
+ autoFocus: J,
34
+ submitOnEnter: S,
35
+ onSubmit: L,
36
+ showKeyboardHints: Q,
37
+ ...q
38
+ }, le) => {
39
+ const G = coreBpghV7Ls.f(p, x);
40
+ if (G === "hidden")
41
+ return null;
42
+ G === "disabled" && (s = true), G === "readOnly" && (a = true);
43
+ const { t: E } = coreBpghV7Ls.g(), d = coreBpghV7Ls.b(x), te = coreBpghV7Ls.h("input", g), se = coreBpghV7Ls.i("input", g), V = ke.useCallback(() => C?.(""), [C]), $ = coreBpghV7Ls.j({
44
+ enabled: S,
45
+ onSubmit: L
46
+ }), O = ke.useCallback(
47
+ (u) => {
48
+ $(u), m?.(u);
49
+ },
50
+ [$, m]
51
+ ), P = ke.useMemo(() => {
52
+ const u = [];
53
+ return S && u.push({ key: "Enter", description: E("shortcuts.submit", "Submit") }), c && u.push({ key: "Escape", description: E("shortcuts.clear", "Clear") }), u;
54
+ }, [S, c, E]);
55
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `nice-field ${R || ""}`, style: k, children: [
56
+ y && /* @__PURE__ */ jsxRuntime.jsxs(
57
+ "label",
58
+ {
59
+ htmlFor: d,
60
+ className: `nice-field__label ${A ? "nice-field__label--required" : ""}`,
61
+ children: [
62
+ y,
63
+ Q && P.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(coreBpghV7Ls.N, { shortcuts: P, size: "sm" })
64
+ ]
65
+ }
66
+ ),
67
+ /* @__PURE__ */ jsxRuntime.jsxs(
68
+ "div",
69
+ {
70
+ className: `nice-input nice-input--${B} nice-input--ds-${se} ${t ? "nice-input--error" : ""} ${s ? "nice-input--disabled" : ""} ${a ? "nice-input--readonly" : ""}`,
71
+ style: te,
72
+ children: [
73
+ I && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-input__icon", children: I }),
74
+ /* @__PURE__ */ jsxRuntime.jsx(
75
+ "input",
76
+ {
77
+ ref: le,
78
+ id: d,
79
+ className: "nice-input__native",
80
+ type: D,
81
+ name: M,
82
+ value: h,
83
+ defaultValue: _,
84
+ placeholder: w,
85
+ disabled: s,
86
+ readOnly: a,
87
+ maxLength: F,
88
+ autoFocus: J,
89
+ "aria-invalid": !!t,
90
+ "aria-describedby": t ? `${d}-error` : v ? `${d}-helper` : void 0,
91
+ onChange: (u) => C?.(u.target.value),
92
+ onBlur: o,
93
+ onKeyDown: O,
94
+ ...q
95
+ }
96
+ ),
97
+ c && h && /* @__PURE__ */ jsxRuntime.jsx(
98
+ "button",
99
+ {
100
+ type: "button",
101
+ className: "nice-input__clear",
102
+ onClick: V,
103
+ "aria-label": E("controls.clear", "Clear"),
104
+ children: "✕"
105
+ }
106
+ ),
107
+ j && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-input__icon", children: j })
108
+ ]
109
+ }
110
+ ),
111
+ t && /* @__PURE__ */ jsxRuntime.jsx("div", { id: `${d}-error`, className: "nice-field__error", role: "alert", children: t }),
112
+ !t && v && /* @__PURE__ */ jsxRuntime.jsx("div", { id: `${d}-helper`, className: "nice-field__helper", children: v })
113
+ ] });
114
+ }
115
+ );
116
+ Re.displayName = "NiceTextInput";
117
+ const De = ke.forwardRef(
118
+ ({
119
+ label: y,
120
+ helperText: v,
121
+ error: t,
122
+ required: A,
123
+ disabled: s,
124
+ size: a = "md",
125
+ name: B,
126
+ id: M,
127
+ className: x,
128
+ style: R,
129
+ accessMode: k,
130
+ displayStyle: p,
131
+ options: g,
132
+ value: h,
133
+ onChange: _,
134
+ placeholder: C,
135
+ multiple: o = false,
136
+ searchable: m = false,
137
+ clearable: w = false,
138
+ emptyText: D,
139
+ maxHeight: F = 240,
140
+ optionsSource: I,
141
+ valueField: j,
142
+ labelField: c,
143
+ virtualScroll: J,
144
+ optionHeight: S = 36,
145
+ onSearch: L,
146
+ loading: Q,
147
+ renderOption: q,
148
+ showKeyboardHints: le
149
+ }, G) => {
150
+ const E = coreBpghV7Ls.f(k, M);
151
+ if (E === "hidden")
152
+ return null;
153
+ (E === "disabled" || E === "readOnly") && (s = true);
154
+ const { t: d } = coreBpghV7Ls.g(), te = coreBpghV7Ls.h("input", p), se = coreBpghV7Ls.i("input", p), V = coreBpghV7Ls.b(M), [$, O] = ke.useState(false), [P, u] = ke.useState(""), [K, H] = ke.useState(-1), [he, Ne] = ke.useState(0), _e = ke.useRef(null), ye = coreBpghV7Ls.k(
155
+ I ?? null,
156
+ j ?? I?.keyField ?? "id",
157
+ c ?? "name"
158
+ ), T = I ? ye.options : g ?? [];
159
+ coreBpghV7Ls.d(_e, () => {
160
+ O(false), u("");
161
+ });
162
+ const f = ke.useMemo(() => h ? Array.isArray(h) ? h : [h] : [], [h]), b = ke.useMemo(() => {
163
+ if (!P && !L || L)
164
+ return T;
165
+ const n = P.toLowerCase();
166
+ return T.filter(
167
+ (r) => r.label.toLowerCase().includes(n) || String(r.value).toLowerCase().includes(n)
168
+ );
169
+ }, [T, P, L]), me = ke.useMemo(() => {
170
+ const n = /* @__PURE__ */ new Map();
171
+ for (const r of b) {
172
+ const i = r.group || "";
173
+ n.has(i) || n.set(i, []), n.get(i).push(r);
174
+ }
175
+ return n;
176
+ }, [b]), X = ke.useCallback(
177
+ (n) => {
178
+ if (o) {
179
+ const r = f.includes(n) ? f.filter((i) => i !== n) : [...f, n];
180
+ _?.(r);
181
+ } else
182
+ _?.(n), O(false), u("");
183
+ },
184
+ [o, f, _]
185
+ ), ke$1 = ke.useCallback(
186
+ (n) => {
187
+ if (n.key === "Escape") {
188
+ O(false), u("");
189
+ return;
190
+ }
191
+ if (n.key === "Enter" || n.key === " ") {
192
+ if (!$) {
193
+ O(true), n.preventDefault();
194
+ return;
195
+ }
196
+ K >= 0 && b[K] && (X(b[K].value), n.preventDefault());
197
+ return;
198
+ }
199
+ n.key === "ArrowDown" && (n.preventDefault(), H((r) => Math.min(r + 1, b.length - 1))), n.key === "ArrowUp" && (n.preventDefault(), H((r) => Math.max(r - 1, 0)));
200
+ },
201
+ [$, K, b, X]
202
+ ), fe = ke.useMemo(() => f.length === 0 ? null : o ? f.map((n) => T.find((r) => r.value === n)?.label || n).join(", ") : T.find((n) => n.value === f[0])?.label || f[0], [f, T, o]), ge = ke.useCallback(
203
+ (n) => {
204
+ n.stopPropagation(), _?.(o ? [] : "");
205
+ },
206
+ [_, o]
207
+ ), $e = ke.useMemo(
208
+ () => [
209
+ { key: "Enter", description: d("shortcuts.select", "Select") },
210
+ { key: "Space", description: d("shortcuts.openDropdown", "Open dropdown") },
211
+ coreBpghV7Ls.C.moveUp,
212
+ coreBpghV7Ls.C.moveDown,
213
+ coreBpghV7Ls.C.cancel
214
+ ],
215
+ [d]
216
+ );
217
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `nice-field ${x || ""}`, style: R, children: [
218
+ y && /* @__PURE__ */ jsxRuntime.jsxs(
219
+ "label",
220
+ {
221
+ htmlFor: V,
222
+ className: `nice-field__label ${A ? "nice-field__label--required" : ""}`,
223
+ children: [
224
+ y,
225
+ le && /* @__PURE__ */ jsxRuntime.jsx(coreBpghV7Ls.N, { shortcuts: $e, size: "sm" })
226
+ ]
227
+ }
228
+ ),
229
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-select", ref: _e, children: [
230
+ /* @__PURE__ */ jsxRuntime.jsxs(
231
+ "button",
232
+ {
233
+ ref: G,
234
+ type: "button",
235
+ id: V,
236
+ role: "combobox",
237
+ "aria-expanded": $,
238
+ "aria-haspopup": "listbox",
239
+ "aria-invalid": !!t,
240
+ className: `nice-select__trigger nice-select__trigger--${a} nice-select--ds-${se} ${$ ? "nice-select__trigger--open" : ""} ${t ? "nice-select__trigger--error" : ""} ${s ? "nice-select__trigger--disabled" : ""}`,
241
+ style: te,
242
+ disabled: s,
243
+ onClick: () => O(!$),
244
+ onKeyDown: ke$1,
245
+ children: [
246
+ fe ? /* @__PURE__ */ jsxRuntime.jsx("span", { children: fe }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-select__placeholder", children: C || d("controls.select", "Select...") }),
247
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
248
+ w && f.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
249
+ "span",
250
+ {
251
+ className: "nice-input__clear",
252
+ onClick: ge,
253
+ role: "button",
254
+ "aria-label": d("controls.clear", "Clear"),
255
+ children: "✕"
256
+ }
257
+ ),
258
+ /* @__PURE__ */ jsxRuntime.jsx(
259
+ "svg",
260
+ {
261
+ className: `nice-select__chevron ${$ ? "nice-select__chevron--open" : ""}`,
262
+ viewBox: "0 0 20 20",
263
+ fill: "currentColor",
264
+ children: /* @__PURE__ */ jsxRuntime.jsx(
265
+ "path",
266
+ {
267
+ fillRule: "evenodd",
268
+ d: "M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",
269
+ clipRule: "evenodd"
270
+ }
271
+ )
272
+ }
273
+ )
274
+ ] })
275
+ ]
276
+ }
277
+ ),
278
+ $ && /* @__PURE__ */ jsxRuntime.jsxs(
279
+ "div",
280
+ {
281
+ className: "nice-select__dropdown",
282
+ role: "listbox",
283
+ style: { maxHeight: F },
284
+ onScroll: J ? (n) => Ne(n.currentTarget.scrollTop) : void 0,
285
+ children: [
286
+ (m || L) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-select__search", children: /* @__PURE__ */ jsxRuntime.jsx(
287
+ "input",
288
+ {
289
+ type: "text",
290
+ value: P,
291
+ onChange: (n) => {
292
+ u(n.target.value), H(0), L?.(n.target.value);
293
+ },
294
+ placeholder: d("controls.search", "Search..."),
295
+ autoFocus: true
296
+ }
297
+ ) }),
298
+ Q && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-select__loading", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-spinner nice-spinner--sm", style: { margin: "8px auto" } }) }),
299
+ !Q && b.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-select__empty", children: D || d("controls.noResults", "No results found") }) : J && !Array.from(me.keys()).some((n) => n !== "") ? (() => {
300
+ const r = b.length * S, i = Math.max(0, Math.floor(he / S) - 3), U = Math.min(
301
+ b.length,
302
+ Math.ceil((he + F) / S) + 3
303
+ ), Y = b.slice(i, U);
304
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: r, position: "relative" }, children: Y.map((N, xe) => {
305
+ const re = i + xe, Z = f.includes(N.value);
306
+ return /* @__PURE__ */ jsxRuntime.jsx(
307
+ "div",
308
+ {
309
+ role: "option",
310
+ "aria-selected": Z,
311
+ className: `nice-select__option ${Z ? "nice-select__option--selected" : ""} ${re === K ? "nice-select__option--highlighted" : ""} ${N.disabled ? "nice-select__option--disabled" : ""}`,
312
+ style: {
313
+ position: "absolute",
314
+ top: re * S,
315
+ left: 0,
316
+ right: 0,
317
+ height: S,
318
+ display: "flex",
319
+ alignItems: "center",
320
+ padding: "0 12px"
321
+ },
322
+ onClick: () => !N.disabled && X(String(N.value)),
323
+ onMouseEnter: () => H(re),
324
+ children: q ? q(N, Z) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
325
+ N.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { children: N.icon }),
326
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1 }, children: [
327
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: N.label }),
328
+ N.description && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-select__option-desc", children: N.description })
329
+ ] }),
330
+ Z && /* @__PURE__ */ jsxRuntime.jsx(
331
+ "svg",
332
+ {
333
+ className: "nice-select__option-check",
334
+ viewBox: "0 0 20 20",
335
+ fill: "currentColor",
336
+ children: /* @__PURE__ */ jsxRuntime.jsx(
337
+ "path",
338
+ {
339
+ fillRule: "evenodd",
340
+ d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",
341
+ clipRule: "evenodd"
342
+ }
343
+ )
344
+ }
345
+ )
346
+ ] })
347
+ },
348
+ N.value
349
+ );
350
+ }) });
351
+ })() : Array.from(me.entries()).map(([n, r]) => /* @__PURE__ */ jsxRuntime.jsxs(ke.Fragment, { children: [
352
+ n && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-select__group-label", children: n }),
353
+ r.map((i) => {
354
+ const U = f.includes(i.value), Y = b.indexOf(i);
355
+ return /* @__PURE__ */ jsxRuntime.jsx(
356
+ "div",
357
+ {
358
+ role: "option",
359
+ "aria-selected": U,
360
+ className: `nice-select__option ${U ? "nice-select__option--selected" : ""} ${Y === K ? "nice-select__option--highlighted" : ""} ${i.disabled ? "nice-select__option--disabled" : ""}`,
361
+ onClick: () => !i.disabled && X(String(i.value)),
362
+ onMouseEnter: () => H(Y),
363
+ children: q ? q(i, U) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
364
+ i.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { children: i.icon }),
365
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1 }, children: [
366
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: i.label }),
367
+ i.description && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-select__option-desc", children: i.description })
368
+ ] }),
369
+ U && /* @__PURE__ */ jsxRuntime.jsx(
370
+ "svg",
371
+ {
372
+ className: "nice-select__option-check",
373
+ viewBox: "0 0 20 20",
374
+ fill: "currentColor",
375
+ children: /* @__PURE__ */ jsxRuntime.jsx(
376
+ "path",
377
+ {
378
+ fillRule: "evenodd",
379
+ d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",
380
+ clipRule: "evenodd"
381
+ }
382
+ )
383
+ }
384
+ )
385
+ ] })
386
+ },
387
+ i.value
388
+ );
389
+ })
390
+ ] }, n))
391
+ ]
392
+ }
393
+ )
394
+ ] }),
395
+ t && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-field__error", role: "alert", children: t }),
396
+ !t && v && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-field__helper", children: v })
397
+ ] });
398
+ }
399
+ );
400
+ De.displayName = "NiceSelect";
401
+ const Ie = [
402
+ "#ef4444",
403
+ "#f97316",
404
+ "#f59e0b",
405
+ "#84cc16",
406
+ "#10b981",
407
+ "#06b6d4",
408
+ "#3b82f6",
409
+ "#6366f1",
410
+ "#8b5cf6",
411
+ "#ec4899",
412
+ "#64748b",
413
+ "#1e293b"
414
+ ];
415
+ function Ee() {
416
+ return "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0");
417
+ }
418
+ const Ae = ke.forwardRef(
419
+ ({
420
+ label: y,
421
+ helperText: v,
422
+ error: t,
423
+ required: A,
424
+ disabled: s,
425
+ id: a,
426
+ className: B,
427
+ style: M,
428
+ accessMode: x,
429
+ displayStyle: R,
430
+ value: k = "#3b82f6",
431
+ onChange: p,
432
+ presets: g = Ie,
433
+ showInput: h = true,
434
+ showRandom: _ = true,
435
+ showKeyboardHints: C
436
+ }, o) => {
437
+ const m = coreBpghV7Ls.f(x, a);
438
+ if (m === "hidden")
439
+ return null;
440
+ (m === "disabled" || m === "readOnly") && (s = true);
441
+ const { t: w } = coreBpghV7Ls.g(), D = coreBpghV7Ls.b(a);
442
+ coreBpghV7Ls.i("input", R);
443
+ const F = ke.useRef(null), I = ke.useCallback(() => {
444
+ s || p?.(Ee());
445
+ }, [s, p]), j = ke.useMemo(
446
+ () => [
447
+ { key: "Enter", description: w("shortcuts.openPicker", "Open color picker") },
448
+ { key: "Arrow keys", description: w("shortcuts.navigatePresets", "Navigate presets") }
449
+ ],
450
+ [w]
451
+ );
452
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `nice-field ${B || ""}`, style: M, children: [
453
+ y && /* @__PURE__ */ jsxRuntime.jsxs(
454
+ "label",
455
+ {
456
+ htmlFor: D,
457
+ className: `nice-field__label ${A ? "nice-field__label--required" : ""}`,
458
+ children: [
459
+ y,
460
+ C && /* @__PURE__ */ jsxRuntime.jsx(coreBpghV7Ls.N, { shortcuts: j, size: "sm" })
461
+ ]
462
+ }
463
+ ),
464
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-color-picker", children: [
465
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-color-picker__preview-row", children: [
466
+ /* @__PURE__ */ jsxRuntime.jsx(
467
+ "div",
468
+ {
469
+ className: "nice-color-picker__swatch",
470
+ style: { background: k },
471
+ onClick: () => F.current?.click(),
472
+ role: "button",
473
+ tabIndex: 0,
474
+ "aria-label": "Pick color",
475
+ children: /* @__PURE__ */ jsxRuntime.jsx(
476
+ "input",
477
+ {
478
+ ref: (c) => {
479
+ F.current = c, typeof o == "function" ? o(c) : o && (o.current = c);
480
+ },
481
+ type: "color",
482
+ className: "nice-color-picker__native",
483
+ id: D,
484
+ value: k,
485
+ disabled: s,
486
+ onChange: (c) => p?.(c.target.value)
487
+ }
488
+ )
489
+ }
490
+ ),
491
+ h && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-input nice-input--sm", style: { width: 100 }, children: /* @__PURE__ */ jsxRuntime.jsx(
492
+ "input",
493
+ {
494
+ className: "nice-input__native",
495
+ type: "text",
496
+ value: k,
497
+ disabled: s,
498
+ onChange: (c) => p?.(c.target.value),
499
+ maxLength: 7
500
+ }
501
+ ) }),
502
+ _ && /* @__PURE__ */ jsxRuntime.jsx(
503
+ "button",
504
+ {
505
+ type: "button",
506
+ className: "nice-btn nice-btn--outline nice-btn--sm nice-color-picker__random",
507
+ onClick: I,
508
+ disabled: s,
509
+ title: "Random color",
510
+ "aria-label": "Random color",
511
+ children: "🎲"
512
+ }
513
+ )
514
+ ] }),
515
+ g.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-color-picker__presets", children: g.map((c) => /* @__PURE__ */ jsxRuntime.jsx(
516
+ "div",
517
+ {
518
+ className: `nice-color-picker__preset ${k === c ? "nice-color-picker__preset--active" : ""}`,
519
+ style: { background: c },
520
+ onClick: () => p?.(c),
521
+ role: "button",
522
+ tabIndex: 0,
523
+ "aria-label": c
524
+ },
525
+ c
526
+ )) })
527
+ ] }),
528
+ t && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-field__error", role: "alert", children: t }),
529
+ !t && v && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-field__helper", children: v })
530
+ ] });
531
+ }
532
+ );
533
+ Ae.displayName = "NiceColorPicker";
534
+ const Fe = ke.forwardRef(
535
+ ({
536
+ children: y,
537
+ variant: v = "primary",
538
+ size: t = "md",
539
+ type: A = "button",
540
+ disabled: s,
541
+ loading: a,
542
+ fullWidth: B,
543
+ onClick: M,
544
+ leftIcon: x,
545
+ rightIcon: R,
546
+ className: k,
547
+ style: p,
548
+ id: g,
549
+ accessMode: h,
550
+ displayStyle: _,
551
+ ...C
552
+ }, o) => {
553
+ const m = coreBpghV7Ls.f(h, g);
554
+ if (m === "hidden")
555
+ return null;
556
+ (m === "disabled" || m === "readOnly") && (s = true);
557
+ const w = coreBpghV7Ls.h("button", _), D = coreBpghV7Ls.i("button", _);
558
+ return /* @__PURE__ */ jsxRuntime.jsxs(
559
+ "button",
560
+ {
561
+ ref: o,
562
+ type: A,
563
+ id: g,
564
+ className: `nice-btn nice-btn--${v} nice-btn--${t} nice-btn--ds-${D} ${B ? "nice-btn--full-width" : ""} ${a ? "nice-btn--loading" : ""} ${k || ""}`,
565
+ style: { ...w, ...p },
566
+ disabled: s || a,
567
+ "aria-busy": a || void 0,
568
+ "aria-disabled": s || a || void 0,
569
+ onClick: M,
570
+ ...C,
571
+ children: [
572
+ a && /* @__PURE__ */ jsxRuntime.jsx(
573
+ "svg",
574
+ {
575
+ className: "nice-btn__spinner",
576
+ viewBox: "0 0 24 24",
577
+ fill: "none",
578
+ stroke: "currentColor",
579
+ strokeWidth: "3",
580
+ "aria-hidden": "true",
581
+ children: /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10", strokeDasharray: "31.4 31.4", strokeLinecap: "round" })
582
+ }
583
+ ),
584
+ !a && x && /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: x }),
585
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: y }),
586
+ !a && R && /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: R })
587
+ ]
588
+ }
589
+ );
590
+ }
591
+ );
592
+ Fe.displayName = "NiceButton";
593
+
594
+ exports.N = Ae;
595
+ exports.a = De;
596
+ exports.b = Re;
597
+ exports.c = Fe;
598
+ //# sourceMappingURL=NiceButton-D9l39Rs7.js.map