beth-clarity 1.1.14 → 1.1.16
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.
|
@@ -7,10 +7,10 @@ const wt = ({
|
|
|
7
7
|
tone: a,
|
|
8
8
|
size: l = "medium",
|
|
9
9
|
bgColor: n,
|
|
10
|
-
textColor:
|
|
10
|
+
textColor: r,
|
|
11
11
|
children: c,
|
|
12
12
|
className: f = "",
|
|
13
|
-
rounded:
|
|
13
|
+
rounded: i = !1,
|
|
14
14
|
outlined: o = !1,
|
|
15
15
|
...d
|
|
16
16
|
}) => {
|
|
@@ -21,11 +21,11 @@ const wt = ({
|
|
|
21
21
|
v,
|
|
22
22
|
u,
|
|
23
23
|
`${v}--${l}`,
|
|
24
|
-
|
|
24
|
+
i ? `${v}--rounded` : "",
|
|
25
25
|
o ? `${v}--outlined` : "",
|
|
26
26
|
f
|
|
27
27
|
].filter(Boolean).join(" "), y = {};
|
|
28
|
-
m && (y.backgroundColor = n,
|
|
28
|
+
m && (y.backgroundColor = n, r && (y.color = r));
|
|
29
29
|
const b = p && t && a ? {
|
|
30
30
|
"--custom-bg-color": `var(--clarity-${t}-${a})`,
|
|
31
31
|
"--custom-text-color": a && parseInt(a) >= 500 ? "white" : `var(--clarity-${t}-800)`
|
|
@@ -48,10 +48,10 @@ const wt = ({
|
|
|
48
48
|
disabled: a = !1,
|
|
49
49
|
loading: l = !1,
|
|
50
50
|
children: n,
|
|
51
|
-
onClick:
|
|
51
|
+
onClick: r,
|
|
52
52
|
type: c = "button",
|
|
53
53
|
className: f = "",
|
|
54
|
-
title:
|
|
54
|
+
title: i,
|
|
55
55
|
customColor: o,
|
|
56
56
|
customColorHover: d,
|
|
57
57
|
...v
|
|
@@ -70,9 +70,9 @@ const wt = ({
|
|
|
70
70
|
className: p,
|
|
71
71
|
style: u,
|
|
72
72
|
disabled: a || l,
|
|
73
|
-
onClick:
|
|
73
|
+
onClick: r,
|
|
74
74
|
type: c,
|
|
75
|
-
title:
|
|
75
|
+
title: i,
|
|
76
76
|
...v,
|
|
77
77
|
children: [
|
|
78
78
|
l && /* @__PURE__ */ s("div", { className: `${m}__spinner` }),
|
|
@@ -86,10 +86,10 @@ const wt = ({
|
|
|
86
86
|
filled: a = !0,
|
|
87
87
|
items: l,
|
|
88
88
|
value: n,
|
|
89
|
-
multiple:
|
|
89
|
+
multiple: r = !1,
|
|
90
90
|
disabled: c = !1,
|
|
91
91
|
onChange: f,
|
|
92
|
-
className:
|
|
92
|
+
className: i = "",
|
|
93
93
|
...o
|
|
94
94
|
}) => {
|
|
95
95
|
const d = "clarity-button-group", v = `${d}--${e}`, m = [
|
|
@@ -98,17 +98,17 @@ const wt = ({
|
|
|
98
98
|
`${d}--${t}`,
|
|
99
99
|
!a && `${d}--outline`,
|
|
100
100
|
c && `${d}--disabled`,
|
|
101
|
-
|
|
101
|
+
i
|
|
102
102
|
].filter(Boolean).join(" "), p = (h) => {
|
|
103
103
|
if (c || !f) return;
|
|
104
104
|
const y = l.find((b) => b.id === h);
|
|
105
105
|
if (!(y != null && y.disabled))
|
|
106
|
-
if (
|
|
106
|
+
if (r) {
|
|
107
107
|
const b = Array.isArray(n) ? n : [], _ = b.includes(h) ? b.filter((B) => B !== h) : [...b, h];
|
|
108
108
|
f(_);
|
|
109
109
|
} else
|
|
110
110
|
f(h);
|
|
111
|
-
}, u = (h) =>
|
|
111
|
+
}, u = (h) => r ? Array.isArray(n) && n.includes(h) : n === h;
|
|
112
112
|
return /* @__PURE__ */ s(
|
|
113
113
|
"div",
|
|
114
114
|
{
|
|
@@ -147,10 +147,10 @@ const wt = ({
|
|
|
147
147
|
label: a,
|
|
148
148
|
helperText: l,
|
|
149
149
|
error: n = !1,
|
|
150
|
-
errorMessage:
|
|
150
|
+
errorMessage: r,
|
|
151
151
|
startIcon: c,
|
|
152
152
|
endIcon: f,
|
|
153
|
-
className:
|
|
153
|
+
className: i = "",
|
|
154
154
|
disabled: o = !1,
|
|
155
155
|
value: d,
|
|
156
156
|
defaultValue: v,
|
|
@@ -178,7 +178,7 @@ const wt = ({
|
|
|
178
178
|
_ && "clarity-input--has-value",
|
|
179
179
|
c && "clarity-input--with-start-icon",
|
|
180
180
|
f && "clarity-input--with-end-icon",
|
|
181
|
-
|
|
181
|
+
i
|
|
182
182
|
].filter(Boolean).join(" ");
|
|
183
183
|
return /* @__PURE__ */ C("div", { className: "clarity-input-wrapper", children: [
|
|
184
184
|
/* @__PURE__ */ C("div", { className: L, children: [
|
|
@@ -201,7 +201,7 @@ const wt = ({
|
|
|
201
201
|
] }),
|
|
202
202
|
f && /* @__PURE__ */ s("div", { className: "clarity-input__end-icon", children: f })
|
|
203
203
|
] }),
|
|
204
|
-
(l || n &&
|
|
204
|
+
(l || n && r) && /* @__PURE__ */ s("div", { className: "clarity-input__helper-text", children: n && r ? r : l })
|
|
205
205
|
] });
|
|
206
206
|
});
|
|
207
207
|
st.displayName = "Input";
|
|
@@ -211,10 +211,10 @@ const at = E.forwardRef(({
|
|
|
211
211
|
label: a,
|
|
212
212
|
helperText: l,
|
|
213
213
|
error: n = !1,
|
|
214
|
-
errorMessage:
|
|
214
|
+
errorMessage: r,
|
|
215
215
|
startIcon: c,
|
|
216
216
|
endIcon: f,
|
|
217
|
-
className:
|
|
217
|
+
className: i = "",
|
|
218
218
|
disabled: o = !1,
|
|
219
219
|
value: d,
|
|
220
220
|
defaultValue: v,
|
|
@@ -246,7 +246,7 @@ const at = E.forwardRef(({
|
|
|
246
246
|
$ && "clarity-textarea--has-value",
|
|
247
247
|
c && "clarity-textarea--with-start-icon",
|
|
248
248
|
f && "clarity-textarea--with-end-icon",
|
|
249
|
-
|
|
249
|
+
i
|
|
250
250
|
].filter(Boolean).join(" "), O = {
|
|
251
251
|
resize: b ? "vertical" : "none",
|
|
252
252
|
minHeight: h ? `${h}px` : void 0,
|
|
@@ -275,7 +275,7 @@ const at = E.forwardRef(({
|
|
|
275
275
|
] }),
|
|
276
276
|
f && /* @__PURE__ */ s("div", { className: "clarity-textarea__end-icon", children: f })
|
|
277
277
|
] }),
|
|
278
|
-
(l || n &&
|
|
278
|
+
(l || n && r) && /* @__PURE__ */ s("div", { className: "clarity-textarea__helper-text", children: n && r ? r : l })
|
|
279
279
|
] });
|
|
280
280
|
});
|
|
281
281
|
at.displayName = "Textarea";
|
|
@@ -285,10 +285,10 @@ const lt = E.forwardRef(({
|
|
|
285
285
|
label: a,
|
|
286
286
|
helperText: l,
|
|
287
287
|
error: n = !1,
|
|
288
|
-
errorMessage:
|
|
288
|
+
errorMessage: r,
|
|
289
289
|
startIcon: c,
|
|
290
290
|
endIcon: f,
|
|
291
|
-
className:
|
|
291
|
+
className: i = "",
|
|
292
292
|
disabled: o = !1,
|
|
293
293
|
value: d,
|
|
294
294
|
defaultValue: v,
|
|
@@ -338,7 +338,7 @@ const lt = E.forwardRef(({
|
|
|
338
338
|
_ && "clarity-select--searchable",
|
|
339
339
|
c && "clarity-select--with-start-icon",
|
|
340
340
|
(f || b) && "clarity-select--with-end-icon",
|
|
341
|
-
|
|
341
|
+
i
|
|
342
342
|
].filter(Boolean).join(" ");
|
|
343
343
|
return /* @__PURE__ */ C("div", { className: "clarity-select-wrapper", children: [
|
|
344
344
|
/* @__PURE__ */ C(
|
|
@@ -447,7 +447,7 @@ const lt = E.forwardRef(({
|
|
|
447
447
|
]
|
|
448
448
|
}
|
|
449
449
|
),
|
|
450
|
-
(l || n &&
|
|
450
|
+
(l || n && r) && /* @__PURE__ */ s("div", { className: "clarity-select__helper-text", children: n && r ? r : l })
|
|
451
451
|
] });
|
|
452
452
|
});
|
|
453
453
|
lt.displayName = "Select";
|
|
@@ -457,10 +457,10 @@ const nt = Ke(({
|
|
|
457
457
|
onChange: a,
|
|
458
458
|
placeholder: l = "Selecione opções",
|
|
459
459
|
label: n,
|
|
460
|
-
helperText:
|
|
460
|
+
helperText: r,
|
|
461
461
|
error: c = !1,
|
|
462
462
|
errorMessage: f,
|
|
463
|
-
disabled:
|
|
463
|
+
disabled: i = !1,
|
|
464
464
|
variant: o = "primary",
|
|
465
465
|
size: d = "medium",
|
|
466
466
|
maxSelectedLabels: v = 3,
|
|
@@ -484,23 +484,23 @@ const nt = Ke(({
|
|
|
484
484
|
const H = e.filter(
|
|
485
485
|
(N) => N.label.toLowerCase().includes($.toLowerCase())
|
|
486
486
|
), V = () => {
|
|
487
|
-
|
|
487
|
+
i || (w(!T), j(!T), T ? L("") : setTimeout(() => {
|
|
488
488
|
var N;
|
|
489
489
|
(N = A.current) == null || N.focus();
|
|
490
490
|
}, 100));
|
|
491
491
|
}, F = (N, D) => {
|
|
492
|
-
if (
|
|
492
|
+
if (i)
|
|
493
493
|
return;
|
|
494
494
|
D && (D.stopPropagation(), D.preventDefault());
|
|
495
495
|
const U = t.includes(N);
|
|
496
496
|
let R;
|
|
497
497
|
U ? R = t.filter((se) => se !== N) : R = [...t, N], a && a(R);
|
|
498
498
|
}, X = (N, D) => {
|
|
499
|
-
if (D.stopPropagation(),
|
|
499
|
+
if (D.stopPropagation(), i) return;
|
|
500
500
|
const U = t.filter((R) => R !== N);
|
|
501
501
|
a == null || a(U);
|
|
502
502
|
}, te = (N) => {
|
|
503
|
-
N.stopPropagation(), !
|
|
503
|
+
N.stopPropagation(), !i && (a == null || a([]));
|
|
504
504
|
}, G = (N) => {
|
|
505
505
|
L(N.target.value);
|
|
506
506
|
}, M = (N) => {
|
|
@@ -513,7 +513,7 @@ const nt = Ke(({
|
|
|
513
513
|
return /* @__PURE__ */ C("div", { className: "clarity-multiselect__chips", children: [
|
|
514
514
|
D.map((R) => /* @__PURE__ */ C("div", { className: "clarity-multiselect__chip", children: [
|
|
515
515
|
/* @__PURE__ */ s("span", { className: "clarity-multiselect__chip-label", children: R.label }),
|
|
516
|
-
!
|
|
516
|
+
!i && /* @__PURE__ */ s(
|
|
517
517
|
"button",
|
|
518
518
|
{
|
|
519
519
|
type: "button",
|
|
@@ -541,7 +541,7 @@ const nt = Ke(({
|
|
|
541
541
|
k && "clarity-multiselect--focused",
|
|
542
542
|
le && "clarity-multiselect--label-up",
|
|
543
543
|
c && "clarity-multiselect--error",
|
|
544
|
-
|
|
544
|
+
i && "clarity-multiselect--disabled",
|
|
545
545
|
t.length > 0 && "clarity-multiselect--has-value"
|
|
546
546
|
].filter(Boolean).join(" ");
|
|
547
547
|
return /* @__PURE__ */ C("div", { className: re, children: [
|
|
@@ -565,7 +565,7 @@ const nt = Ke(({
|
|
|
565
565
|
] }),
|
|
566
566
|
/* @__PURE__ */ s("div", { className: "clarity-multiselect__content", children: t.length > 0 ? ie() : /* @__PURE__ */ s("span", { className: "clarity-multiselect__placeholder", children: l }) }),
|
|
567
567
|
/* @__PURE__ */ C("div", { className: "clarity-multiselect__icons", children: [
|
|
568
|
-
t.length > 0 && !
|
|
568
|
+
t.length > 0 && !i && /* @__PURE__ */ s(
|
|
569
569
|
"button",
|
|
570
570
|
{
|
|
571
571
|
type: "button",
|
|
@@ -603,7 +603,7 @@ const nt = Ke(({
|
|
|
603
603
|
}
|
|
604
604
|
) }),
|
|
605
605
|
/* @__PURE__ */ s("ul", { className: "clarity-multiselect__options", children: H.length > 0 ? H.map((N) => {
|
|
606
|
-
const D = t.includes(N.value), U = N.disabled ||
|
|
606
|
+
const D = t.includes(N.value), U = N.disabled || i;
|
|
607
607
|
return /* @__PURE__ */ C(
|
|
608
608
|
"li",
|
|
609
609
|
{
|
|
@@ -637,7 +637,7 @@ const nt = Ke(({
|
|
|
637
637
|
]
|
|
638
638
|
}
|
|
639
639
|
),
|
|
640
|
-
(
|
|
640
|
+
(r || c && f) && /* @__PURE__ */ s("div", { className: "clarity-multiselect__helper", children: c && f ? /* @__PURE__ */ s("span", { className: "clarity-multiselect__error-message", children: f }) : r && /* @__PURE__ */ s("span", { className: "clarity-multiselect__helper-text", children: r }) })
|
|
641
641
|
] });
|
|
642
642
|
});
|
|
643
643
|
nt.displayName = "MultiSelect";
|
|
@@ -651,7 +651,7 @@ const fe = z(null), pe = () => {
|
|
|
651
651
|
className: t = "",
|
|
652
652
|
title: a
|
|
653
653
|
}) => {
|
|
654
|
-
const { onClose: l, variant: n, showCloseButton:
|
|
654
|
+
const { onClose: l, variant: n, showCloseButton: r } = pe(), c = [
|
|
655
655
|
"clarity-modal-header",
|
|
656
656
|
t,
|
|
657
657
|
n && `clarity-modal-header--${n}`
|
|
@@ -662,8 +662,8 @@ const fe = z(null), pe = () => {
|
|
|
662
662
|
return /* @__PURE__ */ C("div", { className: c, children: [
|
|
663
663
|
a && /* @__PURE__ */ s("h2", { className: "clarity-modal-title", children: a }),
|
|
664
664
|
e,
|
|
665
|
-
|
|
666
|
-
|
|
665
|
+
r && /* @__PURE__ */ s("button", { className: f, onClick: (i) => {
|
|
666
|
+
i.stopPropagation(), l();
|
|
667
667
|
}, children: "×" })
|
|
668
668
|
] });
|
|
669
669
|
};
|
|
@@ -675,12 +675,11 @@ const ve = ({ children: e, className: t = "" }) => /* @__PURE__ */ C("div", { cl
|
|
|
675
675
|
e
|
|
676
676
|
] });
|
|
677
677
|
ve.displayName = "Modal.Footer";
|
|
678
|
-
const Ne = ({ children: e, onClick: t
|
|
679
|
-
onClick: (
|
|
680
|
-
var
|
|
681
|
-
t == null || t(), (
|
|
682
|
-
}
|
|
683
|
-
variant: a
|
|
678
|
+
const Ne = ({ children: e, onClick: t }) => W(e, {
|
|
679
|
+
onClick: (a) => {
|
|
680
|
+
var l, n;
|
|
681
|
+
t == null || t(), (n = (l = e.props).onClick) == null || n.call(l, a);
|
|
682
|
+
}
|
|
684
683
|
});
|
|
685
684
|
Ne.displayName = "Modal.Trigger";
|
|
686
685
|
const be = ({ children: e }) => {
|
|
@@ -699,10 +698,10 @@ const J = ({
|
|
|
699
698
|
onOpen: a,
|
|
700
699
|
children: l,
|
|
701
700
|
className: n = "",
|
|
702
|
-
variant:
|
|
701
|
+
variant: r,
|
|
703
702
|
size: c = "medium",
|
|
704
703
|
showCloseButton: f = !0,
|
|
705
|
-
closeOnOverlayClick:
|
|
704
|
+
closeOnOverlayClick: i = !0
|
|
706
705
|
}) => {
|
|
707
706
|
const [o, d] = x(!1), m = e !== void 0 ? e : o, p = t || (() => {
|
|
708
707
|
d(!1);
|
|
@@ -718,14 +717,14 @@ const J = ({
|
|
|
718
717
|
};
|
|
719
718
|
}, [m, p]);
|
|
720
719
|
const u = (_) => {
|
|
721
|
-
|
|
720
|
+
i && _.target === _.currentTarget && p();
|
|
722
721
|
}, h = E.Children.toArray(l).find(
|
|
723
722
|
(_) => Z(_) && _.type.displayName === "Modal.Trigger"
|
|
724
723
|
), y = E.Children.toArray(l).filter(
|
|
725
724
|
(_) => Z(_) && _.type.displayName !== "Modal.Trigger"
|
|
726
725
|
), b = ["clarity-modal", n, `clarity-modal--${c}`].filter(Boolean).join(" ");
|
|
727
|
-
return /* @__PURE__ */ C(fe.Provider, { value: { onClose: p, variant:
|
|
728
|
-
h && W(h, { onClick: () => d(!0)
|
|
726
|
+
return /* @__PURE__ */ C(fe.Provider, { value: { onClose: p, variant: r, showCloseButton: f }, children: [
|
|
727
|
+
h && W(h, { onClick: () => d(!0) }),
|
|
729
728
|
m && /* @__PURE__ */ s("div", { className: "clarity-modal-overlay", onClick: u, children: /* @__PURE__ */ s("div", { className: b, children: y }) })
|
|
730
729
|
] });
|
|
731
730
|
};
|
|
@@ -740,7 +739,7 @@ const Ce = z(void 0), kt = () => {
|
|
|
740
739
|
if (!e)
|
|
741
740
|
throw new Error("useToast must be used within a ToastProvider");
|
|
742
741
|
return e;
|
|
743
|
-
}, it = ({ id: e, message: t, variant: a, duration: l, onClose: n, invertColors:
|
|
742
|
+
}, it = ({ id: e, message: t, variant: a, duration: l, onClose: n, invertColors: r }) => {
|
|
744
743
|
const [c, f] = x("entering");
|
|
745
744
|
S(() => {
|
|
746
745
|
const o = setTimeout(() => {
|
|
@@ -754,13 +753,13 @@ const Ce = z(void 0), kt = () => {
|
|
|
754
753
|
clearTimeout(o), clearTimeout(d), clearTimeout(v);
|
|
755
754
|
};
|
|
756
755
|
}, [e, l, n]);
|
|
757
|
-
const
|
|
756
|
+
const i = [
|
|
758
757
|
"cl-toast",
|
|
759
758
|
a,
|
|
760
|
-
|
|
759
|
+
r ? "colored-background" : "",
|
|
761
760
|
`cl-toast-${c}`
|
|
762
761
|
].filter(Boolean).join(" ");
|
|
763
|
-
return /* @__PURE__ */ C("div", { className:
|
|
762
|
+
return /* @__PURE__ */ C("div", { className: i, children: [
|
|
764
763
|
/* @__PURE__ */ s("div", { className: "cl-toast-message", children: t }),
|
|
765
764
|
/* @__PURE__ */ s("button", { onClick: () => f("exiting"), className: "cl-toast-close-button", children: "×" }),
|
|
766
765
|
/* @__PURE__ */ s(
|
|
@@ -774,8 +773,8 @@ const Ce = z(void 0), kt = () => {
|
|
|
774
773
|
}, xt = ({ children: e }) => {
|
|
775
774
|
const [t, a] = x([]), l = Y(() => {
|
|
776
775
|
if (typeof document < "u") {
|
|
777
|
-
const
|
|
778
|
-
return
|
|
776
|
+
const i = document.createElement("div");
|
|
777
|
+
return i.id = "toast-portal-root", i;
|
|
779
778
|
}
|
|
780
779
|
return null;
|
|
781
780
|
}, []);
|
|
@@ -785,24 +784,24 @@ const Ce = z(void 0), kt = () => {
|
|
|
785
784
|
document.body.removeChild(l);
|
|
786
785
|
};
|
|
787
786
|
}, [l]);
|
|
788
|
-
const n = ne((
|
|
787
|
+
const n = ne((i) => {
|
|
789
788
|
const d = {
|
|
790
789
|
id: (/* @__PURE__ */ new Date()).toISOString() + Math.random(),
|
|
791
790
|
// duration: 5,
|
|
792
791
|
// position: 'right-top',
|
|
793
|
-
...
|
|
792
|
+
...i
|
|
794
793
|
};
|
|
795
794
|
a((v) => {
|
|
796
795
|
const m = [d, ...v];
|
|
797
796
|
return m.length > 4 ? m.slice(0, 4) : m;
|
|
798
797
|
});
|
|
799
|
-
}, []),
|
|
800
|
-
a((o) => o.filter((d) => d.id !==
|
|
801
|
-
}, []), c = Y(() => t.reduce((
|
|
798
|
+
}, []), r = ne((i) => {
|
|
799
|
+
a((o) => o.filter((d) => d.id !== i));
|
|
800
|
+
}, []), c = Y(() => t.reduce((i, o) => (i[o.position] || (i[o.position] = []), i[o.position].push(o), i), {}), [t]), f = Y(() => ({ show: n }), [n]);
|
|
802
801
|
return /* @__PURE__ */ C(Ce.Provider, { value: f, children: [
|
|
803
802
|
e,
|
|
804
803
|
l && tt.createPortal(
|
|
805
|
-
Object.entries(c).map(([
|
|
804
|
+
Object.entries(c).map(([i, o]) => /* @__PURE__ */ s("div", { className: `cl-toast-container ${i}`, children: o.map((d) => /* @__PURE__ */ s(it, { ...d, onClose: r }, d.id)) }, i)),
|
|
806
805
|
l
|
|
807
806
|
)
|
|
808
807
|
] });
|
|
@@ -815,18 +814,18 @@ const Ce = z(void 0), kt = () => {
|
|
|
815
814
|
children: e,
|
|
816
815
|
className: t = ""
|
|
817
816
|
}) => {
|
|
818
|
-
const { onClose: a, variant: l, showCloseButton: n, title:
|
|
817
|
+
const { onClose: a, variant: l, showCloseButton: n, title: r } = we(), c = [
|
|
819
818
|
"clarity-offcanvas-header",
|
|
820
819
|
t
|
|
821
820
|
].filter(Boolean).join(" "), f = [
|
|
822
821
|
"clarity-offcanvas-close",
|
|
823
822
|
l && `clarity-offcanvas-close--${l}`
|
|
824
|
-
].filter(Boolean).join(" "),
|
|
823
|
+
].filter(Boolean).join(" "), i = [
|
|
825
824
|
"clarity-offcanvas-title",
|
|
826
825
|
l && `clarity-offcanvas-title--${l}`
|
|
827
826
|
].filter(Boolean).join(" ");
|
|
828
827
|
return /* @__PURE__ */ C("div", { className: c, children: [
|
|
829
|
-
|
|
828
|
+
r && /* @__PURE__ */ s("h2", { className: i, children: r }),
|
|
830
829
|
e,
|
|
831
830
|
n && /* @__PURE__ */ s("button", { className: f, onClick: (o) => {
|
|
832
831
|
o.stopPropagation(), a();
|
|
@@ -838,8 +837,8 @@ const $e = ({ children: e, className: t = "" }) => /* @__PURE__ */ s("div", { cl
|
|
|
838
837
|
$e.displayName = "Offcanvas.Content";
|
|
839
838
|
const ke = ({ children: e, onClick: t, variant: a }) => W(e, {
|
|
840
839
|
onClick: (l) => {
|
|
841
|
-
var n,
|
|
842
|
-
t == null || t(), (
|
|
840
|
+
var n, r;
|
|
841
|
+
t == null || t(), (r = (n = e.props).onClick) == null || r.call(n, l);
|
|
843
842
|
},
|
|
844
843
|
variant: a
|
|
845
844
|
});
|
|
@@ -862,10 +861,10 @@ const K = ({
|
|
|
862
861
|
onOpen: a,
|
|
863
862
|
children: l,
|
|
864
863
|
className: n = "",
|
|
865
|
-
variant:
|
|
864
|
+
variant: r,
|
|
866
865
|
placement: c = "right",
|
|
867
866
|
closeOnOverlayClick: f = !0,
|
|
868
|
-
showCloseButton:
|
|
867
|
+
showCloseButton: i = !0,
|
|
869
868
|
title: o
|
|
870
869
|
}) => {
|
|
871
870
|
const [d, v] = x(!1), [m, p] = x(!1), [u, h] = x(!1), y = e !== void 0, b = y ? e : d, _ = ne(() => {
|
|
@@ -920,14 +919,14 @@ const K = ({
|
|
|
920
919
|
"clarity-offcanvas",
|
|
921
920
|
n,
|
|
922
921
|
`clarity-offcanvas--${c}`,
|
|
923
|
-
|
|
922
|
+
r && `clarity-offcanvas--${r}`,
|
|
924
923
|
m ? "clarity-offcanvas--open" : "clarity-offcanvas--closed"
|
|
925
924
|
].filter(Boolean).join(" "), O = [
|
|
926
925
|
"clarity-offcanvas-overlay",
|
|
927
926
|
m ? "clarity-offcanvas-overlay--visible" : ""
|
|
928
927
|
].filter(Boolean).join(" ");
|
|
929
|
-
return /* @__PURE__ */ C(_e.Provider, { value: { onClose: _, variant:
|
|
930
|
-
$ && W($, { onClick: B, variant:
|
|
928
|
+
return /* @__PURE__ */ C(_e.Provider, { value: { onClose: _, variant: r, showCloseButton: i, placement: c, title: o }, children: [
|
|
929
|
+
$ && W($, { onClick: B, variant: r }),
|
|
931
930
|
u && // Only render if shouldRender is true
|
|
932
931
|
/* @__PURE__ */ s("div", { className: O, onClick: T, children: /* @__PURE__ */ C("div", { className: A, children: [
|
|
933
932
|
L,
|
|
@@ -950,10 +949,10 @@ const rt = E.forwardRef(({
|
|
|
950
949
|
size: a = "medium",
|
|
951
950
|
label: l,
|
|
952
951
|
helperText: n,
|
|
953
|
-
error:
|
|
952
|
+
error: r = !1,
|
|
954
953
|
errorMessage: c,
|
|
955
954
|
labelPosition: f = "right",
|
|
956
|
-
className:
|
|
955
|
+
className: i = "",
|
|
957
956
|
disabled: o = !1,
|
|
958
957
|
checked: d,
|
|
959
958
|
id: v,
|
|
@@ -963,15 +962,15 @@ const rt = E.forwardRef(({
|
|
|
963
962
|
"clarity-check-input-wrapper",
|
|
964
963
|
`clarity-check-input-wrapper--${f}`,
|
|
965
964
|
o && "clarity-check-input-wrapper--disabled",
|
|
966
|
-
|
|
965
|
+
r && "clarity-check-input-wrapper--error"
|
|
967
966
|
].filter(Boolean).join(" "), y = [
|
|
968
967
|
"clarity-check-input",
|
|
969
968
|
`clarity-check-input--${e}`,
|
|
970
969
|
`clarity-check-input--${a}`,
|
|
971
970
|
t && `clarity-check-input--${t}`,
|
|
972
|
-
|
|
971
|
+
r && "clarity-check-input--error",
|
|
973
972
|
o && "clarity-check-input--disabled",
|
|
974
|
-
|
|
973
|
+
i
|
|
975
974
|
].filter(Boolean).join(" "), b = [
|
|
976
975
|
"clarity-check-input__label",
|
|
977
976
|
`clarity-check-input__label--${a}`,
|
|
@@ -1015,7 +1014,7 @@ const rt = E.forwardRef(({
|
|
|
1015
1014
|
] }),
|
|
1016
1015
|
l && /* @__PURE__ */ s("span", { className: b, children: l })
|
|
1017
1016
|
] }),
|
|
1018
|
-
(n ||
|
|
1017
|
+
(n || r && c) && /* @__PURE__ */ s("div", { className: "clarity-check-input__helper-text", children: r && c ? c : n })
|
|
1019
1018
|
] });
|
|
1020
1019
|
});
|
|
1021
1020
|
rt.displayName = "CheckInput";
|
|
@@ -1025,10 +1024,10 @@ const ot = E.forwardRef(({
|
|
|
1025
1024
|
label: a,
|
|
1026
1025
|
helperText: l,
|
|
1027
1026
|
error: n = !1,
|
|
1028
|
-
errorMessage:
|
|
1027
|
+
errorMessage: r,
|
|
1029
1028
|
labelPosition: c = "right",
|
|
1030
1029
|
className: f = "",
|
|
1031
|
-
disabled:
|
|
1030
|
+
disabled: i = !1,
|
|
1032
1031
|
checked: o,
|
|
1033
1032
|
id: d,
|
|
1034
1033
|
...v
|
|
@@ -1036,19 +1035,19 @@ const ot = E.forwardRef(({
|
|
|
1036
1035
|
const p = d || `input-switch-${Math.random().toString(36).substr(2, 9)}`, u = [
|
|
1037
1036
|
"clarity-input-switch-wrapper",
|
|
1038
1037
|
`clarity-input-switch-wrapper--${c}`,
|
|
1039
|
-
|
|
1038
|
+
i && "clarity-input-switch-wrapper--disabled",
|
|
1040
1039
|
n && "clarity-input-switch-wrapper--error"
|
|
1041
1040
|
].filter(Boolean).join(" "), h = [
|
|
1042
1041
|
"clarity-input-switch",
|
|
1043
1042
|
`clarity-input-switch--${t}`,
|
|
1044
1043
|
e && `clarity-input-switch--${e}`,
|
|
1045
1044
|
n && "clarity-input-switch--error",
|
|
1046
|
-
|
|
1045
|
+
i && "clarity-input-switch--disabled",
|
|
1047
1046
|
f
|
|
1048
1047
|
].filter(Boolean).join(" "), y = [
|
|
1049
1048
|
"clarity-input-switch__label",
|
|
1050
1049
|
`clarity-input-switch__label--${t}`,
|
|
1051
|
-
|
|
1050
|
+
i && "clarity-input-switch__label--disabled"
|
|
1052
1051
|
].filter(Boolean).join(" ");
|
|
1053
1052
|
return /* @__PURE__ */ C("div", { className: "clarity-input-switch-container", children: [
|
|
1054
1053
|
/* @__PURE__ */ C("label", { className: u, htmlFor: p, children: [
|
|
@@ -1059,7 +1058,7 @@ const ot = E.forwardRef(({
|
|
|
1059
1058
|
id: p,
|
|
1060
1059
|
type: "checkbox",
|
|
1061
1060
|
className: h,
|
|
1062
|
-
disabled:
|
|
1061
|
+
disabled: i,
|
|
1063
1062
|
checked: o,
|
|
1064
1063
|
...v
|
|
1065
1064
|
}
|
|
@@ -1067,7 +1066,7 @@ const ot = E.forwardRef(({
|
|
|
1067
1066
|
/* @__PURE__ */ s("div", { className: "clarity-input-switch__track", children: /* @__PURE__ */ s("div", { className: "clarity-input-switch__thumb" }) }),
|
|
1068
1067
|
a && /* @__PURE__ */ s("span", { className: y, children: a })
|
|
1069
1068
|
] }),
|
|
1070
|
-
(l || n &&
|
|
1069
|
+
(l || n && r) && /* @__PURE__ */ s("div", { className: "clarity-input-switch__helper-text", children: n && r ? r : l })
|
|
1071
1070
|
] });
|
|
1072
1071
|
});
|
|
1073
1072
|
ot.displayName = "InputSwitch";
|
|
@@ -1119,7 +1118,7 @@ const Q = ({
|
|
|
1119
1118
|
variant: l = "clarity-primary",
|
|
1120
1119
|
children: n
|
|
1121
1120
|
}) => {
|
|
1122
|
-
const [
|
|
1121
|
+
const [r, c] = x(!1), f = e !== void 0, i = f ? e : r, o = () => {
|
|
1123
1122
|
f || c(!0);
|
|
1124
1123
|
}, d = () => {
|
|
1125
1124
|
t ? t() : c(!1);
|
|
@@ -1130,10 +1129,10 @@ const Q = ({
|
|
|
1130
1129
|
const h = (y) => {
|
|
1131
1130
|
y.key === "Escape" && d();
|
|
1132
1131
|
};
|
|
1133
|
-
return
|
|
1132
|
+
return i ? (document.addEventListener("keydown", h), document.body.style.overflow = "hidden") : document.body.style.overflow = "unset", () => {
|
|
1134
1133
|
document.removeEventListener("keydown", h), document.body.style.overflow = "unset";
|
|
1135
1134
|
};
|
|
1136
|
-
}, [
|
|
1135
|
+
}, [i, d]);
|
|
1137
1136
|
const m = E.Children.toArray(n).find(
|
|
1138
1137
|
(h) => Z(h) && h.type.displayName === "ConfirmationDialog.Trigger"
|
|
1139
1138
|
), p = E.Children.toArray(n).filter(
|
|
@@ -1141,7 +1140,7 @@ const Q = ({
|
|
|
1141
1140
|
), u = `clarity-confirmation-dialog clarity-confirmation-dialog--${l}`;
|
|
1142
1141
|
return /* @__PURE__ */ C(Te.Provider, { value: { variant: l, onClose: d, onConfirm: v, onOpen: o }, children: [
|
|
1143
1142
|
m,
|
|
1144
|
-
|
|
1143
|
+
i && /* @__PURE__ */ s("div", { className: "clarity-modal-overlay", children: /* @__PURE__ */ s("div", { className: u, children: p }) })
|
|
1145
1144
|
] });
|
|
1146
1145
|
};
|
|
1147
1146
|
Q.Header = Be;
|
|
@@ -1157,10 +1156,10 @@ const Tt = ({
|
|
|
1157
1156
|
disabled: a = !1,
|
|
1158
1157
|
loading: l = !1,
|
|
1159
1158
|
children: n,
|
|
1160
|
-
onClick:
|
|
1159
|
+
onClick: r,
|
|
1161
1160
|
type: c = "button",
|
|
1162
1161
|
className: f = "",
|
|
1163
|
-
"aria-label":
|
|
1162
|
+
"aria-label": i,
|
|
1164
1163
|
title: o,
|
|
1165
1164
|
customColor: d,
|
|
1166
1165
|
customColorHover: v,
|
|
@@ -1179,9 +1178,9 @@ const Tt = ({
|
|
|
1179
1178
|
{
|
|
1180
1179
|
className: u,
|
|
1181
1180
|
disabled: a || l,
|
|
1182
|
-
onClick:
|
|
1181
|
+
onClick: r,
|
|
1183
1182
|
type: c,
|
|
1184
|
-
"aria-label":
|
|
1183
|
+
"aria-label": i,
|
|
1185
1184
|
title: o,
|
|
1186
1185
|
style: h,
|
|
1187
1186
|
...m,
|
|
@@ -1197,10 +1196,10 @@ const Tt = ({
|
|
|
1197
1196
|
tone: a,
|
|
1198
1197
|
hoverTone: l,
|
|
1199
1198
|
size: n = "medium",
|
|
1200
|
-
disabled:
|
|
1199
|
+
disabled: r = !1,
|
|
1201
1200
|
children: c,
|
|
1202
1201
|
onClick: f,
|
|
1203
|
-
href:
|
|
1202
|
+
href: i,
|
|
1204
1203
|
target: o,
|
|
1205
1204
|
rel: d,
|
|
1206
1205
|
className: v = "",
|
|
@@ -1210,7 +1209,7 @@ const Tt = ({
|
|
|
1210
1209
|
p,
|
|
1211
1210
|
h,
|
|
1212
1211
|
`${p}--${n}`,
|
|
1213
|
-
|
|
1212
|
+
r && `${p}--disabled`,
|
|
1214
1213
|
v
|
|
1215
1214
|
].filter(Boolean).join(" "), b = (B) => {
|
|
1216
1215
|
const T = parseInt(B);
|
|
@@ -1219,15 +1218,15 @@ const Tt = ({
|
|
|
1219
1218
|
"--custom-color": `var(--clarity-${t}-${a})`,
|
|
1220
1219
|
"--custom-hover-color": `var(--clarity-${t}-${l || b(a)})`
|
|
1221
1220
|
} : {};
|
|
1222
|
-
return
|
|
1221
|
+
return i ? /* @__PURE__ */ s(
|
|
1223
1222
|
"a",
|
|
1224
1223
|
{
|
|
1225
|
-
href:
|
|
1224
|
+
href: i,
|
|
1226
1225
|
target: o,
|
|
1227
1226
|
rel: d || (o === "_blank" ? "noopener noreferrer" : void 0),
|
|
1228
1227
|
className: y,
|
|
1229
1228
|
style: _,
|
|
1230
|
-
onClick:
|
|
1229
|
+
onClick: r ? void 0 : f,
|
|
1231
1230
|
...m,
|
|
1232
1231
|
children: c
|
|
1233
1232
|
}
|
|
@@ -1236,7 +1235,7 @@ const Tt = ({
|
|
|
1236
1235
|
{
|
|
1237
1236
|
className: y,
|
|
1238
1237
|
style: _,
|
|
1239
|
-
disabled:
|
|
1238
|
+
disabled: r,
|
|
1240
1239
|
onClick: f,
|
|
1241
1240
|
...m,
|
|
1242
1241
|
children: c
|
|
@@ -1253,16 +1252,16 @@ const Tt = ({
|
|
|
1253
1252
|
tone: a,
|
|
1254
1253
|
hoverTone: l,
|
|
1255
1254
|
defaultActiveKey: n,
|
|
1256
|
-
alwaysOpen:
|
|
1255
|
+
alwaysOpen: r = !1,
|
|
1257
1256
|
flush: c = !1,
|
|
1258
1257
|
className: f = "",
|
|
1259
|
-
children:
|
|
1258
|
+
children: i,
|
|
1260
1259
|
onSelect: o,
|
|
1261
1260
|
...d
|
|
1262
1261
|
}) => {
|
|
1263
1262
|
const [v, m] = x(() => n ? Array.isArray(n) ? n : [n] : []), p = (w) => {
|
|
1264
1263
|
let $;
|
|
1265
|
-
|
|
1264
|
+
r ? $ = v.includes(w) ? v.filter((L) => L !== w) : [...v, w] : $ = v.includes(w) ? [] : [w], m($), o && o(v.includes(w) ? null : w, {});
|
|
1266
1265
|
}, u = "clarity-accordion", h = t && a, y = h ? `${u}--custom` : `${u}--${e}`, b = [
|
|
1267
1266
|
u,
|
|
1268
1267
|
y,
|
|
@@ -1278,14 +1277,14 @@ const Tt = ({
|
|
|
1278
1277
|
} : {}, T = {
|
|
1279
1278
|
activeKeys: v,
|
|
1280
1279
|
toggleItem: p,
|
|
1281
|
-
alwaysOpen:
|
|
1280
|
+
alwaysOpen: r,
|
|
1282
1281
|
variant: e,
|
|
1283
1282
|
product: t,
|
|
1284
1283
|
tone: a,
|
|
1285
1284
|
hoverTone: l,
|
|
1286
1285
|
flush: c
|
|
1287
1286
|
};
|
|
1288
|
-
return /* @__PURE__ */ s(Ie.Provider, { value: T, children: /* @__PURE__ */ s("div", { className: b, style: B, ...d, children:
|
|
1287
|
+
return /* @__PURE__ */ s(Ie.Provider, { value: T, children: /* @__PURE__ */ s("div", { className: b, style: B, ...d, children: i }) });
|
|
1289
1288
|
}, dt = ({
|
|
1290
1289
|
eventKey: e,
|
|
1291
1290
|
disabled: t = !1,
|
|
@@ -1293,13 +1292,13 @@ const Tt = ({
|
|
|
1293
1292
|
children: l,
|
|
1294
1293
|
...n
|
|
1295
1294
|
}) => {
|
|
1296
|
-
const { activeKeys:
|
|
1295
|
+
const { activeKeys: r } = De(), c = "clarity-accordion", f = r.includes(e), i = [
|
|
1297
1296
|
`${c}__item`,
|
|
1298
1297
|
f && `${c}__item--active`,
|
|
1299
1298
|
t && `${c}__item--disabled`,
|
|
1300
1299
|
a
|
|
1301
1300
|
].filter(Boolean).join(" ");
|
|
1302
|
-
return /* @__PURE__ */ s("div", { className:
|
|
1301
|
+
return /* @__PURE__ */ s("div", { className: i, ...n, children: E.Children.map(l, (o) => E.isValidElement(o) ? E.cloneElement(o, {
|
|
1303
1302
|
...o.props,
|
|
1304
1303
|
eventKey: e,
|
|
1305
1304
|
disabled: t,
|
|
@@ -1311,31 +1310,31 @@ const Tt = ({
|
|
|
1311
1310
|
onClick: a,
|
|
1312
1311
|
eventKey: l,
|
|
1313
1312
|
disabled: n = !1,
|
|
1314
|
-
isActive:
|
|
1313
|
+
isActive: r = !1,
|
|
1315
1314
|
...c
|
|
1316
1315
|
}) => {
|
|
1317
|
-
const { toggleItem: f } = De(),
|
|
1316
|
+
const { toggleItem: f } = De(), i = "clarity-accordion", o = (d) => {
|
|
1318
1317
|
!n && l && f(l), a == null || a(d);
|
|
1319
1318
|
};
|
|
1320
1319
|
return /* @__PURE__ */ C(
|
|
1321
1320
|
"button",
|
|
1322
1321
|
{
|
|
1323
|
-
className: [`${
|
|
1322
|
+
className: [`${i}__header`, e].filter(Boolean).join(" "),
|
|
1324
1323
|
onClick: o,
|
|
1325
1324
|
disabled: n,
|
|
1326
|
-
"aria-expanded":
|
|
1327
|
-
"aria-controls": l ? `${
|
|
1325
|
+
"aria-expanded": r,
|
|
1326
|
+
"aria-controls": l ? `${i}-collapse-${l}` : void 0,
|
|
1328
1327
|
...c,
|
|
1329
1328
|
children: [
|
|
1330
|
-
/* @__PURE__ */ s("span", { className: `${
|
|
1331
|
-
/* @__PURE__ */ s("span", { className: `${
|
|
1329
|
+
/* @__PURE__ */ s("span", { className: `${i}__title`, children: t }),
|
|
1330
|
+
/* @__PURE__ */ s("span", { className: `${i}__icon`, children: /* @__PURE__ */ s(
|
|
1332
1331
|
"svg",
|
|
1333
1332
|
{
|
|
1334
1333
|
width: "16",
|
|
1335
1334
|
height: "16",
|
|
1336
1335
|
viewBox: "0 0 16 16",
|
|
1337
1336
|
fill: "currentColor",
|
|
1338
|
-
className:
|
|
1337
|
+
className: r ? `${i}__icon--rotated` : "",
|
|
1339
1338
|
children: /* @__PURE__ */ s("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" })
|
|
1340
1339
|
}
|
|
1341
1340
|
) })
|
|
@@ -1349,16 +1348,16 @@ const Tt = ({
|
|
|
1349
1348
|
isActive: l = !1,
|
|
1350
1349
|
...n
|
|
1351
1350
|
}) => {
|
|
1352
|
-
const
|
|
1351
|
+
const r = "clarity-accordion";
|
|
1353
1352
|
return /* @__PURE__ */ s(
|
|
1354
1353
|
"div",
|
|
1355
1354
|
{
|
|
1356
|
-
id: a ? `${
|
|
1355
|
+
id: a ? `${r}-collapse-${a}` : void 0,
|
|
1357
1356
|
className: [
|
|
1358
|
-
`${
|
|
1359
|
-
l && `${
|
|
1357
|
+
`${r}__collapse`,
|
|
1358
|
+
l && `${r}__collapse--show`
|
|
1360
1359
|
].filter(Boolean).join(" "),
|
|
1361
|
-
children: /* @__PURE__ */ s("div", { className: [`${
|
|
1360
|
+
children: /* @__PURE__ */ s("div", { className: [`${r}__body`, e].filter(Boolean).join(" "), ...n, children: t })
|
|
1362
1361
|
}
|
|
1363
1362
|
);
|
|
1364
1363
|
}, jt = Object.assign(ct, {
|
|
@@ -1389,10 +1388,10 @@ const Tt = ({
|
|
|
1389
1388
|
const { isOpen: t, contentRef: a, styles: l } = Ae();
|
|
1390
1389
|
return t ? /* @__PURE__ */ s("div", { ref: a, className: "dropdown__content", style: l, children: e }) : null;
|
|
1391
1390
|
}, ht = ({ children: e }) => /* @__PURE__ */ s("div", { className: "dropdown__menu", children: e }), yt = ({ as: e, children: t, ...a }) => /* @__PURE__ */ s(e || "a", { ...a, className: "dropdown__item", children: t }), vt = () => /* @__PURE__ */ s("hr", { className: "dropdown__separator" }), ae = ({ title: e, position: t = "bottom", children: a }) => {
|
|
1392
|
-
const [l, n] = x(!1), [
|
|
1391
|
+
const [l, n] = x(!1), [r, c] = x({}), f = P(null), i = P(null), o = P(null);
|
|
1393
1392
|
return et(() => {
|
|
1394
1393
|
if (l) {
|
|
1395
|
-
const d =
|
|
1394
|
+
const d = i.current, v = o.current;
|
|
1396
1395
|
if (!d || !v) return;
|
|
1397
1396
|
const m = d.getBoundingClientRect(), p = v.getBoundingClientRect(), u = window.innerHeight, h = window.innerWidth;
|
|
1398
1397
|
let y = t;
|
|
@@ -1422,7 +1421,7 @@ const Tt = ({
|
|
|
1422
1421
|
return document.addEventListener("mousedown", d), () => {
|
|
1423
1422
|
document.removeEventListener("mousedown", d);
|
|
1424
1423
|
};
|
|
1425
|
-
}, []), /* @__PURE__ */ s(Re.Provider, { value: { isOpen: l, setIsOpen: n, triggerRef:
|
|
1424
|
+
}, []), /* @__PURE__ */ s(Re.Provider, { value: { isOpen: l, setIsOpen: n, triggerRef: i, contentRef: o, styles: r }, children: /* @__PURE__ */ s(
|
|
1426
1425
|
"div",
|
|
1427
1426
|
{
|
|
1428
1427
|
ref: f,
|
|
@@ -1443,17 +1442,17 @@ const Pe = z(null), Ve = () => {
|
|
|
1443
1442
|
throw new Error("useTabs must be used within a Tabs provider");
|
|
1444
1443
|
return e;
|
|
1445
1444
|
}, Me = ({ id: e, label: t, className: a = "" }) => {
|
|
1446
|
-
const { activeTab: l, setActiveTab: n, variant:
|
|
1445
|
+
const { activeTab: l, setActiveTab: n, variant: r, orientation: c } = Ve(), f = l === e, i = [
|
|
1447
1446
|
"clarity-tab",
|
|
1448
1447
|
a,
|
|
1449
1448
|
f ? "active" : "",
|
|
1450
|
-
f ? `variant-${
|
|
1449
|
+
f ? `variant-${r}` : "",
|
|
1451
1450
|
`orientation-${c}`
|
|
1452
1451
|
].filter(Boolean).join(" ");
|
|
1453
1452
|
return /* @__PURE__ */ s(
|
|
1454
1453
|
"button",
|
|
1455
1454
|
{
|
|
1456
|
-
className:
|
|
1455
|
+
className: i,
|
|
1457
1456
|
onClick: () => n(e),
|
|
1458
1457
|
role: "tab",
|
|
1459
1458
|
"aria-selected": f,
|
|
@@ -1463,11 +1462,11 @@ const Pe = z(null), Ve = () => {
|
|
|
1463
1462
|
};
|
|
1464
1463
|
Me.displayName = "Tabs.Tab";
|
|
1465
1464
|
const He = ({ id: e, children: t, className: a = "" }) => {
|
|
1466
|
-
const { activeTab: l } = Ve(), n = l === e,
|
|
1465
|
+
const { activeTab: l } = Ve(), n = l === e, r = {
|
|
1467
1466
|
visibility: n ? "visible" : "hidden",
|
|
1468
1467
|
gridArea: "1 / 1"
|
|
1469
1468
|
};
|
|
1470
|
-
return n || (
|
|
1469
|
+
return n || (r.pointerEvents = "none"), /* @__PURE__ */ s("div", { className: `clarity-tab-content ${a}`, role: "tabpanel", style: r, children: t });
|
|
1471
1470
|
};
|
|
1472
1471
|
He.displayName = "Tabs.Content";
|
|
1473
1472
|
const me = ({
|
|
@@ -1477,17 +1476,17 @@ const me = ({
|
|
|
1477
1476
|
orientation: l = "horizontal",
|
|
1478
1477
|
className: n = ""
|
|
1479
1478
|
}) => {
|
|
1480
|
-
const [
|
|
1481
|
-
activeTab:
|
|
1479
|
+
const [r, c] = x(t), f = Y(() => ({
|
|
1480
|
+
activeTab: r,
|
|
1482
1481
|
setActiveTab: c,
|
|
1483
1482
|
variant: a,
|
|
1484
1483
|
orientation: l
|
|
1485
|
-
}), [
|
|
1484
|
+
}), [r, a, l]), i = [
|
|
1486
1485
|
"clarity-tabs-container",
|
|
1487
1486
|
n,
|
|
1488
1487
|
`orientation-${l}`
|
|
1489
1488
|
].filter(Boolean).join(" ");
|
|
1490
|
-
return /* @__PURE__ */ s(Pe.Provider, { value: f, children: /* @__PURE__ */ s("div", { className:
|
|
1489
|
+
return /* @__PURE__ */ s(Pe.Provider, { value: f, children: /* @__PURE__ */ s("div", { className: i, children: e }) });
|
|
1491
1490
|
};
|
|
1492
1491
|
me.Tab = Me;
|
|
1493
1492
|
me.Content = He;
|
|
@@ -1498,10 +1497,10 @@ const Et = ({
|
|
|
1498
1497
|
variant: a = "primary",
|
|
1499
1498
|
product: l,
|
|
1500
1499
|
tone: n,
|
|
1501
|
-
bgColor:
|
|
1500
|
+
bgColor: r,
|
|
1502
1501
|
textColor: c,
|
|
1503
1502
|
children: f,
|
|
1504
|
-
className:
|
|
1503
|
+
className: i = "",
|
|
1505
1504
|
disabled: o = !1,
|
|
1506
1505
|
delay: d = 200,
|
|
1507
1506
|
hideDelay: v = 100,
|
|
@@ -1509,19 +1508,19 @@ const Et = ({
|
|
|
1509
1508
|
arrow: p = !0,
|
|
1510
1509
|
...u
|
|
1511
1510
|
}) => {
|
|
1512
|
-
const [h, y] = x(!1), [b, _] = x(null), B = P(null), T = P(null), w = "clarity-tooltip", $ = !!
|
|
1511
|
+
const [h, y] = x(!1), [b, _] = x(null), B = P(null), T = P(null), w = "clarity-tooltip", $ = !!r, L = l && n && !$;
|
|
1513
1512
|
let k = "";
|
|
1514
1513
|
$ ? k = `${w}__content--custom-bg` : L ? k = `${w}__content--custom` : k = `${w}__content--${a}`;
|
|
1515
1514
|
const j = [
|
|
1516
1515
|
w,
|
|
1517
1516
|
`${w}--${t}`,
|
|
1518
|
-
|
|
1517
|
+
i
|
|
1519
1518
|
].filter(Boolean).join(" "), I = [
|
|
1520
1519
|
`${w}__content`,
|
|
1521
1520
|
k,
|
|
1522
1521
|
p && `${w}__content--arrow`
|
|
1523
1522
|
].filter(Boolean).join(" "), A = {}, O = {};
|
|
1524
|
-
$ &&
|
|
1523
|
+
$ && r && (O["--tooltip-bg-color"] = r), c && (O["--tooltip-text-color"] = c), L && l && n && (O["--tooltip-product"] = l, O["--tooltip-tone"] = n);
|
|
1525
1524
|
const g = {
|
|
1526
1525
|
...A,
|
|
1527
1526
|
...Object.keys(O).length > 0 ? O : {}
|
|
@@ -1583,16 +1582,16 @@ const Et = ({
|
|
|
1583
1582
|
variant: a = "secondary",
|
|
1584
1583
|
emptyText: l = "No results found.",
|
|
1585
1584
|
inputPlaceholder: n = "Search...",
|
|
1586
|
-
...
|
|
1585
|
+
...r
|
|
1587
1586
|
}) => {
|
|
1588
|
-
const [c, f] = x(""), [
|
|
1587
|
+
const [c, f] = x(""), [i, o] = x(null), [d, v] = x(!1), m = [
|
|
1589
1588
|
"clarity-command",
|
|
1590
1589
|
`clarity-command--${a}`,
|
|
1591
1590
|
t
|
|
1592
1591
|
].filter(Boolean).join(" "), p = Y(() => ({
|
|
1593
1592
|
searchTerm: c,
|
|
1594
1593
|
setSearchTerm: f,
|
|
1595
|
-
value:
|
|
1594
|
+
value: i,
|
|
1596
1595
|
setValue: o,
|
|
1597
1596
|
variant: a,
|
|
1598
1597
|
texts: {
|
|
@@ -1601,25 +1600,25 @@ const Et = ({
|
|
|
1601
1600
|
},
|
|
1602
1601
|
isOpen: d,
|
|
1603
1602
|
setIsOpen: v
|
|
1604
|
-
}), [c,
|
|
1605
|
-
return /* @__PURE__ */ s(We.Provider, { value: p, children: /* @__PURE__ */ s("div", { className: m, ...
|
|
1603
|
+
}), [c, i, a, l, n, d]);
|
|
1604
|
+
return /* @__PURE__ */ s(We.Provider, { value: p, children: /* @__PURE__ */ s("div", { className: m, ...r, children: e }) });
|
|
1606
1605
|
};
|
|
1607
1606
|
Fe.displayName = "Command";
|
|
1608
1607
|
const Ge = ({ placeholder: e = "Search...", variant: t, onClick: a }) => {
|
|
1609
|
-
const { setIsOpen: l, variant: n } = ee(), [
|
|
1608
|
+
const { setIsOpen: l, variant: n } = ee(), [r, c] = x(!1);
|
|
1610
1609
|
S(() => {
|
|
1611
1610
|
c(/Mac|iPod|iPhone|iPad/.test(navigator.platform));
|
|
1612
1611
|
}, []);
|
|
1613
|
-
const
|
|
1612
|
+
const i = [
|
|
1614
1613
|
"clarity-command-button",
|
|
1615
1614
|
`clarity-command-button--${t || n}`
|
|
1616
1615
|
].filter(Boolean).join(" ");
|
|
1617
|
-
return /* @__PURE__ */ C("button", { className:
|
|
1616
|
+
return /* @__PURE__ */ C("button", { className: i, onClick: (d) => {
|
|
1618
1617
|
l(!0), a == null || a(d);
|
|
1619
1618
|
}, children: [
|
|
1620
1619
|
/* @__PURE__ */ s("span", { children: e }),
|
|
1621
1620
|
/* @__PURE__ */ C("kbd", { className: "clarity-command-shortcut", children: [
|
|
1622
|
-
|
|
1621
|
+
r ? "⌘" : "Ctrl+",
|
|
1623
1622
|
"K"
|
|
1624
1623
|
] })
|
|
1625
1624
|
] });
|
|
@@ -1628,20 +1627,20 @@ Ge.displayName = "Command.Button";
|
|
|
1628
1627
|
const Ue = ({ children: e, ...t }) => {
|
|
1629
1628
|
const { isOpen: a, setIsOpen: l, variant: n } = ee();
|
|
1630
1629
|
return S(() => {
|
|
1631
|
-
const
|
|
1630
|
+
const r = (c) => {
|
|
1632
1631
|
c.key === "k" && (c.metaKey || c.ctrlKey) && (c.preventDefault(), l(!a));
|
|
1633
1632
|
};
|
|
1634
|
-
return document.addEventListener("keydown",
|
|
1633
|
+
return document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
|
|
1635
1634
|
}, [a, l]), /* @__PURE__ */ s(J, { isOpen: a, onClose: () => l(!1), size: "large", closeOnOverlayClick: !0, children: /* @__PURE__ */ s("div", { className: `clarity-command--${n}`, children: e }) });
|
|
1636
1635
|
};
|
|
1637
1636
|
Ue.displayName = "Command.Dialog";
|
|
1638
1637
|
const ze = ({ className: e = "", ...t }) => {
|
|
1639
|
-
const { searchTerm: a, setSearchTerm: l, variant: n, texts:
|
|
1638
|
+
const { searchTerm: a, setSearchTerm: l, variant: n, texts: r, isOpen: c } = ee(), f = P(null);
|
|
1640
1639
|
S(() => {
|
|
1641
1640
|
var o;
|
|
1642
1641
|
c && ((o = f.current) == null || o.focus());
|
|
1643
1642
|
}, [c]);
|
|
1644
|
-
const
|
|
1643
|
+
const i = [
|
|
1645
1644
|
"clarity-command-input",
|
|
1646
1645
|
`clarity-command-input--${n}`,
|
|
1647
1646
|
e
|
|
@@ -1650,10 +1649,10 @@ const ze = ({ className: e = "", ...t }) => {
|
|
|
1650
1649
|
"input",
|
|
1651
1650
|
{
|
|
1652
1651
|
ref: f,
|
|
1653
|
-
className:
|
|
1652
|
+
className: i,
|
|
1654
1653
|
value: a,
|
|
1655
1654
|
onChange: (o) => l(o.target.value),
|
|
1656
|
-
placeholder: t.placeholder ||
|
|
1655
|
+
placeholder: t.placeholder || r.inputPlaceholder,
|
|
1657
1656
|
...t
|
|
1658
1657
|
}
|
|
1659
1658
|
) });
|
|
@@ -1662,7 +1661,7 @@ ze.displayName = "Command.Input";
|
|
|
1662
1661
|
const qe = ({ children: e, className: t = "", ...a }) => {
|
|
1663
1662
|
const { searchTerm: l } = ee();
|
|
1664
1663
|
let n = !1;
|
|
1665
|
-
const
|
|
1664
|
+
const r = (i) => E.Children.toArray(i).map((o) => {
|
|
1666
1665
|
var v;
|
|
1667
1666
|
if (!E.isValidElement(o)) return o;
|
|
1668
1667
|
const d = o.type.displayName;
|
|
@@ -1671,11 +1670,11 @@ const qe = ({ children: e, className: t = "", ...a }) => {
|
|
|
1671
1670
|
if (d === "Command.Item")
|
|
1672
1671
|
return (((v = o.props.children) == null ? void 0 : v.toString().toLowerCase()) || "").includes(l.toLowerCase()) ? (n = !0, o) : null;
|
|
1673
1672
|
if (d === "Command.Group") {
|
|
1674
|
-
const m =
|
|
1673
|
+
const m = r(o.props.children);
|
|
1675
1674
|
return E.Children.toArray(m).some((u) => E.isValidElement(u) && u.type.displayName === "Command.Item") ? E.cloneElement(o, { ...o.props, children: m }) : null;
|
|
1676
1675
|
}
|
|
1677
1676
|
return o;
|
|
1678
|
-
}).filter(Boolean), c =
|
|
1677
|
+
}).filter(Boolean), c = r(e), f = ["clarity-command-list", t].filter(Boolean).join(" ");
|
|
1679
1678
|
return /* @__PURE__ */ C("div", { className: f, ...a, children: [
|
|
1680
1679
|
c,
|
|
1681
1680
|
!n && /* @__PURE__ */ s(ue, {})
|
|
@@ -1693,8 +1692,8 @@ const Je = ({ children: e, className: t = "", ...a }) => {
|
|
|
1693
1692
|
};
|
|
1694
1693
|
Je.displayName = "Command.Group";
|
|
1695
1694
|
const Qe = ({ children: e, className: t = "", ...a }) => {
|
|
1696
|
-
const { setValue: l, variant: n } = ee(),
|
|
1697
|
-
return /* @__PURE__ */ s("div", { className:
|
|
1695
|
+
const { setValue: l, variant: n } = ee(), r = ["clarity-command-item", `clarity-command-item--${n}`, t].filter(Boolean).join(" ");
|
|
1696
|
+
return /* @__PURE__ */ s("div", { className: r, onClick: () => l((e == null ? void 0 : e.toString()) || ""), ...a, children: e });
|
|
1698
1697
|
};
|
|
1699
1698
|
Qe.displayName = "Command.Item";
|
|
1700
1699
|
const Xe = ({ className: e = "", ...t }) => {
|
|
@@ -1732,15 +1731,15 @@ const Lt = Object.assign(Fe, {
|
|
|
1732
1731
|
data: a,
|
|
1733
1732
|
viewMode: l = "table",
|
|
1734
1733
|
isScrollable: n = !1,
|
|
1735
|
-
isLoading:
|
|
1734
|
+
isLoading: r = !1
|
|
1736
1735
|
}) => {
|
|
1737
|
-
const [c, f] = x(null), [
|
|
1736
|
+
const [c, f] = x(null), [i, o] = x("none"), d = (u) => {
|
|
1738
1737
|
u.sortable && (c === u.key ? o((h) => h === "asc" ? "desc" : h === "desc" ? "none" : "asc") : (f(u.key), o("asc")));
|
|
1739
|
-
}, v = Y(() =>
|
|
1738
|
+
}, v = Y(() => i === "none" || !c ? a : [...a].sort((u, h) => {
|
|
1740
1739
|
const y = u[c], b = h[c];
|
|
1741
|
-
return y < b ?
|
|
1742
|
-
}), [a, c,
|
|
1743
|
-
if (
|
|
1740
|
+
return y < b ? i === "asc" ? -1 : 1 : y > b ? i === "asc" ? 1 : -1 : 0;
|
|
1741
|
+
}), [a, c, i]), m = (u) => u.sortable ? c !== u.key || i === "none" ? /* @__PURE__ */ s("span", { className: "sort-icon", children: "↕" }) : i === "asc" ? /* @__PURE__ */ s("span", { className: "sort-icon", children: "↑" }) : /* @__PURE__ */ s("span", { className: "sort-icon", children: "↓" }) : null;
|
|
1742
|
+
if (r)
|
|
1744
1743
|
return /* @__PURE__ */ s(Nt, { columns: t, viewMode: l });
|
|
1745
1744
|
const p = `table-variant-${e} ${n ? "is-scrollable" : ""}`;
|
|
1746
1745
|
return l === "card" ? /* @__PURE__ */ C("div", { className: `card-view-wrapper ${p}`, children: [
|
|
@@ -1780,15 +1779,15 @@ const Lt = Object.assign(Fe, {
|
|
|
1780
1779
|
tone: a,
|
|
1781
1780
|
size: l = "medium",
|
|
1782
1781
|
color: n,
|
|
1783
|
-
className:
|
|
1782
|
+
className: r = "",
|
|
1784
1783
|
"aria-label": c = "Carregando...",
|
|
1785
1784
|
...f
|
|
1786
1785
|
}) => {
|
|
1787
|
-
const
|
|
1788
|
-
|
|
1789
|
-
`${
|
|
1786
|
+
const i = "clarity-spinner", v = n ? `${i}--custom` : t && a ? `${i}--custom` : `${i}--${e}`, m = [
|
|
1787
|
+
i,
|
|
1788
|
+
`${i}--${l}`,
|
|
1790
1789
|
v,
|
|
1791
|
-
|
|
1790
|
+
r
|
|
1792
1791
|
].filter(Boolean).join(" "), p = {};
|
|
1793
1792
|
return n ? p["--spinner-color"] = n : t && a && (p["--spinner-color"] = `var(--clarity-${t}-${a})`), /* @__PURE__ */ s(
|
|
1794
1793
|
"div",
|
|
@@ -1798,16 +1797,16 @@ const Lt = Object.assign(Fe, {
|
|
|
1798
1797
|
role: "status",
|
|
1799
1798
|
"aria-label": c,
|
|
1800
1799
|
...f,
|
|
1801
|
-
children: /* @__PURE__ */ s("div", { className: `${
|
|
1800
|
+
children: /* @__PURE__ */ s("div", { className: `${i}__container`, children: /* @__PURE__ */ s(
|
|
1802
1801
|
"svg",
|
|
1803
1802
|
{
|
|
1804
|
-
className: `${
|
|
1803
|
+
className: `${i}__svg`,
|
|
1805
1804
|
viewBox: "0 0 50 50",
|
|
1806
1805
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1807
1806
|
children: /* @__PURE__ */ s(
|
|
1808
1807
|
"circle",
|
|
1809
1808
|
{
|
|
1810
|
-
className: `${
|
|
1809
|
+
className: `${i}__circle`,
|
|
1811
1810
|
cx: "25",
|
|
1812
1811
|
cy: "25",
|
|
1813
1812
|
r: "20",
|