@nice2dev/ui 1.3.0 → 1.3.2
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.
- package/CHANGELOG.md +93 -0
- package/dist/NiceDataGrid-Cs4vOOTE.js +2267 -0
- package/dist/NiceDataGrid-jZvzaCv3.cjs +10 -0
- package/dist/NiceForm-DYcrWaN1.js +5017 -0
- package/dist/NiceForm-ZzfYumoR.cjs +1 -0
- package/dist/NiceMention-VhH0Dllr.cjs +430 -0
- package/dist/NiceMention-cOqXnI0M.js +11653 -0
- package/dist/NiceModuleLifecyclePanel-BWUYyWfY.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-BdcJATGF.js +7190 -0
- package/dist/NiceModuleLifecyclePanel-Bk5MXMVu.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-DmdqTQjn.js +7361 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -1
- package/dist/NiceSavedQueryPanel-Cs_dypgU.js +5311 -0
- package/dist/NiceSavedQueryPanel-DTSOHW2v.cjs +586 -0
- package/dist/NiceScheduler-BmHcJLBe.cjs +5 -0
- package/dist/NiceScheduler-DI2sg3Rr.js +1710 -0
- package/dist/core-lazy-BpbIO1EN.cjs +1 -0
- package/dist/core-lazy-L7MVTPp1.js +351 -0
- package/dist/data.cjs +1 -1
- package/dist/data.mjs +2 -2
- package/dist/editors.cjs +1 -1
- package/dist/editors.mjs +3 -3
- package/dist/index.cjs +119 -119
- package/dist/index.css +1 -1
- package/dist/index.d.ts +185 -28
- package/dist/index.mjs +10368 -10337
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +143 -23
- package/dist/navigation.mjs +74 -71
- package/dist/pickerCommons-CUGHOWyc.cjs +1 -0
- package/dist/pickerCommons-D-dwdCBZ.js +659 -0
- package/dist/pickerCommons.css +1 -1
- package/dist/style.css +3 -3
- package/package.json +4 -4
|
@@ -0,0 +1,659 @@
|
|
|
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 W, useRovingFocus as z, useIntent as V, useInputHints as Q, NiceButtonPrompt as H, useNiceAccessMode as q, NiceKeyboardHint as X } from "@nice2dev/ui-core";
|
|
3
|
+
import { useState as G, useRef as P, 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: b = "default",
|
|
10
|
+
vertical: d,
|
|
11
|
+
size: n = "md",
|
|
12
|
+
iconOnly: t = !1,
|
|
13
|
+
centered: r = "auto",
|
|
14
|
+
countLocation: o = "right",
|
|
15
|
+
showHints: g,
|
|
16
|
+
id: h,
|
|
17
|
+
className: m,
|
|
18
|
+
style: e,
|
|
19
|
+
displayStyle: p
|
|
20
|
+
}) => {
|
|
21
|
+
const { t: u } = E(), l = K(h), v = r === "auto" ? t : r, k = F("tab", p), y = Z("tab", p), [A, T] = G(i || f[0]?.id), M = i ?? A, w = P(null), S = P(null), [L] = j(), _ = W(), $ = D(
|
|
22
|
+
(a) => {
|
|
23
|
+
T(a), s?.(a);
|
|
24
|
+
},
|
|
25
|
+
[s]
|
|
26
|
+
);
|
|
27
|
+
z(S, {
|
|
28
|
+
orientation: d ? "vertical" : "horizontal",
|
|
29
|
+
wrap: !0,
|
|
30
|
+
onMove: (a) => {
|
|
31
|
+
const N = a.getAttribute("data-tab-id");
|
|
32
|
+
N && $(N);
|
|
33
|
+
}
|
|
34
|
+
}), V(
|
|
35
|
+
["sectionPrev", "sectionNext"],
|
|
36
|
+
(a) => {
|
|
37
|
+
const N = f.filter((C) => !C.disabled);
|
|
38
|
+
if (N.length < 2)
|
|
39
|
+
return !1;
|
|
40
|
+
const O = N.findIndex((C) => C.id === M), J = a.intent === "sectionNext" ? 1 : -1, B = N[(O + J + N.length) % N.length];
|
|
41
|
+
return $(B.id), [...S.current?.querySelectorAll("[data-tab-id]") ?? []].find((C) => C.getAttribute("data-tab-id") === B.id)?.focus(), !0;
|
|
42
|
+
},
|
|
43
|
+
{ ref: w }
|
|
44
|
+
), Q(
|
|
45
|
+
w,
|
|
46
|
+
f.length > 1 ? [
|
|
47
|
+
{ intent: "sectionPrev", label: u("input.intent.sectionPrev", "Previous section") },
|
|
48
|
+
{ intent: "sectionNext", label: u("input.intent.sectionNext", "Next section") }
|
|
49
|
+
] : []
|
|
50
|
+
);
|
|
51
|
+
const R = f.length > 1 && _ && (g ?? L.hintDensity === "bar-and-controls"), I = f.find((a) => a.id === M)?.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 ${b !== "default" ? `nice-tabs__list--${b}` : ""} ${d ? "nice-tabs__list--vertical" : ""} ${v ? "nice-tabs__list--centered" : ""}`,
|
|
64
|
+
role: "tablist",
|
|
65
|
+
"aria-orientation": d ? "vertical" : "horizontal",
|
|
66
|
+
children: [
|
|
67
|
+
R && /* @__PURE__ */ c("span", { className: "nice-tabs__hint", "aria-hidden": "true", children: /* @__PURE__ */ c(H, { intent: "sectionPrev", size: "sm" }) }),
|
|
68
|
+
f.map((a) => /* @__PURE__ */ x(
|
|
69
|
+
"button",
|
|
70
|
+
{
|
|
71
|
+
type: "button",
|
|
72
|
+
role: "tab",
|
|
73
|
+
id: `${l}-tab-${a.id}`,
|
|
74
|
+
"data-tab-id": a.id,
|
|
75
|
+
"aria-selected": M === a.id,
|
|
76
|
+
"aria-controls": `${l}-panel`,
|
|
77
|
+
"aria-label": t ? a.label : void 0,
|
|
78
|
+
title: t ? a.label : void 0,
|
|
79
|
+
className: `nice-tabs__tab ${M === a.id ? "nice-tabs__tab--active" : ""} ${a.disabled ? "nice-tabs__tab--disabled" : ""} ${o === "bottom" ? "nice-tabs__tab--count-bottom" : ""}`,
|
|
80
|
+
disabled: a.disabled,
|
|
81
|
+
onClick: () => $(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${o === "bottom" ? " nice-tabs__badge--pill" : ""}`,
|
|
89
|
+
children: a.badge
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
a.id
|
|
95
|
+
)),
|
|
96
|
+
R && /* @__PURE__ */ c("span", { className: "nice-tabs__hint", "aria-hidden": "true", children: /* @__PURE__ */ c(H, { intent: "sectionNext", size: "sm" }) })
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
/* @__PURE__ */ c(
|
|
101
|
+
"div",
|
|
102
|
+
{
|
|
103
|
+
className: "nice-tabs__panel",
|
|
104
|
+
role: "tabpanel",
|
|
105
|
+
id: `${l}-panel`,
|
|
106
|
+
"aria-labelledby": M ? `${l}-tab-${M}` : void 0,
|
|
107
|
+
children: I
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
function pf(f, {
|
|
115
|
+
open: i,
|
|
116
|
+
onSelect: s,
|
|
117
|
+
onClose: b,
|
|
118
|
+
onOpen: d,
|
|
119
|
+
loop: n = !1,
|
|
120
|
+
pageSize: t = 10,
|
|
121
|
+
intentRef: r
|
|
122
|
+
}) {
|
|
123
|
+
const [o, g] = G(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((u) => {
|
|
129
|
+
const l = f.length;
|
|
130
|
+
if (l === 0)
|
|
131
|
+
return 0;
|
|
132
|
+
const v = e(u);
|
|
133
|
+
return p ? (v % l + l) % l : Math.min(Math.max(v, 0), l - 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((u) => u + 1, n);
|
|
145
|
+
else if (e.key === "ArrowUp")
|
|
146
|
+
e.preventDefault(), h((u) => u - 1, n);
|
|
147
|
+
else if (e.key === "PageDown")
|
|
148
|
+
e.preventDefault(), h((u) => u + t, !1);
|
|
149
|
+
else if (e.key === "PageUp")
|
|
150
|
+
e.preventDefault(), h((u) => u - 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 u = f[o];
|
|
155
|
+
u !== void 0 && (e.preventDefault(), s(u, o));
|
|
156
|
+
} else e.key === "Escape" && b?.();
|
|
157
|
+
},
|
|
158
|
+
[i, f, o, n, t, h, s, b, 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[o];
|
|
167
|
+
if (p === void 0)
|
|
168
|
+
return !1;
|
|
169
|
+
s(p, o);
|
|
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: r, enabled: i && !!r }
|
|
177
|
+
), { activeIndex: o, 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: b,
|
|
186
|
+
readOnly: d,
|
|
187
|
+
loading: n,
|
|
188
|
+
required: t,
|
|
189
|
+
size: r = "md",
|
|
190
|
+
name: o,
|
|
191
|
+
id: g,
|
|
192
|
+
className: h,
|
|
193
|
+
style: m,
|
|
194
|
+
accessMode: e,
|
|
195
|
+
displayStyle: p,
|
|
196
|
+
showKeyboardHints: u,
|
|
197
|
+
error: l,
|
|
198
|
+
helperText: v,
|
|
199
|
+
labelPlacement: k,
|
|
200
|
+
errorPlacement: y,
|
|
201
|
+
labelWidth: A,
|
|
202
|
+
controlWidth: T
|
|
203
|
+
}, M) => {
|
|
204
|
+
const w = q(e, g), S = w === "hidden";
|
|
205
|
+
(w === "disabled" || w === "readOnly") && (b = !0);
|
|
206
|
+
const { t: L } = E(), _ = K(g);
|
|
207
|
+
F("toggle", p);
|
|
208
|
+
const $ = Z("toggle", p), R = ef(
|
|
209
|
+
() => [{ key: "Space", description: L("shortcuts.toggle", "Toggle on/off") }],
|
|
210
|
+
[L]
|
|
211
|
+
);
|
|
212
|
+
return S ? null : /* @__PURE__ */ x(
|
|
213
|
+
"div",
|
|
214
|
+
{
|
|
215
|
+
className: `nice-field nice-field--inline nice-field--${r} ${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-${$} ${r !== "md" ? `nice-toggle--${r}` : ""} ${b || n ? "nice-toggle--disabled" : ""}`,
|
|
233
|
+
htmlFor: _,
|
|
234
|
+
children: [
|
|
235
|
+
/* @__PURE__ */ c(
|
|
236
|
+
"input",
|
|
237
|
+
{
|
|
238
|
+
ref: M,
|
|
239
|
+
id: _,
|
|
240
|
+
type: "checkbox",
|
|
241
|
+
className: "nice-toggle__input",
|
|
242
|
+
name: o,
|
|
243
|
+
checked: i,
|
|
244
|
+
disabled: b || n,
|
|
245
|
+
readOnly: d,
|
|
246
|
+
role: "switch",
|
|
247
|
+
"aria-checked": i,
|
|
248
|
+
"aria-invalid": !!l,
|
|
249
|
+
onChange: (I) => {
|
|
250
|
+
d || n || s?.(I.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
|
+
u && /* @__PURE__ */ c(X, { shortcuts: R, 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" && l && /* @__PURE__ */ c("div", { id: `${_}-error`, className: "nice-field__error", role: "alert", children: l }),
|
|
262
|
+
y === "right" && !l && v && /* @__PURE__ */ c("div", { id: `${_}-helper`, className: "nice-field__helper", children: v })
|
|
263
|
+
] }),
|
|
264
|
+
y !== "right" && l && /* @__PURE__ */ c("div", { id: `${_}-error`, className: "nice-field__error", role: "alert", children: l }),
|
|
265
|
+
y !== "right" && !l && v && /* @__PURE__ */ c("div", { id: `${_}-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: b } = E(), d = f?.toUpperCase(), n = d ? df[d] : void 0, t = i, r = Math.round(i * 2 / 3);
|
|
472
|
+
return n ? /* @__PURE__ */ c(
|
|
473
|
+
"span",
|
|
474
|
+
{
|
|
475
|
+
className: s,
|
|
476
|
+
role: "img",
|
|
477
|
+
"aria-label": b("pickerCommons.flag", "{upper} flag").replace("{upper}", String(d)),
|
|
478
|
+
style: {
|
|
479
|
+
display: "inline-block",
|
|
480
|
+
width: t,
|
|
481
|
+
height: r,
|
|
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="${r}" 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: b } = E(), d = af(f);
|
|
504
|
+
return /* @__PURE__ */ c(
|
|
505
|
+
"span",
|
|
506
|
+
{
|
|
507
|
+
className: s,
|
|
508
|
+
role: "img",
|
|
509
|
+
"aria-label": b("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, b = 280) {
|
|
526
|
+
const [d, n] = G(s === "left" ? "left" : "right"), t = D(() => {
|
|
527
|
+
if (s !== "auto") {
|
|
528
|
+
n(s);
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
531
|
+
const r = i.current;
|
|
532
|
+
if (!r || typeof window > "u")
|
|
533
|
+
return;
|
|
534
|
+
const o = r.getBoundingClientRect(), h = window.innerWidth - o.left, m = o.right;
|
|
535
|
+
h >= b && h > m ? n("left") : n("right");
|
|
536
|
+
}, [s, i, b]);
|
|
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 Mf = ({ colors: f, size: i = 28, shape: s = "page", className: b }) => {
|
|
545
|
+
const { t: d } = E(), n = i, t = Math.round(i * 0.75), r = f.border ?? "color-mix(in srgb, currentColor 30%, transparent)";
|
|
546
|
+
if (s === "swatch") {
|
|
547
|
+
const u = [
|
|
548
|
+
f.primary,
|
|
549
|
+
f.background,
|
|
550
|
+
f.backgroundSecondary ?? f.background,
|
|
551
|
+
f.textColor
|
|
552
|
+
];
|
|
553
|
+
return /* @__PURE__ */ c(
|
|
554
|
+
"span",
|
|
555
|
+
{
|
|
556
|
+
className: b,
|
|
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 ${r}`,
|
|
564
|
+
borderRadius: 2,
|
|
565
|
+
overflow: "hidden",
|
|
566
|
+
flexShrink: 0,
|
|
567
|
+
verticalAlign: "middle"
|
|
568
|
+
},
|
|
569
|
+
children: u.map((l, v) => /* @__PURE__ */ c("span", { style: { flex: 1, background: l } }, v))
|
|
570
|
+
}
|
|
571
|
+
);
|
|
572
|
+
}
|
|
573
|
+
const o = Math.max(2, Math.round(t * 0.17)), g = Math.max(2, Math.round(n * 0.14)), h = n - g * 2, m = Math.max(2, Math.round(h * 0.16)), e = Math.max(1, Math.round(t * 0.07)), p = t - o;
|
|
574
|
+
return /* @__PURE__ */ x(
|
|
575
|
+
"span",
|
|
576
|
+
{
|
|
577
|
+
className: b,
|
|
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.backgroundSecondary ?? f.background,
|
|
587
|
+
border: `1px solid ${r}`,
|
|
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: o,
|
|
603
|
+
background: f.primary
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
),
|
|
607
|
+
/* @__PURE__ */ c(
|
|
608
|
+
"span",
|
|
609
|
+
{
|
|
610
|
+
style: {
|
|
611
|
+
position: "absolute",
|
|
612
|
+
top: o,
|
|
613
|
+
bottom: 0,
|
|
614
|
+
left: g,
|
|
615
|
+
right: g,
|
|
616
|
+
background: f.background,
|
|
617
|
+
borderLeft: `1px solid ${r}`,
|
|
618
|
+
borderRight: `1px solid ${r}`
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
),
|
|
622
|
+
/* @__PURE__ */ c(
|
|
623
|
+
"span",
|
|
624
|
+
{
|
|
625
|
+
style: {
|
|
626
|
+
position: "absolute",
|
|
627
|
+
top: o + Math.round(p * 0.28),
|
|
628
|
+
left: g + m,
|
|
629
|
+
right: g + m,
|
|
630
|
+
height: e,
|
|
631
|
+
background: f.textColor
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
),
|
|
635
|
+
/* @__PURE__ */ c(
|
|
636
|
+
"span",
|
|
637
|
+
{
|
|
638
|
+
style: {
|
|
639
|
+
position: "absolute",
|
|
640
|
+
top: o + Math.round(p * 0.55),
|
|
641
|
+
left: g + m,
|
|
642
|
+
width: Math.max(3, Math.round((h - m * 2) * 0.6)),
|
|
643
|
+
height: e,
|
|
644
|
+
background: f.textColor
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
)
|
|
648
|
+
]
|
|
649
|
+
}
|
|
650
|
+
);
|
|
651
|
+
};
|
|
652
|
+
export {
|
|
653
|
+
mf as F,
|
|
654
|
+
gf as N,
|
|
655
|
+
Mf as T,
|
|
656
|
+
hf as a,
|
|
657
|
+
vf as b,
|
|
658
|
+
pf as u
|
|
659
|
+
};
|