beth-clarity 1.1.6 → 1.1.8
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.
|
@@ -14,18 +14,18 @@ const wt = ({
|
|
|
14
14
|
outlined: c = !1,
|
|
15
15
|
...p
|
|
16
16
|
}) => {
|
|
17
|
-
const
|
|
17
|
+
const y = "clarity-badge", f = !!n, m = t && a && !f;
|
|
18
18
|
let d = "";
|
|
19
|
-
f ? d = `${
|
|
19
|
+
f ? d = `${y}--custom-bg` : m ? d = `${y}--custom` : d = `${y}--${e}`;
|
|
20
20
|
const C = [
|
|
21
|
-
|
|
21
|
+
y,
|
|
22
22
|
d,
|
|
23
|
-
`${
|
|
24
|
-
i ? `${
|
|
25
|
-
c ? `${
|
|
23
|
+
`${y}--${l}`,
|
|
24
|
+
i ? `${y}--rounded` : "",
|
|
25
|
+
c ? `${y}--outlined` : "",
|
|
26
26
|
u
|
|
27
|
-
].filter(Boolean).join(" "),
|
|
28
|
-
f && (
|
|
27
|
+
].filter(Boolean).join(" "), h = {};
|
|
28
|
+
f && (h.backgroundColor = n, r && (h.color = r));
|
|
29
29
|
const N = m && 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)`
|
|
@@ -35,7 +35,7 @@ const wt = ({
|
|
|
35
35
|
{
|
|
36
36
|
className: C,
|
|
37
37
|
style: {
|
|
38
|
-
...
|
|
38
|
+
...h,
|
|
39
39
|
...N
|
|
40
40
|
},
|
|
41
41
|
...p,
|
|
@@ -54,10 +54,10 @@ const wt = ({
|
|
|
54
54
|
onClick: i,
|
|
55
55
|
type: c = "button",
|
|
56
56
|
className: p = "",
|
|
57
|
-
title:
|
|
57
|
+
title: y,
|
|
58
58
|
...f
|
|
59
59
|
}) => {
|
|
60
|
-
const m = "clarity-button", d = t && a, C = d ? `${m}--custom` : `${m}--${e}`,
|
|
60
|
+
const m = "clarity-button", d = t && a, C = d ? `${m}--custom` : `${m}--${e}`, h = [
|
|
61
61
|
m,
|
|
62
62
|
C,
|
|
63
63
|
`${m}--${n}`,
|
|
@@ -74,12 +74,12 @@ const wt = ({
|
|
|
74
74
|
return /* @__PURE__ */ _(
|
|
75
75
|
"button",
|
|
76
76
|
{
|
|
77
|
-
className:
|
|
77
|
+
className: h,
|
|
78
78
|
style: w,
|
|
79
79
|
disabled: r || o,
|
|
80
80
|
onClick: i,
|
|
81
81
|
type: c,
|
|
82
|
-
title:
|
|
82
|
+
title: y,
|
|
83
83
|
...f,
|
|
84
84
|
children: [
|
|
85
85
|
o && /* @__PURE__ */ s("div", { className: `${m}__spinner` }),
|
|
@@ -99,16 +99,16 @@ const wt = ({
|
|
|
99
99
|
className: i = "",
|
|
100
100
|
disabled: c = !1,
|
|
101
101
|
value: p,
|
|
102
|
-
defaultValue:
|
|
102
|
+
defaultValue: y,
|
|
103
103
|
onFocus: f,
|
|
104
104
|
onBlur: m,
|
|
105
105
|
...d
|
|
106
106
|
}, C) => {
|
|
107
|
-
const [
|
|
107
|
+
const [h, N] = T(!1), [w, B] = T(!1), g = A(null);
|
|
108
108
|
L.useImperativeHandle(C, () => g.current), O(() => {
|
|
109
109
|
const x = g.current;
|
|
110
110
|
x && B(x.value.length > 0);
|
|
111
|
-
}, [p,
|
|
111
|
+
}, [p, y]);
|
|
112
112
|
const b = (x) => {
|
|
113
113
|
N(!0), f == null || f(x);
|
|
114
114
|
}, k = (x) => {
|
|
@@ -120,7 +120,7 @@ const wt = ({
|
|
|
120
120
|
e && `clarity-input--${e}`,
|
|
121
121
|
n && "clarity-input--error",
|
|
122
122
|
c && "clarity-input--disabled",
|
|
123
|
-
|
|
123
|
+
h && "clarity-input--focused",
|
|
124
124
|
w && "clarity-input--has-value",
|
|
125
125
|
o && "clarity-input--with-start-icon",
|
|
126
126
|
u && "clarity-input--with-end-icon",
|
|
@@ -137,7 +137,7 @@ const wt = ({
|
|
|
137
137
|
className: "clarity-input__element",
|
|
138
138
|
disabled: c,
|
|
139
139
|
value: p,
|
|
140
|
-
defaultValue:
|
|
140
|
+
defaultValue: y,
|
|
141
141
|
onFocus: b,
|
|
142
142
|
onBlur: k,
|
|
143
143
|
...d
|
|
@@ -163,12 +163,12 @@ const at = L.forwardRef(({
|
|
|
163
163
|
className: i = "",
|
|
164
164
|
disabled: c = !1,
|
|
165
165
|
value: p,
|
|
166
|
-
defaultValue:
|
|
166
|
+
defaultValue: y,
|
|
167
167
|
onFocus: f,
|
|
168
168
|
onBlur: m,
|
|
169
169
|
rows: d = 3,
|
|
170
170
|
minHeight: C,
|
|
171
|
-
maxHeight:
|
|
171
|
+
maxHeight: h,
|
|
172
172
|
resizable: N = !0,
|
|
173
173
|
...w
|
|
174
174
|
}, B) => {
|
|
@@ -176,7 +176,7 @@ const at = L.forwardRef(({
|
|
|
176
176
|
L.useImperativeHandle(B, () => x.current), O(() => {
|
|
177
177
|
const $ = x.current;
|
|
178
178
|
$ && E($.value.length > 0);
|
|
179
|
-
}, [p,
|
|
179
|
+
}, [p, y]);
|
|
180
180
|
const j = ($) => {
|
|
181
181
|
b(!0), f == null || f($);
|
|
182
182
|
}, S = ($) => {
|
|
@@ -196,7 +196,7 @@ const at = L.forwardRef(({
|
|
|
196
196
|
].filter(Boolean).join(" "), I = {
|
|
197
197
|
resize: N ? "vertical" : "none",
|
|
198
198
|
minHeight: C ? `${C}px` : void 0,
|
|
199
|
-
maxHeight:
|
|
199
|
+
maxHeight: h ? `${h}px` : void 0
|
|
200
200
|
};
|
|
201
201
|
return /* @__PURE__ */ _("div", { className: "clarity-textarea-wrapper", children: [
|
|
202
202
|
/* @__PURE__ */ _("div", { className: P, children: [
|
|
@@ -209,7 +209,7 @@ const at = L.forwardRef(({
|
|
|
209
209
|
className: "clarity-textarea__element",
|
|
210
210
|
disabled: c,
|
|
211
211
|
value: p,
|
|
212
|
-
defaultValue:
|
|
212
|
+
defaultValue: y,
|
|
213
213
|
onFocus: j,
|
|
214
214
|
onBlur: S,
|
|
215
215
|
rows: d,
|
|
@@ -237,17 +237,17 @@ const lt = L.forwardRef(({
|
|
|
237
237
|
className: i = "",
|
|
238
238
|
disabled: c = !1,
|
|
239
239
|
value: p,
|
|
240
|
-
defaultValue:
|
|
240
|
+
defaultValue: y,
|
|
241
241
|
onFocus: f,
|
|
242
242
|
onBlur: m,
|
|
243
243
|
onChange: d,
|
|
244
244
|
options: C,
|
|
245
|
-
placeholder:
|
|
245
|
+
placeholder: h = "Selecione uma opção",
|
|
246
246
|
isClearable: N = !1,
|
|
247
247
|
isSearchable: w = !1,
|
|
248
248
|
...B
|
|
249
249
|
}, g) => {
|
|
250
|
-
const [b, k] = T(!1), [E, x] = T(!1), [j, S] = T(p ||
|
|
250
|
+
const [b, k] = T(!1), [E, x] = T(!1), [j, S] = T(p || y || ""), [P, I] = T(""), $ = A(null), M = A(null);
|
|
251
251
|
L.useImperativeHandle(g, () => $.current), O(() => {
|
|
252
252
|
p !== void 0 && S(p);
|
|
253
253
|
}, [p]), O(() => {
|
|
@@ -271,7 +271,7 @@ const lt = L.forwardRef(({
|
|
|
271
271
|
v.key === "Escape" ? (k(!1), x(!1), I("")) : v.key === "Enter" && V.length > 0 && V[0] && X(V[0]);
|
|
272
272
|
}, H = C.find((v) => v.value === j), le = j !== "" && j !== void 0, re = (v) => {
|
|
273
273
|
v.stopPropagation(), S(""), d == null || d("");
|
|
274
|
-
}, ie = le || E ||
|
|
274
|
+
}, ie = le || E || h || w && P, oe = [
|
|
275
275
|
"clarity-select",
|
|
276
276
|
"clarity-select--outlined",
|
|
277
277
|
`clarity-select--${t}`,
|
|
@@ -313,11 +313,11 @@ const lt = L.forwardRef(({
|
|
|
313
313
|
onFocus: () => {
|
|
314
314
|
b || (k(!0), x(!0), f == null || f());
|
|
315
315
|
},
|
|
316
|
-
placeholder: H ? H.label :
|
|
316
|
+
placeholder: H ? H.label : h,
|
|
317
317
|
disabled: c,
|
|
318
318
|
readOnly: !b
|
|
319
319
|
}
|
|
320
|
-
) : /* @__PURE__ */ s("div", { className: "clarity-select__display", children: H ? H.label :
|
|
320
|
+
) : /* @__PURE__ */ s("div", { className: "clarity-select__display", children: H ? H.label : h }),
|
|
321
321
|
a && /* @__PURE__ */ s("label", { className: "clarity-select__label", children: a })
|
|
322
322
|
] }),
|
|
323
323
|
N && le && /* @__PURE__ */ s(
|
|
@@ -409,12 +409,12 @@ const nt = Ke(({
|
|
|
409
409
|
disabled: i = !1,
|
|
410
410
|
variant: c = "primary",
|
|
411
411
|
size: p = "medium",
|
|
412
|
-
maxSelectedLabels:
|
|
412
|
+
maxSelectedLabels: y = 3,
|
|
413
413
|
selectionLimit: f,
|
|
414
414
|
className: m = "",
|
|
415
415
|
id: d,
|
|
416
416
|
name: C,
|
|
417
|
-
required:
|
|
417
|
+
required: h = !1,
|
|
418
418
|
"data-testid": N,
|
|
419
419
|
...w
|
|
420
420
|
}, B) => {
|
|
@@ -455,7 +455,7 @@ const nt = Ke(({
|
|
|
455
455
|
if (t.length === 0) return null;
|
|
456
456
|
const v = t.map(
|
|
457
457
|
(R) => e.find((se) => se.value === R)
|
|
458
|
-
).filter(Boolean), D = v.slice(0,
|
|
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
461
|
/* @__PURE__ */ s("span", { className: "clarity-multiselect__chip-label", children: R.label }),
|
|
@@ -507,7 +507,7 @@ const nt = Ke(({
|
|
|
507
507
|
children: [
|
|
508
508
|
n && /* @__PURE__ */ _("label", { className: "clarity-multiselect__label", children: [
|
|
509
509
|
n,
|
|
510
|
-
|
|
510
|
+
h && /* @__PURE__ */ s("span", { className: "clarity-multiselect__required", children: "*" })
|
|
511
511
|
] }),
|
|
512
512
|
/* @__PURE__ */ s("div", { className: "clarity-multiselect__content", children: t.length > 0 ? re() : /* @__PURE__ */ s("span", { className: "clarity-multiselect__placeholder", children: l }) }),
|
|
513
513
|
/* @__PURE__ */ _("div", { className: "clarity-multiselect__icons", children: [
|
|
@@ -667,12 +667,12 @@ const J = ({
|
|
|
667
667
|
i && w.target === w.currentTarget && m();
|
|
668
668
|
}, C = L.Children.toArray(l).find(
|
|
669
669
|
(w) => Z(w) && w.type.displayName === "Modal.Trigger"
|
|
670
|
-
),
|
|
670
|
+
), h = L.Children.toArray(l).filter(
|
|
671
671
|
(w) => Z(w) && w.type.displayName !== "Modal.Trigger"
|
|
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__ */ s("div", { className: "clarity-modal-overlay", onClick: d, children: /* @__PURE__ */ s("div", { className: N, children:
|
|
675
|
+
f && /* @__PURE__ */ s("div", { className: "clarity-modal-overlay", onClick: d, children: /* @__PURE__ */ s("div", { className: N, children: h }) })
|
|
676
676
|
] });
|
|
677
677
|
};
|
|
678
678
|
J.Header = he;
|
|
@@ -693,11 +693,11 @@ const be = z(void 0), $t = () => {
|
|
|
693
693
|
u("visible");
|
|
694
694
|
}, 10), p = setTimeout(() => {
|
|
695
695
|
u("exiting");
|
|
696
|
-
}, l * 1e3 - 300),
|
|
696
|
+
}, l * 1e3 - 300), y = setTimeout(() => {
|
|
697
697
|
n(e);
|
|
698
698
|
}, l * 1e3);
|
|
699
699
|
return () => {
|
|
700
|
-
clearTimeout(c), clearTimeout(p), clearTimeout(
|
|
700
|
+
clearTimeout(c), clearTimeout(p), clearTimeout(y);
|
|
701
701
|
};
|
|
702
702
|
}, [e, l, n]);
|
|
703
703
|
const i = [
|
|
@@ -738,8 +738,8 @@ const be = z(void 0), $t = () => {
|
|
|
738
738
|
// position: 'right-top',
|
|
739
739
|
...i
|
|
740
740
|
};
|
|
741
|
-
a((
|
|
742
|
-
const f = [p, ...
|
|
741
|
+
a((y) => {
|
|
742
|
+
const f = [p, ...y];
|
|
743
743
|
return f.length > 4 ? f.slice(0, 4) : f;
|
|
744
744
|
});
|
|
745
745
|
}, []), r = ne((i) => {
|
|
@@ -814,11 +814,11 @@ const K = ({
|
|
|
814
814
|
showCloseButton: i = !0,
|
|
815
815
|
title: c
|
|
816
816
|
}) => {
|
|
817
|
-
const [p,
|
|
818
|
-
t ? t() :
|
|
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
|
+
t ? t() : y(!1);
|
|
819
819
|
}, [t]), B = ne(() => {
|
|
820
|
-
|
|
821
|
-
}, [
|
|
820
|
+
h || y(!0), a == null || a();
|
|
821
|
+
}, [h, a]);
|
|
822
822
|
O(() => {
|
|
823
823
|
if (N) {
|
|
824
824
|
C(!0);
|
|
@@ -902,15 +902,15 @@ const it = L.forwardRef(({
|
|
|
902
902
|
className: i = "",
|
|
903
903
|
disabled: c = !1,
|
|
904
904
|
checked: p,
|
|
905
|
-
id:
|
|
905
|
+
id: y,
|
|
906
906
|
...f
|
|
907
907
|
}, m) => {
|
|
908
|
-
const d =
|
|
908
|
+
const d = y || `check-input-${Math.random().toString(36).substr(2, 9)}`, C = [
|
|
909
909
|
"clarity-check-input-wrapper",
|
|
910
910
|
`clarity-check-input-wrapper--${u}`,
|
|
911
911
|
c && "clarity-check-input-wrapper--disabled",
|
|
912
912
|
r && "clarity-check-input-wrapper--error"
|
|
913
|
-
].filter(Boolean).join(" "),
|
|
913
|
+
].filter(Boolean).join(" "), h = [
|
|
914
914
|
"clarity-check-input",
|
|
915
915
|
`clarity-check-input--${e}`,
|
|
916
916
|
`clarity-check-input--${a}`,
|
|
@@ -931,7 +931,7 @@ const it = L.forwardRef(({
|
|
|
931
931
|
ref: m,
|
|
932
932
|
id: d,
|
|
933
933
|
type: e,
|
|
934
|
-
className:
|
|
934
|
+
className: h,
|
|
935
935
|
disabled: c,
|
|
936
936
|
checked: p,
|
|
937
937
|
...f
|
|
@@ -977,7 +977,7 @@ const ot = L.forwardRef(({
|
|
|
977
977
|
disabled: i = !1,
|
|
978
978
|
checked: c,
|
|
979
979
|
id: p,
|
|
980
|
-
...
|
|
980
|
+
...y
|
|
981
981
|
}, f) => {
|
|
982
982
|
const m = p || `input-switch-${Math.random().toString(36).substr(2, 9)}`, d = [
|
|
983
983
|
"clarity-input-switch-wrapper",
|
|
@@ -991,7 +991,7 @@ const ot = L.forwardRef(({
|
|
|
991
991
|
n && "clarity-input-switch--error",
|
|
992
992
|
i && "clarity-input-switch--disabled",
|
|
993
993
|
u
|
|
994
|
-
].filter(Boolean).join(" "),
|
|
994
|
+
].filter(Boolean).join(" "), h = [
|
|
995
995
|
"clarity-input-switch__label",
|
|
996
996
|
`clarity-input-switch__label--${t}`,
|
|
997
997
|
i && "clarity-input-switch__label--disabled"
|
|
@@ -1007,11 +1007,11 @@ const ot = L.forwardRef(({
|
|
|
1007
1007
|
className: C,
|
|
1008
1008
|
disabled: i,
|
|
1009
1009
|
checked: c,
|
|
1010
|
-
...
|
|
1010
|
+
...y
|
|
1011
1011
|
}
|
|
1012
1012
|
),
|
|
1013
1013
|
/* @__PURE__ */ s("div", { className: "clarity-input-switch__track", children: /* @__PURE__ */ s("div", { className: "clarity-input-switch__thumb" }) }),
|
|
1014
|
-
a && /* @__PURE__ */ s("span", { className:
|
|
1014
|
+
a && /* @__PURE__ */ s("span", { className: h, children: a })
|
|
1015
1015
|
] }),
|
|
1016
1016
|
(l || n && r) && /* @__PURE__ */ s("div", { className: "clarity-input-switch__helper-text", children: n && r ? r : l })
|
|
1017
1017
|
] });
|
|
@@ -1069,12 +1069,12 @@ const Q = ({
|
|
|
1069
1069
|
u || o(!0);
|
|
1070
1070
|
}, p = () => {
|
|
1071
1071
|
t ? t() : o(!1);
|
|
1072
|
-
},
|
|
1072
|
+
}, y = () => {
|
|
1073
1073
|
a && a(), p();
|
|
1074
1074
|
};
|
|
1075
1075
|
O(() => {
|
|
1076
|
-
const C = (
|
|
1077
|
-
|
|
1076
|
+
const C = (h) => {
|
|
1077
|
+
h.key === "Escape" && p();
|
|
1078
1078
|
};
|
|
1079
1079
|
return i ? (document.addEventListener("keydown", C), document.body.style.overflow = "hidden") : document.body.style.overflow = "unset", () => {
|
|
1080
1080
|
document.removeEventListener("keydown", C), document.body.style.overflow = "unset";
|
|
@@ -1085,7 +1085,7 @@ const Q = ({
|
|
|
1085
1085
|
), m = L.Children.toArray(n).filter(
|
|
1086
1086
|
(C) => Z(C) && C.type.displayName !== "ConfirmationDialog.Trigger"
|
|
1087
1087
|
), d = `clarity-confirmation-dialog clarity-confirmation-dialog--${l}`;
|
|
1088
|
-
return /* @__PURE__ */ _(Te.Provider, { value: { variant: l, onClose: p, onConfirm:
|
|
1088
|
+
return /* @__PURE__ */ _(Te.Provider, { value: { variant: l, onClose: p, onConfirm: y, onOpen: c }, children: [
|
|
1089
1089
|
f,
|
|
1090
1090
|
i && /* @__PURE__ */ s("div", { className: "clarity-modal-overlay", children: /* @__PURE__ */ s("div", { className: d, children: m }) })
|
|
1091
1091
|
] });
|
|
@@ -1109,13 +1109,13 @@ const xt = ({
|
|
|
1109
1109
|
onClick: i,
|
|
1110
1110
|
type: c = "button",
|
|
1111
1111
|
className: p = "",
|
|
1112
|
-
"aria-label":
|
|
1112
|
+
"aria-label": y,
|
|
1113
1113
|
title: f,
|
|
1114
1114
|
...m
|
|
1115
1115
|
}) => {
|
|
1116
|
-
const d = "clarity-button-icon", C = t && a,
|
|
1116
|
+
const d = "clarity-button-icon", C = t && a, h = C ? `${d}--custom` : `${d}--${e}`, N = [
|
|
1117
1117
|
d,
|
|
1118
|
-
|
|
1118
|
+
h,
|
|
1119
1119
|
`${d}--${n}`,
|
|
1120
1120
|
o && `${d}--loading`,
|
|
1121
1121
|
r && `${d}--disabled`,
|
|
@@ -1135,7 +1135,7 @@ const xt = ({
|
|
|
1135
1135
|
disabled: r || o,
|
|
1136
1136
|
onClick: i,
|
|
1137
1137
|
type: c,
|
|
1138
|
-
"aria-label":
|
|
1138
|
+
"aria-label": y,
|
|
1139
1139
|
title: f,
|
|
1140
1140
|
...m,
|
|
1141
1141
|
children: [
|
|
@@ -1156,15 +1156,15 @@ const xt = ({
|
|
|
1156
1156
|
href: i,
|
|
1157
1157
|
target: c,
|
|
1158
1158
|
rel: p,
|
|
1159
|
-
className:
|
|
1159
|
+
className: y = "",
|
|
1160
1160
|
...f
|
|
1161
1161
|
}) => {
|
|
1162
|
-
const m = "clarity-button-link", d = t && a, C = d ? `${m}--custom` : `${m}--${e}`,
|
|
1162
|
+
const m = "clarity-button-link", d = t && a, C = d ? `${m}--custom` : `${m}--${e}`, h = [
|
|
1163
1163
|
m,
|
|
1164
1164
|
C,
|
|
1165
1165
|
`${m}--${n}`,
|
|
1166
1166
|
r && `${m}--disabled`,
|
|
1167
|
-
|
|
1167
|
+
y
|
|
1168
1168
|
].filter(Boolean).join(" "), N = (B) => {
|
|
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";
|
|
@@ -1178,7 +1178,7 @@ const xt = ({
|
|
|
1178
1178
|
href: i,
|
|
1179
1179
|
target: c,
|
|
1180
1180
|
rel: p || (c === "_blank" ? "noopener noreferrer" : void 0),
|
|
1181
|
-
className:
|
|
1181
|
+
className: h,
|
|
1182
1182
|
style: w,
|
|
1183
1183
|
onClick: r ? void 0 : u,
|
|
1184
1184
|
...f,
|
|
@@ -1187,7 +1187,7 @@ const xt = ({
|
|
|
1187
1187
|
) : /* @__PURE__ */ s(
|
|
1188
1188
|
"button",
|
|
1189
1189
|
{
|
|
1190
|
-
className:
|
|
1190
|
+
className: h,
|
|
1191
1191
|
style: w,
|
|
1192
1192
|
disabled: r,
|
|
1193
1193
|
onClick: u,
|
|
@@ -1213,12 +1213,12 @@ const xt = ({
|
|
|
1213
1213
|
onSelect: c,
|
|
1214
1214
|
...p
|
|
1215
1215
|
}) => {
|
|
1216
|
-
const [
|
|
1216
|
+
const [y, f] = T(() => n ? Array.isArray(n) ? n : [n] : []), m = (b) => {
|
|
1217
1217
|
let k;
|
|
1218
|
-
r ? k =
|
|
1219
|
-
}, d = "clarity-accordion", C = t && a,
|
|
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 && a, h = C ? `${d}--custom` : `${d}--${e}`, N = [
|
|
1220
1220
|
d,
|
|
1221
|
-
|
|
1221
|
+
h,
|
|
1222
1222
|
o && `${d}--flush`,
|
|
1223
1223
|
u
|
|
1224
1224
|
].filter(Boolean).join(" "), w = (b) => {
|
|
@@ -1229,7 +1229,7 @@ const xt = ({
|
|
|
1229
1229
|
"--custom-header-color": `var(--clarity-${t}-${a})`,
|
|
1230
1230
|
"--custom-hover-color": `var(--clarity-${t}-${l || w(a)})`
|
|
1231
1231
|
} : {}, g = {
|
|
1232
|
-
activeKeys:
|
|
1232
|
+
activeKeys: y,
|
|
1233
1233
|
toggleItem: m,
|
|
1234
1234
|
alwaysOpen: r,
|
|
1235
1235
|
variant: e,
|
|
@@ -1345,13 +1345,13 @@ const xt = ({
|
|
|
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) {
|
|
1348
|
-
const p = i.current,
|
|
1349
|
-
if (!p || !
|
|
1350
|
-
const f = p.getBoundingClientRect(), m =
|
|
1351
|
-
let
|
|
1352
|
-
t === "bottom" && f.bottom + m.height > d && (
|
|
1348
|
+
const p = i.current, y = c.current;
|
|
1349
|
+
if (!p || !y) return;
|
|
1350
|
+
const f = p.getBoundingClientRect(), m = y.getBoundingClientRect(), d = window.innerHeight, C = window.innerWidth;
|
|
1351
|
+
let h = t;
|
|
1352
|
+
t === "bottom" && f.bottom + m.height > d && (h = "top"), t === "top" && f.top - m.height < 0 && (h = "bottom"), t === "right" && f.right + m.width > C && (h = "left"), t === "left" && f.left - m.width < 0 && (h = "right");
|
|
1353
1353
|
const N = {};
|
|
1354
|
-
switch (
|
|
1354
|
+
switch (h) {
|
|
1355
1355
|
case "top":
|
|
1356
1356
|
N.bottom = f.height + 4, N.left = f.width / 2 - m.width / 2;
|
|
1357
1357
|
break;
|
|
@@ -1369,8 +1369,8 @@ const xt = ({
|
|
|
1369
1369
|
o(N);
|
|
1370
1370
|
}
|
|
1371
1371
|
}, [l, t]), O(() => {
|
|
1372
|
-
const p = (
|
|
1373
|
-
u.current && !u.current.contains(
|
|
1372
|
+
const p = (y) => {
|
|
1373
|
+
u.current && !u.current.contains(y.target) && n(!1);
|
|
1374
1374
|
};
|
|
1375
1375
|
return document.addEventListener("mousedown", p), () => {
|
|
1376
1376
|
document.removeEventListener("mousedown", p);
|
|
@@ -1457,12 +1457,12 @@ const jt = ({
|
|
|
1457
1457
|
className: i = "",
|
|
1458
1458
|
disabled: c = !1,
|
|
1459
1459
|
delay: p = 200,
|
|
1460
|
-
hideDelay:
|
|
1460
|
+
hideDelay: y = 100,
|
|
1461
1461
|
trigger: f = "hover",
|
|
1462
1462
|
arrow: m = !0,
|
|
1463
1463
|
...d
|
|
1464
1464
|
}) => {
|
|
1465
|
-
const [C,
|
|
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
1467
|
k ? x = `${b}__content--custom-bg` : E ? x = `${b}__content--custom` : x = `${b}__content--${a}`;
|
|
1468
1468
|
const j = [
|
|
@@ -1482,17 +1482,17 @@ const jt = ({
|
|
|
1482
1482
|
if (c) return;
|
|
1483
1483
|
N && clearTimeout(N);
|
|
1484
1484
|
const H = setTimeout(() => {
|
|
1485
|
-
|
|
1485
|
+
h(!0);
|
|
1486
1486
|
}, p);
|
|
1487
1487
|
w(H);
|
|
1488
1488
|
}, V = () => {
|
|
1489
1489
|
N && clearTimeout(N);
|
|
1490
1490
|
const H = setTimeout(() => {
|
|
1491
|
-
|
|
1492
|
-
},
|
|
1491
|
+
h(!1);
|
|
1492
|
+
}, y);
|
|
1493
1493
|
w(H);
|
|
1494
1494
|
}, F = () => {
|
|
1495
|
-
c ||
|
|
1495
|
+
c || h(!C);
|
|
1496
1496
|
}, X = () => {
|
|
1497
1497
|
c || M();
|
|
1498
1498
|
}, te = () => {
|
|
@@ -1538,7 +1538,7 @@ const jt = ({
|
|
|
1538
1538
|
inputPlaceholder: n = "Search...",
|
|
1539
1539
|
...r
|
|
1540
1540
|
}) => {
|
|
1541
|
-
const [o, u] = T(""), [i, c] = T(null), [p,
|
|
1541
|
+
const [o, u] = T(""), [i, c] = T(null), [p, y] = T(!1), f = [
|
|
1542
1542
|
"clarity-command",
|
|
1543
1543
|
`clarity-command--${a}`,
|
|
1544
1544
|
t
|
|
@@ -1553,7 +1553,7 @@ const jt = ({
|
|
|
1553
1553
|
inputPlaceholder: n
|
|
1554
1554
|
},
|
|
1555
1555
|
isOpen: p,
|
|
1556
|
-
setIsOpen:
|
|
1556
|
+
setIsOpen: y
|
|
1557
1557
|
}), [o, i, a, l, n, p]);
|
|
1558
1558
|
return /* @__PURE__ */ s(We.Provider, { value: m, children: /* @__PURE__ */ s("div", { className: f, ...r, children: e }) });
|
|
1559
1559
|
};
|
|
@@ -1616,13 +1616,13 @@ const qe = ({ children: e, className: t = "", ...a }) => {
|
|
|
1616
1616
|
const { searchTerm: l } = ee();
|
|
1617
1617
|
let n = !1;
|
|
1618
1618
|
const r = (i) => L.Children.toArray(i).map((c) => {
|
|
1619
|
-
var
|
|
1619
|
+
var y;
|
|
1620
1620
|
if (!L.isValidElement(c)) return c;
|
|
1621
1621
|
const p = c.type.displayName;
|
|
1622
1622
|
if (p === "Command.Empty")
|
|
1623
1623
|
return null;
|
|
1624
1624
|
if (p === "Command.Item")
|
|
1625
|
-
return (((
|
|
1625
|
+
return (((y = c.props.children) == null ? void 0 : y.toString().toLowerCase()) || "").includes(l.toLowerCase()) ? (n = !0, c) : null;
|
|
1626
1626
|
if (p === "Command.Group") {
|
|
1627
1627
|
const f = r(c.props.children);
|
|
1628
1628
|
return L.Children.toArray(f).some((d) => L.isValidElement(d) && d.type.displayName === "Command.Item") ? L.cloneElement(c, { ...c.props, children: f }) : null;
|
|
@@ -1689,9 +1689,9 @@ const Lt = Object.assign(Fe, {
|
|
|
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
|
-
},
|
|
1693
|
-
const
|
|
1694
|
-
return
|
|
1692
|
+
}, y = Y(() => i === "none" || !o ? a : [...a].sort((d, C) => {
|
|
1693
|
+
const h = d[o], N = C[o];
|
|
1694
|
+
return h < N ? i === "asc" ? -1 : 1 : h > N ? i === "asc" ? 1 : -1 : 0;
|
|
1695
1695
|
}), [a, o, i]), f = (d) => d.sortable ? o !== d.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;
|
|
1696
1696
|
if (r)
|
|
1697
1697
|
return /* @__PURE__ */ s(Ct, { columns: t, viewMode: l });
|
|
@@ -1710,7 +1710,7 @@ const Lt = Object.assign(Fe, {
|
|
|
1710
1710
|
},
|
|
1711
1711
|
d.key
|
|
1712
1712
|
)) }),
|
|
1713
|
-
/* @__PURE__ */ s("div", { className: "card-view-body", children:
|
|
1713
|
+
/* @__PURE__ */ s("div", { className: "card-view-body", children: y.map((d, C) => /* @__PURE__ */ s("div", { className: `card-view-row table-row-${e}`, children: t.map((h) => /* @__PURE__ */ s("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
1714
|
] }) : /* @__PURE__ */ s("div", { className: `table-wrapper ${m}`, children: /* @__PURE__ */ _("table", { children: [
|
|
1715
1715
|
/* @__PURE__ */ s("thead", { className: "table-header", children: /* @__PURE__ */ s("tr", { className: "table-row", children: t.map((d) => /* @__PURE__ */ _(
|
|
1716
1716
|
"th",
|
|
@@ -1725,7 +1725,7 @@ const Lt = Object.assign(Fe, {
|
|
|
1725
1725
|
},
|
|
1726
1726
|
d.key
|
|
1727
1727
|
)) }) }),
|
|
1728
|
-
/* @__PURE__ */ s("tbody", { children:
|
|
1728
|
+
/* @__PURE__ */ s("tbody", { children: y.map((d, C) => /* @__PURE__ */ s("tr", { className: `table-row table-row-${e}`, children: t.map((h) => /* @__PURE__ */ s("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",
|
|
@@ -1737,10 +1737,10 @@ const Lt = Object.assign(Fe, {
|
|
|
1737
1737
|
"aria-label": o = "Carregando...",
|
|
1738
1738
|
...u
|
|
1739
1739
|
}) => {
|
|
1740
|
-
const i = "clarity-spinner",
|
|
1740
|
+
const i = "clarity-spinner", y = n ? `${i}--custom` : t && a ? `${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
1746
|
return n ? m["--spinner-color"] = n : t && a && (m["--spinner-color"] = `var(--clarity-${t}-${a})`), /* @__PURE__ */ s(
|