@nice2dev/ui 1.2.2 → 1.3.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 (80) hide show
  1. package/CHANGELOG.md +433 -0
  2. package/dist/NiceButton-CnAIqCbd.js +101 -0
  3. package/dist/NiceButton-DzCqkG5a.cjs +1 -0
  4. package/dist/NiceCodeEditor-CK6B54mu.js +1215 -0
  5. package/dist/NiceCodeEditor-bJReZPDO.cjs +268 -0
  6. package/dist/NiceColorPicker-BV3olE3M.cjs +1 -0
  7. package/dist/NiceColorPicker-CyY-4q89.js +552 -0
  8. package/dist/NiceDataGrid-BQIqitMM.cjs +10 -0
  9. package/dist/NiceDataGrid-C1eI6Pso.js +2267 -0
  10. package/dist/NiceForm-CfAPcXdX.cjs +1 -0
  11. package/dist/NiceForm-DfKYNQti.js +5017 -0
  12. package/dist/NiceGantt-TEXbAELi.js +333 -0
  13. package/dist/NiceGantt-s2cgt5zD.cjs +1 -0
  14. package/dist/NiceHtmlEditor-CDZeF_zG.cjs +10 -0
  15. package/dist/NiceHtmlEditor-CdWgddg3.js +901 -0
  16. package/dist/NiceLoginForm-DRPldHXa.js +808 -0
  17. package/dist/NiceLoginForm-IGLUCQUE.cjs +1 -0
  18. package/dist/NiceMention-CgDp0sl9.cjs +430 -0
  19. package/dist/NiceMention-DBvFvx71.js +11653 -0
  20. package/dist/NiceMention.css +1 -1
  21. package/dist/NiceModal-BlYhFDhP.js +80 -0
  22. package/dist/NiceModal-DmWz2PDM.cjs +1 -0
  23. package/dist/NiceModuleLifecyclePanel-D8EoXqBy.cjs +1 -0
  24. package/dist/NiceModuleLifecyclePanel-SN6G7t64.js +7189 -0
  25. package/dist/NiceModuleLifecyclePanel.css +1 -1
  26. package/dist/NicePagination-BJS65foT.js +200 -0
  27. package/dist/NicePagination-D_3GfWp5.cjs +1 -0
  28. package/dist/NicePivotGrid-D_kRF1Dt.js +1180 -0
  29. package/dist/NicePivotGrid-DqluEkCI.cjs +152 -0
  30. package/dist/NiceSavedQueryPanel-C2Tn1cMW.js +5311 -0
  31. package/dist/NiceSavedQueryPanel-DDKtL1AA.cjs +586 -0
  32. package/dist/NiceScheduler-GJLvkXJ3.cjs +5 -0
  33. package/dist/NiceScheduler-UT49u2Vq.js +1710 -0
  34. package/dist/NiceSelect-CdUHd8rj.cjs +1 -0
  35. package/dist/NiceSelect-fOelG_QB.js +495 -0
  36. package/dist/NiceWindow-CqSsTjrS.cjs +1 -0
  37. package/dist/NiceWindow-DZLPhXbR.js +2223 -0
  38. package/dist/charts-BYQwl_GS.js +4789 -0
  39. package/dist/charts-C6iOu0H6.cjs +768 -0
  40. package/dist/charts.cjs +1 -1
  41. package/dist/charts.d.ts +1 -1
  42. package/dist/charts.mjs +1 -1
  43. package/dist/core-lazy-B_laOXNf.cjs +1 -0
  44. package/dist/core-lazy-VQEjdz0L.js +351 -0
  45. package/dist/data-branching-7rpktFJ-.cjs +1 -0
  46. package/dist/data-branching-BS0aFUMu.js +6428 -0
  47. package/dist/data-branching.cjs +1 -1
  48. package/dist/data-branching.mjs +1 -1
  49. package/dist/data.cjs +1 -1
  50. package/dist/data.mjs +3 -3
  51. package/dist/devops-CFytAJQr.cjs +18 -0
  52. package/dist/devops-CW8YY_zA.js +9122 -0
  53. package/dist/devops.cjs +1 -1
  54. package/dist/devops.css +1 -0
  55. package/dist/devops.mjs +5 -5
  56. package/dist/editors.cjs +1 -1
  57. package/dist/editors.mjs +8 -8
  58. package/dist/feedback.cjs +1 -1
  59. package/dist/feedback.d.ts +21 -16
  60. package/dist/feedback.mjs +3 -3
  61. package/dist/index.cjs +262 -257
  62. package/dist/index.css +1 -1
  63. package/dist/index.d.ts +374 -20
  64. package/dist/index.mjs +21602 -20317
  65. package/dist/lazy.cjs +1 -1
  66. package/dist/lazy.mjs +24 -24
  67. package/dist/navigation.cjs +1 -1
  68. package/dist/navigation.d.ts +31 -0
  69. package/dist/navigation.mjs +404 -354
  70. package/dist/no-code-BaAI_sJR.js +8318 -0
  71. package/dist/no-code-oQTeAtnW.cjs +331 -0
  72. package/dist/no-code.cjs +1 -1
  73. package/dist/no-code.mjs +1 -1
  74. package/dist/overlays.cjs +1 -1
  75. package/dist/overlays.d.ts +5 -0
  76. package/dist/overlays.mjs +1 -1
  77. package/dist/pickerCommons-BQi6IEAt.js +661 -0
  78. package/dist/pickerCommons-DvQptSPX.cjs +1 -0
  79. package/dist/style.css +7 -4
  80. package/package.json +4 -3
