@nice2dev/ui 1.0.12 → 1.0.14

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 (52) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +53 -36
  3. package/css/legacy-bg-text-aliases.css +83 -0
  4. package/dist/NiceErrorBoundary-BLTq8mPU.cjs +1 -0
  5. package/dist/NiceErrorBoundary-Bjw5U31n.js +762 -0
  6. package/dist/NiceForm-CUlhtlHw.js +5357 -0
  7. package/dist/NiceForm-DTgIGX88.cjs +382 -0
  8. package/dist/NiceForm.css +1 -1
  9. package/dist/NiceModal-C_t2qqZd.js +95 -0
  10. package/dist/NiceModal-FQqBxCij.cjs +1 -0
  11. package/dist/NiceModuleLifecyclePanel-CCFHxKIu.js +6343 -0
  12. package/dist/NiceModuleLifecyclePanel-D8cIOI8I.cjs +1 -0
  13. package/dist/NiceModuleLifecyclePanel.css +1 -1
  14. package/dist/NicePagination-BVkkePJU.js +171 -0
  15. package/dist/NicePagination-DGd3Hrh9.cjs +1 -0
  16. package/dist/NicePinCodeInput-CDtodnIM.js +11875 -0
  17. package/dist/NicePinCodeInput-DytLfqZL.cjs +419 -0
  18. package/dist/NicePinCodeInput.css +1 -1
  19. package/dist/NiceSavedQueryPanel-CbR3EDQU.cjs +596 -0
  20. package/dist/NiceSavedQueryPanel-DJqCNWYZ.js +6446 -0
  21. package/dist/NiceTabs-B-9_mzpc.js +1624 -0
  22. package/dist/NiceTabs-CHg36waF.cjs +1 -0
  23. package/dist/NiceWindow-BxGVzUs2.js +1409 -0
  24. package/dist/NiceWindow-HhPIzPzs.cjs +1 -0
  25. package/dist/charts-Us8Ep8MJ.cjs +761 -0
  26. package/dist/charts-fO6InNZd.js +4645 -0
  27. package/dist/charts.cjs +1 -1
  28. package/dist/charts.mjs +1 -1
  29. package/dist/core-B-tu8l9M.cjs +96 -0
  30. package/dist/core-BJ_UNMlX.js +22276 -0
  31. package/dist/data.cjs +1 -1
  32. package/dist/data.d.ts +7 -0
  33. package/dist/data.mjs +1 -1
  34. package/dist/editors.cjs +1 -1
  35. package/dist/editors.mjs +3 -3
  36. package/dist/feedback.cjs +1 -1
  37. package/dist/feedback.mjs +2 -2
  38. package/dist/index-DHc_KZkF.js +61311 -0
  39. package/dist/index-drIVMHeC.cjs +5194 -0
  40. package/dist/index.cjs +1 -1
  41. package/dist/index.css +1 -1
  42. package/dist/index.d.ts +1140 -63
  43. package/dist/index.mjs +833 -819
  44. package/dist/lazy.cjs +1 -1
  45. package/dist/lazy.mjs +3 -3
  46. package/dist/navigation.cjs +1 -1
  47. package/dist/navigation.d.ts +309 -70
  48. package/dist/navigation.mjs +91 -90
  49. package/dist/overlays.cjs +1 -1
  50. package/dist/overlays.mjs +2 -2
  51. package/dist/style.css +7 -0
  52. package/package.json +9 -5
