@yourbestsoft/studio-screen-ui-kit 0.0.10 → 0.0.12
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/ToolIconButton-BezvcpMB.js +586 -0
- package/dist/ToolIconButton-BezvcpMB.js.map +1 -0
- package/dist/components/dialog/Dialog.d.ts +2 -1
- package/dist/components/drop-down/DropDown.d.ts +5 -0
- package/dist/hooks/useKeyboardControls.d.ts +14 -1
- package/dist/index.js +119 -128
- package/dist/index.js.map +1 -1
- package/dist/index2.js +21 -21
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/ToolIconButton-CKUWpXoL.js +0 -531
- package/dist/ToolIconButton-CKUWpXoL.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { D as H, B as
|
|
2
|
-
import {
|
|
3
|
-
import { jsx as s, jsxs as g, Fragment as
|
|
1
|
+
import { u as J, D as H, B as G, a as Q } from "./ToolIconButton-BezvcpMB.js";
|
|
2
|
+
import { b as an, e as ln, c as rn, d as dn, C as hn, f as _n, h as un, S as mn, i as pn, T as gn, j as fn, k as yn, g as kn } from "./ToolIconButton-BezvcpMB.js";
|
|
3
|
+
import { jsx as s, jsxs as g, Fragment as X } from "react/jsx-runtime";
|
|
4
4
|
import m from "classnames";
|
|
5
|
-
import { useState as k, useEffect as
|
|
6
|
-
import { ClipboardCopy as
|
|
7
|
-
const
|
|
8
|
-
buttonGroup:
|
|
9
|
-
button:
|
|
10
|
-
label:
|
|
11
|
-
single:
|
|
12
|
-
first:
|
|
13
|
-
last:
|
|
14
|
-
selected:
|
|
5
|
+
import { useState as k, useEffect as $, useCallback as M, useRef as O } from "react";
|
|
6
|
+
import { ClipboardCopy as Y, ChevronLeft as Z, ChevronRight as ee, ChevronDown as te, Sun as ne, Moon as oe, Computer as se } from "lucide-react";
|
|
7
|
+
const ce = "_buttonGroup_ejhd6_1", ae = "_button_ejhd6_1", le = "_label_ejhd6_37", ie = "_single_ejhd6_42", re = "_first_ejhd6_46", de = "_last_ejhd6_50", he = "_selected_ejhd6_54", B = {
|
|
8
|
+
buttonGroup: ce,
|
|
9
|
+
button: ae,
|
|
10
|
+
label: le,
|
|
11
|
+
single: ie,
|
|
12
|
+
first: re,
|
|
13
|
+
last: de,
|
|
14
|
+
selected: he
|
|
15
15
|
}, Jt = ({ buttons: n, className: o }) => /* @__PURE__ */ s("div", { className: m(B.buttonGroup, o), children: n.map((t, e) => {
|
|
16
16
|
const a = n.length === 1, l = e === 0 && !a, c = e === n.length - 1 && !a;
|
|
17
17
|
return /* @__PURE__ */ g(
|
|
@@ -33,35 +33,35 @@ const se = "_buttonGroup_ejhd6_1", ce = "_button_ejhd6_1", ae = "_label_ejhd6_37
|
|
|
33
33
|
},
|
|
34
34
|
e
|
|
35
35
|
);
|
|
36
|
-
}) }),
|
|
36
|
+
}) }), _e = (n, o, t, e) => [
|
|
37
37
|
Math.min(255, Math.round(n + (255 - n) * e)),
|
|
38
38
|
Math.min(255, Math.round(o + (255 - o) * e)),
|
|
39
39
|
Math.min(255, Math.round(t + (255 - t) * e))
|
|
40
|
-
],
|
|
40
|
+
], q = (n, o) => {
|
|
41
41
|
if (o === 5 || n === "transparent" || n === "#ffffff" || n === "#1e1e1e")
|
|
42
42
|
return n;
|
|
43
|
-
const [t, e, a] =
|
|
44
|
-
return
|
|
45
|
-
},
|
|
43
|
+
const [t, e, a] = E(n), l = (5 - o) * 0.2, [c, i, h] = _e(t, e, a, l);
|
|
44
|
+
return ue(c, i, h);
|
|
45
|
+
}, E = (n) => {
|
|
46
46
|
const o = n.replace("#", ""), t = parseInt(o, 16);
|
|
47
47
|
return [t >> 16 & 255, t >> 8 & 255, t & 255];
|
|
48
|
-
},
|
|
48
|
+
}, ue = (n, o, t) => "#" + [n, o, t].map((e) => {
|
|
49
49
|
const a = e.toString(16);
|
|
50
50
|
return a.length === 1 ? "0" + a : a;
|
|
51
|
-
}).join(""),
|
|
51
|
+
}).join(""), me = (n) => {
|
|
52
52
|
if (n === "transparent")
|
|
53
53
|
return "#000";
|
|
54
|
-
const [o, t, e] =
|
|
54
|
+
const [o, t, e] = E(n);
|
|
55
55
|
return (o * 299 + t * 587 + e * 114) / 1e3 > 128 ? "#000" : "#fff";
|
|
56
|
-
},
|
|
57
|
-
colorButton:
|
|
58
|
-
hotkey:
|
|
59
|
-
selected:
|
|
60
|
-
disabled:
|
|
61
|
-
transparent:
|
|
62
|
-
small:
|
|
63
|
-
medium:
|
|
64
|
-
large:
|
|
56
|
+
}, pe = "_colorButton_wldf2_1", ge = "_hotkey_wldf2_22", fe = "_selected_wldf2_26", ye = "_disabled_wldf2_33", ke = "_transparent_wldf2_41", be = "_small_wldf2_46", ve = "_medium_wldf2_52", Ce = "_large_wldf2_58", I = {
|
|
57
|
+
colorButton: pe,
|
|
58
|
+
hotkey: ge,
|
|
59
|
+
selected: fe,
|
|
60
|
+
disabled: ye,
|
|
61
|
+
transparent: ke,
|
|
62
|
+
small: be,
|
|
63
|
+
medium: ve,
|
|
64
|
+
large: Ce
|
|
65
65
|
}, P = (n) => {
|
|
66
66
|
const {
|
|
67
67
|
className: o,
|
|
@@ -86,14 +86,14 @@ const se = "_buttonGroup_ejhd6_1", ce = "_button_ejhd6_1", ae = "_label_ejhd6_37
|
|
|
86
86
|
style: { "--swatch-color": t },
|
|
87
87
|
disabled: e,
|
|
88
88
|
...i,
|
|
89
|
-
children: /* @__PURE__ */ s("p", { className: I.hotkey, style: { color:
|
|
89
|
+
children: /* @__PURE__ */ s("p", { className: I.hotkey, style: { color: me(t) }, children: a })
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
|
-
},
|
|
93
|
-
content:
|
|
94
|
-
section:
|
|
95
|
-
title:
|
|
96
|
-
},
|
|
92
|
+
}, Ne = "_content_1ybrq_1", xe = "_section_1ybrq_11", we = "_title_1ybrq_17", S = {
|
|
93
|
+
content: Ne,
|
|
94
|
+
section: xe,
|
|
95
|
+
title: we
|
|
96
|
+
}, Be = [
|
|
97
97
|
{
|
|
98
98
|
color: "transparent",
|
|
99
99
|
hotkey: "q",
|
|
@@ -169,7 +169,7 @@ const se = "_buttonGroup_ejhd6_1", ce = "_button_ejhd6_1", ae = "_label_ejhd6_37
|
|
|
169
169
|
hotkey: "b",
|
|
170
170
|
name: "red"
|
|
171
171
|
}
|
|
172
|
-
],
|
|
172
|
+
], Se = ({
|
|
173
173
|
colors: n,
|
|
174
174
|
selectedColor: o,
|
|
175
175
|
selectedShadeIndex: t
|
|
@@ -181,11 +181,11 @@ const se = "_buttonGroup_ejhd6_1", ce = "_button_ejhd6_1", ae = "_label_ejhd6_37
|
|
|
181
181
|
index: o?.index ?? 0
|
|
182
182
|
})), r = (_) => {
|
|
183
183
|
const u = j(n, _);
|
|
184
|
-
console.log(u), c(u), h(
|
|
184
|
+
console.log(u), c(u), h(Ie(u, i));
|
|
185
185
|
}, d = (_, u = 999) => {
|
|
186
186
|
h({ ...W(_, e), index: u });
|
|
187
187
|
};
|
|
188
|
-
return
|
|
188
|
+
return $(() => {
|
|
189
189
|
r(e);
|
|
190
190
|
}, [e, n, i.index]), {
|
|
191
191
|
activeColor: i,
|
|
@@ -196,11 +196,11 @@ const se = "_buttonGroup_ejhd6_1", ce = "_button_ejhd6_1", ae = "_label_ejhd6_37
|
|
|
196
196
|
};
|
|
197
197
|
}, W = (n, o) => ({
|
|
198
198
|
...n,
|
|
199
|
-
color:
|
|
200
|
-
}), j = (n, o) => n.map((t) => W(t, o)),
|
|
199
|
+
color: q(n.color, o)
|
|
200
|
+
}), j = (n, o) => n.map((t) => W(t, o)), Ie = (n, o) => ({
|
|
201
201
|
...n[o.index] ?? n[0],
|
|
202
202
|
index: o.index ?? 0
|
|
203
|
-
}),
|
|
203
|
+
}), Te = ({
|
|
204
204
|
onSelect: n,
|
|
205
205
|
options: o,
|
|
206
206
|
selectedId: t
|
|
@@ -208,7 +208,7 @@ const se = "_buttonGroup_ejhd6_1", ce = "_button_ejhd6_1", ae = "_label_ejhd6_37
|
|
|
208
208
|
const [e, a] = k(!1), [l, c] = k(null), [i, h] = k(
|
|
209
209
|
t && o.find((u) => u.value === t) || null
|
|
210
210
|
);
|
|
211
|
-
|
|
211
|
+
$(() => {
|
|
212
212
|
if (t) {
|
|
213
213
|
const u = o.find((f) => f.value === t);
|
|
214
214
|
h(u || null);
|
|
@@ -261,18 +261,9 @@ const se = "_buttonGroup_ejhd6_1", ce = "_button_ejhd6_1", ae = "_label_ejhd6_37
|
|
|
261
261
|
selectedItem: i,
|
|
262
262
|
setIsOpen: a
|
|
263
263
|
};
|
|
264
|
-
}, Te = (n) => {
|
|
265
|
-
K(() => {
|
|
266
|
-
const o = (t) => {
|
|
267
|
-
n.forEach((e) => e(t));
|
|
268
|
-
};
|
|
269
|
-
return window.addEventListener("keydown", o), () => {
|
|
270
|
-
window.removeEventListener("keydown", o);
|
|
271
|
-
};
|
|
272
|
-
}, [n]);
|
|
273
264
|
}, Le = (n) => {
|
|
274
265
|
const { palette: o, setActiveColorHandler: t, setActiveShade: e } = n;
|
|
275
|
-
|
|
266
|
+
J([(c) => {
|
|
276
267
|
if (c.shiftKey && c.code.startsWith("Digit")) {
|
|
277
268
|
const i = parseInt(c.code.replace("Digit", ""), 10);
|
|
278
269
|
i >= 1 && i <= 5 && e(i);
|
|
@@ -283,9 +274,9 @@ const se = "_buttonGroup_ejhd6_1", ce = "_button_ejhd6_1", ae = "_label_ejhd6_37
|
|
|
283
274
|
), r = o[h];
|
|
284
275
|
h !== -1 && t(r, h);
|
|
285
276
|
}]);
|
|
286
|
-
},
|
|
287
|
-
iconButton:
|
|
288
|
-
primary:
|
|
277
|
+
}, Re = "_iconButton_yk1r1_14", Ke = "_primary_yk1r1_34", $e = "_secondary_yk1r1_46", ze = "_transparent_yk1r1_54", He = "_selected_yk1r1_65", Me = "_disabled_yk1r1_74", R = {
|
|
278
|
+
iconButton: Re,
|
|
279
|
+
primary: Ke,
|
|
289
280
|
secondary: $e,
|
|
290
281
|
transparent: ze,
|
|
291
282
|
selected: He,
|
|
@@ -314,17 +305,17 @@ const se = "_buttonGroup_ejhd6_1", ce = "_button_ejhd6_1", ae = "_label_ejhd6_37
|
|
|
314
305
|
children: e
|
|
315
306
|
}
|
|
316
307
|
);
|
|
317
|
-
}, Ae = "_hexInput_x3rtz_1", De = "_inputContainer_x3rtz_11", Ve = "_hash_x3rtz_18", Pe = "_input_x3rtz_11", je = "_error_x3rtz_39",
|
|
308
|
+
}, Ae = "_hexInput_x3rtz_1", De = "_inputContainer_x3rtz_11", Ve = "_hash_x3rtz_18", Pe = "_input_x3rtz_11", je = "_error_x3rtz_39", Fe = "_copyButton_x3rtz_42", Ge = "_slot_x3rtz_48", Oe = "_copiedMessage_x3rtz_55", qe = "_fadeInOut_x3rtz_1", C = {
|
|
318
309
|
hexInput: Ae,
|
|
319
310
|
inputContainer: De,
|
|
320
311
|
hash: Ve,
|
|
321
312
|
input: Pe,
|
|
322
313
|
error: je,
|
|
323
|
-
copyButton:
|
|
324
|
-
slot:
|
|
325
|
-
copiedMessage:
|
|
326
|
-
fadeInOut:
|
|
327
|
-
},
|
|
314
|
+
copyButton: Fe,
|
|
315
|
+
slot: Ge,
|
|
316
|
+
copiedMessage: Oe,
|
|
317
|
+
fadeInOut: qe
|
|
318
|
+
}, Ee = (n) => {
|
|
328
319
|
const {
|
|
329
320
|
children: o,
|
|
330
321
|
className: t,
|
|
@@ -335,7 +326,7 @@ const se = "_buttonGroup_ejhd6_1", ce = "_button_ejhd6_1", ae = "_label_ejhd6_37
|
|
|
335
326
|
} = n, [i, h] = k(
|
|
336
327
|
e.startsWith("#") ? e.slice(1) : e
|
|
337
328
|
), [r, d] = k(!1);
|
|
338
|
-
|
|
329
|
+
$(() => {
|
|
339
330
|
h(e.startsWith("#") ? e.slice(1) : e);
|
|
340
331
|
}, [e]);
|
|
341
332
|
const _ = (b) => /^#([0-9A-F]{3}|[0-9A-F]{6})$/i.test("#" + b), u = (b) => {
|
|
@@ -345,24 +336,24 @@ const se = "_buttonGroup_ejhd6_1", ce = "_button_ejhd6_1", ae = "_label_ejhd6_37
|
|
|
345
336
|
const b = "#" + i;
|
|
346
337
|
navigator.clipboard.writeText(b), d(!0), setTimeout(() => d(!1), 1e3);
|
|
347
338
|
};
|
|
348
|
-
return /* @__PURE__ */ g("div", { className:
|
|
339
|
+
return /* @__PURE__ */ g("div", { className: C.hexInput, children: [
|
|
349
340
|
/* @__PURE__ */ s(
|
|
350
341
|
T,
|
|
351
342
|
{
|
|
352
|
-
icon: /* @__PURE__ */ s(
|
|
343
|
+
icon: /* @__PURE__ */ s(Y, {}),
|
|
353
344
|
onClick: f,
|
|
354
|
-
className:
|
|
345
|
+
className: C.copyButton
|
|
355
346
|
}
|
|
356
347
|
),
|
|
357
|
-
/* @__PURE__ */ g("div", { className:
|
|
358
|
-
/* @__PURE__ */ s("span", { className:
|
|
348
|
+
/* @__PURE__ */ g("div", { className: C.inputContainer, children: [
|
|
349
|
+
/* @__PURE__ */ s("span", { className: C.hash, children: "#" }),
|
|
359
350
|
/* @__PURE__ */ s(
|
|
360
351
|
"input",
|
|
361
352
|
{
|
|
362
353
|
...c,
|
|
363
354
|
className: m(
|
|
364
|
-
|
|
365
|
-
_(i) ? "" :
|
|
355
|
+
C.input,
|
|
356
|
+
_(i) ? "" : C.error,
|
|
366
357
|
t
|
|
367
358
|
),
|
|
368
359
|
value: i,
|
|
@@ -372,8 +363,8 @@ const se = "_buttonGroup_ejhd6_1", ce = "_button_ejhd6_1", ae = "_label_ejhd6_37
|
|
|
372
363
|
}
|
|
373
364
|
)
|
|
374
365
|
] }),
|
|
375
|
-
r && /* @__PURE__ */ s("div", { className:
|
|
376
|
-
o && /* @__PURE__ */ s("div", { className:
|
|
366
|
+
r && /* @__PURE__ */ s("div", { className: C.copiedMessage, children: /* @__PURE__ */ s("span", { children: "Copied!" }) }),
|
|
367
|
+
o && /* @__PURE__ */ s("div", { className: C.slot, children: o })
|
|
377
368
|
] });
|
|
378
369
|
}, We = "_colorsList_1brrj_1", Ue = {
|
|
379
370
|
colorsList: We
|
|
@@ -391,7 +382,7 @@ const se = "_buttonGroup_ejhd6_1", ce = "_button_ejhd6_1", ae = "_label_ejhd6_37
|
|
|
391
382
|
size: "large"
|
|
392
383
|
},
|
|
393
384
|
e.name
|
|
394
|
-
)) }), Qe = "_shadowList_1srdv_1", Xe = "_shadowText_1srdv_6",
|
|
385
|
+
)) }), Qe = "_shadowList_1srdv_1", Xe = "_shadowText_1srdv_6", F = {
|
|
395
386
|
shadowList: Qe,
|
|
396
387
|
shadowText: Xe
|
|
397
388
|
}, Ye = ({
|
|
@@ -403,10 +394,10 @@ const se = "_buttonGroup_ejhd6_1", ce = "_button_ejhd6_1", ae = "_label_ejhd6_37
|
|
|
403
394
|
const a = [1, 2, 3, 4, 5], l = t[n.index];
|
|
404
395
|
return ["#ffffff", "transparent", "#000000", "#1e1e1e"].includes(
|
|
405
396
|
n?.color
|
|
406
|
-
) || !t[n.index] ? /* @__PURE__ */ s("div", { className:
|
|
397
|
+
) || !t[n.index] ? /* @__PURE__ */ s("div", { className: F.shadowText, children: /* @__PURE__ */ s("p", { children: "No shades available for this color" }) }) : /* @__PURE__ */ s("div", { className: F.shadowList, children: a.map((c) => /* @__PURE__ */ s(
|
|
407
398
|
P,
|
|
408
399
|
{
|
|
409
|
-
color:
|
|
400
|
+
color: q(l.color, c),
|
|
410
401
|
hotkey: `⇧+${c}`,
|
|
411
402
|
selected: o === c,
|
|
412
403
|
onClick: () => e(c),
|
|
@@ -415,13 +406,13 @@ const se = "_buttonGroup_ejhd6_1", ce = "_button_ejhd6_1", ae = "_label_ejhd6_37
|
|
|
415
406
|
c
|
|
416
407
|
)) });
|
|
417
408
|
}, Qt = (n) => {
|
|
418
|
-
const { changeColor: o, colors: t, selectedColor: e, selectedShadeIndex: a = 5 } = n, l =
|
|
409
|
+
const { changeColor: o, colors: t, selectedColor: e, selectedShadeIndex: a = 5 } = n, l = Be || t, {
|
|
419
410
|
activeColor: c,
|
|
420
411
|
activeShade: i,
|
|
421
412
|
palette: h,
|
|
422
413
|
setActiveColorHandler: r,
|
|
423
414
|
setActiveShade: d
|
|
424
|
-
} =
|
|
415
|
+
} = Se({ colors: l, selectedColor: e, selectedShadeIndex: a });
|
|
425
416
|
return Le({
|
|
426
417
|
palette: h,
|
|
427
418
|
setActiveColorHandler: r,
|
|
@@ -457,7 +448,7 @@ const se = "_buttonGroup_ejhd6_1", ce = "_button_ejhd6_1", ae = "_label_ejhd6_37
|
|
|
457
448
|
/* @__PURE__ */ g("div", { className: S.section, children: [
|
|
458
449
|
/* @__PURE__ */ s("h3", { className: S.title, children: "Hex code" }),
|
|
459
450
|
/* @__PURE__ */ s(
|
|
460
|
-
|
|
451
|
+
Ee,
|
|
461
452
|
{
|
|
462
453
|
color: c.color,
|
|
463
454
|
onChange: (_) => {
|
|
@@ -468,7 +459,7 @@ const se = "_buttonGroup_ejhd6_1", ce = "_button_ejhd6_1", ae = "_label_ejhd6_37
|
|
|
468
459
|
] })
|
|
469
460
|
] })
|
|
470
461
|
] });
|
|
471
|
-
}, Ze = "_pagination_3kmd4_1", et = "_pages_3kmd4_13",
|
|
462
|
+
}, Ze = "_pagination_3kmd4_1", et = "_pages_3kmd4_13", K = {
|
|
472
463
|
pagination: Ze,
|
|
473
464
|
pages: et
|
|
474
465
|
};
|
|
@@ -510,17 +501,17 @@ const Xt = (n) => {
|
|
|
510
501
|
}, h = () => {
|
|
511
502
|
t < l && e(t + 1);
|
|
512
503
|
};
|
|
513
|
-
return /* @__PURE__ */ g("div", { className:
|
|
504
|
+
return /* @__PURE__ */ g("div", { className: K.pagination, children: [
|
|
514
505
|
/* @__PURE__ */ s(
|
|
515
506
|
T,
|
|
516
507
|
{
|
|
517
508
|
onClick: i,
|
|
518
509
|
disabled: t === 1,
|
|
519
|
-
icon: /* @__PURE__ */ s(
|
|
510
|
+
icon: /* @__PURE__ */ s(Z, { size: 16 }),
|
|
520
511
|
variants: "transparent"
|
|
521
512
|
}
|
|
522
513
|
),
|
|
523
|
-
/* @__PURE__ */ s("div", { className:
|
|
514
|
+
/* @__PURE__ */ s("div", { className: K.pages, children: c.map((r, d) => r === "..." ? /* @__PURE__ */ s("span", { className: K.ellipsis, children: "..." }, `ellipsis-${d}`) : /* @__PURE__ */ s(
|
|
524
515
|
T,
|
|
525
516
|
{
|
|
526
517
|
onClick: () => e(Number(r)),
|
|
@@ -534,8 +525,8 @@ const Xt = (n) => {
|
|
|
534
525
|
{
|
|
535
526
|
onClick: h,
|
|
536
527
|
disabled: t === l,
|
|
537
|
-
className:
|
|
538
|
-
icon: /* @__PURE__ */ s(
|
|
528
|
+
className: K.nextButton,
|
|
529
|
+
icon: /* @__PURE__ */ s(ee, { size: 16 }),
|
|
539
530
|
variants: "transparent"
|
|
540
531
|
}
|
|
541
532
|
)
|
|
@@ -570,21 +561,21 @@ const Xt = (n) => {
|
|
|
570
561
|
title: h = "Select",
|
|
571
562
|
value: r
|
|
572
563
|
}) => {
|
|
573
|
-
const d =
|
|
564
|
+
const d = O(null), {
|
|
574
565
|
handleChange: _,
|
|
575
566
|
handleKeyDown: u,
|
|
576
567
|
handleOutsideClick: f,
|
|
577
568
|
highlightedIndex: b,
|
|
578
569
|
isOpen: y,
|
|
579
|
-
selectedItem:
|
|
570
|
+
selectedItem: x,
|
|
580
571
|
setIsOpen: v
|
|
581
|
-
} =
|
|
582
|
-
|
|
583
|
-
const
|
|
572
|
+
} = Te({ onSelect: o, options: t, selectedId: a });
|
|
573
|
+
$(() => {
|
|
574
|
+
const w = (z) => {
|
|
584
575
|
d.current && !d.current.contains(z.target) && f();
|
|
585
576
|
};
|
|
586
|
-
return document.addEventListener("mousedown",
|
|
587
|
-
document.removeEventListener("mousedown",
|
|
577
|
+
return document.addEventListener("mousedown", w), () => {
|
|
578
|
+
document.removeEventListener("mousedown", w);
|
|
588
579
|
};
|
|
589
580
|
}, [f]);
|
|
590
581
|
const U = m(p.selectMenu, {
|
|
@@ -606,7 +597,7 @@ const Xt = (n) => {
|
|
|
606
597
|
tabIndex: 0,
|
|
607
598
|
children: [
|
|
608
599
|
/* @__PURE__ */ g(
|
|
609
|
-
|
|
600
|
+
G,
|
|
610
601
|
{
|
|
611
602
|
id: r,
|
|
612
603
|
"aria-label": "Toggle select",
|
|
@@ -618,9 +609,9 @@ const Xt = (n) => {
|
|
|
618
609
|
className: m(p.selectButton, i),
|
|
619
610
|
fullWidth: n,
|
|
620
611
|
children: [
|
|
621
|
-
/* @__PURE__ */ s("span", { children:
|
|
612
|
+
/* @__PURE__ */ s("span", { children: x?.label || h }),
|
|
622
613
|
/* @__PURE__ */ s(
|
|
623
|
-
|
|
614
|
+
te,
|
|
624
615
|
{
|
|
625
616
|
size: 20,
|
|
626
617
|
className: m(p.selectIcon, {
|
|
@@ -631,49 +622,49 @@ const Xt = (n) => {
|
|
|
631
622
|
]
|
|
632
623
|
}
|
|
633
624
|
),
|
|
634
|
-
y && /* @__PURE__ */ s("div", { "aria-label": "Select menu", className: U, children: /* @__PURE__ */ s("ul", { role: "menu", "aria-labelledby": r, "aria-orientation": "vertical", children: t?.map((
|
|
625
|
+
y && /* @__PURE__ */ s("div", { "aria-label": "Select menu", className: U, children: /* @__PURE__ */ s("ul", { role: "menu", "aria-labelledby": r, "aria-orientation": "vertical", children: t?.map((w, z) => /* @__PURE__ */ g(
|
|
635
626
|
"li",
|
|
636
627
|
{
|
|
637
|
-
onClick: () => _(
|
|
628
|
+
onClick: () => _(w),
|
|
638
629
|
className: m(p.menuItem, p.menuItemHover, {
|
|
639
630
|
[p.menuItemHighlighted]: b === z,
|
|
640
|
-
[p.menuItemSelected]:
|
|
631
|
+
[p.menuItemSelected]: x?.value === w.value
|
|
641
632
|
}),
|
|
642
633
|
children: [
|
|
643
634
|
l,
|
|
644
|
-
/* @__PURE__ */ s("span", { children:
|
|
635
|
+
/* @__PURE__ */ s("span", { children: w.label }),
|
|
645
636
|
c
|
|
646
637
|
]
|
|
647
638
|
},
|
|
648
|
-
|
|
639
|
+
w.value
|
|
649
640
|
)) }) })
|
|
650
641
|
]
|
|
651
642
|
}
|
|
652
643
|
);
|
|
653
|
-
}, kt = "_groupTitle_eelpn_23", bt = "_list_eelpn_30", vt = "_item_eelpn_35",
|
|
644
|
+
}, kt = "_groupTitle_eelpn_23", bt = "_list_eelpn_30", vt = "_item_eelpn_35", Ct = "_itemKeysVariants_eelpn_45", Nt = "_itemKeysSeparator_eelpn_50", xt = "_itemDescription_eelpn_54", wt = "_itemKey_eelpn_45", N = {
|
|
654
645
|
groupTitle: kt,
|
|
655
646
|
list: bt,
|
|
656
647
|
item: vt,
|
|
657
|
-
itemKeysVariants:
|
|
658
|
-
itemKeysSeparator:
|
|
659
|
-
itemDescription:
|
|
660
|
-
itemKey:
|
|
648
|
+
itemKeysVariants: Ct,
|
|
649
|
+
itemKeysSeparator: Nt,
|
|
650
|
+
itemDescription: xt,
|
|
651
|
+
itemKey: wt
|
|
661
652
|
}, Bt = (n) => {
|
|
662
653
|
const { children: o, className: t, title: e } = n;
|
|
663
|
-
return /* @__PURE__ */ g("div", { className: m(
|
|
664
|
-
/* @__PURE__ */ s("h4", { className:
|
|
654
|
+
return /* @__PURE__ */ g("div", { className: m(N.group, t), children: [
|
|
655
|
+
/* @__PURE__ */ s("h4", { className: N.groupTitle, children: e }),
|
|
665
656
|
o
|
|
666
657
|
] });
|
|
667
658
|
}, St = (n) => {
|
|
668
659
|
const { children: o, className: t } = n;
|
|
669
|
-
return /* @__PURE__ */ s("div", { className: m(
|
|
660
|
+
return /* @__PURE__ */ s("div", { className: m(N.list, t), children: o });
|
|
670
661
|
}, It = (n) => {
|
|
671
|
-
const { className: o, description: t, keysVariants: e } = n, a = (l) => l.map((c, i) => /* @__PURE__ */ s("span", { className:
|
|
672
|
-
return /* @__PURE__ */ g("div", { className: m(
|
|
673
|
-
/* @__PURE__ */ s("div", { className:
|
|
674
|
-
/* @__PURE__ */ s("div", { className:
|
|
675
|
-
(l, c) => c === 0 ? a(l) : /* @__PURE__ */ g(
|
|
676
|
-
/* @__PURE__ */ s("span", { className:
|
|
662
|
+
const { className: o, description: t, keysVariants: e } = n, a = (l) => l.map((c, i) => /* @__PURE__ */ s("span", { className: N.itemKey, children: c }, i));
|
|
663
|
+
return /* @__PURE__ */ g("div", { className: m(N.item, o), children: [
|
|
664
|
+
/* @__PURE__ */ s("div", { className: N.itemDescription, children: t }),
|
|
665
|
+
/* @__PURE__ */ s("div", { className: N.itemKeysVariants, children: e.map(
|
|
666
|
+
(l, c) => c === 0 ? a(l) : /* @__PURE__ */ g(X, { children: [
|
|
667
|
+
/* @__PURE__ */ s("span", { className: N.itemKeysSeparator, children: "or" }),
|
|
677
668
|
a(l)
|
|
678
669
|
] })
|
|
679
670
|
) })
|
|
@@ -683,11 +674,11 @@ const Xt = (n) => {
|
|
|
683
674
|
slider: Tt,
|
|
684
675
|
focused: Lt
|
|
685
676
|
}, en = (n) => {
|
|
686
|
-
const { initialValue: o = 50, max: t = 100, min: e = 0, onChange: a, step: l = 1 } = n, [c, i] = k(o), [h, r] = k(!1), d =
|
|
687
|
-
const v = Number(
|
|
677
|
+
const { initialValue: o = 50, max: t = 100, min: e = 0, onChange: a, step: l = 1 } = n, [c, i] = k(o), [h, r] = k(!1), d = O(null), _ = (x) => {
|
|
678
|
+
const v = Number(x.target.value);
|
|
688
679
|
i(v), a && a(v);
|
|
689
|
-
}, u = (
|
|
690
|
-
|
|
680
|
+
}, u = (x) => {
|
|
681
|
+
x.key === "ArrowRight" ? i((v) => Math.min(v + l, t)) : x.key === "ArrowLeft" && i((v) => Math.max(v - l, e));
|
|
691
682
|
}, f = () => r(!0), b = () => r(!1), y = (c - e) / (t - e) * 100;
|
|
692
683
|
return /* @__PURE__ */ s("div", { className: m(A.container, h && A.focused), children: /* @__PURE__ */ s(
|
|
693
684
|
"input",
|
|
@@ -711,16 +702,16 @@ const Xt = (n) => {
|
|
|
711
702
|
}
|
|
712
703
|
}
|
|
713
704
|
) });
|
|
714
|
-
},
|
|
715
|
-
themeSwitcher:
|
|
716
|
-
themeButton:
|
|
705
|
+
}, Rt = "_themeSwitcher_11ggx_18", Kt = "_themeButton_11ggx_27", $t = "_background_11ggx_31", zt = "_selectedButton_11ggx_42", D = {
|
|
706
|
+
themeSwitcher: Rt,
|
|
707
|
+
themeButton: Kt,
|
|
717
708
|
background: $t,
|
|
718
709
|
selectedButton: zt
|
|
719
710
|
}, tn = () => {
|
|
720
|
-
const { setTheme: n, theme: o } =
|
|
721
|
-
{ icon: /* @__PURE__ */ s(
|
|
722
|
-
{ icon: /* @__PURE__ */ s(
|
|
723
|
-
{ icon: /* @__PURE__ */ s(
|
|
711
|
+
const { setTheme: n, theme: o } = Q(), t = [
|
|
712
|
+
{ icon: /* @__PURE__ */ s(ne, {}), label: "Light", value: "light" },
|
|
713
|
+
{ icon: /* @__PURE__ */ s(oe, {}), label: "Dark", value: "dark" },
|
|
714
|
+
{ icon: /* @__PURE__ */ s(se, {}), label: "System", value: "system" }
|
|
724
715
|
];
|
|
725
716
|
return /* @__PURE__ */ s("div", { className: D.themeSwitcher, children: t.map((e) => /* @__PURE__ */ s(
|
|
726
717
|
T,
|
|
@@ -748,7 +739,7 @@ const Xt = (n) => {
|
|
|
748
739
|
l(i);
|
|
749
740
|
};
|
|
750
741
|
return /* @__PURE__ */ s("div", { className: m(L.toggleSwitch), ...e, children: t.map(({ icon: i, leftSlot: h, rightSlot: r, value: d, ..._ }) => h || r ? /* @__PURE__ */ g(
|
|
751
|
-
|
|
742
|
+
G,
|
|
752
743
|
{
|
|
753
744
|
variant: "text",
|
|
754
745
|
className: m(
|
|
@@ -780,7 +771,7 @@ const Xt = (n) => {
|
|
|
780
771
|
separator: Vt,
|
|
781
772
|
vertical: Pt,
|
|
782
773
|
horizontal: jt
|
|
783
|
-
},
|
|
774
|
+
}, Ft = (n) => {
|
|
784
775
|
const { children: o, className: t, direction: e = "horizontal" } = n;
|
|
785
776
|
return /* @__PURE__ */ s(
|
|
786
777
|
"div",
|
|
@@ -789,9 +780,9 @@ const Xt = (n) => {
|
|
|
789
780
|
children: o
|
|
790
781
|
}
|
|
791
782
|
);
|
|
792
|
-
},
|
|
783
|
+
}, Gt = ({}) => /* @__PURE__ */ s("div", { className: V.separator }), on = { Root: Ft, Separator: Gt };
|
|
793
784
|
export {
|
|
794
|
-
|
|
785
|
+
G as Button,
|
|
795
786
|
an as ButtonRender,
|
|
796
787
|
Jt as ButtonsGroup,
|
|
797
788
|
ln as Card,
|