beth-clarity 1.1.17 → 1.1.18
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,31 +1,31 @@
|
|
|
1
1
|
import { jsx as a, jsxs as _, Fragment as Ze } from "react/jsx-runtime";
|
|
2
|
-
import B, { useState as x, useRef as P, useEffect as S, forwardRef as Ke, isValidElement as Z, createContext as
|
|
2
|
+
import B, { useState as x, useRef as P, useEffect as S, forwardRef as Ke, isValidElement as Z, createContext as U, cloneElement as W, useContext as q, useMemo as Y, useCallback as le, useLayoutEffect as et } from "react";
|
|
3
3
|
import tt from "react-dom";
|
|
4
4
|
const xt = ({
|
|
5
5
|
variant: e = "primary",
|
|
6
6
|
product: t,
|
|
7
7
|
tone: s,
|
|
8
|
-
size:
|
|
9
|
-
bgColor:
|
|
8
|
+
size: n = "medium",
|
|
9
|
+
bgColor: l,
|
|
10
10
|
textColor: i,
|
|
11
|
-
children:
|
|
11
|
+
children: d,
|
|
12
12
|
className: c = "",
|
|
13
13
|
rounded: r = !1,
|
|
14
|
-
outlined:
|
|
14
|
+
outlined: o = !1,
|
|
15
15
|
...u
|
|
16
16
|
}) => {
|
|
17
|
-
const v = "clarity-badge",
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
const
|
|
17
|
+
const v = "clarity-badge", m = !!l, f = t && s && !m;
|
|
18
|
+
let p = "";
|
|
19
|
+
m ? p = `${v}--custom-bg` : f ? p = `${v}--custom` : p = `${v}--${e}`;
|
|
20
|
+
const h = [
|
|
21
21
|
v,
|
|
22
|
-
|
|
23
|
-
`${v}--${
|
|
22
|
+
p,
|
|
23
|
+
`${v}--${n}`,
|
|
24
24
|
r ? `${v}--rounded` : "",
|
|
25
|
-
|
|
25
|
+
o ? `${v}--outlined` : "",
|
|
26
26
|
c
|
|
27
|
-
].filter(Boolean).join(" "),
|
|
28
|
-
|
|
27
|
+
].filter(Boolean).join(" "), y = {};
|
|
28
|
+
m && (y.backgroundColor = l, i && (y.color = i));
|
|
29
29
|
const N = f && t && s ? {
|
|
30
30
|
"--custom-bg-color": `var(--clarity-${t}-${s})`,
|
|
31
31
|
"--custom-text-color": s && parseInt(s) >= 500 ? "white" : `var(--clarity-${t}-800)`
|
|
@@ -33,50 +33,50 @@ const xt = ({
|
|
|
33
33
|
return /* @__PURE__ */ a(
|
|
34
34
|
"span",
|
|
35
35
|
{
|
|
36
|
-
className:
|
|
36
|
+
className: h,
|
|
37
37
|
style: {
|
|
38
|
-
...
|
|
38
|
+
...y,
|
|
39
39
|
...N
|
|
40
40
|
},
|
|
41
41
|
...u,
|
|
42
|
-
children:
|
|
42
|
+
children: d
|
|
43
43
|
}
|
|
44
44
|
);
|
|
45
45
|
}, Tt = ({
|
|
46
46
|
variant: e = "primary",
|
|
47
47
|
size: t = "medium",
|
|
48
48
|
disabled: s = !1,
|
|
49
|
-
loading:
|
|
50
|
-
children:
|
|
49
|
+
loading: n = !1,
|
|
50
|
+
children: l,
|
|
51
51
|
onClick: i,
|
|
52
|
-
type:
|
|
52
|
+
type: d = "button",
|
|
53
53
|
className: c = "",
|
|
54
54
|
title: r,
|
|
55
|
-
customColor:
|
|
55
|
+
customColor: o,
|
|
56
56
|
customColorHover: u,
|
|
57
57
|
...v
|
|
58
58
|
}) => {
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
!
|
|
62
|
-
`${
|
|
63
|
-
|
|
64
|
-
s && `${
|
|
59
|
+
const m = "clarity-button", f = [
|
|
60
|
+
m,
|
|
61
|
+
!o && `${m}--${e}`,
|
|
62
|
+
`${m}--${t}`,
|
|
63
|
+
n && `${m}--loading`,
|
|
64
|
+
s && `${m}--disabled`,
|
|
65
65
|
c
|
|
66
|
-
].filter(Boolean).join(" "),
|
|
67
|
-
return
|
|
66
|
+
].filter(Boolean).join(" "), p = {};
|
|
67
|
+
return o && (p["--button-bg"] = o, p["--button-hover-bg"] = u || `${o}E6`, p["--button-border"] = o, p["--button-hover-border"] = u || `${o}E6`, p["--button-fg"] = "#fff"), /* @__PURE__ */ _(
|
|
68
68
|
"button",
|
|
69
69
|
{
|
|
70
70
|
className: f,
|
|
71
|
-
style:
|
|
72
|
-
disabled: s ||
|
|
71
|
+
style: p,
|
|
72
|
+
disabled: s || n,
|
|
73
73
|
onClick: i,
|
|
74
|
-
type:
|
|
74
|
+
type: d,
|
|
75
75
|
title: r,
|
|
76
76
|
...v,
|
|
77
77
|
children: [
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
n && /* @__PURE__ */ a("div", { className: `${m}__spinner` }),
|
|
79
|
+
l
|
|
80
80
|
]
|
|
81
81
|
}
|
|
82
82
|
);
|
|
@@ -84,59 +84,59 @@ const xt = ({
|
|
|
84
84
|
variant: e = "primary",
|
|
85
85
|
size: t = "medium",
|
|
86
86
|
filled: s = !0,
|
|
87
|
-
items:
|
|
88
|
-
value:
|
|
87
|
+
items: n,
|
|
88
|
+
value: l,
|
|
89
89
|
multiple: i = !1,
|
|
90
|
-
disabled:
|
|
90
|
+
disabled: d = !1,
|
|
91
91
|
onChange: c,
|
|
92
92
|
className: r = "",
|
|
93
|
-
...
|
|
93
|
+
...o
|
|
94
94
|
}) => {
|
|
95
|
-
const u = "clarity-button-group", v = `${u}--${e}`,
|
|
95
|
+
const u = "clarity-button-group", v = `${u}--${e}`, m = [
|
|
96
96
|
u,
|
|
97
97
|
v,
|
|
98
98
|
`${u}--${t}`,
|
|
99
99
|
!s && `${u}--outline`,
|
|
100
|
-
|
|
100
|
+
d && `${u}--disabled`,
|
|
101
101
|
r
|
|
102
|
-
].filter(Boolean).join(" "), f = (
|
|
103
|
-
if (
|
|
104
|
-
const
|
|
105
|
-
if (!(
|
|
102
|
+
].filter(Boolean).join(" "), f = (h) => {
|
|
103
|
+
if (d || !c) return;
|
|
104
|
+
const y = n.find((N) => N.id === h);
|
|
105
|
+
if (!(y != null && y.disabled))
|
|
106
106
|
if (i) {
|
|
107
|
-
const N = Array.isArray(
|
|
107
|
+
const N = Array.isArray(l) ? l : [], C = N.includes(h) ? N.filter((j) => j !== h) : [...N, h];
|
|
108
108
|
c(C);
|
|
109
109
|
} else
|
|
110
|
-
c(
|
|
111
|
-
},
|
|
110
|
+
c(h);
|
|
111
|
+
}, p = (h) => i ? Array.isArray(l) && l.includes(h) : l === h;
|
|
112
112
|
return /* @__PURE__ */ a(
|
|
113
113
|
"div",
|
|
114
114
|
{
|
|
115
|
-
className:
|
|
115
|
+
className: m,
|
|
116
116
|
role: "group",
|
|
117
|
-
...
|
|
118
|
-
children:
|
|
119
|
-
const N =
|
|
117
|
+
...o,
|
|
118
|
+
children: n.map((h, y) => {
|
|
119
|
+
const N = p(h.id), C = [
|
|
120
120
|
`${u}__item`,
|
|
121
121
|
N && `${u}__item--selected`,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
h.disabled && `${u}__item--disabled`,
|
|
123
|
+
y === 0 && `${u}__item--first`,
|
|
124
|
+
y === n.length - 1 && `${u}__item--last`
|
|
125
125
|
].filter(Boolean).join(" ");
|
|
126
126
|
return /* @__PURE__ */ _(
|
|
127
127
|
"button",
|
|
128
128
|
{
|
|
129
129
|
className: C,
|
|
130
|
-
onClick: () => f(
|
|
131
|
-
disabled:
|
|
130
|
+
onClick: () => f(h.id),
|
|
131
|
+
disabled: d || h.disabled,
|
|
132
132
|
type: "button",
|
|
133
133
|
"aria-pressed": N,
|
|
134
134
|
children: [
|
|
135
|
-
|
|
136
|
-
/* @__PURE__ */ a("span", { className: `${u}__item-label`, children:
|
|
135
|
+
h.icon && /* @__PURE__ */ a("span", { className: `${u}__item-icon`, children: h.icon }),
|
|
136
|
+
/* @__PURE__ */ a("span", { className: `${u}__item-label`, children: h.label })
|
|
137
137
|
]
|
|
138
138
|
},
|
|
139
|
-
|
|
139
|
+
h.id
|
|
140
140
|
);
|
|
141
141
|
})
|
|
142
142
|
}
|
|
@@ -145,26 +145,26 @@ const xt = ({
|
|
|
145
145
|
variant: e,
|
|
146
146
|
size: t = "medium",
|
|
147
147
|
label: s,
|
|
148
|
-
helperText:
|
|
149
|
-
error:
|
|
148
|
+
helperText: n,
|
|
149
|
+
error: l = !1,
|
|
150
150
|
errorMessage: i,
|
|
151
|
-
startIcon:
|
|
151
|
+
startIcon: d,
|
|
152
152
|
endIcon: c,
|
|
153
153
|
className: r = "",
|
|
154
|
-
disabled:
|
|
154
|
+
disabled: o = !1,
|
|
155
155
|
value: u,
|
|
156
156
|
defaultValue: v,
|
|
157
|
-
onFocus:
|
|
157
|
+
onFocus: m,
|
|
158
158
|
onBlur: f,
|
|
159
|
-
...
|
|
160
|
-
},
|
|
161
|
-
const [
|
|
162
|
-
B.useImperativeHandle(
|
|
159
|
+
...p
|
|
160
|
+
}, h) => {
|
|
161
|
+
const [y, N] = x(!1), [C, j] = x(!1), T = P(null);
|
|
162
|
+
B.useImperativeHandle(h, () => T.current), S(() => {
|
|
163
163
|
const k = T.current;
|
|
164
164
|
k && j(k.value.length > 0);
|
|
165
165
|
}, [u, v]);
|
|
166
166
|
const w = (k) => {
|
|
167
|
-
N(!0),
|
|
167
|
+
N(!0), m == null || m(k);
|
|
168
168
|
}, $ = (k) => {
|
|
169
169
|
N(!1), j(k.target.value.length > 0), f == null || f(k);
|
|
170
170
|
}, L = [
|
|
@@ -172,36 +172,36 @@ const xt = ({
|
|
|
172
172
|
"clarity-input--outlined",
|
|
173
173
|
`clarity-input--${t}`,
|
|
174
174
|
e && `clarity-input--${e}`,
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
175
|
+
l && "clarity-input--error",
|
|
176
|
+
o && "clarity-input--disabled",
|
|
177
|
+
y && "clarity-input--focused",
|
|
178
178
|
C && "clarity-input--has-value",
|
|
179
|
-
|
|
179
|
+
d && "clarity-input--with-start-icon",
|
|
180
180
|
c && "clarity-input--with-end-icon",
|
|
181
181
|
r
|
|
182
182
|
].filter(Boolean).join(" ");
|
|
183
183
|
return /* @__PURE__ */ _("div", { className: "clarity-input-wrapper", children: [
|
|
184
184
|
/* @__PURE__ */ _("div", { className: L, children: [
|
|
185
|
-
|
|
185
|
+
d && /* @__PURE__ */ a("div", { className: "clarity-input__start-icon", children: d }),
|
|
186
186
|
/* @__PURE__ */ _("div", { className: "clarity-input__field", children: [
|
|
187
187
|
/* @__PURE__ */ a(
|
|
188
188
|
"input",
|
|
189
189
|
{
|
|
190
190
|
ref: T,
|
|
191
191
|
className: "clarity-input__element",
|
|
192
|
-
disabled:
|
|
192
|
+
disabled: o,
|
|
193
193
|
value: u,
|
|
194
194
|
defaultValue: v,
|
|
195
195
|
onFocus: w,
|
|
196
196
|
onBlur: $,
|
|
197
|
-
...
|
|
197
|
+
...p
|
|
198
198
|
}
|
|
199
199
|
),
|
|
200
200
|
s && /* @__PURE__ */ a("label", { className: "clarity-input__label", children: s })
|
|
201
201
|
] }),
|
|
202
202
|
c && /* @__PURE__ */ a("div", { className: "clarity-input__end-icon", children: c })
|
|
203
203
|
] }),
|
|
204
|
-
(
|
|
204
|
+
(n || l && i) && /* @__PURE__ */ a("div", { className: "clarity-input__helper-text", children: l && i ? i : n })
|
|
205
205
|
] });
|
|
206
206
|
});
|
|
207
207
|
st.displayName = "Input";
|
|
@@ -209,20 +209,20 @@ const at = B.forwardRef(({
|
|
|
209
209
|
variant: e,
|
|
210
210
|
size: t = "medium",
|
|
211
211
|
label: s,
|
|
212
|
-
helperText:
|
|
213
|
-
error:
|
|
212
|
+
helperText: n,
|
|
213
|
+
error: l = !1,
|
|
214
214
|
errorMessage: i,
|
|
215
|
-
startIcon:
|
|
215
|
+
startIcon: d,
|
|
216
216
|
endIcon: c,
|
|
217
217
|
className: r = "",
|
|
218
|
-
disabled:
|
|
218
|
+
disabled: o = !1,
|
|
219
219
|
value: u,
|
|
220
220
|
defaultValue: v,
|
|
221
|
-
onFocus:
|
|
221
|
+
onFocus: m,
|
|
222
222
|
onBlur: f,
|
|
223
|
-
rows:
|
|
224
|
-
minHeight:
|
|
225
|
-
maxHeight:
|
|
223
|
+
rows: p = 3,
|
|
224
|
+
minHeight: h,
|
|
225
|
+
maxHeight: y,
|
|
226
226
|
resizable: N = !0,
|
|
227
227
|
...C
|
|
228
228
|
}, j) => {
|
|
@@ -232,7 +232,7 @@ const at = B.forwardRef(({
|
|
|
232
232
|
g && L(g.value.length > 0);
|
|
233
233
|
}, [u, v]);
|
|
234
234
|
const E = (g) => {
|
|
235
|
-
w(!0),
|
|
235
|
+
w(!0), m == null || m(g);
|
|
236
236
|
}, I = (g) => {
|
|
237
237
|
w(!1), L(g.target.value.length > 0), f == null || f(g);
|
|
238
238
|
}, A = [
|
|
@@ -240,33 +240,33 @@ const at = B.forwardRef(({
|
|
|
240
240
|
"clarity-textarea--outlined",
|
|
241
241
|
`clarity-textarea--${t}`,
|
|
242
242
|
e && `clarity-textarea--${e}`,
|
|
243
|
-
|
|
244
|
-
|
|
243
|
+
l && "clarity-textarea--error",
|
|
244
|
+
o && "clarity-textarea--disabled",
|
|
245
245
|
T && "clarity-textarea--focused",
|
|
246
246
|
$ && "clarity-textarea--has-value",
|
|
247
|
-
|
|
247
|
+
d && "clarity-textarea--with-start-icon",
|
|
248
248
|
c && "clarity-textarea--with-end-icon",
|
|
249
249
|
r
|
|
250
250
|
].filter(Boolean).join(" "), O = {
|
|
251
251
|
resize: N ? "vertical" : "none",
|
|
252
|
-
minHeight:
|
|
253
|
-
maxHeight:
|
|
252
|
+
minHeight: h ? `${h}px` : void 0,
|
|
253
|
+
maxHeight: y ? `${y}px` : void 0
|
|
254
254
|
};
|
|
255
255
|
return /* @__PURE__ */ _("div", { className: "clarity-textarea-wrapper", children: [
|
|
256
256
|
/* @__PURE__ */ _("div", { className: A, children: [
|
|
257
|
-
|
|
257
|
+
d && /* @__PURE__ */ a("div", { className: "clarity-textarea__start-icon", children: d }),
|
|
258
258
|
/* @__PURE__ */ _("div", { className: "clarity-textarea__field", children: [
|
|
259
259
|
/* @__PURE__ */ a(
|
|
260
260
|
"textarea",
|
|
261
261
|
{
|
|
262
262
|
ref: k,
|
|
263
263
|
className: "clarity-textarea__element",
|
|
264
|
-
disabled:
|
|
264
|
+
disabled: o,
|
|
265
265
|
value: u,
|
|
266
266
|
defaultValue: v,
|
|
267
267
|
onFocus: E,
|
|
268
268
|
onBlur: I,
|
|
269
|
-
rows:
|
|
269
|
+
rows: p,
|
|
270
270
|
style: O,
|
|
271
271
|
...C
|
|
272
272
|
}
|
|
@@ -275,28 +275,28 @@ const at = B.forwardRef(({
|
|
|
275
275
|
] }),
|
|
276
276
|
c && /* @__PURE__ */ a("div", { className: "clarity-textarea__end-icon", children: c })
|
|
277
277
|
] }),
|
|
278
|
-
(
|
|
278
|
+
(n || l && i) && /* @__PURE__ */ a("div", { className: "clarity-textarea__helper-text", children: l && i ? i : n })
|
|
279
279
|
] });
|
|
280
280
|
});
|
|
281
281
|
at.displayName = "Textarea";
|
|
282
|
-
const
|
|
282
|
+
const nt = B.forwardRef(({
|
|
283
283
|
variant: e,
|
|
284
284
|
size: t = "medium",
|
|
285
285
|
label: s,
|
|
286
|
-
helperText:
|
|
287
|
-
error:
|
|
286
|
+
helperText: n,
|
|
287
|
+
error: l = !1,
|
|
288
288
|
errorMessage: i,
|
|
289
|
-
startIcon:
|
|
289
|
+
startIcon: d,
|
|
290
290
|
endIcon: c,
|
|
291
291
|
className: r = "",
|
|
292
|
-
disabled:
|
|
292
|
+
disabled: o = !1,
|
|
293
293
|
value: u,
|
|
294
294
|
defaultValue: v,
|
|
295
|
-
onFocus:
|
|
295
|
+
onFocus: m,
|
|
296
296
|
onBlur: f,
|
|
297
|
-
onChange:
|
|
298
|
-
options:
|
|
299
|
-
placeholder:
|
|
297
|
+
onChange: p,
|
|
298
|
+
options: h,
|
|
299
|
+
placeholder: y = "Selecione uma opção",
|
|
300
300
|
isClearable: N = !1,
|
|
301
301
|
isSearchable: C = !1,
|
|
302
302
|
...j
|
|
@@ -310,33 +310,33 @@ const lt = B.forwardRef(({
|
|
|
310
310
|
};
|
|
311
311
|
return document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
|
|
312
312
|
}, [f]);
|
|
313
|
-
const V = C && A ?
|
|
313
|
+
const V = C && A ? h.filter(
|
|
314
314
|
(b) => b.label.toLowerCase().includes(A.toLowerCase())
|
|
315
|
-
) :
|
|
316
|
-
|
|
315
|
+
) : h, F = () => {
|
|
316
|
+
o || ($(!w), k(!w), w ? (f == null || f(), C && O("")) : (m == null || m(), C && setTimeout(() => {
|
|
317
317
|
var b;
|
|
318
318
|
(b = H.current) == null || b.focus();
|
|
319
319
|
}, 0)));
|
|
320
320
|
}, X = (b) => {
|
|
321
|
-
b.disabled || (I(b.value), $(!1), k(!1), O(""),
|
|
321
|
+
b.disabled || (I(b.value), $(!1), k(!1), O(""), p == null || p(b.value), f == null || f());
|
|
322
322
|
}, te = (b) => {
|
|
323
323
|
O(b.target.value);
|
|
324
324
|
}, G = (b) => {
|
|
325
325
|
b.key === "Escape" ? ($(!1), k(!1), O("")) : b.key === "Enter" && V.length > 0 && V[0] && X(V[0]);
|
|
326
|
-
}, M =
|
|
327
|
-
b.stopPropagation(), I(""),
|
|
328
|
-
}, re =
|
|
326
|
+
}, M = h.find((b) => b.value === E), ne = E !== "" && E !== void 0, ie = (b) => {
|
|
327
|
+
b.stopPropagation(), I(""), p == null || p("");
|
|
328
|
+
}, re = ne || L || y || C && A, ce = [
|
|
329
329
|
"clarity-select",
|
|
330
330
|
"clarity-select--outlined",
|
|
331
331
|
`clarity-select--${t}`,
|
|
332
332
|
e && `clarity-select--${e}`,
|
|
333
|
-
|
|
334
|
-
|
|
333
|
+
l && "clarity-select--error",
|
|
334
|
+
o && "clarity-select--disabled",
|
|
335
335
|
(L || w) && "clarity-select--focused",
|
|
336
336
|
re && "clarity-select--label-up",
|
|
337
337
|
w && "clarity-select--open",
|
|
338
338
|
C && "clarity-select--searchable",
|
|
339
|
-
|
|
339
|
+
d && "clarity-select--with-start-icon",
|
|
340
340
|
(c || N) && "clarity-select--with-end-icon",
|
|
341
341
|
r
|
|
342
342
|
].filter(Boolean).join(" ");
|
|
@@ -350,10 +350,10 @@ const lt = B.forwardRef(({
|
|
|
350
350
|
role: "combobox",
|
|
351
351
|
"aria-expanded": w,
|
|
352
352
|
"aria-haspopup": "listbox",
|
|
353
|
-
tabIndex:
|
|
353
|
+
tabIndex: o || C ? -1 : 0,
|
|
354
354
|
...j,
|
|
355
355
|
children: [
|
|
356
|
-
|
|
356
|
+
d && /* @__PURE__ */ a("div", { className: "clarity-select__start-icon", children: d }),
|
|
357
357
|
/* @__PURE__ */ _("div", { className: "clarity-select__field", children: [
|
|
358
358
|
C ? /* @__PURE__ */ a(
|
|
359
359
|
"input",
|
|
@@ -365,16 +365,16 @@ const lt = B.forwardRef(({
|
|
|
365
365
|
onChange: te,
|
|
366
366
|
onKeyDown: G,
|
|
367
367
|
onFocus: () => {
|
|
368
|
-
w || ($(!0), k(!0),
|
|
368
|
+
w || ($(!0), k(!0), m == null || m());
|
|
369
369
|
},
|
|
370
|
-
placeholder: M ? M.label :
|
|
371
|
-
disabled:
|
|
370
|
+
placeholder: M ? M.label : y,
|
|
371
|
+
disabled: o,
|
|
372
372
|
readOnly: !w
|
|
373
373
|
}
|
|
374
|
-
) : /* @__PURE__ */ a("div", { className: "clarity-select__display", children: M ? M.label :
|
|
374
|
+
) : /* @__PURE__ */ a("div", { className: "clarity-select__display", children: M ? M.label : y }),
|
|
375
375
|
s && /* @__PURE__ */ a("label", { className: "clarity-select__label", children: s })
|
|
376
376
|
] }),
|
|
377
|
-
N &&
|
|
377
|
+
N && ne && /* @__PURE__ */ a(
|
|
378
378
|
"button",
|
|
379
379
|
{
|
|
380
380
|
type: "button",
|
|
@@ -447,28 +447,28 @@ const lt = B.forwardRef(({
|
|
|
447
447
|
]
|
|
448
448
|
}
|
|
449
449
|
),
|
|
450
|
-
(
|
|
450
|
+
(n || l && i) && /* @__PURE__ */ a("div", { className: "clarity-select__helper-text", children: l && i ? i : n })
|
|
451
451
|
] });
|
|
452
452
|
});
|
|
453
|
-
|
|
454
|
-
const
|
|
453
|
+
nt.displayName = "Select";
|
|
454
|
+
const lt = Ke(({
|
|
455
455
|
options: e = [],
|
|
456
456
|
value: t = [],
|
|
457
457
|
onChange: s,
|
|
458
|
-
placeholder:
|
|
459
|
-
label:
|
|
458
|
+
placeholder: n = "Selecione opções",
|
|
459
|
+
label: l,
|
|
460
460
|
helperText: i,
|
|
461
|
-
error:
|
|
461
|
+
error: d = !1,
|
|
462
462
|
errorMessage: c,
|
|
463
463
|
disabled: r = !1,
|
|
464
|
-
variant:
|
|
464
|
+
variant: o = "primary",
|
|
465
465
|
size: u = "medium",
|
|
466
466
|
maxSelectedLabels: v = 3,
|
|
467
|
-
selectionLimit:
|
|
467
|
+
selectionLimit: m,
|
|
468
468
|
className: f = "",
|
|
469
|
-
id:
|
|
470
|
-
name:
|
|
471
|
-
required:
|
|
469
|
+
id: p,
|
|
470
|
+
name: h,
|
|
471
|
+
required: y = !1,
|
|
472
472
|
"data-testid": N,
|
|
473
473
|
...C
|
|
474
474
|
}, j) => {
|
|
@@ -492,24 +492,24 @@ const nt = Ke(({
|
|
|
492
492
|
if (r)
|
|
493
493
|
return;
|
|
494
494
|
R && (R.stopPropagation(), R.preventDefault());
|
|
495
|
-
const
|
|
495
|
+
const z = t.includes(b);
|
|
496
496
|
let D;
|
|
497
|
-
|
|
497
|
+
z ? D = t.filter((se) => se !== b) : D = [...t, b], s && s(D);
|
|
498
498
|
}, X = (b, R) => {
|
|
499
499
|
if (R.stopPropagation(), r) return;
|
|
500
|
-
const
|
|
501
|
-
s == null || s(
|
|
500
|
+
const z = t.filter((D) => D !== b);
|
|
501
|
+
s == null || s(z);
|
|
502
502
|
}, te = (b) => {
|
|
503
503
|
b.stopPropagation(), !r && (s == null || s([]));
|
|
504
504
|
}, G = (b) => {
|
|
505
505
|
L(b.target.value);
|
|
506
506
|
}, M = (b) => {
|
|
507
507
|
b.key === "Escape" && (w(!1), E(!1), L(""));
|
|
508
|
-
},
|
|
508
|
+
}, ne = k || T || t.length > 0, ie = () => {
|
|
509
509
|
if (t.length === 0) return null;
|
|
510
510
|
const b = t.map(
|
|
511
511
|
(D) => e.find((se) => se.value === D)
|
|
512
|
-
).filter(Boolean), R = b.slice(0, v),
|
|
512
|
+
).filter(Boolean), R = b.slice(0, v), z = b.length - v;
|
|
513
513
|
return /* @__PURE__ */ _("div", { className: "clarity-multiselect__chips", children: [
|
|
514
514
|
R.map((D) => /* @__PURE__ */ _("div", { className: "clarity-multiselect__chip", children: [
|
|
515
515
|
/* @__PURE__ */ a("span", { className: "clarity-multiselect__chip-label", children: D.label }),
|
|
@@ -524,9 +524,9 @@ const nt = Ke(({
|
|
|
524
524
|
}
|
|
525
525
|
)
|
|
526
526
|
] }, D.value)),
|
|
527
|
-
|
|
527
|
+
z > 0 && /* @__PURE__ */ _("div", { className: "clarity-multiselect__chip clarity-multiselect__chip--count", children: [
|
|
528
528
|
"+",
|
|
529
|
-
|
|
529
|
+
z,
|
|
530
530
|
" mais"
|
|
531
531
|
] })
|
|
532
532
|
] });
|
|
@@ -535,12 +535,12 @@ const nt = Ke(({
|
|
|
535
535
|
f
|
|
536
536
|
].filter(Boolean).join(" "), ce = [
|
|
537
537
|
"clarity-multiselect",
|
|
538
|
-
`clarity-multiselect--${
|
|
538
|
+
`clarity-multiselect--${o}`,
|
|
539
539
|
`clarity-multiselect--${u}`,
|
|
540
540
|
T && "clarity-multiselect--open",
|
|
541
541
|
k && "clarity-multiselect--focused",
|
|
542
|
-
|
|
543
|
-
|
|
542
|
+
ne && "clarity-multiselect--label-up",
|
|
543
|
+
d && "clarity-multiselect--error",
|
|
544
544
|
r && "clarity-multiselect--disabled",
|
|
545
545
|
t.length > 0 && "clarity-multiselect--has-value"
|
|
546
546
|
].filter(Boolean).join(" ");
|
|
@@ -559,11 +559,11 @@ const nt = Ke(({
|
|
|
559
559
|
className: "clarity-multiselect__field",
|
|
560
560
|
onClick: V,
|
|
561
561
|
children: [
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
562
|
+
l && /* @__PURE__ */ _("label", { className: "clarity-multiselect__label", children: [
|
|
563
|
+
l,
|
|
564
|
+
y && /* @__PURE__ */ a("span", { className: "clarity-multiselect__required", children: "*" })
|
|
565
565
|
] }),
|
|
566
|
-
/* @__PURE__ */ a("div", { className: "clarity-multiselect__content", children: t.length > 0 ? ie() : /* @__PURE__ */ a("span", { className: "clarity-multiselect__placeholder", children:
|
|
566
|
+
/* @__PURE__ */ a("div", { className: "clarity-multiselect__content", children: t.length > 0 ? ie() : /* @__PURE__ */ a("span", { className: "clarity-multiselect__placeholder", children: n }) }),
|
|
567
567
|
/* @__PURE__ */ _("div", { className: "clarity-multiselect__icons", children: [
|
|
568
568
|
t.length > 0 && !r && /* @__PURE__ */ a(
|
|
569
569
|
"button",
|
|
@@ -603,16 +603,16 @@ const nt = Ke(({
|
|
|
603
603
|
}
|
|
604
604
|
) }),
|
|
605
605
|
/* @__PURE__ */ a("ul", { className: "clarity-multiselect__options", children: H.length > 0 ? H.map((b) => {
|
|
606
|
-
const R = t.includes(b.value),
|
|
606
|
+
const R = t.includes(b.value), z = b.disabled || r;
|
|
607
607
|
return /* @__PURE__ */ _(
|
|
608
608
|
"li",
|
|
609
609
|
{
|
|
610
610
|
className: [
|
|
611
611
|
"clarity-multiselect__option",
|
|
612
612
|
R && "clarity-multiselect__option--selected",
|
|
613
|
-
|
|
613
|
+
z && "clarity-multiselect__option--disabled"
|
|
614
614
|
].filter(Boolean).join(" "),
|
|
615
|
-
onClick: (D) => !
|
|
615
|
+
onClick: (D) => !z && F(b.value, D),
|
|
616
616
|
children: [
|
|
617
617
|
/* @__PURE__ */ a("div", { className: "clarity-multiselect__option-checkbox", children: /* @__PURE__ */ a("div", { className: [
|
|
618
618
|
"clarity-multiselect__checkbox",
|
|
@@ -637,39 +637,39 @@ const nt = Ke(({
|
|
|
637
637
|
]
|
|
638
638
|
}
|
|
639
639
|
),
|
|
640
|
-
(i ||
|
|
640
|
+
(i || d && c) && /* @__PURE__ */ a("div", { className: "clarity-multiselect__helper", children: d && c ? /* @__PURE__ */ a("span", { className: "clarity-multiselect__error-message", children: c }) : i && /* @__PURE__ */ a("span", { className: "clarity-multiselect__helper-text", children: i }) })
|
|
641
641
|
] });
|
|
642
642
|
});
|
|
643
|
-
|
|
644
|
-
const pe =
|
|
643
|
+
lt.displayName = "MultiSelect";
|
|
644
|
+
const pe = U(null), fe = () => {
|
|
645
645
|
const e = q(pe);
|
|
646
646
|
if (!e)
|
|
647
647
|
throw new Error("useModal must be used within a Modal provider");
|
|
648
648
|
return e;
|
|
649
|
-
},
|
|
649
|
+
}, he = ({
|
|
650
650
|
children: e,
|
|
651
651
|
className: t = "",
|
|
652
652
|
title: s
|
|
653
653
|
}) => {
|
|
654
|
-
const { onClose:
|
|
654
|
+
const { onClose: n, variant: l, showCloseButton: i } = fe(), d = [
|
|
655
655
|
"clarity-modal-header",
|
|
656
656
|
t,
|
|
657
|
-
|
|
657
|
+
l && `clarity-modal-header--${l}`
|
|
658
658
|
].filter(Boolean).join(" "), c = [
|
|
659
659
|
"clarity-modal-close",
|
|
660
|
-
|
|
660
|
+
l && `clarity-modal-close--${l}`
|
|
661
661
|
].filter(Boolean).join(" ");
|
|
662
|
-
return /* @__PURE__ */ _("div", { className:
|
|
662
|
+
return /* @__PURE__ */ _("div", { className: d, children: [
|
|
663
663
|
s && /* @__PURE__ */ a("h2", { className: "clarity-modal-title", children: s }),
|
|
664
664
|
e,
|
|
665
665
|
i && /* @__PURE__ */ a("button", { className: c, onClick: (r) => {
|
|
666
|
-
r.stopPropagation(),
|
|
666
|
+
r.stopPropagation(), n();
|
|
667
667
|
}, children: "×" })
|
|
668
668
|
] });
|
|
669
669
|
};
|
|
670
|
-
|
|
671
|
-
const
|
|
672
|
-
|
|
670
|
+
he.displayName = "Modal.Header";
|
|
671
|
+
const ye = ({ children: e, className: t = "" }) => /* @__PURE__ */ a("div", { className: `clarity-modal-content ${t}`, children: e });
|
|
672
|
+
ye.displayName = "Modal.Content";
|
|
673
673
|
const ve = ({ children: e, className: t = "" }) => /* @__PURE__ */ _("div", { className: `clarity-modal-footer ${t}`, children: [
|
|
674
674
|
/* @__PURE__ */ a("div", { className: "clarity-modal-scroll-indicator" }),
|
|
675
675
|
e
|
|
@@ -677,8 +677,8 @@ const ve = ({ children: e, className: t = "" }) => /* @__PURE__ */ _("div", { cl
|
|
|
677
677
|
ve.displayName = "Modal.Footer";
|
|
678
678
|
const Ne = ({ children: e, onClick: t }) => W(e, {
|
|
679
679
|
onClick: (s) => {
|
|
680
|
-
var
|
|
681
|
-
t == null || t(), (
|
|
680
|
+
var n, l;
|
|
681
|
+
t == null || t(), (l = (n = e.props).onClick) == null || l.call(n, s);
|
|
682
682
|
}
|
|
683
683
|
});
|
|
684
684
|
Ne.displayName = "Modal.Trigger";
|
|
@@ -686,8 +686,8 @@ const be = ({ children: e }) => {
|
|
|
686
686
|
const { onClose: t } = fe();
|
|
687
687
|
return W(e, {
|
|
688
688
|
onClick: (s) => {
|
|
689
|
-
var
|
|
690
|
-
t(), (
|
|
689
|
+
var n, l;
|
|
690
|
+
t(), (l = (n = e.props).onClick) == null || l.call(n, s);
|
|
691
691
|
}
|
|
692
692
|
});
|
|
693
693
|
};
|
|
@@ -696,68 +696,68 @@ const J = ({
|
|
|
696
696
|
isOpen: e,
|
|
697
697
|
onClose: t,
|
|
698
698
|
onOpen: s,
|
|
699
|
-
children:
|
|
700
|
-
className:
|
|
699
|
+
children: n,
|
|
700
|
+
className: l = "",
|
|
701
701
|
variant: i,
|
|
702
|
-
size:
|
|
702
|
+
size: d = "medium",
|
|
703
703
|
showCloseButton: c = !0,
|
|
704
704
|
closeOnOverlayClick: r = !0
|
|
705
705
|
}) => {
|
|
706
|
-
const [
|
|
706
|
+
const [o, u] = x(!1), m = e !== void 0 ? e : o, f = t || (() => {
|
|
707
707
|
u(!1);
|
|
708
708
|
});
|
|
709
709
|
S(() => {
|
|
710
|
-
|
|
711
|
-
}, [
|
|
710
|
+
m && (s == null || s());
|
|
711
|
+
}, [m, s]), S(() => {
|
|
712
712
|
const C = (j) => {
|
|
713
713
|
j.key === "Escape" && f();
|
|
714
714
|
};
|
|
715
|
-
return
|
|
715
|
+
return m ? (document.addEventListener("keydown", C), document.body.style.overflow = "hidden") : document.body.style.overflow = "unset", () => {
|
|
716
716
|
document.removeEventListener("keydown", C), document.body.style.overflow = "unset";
|
|
717
717
|
};
|
|
718
|
-
}, [
|
|
719
|
-
const
|
|
718
|
+
}, [m, f]);
|
|
719
|
+
const p = (C) => {
|
|
720
720
|
r && C.target === C.currentTarget && f();
|
|
721
|
-
},
|
|
721
|
+
}, h = B.Children.toArray(n).find(
|
|
722
722
|
(C) => Z(C) && C.type.displayName === "Modal.Trigger"
|
|
723
|
-
),
|
|
723
|
+
), y = B.Children.toArray(n).filter(
|
|
724
724
|
(C) => Z(C) && C.type.displayName !== "Modal.Trigger"
|
|
725
|
-
), N = ["clarity-modal",
|
|
725
|
+
), N = ["clarity-modal", l, `clarity-modal--${d}`].filter(Boolean).join(" ");
|
|
726
726
|
return /* @__PURE__ */ _(pe.Provider, { value: { onClose: f, variant: i, showCloseButton: c }, children: [
|
|
727
|
-
|
|
728
|
-
|
|
727
|
+
h && W(h, { onClick: () => u(!0) }),
|
|
728
|
+
m && /* @__PURE__ */ a("div", { className: "clarity-modal-overlay", onClick: p, children: /* @__PURE__ */ a("div", { className: N, children: y }) })
|
|
729
729
|
] });
|
|
730
730
|
};
|
|
731
|
-
J.Header =
|
|
732
|
-
J.Content =
|
|
731
|
+
J.Header = he;
|
|
732
|
+
J.Content = ye;
|
|
733
733
|
J.Footer = ve;
|
|
734
734
|
J.Trigger = Ne;
|
|
735
735
|
J.Close = be;
|
|
736
736
|
J.displayName = "Modal";
|
|
737
|
-
const Ce =
|
|
737
|
+
const Ce = U(void 0), jt = () => {
|
|
738
738
|
const e = q(Ce);
|
|
739
739
|
if (!e)
|
|
740
740
|
throw new Error("useToast must be used within a ToastProvider");
|
|
741
741
|
return e;
|
|
742
|
-
}, it = ({ id: e, message: t, variant: s, duration:
|
|
743
|
-
const [
|
|
742
|
+
}, it = ({ id: e, message: t, variant: s, duration: n, onClose: l, invertColors: i }) => {
|
|
743
|
+
const [d, c] = x("entering");
|
|
744
744
|
S(() => {
|
|
745
|
-
const
|
|
745
|
+
const o = setTimeout(() => {
|
|
746
746
|
c("visible");
|
|
747
747
|
}, 10), u = setTimeout(() => {
|
|
748
748
|
c("exiting");
|
|
749
|
-
},
|
|
750
|
-
|
|
751
|
-
},
|
|
749
|
+
}, n * 1e3 - 300), v = setTimeout(() => {
|
|
750
|
+
l(e);
|
|
751
|
+
}, n * 1e3);
|
|
752
752
|
return () => {
|
|
753
|
-
clearTimeout(
|
|
753
|
+
clearTimeout(o), clearTimeout(u), clearTimeout(v);
|
|
754
754
|
};
|
|
755
|
-
}, [e,
|
|
755
|
+
}, [e, n, l]);
|
|
756
756
|
const r = [
|
|
757
757
|
"cl-toast",
|
|
758
758
|
s,
|
|
759
759
|
i ? "colored-background" : "",
|
|
760
|
-
`cl-toast-${
|
|
760
|
+
`cl-toast-${d}`
|
|
761
761
|
].filter(Boolean).join(" ");
|
|
762
762
|
return /* @__PURE__ */ _("div", { className: r, children: [
|
|
763
763
|
/* @__PURE__ */ a("div", { className: "cl-toast-message", children: t }),
|
|
@@ -766,12 +766,12 @@ const Ce = z(void 0), jt = () => {
|
|
|
766
766
|
"div",
|
|
767
767
|
{
|
|
768
768
|
className: "cl-toast-progress-bar",
|
|
769
|
-
style: { animationDuration: `${
|
|
769
|
+
style: { animationDuration: `${n}s` }
|
|
770
770
|
}
|
|
771
771
|
)
|
|
772
772
|
] });
|
|
773
773
|
}, Et = ({ children: e }) => {
|
|
774
|
-
const [t, s] = x([]),
|
|
774
|
+
const [t, s] = x([]), n = Y(() => {
|
|
775
775
|
if (typeof document < "u") {
|
|
776
776
|
const r = document.createElement("div");
|
|
777
777
|
return r.id = "toast-portal-root", r;
|
|
@@ -779,12 +779,12 @@ const Ce = z(void 0), jt = () => {
|
|
|
779
779
|
return null;
|
|
780
780
|
}, []);
|
|
781
781
|
S(() => {
|
|
782
|
-
if (
|
|
783
|
-
return document.body.appendChild(
|
|
784
|
-
document.body.removeChild(
|
|
782
|
+
if (n)
|
|
783
|
+
return document.body.appendChild(n), () => {
|
|
784
|
+
document.body.removeChild(n);
|
|
785
785
|
};
|
|
786
|
-
}, [
|
|
787
|
-
const
|
|
786
|
+
}, [n]);
|
|
787
|
+
const l = le((r) => {
|
|
788
788
|
const u = {
|
|
789
789
|
id: (/* @__PURE__ */ new Date()).toISOString() + Math.random(),
|
|
790
790
|
// duration: 5,
|
|
@@ -792,20 +792,20 @@ const Ce = z(void 0), jt = () => {
|
|
|
792
792
|
...r
|
|
793
793
|
};
|
|
794
794
|
s((v) => {
|
|
795
|
-
const
|
|
796
|
-
return
|
|
795
|
+
const m = [u, ...v];
|
|
796
|
+
return m.length > 4 ? m.slice(0, 4) : m;
|
|
797
797
|
});
|
|
798
|
-
}, []), i =
|
|
799
|
-
s((
|
|
800
|
-
}, []),
|
|
798
|
+
}, []), i = le((r) => {
|
|
799
|
+
s((o) => o.filter((u) => u.id !== r));
|
|
800
|
+
}, []), d = Y(() => t.reduce((r, o) => (r[o.position] || (r[o.position] = []), r[o.position].push(o), r), {}), [t]), c = Y(() => ({ show: l }), [l]);
|
|
801
801
|
return /* @__PURE__ */ _(Ce.Provider, { value: c, children: [
|
|
802
802
|
e,
|
|
803
|
-
|
|
804
|
-
Object.entries(
|
|
805
|
-
|
|
803
|
+
n && tt.createPortal(
|
|
804
|
+
Object.entries(d).map(([r, o]) => /* @__PURE__ */ a("div", { className: `cl-toast-container ${r}`, children: o.map((u) => /* @__PURE__ */ a(it, { ...u, onClose: i }, u.id)) }, r)),
|
|
805
|
+
n
|
|
806
806
|
)
|
|
807
807
|
] });
|
|
808
|
-
}, _e =
|
|
808
|
+
}, _e = U(null), we = () => {
|
|
809
809
|
const e = q(_e);
|
|
810
810
|
if (!e)
|
|
811
811
|
throw new Error("useOffcanvas must be used within an Offcanvas provider");
|
|
@@ -814,21 +814,21 @@ const Ce = z(void 0), jt = () => {
|
|
|
814
814
|
children: e,
|
|
815
815
|
className: t = ""
|
|
816
816
|
}) => {
|
|
817
|
-
const { onClose: s, variant:
|
|
817
|
+
const { onClose: s, variant: n, showCloseButton: l, title: i } = we(), d = [
|
|
818
818
|
"clarity-offcanvas-header",
|
|
819
819
|
t
|
|
820
820
|
].filter(Boolean).join(" "), c = [
|
|
821
821
|
"clarity-offcanvas-close",
|
|
822
|
-
|
|
822
|
+
n && `clarity-offcanvas-close--${n}`
|
|
823
823
|
].filter(Boolean).join(" "), r = [
|
|
824
824
|
"clarity-offcanvas-title",
|
|
825
|
-
|
|
825
|
+
n && `clarity-offcanvas-title--${n}`
|
|
826
826
|
].filter(Boolean).join(" ");
|
|
827
|
-
return /* @__PURE__ */ _("div", { className:
|
|
827
|
+
return /* @__PURE__ */ _("div", { className: d, children: [
|
|
828
828
|
i && /* @__PURE__ */ a("h2", { className: r, children: i }),
|
|
829
829
|
e,
|
|
830
|
-
|
|
831
|
-
|
|
830
|
+
l && /* @__PURE__ */ a("button", { className: c, onClick: (o) => {
|
|
831
|
+
o.stopPropagation(), s();
|
|
832
832
|
}, children: "×" })
|
|
833
833
|
] });
|
|
834
834
|
};
|
|
@@ -836,9 +836,9 @@ ge.displayName = "Offcanvas.Header";
|
|
|
836
836
|
const $e = ({ children: e, className: t = "" }) => /* @__PURE__ */ a("div", { className: `clarity-offcanvas-content ${t}`, children: e });
|
|
837
837
|
$e.displayName = "Offcanvas.Content";
|
|
838
838
|
const ke = ({ children: e, onClick: t, variant: s }) => W(e, {
|
|
839
|
-
onClick: (
|
|
840
|
-
var
|
|
841
|
-
t == null || t(), (i = (
|
|
839
|
+
onClick: (n) => {
|
|
840
|
+
var l, i;
|
|
841
|
+
t == null || t(), (i = (l = e.props).onClick) == null || i.call(l, n);
|
|
842
842
|
},
|
|
843
843
|
variant: s
|
|
844
844
|
});
|
|
@@ -849,8 +849,8 @@ const xe = ({ children: e }) => {
|
|
|
849
849
|
const { onClose: t } = we();
|
|
850
850
|
return W(e, {
|
|
851
851
|
onClick: (s) => {
|
|
852
|
-
var
|
|
853
|
-
t(), (
|
|
852
|
+
var n, l;
|
|
853
|
+
t(), (l = (n = e.props).onClick) == null || l.call(n, s);
|
|
854
854
|
}
|
|
855
855
|
});
|
|
856
856
|
};
|
|
@@ -859,22 +859,22 @@ const K = ({
|
|
|
859
859
|
isOpen: e,
|
|
860
860
|
onClose: t,
|
|
861
861
|
onOpen: s,
|
|
862
|
-
children:
|
|
863
|
-
className:
|
|
862
|
+
children: n,
|
|
863
|
+
className: l = "",
|
|
864
864
|
variant: i,
|
|
865
|
-
placement:
|
|
865
|
+
placement: d = "right",
|
|
866
866
|
closeOnOverlayClick: c = !0,
|
|
867
867
|
showCloseButton: r = !0,
|
|
868
|
-
title:
|
|
868
|
+
title: o
|
|
869
869
|
}) => {
|
|
870
|
-
const [u, v] = x(!1), [
|
|
870
|
+
const [u, v] = x(!1), [m, f] = x(!1), [p, h] = x(!1), y = e !== void 0, N = y ? e : u, C = le(() => {
|
|
871
871
|
t ? t() : v(!1);
|
|
872
|
-
}, [t]), j =
|
|
873
|
-
|
|
874
|
-
}, [
|
|
872
|
+
}, [t]), j = le(() => {
|
|
873
|
+
y || v(!0), s == null || s();
|
|
874
|
+
}, [y, s]);
|
|
875
875
|
S(() => {
|
|
876
876
|
if (N) {
|
|
877
|
-
|
|
877
|
+
h(!0);
|
|
878
878
|
const g = setTimeout(() => {
|
|
879
879
|
f(!0);
|
|
880
880
|
}, 50);
|
|
@@ -882,7 +882,7 @@ const K = ({
|
|
|
882
882
|
} else {
|
|
883
883
|
f(!1);
|
|
884
884
|
const g = setTimeout(() => {
|
|
885
|
-
|
|
885
|
+
h(!1);
|
|
886
886
|
}, 300);
|
|
887
887
|
return () => clearTimeout(g);
|
|
888
888
|
}
|
|
@@ -896,7 +896,7 @@ const K = ({
|
|
|
896
896
|
}, [N, C]);
|
|
897
897
|
const T = (g) => {
|
|
898
898
|
c && g.target === g.currentTarget && C();
|
|
899
|
-
}, w = B.Children.toArray(
|
|
899
|
+
}, w = B.Children.toArray(n);
|
|
900
900
|
let $, L, k, E, I;
|
|
901
901
|
w.forEach((g) => {
|
|
902
902
|
if (Z(g))
|
|
@@ -917,17 +917,17 @@ const K = ({
|
|
|
917
917
|
}) : E = /* @__PURE__ */ a(oe, { children: I }));
|
|
918
918
|
const A = [
|
|
919
919
|
"clarity-offcanvas",
|
|
920
|
-
|
|
921
|
-
`clarity-offcanvas--${
|
|
920
|
+
l,
|
|
921
|
+
`clarity-offcanvas--${d}`,
|
|
922
922
|
i && `clarity-offcanvas--${i}`,
|
|
923
|
-
|
|
923
|
+
m ? "clarity-offcanvas--open" : "clarity-offcanvas--closed"
|
|
924
924
|
].filter(Boolean).join(" "), O = [
|
|
925
925
|
"clarity-offcanvas-overlay",
|
|
926
|
-
|
|
926
|
+
m ? "clarity-offcanvas-overlay--visible" : ""
|
|
927
927
|
].filter(Boolean).join(" ");
|
|
928
|
-
return /* @__PURE__ */ _(_e.Provider, { value: { onClose: C, variant: i, showCloseButton: r, placement:
|
|
928
|
+
return /* @__PURE__ */ _(_e.Provider, { value: { onClose: C, variant: i, showCloseButton: r, placement: d, title: o }, children: [
|
|
929
929
|
$ && W($, { onClick: j, variant: i }),
|
|
930
|
-
|
|
930
|
+
p && // Only render if shouldRender is true
|
|
931
931
|
/* @__PURE__ */ a("div", { className: O, onClick: T, children: /* @__PURE__ */ _("div", { className: A, children: [
|
|
932
932
|
L,
|
|
933
933
|
k,
|
|
@@ -947,47 +947,47 @@ const rt = B.forwardRef(({
|
|
|
947
947
|
type: e,
|
|
948
948
|
variant: t = "primary",
|
|
949
949
|
size: s = "medium",
|
|
950
|
-
label:
|
|
951
|
-
helperText:
|
|
950
|
+
label: n,
|
|
951
|
+
helperText: l,
|
|
952
952
|
error: i = !1,
|
|
953
|
-
errorMessage:
|
|
953
|
+
errorMessage: d,
|
|
954
954
|
labelPosition: c = "right",
|
|
955
955
|
className: r = "",
|
|
956
|
-
disabled:
|
|
956
|
+
disabled: o = !1,
|
|
957
957
|
checked: u,
|
|
958
958
|
id: v,
|
|
959
|
-
...
|
|
959
|
+
...m
|
|
960
960
|
}, f) => {
|
|
961
|
-
const
|
|
961
|
+
const p = v || `check-input-${Math.random().toString(36).substr(2, 9)}`, h = [
|
|
962
962
|
"clarity-check-input-wrapper",
|
|
963
963
|
`clarity-check-input-wrapper--${c}`,
|
|
964
|
-
|
|
964
|
+
o && "clarity-check-input-wrapper--disabled",
|
|
965
965
|
i && "clarity-check-input-wrapper--error"
|
|
966
|
-
].filter(Boolean).join(" "),
|
|
966
|
+
].filter(Boolean).join(" "), y = [
|
|
967
967
|
"clarity-check-input",
|
|
968
968
|
`clarity-check-input--${e}`,
|
|
969
969
|
`clarity-check-input--${s}`,
|
|
970
970
|
t && `clarity-check-input--${t}`,
|
|
971
971
|
i && "clarity-check-input--error",
|
|
972
|
-
|
|
972
|
+
o && "clarity-check-input--disabled",
|
|
973
973
|
r
|
|
974
974
|
].filter(Boolean).join(" "), N = [
|
|
975
975
|
"clarity-check-input__label",
|
|
976
976
|
`clarity-check-input__label--${s}`,
|
|
977
|
-
|
|
977
|
+
o && "clarity-check-input__label--disabled"
|
|
978
978
|
].filter(Boolean).join(" ");
|
|
979
979
|
return /* @__PURE__ */ _("div", { className: "clarity-check-input-container", children: [
|
|
980
|
-
/* @__PURE__ */ _("label", { className:
|
|
980
|
+
/* @__PURE__ */ _("label", { className: h, htmlFor: p, children: [
|
|
981
981
|
/* @__PURE__ */ a(
|
|
982
982
|
"input",
|
|
983
983
|
{
|
|
984
984
|
ref: f,
|
|
985
|
-
id:
|
|
985
|
+
id: p,
|
|
986
986
|
type: e,
|
|
987
|
-
className:
|
|
988
|
-
disabled:
|
|
987
|
+
className: y,
|
|
988
|
+
disabled: o,
|
|
989
989
|
checked: u,
|
|
990
|
-
...
|
|
990
|
+
...m
|
|
991
991
|
}
|
|
992
992
|
),
|
|
993
993
|
/* @__PURE__ */ _("div", { className: "clarity-check-input__custom", children: [
|
|
@@ -1012,9 +1012,9 @@ const rt = B.forwardRef(({
|
|
|
1012
1012
|
),
|
|
1013
1013
|
e === "radio" && /* @__PURE__ */ a("div", { className: "clarity-check-input__radio-dot" })
|
|
1014
1014
|
] }),
|
|
1015
|
-
|
|
1015
|
+
n && /* @__PURE__ */ a("span", { className: N, children: n })
|
|
1016
1016
|
] }),
|
|
1017
|
-
(
|
|
1017
|
+
(l || i && d) && /* @__PURE__ */ a("div", { className: "clarity-check-input__helper-text", children: i && d ? d : l })
|
|
1018
1018
|
] });
|
|
1019
1019
|
});
|
|
1020
1020
|
rt.displayName = "CheckInput";
|
|
@@ -1022,62 +1022,62 @@ const ct = B.forwardRef(({
|
|
|
1022
1022
|
variant: e = "primary",
|
|
1023
1023
|
size: t = "medium",
|
|
1024
1024
|
label: s,
|
|
1025
|
-
helperText:
|
|
1026
|
-
error:
|
|
1025
|
+
helperText: n,
|
|
1026
|
+
error: l = !1,
|
|
1027
1027
|
errorMessage: i,
|
|
1028
|
-
labelPosition:
|
|
1028
|
+
labelPosition: d = "right",
|
|
1029
1029
|
className: c = "",
|
|
1030
1030
|
disabled: r = !1,
|
|
1031
|
-
checked:
|
|
1031
|
+
checked: o,
|
|
1032
1032
|
id: u,
|
|
1033
1033
|
...v
|
|
1034
|
-
},
|
|
1035
|
-
const f = u || `input-switch-${Math.random().toString(36).substr(2, 9)}`,
|
|
1034
|
+
}, m) => {
|
|
1035
|
+
const f = u || `input-switch-${Math.random().toString(36).substr(2, 9)}`, p = [
|
|
1036
1036
|
"clarity-input-switch-wrapper",
|
|
1037
|
-
`clarity-input-switch-wrapper--${
|
|
1037
|
+
`clarity-input-switch-wrapper--${d}`,
|
|
1038
1038
|
r && "clarity-input-switch-wrapper--disabled",
|
|
1039
|
-
|
|
1040
|
-
].filter(Boolean).join(" "),
|
|
1039
|
+
l && "clarity-input-switch-wrapper--error"
|
|
1040
|
+
].filter(Boolean).join(" "), h = [
|
|
1041
1041
|
"clarity-input-switch",
|
|
1042
1042
|
`clarity-input-switch--${t}`,
|
|
1043
1043
|
e && `clarity-input-switch--${e}`,
|
|
1044
|
-
|
|
1044
|
+
l && "clarity-input-switch--error",
|
|
1045
1045
|
r && "clarity-input-switch--disabled",
|
|
1046
1046
|
c
|
|
1047
|
-
].filter(Boolean).join(" "),
|
|
1047
|
+
].filter(Boolean).join(" "), y = [
|
|
1048
1048
|
"clarity-input-switch__label",
|
|
1049
1049
|
`clarity-input-switch__label--${t}`,
|
|
1050
1050
|
r && "clarity-input-switch__label--disabled"
|
|
1051
1051
|
].filter(Boolean).join(" ");
|
|
1052
1052
|
return /* @__PURE__ */ _("div", { className: "clarity-input-switch-container", children: [
|
|
1053
|
-
/* @__PURE__ */ _("label", { className:
|
|
1053
|
+
/* @__PURE__ */ _("label", { className: p, htmlFor: f, children: [
|
|
1054
1054
|
/* @__PURE__ */ a(
|
|
1055
1055
|
"input",
|
|
1056
1056
|
{
|
|
1057
|
-
ref:
|
|
1057
|
+
ref: m,
|
|
1058
1058
|
id: f,
|
|
1059
1059
|
type: "checkbox",
|
|
1060
|
-
className:
|
|
1060
|
+
className: h,
|
|
1061
1061
|
disabled: r,
|
|
1062
|
-
checked:
|
|
1062
|
+
checked: o,
|
|
1063
1063
|
...v
|
|
1064
1064
|
}
|
|
1065
1065
|
),
|
|
1066
1066
|
/* @__PURE__ */ a("div", { className: "clarity-input-switch__track", children: /* @__PURE__ */ a("div", { className: "clarity-input-switch__thumb" }) }),
|
|
1067
|
-
s && /* @__PURE__ */ a("span", { className:
|
|
1067
|
+
s && /* @__PURE__ */ a("span", { className: y, children: s })
|
|
1068
1068
|
] }),
|
|
1069
|
-
(
|
|
1069
|
+
(n || l && i) && /* @__PURE__ */ a("div", { className: "clarity-input-switch__helper-text", children: l && i ? i : n })
|
|
1070
1070
|
] });
|
|
1071
1071
|
});
|
|
1072
1072
|
ct.displayName = "InputSwitch";
|
|
1073
|
-
const Te =
|
|
1073
|
+
const Te = U(null), de = () => {
|
|
1074
1074
|
const e = q(Te);
|
|
1075
1075
|
if (!e)
|
|
1076
1076
|
throw new Error("useConfirmationDialog must be used within a ConfirmationDialog provider");
|
|
1077
1077
|
return e;
|
|
1078
1078
|
}, Be = ({ children: e, className: t = "" }) => {
|
|
1079
|
-
const { variant: s } = de(),
|
|
1080
|
-
return /* @__PURE__ */ a("div", { className:
|
|
1079
|
+
const { variant: s } = de(), n = `clarity-confirmation-dialog-header ${t} clarity-confirmation-dialog-header--${s}`;
|
|
1080
|
+
return /* @__PURE__ */ a("div", { className: n, children: e });
|
|
1081
1081
|
};
|
|
1082
1082
|
Be.displayName = "ConfirmationDialog.Header";
|
|
1083
1083
|
const je = ({ children: e, className: t = "" }) => /* @__PURE__ */ a("div", { className: `clarity-confirmation-dialog-content ${t}`, children: e });
|
|
@@ -1086,162 +1086,162 @@ const Ee = ({ children: e, className: t = "" }) => /* @__PURE__ */ a("div", { cl
|
|
|
1086
1086
|
Ee.displayName = "ConfirmationDialog.Footer";
|
|
1087
1087
|
const Le = ({ children: e }) => W(e, {
|
|
1088
1088
|
onClick: (t) => {
|
|
1089
|
-
var s,
|
|
1090
|
-
(
|
|
1089
|
+
var s, n;
|
|
1090
|
+
(n = (s = e.props).onClick) == null || n.call(s, t);
|
|
1091
1091
|
}
|
|
1092
1092
|
});
|
|
1093
1093
|
Le.displayName = "ConfirmationDialog.Trigger";
|
|
1094
|
-
const
|
|
1094
|
+
const Se = ({ children: e }) => {
|
|
1095
1095
|
const { onClose: t } = de();
|
|
1096
1096
|
return W(e, {
|
|
1097
1097
|
onClick: (s) => {
|
|
1098
|
-
var
|
|
1099
|
-
t(), (
|
|
1098
|
+
var n, l;
|
|
1099
|
+
t(), (l = (n = e.props).onClick) == null || l.call(n, s);
|
|
1100
1100
|
}
|
|
1101
1101
|
});
|
|
1102
1102
|
};
|
|
1103
|
-
|
|
1104
|
-
const
|
|
1103
|
+
Se.displayName = "ConfirmationDialog.Close";
|
|
1104
|
+
const Oe = ({ children: e }) => {
|
|
1105
1105
|
const { onConfirm: t } = de();
|
|
1106
1106
|
return W(e, {
|
|
1107
1107
|
onClick: (s) => {
|
|
1108
|
-
var
|
|
1109
|
-
t(), (
|
|
1108
|
+
var n, l;
|
|
1109
|
+
t(), (l = (n = e.props).onClick) == null || l.call(n, s);
|
|
1110
1110
|
}
|
|
1111
1111
|
});
|
|
1112
1112
|
};
|
|
1113
|
-
|
|
1113
|
+
Oe.displayName = "ConfirmationDialog.Confirm";
|
|
1114
1114
|
const Q = ({
|
|
1115
1115
|
isOpen: e,
|
|
1116
1116
|
onClose: t,
|
|
1117
1117
|
onConfirm: s,
|
|
1118
|
-
variant:
|
|
1119
|
-
children:
|
|
1118
|
+
variant: n = "clarity-primary",
|
|
1119
|
+
children: l
|
|
1120
1120
|
}) => {
|
|
1121
|
-
const [i,
|
|
1122
|
-
c ||
|
|
1121
|
+
const [i, d] = x(!1), c = e !== void 0, r = c ? e : i, o = () => {
|
|
1122
|
+
c || d(!0);
|
|
1123
1123
|
}, u = () => {
|
|
1124
|
-
t ? t() :
|
|
1124
|
+
t ? t() : d(!1);
|
|
1125
1125
|
}, v = () => {
|
|
1126
1126
|
s && s(), u();
|
|
1127
1127
|
};
|
|
1128
1128
|
S(() => {
|
|
1129
|
-
const
|
|
1130
|
-
|
|
1129
|
+
const h = (y) => {
|
|
1130
|
+
y.key === "Escape" && u();
|
|
1131
1131
|
};
|
|
1132
|
-
return r ? (document.addEventListener("keydown",
|
|
1133
|
-
document.removeEventListener("keydown",
|
|
1132
|
+
return r ? (document.addEventListener("keydown", h), document.body.style.overflow = "hidden") : document.body.style.overflow = "unset", () => {
|
|
1133
|
+
document.removeEventListener("keydown", h), document.body.style.overflow = "unset";
|
|
1134
1134
|
};
|
|
1135
1135
|
}, [r, u]);
|
|
1136
|
-
const
|
|
1137
|
-
(
|
|
1138
|
-
), f = B.Children.toArray(
|
|
1139
|
-
(
|
|
1140
|
-
),
|
|
1141
|
-
return /* @__PURE__ */ _(Te.Provider, { value: { variant:
|
|
1142
|
-
|
|
1143
|
-
r && /* @__PURE__ */ a("div", { className: "clarity-modal-overlay", children: /* @__PURE__ */ a("div", { className:
|
|
1136
|
+
const m = B.Children.toArray(l).find(
|
|
1137
|
+
(h) => Z(h) && h.type.displayName === "ConfirmationDialog.Trigger"
|
|
1138
|
+
), f = B.Children.toArray(l).filter(
|
|
1139
|
+
(h) => Z(h) && h.type.displayName !== "ConfirmationDialog.Trigger"
|
|
1140
|
+
), p = `clarity-confirmation-dialog clarity-confirmation-dialog--${n}`;
|
|
1141
|
+
return /* @__PURE__ */ _(Te.Provider, { value: { variant: n, onClose: u, onConfirm: v, onOpen: o }, children: [
|
|
1142
|
+
m,
|
|
1143
|
+
r && /* @__PURE__ */ a("div", { className: "clarity-modal-overlay", children: /* @__PURE__ */ a("div", { className: p, children: f }) })
|
|
1144
1144
|
] });
|
|
1145
1145
|
};
|
|
1146
1146
|
Q.Header = Be;
|
|
1147
1147
|
Q.Content = je;
|
|
1148
1148
|
Q.Footer = Ee;
|
|
1149
1149
|
Q.Trigger = Le;
|
|
1150
|
-
Q.Close =
|
|
1151
|
-
Q.Confirm =
|
|
1150
|
+
Q.Close = Se;
|
|
1151
|
+
Q.Confirm = Oe;
|
|
1152
1152
|
Q.displayName = "ConfirmationDialog";
|
|
1153
1153
|
const Lt = ({
|
|
1154
1154
|
variant: e = "primary",
|
|
1155
1155
|
size: t = "medium",
|
|
1156
1156
|
disabled: s = !1,
|
|
1157
|
-
loading:
|
|
1158
|
-
children:
|
|
1157
|
+
loading: n = !1,
|
|
1158
|
+
children: l,
|
|
1159
1159
|
onClick: i,
|
|
1160
|
-
type:
|
|
1160
|
+
type: d = "button",
|
|
1161
1161
|
className: c = "",
|
|
1162
1162
|
"aria-label": r,
|
|
1163
|
-
title:
|
|
1163
|
+
title: o,
|
|
1164
1164
|
customColor: u,
|
|
1165
1165
|
customColorHover: v,
|
|
1166
|
-
...
|
|
1166
|
+
...m
|
|
1167
1167
|
}) => {
|
|
1168
|
-
const f = "clarity-button-icon",
|
|
1168
|
+
const f = "clarity-button-icon", p = [
|
|
1169
1169
|
f,
|
|
1170
1170
|
!u && `${f}--${e}`,
|
|
1171
1171
|
`${f}--${t}`,
|
|
1172
|
-
|
|
1172
|
+
n && `${f}--loading`,
|
|
1173
1173
|
s && `${f}--disabled`,
|
|
1174
1174
|
c
|
|
1175
|
-
].filter(Boolean).join(" "),
|
|
1176
|
-
return u && (
|
|
1175
|
+
].filter(Boolean).join(" "), h = {};
|
|
1176
|
+
return u && (h["--button-icon-bg"] = u, h["--button-icon-hover-bg"] = v || `${u}E6`), /* @__PURE__ */ _(
|
|
1177
1177
|
"button",
|
|
1178
1178
|
{
|
|
1179
|
-
className:
|
|
1180
|
-
disabled: s ||
|
|
1179
|
+
className: p,
|
|
1180
|
+
disabled: s || n,
|
|
1181
1181
|
onClick: i,
|
|
1182
|
-
type:
|
|
1182
|
+
type: d,
|
|
1183
1183
|
"aria-label": r,
|
|
1184
|
-
title:
|
|
1185
|
-
style:
|
|
1186
|
-
...
|
|
1184
|
+
title: o,
|
|
1185
|
+
style: h,
|
|
1186
|
+
...m,
|
|
1187
1187
|
children: [
|
|
1188
|
-
|
|
1189
|
-
!
|
|
1188
|
+
n && /* @__PURE__ */ a("div", { className: `${f}__spinner` }),
|
|
1189
|
+
!n && l
|
|
1190
1190
|
]
|
|
1191
1191
|
}
|
|
1192
1192
|
);
|
|
1193
|
-
},
|
|
1193
|
+
}, St = ({
|
|
1194
1194
|
variant: e = "primary",
|
|
1195
1195
|
product: t,
|
|
1196
1196
|
tone: s,
|
|
1197
|
-
hoverTone:
|
|
1198
|
-
size:
|
|
1197
|
+
hoverTone: n,
|
|
1198
|
+
size: l = "medium",
|
|
1199
1199
|
disabled: i = !1,
|
|
1200
|
-
children:
|
|
1200
|
+
children: d,
|
|
1201
1201
|
onClick: c,
|
|
1202
1202
|
href: r,
|
|
1203
|
-
target:
|
|
1203
|
+
target: o,
|
|
1204
1204
|
rel: u,
|
|
1205
1205
|
className: v = "",
|
|
1206
|
-
...
|
|
1206
|
+
...m
|
|
1207
1207
|
}) => {
|
|
1208
|
-
const f = "clarity-button-link",
|
|
1208
|
+
const f = "clarity-button-link", p = t && s, h = p ? `${f}--custom` : `${f}--${e}`, y = [
|
|
1209
1209
|
f,
|
|
1210
|
-
|
|
1211
|
-
`${f}--${
|
|
1210
|
+
h,
|
|
1211
|
+
`${f}--${l}`,
|
|
1212
1212
|
i && `${f}--disabled`,
|
|
1213
1213
|
v
|
|
1214
1214
|
].filter(Boolean).join(" "), N = (j) => {
|
|
1215
1215
|
const T = parseInt(j);
|
|
1216
1216
|
return T >= 800 ? "900" : T >= 700 ? "800" : T >= 600 ? "700" : T >= 500 ? "600" : T >= 400 ? "500" : T >= 300 ? "400" : T >= 200 ? "300" : "200";
|
|
1217
|
-
}, C =
|
|
1217
|
+
}, C = p ? {
|
|
1218
1218
|
"--custom-color": `var(--clarity-${t}-${s})`,
|
|
1219
|
-
"--custom-hover-color": `var(--clarity-${t}-${
|
|
1219
|
+
"--custom-hover-color": `var(--clarity-${t}-${n || N(s)})`
|
|
1220
1220
|
} : {};
|
|
1221
1221
|
return r ? /* @__PURE__ */ a(
|
|
1222
1222
|
"a",
|
|
1223
1223
|
{
|
|
1224
1224
|
href: r,
|
|
1225
|
-
target:
|
|
1226
|
-
rel: u || (
|
|
1227
|
-
className:
|
|
1225
|
+
target: o,
|
|
1226
|
+
rel: u || (o === "_blank" ? "noopener noreferrer" : void 0),
|
|
1227
|
+
className: y,
|
|
1228
1228
|
style: C,
|
|
1229
1229
|
onClick: i ? void 0 : c,
|
|
1230
|
-
...
|
|
1231
|
-
children:
|
|
1230
|
+
...m,
|
|
1231
|
+
children: d
|
|
1232
1232
|
}
|
|
1233
1233
|
) : /* @__PURE__ */ a(
|
|
1234
1234
|
"button",
|
|
1235
1235
|
{
|
|
1236
|
-
className:
|
|
1236
|
+
className: y,
|
|
1237
1237
|
style: C,
|
|
1238
1238
|
disabled: i,
|
|
1239
1239
|
onClick: c,
|
|
1240
|
-
...
|
|
1241
|
-
children:
|
|
1240
|
+
...m,
|
|
1241
|
+
children: d
|
|
1242
1242
|
}
|
|
1243
1243
|
);
|
|
1244
|
-
}, Ie =
|
|
1244
|
+
}, Ie = U(void 0), Re = () => {
|
|
1245
1245
|
const e = q(Ie);
|
|
1246
1246
|
if (!e)
|
|
1247
1247
|
throw new Error("Accordion components must be used within an Accordion");
|
|
@@ -1250,30 +1250,30 @@ const Lt = ({
|
|
|
1250
1250
|
variant: e = "primary",
|
|
1251
1251
|
product: t,
|
|
1252
1252
|
tone: s,
|
|
1253
|
-
hoverTone:
|
|
1254
|
-
defaultActiveKey:
|
|
1253
|
+
hoverTone: n,
|
|
1254
|
+
defaultActiveKey: l,
|
|
1255
1255
|
alwaysOpen: i = !1,
|
|
1256
|
-
flush:
|
|
1256
|
+
flush: d = !1,
|
|
1257
1257
|
className: c = "",
|
|
1258
1258
|
children: r,
|
|
1259
|
-
onSelect:
|
|
1259
|
+
onSelect: o,
|
|
1260
1260
|
...u
|
|
1261
1261
|
}) => {
|
|
1262
|
-
const [v,
|
|
1262
|
+
const [v, m] = x(() => l ? Array.isArray(l) ? l : [l] : []), f = (w) => {
|
|
1263
1263
|
let $;
|
|
1264
|
-
i ? $ = v.includes(w) ? v.filter((L) => L !== w) : [...v, w] : $ = v.includes(w) ? [] : [w],
|
|
1265
|
-
},
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1264
|
+
i ? $ = v.includes(w) ? v.filter((L) => L !== w) : [...v, w] : $ = v.includes(w) ? [] : [w], m($), o && o(v.includes(w) ? null : w, {});
|
|
1265
|
+
}, p = "clarity-accordion", h = t && s, y = h ? `${p}--custom` : `${p}--${e}`, N = [
|
|
1266
|
+
p,
|
|
1267
|
+
y,
|
|
1268
|
+
d && `${p}--flush`,
|
|
1269
1269
|
c
|
|
1270
1270
|
].filter(Boolean).join(" "), C = (w) => {
|
|
1271
1271
|
const $ = parseInt(w);
|
|
1272
1272
|
return $ >= 800 ? "900" : $ >= 700 ? "800" : $ >= 600 ? "700" : $ >= 500 ? "600" : $ >= 400 ? "500" : $ >= 300 ? "400" : $ >= 200 ? "300" : "200";
|
|
1273
|
-
}, j =
|
|
1273
|
+
}, j = h ? {
|
|
1274
1274
|
"--custom-border-color": `var(--clarity-${t}-${s})`,
|
|
1275
1275
|
"--custom-header-color": `var(--clarity-${t}-${s})`,
|
|
1276
|
-
"--custom-hover-color": `var(--clarity-${t}-${
|
|
1276
|
+
"--custom-hover-color": `var(--clarity-${t}-${n || C(s)})`
|
|
1277
1277
|
} : {}, T = {
|
|
1278
1278
|
activeKeys: v,
|
|
1279
1279
|
toggleItem: f,
|
|
@@ -1281,50 +1281,50 @@ const Lt = ({
|
|
|
1281
1281
|
variant: e,
|
|
1282
1282
|
product: t,
|
|
1283
1283
|
tone: s,
|
|
1284
|
-
hoverTone:
|
|
1285
|
-
flush:
|
|
1284
|
+
hoverTone: n,
|
|
1285
|
+
flush: d
|
|
1286
1286
|
};
|
|
1287
1287
|
return /* @__PURE__ */ a(Ie.Provider, { value: T, children: /* @__PURE__ */ a("div", { className: N, style: j, ...u, children: r }) });
|
|
1288
1288
|
}, dt = ({
|
|
1289
1289
|
eventKey: e,
|
|
1290
1290
|
disabled: t = !1,
|
|
1291
1291
|
className: s = "",
|
|
1292
|
-
children:
|
|
1293
|
-
...
|
|
1292
|
+
children: n,
|
|
1293
|
+
...l
|
|
1294
1294
|
}) => {
|
|
1295
|
-
const { activeKeys: i } = Re(),
|
|
1296
|
-
`${
|
|
1297
|
-
c && `${
|
|
1298
|
-
t && `${
|
|
1295
|
+
const { activeKeys: i } = Re(), d = "clarity-accordion", c = i.includes(e), r = [
|
|
1296
|
+
`${d}__item`,
|
|
1297
|
+
c && `${d}__item--active`,
|
|
1298
|
+
t && `${d}__item--disabled`,
|
|
1299
1299
|
s
|
|
1300
1300
|
].filter(Boolean).join(" ");
|
|
1301
|
-
return /* @__PURE__ */ a("div", { className: r, ...
|
|
1302
|
-
...
|
|
1301
|
+
return /* @__PURE__ */ a("div", { className: r, ...l, children: B.Children.map(n, (o) => B.isValidElement(o) ? B.cloneElement(o, {
|
|
1302
|
+
...o.props,
|
|
1303
1303
|
eventKey: e,
|
|
1304
1304
|
disabled: t,
|
|
1305
1305
|
isActive: c
|
|
1306
|
-
}) :
|
|
1306
|
+
}) : o) });
|
|
1307
1307
|
}, mt = ({
|
|
1308
1308
|
className: e = "",
|
|
1309
1309
|
children: t,
|
|
1310
1310
|
onClick: s,
|
|
1311
|
-
eventKey:
|
|
1312
|
-
disabled:
|
|
1311
|
+
eventKey: n,
|
|
1312
|
+
disabled: l = !1,
|
|
1313
1313
|
isActive: i = !1,
|
|
1314
|
-
...
|
|
1314
|
+
...d
|
|
1315
1315
|
}) => {
|
|
1316
|
-
const { toggleItem: c } = Re(), r = "clarity-accordion",
|
|
1317
|
-
!
|
|
1316
|
+
const { toggleItem: c } = Re(), r = "clarity-accordion", o = (u) => {
|
|
1317
|
+
!l && n && c(n), s == null || s(u);
|
|
1318
1318
|
};
|
|
1319
1319
|
return /* @__PURE__ */ _(
|
|
1320
1320
|
"button",
|
|
1321
1321
|
{
|
|
1322
1322
|
className: [`${r}__header`, e].filter(Boolean).join(" "),
|
|
1323
|
-
onClick:
|
|
1324
|
-
disabled:
|
|
1323
|
+
onClick: o,
|
|
1324
|
+
disabled: l,
|
|
1325
1325
|
"aria-expanded": i,
|
|
1326
|
-
"aria-controls":
|
|
1327
|
-
...
|
|
1326
|
+
"aria-controls": n ? `${r}-collapse-${n}` : void 0,
|
|
1327
|
+
...d,
|
|
1328
1328
|
children: [
|
|
1329
1329
|
/* @__PURE__ */ a("span", { className: `${r}__title`, children: t }),
|
|
1330
1330
|
/* @__PURE__ */ a("span", { className: `${r}__icon`, children: /* @__PURE__ */ a(
|
|
@@ -1345,8 +1345,8 @@ const Lt = ({
|
|
|
1345
1345
|
className: e = "",
|
|
1346
1346
|
children: t,
|
|
1347
1347
|
eventKey: s,
|
|
1348
|
-
isActive:
|
|
1349
|
-
...
|
|
1348
|
+
isActive: n = !1,
|
|
1349
|
+
...l
|
|
1350
1350
|
}) => {
|
|
1351
1351
|
const i = "clarity-accordion";
|
|
1352
1352
|
return /* @__PURE__ */ a(
|
|
@@ -1355,16 +1355,16 @@ const Lt = ({
|
|
|
1355
1355
|
id: s ? `${i}-collapse-${s}` : void 0,
|
|
1356
1356
|
className: [
|
|
1357
1357
|
`${i}__collapse`,
|
|
1358
|
-
|
|
1358
|
+
n && `${i}__collapse--show`
|
|
1359
1359
|
].filter(Boolean).join(" "),
|
|
1360
|
-
children: /* @__PURE__ */ a("div", { className: [`${i}__body`, e].filter(Boolean).join(" "), ...
|
|
1360
|
+
children: /* @__PURE__ */ a("div", { className: [`${i}__body`, e].filter(Boolean).join(" "), ...l, children: t })
|
|
1361
1361
|
}
|
|
1362
1362
|
);
|
|
1363
|
-
},
|
|
1363
|
+
}, Ot = Object.assign(ot, {
|
|
1364
1364
|
Item: dt,
|
|
1365
1365
|
Header: mt,
|
|
1366
1366
|
Body: ut
|
|
1367
|
-
}), De =
|
|
1367
|
+
}), De = U(
|
|
1368
1368
|
void 0
|
|
1369
1369
|
), Ae = () => {
|
|
1370
1370
|
const e = q(De);
|
|
@@ -1379,49 +1379,49 @@ const Lt = ({
|
|
|
1379
1379
|
type: "button",
|
|
1380
1380
|
ref: s,
|
|
1381
1381
|
className: "dropdown__trigger",
|
|
1382
|
-
onClick: () => t((
|
|
1382
|
+
onClick: () => t((n) => !n),
|
|
1383
1383
|
"aria-haspopup": "true",
|
|
1384
1384
|
children: e
|
|
1385
1385
|
}
|
|
1386
1386
|
);
|
|
1387
1387
|
}, ft = ({ children: e }) => {
|
|
1388
|
-
const { isOpen: t, contentRef: s, styles:
|
|
1389
|
-
return t ? /* @__PURE__ */ a("div", { ref: s, className: "dropdown__content", style:
|
|
1390
|
-
},
|
|
1391
|
-
const [
|
|
1388
|
+
const { isOpen: t, contentRef: s, styles: n } = Ae();
|
|
1389
|
+
return t ? /* @__PURE__ */ a("div", { ref: s, className: "dropdown__content", style: n, children: e }) : null;
|
|
1390
|
+
}, ht = ({ children: e }) => /* @__PURE__ */ a("div", { className: "dropdown__menu", children: e }), yt = ({ as: e, children: t, ...s }) => /* @__PURE__ */ a(e || "a", { ...s, className: "dropdown__item", children: t }), vt = () => /* @__PURE__ */ a("hr", { className: "dropdown__separator" }), ae = ({ title: e, position: t = "bottom", children: s }) => {
|
|
1391
|
+
const [n, l] = x(!1), [i, d] = x({}), c = P(null), r = P(null), o = P(null);
|
|
1392
1392
|
return et(() => {
|
|
1393
|
-
if (
|
|
1394
|
-
const u = r.current, v =
|
|
1393
|
+
if (n) {
|
|
1394
|
+
const u = r.current, v = o.current;
|
|
1395
1395
|
if (!u || !v) return;
|
|
1396
|
-
const
|
|
1397
|
-
let
|
|
1398
|
-
t === "bottom" &&
|
|
1396
|
+
const m = u.getBoundingClientRect(), f = v.getBoundingClientRect(), p = window.innerHeight, h = window.innerWidth;
|
|
1397
|
+
let y = t;
|
|
1398
|
+
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");
|
|
1399
1399
|
const N = {};
|
|
1400
|
-
switch (
|
|
1400
|
+
switch (y) {
|
|
1401
1401
|
case "top":
|
|
1402
|
-
N.bottom =
|
|
1402
|
+
N.bottom = m.height + 4, N.left = m.width / 2 - f.width / 2;
|
|
1403
1403
|
break;
|
|
1404
1404
|
case "right":
|
|
1405
|
-
N.left =
|
|
1405
|
+
N.left = m.width + 4, N.top = m.height / 2 - f.height / 2;
|
|
1406
1406
|
break;
|
|
1407
1407
|
case "left":
|
|
1408
|
-
N.right =
|
|
1408
|
+
N.right = m.width + 4, N.top = m.height / 2 - f.height / 2;
|
|
1409
1409
|
break;
|
|
1410
1410
|
case "bottom":
|
|
1411
1411
|
default:
|
|
1412
|
-
N.top =
|
|
1412
|
+
N.top = m.height + 4, N.left = m.width / 2 - f.width / 2;
|
|
1413
1413
|
break;
|
|
1414
1414
|
}
|
|
1415
|
-
|
|
1415
|
+
d(N);
|
|
1416
1416
|
}
|
|
1417
|
-
}, [
|
|
1417
|
+
}, [n, t]), S(() => {
|
|
1418
1418
|
const u = (v) => {
|
|
1419
|
-
c.current && !c.current.contains(v.target) &&
|
|
1419
|
+
c.current && !c.current.contains(v.target) && l(!1);
|
|
1420
1420
|
};
|
|
1421
1421
|
return document.addEventListener("mousedown", u), () => {
|
|
1422
1422
|
document.removeEventListener("mousedown", u);
|
|
1423
1423
|
};
|
|
1424
|
-
}, []), /* @__PURE__ */ a(De.Provider, { value: { isOpen:
|
|
1424
|
+
}, []), /* @__PURE__ */ a(De.Provider, { value: { isOpen: n, setIsOpen: l, triggerRef: r, contentRef: o, styles: i }, children: /* @__PURE__ */ a(
|
|
1425
1425
|
"div",
|
|
1426
1426
|
{
|
|
1427
1427
|
ref: c,
|
|
@@ -1433,27 +1433,27 @@ const Lt = ({
|
|
|
1433
1433
|
};
|
|
1434
1434
|
ae.Trigger = pt;
|
|
1435
1435
|
ae.Content = ft;
|
|
1436
|
-
ae.Menu =
|
|
1437
|
-
ae.Item =
|
|
1436
|
+
ae.Menu = ht;
|
|
1437
|
+
ae.Item = yt;
|
|
1438
1438
|
ae.Separator = vt;
|
|
1439
|
-
const Pe =
|
|
1439
|
+
const Pe = U(null), Ve = () => {
|
|
1440
1440
|
const e = q(Pe);
|
|
1441
1441
|
if (!e)
|
|
1442
1442
|
throw new Error("useTabs must be used within a Tabs provider");
|
|
1443
1443
|
return e;
|
|
1444
1444
|
}, Me = ({ id: e, label: t, className: s = "" }) => {
|
|
1445
|
-
const { activeTab:
|
|
1445
|
+
const { activeTab: n, setActiveTab: l, variant: i, orientation: d } = Ve(), c = n === e, r = [
|
|
1446
1446
|
"clarity-tab",
|
|
1447
1447
|
s,
|
|
1448
1448
|
c ? "active" : "",
|
|
1449
1449
|
c ? `variant-${i}` : "",
|
|
1450
|
-
`orientation-${
|
|
1450
|
+
`orientation-${d}`
|
|
1451
1451
|
].filter(Boolean).join(" ");
|
|
1452
1452
|
return /* @__PURE__ */ a(
|
|
1453
1453
|
"button",
|
|
1454
1454
|
{
|
|
1455
1455
|
className: r,
|
|
1456
|
-
onClick: () =>
|
|
1456
|
+
onClick: () => l(e),
|
|
1457
1457
|
role: "tab",
|
|
1458
1458
|
"aria-selected": c,
|
|
1459
1459
|
children: /* @__PURE__ */ a("span", { className: "clarity-tab-label", children: t })
|
|
@@ -1462,31 +1462,46 @@ const Pe = z(null), Ve = () => {
|
|
|
1462
1462
|
};
|
|
1463
1463
|
Me.displayName = "Tabs.Tab";
|
|
1464
1464
|
const He = ({ id: e, children: t, className: s = "" }) => {
|
|
1465
|
-
const { activeTab:
|
|
1466
|
-
visibility:
|
|
1465
|
+
const { activeTab: n } = Ve(), l = n === e, i = {
|
|
1466
|
+
visibility: l ? "visible" : "hidden",
|
|
1467
1467
|
gridArea: "1 / 1"
|
|
1468
1468
|
};
|
|
1469
|
-
return
|
|
1469
|
+
return l || (i.pointerEvents = "none"), /* @__PURE__ */ a("div", { className: `clarity-tab-content ${s}`, role: "tabpanel", style: i, children: t });
|
|
1470
1470
|
};
|
|
1471
1471
|
He.displayName = "Tabs.Content";
|
|
1472
1472
|
const me = ({
|
|
1473
1473
|
children: e,
|
|
1474
1474
|
defaultTab: t,
|
|
1475
1475
|
variant: s = "primary",
|
|
1476
|
-
orientation:
|
|
1477
|
-
className:
|
|
1476
|
+
orientation: n = "horizontal",
|
|
1477
|
+
className: l = "",
|
|
1478
|
+
useUrl: i = !1
|
|
1478
1479
|
}) => {
|
|
1479
|
-
const
|
|
1480
|
-
|
|
1480
|
+
const d = () => window.location.hash.replace("#", ""), [c, r] = x(() => i && d() || t);
|
|
1481
|
+
S(() => {
|
|
1482
|
+
if (i) {
|
|
1483
|
+
const m = () => {
|
|
1484
|
+
const f = d();
|
|
1485
|
+
f && r(f);
|
|
1486
|
+
};
|
|
1487
|
+
return window.addEventListener("hashchange", m), () => {
|
|
1488
|
+
window.removeEventListener("hashchange", m);
|
|
1489
|
+
};
|
|
1490
|
+
}
|
|
1491
|
+
}, [i]);
|
|
1492
|
+
const o = (m) => {
|
|
1493
|
+
i && (window.location.hash = String(m)), r(m);
|
|
1494
|
+
}, u = Y(() => ({
|
|
1495
|
+
activeTab: c,
|
|
1481
1496
|
setActiveTab: o,
|
|
1482
1497
|
variant: s,
|
|
1483
|
-
orientation:
|
|
1484
|
-
}), [
|
|
1498
|
+
orientation: n
|
|
1499
|
+
}), [c, s, n]), v = [
|
|
1485
1500
|
"clarity-tabs-container",
|
|
1486
|
-
|
|
1487
|
-
`orientation-${
|
|
1501
|
+
l,
|
|
1502
|
+
`orientation-${n}`
|
|
1488
1503
|
].filter(Boolean).join(" ");
|
|
1489
|
-
return /* @__PURE__ */ a(Pe.Provider, { value:
|
|
1504
|
+
return /* @__PURE__ */ a(Pe.Provider, { value: u, children: /* @__PURE__ */ a("div", { className: v, children: e }) });
|
|
1490
1505
|
};
|
|
1491
1506
|
me.Tab = Me;
|
|
1492
1507
|
me.Content = He;
|
|
@@ -1495,20 +1510,20 @@ const It = ({
|
|
|
1495
1510
|
content: e,
|
|
1496
1511
|
position: t = "top",
|
|
1497
1512
|
variant: s = "primary",
|
|
1498
|
-
product:
|
|
1499
|
-
tone:
|
|
1513
|
+
product: n,
|
|
1514
|
+
tone: l,
|
|
1500
1515
|
bgColor: i,
|
|
1501
|
-
textColor:
|
|
1516
|
+
textColor: d,
|
|
1502
1517
|
children: c,
|
|
1503
1518
|
className: r = "",
|
|
1504
|
-
disabled:
|
|
1519
|
+
disabled: o = !1,
|
|
1505
1520
|
delay: u = 200,
|
|
1506
1521
|
hideDelay: v = 100,
|
|
1507
|
-
trigger:
|
|
1522
|
+
trigger: m = "hover",
|
|
1508
1523
|
arrow: f = !0,
|
|
1509
|
-
...
|
|
1524
|
+
...p
|
|
1510
1525
|
}) => {
|
|
1511
|
-
const [
|
|
1526
|
+
const [h, y] = x(!1), [N, C] = x(null), j = P(null), T = P(null), w = "clarity-tooltip", $ = !!i, L = n && l && !$;
|
|
1512
1527
|
let k = "";
|
|
1513
1528
|
$ ? k = `${w}__content--custom-bg` : L ? k = `${w}__content--custom` : k = `${w}__content--${s}`;
|
|
1514
1529
|
const E = [
|
|
@@ -1520,27 +1535,27 @@ const It = ({
|
|
|
1520
1535
|
k,
|
|
1521
1536
|
f && `${w}__content--arrow`
|
|
1522
1537
|
].filter(Boolean).join(" "), A = {}, O = {};
|
|
1523
|
-
$ && i && (O["--tooltip-bg-color"] = i),
|
|
1538
|
+
$ && i && (O["--tooltip-bg-color"] = i), d && (O["--tooltip-text-color"] = d), L && n && l && (O["--tooltip-product"] = n, O["--tooltip-tone"] = l);
|
|
1524
1539
|
const g = {
|
|
1525
1540
|
...A,
|
|
1526
1541
|
...Object.keys(O).length > 0 ? O : {}
|
|
1527
1542
|
}, H = () => {
|
|
1528
|
-
if (
|
|
1543
|
+
if (o) return;
|
|
1529
1544
|
N && clearTimeout(N);
|
|
1530
1545
|
const M = setTimeout(() => {
|
|
1531
|
-
|
|
1546
|
+
y(!0);
|
|
1532
1547
|
}, u);
|
|
1533
1548
|
C(M);
|
|
1534
1549
|
}, V = () => {
|
|
1535
1550
|
N && clearTimeout(N);
|
|
1536
1551
|
const M = setTimeout(() => {
|
|
1537
|
-
|
|
1552
|
+
y(!1);
|
|
1538
1553
|
}, v);
|
|
1539
1554
|
C(M);
|
|
1540
1555
|
}, F = () => {
|
|
1541
|
-
|
|
1556
|
+
o || y(!h);
|
|
1542
1557
|
}, X = () => {
|
|
1543
|
-
|
|
1558
|
+
o || H();
|
|
1544
1559
|
}, te = () => {
|
|
1545
1560
|
V();
|
|
1546
1561
|
};
|
|
@@ -1548,30 +1563,30 @@ const It = ({
|
|
|
1548
1563
|
N && clearTimeout(N);
|
|
1549
1564
|
}, [N]);
|
|
1550
1565
|
const G = {};
|
|
1551
|
-
return
|
|
1566
|
+
return m === "hover" ? (G.onMouseEnter = H, G.onMouseLeave = V) : m === "click" ? G.onClick = F : m === "focus" && (G.onFocus = X, G.onBlur = te), /* @__PURE__ */ _(
|
|
1552
1567
|
"div",
|
|
1553
1568
|
{
|
|
1554
1569
|
ref: T,
|
|
1555
1570
|
className: `${w}__trigger`,
|
|
1556
1571
|
...G,
|
|
1557
|
-
...
|
|
1572
|
+
...p,
|
|
1558
1573
|
children: [
|
|
1559
1574
|
c,
|
|
1560
|
-
|
|
1575
|
+
h && /* @__PURE__ */ a(
|
|
1561
1576
|
"div",
|
|
1562
1577
|
{
|
|
1563
1578
|
ref: j,
|
|
1564
1579
|
className: E,
|
|
1565
1580
|
style: g,
|
|
1566
1581
|
role: "tooltip",
|
|
1567
|
-
"aria-hidden": !
|
|
1582
|
+
"aria-hidden": !h,
|
|
1568
1583
|
children: /* @__PURE__ */ a("div", { className: I, children: e })
|
|
1569
1584
|
}
|
|
1570
1585
|
)
|
|
1571
1586
|
]
|
|
1572
1587
|
}
|
|
1573
1588
|
);
|
|
1574
|
-
}, We =
|
|
1589
|
+
}, We = U(null), ee = () => {
|
|
1575
1590
|
const e = q(We);
|
|
1576
1591
|
if (!e)
|
|
1577
1592
|
throw new Error("useCommand must be used within a Command provider");
|
|
@@ -1580,41 +1595,41 @@ const It = ({
|
|
|
1580
1595
|
children: e,
|
|
1581
1596
|
className: t = "",
|
|
1582
1597
|
variant: s = "secondary",
|
|
1583
|
-
emptyText:
|
|
1584
|
-
inputPlaceholder:
|
|
1598
|
+
emptyText: n = "No results found.",
|
|
1599
|
+
inputPlaceholder: l = "Search...",
|
|
1585
1600
|
...i
|
|
1586
1601
|
}) => {
|
|
1587
|
-
const [
|
|
1602
|
+
const [d, c] = x(""), [r, o] = x(null), [u, v] = x(!1), m = [
|
|
1588
1603
|
"clarity-command",
|
|
1589
1604
|
`clarity-command--${s}`,
|
|
1590
1605
|
t
|
|
1591
1606
|
].filter(Boolean).join(" "), f = Y(() => ({
|
|
1592
|
-
searchTerm:
|
|
1607
|
+
searchTerm: d,
|
|
1593
1608
|
setSearchTerm: c,
|
|
1594
1609
|
value: r,
|
|
1595
|
-
setValue:
|
|
1610
|
+
setValue: o,
|
|
1596
1611
|
variant: s,
|
|
1597
1612
|
texts: {
|
|
1598
|
-
empty:
|
|
1599
|
-
inputPlaceholder:
|
|
1613
|
+
empty: n,
|
|
1614
|
+
inputPlaceholder: l
|
|
1600
1615
|
},
|
|
1601
1616
|
isOpen: u,
|
|
1602
1617
|
setIsOpen: v
|
|
1603
|
-
}), [
|
|
1604
|
-
return /* @__PURE__ */ a(We.Provider, { value: f, children: /* @__PURE__ */ a("div", { className:
|
|
1618
|
+
}), [d, r, s, n, l, u]);
|
|
1619
|
+
return /* @__PURE__ */ a(We.Provider, { value: f, children: /* @__PURE__ */ a("div", { className: m, ...i, children: e }) });
|
|
1605
1620
|
};
|
|
1606
1621
|
Fe.displayName = "Command";
|
|
1607
1622
|
const Ge = ({ placeholder: e = "Search...", variant: t, onClick: s }) => {
|
|
1608
|
-
const { setIsOpen:
|
|
1623
|
+
const { setIsOpen: n, variant: l } = ee(), [i, d] = x(!1);
|
|
1609
1624
|
S(() => {
|
|
1610
|
-
|
|
1625
|
+
d(/Mac|iPod|iPhone|iPad/.test(navigator.platform));
|
|
1611
1626
|
}, []);
|
|
1612
1627
|
const r = [
|
|
1613
1628
|
"clarity-command-button",
|
|
1614
|
-
`clarity-command-button--${t ||
|
|
1629
|
+
`clarity-command-button--${t || l}`
|
|
1615
1630
|
].filter(Boolean).join(" ");
|
|
1616
1631
|
return /* @__PURE__ */ _("button", { className: r, onClick: (u) => {
|
|
1617
|
-
|
|
1632
|
+
n(!0), s == null || s(u);
|
|
1618
1633
|
}, children: [
|
|
1619
1634
|
/* @__PURE__ */ a("span", { children: e }),
|
|
1620
1635
|
/* @__PURE__ */ _("kbd", { className: "clarity-command-shortcut", children: [
|
|
@@ -1624,25 +1639,25 @@ const Ge = ({ placeholder: e = "Search...", variant: t, onClick: s }) => {
|
|
|
1624
1639
|
] });
|
|
1625
1640
|
};
|
|
1626
1641
|
Ge.displayName = "Command.Button";
|
|
1627
|
-
const
|
|
1628
|
-
const { isOpen: s, setIsOpen:
|
|
1642
|
+
const ze = ({ children: e, ...t }) => {
|
|
1643
|
+
const { isOpen: s, setIsOpen: n, variant: l } = ee();
|
|
1629
1644
|
return S(() => {
|
|
1630
|
-
const i = (
|
|
1631
|
-
|
|
1645
|
+
const i = (d) => {
|
|
1646
|
+
d.key === "k" && (d.metaKey || d.ctrlKey) && (d.preventDefault(), n(!s));
|
|
1632
1647
|
};
|
|
1633
1648
|
return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
|
|
1634
|
-
}, [s,
|
|
1649
|
+
}, [s, n]), /* @__PURE__ */ a(J, { isOpen: s, onClose: () => n(!1), size: "large", closeOnOverlayClick: !0, children: /* @__PURE__ */ a("div", { className: `clarity-command--${l}`, children: e }) });
|
|
1635
1650
|
};
|
|
1636
|
-
|
|
1637
|
-
const
|
|
1638
|
-
const { searchTerm: s, setSearchTerm:
|
|
1651
|
+
ze.displayName = "Command.Dialog";
|
|
1652
|
+
const Ue = ({ className: e = "", ...t }) => {
|
|
1653
|
+
const { searchTerm: s, setSearchTerm: n, variant: l, texts: i, isOpen: d } = ee(), c = P(null);
|
|
1639
1654
|
S(() => {
|
|
1640
|
-
var
|
|
1641
|
-
|
|
1642
|
-
}, [
|
|
1655
|
+
var o;
|
|
1656
|
+
d && ((o = c.current) == null || o.focus());
|
|
1657
|
+
}, [d]);
|
|
1643
1658
|
const r = [
|
|
1644
1659
|
"clarity-command-input",
|
|
1645
|
-
`clarity-command-input--${
|
|
1660
|
+
`clarity-command-input--${l}`,
|
|
1646
1661
|
e
|
|
1647
1662
|
].filter(Boolean).join(" ");
|
|
1648
1663
|
return /* @__PURE__ */ a("div", { className: "clarity-command-input__wrapper", children: /* @__PURE__ */ a(
|
|
@@ -1651,49 +1666,49 @@ const ze = ({ className: e = "", ...t }) => {
|
|
|
1651
1666
|
ref: c,
|
|
1652
1667
|
className: r,
|
|
1653
1668
|
value: s,
|
|
1654
|
-
onChange: (
|
|
1669
|
+
onChange: (o) => n(o.target.value),
|
|
1655
1670
|
placeholder: t.placeholder || i.inputPlaceholder,
|
|
1656
1671
|
...t
|
|
1657
1672
|
}
|
|
1658
1673
|
) });
|
|
1659
1674
|
};
|
|
1660
|
-
|
|
1675
|
+
Ue.displayName = "Command.Input";
|
|
1661
1676
|
const qe = ({ children: e, className: t = "", ...s }) => {
|
|
1662
|
-
const { searchTerm:
|
|
1663
|
-
let
|
|
1664
|
-
const i = (r) => B.Children.toArray(r).map((
|
|
1677
|
+
const { searchTerm: n } = ee();
|
|
1678
|
+
let l = !1;
|
|
1679
|
+
const i = (r) => B.Children.toArray(r).map((o) => {
|
|
1665
1680
|
var v;
|
|
1666
|
-
if (!B.isValidElement(
|
|
1667
|
-
const u =
|
|
1681
|
+
if (!B.isValidElement(o)) return o;
|
|
1682
|
+
const u = o.type.displayName;
|
|
1668
1683
|
if (u === "Command.Empty")
|
|
1669
1684
|
return null;
|
|
1670
1685
|
if (u === "Command.Item")
|
|
1671
|
-
return (((v =
|
|
1686
|
+
return (((v = o.props.children) == null ? void 0 : v.toString().toLowerCase()) || "").includes(n.toLowerCase()) ? (l = !0, o) : null;
|
|
1672
1687
|
if (u === "Command.Group") {
|
|
1673
|
-
const
|
|
1674
|
-
return B.Children.toArray(
|
|
1688
|
+
const m = i(o.props.children);
|
|
1689
|
+
return B.Children.toArray(m).some((p) => B.isValidElement(p) && p.type.displayName === "Command.Item") ? B.cloneElement(o, { ...o.props, children: m }) : null;
|
|
1675
1690
|
}
|
|
1676
|
-
return
|
|
1677
|
-
}).filter(Boolean),
|
|
1691
|
+
return o;
|
|
1692
|
+
}).filter(Boolean), d = i(e), c = ["clarity-command-list", t].filter(Boolean).join(" ");
|
|
1678
1693
|
return /* @__PURE__ */ _("div", { className: c, ...s, children: [
|
|
1679
|
-
|
|
1680
|
-
!
|
|
1694
|
+
d,
|
|
1695
|
+
!l && /* @__PURE__ */ a(ue, {})
|
|
1681
1696
|
] });
|
|
1682
1697
|
};
|
|
1683
1698
|
qe.displayName = "Command.List";
|
|
1684
1699
|
const ue = ({ children: e, className: t = "", ...s }) => {
|
|
1685
|
-
const { texts:
|
|
1686
|
-
return /* @__PURE__ */ a("div", { className:
|
|
1700
|
+
const { texts: n } = ee(), l = ["clarity-command-empty", t].filter(Boolean).join(" ");
|
|
1701
|
+
return /* @__PURE__ */ a("div", { className: l, ...s, children: e || s.emptyText || n.empty });
|
|
1687
1702
|
};
|
|
1688
1703
|
ue.displayName = "Command.Empty";
|
|
1689
1704
|
const Je = ({ children: e, className: t = "", ...s }) => {
|
|
1690
|
-
const
|
|
1691
|
-
return /* @__PURE__ */ a("div", { className:
|
|
1705
|
+
const n = ["clarity-command-group", t].filter(Boolean).join(" ");
|
|
1706
|
+
return /* @__PURE__ */ a("div", { className: n, ...s, children: e });
|
|
1692
1707
|
};
|
|
1693
1708
|
Je.displayName = "Command.Group";
|
|
1694
1709
|
const Qe = ({ children: e, className: t = "", ...s }) => {
|
|
1695
|
-
const { setValue:
|
|
1696
|
-
return /* @__PURE__ */ a("div", { className: i, onClick: () =>
|
|
1710
|
+
const { setValue: n, variant: l } = ee(), i = ["clarity-command-item", `clarity-command-item--${l}`, t].filter(Boolean).join(" ");
|
|
1711
|
+
return /* @__PURE__ */ a("div", { className: i, onClick: () => n((e == null ? void 0 : e.toString()) || ""), ...s, children: e });
|
|
1697
1712
|
};
|
|
1698
1713
|
Qe.displayName = "Command.Item";
|
|
1699
1714
|
const Xe = ({ className: e = "", ...t }) => {
|
|
@@ -1702,14 +1717,14 @@ const Xe = ({ className: e = "", ...t }) => {
|
|
|
1702
1717
|
};
|
|
1703
1718
|
Xe.displayName = "Command.Separator";
|
|
1704
1719
|
const Ye = ({ children: e, className: t = "", ...s }) => {
|
|
1705
|
-
const
|
|
1706
|
-
return /* @__PURE__ */ a("span", { className:
|
|
1720
|
+
const n = ["clarity-command-shortcut", t].filter(Boolean).join(" ");
|
|
1721
|
+
return /* @__PURE__ */ a("span", { className: n, ...s, children: e });
|
|
1707
1722
|
};
|
|
1708
1723
|
Ye.displayName = "Command.Shortcut";
|
|
1709
1724
|
const Rt = Object.assign(Fe, {
|
|
1710
1725
|
Button: Ge,
|
|
1711
|
-
Dialog:
|
|
1712
|
-
Input:
|
|
1726
|
+
Dialog: ze,
|
|
1727
|
+
Input: Ue,
|
|
1713
1728
|
List: qe,
|
|
1714
1729
|
Empty: ue,
|
|
1715
1730
|
Group: Je,
|
|
@@ -1717,85 +1732,85 @@ const Rt = Object.assign(Fe, {
|
|
|
1717
1732
|
Separator: Xe,
|
|
1718
1733
|
Shortcut: Ye
|
|
1719
1734
|
}), Nt = ({ columns: e, viewMode: t }) => {
|
|
1720
|
-
const s = Array.from({ length: 5 }, (
|
|
1735
|
+
const s = Array.from({ length: 5 }, (n, l) => l);
|
|
1721
1736
|
return t === "card" ? /* @__PURE__ */ _("div", { className: "card-view-wrapper is-loading", children: [
|
|
1722
1737
|
/* @__PURE__ */ a("div", { className: "skeleton card-view-header" }),
|
|
1723
|
-
/* @__PURE__ */ a("div", { className: "card-view-body", children: s.map((
|
|
1738
|
+
/* @__PURE__ */ a("div", { className: "card-view-body", children: s.map((n) => /* @__PURE__ */ a("div", { className: "skeleton card-view-row" }, n)) })
|
|
1724
1739
|
] }) : /* @__PURE__ */ a("div", { className: "table-wrapper is-loading", children: /* @__PURE__ */ _("table", { children: [
|
|
1725
|
-
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ a("tr", { className: "table-row", children: e.map((
|
|
1726
|
-
/* @__PURE__ */ a("tbody", { children: s.map((
|
|
1740
|
+
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ a("tr", { className: "table-row", children: e.map((n) => /* @__PURE__ */ a("th", { className: "table-header-cell", children: /* @__PURE__ */ a("div", { className: "skeleton skeleton-text" }) }, n.key)) }) }),
|
|
1741
|
+
/* @__PURE__ */ a("tbody", { children: s.map((n) => /* @__PURE__ */ a("tr", { className: "table-row", children: e.map((l) => /* @__PURE__ */ a("td", { className: "table-cell", children: /* @__PURE__ */ a("div", { className: "skeleton skeleton-text" }) }, l.key)) }, n)) })
|
|
1727
1742
|
] }) });
|
|
1728
1743
|
}, Dt = ({
|
|
1729
1744
|
variant: e = "secondary",
|
|
1730
1745
|
columns: t,
|
|
1731
1746
|
data: s,
|
|
1732
|
-
viewMode:
|
|
1733
|
-
isScrollable:
|
|
1747
|
+
viewMode: n = "table",
|
|
1748
|
+
isScrollable: l = !1,
|
|
1734
1749
|
isLoading: i = !1
|
|
1735
1750
|
}) => {
|
|
1736
|
-
const [
|
|
1737
|
-
|
|
1738
|
-
}, v = Y(() => r === "none" || !
|
|
1739
|
-
const
|
|
1740
|
-
return
|
|
1741
|
-
}), [s,
|
|
1751
|
+
const [d, c] = x(null), [r, o] = x("none"), u = (p) => {
|
|
1752
|
+
p.sortable && (d === p.key ? o((h) => h === "asc" ? "desc" : h === "desc" ? "none" : "asc") : (c(p.key), o("asc")));
|
|
1753
|
+
}, v = Y(() => r === "none" || !d ? s : [...s].sort((p, h) => {
|
|
1754
|
+
const y = p[d], N = h[d];
|
|
1755
|
+
return y < N ? r === "asc" ? -1 : 1 : y > N ? r === "asc" ? 1 : -1 : 0;
|
|
1756
|
+
}), [s, d, r]), m = (p) => p.sortable ? d !== p.key || r === "none" ? /* @__PURE__ */ a("span", { className: "sort-icon", children: "↕" }) : r === "asc" ? /* @__PURE__ */ a("span", { className: "sort-icon", children: "↑" }) : /* @__PURE__ */ a("span", { className: "sort-icon", children: "↓" }) : null;
|
|
1742
1757
|
if (i)
|
|
1743
|
-
return /* @__PURE__ */ a(Nt, { columns: t, viewMode:
|
|
1744
|
-
const f = `table-variant-${e} ${
|
|
1745
|
-
return
|
|
1746
|
-
/* @__PURE__ */ a("div", { className: `card-view-header table-header-cell-${e}`, children: t.map((
|
|
1758
|
+
return /* @__PURE__ */ a(Nt, { columns: t, viewMode: n });
|
|
1759
|
+
const f = `table-variant-${e} ${l ? "is-scrollable" : ""}`;
|
|
1760
|
+
return n === "card" ? /* @__PURE__ */ _("div", { className: `card-view-wrapper ${f}`, children: [
|
|
1761
|
+
/* @__PURE__ */ a("div", { className: `card-view-header table-header-cell-${e}`, children: t.map((p) => /* @__PURE__ */ _(
|
|
1747
1762
|
"div",
|
|
1748
1763
|
{
|
|
1749
|
-
className: `card-view-header-cell ${
|
|
1750
|
-
onClick: () => u(
|
|
1751
|
-
style: { minWidth:
|
|
1764
|
+
className: `card-view-header-cell ${p.sortable ? "sortable" : ""}`,
|
|
1765
|
+
onClick: () => u(p),
|
|
1766
|
+
style: { minWidth: p.minWidth },
|
|
1752
1767
|
children: [
|
|
1753
|
-
|
|
1754
|
-
p
|
|
1768
|
+
p.header,
|
|
1769
|
+
m(p)
|
|
1755
1770
|
]
|
|
1756
1771
|
},
|
|
1757
|
-
|
|
1772
|
+
p.key
|
|
1758
1773
|
)) }),
|
|
1759
|
-
/* @__PURE__ */ a("div", { className: "card-view-body", children: v.map((
|
|
1774
|
+
/* @__PURE__ */ a("div", { className: "card-view-body", children: v.map((p, h) => /* @__PURE__ */ a("div", { className: `card-view-row table-row-${e}`, children: t.map((y) => /* @__PURE__ */ a("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)) })
|
|
1760
1775
|
] }) : /* @__PURE__ */ a("div", { className: `table-wrapper ${f}`, children: /* @__PURE__ */ _("table", { children: [
|
|
1761
|
-
/* @__PURE__ */ a("thead", { className: "table-header", children: /* @__PURE__ */ a("tr", { className: "table-row", children: t.map((
|
|
1776
|
+
/* @__PURE__ */ a("thead", { className: "table-header", children: /* @__PURE__ */ a("tr", { className: "table-row", children: t.map((p) => /* @__PURE__ */ _(
|
|
1762
1777
|
"th",
|
|
1763
1778
|
{
|
|
1764
|
-
className: `table-header-cell ${
|
|
1765
|
-
onClick: () => u(
|
|
1766
|
-
style: { minWidth:
|
|
1779
|
+
className: `table-header-cell ${p.sortable ? "sortable" : ""} table-header-cell-${e}`,
|
|
1780
|
+
onClick: () => u(p),
|
|
1781
|
+
style: { minWidth: p.minWidth },
|
|
1767
1782
|
children: [
|
|
1768
|
-
|
|
1769
|
-
p
|
|
1783
|
+
p.header,
|
|
1784
|
+
m(p)
|
|
1770
1785
|
]
|
|
1771
1786
|
},
|
|
1772
|
-
|
|
1787
|
+
p.key
|
|
1773
1788
|
)) }) }),
|
|
1774
|
-
/* @__PURE__ */ a("tbody", { children: v.map((
|
|
1789
|
+
/* @__PURE__ */ a("tbody", { children: v.map((p, h) => /* @__PURE__ */ a("tr", { className: `table-row table-row-${e}`, children: t.map((y) => /* @__PURE__ */ a("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)) })
|
|
1775
1790
|
] }) });
|
|
1776
1791
|
}, At = ({
|
|
1777
1792
|
variant: e = "primary",
|
|
1778
1793
|
product: t,
|
|
1779
1794
|
tone: s,
|
|
1780
|
-
size:
|
|
1781
|
-
color:
|
|
1795
|
+
size: n = "medium",
|
|
1796
|
+
color: l,
|
|
1782
1797
|
className: i = "",
|
|
1783
|
-
"aria-label":
|
|
1798
|
+
"aria-label": d = "Carregando...",
|
|
1784
1799
|
...c
|
|
1785
1800
|
}) => {
|
|
1786
|
-
const r = "clarity-spinner", v =
|
|
1801
|
+
const r = "clarity-spinner", v = l ? `${r}--custom` : t && s ? `${r}--custom` : `${r}--${e}`, m = [
|
|
1787
1802
|
r,
|
|
1788
|
-
`${r}--${
|
|
1803
|
+
`${r}--${n}`,
|
|
1789
1804
|
v,
|
|
1790
1805
|
i
|
|
1791
1806
|
].filter(Boolean).join(" "), f = {};
|
|
1792
|
-
return
|
|
1807
|
+
return l ? f["--spinner-color"] = l : t && s && (f["--spinner-color"] = `var(--clarity-${t}-${s})`), /* @__PURE__ */ a(
|
|
1793
1808
|
"div",
|
|
1794
1809
|
{
|
|
1795
|
-
className:
|
|
1810
|
+
className: m,
|
|
1796
1811
|
style: f,
|
|
1797
1812
|
role: "status",
|
|
1798
|
-
"aria-label":
|
|
1813
|
+
"aria-label": d,
|
|
1799
1814
|
...c,
|
|
1800
1815
|
children: /* @__PURE__ */ a("div", { className: `${r}__container`, children: /* @__PURE__ */ a(
|
|
1801
1816
|
"svg",
|
|
@@ -1822,47 +1837,47 @@ const Rt = Object.assign(Fe, {
|
|
|
1822
1837
|
className: e = "",
|
|
1823
1838
|
noGutters: t,
|
|
1824
1839
|
justify: s,
|
|
1825
|
-
align:
|
|
1826
|
-
children:
|
|
1840
|
+
align: n,
|
|
1841
|
+
children: l,
|
|
1827
1842
|
as: i = "div",
|
|
1828
|
-
...
|
|
1843
|
+
...d
|
|
1829
1844
|
}) => {
|
|
1830
1845
|
const c = [
|
|
1831
1846
|
"clarity-row",
|
|
1832
1847
|
t ? "clarity-row--no-gutters" : "",
|
|
1833
1848
|
s ? `clarity-row--justify-${s}` : "",
|
|
1834
|
-
|
|
1849
|
+
n ? `clarity-row--align-${n}` : "",
|
|
1835
1850
|
e
|
|
1836
1851
|
].filter(Boolean).join(" ");
|
|
1837
|
-
return B.createElement(i, { className: c, ...
|
|
1852
|
+
return B.createElement(i, { className: c, ...d }, l);
|
|
1838
1853
|
};
|
|
1839
1854
|
bt.displayName = "Row";
|
|
1840
1855
|
const Ct = (e) => `${e / 12 * 100}%`, _t = (e) => `${e / 12 * 100}%`, wt = ({
|
|
1841
1856
|
className: e = "",
|
|
1842
1857
|
xs: t,
|
|
1843
1858
|
sm: s,
|
|
1844
|
-
md:
|
|
1845
|
-
lg:
|
|
1859
|
+
md: n,
|
|
1860
|
+
lg: l,
|
|
1846
1861
|
xl: i,
|
|
1847
|
-
xxl:
|
|
1862
|
+
xxl: d,
|
|
1848
1863
|
offset: c,
|
|
1849
1864
|
children: r,
|
|
1850
|
-
as:
|
|
1865
|
+
as: o = "div",
|
|
1851
1866
|
style: u,
|
|
1852
1867
|
...v
|
|
1853
1868
|
}) => {
|
|
1854
|
-
const
|
|
1869
|
+
const m = { ...u }, f = (y, N) => {
|
|
1855
1870
|
if (N === void 0) return;
|
|
1856
|
-
const C = `--clarity-col-width-${
|
|
1857
|
-
|
|
1858
|
-
},
|
|
1871
|
+
const C = `--clarity-col-width-${y}`;
|
|
1872
|
+
m[C] = typeof N == "number" ? Ct(N) : "auto";
|
|
1873
|
+
}, p = (y, N) => {
|
|
1859
1874
|
if (N === void 0) return;
|
|
1860
|
-
const C = `--clarity-col-offset-${
|
|
1861
|
-
|
|
1875
|
+
const C = `--clarity-col-offset-${y}`;
|
|
1876
|
+
m[C] = _t(N);
|
|
1862
1877
|
};
|
|
1863
|
-
f("xs", t), f("sm", s), f("md",
|
|
1864
|
-
const
|
|
1865
|
-
return B.createElement(
|
|
1878
|
+
f("xs", t), f("sm", s), f("md", n), f("lg", l), f("xl", i), f("xxl", d), p("xs", c == null ? void 0 : c.xs), p("sm", c == null ? void 0 : c.sm), p("md", c == null ? void 0 : c.md), p("lg", c == null ? void 0 : c.lg), p("xl", c == null ? void 0 : c.xl), p("xxl", c == null ? void 0 : c.xxl);
|
|
1879
|
+
const h = ["clarity-col", e].filter(Boolean).join(" ");
|
|
1880
|
+
return B.createElement(o, { className: h, style: m, ...v }, r);
|
|
1866
1881
|
};
|
|
1867
1882
|
wt.displayName = "Col";
|
|
1868
1883
|
const Pt = {
|
|
@@ -1944,12 +1959,12 @@ const Pt = {
|
|
|
1944
1959
|
}
|
|
1945
1960
|
}, Ht = (...e) => e.filter(Boolean).join(" "), Wt = () => Math.random().toString(36).substr(2, 9);
|
|
1946
1961
|
export {
|
|
1947
|
-
|
|
1962
|
+
Ot as Accordion,
|
|
1948
1963
|
xt as Badge,
|
|
1949
1964
|
Tt as Button,
|
|
1950
1965
|
Bt as ButtonGroup,
|
|
1951
1966
|
Lt as ButtonIcon,
|
|
1952
|
-
|
|
1967
|
+
St as ButtonLink,
|
|
1953
1968
|
rt as CheckInput,
|
|
1954
1969
|
wt as Col,
|
|
1955
1970
|
Rt as Command,
|
|
@@ -1958,10 +1973,10 @@ export {
|
|
|
1958
1973
|
st as Input,
|
|
1959
1974
|
ct as InputSwitch,
|
|
1960
1975
|
J as Modal,
|
|
1961
|
-
|
|
1976
|
+
lt as MultiSelect,
|
|
1962
1977
|
K as Offcanvas,
|
|
1963
1978
|
bt as Row,
|
|
1964
|
-
|
|
1979
|
+
nt as Select,
|
|
1965
1980
|
At as Spinner,
|
|
1966
1981
|
Dt as Table,
|
|
1967
1982
|
me as Tabs,
|