@@ -0,0 +1,1624 @@
1
+ import { jsxs as _, jsx as e, Fragment as Ee } from "react/jsx-runtime";
2
+ import { B as xe, $ as Re, S as Ie, o as He, a as $e, d as je, c as Ve, O as Ae, f as Ke, Z as Te, j as Ge, b as Xe } from "./core-BJ_UNMlX.js";
3
+ import Ze, { forwardRef as Me, useCallback as ne, useMemo as oe, useState as ue, useRef as Fe, useLayoutEffect as qe, useEffect as Ye } from "react";
4
+ import ze from "react-dom";
5
+ const Je = Me(
6
+ ({
7
+ label: l,
8
+ helperText: h,
9
+ error: t,
10
+ required: d,
11
+ disabled: i,
12
+ readOnly: n,
13
+ size: a = "md",
14
+ name: $,
15
+ id: u,
16
+ className: o,
17
+ style: f,
18
+ accessMode: D,
19
+ displayStyle: Z,
20
+ variant: m,
21
+ value: x,
22
+ defaultValue: R,
23
+ onChange: p,
24
+ onBlur: J,
25
+ onKeyDown: L,
26
+ placeholder: k,
27
+ type: E = "text",
28
+ maxLength: g,
29
+ prefix: I,
30
+ suffix: j,
31
+ clearable: S,
32
+ autoFocus: A,
33
+ submitOnEnter: w,
34
+ onSubmit: B,
35
+ showKeyboardHints: K,
36
+ labelPlacement: F,
37
+ errorPlacement: O,
38
+ loading: re,
39
+ labelWidth: se,
40
+ controlWidth: Y,
41
+ displayMode: G,
42
+ ...pe
43
+ }, b) => {
44
+ const N = xe(D, u), V = N === "hidden";
45
+ N === "disabled" && (i = !0), N === "readOnly" && (n = !0);
46
+ const { t: H } = Re(), M = Ie(u), W = He("input", Z), ae = $e("input", Z), he = m === "filled" ? "filled" : m === "underlined" ? "underlined" : "", z = ne(() => p?.(""), [p]), X = je({ enabled: G, readOnly: n, disabled: i }), de = Ve({
47
+ enabled: w,
48
+ onSubmit: B
49
+ }), ie = ne(
50
+ (v) => {
51
+ de(v), L?.(v);
52
+ },
53
+ [de, L]
54
+ ), r = oe(() => {
55
+ const v = [];
56
+ return w && v.push({ key: "Enter", description: H("shortcuts.submit", "Submit") }), S && v.push({ key: "Escape", description: H("shortcuts.clear", "Clear") }), v;
57
+ }, [w, S, H]);
58
+ return V ? null : /* @__PURE__ */ _(
59
+ "div",
60
+ {
61
+ className: `nice-field nice-field--${a} ${F === "left" ? "nice-field--label-left" : ""} ${F === "inside" ? "nice-field--label-inside" : ""} ${re ? "nice-field--loading" : ""} ${o || ""}`,
62
+ style: {
63
+ ...f,
64
+ ...se != null && {
65
+ "--nice-field-label-width": typeof se == "number" ? `${se}px` : se
66
+ },
67
+ ...Y != null && {
68
+ "--nice-field-control-width": typeof Y == "number" ? `${Y}px` : Y
69
+ }
70
+ },
71
+ "aria-busy": re || void 0,
72
+ "data-floating": F === "inside" && x ? "true" : void 0,
73
+ children: [
74
+ l && F !== "inside" && /* @__PURE__ */ _(
75
+ "label",
76
+ {
77
+ htmlFor: M,
78
+ className: `nice-field__label ${d ? "nice-field__label--required" : ""}`,
79
+ children: [
80
+ l,
81
+ K && r.length > 0 && /* @__PURE__ */ e(Ae, { shortcuts: r, size: "sm" })
82
+ ]
83
+ }
84
+ ),
85
+ /* @__PURE__ */ _("div", { className: "nice-field__control", children: [
86
+ X.isDisplay ? /* @__PURE__ */ e(
87
+ Ke,
88
+ {
89
+ value: x ?? R ?? "",
90
+ placeholder: k,
91
+ disabled: i,
92
+ readOnly: n,
93
+ onActivate: X.enterEdit,
94
+ ariaLabel: l
95
+ }
96
+ ) : /* @__PURE__ */ _(
97
+ "div",
98
+ {
99
+ className: `nice-input nice-input--${a} nice-input--ds-${he || ae} ${t ? "nice-input--error" : ""} ${i ? "nice-input--disabled" : ""} ${n ? "nice-input--readonly" : ""}`,
100
+ style: m ? void 0 : W,
101
+ children: [
102
+ I && /* @__PURE__ */ e("span", { className: "nice-input__icon", children: I }),
103
+ /* @__PURE__ */ e(
104
+ "input",
105
+ {
106
+ ref: (v) => {
107
+ typeof b == "function" ? b(v) : b && (b.current = v), X.autoFocusRef(v);
108
+ },
109
+ id: M,
110
+ className: "nice-input__native",
111
+ type: E,
112
+ name: $,
113
+ value: x,
114
+ defaultValue: R,
115
+ placeholder: k,
116
+ disabled: i || re,
117
+ readOnly: n,
118
+ maxLength: g,
119
+ autoFocus: A,
120
+ "aria-invalid": !!t,
121
+ "aria-describedby": t ? `${M}-error` : h ? `${M}-helper` : void 0,
122
+ onChange: (v) => p?.(v.target.value),
123
+ onBlur: (v) => {
124
+ G && X.exitEdit(), J?.(v);
125
+ },
126
+ onKeyDown: ie,
127
+ ...pe
128
+ }
129
+ ),
130
+ S && x && /* @__PURE__ */ e(
131
+ "button",
132
+ {
133
+ type: "button",
134
+ className: "nice-input__clear",
135
+ onClick: z,
136
+ "aria-label": H("controls.clear", "Clear"),
137
+ children: "✕"
138
+ }
139
+ ),
140
+ j && /* @__PURE__ */ e("span", { className: "nice-input__icon", children: j }),
141
+ l && F === "inside" && /* @__PURE__ */ e(
142
+ "label",
143
+ {
144
+ htmlFor: M,
145
+ className: `nice-input__floating-label ${d ? "nice-input__floating-label--required" : ""}`,
146
+ children: l
147
+ }
148
+ )
149
+ ]
150
+ }
151
+ ),
152
+ re && /* @__PURE__ */ e("span", { className: "nice-field__spinner", children: /* @__PURE__ */ e("span", { className: "nice-spinner nice-spinner--sm" }) }),
153
+ O === "right" && t && /* @__PURE__ */ e("div", { id: `${M}-error`, className: "nice-field__error", role: "alert", children: t }),
154
+ O === "right" && !t && h && /* @__PURE__ */ e("div", { id: `${M}-helper`, className: "nice-field__helper", children: h })
155
+ ] }),
156
+ O !== "right" && t && /* @__PURE__ */ e("div", { id: `${M}-error`, className: "nice-field__error", role: "alert", children: t }),
157
+ O !== "right" && !t && h && /* @__PURE__ */ e("div", { id: `${M}-helper`, className: "nice-field__helper", children: h })
158
+ ]
159
+ }
160
+ );
161
+ }
162
+ );
163
+ Je.displayName = "NiceTextInput";
164
+ const Qe = Me(
165
+ ({
166
+ label: l,
167
+ helperText: h,
168
+ error: t,
169
+ required: d,
170
+ disabled: i,
171
+ readOnly: n,
172
+ size: a = "md",
173
+ name: $,
174
+ id: u,
175
+ className: o,
176
+ style: f,
177
+ accessMode: D,
178
+ displayStyle: Z,
179
+ value: m,
180
+ onChange: x,
181
+ onBlur: R,
182
+ onKeyDown: p,
183
+ placeholder: J,
184
+ min: L,
185
+ max: k,
186
+ step: E = 1,
187
+ precision: g,
188
+ prefix: I,
189
+ prefixType: j = "label",
190
+ prefixOptions: S,
191
+ prefixValue: A,
192
+ onPrefixChange: w,
193
+ suffix: B,
194
+ showStepper: K = !0,
195
+ submitOnEnter: F,
196
+ onSubmit: O,
197
+ showKeyboardHints: re,
198
+ labelPlacement: se,
199
+ errorPlacement: Y,
200
+ loading: G,
201
+ labelWidth: pe,
202
+ controlWidth: b,
203
+ formatPreset: N,
204
+ format: V,
205
+ suffixType: H = "label",
206
+ suffixOptions: M,
207
+ suffixValue: W,
208
+ onSuffixChange: ae,
209
+ displayMode: he
210
+ }, z) => {
211
+ const X = xe(D, u), de = X === "hidden";
212
+ X === "disabled" && (i = !0), X === "readOnly" && (n = !0);
213
+ const { t: ie } = Re(), r = Ie(u), v = He("input", Z), q = $e("input", Z), [C, Q] = ue(!1), [P, be] = ue(null), Ne = je({ enabled: he, readOnly: n, disabled: i }), fe = oe(() => {
214
+ let c = 3;
215
+ return k != null && (c = String(Math.abs(Math.floor(k))).length), L != null && L < 0 && (c += 1), g && (c += g + 1), Math.max(3, c) + 1;
216
+ }, [k, L, g]), Ce = ne(
217
+ (c) => {
218
+ if (V)
219
+ return V(c);
220
+ if (!N)
221
+ return g != null ? c.toFixed(g) : String(c);
222
+ switch (N) {
223
+ case "integer":
224
+ return Math.round(c).toLocaleString();
225
+ case "decimal":
226
+ return c.toLocaleString(void 0, {
227
+ minimumFractionDigits: g ?? 2,
228
+ maximumFractionDigits: g ?? 2
229
+ });
230
+ case "money":
231
+ return c.toLocaleString(void 0, {
232
+ minimumFractionDigits: g ?? 2,
233
+ maximumFractionDigits: g ?? 2,
234
+ useGrouping: !0
235
+ });
236
+ case "percent":
237
+ return (c * 100).toLocaleString(void 0, {
238
+ minimumFractionDigits: g ?? 0,
239
+ maximumFractionDigits: g ?? 2
240
+ }) + "%";
241
+ default:
242
+ return String(c);
243
+ }
244
+ },
245
+ [V, N, g]
246
+ ), De = oe(() => C && P !== null ? P : m == null ? "" : C ? g != null ? m.toFixed(g) : String(m) : Ce(m), [m, C, P, Ce, g]), me = m != null && m < 0, te = !!(I || j === "select" && S && S.length > 0), ee = me && te && !C, Be = ee ? De.replace(/^[-−]/, "") : De, _e = ne(
247
+ (c) => {
248
+ let y = c;
249
+ return L !== void 0 && (y = Math.max(L, y)), k !== void 0 && (y = Math.min(k, y)), g !== void 0 && (y = parseFloat(y.toFixed(g))), y;
250
+ },
251
+ [L, k, g]
252
+ ), Ue = ne(
253
+ (c) => {
254
+ const y = c.target.value;
255
+ if (be(y), y === "" || y === "-" || y === "." || y === "-.") {
256
+ y === "" && x?.(null);
257
+ return;
258
+ }
259
+ const le = parseFloat(y);
260
+ if (!isNaN(le)) {
261
+ let ge = le;
262
+ L !== void 0 && (ge = Math.max(L, ge)), k !== void 0 && (ge = Math.min(k, ge)), x?.(ge);
263
+ }
264
+ },
265
+ [x, L, k]
266
+ ), ye = ne(() => {
267
+ const c = ke.current, y = _e((c ?? 0) + E);
268
+ ke.current = y, x?.(y);
269
+ }, [E, x, _e]), Se = ne(() => {
270
+ const c = ke.current, y = _e((c ?? 0) - E);
271
+ ke.current = y, x?.(y);
272
+ }, [E, x, _e]), ke = Fe(m);
273
+ ke.current = m;
274
+ const s = Fe(null), T = ne(() => {
275
+ s.current && (clearTimeout(s.current), s.current = null);
276
+ }, []), U = ne(
277
+ (c) => {
278
+ T();
279
+ let y = 300;
280
+ const le = () => {
281
+ c(), y = Math.max(30, y * 0.82), s.current = setTimeout(le, y);
282
+ };
283
+ s.current = setTimeout(le, 400);
284
+ },
285
+ [T]
286
+ ), ve = Ve({
287
+ enabled: F,
288
+ onSubmit: O
289
+ }), Le = ne(
290
+ (c) => {
291
+ ve(c), c.key === "ArrowUp" ? (c.preventDefault(), ye()) : c.key === "ArrowDown" && (c.preventDefault(), Se()), p?.(c);
292
+ },
293
+ [ve, p, ye, Se]
294
+ ), ce = oe(() => {
295
+ const c = [];
296
+ return F && c.push(Te.submit), K && (c.push({ key: "ArrowUp", description: ie("shortcuts.increment", "Increase value") }), c.push({ key: "ArrowDown", description: ie("shortcuts.decrement", "Decrease value") })), c;
297
+ }, [F, K, ie]);
298
+ return de ? null : /* @__PURE__ */ _(
299
+ "div",
300
+ {
301
+ className: `nice-field nice-field--${a} ${se === "left" ? "nice-field--label-left" : ""} ${G ? "nice-field--loading" : ""} ${o || ""}`,
302
+ style: {
303
+ ...f,
304
+ ...pe != null && {
305
+ "--nice-field-label-width": typeof pe == "number" ? `${pe}px` : pe
306
+ },
307
+ ...b != null && {
308
+ "--nice-field-control-width": typeof b == "number" ? `${b}px` : b
309
+ }
310
+ },
311
+ "aria-busy": G || void 0,
312
+ children: [
313
+ l && /* @__PURE__ */ _(
314
+ "label",
315
+ {
316
+ htmlFor: r,
317
+ className: `nice-field__label ${d ? "nice-field__label--required" : ""}`,
318
+ children: [
319
+ l,
320
+ re && ce.length > 0 && /* @__PURE__ */ e(Ae, { shortcuts: ce, size: "sm" })
321
+ ]
322
+ }
323
+ ),
324
+ /* @__PURE__ */ _("div", { className: "nice-field__control", children: [
325
+ Ne.isDisplay ? /* @__PURE__ */ e(
326
+ Ke,
327
+ {
328
+ value: m == null ? "" : I ? /* @__PURE__ */ _(Ee, { children: [
329
+ I,
330
+ De
331
+ ] }) : De,
332
+ placeholder: J,
333
+ disabled: i,
334
+ readOnly: n,
335
+ onActivate: Ne.enterEdit,
336
+ ariaLabel: l
337
+ }
338
+ ) : /* @__PURE__ */ e(Ee, { children: /* @__PURE__ */ _(
339
+ "div",
340
+ {
341
+ className: `nice-input nice-input--number nice-input--${a} nice-input--ds-${q} ${t ? "nice-input--error" : ""} ${i ? "nice-input--disabled" : ""} ${n ? "nice-input--readonly" : ""}`,
342
+ style: v,
343
+ children: [
344
+ K && !n && /* @__PURE__ */ e(
345
+ "button",
346
+ {
347
+ type: "button",
348
+ className: "nice-input__clear nice-input__minus",
349
+ onClick: Se,
350
+ onMouseDown: () => U(Se),
351
+ onMouseUp: T,
352
+ onMouseLeave: T,
353
+ disabled: i,
354
+ "aria-label": ie("controls.decrement", "Decrement"),
355
+ children: "−"
356
+ }
357
+ ),
358
+ j === "select" && S && S.length > 0 ? /* @__PURE__ */ _(Ee, { children: [
359
+ ee && /* @__PURE__ */ e("span", { className: "nice-input__sign", children: "−" }),
360
+ /* @__PURE__ */ e(
361
+ "select",
362
+ {
363
+ className: "nice-input__suffix-select nice-input__icon--prefix",
364
+ value: A ?? S[0]?.value,
365
+ disabled: i,
366
+ onChange: (c) => {
367
+ const y = c.target.value, le = S.find(
368
+ (we) => we.value === (A ?? S[0]?.value)
369
+ ), ge = S.find((we) => we.value === y);
370
+ w?.(y, le?.weight, ge?.weight);
371
+ },
372
+ children: S.map((c) => /* @__PURE__ */ e("option", { value: c.value, children: c.label }, c.value))
373
+ }
374
+ )
375
+ ] }) : I ? /* @__PURE__ */ _("span", { className: "nice-input__icon nice-input__icon--prefix", children: [
376
+ ee && /* @__PURE__ */ e("span", { className: "nice-input__sign", children: "−" }),
377
+ I
378
+ ] }) : null,
379
+ /* @__PURE__ */ e(
380
+ "input",
381
+ {
382
+ ref: (c) => {
383
+ typeof z == "function" ? z(c) : z && (z.current = c), Ne.autoFocusRef(c);
384
+ },
385
+ id: r,
386
+ className: "nice-input__native",
387
+ type: !C && (V || N) ? "text" : "number",
388
+ name: $,
389
+ value: Be,
390
+ placeholder: J,
391
+ min: L,
392
+ max: k,
393
+ step: E,
394
+ disabled: i || G,
395
+ readOnly: n,
396
+ "aria-invalid": !!t,
397
+ onChange: Ue,
398
+ onFocus: (c) => {
399
+ Q(!0), be(null), c.target.select();
400
+ },
401
+ onBlur: (c) => {
402
+ if (Q(!1), be(null), m != null && g !== void 0) {
403
+ const y = parseFloat(m.toFixed(g));
404
+ y !== m && x?.(y);
405
+ }
406
+ he && Ne.exitEdit(), R?.(c);
407
+ },
408
+ onKeyDown: Le,
409
+ style: { width: `${fe}ch` }
410
+ }
411
+ ),
412
+ H === "select" && M && M.length > 0 ? /* @__PURE__ */ e(
413
+ "select",
414
+ {
415
+ className: "nice-input__suffix-select nice-input__icon--suffix",
416
+ value: W ?? M[0]?.value,
417
+ disabled: i,
418
+ onChange: (c) => {
419
+ const y = c.target.value, le = M.find(
420
+ (we) => we.value === (W ?? M[0]?.value)
421
+ ), ge = M.find((we) => we.value === y);
422
+ ae?.(y, le?.weight, ge?.weight);
423
+ },
424
+ children: M.map((c) => /* @__PURE__ */ e("option", { value: c.value, children: c.label }, c.value))
425
+ }
426
+ ) : B ? /* @__PURE__ */ e("span", { className: "nice-input__icon nice-input__icon--suffix", children: B }) : null,
427
+ K && !n && /* @__PURE__ */ e(
428
+ "button",
429
+ {
430
+ type: "button",
431
+ className: "nice-input__clear nice-input__plus",
432
+ onClick: ye,
433
+ onMouseDown: () => U(ye),
434
+ onMouseUp: T,
435
+ onMouseLeave: T,
436
+ disabled: i,
437
+ "aria-label": ie("controls.increment", "Increment"),
438
+ children: "+"
439
+ }
440
+ )
441
+ ]
442
+ }
443
+ ) }),
444
+ G && /* @__PURE__ */ e("span", { className: "nice-field__spinner", children: /* @__PURE__ */ e("span", { className: "nice-spinner nice-spinner--sm" }) }),
445
+ Y === "right" && t && /* @__PURE__ */ e("div", { className: "nice-field__error", role: "alert", children: t }),
446
+ Y === "right" && !t && h && /* @__PURE__ */ e("div", { className: "nice-field__helper", children: h })
447
+ ] }),
448
+ Y !== "right" && t && /* @__PURE__ */ e("div", { className: "nice-field__error", role: "alert", children: t }),
449
+ Y !== "right" && !t && h && /* @__PURE__ */ e("div", { className: "nice-field__helper", children: h })
450
+ ]
451
+ }
452
+ );
453
+ }
454
+ );
455
+ Qe.displayName = "NiceNumberInput";
456
+ const Pe = Me(
457
+ ({
458
+ label: l,
459
+ helperText: h,
460
+ error: t,
461
+ required: d,
462
+ disabled: i,
463
+ size: n = "md",
464
+ name: a,
465
+ id: $,
466
+ className: u,
467
+ style: o,
468
+ accessMode: f,
469
+ displayStyle: D,
470
+ options: Z,
471
+ value: m,
472
+ onChange: x,
473
+ placeholder: R,
474
+ multiple: p = !1,
475
+ searchable: J = !1,
476
+ clearable: L = !1,
477
+ emptyText: k,
478
+ maxHeight: E = 240,
479
+ optionsSource: g,
480
+ valueField: I,
481
+ labelField: j,
482
+ virtualScroll: S,
483
+ optionHeight: A = 36,
484
+ onSearch: w,
485
+ loading: B,
486
+ renderOption: K,
487
+ multipleAutosize: F = !1,
488
+ showKeyboardHints: O,
489
+ labelPlacement: re,
490
+ errorPlacement: se,
491
+ labelWidth: Y,
492
+ controlWidth: G,
493
+ displayMode: pe
494
+ }, b) => {
495
+ const N = xe(f, $), V = N === "hidden";
496
+ (N === "disabled" || N === "readOnly") && (i = !0);
497
+ const { t: H } = Re(), M = He("input", D), W = $e("input", D), ae = Ie($), he = je({ enabled: pe, disabled: i }), [z, X] = ue(!1), [de, ie] = ue(""), [r, v] = ue(-1), [q, C] = ue(0), Q = Fe(null), P = Fe(null), [be, Ne] = ue(null);
498
+ qe(() => {
499
+ !B && P.current && Ne(P.current.offsetWidth);
500
+ }, [B, m, D]);
501
+ const [fe, Ce] = ue(null);
502
+ qe(() => {
503
+ p && !F && P.current && fe == null && Ce(P.current.offsetWidth);
504
+ }, [p, F, fe]);
505
+ const De = Ge(
506
+ g ?? null,
507
+ I ?? g?.keyField ?? "id",
508
+ j ?? "name"
509
+ ), me = g ? De.options : (Z ?? []).map(
510
+ (s) => typeof s == "string" ? { value: s, label: s } : s
511
+ );
512
+ Xe(Q, () => {
513
+ X(!1), ie("");
514
+ });
515
+ const te = oe(() => m ? Array.isArray(m) ? m : [m] : [], [m]), ee = oe(() => {
516
+ if (!de && !w || w)
517
+ return me;
518
+ const s = de.toLowerCase();
519
+ return me.filter(
520
+ (T) => T.label.toLowerCase().includes(s) || String(T.value).toLowerCase().includes(s)
521
+ );
522
+ }, [me, de, w]), Be = oe(() => {
523
+ const s = /* @__PURE__ */ new Map();
524
+ for (const T of ee) {
525
+ const U = T.group || "";
526
+ s.has(U) || s.set(U, []), s.get(U).push(T);
527
+ }
528
+ return s;
529
+ }, [ee]), _e = ne(
530
+ (s) => {
531
+ if (p) {
532
+ const T = te.includes(s) ? te.filter((U) => U !== s) : [...te, s];
533
+ x?.(T);
534
+ } else
535
+ x?.(s), X(!1), ie("");
536
+ },
537
+ [p, te, x]
538
+ ), Ue = ne(
539
+ (s) => {
540
+ if (s.key === "Escape") {
541
+ X(!1), ie("");
542
+ return;
543
+ }
544
+ if (s.key === "Enter" || s.key === " ") {
545
+ if (!z) {
546
+ X(!0), s.preventDefault();
547
+ return;
548
+ }
549
+ r >= 0 && ee[r] && (_e(ee[r].value), s.preventDefault());
550
+ return;
551
+ }
552
+ s.key === "ArrowDown" && (s.preventDefault(), v((T) => Math.min(T + 1, ee.length - 1))), s.key === "ArrowUp" && (s.preventDefault(), v((T) => Math.max(T - 1, 0)));
553
+ },
554
+ [z, r, ee, _e]
555
+ ), ye = oe(() => te.length === 0 ? null : p ? te.map((s) => me.find((T) => T.value === s)?.label || s).join(", ") : me.find((s) => s.value === te[0])?.label || te[0], [te, me, p]), Se = ne(
556
+ (s) => {
557
+ s.stopPropagation(), x?.(p ? [] : "");
558
+ },
559
+ [x, p]
560
+ ), ke = oe(
561
+ () => [
562
+ { key: "Enter", description: H("shortcuts.select", "Select") },
563
+ { key: "Space", description: H("shortcuts.openDropdown", "Open dropdown") },
564
+ Te.moveUp,
565
+ Te.moveDown,
566
+ Te.cancel
567
+ ],
568
+ [H]
569
+ );
570
+ return V ? null : /* @__PURE__ */ _(
571
+ "div",
572
+ {
573
+ className: `nice-field ${G == null ? "nice-field--select-auto" : ""} nice-field--${n} ${re === "left" ? "nice-field--label-left" : ""} ${B ? "nice-field--loading" : ""} ${u || ""}`,
574
+ style: {
575
+ ...o,
576
+ ...Y != null && {
577
+ "--nice-field-label-width": typeof Y == "number" ? `${Y}px` : Y
578
+ },
579
+ ...G != null && {
580
+ "--nice-field-control-width": typeof G == "number" ? `${G}px` : G
581
+ },
582
+ ...B && be != null && { "--nice-select-locked-width": `${be}px` }
583
+ },
584
+ "aria-busy": B || void 0,
585
+ children: [
586
+ l && /* @__PURE__ */ _(
587
+ "label",
588
+ {
589
+ htmlFor: ae,
590
+ className: `nice-field__label ${d ? "nice-field__label--required" : ""}`,
591
+ children: [
592
+ l,
593
+ O && /* @__PURE__ */ e(Ae, { shortcuts: ke, size: "sm" })
594
+ ]
595
+ }
596
+ ),
597
+ /* @__PURE__ */ _("div", { className: "nice-field__control", children: [
598
+ he.isDisplay ? /* @__PURE__ */ e(
599
+ Ke,
600
+ {
601
+ value: ye,
602
+ placeholder: R || H("controls.select", "Select..."),
603
+ disabled: i,
604
+ onActivate: () => {
605
+ he.enterEdit(), X(!0);
606
+ },
607
+ ariaLabel: l
608
+ }
609
+ ) : /* @__PURE__ */ _("div", { className: "nice-select", ref: Q, children: [
610
+ /* @__PURE__ */ _(
611
+ "button",
612
+ {
613
+ ref: (s) => {
614
+ P.current = s, typeof b == "function" ? b(s) : b && (b.current = s);
615
+ },
616
+ type: "button",
617
+ id: ae,
618
+ role: "combobox",
619
+ "aria-expanded": z,
620
+ "aria-haspopup": "listbox",
621
+ "aria-invalid": !!t,
622
+ className: `nice-select__trigger nice-select__trigger--${n} nice-select--ds-${W} ${z ? "nice-select__trigger--open" : ""} ${t ? "nice-select__trigger--error" : ""} ${i ? "nice-select__trigger--disabled" : ""}`,
623
+ style: {
624
+ ...M,
625
+ ...p && !F && fe != null ? {
626
+ width: fe,
627
+ maxWidth: fe,
628
+ overflow: "hidden"
629
+ } : {}
630
+ },
631
+ disabled: i,
632
+ onClick: () => X(!z),
633
+ onKeyDown: Ue,
634
+ children: [
635
+ ye ? /* @__PURE__ */ e(
636
+ "span",
637
+ {
638
+ style: p && !F ? {
639
+ flex: 1,
640
+ minWidth: 0,
641
+ overflow: "hidden",
642
+ textOverflow: "ellipsis",
643
+ whiteSpace: "nowrap"
644
+ } : void 0,
645
+ children: ye
646
+ }
647
+ ) : /* @__PURE__ */ e("span", { className: "nice-select__placeholder", children: R || H("controls.select", "Select...") }),
648
+ /* @__PURE__ */ _("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
649
+ L && te.length > 0 && /* @__PURE__ */ e(
650
+ "span",
651
+ {
652
+ className: "nice-input__clear",
653
+ onClick: Se,
654
+ role: "button",
655
+ "aria-label": H("controls.clear", "Clear"),
656
+ children: "✕"
657
+ }
658
+ ),
659
+ /* @__PURE__ */ e(
660
+ "svg",
661
+ {
662
+ className: `nice-select__chevron ${z ? "nice-select__chevron--open" : ""}`,
663
+ viewBox: "0 0 20 20",
664
+ fill: "currentColor",
665
+ children: /* @__PURE__ */ e(
666
+ "path",
667
+ {
668
+ fillRule: "evenodd",
669
+ 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",
670
+ clipRule: "evenodd"
671
+ }
672
+ )
673
+ }
674
+ )
675
+ ] })
676
+ ]
677
+ }
678
+ ),
679
+ z && /* @__PURE__ */ _(
680
+ "div",
681
+ {
682
+ className: "nice-select__dropdown",
683
+ role: "listbox",
684
+ style: { maxHeight: E },
685
+ onScroll: S ? (s) => C(s.currentTarget.scrollTop) : void 0,
686
+ children: [
687
+ (J || w) && /* @__PURE__ */ e("div", { className: "nice-select__search", children: /* @__PURE__ */ e(
688
+ "input",
689
+ {
690
+ type: "text",
691
+ value: de,
692
+ onChange: (s) => {
693
+ ie(s.target.value), v(0), w?.(s.target.value);
694
+ },
695
+ placeholder: H("controls.search", "Search..."),
696
+ autoFocus: !0
697
+ }
698
+ ) }),
699
+ B && /* @__PURE__ */ e("div", { className: "nice-select__loading", children: /* @__PURE__ */ e(
700
+ "div",
701
+ {
702
+ className: "nice-spinner nice-spinner--sm",
703
+ style: { margin: "8px auto" }
704
+ }
705
+ ) }),
706
+ !B && ee.length === 0 ? /* @__PURE__ */ e("div", { className: "nice-select__empty", children: k || H("controls.noResults", "No results found") }) : S && !Array.from(Be.keys()).some((s) => s !== "") ? (() => {
707
+ const T = ee.length * A, U = Math.max(
708
+ 0,
709
+ Math.floor(q / A) - 3
710
+ ), ve = Math.min(
711
+ ee.length,
712
+ Math.ceil((q + E) / A) + 3
713
+ ), Le = ee.slice(U, ve);
714
+ return /* @__PURE__ */ e("div", { style: { height: T, position: "relative" }, children: Le.map((ce, c) => {
715
+ const y = U + c, le = te.includes(ce.value);
716
+ return /* @__PURE__ */ e(
717
+ "div",
718
+ {
719
+ role: "option",
720
+ "aria-selected": le,
721
+ className: `nice-select__option ${le ? "nice-select__option--selected" : ""} ${y === r ? "nice-select__option--highlighted" : ""} ${ce.disabled ? "nice-select__option--disabled" : ""}`,
722
+ style: {
723
+ position: "absolute",
724
+ top: y * A,
725
+ left: 0,
726
+ right: 0,
727
+ height: A,
728
+ display: "flex",
729
+ alignItems: "center",
730
+ padding: "0 12px"
731
+ },
732
+ onClick: () => !ce.disabled && _e(String(ce.value)),
733
+ onMouseEnter: () => v(y),
734
+ children: K ? K(ce, le) : /* @__PURE__ */ _(Ee, { children: [
735
+ ce.icon && /* @__PURE__ */ e("span", { children: ce.icon }),
736
+ /* @__PURE__ */ _("div", { style: { flex: 1 }, children: [
737
+ /* @__PURE__ */ e("div", { children: ce.label }),
738
+ ce.description && /* @__PURE__ */ e("div", { className: "nice-select__option-desc", children: ce.description })
739
+ ] }),
740
+ le && /* @__PURE__ */ e(
741
+ "svg",
742
+ {
743
+ className: "nice-select__option-check",
744
+ viewBox: "0 0 20 20",
745
+ fill: "currentColor",
746
+ children: /* @__PURE__ */ e(
747
+ "path",
748
+ {
749
+ fillRule: "evenodd",
750
+ 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",
751
+ clipRule: "evenodd"
752
+ }
753
+ )
754
+ }
755
+ )
756
+ ] })
757
+ },
758
+ ce.value
759
+ );
760
+ }) });
761
+ })() : Array.from(Be.entries()).map(([s, T]) => /* @__PURE__ */ _(Ze.Fragment, { children: [
762
+ s && /* @__PURE__ */ e("div", { className: "nice-select__group-label", children: s }),
763
+ T.map((U) => {
764
+ const ve = te.includes(U.value), Le = ee.indexOf(U);
765
+ return /* @__PURE__ */ e(
766
+ "div",
767
+ {
768
+ role: "option",
769
+ "aria-selected": ve,
770
+ className: `nice-select__option ${ve ? "nice-select__option--selected" : ""} ${Le === r ? "nice-select__option--highlighted" : ""} ${U.disabled ? "nice-select__option--disabled" : ""}`,
771
+ onClick: () => !U.disabled && _e(String(U.value)),
772
+ onMouseEnter: () => v(Le),
773
+ children: K ? K(U, ve) : /* @__PURE__ */ _(Ee, { children: [
774
+ U.icon && /* @__PURE__ */ e("span", { children: U.icon }),
775
+ /* @__PURE__ */ _("div", { style: { flex: 1 }, children: [
776
+ /* @__PURE__ */ e("div", { children: U.label }),
777
+ U.description && /* @__PURE__ */ e("div", { className: "nice-select__option-desc", children: U.description })
778
+ ] }),
779
+ ve && /* @__PURE__ */ e(
780
+ "svg",
781
+ {
782
+ className: "nice-select__option-check",
783
+ viewBox: "0 0 20 20",
784
+ fill: "currentColor",
785
+ children: /* @__PURE__ */ e(
786
+ "path",
787
+ {
788
+ fillRule: "evenodd",
789
+ 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",
790
+ clipRule: "evenodd"
791
+ }
792
+ )
793
+ }
794
+ )
795
+ ] })
796
+ },
797
+ U.value
798
+ );
799
+ })
800
+ ] }, s))
801
+ ]
802
+ }
803
+ )
804
+ ] }),
805
+ B && /* @__PURE__ */ e("span", { className: "nice-field__spinner", children: /* @__PURE__ */ e("span", { className: "nice-spinner nice-spinner--sm" }) }),
806
+ se === "right" && t && /* @__PURE__ */ e("div", { id: `${ae}-error`, className: "nice-field__error", role: "alert", children: t }),
807
+ se === "right" && !t && h && /* @__PURE__ */ e("div", { id: `${ae}-helper`, className: "nice-field__helper", children: h })
808
+ ] }),
809
+ se !== "right" && t && /* @__PURE__ */ e("div", { id: `${ae}-error`, className: "nice-field__error", role: "alert", children: t }),
810
+ se !== "right" && !t && h && /* @__PURE__ */ e("div", { id: `${ae}-helper`, className: "nice-field__helper", children: h })
811
+ ]
812
+ }
813
+ );
814
+ }
815
+ );
816
+ Pe.displayName = "NiceSelect";
817
+ const Oe = Me(
818
+ ({
819
+ label: l,
820
+ checked: h = !1,
821
+ indeterminate: t = !1,
822
+ onChange: d,
823
+ disabled: i,
824
+ readOnly: n,
825
+ loading: a,
826
+ required: $,
827
+ size: u = "md",
828
+ name: o,
829
+ id: f,
830
+ className: D,
831
+ style: Z,
832
+ error: m,
833
+ helperText: x,
834
+ accessMode: R,
835
+ displayStyle: p,
836
+ showKeyboardHints: J,
837
+ labelPlacement: L,
838
+ errorPlacement: k,
839
+ labelWidth: E,
840
+ controlWidth: g
841
+ }, I) => {
842
+ const j = xe(R, f), S = j === "hidden";
843
+ (j === "disabled" || j === "readOnly") && (i = !0);
844
+ const { t: A } = Re(), w = Ie(f);
845
+ $e("toggle", p);
846
+ const B = oe(
847
+ () => [{ key: "Space", description: A("shortcuts.toggle", "Toggle") }],
848
+ [A]
849
+ ), K = Ze.useCallback(
850
+ (F) => {
851
+ F && (F.indeterminate = t), typeof I == "function" ? I(F) : I && (I.current = F);
852
+ },
853
+ [t, I]
854
+ );
855
+ return S ? null : /* @__PURE__ */ _(
856
+ "div",
857
+ {
858
+ className: `nice-field nice-field--inline nice-field--${u} ${L === "left" ? "nice-field--label-left" : ""} ${k === "right" ? "nice-field--error-right" : ""} ${a ? "nice-field--loading" : ""} ${D || ""}`,
859
+ style: {
860
+ ...Z,
861
+ ...E != null && {
862
+ "--nice-field-label-width": typeof E == "number" ? `${E}px` : E
863
+ },
864
+ ...g != null && {
865
+ "--nice-field-control-width": typeof g == "number" ? `${g}px` : g
866
+ }
867
+ },
868
+ "aria-busy": a || void 0,
869
+ children: [
870
+ L === "left" && l && /* @__PURE__ */ e("span", { className: `nice-field__label ${$ ? "nice-field__label--required" : ""}`, children: l }),
871
+ /* @__PURE__ */ _("div", { className: "nice-field__control", children: [
872
+ /* @__PURE__ */ _(
873
+ "label",
874
+ {
875
+ className: `nice-checkbox ${u !== "md" ? `nice-checkbox--${u}` : ""} ${i || a ? "nice-checkbox--disabled" : ""}`,
876
+ htmlFor: w,
877
+ children: [
878
+ /* @__PURE__ */ e(
879
+ "input",
880
+ {
881
+ ref: K,
882
+ id: w,
883
+ type: "checkbox",
884
+ className: "nice-checkbox__input",
885
+ name: o,
886
+ checked: h,
887
+ disabled: i || a,
888
+ readOnly: n,
889
+ "aria-invalid": !!m,
890
+ onChange: (F) => {
891
+ n || a || d?.(F.target.checked);
892
+ }
893
+ }
894
+ ),
895
+ /* @__PURE__ */ e("span", { className: "nice-checkbox__box", children: /* @__PURE__ */ e(
896
+ "svg",
897
+ {
898
+ viewBox: "0 0 12 12",
899
+ fill: "none",
900
+ stroke: "currentColor",
901
+ strokeWidth: "2",
902
+ strokeLinecap: "round",
903
+ strokeLinejoin: "round",
904
+ children: t ? /* @__PURE__ */ e("line", { x1: "2", y1: "6", x2: "10", y2: "6" }) : /* @__PURE__ */ e("polyline", { points: "2 6 5 9 10 3" })
905
+ }
906
+ ) }),
907
+ L !== "left" && l && /* @__PURE__ */ e("span", { children: l }),
908
+ J && /* @__PURE__ */ e(Ae, { shortcuts: B, size: "sm" })
909
+ ]
910
+ }
911
+ ),
912
+ a && /* @__PURE__ */ e("span", { className: "nice-field__spinner", children: /* @__PURE__ */ e("span", { className: "nice-spinner nice-spinner--sm" }) }),
913
+ k === "right" && m && /* @__PURE__ */ e("div", { id: `${w}-error`, className: "nice-field__error", role: "alert", children: m }),
914
+ k === "right" && !m && x && /* @__PURE__ */ e("div", { id: `${w}-helper`, className: "nice-field__helper", children: x })
915
+ ] }),
916
+ k !== "right" && m && /* @__PURE__ */ e("div", { id: `${w}-error`, className: "nice-field__error", role: "alert", children: m }),
917
+ k !== "right" && !m && x && /* @__PURE__ */ e("div", { id: `${w}-helper`, className: "nice-field__helper", children: x })
918
+ ]
919
+ }
920
+ );
921
+ }
922
+ );
923
+ Oe.displayName = "NiceCheckbox";
924
+ const We = Me(
925
+ ({
926
+ label: l,
927
+ checked: h = !1,
928
+ onChange: t,
929
+ disabled: d,
930
+ readOnly: i,
931
+ loading: n,
932
+ required: a,
933
+ size: $ = "md",
934
+ name: u,
935
+ id: o,
936
+ className: f,
937
+ style: D,
938
+ accessMode: Z,
939
+ displayStyle: m,
940
+ showKeyboardHints: x,
941
+ error: R,
942
+ helperText: p,
943
+ labelPlacement: J,
944
+ errorPlacement: L,
945
+ labelWidth: k,
946
+ controlWidth: E
947
+ }, g) => {
948
+ const I = xe(Z, o), j = I === "hidden";
949
+ (I === "disabled" || I === "readOnly") && (d = !0);
950
+ const { t: S } = Re(), A = Ie(o);
951
+ He("toggle", m);
952
+ const w = $e("toggle", m), B = oe(
953
+ () => [{ key: "Space", description: S("shortcuts.toggle", "Toggle on/off") }],
954
+ [S]
955
+ );
956
+ return j ? null : /* @__PURE__ */ _(
957
+ "div",
958
+ {
959
+ className: `nice-field nice-field--inline nice-field--${$} ${J === "left" ? "nice-field--label-left" : ""} ${n ? "nice-field--loading" : ""} ${f || ""}`,
960
+ style: {
961
+ ...D,
962
+ ...k != null && {
963
+ "--nice-field-label-width": typeof k == "number" ? `${k}px` : k
964
+ },
965
+ ...E != null && {
966
+ "--nice-field-control-width": typeof E == "number" ? `${E}px` : E
967
+ }
968
+ },
969
+ "aria-busy": n || void 0,
970
+ children: [
971
+ J === "left" && l && /* @__PURE__ */ e("span", { className: `nice-field__label ${a ? "nice-field__label--required" : ""}`, children: l }),
972
+ /* @__PURE__ */ _("div", { className: "nice-field__control", children: [
973
+ /* @__PURE__ */ _(
974
+ "label",
975
+ {
976
+ className: `nice-toggle nice-toggle--ds-${w} ${$ !== "md" ? `nice-toggle--${$}` : ""} ${d || n ? "nice-toggle--disabled" : ""}`,
977
+ htmlFor: A,
978
+ children: [
979
+ /* @__PURE__ */ e(
980
+ "input",
981
+ {
982
+ ref: g,
983
+ id: A,
984
+ type: "checkbox",
985
+ className: "nice-toggle__input",
986
+ name: u,
987
+ checked: h,
988
+ disabled: d || n,
989
+ readOnly: i,
990
+ role: "switch",
991
+ "aria-checked": h,
992
+ "aria-invalid": !!R,
993
+ onChange: (K) => {
994
+ i || n || t?.(K.target.checked);
995
+ }
996
+ }
997
+ ),
998
+ /* @__PURE__ */ e("span", { className: "nice-toggle__track", children: /* @__PURE__ */ e("span", { className: "nice-toggle__thumb" }) }),
999
+ J !== "left" && l && /* @__PURE__ */ e("span", { children: l }),
1000
+ x && /* @__PURE__ */ e(Ae, { shortcuts: B, size: "sm" })
1001
+ ]
1002
+ }
1003
+ ),
1004
+ n && /* @__PURE__ */ e("span", { className: "nice-field__spinner", children: /* @__PURE__ */ e("span", { className: "nice-spinner nice-spinner--sm" }) }),
1005
+ L === "right" && R && /* @__PURE__ */ e("div", { id: `${A}-error`, className: "nice-field__error", role: "alert", children: R }),
1006
+ L === "right" && !R && p && /* @__PURE__ */ e("div", { id: `${A}-helper`, className: "nice-field__helper", children: p })
1007
+ ] }),
1008
+ L !== "right" && R && /* @__PURE__ */ e("div", { id: `${A}-error`, className: "nice-field__error", role: "alert", children: R }),
1009
+ L !== "right" && !R && p && /* @__PURE__ */ e("div", { id: `${A}-helper`, className: "nice-field__helper", children: p })
1010
+ ]
1011
+ }
1012
+ );
1013
+ }
1014
+ );
1015
+ We.displayName = "NiceToggle";
1016
+ const en = [
1017
+ "var(--nice-danger, #ef4444)",
1018
+ "var(--nice-warning, #f97316)",
1019
+ "var(--nice-warning, #f59e0b)",
1020
+ "var(--nice-success, #84cc16)",
1021
+ "var(--nice-success, #10b981)",
1022
+ "var(--nice-info, #06b6d4)",
1023
+ "var(--nice-primary, #3b82f6)",
1024
+ "var(--nice-info, #6366f1)",
1025
+ "var(--nice-accent, #8b5cf6)",
1026
+ "var(--nice-accent-pink, #ec4899)",
1027
+ "var(--nice-text-secondary, #64748b)",
1028
+ "var(--nice-text, #1e293b)"
1029
+ ];
1030
+ function nn() {
1031
+ return "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0");
1032
+ }
1033
+ function tn(l, h, t) {
1034
+ const d = l / 255, i = h / 255, n = t / 255, a = Math.max(d, i, n), $ = Math.min(d, i, n), u = (a + $) / 2;
1035
+ let o = 0, f = 0;
1036
+ if (a !== $) {
1037
+ const D = a - $;
1038
+ switch (f = u > 0.5 ? D / (2 - a - $) : D / (a + $), a) {
1039
+ case d:
1040
+ o = (i - n) / D + (i < n ? 6 : 0);
1041
+ break;
1042
+ case i:
1043
+ o = (n - d) / D + 2;
1044
+ break;
1045
+ case n:
1046
+ o = (d - i) / D + 4;
1047
+ break;
1048
+ }
1049
+ o *= 60;
1050
+ }
1051
+ return { h: Math.round(o), s: Math.round(f * 100), l: Math.round(u * 100) };
1052
+ }
1053
+ function cn(l, h, t) {
1054
+ const d = h / 100, i = t / 100, n = (1 - Math.abs(2 * i - 1)) * d, a = n * (1 - Math.abs(l / 60 % 2 - 1)), $ = i - n / 2;
1055
+ let u = 0, o = 0, f = 0;
1056
+ return l < 60 ? [u, o, f] = [n, a, 0] : l < 120 ? [u, o, f] = [a, n, 0] : l < 180 ? [u, o, f] = [0, n, a] : l < 240 ? [u, o, f] = [0, a, n] : l < 300 ? [u, o, f] = [a, 0, n] : [u, o, f] = [n, 0, a], {
1057
+ r: Math.round((u + $) * 255),
1058
+ g: Math.round((o + $) * 255),
1059
+ b: Math.round((f + $) * 255)
1060
+ };
1061
+ }
1062
+ function ln(l, h, t) {
1063
+ const d = l / 255, i = h / 255, n = t / 255, a = Math.max(d, i, n), $ = Math.min(d, i, n), u = a - $;
1064
+ let o = 0;
1065
+ u !== 0 && (a === d ? o = (i - n) / u % 6 : a === i ? o = (n - d) / u + 2 : o = (d - i) / u + 4, o *= 60, o < 0 && (o += 360));
1066
+ const f = a === 0 ? 0 : u / a;
1067
+ return { h: Math.round(o), s: Math.round(f * 100), v: Math.round(a * 100) };
1068
+ }
1069
+ function sn(l, h, t) {
1070
+ const d = h / 100, i = t / 100, n = i * d, a = n * (1 - Math.abs(l / 60 % 2 - 1)), $ = i - n;
1071
+ let u = 0, o = 0, f = 0;
1072
+ return l < 60 ? [u, o, f] = [n, a, 0] : l < 120 ? [u, o, f] = [a, n, 0] : l < 180 ? [u, o, f] = [0, n, a] : l < 240 ? [u, o, f] = [0, a, n] : l < 300 ? [u, o, f] = [a, 0, n] : [u, o, f] = [n, 0, a], {
1073
+ r: Math.round((u + $) * 255),
1074
+ g: Math.round((o + $) * 255),
1075
+ b: Math.round((f + $) * 255)
1076
+ };
1077
+ }
1078
+ function rn(l) {
1079
+ const h = /^#?([0-9a-f]{6})$/i.exec(l.trim()), t = /^#?([0-9a-f]{8})$/i.exec(l.trim());
1080
+ if (t) {
1081
+ const d = t[1];
1082
+ return {
1083
+ r: parseInt(d.slice(0, 2), 16),
1084
+ g: parseInt(d.slice(2, 4), 16),
1085
+ b: parseInt(d.slice(4, 6), 16),
1086
+ a: parseInt(d.slice(6, 8), 16) / 255
1087
+ };
1088
+ }
1089
+ if (h) {
1090
+ const d = parseInt(h[1], 16);
1091
+ return { r: d >> 16 & 255, g: d >> 8 & 255, b: d & 255, a: 1 };
1092
+ }
1093
+ return { r: 0, g: 0, b: 0, a: 1 };
1094
+ }
1095
+ function an(l, h, t, d, i) {
1096
+ const n = ($) => Math.max(0, Math.min(255, Math.round($))).toString(16).padStart(2, "0"), a = `#${n(l)}${n(h)}${n(t)}`;
1097
+ return i ? `${a}${n(d * 255)}` : a;
1098
+ }
1099
+ const on = Me(
1100
+ ({
1101
+ label: l,
1102
+ helperText: h,
1103
+ error: t,
1104
+ required: d,
1105
+ disabled: i,
1106
+ id: n,
1107
+ className: a,
1108
+ style: $,
1109
+ accessMode: u,
1110
+ displayStyle: o,
1111
+ value: f = "var(--nice-primary, #3b82f6)",
1112
+ onChange: D,
1113
+ presets: Z = en,
1114
+ showInput: m = !0,
1115
+ showRandom: x = !0,
1116
+ withAlpha: R = !1,
1117
+ showKeyboardHints: p,
1118
+ size: J = "md",
1119
+ labelPlacement: L,
1120
+ errorPlacement: k,
1121
+ labelWidth: E,
1122
+ controlWidth: g,
1123
+ loading: I
1124
+ }, j) => {
1125
+ const S = xe(u, n), A = S === "hidden";
1126
+ (S === "disabled" || S === "readOnly") && (i = !0);
1127
+ const { t: w } = Re(), B = Ie(n);
1128
+ $e("input", o);
1129
+ const K = ne(() => {
1130
+ i || D?.(nn());
1131
+ }, [i, D]), [F, O] = ue(!1), [re, se] = ue(null), Y = Fe(null), G = Fe(null);
1132
+ qe(() => {
1133
+ if (!F || !G.current)
1134
+ return;
1135
+ const b = () => {
1136
+ const N = G.current?.getBoundingClientRect();
1137
+ if (!N)
1138
+ return;
1139
+ const V = 280, H = 360;
1140
+ let M = N.left, W = N.bottom + 6;
1141
+ M + V > window.innerWidth - 8 && (M = Math.max(8, window.innerWidth - V - 8)), W + H > window.innerHeight - 8 && (W = Math.max(8, N.top - H - 6)), se({ left: M, top: W });
1142
+ };
1143
+ return b(), window.addEventListener("scroll", b, !0), window.addEventListener("resize", b), () => {
1144
+ window.removeEventListener("scroll", b, !0), window.removeEventListener("resize", b);
1145
+ };
1146
+ }, [F]), Ye(() => {
1147
+ if (!F)
1148
+ return;
1149
+ const b = (V) => {
1150
+ const H = V.target;
1151
+ Y.current?.contains(H) || G.current?.contains(H) || O(!1);
1152
+ }, N = (V) => {
1153
+ V.key === "Escape" && O(!1);
1154
+ };
1155
+ return document.addEventListener("mousedown", b), document.addEventListener("keydown", N), () => {
1156
+ document.removeEventListener("mousedown", b), document.removeEventListener("keydown", N);
1157
+ };
1158
+ }, [F]);
1159
+ const pe = oe(
1160
+ () => [
1161
+ { key: "Enter", description: w("shortcuts.openPicker", "Open color picker") },
1162
+ { key: "Arrow keys", description: w("shortcuts.navigatePresets", "Navigate presets") }
1163
+ ],
1164
+ [w]
1165
+ );
1166
+ return A ? null : /* @__PURE__ */ _(
1167
+ "div",
1168
+ {
1169
+ className: `nice-field nice-field--${J} ${L === "left" ? "nice-field--label-left" : ""} ${I ? "nice-field--loading" : ""} ${a || ""}`,
1170
+ style: {
1171
+ ...$,
1172
+ ...E != null && {
1173
+ "--nice-field-label-width": typeof E == "number" ? `${E}px` : E
1174
+ },
1175
+ ...g != null && {
1176
+ "--nice-field-control-width": typeof g == "number" ? `${g}px` : g
1177
+ }
1178
+ },
1179
+ "aria-busy": I || void 0,
1180
+ children: [
1181
+ l && /* @__PURE__ */ _(
1182
+ "label",
1183
+ {
1184
+ htmlFor: B,
1185
+ className: `nice-field__label ${d ? "nice-field__label--required" : ""}`,
1186
+ children: [
1187
+ l,
1188
+ p && /* @__PURE__ */ e(Ae, { shortcuts: pe, size: "sm" })
1189
+ ]
1190
+ }
1191
+ ),
1192
+ /* @__PURE__ */ e("div", { className: "nice-field__control", children: /* @__PURE__ */ _("div", { className: "nice-color-picker", children: [
1193
+ /* @__PURE__ */ _("div", { className: "nice-color-picker__preview-row", children: [
1194
+ /* @__PURE__ */ e(
1195
+ "div",
1196
+ {
1197
+ ref: G,
1198
+ className: "nice-color-picker__swatch",
1199
+ id: B,
1200
+ style: { background: f },
1201
+ onClick: (b) => {
1202
+ b.stopPropagation(), i || O((N) => !N);
1203
+ },
1204
+ onKeyDown: (b) => {
1205
+ !i && (b.key === "Enter" || b.key === " ") && (b.preventDefault(), O((N) => !N));
1206
+ },
1207
+ role: "button",
1208
+ tabIndex: 0,
1209
+ "aria-label": w("colorPicker.openPalette", "Open color palette"),
1210
+ "aria-haspopup": "dialog",
1211
+ "aria-expanded": F,
1212
+ children: /* @__PURE__ */ e(
1213
+ "input",
1214
+ {
1215
+ ref: (b) => {
1216
+ typeof j == "function" ? j(b) : j && (j.current = b);
1217
+ },
1218
+ type: "hidden",
1219
+ value: f,
1220
+ disabled: i,
1221
+ readOnly: !0
1222
+ }
1223
+ )
1224
+ }
1225
+ ),
1226
+ m && /* @__PURE__ */ e("div", { className: "nice-input nice-input--sm", style: { width: 100 }, children: /* @__PURE__ */ e(
1227
+ "input",
1228
+ {
1229
+ className: "nice-input__native",
1230
+ type: "text",
1231
+ value: f,
1232
+ disabled: i,
1233
+ onChange: (b) => D?.(b.target.value),
1234
+ maxLength: 7
1235
+ }
1236
+ ) }),
1237
+ x && /* @__PURE__ */ e(
1238
+ "button",
1239
+ {
1240
+ type: "button",
1241
+ className: "nice-btn nice-btn--outline nice-btn--sm nice-color-picker__random",
1242
+ onClick: K,
1243
+ disabled: i,
1244
+ title: w("colorPicker.random", "Random"),
1245
+ "aria-label": w("colorPicker.random", "Random"),
1246
+ style: {
1247
+ fontSize: "0.65rem",
1248
+ textTransform: "uppercase",
1249
+ letterSpacing: "0.05em"
1250
+ },
1251
+ children: w("colorPicker.random", "Random")
1252
+ }
1253
+ ),
1254
+ I && /* @__PURE__ */ e("span", { className: "nice-field__spinner", children: /* @__PURE__ */ e("span", { className: "nice-spinner nice-spinner--sm" }) }),
1255
+ k === "right" && t && /* @__PURE__ */ e("div", { id: `${B}-error`, className: "nice-field__error", role: "alert", children: t }),
1256
+ k === "right" && !t && h && /* @__PURE__ */ e("div", { id: `${B}-helper`, className: "nice-field__helper", children: h })
1257
+ ] }),
1258
+ F && re && typeof document < "u" && ze.createPortal(
1259
+ /* @__PURE__ */ e(
1260
+ "div",
1261
+ {
1262
+ ref: Y,
1263
+ className: "nice-color-picker__popup nice-color-picker__popup--portal",
1264
+ role: "dialog",
1265
+ "aria-label": w("colorPicker.palette", "Color palette"),
1266
+ style: { position: "fixed", left: re.left, top: re.top },
1267
+ onClick: (b) => b.stopPropagation(),
1268
+ children: (() => {
1269
+ const b = rn(f), N = { r: b.r, g: b.g, b: b.b }, V = R ? b.a : 1, H = tn(N.r, N.g, N.b), M = ln(N.r, N.g, N.b), W = (r, v, q, C = V) => D?.(an(r, v, q, C, R)), ae = (r, v, q) => W(r, v, q), he = (r, v, q) => {
1270
+ const C = cn(r, v, q);
1271
+ W(C.r, C.g, C.b);
1272
+ }, z = (r, v, q) => {
1273
+ const C = sn(r, v, q);
1274
+ W(C.r, C.g, C.b);
1275
+ }, X = (r) => W(N.r, N.g, N.b, r), de = (r) => {
1276
+ if (i)
1277
+ return;
1278
+ const v = r.currentTarget, q = (Q) => {
1279
+ const P = v.getBoundingClientRect(), be = Math.max(0, Math.min(P.width, Q.clientX - P.left)), Ne = Math.max(0, Math.min(P.height, Q.clientY - P.top)), fe = Math.round(be / P.width * 100), Ce = 100 - Math.round(Ne / P.height * 100);
1280
+ z(M.h, fe, Ce);
1281
+ };
1282
+ q(r);
1283
+ const C = () => {
1284
+ document.removeEventListener("pointermove", q), document.removeEventListener("pointerup", C);
1285
+ };
1286
+ document.addEventListener("pointermove", q), document.addEventListener("pointerup", C);
1287
+ }, ie = `hsl(${M.h}, 100%, 50%)`;
1288
+ return /* @__PURE__ */ _(Ee, { children: [
1289
+ /* @__PURE__ */ e("div", { className: "nice-color-picker__popup-header", children: /* @__PURE__ */ e(
1290
+ "input",
1291
+ {
1292
+ type: "text",
1293
+ className: "nice-input__native nice-color-picker__popup-hex",
1294
+ value: f,
1295
+ disabled: i,
1296
+ onChange: (r) => D?.(r.target.value),
1297
+ maxLength: R ? 9 : 7,
1298
+ "aria-label": w("colorPicker.hexValue", "Hex value")
1299
+ }
1300
+ ) }),
1301
+ /* @__PURE__ */ e(
1302
+ "input",
1303
+ {
1304
+ type: "range",
1305
+ min: 0,
1306
+ max: 360,
1307
+ value: M.h,
1308
+ disabled: i,
1309
+ onChange: (r) => z(Number(r.target.value), M.s, M.v),
1310
+ className: "nice-color-picker__hue-slider",
1311
+ "aria-label": w("colorPicker.hue", "Hue")
1312
+ }
1313
+ ),
1314
+ /* @__PURE__ */ e(
1315
+ "div",
1316
+ {
1317
+ className: "nice-color-picker__sv",
1318
+ style: {
1319
+ background: `linear-gradient(to top, var(--nice-text, #000), transparent), linear-gradient(to right, var(--nice-bg, #FFF), ${ie})`
1320
+ },
1321
+ onPointerDown: de,
1322
+ role: "application",
1323
+ "aria-label": w("colorPicker.svPalette", "Saturation/value palette"),
1324
+ children: /* @__PURE__ */ e(
1325
+ "span",
1326
+ {
1327
+ className: "nice-color-picker__sv-marker",
1328
+ style: { left: `${M.s}%`, top: `${100 - M.v}%` }
1329
+ }
1330
+ )
1331
+ }
1332
+ ),
1333
+ /* @__PURE__ */ _("div", { className: "nice-color-picker__sliders", children: [
1334
+ /* @__PURE__ */ e("div", { className: "nice-color-picker__slider-col", children: ["h", "s", "l"].map((r) => {
1335
+ const v = r === "h" ? 360 : 100, q = H[r], C = (Q) => he(
1336
+ r === "h" ? Q : H.h,
1337
+ r === "s" ? Q : H.s,
1338
+ r === "l" ? Q : H.l
1339
+ );
1340
+ return /* @__PURE__ */ _("div", { className: "nice-color-picker__slider-row", children: [
1341
+ /* @__PURE__ */ e("label", { className: "nice-color-picker__slider-label", children: r.toUpperCase() }),
1342
+ /* @__PURE__ */ e(
1343
+ "input",
1344
+ {
1345
+ type: "range",
1346
+ min: 0,
1347
+ max: v,
1348
+ value: q,
1349
+ disabled: i,
1350
+ onChange: (Q) => C(Number(Q.target.value))
1351
+ }
1352
+ ),
1353
+ /* @__PURE__ */ e(
1354
+ "input",
1355
+ {
1356
+ type: "number",
1357
+ min: 0,
1358
+ max: v,
1359
+ value: q,
1360
+ disabled: i,
1361
+ onChange: (Q) => C(Number(Q.target.value) || 0),
1362
+ className: "nice-input__native nice-color-picker__slider-num"
1363
+ }
1364
+ )
1365
+ ] }, r);
1366
+ }) }),
1367
+ /* @__PURE__ */ e("div", { className: "nice-color-picker__slider-col", children: ["r", "g", "b"].map((r) => {
1368
+ const v = N[r], q = (C) => ae(
1369
+ r === "r" ? C : N.r,
1370
+ r === "g" ? C : N.g,
1371
+ r === "b" ? C : N.b
1372
+ );
1373
+ return /* @__PURE__ */ _("div", { className: "nice-color-picker__slider-row", children: [
1374
+ /* @__PURE__ */ e("label", { className: "nice-color-picker__slider-label", children: r.toUpperCase() }),
1375
+ /* @__PURE__ */ e(
1376
+ "input",
1377
+ {
1378
+ type: "range",
1379
+ min: 0,
1380
+ max: 255,
1381
+ value: v,
1382
+ disabled: i,
1383
+ onChange: (C) => q(Number(C.target.value))
1384
+ }
1385
+ ),
1386
+ /* @__PURE__ */ e(
1387
+ "input",
1388
+ {
1389
+ type: "number",
1390
+ min: 0,
1391
+ max: 255,
1392
+ value: v,
1393
+ disabled: i,
1394
+ onChange: (C) => q(Number(C.target.value) || 0),
1395
+ className: "nice-input__native nice-color-picker__slider-num"
1396
+ }
1397
+ )
1398
+ ] }, r);
1399
+ }) })
1400
+ ] }),
1401
+ R && /* @__PURE__ */ _("div", { className: "nice-color-picker__alpha-row", children: [
1402
+ /* @__PURE__ */ e("label", { className: "nice-color-picker__slider-label", children: "A" }),
1403
+ /* @__PURE__ */ e(
1404
+ "input",
1405
+ {
1406
+ type: "range",
1407
+ min: 0,
1408
+ max: 100,
1409
+ value: Math.round(V * 100),
1410
+ disabled: i,
1411
+ onChange: (r) => X(Number(r.target.value) / 100),
1412
+ className: "nice-color-picker__alpha-slider",
1413
+ style: {
1414
+ background: `linear-gradient(to right, transparent, rgb(${N.r},${N.g},${N.b}))`
1415
+ },
1416
+ "aria-label": w("colorPicker.alpha", "Alpha")
1417
+ }
1418
+ ),
1419
+ /* @__PURE__ */ e(
1420
+ "input",
1421
+ {
1422
+ type: "number",
1423
+ min: 0,
1424
+ max: 100,
1425
+ value: Math.round(V * 100),
1426
+ disabled: i,
1427
+ onChange: (r) => X((Number(r.target.value) || 0) / 100),
1428
+ className: "nice-input__native nice-color-picker__slider-num"
1429
+ }
1430
+ )
1431
+ ] }),
1432
+ Z.length > 0 && /* @__PURE__ */ e("div", { className: "nice-color-picker__popup-presets", children: Z.map((r) => /* @__PURE__ */ e(
1433
+ "div",
1434
+ {
1435
+ className: `nice-color-picker__preset ${f === r ? "nice-color-picker__preset--active" : ""}`,
1436
+ style: { background: r },
1437
+ onClick: () => {
1438
+ D?.(r), O(!1);
1439
+ },
1440
+ role: "button",
1441
+ tabIndex: 0,
1442
+ "aria-label": r,
1443
+ onKeyDown: (v) => {
1444
+ (v.key === "Enter" || v.key === " ") && (v.preventDefault(), D?.(r), O(!1));
1445
+ }
1446
+ },
1447
+ r
1448
+ )) })
1449
+ ] });
1450
+ })()
1451
+ }
1452
+ ),
1453
+ document.body
1454
+ )
1455
+ ] }) }),
1456
+ k !== "right" && t && /* @__PURE__ */ e("div", { id: `${B}-error`, className: "nice-field__error", role: "alert", children: t }),
1457
+ k !== "right" && !t && h && /* @__PURE__ */ e("div", { id: `${B}-helper`, className: "nice-field__helper", children: h })
1458
+ ]
1459
+ }
1460
+ );
1461
+ }
1462
+ );
1463
+ on.displayName = "NiceColorPicker";
1464
+ const dn = Me(
1465
+ ({
1466
+ children: l,
1467
+ variant: h = "primary",
1468
+ size: t = "md",
1469
+ type: d = "button",
1470
+ disabled: i,
1471
+ loading: n,
1472
+ fullWidth: a,
1473
+ onClick: $,
1474
+ leftIcon: u,
1475
+ rightIcon: o,
1476
+ error: f,
1477
+ errorPlacement: D = "bottom",
1478
+ className: Z,
1479
+ style: m,
1480
+ id: x,
1481
+ accessMode: R,
1482
+ displayStyle: p,
1483
+ ...J
1484
+ }, L) => {
1485
+ const k = xe(R, x), E = k === "hidden";
1486
+ (k === "disabled" || k === "readOnly") && (i = !0);
1487
+ const g = He("button", p), I = $e("button", p), j = h !== "primary" ? (({ background: w, color: B, ...K }) => K)(
1488
+ g
1489
+ ) : g, S = /* @__PURE__ */ _(
1490
+ "button",
1491
+ {
1492
+ ref: L,
1493
+ type: d,
1494
+ id: x,
1495
+ className: `nice-btn nice-btn--${h} nice-btn--${t} nice-btn--ds-${I} ${a ? "nice-btn--full-width" : ""} ${n ? "nice-btn--loading" : ""} ${f && !D ? "nice-btn--has-error" : ""} ${Z || ""}`,
1496
+ style: { ...j, ...m },
1497
+ disabled: i || n,
1498
+ "aria-busy": n || void 0,
1499
+ "aria-disabled": i || n || void 0,
1500
+ onClick: $,
1501
+ ...J,
1502
+ children: [
1503
+ n && /* @__PURE__ */ e(
1504
+ "svg",
1505
+ {
1506
+ className: "nice-btn__spinner",
1507
+ viewBox: "0 0 24 24",
1508
+ fill: "none",
1509
+ stroke: "currentColor",
1510
+ strokeWidth: "3",
1511
+ "aria-hidden": "true",
1512
+ children: /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10", strokeDasharray: "31.4 31.4", strokeLinecap: "round" })
1513
+ }
1514
+ ),
1515
+ !n && u && /* @__PURE__ */ e("span", { "aria-hidden": "true", children: u }),
1516
+ !n && /* @__PURE__ */ e("span", { children: l }),
1517
+ n && /* @__PURE__ */ e("span", { style: { visibility: "hidden" }, "aria-hidden": "true", children: l }),
1518
+ !n && o && /* @__PURE__ */ e("span", { "aria-hidden": "true", children: o })
1519
+ ]
1520
+ }
1521
+ );
1522
+ if (E)
1523
+ return null;
1524
+ if (!f)
1525
+ return S;
1526
+ const A = /* @__PURE__ */ e("div", { className: "nice-field__error", role: "alert", children: f });
1527
+ return D === "right" ? /* @__PURE__ */ _(
1528
+ "span",
1529
+ {
1530
+ className: `nice-btn-field nice-btn-field--right nice-field--${t}`,
1531
+ style: {
1532
+ display: "inline-flex",
1533
+ flexDirection: "row",
1534
+ alignItems: "center",
1535
+ gap: "8px",
1536
+ width: "fit-content"
1537
+ },
1538
+ children: [
1539
+ S,
1540
+ A
1541
+ ]
1542
+ }
1543
+ ) : E ? null : /* @__PURE__ */ _(
1544
+ "span",
1545
+ {
1546
+ className: `nice-btn-field nice-btn-field--bottom nice-field--${t}`,
1547
+ style: {
1548
+ display: "inline-flex",
1549
+ flexDirection: "column",
1550
+ alignItems: "flex-start",
1551
+ gap: "4px",
1552
+ width: "fit-content"
1553
+ },
1554
+ children: [
1555
+ S,
1556
+ A
1557
+ ]
1558
+ }
1559
+ );
1560
+ }
1561
+ );
1562
+ dn.displayName = "NiceButton";
1563
+ const mn = ({
1564
+ tabs: l,
1565
+ activeTab: h,
1566
+ onChange: t,
1567
+ variant: d = "default",
1568
+ vertical: i,
1569
+ size: n = "md",
1570
+ className: a,
1571
+ style: $,
1572
+ displayStyle: u
1573
+ }) => {
1574
+ const o = He("tab", u), f = $e("tab", u), [D, Z] = ue(h || l[0]?.id), m = h ?? D, x = ne(
1575
+ (p) => {
1576
+ Z(p), t?.(p);
1577
+ },
1578
+ [t]
1579
+ ), R = l.find((p) => p.id === m)?.content;
1580
+ return /* @__PURE__ */ _(
1581
+ "div",
1582
+ {
1583
+ className: `nice-tabs nice-tabs--${n} nice-tabs--ds-${f} ${a || ""}`,
1584
+ style: { ...o, ...$, ...i ? { display: "flex", gap: 16 } : {} },
1585
+ children: [
1586
+ /* @__PURE__ */ e(
1587
+ "div",
1588
+ {
1589
+ className: `nice-tabs__list ${d !== "default" ? `nice-tabs__list--${d}` : ""} ${i ? "nice-tabs__list--vertical" : ""}`,
1590
+ role: "tablist",
1591
+ children: l.map((p) => /* @__PURE__ */ _(
1592
+ "button",
1593
+ {
1594
+ type: "button",
1595
+ role: "tab",
1596
+ "aria-selected": m === p.id,
1597
+ className: `nice-tabs__tab ${m === p.id ? "nice-tabs__tab--active" : ""} ${p.disabled ? "nice-tabs__tab--disabled" : ""}`,
1598
+ disabled: p.disabled,
1599
+ onClick: () => x(p.id),
1600
+ children: [
1601
+ p.icon,
1602
+ /* @__PURE__ */ e("span", { children: p.label }),
1603
+ p.badge !== void 0 && /* @__PURE__ */ e("span", { className: "nice-tabs__badge", children: p.badge })
1604
+ ]
1605
+ },
1606
+ p.id
1607
+ ))
1608
+ }
1609
+ ),
1610
+ R && /* @__PURE__ */ e("div", { className: "nice-tabs__panel", role: "tabpanel", children: R })
1611
+ ]
1612
+ }
1613
+ );
1614
+ };
1615
+ export {
1616
+ Oe as N,
1617
+ on as a,
1618
+ Qe as b,
1619
+ Pe as c,
1620
+ Je as d,
1621
+ We as e,
1622
+ mn as f,
1623
+ dn as g
1624
+ };