beth-clarity 1.1.4 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/clarity-design-system.es.js +89 -89
- package/dist/clarity-design-system.umd.js +2 -2
- package/dist/components/Accordion/Accordion.d.ts +45 -0
- package/dist/components/Accordion/index.d.ts +3 -0
- package/dist/components/Badge/Badge.d.ts +19 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +21 -0
- package/dist/components/Button/index.d.ts +3 -0
- package/dist/components/ButtonIcon/ButtonIcon.d.ts +22 -0
- package/dist/components/ButtonIcon/index.d.ts +3 -0
- package/dist/components/ButtonLink/ButtonLink.d.ts +21 -0
- package/dist/components/ButtonLink/index.d.ts +3 -0
- package/dist/components/CheckInput/CheckInput.d.ts +22 -0
- package/dist/components/CheckInput/index.d.ts +3 -0
- package/dist/components/Command/Command.d.ts +17 -0
- package/dist/components/Command/index.d.ts +2 -0
- package/dist/components/ConfirmationDialog/ConfirmationDialog.d.ts +38 -0
- package/dist/components/ConfirmationDialog/index.d.ts +2 -0
- package/dist/components/Dropdown/Dropdown.d.ts +22 -0
- package/dist/components/Dropdown/index.d.ts +2 -0
- package/dist/components/Input/Input.d.ts +24 -0
- package/dist/components/Input/index.d.ts +3 -0
- package/dist/components/InputSwitch/InputSwitch.d.ts +20 -0
- package/dist/components/InputSwitch/index.d.ts +3 -0
- package/dist/components/Modal/Modal.d.ts +18 -0
- package/dist/components/Modal/index.d.ts +2 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +31 -0
- package/dist/components/MultiSelect/index.d.ts +3 -0
- package/dist/components/Offcanvas/Offcanvas.d.ts +16 -0
- package/dist/components/Offcanvas/index.d.ts +2 -0
- package/dist/components/Select/Select.d.ts +51 -0
- package/dist/components/Select/index.d.ts +3 -0
- package/dist/components/Spinner/Spinner.d.ts +17 -0
- package/dist/components/Spinner/index.d.ts +3 -0
- package/dist/components/Table/Table.d.ts +4 -0
- package/dist/components/Table/index.d.ts +3 -0
- package/dist/components/Tabs/Tabs.d.ts +10 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Textarea/Textarea.d.ts +30 -0
- package/dist/components/Textarea/index.d.ts +3 -0
- package/dist/components/Toast/Toast.d.ts +7 -0
- package/dist/components/Toast/index.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.d.ts +24 -0
- package/dist/components/Tooltip/index.d.ts +3 -0
- package/dist/components/index.d.ts +22 -0
- package/dist/index.d.ts +4 -1
- package/dist/styles/index.css +1 -1
- package/dist/tokens/colors.d.ts +51 -0
- package/dist/tokens/index.d.ts +4 -0
- package/dist/tokens/spacing.d.ts +10 -0
- package/dist/tokens/typography.d.ts +22 -0
- package/dist/types/table.d.ts +40 -0
- package/dist/utils/index.d.ts +3 -0
- package/package.json +3 -1
|
@@ -24,8 +24,8 @@ const wt = ({
|
|
|
24
24
|
i ? `${h}--rounded` : "",
|
|
25
25
|
c ? `${h}--outlined` : "",
|
|
26
26
|
u
|
|
27
|
-
].filter(Boolean).join(" "),
|
|
28
|
-
f && (
|
|
27
|
+
].filter(Boolean).join(" "), y = {};
|
|
28
|
+
f && (y.backgroundColor = n, r && (y.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
|
+
...y,
|
|
39
39
|
...N
|
|
40
40
|
},
|
|
41
41
|
...p,
|
|
@@ -57,7 +57,7 @@ const wt = ({
|
|
|
57
57
|
title: h,
|
|
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}`, y = [
|
|
61
61
|
m,
|
|
62
62
|
C,
|
|
63
63
|
`${m}--${n}`,
|
|
@@ -74,7 +74,7 @@ const wt = ({
|
|
|
74
74
|
return /* @__PURE__ */ _(
|
|
75
75
|
"button",
|
|
76
76
|
{
|
|
77
|
-
className:
|
|
77
|
+
className: y,
|
|
78
78
|
style: w,
|
|
79
79
|
disabled: r || o,
|
|
80
80
|
onClick: i,
|
|
@@ -104,7 +104,7 @@ const wt = ({
|
|
|
104
104
|
onBlur: m,
|
|
105
105
|
...d
|
|
106
106
|
}, C) => {
|
|
107
|
-
const [
|
|
107
|
+
const [y, 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);
|
|
@@ -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
|
+
y && "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",
|
|
@@ -168,7 +168,7 @@ const at = L.forwardRef(({
|
|
|
168
168
|
onBlur: m,
|
|
169
169
|
rows: d = 3,
|
|
170
170
|
minHeight: C,
|
|
171
|
-
maxHeight:
|
|
171
|
+
maxHeight: y,
|
|
172
172
|
resizable: N = !0,
|
|
173
173
|
...w
|
|
174
174
|
}, B) => {
|
|
@@ -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: y ? `${y}px` : void 0
|
|
200
200
|
};
|
|
201
201
|
return /* @__PURE__ */ _("div", { className: "clarity-textarea-wrapper", children: [
|
|
202
202
|
/* @__PURE__ */ _("div", { className: P, children: [
|
|
@@ -242,7 +242,7 @@ const lt = L.forwardRef(({
|
|
|
242
242
|
onBlur: m,
|
|
243
243
|
onChange: d,
|
|
244
244
|
options: C,
|
|
245
|
-
placeholder:
|
|
245
|
+
placeholder: y = "Selecione uma opção",
|
|
246
246
|
isClearable: N = !1,
|
|
247
247
|
isSearchable: w = !1,
|
|
248
248
|
...B
|
|
@@ -251,27 +251,27 @@ const lt = L.forwardRef(({
|
|
|
251
251
|
L.useImperativeHandle(g, () => $.current), O(() => {
|
|
252
252
|
p !== void 0 && S(p);
|
|
253
253
|
}, [p]), O(() => {
|
|
254
|
-
const
|
|
254
|
+
const v = (D) => {
|
|
255
255
|
$.current && !$.current.contains(D.target) && (k(!1), x(!1), m == null || m());
|
|
256
256
|
};
|
|
257
|
-
return document.addEventListener("mousedown",
|
|
257
|
+
return document.addEventListener("mousedown", v), () => document.removeEventListener("mousedown", v);
|
|
258
258
|
}, [m]);
|
|
259
259
|
const V = w && P ? C.filter(
|
|
260
|
-
(
|
|
260
|
+
(v) => v.label.toLowerCase().includes(P.toLowerCase())
|
|
261
261
|
) : C, F = () => {
|
|
262
262
|
c || (k(!b), x(!b), b ? (m == null || m(), w && I("")) : (f == null || f(), w && setTimeout(() => {
|
|
263
|
-
var
|
|
264
|
-
(
|
|
263
|
+
var v;
|
|
264
|
+
(v = M.current) == null || v.focus();
|
|
265
265
|
}, 0)));
|
|
266
|
-
}, X = (
|
|
267
|
-
|
|
268
|
-
}, te = (
|
|
269
|
-
I(
|
|
270
|
-
}, G = (
|
|
271
|
-
|
|
272
|
-
}, H = C.find((
|
|
273
|
-
|
|
274
|
-
}, ie = le || E ||
|
|
266
|
+
}, X = (v) => {
|
|
267
|
+
v.disabled || (S(v.value), k(!1), x(!1), I(""), d == null || d(v.value), m == null || m());
|
|
268
|
+
}, te = (v) => {
|
|
269
|
+
I(v.target.value);
|
|
270
|
+
}, G = (v) => {
|
|
271
|
+
v.key === "Escape" ? (k(!1), x(!1), I("")) : v.key === "Enter" && V.length > 0 && V[0] && X(V[0]);
|
|
272
|
+
}, H = C.find((v) => v.value === j), le = j !== "" && j !== void 0, re = (v) => {
|
|
273
|
+
v.stopPropagation(), S(""), d == null || d("");
|
|
274
|
+
}, ie = le || E || y || 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 : y,
|
|
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 : y }),
|
|
321
321
|
a && /* @__PURE__ */ s("label", { className: "clarity-select__label", children: a })
|
|
322
322
|
] }),
|
|
323
323
|
N && le && /* @__PURE__ */ s(
|
|
@@ -375,20 +375,20 @@ const lt = L.forwardRef(({
|
|
|
375
375
|
)
|
|
376
376
|
}
|
|
377
377
|
),
|
|
378
|
-
b && /* @__PURE__ */ s("div", { className: "clarity-select__dropdown", children: /* @__PURE__ */ s("ul", { className: "clarity-select__options", role: "listbox", children: V.length > 0 ? V.map((
|
|
378
|
+
b && /* @__PURE__ */ s("div", { className: "clarity-select__dropdown", children: /* @__PURE__ */ s("ul", { className: "clarity-select__options", role: "listbox", children: V.length > 0 ? V.map((v) => /* @__PURE__ */ s(
|
|
379
379
|
"li",
|
|
380
380
|
{
|
|
381
381
|
className: [
|
|
382
382
|
"clarity-select__option",
|
|
383
|
-
|
|
384
|
-
j ===
|
|
383
|
+
v.disabled && "clarity-select__option--disabled",
|
|
384
|
+
j === v.value && "clarity-select__option--selected"
|
|
385
385
|
].filter(Boolean).join(" "),
|
|
386
|
-
onClick: () => X(
|
|
386
|
+
onClick: () => X(v),
|
|
387
387
|
role: "option",
|
|
388
|
-
"aria-selected": j ===
|
|
389
|
-
children:
|
|
388
|
+
"aria-selected": j === v.value,
|
|
389
|
+
children: v.label
|
|
390
390
|
},
|
|
391
|
-
|
|
391
|
+
v.value
|
|
392
392
|
)) : /* @__PURE__ */ s("li", { className: "clarity-select__option clarity-select__option--no-results", children: "Nenhum resultado encontrado" }) }) })
|
|
393
393
|
]
|
|
394
394
|
}
|
|
@@ -414,48 +414,48 @@ const nt = Ke(({
|
|
|
414
414
|
className: m = "",
|
|
415
415
|
id: d,
|
|
416
416
|
name: C,
|
|
417
|
-
required:
|
|
417
|
+
required: y = !1,
|
|
418
418
|
"data-testid": N,
|
|
419
419
|
...w
|
|
420
420
|
}, B) => {
|
|
421
|
-
const [g, b] = T(!1), [k, E] = T(""), [x, j] = T(!1), S = A(null), P = A(null), I = A(null), $ = (
|
|
422
|
-
S.current =
|
|
421
|
+
const [g, b] = T(!1), [k, E] = T(""), [x, j] = T(!1), S = A(null), P = A(null), I = A(null), $ = (v) => {
|
|
422
|
+
S.current = v, B && (typeof B == "function" ? B(v) : B.current = v);
|
|
423
423
|
};
|
|
424
424
|
O(() => {
|
|
425
|
-
const
|
|
425
|
+
const v = (D) => {
|
|
426
426
|
S.current && !S.current.contains(D.target) && (b(!1), j(!1), E(""));
|
|
427
427
|
};
|
|
428
|
-
return document.addEventListener("click",
|
|
428
|
+
return document.addEventListener("click", v), () => document.removeEventListener("click", v);
|
|
429
429
|
}, []);
|
|
430
430
|
const M = e.filter(
|
|
431
|
-
(
|
|
431
|
+
(v) => v.label.toLowerCase().includes(k.toLowerCase())
|
|
432
432
|
), V = () => {
|
|
433
433
|
i || (b(!g), j(!g), g ? E("") : setTimeout(() => {
|
|
434
|
-
var
|
|
435
|
-
(
|
|
434
|
+
var v;
|
|
435
|
+
(v = P.current) == null || v.focus();
|
|
436
436
|
}, 100));
|
|
437
|
-
}, F = (
|
|
437
|
+
}, F = (v, D) => {
|
|
438
438
|
if (i)
|
|
439
439
|
return;
|
|
440
440
|
D && (D.stopPropagation(), D.preventDefault());
|
|
441
|
-
const U = t.includes(
|
|
441
|
+
const U = t.includes(v);
|
|
442
442
|
let R;
|
|
443
|
-
U ? R = t.filter((se) => se !==
|
|
444
|
-
}, X = (
|
|
443
|
+
U ? R = t.filter((se) => se !== v) : R = [...t, v], a && a(R);
|
|
444
|
+
}, X = (v, D) => {
|
|
445
445
|
if (D.stopPropagation(), i) return;
|
|
446
|
-
const U = t.filter((R) => R !==
|
|
446
|
+
const U = t.filter((R) => R !== v);
|
|
447
447
|
a == null || a(U);
|
|
448
|
-
}, te = (
|
|
449
|
-
|
|
450
|
-
}, G = (
|
|
451
|
-
E(
|
|
452
|
-
}, H = (
|
|
453
|
-
|
|
448
|
+
}, te = (v) => {
|
|
449
|
+
v.stopPropagation(), !i && (a == null || a([]));
|
|
450
|
+
}, G = (v) => {
|
|
451
|
+
E(v.target.value);
|
|
452
|
+
}, H = (v) => {
|
|
453
|
+
v.key === "Escape" && (b(!1), j(!1), E(""));
|
|
454
454
|
}, le = x || g || t.length > 0, re = () => {
|
|
455
455
|
if (t.length === 0) return null;
|
|
456
|
-
const
|
|
456
|
+
const v = t.map(
|
|
457
457
|
(R) => e.find((se) => se.value === R)
|
|
458
|
-
).filter(Boolean), D =
|
|
458
|
+
).filter(Boolean), D = v.slice(0, h), U = v.length - h;
|
|
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
|
+
y && /* @__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: [
|
|
@@ -548,8 +548,8 @@ const nt = Ke(({
|
|
|
548
548
|
onKeyDown: H
|
|
549
549
|
}
|
|
550
550
|
) }),
|
|
551
|
-
/* @__PURE__ */ s("ul", { className: "clarity-multiselect__options", children: M.length > 0 ? M.map((
|
|
552
|
-
const D = t.includes(
|
|
551
|
+
/* @__PURE__ */ s("ul", { className: "clarity-multiselect__options", children: M.length > 0 ? M.map((v) => {
|
|
552
|
+
const D = t.includes(v.value), U = v.disabled || i;
|
|
553
553
|
return /* @__PURE__ */ _(
|
|
554
554
|
"li",
|
|
555
555
|
{
|
|
@@ -558,7 +558,7 @@ const nt = Ke(({
|
|
|
558
558
|
D && "clarity-multiselect__option--selected",
|
|
559
559
|
U && "clarity-multiselect__option--disabled"
|
|
560
560
|
].filter(Boolean).join(" "),
|
|
561
|
-
onClick: (R) => !U && F(
|
|
561
|
+
onClick: (R) => !U && F(v.value, R),
|
|
562
562
|
children: [
|
|
563
563
|
/* @__PURE__ */ s("div", { className: "clarity-multiselect__option-checkbox", children: /* @__PURE__ */ s("div", { className: [
|
|
564
564
|
"clarity-multiselect__checkbox",
|
|
@@ -573,10 +573,10 @@ const nt = Ke(({
|
|
|
573
573
|
strokeLinejoin: "round"
|
|
574
574
|
}
|
|
575
575
|
) }) }) }),
|
|
576
|
-
/* @__PURE__ */ s("span", { className: "clarity-multiselect__option-label", children:
|
|
576
|
+
/* @__PURE__ */ s("span", { className: "clarity-multiselect__option-label", children: v.label })
|
|
577
577
|
]
|
|
578
578
|
},
|
|
579
|
-
|
|
579
|
+
v.value
|
|
580
580
|
);
|
|
581
581
|
}) : /* @__PURE__ */ s("li", { className: "clarity-multiselect__option clarity-multiselect__option--no-results", children: "Nenhum resultado encontrado" }) })
|
|
582
582
|
] })
|
|
@@ -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
|
+
), y = 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: y }) })
|
|
676
676
|
] });
|
|
677
677
|
};
|
|
678
678
|
J.Header = he;
|
|
@@ -814,11 +814,11 @@ const K = ({
|
|
|
814
814
|
showCloseButton: i = !0,
|
|
815
815
|
title: c
|
|
816
816
|
}) => {
|
|
817
|
-
const [p, h] = T(!1), [f, m] = T(!1), [d, C] = T(!1),
|
|
817
|
+
const [p, h] = T(!1), [f, m] = T(!1), [d, C] = T(!1), y = e !== void 0, N = y ? e : p, w = ne(() => {
|
|
818
818
|
t ? t() : h(!1);
|
|
819
819
|
}, [t]), B = ne(() => {
|
|
820
|
-
|
|
821
|
-
}, [
|
|
820
|
+
y || h(!0), a == null || a();
|
|
821
|
+
}, [y, a]);
|
|
822
822
|
O(() => {
|
|
823
823
|
if (N) {
|
|
824
824
|
C(!0);
|
|
@@ -910,7 +910,7 @@ const it = L.forwardRef(({
|
|
|
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(" "), y = [
|
|
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: y,
|
|
935
935
|
disabled: c,
|
|
936
936
|
checked: p,
|
|
937
937
|
...f
|
|
@@ -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(" "), y = [
|
|
995
995
|
"clarity-input-switch__label",
|
|
996
996
|
`clarity-input-switch__label--${t}`,
|
|
997
997
|
i && "clarity-input-switch__label--disabled"
|
|
@@ -1011,7 +1011,7 @@ const ot = L.forwardRef(({
|
|
|
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: y, 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
|
] });
|
|
@@ -1073,8 +1073,8 @@ const Q = ({
|
|
|
1073
1073
|
a && a(), p();
|
|
1074
1074
|
};
|
|
1075
1075
|
O(() => {
|
|
1076
|
-
const C = (
|
|
1077
|
-
|
|
1076
|
+
const C = (y) => {
|
|
1077
|
+
y.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";
|
|
@@ -1113,9 +1113,9 @@ const xt = ({
|
|
|
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, y = C ? `${d}--custom` : `${d}--${e}`, N = [
|
|
1117
1117
|
d,
|
|
1118
|
-
|
|
1118
|
+
y,
|
|
1119
1119
|
`${d}--${n}`,
|
|
1120
1120
|
o && `${d}--loading`,
|
|
1121
1121
|
r && `${d}--disabled`,
|
|
@@ -1159,7 +1159,7 @@ const xt = ({
|
|
|
1159
1159
|
className: h = "",
|
|
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}`, y = [
|
|
1163
1163
|
m,
|
|
1164
1164
|
C,
|
|
1165
1165
|
`${m}--${n}`,
|
|
@@ -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: y,
|
|
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: y,
|
|
1191
1191
|
style: w,
|
|
1192
1192
|
disabled: r,
|
|
1193
1193
|
onClick: u,
|
|
@@ -1216,9 +1216,9 @@ const xt = ({
|
|
|
1216
1216
|
const [h, f] = T(() => n ? Array.isArray(n) ? n : [n] : []), m = (b) => {
|
|
1217
1217
|
let k;
|
|
1218
1218
|
r ? k = h.includes(b) ? h.filter((E) => E !== b) : [...h, b] : k = h.includes(b) ? [] : [b], f(k), c && c(h.includes(b) ? null : b, {});
|
|
1219
|
-
}, d = "clarity-accordion", C = t && a,
|
|
1219
|
+
}, d = "clarity-accordion", C = t && a, y = C ? `${d}--custom` : `${d}--${e}`, N = [
|
|
1220
1220
|
d,
|
|
1221
|
-
|
|
1221
|
+
y,
|
|
1222
1222
|
o && `${d}--flush`,
|
|
1223
1223
|
u
|
|
1224
1224
|
].filter(Boolean).join(" "), w = (b) => {
|
|
@@ -1348,10 +1348,10 @@ const xt = ({
|
|
|
1348
1348
|
const p = i.current, h = c.current;
|
|
1349
1349
|
if (!p || !h) return;
|
|
1350
1350
|
const f = p.getBoundingClientRect(), m = h.getBoundingClientRect(), d = window.innerHeight, C = window.innerWidth;
|
|
1351
|
-
let
|
|
1352
|
-
t === "bottom" && f.bottom + m.height > d && (
|
|
1351
|
+
let y = t;
|
|
1352
|
+
t === "bottom" && f.bottom + m.height > d && (y = "top"), t === "top" && f.top - m.height < 0 && (y = "bottom"), t === "right" && f.right + m.width > C && (y = "left"), t === "left" && f.left - m.width < 0 && (y = "right");
|
|
1353
1353
|
const N = {};
|
|
1354
|
-
switch (
|
|
1354
|
+
switch (y) {
|
|
1355
1355
|
case "top":
|
|
1356
1356
|
N.bottom = f.height + 4, N.left = f.width / 2 - m.width / 2;
|
|
1357
1357
|
break;
|
|
@@ -1462,7 +1462,7 @@ const jt = ({
|
|
|
1462
1462
|
arrow: m = !0,
|
|
1463
1463
|
...d
|
|
1464
1464
|
}) => {
|
|
1465
|
-
const [C,
|
|
1465
|
+
const [C, y] = 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
|
+
y(!0);
|
|
1486
1486
|
}, p);
|
|
1487
1487
|
w(H);
|
|
1488
1488
|
}, V = () => {
|
|
1489
1489
|
N && clearTimeout(N);
|
|
1490
1490
|
const H = setTimeout(() => {
|
|
1491
|
-
|
|
1491
|
+
y(!1);
|
|
1492
1492
|
}, h);
|
|
1493
1493
|
w(H);
|
|
1494
1494
|
}, F = () => {
|
|
1495
|
-
c ||
|
|
1495
|
+
c || y(!C);
|
|
1496
1496
|
}, X = () => {
|
|
1497
1497
|
c || M();
|
|
1498
1498
|
}, te = () => {
|
|
@@ -1690,8 +1690,8 @@ const Lt = Object.assign(Fe, {
|
|
|
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
1692
|
}, h = Y(() => i === "none" || !o ? a : [...a].sort((d, C) => {
|
|
1693
|
-
const
|
|
1694
|
-
return
|
|
1693
|
+
const y = d[o], N = C[o];
|
|
1694
|
+
return y < N ? i === "asc" ? -1 : 1 : y > 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: h.map((d, C) => /* @__PURE__ */ s("div", { className: `card-view-row table-row-${e}`, children: t.map((
|
|
1713
|
+
/* @__PURE__ */ s("div", { className: "card-view-body", children: h.map((d, C) => /* @__PURE__ */ s("div", { className: `card-view-row table-row-${e}`, children: t.map((y) => /* @__PURE__ */ s("div", { className: "card-view-cell", style: { minWidth: y.minWidth }, children: y.render ? y.render(d) : d[y.key] }, y.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: h.map((d, C) => /* @__PURE__ */ s("tr", { className: `table-row table-row-${e}`, children: t.map((
|
|
1728
|
+
/* @__PURE__ */ s("tbody", { children: h.map((d, C) => /* @__PURE__ */ s("tr", { className: `table-row table-row-${e}`, children: t.map((y) => /* @__PURE__ */ s("td", { className: "table-cell", style: { minWidth: y.minWidth }, children: y.render ? y.render(d) : d[y.key] }, y.key)) }, C)) })
|
|
1729
1729
|
] }) });
|
|
1730
1730
|
}, It = ({
|
|
1731
1731
|
variant: e = "primary",
|