beth-clarity 1.1.8 → 1.1.10
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 L, { useState as T, useRef as
|
|
1
|
+
import { jsx as s, jsxs as w, Fragment as Ze } from "react/jsx-runtime";
|
|
2
|
+
import L, { useState as T, useRef as P, useEffect as O, forwardRef as Ke, isValidElement as Z, createContext as z, cloneElement as W, useContext as q, useMemo as Y, useCallback as ne, useLayoutEffect as et } from "react";
|
|
3
3
|
import tt from "react-dom";
|
|
4
4
|
const wt = ({
|
|
5
5
|
variant: e = "primary",
|
|
@@ -12,37 +12,37 @@ const wt = ({
|
|
|
12
12
|
className: u = "",
|
|
13
13
|
rounded: i = !1,
|
|
14
14
|
outlined: c = !1,
|
|
15
|
-
...
|
|
15
|
+
...m
|
|
16
16
|
}) => {
|
|
17
|
-
const
|
|
17
|
+
const v = "clarity-badge", p = !!n, f = t && a && !p;
|
|
18
18
|
let d = "";
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
19
|
+
p ? d = `${v}--custom-bg` : f ? d = `${v}--custom` : d = `${v}--${e}`;
|
|
20
|
+
const h = [
|
|
21
|
+
v,
|
|
22
22
|
d,
|
|
23
|
-
`${
|
|
24
|
-
i ? `${
|
|
25
|
-
c ? `${
|
|
23
|
+
`${v}--${l}`,
|
|
24
|
+
i ? `${v}--rounded` : "",
|
|
25
|
+
c ? `${v}--outlined` : "",
|
|
26
26
|
u
|
|
27
|
-
].filter(Boolean).join(" "),
|
|
28
|
-
|
|
29
|
-
const N =
|
|
27
|
+
].filter(Boolean).join(" "), y = {};
|
|
28
|
+
p && (y.backgroundColor = n, r && (y.color = r));
|
|
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)`
|
|
32
32
|
} : {};
|
|
33
33
|
return /* @__PURE__ */ s(
|
|
34
34
|
"span",
|
|
35
35
|
{
|
|
36
|
-
className:
|
|
36
|
+
className: h,
|
|
37
37
|
style: {
|
|
38
|
-
...
|
|
38
|
+
...y,
|
|
39
39
|
...N
|
|
40
40
|
},
|
|
41
|
-
...
|
|
41
|
+
...m,
|
|
42
42
|
children: o
|
|
43
43
|
}
|
|
44
44
|
);
|
|
45
|
-
},
|
|
45
|
+
}, $t = ({
|
|
46
46
|
variant: e = "primary",
|
|
47
47
|
product: t,
|
|
48
48
|
tone: a,
|
|
@@ -53,40 +53,101 @@ const wt = ({
|
|
|
53
53
|
children: u,
|
|
54
54
|
onClick: i,
|
|
55
55
|
type: c = "button",
|
|
56
|
-
className:
|
|
57
|
-
title:
|
|
58
|
-
...
|
|
56
|
+
className: m = "",
|
|
57
|
+
title: v,
|
|
58
|
+
...p
|
|
59
59
|
}) => {
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
`${
|
|
64
|
-
o && `${
|
|
65
|
-
r && `${
|
|
66
|
-
|
|
60
|
+
const f = "clarity-button", d = t && a, h = d ? `${f}--custom` : `${f}--${e}`, y = [
|
|
61
|
+
f,
|
|
62
|
+
h,
|
|
63
|
+
`${f}--${n}`,
|
|
64
|
+
o && `${f}--loading`,
|
|
65
|
+
r && `${f}--disabled`,
|
|
66
|
+
m
|
|
67
67
|
].filter(Boolean).join(" "), N = (B) => {
|
|
68
|
-
const
|
|
69
|
-
return
|
|
70
|
-
},
|
|
68
|
+
const $ = parseInt(B);
|
|
69
|
+
return $ >= 800 ? "900" : $ >= 700 ? "800" : $ >= 600 ? "700" : $ >= 500 ? "600" : $ >= 400 ? "500" : $ >= 300 ? "400" : $ >= 200 ? "300" : "200";
|
|
70
|
+
}, b = d ? {
|
|
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__ */ w(
|
|
75
75
|
"button",
|
|
76
76
|
{
|
|
77
|
-
className:
|
|
78
|
-
style:
|
|
77
|
+
className: y,
|
|
78
|
+
style: b,
|
|
79
79
|
disabled: r || o,
|
|
80
80
|
onClick: i,
|
|
81
81
|
type: c,
|
|
82
|
-
title:
|
|
83
|
-
...
|
|
82
|
+
title: v,
|
|
83
|
+
...p,
|
|
84
84
|
children: [
|
|
85
|
-
o && /* @__PURE__ */ s("div", { className: `${
|
|
85
|
+
o && /* @__PURE__ */ s("div", { className: `${f}__spinner` }),
|
|
86
86
|
u
|
|
87
87
|
]
|
|
88
88
|
}
|
|
89
89
|
);
|
|
90
|
+
}, gt = ({
|
|
91
|
+
variant: e = "primary",
|
|
92
|
+
size: t = "medium",
|
|
93
|
+
filled: a = !0,
|
|
94
|
+
items: l,
|
|
95
|
+
value: n,
|
|
96
|
+
multiple: r = !1,
|
|
97
|
+
disabled: o = !1,
|
|
98
|
+
onChange: u,
|
|
99
|
+
className: i = "",
|
|
100
|
+
...c
|
|
101
|
+
}) => {
|
|
102
|
+
const m = "clarity-button-group", v = `${m}--${e}`, p = [
|
|
103
|
+
m,
|
|
104
|
+
v,
|
|
105
|
+
`${m}--${t}`,
|
|
106
|
+
!a && `${m}--outline`,
|
|
107
|
+
o && `${m}--disabled`,
|
|
108
|
+
i
|
|
109
|
+
].filter(Boolean).join(" "), f = (h) => {
|
|
110
|
+
if (o || !u) return;
|
|
111
|
+
const y = l.find((N) => N.id === h);
|
|
112
|
+
if (!(y != null && y.disabled))
|
|
113
|
+
if (r) {
|
|
114
|
+
const N = Array.isArray(n) ? n : [], b = N.includes(h) ? N.filter((B) => B !== h) : [...N, h];
|
|
115
|
+
u(b);
|
|
116
|
+
} else
|
|
117
|
+
u(h);
|
|
118
|
+
}, d = (h) => r ? Array.isArray(n) && n.includes(h) : n === h;
|
|
119
|
+
return /* @__PURE__ */ s(
|
|
120
|
+
"div",
|
|
121
|
+
{
|
|
122
|
+
className: p,
|
|
123
|
+
role: "group",
|
|
124
|
+
...c,
|
|
125
|
+
children: l.map((h, y) => {
|
|
126
|
+
const N = d(h.id), b = [
|
|
127
|
+
`${m}__item`,
|
|
128
|
+
N && `${m}__item--selected`,
|
|
129
|
+
h.disabled && `${m}__item--disabled`,
|
|
130
|
+
y === 0 && `${m}__item--first`,
|
|
131
|
+
y === l.length - 1 && `${m}__item--last`
|
|
132
|
+
].filter(Boolean).join(" ");
|
|
133
|
+
return /* @__PURE__ */ w(
|
|
134
|
+
"button",
|
|
135
|
+
{
|
|
136
|
+
className: b,
|
|
137
|
+
onClick: () => f(h.id),
|
|
138
|
+
disabled: o || h.disabled,
|
|
139
|
+
type: "button",
|
|
140
|
+
"aria-pressed": N,
|
|
141
|
+
children: [
|
|
142
|
+
h.icon && /* @__PURE__ */ s("span", { className: `${m}__item-icon`, children: h.icon }),
|
|
143
|
+
/* @__PURE__ */ s("span", { className: `${m}__item-label`, children: h.label })
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
h.id
|
|
147
|
+
);
|
|
148
|
+
})
|
|
149
|
+
}
|
|
150
|
+
);
|
|
90
151
|
}, st = L.forwardRef(({
|
|
91
152
|
variant: e,
|
|
92
153
|
size: t = "medium",
|
|
@@ -98,21 +159,21 @@ const wt = ({
|
|
|
98
159
|
endIcon: u,
|
|
99
160
|
className: i = "",
|
|
100
161
|
disabled: c = !1,
|
|
101
|
-
value:
|
|
102
|
-
defaultValue:
|
|
103
|
-
onFocus:
|
|
104
|
-
onBlur:
|
|
162
|
+
value: m,
|
|
163
|
+
defaultValue: v,
|
|
164
|
+
onFocus: p,
|
|
165
|
+
onBlur: f,
|
|
105
166
|
...d
|
|
106
|
-
},
|
|
107
|
-
const [
|
|
108
|
-
L.useImperativeHandle(
|
|
109
|
-
const x =
|
|
167
|
+
}, h) => {
|
|
168
|
+
const [y, N] = T(!1), [b, B] = T(!1), $ = P(null);
|
|
169
|
+
L.useImperativeHandle(h, () => $.current), O(() => {
|
|
170
|
+
const x = $.current;
|
|
110
171
|
x && B(x.value.length > 0);
|
|
111
|
-
}, [
|
|
112
|
-
const
|
|
113
|
-
N(!0),
|
|
172
|
+
}, [m, v]);
|
|
173
|
+
const _ = (x) => {
|
|
174
|
+
N(!0), p == null || p(x);
|
|
114
175
|
}, k = (x) => {
|
|
115
|
-
N(!1), B(x.target.value.length > 0),
|
|
176
|
+
N(!1), B(x.target.value.length > 0), f == null || f(x);
|
|
116
177
|
}, E = [
|
|
117
178
|
"clarity-input",
|
|
118
179
|
"clarity-input--outlined",
|
|
@@ -120,25 +181,25 @@ const wt = ({
|
|
|
120
181
|
e && `clarity-input--${e}`,
|
|
121
182
|
n && "clarity-input--error",
|
|
122
183
|
c && "clarity-input--disabled",
|
|
123
|
-
|
|
124
|
-
|
|
184
|
+
y && "clarity-input--focused",
|
|
185
|
+
b && "clarity-input--has-value",
|
|
125
186
|
o && "clarity-input--with-start-icon",
|
|
126
187
|
u && "clarity-input--with-end-icon",
|
|
127
188
|
i
|
|
128
189
|
].filter(Boolean).join(" ");
|
|
129
|
-
return /* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */
|
|
190
|
+
return /* @__PURE__ */ w("div", { className: "clarity-input-wrapper", children: [
|
|
191
|
+
/* @__PURE__ */ w("div", { className: E, children: [
|
|
131
192
|
o && /* @__PURE__ */ s("div", { className: "clarity-input__start-icon", children: o }),
|
|
132
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ w("div", { className: "clarity-input__field", children: [
|
|
133
194
|
/* @__PURE__ */ s(
|
|
134
195
|
"input",
|
|
135
196
|
{
|
|
136
|
-
ref:
|
|
197
|
+
ref: $,
|
|
137
198
|
className: "clarity-input__element",
|
|
138
199
|
disabled: c,
|
|
139
|
-
value:
|
|
140
|
-
defaultValue:
|
|
141
|
-
onFocus:
|
|
200
|
+
value: m,
|
|
201
|
+
defaultValue: v,
|
|
202
|
+
onFocus: _,
|
|
142
203
|
onBlur: k,
|
|
143
204
|
...d
|
|
144
205
|
}
|
|
@@ -162,59 +223,59 @@ const at = L.forwardRef(({
|
|
|
162
223
|
endIcon: u,
|
|
163
224
|
className: i = "",
|
|
164
225
|
disabled: c = !1,
|
|
165
|
-
value:
|
|
166
|
-
defaultValue:
|
|
167
|
-
onFocus:
|
|
168
|
-
onBlur:
|
|
226
|
+
value: m,
|
|
227
|
+
defaultValue: v,
|
|
228
|
+
onFocus: p,
|
|
229
|
+
onBlur: f,
|
|
169
230
|
rows: d = 3,
|
|
170
|
-
minHeight:
|
|
171
|
-
maxHeight:
|
|
231
|
+
minHeight: h,
|
|
232
|
+
maxHeight: y,
|
|
172
233
|
resizable: N = !0,
|
|
173
|
-
...
|
|
234
|
+
...b
|
|
174
235
|
}, B) => {
|
|
175
|
-
const [
|
|
236
|
+
const [$, _] = T(!1), [k, E] = T(!1), x = P(null);
|
|
176
237
|
L.useImperativeHandle(B, () => x.current), O(() => {
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
}, [
|
|
180
|
-
const j = (
|
|
181
|
-
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
},
|
|
238
|
+
const g = x.current;
|
|
239
|
+
g && E(g.value.length > 0);
|
|
240
|
+
}, [m, v]);
|
|
241
|
+
const j = (g) => {
|
|
242
|
+
_(!0), p == null || p(g);
|
|
243
|
+
}, I = (g) => {
|
|
244
|
+
_(!1), E(g.target.value.length > 0), f == null || f(g);
|
|
245
|
+
}, A = [
|
|
185
246
|
"clarity-textarea",
|
|
186
247
|
"clarity-textarea--outlined",
|
|
187
248
|
`clarity-textarea--${t}`,
|
|
188
249
|
e && `clarity-textarea--${e}`,
|
|
189
250
|
n && "clarity-textarea--error",
|
|
190
251
|
c && "clarity-textarea--disabled",
|
|
191
|
-
|
|
252
|
+
$ && "clarity-textarea--focused",
|
|
192
253
|
k && "clarity-textarea--has-value",
|
|
193
254
|
o && "clarity-textarea--with-start-icon",
|
|
194
255
|
u && "clarity-textarea--with-end-icon",
|
|
195
256
|
i
|
|
196
|
-
].filter(Boolean).join(" "),
|
|
257
|
+
].filter(Boolean).join(" "), S = {
|
|
197
258
|
resize: N ? "vertical" : "none",
|
|
198
|
-
minHeight:
|
|
199
|
-
maxHeight:
|
|
259
|
+
minHeight: h ? `${h}px` : void 0,
|
|
260
|
+
maxHeight: y ? `${y}px` : void 0
|
|
200
261
|
};
|
|
201
|
-
return /* @__PURE__ */
|
|
202
|
-
/* @__PURE__ */
|
|
262
|
+
return /* @__PURE__ */ w("div", { className: "clarity-textarea-wrapper", children: [
|
|
263
|
+
/* @__PURE__ */ w("div", { className: A, children: [
|
|
203
264
|
o && /* @__PURE__ */ s("div", { className: "clarity-textarea__start-icon", children: o }),
|
|
204
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ w("div", { className: "clarity-textarea__field", children: [
|
|
205
266
|
/* @__PURE__ */ s(
|
|
206
267
|
"textarea",
|
|
207
268
|
{
|
|
208
269
|
ref: x,
|
|
209
270
|
className: "clarity-textarea__element",
|
|
210
271
|
disabled: c,
|
|
211
|
-
value:
|
|
212
|
-
defaultValue:
|
|
272
|
+
value: m,
|
|
273
|
+
defaultValue: v,
|
|
213
274
|
onFocus: j,
|
|
214
|
-
onBlur:
|
|
275
|
+
onBlur: I,
|
|
215
276
|
rows: d,
|
|
216
|
-
style:
|
|
217
|
-
...
|
|
277
|
+
style: S,
|
|
278
|
+
...b
|
|
218
279
|
}
|
|
219
280
|
),
|
|
220
281
|
a && /* @__PURE__ */ s("label", { className: "clarity-textarea__label", children: a })
|
|
@@ -236,88 +297,88 @@ const lt = L.forwardRef(({
|
|
|
236
297
|
endIcon: u,
|
|
237
298
|
className: i = "",
|
|
238
299
|
disabled: c = !1,
|
|
239
|
-
value:
|
|
240
|
-
defaultValue:
|
|
241
|
-
onFocus:
|
|
242
|
-
onBlur:
|
|
300
|
+
value: m,
|
|
301
|
+
defaultValue: v,
|
|
302
|
+
onFocus: p,
|
|
303
|
+
onBlur: f,
|
|
243
304
|
onChange: d,
|
|
244
|
-
options:
|
|
245
|
-
placeholder:
|
|
305
|
+
options: h,
|
|
306
|
+
placeholder: y = "Selecione uma opção",
|
|
246
307
|
isClearable: N = !1,
|
|
247
|
-
isSearchable:
|
|
308
|
+
isSearchable: b = !1,
|
|
248
309
|
...B
|
|
249
|
-
},
|
|
250
|
-
const [
|
|
251
|
-
L.useImperativeHandle(
|
|
252
|
-
|
|
253
|
-
}, [
|
|
254
|
-
const
|
|
255
|
-
|
|
310
|
+
}, $) => {
|
|
311
|
+
const [_, k] = T(!1), [E, x] = T(!1), [j, I] = T(m || v || ""), [A, S] = T(""), g = P(null), M = P(null);
|
|
312
|
+
L.useImperativeHandle($, () => g.current), O(() => {
|
|
313
|
+
m !== void 0 && I(m);
|
|
314
|
+
}, [m]), O(() => {
|
|
315
|
+
const C = (D) => {
|
|
316
|
+
g.current && !g.current.contains(D.target) && (k(!1), x(!1), f == null || f());
|
|
256
317
|
};
|
|
257
|
-
return document.addEventListener("mousedown",
|
|
258
|
-
}, [
|
|
259
|
-
const V =
|
|
260
|
-
(
|
|
261
|
-
) :
|
|
262
|
-
c || (k(!
|
|
263
|
-
var
|
|
264
|
-
(
|
|
318
|
+
return document.addEventListener("mousedown", C), () => document.removeEventListener("mousedown", C);
|
|
319
|
+
}, [f]);
|
|
320
|
+
const V = b && A ? h.filter(
|
|
321
|
+
(C) => C.label.toLowerCase().includes(A.toLowerCase())
|
|
322
|
+
) : h, F = () => {
|
|
323
|
+
c || (k(!_), x(!_), _ ? (f == null || f(), b && S("")) : (p == null || p(), b && setTimeout(() => {
|
|
324
|
+
var C;
|
|
325
|
+
(C = M.current) == null || C.focus();
|
|
265
326
|
}, 0)));
|
|
266
|
-
}, X = (
|
|
267
|
-
|
|
268
|
-
}, te = (
|
|
269
|
-
|
|
270
|
-
}, G = (
|
|
271
|
-
|
|
272
|
-
}, H =
|
|
273
|
-
|
|
274
|
-
}, ie = le || E ||
|
|
327
|
+
}, X = (C) => {
|
|
328
|
+
C.disabled || (I(C.value), k(!1), x(!1), S(""), d == null || d(C.value), f == null || f());
|
|
329
|
+
}, te = (C) => {
|
|
330
|
+
S(C.target.value);
|
|
331
|
+
}, G = (C) => {
|
|
332
|
+
C.key === "Escape" ? (k(!1), x(!1), S("")) : C.key === "Enter" && V.length > 0 && V[0] && X(V[0]);
|
|
333
|
+
}, H = h.find((C) => C.value === j), le = j !== "" && j !== void 0, re = (C) => {
|
|
334
|
+
C.stopPropagation(), I(""), d == null || d("");
|
|
335
|
+
}, ie = le || E || y || b && A, oe = [
|
|
275
336
|
"clarity-select",
|
|
276
337
|
"clarity-select--outlined",
|
|
277
338
|
`clarity-select--${t}`,
|
|
278
339
|
e && `clarity-select--${e}`,
|
|
279
340
|
n && "clarity-select--error",
|
|
280
341
|
c && "clarity-select--disabled",
|
|
281
|
-
(E ||
|
|
342
|
+
(E || _) && "clarity-select--focused",
|
|
282
343
|
ie && "clarity-select--label-up",
|
|
283
|
-
|
|
284
|
-
|
|
344
|
+
_ && "clarity-select--open",
|
|
345
|
+
b && "clarity-select--searchable",
|
|
285
346
|
o && "clarity-select--with-start-icon",
|
|
286
347
|
(u || N) && "clarity-select--with-end-icon",
|
|
287
348
|
i
|
|
288
349
|
].filter(Boolean).join(" ");
|
|
289
|
-
return /* @__PURE__ */
|
|
290
|
-
/* @__PURE__ */
|
|
350
|
+
return /* @__PURE__ */ w("div", { className: "clarity-select-wrapper", children: [
|
|
351
|
+
/* @__PURE__ */ w(
|
|
291
352
|
"div",
|
|
292
353
|
{
|
|
293
|
-
ref:
|
|
354
|
+
ref: g,
|
|
294
355
|
className: oe,
|
|
295
|
-
onClick:
|
|
356
|
+
onClick: b ? void 0 : F,
|
|
296
357
|
role: "combobox",
|
|
297
|
-
"aria-expanded":
|
|
358
|
+
"aria-expanded": _,
|
|
298
359
|
"aria-haspopup": "listbox",
|
|
299
|
-
tabIndex: c ||
|
|
360
|
+
tabIndex: c || b ? -1 : 0,
|
|
300
361
|
...B,
|
|
301
362
|
children: [
|
|
302
363
|
o && /* @__PURE__ */ s("div", { className: "clarity-select__start-icon", children: o }),
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
|
|
364
|
+
/* @__PURE__ */ w("div", { className: "clarity-select__field", children: [
|
|
365
|
+
b ? /* @__PURE__ */ s(
|
|
305
366
|
"input",
|
|
306
367
|
{
|
|
307
368
|
ref: M,
|
|
308
369
|
type: "text",
|
|
309
370
|
className: "clarity-select__search-input",
|
|
310
|
-
value:
|
|
371
|
+
value: _ ? A : H ? H.label : "",
|
|
311
372
|
onChange: te,
|
|
312
373
|
onKeyDown: G,
|
|
313
374
|
onFocus: () => {
|
|
314
|
-
|
|
375
|
+
_ || (k(!0), x(!0), p == null || p());
|
|
315
376
|
},
|
|
316
|
-
placeholder: H ? H.label :
|
|
377
|
+
placeholder: H ? H.label : y,
|
|
317
378
|
disabled: c,
|
|
318
|
-
readOnly: !
|
|
379
|
+
readOnly: !_
|
|
319
380
|
}
|
|
320
|
-
) : /* @__PURE__ */ s("div", { className: "clarity-select__display", children: H ? H.label :
|
|
381
|
+
) : /* @__PURE__ */ s("div", { className: "clarity-select__display", children: H ? H.label : y }),
|
|
321
382
|
a && /* @__PURE__ */ s("label", { className: "clarity-select__label", children: a })
|
|
322
383
|
] }),
|
|
323
384
|
N && le && /* @__PURE__ */ s(
|
|
@@ -352,7 +413,7 @@ const lt = L.forwardRef(({
|
|
|
352
413
|
"div",
|
|
353
414
|
{
|
|
354
415
|
className: "clarity-select__end-icon",
|
|
355
|
-
onClick:
|
|
416
|
+
onClick: b ? F : void 0,
|
|
356
417
|
children: u || /* @__PURE__ */ s(
|
|
357
418
|
"svg",
|
|
358
419
|
{
|
|
@@ -375,20 +436,20 @@ const lt = L.forwardRef(({
|
|
|
375
436
|
)
|
|
376
437
|
}
|
|
377
438
|
),
|
|
378
|
-
|
|
439
|
+
_ && /* @__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(
|
|
379
440
|
"li",
|
|
380
441
|
{
|
|
381
442
|
className: [
|
|
382
443
|
"clarity-select__option",
|
|
383
|
-
|
|
384
|
-
j ===
|
|
444
|
+
C.disabled && "clarity-select__option--disabled",
|
|
445
|
+
j === C.value && "clarity-select__option--selected"
|
|
385
446
|
].filter(Boolean).join(" "),
|
|
386
|
-
onClick: () => X(
|
|
447
|
+
onClick: () => X(C),
|
|
387
448
|
role: "option",
|
|
388
|
-
"aria-selected": j ===
|
|
389
|
-
children:
|
|
449
|
+
"aria-selected": j === C.value,
|
|
450
|
+
children: C.label
|
|
390
451
|
},
|
|
391
|
-
|
|
452
|
+
C.value
|
|
392
453
|
)) : /* @__PURE__ */ s("li", { className: "clarity-select__option clarity-select__option--no-results", children: "Nenhum resultado encontrado" }) }) })
|
|
393
454
|
]
|
|
394
455
|
}
|
|
@@ -408,56 +469,56 @@ const nt = Ke(({
|
|
|
408
469
|
errorMessage: u,
|
|
409
470
|
disabled: i = !1,
|
|
410
471
|
variant: c = "primary",
|
|
411
|
-
size:
|
|
412
|
-
maxSelectedLabels:
|
|
413
|
-
selectionLimit:
|
|
414
|
-
className:
|
|
472
|
+
size: m = "medium",
|
|
473
|
+
maxSelectedLabels: v = 3,
|
|
474
|
+
selectionLimit: p,
|
|
475
|
+
className: f = "",
|
|
415
476
|
id: d,
|
|
416
|
-
name:
|
|
417
|
-
required:
|
|
477
|
+
name: h,
|
|
478
|
+
required: y = !1,
|
|
418
479
|
"data-testid": N,
|
|
419
|
-
...
|
|
480
|
+
...b
|
|
420
481
|
}, B) => {
|
|
421
|
-
const [
|
|
422
|
-
|
|
482
|
+
const [$, _] = T(!1), [k, E] = T(""), [x, j] = T(!1), I = P(null), A = P(null), S = P(null), g = (C) => {
|
|
483
|
+
I.current = C, B && (typeof B == "function" ? B(C) : B.current = C);
|
|
423
484
|
};
|
|
424
485
|
O(() => {
|
|
425
|
-
const
|
|
426
|
-
|
|
486
|
+
const C = (D) => {
|
|
487
|
+
I.current && !I.current.contains(D.target) && (_(!1), j(!1), E(""));
|
|
427
488
|
};
|
|
428
|
-
return document.addEventListener("click",
|
|
489
|
+
return document.addEventListener("click", C), () => document.removeEventListener("click", C);
|
|
429
490
|
}, []);
|
|
430
491
|
const M = e.filter(
|
|
431
|
-
(
|
|
492
|
+
(C) => C.label.toLowerCase().includes(k.toLowerCase())
|
|
432
493
|
), V = () => {
|
|
433
|
-
i || (
|
|
434
|
-
var
|
|
435
|
-
(
|
|
494
|
+
i || (_(!$), j(!$), $ ? E("") : setTimeout(() => {
|
|
495
|
+
var C;
|
|
496
|
+
(C = A.current) == null || C.focus();
|
|
436
497
|
}, 100));
|
|
437
|
-
}, F = (
|
|
498
|
+
}, F = (C, D) => {
|
|
438
499
|
if (i)
|
|
439
500
|
return;
|
|
440
501
|
D && (D.stopPropagation(), D.preventDefault());
|
|
441
|
-
const U = t.includes(
|
|
502
|
+
const U = t.includes(C);
|
|
442
503
|
let R;
|
|
443
|
-
U ? R = t.filter((se) => se !==
|
|
444
|
-
}, X = (
|
|
504
|
+
U ? R = t.filter((se) => se !== C) : R = [...t, C], a && a(R);
|
|
505
|
+
}, X = (C, D) => {
|
|
445
506
|
if (D.stopPropagation(), i) return;
|
|
446
|
-
const U = t.filter((R) => R !==
|
|
507
|
+
const U = t.filter((R) => R !== C);
|
|
447
508
|
a == null || a(U);
|
|
448
|
-
}, te = (
|
|
449
|
-
|
|
450
|
-
}, G = (
|
|
451
|
-
E(
|
|
452
|
-
}, H = (
|
|
453
|
-
|
|
454
|
-
}, le = x ||
|
|
509
|
+
}, te = (C) => {
|
|
510
|
+
C.stopPropagation(), !i && (a == null || a([]));
|
|
511
|
+
}, G = (C) => {
|
|
512
|
+
E(C.target.value);
|
|
513
|
+
}, H = (C) => {
|
|
514
|
+
C.key === "Escape" && (_(!1), j(!1), E(""));
|
|
515
|
+
}, le = x || $ || t.length > 0, re = () => {
|
|
455
516
|
if (t.length === 0) return null;
|
|
456
|
-
const
|
|
517
|
+
const C = t.map(
|
|
457
518
|
(R) => e.find((se) => se.value === R)
|
|
458
|
-
).filter(Boolean), D =
|
|
459
|
-
return /* @__PURE__ */
|
|
460
|
-
D.map((R) => /* @__PURE__ */
|
|
519
|
+
).filter(Boolean), D = C.slice(0, v), U = C.length - v;
|
|
520
|
+
return /* @__PURE__ */ w("div", { className: "clarity-multiselect__chips", children: [
|
|
521
|
+
D.map((R) => /* @__PURE__ */ w("div", { className: "clarity-multiselect__chip", children: [
|
|
461
522
|
/* @__PURE__ */ s("span", { className: "clarity-multiselect__chip-label", children: R.label }),
|
|
462
523
|
!i && /* @__PURE__ */ s(
|
|
463
524
|
"button",
|
|
@@ -470,7 +531,7 @@ const nt = Ke(({
|
|
|
470
531
|
}
|
|
471
532
|
)
|
|
472
533
|
] }, R.value)),
|
|
473
|
-
U > 0 && /* @__PURE__ */
|
|
534
|
+
U > 0 && /* @__PURE__ */ w("div", { className: "clarity-multiselect__chip clarity-multiselect__chip--count", children: [
|
|
474
535
|
"+",
|
|
475
536
|
U,
|
|
476
537
|
" mais"
|
|
@@ -478,39 +539,39 @@ const nt = Ke(({
|
|
|
478
539
|
] });
|
|
479
540
|
}, ie = [
|
|
480
541
|
"clarity-multiselect-wrapper",
|
|
481
|
-
|
|
542
|
+
f
|
|
482
543
|
].filter(Boolean).join(" "), oe = [
|
|
483
544
|
"clarity-multiselect",
|
|
484
545
|
`clarity-multiselect--${c}`,
|
|
485
|
-
`clarity-multiselect--${
|
|
486
|
-
|
|
546
|
+
`clarity-multiselect--${m}`,
|
|
547
|
+
$ && "clarity-multiselect--open",
|
|
487
548
|
x && "clarity-multiselect--focused",
|
|
488
549
|
le && "clarity-multiselect--label-up",
|
|
489
550
|
o && "clarity-multiselect--error",
|
|
490
551
|
i && "clarity-multiselect--disabled",
|
|
491
552
|
t.length > 0 && "clarity-multiselect--has-value"
|
|
492
553
|
].filter(Boolean).join(" ");
|
|
493
|
-
return /* @__PURE__ */
|
|
494
|
-
/* @__PURE__ */
|
|
554
|
+
return /* @__PURE__ */ w("div", { className: ie, children: [
|
|
555
|
+
/* @__PURE__ */ w(
|
|
495
556
|
"div",
|
|
496
557
|
{
|
|
497
|
-
ref:
|
|
558
|
+
ref: g,
|
|
498
559
|
className: oe,
|
|
499
560
|
"data-testid": N,
|
|
500
|
-
...
|
|
561
|
+
...b,
|
|
501
562
|
children: [
|
|
502
|
-
/* @__PURE__ */
|
|
563
|
+
/* @__PURE__ */ w(
|
|
503
564
|
"div",
|
|
504
565
|
{
|
|
505
566
|
className: "clarity-multiselect__field",
|
|
506
567
|
onClick: V,
|
|
507
568
|
children: [
|
|
508
|
-
n && /* @__PURE__ */
|
|
569
|
+
n && /* @__PURE__ */ w("label", { className: "clarity-multiselect__label", children: [
|
|
509
570
|
n,
|
|
510
|
-
|
|
571
|
+
y && /* @__PURE__ */ s("span", { className: "clarity-multiselect__required", children: "*" })
|
|
511
572
|
] }),
|
|
512
573
|
/* @__PURE__ */ s("div", { className: "clarity-multiselect__content", children: t.length > 0 ? re() : /* @__PURE__ */ s("span", { className: "clarity-multiselect__placeholder", children: l }) }),
|
|
513
|
-
/* @__PURE__ */
|
|
574
|
+
/* @__PURE__ */ w("div", { className: "clarity-multiselect__icons", children: [
|
|
514
575
|
t.length > 0 && !i && /* @__PURE__ */ s(
|
|
515
576
|
"button",
|
|
516
577
|
{
|
|
@@ -535,11 +596,11 @@ const nt = Ke(({
|
|
|
535
596
|
]
|
|
536
597
|
}
|
|
537
598
|
),
|
|
538
|
-
|
|
599
|
+
$ && /* @__PURE__ */ w("div", { ref: S, className: "clarity-multiselect__dropdown", children: [
|
|
539
600
|
/* @__PURE__ */ s("div", { className: "clarity-multiselect__search", children: /* @__PURE__ */ s(
|
|
540
601
|
"input",
|
|
541
602
|
{
|
|
542
|
-
ref:
|
|
603
|
+
ref: A,
|
|
543
604
|
type: "text",
|
|
544
605
|
className: "clarity-multiselect__search-input",
|
|
545
606
|
placeholder: "Buscar opções...",
|
|
@@ -548,9 +609,9 @@ const nt = Ke(({
|
|
|
548
609
|
onKeyDown: H
|
|
549
610
|
}
|
|
550
611
|
) }),
|
|
551
|
-
/* @__PURE__ */ s("ul", { className: "clarity-multiselect__options", children: M.length > 0 ? M.map((
|
|
552
|
-
const D = t.includes(
|
|
553
|
-
return /* @__PURE__ */
|
|
612
|
+
/* @__PURE__ */ s("ul", { className: "clarity-multiselect__options", children: M.length > 0 ? M.map((C) => {
|
|
613
|
+
const D = t.includes(C.value), U = C.disabled || i;
|
|
614
|
+
return /* @__PURE__ */ w(
|
|
554
615
|
"li",
|
|
555
616
|
{
|
|
556
617
|
className: [
|
|
@@ -558,7 +619,7 @@ const nt = Ke(({
|
|
|
558
619
|
D && "clarity-multiselect__option--selected",
|
|
559
620
|
U && "clarity-multiselect__option--disabled"
|
|
560
621
|
].filter(Boolean).join(" "),
|
|
561
|
-
onClick: (R) => !U && F(
|
|
622
|
+
onClick: (R) => !U && F(C.value, R),
|
|
562
623
|
children: [
|
|
563
624
|
/* @__PURE__ */ s("div", { className: "clarity-multiselect__option-checkbox", children: /* @__PURE__ */ s("div", { className: [
|
|
564
625
|
"clarity-multiselect__checkbox",
|
|
@@ -573,10 +634,10 @@ const nt = Ke(({
|
|
|
573
634
|
strokeLinejoin: "round"
|
|
574
635
|
}
|
|
575
636
|
) }) }) }),
|
|
576
|
-
/* @__PURE__ */ s("span", { className: "clarity-multiselect__option-label", children:
|
|
637
|
+
/* @__PURE__ */ s("span", { className: "clarity-multiselect__option-label", children: C.label })
|
|
577
638
|
]
|
|
578
639
|
},
|
|
579
|
-
|
|
640
|
+
C.value
|
|
580
641
|
);
|
|
581
642
|
}) : /* @__PURE__ */ s("li", { className: "clarity-multiselect__option clarity-multiselect__option--no-results", children: "Nenhum resultado encontrado" }) })
|
|
582
643
|
] })
|
|
@@ -605,7 +666,7 @@ const fe = z(null), pe = () => {
|
|
|
605
666
|
"clarity-modal-close",
|
|
606
667
|
n && `clarity-modal-close--${n}`
|
|
607
668
|
].filter(Boolean).join(" ");
|
|
608
|
-
return /* @__PURE__ */
|
|
669
|
+
return /* @__PURE__ */ w("div", { className: o, children: [
|
|
609
670
|
a && /* @__PURE__ */ s("h2", { className: "clarity-modal-title", children: a }),
|
|
610
671
|
e,
|
|
611
672
|
r && /* @__PURE__ */ s("button", { className: u, onClick: (i) => {
|
|
@@ -616,7 +677,7 @@ const fe = z(null), pe = () => {
|
|
|
616
677
|
he.displayName = "Modal.Header";
|
|
617
678
|
const ye = ({ children: e, className: t = "" }) => /* @__PURE__ */ s("div", { className: `clarity-modal-content ${t}`, children: e });
|
|
618
679
|
ye.displayName = "Modal.Content";
|
|
619
|
-
const ve = ({ children: e, className: t = "" }) => /* @__PURE__ */
|
|
680
|
+
const ve = ({ children: e, className: t = "" }) => /* @__PURE__ */ w("div", { className: `clarity-modal-footer ${t}`, children: [
|
|
620
681
|
/* @__PURE__ */ s("div", { className: "clarity-modal-scroll-indicator" }),
|
|
621
682
|
e
|
|
622
683
|
] });
|
|
@@ -650,29 +711,29 @@ const J = ({
|
|
|
650
711
|
showCloseButton: u = !0,
|
|
651
712
|
closeOnOverlayClick: i = !0
|
|
652
713
|
}) => {
|
|
653
|
-
const [c,
|
|
654
|
-
|
|
714
|
+
const [c, m] = T(!1), p = e !== void 0 ? e : c, f = t || (() => {
|
|
715
|
+
m(!1);
|
|
655
716
|
});
|
|
656
717
|
O(() => {
|
|
657
|
-
|
|
658
|
-
}, [
|
|
659
|
-
const
|
|
660
|
-
B.key === "Escape" &&
|
|
718
|
+
p && (a == null || a());
|
|
719
|
+
}, [p, a]), O(() => {
|
|
720
|
+
const b = (B) => {
|
|
721
|
+
B.key === "Escape" && f();
|
|
661
722
|
};
|
|
662
|
-
return
|
|
663
|
-
document.removeEventListener("keydown",
|
|
723
|
+
return p ? (document.addEventListener("keydown", b), document.body.style.overflow = "hidden") : document.body.style.overflow = "unset", () => {
|
|
724
|
+
document.removeEventListener("keydown", b), document.body.style.overflow = "unset";
|
|
664
725
|
};
|
|
665
|
-
}, [
|
|
666
|
-
const d = (
|
|
667
|
-
i &&
|
|
668
|
-
},
|
|
669
|
-
(
|
|
670
|
-
),
|
|
671
|
-
(
|
|
726
|
+
}, [p, f]);
|
|
727
|
+
const d = (b) => {
|
|
728
|
+
i && b.target === b.currentTarget && f();
|
|
729
|
+
}, h = L.Children.toArray(l).find(
|
|
730
|
+
(b) => Z(b) && b.type.displayName === "Modal.Trigger"
|
|
731
|
+
), y = L.Children.toArray(l).filter(
|
|
732
|
+
(b) => Z(b) && b.type.displayName !== "Modal.Trigger"
|
|
672
733
|
), N = ["clarity-modal", n, `clarity-modal--${o}`].filter(Boolean).join(" ");
|
|
673
|
-
return /* @__PURE__ */
|
|
674
|
-
|
|
675
|
-
|
|
734
|
+
return /* @__PURE__ */ w(fe.Provider, { value: { onClose: f, variant: r, showCloseButton: u }, children: [
|
|
735
|
+
h && W(h, { onClick: () => m(!0), variant: r }),
|
|
736
|
+
p && /* @__PURE__ */ s("div", { className: "clarity-modal-overlay", onClick: d, children: /* @__PURE__ */ s("div", { className: N, children: y }) })
|
|
676
737
|
] });
|
|
677
738
|
};
|
|
678
739
|
J.Header = he;
|
|
@@ -681,7 +742,7 @@ J.Footer = ve;
|
|
|
681
742
|
J.Trigger = Ce;
|
|
682
743
|
J.Close = Ne;
|
|
683
744
|
J.displayName = "Modal";
|
|
684
|
-
const be = z(void 0),
|
|
745
|
+
const be = z(void 0), kt = () => {
|
|
685
746
|
const e = q(be);
|
|
686
747
|
if (!e)
|
|
687
748
|
throw new Error("useToast must be used within a ToastProvider");
|
|
@@ -691,13 +752,13 @@ const be = z(void 0), $t = () => {
|
|
|
691
752
|
O(() => {
|
|
692
753
|
const c = setTimeout(() => {
|
|
693
754
|
u("visible");
|
|
694
|
-
}, 10),
|
|
755
|
+
}, 10), m = setTimeout(() => {
|
|
695
756
|
u("exiting");
|
|
696
|
-
}, l * 1e3 - 300),
|
|
757
|
+
}, l * 1e3 - 300), v = setTimeout(() => {
|
|
697
758
|
n(e);
|
|
698
759
|
}, l * 1e3);
|
|
699
760
|
return () => {
|
|
700
|
-
clearTimeout(c), clearTimeout(
|
|
761
|
+
clearTimeout(c), clearTimeout(m), clearTimeout(v);
|
|
701
762
|
};
|
|
702
763
|
}, [e, l, n]);
|
|
703
764
|
const i = [
|
|
@@ -706,7 +767,7 @@ const be = z(void 0), $t = () => {
|
|
|
706
767
|
r ? "colored-background" : "",
|
|
707
768
|
`cl-toast-${o}`
|
|
708
769
|
].filter(Boolean).join(" ");
|
|
709
|
-
return /* @__PURE__ */
|
|
770
|
+
return /* @__PURE__ */ w("div", { className: i, children: [
|
|
710
771
|
/* @__PURE__ */ s("div", { className: "cl-toast-message", children: t }),
|
|
711
772
|
/* @__PURE__ */ s("button", { onClick: () => u("exiting"), className: "cl-toast-close-button", children: "×" }),
|
|
712
773
|
/* @__PURE__ */ s(
|
|
@@ -717,7 +778,7 @@ const be = z(void 0), $t = () => {
|
|
|
717
778
|
}
|
|
718
779
|
)
|
|
719
780
|
] });
|
|
720
|
-
},
|
|
781
|
+
}, xt = ({ children: e }) => {
|
|
721
782
|
const [t, a] = T([]), l = Y(() => {
|
|
722
783
|
if (typeof document < "u") {
|
|
723
784
|
const i = document.createElement("div");
|
|
@@ -732,23 +793,23 @@ const be = z(void 0), $t = () => {
|
|
|
732
793
|
};
|
|
733
794
|
}, [l]);
|
|
734
795
|
const n = ne((i) => {
|
|
735
|
-
const
|
|
796
|
+
const m = {
|
|
736
797
|
id: (/* @__PURE__ */ new Date()).toISOString() + Math.random(),
|
|
737
798
|
// duration: 5,
|
|
738
799
|
// position: 'right-top',
|
|
739
800
|
...i
|
|
740
801
|
};
|
|
741
|
-
a((
|
|
742
|
-
const
|
|
743
|
-
return
|
|
802
|
+
a((v) => {
|
|
803
|
+
const p = [m, ...v];
|
|
804
|
+
return p.length > 4 ? p.slice(0, 4) : p;
|
|
744
805
|
});
|
|
745
806
|
}, []), r = ne((i) => {
|
|
746
|
-
a((c) => c.filter((
|
|
807
|
+
a((c) => c.filter((m) => m.id !== i));
|
|
747
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]);
|
|
748
|
-
return /* @__PURE__ */
|
|
809
|
+
return /* @__PURE__ */ w(be.Provider, { value: u, children: [
|
|
749
810
|
e,
|
|
750
811
|
l && tt.createPortal(
|
|
751
|
-
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((m) => /* @__PURE__ */ s(rt, { ...m, onClose: r }, m.id)) }, i)),
|
|
752
813
|
l
|
|
753
814
|
)
|
|
754
815
|
] });
|
|
@@ -757,7 +818,7 @@ const be = z(void 0), $t = () => {
|
|
|
757
818
|
if (!e)
|
|
758
819
|
throw new Error("useOffcanvas must be used within an Offcanvas provider");
|
|
759
820
|
return e;
|
|
760
|
-
},
|
|
821
|
+
}, $e = ({
|
|
761
822
|
children: e,
|
|
762
823
|
className: t = ""
|
|
763
824
|
}) => {
|
|
@@ -771,7 +832,7 @@ const be = z(void 0), $t = () => {
|
|
|
771
832
|
"clarity-offcanvas-title",
|
|
772
833
|
l && `clarity-offcanvas-title--${l}`
|
|
773
834
|
].filter(Boolean).join(" ");
|
|
774
|
-
return /* @__PURE__ */
|
|
835
|
+
return /* @__PURE__ */ w("div", { className: o, children: [
|
|
775
836
|
r && /* @__PURE__ */ s("h2", { className: i, children: r }),
|
|
776
837
|
e,
|
|
777
838
|
n && /* @__PURE__ */ s("button", { className: u, onClick: (c) => {
|
|
@@ -779,9 +840,9 @@ const be = z(void 0), $t = () => {
|
|
|
779
840
|
}, children: "×" })
|
|
780
841
|
] });
|
|
781
842
|
};
|
|
782
|
-
|
|
783
|
-
const
|
|
784
|
-
|
|
843
|
+
$e.displayName = "Offcanvas.Header";
|
|
844
|
+
const ge = ({ children: e, className: t = "" }) => /* @__PURE__ */ s("div", { className: `clarity-offcanvas-content ${t}`, children: e });
|
|
845
|
+
ge.displayName = "Offcanvas.Content";
|
|
785
846
|
const ke = ({ children: e, onClick: t, variant: a }) => W(e, {
|
|
786
847
|
onClick: (l) => {
|
|
787
848
|
var n, r;
|
|
@@ -814,68 +875,68 @@ const K = ({
|
|
|
814
875
|
showCloseButton: i = !0,
|
|
815
876
|
title: c
|
|
816
877
|
}) => {
|
|
817
|
-
const [
|
|
818
|
-
t ? t() :
|
|
878
|
+
const [m, v] = T(!1), [p, f] = T(!1), [d, h] = T(!1), y = e !== void 0, N = y ? e : m, b = ne(() => {
|
|
879
|
+
t ? t() : v(!1);
|
|
819
880
|
}, [t]), B = ne(() => {
|
|
820
|
-
|
|
821
|
-
}, [
|
|
881
|
+
y || v(!0), a == null || a();
|
|
882
|
+
}, [y, a]);
|
|
822
883
|
O(() => {
|
|
823
884
|
if (N) {
|
|
824
|
-
|
|
825
|
-
const
|
|
826
|
-
|
|
885
|
+
h(!0);
|
|
886
|
+
const g = setTimeout(() => {
|
|
887
|
+
f(!0);
|
|
827
888
|
}, 50);
|
|
828
|
-
return () => clearTimeout(
|
|
889
|
+
return () => clearTimeout(g);
|
|
829
890
|
} else {
|
|
830
|
-
|
|
831
|
-
const
|
|
832
|
-
|
|
891
|
+
f(!1);
|
|
892
|
+
const g = setTimeout(() => {
|
|
893
|
+
h(!1);
|
|
833
894
|
}, 300);
|
|
834
|
-
return () => clearTimeout(
|
|
895
|
+
return () => clearTimeout(g);
|
|
835
896
|
}
|
|
836
897
|
}, [N]), O(() => {
|
|
837
|
-
const
|
|
838
|
-
M.key === "Escape" &&
|
|
898
|
+
const g = (M) => {
|
|
899
|
+
M.key === "Escape" && b();
|
|
839
900
|
};
|
|
840
|
-
return N ? (document.addEventListener("keydown",
|
|
841
|
-
document.removeEventListener("keydown",
|
|
901
|
+
return N ? (document.addEventListener("keydown", g), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", g), document.body.style.overflow = "unset"), () => {
|
|
902
|
+
document.removeEventListener("keydown", g), document.body.style.overflow = "unset";
|
|
842
903
|
};
|
|
843
|
-
}, [N,
|
|
844
|
-
const
|
|
845
|
-
u &&
|
|
846
|
-
},
|
|
847
|
-
let k, E, x, j,
|
|
848
|
-
|
|
849
|
-
if (Z(
|
|
850
|
-
if (
|
|
851
|
-
k =
|
|
852
|
-
else if (
|
|
853
|
-
E =
|
|
854
|
-
else if (
|
|
855
|
-
x =
|
|
856
|
-
const V = L.Children.toArray(x.props.children).filter((F) => Z(F) && F.type.displayName === "Offcanvas.Close" ? (
|
|
904
|
+
}, [N, b]);
|
|
905
|
+
const $ = (g) => {
|
|
906
|
+
u && g.target === g.currentTarget && b();
|
|
907
|
+
}, _ = L.Children.toArray(l);
|
|
908
|
+
let k, E, x, j, I;
|
|
909
|
+
_.forEach((g) => {
|
|
910
|
+
if (Z(g))
|
|
911
|
+
if (g.type.displayName === "Offcanvas.Trigger")
|
|
912
|
+
k = g;
|
|
913
|
+
else if (g.type.displayName === "Offcanvas.Header")
|
|
914
|
+
E = g;
|
|
915
|
+
else if (g.type.displayName === "Offcanvas.Content") {
|
|
916
|
+
x = g;
|
|
917
|
+
const V = L.Children.toArray(x.props.children).filter((F) => Z(F) && F.type.displayName === "Offcanvas.Close" ? (I = F, !1) : !0);
|
|
857
918
|
x = W(x, { children: V });
|
|
858
|
-
} else
|
|
859
|
-
}),
|
|
860
|
-
children: /* @__PURE__ */
|
|
919
|
+
} else g.type.displayName === "Offcanvas.Footer" && (j = g);
|
|
920
|
+
}), I && (j ? j = W(j, {
|
|
921
|
+
children: /* @__PURE__ */ w(Ze, { children: [
|
|
861
922
|
j.props.children,
|
|
862
|
-
|
|
923
|
+
I
|
|
863
924
|
] })
|
|
864
|
-
}) : j = /* @__PURE__ */ s(ce, { children:
|
|
865
|
-
const
|
|
925
|
+
}) : j = /* @__PURE__ */ s(ce, { children: I }));
|
|
926
|
+
const A = [
|
|
866
927
|
"clarity-offcanvas",
|
|
867
928
|
n,
|
|
868
929
|
`clarity-offcanvas--${o}`,
|
|
869
930
|
r && `clarity-offcanvas--${r}`,
|
|
870
|
-
|
|
871
|
-
].filter(Boolean).join(" "),
|
|
931
|
+
p ? "clarity-offcanvas--open" : "clarity-offcanvas--closed"
|
|
932
|
+
].filter(Boolean).join(" "), S = [
|
|
872
933
|
"clarity-offcanvas-overlay",
|
|
873
|
-
|
|
934
|
+
p ? "clarity-offcanvas-overlay--visible" : ""
|
|
874
935
|
].filter(Boolean).join(" ");
|
|
875
|
-
return /* @__PURE__ */
|
|
936
|
+
return /* @__PURE__ */ w(_e.Provider, { value: { onClose: b, variant: r, showCloseButton: i, placement: o, title: c }, children: [
|
|
876
937
|
k && W(k, { onClick: B, variant: r }),
|
|
877
938
|
d && // Only render if shouldRender is true
|
|
878
|
-
/* @__PURE__ */ s("div", { className:
|
|
939
|
+
/* @__PURE__ */ s("div", { className: S, onClick: $, children: /* @__PURE__ */ w("div", { className: A, children: [
|
|
879
940
|
E,
|
|
880
941
|
x,
|
|
881
942
|
j && /* @__PURE__ */ s("div", { className: "clarity-offcanvas-scroll-indicator" }),
|
|
@@ -884,8 +945,8 @@ const K = ({
|
|
|
884
945
|
] }) })
|
|
885
946
|
] });
|
|
886
947
|
};
|
|
887
|
-
K.Header =
|
|
888
|
-
K.Content =
|
|
948
|
+
K.Header = $e;
|
|
949
|
+
K.Content = ge;
|
|
889
950
|
K.Footer = ce;
|
|
890
951
|
K.Trigger = ke;
|
|
891
952
|
K.Close = xe;
|
|
@@ -901,16 +962,16 @@ const it = L.forwardRef(({
|
|
|
901
962
|
labelPosition: u = "right",
|
|
902
963
|
className: i = "",
|
|
903
964
|
disabled: c = !1,
|
|
904
|
-
checked:
|
|
905
|
-
id:
|
|
906
|
-
...
|
|
907
|
-
},
|
|
908
|
-
const d =
|
|
965
|
+
checked: m,
|
|
966
|
+
id: v,
|
|
967
|
+
...p
|
|
968
|
+
}, f) => {
|
|
969
|
+
const d = v || `check-input-${Math.random().toString(36).substr(2, 9)}`, h = [
|
|
909
970
|
"clarity-check-input-wrapper",
|
|
910
971
|
`clarity-check-input-wrapper--${u}`,
|
|
911
972
|
c && "clarity-check-input-wrapper--disabled",
|
|
912
973
|
r && "clarity-check-input-wrapper--error"
|
|
913
|
-
].filter(Boolean).join(" "),
|
|
974
|
+
].filter(Boolean).join(" "), y = [
|
|
914
975
|
"clarity-check-input",
|
|
915
976
|
`clarity-check-input--${e}`,
|
|
916
977
|
`clarity-check-input--${a}`,
|
|
@@ -923,21 +984,21 @@ const it = L.forwardRef(({
|
|
|
923
984
|
`clarity-check-input__label--${a}`,
|
|
924
985
|
c && "clarity-check-input__label--disabled"
|
|
925
986
|
].filter(Boolean).join(" ");
|
|
926
|
-
return /* @__PURE__ */
|
|
927
|
-
/* @__PURE__ */
|
|
987
|
+
return /* @__PURE__ */ w("div", { className: "clarity-check-input-container", children: [
|
|
988
|
+
/* @__PURE__ */ w("label", { className: h, htmlFor: d, children: [
|
|
928
989
|
/* @__PURE__ */ s(
|
|
929
990
|
"input",
|
|
930
991
|
{
|
|
931
|
-
ref:
|
|
992
|
+
ref: f,
|
|
932
993
|
id: d,
|
|
933
994
|
type: e,
|
|
934
|
-
className:
|
|
995
|
+
className: y,
|
|
935
996
|
disabled: c,
|
|
936
|
-
checked:
|
|
937
|
-
...
|
|
997
|
+
checked: m,
|
|
998
|
+
...p
|
|
938
999
|
}
|
|
939
1000
|
),
|
|
940
|
-
/* @__PURE__ */
|
|
1001
|
+
/* @__PURE__ */ w("div", { className: "clarity-check-input__custom", children: [
|
|
941
1002
|
e === "checkbox" && /* @__PURE__ */ s(
|
|
942
1003
|
"svg",
|
|
943
1004
|
{
|
|
@@ -976,42 +1037,42 @@ const ot = L.forwardRef(({
|
|
|
976
1037
|
className: u = "",
|
|
977
1038
|
disabled: i = !1,
|
|
978
1039
|
checked: c,
|
|
979
|
-
id:
|
|
980
|
-
...
|
|
981
|
-
},
|
|
982
|
-
const
|
|
1040
|
+
id: m,
|
|
1041
|
+
...v
|
|
1042
|
+
}, p) => {
|
|
1043
|
+
const f = m || `input-switch-${Math.random().toString(36).substr(2, 9)}`, d = [
|
|
983
1044
|
"clarity-input-switch-wrapper",
|
|
984
1045
|
`clarity-input-switch-wrapper--${o}`,
|
|
985
1046
|
i && "clarity-input-switch-wrapper--disabled",
|
|
986
1047
|
n && "clarity-input-switch-wrapper--error"
|
|
987
|
-
].filter(Boolean).join(" "),
|
|
1048
|
+
].filter(Boolean).join(" "), h = [
|
|
988
1049
|
"clarity-input-switch",
|
|
989
1050
|
`clarity-input-switch--${t}`,
|
|
990
1051
|
e && `clarity-input-switch--${e}`,
|
|
991
1052
|
n && "clarity-input-switch--error",
|
|
992
1053
|
i && "clarity-input-switch--disabled",
|
|
993
1054
|
u
|
|
994
|
-
].filter(Boolean).join(" "),
|
|
1055
|
+
].filter(Boolean).join(" "), y = [
|
|
995
1056
|
"clarity-input-switch__label",
|
|
996
1057
|
`clarity-input-switch__label--${t}`,
|
|
997
1058
|
i && "clarity-input-switch__label--disabled"
|
|
998
1059
|
].filter(Boolean).join(" ");
|
|
999
|
-
return /* @__PURE__ */
|
|
1000
|
-
/* @__PURE__ */
|
|
1060
|
+
return /* @__PURE__ */ w("div", { className: "clarity-input-switch-container", children: [
|
|
1061
|
+
/* @__PURE__ */ w("label", { className: d, htmlFor: f, children: [
|
|
1001
1062
|
/* @__PURE__ */ s(
|
|
1002
1063
|
"input",
|
|
1003
1064
|
{
|
|
1004
|
-
ref:
|
|
1005
|
-
id:
|
|
1065
|
+
ref: p,
|
|
1066
|
+
id: f,
|
|
1006
1067
|
type: "checkbox",
|
|
1007
|
-
className:
|
|
1068
|
+
className: h,
|
|
1008
1069
|
disabled: i,
|
|
1009
1070
|
checked: c,
|
|
1010
|
-
...
|
|
1071
|
+
...v
|
|
1011
1072
|
}
|
|
1012
1073
|
),
|
|
1013
1074
|
/* @__PURE__ */ s("div", { className: "clarity-input-switch__track", children: /* @__PURE__ */ s("div", { className: "clarity-input-switch__thumb" }) }),
|
|
1014
|
-
a && /* @__PURE__ */ s("span", { className:
|
|
1075
|
+
a && /* @__PURE__ */ s("span", { className: y, children: a })
|
|
1015
1076
|
] }),
|
|
1016
1077
|
(l || n && r) && /* @__PURE__ */ s("div", { className: "clarity-input-switch__helper-text", children: n && r ? r : l })
|
|
1017
1078
|
] });
|
|
@@ -1038,7 +1099,7 @@ const Ee = ({ children: e }) => W(e, {
|
|
|
1038
1099
|
}
|
|
1039
1100
|
});
|
|
1040
1101
|
Ee.displayName = "ConfirmationDialog.Trigger";
|
|
1041
|
-
const
|
|
1102
|
+
const Se = ({ children: e }) => {
|
|
1042
1103
|
const { onClose: t } = de();
|
|
1043
1104
|
return W(e, {
|
|
1044
1105
|
onClick: (a) => {
|
|
@@ -1047,7 +1108,7 @@ const Ie = ({ children: e }) => {
|
|
|
1047
1108
|
}
|
|
1048
1109
|
});
|
|
1049
1110
|
};
|
|
1050
|
-
|
|
1111
|
+
Se.displayName = "ConfirmationDialog.Close";
|
|
1051
1112
|
const Oe = ({ children: e }) => {
|
|
1052
1113
|
const { onConfirm: t } = de();
|
|
1053
1114
|
return W(e, {
|
|
@@ -1067,37 +1128,37 @@ const Q = ({
|
|
|
1067
1128
|
}) => {
|
|
1068
1129
|
const [r, o] = T(!1), u = e !== void 0, i = u ? e : r, c = () => {
|
|
1069
1130
|
u || o(!0);
|
|
1070
|
-
},
|
|
1131
|
+
}, m = () => {
|
|
1071
1132
|
t ? t() : o(!1);
|
|
1072
|
-
},
|
|
1073
|
-
a && a(),
|
|
1133
|
+
}, v = () => {
|
|
1134
|
+
a && a(), m();
|
|
1074
1135
|
};
|
|
1075
1136
|
O(() => {
|
|
1076
|
-
const
|
|
1077
|
-
|
|
1137
|
+
const h = (y) => {
|
|
1138
|
+
y.key === "Escape" && m();
|
|
1078
1139
|
};
|
|
1079
|
-
return i ? (document.addEventListener("keydown",
|
|
1080
|
-
document.removeEventListener("keydown",
|
|
1140
|
+
return i ? (document.addEventListener("keydown", h), document.body.style.overflow = "hidden") : document.body.style.overflow = "unset", () => {
|
|
1141
|
+
document.removeEventListener("keydown", h), document.body.style.overflow = "unset";
|
|
1081
1142
|
};
|
|
1082
|
-
}, [i,
|
|
1083
|
-
const
|
|
1084
|
-
(
|
|
1085
|
-
),
|
|
1086
|
-
(
|
|
1143
|
+
}, [i, m]);
|
|
1144
|
+
const p = L.Children.toArray(n).find(
|
|
1145
|
+
(h) => Z(h) && h.type.displayName === "ConfirmationDialog.Trigger"
|
|
1146
|
+
), f = L.Children.toArray(n).filter(
|
|
1147
|
+
(h) => Z(h) && h.type.displayName !== "ConfirmationDialog.Trigger"
|
|
1087
1148
|
), d = `clarity-confirmation-dialog clarity-confirmation-dialog--${l}`;
|
|
1088
|
-
return /* @__PURE__ */
|
|
1089
|
-
|
|
1090
|
-
i && /* @__PURE__ */ s("div", { className: "clarity-modal-overlay", children: /* @__PURE__ */ s("div", { className: d, children:
|
|
1149
|
+
return /* @__PURE__ */ w(Te.Provider, { value: { variant: l, onClose: m, onConfirm: v, onOpen: c }, children: [
|
|
1150
|
+
p,
|
|
1151
|
+
i && /* @__PURE__ */ s("div", { className: "clarity-modal-overlay", children: /* @__PURE__ */ s("div", { className: d, children: f }) })
|
|
1091
1152
|
] });
|
|
1092
1153
|
};
|
|
1093
1154
|
Q.Header = Be;
|
|
1094
1155
|
Q.Content = je;
|
|
1095
1156
|
Q.Footer = Le;
|
|
1096
1157
|
Q.Trigger = Ee;
|
|
1097
|
-
Q.Close =
|
|
1158
|
+
Q.Close = Se;
|
|
1098
1159
|
Q.Confirm = Oe;
|
|
1099
1160
|
Q.displayName = "ConfirmationDialog";
|
|
1100
|
-
const
|
|
1161
|
+
const Tt = ({
|
|
1101
1162
|
variant: e = "primary",
|
|
1102
1163
|
product: t,
|
|
1103
1164
|
tone: a,
|
|
@@ -1108,26 +1169,26 @@ const xt = ({
|
|
|
1108
1169
|
children: u,
|
|
1109
1170
|
onClick: i,
|
|
1110
1171
|
type: c = "button",
|
|
1111
|
-
className:
|
|
1112
|
-
"aria-label":
|
|
1113
|
-
title:
|
|
1114
|
-
...
|
|
1172
|
+
className: m = "",
|
|
1173
|
+
"aria-label": v,
|
|
1174
|
+
title: p,
|
|
1175
|
+
...f
|
|
1115
1176
|
}) => {
|
|
1116
|
-
const d = "clarity-button-icon",
|
|
1177
|
+
const d = "clarity-button-icon", h = t && a, y = h ? `${d}--custom` : `${d}--${e}`, N = [
|
|
1117
1178
|
d,
|
|
1118
|
-
|
|
1179
|
+
y,
|
|
1119
1180
|
`${d}--${n}`,
|
|
1120
1181
|
o && `${d}--loading`,
|
|
1121
1182
|
r && `${d}--disabled`,
|
|
1122
|
-
|
|
1123
|
-
].filter(Boolean).join(" "),
|
|
1124
|
-
const
|
|
1125
|
-
return
|
|
1126
|
-
}, B =
|
|
1183
|
+
m
|
|
1184
|
+
].filter(Boolean).join(" "), b = ($) => {
|
|
1185
|
+
const _ = parseInt($);
|
|
1186
|
+
return _ >= 800 ? "900" : _ >= 700 ? "800" : _ >= 600 ? "700" : _ >= 500 ? "600" : _ >= 400 ? "500" : _ >= 300 ? "400" : _ >= 200 ? "300" : "200";
|
|
1187
|
+
}, B = h ? {
|
|
1127
1188
|
"--custom-bg-color": `var(--clarity-${t}-${a})`,
|
|
1128
|
-
"--custom-hover-color": `var(--clarity-${t}-${l ||
|
|
1189
|
+
"--custom-hover-color": `var(--clarity-${t}-${l || b(a)})`
|
|
1129
1190
|
} : {};
|
|
1130
|
-
return /* @__PURE__ */
|
|
1191
|
+
return /* @__PURE__ */ w(
|
|
1131
1192
|
"button",
|
|
1132
1193
|
{
|
|
1133
1194
|
className: N,
|
|
@@ -1135,16 +1196,16 @@ const xt = ({
|
|
|
1135
1196
|
disabled: r || o,
|
|
1136
1197
|
onClick: i,
|
|
1137
1198
|
type: c,
|
|
1138
|
-
"aria-label":
|
|
1139
|
-
title:
|
|
1140
|
-
...
|
|
1199
|
+
"aria-label": v,
|
|
1200
|
+
title: p,
|
|
1201
|
+
...f,
|
|
1141
1202
|
children: [
|
|
1142
1203
|
o && /* @__PURE__ */ s("div", { className: `${d}__spinner` }),
|
|
1143
1204
|
!o && u
|
|
1144
1205
|
]
|
|
1145
1206
|
}
|
|
1146
1207
|
);
|
|
1147
|
-
},
|
|
1208
|
+
}, Bt = ({
|
|
1148
1209
|
variant: e = "primary",
|
|
1149
1210
|
product: t,
|
|
1150
1211
|
tone: a,
|
|
@@ -1155,20 +1216,20 @@ const xt = ({
|
|
|
1155
1216
|
onClick: u,
|
|
1156
1217
|
href: i,
|
|
1157
1218
|
target: c,
|
|
1158
|
-
rel:
|
|
1159
|
-
className:
|
|
1160
|
-
...
|
|
1219
|
+
rel: m,
|
|
1220
|
+
className: v = "",
|
|
1221
|
+
...p
|
|
1161
1222
|
}) => {
|
|
1162
|
-
const
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
`${
|
|
1166
|
-
r && `${
|
|
1167
|
-
|
|
1223
|
+
const f = "clarity-button-link", d = t && a, h = d ? `${f}--custom` : `${f}--${e}`, y = [
|
|
1224
|
+
f,
|
|
1225
|
+
h,
|
|
1226
|
+
`${f}--${n}`,
|
|
1227
|
+
r && `${f}--disabled`,
|
|
1228
|
+
v
|
|
1168
1229
|
].filter(Boolean).join(" "), N = (B) => {
|
|
1169
|
-
const
|
|
1170
|
-
return
|
|
1171
|
-
},
|
|
1230
|
+
const $ = parseInt(B);
|
|
1231
|
+
return $ >= 800 ? "900" : $ >= 700 ? "800" : $ >= 600 ? "700" : $ >= 500 ? "600" : $ >= 400 ? "500" : $ >= 300 ? "400" : $ >= 200 ? "300" : "200";
|
|
1232
|
+
}, b = d ? {
|
|
1172
1233
|
"--custom-color": `var(--clarity-${t}-${a})`,
|
|
1173
1234
|
"--custom-hover-color": `var(--clarity-${t}-${l || N(a)})`
|
|
1174
1235
|
} : {};
|
|
@@ -1177,26 +1238,26 @@ const xt = ({
|
|
|
1177
1238
|
{
|
|
1178
1239
|
href: i,
|
|
1179
1240
|
target: c,
|
|
1180
|
-
rel:
|
|
1181
|
-
className:
|
|
1182
|
-
style:
|
|
1241
|
+
rel: m || (c === "_blank" ? "noopener noreferrer" : void 0),
|
|
1242
|
+
className: y,
|
|
1243
|
+
style: b,
|
|
1183
1244
|
onClick: r ? void 0 : u,
|
|
1184
|
-
...
|
|
1245
|
+
...p,
|
|
1185
1246
|
children: o
|
|
1186
1247
|
}
|
|
1187
1248
|
) : /* @__PURE__ */ s(
|
|
1188
1249
|
"button",
|
|
1189
1250
|
{
|
|
1190
|
-
className:
|
|
1191
|
-
style:
|
|
1251
|
+
className: y,
|
|
1252
|
+
style: b,
|
|
1192
1253
|
disabled: r,
|
|
1193
1254
|
onClick: u,
|
|
1194
|
-
...
|
|
1255
|
+
...p,
|
|
1195
1256
|
children: o
|
|
1196
1257
|
}
|
|
1197
1258
|
);
|
|
1198
|
-
},
|
|
1199
|
-
const e = q(
|
|
1259
|
+
}, Ie = z(void 0), De = () => {
|
|
1260
|
+
const e = q(Ie);
|
|
1200
1261
|
if (!e)
|
|
1201
1262
|
throw new Error("Accordion components must be used within an Accordion");
|
|
1202
1263
|
return e;
|
|
@@ -1211,26 +1272,26 @@ const xt = ({
|
|
|
1211
1272
|
className: u = "",
|
|
1212
1273
|
children: i,
|
|
1213
1274
|
onSelect: c,
|
|
1214
|
-
...
|
|
1275
|
+
...m
|
|
1215
1276
|
}) => {
|
|
1216
|
-
const [
|
|
1277
|
+
const [v, p] = T(() => n ? Array.isArray(n) ? n : [n] : []), f = (_) => {
|
|
1217
1278
|
let k;
|
|
1218
|
-
r ? k =
|
|
1219
|
-
}, d = "clarity-accordion",
|
|
1279
|
+
r ? k = v.includes(_) ? v.filter((E) => E !== _) : [...v, _] : k = v.includes(_) ? [] : [_], p(k), c && c(v.includes(_) ? null : _, {});
|
|
1280
|
+
}, d = "clarity-accordion", h = t && a, y = h ? `${d}--custom` : `${d}--${e}`, N = [
|
|
1220
1281
|
d,
|
|
1221
|
-
|
|
1282
|
+
y,
|
|
1222
1283
|
o && `${d}--flush`,
|
|
1223
1284
|
u
|
|
1224
|
-
].filter(Boolean).join(" "),
|
|
1225
|
-
const k = parseInt(
|
|
1285
|
+
].filter(Boolean).join(" "), b = (_) => {
|
|
1286
|
+
const k = parseInt(_);
|
|
1226
1287
|
return k >= 800 ? "900" : k >= 700 ? "800" : k >= 600 ? "700" : k >= 500 ? "600" : k >= 400 ? "500" : k >= 300 ? "400" : k >= 200 ? "300" : "200";
|
|
1227
|
-
}, B =
|
|
1288
|
+
}, B = h ? {
|
|
1228
1289
|
"--custom-border-color": `var(--clarity-${t}-${a})`,
|
|
1229
1290
|
"--custom-header-color": `var(--clarity-${t}-${a})`,
|
|
1230
|
-
"--custom-hover-color": `var(--clarity-${t}-${l ||
|
|
1231
|
-
} : {},
|
|
1232
|
-
activeKeys:
|
|
1233
|
-
toggleItem:
|
|
1291
|
+
"--custom-hover-color": `var(--clarity-${t}-${l || b(a)})`
|
|
1292
|
+
} : {}, $ = {
|
|
1293
|
+
activeKeys: v,
|
|
1294
|
+
toggleItem: f,
|
|
1234
1295
|
alwaysOpen: r,
|
|
1235
1296
|
variant: e,
|
|
1236
1297
|
product: t,
|
|
@@ -1238,7 +1299,7 @@ const xt = ({
|
|
|
1238
1299
|
hoverTone: l,
|
|
1239
1300
|
flush: o
|
|
1240
1301
|
};
|
|
1241
|
-
return /* @__PURE__ */ s(
|
|
1302
|
+
return /* @__PURE__ */ s(Ie.Provider, { value: $, children: /* @__PURE__ */ s("div", { className: N, style: B, ...m, children: i }) });
|
|
1242
1303
|
}, dt = ({
|
|
1243
1304
|
eventKey: e,
|
|
1244
1305
|
disabled: t = !1,
|
|
@@ -1267,10 +1328,10 @@ const xt = ({
|
|
|
1267
1328
|
isActive: r = !1,
|
|
1268
1329
|
...o
|
|
1269
1330
|
}) => {
|
|
1270
|
-
const { toggleItem: u } = De(), i = "clarity-accordion", c = (
|
|
1271
|
-
!n && l && u(l), a == null || a(
|
|
1331
|
+
const { toggleItem: u } = De(), i = "clarity-accordion", c = (m) => {
|
|
1332
|
+
!n && l && u(l), a == null || a(m);
|
|
1272
1333
|
};
|
|
1273
|
-
return /* @__PURE__ */
|
|
1334
|
+
return /* @__PURE__ */ w(
|
|
1274
1335
|
"button",
|
|
1275
1336
|
{
|
|
1276
1337
|
className: [`${i}__header`, e].filter(Boolean).join(" "),
|
|
@@ -1314,19 +1375,19 @@ const xt = ({
|
|
|
1314
1375
|
children: /* @__PURE__ */ s("div", { className: [`${r}__body`, e].filter(Boolean).join(" "), ...n, children: t })
|
|
1315
1376
|
}
|
|
1316
1377
|
);
|
|
1317
|
-
},
|
|
1378
|
+
}, jt = Object.assign(ct, {
|
|
1318
1379
|
Item: dt,
|
|
1319
1380
|
Header: mt,
|
|
1320
1381
|
Body: ut
|
|
1321
1382
|
}), Re = z(
|
|
1322
1383
|
void 0
|
|
1323
|
-
),
|
|
1384
|
+
), Ae = () => {
|
|
1324
1385
|
const e = q(Re);
|
|
1325
1386
|
if (!e)
|
|
1326
1387
|
throw new Error("useDropdown must be used within a DropdownProvider");
|
|
1327
1388
|
return e;
|
|
1328
1389
|
}, ft = ({ children: e }) => {
|
|
1329
|
-
const { setIsOpen: t, triggerRef: a } =
|
|
1390
|
+
const { setIsOpen: t, triggerRef: a } = Ae();
|
|
1330
1391
|
return /* @__PURE__ */ s(
|
|
1331
1392
|
"button",
|
|
1332
1393
|
{
|
|
@@ -1339,41 +1400,41 @@ const xt = ({
|
|
|
1339
1400
|
}
|
|
1340
1401
|
);
|
|
1341
1402
|
}, pt = ({ children: e }) => {
|
|
1342
|
-
const { isOpen: t, contentRef: a, styles: l } =
|
|
1403
|
+
const { isOpen: t, contentRef: a, styles: l } = Ae();
|
|
1343
1404
|
return t ? /* @__PURE__ */ s("div", { ref: a, className: "dropdown__content", style: l, children: e }) : null;
|
|
1344
|
-
}, ht = ({ children: e }) => /* @__PURE__ */ s("div", { className: "dropdown__menu", children: e }), yt = ({
|
|
1345
|
-
const [l, n] = T(!1), [r, o] = T({}), u =
|
|
1405
|
+
}, ht = ({ children: e }) => /* @__PURE__ */ s("div", { className: "dropdown__menu", children: e }), yt = ({ as: e, children: t, ...a }) => /* @__PURE__ */ s(e || "a", { ...a, className: "dropdown__item", children: t }), vt = () => /* @__PURE__ */ s("hr", { className: "dropdown__separator" }), ae = ({ title: e, position: t = "bottom", children: a }) => {
|
|
1406
|
+
const [l, n] = T(!1), [r, o] = T({}), u = P(null), i = P(null), c = P(null);
|
|
1346
1407
|
return et(() => {
|
|
1347
1408
|
if (l) {
|
|
1348
|
-
const
|
|
1349
|
-
if (!
|
|
1350
|
-
const
|
|
1351
|
-
let
|
|
1352
|
-
t === "bottom" &&
|
|
1409
|
+
const m = i.current, v = c.current;
|
|
1410
|
+
if (!m || !v) return;
|
|
1411
|
+
const p = m.getBoundingClientRect(), f = v.getBoundingClientRect(), d = window.innerHeight, h = window.innerWidth;
|
|
1412
|
+
let y = t;
|
|
1413
|
+
t === "bottom" && p.bottom + f.height > d && (y = "top"), t === "top" && p.top - f.height < 0 && (y = "bottom"), t === "right" && p.right + f.width > h && (y = "left"), t === "left" && p.left - f.width < 0 && (y = "right");
|
|
1353
1414
|
const N = {};
|
|
1354
|
-
switch (
|
|
1415
|
+
switch (y) {
|
|
1355
1416
|
case "top":
|
|
1356
|
-
N.bottom =
|
|
1417
|
+
N.bottom = p.height + 4, N.left = p.width / 2 - f.width / 2;
|
|
1357
1418
|
break;
|
|
1358
1419
|
case "right":
|
|
1359
|
-
N.left =
|
|
1420
|
+
N.left = p.width + 4, N.top = p.height / 2 - f.height / 2;
|
|
1360
1421
|
break;
|
|
1361
1422
|
case "left":
|
|
1362
|
-
N.right =
|
|
1423
|
+
N.right = p.width + 4, N.top = p.height / 2 - f.height / 2;
|
|
1363
1424
|
break;
|
|
1364
1425
|
case "bottom":
|
|
1365
1426
|
default:
|
|
1366
|
-
N.top =
|
|
1427
|
+
N.top = p.height + 4, N.left = p.width / 2 - f.width / 2;
|
|
1367
1428
|
break;
|
|
1368
1429
|
}
|
|
1369
1430
|
o(N);
|
|
1370
1431
|
}
|
|
1371
1432
|
}, [l, t]), O(() => {
|
|
1372
|
-
const
|
|
1373
|
-
u.current && !u.current.contains(
|
|
1433
|
+
const m = (v) => {
|
|
1434
|
+
u.current && !u.current.contains(v.target) && n(!1);
|
|
1374
1435
|
};
|
|
1375
|
-
return document.addEventListener("mousedown",
|
|
1376
|
-
document.removeEventListener("mousedown",
|
|
1436
|
+
return document.addEventListener("mousedown", m), () => {
|
|
1437
|
+
document.removeEventListener("mousedown", m);
|
|
1377
1438
|
};
|
|
1378
1439
|
}, []), /* @__PURE__ */ s(Re.Provider, { value: { isOpen: l, setIsOpen: n, triggerRef: i, contentRef: c, styles: r }, children: /* @__PURE__ */ s(
|
|
1379
1440
|
"div",
|
|
@@ -1390,8 +1451,8 @@ ae.Content = pt;
|
|
|
1390
1451
|
ae.Menu = ht;
|
|
1391
1452
|
ae.Item = yt;
|
|
1392
1453
|
ae.Separator = vt;
|
|
1393
|
-
const
|
|
1394
|
-
const e = q(
|
|
1454
|
+
const Pe = z(null), Ve = () => {
|
|
1455
|
+
const e = q(Pe);
|
|
1395
1456
|
if (!e)
|
|
1396
1457
|
throw new Error("useTabs must be used within a Tabs provider");
|
|
1397
1458
|
return e;
|
|
@@ -1440,12 +1501,12 @@ const me = ({
|
|
|
1440
1501
|
n,
|
|
1441
1502
|
`orientation-${l}`
|
|
1442
1503
|
].filter(Boolean).join(" ");
|
|
1443
|
-
return /* @__PURE__ */ s(
|
|
1504
|
+
return /* @__PURE__ */ s(Pe.Provider, { value: u, children: /* @__PURE__ */ s("div", { className: i, children: e }) });
|
|
1444
1505
|
};
|
|
1445
1506
|
me.Tab = He;
|
|
1446
1507
|
me.Content = Me;
|
|
1447
1508
|
me.displayName = "Tabs";
|
|
1448
|
-
const
|
|
1509
|
+
const Lt = ({
|
|
1449
1510
|
content: e,
|
|
1450
1511
|
position: t = "top",
|
|
1451
1512
|
variant: a = "primary",
|
|
@@ -1456,43 +1517,43 @@ const jt = ({
|
|
|
1456
1517
|
children: u,
|
|
1457
1518
|
className: i = "",
|
|
1458
1519
|
disabled: c = !1,
|
|
1459
|
-
delay:
|
|
1460
|
-
hideDelay:
|
|
1461
|
-
trigger:
|
|
1462
|
-
arrow:
|
|
1520
|
+
delay: m = 200,
|
|
1521
|
+
hideDelay: v = 100,
|
|
1522
|
+
trigger: p = "hover",
|
|
1523
|
+
arrow: f = !0,
|
|
1463
1524
|
...d
|
|
1464
1525
|
}) => {
|
|
1465
|
-
const [
|
|
1526
|
+
const [h, y] = T(!1), [N, b] = T(null), B = P(null), $ = P(null), _ = "clarity-tooltip", k = !!r, E = l && n && !k;
|
|
1466
1527
|
let x = "";
|
|
1467
|
-
k ? x = `${
|
|
1528
|
+
k ? x = `${_}__content--custom-bg` : E ? x = `${_}__content--custom` : x = `${_}__content--${a}`;
|
|
1468
1529
|
const j = [
|
|
1469
|
-
|
|
1470
|
-
`${
|
|
1530
|
+
_,
|
|
1531
|
+
`${_}--${t}`,
|
|
1471
1532
|
i
|
|
1472
|
-
].filter(Boolean).join(" "),
|
|
1473
|
-
`${
|
|
1533
|
+
].filter(Boolean).join(" "), I = [
|
|
1534
|
+
`${_}__content`,
|
|
1474
1535
|
x,
|
|
1475
|
-
|
|
1476
|
-
].filter(Boolean).join(" "),
|
|
1477
|
-
k && r && (
|
|
1478
|
-
const
|
|
1479
|
-
...
|
|
1480
|
-
...Object.keys(
|
|
1536
|
+
f && `${_}__content--arrow`
|
|
1537
|
+
].filter(Boolean).join(" "), A = {}, S = {};
|
|
1538
|
+
k && r && (S["--tooltip-bg-color"] = r), o && (S["--tooltip-text-color"] = o), E && l && n && (S["--tooltip-product"] = l, S["--tooltip-tone"] = n);
|
|
1539
|
+
const g = {
|
|
1540
|
+
...A,
|
|
1541
|
+
...Object.keys(S).length > 0 ? S : {}
|
|
1481
1542
|
}, M = () => {
|
|
1482
1543
|
if (c) return;
|
|
1483
1544
|
N && clearTimeout(N);
|
|
1484
1545
|
const H = setTimeout(() => {
|
|
1485
|
-
|
|
1486
|
-
},
|
|
1487
|
-
|
|
1546
|
+
y(!0);
|
|
1547
|
+
}, m);
|
|
1548
|
+
b(H);
|
|
1488
1549
|
}, V = () => {
|
|
1489
1550
|
N && clearTimeout(N);
|
|
1490
1551
|
const H = setTimeout(() => {
|
|
1491
|
-
|
|
1492
|
-
},
|
|
1493
|
-
|
|
1552
|
+
y(!1);
|
|
1553
|
+
}, v);
|
|
1554
|
+
b(H);
|
|
1494
1555
|
}, F = () => {
|
|
1495
|
-
c ||
|
|
1556
|
+
c || y(!h);
|
|
1496
1557
|
}, X = () => {
|
|
1497
1558
|
c || M();
|
|
1498
1559
|
}, te = () => {
|
|
@@ -1502,24 +1563,24 @@ const jt = ({
|
|
|
1502
1563
|
N && clearTimeout(N);
|
|
1503
1564
|
}, [N]);
|
|
1504
1565
|
const G = {};
|
|
1505
|
-
return
|
|
1566
|
+
return p === "hover" ? (G.onMouseEnter = M, G.onMouseLeave = V) : p === "click" ? G.onClick = F : p === "focus" && (G.onFocus = X, G.onBlur = te), /* @__PURE__ */ w(
|
|
1506
1567
|
"div",
|
|
1507
1568
|
{
|
|
1508
|
-
ref:
|
|
1509
|
-
className: `${
|
|
1569
|
+
ref: $,
|
|
1570
|
+
className: `${_}__trigger`,
|
|
1510
1571
|
...G,
|
|
1511
1572
|
...d,
|
|
1512
1573
|
children: [
|
|
1513
1574
|
u,
|
|
1514
|
-
|
|
1575
|
+
h && /* @__PURE__ */ s(
|
|
1515
1576
|
"div",
|
|
1516
1577
|
{
|
|
1517
1578
|
ref: B,
|
|
1518
1579
|
className: j,
|
|
1519
|
-
style:
|
|
1580
|
+
style: g,
|
|
1520
1581
|
role: "tooltip",
|
|
1521
|
-
"aria-hidden": !
|
|
1522
|
-
children: /* @__PURE__ */ s("div", { className:
|
|
1582
|
+
"aria-hidden": !h,
|
|
1583
|
+
children: /* @__PURE__ */ s("div", { className: I, children: e })
|
|
1523
1584
|
}
|
|
1524
1585
|
)
|
|
1525
1586
|
]
|
|
@@ -1538,11 +1599,11 @@ const jt = ({
|
|
|
1538
1599
|
inputPlaceholder: n = "Search...",
|
|
1539
1600
|
...r
|
|
1540
1601
|
}) => {
|
|
1541
|
-
const [o, u] = T(""), [i, c] = T(null), [
|
|
1602
|
+
const [o, u] = T(""), [i, c] = T(null), [m, v] = T(!1), p = [
|
|
1542
1603
|
"clarity-command",
|
|
1543
1604
|
`clarity-command--${a}`,
|
|
1544
1605
|
t
|
|
1545
|
-
].filter(Boolean).join(" "),
|
|
1606
|
+
].filter(Boolean).join(" "), f = Y(() => ({
|
|
1546
1607
|
searchTerm: o,
|
|
1547
1608
|
setSearchTerm: u,
|
|
1548
1609
|
value: i,
|
|
@@ -1552,10 +1613,10 @@ const jt = ({
|
|
|
1552
1613
|
empty: l,
|
|
1553
1614
|
inputPlaceholder: n
|
|
1554
1615
|
},
|
|
1555
|
-
isOpen:
|
|
1556
|
-
setIsOpen:
|
|
1557
|
-
}), [o, i, a, l, n,
|
|
1558
|
-
return /* @__PURE__ */ s(We.Provider, { value:
|
|
1616
|
+
isOpen: m,
|
|
1617
|
+
setIsOpen: v
|
|
1618
|
+
}), [o, i, a, l, n, m]);
|
|
1619
|
+
return /* @__PURE__ */ s(We.Provider, { value: f, children: /* @__PURE__ */ s("div", { className: p, ...r, children: e }) });
|
|
1559
1620
|
};
|
|
1560
1621
|
Fe.displayName = "Command";
|
|
1561
1622
|
const Ge = ({ placeholder: e = "Search...", variant: t, onClick: a }) => {
|
|
@@ -1567,11 +1628,11 @@ const Ge = ({ placeholder: e = "Search...", variant: t, onClick: a }) => {
|
|
|
1567
1628
|
"clarity-command-button",
|
|
1568
1629
|
`clarity-command-button--${t || n}`
|
|
1569
1630
|
].filter(Boolean).join(" ");
|
|
1570
|
-
return /* @__PURE__ */
|
|
1571
|
-
l(!0), a == null || a(
|
|
1631
|
+
return /* @__PURE__ */ w("button", { className: i, onClick: (m) => {
|
|
1632
|
+
l(!0), a == null || a(m);
|
|
1572
1633
|
}, children: [
|
|
1573
1634
|
/* @__PURE__ */ s("span", { children: e }),
|
|
1574
|
-
/* @__PURE__ */
|
|
1635
|
+
/* @__PURE__ */ w("kbd", { className: "clarity-command-shortcut", children: [
|
|
1575
1636
|
r ? "⌘" : "Ctrl+",
|
|
1576
1637
|
"K"
|
|
1577
1638
|
] })
|
|
@@ -1589,7 +1650,7 @@ const Ue = ({ children: e, ...t }) => {
|
|
|
1589
1650
|
};
|
|
1590
1651
|
Ue.displayName = "Command.Dialog";
|
|
1591
1652
|
const ze = ({ className: e = "", ...t }) => {
|
|
1592
|
-
const { searchTerm: a, setSearchTerm: l, variant: n, texts: r, isOpen: o } = ee(), u =
|
|
1653
|
+
const { searchTerm: a, setSearchTerm: l, variant: n, texts: r, isOpen: o } = ee(), u = P(null);
|
|
1593
1654
|
O(() => {
|
|
1594
1655
|
var c;
|
|
1595
1656
|
o && ((c = u.current) == null || c.focus());
|
|
@@ -1616,20 +1677,20 @@ const qe = ({ children: e, className: t = "", ...a }) => {
|
|
|
1616
1677
|
const { searchTerm: l } = ee();
|
|
1617
1678
|
let n = !1;
|
|
1618
1679
|
const r = (i) => L.Children.toArray(i).map((c) => {
|
|
1619
|
-
var
|
|
1680
|
+
var v;
|
|
1620
1681
|
if (!L.isValidElement(c)) return c;
|
|
1621
|
-
const
|
|
1622
|
-
if (
|
|
1682
|
+
const m = c.type.displayName;
|
|
1683
|
+
if (m === "Command.Empty")
|
|
1623
1684
|
return null;
|
|
1624
|
-
if (
|
|
1625
|
-
return (((
|
|
1626
|
-
if (
|
|
1627
|
-
const
|
|
1628
|
-
return L.Children.toArray(
|
|
1685
|
+
if (m === "Command.Item")
|
|
1686
|
+
return (((v = c.props.children) == null ? void 0 : v.toString().toLowerCase()) || "").includes(l.toLowerCase()) ? (n = !0, c) : null;
|
|
1687
|
+
if (m === "Command.Group") {
|
|
1688
|
+
const p = r(c.props.children);
|
|
1689
|
+
return L.Children.toArray(p).some((d) => L.isValidElement(d) && d.type.displayName === "Command.Item") ? L.cloneElement(c, { ...c.props, children: p }) : null;
|
|
1629
1690
|
}
|
|
1630
1691
|
return c;
|
|
1631
1692
|
}).filter(Boolean), o = r(e), u = ["clarity-command-list", t].filter(Boolean).join(" ");
|
|
1632
|
-
return /* @__PURE__ */
|
|
1693
|
+
return /* @__PURE__ */ w("div", { className: u, ...a, children: [
|
|
1633
1694
|
o,
|
|
1634
1695
|
!n && /* @__PURE__ */ s(ue, {})
|
|
1635
1696
|
] });
|
|
@@ -1660,7 +1721,7 @@ const Ye = ({ children: e, className: t = "", ...a }) => {
|
|
|
1660
1721
|
return /* @__PURE__ */ s("span", { className: l, ...a, children: e });
|
|
1661
1722
|
};
|
|
1662
1723
|
Ye.displayName = "Command.Shortcut";
|
|
1663
|
-
const
|
|
1724
|
+
const Et = Object.assign(Fe, {
|
|
1664
1725
|
Button: Ge,
|
|
1665
1726
|
Dialog: Ue,
|
|
1666
1727
|
Input: ze,
|
|
@@ -1672,14 +1733,14 @@ const Lt = Object.assign(Fe, {
|
|
|
1672
1733
|
Shortcut: Ye
|
|
1673
1734
|
}), Ct = ({ columns: e, viewMode: t }) => {
|
|
1674
1735
|
const a = Array.from({ length: 5 }, (l, n) => n);
|
|
1675
|
-
return t === "card" ? /* @__PURE__ */
|
|
1736
|
+
return t === "card" ? /* @__PURE__ */ w("div", { className: "card-view-wrapper is-loading", children: [
|
|
1676
1737
|
/* @__PURE__ */ s("div", { className: "skeleton card-view-header" }),
|
|
1677
1738
|
/* @__PURE__ */ s("div", { className: "card-view-body", children: a.map((l) => /* @__PURE__ */ s("div", { className: "skeleton card-view-row" }, l)) })
|
|
1678
|
-
] }) : /* @__PURE__ */ s("div", { className: "table-wrapper is-loading", children: /* @__PURE__ */
|
|
1739
|
+
] }) : /* @__PURE__ */ s("div", { className: "table-wrapper is-loading", children: /* @__PURE__ */ w("table", { children: [
|
|
1679
1740
|
/* @__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)) }) }),
|
|
1680
1741
|
/* @__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)) })
|
|
1681
1742
|
] }) });
|
|
1682
|
-
},
|
|
1743
|
+
}, St = ({
|
|
1683
1744
|
variant: e = "secondary",
|
|
1684
1745
|
columns: t,
|
|
1685
1746
|
data: a,
|
|
@@ -1687,47 +1748,47 @@ const Lt = Object.assign(Fe, {
|
|
|
1687
1748
|
isScrollable: n = !1,
|
|
1688
1749
|
isLoading: r = !1
|
|
1689
1750
|
}) => {
|
|
1690
|
-
const [o, u] = T(null), [i, c] = T("none"),
|
|
1691
|
-
d.sortable && (o === d.key ? c((
|
|
1692
|
-
},
|
|
1693
|
-
const
|
|
1694
|
-
return
|
|
1695
|
-
}), [a, o, i]),
|
|
1751
|
+
const [o, u] = T(null), [i, c] = T("none"), m = (d) => {
|
|
1752
|
+
d.sortable && (o === d.key ? c((h) => h === "asc" ? "desc" : h === "desc" ? "none" : "asc") : (u(d.key), c("asc")));
|
|
1753
|
+
}, v = Y(() => i === "none" || !o ? a : [...a].sort((d, h) => {
|
|
1754
|
+
const y = d[o], N = h[o];
|
|
1755
|
+
return y < N ? i === "asc" ? -1 : 1 : y > N ? i === "asc" ? 1 : -1 : 0;
|
|
1756
|
+
}), [a, o, i]), p = (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
1757
|
if (r)
|
|
1697
1758
|
return /* @__PURE__ */ s(Ct, { columns: t, viewMode: l });
|
|
1698
|
-
const
|
|
1699
|
-
return l === "card" ? /* @__PURE__ */
|
|
1700
|
-
/* @__PURE__ */ s("div", { className: `card-view-header table-header-cell-${e}`, children: t.map((d) => /* @__PURE__ */
|
|
1759
|
+
const f = `table-variant-${e} ${n ? "is-scrollable" : ""}`;
|
|
1760
|
+
return l === "card" ? /* @__PURE__ */ w("div", { className: `card-view-wrapper ${f}`, children: [
|
|
1761
|
+
/* @__PURE__ */ s("div", { className: `card-view-header table-header-cell-${e}`, children: t.map((d) => /* @__PURE__ */ w(
|
|
1701
1762
|
"div",
|
|
1702
1763
|
{
|
|
1703
1764
|
className: `card-view-header-cell ${d.sortable ? "sortable" : ""}`,
|
|
1704
|
-
onClick: () =>
|
|
1765
|
+
onClick: () => m(d),
|
|
1705
1766
|
style: { minWidth: d.minWidth },
|
|
1706
1767
|
children: [
|
|
1707
1768
|
d.header,
|
|
1708
|
-
|
|
1769
|
+
p(d)
|
|
1709
1770
|
]
|
|
1710
1771
|
},
|
|
1711
1772
|
d.key
|
|
1712
1773
|
)) }),
|
|
1713
|
-
/* @__PURE__ */ s("div", { className: "card-view-body", children:
|
|
1714
|
-
] }) : /* @__PURE__ */ s("div", { className: `table-wrapper ${
|
|
1715
|
-
/* @__PURE__ */ s("thead", { className: "table-header", children: /* @__PURE__ */ s("tr", { className: "table-row", children: t.map((d) => /* @__PURE__ */
|
|
1774
|
+
/* @__PURE__ */ s("div", { className: "card-view-body", children: v.map((d, 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(d) : d[y.key] }, y.key)) }, h)) })
|
|
1775
|
+
] }) : /* @__PURE__ */ s("div", { className: `table-wrapper ${f}`, children: /* @__PURE__ */ w("table", { children: [
|
|
1776
|
+
/* @__PURE__ */ s("thead", { className: "table-header", children: /* @__PURE__ */ s("tr", { className: "table-row", children: t.map((d) => /* @__PURE__ */ w(
|
|
1716
1777
|
"th",
|
|
1717
1778
|
{
|
|
1718
1779
|
className: `table-header-cell ${d.sortable ? "sortable" : ""} table-header-cell-${e}`,
|
|
1719
|
-
onClick: () =>
|
|
1780
|
+
onClick: () => m(d),
|
|
1720
1781
|
style: { minWidth: d.minWidth },
|
|
1721
1782
|
children: [
|
|
1722
1783
|
d.header,
|
|
1723
|
-
|
|
1784
|
+
p(d)
|
|
1724
1785
|
]
|
|
1725
1786
|
},
|
|
1726
1787
|
d.key
|
|
1727
1788
|
)) }) }),
|
|
1728
|
-
/* @__PURE__ */ s("tbody", { children:
|
|
1789
|
+
/* @__PURE__ */ s("tbody", { children: v.map((d, 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(d) : d[y.key] }, y.key)) }, h)) })
|
|
1729
1790
|
] }) });
|
|
1730
|
-
},
|
|
1791
|
+
}, Ot = ({
|
|
1731
1792
|
variant: e = "primary",
|
|
1732
1793
|
product: t,
|
|
1733
1794
|
tone: a,
|
|
@@ -1737,17 +1798,17 @@ const Lt = Object.assign(Fe, {
|
|
|
1737
1798
|
"aria-label": o = "Carregando...",
|
|
1738
1799
|
...u
|
|
1739
1800
|
}) => {
|
|
1740
|
-
const i = "clarity-spinner",
|
|
1801
|
+
const i = "clarity-spinner", v = n ? `${i}--custom` : t && a ? `${i}--custom` : `${i}--${e}`, p = [
|
|
1741
1802
|
i,
|
|
1742
1803
|
`${i}--${l}`,
|
|
1743
|
-
|
|
1804
|
+
v,
|
|
1744
1805
|
r
|
|
1745
|
-
].filter(Boolean).join(" "),
|
|
1746
|
-
return n ?
|
|
1806
|
+
].filter(Boolean).join(" "), f = {};
|
|
1807
|
+
return n ? f["--spinner-color"] = n : t && a && (f["--spinner-color"] = `var(--clarity-${t}-${a})`), /* @__PURE__ */ s(
|
|
1747
1808
|
"div",
|
|
1748
1809
|
{
|
|
1749
|
-
className:
|
|
1750
|
-
style:
|
|
1810
|
+
className: p,
|
|
1811
|
+
style: f,
|
|
1751
1812
|
role: "status",
|
|
1752
1813
|
"aria-label": o,
|
|
1753
1814
|
...u,
|
|
@@ -1772,7 +1833,7 @@ const Lt = Object.assign(Fe, {
|
|
|
1772
1833
|
) })
|
|
1773
1834
|
}
|
|
1774
1835
|
);
|
|
1775
|
-
},
|
|
1836
|
+
}, It = {
|
|
1776
1837
|
primary: {
|
|
1777
1838
|
50: "#f0f9ff",
|
|
1778
1839
|
100: "#e0f2fe",
|
|
@@ -1821,7 +1882,7 @@ const Lt = Object.assign(Fe, {
|
|
|
1821
1882
|
800: "#065f46",
|
|
1822
1883
|
900: "#064e3b"
|
|
1823
1884
|
}
|
|
1824
|
-
},
|
|
1885
|
+
}, Dt = {
|
|
1825
1886
|
xs: "4px",
|
|
1826
1887
|
sm: "8px",
|
|
1827
1888
|
md: "16px",
|
|
@@ -1829,7 +1890,7 @@ const Lt = Object.assign(Fe, {
|
|
|
1829
1890
|
xl: "32px",
|
|
1830
1891
|
"2xl": "48px",
|
|
1831
1892
|
"3xl": "64px"
|
|
1832
|
-
},
|
|
1893
|
+
}, Rt = {
|
|
1833
1894
|
fontFamily: {
|
|
1834
1895
|
sans: ["Inter", "system-ui", "sans-serif"],
|
|
1835
1896
|
mono: ["Fira Code", "monospace"]
|
|
@@ -1849,15 +1910,16 @@ const Lt = Object.assign(Fe, {
|
|
|
1849
1910
|
semibold: 600,
|
|
1850
1911
|
bold: 700
|
|
1851
1912
|
}
|
|
1852
|
-
},
|
|
1913
|
+
}, At = (...e) => e.filter(Boolean).join(" "), Pt = () => Math.random().toString(36).substr(2, 9);
|
|
1853
1914
|
export {
|
|
1854
|
-
|
|
1915
|
+
jt as Accordion,
|
|
1855
1916
|
wt as Badge,
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
Tt as
|
|
1917
|
+
$t as Button,
|
|
1918
|
+
gt as ButtonGroup,
|
|
1919
|
+
Tt as ButtonIcon,
|
|
1920
|
+
Bt as ButtonLink,
|
|
1859
1921
|
it as CheckInput,
|
|
1860
|
-
|
|
1922
|
+
Et as Command,
|
|
1861
1923
|
Q as ConfirmationDialog,
|
|
1862
1924
|
ae as Dropdown,
|
|
1863
1925
|
st as Input,
|
|
@@ -1866,16 +1928,16 @@ export {
|
|
|
1866
1928
|
nt as MultiSelect,
|
|
1867
1929
|
K as Offcanvas,
|
|
1868
1930
|
lt as Select,
|
|
1869
|
-
|
|
1870
|
-
|
|
1931
|
+
Ot as Spinner,
|
|
1932
|
+
St as Table,
|
|
1871
1933
|
me as Tabs,
|
|
1872
1934
|
at as Textarea,
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1935
|
+
xt as ToastProvider,
|
|
1936
|
+
Lt as Tooltip,
|
|
1937
|
+
At as cn,
|
|
1938
|
+
It as colors,
|
|
1877
1939
|
Pt as generateId,
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1940
|
+
Dt as spacing,
|
|
1941
|
+
Rt as typography,
|
|
1942
|
+
kt as useToast
|
|
1881
1943
|
};
|