beth-clarity 1.1.8 → 1.1.9
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.
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as a, jsxs as _, Fragment as Ze } from "react/jsx-runtime";
|
|
2
2
|
import L, { useState as T, useRef as A, useEffect as O, forwardRef as Ke, isValidElement as Z, createContext as z, cloneElement as W, useContext as q, useMemo as Y, useCallback as ne, useLayoutEffect as et } from "react";
|
|
3
3
|
import tt from "react-dom";
|
|
4
4
|
const wt = ({
|
|
5
5
|
variant: e = "primary",
|
|
6
6
|
product: t,
|
|
7
|
-
tone:
|
|
7
|
+
tone: s,
|
|
8
8
|
size: l = "medium",
|
|
9
9
|
bgColor: n,
|
|
10
10
|
textColor: r,
|
|
@@ -14,7 +14,7 @@ const wt = ({
|
|
|
14
14
|
outlined: c = !1,
|
|
15
15
|
...p
|
|
16
16
|
}) => {
|
|
17
|
-
const y = "clarity-badge", f = !!n, m = t &&
|
|
17
|
+
const y = "clarity-badge", f = !!n, m = t && s && !f;
|
|
18
18
|
let d = "";
|
|
19
19
|
f ? d = `${y}--custom-bg` : m ? d = `${y}--custom` : d = `${y}--${e}`;
|
|
20
20
|
const C = [
|
|
@@ -26,11 +26,11 @@ const wt = ({
|
|
|
26
26
|
u
|
|
27
27
|
].filter(Boolean).join(" "), h = {};
|
|
28
28
|
f && (h.backgroundColor = n, r && (h.color = r));
|
|
29
|
-
const N = m && t &&
|
|
30
|
-
"--custom-bg-color": `var(--clarity-${t}-${
|
|
31
|
-
"--custom-text-color":
|
|
29
|
+
const N = m && t && s ? {
|
|
30
|
+
"--custom-bg-color": `var(--clarity-${t}-${s})`,
|
|
31
|
+
"--custom-text-color": s && parseInt(s) >= 500 ? "white" : `var(--clarity-${t}-800)`
|
|
32
32
|
} : {};
|
|
33
|
-
return /* @__PURE__ */
|
|
33
|
+
return /* @__PURE__ */ a(
|
|
34
34
|
"span",
|
|
35
35
|
{
|
|
36
36
|
className: C,
|
|
@@ -45,7 +45,7 @@ const wt = ({
|
|
|
45
45
|
}, gt = ({
|
|
46
46
|
variant: e = "primary",
|
|
47
47
|
product: t,
|
|
48
|
-
tone:
|
|
48
|
+
tone: s,
|
|
49
49
|
hoverTone: l,
|
|
50
50
|
size: n = "medium",
|
|
51
51
|
disabled: r = !1,
|
|
@@ -57,7 +57,7 @@ const wt = ({
|
|
|
57
57
|
title: y,
|
|
58
58
|
...f
|
|
59
59
|
}) => {
|
|
60
|
-
const m = "clarity-button", d = t &&
|
|
60
|
+
const m = "clarity-button", d = t && s, C = d ? `${m}--custom` : `${m}--${e}`, h = [
|
|
61
61
|
m,
|
|
62
62
|
C,
|
|
63
63
|
`${m}--${n}`,
|
|
@@ -68,8 +68,8 @@ const wt = ({
|
|
|
68
68
|
const g = parseInt(B);
|
|
69
69
|
return g >= 800 ? "900" : g >= 700 ? "800" : g >= 600 ? "700" : g >= 500 ? "600" : g >= 400 ? "500" : g >= 300 ? "400" : g >= 200 ? "300" : "200";
|
|
70
70
|
}, w = d ? {
|
|
71
|
-
"--custom-bg-color": `var(--clarity-${t}-${
|
|
72
|
-
"--custom-hover-color": `var(--clarity-${t}-${l || N(
|
|
71
|
+
"--custom-bg-color": `var(--clarity-${t}-${s})`,
|
|
72
|
+
"--custom-hover-color": `var(--clarity-${t}-${l || N(s)})`
|
|
73
73
|
} : {};
|
|
74
74
|
return /* @__PURE__ */ _(
|
|
75
75
|
"button",
|
|
@@ -82,7 +82,7 @@ const wt = ({
|
|
|
82
82
|
title: y,
|
|
83
83
|
...f,
|
|
84
84
|
children: [
|
|
85
|
-
o && /* @__PURE__ */
|
|
85
|
+
o && /* @__PURE__ */ a("div", { className: `${m}__spinner` }),
|
|
86
86
|
u
|
|
87
87
|
]
|
|
88
88
|
}
|
|
@@ -90,7 +90,7 @@ const wt = ({
|
|
|
90
90
|
}, st = L.forwardRef(({
|
|
91
91
|
variant: e,
|
|
92
92
|
size: t = "medium",
|
|
93
|
-
label:
|
|
93
|
+
label: s,
|
|
94
94
|
helperText: l,
|
|
95
95
|
error: n = !1,
|
|
96
96
|
errorMessage: r,
|
|
@@ -128,9 +128,9 @@ const wt = ({
|
|
|
128
128
|
].filter(Boolean).join(" ");
|
|
129
129
|
return /* @__PURE__ */ _("div", { className: "clarity-input-wrapper", children: [
|
|
130
130
|
/* @__PURE__ */ _("div", { className: E, children: [
|
|
131
|
-
o && /* @__PURE__ */
|
|
131
|
+
o && /* @__PURE__ */ a("div", { className: "clarity-input__start-icon", children: o }),
|
|
132
132
|
/* @__PURE__ */ _("div", { className: "clarity-input__field", children: [
|
|
133
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ a(
|
|
134
134
|
"input",
|
|
135
135
|
{
|
|
136
136
|
ref: g,
|
|
@@ -143,18 +143,18 @@ const wt = ({
|
|
|
143
143
|
...d
|
|
144
144
|
}
|
|
145
145
|
),
|
|
146
|
-
|
|
146
|
+
s && /* @__PURE__ */ a("label", { className: "clarity-input__label", children: s })
|
|
147
147
|
] }),
|
|
148
|
-
u && /* @__PURE__ */
|
|
148
|
+
u && /* @__PURE__ */ a("div", { className: "clarity-input__end-icon", children: u })
|
|
149
149
|
] }),
|
|
150
|
-
(l || n && r) && /* @__PURE__ */
|
|
150
|
+
(l || n && r) && /* @__PURE__ */ a("div", { className: "clarity-input__helper-text", children: n && r ? r : l })
|
|
151
151
|
] });
|
|
152
152
|
});
|
|
153
153
|
st.displayName = "Input";
|
|
154
154
|
const at = L.forwardRef(({
|
|
155
155
|
variant: e,
|
|
156
156
|
size: t = "medium",
|
|
157
|
-
label:
|
|
157
|
+
label: s,
|
|
158
158
|
helperText: l,
|
|
159
159
|
error: n = !1,
|
|
160
160
|
errorMessage: r,
|
|
@@ -200,9 +200,9 @@ const at = L.forwardRef(({
|
|
|
200
200
|
};
|
|
201
201
|
return /* @__PURE__ */ _("div", { className: "clarity-textarea-wrapper", children: [
|
|
202
202
|
/* @__PURE__ */ _("div", { className: P, children: [
|
|
203
|
-
o && /* @__PURE__ */
|
|
203
|
+
o && /* @__PURE__ */ a("div", { className: "clarity-textarea__start-icon", children: o }),
|
|
204
204
|
/* @__PURE__ */ _("div", { className: "clarity-textarea__field", children: [
|
|
205
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ a(
|
|
206
206
|
"textarea",
|
|
207
207
|
{
|
|
208
208
|
ref: x,
|
|
@@ -217,18 +217,18 @@ const at = L.forwardRef(({
|
|
|
217
217
|
...w
|
|
218
218
|
}
|
|
219
219
|
),
|
|
220
|
-
|
|
220
|
+
s && /* @__PURE__ */ a("label", { className: "clarity-textarea__label", children: s })
|
|
221
221
|
] }),
|
|
222
|
-
u && /* @__PURE__ */
|
|
222
|
+
u && /* @__PURE__ */ a("div", { className: "clarity-textarea__end-icon", children: u })
|
|
223
223
|
] }),
|
|
224
|
-
(l || n && r) && /* @__PURE__ */
|
|
224
|
+
(l || n && r) && /* @__PURE__ */ a("div", { className: "clarity-textarea__helper-text", children: n && r ? r : l })
|
|
225
225
|
] });
|
|
226
226
|
});
|
|
227
227
|
at.displayName = "Textarea";
|
|
228
228
|
const lt = L.forwardRef(({
|
|
229
229
|
variant: e,
|
|
230
230
|
size: t = "medium",
|
|
231
|
-
label:
|
|
231
|
+
label: s,
|
|
232
232
|
helperText: l,
|
|
233
233
|
error: n = !1,
|
|
234
234
|
errorMessage: r,
|
|
@@ -299,9 +299,9 @@ const lt = L.forwardRef(({
|
|
|
299
299
|
tabIndex: c || w ? -1 : 0,
|
|
300
300
|
...B,
|
|
301
301
|
children: [
|
|
302
|
-
o && /* @__PURE__ */
|
|
302
|
+
o && /* @__PURE__ */ a("div", { className: "clarity-select__start-icon", children: o }),
|
|
303
303
|
/* @__PURE__ */ _("div", { className: "clarity-select__field", children: [
|
|
304
|
-
w ? /* @__PURE__ */
|
|
304
|
+
w ? /* @__PURE__ */ a(
|
|
305
305
|
"input",
|
|
306
306
|
{
|
|
307
307
|
ref: M,
|
|
@@ -317,24 +317,24 @@ const lt = L.forwardRef(({
|
|
|
317
317
|
disabled: c,
|
|
318
318
|
readOnly: !b
|
|
319
319
|
}
|
|
320
|
-
) : /* @__PURE__ */
|
|
321
|
-
|
|
320
|
+
) : /* @__PURE__ */ a("div", { className: "clarity-select__display", children: H ? H.label : h }),
|
|
321
|
+
s && /* @__PURE__ */ a("label", { className: "clarity-select__label", children: s })
|
|
322
322
|
] }),
|
|
323
|
-
N && le && /* @__PURE__ */
|
|
323
|
+
N && le && /* @__PURE__ */ a(
|
|
324
324
|
"button",
|
|
325
325
|
{
|
|
326
326
|
type: "button",
|
|
327
327
|
className: "clarity-select__clear-button",
|
|
328
328
|
onClick: re,
|
|
329
329
|
"aria-label": "Limpar seleção",
|
|
330
|
-
children: /* @__PURE__ */
|
|
330
|
+
children: /* @__PURE__ */ a(
|
|
331
331
|
"svg",
|
|
332
332
|
{
|
|
333
333
|
width: "16",
|
|
334
334
|
height: "16",
|
|
335
335
|
viewBox: "0 0 16 16",
|
|
336
336
|
fill: "none",
|
|
337
|
-
children: /* @__PURE__ */
|
|
337
|
+
children: /* @__PURE__ */ a(
|
|
338
338
|
"path",
|
|
339
339
|
{
|
|
340
340
|
d: "M12 4L4 12M4 4L12 12",
|
|
@@ -348,12 +348,12 @@ const lt = L.forwardRef(({
|
|
|
348
348
|
)
|
|
349
349
|
}
|
|
350
350
|
),
|
|
351
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ a(
|
|
352
352
|
"div",
|
|
353
353
|
{
|
|
354
354
|
className: "clarity-select__end-icon",
|
|
355
355
|
onClick: w ? F : void 0,
|
|
356
|
-
children: u || /* @__PURE__ */
|
|
356
|
+
children: u || /* @__PURE__ */ a(
|
|
357
357
|
"svg",
|
|
358
358
|
{
|
|
359
359
|
className: "clarity-select__arrow",
|
|
@@ -361,7 +361,7 @@ const lt = L.forwardRef(({
|
|
|
361
361
|
height: "16",
|
|
362
362
|
viewBox: "0 0 16 16",
|
|
363
363
|
fill: "none",
|
|
364
|
-
children: /* @__PURE__ */
|
|
364
|
+
children: /* @__PURE__ */ a(
|
|
365
365
|
"path",
|
|
366
366
|
{
|
|
367
367
|
d: "M4 6L8 10L12 6",
|
|
@@ -375,7 +375,7 @@ const lt = L.forwardRef(({
|
|
|
375
375
|
)
|
|
376
376
|
}
|
|
377
377
|
),
|
|
378
|
-
b && /* @__PURE__ */
|
|
378
|
+
b && /* @__PURE__ */ a("div", { className: "clarity-select__dropdown", children: /* @__PURE__ */ a("ul", { className: "clarity-select__options", role: "listbox", children: V.length > 0 ? V.map((v) => /* @__PURE__ */ a(
|
|
379
379
|
"li",
|
|
380
380
|
{
|
|
381
381
|
className: [
|
|
@@ -389,18 +389,18 @@ const lt = L.forwardRef(({
|
|
|
389
389
|
children: v.label
|
|
390
390
|
},
|
|
391
391
|
v.value
|
|
392
|
-
)) : /* @__PURE__ */
|
|
392
|
+
)) : /* @__PURE__ */ a("li", { className: "clarity-select__option clarity-select__option--no-results", children: "Nenhum resultado encontrado" }) }) })
|
|
393
393
|
]
|
|
394
394
|
}
|
|
395
395
|
),
|
|
396
|
-
(l || n && r) && /* @__PURE__ */
|
|
396
|
+
(l || n && r) && /* @__PURE__ */ a("div", { className: "clarity-select__helper-text", children: n && r ? r : l })
|
|
397
397
|
] });
|
|
398
398
|
});
|
|
399
399
|
lt.displayName = "Select";
|
|
400
400
|
const nt = Ke(({
|
|
401
401
|
options: e = [],
|
|
402
402
|
value: t = [],
|
|
403
|
-
onChange:
|
|
403
|
+
onChange: s,
|
|
404
404
|
placeholder: l = "Selecione opções",
|
|
405
405
|
label: n,
|
|
406
406
|
helperText: r,
|
|
@@ -440,13 +440,13 @@ const nt = Ke(({
|
|
|
440
440
|
D && (D.stopPropagation(), D.preventDefault());
|
|
441
441
|
const U = t.includes(v);
|
|
442
442
|
let R;
|
|
443
|
-
U ? R = t.filter((se) => se !== v) : R = [...t, v],
|
|
443
|
+
U ? R = t.filter((se) => se !== v) : R = [...t, v], s && s(R);
|
|
444
444
|
}, X = (v, D) => {
|
|
445
445
|
if (D.stopPropagation(), i) return;
|
|
446
446
|
const U = t.filter((R) => R !== v);
|
|
447
|
-
|
|
447
|
+
s == null || s(U);
|
|
448
448
|
}, te = (v) => {
|
|
449
|
-
v.stopPropagation(), !i && (
|
|
449
|
+
v.stopPropagation(), !i && (s == null || s([]));
|
|
450
450
|
}, G = (v) => {
|
|
451
451
|
E(v.target.value);
|
|
452
452
|
}, H = (v) => {
|
|
@@ -458,8 +458,8 @@ const nt = Ke(({
|
|
|
458
458
|
).filter(Boolean), D = v.slice(0, y), U = v.length - y;
|
|
459
459
|
return /* @__PURE__ */ _("div", { className: "clarity-multiselect__chips", children: [
|
|
460
460
|
D.map((R) => /* @__PURE__ */ _("div", { className: "clarity-multiselect__chip", children: [
|
|
461
|
-
/* @__PURE__ */
|
|
462
|
-
!i && /* @__PURE__ */
|
|
461
|
+
/* @__PURE__ */ a("span", { className: "clarity-multiselect__chip-label", children: R.label }),
|
|
462
|
+
!i && /* @__PURE__ */ a(
|
|
463
463
|
"button",
|
|
464
464
|
{
|
|
465
465
|
type: "button",
|
|
@@ -507,11 +507,11 @@ const nt = Ke(({
|
|
|
507
507
|
children: [
|
|
508
508
|
n && /* @__PURE__ */ _("label", { className: "clarity-multiselect__label", children: [
|
|
509
509
|
n,
|
|
510
|
-
h && /* @__PURE__ */
|
|
510
|
+
h && /* @__PURE__ */ a("span", { className: "clarity-multiselect__required", children: "*" })
|
|
511
511
|
] }),
|
|
512
|
-
/* @__PURE__ */
|
|
512
|
+
/* @__PURE__ */ a("div", { className: "clarity-multiselect__content", children: t.length > 0 ? re() : /* @__PURE__ */ a("span", { className: "clarity-multiselect__placeholder", children: l }) }),
|
|
513
513
|
/* @__PURE__ */ _("div", { className: "clarity-multiselect__icons", children: [
|
|
514
|
-
t.length > 0 && !i && /* @__PURE__ */
|
|
514
|
+
t.length > 0 && !i && /* @__PURE__ */ a(
|
|
515
515
|
"button",
|
|
516
516
|
{
|
|
517
517
|
type: "button",
|
|
@@ -521,7 +521,7 @@ const nt = Ke(({
|
|
|
521
521
|
children: "×"
|
|
522
522
|
}
|
|
523
523
|
),
|
|
524
|
-
/* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ a("div", { className: "clarity-multiselect__dropdown-icon", children: /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ a(
|
|
525
525
|
"path",
|
|
526
526
|
{
|
|
527
527
|
d: "M4 6L8 10L12 6",
|
|
@@ -536,7 +536,7 @@ const nt = Ke(({
|
|
|
536
536
|
}
|
|
537
537
|
),
|
|
538
538
|
g && /* @__PURE__ */ _("div", { ref: I, className: "clarity-multiselect__dropdown", children: [
|
|
539
|
-
/* @__PURE__ */
|
|
539
|
+
/* @__PURE__ */ a("div", { className: "clarity-multiselect__search", children: /* @__PURE__ */ a(
|
|
540
540
|
"input",
|
|
541
541
|
{
|
|
542
542
|
ref: P,
|
|
@@ -548,7 +548,7 @@ const nt = Ke(({
|
|
|
548
548
|
onKeyDown: H
|
|
549
549
|
}
|
|
550
550
|
) }),
|
|
551
|
-
/* @__PURE__ */
|
|
551
|
+
/* @__PURE__ */ a("ul", { className: "clarity-multiselect__options", children: M.length > 0 ? M.map((v) => {
|
|
552
552
|
const D = t.includes(v.value), U = v.disabled || i;
|
|
553
553
|
return /* @__PURE__ */ _(
|
|
554
554
|
"li",
|
|
@@ -560,10 +560,10 @@ const nt = Ke(({
|
|
|
560
560
|
].filter(Boolean).join(" "),
|
|
561
561
|
onClick: (R) => !U && F(v.value, R),
|
|
562
562
|
children: [
|
|
563
|
-
/* @__PURE__ */
|
|
563
|
+
/* @__PURE__ */ a("div", { className: "clarity-multiselect__option-checkbox", children: /* @__PURE__ */ a("div", { className: [
|
|
564
564
|
"clarity-multiselect__checkbox",
|
|
565
565
|
D && "clarity-multiselect__checkbox--checked"
|
|
566
|
-
].filter(Boolean).join(" "), children: D && /* @__PURE__ */
|
|
566
|
+
].filter(Boolean).join(" "), children: D && /* @__PURE__ */ a("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ a(
|
|
567
567
|
"path",
|
|
568
568
|
{
|
|
569
569
|
d: "M2 6L5 9L10 3",
|
|
@@ -573,17 +573,17 @@ const nt = Ke(({
|
|
|
573
573
|
strokeLinejoin: "round"
|
|
574
574
|
}
|
|
575
575
|
) }) }) }),
|
|
576
|
-
/* @__PURE__ */
|
|
576
|
+
/* @__PURE__ */ a("span", { className: "clarity-multiselect__option-label", children: v.label })
|
|
577
577
|
]
|
|
578
578
|
},
|
|
579
579
|
v.value
|
|
580
580
|
);
|
|
581
|
-
}) : /* @__PURE__ */
|
|
581
|
+
}) : /* @__PURE__ */ a("li", { className: "clarity-multiselect__option clarity-multiselect__option--no-results", children: "Nenhum resultado encontrado" }) })
|
|
582
582
|
] })
|
|
583
583
|
]
|
|
584
584
|
}
|
|
585
585
|
),
|
|
586
|
-
(r || o && u) && /* @__PURE__ */
|
|
586
|
+
(r || o && u) && /* @__PURE__ */ a("div", { className: "clarity-multiselect__helper", children: o && u ? /* @__PURE__ */ a("span", { className: "clarity-multiselect__error-message", children: u }) : r && /* @__PURE__ */ a("span", { className: "clarity-multiselect__helper-text", children: r }) })
|
|
587
587
|
] });
|
|
588
588
|
});
|
|
589
589
|
nt.displayName = "MultiSelect";
|
|
@@ -595,7 +595,7 @@ const fe = z(null), pe = () => {
|
|
|
595
595
|
}, he = ({
|
|
596
596
|
children: e,
|
|
597
597
|
className: t = "",
|
|
598
|
-
title:
|
|
598
|
+
title: s
|
|
599
599
|
}) => {
|
|
600
600
|
const { onClose: l, variant: n, showCloseButton: r } = pe(), o = [
|
|
601
601
|
"clarity-modal-header",
|
|
@@ -606,35 +606,35 @@ const fe = z(null), pe = () => {
|
|
|
606
606
|
n && `clarity-modal-close--${n}`
|
|
607
607
|
].filter(Boolean).join(" ");
|
|
608
608
|
return /* @__PURE__ */ _("div", { className: o, children: [
|
|
609
|
-
|
|
609
|
+
s && /* @__PURE__ */ a("h2", { className: "clarity-modal-title", children: s }),
|
|
610
610
|
e,
|
|
611
|
-
r && /* @__PURE__ */
|
|
611
|
+
r && /* @__PURE__ */ a("button", { className: u, onClick: (i) => {
|
|
612
612
|
i.stopPropagation(), l();
|
|
613
613
|
}, children: "×" })
|
|
614
614
|
] });
|
|
615
615
|
};
|
|
616
616
|
he.displayName = "Modal.Header";
|
|
617
|
-
const ye = ({ children: e, className: t = "" }) => /* @__PURE__ */
|
|
617
|
+
const ye = ({ children: e, className: t = "" }) => /* @__PURE__ */ a("div", { className: `clarity-modal-content ${t}`, children: e });
|
|
618
618
|
ye.displayName = "Modal.Content";
|
|
619
619
|
const ve = ({ children: e, className: t = "" }) => /* @__PURE__ */ _("div", { className: `clarity-modal-footer ${t}`, children: [
|
|
620
|
-
/* @__PURE__ */
|
|
620
|
+
/* @__PURE__ */ a("div", { className: "clarity-modal-scroll-indicator" }),
|
|
621
621
|
e
|
|
622
622
|
] });
|
|
623
623
|
ve.displayName = "Modal.Footer";
|
|
624
|
-
const Ce = ({ children: e, onClick: t, variant:
|
|
624
|
+
const Ce = ({ children: e, onClick: t, variant: s }) => W(e, {
|
|
625
625
|
onClick: (l) => {
|
|
626
626
|
var n, r;
|
|
627
627
|
t == null || t(), (r = (n = e.props).onClick) == null || r.call(n, l);
|
|
628
628
|
},
|
|
629
|
-
variant:
|
|
629
|
+
variant: s
|
|
630
630
|
});
|
|
631
631
|
Ce.displayName = "Modal.Trigger";
|
|
632
632
|
const Ne = ({ children: e }) => {
|
|
633
633
|
const { onClose: t } = pe();
|
|
634
634
|
return W(e, {
|
|
635
|
-
onClick: (
|
|
635
|
+
onClick: (s) => {
|
|
636
636
|
var l, n;
|
|
637
|
-
t(), (n = (l = e.props).onClick) == null || n.call(l,
|
|
637
|
+
t(), (n = (l = e.props).onClick) == null || n.call(l, s);
|
|
638
638
|
}
|
|
639
639
|
});
|
|
640
640
|
};
|
|
@@ -642,7 +642,7 @@ Ne.displayName = "Modal.Close";
|
|
|
642
642
|
const J = ({
|
|
643
643
|
isOpen: e,
|
|
644
644
|
onClose: t,
|
|
645
|
-
onOpen:
|
|
645
|
+
onOpen: s,
|
|
646
646
|
children: l,
|
|
647
647
|
className: n = "",
|
|
648
648
|
variant: r,
|
|
@@ -654,8 +654,8 @@ const J = ({
|
|
|
654
654
|
p(!1);
|
|
655
655
|
});
|
|
656
656
|
O(() => {
|
|
657
|
-
f && (
|
|
658
|
-
}, [f,
|
|
657
|
+
f && (s == null || s());
|
|
658
|
+
}, [f, s]), O(() => {
|
|
659
659
|
const w = (B) => {
|
|
660
660
|
B.key === "Escape" && m();
|
|
661
661
|
};
|
|
@@ -672,7 +672,7 @@ const J = ({
|
|
|
672
672
|
), N = ["clarity-modal", n, `clarity-modal--${o}`].filter(Boolean).join(" ");
|
|
673
673
|
return /* @__PURE__ */ _(fe.Provider, { value: { onClose: m, variant: r, showCloseButton: u }, children: [
|
|
674
674
|
C && W(C, { onClick: () => p(!0), variant: r }),
|
|
675
|
-
f && /* @__PURE__ */
|
|
675
|
+
f && /* @__PURE__ */ a("div", { className: "clarity-modal-overlay", onClick: d, children: /* @__PURE__ */ a("div", { className: N, children: h }) })
|
|
676
676
|
] });
|
|
677
677
|
};
|
|
678
678
|
J.Header = he;
|
|
@@ -686,7 +686,7 @@ const be = z(void 0), $t = () => {
|
|
|
686
686
|
if (!e)
|
|
687
687
|
throw new Error("useToast must be used within a ToastProvider");
|
|
688
688
|
return e;
|
|
689
|
-
}, rt = ({ id: e, message: t, variant:
|
|
689
|
+
}, rt = ({ id: e, message: t, variant: s, duration: l, onClose: n, invertColors: r }) => {
|
|
690
690
|
const [o, u] = T("entering");
|
|
691
691
|
O(() => {
|
|
692
692
|
const c = setTimeout(() => {
|
|
@@ -702,14 +702,14 @@ const be = z(void 0), $t = () => {
|
|
|
702
702
|
}, [e, l, n]);
|
|
703
703
|
const i = [
|
|
704
704
|
"cl-toast",
|
|
705
|
-
|
|
705
|
+
s,
|
|
706
706
|
r ? "colored-background" : "",
|
|
707
707
|
`cl-toast-${o}`
|
|
708
708
|
].filter(Boolean).join(" ");
|
|
709
709
|
return /* @__PURE__ */ _("div", { className: i, children: [
|
|
710
|
-
/* @__PURE__ */
|
|
711
|
-
/* @__PURE__ */
|
|
712
|
-
/* @__PURE__ */
|
|
710
|
+
/* @__PURE__ */ a("div", { className: "cl-toast-message", children: t }),
|
|
711
|
+
/* @__PURE__ */ a("button", { onClick: () => u("exiting"), className: "cl-toast-close-button", children: "×" }),
|
|
712
|
+
/* @__PURE__ */ a(
|
|
713
713
|
"div",
|
|
714
714
|
{
|
|
715
715
|
className: "cl-toast-progress-bar",
|
|
@@ -718,7 +718,7 @@ const be = z(void 0), $t = () => {
|
|
|
718
718
|
)
|
|
719
719
|
] });
|
|
720
720
|
}, kt = ({ children: e }) => {
|
|
721
|
-
const [t,
|
|
721
|
+
const [t, s] = T([]), l = Y(() => {
|
|
722
722
|
if (typeof document < "u") {
|
|
723
723
|
const i = document.createElement("div");
|
|
724
724
|
return i.id = "toast-portal-root", i;
|
|
@@ -738,17 +738,17 @@ const be = z(void 0), $t = () => {
|
|
|
738
738
|
// position: 'right-top',
|
|
739
739
|
...i
|
|
740
740
|
};
|
|
741
|
-
|
|
741
|
+
s((y) => {
|
|
742
742
|
const f = [p, ...y];
|
|
743
743
|
return f.length > 4 ? f.slice(0, 4) : f;
|
|
744
744
|
});
|
|
745
745
|
}, []), r = ne((i) => {
|
|
746
|
-
|
|
746
|
+
s((c) => c.filter((p) => p.id !== i));
|
|
747
747
|
}, []), o = Y(() => t.reduce((i, c) => (i[c.position] || (i[c.position] = []), i[c.position].push(c), i), {}), [t]), u = Y(() => ({ show: n }), [n]);
|
|
748
748
|
return /* @__PURE__ */ _(be.Provider, { value: u, children: [
|
|
749
749
|
e,
|
|
750
750
|
l && tt.createPortal(
|
|
751
|
-
Object.entries(o).map(([i, c]) => /* @__PURE__ */
|
|
751
|
+
Object.entries(o).map(([i, c]) => /* @__PURE__ */ a("div", { className: `cl-toast-container ${i}`, children: c.map((p) => /* @__PURE__ */ a(rt, { ...p, onClose: r }, p.id)) }, i)),
|
|
752
752
|
l
|
|
753
753
|
)
|
|
754
754
|
] });
|
|
@@ -761,7 +761,7 @@ const be = z(void 0), $t = () => {
|
|
|
761
761
|
children: e,
|
|
762
762
|
className: t = ""
|
|
763
763
|
}) => {
|
|
764
|
-
const { onClose:
|
|
764
|
+
const { onClose: s, variant: l, showCloseButton: n, title: r } = we(), o = [
|
|
765
765
|
"clarity-offcanvas-header",
|
|
766
766
|
t
|
|
767
767
|
].filter(Boolean).join(" "), u = [
|
|
@@ -772,32 +772,32 @@ const be = z(void 0), $t = () => {
|
|
|
772
772
|
l && `clarity-offcanvas-title--${l}`
|
|
773
773
|
].filter(Boolean).join(" ");
|
|
774
774
|
return /* @__PURE__ */ _("div", { className: o, children: [
|
|
775
|
-
r && /* @__PURE__ */
|
|
775
|
+
r && /* @__PURE__ */ a("h2", { className: i, children: r }),
|
|
776
776
|
e,
|
|
777
|
-
n && /* @__PURE__ */
|
|
778
|
-
c.stopPropagation(),
|
|
777
|
+
n && /* @__PURE__ */ a("button", { className: u, onClick: (c) => {
|
|
778
|
+
c.stopPropagation(), s();
|
|
779
779
|
}, children: "×" })
|
|
780
780
|
] });
|
|
781
781
|
};
|
|
782
782
|
ge.displayName = "Offcanvas.Header";
|
|
783
|
-
const $e = ({ children: e, className: t = "" }) => /* @__PURE__ */
|
|
783
|
+
const $e = ({ children: e, className: t = "" }) => /* @__PURE__ */ a("div", { className: `clarity-offcanvas-content ${t}`, children: e });
|
|
784
784
|
$e.displayName = "Offcanvas.Content";
|
|
785
|
-
const ke = ({ children: e, onClick: t, variant:
|
|
785
|
+
const ke = ({ children: e, onClick: t, variant: s }) => W(e, {
|
|
786
786
|
onClick: (l) => {
|
|
787
787
|
var n, r;
|
|
788
788
|
t == null || t(), (r = (n = e.props).onClick) == null || r.call(n, l);
|
|
789
789
|
},
|
|
790
|
-
variant:
|
|
790
|
+
variant: s
|
|
791
791
|
});
|
|
792
792
|
ke.displayName = "Offcanvas.Trigger";
|
|
793
|
-
const ce = ({ children: e, className: t = "" }) => /* @__PURE__ */
|
|
793
|
+
const ce = ({ children: e, className: t = "" }) => /* @__PURE__ */ a("div", { className: `clarity-offcanvas-footer ${t}`, children: e });
|
|
794
794
|
ce.displayName = "Offcanvas.Footer";
|
|
795
795
|
const xe = ({ children: e }) => {
|
|
796
796
|
const { onClose: t } = we();
|
|
797
797
|
return W(e, {
|
|
798
|
-
onClick: (
|
|
798
|
+
onClick: (s) => {
|
|
799
799
|
var l, n;
|
|
800
|
-
t(), (n = (l = e.props).onClick) == null || n.call(l,
|
|
800
|
+
t(), (n = (l = e.props).onClick) == null || n.call(l, s);
|
|
801
801
|
}
|
|
802
802
|
});
|
|
803
803
|
};
|
|
@@ -805,7 +805,7 @@ xe.displayName = "Offcanvas.Close";
|
|
|
805
805
|
const K = ({
|
|
806
806
|
isOpen: e,
|
|
807
807
|
onClose: t,
|
|
808
|
-
onOpen:
|
|
808
|
+
onOpen: s,
|
|
809
809
|
children: l,
|
|
810
810
|
className: n = "",
|
|
811
811
|
variant: r,
|
|
@@ -817,8 +817,8 @@ const K = ({
|
|
|
817
817
|
const [p, y] = T(!1), [f, m] = T(!1), [d, C] = T(!1), h = e !== void 0, N = h ? e : p, w = ne(() => {
|
|
818
818
|
t ? t() : y(!1);
|
|
819
819
|
}, [t]), B = ne(() => {
|
|
820
|
-
h || y(!0),
|
|
821
|
-
}, [h,
|
|
820
|
+
h || y(!0), s == null || s();
|
|
821
|
+
}, [h, s]);
|
|
822
822
|
O(() => {
|
|
823
823
|
if (N) {
|
|
824
824
|
C(!0);
|
|
@@ -861,7 +861,7 @@ const K = ({
|
|
|
861
861
|
j.props.children,
|
|
862
862
|
S
|
|
863
863
|
] })
|
|
864
|
-
}) : j = /* @__PURE__ */
|
|
864
|
+
}) : j = /* @__PURE__ */ a(ce, { children: S }));
|
|
865
865
|
const P = [
|
|
866
866
|
"clarity-offcanvas",
|
|
867
867
|
n,
|
|
@@ -875,10 +875,10 @@ const K = ({
|
|
|
875
875
|
return /* @__PURE__ */ _(_e.Provider, { value: { onClose: w, variant: r, showCloseButton: i, placement: o, title: c }, children: [
|
|
876
876
|
k && W(k, { onClick: B, variant: r }),
|
|
877
877
|
d && // Only render if shouldRender is true
|
|
878
|
-
/* @__PURE__ */
|
|
878
|
+
/* @__PURE__ */ a("div", { className: I, onClick: g, children: /* @__PURE__ */ _("div", { className: P, children: [
|
|
879
879
|
E,
|
|
880
880
|
x,
|
|
881
|
-
j && /* @__PURE__ */
|
|
881
|
+
j && /* @__PURE__ */ a("div", { className: "clarity-offcanvas-scroll-indicator" }),
|
|
882
882
|
" ",
|
|
883
883
|
j
|
|
884
884
|
] }) })
|
|
@@ -893,7 +893,7 @@ K.displayName = "Offcanvas";
|
|
|
893
893
|
const it = L.forwardRef(({
|
|
894
894
|
type: e,
|
|
895
895
|
variant: t = "primary",
|
|
896
|
-
size:
|
|
896
|
+
size: s = "medium",
|
|
897
897
|
label: l,
|
|
898
898
|
helperText: n,
|
|
899
899
|
error: r = !1,
|
|
@@ -913,19 +913,19 @@ const it = L.forwardRef(({
|
|
|
913
913
|
].filter(Boolean).join(" "), h = [
|
|
914
914
|
"clarity-check-input",
|
|
915
915
|
`clarity-check-input--${e}`,
|
|
916
|
-
`clarity-check-input--${
|
|
916
|
+
`clarity-check-input--${s}`,
|
|
917
917
|
t && `clarity-check-input--${t}`,
|
|
918
918
|
r && "clarity-check-input--error",
|
|
919
919
|
c && "clarity-check-input--disabled",
|
|
920
920
|
i
|
|
921
921
|
].filter(Boolean).join(" "), N = [
|
|
922
922
|
"clarity-check-input__label",
|
|
923
|
-
`clarity-check-input__label--${
|
|
923
|
+
`clarity-check-input__label--${s}`,
|
|
924
924
|
c && "clarity-check-input__label--disabled"
|
|
925
925
|
].filter(Boolean).join(" ");
|
|
926
926
|
return /* @__PURE__ */ _("div", { className: "clarity-check-input-container", children: [
|
|
927
927
|
/* @__PURE__ */ _("label", { className: C, htmlFor: d, children: [
|
|
928
|
-
/* @__PURE__ */
|
|
928
|
+
/* @__PURE__ */ a(
|
|
929
929
|
"input",
|
|
930
930
|
{
|
|
931
931
|
ref: m,
|
|
@@ -938,14 +938,14 @@ const it = L.forwardRef(({
|
|
|
938
938
|
}
|
|
939
939
|
),
|
|
940
940
|
/* @__PURE__ */ _("div", { className: "clarity-check-input__custom", children: [
|
|
941
|
-
e === "checkbox" && /* @__PURE__ */
|
|
941
|
+
e === "checkbox" && /* @__PURE__ */ a(
|
|
942
942
|
"svg",
|
|
943
943
|
{
|
|
944
944
|
className: "clarity-check-input__icon",
|
|
945
945
|
viewBox: "0 0 16 16",
|
|
946
946
|
fill: "none",
|
|
947
947
|
xmlns: "http://www.w3.org/2000/svg",
|
|
948
|
-
children: /* @__PURE__ */
|
|
948
|
+
children: /* @__PURE__ */ a(
|
|
949
949
|
"path",
|
|
950
950
|
{
|
|
951
951
|
d: "M13.5 4.5L6 12L2.5 8.5",
|
|
@@ -957,18 +957,18 @@ const it = L.forwardRef(({
|
|
|
957
957
|
)
|
|
958
958
|
}
|
|
959
959
|
),
|
|
960
|
-
e === "radio" && /* @__PURE__ */
|
|
960
|
+
e === "radio" && /* @__PURE__ */ a("div", { className: "clarity-check-input__radio-dot" })
|
|
961
961
|
] }),
|
|
962
|
-
l && /* @__PURE__ */
|
|
962
|
+
l && /* @__PURE__ */ a("span", { className: N, children: l })
|
|
963
963
|
] }),
|
|
964
|
-
(n || r && o) && /* @__PURE__ */
|
|
964
|
+
(n || r && o) && /* @__PURE__ */ a("div", { className: "clarity-check-input__helper-text", children: r && o ? o : n })
|
|
965
965
|
] });
|
|
966
966
|
});
|
|
967
967
|
it.displayName = "CheckInput";
|
|
968
968
|
const ot = L.forwardRef(({
|
|
969
969
|
variant: e = "primary",
|
|
970
970
|
size: t = "medium",
|
|
971
|
-
label:
|
|
971
|
+
label: s,
|
|
972
972
|
helperText: l,
|
|
973
973
|
error: n = !1,
|
|
974
974
|
errorMessage: r,
|
|
@@ -998,7 +998,7 @@ const ot = L.forwardRef(({
|
|
|
998
998
|
].filter(Boolean).join(" ");
|
|
999
999
|
return /* @__PURE__ */ _("div", { className: "clarity-input-switch-container", children: [
|
|
1000
1000
|
/* @__PURE__ */ _("label", { className: d, htmlFor: m, children: [
|
|
1001
|
-
/* @__PURE__ */
|
|
1001
|
+
/* @__PURE__ */ a(
|
|
1002
1002
|
"input",
|
|
1003
1003
|
{
|
|
1004
1004
|
ref: f,
|
|
@@ -1010,10 +1010,10 @@ const ot = L.forwardRef(({
|
|
|
1010
1010
|
...y
|
|
1011
1011
|
}
|
|
1012
1012
|
),
|
|
1013
|
-
/* @__PURE__ */
|
|
1014
|
-
|
|
1013
|
+
/* @__PURE__ */ a("div", { className: "clarity-input-switch__track", children: /* @__PURE__ */ a("div", { className: "clarity-input-switch__thumb" }) }),
|
|
1014
|
+
s && /* @__PURE__ */ a("span", { className: h, children: s })
|
|
1015
1015
|
] }),
|
|
1016
|
-
(l || n && r) && /* @__PURE__ */
|
|
1016
|
+
(l || n && r) && /* @__PURE__ */ a("div", { className: "clarity-input-switch__helper-text", children: n && r ? r : l })
|
|
1017
1017
|
] });
|
|
1018
1018
|
});
|
|
1019
1019
|
ot.displayName = "InputSwitch";
|
|
@@ -1023,27 +1023,27 @@ const Te = z(null), de = () => {
|
|
|
1023
1023
|
throw new Error("useConfirmationDialog must be used within a ConfirmationDialog provider");
|
|
1024
1024
|
return e;
|
|
1025
1025
|
}, Be = ({ children: e, className: t = "" }) => {
|
|
1026
|
-
const { variant:
|
|
1027
|
-
return /* @__PURE__ */
|
|
1026
|
+
const { variant: s } = de(), l = `clarity-confirmation-dialog-header ${t} clarity-confirmation-dialog-header--${s}`;
|
|
1027
|
+
return /* @__PURE__ */ a("div", { className: l, children: e });
|
|
1028
1028
|
};
|
|
1029
1029
|
Be.displayName = "ConfirmationDialog.Header";
|
|
1030
|
-
const je = ({ children: e, className: t = "" }) => /* @__PURE__ */
|
|
1030
|
+
const je = ({ children: e, className: t = "" }) => /* @__PURE__ */ a("div", { className: `clarity-confirmation-dialog-content ${t}`, children: e });
|
|
1031
1031
|
je.displayName = "ConfirmationDialog.Content";
|
|
1032
|
-
const Le = ({ children: e, className: t = "" }) => /* @__PURE__ */
|
|
1032
|
+
const Le = ({ children: e, className: t = "" }) => /* @__PURE__ */ a("div", { className: `clarity-confirmation-dialog-footer ${t}`, children: e });
|
|
1033
1033
|
Le.displayName = "ConfirmationDialog.Footer";
|
|
1034
1034
|
const Ee = ({ children: e }) => W(e, {
|
|
1035
1035
|
onClick: (t) => {
|
|
1036
|
-
var
|
|
1037
|
-
(l = (
|
|
1036
|
+
var s, l;
|
|
1037
|
+
(l = (s = e.props).onClick) == null || l.call(s, t);
|
|
1038
1038
|
}
|
|
1039
1039
|
});
|
|
1040
1040
|
Ee.displayName = "ConfirmationDialog.Trigger";
|
|
1041
1041
|
const Ie = ({ children: e }) => {
|
|
1042
1042
|
const { onClose: t } = de();
|
|
1043
1043
|
return W(e, {
|
|
1044
|
-
onClick: (
|
|
1044
|
+
onClick: (s) => {
|
|
1045
1045
|
var l, n;
|
|
1046
|
-
t(), (n = (l = e.props).onClick) == null || n.call(l,
|
|
1046
|
+
t(), (n = (l = e.props).onClick) == null || n.call(l, s);
|
|
1047
1047
|
}
|
|
1048
1048
|
});
|
|
1049
1049
|
};
|
|
@@ -1051,9 +1051,9 @@ Ie.displayName = "ConfirmationDialog.Close";
|
|
|
1051
1051
|
const Oe = ({ children: e }) => {
|
|
1052
1052
|
const { onConfirm: t } = de();
|
|
1053
1053
|
return W(e, {
|
|
1054
|
-
onClick: (
|
|
1054
|
+
onClick: (s) => {
|
|
1055
1055
|
var l, n;
|
|
1056
|
-
t(), (n = (l = e.props).onClick) == null || n.call(l,
|
|
1056
|
+
t(), (n = (l = e.props).onClick) == null || n.call(l, s);
|
|
1057
1057
|
}
|
|
1058
1058
|
});
|
|
1059
1059
|
};
|
|
@@ -1061,7 +1061,7 @@ Oe.displayName = "ConfirmationDialog.Confirm";
|
|
|
1061
1061
|
const Q = ({
|
|
1062
1062
|
isOpen: e,
|
|
1063
1063
|
onClose: t,
|
|
1064
|
-
onConfirm:
|
|
1064
|
+
onConfirm: s,
|
|
1065
1065
|
variant: l = "clarity-primary",
|
|
1066
1066
|
children: n
|
|
1067
1067
|
}) => {
|
|
@@ -1070,7 +1070,7 @@ const Q = ({
|
|
|
1070
1070
|
}, p = () => {
|
|
1071
1071
|
t ? t() : o(!1);
|
|
1072
1072
|
}, y = () => {
|
|
1073
|
-
|
|
1073
|
+
s && s(), p();
|
|
1074
1074
|
};
|
|
1075
1075
|
O(() => {
|
|
1076
1076
|
const C = (h) => {
|
|
@@ -1087,7 +1087,7 @@ const Q = ({
|
|
|
1087
1087
|
), d = `clarity-confirmation-dialog clarity-confirmation-dialog--${l}`;
|
|
1088
1088
|
return /* @__PURE__ */ _(Te.Provider, { value: { variant: l, onClose: p, onConfirm: y, onOpen: c }, children: [
|
|
1089
1089
|
f,
|
|
1090
|
-
i && /* @__PURE__ */
|
|
1090
|
+
i && /* @__PURE__ */ a("div", { className: "clarity-modal-overlay", children: /* @__PURE__ */ a("div", { className: d, children: m }) })
|
|
1091
1091
|
] });
|
|
1092
1092
|
};
|
|
1093
1093
|
Q.Header = Be;
|
|
@@ -1100,7 +1100,7 @@ Q.displayName = "ConfirmationDialog";
|
|
|
1100
1100
|
const xt = ({
|
|
1101
1101
|
variant: e = "primary",
|
|
1102
1102
|
product: t,
|
|
1103
|
-
tone:
|
|
1103
|
+
tone: s,
|
|
1104
1104
|
hoverTone: l,
|
|
1105
1105
|
size: n = "medium",
|
|
1106
1106
|
disabled: r = !1,
|
|
@@ -1113,7 +1113,7 @@ const xt = ({
|
|
|
1113
1113
|
title: f,
|
|
1114
1114
|
...m
|
|
1115
1115
|
}) => {
|
|
1116
|
-
const d = "clarity-button-icon", C = t &&
|
|
1116
|
+
const d = "clarity-button-icon", C = t && s, h = C ? `${d}--custom` : `${d}--${e}`, N = [
|
|
1117
1117
|
d,
|
|
1118
1118
|
h,
|
|
1119
1119
|
`${d}--${n}`,
|
|
@@ -1124,8 +1124,8 @@ const xt = ({
|
|
|
1124
1124
|
const b = parseInt(g);
|
|
1125
1125
|
return b >= 800 ? "900" : b >= 700 ? "800" : b >= 600 ? "700" : b >= 500 ? "600" : b >= 400 ? "500" : b >= 300 ? "400" : b >= 200 ? "300" : "200";
|
|
1126
1126
|
}, B = C ? {
|
|
1127
|
-
"--custom-bg-color": `var(--clarity-${t}-${
|
|
1128
|
-
"--custom-hover-color": `var(--clarity-${t}-${l || w(
|
|
1127
|
+
"--custom-bg-color": `var(--clarity-${t}-${s})`,
|
|
1128
|
+
"--custom-hover-color": `var(--clarity-${t}-${l || w(s)})`
|
|
1129
1129
|
} : {};
|
|
1130
1130
|
return /* @__PURE__ */ _(
|
|
1131
1131
|
"button",
|
|
@@ -1139,7 +1139,7 @@ const xt = ({
|
|
|
1139
1139
|
title: f,
|
|
1140
1140
|
...m,
|
|
1141
1141
|
children: [
|
|
1142
|
-
o && /* @__PURE__ */
|
|
1142
|
+
o && /* @__PURE__ */ a("div", { className: `${d}__spinner` }),
|
|
1143
1143
|
!o && u
|
|
1144
1144
|
]
|
|
1145
1145
|
}
|
|
@@ -1147,7 +1147,7 @@ const xt = ({
|
|
|
1147
1147
|
}, Tt = ({
|
|
1148
1148
|
variant: e = "primary",
|
|
1149
1149
|
product: t,
|
|
1150
|
-
tone:
|
|
1150
|
+
tone: s,
|
|
1151
1151
|
hoverTone: l,
|
|
1152
1152
|
size: n = "medium",
|
|
1153
1153
|
disabled: r = !1,
|
|
@@ -1159,7 +1159,7 @@ const xt = ({
|
|
|
1159
1159
|
className: y = "",
|
|
1160
1160
|
...f
|
|
1161
1161
|
}) => {
|
|
1162
|
-
const m = "clarity-button-link", d = t &&
|
|
1162
|
+
const m = "clarity-button-link", d = t && s, C = d ? `${m}--custom` : `${m}--${e}`, h = [
|
|
1163
1163
|
m,
|
|
1164
1164
|
C,
|
|
1165
1165
|
`${m}--${n}`,
|
|
@@ -1169,10 +1169,10 @@ const xt = ({
|
|
|
1169
1169
|
const g = parseInt(B);
|
|
1170
1170
|
return g >= 800 ? "900" : g >= 700 ? "800" : g >= 600 ? "700" : g >= 500 ? "600" : g >= 400 ? "500" : g >= 300 ? "400" : g >= 200 ? "300" : "200";
|
|
1171
1171
|
}, w = d ? {
|
|
1172
|
-
"--custom-color": `var(--clarity-${t}-${
|
|
1173
|
-
"--custom-hover-color": `var(--clarity-${t}-${l || N(
|
|
1172
|
+
"--custom-color": `var(--clarity-${t}-${s})`,
|
|
1173
|
+
"--custom-hover-color": `var(--clarity-${t}-${l || N(s)})`
|
|
1174
1174
|
} : {};
|
|
1175
|
-
return i ? /* @__PURE__ */
|
|
1175
|
+
return i ? /* @__PURE__ */ a(
|
|
1176
1176
|
"a",
|
|
1177
1177
|
{
|
|
1178
1178
|
href: i,
|
|
@@ -1184,7 +1184,7 @@ const xt = ({
|
|
|
1184
1184
|
...f,
|
|
1185
1185
|
children: o
|
|
1186
1186
|
}
|
|
1187
|
-
) : /* @__PURE__ */
|
|
1187
|
+
) : /* @__PURE__ */ a(
|
|
1188
1188
|
"button",
|
|
1189
1189
|
{
|
|
1190
1190
|
className: h,
|
|
@@ -1203,7 +1203,7 @@ const xt = ({
|
|
|
1203
1203
|
}, ct = ({
|
|
1204
1204
|
variant: e = "primary",
|
|
1205
1205
|
product: t,
|
|
1206
|
-
tone:
|
|
1206
|
+
tone: s,
|
|
1207
1207
|
hoverTone: l,
|
|
1208
1208
|
defaultActiveKey: n,
|
|
1209
1209
|
alwaysOpen: r = !1,
|
|
@@ -1216,7 +1216,7 @@ const xt = ({
|
|
|
1216
1216
|
const [y, f] = T(() => n ? Array.isArray(n) ? n : [n] : []), m = (b) => {
|
|
1217
1217
|
let k;
|
|
1218
1218
|
r ? k = y.includes(b) ? y.filter((E) => E !== b) : [...y, b] : k = y.includes(b) ? [] : [b], f(k), c && c(y.includes(b) ? null : b, {});
|
|
1219
|
-
}, d = "clarity-accordion", C = t &&
|
|
1219
|
+
}, d = "clarity-accordion", C = t && s, h = C ? `${d}--custom` : `${d}--${e}`, N = [
|
|
1220
1220
|
d,
|
|
1221
1221
|
h,
|
|
1222
1222
|
o && `${d}--flush`,
|
|
@@ -1225,24 +1225,24 @@ const xt = ({
|
|
|
1225
1225
|
const k = parseInt(b);
|
|
1226
1226
|
return k >= 800 ? "900" : k >= 700 ? "800" : k >= 600 ? "700" : k >= 500 ? "600" : k >= 400 ? "500" : k >= 300 ? "400" : k >= 200 ? "300" : "200";
|
|
1227
1227
|
}, B = C ? {
|
|
1228
|
-
"--custom-border-color": `var(--clarity-${t}-${
|
|
1229
|
-
"--custom-header-color": `var(--clarity-${t}-${
|
|
1230
|
-
"--custom-hover-color": `var(--clarity-${t}-${l || w(
|
|
1228
|
+
"--custom-border-color": `var(--clarity-${t}-${s})`,
|
|
1229
|
+
"--custom-header-color": `var(--clarity-${t}-${s})`,
|
|
1230
|
+
"--custom-hover-color": `var(--clarity-${t}-${l || w(s)})`
|
|
1231
1231
|
} : {}, g = {
|
|
1232
1232
|
activeKeys: y,
|
|
1233
1233
|
toggleItem: m,
|
|
1234
1234
|
alwaysOpen: r,
|
|
1235
1235
|
variant: e,
|
|
1236
1236
|
product: t,
|
|
1237
|
-
tone:
|
|
1237
|
+
tone: s,
|
|
1238
1238
|
hoverTone: l,
|
|
1239
1239
|
flush: o
|
|
1240
1240
|
};
|
|
1241
|
-
return /* @__PURE__ */
|
|
1241
|
+
return /* @__PURE__ */ a(Se.Provider, { value: g, children: /* @__PURE__ */ a("div", { className: N, style: B, ...p, children: i }) });
|
|
1242
1242
|
}, dt = ({
|
|
1243
1243
|
eventKey: e,
|
|
1244
1244
|
disabled: t = !1,
|
|
1245
|
-
className:
|
|
1245
|
+
className: s = "",
|
|
1246
1246
|
children: l,
|
|
1247
1247
|
...n
|
|
1248
1248
|
}) => {
|
|
@@ -1250,9 +1250,9 @@ const xt = ({
|
|
|
1250
1250
|
`${o}__item`,
|
|
1251
1251
|
u && `${o}__item--active`,
|
|
1252
1252
|
t && `${o}__item--disabled`,
|
|
1253
|
-
|
|
1253
|
+
s
|
|
1254
1254
|
].filter(Boolean).join(" ");
|
|
1255
|
-
return /* @__PURE__ */
|
|
1255
|
+
return /* @__PURE__ */ a("div", { className: i, ...n, children: L.Children.map(l, (c) => L.isValidElement(c) ? L.cloneElement(c, {
|
|
1256
1256
|
...c.props,
|
|
1257
1257
|
eventKey: e,
|
|
1258
1258
|
disabled: t,
|
|
@@ -1261,14 +1261,14 @@ const xt = ({
|
|
|
1261
1261
|
}, mt = ({
|
|
1262
1262
|
className: e = "",
|
|
1263
1263
|
children: t,
|
|
1264
|
-
onClick:
|
|
1264
|
+
onClick: s,
|
|
1265
1265
|
eventKey: l,
|
|
1266
1266
|
disabled: n = !1,
|
|
1267
1267
|
isActive: r = !1,
|
|
1268
1268
|
...o
|
|
1269
1269
|
}) => {
|
|
1270
1270
|
const { toggleItem: u } = De(), i = "clarity-accordion", c = (p) => {
|
|
1271
|
-
!n && l && u(l),
|
|
1271
|
+
!n && l && u(l), s == null || s(p);
|
|
1272
1272
|
};
|
|
1273
1273
|
return /* @__PURE__ */ _(
|
|
1274
1274
|
"button",
|
|
@@ -1280,8 +1280,8 @@ const xt = ({
|
|
|
1280
1280
|
"aria-controls": l ? `${i}-collapse-${l}` : void 0,
|
|
1281
1281
|
...o,
|
|
1282
1282
|
children: [
|
|
1283
|
-
/* @__PURE__ */
|
|
1284
|
-
/* @__PURE__ */
|
|
1283
|
+
/* @__PURE__ */ a("span", { className: `${i}__title`, children: t }),
|
|
1284
|
+
/* @__PURE__ */ a("span", { className: `${i}__icon`, children: /* @__PURE__ */ a(
|
|
1285
1285
|
"svg",
|
|
1286
1286
|
{
|
|
1287
1287
|
width: "16",
|
|
@@ -1289,7 +1289,7 @@ const xt = ({
|
|
|
1289
1289
|
viewBox: "0 0 16 16",
|
|
1290
1290
|
fill: "currentColor",
|
|
1291
1291
|
className: r ? `${i}__icon--rotated` : "",
|
|
1292
|
-
children: /* @__PURE__ */
|
|
1292
|
+
children: /* @__PURE__ */ a("path", { d: "M4.646 6.646a.5.5 0 0 1 .708 0L8 9.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z" })
|
|
1293
1293
|
}
|
|
1294
1294
|
) })
|
|
1295
1295
|
]
|
|
@@ -1298,20 +1298,20 @@ const xt = ({
|
|
|
1298
1298
|
}, ut = ({
|
|
1299
1299
|
className: e = "",
|
|
1300
1300
|
children: t,
|
|
1301
|
-
eventKey:
|
|
1301
|
+
eventKey: s,
|
|
1302
1302
|
isActive: l = !1,
|
|
1303
1303
|
...n
|
|
1304
1304
|
}) => {
|
|
1305
1305
|
const r = "clarity-accordion";
|
|
1306
|
-
return /* @__PURE__ */
|
|
1306
|
+
return /* @__PURE__ */ a(
|
|
1307
1307
|
"div",
|
|
1308
1308
|
{
|
|
1309
|
-
id:
|
|
1309
|
+
id: s ? `${r}-collapse-${s}` : void 0,
|
|
1310
1310
|
className: [
|
|
1311
1311
|
`${r}__collapse`,
|
|
1312
1312
|
l && `${r}__collapse--show`
|
|
1313
1313
|
].filter(Boolean).join(" "),
|
|
1314
|
-
children: /* @__PURE__ */
|
|
1314
|
+
children: /* @__PURE__ */ a("div", { className: [`${r}__body`, e].filter(Boolean).join(" "), ...n, children: t })
|
|
1315
1315
|
}
|
|
1316
1316
|
);
|
|
1317
1317
|
}, Bt = Object.assign(ct, {
|
|
@@ -1326,12 +1326,12 @@ const xt = ({
|
|
|
1326
1326
|
throw new Error("useDropdown must be used within a DropdownProvider");
|
|
1327
1327
|
return e;
|
|
1328
1328
|
}, ft = ({ children: e }) => {
|
|
1329
|
-
const { setIsOpen: t, triggerRef:
|
|
1330
|
-
return /* @__PURE__ */
|
|
1329
|
+
const { setIsOpen: t, triggerRef: s } = Pe();
|
|
1330
|
+
return /* @__PURE__ */ a(
|
|
1331
1331
|
"button",
|
|
1332
1332
|
{
|
|
1333
1333
|
type: "button",
|
|
1334
|
-
ref:
|
|
1334
|
+
ref: s,
|
|
1335
1335
|
className: "dropdown__trigger",
|
|
1336
1336
|
onClick: () => t((l) => !l),
|
|
1337
1337
|
"aria-haspopup": "true",
|
|
@@ -1339,9 +1339,9 @@ const xt = ({
|
|
|
1339
1339
|
}
|
|
1340
1340
|
);
|
|
1341
1341
|
}, pt = ({ children: e }) => {
|
|
1342
|
-
const { isOpen: t, contentRef:
|
|
1343
|
-
return t ? /* @__PURE__ */
|
|
1344
|
-
}, ht = ({ children: e }) => /* @__PURE__ */
|
|
1342
|
+
const { isOpen: t, contentRef: s, styles: l } = Pe();
|
|
1343
|
+
return t ? /* @__PURE__ */ a("div", { ref: s, className: "dropdown__content", style: l, children: e }) : null;
|
|
1344
|
+
}, ht = ({ children: e }) => /* @__PURE__ */ a("div", { className: "dropdown__menu", children: e }), yt = ({ as: e, children: t, ...s }) => /* @__PURE__ */ a(e || "a", { ...s, className: "dropdown__item", children: t }), vt = () => /* @__PURE__ */ a("hr", { className: "dropdown__separator" }), ae = ({ title: e, position: t = "bottom", children: s }) => {
|
|
1345
1345
|
const [l, n] = T(!1), [r, o] = T({}), u = A(null), i = A(null), c = A(null);
|
|
1346
1346
|
return et(() => {
|
|
1347
1347
|
if (l) {
|
|
@@ -1375,13 +1375,13 @@ const xt = ({
|
|
|
1375
1375
|
return document.addEventListener("mousedown", p), () => {
|
|
1376
1376
|
document.removeEventListener("mousedown", p);
|
|
1377
1377
|
};
|
|
1378
|
-
}, []), /* @__PURE__ */
|
|
1378
|
+
}, []), /* @__PURE__ */ a(Re.Provider, { value: { isOpen: l, setIsOpen: n, triggerRef: i, contentRef: c, styles: r }, children: /* @__PURE__ */ a(
|
|
1379
1379
|
"div",
|
|
1380
1380
|
{
|
|
1381
1381
|
ref: u,
|
|
1382
1382
|
className: "dropdown",
|
|
1383
1383
|
title: e,
|
|
1384
|
-
children:
|
|
1384
|
+
children: s
|
|
1385
1385
|
}
|
|
1386
1386
|
) });
|
|
1387
1387
|
};
|
|
@@ -1395,52 +1395,52 @@ const Ae = z(null), Ve = () => {
|
|
|
1395
1395
|
if (!e)
|
|
1396
1396
|
throw new Error("useTabs must be used within a Tabs provider");
|
|
1397
1397
|
return e;
|
|
1398
|
-
}, He = ({ id: e, label: t, className:
|
|
1398
|
+
}, He = ({ id: e, label: t, className: s = "" }) => {
|
|
1399
1399
|
const { activeTab: l, setActiveTab: n, variant: r, orientation: o } = Ve(), u = l === e, i = [
|
|
1400
1400
|
"clarity-tab",
|
|
1401
|
-
|
|
1401
|
+
s,
|
|
1402
1402
|
u ? "active" : "",
|
|
1403
1403
|
u ? `variant-${r}` : "",
|
|
1404
1404
|
`orientation-${o}`
|
|
1405
1405
|
].filter(Boolean).join(" ");
|
|
1406
|
-
return /* @__PURE__ */
|
|
1406
|
+
return /* @__PURE__ */ a(
|
|
1407
1407
|
"button",
|
|
1408
1408
|
{
|
|
1409
1409
|
className: i,
|
|
1410
1410
|
onClick: () => n(e),
|
|
1411
1411
|
role: "tab",
|
|
1412
1412
|
"aria-selected": u,
|
|
1413
|
-
children: /* @__PURE__ */
|
|
1413
|
+
children: /* @__PURE__ */ a("span", { className: "clarity-tab-label", children: t })
|
|
1414
1414
|
}
|
|
1415
1415
|
);
|
|
1416
1416
|
};
|
|
1417
1417
|
He.displayName = "Tabs.Tab";
|
|
1418
|
-
const Me = ({ id: e, children: t, className:
|
|
1418
|
+
const Me = ({ id: e, children: t, className: s = "" }) => {
|
|
1419
1419
|
const { activeTab: l } = Ve(), n = l === e, r = {
|
|
1420
1420
|
visibility: n ? "visible" : "hidden",
|
|
1421
1421
|
gridArea: "1 / 1"
|
|
1422
1422
|
};
|
|
1423
|
-
return n || (r.pointerEvents = "none"), /* @__PURE__ */
|
|
1423
|
+
return n || (r.pointerEvents = "none"), /* @__PURE__ */ a("div", { className: `clarity-tab-content ${s}`, role: "tabpanel", style: r, children: t });
|
|
1424
1424
|
};
|
|
1425
1425
|
Me.displayName = "Tabs.Content";
|
|
1426
1426
|
const me = ({
|
|
1427
1427
|
children: e,
|
|
1428
1428
|
defaultTab: t,
|
|
1429
|
-
variant:
|
|
1429
|
+
variant: s = "primary",
|
|
1430
1430
|
orientation: l = "horizontal",
|
|
1431
1431
|
className: n = ""
|
|
1432
1432
|
}) => {
|
|
1433
1433
|
const [r, o] = T(t), u = Y(() => ({
|
|
1434
1434
|
activeTab: r,
|
|
1435
1435
|
setActiveTab: o,
|
|
1436
|
-
variant:
|
|
1436
|
+
variant: s,
|
|
1437
1437
|
orientation: l
|
|
1438
|
-
}), [r,
|
|
1438
|
+
}), [r, s, l]), i = [
|
|
1439
1439
|
"clarity-tabs-container",
|
|
1440
1440
|
n,
|
|
1441
1441
|
`orientation-${l}`
|
|
1442
1442
|
].filter(Boolean).join(" ");
|
|
1443
|
-
return /* @__PURE__ */
|
|
1443
|
+
return /* @__PURE__ */ a(Ae.Provider, { value: u, children: /* @__PURE__ */ a("div", { className: i, children: e }) });
|
|
1444
1444
|
};
|
|
1445
1445
|
me.Tab = He;
|
|
1446
1446
|
me.Content = Me;
|
|
@@ -1448,7 +1448,7 @@ me.displayName = "Tabs";
|
|
|
1448
1448
|
const jt = ({
|
|
1449
1449
|
content: e,
|
|
1450
1450
|
position: t = "top",
|
|
1451
|
-
variant:
|
|
1451
|
+
variant: s = "primary",
|
|
1452
1452
|
product: l,
|
|
1453
1453
|
tone: n,
|
|
1454
1454
|
bgColor: r,
|
|
@@ -1464,7 +1464,7 @@ const jt = ({
|
|
|
1464
1464
|
}) => {
|
|
1465
1465
|
const [C, h] = T(!1), [N, w] = T(null), B = A(null), g = A(null), b = "clarity-tooltip", k = !!r, E = l && n && !k;
|
|
1466
1466
|
let x = "";
|
|
1467
|
-
k ? x = `${b}__content--custom-bg` : E ? x = `${b}__content--custom` : x = `${b}__content--${
|
|
1467
|
+
k ? x = `${b}__content--custom-bg` : E ? x = `${b}__content--custom` : x = `${b}__content--${s}`;
|
|
1468
1468
|
const j = [
|
|
1469
1469
|
b,
|
|
1470
1470
|
`${b}--${t}`,
|
|
@@ -1511,7 +1511,7 @@ const jt = ({
|
|
|
1511
1511
|
...d,
|
|
1512
1512
|
children: [
|
|
1513
1513
|
u,
|
|
1514
|
-
C && /* @__PURE__ */
|
|
1514
|
+
C && /* @__PURE__ */ a(
|
|
1515
1515
|
"div",
|
|
1516
1516
|
{
|
|
1517
1517
|
ref: B,
|
|
@@ -1519,7 +1519,7 @@ const jt = ({
|
|
|
1519
1519
|
style: $,
|
|
1520
1520
|
role: "tooltip",
|
|
1521
1521
|
"aria-hidden": !C,
|
|
1522
|
-
children: /* @__PURE__ */
|
|
1522
|
+
children: /* @__PURE__ */ a("div", { className: S, children: e })
|
|
1523
1523
|
}
|
|
1524
1524
|
)
|
|
1525
1525
|
]
|
|
@@ -1533,32 +1533,32 @@ const jt = ({
|
|
|
1533
1533
|
}, Fe = ({
|
|
1534
1534
|
children: e,
|
|
1535
1535
|
className: t = "",
|
|
1536
|
-
variant:
|
|
1536
|
+
variant: s = "secondary",
|
|
1537
1537
|
emptyText: l = "No results found.",
|
|
1538
1538
|
inputPlaceholder: n = "Search...",
|
|
1539
1539
|
...r
|
|
1540
1540
|
}) => {
|
|
1541
1541
|
const [o, u] = T(""), [i, c] = T(null), [p, y] = T(!1), f = [
|
|
1542
1542
|
"clarity-command",
|
|
1543
|
-
`clarity-command--${
|
|
1543
|
+
`clarity-command--${s}`,
|
|
1544
1544
|
t
|
|
1545
1545
|
].filter(Boolean).join(" "), m = Y(() => ({
|
|
1546
1546
|
searchTerm: o,
|
|
1547
1547
|
setSearchTerm: u,
|
|
1548
1548
|
value: i,
|
|
1549
1549
|
setValue: c,
|
|
1550
|
-
variant:
|
|
1550
|
+
variant: s,
|
|
1551
1551
|
texts: {
|
|
1552
1552
|
empty: l,
|
|
1553
1553
|
inputPlaceholder: n
|
|
1554
1554
|
},
|
|
1555
1555
|
isOpen: p,
|
|
1556
1556
|
setIsOpen: y
|
|
1557
|
-
}), [o, i,
|
|
1558
|
-
return /* @__PURE__ */
|
|
1557
|
+
}), [o, i, s, l, n, p]);
|
|
1558
|
+
return /* @__PURE__ */ a(We.Provider, { value: m, children: /* @__PURE__ */ a("div", { className: f, ...r, children: e }) });
|
|
1559
1559
|
};
|
|
1560
1560
|
Fe.displayName = "Command";
|
|
1561
|
-
const Ge = ({ placeholder: e = "Search...", variant: t, onClick:
|
|
1561
|
+
const Ge = ({ placeholder: e = "Search...", variant: t, onClick: s }) => {
|
|
1562
1562
|
const { setIsOpen: l, variant: n } = ee(), [r, o] = T(!1);
|
|
1563
1563
|
O(() => {
|
|
1564
1564
|
o(/Mac|iPod|iPhone|iPad/.test(navigator.platform));
|
|
@@ -1568,9 +1568,9 @@ const Ge = ({ placeholder: e = "Search...", variant: t, onClick: a }) => {
|
|
|
1568
1568
|
`clarity-command-button--${t || n}`
|
|
1569
1569
|
].filter(Boolean).join(" ");
|
|
1570
1570
|
return /* @__PURE__ */ _("button", { className: i, onClick: (p) => {
|
|
1571
|
-
l(!0),
|
|
1571
|
+
l(!0), s == null || s(p);
|
|
1572
1572
|
}, children: [
|
|
1573
|
-
/* @__PURE__ */
|
|
1573
|
+
/* @__PURE__ */ a("span", { children: e }),
|
|
1574
1574
|
/* @__PURE__ */ _("kbd", { className: "clarity-command-shortcut", children: [
|
|
1575
1575
|
r ? "⌘" : "Ctrl+",
|
|
1576
1576
|
"K"
|
|
@@ -1579,17 +1579,17 @@ const Ge = ({ placeholder: e = "Search...", variant: t, onClick: a }) => {
|
|
|
1579
1579
|
};
|
|
1580
1580
|
Ge.displayName = "Command.Button";
|
|
1581
1581
|
const Ue = ({ children: e, ...t }) => {
|
|
1582
|
-
const { isOpen:
|
|
1582
|
+
const { isOpen: s, setIsOpen: l, variant: n } = ee();
|
|
1583
1583
|
return O(() => {
|
|
1584
1584
|
const r = (o) => {
|
|
1585
|
-
o.key === "k" && (o.metaKey || o.ctrlKey) && (o.preventDefault(), l(!
|
|
1585
|
+
o.key === "k" && (o.metaKey || o.ctrlKey) && (o.preventDefault(), l(!s));
|
|
1586
1586
|
};
|
|
1587
1587
|
return document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
|
|
1588
|
-
}, [
|
|
1588
|
+
}, [s, l]), /* @__PURE__ */ a(J, { isOpen: s, onClose: () => l(!1), size: "large", closeOnOverlayClick: !0, children: /* @__PURE__ */ a("div", { className: `clarity-command--${n}`, children: e }) });
|
|
1589
1589
|
};
|
|
1590
1590
|
Ue.displayName = "Command.Dialog";
|
|
1591
1591
|
const ze = ({ className: e = "", ...t }) => {
|
|
1592
|
-
const { searchTerm:
|
|
1592
|
+
const { searchTerm: s, setSearchTerm: l, variant: n, texts: r, isOpen: o } = ee(), u = A(null);
|
|
1593
1593
|
O(() => {
|
|
1594
1594
|
var c;
|
|
1595
1595
|
o && ((c = u.current) == null || c.focus());
|
|
@@ -1599,12 +1599,12 @@ const ze = ({ className: e = "", ...t }) => {
|
|
|
1599
1599
|
`clarity-command-input--${n}`,
|
|
1600
1600
|
e
|
|
1601
1601
|
].filter(Boolean).join(" ");
|
|
1602
|
-
return /* @__PURE__ */
|
|
1602
|
+
return /* @__PURE__ */ a("div", { className: "clarity-command-input__wrapper", children: /* @__PURE__ */ a(
|
|
1603
1603
|
"input",
|
|
1604
1604
|
{
|
|
1605
1605
|
ref: u,
|
|
1606
1606
|
className: i,
|
|
1607
|
-
value:
|
|
1607
|
+
value: s,
|
|
1608
1608
|
onChange: (c) => l(c.target.value),
|
|
1609
1609
|
placeholder: t.placeholder || r.inputPlaceholder,
|
|
1610
1610
|
...t
|
|
@@ -1612,7 +1612,7 @@ const ze = ({ className: e = "", ...t }) => {
|
|
|
1612
1612
|
) });
|
|
1613
1613
|
};
|
|
1614
1614
|
ze.displayName = "Command.Input";
|
|
1615
|
-
const qe = ({ children: e, className: t = "", ...
|
|
1615
|
+
const qe = ({ children: e, className: t = "", ...s }) => {
|
|
1616
1616
|
const { searchTerm: l } = ee();
|
|
1617
1617
|
let n = !1;
|
|
1618
1618
|
const r = (i) => L.Children.toArray(i).map((c) => {
|
|
@@ -1629,35 +1629,35 @@ const qe = ({ children: e, className: t = "", ...a }) => {
|
|
|
1629
1629
|
}
|
|
1630
1630
|
return c;
|
|
1631
1631
|
}).filter(Boolean), o = r(e), u = ["clarity-command-list", t].filter(Boolean).join(" ");
|
|
1632
|
-
return /* @__PURE__ */ _("div", { className: u, ...
|
|
1632
|
+
return /* @__PURE__ */ _("div", { className: u, ...s, children: [
|
|
1633
1633
|
o,
|
|
1634
|
-
!n && /* @__PURE__ */
|
|
1634
|
+
!n && /* @__PURE__ */ a(ue, {})
|
|
1635
1635
|
] });
|
|
1636
1636
|
};
|
|
1637
1637
|
qe.displayName = "Command.List";
|
|
1638
|
-
const ue = ({ children: e, className: t = "", ...
|
|
1638
|
+
const ue = ({ children: e, className: t = "", ...s }) => {
|
|
1639
1639
|
const { texts: l } = ee(), n = ["clarity-command-empty", t].filter(Boolean).join(" ");
|
|
1640
|
-
return /* @__PURE__ */
|
|
1640
|
+
return /* @__PURE__ */ a("div", { className: n, ...s, children: e || s.emptyText || l.empty });
|
|
1641
1641
|
};
|
|
1642
1642
|
ue.displayName = "Command.Empty";
|
|
1643
|
-
const Je = ({ children: e, className: t = "", ...
|
|
1643
|
+
const Je = ({ children: e, className: t = "", ...s }) => {
|
|
1644
1644
|
const l = ["clarity-command-group", t].filter(Boolean).join(" ");
|
|
1645
|
-
return /* @__PURE__ */
|
|
1645
|
+
return /* @__PURE__ */ a("div", { className: l, ...s, children: e });
|
|
1646
1646
|
};
|
|
1647
1647
|
Je.displayName = "Command.Group";
|
|
1648
|
-
const Qe = ({ children: e, className: t = "", ...
|
|
1648
|
+
const Qe = ({ children: e, className: t = "", ...s }) => {
|
|
1649
1649
|
const { setValue: l, variant: n } = ee(), r = ["clarity-command-item", `clarity-command-item--${n}`, t].filter(Boolean).join(" ");
|
|
1650
|
-
return /* @__PURE__ */
|
|
1650
|
+
return /* @__PURE__ */ a("div", { className: r, onClick: () => l((e == null ? void 0 : e.toString()) || ""), ...s, children: e });
|
|
1651
1651
|
};
|
|
1652
1652
|
Qe.displayName = "Command.Item";
|
|
1653
1653
|
const Xe = ({ className: e = "", ...t }) => {
|
|
1654
|
-
const
|
|
1655
|
-
return /* @__PURE__ */
|
|
1654
|
+
const s = ["clarity-command-separator", e].filter(Boolean).join(" ");
|
|
1655
|
+
return /* @__PURE__ */ a("hr", { className: s, ...t });
|
|
1656
1656
|
};
|
|
1657
1657
|
Xe.displayName = "Command.Separator";
|
|
1658
|
-
const Ye = ({ children: e, className: t = "", ...
|
|
1658
|
+
const Ye = ({ children: e, className: t = "", ...s }) => {
|
|
1659
1659
|
const l = ["clarity-command-shortcut", t].filter(Boolean).join(" ");
|
|
1660
|
-
return /* @__PURE__ */
|
|
1660
|
+
return /* @__PURE__ */ a("span", { className: l, ...s, children: e });
|
|
1661
1661
|
};
|
|
1662
1662
|
Ye.displayName = "Command.Shortcut";
|
|
1663
1663
|
const Lt = Object.assign(Fe, {
|
|
@@ -1671,33 +1671,33 @@ const Lt = Object.assign(Fe, {
|
|
|
1671
1671
|
Separator: Xe,
|
|
1672
1672
|
Shortcut: Ye
|
|
1673
1673
|
}), Ct = ({ columns: e, viewMode: t }) => {
|
|
1674
|
-
const
|
|
1674
|
+
const s = Array.from({ length: 5 }, (l, n) => n);
|
|
1675
1675
|
return t === "card" ? /* @__PURE__ */ _("div", { className: "card-view-wrapper is-loading", children: [
|
|
1676
|
-
/* @__PURE__ */
|
|
1677
|
-
/* @__PURE__ */
|
|
1678
|
-
] }) : /* @__PURE__ */
|
|
1679
|
-
/* @__PURE__ */
|
|
1680
|
-
/* @__PURE__ */
|
|
1676
|
+
/* @__PURE__ */ a("div", { className: "skeleton card-view-header" }),
|
|
1677
|
+
/* @__PURE__ */ a("div", { className: "card-view-body", children: s.map((l) => /* @__PURE__ */ a("div", { className: "skeleton card-view-row" }, l)) })
|
|
1678
|
+
] }) : /* @__PURE__ */ a("div", { className: "table-wrapper is-loading", children: /* @__PURE__ */ _("table", { children: [
|
|
1679
|
+
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ a("tr", { className: "table-row", children: e.map((l) => /* @__PURE__ */ a("th", { className: "table-header-cell", children: /* @__PURE__ */ a("div", { className: "skeleton skeleton-text" }) }, l.key)) }) }),
|
|
1680
|
+
/* @__PURE__ */ a("tbody", { children: s.map((l) => /* @__PURE__ */ a("tr", { className: "table-row", children: e.map((n) => /* @__PURE__ */ a("td", { className: "table-cell", children: /* @__PURE__ */ a("div", { className: "skeleton skeleton-text" }) }, n.key)) }, l)) })
|
|
1681
1681
|
] }) });
|
|
1682
1682
|
}, Et = ({
|
|
1683
1683
|
variant: e = "secondary",
|
|
1684
1684
|
columns: t,
|
|
1685
|
-
data:
|
|
1685
|
+
data: s,
|
|
1686
1686
|
viewMode: l = "table",
|
|
1687
1687
|
isScrollable: n = !1,
|
|
1688
1688
|
isLoading: r = !1
|
|
1689
1689
|
}) => {
|
|
1690
1690
|
const [o, u] = T(null), [i, c] = T("none"), p = (d) => {
|
|
1691
1691
|
d.sortable && (o === d.key ? c((C) => C === "asc" ? "desc" : C === "desc" ? "none" : "asc") : (u(d.key), c("asc")));
|
|
1692
|
-
}, y = Y(() => i === "none" || !o ?
|
|
1692
|
+
}, y = Y(() => i === "none" || !o ? s : [...s].sort((d, C) => {
|
|
1693
1693
|
const h = d[o], N = C[o];
|
|
1694
1694
|
return h < N ? i === "asc" ? -1 : 1 : h > N ? i === "asc" ? 1 : -1 : 0;
|
|
1695
|
-
}), [
|
|
1695
|
+
}), [s, o, i]), f = (d) => d.sortable ? o !== d.key || i === "none" ? /* @__PURE__ */ a("span", { className: "sort-icon", children: "↕" }) : i === "asc" ? /* @__PURE__ */ a("span", { className: "sort-icon", children: "↑" }) : /* @__PURE__ */ a("span", { className: "sort-icon", children: "↓" }) : null;
|
|
1696
1696
|
if (r)
|
|
1697
|
-
return /* @__PURE__ */
|
|
1697
|
+
return /* @__PURE__ */ a(Ct, { columns: t, viewMode: l });
|
|
1698
1698
|
const m = `table-variant-${e} ${n ? "is-scrollable" : ""}`;
|
|
1699
1699
|
return l === "card" ? /* @__PURE__ */ _("div", { className: `card-view-wrapper ${m}`, children: [
|
|
1700
|
-
/* @__PURE__ */
|
|
1700
|
+
/* @__PURE__ */ a("div", { className: `card-view-header table-header-cell-${e}`, children: t.map((d) => /* @__PURE__ */ _(
|
|
1701
1701
|
"div",
|
|
1702
1702
|
{
|
|
1703
1703
|
className: `card-view-header-cell ${d.sortable ? "sortable" : ""}`,
|
|
@@ -1710,9 +1710,9 @@ const Lt = Object.assign(Fe, {
|
|
|
1710
1710
|
},
|
|
1711
1711
|
d.key
|
|
1712
1712
|
)) }),
|
|
1713
|
-
/* @__PURE__ */
|
|
1714
|
-
] }) : /* @__PURE__ */
|
|
1715
|
-
/* @__PURE__ */
|
|
1713
|
+
/* @__PURE__ */ a("div", { className: "card-view-body", children: y.map((d, C) => /* @__PURE__ */ a("div", { className: `card-view-row table-row-${e}`, children: t.map((h) => /* @__PURE__ */ a("div", { className: `card-view-cell ${h.align ? `table-cell-align-${h.align}` : ""}`, style: { minWidth: h.minWidth }, children: h.render ? h.render(d) : d[h.key] }, h.key)) }, C)) })
|
|
1714
|
+
] }) : /* @__PURE__ */ a("div", { className: `table-wrapper ${m}`, children: /* @__PURE__ */ _("table", { children: [
|
|
1715
|
+
/* @__PURE__ */ a("thead", { className: "table-header", children: /* @__PURE__ */ a("tr", { className: "table-row", children: t.map((d) => /* @__PURE__ */ _(
|
|
1716
1716
|
"th",
|
|
1717
1717
|
{
|
|
1718
1718
|
className: `table-header-cell ${d.sortable ? "sortable" : ""} table-header-cell-${e}`,
|
|
@@ -1725,25 +1725,25 @@ const Lt = Object.assign(Fe, {
|
|
|
1725
1725
|
},
|
|
1726
1726
|
d.key
|
|
1727
1727
|
)) }) }),
|
|
1728
|
-
/* @__PURE__ */
|
|
1728
|
+
/* @__PURE__ */ a("tbody", { children: y.map((d, C) => /* @__PURE__ */ a("tr", { className: `table-row table-row-${e}`, children: t.map((h) => /* @__PURE__ */ a("td", { className: `table-cell ${h.align ? `table-cell-align-${h.align}` : ""}`, style: { minWidth: h.minWidth }, children: h.render ? h.render(d) : d[h.key] }, h.key)) }, C)) })
|
|
1729
1729
|
] }) });
|
|
1730
1730
|
}, It = ({
|
|
1731
1731
|
variant: e = "primary",
|
|
1732
1732
|
product: t,
|
|
1733
|
-
tone:
|
|
1733
|
+
tone: s,
|
|
1734
1734
|
size: l = "medium",
|
|
1735
1735
|
color: n,
|
|
1736
1736
|
className: r = "",
|
|
1737
1737
|
"aria-label": o = "Carregando...",
|
|
1738
1738
|
...u
|
|
1739
1739
|
}) => {
|
|
1740
|
-
const i = "clarity-spinner", y = n ? `${i}--custom` : t &&
|
|
1740
|
+
const i = "clarity-spinner", y = n ? `${i}--custom` : t && s ? `${i}--custom` : `${i}--${e}`, f = [
|
|
1741
1741
|
i,
|
|
1742
1742
|
`${i}--${l}`,
|
|
1743
1743
|
y,
|
|
1744
1744
|
r
|
|
1745
1745
|
].filter(Boolean).join(" "), m = {};
|
|
1746
|
-
return n ? m["--spinner-color"] = n : t &&
|
|
1746
|
+
return n ? m["--spinner-color"] = n : t && s && (m["--spinner-color"] = `var(--clarity-${t}-${s})`), /* @__PURE__ */ a(
|
|
1747
1747
|
"div",
|
|
1748
1748
|
{
|
|
1749
1749
|
className: f,
|
|
@@ -1751,13 +1751,13 @@ const Lt = Object.assign(Fe, {
|
|
|
1751
1751
|
role: "status",
|
|
1752
1752
|
"aria-label": o,
|
|
1753
1753
|
...u,
|
|
1754
|
-
children: /* @__PURE__ */
|
|
1754
|
+
children: /* @__PURE__ */ a("div", { className: `${i}__container`, children: /* @__PURE__ */ a(
|
|
1755
1755
|
"svg",
|
|
1756
1756
|
{
|
|
1757
1757
|
className: `${i}__svg`,
|
|
1758
1758
|
viewBox: "0 0 50 50",
|
|
1759
1759
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1760
|
-
children: /* @__PURE__ */
|
|
1760
|
+
children: /* @__PURE__ */ a(
|
|
1761
1761
|
"circle",
|
|
1762
1762
|
{
|
|
1763
1763
|
className: `${i}__circle`,
|