@nice2dev/ui 1.0.30 → 1.1.5
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 +848 -0
- package/README.md +30 -31
- package/dist/NiceCalendarScheduler.doc-BEtQkZjV.cjs +9 -0
- package/dist/NiceCalendarScheduler.doc-D__LRgOx.js +33 -0
- package/dist/NiceCodeEditor-BVUwp9yX.js +1134 -0
- package/dist/NiceCodeEditor-cIqUSk3j.cjs +260 -0
- package/dist/NiceColorPicker-C8NZZcXE.js +596 -0
- package/dist/NiceColorPicker-CKVbjicN.cjs +1 -0
- package/dist/NiceConfirmDialog-B57cl_F7.cjs +1 -0
- package/dist/NiceConfirmDialog-DmBX1Iea.js +81 -0
- package/dist/NiceConfirmDialog-N9fBTLYm.js +81 -0
- package/dist/NiceConfirmDialog-oSxVpsCs.cjs +1 -0
- package/dist/NiceDataGrid-3AIf2D3t.cjs +10 -0
- package/dist/NiceDataGrid-CXCUAkRb.js +1736 -0
- package/dist/NiceDocumentViewer-B-uEPZAf.js +672 -0
- package/dist/NiceDocumentViewer-BE0gKBlw.cjs +180 -0
- package/dist/NiceDrawingCanvas.doc-Dv5vB4gY.js +32 -0
- package/dist/NiceDrawingCanvas.doc-Ww9zz17x.cjs +8 -0
- package/dist/NiceErrorBoundary-BD-uqk_q.js +709 -0
- package/dist/NiceErrorBoundary-CIPXaYik.cjs +1 -0
- package/dist/NiceFileManagerViews.doc-CKlnm6cX.cjs +1 -0
- package/dist/NiceFileManagerViews.doc-Cg21DArG.js +25 -0
- package/dist/NiceForm-BNZB31Pg.js +4499 -0
- package/dist/NiceForm-C6F0HvrX.cjs +1 -0
- package/dist/NiceForm-CCyfWgIs.js +4805 -0
- package/dist/NiceForm-CPyAXxBO.cjs +1 -0
- package/dist/NiceGantt-CSFLZD2y.js +328 -0
- package/dist/NiceGantt-_ysNSVYR.cjs +1 -0
- package/dist/NiceHtmlEditor-B8B8AcSC.js +841 -0
- package/dist/NiceHtmlEditor-D8RQcBNp.cjs +10 -0
- package/dist/NiceLoginForm-Bai7aN8V.js +708 -0
- package/dist/NiceLoginForm-BrvIc-wq.cjs +1 -0
- package/dist/NiceMegaMenu.doc-7UyOCd3l.cjs +7 -0
- package/dist/NiceMegaMenu.doc-zeIyVa65.js +31 -0
- package/dist/NiceMention-CWoLD0SE.js +11082 -0
- package/dist/NiceMention-J1lUDLhg.cjs +430 -0
- package/dist/NiceMention.css +1 -0
- package/dist/NiceModal-0UxviEYE.cjs +1 -0
- package/dist/NiceModal-Bj53SKLI.js +95 -0
- package/dist/NiceModal-D-iOonog.js +95 -0
- package/dist/NiceModal-DC0UlQhc.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-4hzDw6it.js +6999 -0
- package/dist/NiceModuleLifecyclePanel-BBOg9g0b.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-Df_1k5qW.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-DtuXRiLR.js +6991 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -1
- package/dist/NicePagination-Bjxy9aEc.js +172 -0
- package/dist/NicePagination-CPn-Q1h_.js +172 -0
- package/dist/NicePagination-CfFfNwrg.cjs +1 -0
- package/dist/NicePagination-EEQ6o1dF.cjs +1 -0
- package/dist/NicePivotGrid-Cmiolup9.cjs +152 -0
- package/dist/NicePivotGrid-DX_iUj2X.js +1167 -0
- package/dist/NiceSavedQueryPanel-BhjFJBvn.cjs +586 -0
- package/dist/NiceSavedQueryPanel-CH5c3rUG.js +6988 -0
- package/dist/NiceSavedQueryPanel-KvyXTnFx.js +5129 -0
- package/dist/NiceSavedQueryPanel-aQrEmmcC.cjs +596 -0
- package/dist/NiceScannerControl-Cd5KXJA9.js +12769 -0
- package/dist/NiceScannerControl-DZsERSw_.cjs +698 -0
- package/dist/NiceScannerControl.css +1 -0
- package/dist/NiceScheduler-DuxPzQQZ.js +1645 -0
- package/dist/NiceScheduler-nW7fMzKL.cjs +5 -0
- package/dist/NiceSelect-BVoqtfYN.cjs +1 -0
- package/dist/NiceSelect-DHowflmX.js +433 -0
- package/dist/NiceWindow-BoDzlGk-.js +1621 -0
- package/dist/NiceWindow-DdD9k4nc.cjs +1 -0
- package/dist/NiceWindow-DgONWxBm.cjs +1 -0
- package/dist/NiceWindow-xnTSHdHv.js +1623 -0
- package/dist/charts-B-sl1V9y.cjs +882 -0
- package/dist/charts-Bs0aDM0X.js +4671 -0
- package/dist/charts-DO2z6Ziu.js +31920 -0
- package/dist/charts-DjjKkw0q.cjs +761 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.mjs +7 -7
- package/dist/core-BUsZ7_vI.js +27914 -0
- package/dist/core-C2KhqEaU.cjs +1 -0
- package/dist/core-CLfcCDKc.cjs +122 -0
- package/dist/core-K2DIxXLn.js +795 -0
- package/dist/data-branching-D7l_kILW.cjs +1 -0
- package/dist/data-branching-DC6hcBQN.cjs +1 -0
- package/dist/data-branching-DykdTpjJ.js +6255 -0
- package/dist/data-branching-lJ07lDN-.js +6255 -0
- package/dist/data-branching.cjs +1 -1
- package/dist/data-branching.mjs +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.d.ts +70 -44
- package/dist/data.mjs +17 -16
- package/dist/devops-Bi8MXtko.js +8165 -0
- package/dist/devops-CU0sOVEA.cjs +17 -0
- package/dist/devops-CXyEwQeM.js +8165 -0
- package/dist/devops-On_1wRf9.cjs +17 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.mjs +1 -1
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +288 -432
- package/dist/editors.mjs +58 -62
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.d.ts +1 -1
- package/dist/feedback.mjs +3 -3
- package/dist/index-BDH1yDSg.js +69235 -0
- package/dist/index-C9njkNOD.cjs +5470 -0
- package/dist/index.cjs +5137 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +556 -929
- package/dist/index.mjs +66371 -1017
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.mjs +24 -24
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +31 -213
- package/dist/navigation.mjs +105 -113
- package/dist/no-code-8lO7o6xi.js +7425 -0
- package/dist/no-code-C58g8_fb.cjs +332 -0
- package/dist/no-code-Cj4xJ3w9.js +7425 -0
- package/dist/no-code-K8tOLNew.cjs +332 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.mjs +1 -1
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.d.ts +10 -0
- package/dist/overlays.mjs +36 -36
- package/dist/pickerCommons-B-wOzHFh.cjs +1 -0
- package/dist/pickerCommons-CORo9j2a.js +2119 -0
- package/dist/pickerCommons-COiSUiP2.js +1122 -0
- package/dist/pickerCommons-D3WShRrR.cjs +1 -0
- package/dist/style.css +6 -6
- package/dist/vendor-BPVpdtPp.js +271 -0
- package/dist/vendor-Bo2Q64AF.cjs +1 -0
- package/package.json +17 -17
|
@@ -0,0 +1,1122 @@
|
|
|
1
|
+
import { jsxs as g, jsx as f, Fragment as kf } from "react/jsx-runtime";
|
|
2
|
+
import { r as hf, g as tf, D as pf, G as _f, c as mf, j as gf, n as Ef, Z as Gf, q as Qf, t as If, o as Cf } from "./charts-DO2z6Ziu.js";
|
|
3
|
+
import Xf, { useState as bf, useCallback as R, forwardRef as vf, useMemo as ff, useRef as Rf, useEffect as Pf } from "react";
|
|
4
|
+
import { F as Of } from "./vendor-BPVpdtPp.js";
|
|
5
|
+
const de = ({
|
|
6
|
+
tabs: c,
|
|
7
|
+
activeTab: s,
|
|
8
|
+
onChange: n,
|
|
9
|
+
variant: b = "default",
|
|
10
|
+
vertical: t,
|
|
11
|
+
size: i = "md",
|
|
12
|
+
iconOnly: d = !1,
|
|
13
|
+
centered: m = "auto",
|
|
14
|
+
countLocation: _ = "right",
|
|
15
|
+
className: C,
|
|
16
|
+
style: w,
|
|
17
|
+
displayStyle: $
|
|
18
|
+
}) => {
|
|
19
|
+
const F = m === "auto" ? d : m, r = hf("tab", $), h = tf("tab", $), [S, A] = bf(s || c[0]?.id), x = s ?? S, p = R(
|
|
20
|
+
(a) => {
|
|
21
|
+
A(a), n?.(a);
|
|
22
|
+
},
|
|
23
|
+
[n]
|
|
24
|
+
), u = c.find((a) => a.id === x)?.content;
|
|
25
|
+
return /* @__PURE__ */ g(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
className: `nice-tabs nice-tabs--${i} ${t ? "nice-tabs--vertical" : ""} ${d ? "nice-tabs--icon-only" : ""} nice-tabs--ds-${h} ${C || ""}`,
|
|
29
|
+
style: { ...r, ...w },
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ f(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
className: `nice-tabs__list ${b !== "default" ? `nice-tabs__list--${b}` : ""} ${t ? "nice-tabs__list--vertical" : ""} ${F ? "nice-tabs__list--centered" : ""}`,
|
|
35
|
+
role: "tablist",
|
|
36
|
+
children: c.map((a) => /* @__PURE__ */ g(
|
|
37
|
+
"button",
|
|
38
|
+
{
|
|
39
|
+
type: "button",
|
|
40
|
+
role: "tab",
|
|
41
|
+
"aria-selected": x === a.id,
|
|
42
|
+
"aria-label": d ? a.label : void 0,
|
|
43
|
+
title: d ? a.label : void 0,
|
|
44
|
+
className: `nice-tabs__tab ${x === a.id ? "nice-tabs__tab--active" : ""} ${a.disabled ? "nice-tabs__tab--disabled" : ""} ${_ === "bottom" ? "nice-tabs__tab--count-bottom" : ""}`,
|
|
45
|
+
disabled: a.disabled,
|
|
46
|
+
onClick: () => p(a.id),
|
|
47
|
+
children: [
|
|
48
|
+
a.icon,
|
|
49
|
+
!d && /* @__PURE__ */ f("span", { children: a.label }),
|
|
50
|
+
a.badge !== void 0 && /* @__PURE__ */ f(
|
|
51
|
+
"span",
|
|
52
|
+
{
|
|
53
|
+
className: `nice-tabs__badge${_ === "bottom" ? " nice-tabs__badge--pill" : ""}`,
|
|
54
|
+
children: a.badge
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
a.id
|
|
60
|
+
))
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
/* @__PURE__ */ f("div", { className: "nice-tabs__panel", role: "tabpanel", children: u })
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}, Bf = vf(
|
|
68
|
+
({
|
|
69
|
+
label: c,
|
|
70
|
+
checked: s = !1,
|
|
71
|
+
indeterminate: n = !1,
|
|
72
|
+
onChange: b,
|
|
73
|
+
disabled: t,
|
|
74
|
+
readOnly: i,
|
|
75
|
+
loading: d,
|
|
76
|
+
required: m,
|
|
77
|
+
size: _ = "md",
|
|
78
|
+
name: C,
|
|
79
|
+
id: w,
|
|
80
|
+
className: $,
|
|
81
|
+
style: F,
|
|
82
|
+
error: r,
|
|
83
|
+
helperText: h,
|
|
84
|
+
accessMode: S,
|
|
85
|
+
displayStyle: A,
|
|
86
|
+
showKeyboardHints: x,
|
|
87
|
+
labelPlacement: p,
|
|
88
|
+
errorPlacement: u,
|
|
89
|
+
labelWidth: a,
|
|
90
|
+
controlWidth: o
|
|
91
|
+
}, v) => {
|
|
92
|
+
const D = pf(S, w), N = D === "hidden";
|
|
93
|
+
(D === "disabled" || D === "readOnly") && (t = !0);
|
|
94
|
+
const { t: T } = _f(), L = mf(w);
|
|
95
|
+
tf("toggle", A);
|
|
96
|
+
const K = ff(
|
|
97
|
+
() => [{ key: "Space", description: T("shortcuts.toggle", "Toggle") }],
|
|
98
|
+
[T]
|
|
99
|
+
), E = Xf.useCallback(
|
|
100
|
+
(k) => {
|
|
101
|
+
k && (k.indeterminate = n), typeof v == "function" ? v(k) : v && (v.current = k);
|
|
102
|
+
},
|
|
103
|
+
[n, v]
|
|
104
|
+
);
|
|
105
|
+
return N ? null : /* @__PURE__ */ g(
|
|
106
|
+
"div",
|
|
107
|
+
{
|
|
108
|
+
className: `nice-field nice-field--inline nice-field--${_} ${p === "left" ? "nice-field--label-left" : ""} ${u === "right" ? "nice-field--error-right" : ""} ${d ? "nice-field--loading" : ""} ${$ || ""}`,
|
|
109
|
+
style: {
|
|
110
|
+
...F,
|
|
111
|
+
...a != null && {
|
|
112
|
+
"--nice-field-label-width": typeof a == "number" ? `${a}px` : a
|
|
113
|
+
},
|
|
114
|
+
...o != null && {
|
|
115
|
+
"--nice-field-control-width": typeof o == "number" ? `${o}px` : o
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"aria-busy": d || void 0,
|
|
119
|
+
children: [
|
|
120
|
+
p === "left" && c && /* @__PURE__ */ f("span", { className: `nice-field__label ${m ? "nice-field__label--required" : ""}`, children: c }),
|
|
121
|
+
/* @__PURE__ */ g("div", { className: "nice-field__control", children: [
|
|
122
|
+
/* @__PURE__ */ g(
|
|
123
|
+
"label",
|
|
124
|
+
{
|
|
125
|
+
className: `nice-checkbox ${_ !== "md" ? `nice-checkbox--${_}` : ""} ${t || d ? "nice-checkbox--disabled" : ""}`,
|
|
126
|
+
htmlFor: L,
|
|
127
|
+
children: [
|
|
128
|
+
/* @__PURE__ */ f(
|
|
129
|
+
"input",
|
|
130
|
+
{
|
|
131
|
+
ref: E,
|
|
132
|
+
id: L,
|
|
133
|
+
type: "checkbox",
|
|
134
|
+
className: "nice-checkbox__input",
|
|
135
|
+
name: C,
|
|
136
|
+
checked: s,
|
|
137
|
+
disabled: t || d,
|
|
138
|
+
readOnly: i,
|
|
139
|
+
"aria-invalid": !!r,
|
|
140
|
+
onChange: (k) => {
|
|
141
|
+
i || d || b?.(k.target.checked);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
),
|
|
145
|
+
/* @__PURE__ */ f("span", { className: "nice-checkbox__box", children: /* @__PURE__ */ f(
|
|
146
|
+
"svg",
|
|
147
|
+
{
|
|
148
|
+
viewBox: "0 0 12 12",
|
|
149
|
+
fill: "none",
|
|
150
|
+
stroke: "currentColor",
|
|
151
|
+
strokeWidth: "2",
|
|
152
|
+
strokeLinecap: "round",
|
|
153
|
+
strokeLinejoin: "round",
|
|
154
|
+
children: s ? /* @__PURE__ */ f("polyline", { points: "2 6 5 9 10 3" }) : /* @__PURE__ */ f("line", { x1: "2", y1: "6", x2: "10", y2: "6" })
|
|
155
|
+
}
|
|
156
|
+
) }),
|
|
157
|
+
p !== "left" && c && /* @__PURE__ */ f("span", { children: c }),
|
|
158
|
+
x && /* @__PURE__ */ f(gf, { shortcuts: K, size: "sm" })
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
d && /* @__PURE__ */ f("span", { className: "nice-field__spinner", children: /* @__PURE__ */ f("span", { className: "nice-spinner nice-spinner--sm" }) }),
|
|
163
|
+
u === "right" && r && /* @__PURE__ */ f("div", { id: `${L}-error`, className: "nice-field__error", role: "alert", children: r }),
|
|
164
|
+
u === "right" && !r && h && /* @__PURE__ */ f("div", { id: `${L}-helper`, className: "nice-field__helper", children: h })
|
|
165
|
+
] }),
|
|
166
|
+
u !== "right" && r && /* @__PURE__ */ f("div", { id: `${L}-error`, className: "nice-field__error", role: "alert", children: r }),
|
|
167
|
+
u !== "right" && !r && h && /* @__PURE__ */ f("div", { id: `${L}-helper`, className: "nice-field__helper", children: h })
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
Bf.displayName = "NiceCheckbox";
|
|
174
|
+
const se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
175
|
+
__proto__: null,
|
|
176
|
+
NiceCheckbox: Bf
|
|
177
|
+
}, Symbol.toStringTag, { value: "Module" })), Hf = vf(
|
|
178
|
+
({
|
|
179
|
+
label: c,
|
|
180
|
+
helperText: s,
|
|
181
|
+
error: n,
|
|
182
|
+
required: b,
|
|
183
|
+
disabled: t,
|
|
184
|
+
readOnly: i,
|
|
185
|
+
size: d = "md",
|
|
186
|
+
name: m,
|
|
187
|
+
id: _,
|
|
188
|
+
className: C,
|
|
189
|
+
style: w,
|
|
190
|
+
accessMode: $,
|
|
191
|
+
displayStyle: F,
|
|
192
|
+
value: r,
|
|
193
|
+
onChange: h,
|
|
194
|
+
onBlur: S,
|
|
195
|
+
onKeyDown: A,
|
|
196
|
+
placeholder: x,
|
|
197
|
+
min: p,
|
|
198
|
+
max: u,
|
|
199
|
+
step: a = 1,
|
|
200
|
+
precision: o,
|
|
201
|
+
prefix: v,
|
|
202
|
+
prefixType: D = "label",
|
|
203
|
+
prefixOptions: N,
|
|
204
|
+
prefixValue: T,
|
|
205
|
+
onPrefixChange: L,
|
|
206
|
+
suffix: K,
|
|
207
|
+
showStepper: E = !0,
|
|
208
|
+
submitOnEnter: k,
|
|
209
|
+
onSubmit: J,
|
|
210
|
+
showKeyboardHints: z,
|
|
211
|
+
labelPlacement: q,
|
|
212
|
+
errorPlacement: G,
|
|
213
|
+
loading: j,
|
|
214
|
+
labelWidth: Q,
|
|
215
|
+
controlWidth: I,
|
|
216
|
+
formatPreset: Z,
|
|
217
|
+
format: X,
|
|
218
|
+
suffixType: P = "label",
|
|
219
|
+
suffixOptions: y,
|
|
220
|
+
suffixValue: af,
|
|
221
|
+
onSuffixChange: Nf,
|
|
222
|
+
suffixSeparator: $f = !1,
|
|
223
|
+
displayMode: lf
|
|
224
|
+
}, B) => {
|
|
225
|
+
const O = pf($, _), yf = O === "hidden";
|
|
226
|
+
O === "disabled" && (t = !0), O === "readOnly" && (i = !0);
|
|
227
|
+
const { t: V } = _f(), M = mf(_), Kf = hf("input", F), Zf = tf("input", F), [ef, Af] = bf(!1), [Mf, wf] = bf(null), df = Ef({ enabled: lf, readOnly: i, disabled: t }), Vf = ff(() => {
|
|
228
|
+
let e = 3;
|
|
229
|
+
return u != null && (e = String(Math.abs(Math.floor(u))).length), p != null && p < 0 && (e += 1), o && (e += o + 1), Math.max(3, e) + 1;
|
|
230
|
+
}, [u, p, o]), xf = R(
|
|
231
|
+
(e) => {
|
|
232
|
+
if (X)
|
|
233
|
+
return X(e);
|
|
234
|
+
if (!Z)
|
|
235
|
+
return o != null ? e.toFixed(o) : String(e);
|
|
236
|
+
switch (Z) {
|
|
237
|
+
case "integer":
|
|
238
|
+
return Math.round(e).toLocaleString();
|
|
239
|
+
case "decimal":
|
|
240
|
+
return e.toLocaleString(void 0, {
|
|
241
|
+
minimumFractionDigits: o ?? 2,
|
|
242
|
+
maximumFractionDigits: o ?? 2
|
|
243
|
+
});
|
|
244
|
+
case "money":
|
|
245
|
+
return e.toLocaleString(void 0, {
|
|
246
|
+
minimumFractionDigits: o ?? 2,
|
|
247
|
+
maximumFractionDigits: o ?? 2,
|
|
248
|
+
useGrouping: !0
|
|
249
|
+
});
|
|
250
|
+
case "percent":
|
|
251
|
+
return (e * 100).toLocaleString(void 0, {
|
|
252
|
+
minimumFractionDigits: o ?? 0,
|
|
253
|
+
maximumFractionDigits: o ?? 2
|
|
254
|
+
}) + "%";
|
|
255
|
+
default:
|
|
256
|
+
return String(e);
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
[X, Z, o]
|
|
260
|
+
), sf = ff(() => ef && Mf !== null ? Mf : r == null ? "" : ef ? o != null ? r.toFixed(o) : String(r) : xf(r), [r, ef, Mf, xf, o]), jf = r != null && r < 0, Yf = !!(v || D === "select" && N && N.length > 0), Sf = jf && Yf && !ef, Jf = Sf ? sf.replace(/^[-−]/, "") : sf, rf = R(
|
|
261
|
+
(e) => {
|
|
262
|
+
let l = e;
|
|
263
|
+
return p !== void 0 && (l = Math.max(p, l)), u !== void 0 && (l = Math.min(u, l)), o !== void 0 && (l = parseFloat(l.toFixed(o))), l;
|
|
264
|
+
},
|
|
265
|
+
[p, u, o]
|
|
266
|
+
), zf = R(
|
|
267
|
+
(e) => {
|
|
268
|
+
const l = e.target.value;
|
|
269
|
+
if (wf(l), l === "" || l === "-" || l === "." || l === "-.") {
|
|
270
|
+
l === "" && h?.(null);
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
const H = parseFloat(l);
|
|
274
|
+
if (!isNaN(H)) {
|
|
275
|
+
let U = H;
|
|
276
|
+
p !== void 0 && (U = Math.max(p, U)), u !== void 0 && (U = Math.min(u, U)), h?.(U);
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
[h, p, u]
|
|
280
|
+
), of = R(() => {
|
|
281
|
+
const e = cf.current, l = rf((e ?? 0) + a);
|
|
282
|
+
cf.current = l, h?.(l);
|
|
283
|
+
}, [a, h, rf]), uf = R(() => {
|
|
284
|
+
const e = cf.current, l = rf((e ?? 0) - a);
|
|
285
|
+
cf.current = l, h?.(l);
|
|
286
|
+
}, [a, h, rf]), cf = Rf(r);
|
|
287
|
+
cf.current = r;
|
|
288
|
+
const nf = Rf(null), W = R(() => {
|
|
289
|
+
nf.current && (clearTimeout(nf.current), nf.current = null);
|
|
290
|
+
}, []), Tf = R(
|
|
291
|
+
(e) => {
|
|
292
|
+
W();
|
|
293
|
+
let l = 300;
|
|
294
|
+
const H = () => {
|
|
295
|
+
e(), l = Math.max(30, l * 0.82), nf.current = setTimeout(H, l);
|
|
296
|
+
};
|
|
297
|
+
nf.current = setTimeout(H, 400);
|
|
298
|
+
},
|
|
299
|
+
[W]
|
|
300
|
+
), Lf = Gf({
|
|
301
|
+
enabled: k,
|
|
302
|
+
onSubmit: J
|
|
303
|
+
}), qf = R(
|
|
304
|
+
(e) => {
|
|
305
|
+
Lf(e), e.key === "ArrowUp" ? (e.preventDefault(), of()) : e.key === "ArrowDown" && (e.preventDefault(), uf()), A?.(e);
|
|
306
|
+
},
|
|
307
|
+
[Lf, A, of, uf]
|
|
308
|
+
), Ff = ff(() => {
|
|
309
|
+
const e = [];
|
|
310
|
+
return k && e.push(Qf.submit), E && (e.push({ key: "ArrowUp", description: V("shortcuts.increment", "Increase value") }), e.push({ key: "ArrowDown", description: V("shortcuts.decrement", "Decrease value") })), e;
|
|
311
|
+
}, [k, E, V]);
|
|
312
|
+
return yf ? null : /* @__PURE__ */ g(
|
|
313
|
+
"div",
|
|
314
|
+
{
|
|
315
|
+
className: `nice-field nice-field--${d} ${q === "left" ? "nice-field--label-left" : ""} ${j ? "nice-field--loading" : ""} ${C || ""}`,
|
|
316
|
+
style: {
|
|
317
|
+
...w,
|
|
318
|
+
...Q != null && {
|
|
319
|
+
"--nice-field-label-width": typeof Q == "number" ? `${Q}px` : Q
|
|
320
|
+
},
|
|
321
|
+
...I != null && {
|
|
322
|
+
"--nice-field-control-width": typeof I == "number" ? `${I}px` : I
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
"aria-busy": j || void 0,
|
|
326
|
+
children: [
|
|
327
|
+
c && /* @__PURE__ */ g(
|
|
328
|
+
"label",
|
|
329
|
+
{
|
|
330
|
+
htmlFor: M,
|
|
331
|
+
className: `nice-field__label ${b ? "nice-field__label--required" : ""}`,
|
|
332
|
+
children: [
|
|
333
|
+
c,
|
|
334
|
+
z && Ff.length > 0 && /* @__PURE__ */ f(gf, { shortcuts: Ff, size: "sm" })
|
|
335
|
+
]
|
|
336
|
+
}
|
|
337
|
+
),
|
|
338
|
+
/* @__PURE__ */ g("div", { className: "nice-field__control", children: [
|
|
339
|
+
df.isDisplay ? /* @__PURE__ */ f(
|
|
340
|
+
If,
|
|
341
|
+
{
|
|
342
|
+
value: r == null ? "" : v ? /* @__PURE__ */ g(kf, { children: [
|
|
343
|
+
v,
|
|
344
|
+
sf
|
|
345
|
+
] }) : sf,
|
|
346
|
+
placeholder: x,
|
|
347
|
+
disabled: t,
|
|
348
|
+
readOnly: i,
|
|
349
|
+
onActivate: df.enterEdit,
|
|
350
|
+
ariaLabel: c
|
|
351
|
+
}
|
|
352
|
+
) : /* @__PURE__ */ f(kf, { children: /* @__PURE__ */ g(
|
|
353
|
+
"div",
|
|
354
|
+
{
|
|
355
|
+
className: `nice-input nice-input--number nice-input--${d} nice-input--ds-${Zf} ${$f ? "nice-input--suffix-sep" : ""} ${n ? "nice-input--error" : ""} ${t ? "nice-input--disabled" : ""} ${i ? "nice-input--readonly" : ""}`,
|
|
356
|
+
style: Kf,
|
|
357
|
+
children: [
|
|
358
|
+
E && !i && /* @__PURE__ */ f(
|
|
359
|
+
"button",
|
|
360
|
+
{
|
|
361
|
+
type: "button",
|
|
362
|
+
className: "nice-input__clear nice-input__minus",
|
|
363
|
+
onClick: uf,
|
|
364
|
+
onMouseDown: () => Tf(uf),
|
|
365
|
+
onMouseUp: W,
|
|
366
|
+
onMouseLeave: W,
|
|
367
|
+
disabled: t,
|
|
368
|
+
"aria-label": V("controls.decrement", "Decrement"),
|
|
369
|
+
children: /* @__PURE__ */ f(Cf, { name: "minus", size: 16 })
|
|
370
|
+
}
|
|
371
|
+
),
|
|
372
|
+
D === "select" && N && N.length > 0 ? /* @__PURE__ */ g(kf, { children: [
|
|
373
|
+
Sf && /* @__PURE__ */ f("span", { className: "nice-input__sign", children: "−" }),
|
|
374
|
+
/* @__PURE__ */ f(
|
|
375
|
+
"select",
|
|
376
|
+
{
|
|
377
|
+
className: "nice-input__suffix-select nice-input__icon--prefix",
|
|
378
|
+
value: T ?? N[0]?.value,
|
|
379
|
+
disabled: t,
|
|
380
|
+
onChange: (e) => {
|
|
381
|
+
const l = e.target.value, H = N.find(
|
|
382
|
+
(Y) => Y.value === (T ?? N[0]?.value)
|
|
383
|
+
), U = N.find((Y) => Y.value === l);
|
|
384
|
+
L?.(l, H?.weight, U?.weight);
|
|
385
|
+
},
|
|
386
|
+
children: N.map((e) => /* @__PURE__ */ f("option", { value: e.value, children: e.label }, e.value))
|
|
387
|
+
}
|
|
388
|
+
)
|
|
389
|
+
] }) : v ? /* @__PURE__ */ g("span", { className: "nice-input__icon nice-input__icon--prefix", children: [
|
|
390
|
+
Sf && /* @__PURE__ */ f("span", { className: "nice-input__sign", children: "−" }),
|
|
391
|
+
v
|
|
392
|
+
] }) : null,
|
|
393
|
+
/* @__PURE__ */ f(
|
|
394
|
+
"input",
|
|
395
|
+
{
|
|
396
|
+
ref: (e) => {
|
|
397
|
+
typeof B == "function" ? B(e) : B && (B.current = e), df.autoFocusRef(e);
|
|
398
|
+
},
|
|
399
|
+
id: M,
|
|
400
|
+
className: "nice-input__native",
|
|
401
|
+
type: !ef && (X || Z) ? "text" : "number",
|
|
402
|
+
name: m,
|
|
403
|
+
value: Jf,
|
|
404
|
+
placeholder: x,
|
|
405
|
+
min: p,
|
|
406
|
+
max: u,
|
|
407
|
+
step: a,
|
|
408
|
+
disabled: t || j,
|
|
409
|
+
readOnly: i,
|
|
410
|
+
"aria-invalid": !!n,
|
|
411
|
+
onChange: zf,
|
|
412
|
+
onFocus: (e) => {
|
|
413
|
+
Af(!0), wf(null), e.target.select();
|
|
414
|
+
},
|
|
415
|
+
onBlur: (e) => {
|
|
416
|
+
if (Af(!1), wf(null), r != null && o !== void 0) {
|
|
417
|
+
const l = parseFloat(r.toFixed(o));
|
|
418
|
+
l !== r && h?.(l);
|
|
419
|
+
}
|
|
420
|
+
lf && df.exitEdit(), S?.(e);
|
|
421
|
+
},
|
|
422
|
+
onKeyDown: qf,
|
|
423
|
+
style: { width: `${Vf}ch` }
|
|
424
|
+
}
|
|
425
|
+
),
|
|
426
|
+
P === "select" && y && y.length > 0 ? /* @__PURE__ */ f(
|
|
427
|
+
"select",
|
|
428
|
+
{
|
|
429
|
+
className: "nice-input__suffix-select nice-input__icon--suffix",
|
|
430
|
+
value: af ?? y[0]?.value,
|
|
431
|
+
disabled: t,
|
|
432
|
+
onChange: (e) => {
|
|
433
|
+
const l = e.target.value, H = y.find(
|
|
434
|
+
(Y) => Y.value === (af ?? y[0]?.value)
|
|
435
|
+
), U = y.find((Y) => Y.value === l);
|
|
436
|
+
Nf?.(l, H?.weight, U?.weight);
|
|
437
|
+
},
|
|
438
|
+
children: y.map((e) => /* @__PURE__ */ f("option", { value: e.value, children: e.label }, e.value))
|
|
439
|
+
}
|
|
440
|
+
) : K ? /* @__PURE__ */ f("span", { className: "nice-input__icon nice-input__icon--suffix", children: K }) : null,
|
|
441
|
+
E && !i && /* @__PURE__ */ f(
|
|
442
|
+
"button",
|
|
443
|
+
{
|
|
444
|
+
type: "button",
|
|
445
|
+
className: "nice-input__clear nice-input__plus",
|
|
446
|
+
onClick: of,
|
|
447
|
+
onMouseDown: () => Tf(of),
|
|
448
|
+
onMouseUp: W,
|
|
449
|
+
onMouseLeave: W,
|
|
450
|
+
disabled: t,
|
|
451
|
+
"aria-label": V("controls.increment", "Increment"),
|
|
452
|
+
children: /* @__PURE__ */ f(Cf, { name: "plus", size: 16 })
|
|
453
|
+
}
|
|
454
|
+
)
|
|
455
|
+
]
|
|
456
|
+
}
|
|
457
|
+
) }),
|
|
458
|
+
j && /* @__PURE__ */ f("span", { className: "nice-field__spinner", children: /* @__PURE__ */ f("span", { className: "nice-spinner nice-spinner--sm" }) }),
|
|
459
|
+
G === "right" && n && /* @__PURE__ */ f("div", { className: "nice-field__error", role: "alert", children: n }),
|
|
460
|
+
G === "right" && !n && s && /* @__PURE__ */ f("div", { className: "nice-field__helper", children: s })
|
|
461
|
+
] }),
|
|
462
|
+
G !== "right" && n && /* @__PURE__ */ f("div", { className: "nice-field__error", role: "alert", children: n }),
|
|
463
|
+
G !== "right" && !n && s && /* @__PURE__ */ f("div", { className: "nice-field__helper", children: s })
|
|
464
|
+
]
|
|
465
|
+
}
|
|
466
|
+
);
|
|
467
|
+
}
|
|
468
|
+
);
|
|
469
|
+
Hf.displayName = "NiceNumberInput";
|
|
470
|
+
const re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
471
|
+
__proto__: null,
|
|
472
|
+
NiceNumberInput: Hf
|
|
473
|
+
}, Symbol.toStringTag, { value: "Module" })), Uf = vf(
|
|
474
|
+
({
|
|
475
|
+
label: c,
|
|
476
|
+
helperText: s,
|
|
477
|
+
error: n,
|
|
478
|
+
required: b,
|
|
479
|
+
disabled: t,
|
|
480
|
+
readOnly: i,
|
|
481
|
+
size: d = "md",
|
|
482
|
+
name: m,
|
|
483
|
+
id: _,
|
|
484
|
+
className: C,
|
|
485
|
+
style: w,
|
|
486
|
+
accessMode: $,
|
|
487
|
+
displayStyle: F,
|
|
488
|
+
variant: r,
|
|
489
|
+
value: h,
|
|
490
|
+
defaultValue: S,
|
|
491
|
+
onChange: A,
|
|
492
|
+
onBlur: x,
|
|
493
|
+
onKeyDown: p,
|
|
494
|
+
placeholder: u,
|
|
495
|
+
type: a = "text",
|
|
496
|
+
maxLength: o,
|
|
497
|
+
prefix: v,
|
|
498
|
+
suffix: D,
|
|
499
|
+
clearable: N,
|
|
500
|
+
autoFocus: T,
|
|
501
|
+
submitOnEnter: L,
|
|
502
|
+
onSubmit: K,
|
|
503
|
+
showKeyboardHints: E,
|
|
504
|
+
labelPlacement: k,
|
|
505
|
+
errorPlacement: J,
|
|
506
|
+
loading: z,
|
|
507
|
+
labelWidth: q,
|
|
508
|
+
controlWidth: G,
|
|
509
|
+
displayMode: j,
|
|
510
|
+
...Q
|
|
511
|
+
}, I) => {
|
|
512
|
+
const Z = pf($, _), X = Z === "hidden";
|
|
513
|
+
Z === "disabled" && (t = !0), Z === "readOnly" && (i = !0);
|
|
514
|
+
const { t: P } = _f(), y = mf(_), af = hf("input", F), Nf = tf("input", F), $f = r === "filled" ? "filled" : r === "underlined" ? "underlined" : "", lf = R(() => A?.(""), [A]), B = Ef({ enabled: j, readOnly: i, disabled: t }), O = Gf({
|
|
515
|
+
enabled: L,
|
|
516
|
+
onSubmit: K
|
|
517
|
+
}), yf = R(
|
|
518
|
+
(M) => {
|
|
519
|
+
O(M), p?.(M);
|
|
520
|
+
},
|
|
521
|
+
[O, p]
|
|
522
|
+
), V = ff(() => {
|
|
523
|
+
const M = [];
|
|
524
|
+
return L && M.push({ key: "Enter", description: P("shortcuts.submit", "Submit") }), N && M.push({ key: "Escape", description: P("shortcuts.clear", "Clear") }), M;
|
|
525
|
+
}, [L, N, P]);
|
|
526
|
+
return X ? null : /* @__PURE__ */ g(
|
|
527
|
+
"div",
|
|
528
|
+
{
|
|
529
|
+
className: `nice-field nice-field--${d} ${k === "left" ? "nice-field--label-left" : ""} ${k === "inside" ? "nice-field--label-inside" : ""} ${z ? "nice-field--loading" : ""} ${C || ""}`,
|
|
530
|
+
style: {
|
|
531
|
+
...w,
|
|
532
|
+
...q != null && {
|
|
533
|
+
"--nice-field-label-width": typeof q == "number" ? `${q}px` : q
|
|
534
|
+
},
|
|
535
|
+
...G != null && {
|
|
536
|
+
"--nice-field-control-width": typeof G == "number" ? `${G}px` : G
|
|
537
|
+
}
|
|
538
|
+
},
|
|
539
|
+
"aria-busy": z || void 0,
|
|
540
|
+
"data-floating": k === "inside" && h ? "true" : void 0,
|
|
541
|
+
children: [
|
|
542
|
+
c && k !== "inside" && /* @__PURE__ */ g(
|
|
543
|
+
"label",
|
|
544
|
+
{
|
|
545
|
+
htmlFor: y,
|
|
546
|
+
className: `nice-field__label ${b ? "nice-field__label--required" : ""}`,
|
|
547
|
+
children: [
|
|
548
|
+
c,
|
|
549
|
+
E && V.length > 0 && /* @__PURE__ */ f(gf, { shortcuts: V, size: "sm" })
|
|
550
|
+
]
|
|
551
|
+
}
|
|
552
|
+
),
|
|
553
|
+
/* @__PURE__ */ g("div", { className: "nice-field__control", children: [
|
|
554
|
+
B.isDisplay ? /* @__PURE__ */ f(
|
|
555
|
+
If,
|
|
556
|
+
{
|
|
557
|
+
value: h ?? S ?? "",
|
|
558
|
+
placeholder: u,
|
|
559
|
+
disabled: t,
|
|
560
|
+
readOnly: i,
|
|
561
|
+
onActivate: B.enterEdit,
|
|
562
|
+
ariaLabel: c
|
|
563
|
+
}
|
|
564
|
+
) : /* @__PURE__ */ g(
|
|
565
|
+
"div",
|
|
566
|
+
{
|
|
567
|
+
className: `nice-input nice-input--${d} nice-input--ds-${$f || Nf} ${n ? "nice-input--error" : ""} ${t ? "nice-input--disabled" : ""} ${i ? "nice-input--readonly" : ""}`,
|
|
568
|
+
style: r ? void 0 : af,
|
|
569
|
+
children: [
|
|
570
|
+
v && /* @__PURE__ */ f("span", { className: "nice-input__icon", children: v }),
|
|
571
|
+
/* @__PURE__ */ f(
|
|
572
|
+
"input",
|
|
573
|
+
{
|
|
574
|
+
ref: (M) => {
|
|
575
|
+
typeof I == "function" ? I(M) : I && (I.current = M), B.autoFocusRef(M);
|
|
576
|
+
},
|
|
577
|
+
id: y,
|
|
578
|
+
className: "nice-input__native",
|
|
579
|
+
type: a,
|
|
580
|
+
name: m,
|
|
581
|
+
value: h,
|
|
582
|
+
defaultValue: S,
|
|
583
|
+
placeholder: u,
|
|
584
|
+
disabled: t || z,
|
|
585
|
+
readOnly: i,
|
|
586
|
+
maxLength: o,
|
|
587
|
+
autoFocus: T,
|
|
588
|
+
"aria-invalid": !!n,
|
|
589
|
+
"aria-describedby": n ? `${y}-error` : s ? `${y}-helper` : void 0,
|
|
590
|
+
onChange: (M) => A?.(M.target.value),
|
|
591
|
+
onBlur: (M) => {
|
|
592
|
+
j && B.exitEdit(), x?.(M);
|
|
593
|
+
},
|
|
594
|
+
onKeyDown: yf,
|
|
595
|
+
...Q
|
|
596
|
+
}
|
|
597
|
+
),
|
|
598
|
+
N && h && /* @__PURE__ */ f(
|
|
599
|
+
"button",
|
|
600
|
+
{
|
|
601
|
+
type: "button",
|
|
602
|
+
className: "nice-input__clear",
|
|
603
|
+
onClick: lf,
|
|
604
|
+
"aria-label": P("controls.clear", "Clear"),
|
|
605
|
+
children: /* @__PURE__ */ f(Cf, { name: "close", size: 14 })
|
|
606
|
+
}
|
|
607
|
+
),
|
|
608
|
+
D && /* @__PURE__ */ f("span", { className: "nice-input__icon", children: D }),
|
|
609
|
+
c && k === "inside" && /* @__PURE__ */ f(
|
|
610
|
+
"label",
|
|
611
|
+
{
|
|
612
|
+
htmlFor: y,
|
|
613
|
+
className: `nice-input__floating-label ${b ? "nice-input__floating-label--required" : ""}`,
|
|
614
|
+
children: c
|
|
615
|
+
}
|
|
616
|
+
)
|
|
617
|
+
]
|
|
618
|
+
}
|
|
619
|
+
),
|
|
620
|
+
z && /* @__PURE__ */ f("span", { className: "nice-field__spinner", children: /* @__PURE__ */ f("span", { className: "nice-spinner nice-spinner--sm" }) }),
|
|
621
|
+
J === "right" && n && /* @__PURE__ */ f("div", { id: `${y}-error`, className: "nice-field__error", role: "alert", children: n }),
|
|
622
|
+
J === "right" && !n && s && /* @__PURE__ */ f("div", { id: `${y}-helper`, className: "nice-field__helper", children: s })
|
|
623
|
+
] }),
|
|
624
|
+
J !== "right" && n && /* @__PURE__ */ f("div", { id: `${y}-error`, className: "nice-field__error", role: "alert", children: n }),
|
|
625
|
+
J !== "right" && !n && s && /* @__PURE__ */ f("div", { id: `${y}-helper`, className: "nice-field__helper", children: s })
|
|
626
|
+
]
|
|
627
|
+
}
|
|
628
|
+
);
|
|
629
|
+
}
|
|
630
|
+
);
|
|
631
|
+
Uf.displayName = "NiceTextInput";
|
|
632
|
+
const oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
633
|
+
__proto__: null,
|
|
634
|
+
NiceTextInput: Uf
|
|
635
|
+
}, Symbol.toStringTag, { value: "Module" })), Wf = vf(
|
|
636
|
+
({
|
|
637
|
+
label: c,
|
|
638
|
+
checked: s = !1,
|
|
639
|
+
onChange: n,
|
|
640
|
+
disabled: b,
|
|
641
|
+
readOnly: t,
|
|
642
|
+
loading: i,
|
|
643
|
+
required: d,
|
|
644
|
+
size: m = "md",
|
|
645
|
+
name: _,
|
|
646
|
+
id: C,
|
|
647
|
+
className: w,
|
|
648
|
+
style: $,
|
|
649
|
+
accessMode: F,
|
|
650
|
+
displayStyle: r,
|
|
651
|
+
showKeyboardHints: h,
|
|
652
|
+
error: S,
|
|
653
|
+
helperText: A,
|
|
654
|
+
labelPlacement: x,
|
|
655
|
+
errorPlacement: p,
|
|
656
|
+
labelWidth: u,
|
|
657
|
+
controlWidth: a
|
|
658
|
+
}, o) => {
|
|
659
|
+
const v = pf(F, C), D = v === "hidden";
|
|
660
|
+
(v === "disabled" || v === "readOnly") && (b = !0);
|
|
661
|
+
const { t: N } = _f(), T = mf(C);
|
|
662
|
+
hf("toggle", r);
|
|
663
|
+
const L = tf("toggle", r), K = ff(
|
|
664
|
+
() => [{ key: "Space", description: N("shortcuts.toggle", "Toggle on/off") }],
|
|
665
|
+
[N]
|
|
666
|
+
);
|
|
667
|
+
return D ? null : /* @__PURE__ */ g(
|
|
668
|
+
"div",
|
|
669
|
+
{
|
|
670
|
+
className: `nice-field nice-field--inline nice-field--${m} ${x === "left" ? "nice-field--label-left" : ""} ${i ? "nice-field--loading" : ""} ${w || ""}`,
|
|
671
|
+
style: {
|
|
672
|
+
...$,
|
|
673
|
+
...u != null && {
|
|
674
|
+
"--nice-field-label-width": typeof u == "number" ? `${u}px` : u
|
|
675
|
+
},
|
|
676
|
+
...a != null && {
|
|
677
|
+
"--nice-field-control-width": typeof a == "number" ? `${a}px` : a
|
|
678
|
+
}
|
|
679
|
+
},
|
|
680
|
+
"aria-busy": i || void 0,
|
|
681
|
+
children: [
|
|
682
|
+
x === "left" && c && /* @__PURE__ */ f("span", { className: `nice-field__label ${d ? "nice-field__label--required" : ""}`, children: c }),
|
|
683
|
+
/* @__PURE__ */ g("div", { className: "nice-field__control", children: [
|
|
684
|
+
/* @__PURE__ */ g(
|
|
685
|
+
"label",
|
|
686
|
+
{
|
|
687
|
+
className: `nice-toggle nice-toggle--ds-${L} ${m !== "md" ? `nice-toggle--${m}` : ""} ${b || i ? "nice-toggle--disabled" : ""}`,
|
|
688
|
+
htmlFor: T,
|
|
689
|
+
children: [
|
|
690
|
+
/* @__PURE__ */ f(
|
|
691
|
+
"input",
|
|
692
|
+
{
|
|
693
|
+
ref: o,
|
|
694
|
+
id: T,
|
|
695
|
+
type: "checkbox",
|
|
696
|
+
className: "nice-toggle__input",
|
|
697
|
+
name: _,
|
|
698
|
+
checked: s,
|
|
699
|
+
disabled: b || i,
|
|
700
|
+
readOnly: t,
|
|
701
|
+
role: "switch",
|
|
702
|
+
"aria-checked": s,
|
|
703
|
+
"aria-invalid": !!S,
|
|
704
|
+
onChange: (E) => {
|
|
705
|
+
t || i || n?.(E.target.checked);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
),
|
|
709
|
+
/* @__PURE__ */ f("span", { className: "nice-toggle__track", children: /* @__PURE__ */ f("span", { className: "nice-toggle__thumb" }) }),
|
|
710
|
+
x !== "left" && c && /* @__PURE__ */ f("span", { children: c }),
|
|
711
|
+
h && /* @__PURE__ */ f(gf, { shortcuts: K, size: "sm" })
|
|
712
|
+
]
|
|
713
|
+
}
|
|
714
|
+
),
|
|
715
|
+
i && /* @__PURE__ */ f("span", { className: "nice-field__spinner", children: /* @__PURE__ */ f("span", { className: "nice-spinner nice-spinner--sm" }) }),
|
|
716
|
+
p === "right" && S && /* @__PURE__ */ f("div", { id: `${T}-error`, className: "nice-field__error", role: "alert", children: S }),
|
|
717
|
+
p === "right" && !S && A && /* @__PURE__ */ f("div", { id: `${T}-helper`, className: "nice-field__helper", children: A })
|
|
718
|
+
] }),
|
|
719
|
+
p !== "right" && S && /* @__PURE__ */ f("div", { id: `${T}-error`, className: "nice-field__error", role: "alert", children: S }),
|
|
720
|
+
p !== "right" && !S && A && /* @__PURE__ */ f("div", { id: `${T}-helper`, className: "nice-field__helper", children: A })
|
|
721
|
+
]
|
|
722
|
+
}
|
|
723
|
+
);
|
|
724
|
+
}
|
|
725
|
+
);
|
|
726
|
+
Wf.displayName = "NiceToggle";
|
|
727
|
+
const fe = Object.freeze({
|
|
728
|
+
AR: ["#74acdf", "#ffffff", "#74acdf"],
|
|
729
|
+
AT: ["#ed2939", "#ffffff", "#ed2939"],
|
|
730
|
+
AU: ["#012169", "#ffffff", "#e4002b"],
|
|
731
|
+
BE: ["#000000", "#fae042", "#ed2939"],
|
|
732
|
+
BR: ["#009c3b", "#ffdf00", "#002776"],
|
|
733
|
+
CA: ["#ff0000", "#ffffff", "#ff0000"],
|
|
734
|
+
CH: ["#d52b1e", "#ffffff", "#d52b1e"],
|
|
735
|
+
CN: ["#de2910", "#ffde00", "#de2910"],
|
|
736
|
+
CZ: ["#11457e", "#ffffff", "#d7141a"],
|
|
737
|
+
DE: ["#000000", "#dd0000", "#ffce00"],
|
|
738
|
+
DK: ["#c8102e", "#ffffff", "#c8102e"],
|
|
739
|
+
EE: ["#0072ce", "#000000", "#ffffff"],
|
|
740
|
+
EG: ["#ce1126", "#ffffff", "#000000"],
|
|
741
|
+
ES: ["#aa151b", "#f1bf00", "#aa151b"],
|
|
742
|
+
FI: ["#ffffff", "#003580", "#ffffff"],
|
|
743
|
+
FR: ["#0055a4", "#ffffff", "#ef4135"],
|
|
744
|
+
GB: ["#012169", "#ffffff", "#c8102e"],
|
|
745
|
+
GR: ["#0d5eaf", "#ffffff", "#0d5eaf"],
|
|
746
|
+
HR: ["#171796", "#ffffff", "#ff0000"],
|
|
747
|
+
HU: ["#ce2939", "#ffffff", "#477050"],
|
|
748
|
+
IE: ["#169b62", "#ffffff", "#ff883e"],
|
|
749
|
+
IL: ["#ffffff", "#0038b8", "#ffffff"],
|
|
750
|
+
IN: ["#ff9933", "#ffffff", "#138808"],
|
|
751
|
+
IS: ["#02529c", "#ffffff", "#dc1e35"],
|
|
752
|
+
IT: ["#009246", "#ffffff", "#ce2b37"],
|
|
753
|
+
JP: ["#ffffff", "#bc002d", "#ffffff"],
|
|
754
|
+
KR: ["#ffffff", "#cd2e3a", "#0047a0"],
|
|
755
|
+
LT: ["#fdb913", "#006a44", "#c1272d"],
|
|
756
|
+
LU: ["#ed2939", "#ffffff", "#00a1de"],
|
|
757
|
+
LV: ["#9e3039", "#ffffff", "#9e3039"],
|
|
758
|
+
MX: ["#006847", "#ffffff", "#ce1126"],
|
|
759
|
+
NL: ["#ae1c28", "#ffffff", "#21468b"],
|
|
760
|
+
NO: ["#ef2b2d", "#ffffff", "#002868"],
|
|
761
|
+
NZ: ["#012169", "#ffffff", "#cc142b"],
|
|
762
|
+
PL: ["#ffffff", "#dc143c"],
|
|
763
|
+
PT: ["#006600", "#ff0000"],
|
|
764
|
+
RO: ["#002b7f", "#fcd116", "#ce1126"],
|
|
765
|
+
RU: ["#ffffff", "#0039a6", "#d52b1e"],
|
|
766
|
+
SE: ["#006aa7", "#fecc00", "#006aa7"],
|
|
767
|
+
SK: ["#ffffff", "#0b4ea2", "#ee1c25"],
|
|
768
|
+
TR: ["#e30a17", "#ffffff", "#e30a17"],
|
|
769
|
+
UA: ["#005bbb", "#ffd500"],
|
|
770
|
+
US: ["#b22234", "#ffffff", "#3c3b6e"],
|
|
771
|
+
VN: ["#da251d", "#ffff00", "#da251d"],
|
|
772
|
+
ZA: ["#007a4d", "#ffffff", "#de3831"],
|
|
773
|
+
// ── Round 22 expansion: cover the full COUNTRIES catalogue ─────
|
|
774
|
+
AD: ["#10069f", "#fedf00", "#d50032"],
|
|
775
|
+
AE: ["#00732f", "#ffffff", "#000000"],
|
|
776
|
+
AF: ["#000000", "#d32011", "#007a36"],
|
|
777
|
+
AG: ["#ce1126", "#fcd116", "#000000"],
|
|
778
|
+
AL: ["#e41e20", "#000000", "#e41e20"],
|
|
779
|
+
AM: ["#d90012", "#0033a0", "#f2a800"],
|
|
780
|
+
AO: ["#ce1126", "#000000", "#ffc500"],
|
|
781
|
+
AZ: ["#0092bc", "#ed2939", "#509e2f"],
|
|
782
|
+
BA: ["#002395", "#fecb00", "#ffffff"],
|
|
783
|
+
BB: ["#00267f", "#ffc726", "#00267f"],
|
|
784
|
+
BD: ["#006a4e", "#f42a41", "#006a4e"],
|
|
785
|
+
BF: ["#ef2b2d", "#009e49", "#fcd116"],
|
|
786
|
+
BG: ["#ffffff", "#00966e", "#d62612"],
|
|
787
|
+
BH: ["#ffffff", "#ce1126", "#ce1126"],
|
|
788
|
+
BI: ["#1eb53a", "#ffffff", "#ce1126"],
|
|
789
|
+
BJ: ["#008751", "#fcd116", "#e8112d"],
|
|
790
|
+
BN: ["#f7e017", "#ffffff", "#000000"],
|
|
791
|
+
BO: ["#d52b1e", "#f9e300", "#007934"],
|
|
792
|
+
BS: ["#00778b", "#ffc72c", "#000000"],
|
|
793
|
+
BT: ["#ffcc33", "#ff4e12", "#ffcc33"],
|
|
794
|
+
BW: ["#75aadb", "#ffffff", "#000000"],
|
|
795
|
+
BY: ["#c8313e", "#007c30", "#ffffff"],
|
|
796
|
+
BZ: ["#003f87", "#ce1126", "#003f87"],
|
|
797
|
+
CD: ["#007fff", "#f7d618", "#ce1021"],
|
|
798
|
+
CF: ["#003082", "#ffffff", "#289728"],
|
|
799
|
+
CG: ["#009543", "#fbde4a", "#dc241f"],
|
|
800
|
+
CI: ["#f77f00", "#ffffff", "#009e60"],
|
|
801
|
+
CM: ["#007a5e", "#ce1126", "#fcd116"],
|
|
802
|
+
CO: ["#fcd116", "#003893", "#ce1126"],
|
|
803
|
+
CR: ["#002b7f", "#ffffff", "#ce1126"],
|
|
804
|
+
CU: ["#002590", "#ffffff", "#cf142b"],
|
|
805
|
+
CV: ["#003893", "#ffffff", "#cf2027"],
|
|
806
|
+
CY: ["#ffffff", "#d57800", "#ffffff"],
|
|
807
|
+
DJ: ["#6ab2e7", "#ffffff", "#12ad2b"],
|
|
808
|
+
DM: ["#006b3f", "#ffffff", "#000000"],
|
|
809
|
+
DO: ["#002d62", "#ffffff", "#ce1126"],
|
|
810
|
+
DZ: ["#006233", "#ffffff", "#d21034"],
|
|
811
|
+
EC: ["#ffd100", "#034ea2", "#ed1c24"],
|
|
812
|
+
ER: ["#ea0437", "#0084c9", "#418fde"],
|
|
813
|
+
ET: ["#078930", "#fcdd09", "#da121a"],
|
|
814
|
+
FJ: ["#68bfe5", "#cc0000", "#ffffff"],
|
|
815
|
+
GA: ["#3a75c4", "#ffe700", "#009e60"],
|
|
816
|
+
GD: ["#ce1126", "#fcd116", "#007a5e"],
|
|
817
|
+
GE: ["#ffffff", "#ff0000", "#ffffff"],
|
|
818
|
+
GH: ["#ce1126", "#fcd116", "#006b3f"],
|
|
819
|
+
GM: ["#ce1126", "#ffffff", "#0c1c8c"],
|
|
820
|
+
GN: ["#ce1126", "#fcd116", "#009460"],
|
|
821
|
+
GQ: ["#3e9a00", "#ffffff", "#e32118"],
|
|
822
|
+
GT: ["#4997d0", "#ffffff", "#4997d0"],
|
|
823
|
+
GW: ["#ce1126", "#fcd116", "#009e49"],
|
|
824
|
+
GY: ["#009e49", "#ffffff", "#fcd116"],
|
|
825
|
+
HK: ["#de2910", "#ffffff", "#de2910"],
|
|
826
|
+
HN: ["#0073cf", "#ffffff", "#0073cf"],
|
|
827
|
+
HT: ["#00209f", "#d21034", "#00209f"],
|
|
828
|
+
ID: ["#ff0000", "#ffffff", "#ff0000"],
|
|
829
|
+
IQ: ["#ce1126", "#ffffff", "#000000"],
|
|
830
|
+
IR: ["#239f40", "#ffffff", "#da0000"],
|
|
831
|
+
JM: ["#000000", "#fed100", "#009b3a"],
|
|
832
|
+
JO: ["#000000", "#ffffff", "#007a3d"],
|
|
833
|
+
KE: ["#000000", "#bb0000", "#006600"],
|
|
834
|
+
KG: ["#ff0000", "#fcd116", "#ff0000"],
|
|
835
|
+
KH: ["#032ea1", "#e00025", "#032ea1"],
|
|
836
|
+
KM: ["#fcd116", "#ffffff", "#ce1126"],
|
|
837
|
+
KP: ["#024fa2", "#ed1c27", "#024fa2"],
|
|
838
|
+
KW: ["#007a3d", "#ffffff", "#ce1126"],
|
|
839
|
+
KZ: ["#00afca", "#fec50c", "#00afca"],
|
|
840
|
+
LA: ["#ce1126", "#002868", "#ce1126"],
|
|
841
|
+
LB: ["#ed1c24", "#ffffff", "#ed1c24"],
|
|
842
|
+
LI: ["#002780", "#ce1126", "#002780"],
|
|
843
|
+
LK: ["#ffbe29", "#8d153a", "#00534e"],
|
|
844
|
+
LR: ["#bf0a30", "#ffffff", "#002868"],
|
|
845
|
+
LS: ["#00209f", "#ffffff", "#009543"],
|
|
846
|
+
LY: ["#e70013", "#000000", "#239e46"],
|
|
847
|
+
MA: ["#c1272d", "#006233", "#c1272d"],
|
|
848
|
+
MD: ["#0046ae", "#ffd200", "#cc092f"],
|
|
849
|
+
ME: ["#d4af37", "#cc0033", "#d4af37"],
|
|
850
|
+
MG: ["#ffffff", "#fc3d32", "#007e3a"],
|
|
851
|
+
MH: ["#003893", "#dd7500", "#ffffff"],
|
|
852
|
+
MK: ["#d20000", "#ffe600", "#d20000"],
|
|
853
|
+
ML: ["#14b53a", "#fcd116", "#ce1126"],
|
|
854
|
+
MM: ["#fecb00", "#34b233", "#ea2839"],
|
|
855
|
+
MN: ["#c4272f", "#015197", "#c4272f"],
|
|
856
|
+
MO: ["#00785a", "#ffd700", "#ffffff"],
|
|
857
|
+
MR: ["#006233", "#ffc400", "#d01c1f"],
|
|
858
|
+
MT: ["#ffffff", "#cf142b", "#ffffff"],
|
|
859
|
+
MU: ["#ea2839", "#1a206d", "#00a04d"],
|
|
860
|
+
MV: ["#d21034", "#007e3a", "#ffffff"],
|
|
861
|
+
MW: ["#000000", "#ce1126", "#339e35"],
|
|
862
|
+
MY: ["#cc0000", "#ffffff", "#010066"],
|
|
863
|
+
MZ: ["#009a44", "#ffffff", "#000000"],
|
|
864
|
+
NA: ["#003580", "#ffffff", "#009543"],
|
|
865
|
+
NE: ["#ff8000", "#ffffff", "#0db02b"],
|
|
866
|
+
NG: ["#008753", "#ffffff", "#008753"],
|
|
867
|
+
NI: ["#0067c6", "#ffffff", "#0067c6"],
|
|
868
|
+
NP: ["#dc143c", "#003893", "#dc143c"],
|
|
869
|
+
OM: ["#dc241f", "#ffffff", "#008000"],
|
|
870
|
+
PA: ["#ffffff", "#cc0033", "#005aa7"],
|
|
871
|
+
PE: ["#d91023", "#ffffff", "#d91023"],
|
|
872
|
+
PG: ["#ce1126", "#000000", "#fcd116"],
|
|
873
|
+
PH: ["#0038a8", "#ffffff", "#ce1126"],
|
|
874
|
+
PK: ["#ffffff", "#01411c", "#01411c"],
|
|
875
|
+
PS: ["#000000", "#ffffff", "#007a3d"],
|
|
876
|
+
PY: ["#d52b1e", "#ffffff", "#0038a8"],
|
|
877
|
+
QA: ["#ffffff", "#8a1538", "#8a1538"],
|
|
878
|
+
RS: ["#c6363c", "#0c4076", "#ffffff"],
|
|
879
|
+
RW: ["#00a1de", "#fad201", "#00a651"],
|
|
880
|
+
SA: ["#006c35", "#ffffff", "#006c35"],
|
|
881
|
+
SB: ["#0051ba", "#fcd116", "#215b33"],
|
|
882
|
+
SC: ["#003f87", "#fcd116", "#d62828"],
|
|
883
|
+
SD: ["#d21034", "#ffffff", "#000000"],
|
|
884
|
+
SG: ["#ed2939", "#ffffff", "#ed2939"],
|
|
885
|
+
SI: ["#ffffff", "#0000ff", "#ff0000"],
|
|
886
|
+
SL: ["#1eb53a", "#ffffff", "#0072c6"],
|
|
887
|
+
SM: ["#ffffff", "#5eb6e4", "#ffffff"],
|
|
888
|
+
SN: ["#00853f", "#fdef42", "#e31b23"],
|
|
889
|
+
SO: ["#4189dd", "#ffffff", "#4189dd"],
|
|
890
|
+
SR: ["#377e3f", "#ffffff", "#b40a2d"],
|
|
891
|
+
SS: ["#000000", "#ce1126", "#078930"],
|
|
892
|
+
ST: ["#12ad2b", "#ffce00", "#d21034"],
|
|
893
|
+
SV: ["#0047ab", "#ffffff", "#0047ab"],
|
|
894
|
+
SY: ["#ce1126", "#ffffff", "#000000"],
|
|
895
|
+
SZ: ["#3e5eb9", "#ffd900", "#b10c0c"],
|
|
896
|
+
TD: ["#002664", "#fecb00", "#c60c30"],
|
|
897
|
+
TG: ["#006a4e", "#fcd116", "#d21034"],
|
|
898
|
+
TH: ["#ed1c24", "#ffffff", "#241d4f"],
|
|
899
|
+
TJ: ["#cc0000", "#ffffff", "#006600"],
|
|
900
|
+
TL: ["#dc241f", "#ffc726", "#000000"],
|
|
901
|
+
TM: ["#00853e", "#ffffff", "#cc0000"],
|
|
902
|
+
TN: ["#e70013", "#ffffff", "#e70013"],
|
|
903
|
+
TO: ["#ffffff", "#c10000", "#c10000"],
|
|
904
|
+
TT: ["#ce1126", "#ffffff", "#000000"],
|
|
905
|
+
TW: ["#fe0000", "#000095", "#fe0000"],
|
|
906
|
+
TZ: ["#1eb53a", "#fcd116", "#00a3dd"],
|
|
907
|
+
UG: ["#000000", "#fcdc04", "#d90000"],
|
|
908
|
+
UY: ["#ffffff", "#0038a8", "#ffffff"],
|
|
909
|
+
UZ: ["#1eb53a", "#ffffff", "#0099b5"],
|
|
910
|
+
VA: ["#ffe000", "#ffffff", "#ffe000"],
|
|
911
|
+
VE: ["#fcd116", "#00247d", "#cf142b"],
|
|
912
|
+
VU: ["#000000", "#ce1126", "#009543"],
|
|
913
|
+
WS: ["#002b7f", "#ffffff", "#cc0033"],
|
|
914
|
+
YE: ["#ce1126", "#ffffff", "#000000"],
|
|
915
|
+
ZM: ["#198a00", "#de2010", "#ef7d00"],
|
|
916
|
+
ZW: ["#078930", "#fcd116", "#cf2027"]
|
|
917
|
+
}), Df = ["#cbd5e1", "#94a3b8", "#cbd5e1"];
|
|
918
|
+
function ee(c) {
|
|
919
|
+
return c ? fe[c.toUpperCase()] ?? Df : Df;
|
|
920
|
+
}
|
|
921
|
+
const ce = Of, ue = ({
|
|
922
|
+
code: c,
|
|
923
|
+
size: s = 22,
|
|
924
|
+
className: n
|
|
925
|
+
}) => {
|
|
926
|
+
const b = c?.toUpperCase(), t = b ? ce[b] : void 0, i = s, d = Math.round(s * 2 / 3);
|
|
927
|
+
return t ? /* @__PURE__ */ f(
|
|
928
|
+
"span",
|
|
929
|
+
{
|
|
930
|
+
className: n,
|
|
931
|
+
role: "img",
|
|
932
|
+
"aria-label": `${b} flag`,
|
|
933
|
+
style: {
|
|
934
|
+
display: "inline-block",
|
|
935
|
+
width: i,
|
|
936
|
+
height: d,
|
|
937
|
+
boxSizing: "content-box",
|
|
938
|
+
border: "1px solid var(--nice-overlay-15, rgba(0, 0, 0, 0.15))",
|
|
939
|
+
borderRadius: 2,
|
|
940
|
+
overflow: "hidden",
|
|
941
|
+
flexShrink: 0,
|
|
942
|
+
verticalAlign: "middle",
|
|
943
|
+
lineHeight: 0
|
|
944
|
+
},
|
|
945
|
+
dangerouslySetInnerHTML: {
|
|
946
|
+
__html: t.replace(
|
|
947
|
+
"<svg ",
|
|
948
|
+
`<svg width="${i}" height="${d}" preserveAspectRatio="xMidYMid slice" `
|
|
949
|
+
)
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
) : /* @__PURE__ */ f(ie, { code: c, size: s, className: n });
|
|
953
|
+
}, ie = ({
|
|
954
|
+
code: c,
|
|
955
|
+
size: s = 18,
|
|
956
|
+
className: n
|
|
957
|
+
}) => {
|
|
958
|
+
const b = ee(c);
|
|
959
|
+
return /* @__PURE__ */ f(
|
|
960
|
+
"span",
|
|
961
|
+
{
|
|
962
|
+
className: n,
|
|
963
|
+
role: "img",
|
|
964
|
+
"aria-label": `${c} flag`,
|
|
965
|
+
style: {
|
|
966
|
+
display: "inline-flex",
|
|
967
|
+
width: s,
|
|
968
|
+
height: Math.round(s * 0.7),
|
|
969
|
+
boxSizing: "content-box",
|
|
970
|
+
border: "1px solid var(--nice-overlay-15, rgba(0, 0, 0, 0.15))",
|
|
971
|
+
borderRadius: 2,
|
|
972
|
+
overflow: "hidden",
|
|
973
|
+
flexShrink: 0,
|
|
974
|
+
verticalAlign: "middle"
|
|
975
|
+
},
|
|
976
|
+
children: b.map((t, i) => /* @__PURE__ */ f("span", { style: { flex: 1, background: t } }, i))
|
|
977
|
+
}
|
|
978
|
+
);
|
|
979
|
+
};
|
|
980
|
+
function be(c, s, n, b = 280) {
|
|
981
|
+
const [t, i] = bf(n === "left" ? "left" : "right"), d = R(() => {
|
|
982
|
+
if (n !== "auto") {
|
|
983
|
+
i(n);
|
|
984
|
+
return;
|
|
985
|
+
}
|
|
986
|
+
const m = s.current;
|
|
987
|
+
if (!m || typeof window > "u")
|
|
988
|
+
return;
|
|
989
|
+
const _ = m.getBoundingClientRect(), w = window.innerWidth - _.left, $ = _.right;
|
|
990
|
+
w >= b && w > $ ? i("left") : i("right");
|
|
991
|
+
}, [n, s, b]);
|
|
992
|
+
return Pf(() => {
|
|
993
|
+
if (c)
|
|
994
|
+
return d(), window.addEventListener("resize", d), window.addEventListener("scroll", d, !0), () => {
|
|
995
|
+
window.removeEventListener("resize", d), window.removeEventListener("scroll", d, !0);
|
|
996
|
+
};
|
|
997
|
+
}, [c, d]), t;
|
|
998
|
+
}
|
|
999
|
+
const he = ({ colors: c, size: s = 28, shape: n = "page", className: b }) => {
|
|
1000
|
+
const t = s, i = Math.round(s * 0.75), d = c.border ?? "color-mix(in srgb, currentColor 30%, transparent)";
|
|
1001
|
+
if (n === "swatch") {
|
|
1002
|
+
const F = [
|
|
1003
|
+
c.primary,
|
|
1004
|
+
c.background,
|
|
1005
|
+
c.backgroundSecondary ?? c.background,
|
|
1006
|
+
c.textColor
|
|
1007
|
+
];
|
|
1008
|
+
return /* @__PURE__ */ f(
|
|
1009
|
+
"span",
|
|
1010
|
+
{
|
|
1011
|
+
className: b,
|
|
1012
|
+
role: "img",
|
|
1013
|
+
"aria-label": "Theme preview",
|
|
1014
|
+
style: {
|
|
1015
|
+
display: "inline-flex",
|
|
1016
|
+
width: t,
|
|
1017
|
+
height: i,
|
|
1018
|
+
border: `1px solid ${d}`,
|
|
1019
|
+
borderRadius: 2,
|
|
1020
|
+
overflow: "hidden",
|
|
1021
|
+
flexShrink: 0,
|
|
1022
|
+
verticalAlign: "middle"
|
|
1023
|
+
},
|
|
1024
|
+
children: F.map((r, h) => /* @__PURE__ */ f("span", { style: { flex: 1, background: r } }, h))
|
|
1025
|
+
}
|
|
1026
|
+
);
|
|
1027
|
+
}
|
|
1028
|
+
const m = Math.max(2, Math.round(i * 0.22)), _ = c.backgroundSecondary ? Math.max(3, Math.round(t * 0.28)) : 0, C = Math.max(1, Math.round(i * 0.08)), w = Math.max(1, Math.round(i * 0.05)), $ = Math.max(2, Math.round(t * 0.08));
|
|
1029
|
+
return /* @__PURE__ */ g(
|
|
1030
|
+
"span",
|
|
1031
|
+
{
|
|
1032
|
+
className: b,
|
|
1033
|
+
role: "img",
|
|
1034
|
+
"aria-label": "Theme preview",
|
|
1035
|
+
style: {
|
|
1036
|
+
position: "relative",
|
|
1037
|
+
display: "inline-block",
|
|
1038
|
+
width: t,
|
|
1039
|
+
height: i,
|
|
1040
|
+
boxSizing: "content-box",
|
|
1041
|
+
background: c.background,
|
|
1042
|
+
border: `1px solid ${d}`,
|
|
1043
|
+
borderRadius: 2,
|
|
1044
|
+
overflow: "hidden",
|
|
1045
|
+
flexShrink: 0,
|
|
1046
|
+
verticalAlign: "middle"
|
|
1047
|
+
},
|
|
1048
|
+
children: [
|
|
1049
|
+
/* @__PURE__ */ f(
|
|
1050
|
+
"span",
|
|
1051
|
+
{
|
|
1052
|
+
style: {
|
|
1053
|
+
position: "absolute",
|
|
1054
|
+
top: 0,
|
|
1055
|
+
left: 0,
|
|
1056
|
+
right: 0,
|
|
1057
|
+
height: m,
|
|
1058
|
+
background: c.primary
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
),
|
|
1062
|
+
_ > 0 && /* @__PURE__ */ f(
|
|
1063
|
+
"span",
|
|
1064
|
+
{
|
|
1065
|
+
style: {
|
|
1066
|
+
position: "absolute",
|
|
1067
|
+
top: m,
|
|
1068
|
+
left: 0,
|
|
1069
|
+
bottom: 0,
|
|
1070
|
+
width: _,
|
|
1071
|
+
background: c.backgroundSecondary
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
),
|
|
1075
|
+
/* @__PURE__ */ f(
|
|
1076
|
+
"span",
|
|
1077
|
+
{
|
|
1078
|
+
style: {
|
|
1079
|
+
position: "absolute",
|
|
1080
|
+
top: m + w,
|
|
1081
|
+
left: _ + $,
|
|
1082
|
+
right: $,
|
|
1083
|
+
height: C,
|
|
1084
|
+
background: c.textColor,
|
|
1085
|
+
opacity: 0.8,
|
|
1086
|
+
borderRadius: 1
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
),
|
|
1090
|
+
/* @__PURE__ */ f(
|
|
1091
|
+
"span",
|
|
1092
|
+
{
|
|
1093
|
+
style: {
|
|
1094
|
+
position: "absolute",
|
|
1095
|
+
top: m + w * 2 + C,
|
|
1096
|
+
left: _ + $,
|
|
1097
|
+
width: `${Math.max(20, t - _ - $ * 2 - 4)}px`,
|
|
1098
|
+
height: C,
|
|
1099
|
+
background: c.textColor,
|
|
1100
|
+
opacity: 0.5,
|
|
1101
|
+
borderRadius: 1
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
)
|
|
1105
|
+
]
|
|
1106
|
+
}
|
|
1107
|
+
);
|
|
1108
|
+
};
|
|
1109
|
+
export {
|
|
1110
|
+
ue as F,
|
|
1111
|
+
Bf as N,
|
|
1112
|
+
he as T,
|
|
1113
|
+
Hf as a,
|
|
1114
|
+
Uf as b,
|
|
1115
|
+
Wf as c,
|
|
1116
|
+
de as d,
|
|
1117
|
+
ie as e,
|
|
1118
|
+
se as f,
|
|
1119
|
+
re as g,
|
|
1120
|
+
oe as h,
|
|
1121
|
+
be as u
|
|
1122
|
+
};
|