@@ -0,0 +1,661 @@
1
+ import { jsxs as x, jsx as c } from "react/jsx-runtime";
2
+ import { useNiceTranslation as E, useControlId as K, useComponentDisplayStyle as F, useComponentDisplayClass as Z, useInputPreferences as j, useHintsVisible as z, useRovingFocus as Q, useIntent as V, useInputHints as W, NiceButtonPrompt as B, useNiceAccessMode as q, NiceKeyboardHint as X } from "@nice2dev/ui-core";
3
+ import { useState as I, useRef as H, useCallback as D, useEffect as Y, forwardRef as ff, useMemo as ef } from "react";
4
+ import { F as tf } from "./vendor-BPVpdtPp.js";
5
+ const cf = [], hf = ({
6
+ tabs: f = cf,
7
+ activeTab: i,
8
+ onChange: s,
9
+ variant: o = "default",
10
+ vertical: d,
11
+ size: n = "md",
12
+ iconOnly: t = !1,
13
+ centered: u = "auto",
14
+ countLocation: l = "right",
15
+ showHints: g,
16
+ id: h,
17
+ className: m,
18
+ style: e,
19
+ displayStyle: p
20
+ }) => {
21
+ const { t: b } = E(), r = K(h), v = u === "auto" ? t : u, k = F("tab", p), y = Z("tab", p), [A, T] = I(i || f[0]?.id), _ = i ?? A, w = H(null), S = H(null), [R] = j(), M = z(), C = D(
22
+ (a) => {
23
+ T(a), s?.(a);
24
+ },
25
+ [s]
26
+ );
27
+ Q(S, {
28
+ orientation: d ? "vertical" : "horizontal",
29
+ wrap: !0,
30
+ onMove: (a) => {
31
+ const N = a.getAttribute("data-tab-id");
32
+ N && C(N);
33
+ }
34
+ }), V(
35
+ ["sectionPrev", "sectionNext"],
36
+ (a) => {
37
+ const N = f.filter(($) => !$.disabled);
38
+ if (N.length < 2)
39
+ return !1;
40
+ const O = N.findIndex(($) => $.id === _), J = a.intent === "sectionNext" ? 1 : -1, P = N[(O + J + N.length) % N.length];
41
+ return C(P.id), [...S.current?.querySelectorAll("[data-tab-id]") ?? []].find(($) => $.getAttribute("data-tab-id") === P.id)?.focus(), !0;
42
+ },
43
+ { ref: w }
44
+ ), W(
45
+ w,
46
+ f.length > 1 ? [
47
+ { intent: "sectionPrev", label: b("input.intent.sectionPrev", "Previous section") },
48
+ { intent: "sectionNext", label: b("input.intent.sectionNext", "Next section") }
49
+ ] : []
50
+ );
51
+ const L = f.length > 1 && M && (g ?? R.hintDensity === "bar-and-controls"), G = f.find((a) => a.id === _)?.content;
52
+ return /* @__PURE__ */ x(
53
+ "div",
54
+ {
55
+ ref: w,
56
+ className: `nice-tabs nice-tabs--${n} ${d ? "nice-tabs--vertical" : ""} ${t ? "nice-tabs--icon-only" : ""} nice-tabs--ds-${y} ${m || ""}`,
57
+ style: { ...k, ...e },
58
+ children: [
59
+ /* @__PURE__ */ x(
60
+ "div",
61
+ {
62
+ ref: S,
63
+ className: `nice-tabs__list ${o !== "default" ? `nice-tabs__list--${o}` : ""} ${d ? "nice-tabs__list--vertical" : ""} ${v ? "nice-tabs__list--centered" : ""}`,
64
+ role: "tablist",
65
+ "aria-orientation": d ? "vertical" : "horizontal",
66
+ children: [
67
+ L && /* @__PURE__ */ c("span", { className: "nice-tabs__hint", "aria-hidden": "true", children: /* @__PURE__ */ c(B, { intent: "sectionPrev", size: "sm" }) }),
68
+ f.map((a) => /* @__PURE__ */ x(
69
+ "button",
70
+ {
71
+ type: "button",
72
+ role: "tab",
73
+ id: `${r}-tab-${a.id}`,
74
+ "data-tab-id": a.id,
75
+ "aria-selected": _ === a.id,
76
+ "aria-controls": `${r}-panel`,
77
+ "aria-label": t ? a.label : void 0,
78
+ title: t ? a.label : void 0,
79
+ className: `nice-tabs__tab ${_ === a.id ? "nice-tabs__tab--active" : ""} ${a.disabled ? "nice-tabs__tab--disabled" : ""} ${l === "bottom" ? "nice-tabs__tab--count-bottom" : ""}`,
80
+ disabled: a.disabled,
81
+ onClick: () => C(a.id),
82
+ children: [
83
+ a.icon,
84
+ !t && /* @__PURE__ */ c("span", { children: a.label }),
85
+ a.badge !== void 0 && /* @__PURE__ */ c(
86
+ "span",
87
+ {
88
+ className: `nice-tabs__badge${l === "bottom" ? " nice-tabs__badge--pill" : ""}`,
89
+ children: a.badge
90
+ }
91
+ )
92
+ ]
93
+ },
94
+ a.id
95
+ )),
96
+ L && /* @__PURE__ */ c("span", { className: "nice-tabs__hint", "aria-hidden": "true", children: /* @__PURE__ */ c(B, { intent: "sectionNext", size: "sm" }) })
97
+ ]
98
+ }
99
+ ),
100
+ /* @__PURE__ */ c(
101
+ "div",
102
+ {
103
+ className: "nice-tabs__panel",
104
+ role: "tabpanel",
105
+ id: `${r}-panel`,
106
+ "aria-labelledby": _ ? `${r}-tab-${_}` : void 0,
107
+ children: G
108
+ }
109
+ )
110
+ ]
111
+ }
112
+ );
113
+ };
114
+ function pf(f, {
115
+ open: i,
116
+ onSelect: s,
117
+ onClose: o,
118
+ onOpen: d,
119
+ loop: n = !1,
120
+ pageSize: t = 10,
121
+ intentRef: u
122
+ }) {
123
+ const [l, g] = I(0);
124
+ Y(() => {
125
+ g((e) => f.length === 0 ? 0 : Math.min(Math.max(e, 0), f.length - 1));
126
+ }, [f.length]);
127
+ const h = D(
128
+ (e, p) => g((b) => {
129
+ const r = f.length;
130
+ if (r === 0)
131
+ return 0;
132
+ const v = e(b);
133
+ return p ? (v % r + r) % r : Math.min(Math.max(v, 0), r - 1);
134
+ }),
135
+ [f.length]
136
+ ), m = D(
137
+ (e) => {
138
+ if (!i) {
139
+ (e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), d?.());
140
+ return;
141
+ }
142
+ const p = e.target instanceof HTMLTextAreaElement || e.target instanceof HTMLInputElement && e.target.type !== "checkbox";
143
+ if (e.key === "ArrowDown")
144
+ e.preventDefault(), h((b) => b + 1, n);
145
+ else if (e.key === "ArrowUp")
146
+ e.preventDefault(), h((b) => b - 1, n);
147
+ else if (e.key === "PageDown")
148
+ e.preventDefault(), h((b) => b + t, !1);
149
+ else if (e.key === "PageUp")
150
+ e.preventDefault(), h((b) => b - t, !1);
151
+ else if (!p && (e.key === "Home" || e.key === "End"))
152
+ e.preventDefault(), h(() => e.key === "Home" ? 0 : f.length - 1, !1);
153
+ else if (e.key === "Enter") {
154
+ const b = f[l];
155
+ b !== void 0 && (e.preventDefault(), s(b, l));
156
+ } else e.key === "Escape" && o?.();
157
+ },
158
+ [i, f, l, n, t, h, s, o, d]
159
+ );
160
+ return V(
161
+ ["navigate", "activate"],
162
+ (e) => {
163
+ if (e.source === "keyboard")
164
+ return !1;
165
+ if (e.intent === "activate") {
166
+ const p = f[l];
167
+ if (p === void 0)
168
+ return !1;
169
+ s(p, l);
170
+ return;
171
+ }
172
+ if (e.direction !== "up" && e.direction !== "down")
173
+ return !1;
174
+ h((p) => p + (e.direction === "down" ? 1 : -1), n);
175
+ },
176
+ { ref: u, enabled: i && !!u }
177
+ ), { activeIndex: l, setActiveIndex: g, handleKeyDown: m };
178
+ }
179
+ const gf = /* @__PURE__ */ Object.assign(
180
+ /* @__PURE__ */ ff(
181
+ ({
182
+ label: f,
183
+ checked: i = !1,
184
+ onChange: s,
185
+ disabled: o,
186
+ readOnly: d,
187
+ loading: n,
188
+ required: t,
189
+ size: u = "md",
190
+ name: l,
191
+ id: g,
192
+ className: h,
193
+ style: m,
194
+ accessMode: e,
195
+ displayStyle: p,
196
+ showKeyboardHints: b,
197
+ error: r,
198
+ helperText: v,
199
+ labelPlacement: k,
200
+ errorPlacement: y,
201
+ labelWidth: A,
202
+ controlWidth: T
203
+ }, _) => {
204
+ const w = q(e, g), S = w === "hidden";
205
+ (w === "disabled" || w === "readOnly") && (o = !0);
206
+ const { t: R } = E(), M = K(g);
207
+ F("toggle", p);
208
+ const C = Z("toggle", p), L = ef(
209
+ () => [{ key: "Space", description: R("shortcuts.toggle", "Toggle on/off") }],
210
+ [R]
211
+ );
212
+ return S ? null : /* @__PURE__ */ x(
213
+ "div",
214
+ {
215
+ className: `nice-field nice-field--inline nice-field--${u} ${k === "left" ? "nice-field--label-left" : ""} ${n ? "nice-field--loading" : ""} ${h || ""}`,
216
+ style: {
217
+ ...m,
218
+ ...A != null && {
219
+ "--nice-field-label-width": typeof A == "number" ? `${A}px` : A
220
+ },
221
+ ...T != null && {
222
+ "--nice-field-control-width": typeof T == "number" ? `${T}px` : T
223
+ }
224
+ },
225
+ "aria-busy": n || void 0,
226
+ children: [
227
+ k === "left" && f && /* @__PURE__ */ c("span", { className: `nice-field__label ${t ? "nice-field__label--required" : ""}`, children: f }),
228
+ /* @__PURE__ */ x("div", { className: "nice-field__control", children: [
229
+ /* @__PURE__ */ x(
230
+ "label",
231
+ {
232
+ className: `nice-toggle nice-toggle--ds-${C} ${u !== "md" ? `nice-toggle--${u}` : ""} ${o || n ? "nice-toggle--disabled" : ""}`,
233
+ htmlFor: M,
234
+ children: [
235
+ /* @__PURE__ */ c(
236
+ "input",
237
+ {
238
+ ref: _,
239
+ id: M,
240
+ type: "checkbox",
241
+ className: "nice-toggle__input",
242
+ name: l,
243
+ checked: i,
244
+ disabled: o || n,
245
+ readOnly: d,
246
+ role: "switch",
247
+ "aria-checked": i,
248
+ "aria-invalid": !!r,
249
+ onChange: (G) => {
250
+ d || n || s?.(G.target.checked);
251
+ }
252
+ }
253
+ ),
254
+ /* @__PURE__ */ c("span", { className: "nice-toggle__track", children: /* @__PURE__ */ c("span", { className: "nice-toggle__thumb" }) }),
255
+ k !== "left" && f && /* @__PURE__ */ c("span", { children: f }),
256
+ b && /* @__PURE__ */ c(X, { shortcuts: L, size: "sm" })
257
+ ]
258
+ }
259
+ ),
260
+ n && /* @__PURE__ */ c("span", { className: "nice-field__spinner", children: /* @__PURE__ */ c("span", { className: "nice-spinner nice-spinner--sm" }) }),
261
+ y === "right" && r && /* @__PURE__ */ c("div", { id: `${M}-error`, className: "nice-field__error", role: "alert", children: r }),
262
+ y === "right" && !r && v && /* @__PURE__ */ c("div", { id: `${M}-helper`, className: "nice-field__helper", children: v })
263
+ ] }),
264
+ y !== "right" && r && /* @__PURE__ */ c("div", { id: `${M}-error`, className: "nice-field__error", role: "alert", children: r }),
265
+ y !== "right" && !r && v && /* @__PURE__ */ c("div", { id: `${M}-helper`, className: "nice-field__helper", children: v })
266
+ ]
267
+ }
268
+ );
269
+ }
270
+ ),
271
+ { displayName: "NiceToggle" }
272
+ ), nf = /* @__PURE__ */ Object.freeze({
273
+ AR: ["#74acdf", "#ffffff", "#74acdf"],
274
+ AT: ["#ed2939", "#ffffff", "#ed2939"],
275
+ AU: ["#012169", "#ffffff", "#e4002b"],
276
+ BE: ["#000000", "#fae042", "#ed2939"],
277
+ BR: ["#009c3b", "#ffdf00", "#002776"],
278
+ CA: ["#ff0000", "#ffffff", "#ff0000"],
279
+ CH: ["#d52b1e", "#ffffff", "#d52b1e"],
280
+ CN: ["#de2910", "#ffde00", "#de2910"],
281
+ CZ: ["#11457e", "#ffffff", "#d7141a"],
282
+ DE: ["#000000", "#dd0000", "#ffce00"],
283
+ DK: ["#c8102e", "#ffffff", "#c8102e"],
284
+ EE: ["#0072ce", "#000000", "#ffffff"],
285
+ EG: ["#ce1126", "#ffffff", "#000000"],
286
+ ES: ["#aa151b", "#f1bf00", "#aa151b"],
287
+ FI: ["#ffffff", "#003580", "#ffffff"],
288
+ FR: ["#0055a4", "#ffffff", "#ef4135"],
289
+ GB: ["#012169", "#ffffff", "#c8102e"],
290
+ GR: ["#0d5eaf", "#ffffff", "#0d5eaf"],
291
+ HR: ["#171796", "#ffffff", "#ff0000"],
292
+ HU: ["#ce2939", "#ffffff", "#477050"],
293
+ IE: ["#169b62", "#ffffff", "#ff883e"],
294
+ IL: ["#ffffff", "#0038b8", "#ffffff"],
295
+ IN: ["#ff9933", "#ffffff", "#138808"],
296
+ IS: ["#02529c", "#ffffff", "#dc1e35"],
297
+ IT: ["#009246", "#ffffff", "#ce2b37"],
298
+ JP: ["#ffffff", "#bc002d", "#ffffff"],
299
+ KR: ["#ffffff", "#cd2e3a", "#0047a0"],
300
+ LT: ["#fdb913", "#006a44", "#c1272d"],
301
+ LU: ["#ed2939", "#ffffff", "#00a1de"],
302
+ LV: ["#9e3039", "#ffffff", "#9e3039"],
303
+ MX: ["#006847", "#ffffff", "#ce1126"],
304
+ NL: ["#ae1c28", "#ffffff", "#21468b"],
305
+ NO: ["#ef2b2d", "#ffffff", "#002868"],
306
+ NZ: ["#012169", "#ffffff", "#cc142b"],
307
+ PL: ["#ffffff", "#dc143c"],
308
+ PT: ["#006600", "#ff0000"],
309
+ RO: ["#002b7f", "#fcd116", "#ce1126"],
310
+ RU: ["#ffffff", "#0039a6", "#d52b1e"],
311
+ SE: ["#006aa7", "#fecc00", "#006aa7"],
312
+ SK: ["#ffffff", "#0b4ea2", "#ee1c25"],
313
+ TR: ["#e30a17", "#ffffff", "#e30a17"],
314
+ UA: ["#005bbb", "#ffd500"],
315
+ US: ["#b22234", "#ffffff", "#3c3b6e"],
316
+ VN: ["#da251d", "#ffff00", "#da251d"],
317
+ ZA: ["#007a4d", "#ffffff", "#de3831"],
318
+ // ── Round 22 expansion: cover the full COUNTRIES catalogue ─────
319
+ AD: ["#10069f", "#fedf00", "#d50032"],
320
+ AE: ["#00732f", "#ffffff", "#000000"],
321
+ AF: ["#000000", "#d32011", "#007a36"],
322
+ AG: ["#ce1126", "#fcd116", "#000000"],
323
+ AL: ["#e41e20", "#000000", "#e41e20"],
324
+ AM: ["#d90012", "#0033a0", "#f2a800"],
325
+ AO: ["#ce1126", "#000000", "#ffc500"],
326
+ AZ: ["#0092bc", "#ed2939", "#509e2f"],
327
+ BA: ["#002395", "#fecb00", "#ffffff"],
328
+ BB: ["#00267f", "#ffc726", "#00267f"],
329
+ BD: ["#006a4e", "#f42a41", "#006a4e"],
330
+ BF: ["#ef2b2d", "#009e49", "#fcd116"],
331
+ BG: ["#ffffff", "#00966e", "#d62612"],
332
+ BH: ["#ffffff", "#ce1126", "#ce1126"],
333
+ BI: ["#1eb53a", "#ffffff", "#ce1126"],
334
+ BJ: ["#008751", "#fcd116", "#e8112d"],
335
+ BN: ["#f7e017", "#ffffff", "#000000"],
336
+ BO: ["#d52b1e", "#f9e300", "#007934"],
337
+ BS: ["#00778b", "#ffc72c", "#000000"],
338
+ BT: ["#ffcc33", "#ff4e12", "#ffcc33"],
339
+ BW: ["#75aadb", "#ffffff", "#000000"],
340
+ BY: ["#c8313e", "#007c30", "#ffffff"],
341
+ BZ: ["#003f87", "#ce1126", "#003f87"],
342
+ CD: ["#007fff", "#f7d618", "#ce1021"],
343
+ CF: ["#003082", "#ffffff", "#289728"],
344
+ CG: ["#009543", "#fbde4a", "#dc241f"],
345
+ CI: ["#f77f00", "#ffffff", "#009e60"],
346
+ CM: ["#007a5e", "#ce1126", "#fcd116"],
347
+ CO: ["#fcd116", "#003893", "#ce1126"],
348
+ CR: ["#002b7f", "#ffffff", "#ce1126"],
349
+ CU: ["#002590", "#ffffff", "#cf142b"],
350
+ CV: ["#003893", "#ffffff", "#cf2027"],
351
+ CY: ["#ffffff", "#d57800", "#ffffff"],
352
+ DJ: ["#6ab2e7", "#ffffff", "#12ad2b"],
353
+ DM: ["#006b3f", "#ffffff", "#000000"],
354
+ DO: ["#002d62", "#ffffff", "#ce1126"],
355
+ DZ: ["#006233", "#ffffff", "#d21034"],
356
+ EC: ["#ffd100", "#034ea2", "#ed1c24"],
357
+ ER: ["#ea0437", "#0084c9", "#418fde"],
358
+ ET: ["#078930", "#fcdd09", "#da121a"],
359
+ FJ: ["#68bfe5", "#cc0000", "#ffffff"],
360
+ GA: ["#3a75c4", "#ffe700", "#009e60"],
361
+ GD: ["#ce1126", "#fcd116", "#007a5e"],
362
+ GE: ["#ffffff", "#ff0000", "#ffffff"],
363
+ GH: ["#ce1126", "#fcd116", "#006b3f"],
364
+ GM: ["#ce1126", "#ffffff", "#0c1c8c"],
365
+ GN: ["#ce1126", "#fcd116", "#009460"],
366
+ GQ: ["#3e9a00", "#ffffff", "#e32118"],
367
+ GT: ["#4997d0", "#ffffff", "#4997d0"],
368
+ GW: ["#ce1126", "#fcd116", "#009e49"],
369
+ GY: ["#009e49", "#ffffff", "#fcd116"],
370
+ HK: ["#de2910", "#ffffff", "#de2910"],
371
+ HN: ["#0073cf", "#ffffff", "#0073cf"],
372
+ HT: ["#00209f", "#d21034", "#00209f"],
373
+ ID: ["#ff0000", "#ffffff", "#ff0000"],
374
+ IQ: ["#ce1126", "#ffffff", "#000000"],
375
+ IR: ["#239f40", "#ffffff", "#da0000"],
376
+ JM: ["#000000", "#fed100", "#009b3a"],
377
+ JO: ["#000000", "#ffffff", "#007a3d"],
378
+ KE: ["#000000", "#bb0000", "#006600"],
379
+ KG: ["#ff0000", "#fcd116", "#ff0000"],
380
+ KH: ["#032ea1", "#e00025", "#032ea1"],
381
+ KM: ["#fcd116", "#ffffff", "#ce1126"],
382
+ KP: ["#024fa2", "#ed1c27", "#024fa2"],
383
+ KW: ["#007a3d", "#ffffff", "#ce1126"],
384
+ KZ: ["#00afca", "#fec50c", "#00afca"],
385
+ LA: ["#ce1126", "#002868", "#ce1126"],
386
+ LB: ["#ed1c24", "#ffffff", "#ed1c24"],
387
+ LI: ["#002780", "#ce1126", "#002780"],
388
+ LK: ["#ffbe29", "#8d153a", "#00534e"],
389
+ LR: ["#bf0a30", "#ffffff", "#002868"],
390
+ LS: ["#00209f", "#ffffff", "#009543"],
391
+ LY: ["#e70013", "#000000", "#239e46"],
392
+ MA: ["#c1272d", "#006233", "#c1272d"],
393
+ MD: ["#0046ae", "#ffd200", "#cc092f"],
394
+ ME: ["#d4af37", "#cc0033", "#d4af37"],
395
+ MG: ["#ffffff", "#fc3d32", "#007e3a"],
396
+ MH: ["#003893", "#dd7500", "#ffffff"],
397
+ MK: ["#d20000", "#ffe600", "#d20000"],
398
+ ML: ["#14b53a", "#fcd116", "#ce1126"],
399
+ MM: ["#fecb00", "#34b233", "#ea2839"],
400
+ MN: ["#c4272f", "#015197", "#c4272f"],
401
+ MO: ["#00785a", "#ffd700", "#ffffff"],
402
+ MR: ["#006233", "#ffc400", "#d01c1f"],
403
+ MT: ["#ffffff", "#cf142b", "#ffffff"],
404
+ MU: ["#ea2839", "#1a206d", "#00a04d"],
405
+ MV: ["#d21034", "#007e3a", "#ffffff"],
406
+ MW: ["#000000", "#ce1126", "#339e35"],
407
+ MY: ["#cc0000", "#ffffff", "#010066"],
408
+ MZ: ["#009a44", "#ffffff", "#000000"],
409
+ NA: ["#003580", "#ffffff", "#009543"],
410
+ NE: ["#ff8000", "#ffffff", "#0db02b"],
411
+ NG: ["#008753", "#ffffff", "#008753"],
412
+ NI: ["#0067c6", "#ffffff", "#0067c6"],
413
+ NP: ["#dc143c", "#003893", "#dc143c"],
414
+ OM: ["#dc241f", "#ffffff", "#008000"],
415
+ PA: ["#ffffff", "#cc0033", "#005aa7"],
416
+ PE: ["#d91023", "#ffffff", "#d91023"],
417
+ PG: ["#ce1126", "#000000", "#fcd116"],
418
+ PH: ["#0038a8", "#ffffff", "#ce1126"],
419
+ PK: ["#ffffff", "#01411c", "#01411c"],
420
+ PS: ["#000000", "#ffffff", "#007a3d"],
421
+ PY: ["#d52b1e", "#ffffff", "#0038a8"],
422
+ QA: ["#ffffff", "#8a1538", "#8a1538"],
423
+ RS: ["#c6363c", "#0c4076", "#ffffff"],
424
+ RW: ["#00a1de", "#fad201", "#00a651"],
425
+ SA: ["#006c35", "#ffffff", "#006c35"],
426
+ SB: ["#0051ba", "#fcd116", "#215b33"],
427
+ SC: ["#003f87", "#fcd116", "#d62828"],
428
+ SD: ["#d21034", "#ffffff", "#000000"],
429
+ SG: ["#ed2939", "#ffffff", "#ed2939"],
430
+ SI: ["#ffffff", "#0000ff", "#ff0000"],
431
+ SL: ["#1eb53a", "#ffffff", "#0072c6"],
432
+ SM: ["#ffffff", "#5eb6e4", "#ffffff"],
433
+ SN: ["#00853f", "#fdef42", "#e31b23"],
434
+ SO: ["#4189dd", "#ffffff", "#4189dd"],
435
+ SR: ["#377e3f", "#ffffff", "#b40a2d"],
436
+ SS: ["#000000", "#ce1126", "#078930"],
437
+ ST: ["#12ad2b", "#ffce00", "#d21034"],
438
+ SV: ["#0047ab", "#ffffff", "#0047ab"],
439
+ SY: ["#ce1126", "#ffffff", "#000000"],
440
+ SZ: ["#3e5eb9", "#ffd900", "#b10c0c"],
441
+ TD: ["#002664", "#fecb00", "#c60c30"],
442
+ TG: ["#006a4e", "#fcd116", "#d21034"],
443
+ TH: ["#ed1c24", "#ffffff", "#241d4f"],
444
+ TJ: ["#cc0000", "#ffffff", "#006600"],
445
+ TL: ["#dc241f", "#ffc726", "#000000"],
446
+ TM: ["#00853e", "#ffffff", "#cc0000"],
447
+ TN: ["#e70013", "#ffffff", "#e70013"],
448
+ TO: ["#ffffff", "#c10000", "#c10000"],
449
+ TT: ["#ce1126", "#ffffff", "#000000"],
450
+ TW: ["#fe0000", "#000095", "#fe0000"],
451
+ TZ: ["#1eb53a", "#fcd116", "#00a3dd"],
452
+ UG: ["#000000", "#fcdc04", "#d90000"],
453
+ UY: ["#ffffff", "#0038a8", "#ffffff"],
454
+ UZ: ["#1eb53a", "#ffffff", "#0099b5"],
455
+ VA: ["#ffe000", "#ffffff", "#ffe000"],
456
+ VE: ["#fcd116", "#00247d", "#cf142b"],
457
+ VU: ["#000000", "#ce1126", "#009543"],
458
+ WS: ["#002b7f", "#ffffff", "#cc0033"],
459
+ YE: ["#ce1126", "#ffffff", "#000000"],
460
+ ZM: ["#198a00", "#de2010", "#ef7d00"],
461
+ ZW: ["#078930", "#fcd116", "#cf2027"]
462
+ }), U = ["#cbd5e1", "#94a3b8", "#cbd5e1"];
463
+ function af(f) {
464
+ return f ? nf[f.toUpperCase()] ?? U : U;
465
+ }
466
+ const df = tf, mf = ({
467
+ code: f,
468
+ size: i = 22,
469
+ className: s
470
+ }) => {
471
+ const { t: o } = E(), d = f?.toUpperCase(), n = d ? df[d] : void 0, t = i, u = Math.round(i * 2 / 3);
472
+ return n ? /* @__PURE__ */ c(
473
+ "span",
474
+ {
475
+ className: s,
476
+ role: "img",
477
+ "aria-label": o("pickerCommons.flag", "{upper} flag").replace("{upper}", String(d)),
478
+ style: {
479
+ display: "inline-block",
480
+ width: t,
481
+ height: u,
482
+ boxSizing: "content-box",
483
+ border: "1px solid var(--nice-overlay-15, rgba(0, 0, 0, 0.15))",
484
+ borderRadius: 2,
485
+ overflow: "hidden",
486
+ flexShrink: 0,
487
+ verticalAlign: "middle",
488
+ lineHeight: 0
489
+ },
490
+ dangerouslySetInnerHTML: {
491
+ __html: n.replace(
492
+ "<svg ",
493
+ `<svg width="${t}" height="${u}" preserveAspectRatio="xMidYMid slice" `
494
+ )
495
+ }
496
+ }
497
+ ) : /* @__PURE__ */ c(sf, { code: f, size: i, className: s });
498
+ }, sf = ({
499
+ code: f,
500
+ size: i = 18,
501
+ className: s
502
+ }) => {
503
+ const { t: o } = E(), d = af(f);
504
+ return /* @__PURE__ */ c(
505
+ "span",
506
+ {
507
+ className: s,
508
+ role: "img",
509
+ "aria-label": o("pickerCommons.flag2", "{code} flag").replace("{code}", String(f)),
510
+ style: {
511
+ display: "inline-flex",
512
+ width: i,
513
+ height: Math.round(i * 0.7),
514
+ boxSizing: "content-box",
515
+ border: "1px solid var(--nice-overlay-15, rgba(0, 0, 0, 0.15))",
516
+ borderRadius: 2,
517
+ overflow: "hidden",
518
+ flexShrink: 0,
519
+ verticalAlign: "middle"
520
+ },
521
+ children: d.map((n, t) => /* @__PURE__ */ c("span", { style: { flex: 1, background: n } }, t))
522
+ }
523
+ );
524
+ };
525
+ function vf(f, i, s, o = 280) {
526
+ const [d, n] = I(s === "left" ? "left" : "right"), t = D(() => {
527
+ if (s !== "auto") {
528
+ n(s);
529
+ return;
530
+ }
531
+ const u = i.current;
532
+ if (!u || typeof window > "u")
533
+ return;
534
+ const l = u.getBoundingClientRect(), h = window.innerWidth - l.left, m = l.right;
535
+ h >= o && h > m ? n("left") : n("right");
536
+ }, [s, i, o]);
537
+ return Y(() => {
538
+ if (f)
539
+ return t(), window.addEventListener("resize", t), window.addEventListener("scroll", t, !0), () => {
540
+ window.removeEventListener("resize", t), window.removeEventListener("scroll", t, !0);
541
+ };
542
+ }, [f, t]), d;
543
+ }
544
+ const _f = ({ colors: f, size: i = 28, shape: s = "page", className: o }) => {
545
+ const { t: d } = E(), n = i, t = Math.round(i * 0.75), u = f.border ?? "color-mix(in srgb, currentColor 30%, transparent)";
546
+ if (s === "swatch") {
547
+ const p = [
548
+ f.primary,
549
+ f.background,
550
+ f.backgroundSecondary ?? f.background,
551
+ f.textColor
552
+ ];
553
+ return /* @__PURE__ */ c(
554
+ "span",
555
+ {
556
+ className: o,
557
+ role: "img",
558
+ "aria-label": d("pickerCommons.themePreview", "Theme preview"),
559
+ style: {
560
+ display: "inline-flex",
561
+ width: n,
562
+ height: t,
563
+ border: `1px solid ${u}`,
564
+ borderRadius: 2,
565
+ overflow: "hidden",
566
+ flexShrink: 0,
567
+ verticalAlign: "middle"
568
+ },
569
+ children: p.map((b, r) => /* @__PURE__ */ c("span", { style: { flex: 1, background: b } }, r))
570
+ }
571
+ );
572
+ }
573
+ const l = Math.max(2, Math.round(t * 0.22)), g = f.backgroundSecondary ? Math.max(3, Math.round(n * 0.28)) : 0, h = Math.max(1, Math.round(t * 0.08)), m = Math.max(1, Math.round(t * 0.05)), e = Math.max(2, Math.round(n * 0.08));
574
+ return /* @__PURE__ */ x(
575
+ "span",
576
+ {
577
+ className: o,
578
+ role: "img",
579
+ "aria-label": d("pickerCommons.themePreview", "Theme preview"),
580
+ style: {
581
+ position: "relative",
582
+ display: "inline-block",
583
+ width: n,
584
+ height: t,
585
+ boxSizing: "content-box",
586
+ background: f.background,
587
+ border: `1px solid ${u}`,
588
+ borderRadius: 2,
589
+ overflow: "hidden",
590
+ flexShrink: 0,
591
+ verticalAlign: "middle"
592
+ },
593
+ children: [
594
+ /* @__PURE__ */ c(
595
+ "span",
596
+ {
597
+ style: {
598
+ position: "absolute",
599
+ top: 0,
600
+ left: 0,
601
+ right: 0,
602
+ height: l,
603
+ background: f.primary
604
+ }
605
+ }
606
+ ),
607
+ g > 0 && /* @__PURE__ */ c(
608
+ "span",
609
+ {
610
+ style: {
611
+ position: "absolute",
612
+ top: l,
613
+ left: 0,
614
+ bottom: 0,
615
+ width: g,
616
+ background: f.backgroundSecondary
617
+ }
618
+ }
619
+ ),
620
+ /* @__PURE__ */ c(
621
+ "span",
622
+ {
623
+ style: {
624
+ position: "absolute",
625
+ top: l + m,
626
+ left: g + e,
627
+ right: e,
628
+ height: h,
629
+ background: f.textColor,
630
+ opacity: 0.8,
631
+ borderRadius: 1
632
+ }
633
+ }
634
+ ),
635
+ /* @__PURE__ */ c(
636
+ "span",
637
+ {
638
+ style: {
639
+ position: "absolute",
640
+ top: l + m * 2 + h,
641
+ left: g + e,
642
+ width: `${Math.max(20, n - g - e * 2 - 4)}px`,
643
+ height: h,
644
+ background: f.textColor,
645
+ opacity: 0.5,
646
+ borderRadius: 1
647
+ }
648
+ }
649
+ )
650
+ ]
651
+ }
652
+ );
653
+ };
654
+ export {
655
+ mf as F,
656
+ gf as N,
657
+ _f as T,
658
+ hf as a,
659
+ vf as b,
660
+ pf as u
661
+ };