beth-clarity 1.1.10 → 1.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as s, jsxs as b, Fragment as Ze } from "react/jsx-runtime";
|
|
2
|
+
import E, { useState as T, useRef as P, useEffect as S, forwardRef as Ke, isValidElement as Z, createContext as z, cloneElement as W, useContext as q, useMemo as Y, useCallback as ne, useLayoutEffect as et } from "react";
|
|
3
3
|
import tt from "react-dom";
|
|
4
4
|
const wt = ({
|
|
5
5
|
variant: e = "primary",
|
|
@@ -12,20 +12,20 @@ const wt = ({
|
|
|
12
12
|
className: u = "",
|
|
13
13
|
rounded: i = !1,
|
|
14
14
|
outlined: c = !1,
|
|
15
|
-
...
|
|
15
|
+
...d
|
|
16
16
|
}) => {
|
|
17
|
-
const v = "clarity-badge",
|
|
18
|
-
let
|
|
19
|
-
|
|
17
|
+
const v = "clarity-badge", m = !!n, f = t && a && !m;
|
|
18
|
+
let p = "";
|
|
19
|
+
m ? p = `${v}--custom-bg` : f ? p = `${v}--custom` : p = `${v}--${e}`;
|
|
20
20
|
const h = [
|
|
21
21
|
v,
|
|
22
|
-
|
|
22
|
+
p,
|
|
23
23
|
`${v}--${l}`,
|
|
24
24
|
i ? `${v}--rounded` : "",
|
|
25
25
|
c ? `${v}--outlined` : "",
|
|
26
26
|
u
|
|
27
27
|
].filter(Boolean).join(" "), y = {};
|
|
28
|
-
|
|
28
|
+
m && (y.backgroundColor = n, r && (y.color = r));
|
|
29
29
|
const N = f && 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)`
|
|
@@ -38,11 +38,11 @@ const wt = ({
|
|
|
38
38
|
...y,
|
|
39
39
|
...N
|
|
40
40
|
},
|
|
41
|
-
...
|
|
41
|
+
...d,
|
|
42
42
|
children: o
|
|
43
43
|
}
|
|
44
44
|
);
|
|
45
|
-
},
|
|
45
|
+
}, gt = ({
|
|
46
46
|
variant: e = "primary",
|
|
47
47
|
product: t,
|
|
48
48
|
tone: a,
|
|
@@ -53,41 +53,41 @@ const wt = ({
|
|
|
53
53
|
children: u,
|
|
54
54
|
onClick: i,
|
|
55
55
|
type: c = "button",
|
|
56
|
-
className:
|
|
56
|
+
className: d = "",
|
|
57
57
|
title: v,
|
|
58
|
-
...
|
|
58
|
+
...m
|
|
59
59
|
}) => {
|
|
60
|
-
const f = "clarity-button",
|
|
60
|
+
const f = "clarity-button", p = t && a, h = p ? `${f}--custom` : `${f}--${e}`, y = [
|
|
61
61
|
f,
|
|
62
62
|
h,
|
|
63
63
|
`${f}--${n}`,
|
|
64
64
|
o && `${f}--loading`,
|
|
65
65
|
r && `${f}--disabled`,
|
|
66
|
-
|
|
66
|
+
d
|
|
67
67
|
].filter(Boolean).join(" "), N = (B) => {
|
|
68
68
|
const $ = parseInt(B);
|
|
69
69
|
return $ >= 800 ? "900" : $ >= 700 ? "800" : $ >= 600 ? "700" : $ >= 500 ? "600" : $ >= 400 ? "500" : $ >= 300 ? "400" : $ >= 200 ? "300" : "200";
|
|
70
|
-
},
|
|
70
|
+
}, _ = p ? {
|
|
71
71
|
"--custom-bg-color": `var(--clarity-${t}-${a})`,
|
|
72
72
|
"--custom-hover-color": `var(--clarity-${t}-${l || N(a)})`
|
|
73
73
|
} : {};
|
|
74
|
-
return /* @__PURE__ */
|
|
74
|
+
return /* @__PURE__ */ b(
|
|
75
75
|
"button",
|
|
76
76
|
{
|
|
77
77
|
className: y,
|
|
78
|
-
style:
|
|
78
|
+
style: _,
|
|
79
79
|
disabled: r || o,
|
|
80
80
|
onClick: i,
|
|
81
81
|
type: c,
|
|
82
82
|
title: v,
|
|
83
|
-
...
|
|
83
|
+
...m,
|
|
84
84
|
children: [
|
|
85
85
|
o && /* @__PURE__ */ s("div", { className: `${f}__spinner` }),
|
|
86
86
|
u
|
|
87
87
|
]
|
|
88
88
|
}
|
|
89
89
|
);
|
|
90
|
-
},
|
|
90
|
+
}, $t = ({
|
|
91
91
|
variant: e = "primary",
|
|
92
92
|
size: t = "medium",
|
|
93
93
|
filled: a = !0,
|
|
@@ -99,48 +99,48 @@ const wt = ({
|
|
|
99
99
|
className: i = "",
|
|
100
100
|
...c
|
|
101
101
|
}) => {
|
|
102
|
-
const
|
|
103
|
-
|
|
102
|
+
const d = "clarity-button-group", v = `${d}--${e}`, m = [
|
|
103
|
+
d,
|
|
104
104
|
v,
|
|
105
|
-
`${
|
|
106
|
-
!a && `${
|
|
107
|
-
o && `${
|
|
105
|
+
`${d}--${t}`,
|
|
106
|
+
!a && `${d}--outline`,
|
|
107
|
+
o && `${d}--disabled`,
|
|
108
108
|
i
|
|
109
109
|
].filter(Boolean).join(" "), f = (h) => {
|
|
110
110
|
if (o || !u) return;
|
|
111
111
|
const y = l.find((N) => N.id === h);
|
|
112
112
|
if (!(y != null && y.disabled))
|
|
113
113
|
if (r) {
|
|
114
|
-
const N = Array.isArray(n) ? n : [],
|
|
115
|
-
u(
|
|
114
|
+
const N = Array.isArray(n) ? n : [], _ = N.includes(h) ? N.filter((B) => B !== h) : [...N, h];
|
|
115
|
+
u(_);
|
|
116
116
|
} else
|
|
117
117
|
u(h);
|
|
118
|
-
},
|
|
118
|
+
}, p = (h) => r ? Array.isArray(n) && n.includes(h) : n === h;
|
|
119
119
|
return /* @__PURE__ */ s(
|
|
120
120
|
"div",
|
|
121
121
|
{
|
|
122
|
-
className:
|
|
122
|
+
className: m,
|
|
123
123
|
role: "group",
|
|
124
124
|
...c,
|
|
125
125
|
children: l.map((h, y) => {
|
|
126
|
-
const N =
|
|
127
|
-
`${
|
|
128
|
-
N && `${
|
|
129
|
-
h.disabled && `${
|
|
130
|
-
y === 0 && `${
|
|
131
|
-
y === l.length - 1 && `${
|
|
126
|
+
const N = p(h.id), _ = [
|
|
127
|
+
`${d}__item`,
|
|
128
|
+
N && `${d}__item--selected`,
|
|
129
|
+
h.disabled && `${d}__item--disabled`,
|
|
130
|
+
y === 0 && `${d}__item--first`,
|
|
131
|
+
y === l.length - 1 && `${d}__item--last`
|
|
132
132
|
].filter(Boolean).join(" ");
|
|
133
|
-
return /* @__PURE__ */
|
|
133
|
+
return /* @__PURE__ */ b(
|
|
134
134
|
"button",
|
|
135
135
|
{
|
|
136
|
-
className:
|
|
136
|
+
className: _,
|
|
137
137
|
onClick: () => f(h.id),
|
|
138
138
|
disabled: o || h.disabled,
|
|
139
139
|
type: "button",
|
|
140
140
|
"aria-pressed": N,
|
|
141
141
|
children: [
|
|
142
|
-
h.icon && /* @__PURE__ */ s("span", { className: `${
|
|
143
|
-
/* @__PURE__ */ s("span", { className: `${
|
|
142
|
+
h.icon && /* @__PURE__ */ s("span", { className: `${d}__item-icon`, children: h.icon }),
|
|
143
|
+
/* @__PURE__ */ s("span", { className: `${d}__item-label`, children: h.label })
|
|
144
144
|
]
|
|
145
145
|
},
|
|
146
146
|
h.id
|
|
@@ -148,7 +148,7 @@ const wt = ({
|
|
|
148
148
|
})
|
|
149
149
|
}
|
|
150
150
|
);
|
|
151
|
-
}, st =
|
|
151
|
+
}, st = E.forwardRef(({
|
|
152
152
|
variant: e,
|
|
153
153
|
size: t = "medium",
|
|
154
154
|
label: a,
|
|
@@ -159,22 +159,22 @@ const wt = ({
|
|
|
159
159
|
endIcon: u,
|
|
160
160
|
className: i = "",
|
|
161
161
|
disabled: c = !1,
|
|
162
|
-
value:
|
|
162
|
+
value: d,
|
|
163
163
|
defaultValue: v,
|
|
164
|
-
onFocus:
|
|
164
|
+
onFocus: m,
|
|
165
165
|
onBlur: f,
|
|
166
|
-
...
|
|
166
|
+
...p
|
|
167
167
|
}, h) => {
|
|
168
|
-
const [y, N] = T(!1), [
|
|
169
|
-
|
|
168
|
+
const [y, N] = T(!1), [_, B] = T(!1), $ = P(null);
|
|
169
|
+
E.useImperativeHandle(h, () => $.current), S(() => {
|
|
170
170
|
const x = $.current;
|
|
171
171
|
x && B(x.value.length > 0);
|
|
172
|
-
}, [
|
|
173
|
-
const
|
|
174
|
-
N(!0),
|
|
172
|
+
}, [d, v]);
|
|
173
|
+
const w = (x) => {
|
|
174
|
+
N(!0), m == null || m(x);
|
|
175
175
|
}, k = (x) => {
|
|
176
176
|
N(!1), B(x.target.value.length > 0), f == null || f(x);
|
|
177
|
-
},
|
|
177
|
+
}, L = [
|
|
178
178
|
"clarity-input",
|
|
179
179
|
"clarity-input--outlined",
|
|
180
180
|
`clarity-input--${t}`,
|
|
@@ -182,26 +182,26 @@ const wt = ({
|
|
|
182
182
|
n && "clarity-input--error",
|
|
183
183
|
c && "clarity-input--disabled",
|
|
184
184
|
y && "clarity-input--focused",
|
|
185
|
-
|
|
185
|
+
_ && "clarity-input--has-value",
|
|
186
186
|
o && "clarity-input--with-start-icon",
|
|
187
187
|
u && "clarity-input--with-end-icon",
|
|
188
188
|
i
|
|
189
189
|
].filter(Boolean).join(" ");
|
|
190
|
-
return /* @__PURE__ */
|
|
191
|
-
/* @__PURE__ */
|
|
190
|
+
return /* @__PURE__ */ b("div", { className: "clarity-input-wrapper", children: [
|
|
191
|
+
/* @__PURE__ */ b("div", { className: L, children: [
|
|
192
192
|
o && /* @__PURE__ */ s("div", { className: "clarity-input__start-icon", children: o }),
|
|
193
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ b("div", { className: "clarity-input__field", children: [
|
|
194
194
|
/* @__PURE__ */ s(
|
|
195
195
|
"input",
|
|
196
196
|
{
|
|
197
197
|
ref: $,
|
|
198
198
|
className: "clarity-input__element",
|
|
199
199
|
disabled: c,
|
|
200
|
-
value:
|
|
200
|
+
value: d,
|
|
201
201
|
defaultValue: v,
|
|
202
|
-
onFocus:
|
|
202
|
+
onFocus: w,
|
|
203
203
|
onBlur: k,
|
|
204
|
-
...
|
|
204
|
+
...p
|
|
205
205
|
}
|
|
206
206
|
),
|
|
207
207
|
a && /* @__PURE__ */ s("label", { className: "clarity-input__label", children: a })
|
|
@@ -212,7 +212,7 @@ const wt = ({
|
|
|
212
212
|
] });
|
|
213
213
|
});
|
|
214
214
|
st.displayName = "Input";
|
|
215
|
-
const at =
|
|
215
|
+
const at = E.forwardRef(({
|
|
216
216
|
variant: e,
|
|
217
217
|
size: t = "medium",
|
|
218
218
|
label: a,
|
|
@@ -223,25 +223,25 @@ const at = L.forwardRef(({
|
|
|
223
223
|
endIcon: u,
|
|
224
224
|
className: i = "",
|
|
225
225
|
disabled: c = !1,
|
|
226
|
-
value:
|
|
226
|
+
value: d,
|
|
227
227
|
defaultValue: v,
|
|
228
|
-
onFocus:
|
|
228
|
+
onFocus: m,
|
|
229
229
|
onBlur: f,
|
|
230
|
-
rows:
|
|
230
|
+
rows: p = 3,
|
|
231
231
|
minHeight: h,
|
|
232
232
|
maxHeight: y,
|
|
233
233
|
resizable: N = !0,
|
|
234
|
-
...
|
|
234
|
+
..._
|
|
235
235
|
}, B) => {
|
|
236
|
-
const [$,
|
|
237
|
-
|
|
236
|
+
const [$, w] = T(!1), [k, L] = T(!1), x = P(null);
|
|
237
|
+
E.useImperativeHandle(B, () => x.current), S(() => {
|
|
238
238
|
const g = x.current;
|
|
239
|
-
g &&
|
|
240
|
-
}, [
|
|
239
|
+
g && L(g.value.length > 0);
|
|
240
|
+
}, [d, v]);
|
|
241
241
|
const j = (g) => {
|
|
242
|
-
|
|
242
|
+
w(!0), m == null || m(g);
|
|
243
243
|
}, I = (g) => {
|
|
244
|
-
|
|
244
|
+
w(!1), L(g.target.value.length > 0), f == null || f(g);
|
|
245
245
|
}, A = [
|
|
246
246
|
"clarity-textarea",
|
|
247
247
|
"clarity-textarea--outlined",
|
|
@@ -254,28 +254,28 @@ const at = L.forwardRef(({
|
|
|
254
254
|
o && "clarity-textarea--with-start-icon",
|
|
255
255
|
u && "clarity-textarea--with-end-icon",
|
|
256
256
|
i
|
|
257
|
-
].filter(Boolean).join(" "),
|
|
257
|
+
].filter(Boolean).join(" "), O = {
|
|
258
258
|
resize: N ? "vertical" : "none",
|
|
259
259
|
minHeight: h ? `${h}px` : void 0,
|
|
260
260
|
maxHeight: y ? `${y}px` : void 0
|
|
261
261
|
};
|
|
262
|
-
return /* @__PURE__ */
|
|
263
|
-
/* @__PURE__ */
|
|
262
|
+
return /* @__PURE__ */ b("div", { className: "clarity-textarea-wrapper", children: [
|
|
263
|
+
/* @__PURE__ */ b("div", { className: A, children: [
|
|
264
264
|
o && /* @__PURE__ */ s("div", { className: "clarity-textarea__start-icon", children: o }),
|
|
265
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ b("div", { className: "clarity-textarea__field", children: [
|
|
266
266
|
/* @__PURE__ */ s(
|
|
267
267
|
"textarea",
|
|
268
268
|
{
|
|
269
269
|
ref: x,
|
|
270
270
|
className: "clarity-textarea__element",
|
|
271
271
|
disabled: c,
|
|
272
|
-
value:
|
|
272
|
+
value: d,
|
|
273
273
|
defaultValue: v,
|
|
274
274
|
onFocus: j,
|
|
275
275
|
onBlur: I,
|
|
276
|
-
rows:
|
|
277
|
-
style:
|
|
278
|
-
...
|
|
276
|
+
rows: p,
|
|
277
|
+
style: O,
|
|
278
|
+
..._
|
|
279
279
|
}
|
|
280
280
|
),
|
|
281
281
|
a && /* @__PURE__ */ s("label", { className: "clarity-textarea__label", children: a })
|
|
@@ -286,7 +286,7 @@ const at = L.forwardRef(({
|
|
|
286
286
|
] });
|
|
287
287
|
});
|
|
288
288
|
at.displayName = "Textarea";
|
|
289
|
-
const lt =
|
|
289
|
+
const lt = E.forwardRef(({
|
|
290
290
|
variant: e,
|
|
291
291
|
size: t = "medium",
|
|
292
292
|
label: a,
|
|
@@ -297,86 +297,86 @@ const lt = L.forwardRef(({
|
|
|
297
297
|
endIcon: u,
|
|
298
298
|
className: i = "",
|
|
299
299
|
disabled: c = !1,
|
|
300
|
-
value:
|
|
300
|
+
value: d,
|
|
301
301
|
defaultValue: v,
|
|
302
|
-
onFocus:
|
|
302
|
+
onFocus: m,
|
|
303
303
|
onBlur: f,
|
|
304
|
-
onChange:
|
|
304
|
+
onChange: p,
|
|
305
305
|
options: h,
|
|
306
306
|
placeholder: y = "Selecione uma opção",
|
|
307
307
|
isClearable: N = !1,
|
|
308
|
-
isSearchable:
|
|
308
|
+
isSearchable: _ = !1,
|
|
309
309
|
...B
|
|
310
310
|
}, $) => {
|
|
311
|
-
const [
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
}, [
|
|
311
|
+
const [w, k] = T(!1), [L, x] = T(!1), [j, I] = T(d || v || ""), [A, O] = T(""), g = P(null), M = P(null);
|
|
312
|
+
E.useImperativeHandle($, () => g.current), S(() => {
|
|
313
|
+
d !== void 0 && I(d);
|
|
314
|
+
}, [d]), S(() => {
|
|
315
315
|
const C = (D) => {
|
|
316
316
|
g.current && !g.current.contains(D.target) && (k(!1), x(!1), f == null || f());
|
|
317
317
|
};
|
|
318
318
|
return document.addEventListener("mousedown", C), () => document.removeEventListener("mousedown", C);
|
|
319
319
|
}, [f]);
|
|
320
|
-
const V =
|
|
320
|
+
const V = _ && A ? h.filter(
|
|
321
321
|
(C) => C.label.toLowerCase().includes(A.toLowerCase())
|
|
322
322
|
) : h, F = () => {
|
|
323
|
-
c || (k(!
|
|
323
|
+
c || (k(!w), x(!w), w ? (f == null || f(), _ && O("")) : (m == null || m(), _ && setTimeout(() => {
|
|
324
324
|
var C;
|
|
325
325
|
(C = M.current) == null || C.focus();
|
|
326
326
|
}, 0)));
|
|
327
327
|
}, X = (C) => {
|
|
328
|
-
C.disabled || (I(C.value), k(!1), x(!1),
|
|
328
|
+
C.disabled || (I(C.value), k(!1), x(!1), O(""), p == null || p(C.value), f == null || f());
|
|
329
329
|
}, te = (C) => {
|
|
330
|
-
|
|
330
|
+
O(C.target.value);
|
|
331
331
|
}, G = (C) => {
|
|
332
|
-
C.key === "Escape" ? (k(!1), x(!1),
|
|
332
|
+
C.key === "Escape" ? (k(!1), x(!1), O("")) : C.key === "Enter" && V.length > 0 && V[0] && X(V[0]);
|
|
333
333
|
}, H = h.find((C) => C.value === j), le = j !== "" && j !== void 0, re = (C) => {
|
|
334
|
-
C.stopPropagation(), I(""),
|
|
335
|
-
}, ie = le ||
|
|
334
|
+
C.stopPropagation(), I(""), p == null || p("");
|
|
335
|
+
}, ie = le || L || y || _ && A, oe = [
|
|
336
336
|
"clarity-select",
|
|
337
337
|
"clarity-select--outlined",
|
|
338
338
|
`clarity-select--${t}`,
|
|
339
339
|
e && `clarity-select--${e}`,
|
|
340
340
|
n && "clarity-select--error",
|
|
341
341
|
c && "clarity-select--disabled",
|
|
342
|
-
(
|
|
342
|
+
(L || w) && "clarity-select--focused",
|
|
343
343
|
ie && "clarity-select--label-up",
|
|
344
|
-
|
|
345
|
-
|
|
344
|
+
w && "clarity-select--open",
|
|
345
|
+
_ && "clarity-select--searchable",
|
|
346
346
|
o && "clarity-select--with-start-icon",
|
|
347
347
|
(u || N) && "clarity-select--with-end-icon",
|
|
348
348
|
i
|
|
349
349
|
].filter(Boolean).join(" ");
|
|
350
|
-
return /* @__PURE__ */
|
|
351
|
-
/* @__PURE__ */
|
|
350
|
+
return /* @__PURE__ */ b("div", { className: "clarity-select-wrapper", children: [
|
|
351
|
+
/* @__PURE__ */ b(
|
|
352
352
|
"div",
|
|
353
353
|
{
|
|
354
354
|
ref: g,
|
|
355
355
|
className: oe,
|
|
356
|
-
onClick:
|
|
356
|
+
onClick: _ ? void 0 : F,
|
|
357
357
|
role: "combobox",
|
|
358
|
-
"aria-expanded":
|
|
358
|
+
"aria-expanded": w,
|
|
359
359
|
"aria-haspopup": "listbox",
|
|
360
|
-
tabIndex: c ||
|
|
360
|
+
tabIndex: c || _ ? -1 : 0,
|
|
361
361
|
...B,
|
|
362
362
|
children: [
|
|
363
363
|
o && /* @__PURE__ */ s("div", { className: "clarity-select__start-icon", children: o }),
|
|
364
|
-
/* @__PURE__ */
|
|
365
|
-
|
|
364
|
+
/* @__PURE__ */ b("div", { className: "clarity-select__field", children: [
|
|
365
|
+
_ ? /* @__PURE__ */ s(
|
|
366
366
|
"input",
|
|
367
367
|
{
|
|
368
368
|
ref: M,
|
|
369
369
|
type: "text",
|
|
370
370
|
className: "clarity-select__search-input",
|
|
371
|
-
value:
|
|
371
|
+
value: w ? A : H ? H.label : "",
|
|
372
372
|
onChange: te,
|
|
373
373
|
onKeyDown: G,
|
|
374
374
|
onFocus: () => {
|
|
375
|
-
|
|
375
|
+
w || (k(!0), x(!0), m == null || m());
|
|
376
376
|
},
|
|
377
377
|
placeholder: H ? H.label : y,
|
|
378
378
|
disabled: c,
|
|
379
|
-
readOnly: !
|
|
379
|
+
readOnly: !w
|
|
380
380
|
}
|
|
381
381
|
) : /* @__PURE__ */ s("div", { className: "clarity-select__display", children: H ? H.label : y }),
|
|
382
382
|
a && /* @__PURE__ */ s("label", { className: "clarity-select__label", children: a })
|
|
@@ -413,7 +413,7 @@ const lt = L.forwardRef(({
|
|
|
413
413
|
"div",
|
|
414
414
|
{
|
|
415
415
|
className: "clarity-select__end-icon",
|
|
416
|
-
onClick:
|
|
416
|
+
onClick: _ ? F : void 0,
|
|
417
417
|
children: u || /* @__PURE__ */ s(
|
|
418
418
|
"svg",
|
|
419
419
|
{
|
|
@@ -436,7 +436,7 @@ const lt = L.forwardRef(({
|
|
|
436
436
|
)
|
|
437
437
|
}
|
|
438
438
|
),
|
|
439
|
-
|
|
439
|
+
w && /* @__PURE__ */ s("div", { className: "clarity-select__dropdown", children: /* @__PURE__ */ s("ul", { className: "clarity-select__options", role: "listbox", children: V.length > 0 ? V.map((C) => /* @__PURE__ */ s(
|
|
440
440
|
"li",
|
|
441
441
|
{
|
|
442
442
|
className: [
|
|
@@ -469,29 +469,29 @@ const nt = Ke(({
|
|
|
469
469
|
errorMessage: u,
|
|
470
470
|
disabled: i = !1,
|
|
471
471
|
variant: c = "primary",
|
|
472
|
-
size:
|
|
472
|
+
size: d = "medium",
|
|
473
473
|
maxSelectedLabels: v = 3,
|
|
474
|
-
selectionLimit:
|
|
474
|
+
selectionLimit: m,
|
|
475
475
|
className: f = "",
|
|
476
|
-
id:
|
|
476
|
+
id: p,
|
|
477
477
|
name: h,
|
|
478
478
|
required: y = !1,
|
|
479
479
|
"data-testid": N,
|
|
480
|
-
...
|
|
480
|
+
..._
|
|
481
481
|
}, B) => {
|
|
482
|
-
const [$,
|
|
482
|
+
const [$, w] = T(!1), [k, L] = T(""), [x, j] = T(!1), I = P(null), A = P(null), O = P(null), g = (C) => {
|
|
483
483
|
I.current = C, B && (typeof B == "function" ? B(C) : B.current = C);
|
|
484
484
|
};
|
|
485
|
-
|
|
485
|
+
S(() => {
|
|
486
486
|
const C = (D) => {
|
|
487
|
-
I.current && !I.current.contains(D.target) && (
|
|
487
|
+
I.current && !I.current.contains(D.target) && (w(!1), j(!1), L(""));
|
|
488
488
|
};
|
|
489
489
|
return document.addEventListener("click", C), () => document.removeEventListener("click", C);
|
|
490
490
|
}, []);
|
|
491
491
|
const M = e.filter(
|
|
492
492
|
(C) => C.label.toLowerCase().includes(k.toLowerCase())
|
|
493
493
|
), V = () => {
|
|
494
|
-
i || (
|
|
494
|
+
i || (w(!$), j(!$), $ ? L("") : setTimeout(() => {
|
|
495
495
|
var C;
|
|
496
496
|
(C = A.current) == null || C.focus();
|
|
497
497
|
}, 100));
|
|
@@ -509,16 +509,16 @@ const nt = Ke(({
|
|
|
509
509
|
}, te = (C) => {
|
|
510
510
|
C.stopPropagation(), !i && (a == null || a([]));
|
|
511
511
|
}, G = (C) => {
|
|
512
|
-
|
|
512
|
+
L(C.target.value);
|
|
513
513
|
}, H = (C) => {
|
|
514
|
-
C.key === "Escape" && (
|
|
514
|
+
C.key === "Escape" && (w(!1), j(!1), L(""));
|
|
515
515
|
}, le = x || $ || t.length > 0, re = () => {
|
|
516
516
|
if (t.length === 0) return null;
|
|
517
517
|
const C = t.map(
|
|
518
518
|
(R) => e.find((se) => se.value === R)
|
|
519
519
|
).filter(Boolean), D = C.slice(0, v), U = C.length - v;
|
|
520
|
-
return /* @__PURE__ */
|
|
521
|
-
D.map((R) => /* @__PURE__ */
|
|
520
|
+
return /* @__PURE__ */ b("div", { className: "clarity-multiselect__chips", children: [
|
|
521
|
+
D.map((R) => /* @__PURE__ */ b("div", { className: "clarity-multiselect__chip", children: [
|
|
522
522
|
/* @__PURE__ */ s("span", { className: "clarity-multiselect__chip-label", children: R.label }),
|
|
523
523
|
!i && /* @__PURE__ */ s(
|
|
524
524
|
"button",
|
|
@@ -531,7 +531,7 @@ const nt = Ke(({
|
|
|
531
531
|
}
|
|
532
532
|
)
|
|
533
533
|
] }, R.value)),
|
|
534
|
-
U > 0 && /* @__PURE__ */
|
|
534
|
+
U > 0 && /* @__PURE__ */ b("div", { className: "clarity-multiselect__chip clarity-multiselect__chip--count", children: [
|
|
535
535
|
"+",
|
|
536
536
|
U,
|
|
537
537
|
" mais"
|
|
@@ -543,7 +543,7 @@ const nt = Ke(({
|
|
|
543
543
|
].filter(Boolean).join(" "), oe = [
|
|
544
544
|
"clarity-multiselect",
|
|
545
545
|
`clarity-multiselect--${c}`,
|
|
546
|
-
`clarity-multiselect--${
|
|
546
|
+
`clarity-multiselect--${d}`,
|
|
547
547
|
$ && "clarity-multiselect--open",
|
|
548
548
|
x && "clarity-multiselect--focused",
|
|
549
549
|
le && "clarity-multiselect--label-up",
|
|
@@ -551,27 +551,27 @@ const nt = Ke(({
|
|
|
551
551
|
i && "clarity-multiselect--disabled",
|
|
552
552
|
t.length > 0 && "clarity-multiselect--has-value"
|
|
553
553
|
].filter(Boolean).join(" ");
|
|
554
|
-
return /* @__PURE__ */
|
|
555
|
-
/* @__PURE__ */
|
|
554
|
+
return /* @__PURE__ */ b("div", { className: ie, children: [
|
|
555
|
+
/* @__PURE__ */ b(
|
|
556
556
|
"div",
|
|
557
557
|
{
|
|
558
558
|
ref: g,
|
|
559
559
|
className: oe,
|
|
560
560
|
"data-testid": N,
|
|
561
|
-
...
|
|
561
|
+
..._,
|
|
562
562
|
children: [
|
|
563
|
-
/* @__PURE__ */
|
|
563
|
+
/* @__PURE__ */ b(
|
|
564
564
|
"div",
|
|
565
565
|
{
|
|
566
566
|
className: "clarity-multiselect__field",
|
|
567
567
|
onClick: V,
|
|
568
568
|
children: [
|
|
569
|
-
n && /* @__PURE__ */
|
|
569
|
+
n && /* @__PURE__ */ b("label", { className: "clarity-multiselect__label", children: [
|
|
570
570
|
n,
|
|
571
571
|
y && /* @__PURE__ */ s("span", { className: "clarity-multiselect__required", children: "*" })
|
|
572
572
|
] }),
|
|
573
573
|
/* @__PURE__ */ s("div", { className: "clarity-multiselect__content", children: t.length > 0 ? re() : /* @__PURE__ */ s("span", { className: "clarity-multiselect__placeholder", children: l }) }),
|
|
574
|
-
/* @__PURE__ */
|
|
574
|
+
/* @__PURE__ */ b("div", { className: "clarity-multiselect__icons", children: [
|
|
575
575
|
t.length > 0 && !i && /* @__PURE__ */ s(
|
|
576
576
|
"button",
|
|
577
577
|
{
|
|
@@ -596,7 +596,7 @@ const nt = Ke(({
|
|
|
596
596
|
]
|
|
597
597
|
}
|
|
598
598
|
),
|
|
599
|
-
$ && /* @__PURE__ */
|
|
599
|
+
$ && /* @__PURE__ */ b("div", { ref: O, className: "clarity-multiselect__dropdown", children: [
|
|
600
600
|
/* @__PURE__ */ s("div", { className: "clarity-multiselect__search", children: /* @__PURE__ */ s(
|
|
601
601
|
"input",
|
|
602
602
|
{
|
|
@@ -611,7 +611,7 @@ const nt = Ke(({
|
|
|
611
611
|
) }),
|
|
612
612
|
/* @__PURE__ */ s("ul", { className: "clarity-multiselect__options", children: M.length > 0 ? M.map((C) => {
|
|
613
613
|
const D = t.includes(C.value), U = C.disabled || i;
|
|
614
|
-
return /* @__PURE__ */
|
|
614
|
+
return /* @__PURE__ */ b(
|
|
615
615
|
"li",
|
|
616
616
|
{
|
|
617
617
|
className: [
|
|
@@ -666,7 +666,7 @@ const fe = z(null), pe = () => {
|
|
|
666
666
|
"clarity-modal-close",
|
|
667
667
|
n && `clarity-modal-close--${n}`
|
|
668
668
|
].filter(Boolean).join(" ");
|
|
669
|
-
return /* @__PURE__ */
|
|
669
|
+
return /* @__PURE__ */ b("div", { className: o, children: [
|
|
670
670
|
a && /* @__PURE__ */ s("h2", { className: "clarity-modal-title", children: a }),
|
|
671
671
|
e,
|
|
672
672
|
r && /* @__PURE__ */ s("button", { className: u, onClick: (i) => {
|
|
@@ -677,7 +677,7 @@ const fe = z(null), pe = () => {
|
|
|
677
677
|
he.displayName = "Modal.Header";
|
|
678
678
|
const ye = ({ children: e, className: t = "" }) => /* @__PURE__ */ s("div", { className: `clarity-modal-content ${t}`, children: e });
|
|
679
679
|
ye.displayName = "Modal.Content";
|
|
680
|
-
const ve = ({ children: e, className: t = "" }) => /* @__PURE__ */
|
|
680
|
+
const ve = ({ children: e, className: t = "" }) => /* @__PURE__ */ b("div", { className: `clarity-modal-footer ${t}`, children: [
|
|
681
681
|
/* @__PURE__ */ s("div", { className: "clarity-modal-scroll-indicator" }),
|
|
682
682
|
e
|
|
683
683
|
] });
|
|
@@ -711,29 +711,29 @@ const J = ({
|
|
|
711
711
|
showCloseButton: u = !0,
|
|
712
712
|
closeOnOverlayClick: i = !0
|
|
713
713
|
}) => {
|
|
714
|
-
const [c,
|
|
715
|
-
|
|
714
|
+
const [c, d] = T(!1), m = e !== void 0 ? e : c, f = t || (() => {
|
|
715
|
+
d(!1);
|
|
716
716
|
});
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
}, [
|
|
720
|
-
const
|
|
717
|
+
S(() => {
|
|
718
|
+
m && (a == null || a());
|
|
719
|
+
}, [m, a]), S(() => {
|
|
720
|
+
const _ = (B) => {
|
|
721
721
|
B.key === "Escape" && f();
|
|
722
722
|
};
|
|
723
|
-
return
|
|
724
|
-
document.removeEventListener("keydown",
|
|
723
|
+
return m ? (document.addEventListener("keydown", _), document.body.style.overflow = "hidden") : document.body.style.overflow = "unset", () => {
|
|
724
|
+
document.removeEventListener("keydown", _), document.body.style.overflow = "unset";
|
|
725
725
|
};
|
|
726
|
-
}, [
|
|
727
|
-
const
|
|
728
|
-
i &&
|
|
729
|
-
}, h =
|
|
730
|
-
(
|
|
731
|
-
), y =
|
|
732
|
-
(
|
|
726
|
+
}, [m, f]);
|
|
727
|
+
const p = (_) => {
|
|
728
|
+
i && _.target === _.currentTarget && f();
|
|
729
|
+
}, h = E.Children.toArray(l).find(
|
|
730
|
+
(_) => Z(_) && _.type.displayName === "Modal.Trigger"
|
|
731
|
+
), y = E.Children.toArray(l).filter(
|
|
732
|
+
(_) => Z(_) && _.type.displayName !== "Modal.Trigger"
|
|
733
733
|
), N = ["clarity-modal", n, `clarity-modal--${o}`].filter(Boolean).join(" ");
|
|
734
|
-
return /* @__PURE__ */
|
|
735
|
-
h && W(h, { onClick: () =>
|
|
736
|
-
|
|
734
|
+
return /* @__PURE__ */ b(fe.Provider, { value: { onClose: f, variant: r, showCloseButton: u }, children: [
|
|
735
|
+
h && W(h, { onClick: () => d(!0), variant: r }),
|
|
736
|
+
m && /* @__PURE__ */ s("div", { className: "clarity-modal-overlay", onClick: p, children: /* @__PURE__ */ s("div", { className: N, children: y }) })
|
|
737
737
|
] });
|
|
738
738
|
};
|
|
739
739
|
J.Header = he;
|
|
@@ -749,16 +749,16 @@ const be = z(void 0), kt = () => {
|
|
|
749
749
|
return e;
|
|
750
750
|
}, rt = ({ id: e, message: t, variant: a, duration: l, onClose: n, invertColors: r }) => {
|
|
751
751
|
const [o, u] = T("entering");
|
|
752
|
-
|
|
752
|
+
S(() => {
|
|
753
753
|
const c = setTimeout(() => {
|
|
754
754
|
u("visible");
|
|
755
|
-
}, 10),
|
|
755
|
+
}, 10), d = setTimeout(() => {
|
|
756
756
|
u("exiting");
|
|
757
757
|
}, l * 1e3 - 300), v = setTimeout(() => {
|
|
758
758
|
n(e);
|
|
759
759
|
}, l * 1e3);
|
|
760
760
|
return () => {
|
|
761
|
-
clearTimeout(c), clearTimeout(
|
|
761
|
+
clearTimeout(c), clearTimeout(d), clearTimeout(v);
|
|
762
762
|
};
|
|
763
763
|
}, [e, l, n]);
|
|
764
764
|
const i = [
|
|
@@ -767,7 +767,7 @@ const be = z(void 0), kt = () => {
|
|
|
767
767
|
r ? "colored-background" : "",
|
|
768
768
|
`cl-toast-${o}`
|
|
769
769
|
].filter(Boolean).join(" ");
|
|
770
|
-
return /* @__PURE__ */
|
|
770
|
+
return /* @__PURE__ */ b("div", { className: i, children: [
|
|
771
771
|
/* @__PURE__ */ s("div", { className: "cl-toast-message", children: t }),
|
|
772
772
|
/* @__PURE__ */ s("button", { onClick: () => u("exiting"), className: "cl-toast-close-button", children: "×" }),
|
|
773
773
|
/* @__PURE__ */ s(
|
|
@@ -786,30 +786,30 @@ const be = z(void 0), kt = () => {
|
|
|
786
786
|
}
|
|
787
787
|
return null;
|
|
788
788
|
}, []);
|
|
789
|
-
|
|
789
|
+
S(() => {
|
|
790
790
|
if (l)
|
|
791
791
|
return document.body.appendChild(l), () => {
|
|
792
792
|
document.body.removeChild(l);
|
|
793
793
|
};
|
|
794
794
|
}, [l]);
|
|
795
795
|
const n = ne((i) => {
|
|
796
|
-
const
|
|
796
|
+
const d = {
|
|
797
797
|
id: (/* @__PURE__ */ new Date()).toISOString() + Math.random(),
|
|
798
798
|
// duration: 5,
|
|
799
799
|
// position: 'right-top',
|
|
800
800
|
...i
|
|
801
801
|
};
|
|
802
802
|
a((v) => {
|
|
803
|
-
const
|
|
804
|
-
return
|
|
803
|
+
const m = [d, ...v];
|
|
804
|
+
return m.length > 4 ? m.slice(0, 4) : m;
|
|
805
805
|
});
|
|
806
806
|
}, []), r = ne((i) => {
|
|
807
|
-
a((c) => c.filter((
|
|
807
|
+
a((c) => c.filter((d) => d.id !== i));
|
|
808
808
|
}, []), o = Y(() => t.reduce((i, c) => (i[c.position] || (i[c.position] = []), i[c.position].push(c), i), {}), [t]), u = Y(() => ({ show: n }), [n]);
|
|
809
|
-
return /* @__PURE__ */
|
|
809
|
+
return /* @__PURE__ */ b(be.Provider, { value: u, children: [
|
|
810
810
|
e,
|
|
811
811
|
l && tt.createPortal(
|
|
812
|
-
Object.entries(o).map(([i, c]) => /* @__PURE__ */ s("div", { className: `cl-toast-container ${i}`, children: c.map((
|
|
812
|
+
Object.entries(o).map(([i, c]) => /* @__PURE__ */ s("div", { className: `cl-toast-container ${i}`, children: c.map((d) => /* @__PURE__ */ s(rt, { ...d, onClose: r }, d.id)) }, i)),
|
|
813
813
|
l
|
|
814
814
|
)
|
|
815
815
|
] });
|
|
@@ -818,7 +818,7 @@ const be = z(void 0), kt = () => {
|
|
|
818
818
|
if (!e)
|
|
819
819
|
throw new Error("useOffcanvas must be used within an Offcanvas provider");
|
|
820
820
|
return e;
|
|
821
|
-
},
|
|
821
|
+
}, ge = ({
|
|
822
822
|
children: e,
|
|
823
823
|
className: t = ""
|
|
824
824
|
}) => {
|
|
@@ -832,7 +832,7 @@ const be = z(void 0), kt = () => {
|
|
|
832
832
|
"clarity-offcanvas-title",
|
|
833
833
|
l && `clarity-offcanvas-title--${l}`
|
|
834
834
|
].filter(Boolean).join(" ");
|
|
835
|
-
return /* @__PURE__ */
|
|
835
|
+
return /* @__PURE__ */ b("div", { className: o, children: [
|
|
836
836
|
r && /* @__PURE__ */ s("h2", { className: i, children: r }),
|
|
837
837
|
e,
|
|
838
838
|
n && /* @__PURE__ */ s("button", { className: u, onClick: (c) => {
|
|
@@ -840,9 +840,9 @@ const be = z(void 0), kt = () => {
|
|
|
840
840
|
}, children: "×" })
|
|
841
841
|
] });
|
|
842
842
|
};
|
|
843
|
-
|
|
844
|
-
const
|
|
845
|
-
|
|
843
|
+
ge.displayName = "Offcanvas.Header";
|
|
844
|
+
const $e = ({ children: e, className: t = "" }) => /* @__PURE__ */ s("div", { className: `clarity-offcanvas-content ${t}`, children: e });
|
|
845
|
+
$e.displayName = "Offcanvas.Content";
|
|
846
846
|
const ke = ({ children: e, onClick: t, variant: a }) => W(e, {
|
|
847
847
|
onClick: (l) => {
|
|
848
848
|
var n, r;
|
|
@@ -875,12 +875,12 @@ const K = ({
|
|
|
875
875
|
showCloseButton: i = !0,
|
|
876
876
|
title: c
|
|
877
877
|
}) => {
|
|
878
|
-
const [
|
|
878
|
+
const [d, v] = T(!1), [m, f] = T(!1), [p, h] = T(!1), y = e !== void 0, N = y ? e : d, _ = ne(() => {
|
|
879
879
|
t ? t() : v(!1);
|
|
880
880
|
}, [t]), B = ne(() => {
|
|
881
881
|
y || v(!0), a == null || a();
|
|
882
882
|
}, [y, a]);
|
|
883
|
-
|
|
883
|
+
S(() => {
|
|
884
884
|
if (N) {
|
|
885
885
|
h(!0);
|
|
886
886
|
const g = setTimeout(() => {
|
|
@@ -894,31 +894,31 @@ const K = ({
|
|
|
894
894
|
}, 300);
|
|
895
895
|
return () => clearTimeout(g);
|
|
896
896
|
}
|
|
897
|
-
}, [N]),
|
|
897
|
+
}, [N]), S(() => {
|
|
898
898
|
const g = (M) => {
|
|
899
|
-
M.key === "Escape" &&
|
|
899
|
+
M.key === "Escape" && _();
|
|
900
900
|
};
|
|
901
901
|
return N ? (document.addEventListener("keydown", g), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", g), document.body.style.overflow = "unset"), () => {
|
|
902
902
|
document.removeEventListener("keydown", g), document.body.style.overflow = "unset";
|
|
903
903
|
};
|
|
904
|
-
}, [N,
|
|
904
|
+
}, [N, _]);
|
|
905
905
|
const $ = (g) => {
|
|
906
|
-
u && g.target === g.currentTarget &&
|
|
907
|
-
},
|
|
908
|
-
let k,
|
|
909
|
-
|
|
906
|
+
u && g.target === g.currentTarget && _();
|
|
907
|
+
}, w = E.Children.toArray(l);
|
|
908
|
+
let k, L, x, j, I;
|
|
909
|
+
w.forEach((g) => {
|
|
910
910
|
if (Z(g))
|
|
911
911
|
if (g.type.displayName === "Offcanvas.Trigger")
|
|
912
912
|
k = g;
|
|
913
913
|
else if (g.type.displayName === "Offcanvas.Header")
|
|
914
|
-
|
|
914
|
+
L = g;
|
|
915
915
|
else if (g.type.displayName === "Offcanvas.Content") {
|
|
916
916
|
x = g;
|
|
917
|
-
const V =
|
|
917
|
+
const V = E.Children.toArray(x.props.children).filter((F) => Z(F) && F.type.displayName === "Offcanvas.Close" ? (I = F, !1) : !0);
|
|
918
918
|
x = W(x, { children: V });
|
|
919
919
|
} else g.type.displayName === "Offcanvas.Footer" && (j = g);
|
|
920
920
|
}), I && (j ? j = W(j, {
|
|
921
|
-
children: /* @__PURE__ */
|
|
921
|
+
children: /* @__PURE__ */ b(Ze, { children: [
|
|
922
922
|
j.props.children,
|
|
923
923
|
I
|
|
924
924
|
] })
|
|
@@ -928,16 +928,16 @@ const K = ({
|
|
|
928
928
|
n,
|
|
929
929
|
`clarity-offcanvas--${o}`,
|
|
930
930
|
r && `clarity-offcanvas--${r}`,
|
|
931
|
-
|
|
932
|
-
].filter(Boolean).join(" "),
|
|
931
|
+
m ? "clarity-offcanvas--open" : "clarity-offcanvas--closed"
|
|
932
|
+
].filter(Boolean).join(" "), O = [
|
|
933
933
|
"clarity-offcanvas-overlay",
|
|
934
|
-
|
|
934
|
+
m ? "clarity-offcanvas-overlay--visible" : ""
|
|
935
935
|
].filter(Boolean).join(" ");
|
|
936
|
-
return /* @__PURE__ */
|
|
936
|
+
return /* @__PURE__ */ b(_e.Provider, { value: { onClose: _, variant: r, showCloseButton: i, placement: o, title: c }, children: [
|
|
937
937
|
k && W(k, { onClick: B, variant: r }),
|
|
938
|
-
|
|
939
|
-
/* @__PURE__ */ s("div", { className:
|
|
940
|
-
|
|
938
|
+
p && // Only render if shouldRender is true
|
|
939
|
+
/* @__PURE__ */ s("div", { className: O, onClick: $, children: /* @__PURE__ */ b("div", { className: A, children: [
|
|
940
|
+
L,
|
|
941
941
|
x,
|
|
942
942
|
j && /* @__PURE__ */ s("div", { className: "clarity-offcanvas-scroll-indicator" }),
|
|
943
943
|
" ",
|
|
@@ -945,13 +945,13 @@ const K = ({
|
|
|
945
945
|
] }) })
|
|
946
946
|
] });
|
|
947
947
|
};
|
|
948
|
-
K.Header =
|
|
949
|
-
K.Content =
|
|
948
|
+
K.Header = ge;
|
|
949
|
+
K.Content = $e;
|
|
950
950
|
K.Footer = ce;
|
|
951
951
|
K.Trigger = ke;
|
|
952
952
|
K.Close = xe;
|
|
953
953
|
K.displayName = "Offcanvas";
|
|
954
|
-
const it =
|
|
954
|
+
const it = E.forwardRef(({
|
|
955
955
|
type: e,
|
|
956
956
|
variant: t = "primary",
|
|
957
957
|
size: a = "medium",
|
|
@@ -962,11 +962,11 @@ const it = L.forwardRef(({
|
|
|
962
962
|
labelPosition: u = "right",
|
|
963
963
|
className: i = "",
|
|
964
964
|
disabled: c = !1,
|
|
965
|
-
checked:
|
|
965
|
+
checked: d,
|
|
966
966
|
id: v,
|
|
967
|
-
...
|
|
967
|
+
...m
|
|
968
968
|
}, f) => {
|
|
969
|
-
const
|
|
969
|
+
const p = v || `check-input-${Math.random().toString(36).substr(2, 9)}`, h = [
|
|
970
970
|
"clarity-check-input-wrapper",
|
|
971
971
|
`clarity-check-input-wrapper--${u}`,
|
|
972
972
|
c && "clarity-check-input-wrapper--disabled",
|
|
@@ -984,21 +984,21 @@ const it = L.forwardRef(({
|
|
|
984
984
|
`clarity-check-input__label--${a}`,
|
|
985
985
|
c && "clarity-check-input__label--disabled"
|
|
986
986
|
].filter(Boolean).join(" ");
|
|
987
|
-
return /* @__PURE__ */
|
|
988
|
-
/* @__PURE__ */
|
|
987
|
+
return /* @__PURE__ */ b("div", { className: "clarity-check-input-container", children: [
|
|
988
|
+
/* @__PURE__ */ b("label", { className: h, htmlFor: p, children: [
|
|
989
989
|
/* @__PURE__ */ s(
|
|
990
990
|
"input",
|
|
991
991
|
{
|
|
992
992
|
ref: f,
|
|
993
|
-
id:
|
|
993
|
+
id: p,
|
|
994
994
|
type: e,
|
|
995
995
|
className: y,
|
|
996
996
|
disabled: c,
|
|
997
|
-
checked:
|
|
998
|
-
...
|
|
997
|
+
checked: d,
|
|
998
|
+
...m
|
|
999
999
|
}
|
|
1000
1000
|
),
|
|
1001
|
-
/* @__PURE__ */
|
|
1001
|
+
/* @__PURE__ */ b("div", { className: "clarity-check-input__custom", children: [
|
|
1002
1002
|
e === "checkbox" && /* @__PURE__ */ s(
|
|
1003
1003
|
"svg",
|
|
1004
1004
|
{
|
|
@@ -1026,7 +1026,7 @@ const it = L.forwardRef(({
|
|
|
1026
1026
|
] });
|
|
1027
1027
|
});
|
|
1028
1028
|
it.displayName = "CheckInput";
|
|
1029
|
-
const ot =
|
|
1029
|
+
const ot = E.forwardRef(({
|
|
1030
1030
|
variant: e = "primary",
|
|
1031
1031
|
size: t = "medium",
|
|
1032
1032
|
label: a,
|
|
@@ -1037,10 +1037,10 @@ const ot = L.forwardRef(({
|
|
|
1037
1037
|
className: u = "",
|
|
1038
1038
|
disabled: i = !1,
|
|
1039
1039
|
checked: c,
|
|
1040
|
-
id:
|
|
1040
|
+
id: d,
|
|
1041
1041
|
...v
|
|
1042
|
-
},
|
|
1043
|
-
const f =
|
|
1042
|
+
}, m) => {
|
|
1043
|
+
const f = d || `input-switch-${Math.random().toString(36).substr(2, 9)}`, p = [
|
|
1044
1044
|
"clarity-input-switch-wrapper",
|
|
1045
1045
|
`clarity-input-switch-wrapper--${o}`,
|
|
1046
1046
|
i && "clarity-input-switch-wrapper--disabled",
|
|
@@ -1057,12 +1057,12 @@ const ot = L.forwardRef(({
|
|
|
1057
1057
|
`clarity-input-switch__label--${t}`,
|
|
1058
1058
|
i && "clarity-input-switch__label--disabled"
|
|
1059
1059
|
].filter(Boolean).join(" ");
|
|
1060
|
-
return /* @__PURE__ */
|
|
1061
|
-
/* @__PURE__ */
|
|
1060
|
+
return /* @__PURE__ */ b("div", { className: "clarity-input-switch-container", children: [
|
|
1061
|
+
/* @__PURE__ */ b("label", { className: p, htmlFor: f, children: [
|
|
1062
1062
|
/* @__PURE__ */ s(
|
|
1063
1063
|
"input",
|
|
1064
1064
|
{
|
|
1065
|
-
ref:
|
|
1065
|
+
ref: m,
|
|
1066
1066
|
id: f,
|
|
1067
1067
|
type: "checkbox",
|
|
1068
1068
|
className: h,
|
|
@@ -1090,16 +1090,16 @@ const Te = z(null), de = () => {
|
|
|
1090
1090
|
Be.displayName = "ConfirmationDialog.Header";
|
|
1091
1091
|
const je = ({ children: e, className: t = "" }) => /* @__PURE__ */ s("div", { className: `clarity-confirmation-dialog-content ${t}`, children: e });
|
|
1092
1092
|
je.displayName = "ConfirmationDialog.Content";
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1095
|
-
const
|
|
1093
|
+
const Ee = ({ children: e, className: t = "" }) => /* @__PURE__ */ s("div", { className: `clarity-confirmation-dialog-footer ${t}`, children: e });
|
|
1094
|
+
Ee.displayName = "ConfirmationDialog.Footer";
|
|
1095
|
+
const Le = ({ children: e }) => W(e, {
|
|
1096
1096
|
onClick: (t) => {
|
|
1097
1097
|
var a, l;
|
|
1098
1098
|
(l = (a = e.props).onClick) == null || l.call(a, t);
|
|
1099
1099
|
}
|
|
1100
1100
|
});
|
|
1101
|
-
|
|
1102
|
-
const
|
|
1101
|
+
Le.displayName = "ConfirmationDialog.Trigger";
|
|
1102
|
+
const Oe = ({ children: e }) => {
|
|
1103
1103
|
const { onClose: t } = de();
|
|
1104
1104
|
return W(e, {
|
|
1105
1105
|
onClick: (a) => {
|
|
@@ -1108,8 +1108,8 @@ const Se = ({ children: e }) => {
|
|
|
1108
1108
|
}
|
|
1109
1109
|
});
|
|
1110
1110
|
};
|
|
1111
|
-
|
|
1112
|
-
const
|
|
1111
|
+
Oe.displayName = "ConfirmationDialog.Close";
|
|
1112
|
+
const Se = ({ children: e }) => {
|
|
1113
1113
|
const { onConfirm: t } = de();
|
|
1114
1114
|
return W(e, {
|
|
1115
1115
|
onClick: (a) => {
|
|
@@ -1118,7 +1118,7 @@ const Oe = ({ children: e }) => {
|
|
|
1118
1118
|
}
|
|
1119
1119
|
});
|
|
1120
1120
|
};
|
|
1121
|
-
|
|
1121
|
+
Se.displayName = "ConfirmationDialog.Confirm";
|
|
1122
1122
|
const Q = ({
|
|
1123
1123
|
isOpen: e,
|
|
1124
1124
|
onClose: t,
|
|
@@ -1128,80 +1128,76 @@ const Q = ({
|
|
|
1128
1128
|
}) => {
|
|
1129
1129
|
const [r, o] = T(!1), u = e !== void 0, i = u ? e : r, c = () => {
|
|
1130
1130
|
u || o(!0);
|
|
1131
|
-
},
|
|
1131
|
+
}, d = () => {
|
|
1132
1132
|
t ? t() : o(!1);
|
|
1133
1133
|
}, v = () => {
|
|
1134
|
-
a && a(),
|
|
1134
|
+
a && a(), d();
|
|
1135
1135
|
};
|
|
1136
|
-
|
|
1136
|
+
S(() => {
|
|
1137
1137
|
const h = (y) => {
|
|
1138
|
-
y.key === "Escape" &&
|
|
1138
|
+
y.key === "Escape" && d();
|
|
1139
1139
|
};
|
|
1140
1140
|
return i ? (document.addEventListener("keydown", h), document.body.style.overflow = "hidden") : document.body.style.overflow = "unset", () => {
|
|
1141
1141
|
document.removeEventListener("keydown", h), document.body.style.overflow = "unset";
|
|
1142
1142
|
};
|
|
1143
|
-
}, [i,
|
|
1144
|
-
const
|
|
1143
|
+
}, [i, d]);
|
|
1144
|
+
const m = E.Children.toArray(n).find(
|
|
1145
1145
|
(h) => Z(h) && h.type.displayName === "ConfirmationDialog.Trigger"
|
|
1146
|
-
), f =
|
|
1146
|
+
), f = E.Children.toArray(n).filter(
|
|
1147
1147
|
(h) => Z(h) && h.type.displayName !== "ConfirmationDialog.Trigger"
|
|
1148
|
-
),
|
|
1149
|
-
return /* @__PURE__ */
|
|
1150
|
-
|
|
1151
|
-
i && /* @__PURE__ */ s("div", { className: "clarity-modal-overlay", children: /* @__PURE__ */ s("div", { className:
|
|
1148
|
+
), p = `clarity-confirmation-dialog clarity-confirmation-dialog--${l}`;
|
|
1149
|
+
return /* @__PURE__ */ b(Te.Provider, { value: { variant: l, onClose: d, onConfirm: v, onOpen: c }, children: [
|
|
1150
|
+
m,
|
|
1151
|
+
i && /* @__PURE__ */ s("div", { className: "clarity-modal-overlay", children: /* @__PURE__ */ s("div", { className: p, children: f }) })
|
|
1152
1152
|
] });
|
|
1153
1153
|
};
|
|
1154
1154
|
Q.Header = Be;
|
|
1155
1155
|
Q.Content = je;
|
|
1156
|
-
Q.Footer =
|
|
1157
|
-
Q.Trigger =
|
|
1158
|
-
Q.Close =
|
|
1159
|
-
Q.Confirm =
|
|
1156
|
+
Q.Footer = Ee;
|
|
1157
|
+
Q.Trigger = Le;
|
|
1158
|
+
Q.Close = Oe;
|
|
1159
|
+
Q.Confirm = Se;
|
|
1160
1160
|
Q.displayName = "ConfirmationDialog";
|
|
1161
1161
|
const Tt = ({
|
|
1162
1162
|
variant: e = "primary",
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
title: p,
|
|
1175
|
-
...f
|
|
1163
|
+
size: t = "medium",
|
|
1164
|
+
disabled: a = !1,
|
|
1165
|
+
loading: l = !1,
|
|
1166
|
+
children: n,
|
|
1167
|
+
onClick: r,
|
|
1168
|
+
type: o = "button",
|
|
1169
|
+
className: u = "",
|
|
1170
|
+
"aria-label": i,
|
|
1171
|
+
title: c,
|
|
1172
|
+
customColor: d,
|
|
1173
|
+
...v
|
|
1176
1174
|
}) => {
|
|
1177
|
-
const
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
`${
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
].filter(Boolean).join(" "),
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
"--custom-bg-color": `var(--clarity-${t}-${a})`,
|
|
1189
|
-
"--custom-hover-color": `var(--clarity-${t}-${l || b(a)})`
|
|
1175
|
+
const m = "clarity-button-icon", f = [
|
|
1176
|
+
m,
|
|
1177
|
+
!d && `${m}--${e}`,
|
|
1178
|
+
`${m}--${t}`,
|
|
1179
|
+
l && `${m}--loading`,
|
|
1180
|
+
a && `${m}--disabled`,
|
|
1181
|
+
u
|
|
1182
|
+
].filter(Boolean).join(" "), p = d ? {
|
|
1183
|
+
"--button-icon-bg": d,
|
|
1184
|
+
"--button-icon-hover-bg": `${d}E6`
|
|
1185
|
+
// Add some transparency for hover
|
|
1190
1186
|
} : {};
|
|
1191
|
-
return /* @__PURE__ */
|
|
1187
|
+
return /* @__PURE__ */ b(
|
|
1192
1188
|
"button",
|
|
1193
1189
|
{
|
|
1194
|
-
className:
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
...
|
|
1190
|
+
className: f,
|
|
1191
|
+
disabled: a || l,
|
|
1192
|
+
onClick: r,
|
|
1193
|
+
type: o,
|
|
1194
|
+
"aria-label": i,
|
|
1195
|
+
title: c,
|
|
1196
|
+
style: p,
|
|
1197
|
+
...v,
|
|
1202
1198
|
children: [
|
|
1203
|
-
|
|
1204
|
-
!
|
|
1199
|
+
l && /* @__PURE__ */ s("div", { className: `${m}__spinner` }),
|
|
1200
|
+
!l && n
|
|
1205
1201
|
]
|
|
1206
1202
|
}
|
|
1207
1203
|
);
|
|
@@ -1216,11 +1212,11 @@ const Tt = ({
|
|
|
1216
1212
|
onClick: u,
|
|
1217
1213
|
href: i,
|
|
1218
1214
|
target: c,
|
|
1219
|
-
rel:
|
|
1215
|
+
rel: d,
|
|
1220
1216
|
className: v = "",
|
|
1221
|
-
...
|
|
1217
|
+
...m
|
|
1222
1218
|
}) => {
|
|
1223
|
-
const f = "clarity-button-link",
|
|
1219
|
+
const f = "clarity-button-link", p = t && a, h = p ? `${f}--custom` : `${f}--${e}`, y = [
|
|
1224
1220
|
f,
|
|
1225
1221
|
h,
|
|
1226
1222
|
`${f}--${n}`,
|
|
@@ -1229,7 +1225,7 @@ const Tt = ({
|
|
|
1229
1225
|
].filter(Boolean).join(" "), N = (B) => {
|
|
1230
1226
|
const $ = parseInt(B);
|
|
1231
1227
|
return $ >= 800 ? "900" : $ >= 700 ? "800" : $ >= 600 ? "700" : $ >= 500 ? "600" : $ >= 400 ? "500" : $ >= 300 ? "400" : $ >= 200 ? "300" : "200";
|
|
1232
|
-
},
|
|
1228
|
+
}, _ = p ? {
|
|
1233
1229
|
"--custom-color": `var(--clarity-${t}-${a})`,
|
|
1234
1230
|
"--custom-hover-color": `var(--clarity-${t}-${l || N(a)})`
|
|
1235
1231
|
} : {};
|
|
@@ -1238,21 +1234,21 @@ const Tt = ({
|
|
|
1238
1234
|
{
|
|
1239
1235
|
href: i,
|
|
1240
1236
|
target: c,
|
|
1241
|
-
rel:
|
|
1237
|
+
rel: d || (c === "_blank" ? "noopener noreferrer" : void 0),
|
|
1242
1238
|
className: y,
|
|
1243
|
-
style:
|
|
1239
|
+
style: _,
|
|
1244
1240
|
onClick: r ? void 0 : u,
|
|
1245
|
-
...
|
|
1241
|
+
...m,
|
|
1246
1242
|
children: o
|
|
1247
1243
|
}
|
|
1248
1244
|
) : /* @__PURE__ */ s(
|
|
1249
1245
|
"button",
|
|
1250
1246
|
{
|
|
1251
1247
|
className: y,
|
|
1252
|
-
style:
|
|
1248
|
+
style: _,
|
|
1253
1249
|
disabled: r,
|
|
1254
1250
|
onClick: u,
|
|
1255
|
-
...
|
|
1251
|
+
...m,
|
|
1256
1252
|
children: o
|
|
1257
1253
|
}
|
|
1258
1254
|
);
|
|
@@ -1272,23 +1268,23 @@ const Tt = ({
|
|
|
1272
1268
|
className: u = "",
|
|
1273
1269
|
children: i,
|
|
1274
1270
|
onSelect: c,
|
|
1275
|
-
...
|
|
1271
|
+
...d
|
|
1276
1272
|
}) => {
|
|
1277
|
-
const [v,
|
|
1273
|
+
const [v, m] = T(() => n ? Array.isArray(n) ? n : [n] : []), f = (w) => {
|
|
1278
1274
|
let k;
|
|
1279
|
-
r ? k = v.includes(
|
|
1280
|
-
},
|
|
1281
|
-
|
|
1275
|
+
r ? k = v.includes(w) ? v.filter((L) => L !== w) : [...v, w] : k = v.includes(w) ? [] : [w], m(k), c && c(v.includes(w) ? null : w, {});
|
|
1276
|
+
}, p = "clarity-accordion", h = t && a, y = h ? `${p}--custom` : `${p}--${e}`, N = [
|
|
1277
|
+
p,
|
|
1282
1278
|
y,
|
|
1283
|
-
o && `${
|
|
1279
|
+
o && `${p}--flush`,
|
|
1284
1280
|
u
|
|
1285
|
-
].filter(Boolean).join(" "),
|
|
1286
|
-
const k = parseInt(
|
|
1281
|
+
].filter(Boolean).join(" "), _ = (w) => {
|
|
1282
|
+
const k = parseInt(w);
|
|
1287
1283
|
return k >= 800 ? "900" : k >= 700 ? "800" : k >= 600 ? "700" : k >= 500 ? "600" : k >= 400 ? "500" : k >= 300 ? "400" : k >= 200 ? "300" : "200";
|
|
1288
1284
|
}, B = h ? {
|
|
1289
1285
|
"--custom-border-color": `var(--clarity-${t}-${a})`,
|
|
1290
1286
|
"--custom-header-color": `var(--clarity-${t}-${a})`,
|
|
1291
|
-
"--custom-hover-color": `var(--clarity-${t}-${l ||
|
|
1287
|
+
"--custom-hover-color": `var(--clarity-${t}-${l || _(a)})`
|
|
1292
1288
|
} : {}, $ = {
|
|
1293
1289
|
activeKeys: v,
|
|
1294
1290
|
toggleItem: f,
|
|
@@ -1299,7 +1295,7 @@ const Tt = ({
|
|
|
1299
1295
|
hoverTone: l,
|
|
1300
1296
|
flush: o
|
|
1301
1297
|
};
|
|
1302
|
-
return /* @__PURE__ */ s(Ie.Provider, { value: $, children: /* @__PURE__ */ s("div", { className: N, style: B, ...
|
|
1298
|
+
return /* @__PURE__ */ s(Ie.Provider, { value: $, children: /* @__PURE__ */ s("div", { className: N, style: B, ...d, children: i }) });
|
|
1303
1299
|
}, dt = ({
|
|
1304
1300
|
eventKey: e,
|
|
1305
1301
|
disabled: t = !1,
|
|
@@ -1313,7 +1309,7 @@ const Tt = ({
|
|
|
1313
1309
|
t && `${o}__item--disabled`,
|
|
1314
1310
|
a
|
|
1315
1311
|
].filter(Boolean).join(" ");
|
|
1316
|
-
return /* @__PURE__ */ s("div", { className: i, ...n, children:
|
|
1312
|
+
return /* @__PURE__ */ s("div", { className: i, ...n, children: E.Children.map(l, (c) => E.isValidElement(c) ? E.cloneElement(c, {
|
|
1317
1313
|
...c.props,
|
|
1318
1314
|
eventKey: e,
|
|
1319
1315
|
disabled: t,
|
|
@@ -1328,10 +1324,10 @@ const Tt = ({
|
|
|
1328
1324
|
isActive: r = !1,
|
|
1329
1325
|
...o
|
|
1330
1326
|
}) => {
|
|
1331
|
-
const { toggleItem: u } = De(), i = "clarity-accordion", c = (
|
|
1332
|
-
!n && l && u(l), a == null || a(
|
|
1327
|
+
const { toggleItem: u } = De(), i = "clarity-accordion", c = (d) => {
|
|
1328
|
+
!n && l && u(l), a == null || a(d);
|
|
1333
1329
|
};
|
|
1334
|
-
return /* @__PURE__ */
|
|
1330
|
+
return /* @__PURE__ */ b(
|
|
1335
1331
|
"button",
|
|
1336
1332
|
{
|
|
1337
1333
|
className: [`${i}__header`, e].filter(Boolean).join(" "),
|
|
@@ -1406,35 +1402,35 @@ const Tt = ({
|
|
|
1406
1402
|
const [l, n] = T(!1), [r, o] = T({}), u = P(null), i = P(null), c = P(null);
|
|
1407
1403
|
return et(() => {
|
|
1408
1404
|
if (l) {
|
|
1409
|
-
const
|
|
1410
|
-
if (!
|
|
1411
|
-
const
|
|
1405
|
+
const d = i.current, v = c.current;
|
|
1406
|
+
if (!d || !v) return;
|
|
1407
|
+
const m = d.getBoundingClientRect(), f = v.getBoundingClientRect(), p = window.innerHeight, h = window.innerWidth;
|
|
1412
1408
|
let y = t;
|
|
1413
|
-
t === "bottom" &&
|
|
1409
|
+
t === "bottom" && m.bottom + f.height > p && (y = "top"), t === "top" && m.top - f.height < 0 && (y = "bottom"), t === "right" && m.right + f.width > h && (y = "left"), t === "left" && m.left - f.width < 0 && (y = "right");
|
|
1414
1410
|
const N = {};
|
|
1415
1411
|
switch (y) {
|
|
1416
1412
|
case "top":
|
|
1417
|
-
N.bottom =
|
|
1413
|
+
N.bottom = m.height + 4, N.left = m.width / 2 - f.width / 2;
|
|
1418
1414
|
break;
|
|
1419
1415
|
case "right":
|
|
1420
|
-
N.left =
|
|
1416
|
+
N.left = m.width + 4, N.top = m.height / 2 - f.height / 2;
|
|
1421
1417
|
break;
|
|
1422
1418
|
case "left":
|
|
1423
|
-
N.right =
|
|
1419
|
+
N.right = m.width + 4, N.top = m.height / 2 - f.height / 2;
|
|
1424
1420
|
break;
|
|
1425
1421
|
case "bottom":
|
|
1426
1422
|
default:
|
|
1427
|
-
N.top =
|
|
1423
|
+
N.top = m.height + 4, N.left = m.width / 2 - f.width / 2;
|
|
1428
1424
|
break;
|
|
1429
1425
|
}
|
|
1430
1426
|
o(N);
|
|
1431
1427
|
}
|
|
1432
|
-
}, [l, t]),
|
|
1433
|
-
const
|
|
1428
|
+
}, [l, t]), S(() => {
|
|
1429
|
+
const d = (v) => {
|
|
1434
1430
|
u.current && !u.current.contains(v.target) && n(!1);
|
|
1435
1431
|
};
|
|
1436
|
-
return document.addEventListener("mousedown",
|
|
1437
|
-
document.removeEventListener("mousedown",
|
|
1432
|
+
return document.addEventListener("mousedown", d), () => {
|
|
1433
|
+
document.removeEventListener("mousedown", d);
|
|
1438
1434
|
};
|
|
1439
1435
|
}, []), /* @__PURE__ */ s(Re.Provider, { value: { isOpen: l, setIsOpen: n, triggerRef: i, contentRef: c, styles: r }, children: /* @__PURE__ */ s(
|
|
1440
1436
|
"div",
|
|
@@ -1506,7 +1502,7 @@ const me = ({
|
|
|
1506
1502
|
me.Tab = He;
|
|
1507
1503
|
me.Content = Me;
|
|
1508
1504
|
me.displayName = "Tabs";
|
|
1509
|
-
const
|
|
1505
|
+
const Et = ({
|
|
1510
1506
|
content: e,
|
|
1511
1507
|
position: t = "top",
|
|
1512
1508
|
variant: a = "primary",
|
|
@@ -1517,41 +1513,41 @@ const Lt = ({
|
|
|
1517
1513
|
children: u,
|
|
1518
1514
|
className: i = "",
|
|
1519
1515
|
disabled: c = !1,
|
|
1520
|
-
delay:
|
|
1516
|
+
delay: d = 200,
|
|
1521
1517
|
hideDelay: v = 100,
|
|
1522
|
-
trigger:
|
|
1518
|
+
trigger: m = "hover",
|
|
1523
1519
|
arrow: f = !0,
|
|
1524
|
-
...
|
|
1520
|
+
...p
|
|
1525
1521
|
}) => {
|
|
1526
|
-
const [h, y] = T(!1), [N,
|
|
1522
|
+
const [h, y] = T(!1), [N, _] = T(null), B = P(null), $ = P(null), w = "clarity-tooltip", k = !!r, L = l && n && !k;
|
|
1527
1523
|
let x = "";
|
|
1528
|
-
k ? x = `${
|
|
1524
|
+
k ? x = `${w}__content--custom-bg` : L ? x = `${w}__content--custom` : x = `${w}__content--${a}`;
|
|
1529
1525
|
const j = [
|
|
1530
|
-
|
|
1531
|
-
`${
|
|
1526
|
+
w,
|
|
1527
|
+
`${w}--${t}`,
|
|
1532
1528
|
i
|
|
1533
1529
|
].filter(Boolean).join(" "), I = [
|
|
1534
|
-
`${
|
|
1530
|
+
`${w}__content`,
|
|
1535
1531
|
x,
|
|
1536
|
-
f && `${
|
|
1537
|
-
].filter(Boolean).join(" "), A = {},
|
|
1538
|
-
k && r && (
|
|
1532
|
+
f && `${w}__content--arrow`
|
|
1533
|
+
].filter(Boolean).join(" "), A = {}, O = {};
|
|
1534
|
+
k && r && (O["--tooltip-bg-color"] = r), o && (O["--tooltip-text-color"] = o), L && l && n && (O["--tooltip-product"] = l, O["--tooltip-tone"] = n);
|
|
1539
1535
|
const g = {
|
|
1540
1536
|
...A,
|
|
1541
|
-
...Object.keys(
|
|
1537
|
+
...Object.keys(O).length > 0 ? O : {}
|
|
1542
1538
|
}, M = () => {
|
|
1543
1539
|
if (c) return;
|
|
1544
1540
|
N && clearTimeout(N);
|
|
1545
1541
|
const H = setTimeout(() => {
|
|
1546
1542
|
y(!0);
|
|
1547
|
-
},
|
|
1548
|
-
|
|
1543
|
+
}, d);
|
|
1544
|
+
_(H);
|
|
1549
1545
|
}, V = () => {
|
|
1550
1546
|
N && clearTimeout(N);
|
|
1551
1547
|
const H = setTimeout(() => {
|
|
1552
1548
|
y(!1);
|
|
1553
1549
|
}, v);
|
|
1554
|
-
|
|
1550
|
+
_(H);
|
|
1555
1551
|
}, F = () => {
|
|
1556
1552
|
c || y(!h);
|
|
1557
1553
|
}, X = () => {
|
|
@@ -1559,17 +1555,17 @@ const Lt = ({
|
|
|
1559
1555
|
}, te = () => {
|
|
1560
1556
|
V();
|
|
1561
1557
|
};
|
|
1562
|
-
|
|
1558
|
+
S(() => () => {
|
|
1563
1559
|
N && clearTimeout(N);
|
|
1564
1560
|
}, [N]);
|
|
1565
1561
|
const G = {};
|
|
1566
|
-
return
|
|
1562
|
+
return m === "hover" ? (G.onMouseEnter = M, G.onMouseLeave = V) : m === "click" ? G.onClick = F : m === "focus" && (G.onFocus = X, G.onBlur = te), /* @__PURE__ */ b(
|
|
1567
1563
|
"div",
|
|
1568
1564
|
{
|
|
1569
1565
|
ref: $,
|
|
1570
|
-
className: `${
|
|
1566
|
+
className: `${w}__trigger`,
|
|
1571
1567
|
...G,
|
|
1572
|
-
...
|
|
1568
|
+
...p,
|
|
1573
1569
|
children: [
|
|
1574
1570
|
u,
|
|
1575
1571
|
h && /* @__PURE__ */ s(
|
|
@@ -1599,7 +1595,7 @@ const Lt = ({
|
|
|
1599
1595
|
inputPlaceholder: n = "Search...",
|
|
1600
1596
|
...r
|
|
1601
1597
|
}) => {
|
|
1602
|
-
const [o, u] = T(""), [i, c] = T(null), [
|
|
1598
|
+
const [o, u] = T(""), [i, c] = T(null), [d, v] = T(!1), m = [
|
|
1603
1599
|
"clarity-command",
|
|
1604
1600
|
`clarity-command--${a}`,
|
|
1605
1601
|
t
|
|
@@ -1613,26 +1609,26 @@ const Lt = ({
|
|
|
1613
1609
|
empty: l,
|
|
1614
1610
|
inputPlaceholder: n
|
|
1615
1611
|
},
|
|
1616
|
-
isOpen:
|
|
1612
|
+
isOpen: d,
|
|
1617
1613
|
setIsOpen: v
|
|
1618
|
-
}), [o, i, a, l, n,
|
|
1619
|
-
return /* @__PURE__ */ s(We.Provider, { value: f, children: /* @__PURE__ */ s("div", { className:
|
|
1614
|
+
}), [o, i, a, l, n, d]);
|
|
1615
|
+
return /* @__PURE__ */ s(We.Provider, { value: f, children: /* @__PURE__ */ s("div", { className: m, ...r, children: e }) });
|
|
1620
1616
|
};
|
|
1621
1617
|
Fe.displayName = "Command";
|
|
1622
1618
|
const Ge = ({ placeholder: e = "Search...", variant: t, onClick: a }) => {
|
|
1623
1619
|
const { setIsOpen: l, variant: n } = ee(), [r, o] = T(!1);
|
|
1624
|
-
|
|
1620
|
+
S(() => {
|
|
1625
1621
|
o(/Mac|iPod|iPhone|iPad/.test(navigator.platform));
|
|
1626
1622
|
}, []);
|
|
1627
1623
|
const i = [
|
|
1628
1624
|
"clarity-command-button",
|
|
1629
1625
|
`clarity-command-button--${t || n}`
|
|
1630
1626
|
].filter(Boolean).join(" ");
|
|
1631
|
-
return /* @__PURE__ */
|
|
1632
|
-
l(!0), a == null || a(
|
|
1627
|
+
return /* @__PURE__ */ b("button", { className: i, onClick: (d) => {
|
|
1628
|
+
l(!0), a == null || a(d);
|
|
1633
1629
|
}, children: [
|
|
1634
1630
|
/* @__PURE__ */ s("span", { children: e }),
|
|
1635
|
-
/* @__PURE__ */
|
|
1631
|
+
/* @__PURE__ */ b("kbd", { className: "clarity-command-shortcut", children: [
|
|
1636
1632
|
r ? "⌘" : "Ctrl+",
|
|
1637
1633
|
"K"
|
|
1638
1634
|
] })
|
|
@@ -1641,7 +1637,7 @@ const Ge = ({ placeholder: e = "Search...", variant: t, onClick: a }) => {
|
|
|
1641
1637
|
Ge.displayName = "Command.Button";
|
|
1642
1638
|
const Ue = ({ children: e, ...t }) => {
|
|
1643
1639
|
const { isOpen: a, setIsOpen: l, variant: n } = ee();
|
|
1644
|
-
return
|
|
1640
|
+
return S(() => {
|
|
1645
1641
|
const r = (o) => {
|
|
1646
1642
|
o.key === "k" && (o.metaKey || o.ctrlKey) && (o.preventDefault(), l(!a));
|
|
1647
1643
|
};
|
|
@@ -1651,7 +1647,7 @@ const Ue = ({ children: e, ...t }) => {
|
|
|
1651
1647
|
Ue.displayName = "Command.Dialog";
|
|
1652
1648
|
const ze = ({ className: e = "", ...t }) => {
|
|
1653
1649
|
const { searchTerm: a, setSearchTerm: l, variant: n, texts: r, isOpen: o } = ee(), u = P(null);
|
|
1654
|
-
|
|
1650
|
+
S(() => {
|
|
1655
1651
|
var c;
|
|
1656
1652
|
o && ((c = u.current) == null || c.focus());
|
|
1657
1653
|
}, [o]);
|
|
@@ -1676,21 +1672,21 @@ ze.displayName = "Command.Input";
|
|
|
1676
1672
|
const qe = ({ children: e, className: t = "", ...a }) => {
|
|
1677
1673
|
const { searchTerm: l } = ee();
|
|
1678
1674
|
let n = !1;
|
|
1679
|
-
const r = (i) =>
|
|
1675
|
+
const r = (i) => E.Children.toArray(i).map((c) => {
|
|
1680
1676
|
var v;
|
|
1681
|
-
if (!
|
|
1682
|
-
const
|
|
1683
|
-
if (
|
|
1677
|
+
if (!E.isValidElement(c)) return c;
|
|
1678
|
+
const d = c.type.displayName;
|
|
1679
|
+
if (d === "Command.Empty")
|
|
1684
1680
|
return null;
|
|
1685
|
-
if (
|
|
1681
|
+
if (d === "Command.Item")
|
|
1686
1682
|
return (((v = c.props.children) == null ? void 0 : v.toString().toLowerCase()) || "").includes(l.toLowerCase()) ? (n = !0, c) : null;
|
|
1687
|
-
if (
|
|
1688
|
-
const
|
|
1689
|
-
return
|
|
1683
|
+
if (d === "Command.Group") {
|
|
1684
|
+
const m = r(c.props.children);
|
|
1685
|
+
return E.Children.toArray(m).some((p) => E.isValidElement(p) && p.type.displayName === "Command.Item") ? E.cloneElement(c, { ...c.props, children: m }) : null;
|
|
1690
1686
|
}
|
|
1691
1687
|
return c;
|
|
1692
1688
|
}).filter(Boolean), o = r(e), u = ["clarity-command-list", t].filter(Boolean).join(" ");
|
|
1693
|
-
return /* @__PURE__ */
|
|
1689
|
+
return /* @__PURE__ */ b("div", { className: u, ...a, children: [
|
|
1694
1690
|
o,
|
|
1695
1691
|
!n && /* @__PURE__ */ s(ue, {})
|
|
1696
1692
|
] });
|
|
@@ -1721,7 +1717,7 @@ const Ye = ({ children: e, className: t = "", ...a }) => {
|
|
|
1721
1717
|
return /* @__PURE__ */ s("span", { className: l, ...a, children: e });
|
|
1722
1718
|
};
|
|
1723
1719
|
Ye.displayName = "Command.Shortcut";
|
|
1724
|
-
const
|
|
1720
|
+
const Lt = Object.assign(Fe, {
|
|
1725
1721
|
Button: Ge,
|
|
1726
1722
|
Dialog: Ue,
|
|
1727
1723
|
Input: ze,
|
|
@@ -1733,14 +1729,14 @@ const Et = Object.assign(Fe, {
|
|
|
1733
1729
|
Shortcut: Ye
|
|
1734
1730
|
}), Ct = ({ columns: e, viewMode: t }) => {
|
|
1735
1731
|
const a = Array.from({ length: 5 }, (l, n) => n);
|
|
1736
|
-
return t === "card" ? /* @__PURE__ */
|
|
1732
|
+
return t === "card" ? /* @__PURE__ */ b("div", { className: "card-view-wrapper is-loading", children: [
|
|
1737
1733
|
/* @__PURE__ */ s("div", { className: "skeleton card-view-header" }),
|
|
1738
1734
|
/* @__PURE__ */ s("div", { className: "card-view-body", children: a.map((l) => /* @__PURE__ */ s("div", { className: "skeleton card-view-row" }, l)) })
|
|
1739
|
-
] }) : /* @__PURE__ */ s("div", { className: "table-wrapper is-loading", children: /* @__PURE__ */
|
|
1735
|
+
] }) : /* @__PURE__ */ s("div", { className: "table-wrapper is-loading", children: /* @__PURE__ */ b("table", { children: [
|
|
1740
1736
|
/* @__PURE__ */ s("thead", { children: /* @__PURE__ */ s("tr", { className: "table-row", children: e.map((l) => /* @__PURE__ */ s("th", { className: "table-header-cell", children: /* @__PURE__ */ s("div", { className: "skeleton skeleton-text" }) }, l.key)) }) }),
|
|
1741
1737
|
/* @__PURE__ */ s("tbody", { children: a.map((l) => /* @__PURE__ */ s("tr", { className: "table-row", children: e.map((n) => /* @__PURE__ */ s("td", { className: "table-cell", children: /* @__PURE__ */ s("div", { className: "skeleton skeleton-text" }) }, n.key)) }, l)) })
|
|
1742
1738
|
] }) });
|
|
1743
|
-
},
|
|
1739
|
+
}, Ot = ({
|
|
1744
1740
|
variant: e = "secondary",
|
|
1745
1741
|
columns: t,
|
|
1746
1742
|
data: a,
|
|
@@ -1748,47 +1744,47 @@ const Et = Object.assign(Fe, {
|
|
|
1748
1744
|
isScrollable: n = !1,
|
|
1749
1745
|
isLoading: r = !1
|
|
1750
1746
|
}) => {
|
|
1751
|
-
const [o, u] = T(null), [i, c] = T("none"),
|
|
1752
|
-
|
|
1753
|
-
}, v = Y(() => i === "none" || !o ? a : [...a].sort((
|
|
1754
|
-
const y =
|
|
1747
|
+
const [o, u] = T(null), [i, c] = T("none"), d = (p) => {
|
|
1748
|
+
p.sortable && (o === p.key ? c((h) => h === "asc" ? "desc" : h === "desc" ? "none" : "asc") : (u(p.key), c("asc")));
|
|
1749
|
+
}, v = Y(() => i === "none" || !o ? a : [...a].sort((p, h) => {
|
|
1750
|
+
const y = p[o], N = h[o];
|
|
1755
1751
|
return y < N ? i === "asc" ? -1 : 1 : y > N ? i === "asc" ? 1 : -1 : 0;
|
|
1756
|
-
}), [a, o, i]),
|
|
1752
|
+
}), [a, o, i]), m = (p) => p.sortable ? o !== p.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;
|
|
1757
1753
|
if (r)
|
|
1758
1754
|
return /* @__PURE__ */ s(Ct, { columns: t, viewMode: l });
|
|
1759
1755
|
const f = `table-variant-${e} ${n ? "is-scrollable" : ""}`;
|
|
1760
|
-
return l === "card" ? /* @__PURE__ */
|
|
1761
|
-
/* @__PURE__ */ s("div", { className: `card-view-header table-header-cell-${e}`, children: t.map((
|
|
1756
|
+
return l === "card" ? /* @__PURE__ */ b("div", { className: `card-view-wrapper ${f}`, children: [
|
|
1757
|
+
/* @__PURE__ */ s("div", { className: `card-view-header table-header-cell-${e}`, children: t.map((p) => /* @__PURE__ */ b(
|
|
1762
1758
|
"div",
|
|
1763
1759
|
{
|
|
1764
|
-
className: `card-view-header-cell ${
|
|
1765
|
-
onClick: () =>
|
|
1766
|
-
style: { minWidth:
|
|
1760
|
+
className: `card-view-header-cell ${p.sortable ? "sortable" : ""}`,
|
|
1761
|
+
onClick: () => d(p),
|
|
1762
|
+
style: { minWidth: p.minWidth },
|
|
1767
1763
|
children: [
|
|
1768
|
-
|
|
1769
|
-
p
|
|
1764
|
+
p.header,
|
|
1765
|
+
m(p)
|
|
1770
1766
|
]
|
|
1771
1767
|
},
|
|
1772
|
-
|
|
1768
|
+
p.key
|
|
1773
1769
|
)) }),
|
|
1774
|
-
/* @__PURE__ */ s("div", { className: "card-view-body", children: v.map((
|
|
1775
|
-
] }) : /* @__PURE__ */ s("div", { className: `table-wrapper ${f}`, children: /* @__PURE__ */
|
|
1776
|
-
/* @__PURE__ */ s("thead", { className: "table-header", children: /* @__PURE__ */ s("tr", { className: "table-row", children: t.map((
|
|
1770
|
+
/* @__PURE__ */ s("div", { className: "card-view-body", children: v.map((p, h) => /* @__PURE__ */ s("div", { className: `card-view-row table-row-${e}`, children: t.map((y) => /* @__PURE__ */ s("div", { className: `card-view-cell ${y.align ? `table-cell-align-${y.align}` : ""}`, style: { minWidth: y.minWidth }, children: y.render ? y.render(p) : p[y.key] }, y.key)) }, h)) })
|
|
1771
|
+
] }) : /* @__PURE__ */ s("div", { className: `table-wrapper ${f}`, children: /* @__PURE__ */ b("table", { children: [
|
|
1772
|
+
/* @__PURE__ */ s("thead", { className: "table-header", children: /* @__PURE__ */ s("tr", { className: "table-row", children: t.map((p) => /* @__PURE__ */ b(
|
|
1777
1773
|
"th",
|
|
1778
1774
|
{
|
|
1779
|
-
className: `table-header-cell ${
|
|
1780
|
-
onClick: () =>
|
|
1781
|
-
style: { minWidth:
|
|
1775
|
+
className: `table-header-cell ${p.sortable ? "sortable" : ""} table-header-cell-${e}`,
|
|
1776
|
+
onClick: () => d(p),
|
|
1777
|
+
style: { minWidth: p.minWidth },
|
|
1782
1778
|
children: [
|
|
1783
|
-
|
|
1784
|
-
p
|
|
1779
|
+
p.header,
|
|
1780
|
+
m(p)
|
|
1785
1781
|
]
|
|
1786
1782
|
},
|
|
1787
|
-
|
|
1783
|
+
p.key
|
|
1788
1784
|
)) }) }),
|
|
1789
|
-
/* @__PURE__ */ s("tbody", { children: v.map((
|
|
1785
|
+
/* @__PURE__ */ s("tbody", { children: v.map((p, h) => /* @__PURE__ */ s("tr", { className: `table-row table-row-${e}`, children: t.map((y) => /* @__PURE__ */ s("td", { className: `table-cell ${y.align ? `table-cell-align-${y.align}` : ""}`, style: { minWidth: y.minWidth }, children: y.render ? y.render(p) : p[y.key] }, y.key)) }, h)) })
|
|
1790
1786
|
] }) });
|
|
1791
|
-
},
|
|
1787
|
+
}, St = ({
|
|
1792
1788
|
variant: e = "primary",
|
|
1793
1789
|
product: t,
|
|
1794
1790
|
tone: a,
|
|
@@ -1798,7 +1794,7 @@ const Et = Object.assign(Fe, {
|
|
|
1798
1794
|
"aria-label": o = "Carregando...",
|
|
1799
1795
|
...u
|
|
1800
1796
|
}) => {
|
|
1801
|
-
const i = "clarity-spinner", v = n ? `${i}--custom` : t && a ? `${i}--custom` : `${i}--${e}`,
|
|
1797
|
+
const i = "clarity-spinner", v = n ? `${i}--custom` : t && a ? `${i}--custom` : `${i}--${e}`, m = [
|
|
1802
1798
|
i,
|
|
1803
1799
|
`${i}--${l}`,
|
|
1804
1800
|
v,
|
|
@@ -1807,7 +1803,7 @@ const Et = Object.assign(Fe, {
|
|
|
1807
1803
|
return n ? f["--spinner-color"] = n : t && a && (f["--spinner-color"] = `var(--clarity-${t}-${a})`), /* @__PURE__ */ s(
|
|
1808
1804
|
"div",
|
|
1809
1805
|
{
|
|
1810
|
-
className:
|
|
1806
|
+
className: m,
|
|
1811
1807
|
style: f,
|
|
1812
1808
|
role: "status",
|
|
1813
1809
|
"aria-label": o,
|
|
@@ -1914,12 +1910,12 @@ const Et = Object.assign(Fe, {
|
|
|
1914
1910
|
export {
|
|
1915
1911
|
jt as Accordion,
|
|
1916
1912
|
wt as Badge,
|
|
1917
|
-
|
|
1918
|
-
|
|
1913
|
+
gt as Button,
|
|
1914
|
+
$t as ButtonGroup,
|
|
1919
1915
|
Tt as ButtonIcon,
|
|
1920
1916
|
Bt as ButtonLink,
|
|
1921
1917
|
it as CheckInput,
|
|
1922
|
-
|
|
1918
|
+
Lt as Command,
|
|
1923
1919
|
Q as ConfirmationDialog,
|
|
1924
1920
|
ae as Dropdown,
|
|
1925
1921
|
st as Input,
|
|
@@ -1928,12 +1924,12 @@ export {
|
|
|
1928
1924
|
nt as MultiSelect,
|
|
1929
1925
|
K as Offcanvas,
|
|
1930
1926
|
lt as Select,
|
|
1931
|
-
|
|
1932
|
-
|
|
1927
|
+
St as Spinner,
|
|
1928
|
+
Ot as Table,
|
|
1933
1929
|
me as Tabs,
|
|
1934
1930
|
at as Textarea,
|
|
1935
1931
|
xt as ToastProvider,
|
|
1936
|
-
|
|
1932
|
+
Et as Tooltip,
|
|
1937
1933
|
At as cn,
|
|
1938
1934
|
It as colors,
|
|
1939
1935
|
Pt as generateId,
|