melonykit 0.12.0 → 0.13.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.
- package/dist/index.js +196 -113
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -40,7 +40,7 @@ var d = /*#__PURE__*/ function() {
|
|
|
40
40
|
}, e;
|
|
41
41
|
}(), f = "-ms-", p = "-moz-", m = "-webkit-", h = "comm", g = "rule", _ = "decl", v = "@import", y = "@keyframes", b = "@layer", x = Math.abs, S = String.fromCharCode, C = Object.assign;
|
|
42
42
|
function w(e, t) {
|
|
43
|
-
return
|
|
43
|
+
return E(e, 0) ^ 45 ? (((t << 2 ^ E(e, 0)) << 2 ^ E(e, 1)) << 2 ^ E(e, 2)) << 2 ^ E(e, 3) : 0;
|
|
44
44
|
}
|
|
45
45
|
function ee(e) {
|
|
46
46
|
return e.trim();
|
|
@@ -51,31 +51,31 @@ function te(e, t) {
|
|
|
51
51
|
function T(e, t, n) {
|
|
52
52
|
return e.replace(t, n);
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function ne(e, t) {
|
|
55
55
|
return e.indexOf(t);
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function E(e, t) {
|
|
58
58
|
return e.charCodeAt(t) | 0;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function D(e, t, n) {
|
|
61
61
|
return e.slice(t, n);
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function O(e) {
|
|
64
64
|
return e.length;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function re(e) {
|
|
67
67
|
return e.length;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function ie(e, t) {
|
|
70
70
|
return t.push(e), e;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function ae(e, t) {
|
|
73
73
|
return e.map(t).join("");
|
|
74
74
|
}
|
|
75
75
|
//#endregion
|
|
76
76
|
//#region node_modules/stylis/src/Tokenizer.js
|
|
77
|
-
var
|
|
78
|
-
function
|
|
77
|
+
var oe = 1, k = 1, se = 0, A = 0, j = 0, M = "";
|
|
78
|
+
function ce(e, t, n, r, i, a, o) {
|
|
79
79
|
return {
|
|
80
80
|
value: e,
|
|
81
81
|
root: t,
|
|
@@ -83,34 +83,34 @@ function se(e, t, n, r, i, a, o) {
|
|
|
83
83
|
type: r,
|
|
84
84
|
props: i,
|
|
85
85
|
children: a,
|
|
86
|
-
line:
|
|
87
|
-
column:
|
|
86
|
+
line: oe,
|
|
87
|
+
column: k,
|
|
88
88
|
length: o,
|
|
89
89
|
return: ""
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
return C(
|
|
94
|
-
}
|
|
95
|
-
function ce() {
|
|
96
|
-
return M;
|
|
92
|
+
function N(e, t) {
|
|
93
|
+
return C(ce("", null, null, "", null, null, 0), e, { length: -e.length }, t);
|
|
97
94
|
}
|
|
98
95
|
function le() {
|
|
99
|
-
return
|
|
96
|
+
return j;
|
|
100
97
|
}
|
|
101
|
-
function
|
|
102
|
-
return
|
|
98
|
+
function ue() {
|
|
99
|
+
return j = A > 0 ? E(M, --A) : 0, k--, j === 10 && (k = 1, oe--), j;
|
|
103
100
|
}
|
|
104
|
-
function
|
|
105
|
-
return
|
|
101
|
+
function P() {
|
|
102
|
+
return j = A < se ? E(M, A++) : 0, k++, j === 10 && (k = 1, oe++), j;
|
|
106
103
|
}
|
|
107
|
-
function
|
|
108
|
-
return
|
|
104
|
+
function F() {
|
|
105
|
+
return E(M, A);
|
|
109
106
|
}
|
|
110
|
-
function
|
|
111
|
-
return
|
|
107
|
+
function de() {
|
|
108
|
+
return A;
|
|
112
109
|
}
|
|
113
|
-
function
|
|
110
|
+
function I(e, t) {
|
|
111
|
+
return D(M, e, t);
|
|
112
|
+
}
|
|
113
|
+
function L(e) {
|
|
114
114
|
switch (e) {
|
|
115
115
|
case 0:
|
|
116
116
|
case 9:
|
|
@@ -137,62 +137,62 @@ function R(e) {
|
|
|
137
137
|
}
|
|
138
138
|
return 0;
|
|
139
139
|
}
|
|
140
|
-
function de(e) {
|
|
141
|
-
return ae = A = 1, oe = k(N = e), j = 0, [];
|
|
142
|
-
}
|
|
143
140
|
function fe(e) {
|
|
144
|
-
return
|
|
141
|
+
return oe = k = 1, se = O(M = e), A = 0, [];
|
|
145
142
|
}
|
|
146
143
|
function pe(e) {
|
|
147
|
-
return
|
|
144
|
+
return M = "", e;
|
|
145
|
+
}
|
|
146
|
+
function R(e) {
|
|
147
|
+
return ee(I(A - 1, ge(e === 91 ? e + 2 : e === 40 ? e + 1 : e)));
|
|
148
148
|
}
|
|
149
149
|
function me(e) {
|
|
150
|
-
for (; (
|
|
151
|
-
return
|
|
150
|
+
for (; (j = F()) && j < 33;) P();
|
|
151
|
+
return L(e) > 2 || L(j) > 3 ? "" : " ";
|
|
152
152
|
}
|
|
153
153
|
function he(e, t) {
|
|
154
|
-
for (; --t &&
|
|
155
|
-
return
|
|
154
|
+
for (; --t && P() && !(j < 48 || j > 102 || j > 57 && j < 65 || j > 70 && j < 97););
|
|
155
|
+
return I(e, de() + (t < 6 && F() == 32 && P() == 32));
|
|
156
156
|
}
|
|
157
157
|
function ge(e) {
|
|
158
|
-
for (;
|
|
159
|
-
case e: return
|
|
158
|
+
for (; P();) switch (j) {
|
|
159
|
+
case e: return A;
|
|
160
160
|
case 34:
|
|
161
161
|
case 39:
|
|
162
|
-
e !== 34 && e !== 39 && ge(
|
|
162
|
+
e !== 34 && e !== 39 && ge(j);
|
|
163
163
|
break;
|
|
164
164
|
case 40:
|
|
165
165
|
e === 41 && ge(e);
|
|
166
166
|
break;
|
|
167
167
|
case 92:
|
|
168
|
-
|
|
168
|
+
P();
|
|
169
169
|
break;
|
|
170
170
|
}
|
|
171
|
-
return
|
|
171
|
+
return A;
|
|
172
172
|
}
|
|
173
173
|
function _e(e, t) {
|
|
174
|
-
for (;
|
|
175
|
-
return "/*" +
|
|
174
|
+
for (; P() && e + j !== 57 && (e + j !== 84 || F() !== 47););
|
|
175
|
+
return "/*" + I(t, A - 1) + "*" + S(e === 47 ? e : P());
|
|
176
176
|
}
|
|
177
177
|
function ve(e) {
|
|
178
|
-
for (; !
|
|
179
|
-
return
|
|
178
|
+
for (; !L(F());) P();
|
|
179
|
+
return I(e, A);
|
|
180
180
|
}
|
|
181
181
|
//#endregion
|
|
182
182
|
//#region node_modules/stylis/src/Parser.js
|
|
183
183
|
function ye(e) {
|
|
184
|
-
return
|
|
184
|
+
return pe(z("", null, null, null, [""], e = fe(e), 0, [0], e));
|
|
185
185
|
}
|
|
186
186
|
function z(e, t, n, r, i, a, o, s, c) {
|
|
187
|
-
for (var l = 0, u = 0, d = o, f = 0, p = 0, m = 0, h = 1, g = 1, _ = 1, v = 0, y = "", b = i, x = a, C = r, w = y; g;) switch (m = v, v =
|
|
188
|
-
case 40: if (m != 108 &&
|
|
189
|
-
|
|
187
|
+
for (var l = 0, u = 0, d = o, f = 0, p = 0, m = 0, h = 1, g = 1, _ = 1, v = 0, y = "", b = i, x = a, C = r, w = y; g;) switch (m = v, v = P()) {
|
|
188
|
+
case 40: if (m != 108 && E(w, d - 1) == 58) {
|
|
189
|
+
ne(w += T(R(v), "&", "&\f"), "&\f") != -1 && (_ = -1);
|
|
190
190
|
break;
|
|
191
191
|
}
|
|
192
192
|
case 34:
|
|
193
193
|
case 39:
|
|
194
194
|
case 91:
|
|
195
|
-
w +=
|
|
195
|
+
w += R(v);
|
|
196
196
|
break;
|
|
197
197
|
case 9:
|
|
198
198
|
case 10:
|
|
@@ -201,18 +201,18 @@ function z(e, t, n, r, i, a, o, s, c) {
|
|
|
201
201
|
w += me(m);
|
|
202
202
|
break;
|
|
203
203
|
case 92:
|
|
204
|
-
w += he(
|
|
204
|
+
w += he(de() - 1, 7);
|
|
205
205
|
continue;
|
|
206
206
|
case 47:
|
|
207
|
-
switch (
|
|
207
|
+
switch (F()) {
|
|
208
208
|
case 42:
|
|
209
209
|
case 47:
|
|
210
|
-
|
|
210
|
+
ie(xe(_e(P(), de()), t, n), c);
|
|
211
211
|
break;
|
|
212
212
|
default: w += "/";
|
|
213
213
|
}
|
|
214
214
|
break;
|
|
215
|
-
case 123 * h: s[l++] =
|
|
215
|
+
case 123 * h: s[l++] = O(w) * _;
|
|
216
216
|
case 125 * h:
|
|
217
217
|
case 59:
|
|
218
218
|
case 0:
|
|
@@ -220,17 +220,17 @@ function z(e, t, n, r, i, a, o, s, c) {
|
|
|
220
220
|
case 0:
|
|
221
221
|
case 125: g = 0;
|
|
222
222
|
case 59 + u:
|
|
223
|
-
_ == -1 && (w = T(w, /\f/g, "")), p > 0 &&
|
|
223
|
+
_ == -1 && (w = T(w, /\f/g, "")), p > 0 && O(w) - d && ie(p > 32 ? Se(w + ";", r, n, d - 1) : Se(T(w, " ", "") + ";", r, n, d - 2), c);
|
|
224
224
|
break;
|
|
225
225
|
case 59: w += ";";
|
|
226
|
-
default: if (
|
|
226
|
+
default: if (ie(C = be(w, t, n, l, u, i, s, y, b = [], x = [], d), a), v === 123) {
|
|
227
227
|
if (u === 0) z(w, t, C, C, b, a, d, s, x);
|
|
228
|
-
else switch (f === 99 &&
|
|
228
|
+
else switch (f === 99 && E(w, 3) === 110 ? 100 : f) {
|
|
229
229
|
case 100:
|
|
230
230
|
case 108:
|
|
231
231
|
case 109:
|
|
232
232
|
case 115:
|
|
233
|
-
z(e, C, C, r &&
|
|
233
|
+
z(e, C, C, r && ie(be(e, C, C, 0, 0, i, s, y, i, b = [], d), x), i, x, d, s, r ? b : x);
|
|
234
234
|
break;
|
|
235
235
|
default: z(w, C, C, C, [""], x, 0, s, x);
|
|
236
236
|
}
|
|
@@ -238,41 +238,41 @@ function z(e, t, n, r, i, a, o, s, c) {
|
|
|
238
238
|
}
|
|
239
239
|
l = u = p = 0, h = _ = 1, y = w = "", d = o;
|
|
240
240
|
break;
|
|
241
|
-
case 58: d = 1 +
|
|
241
|
+
case 58: d = 1 + O(w), p = m;
|
|
242
242
|
default:
|
|
243
243
|
if (h < 1) {
|
|
244
244
|
if (v == 123) --h;
|
|
245
|
-
else if (v == 125 && h++ == 0 &&
|
|
245
|
+
else if (v == 125 && h++ == 0 && ue() == 125) continue;
|
|
246
246
|
}
|
|
247
247
|
switch (w += S(v), v * h) {
|
|
248
248
|
case 38:
|
|
249
249
|
_ = u > 0 ? 1 : (w += "\f", -1);
|
|
250
250
|
break;
|
|
251
251
|
case 44:
|
|
252
|
-
s[l++] = (
|
|
252
|
+
s[l++] = (O(w) - 1) * _, _ = 1;
|
|
253
253
|
break;
|
|
254
254
|
case 64:
|
|
255
|
-
|
|
255
|
+
F() === 45 && (w += R(P())), f = F(), u = d = O(y = w += ve(de())), v++;
|
|
256
256
|
break;
|
|
257
|
-
case 45: m === 45 &&
|
|
257
|
+
case 45: m === 45 && O(w) == 2 && (h = 0);
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
return a;
|
|
261
261
|
}
|
|
262
262
|
function be(e, t, n, r, i, a, o, s, c, l, u) {
|
|
263
|
-
for (var d = i - 1, f = i === 0 ? a : [""], p =
|
|
264
|
-
return
|
|
263
|
+
for (var d = i - 1, f = i === 0 ? a : [""], p = re(f), m = 0, h = 0, _ = 0; m < r; ++m) for (var v = 0, y = D(e, d + 1, d = x(h = o[m])), b = e; v < p; ++v) (b = ee(h > 0 ? f[v] + " " + y : T(y, /&\f/g, f[v]))) && (c[_++] = b);
|
|
264
|
+
return ce(e, t, n, i === 0 ? g : s, c, l, u);
|
|
265
265
|
}
|
|
266
266
|
function xe(e, t, n) {
|
|
267
|
-
return
|
|
267
|
+
return ce(e, t, n, h, S(le()), D(e, 2, -2), 0);
|
|
268
268
|
}
|
|
269
269
|
function Se(e, t, n, r) {
|
|
270
|
-
return
|
|
270
|
+
return ce(e, t, n, _, D(e, 0, r), D(e, r + 1, -1), r);
|
|
271
271
|
}
|
|
272
272
|
//#endregion
|
|
273
273
|
//#region node_modules/stylis/src/Serializer.js
|
|
274
274
|
function B(e, t) {
|
|
275
|
-
for (var n = "", r =
|
|
275
|
+
for (var n = "", r = re(e), i = 0; i < r; i++) n += t(e[i], i, e, t) || "";
|
|
276
276
|
return n;
|
|
277
277
|
}
|
|
278
278
|
function Ce(e, t, n, r) {
|
|
@@ -284,12 +284,12 @@ function Ce(e, t, n, r) {
|
|
|
284
284
|
case y: return e.return = e.value + "{" + B(e.children, r) + "}";
|
|
285
285
|
case g: e.value = e.props.join(",");
|
|
286
286
|
}
|
|
287
|
-
return
|
|
287
|
+
return O(n = B(e.children, r)) ? e.return = e.value + "{" + n + "}" : "";
|
|
288
288
|
}
|
|
289
289
|
//#endregion
|
|
290
290
|
//#region node_modules/stylis/src/Middleware.js
|
|
291
291
|
function we(e) {
|
|
292
|
-
var t =
|
|
292
|
+
var t = re(e);
|
|
293
293
|
return function(n, r, i, a) {
|
|
294
294
|
for (var o = "", s = 0; s < t; s++) o += e[s](n, r, i, a) || "";
|
|
295
295
|
return o;
|
|
@@ -311,28 +311,28 @@ function Ee(e) {
|
|
|
311
311
|
//#endregion
|
|
312
312
|
//#region node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js
|
|
313
313
|
var De = function(e, t, n) {
|
|
314
|
-
for (var r = 0, i = 0; r = i, i =
|
|
315
|
-
return
|
|
314
|
+
for (var r = 0, i = 0; r = i, i = F(), r === 38 && i === 12 && (t[n] = 1), !L(i);) P();
|
|
315
|
+
return I(e, A);
|
|
316
316
|
}, Oe = function(e, t) {
|
|
317
317
|
var n = -1, r = 44;
|
|
318
318
|
do
|
|
319
|
-
switch (
|
|
319
|
+
switch (L(r)) {
|
|
320
320
|
case 0:
|
|
321
|
-
r === 38 &&
|
|
321
|
+
r === 38 && F() === 12 && (t[n] = 1), e[n] += De(A - 1, t, n);
|
|
322
322
|
break;
|
|
323
323
|
case 2:
|
|
324
|
-
e[n] +=
|
|
324
|
+
e[n] += R(r);
|
|
325
325
|
break;
|
|
326
326
|
case 4: if (r === 44) {
|
|
327
|
-
e[++n] =
|
|
327
|
+
e[++n] = F() === 58 ? "&\f" : "", t[n] = e[n].length;
|
|
328
328
|
break;
|
|
329
329
|
}
|
|
330
330
|
default: e[n] += S(r);
|
|
331
331
|
}
|
|
332
|
-
while (r =
|
|
332
|
+
while (r = P());
|
|
333
333
|
return e;
|
|
334
334
|
}, ke = function(e, t) {
|
|
335
|
-
return
|
|
335
|
+
return pe(Oe(fe(e), t));
|
|
336
336
|
}, Ae = /* #__PURE__ */ new WeakMap(), je = function(e) {
|
|
337
337
|
if (!(e.type !== "rule" || !e.parent || e.length < 1)) {
|
|
338
338
|
for (var t = e.value, n = e.parent, r = e.column === n.column && e.line === n.line; n.type !== "rule";) if (n = n.parent, !n) return;
|
|
@@ -410,21 +410,21 @@ function Ne(e, t) {
|
|
|
410
410
|
case 5789:
|
|
411
411
|
case 5021:
|
|
412
412
|
case 4765:
|
|
413
|
-
if (
|
|
414
|
-
case 109: if (
|
|
415
|
-
case 102: return T(e, /(.+:)(.+)-([^]+)/, "$1" + m + "$2-$3$1" + p + (
|
|
416
|
-
case 115: return ~
|
|
413
|
+
if (O(e) - 1 - t > 6) switch (E(e, t + 1)) {
|
|
414
|
+
case 109: if (E(e, t + 4) !== 45) break;
|
|
415
|
+
case 102: return T(e, /(.+:)(.+)-([^]+)/, "$1" + m + "$2-$3$1" + p + (E(e, t + 3) == 108 ? "$3" : "$2-$3")) + e;
|
|
416
|
+
case 115: return ~ne(e, "stretch") ? Ne(T(e, "stretch", "fill-available"), t) + e : e;
|
|
417
417
|
}
|
|
418
418
|
break;
|
|
419
|
-
case 4949: if (
|
|
419
|
+
case 4949: if (E(e, t + 1) !== 115) break;
|
|
420
420
|
case 6444:
|
|
421
|
-
switch (
|
|
421
|
+
switch (E(e, O(e) - 3 - (~ne(e, "!important") && 10))) {
|
|
422
422
|
case 107: return T(e, ":", ":" + m) + e;
|
|
423
|
-
case 101: return T(e, /(.+:)([^;!]+)(;|!.+)?/, "$1" + m + (
|
|
423
|
+
case 101: return T(e, /(.+:)([^;!]+)(;|!.+)?/, "$1" + m + (E(e, 14) === 45 ? "inline-" : "") + "box$3$1" + m + "$2$3$1" + f + "$2box$3") + e;
|
|
424
424
|
}
|
|
425
425
|
break;
|
|
426
426
|
case 5936:
|
|
427
|
-
switch (
|
|
427
|
+
switch (E(e, t + 11)) {
|
|
428
428
|
case 114: return m + e + f + T(e, /[svh]\w+-[tblr]{2}/, "tb") + e;
|
|
429
429
|
case 108: return m + e + f + T(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e;
|
|
430
430
|
case 45: return m + e + f + T(e, /[svh]\w+-[tblr]{2}/, "lr") + e;
|
|
@@ -438,15 +438,15 @@ var Pe = [function(e, t, n, r) {
|
|
|
438
438
|
case _:
|
|
439
439
|
e.return = Ne(e.value, e.length);
|
|
440
440
|
break;
|
|
441
|
-
case y: return B([
|
|
442
|
-
case g: if (e.length) return
|
|
441
|
+
case y: return B([N(e, { value: T(e.value, "@", "@" + m) })], r);
|
|
442
|
+
case g: if (e.length) return ae(e.props, function(t) {
|
|
443
443
|
switch (te(t, /(::plac\w+|:read-\w+)/)) {
|
|
444
444
|
case ":read-only":
|
|
445
|
-
case ":read-write": return B([
|
|
445
|
+
case ":read-write": return B([N(e, { props: [T(t, /:(read-\w+)/, ":" + p + "$1")] })], r);
|
|
446
446
|
case "::placeholder": return B([
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
447
|
+
N(e, { props: [T(t, /:(plac\w+)/, ":" + m + "input-$1")] }),
|
|
448
|
+
N(e, { props: [T(t, /:(plac\w+)/, ":" + p + "$1")] }),
|
|
449
|
+
N(e, { props: [T(t, /:(plac\w+)/, f + "input-$1")] })
|
|
450
450
|
], r);
|
|
451
451
|
}
|
|
452
452
|
return "";
|
|
@@ -1622,7 +1622,7 @@ function Ot({ items: e = [], value: t, width: l, isDisabled: u = !1, onChange: d
|
|
|
1622
1622
|
function T(e) {
|
|
1623
1623
|
g.value = e.value, _.value = !1, m.current?.focus(), d?.(e.value, e);
|
|
1624
1624
|
}
|
|
1625
|
-
let
|
|
1625
|
+
let ne = /* @__PURE__ */ c("button", {
|
|
1626
1626
|
ref: m,
|
|
1627
1627
|
type: "button",
|
|
1628
1628
|
className: Q.trigger,
|
|
@@ -1660,7 +1660,7 @@ function Ot({ items: e = [], value: t, width: l, isDisabled: u = !1, onChange: d
|
|
|
1660
1660
|
"is-disabled": b || void 0,
|
|
1661
1661
|
children: /* @__PURE__ */ s(ot, {
|
|
1662
1662
|
className: Q.popup,
|
|
1663
|
-
trigger:
|
|
1663
|
+
trigger: ne,
|
|
1664
1664
|
id: f,
|
|
1665
1665
|
isOpen: _.value,
|
|
1666
1666
|
origin: "left",
|
|
@@ -1896,8 +1896,30 @@ var Lt = { base: G`
|
|
|
1896
1896
|
background-color: ${K.colors.back.secondary};
|
|
1897
1897
|
` };
|
|
1898
1898
|
//#endregion
|
|
1899
|
+
//#region src/components/_counter.jsx
|
|
1900
|
+
function Rt({ value: e }) {
|
|
1901
|
+
return e == null ? /* @__PURE__ */ s(o, {}) : /* @__PURE__ */ s(o, { children: /* @__PURE__ */ s("span", {
|
|
1902
|
+
className: zt.base,
|
|
1903
|
+
children: e
|
|
1904
|
+
}) });
|
|
1905
|
+
}
|
|
1906
|
+
var zt = { base: G`
|
|
1907
|
+
display: inline-flex;
|
|
1908
|
+
align-items: center;
|
|
1909
|
+
justify-content: center;
|
|
1910
|
+
min-width: 1.2rem;
|
|
1911
|
+
height: 1.2rem;
|
|
1912
|
+
padding: 0 .2rem;
|
|
1913
|
+
border-radius: 50%;
|
|
1914
|
+
color: ${K.colors.fore.primary};
|
|
1915
|
+
background-color: #e1e1e1;
|
|
1916
|
+
font-size: .7rem;
|
|
1917
|
+
font-weight: 700;
|
|
1918
|
+
line-height: 1;
|
|
1919
|
+
` };
|
|
1920
|
+
//#endregion
|
|
1899
1921
|
//#region src/components/_tab-box.jsx
|
|
1900
|
-
function
|
|
1922
|
+
function Bt({ className: e, width: t, height: r, initialIndex: a = 0, items: l = [], onChange: u }) {
|
|
1901
1923
|
let d = i(), f = Math.max(l.length - 1, 0), p = n(Math.min(Math.max(a, 0), f)), m = Math.min(p.value, f);
|
|
1902
1924
|
function h(e) {
|
|
1903
1925
|
e !== m && (p.value = e, u?.(e, l[e]));
|
|
@@ -1925,7 +1947,7 @@ function Rt({ className: e, width: t, height: r, initialIndex: a = 0, items: l =
|
|
|
1925
1947
|
className: $.tabs,
|
|
1926
1948
|
role: "tablist",
|
|
1927
1949
|
children: l.map((e, t) => {
|
|
1928
|
-
let n = t === m, r = e.
|
|
1950
|
+
let n = t === m, r = e.counter ?? e.notification;
|
|
1929
1951
|
return /* @__PURE__ */ s(o, { children: /* @__PURE__ */ c("button", {
|
|
1930
1952
|
id: `${d}-tab-${t}`,
|
|
1931
1953
|
className: $.tab,
|
|
@@ -1947,11 +1969,7 @@ function Rt({ className: e, width: t, height: r, initialIndex: a = 0, items: l =
|
|
|
1947
1969
|
size: "1rem"
|
|
1948
1970
|
}),
|
|
1949
1971
|
e.label && /* @__PURE__ */ s("span", { children: e.label }),
|
|
1950
|
-
|
|
1951
|
-
className: $.notification,
|
|
1952
|
-
"aria-label": `${e.notification} notifications`,
|
|
1953
|
-
children: e.notification
|
|
1954
|
-
})
|
|
1972
|
+
/* @__PURE__ */ s(Rt, { value: r })
|
|
1955
1973
|
]
|
|
1956
1974
|
}, e.id ?? t) });
|
|
1957
1975
|
})
|
|
@@ -2015,21 +2033,86 @@ var $ = {
|
|
|
2015
2033
|
color: ${K.colors.fore.primary};
|
|
2016
2034
|
background-color: ${K.colors.back.primary};
|
|
2017
2035
|
}
|
|
2036
|
+
`
|
|
2037
|
+
};
|
|
2038
|
+
//#endregion
|
|
2039
|
+
//#region src/components/_tab-container.jsx
|
|
2040
|
+
function Vt({ className: e, initialIndex: t = 0, items: r = [], onChange: a, width: l }) {
|
|
2041
|
+
let u = i(), d = Math.max(r.length - 1, 0), f = n(Math.min(Math.max(t, 0), d)), p = Math.min(f.value, d), m = r[p];
|
|
2042
|
+
function h(e) {
|
|
2043
|
+
e !== p && (f.value = e, a?.(e, r[e]));
|
|
2044
|
+
}
|
|
2045
|
+
return /* @__PURE__ */ s(o, { children: /* @__PURE__ */ s("div", {
|
|
2046
|
+
className: W(Ht.base, e),
|
|
2047
|
+
style: { width: l },
|
|
2048
|
+
children: r.length > 0 && /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("div", {
|
|
2049
|
+
className: Ht.tabs,
|
|
2050
|
+
role: "tablist",
|
|
2051
|
+
children: r.map((e, t) => {
|
|
2052
|
+
let n = t === p, r = e.counter ?? e.notification;
|
|
2053
|
+
return /* @__PURE__ */ c("button", {
|
|
2054
|
+
id: `${u}-tab-${t}`,
|
|
2055
|
+
className: Ht.tab,
|
|
2056
|
+
type: "button",
|
|
2057
|
+
role: "tab",
|
|
2058
|
+
"aria-controls": `${u}-panel`,
|
|
2059
|
+
"aria-selected": n,
|
|
2060
|
+
tabIndex: n ? 0 : -1,
|
|
2061
|
+
"is-active": n || void 0,
|
|
2062
|
+
onClick: () => h(t),
|
|
2063
|
+
children: [e.label, /* @__PURE__ */ s(Rt, { value: r })]
|
|
2064
|
+
}, e.id ?? t);
|
|
2065
|
+
})
|
|
2066
|
+
}), /* @__PURE__ */ s("div", {
|
|
2067
|
+
id: `${u}-panel`,
|
|
2068
|
+
className: Ht.panel,
|
|
2069
|
+
role: "tabpanel",
|
|
2070
|
+
"aria-labelledby": `${u}-tab-${p}`,
|
|
2071
|
+
children: m?.content
|
|
2072
|
+
})] })
|
|
2073
|
+
}) });
|
|
2074
|
+
}
|
|
2075
|
+
var Ht = {
|
|
2076
|
+
base: G`
|
|
2077
|
+
position: relative;
|
|
2078
|
+
width: 100%;
|
|
2079
|
+
max-width: 100%;
|
|
2018
2080
|
`,
|
|
2019
|
-
|
|
2020
|
-
display:
|
|
2081
|
+
tabs: G`
|
|
2082
|
+
display: flex;
|
|
2083
|
+
gap: .25rem;
|
|
2084
|
+
padding: .25rem;
|
|
2085
|
+
border-radius: 12px;
|
|
2086
|
+
background-color: ${K.colors.back.secondary};
|
|
2087
|
+
`,
|
|
2088
|
+
tab: G`
|
|
2089
|
+
display: flex;
|
|
2090
|
+
flex: 1 1 0;
|
|
2021
2091
|
align-items: center;
|
|
2022
2092
|
justify-content: center;
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2093
|
+
gap: .4rem;
|
|
2094
|
+
min-width: 0;
|
|
2095
|
+
min-height: 2.5rem;
|
|
2096
|
+
padding: .5rem .75rem;
|
|
2097
|
+
border-radius: 9px;
|
|
2098
|
+
color: ${K.colors.fore.secondary};
|
|
2099
|
+
cursor: pointer;
|
|
2100
|
+
font-family: ${K.fontFamily}, sans-serif;
|
|
2101
|
+
font-size: .8rem;
|
|
2102
|
+
font-weight: 600;
|
|
2103
|
+
transition: color .2s ease, background-color .2s ease;
|
|
2104
|
+
|
|
2105
|
+
&[is-active] {
|
|
2106
|
+
color: ${K.colors.fore.primary};
|
|
2107
|
+
background-color: ${K.colors.back.primary};
|
|
2108
|
+
box-shadow: 0 2px 8px rgb(22 24 38 / 7%);
|
|
2109
|
+
}
|
|
2110
|
+
`,
|
|
2111
|
+
panel: G`
|
|
2112
|
+
width: 100%;
|
|
2113
|
+
min-width: 0;
|
|
2114
|
+
padding: 1.5rem 1.25rem;
|
|
2032
2115
|
`
|
|
2033
2116
|
};
|
|
2034
2117
|
//#endregion
|
|
2035
|
-
export { ct as Actions, ft as AppWrapper, ht as Bar, _t as Box, yt as Button, Ot as Dropdown, Ct as Headline, q as Icon, It as IconButton, xt as Layout, ot as PopupBox, Tt as Space, Mt as Switch,
|
|
2118
|
+
export { ct as Actions, ft as AppWrapper, ht as Bar, _t as Box, yt as Button, Rt as Counter, Ot as Dropdown, Ct as Headline, q as Icon, It as IconButton, xt as Layout, ot as PopupBox, Tt as Space, Mt as Switch, Bt as TabBox, Vt as TabContainer, Pt as Tag, ut as Text, Et as TextField, K as Theme, pt as Toolbar };
|