beth-clarity 1.1.9 → 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,10 +1,10 @@
|
|
|
1
|
-
import { jsx 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",
|
|
6
6
|
product: t,
|
|
7
|
-
tone:
|
|
7
|
+
tone: a,
|
|
8
8
|
size: l = "medium",
|
|
9
9
|
bgColor: n,
|
|
10
10
|
textColor: r,
|
|
@@ -12,40 +12,40 @@ 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 =
|
|
30
|
-
"--custom-bg-color": `var(--clarity-${t}-${
|
|
31
|
-
"--custom-text-color":
|
|
27
|
+
].filter(Boolean).join(" "), y = {};
|
|
28
|
+
p && (y.backgroundColor = n, r && (y.color = r));
|
|
29
|
+
const N = f && t && a ? {
|
|
30
|
+
"--custom-bg-color": `var(--clarity-${t}-${a})`,
|
|
31
|
+
"--custom-text-color": a && parseInt(a) >= 500 ? "white" : `var(--clarity-${t}-800)`
|
|
32
32
|
} : {};
|
|
33
|
-
return /* @__PURE__ */
|
|
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
|
-
tone:
|
|
48
|
+
tone: a,
|
|
49
49
|
hoverTone: l,
|
|
50
50
|
size: n = "medium",
|
|
51
51
|
disabled: r = !1,
|
|
@@ -53,44 +53,105 @@ 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
|
-
},
|
|
71
|
-
"--custom-bg-color": `var(--clarity-${t}-${
|
|
72
|
-
"--custom-hover-color": `var(--clarity-${t}-${l || N(
|
|
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
|
+
"--custom-bg-color": `var(--clarity-${t}-${a})`,
|
|
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__ */
|
|
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",
|
|
93
|
-
label:
|
|
154
|
+
label: a,
|
|
94
155
|
helperText: l,
|
|
95
156
|
error: n = !1,
|
|
96
157
|
errorMessage: r,
|
|
@@ -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,41 +181,41 @@ 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__ */
|
|
131
|
-
o && /* @__PURE__ */
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
/* @__PURE__ */
|
|
190
|
+
return /* @__PURE__ */ w("div", { className: "clarity-input-wrapper", children: [
|
|
191
|
+
/* @__PURE__ */ w("div", { className: E, children: [
|
|
192
|
+
o && /* @__PURE__ */ s("div", { className: "clarity-input__start-icon", children: o }),
|
|
193
|
+
/* @__PURE__ */ w("div", { className: "clarity-input__field", children: [
|
|
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
|
}
|
|
145
206
|
),
|
|
146
|
-
|
|
207
|
+
a && /* @__PURE__ */ s("label", { className: "clarity-input__label", children: a })
|
|
147
208
|
] }),
|
|
148
|
-
u && /* @__PURE__ */
|
|
209
|
+
u && /* @__PURE__ */ s("div", { className: "clarity-input__end-icon", children: u })
|
|
149
210
|
] }),
|
|
150
|
-
(l || n && r) && /* @__PURE__ */
|
|
211
|
+
(l || n && r) && /* @__PURE__ */ s("div", { className: "clarity-input__helper-text", children: n && r ? r : l })
|
|
151
212
|
] });
|
|
152
213
|
});
|
|
153
214
|
st.displayName = "Input";
|
|
154
215
|
const at = L.forwardRef(({
|
|
155
216
|
variant: e,
|
|
156
217
|
size: t = "medium",
|
|
157
|
-
label:
|
|
218
|
+
label: a,
|
|
158
219
|
helperText: l,
|
|
159
220
|
error: n = !1,
|
|
160
221
|
errorMessage: r,
|
|
@@ -162,73 +223,73 @@ 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__ */
|
|
203
|
-
o && /* @__PURE__ */
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
-
/* @__PURE__ */
|
|
262
|
+
return /* @__PURE__ */ w("div", { className: "clarity-textarea-wrapper", children: [
|
|
263
|
+
/* @__PURE__ */ w("div", { className: A, children: [
|
|
264
|
+
o && /* @__PURE__ */ s("div", { className: "clarity-textarea__start-icon", children: o }),
|
|
265
|
+
/* @__PURE__ */ w("div", { className: "clarity-textarea__field", children: [
|
|
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 })
|
|
221
282
|
] }),
|
|
222
|
-
u && /* @__PURE__ */
|
|
283
|
+
u && /* @__PURE__ */ s("div", { className: "clarity-textarea__end-icon", children: u })
|
|
223
284
|
] }),
|
|
224
|
-
(l || n && r) && /* @__PURE__ */
|
|
285
|
+
(l || n && r) && /* @__PURE__ */ s("div", { className: "clarity-textarea__helper-text", children: n && r ? r : l })
|
|
225
286
|
] });
|
|
226
287
|
});
|
|
227
288
|
at.displayName = "Textarea";
|
|
228
289
|
const lt = L.forwardRef(({
|
|
229
290
|
variant: e,
|
|
230
291
|
size: t = "medium",
|
|
231
|
-
label:
|
|
292
|
+
label: a,
|
|
232
293
|
helperText: l,
|
|
233
294
|
error: n = !1,
|
|
234
295
|
errorMessage: r,
|
|
@@ -236,105 +297,105 @@ 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
|
-
o && /* @__PURE__ */
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
|
|
363
|
+
o && /* @__PURE__ */ s("div", { className: "clarity-select__start-icon", children: o }),
|
|
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__ */
|
|
321
|
-
|
|
381
|
+
) : /* @__PURE__ */ s("div", { className: "clarity-select__display", children: H ? H.label : y }),
|
|
382
|
+
a && /* @__PURE__ */ s("label", { className: "clarity-select__label", children: a })
|
|
322
383
|
] }),
|
|
323
|
-
N && le && /* @__PURE__ */
|
|
384
|
+
N && le && /* @__PURE__ */ s(
|
|
324
385
|
"button",
|
|
325
386
|
{
|
|
326
387
|
type: "button",
|
|
327
388
|
className: "clarity-select__clear-button",
|
|
328
389
|
onClick: re,
|
|
329
390
|
"aria-label": "Limpar seleção",
|
|
330
|
-
children: /* @__PURE__ */
|
|
391
|
+
children: /* @__PURE__ */ s(
|
|
331
392
|
"svg",
|
|
332
393
|
{
|
|
333
394
|
width: "16",
|
|
334
395
|
height: "16",
|
|
335
396
|
viewBox: "0 0 16 16",
|
|
336
397
|
fill: "none",
|
|
337
|
-
children: /* @__PURE__ */
|
|
398
|
+
children: /* @__PURE__ */ s(
|
|
338
399
|
"path",
|
|
339
400
|
{
|
|
340
401
|
d: "M12 4L4 12M4 4L12 12",
|
|
@@ -348,12 +409,12 @@ const lt = L.forwardRef(({
|
|
|
348
409
|
)
|
|
349
410
|
}
|
|
350
411
|
),
|
|
351
|
-
/* @__PURE__ */
|
|
412
|
+
/* @__PURE__ */ s(
|
|
352
413
|
"div",
|
|
353
414
|
{
|
|
354
415
|
className: "clarity-select__end-icon",
|
|
355
|
-
onClick:
|
|
356
|
-
children: u || /* @__PURE__ */
|
|
416
|
+
onClick: b ? F : void 0,
|
|
417
|
+
children: u || /* @__PURE__ */ s(
|
|
357
418
|
"svg",
|
|
358
419
|
{
|
|
359
420
|
className: "clarity-select__arrow",
|
|
@@ -361,7 +422,7 @@ const lt = L.forwardRef(({
|
|
|
361
422
|
height: "16",
|
|
362
423
|
viewBox: "0 0 16 16",
|
|
363
424
|
fill: "none",
|
|
364
|
-
children: /* @__PURE__ */
|
|
425
|
+
children: /* @__PURE__ */ s(
|
|
365
426
|
"path",
|
|
366
427
|
{
|
|
367
428
|
d: "M4 6L8 10L12 6",
|
|
@@ -375,32 +436,32 @@ 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
|
-
|
|
392
|
-
)) : /* @__PURE__ */
|
|
452
|
+
C.value
|
|
453
|
+
)) : /* @__PURE__ */ s("li", { className: "clarity-select__option clarity-select__option--no-results", children: "Nenhum resultado encontrado" }) }) })
|
|
393
454
|
]
|
|
394
455
|
}
|
|
395
456
|
),
|
|
396
|
-
(l || n && r) && /* @__PURE__ */
|
|
457
|
+
(l || n && r) && /* @__PURE__ */ s("div", { className: "clarity-select__helper-text", children: n && r ? r : l })
|
|
397
458
|
] });
|
|
398
459
|
});
|
|
399
460
|
lt.displayName = "Select";
|
|
400
461
|
const nt = Ke(({
|
|
401
462
|
options: e = [],
|
|
402
463
|
value: t = [],
|
|
403
|
-
onChange:
|
|
464
|
+
onChange: a,
|
|
404
465
|
placeholder: l = "Selecione opções",
|
|
405
466
|
label: n,
|
|
406
467
|
helperText: r,
|
|
@@ -408,58 +469,58 @@ 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 !==
|
|
447
|
-
|
|
448
|
-
}, te = (
|
|
449
|
-
|
|
450
|
-
}, G = (
|
|
451
|
-
E(
|
|
452
|
-
}, H = (
|
|
453
|
-
|
|
454
|
-
}, le = x ||
|
|
507
|
+
const U = t.filter((R) => R !== C);
|
|
508
|
+
a == null || a(U);
|
|
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__ */
|
|
461
|
-
/* @__PURE__ */
|
|
462
|
-
!i && /* @__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: [
|
|
522
|
+
/* @__PURE__ */ s("span", { className: "clarity-multiselect__chip-label", children: R.label }),
|
|
523
|
+
!i && /* @__PURE__ */ s(
|
|
463
524
|
"button",
|
|
464
525
|
{
|
|
465
526
|
type: "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,40 +539,40 @@ 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
|
-
/* @__PURE__ */
|
|
513
|
-
/* @__PURE__ */
|
|
514
|
-
t.length > 0 && !i && /* @__PURE__ */
|
|
573
|
+
/* @__PURE__ */ s("div", { className: "clarity-multiselect__content", children: t.length > 0 ? re() : /* @__PURE__ */ s("span", { className: "clarity-multiselect__placeholder", children: l }) }),
|
|
574
|
+
/* @__PURE__ */ w("div", { className: "clarity-multiselect__icons", children: [
|
|
575
|
+
t.length > 0 && !i && /* @__PURE__ */ s(
|
|
515
576
|
"button",
|
|
516
577
|
{
|
|
517
578
|
type: "button",
|
|
@@ -521,7 +582,7 @@ const nt = Ke(({
|
|
|
521
582
|
children: "×"
|
|
522
583
|
}
|
|
523
584
|
),
|
|
524
|
-
/* @__PURE__ */
|
|
585
|
+
/* @__PURE__ */ s("div", { className: "clarity-multiselect__dropdown-icon", children: /* @__PURE__ */ s("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ s(
|
|
525
586
|
"path",
|
|
526
587
|
{
|
|
527
588
|
d: "M4 6L8 10L12 6",
|
|
@@ -535,11 +596,11 @@ const nt = Ke(({
|
|
|
535
596
|
]
|
|
536
597
|
}
|
|
537
598
|
),
|
|
538
|
-
|
|
539
|
-
/* @__PURE__ */
|
|
599
|
+
$ && /* @__PURE__ */ w("div", { ref: S, className: "clarity-multiselect__dropdown", children: [
|
|
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__ */
|
|
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,12 +619,12 @@ 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
|
-
/* @__PURE__ */
|
|
624
|
+
/* @__PURE__ */ s("div", { className: "clarity-multiselect__option-checkbox", children: /* @__PURE__ */ s("div", { className: [
|
|
564
625
|
"clarity-multiselect__checkbox",
|
|
565
626
|
D && "clarity-multiselect__checkbox--checked"
|
|
566
|
-
].filter(Boolean).join(" "), children: D && /* @__PURE__ */
|
|
627
|
+
].filter(Boolean).join(" "), children: D && /* @__PURE__ */ s("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ s(
|
|
567
628
|
"path",
|
|
568
629
|
{
|
|
569
630
|
d: "M2 6L5 9L10 3",
|
|
@@ -573,17 +634,17 @@ const nt = Ke(({
|
|
|
573
634
|
strokeLinejoin: "round"
|
|
574
635
|
}
|
|
575
636
|
) }) }) }),
|
|
576
|
-
/* @__PURE__ */
|
|
637
|
+
/* @__PURE__ */ s("span", { className: "clarity-multiselect__option-label", children: C.label })
|
|
577
638
|
]
|
|
578
639
|
},
|
|
579
|
-
|
|
640
|
+
C.value
|
|
580
641
|
);
|
|
581
|
-
}) : /* @__PURE__ */
|
|
642
|
+
}) : /* @__PURE__ */ s("li", { className: "clarity-multiselect__option clarity-multiselect__option--no-results", children: "Nenhum resultado encontrado" }) })
|
|
582
643
|
] })
|
|
583
644
|
]
|
|
584
645
|
}
|
|
585
646
|
),
|
|
586
|
-
(r || o && u) && /* @__PURE__ */
|
|
647
|
+
(r || o && u) && /* @__PURE__ */ s("div", { className: "clarity-multiselect__helper", children: o && u ? /* @__PURE__ */ s("span", { className: "clarity-multiselect__error-message", children: u }) : r && /* @__PURE__ */ s("span", { className: "clarity-multiselect__helper-text", children: r }) })
|
|
587
648
|
] });
|
|
588
649
|
});
|
|
589
650
|
nt.displayName = "MultiSelect";
|
|
@@ -595,7 +656,7 @@ const fe = z(null), pe = () => {
|
|
|
595
656
|
}, he = ({
|
|
596
657
|
children: e,
|
|
597
658
|
className: t = "",
|
|
598
|
-
title:
|
|
659
|
+
title: a
|
|
599
660
|
}) => {
|
|
600
661
|
const { onClose: l, variant: n, showCloseButton: r } = pe(), o = [
|
|
601
662
|
"clarity-modal-header",
|
|
@@ -605,36 +666,36 @@ 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__ */
|
|
609
|
-
|
|
669
|
+
return /* @__PURE__ */ w("div", { className: o, children: [
|
|
670
|
+
a && /* @__PURE__ */ s("h2", { className: "clarity-modal-title", children: a }),
|
|
610
671
|
e,
|
|
611
|
-
r && /* @__PURE__ */
|
|
672
|
+
r && /* @__PURE__ */ s("button", { className: u, onClick: (i) => {
|
|
612
673
|
i.stopPropagation(), l();
|
|
613
674
|
}, children: "×" })
|
|
614
675
|
] });
|
|
615
676
|
};
|
|
616
677
|
he.displayName = "Modal.Header";
|
|
617
|
-
const ye = ({ children: e, className: t = "" }) => /* @__PURE__ */
|
|
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__ */
|
|
620
|
-
/* @__PURE__ */
|
|
680
|
+
const ve = ({ children: e, className: t = "" }) => /* @__PURE__ */ w("div", { className: `clarity-modal-footer ${t}`, children: [
|
|
681
|
+
/* @__PURE__ */ s("div", { className: "clarity-modal-scroll-indicator" }),
|
|
621
682
|
e
|
|
622
683
|
] });
|
|
623
684
|
ve.displayName = "Modal.Footer";
|
|
624
|
-
const Ce = ({ children: e, onClick: t, variant:
|
|
685
|
+
const Ce = ({ children: e, onClick: t, variant: a }) => W(e, {
|
|
625
686
|
onClick: (l) => {
|
|
626
687
|
var n, r;
|
|
627
688
|
t == null || t(), (r = (n = e.props).onClick) == null || r.call(n, l);
|
|
628
689
|
},
|
|
629
|
-
variant:
|
|
690
|
+
variant: a
|
|
630
691
|
});
|
|
631
692
|
Ce.displayName = "Modal.Trigger";
|
|
632
693
|
const Ne = ({ children: e }) => {
|
|
633
694
|
const { onClose: t } = pe();
|
|
634
695
|
return W(e, {
|
|
635
|
-
onClick: (
|
|
696
|
+
onClick: (a) => {
|
|
636
697
|
var l, n;
|
|
637
|
-
t(), (n = (l = e.props).onClick) == null || n.call(l,
|
|
698
|
+
t(), (n = (l = e.props).onClick) == null || n.call(l, a);
|
|
638
699
|
}
|
|
639
700
|
});
|
|
640
701
|
};
|
|
@@ -642,7 +703,7 @@ Ne.displayName = "Modal.Close";
|
|
|
642
703
|
const J = ({
|
|
643
704
|
isOpen: e,
|
|
644
705
|
onClose: t,
|
|
645
|
-
onOpen:
|
|
706
|
+
onOpen: a,
|
|
646
707
|
children: l,
|
|
647
708
|
className: n = "",
|
|
648
709
|
variant: r,
|
|
@@ -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,35 +742,35 @@ 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");
|
|
688
749
|
return e;
|
|
689
|
-
}, rt = ({ id: e, message: t, variant:
|
|
750
|
+
}, rt = ({ id: e, message: t, variant: a, duration: l, onClose: n, invertColors: r }) => {
|
|
690
751
|
const [o, u] = T("entering");
|
|
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 = [
|
|
704
765
|
"cl-toast",
|
|
705
|
-
|
|
766
|
+
a,
|
|
706
767
|
r ? "colored-background" : "",
|
|
707
768
|
`cl-toast-${o}`
|
|
708
769
|
].filter(Boolean).join(" ");
|
|
709
|
-
return /* @__PURE__ */
|
|
710
|
-
/* @__PURE__ */
|
|
711
|
-
/* @__PURE__ */
|
|
712
|
-
/* @__PURE__ */
|
|
770
|
+
return /* @__PURE__ */ w("div", { className: i, children: [
|
|
771
|
+
/* @__PURE__ */ s("div", { className: "cl-toast-message", children: t }),
|
|
772
|
+
/* @__PURE__ */ s("button", { onClick: () => u("exiting"), className: "cl-toast-close-button", children: "×" }),
|
|
773
|
+
/* @__PURE__ */ s(
|
|
713
774
|
"div",
|
|
714
775
|
{
|
|
715
776
|
className: "cl-toast-progress-bar",
|
|
@@ -717,8 +778,8 @@ const be = z(void 0), $t = () => {
|
|
|
717
778
|
}
|
|
718
779
|
)
|
|
719
780
|
] });
|
|
720
|
-
},
|
|
721
|
-
const [t,
|
|
781
|
+
}, xt = ({ children: e }) => {
|
|
782
|
+
const [t, a] = T([]), l = Y(() => {
|
|
722
783
|
if (typeof document < "u") {
|
|
723
784
|
const i = document.createElement("div");
|
|
724
785
|
return i.id = "toast-portal-root", i;
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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__ */
|
|
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,11 +818,11 @@ 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
|
}) => {
|
|
764
|
-
const { onClose:
|
|
825
|
+
const { onClose: a, variant: l, showCloseButton: n, title: r } = we(), o = [
|
|
765
826
|
"clarity-offcanvas-header",
|
|
766
827
|
t
|
|
767
828
|
].filter(Boolean).join(" "), u = [
|
|
@@ -771,33 +832,33 @@ 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__ */
|
|
775
|
-
r && /* @__PURE__ */
|
|
835
|
+
return /* @__PURE__ */ w("div", { className: o, children: [
|
|
836
|
+
r && /* @__PURE__ */ s("h2", { className: i, children: r }),
|
|
776
837
|
e,
|
|
777
|
-
n && /* @__PURE__ */
|
|
778
|
-
c.stopPropagation(),
|
|
838
|
+
n && /* @__PURE__ */ s("button", { className: u, onClick: (c) => {
|
|
839
|
+
c.stopPropagation(), a();
|
|
779
840
|
}, children: "×" })
|
|
780
841
|
] });
|
|
781
842
|
};
|
|
782
|
-
|
|
783
|
-
const
|
|
784
|
-
|
|
785
|
-
const ke = ({ children: e, onClick: t, variant:
|
|
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";
|
|
846
|
+
const ke = ({ children: e, onClick: t, variant: a }) => W(e, {
|
|
786
847
|
onClick: (l) => {
|
|
787
848
|
var n, r;
|
|
788
849
|
t == null || t(), (r = (n = e.props).onClick) == null || r.call(n, l);
|
|
789
850
|
},
|
|
790
|
-
variant:
|
|
851
|
+
variant: a
|
|
791
852
|
});
|
|
792
853
|
ke.displayName = "Offcanvas.Trigger";
|
|
793
|
-
const ce = ({ children: e, className: t = "" }) => /* @__PURE__ */
|
|
854
|
+
const ce = ({ children: e, className: t = "" }) => /* @__PURE__ */ s("div", { className: `clarity-offcanvas-footer ${t}`, children: e });
|
|
794
855
|
ce.displayName = "Offcanvas.Footer";
|
|
795
856
|
const xe = ({ children: e }) => {
|
|
796
857
|
const { onClose: t } = we();
|
|
797
858
|
return W(e, {
|
|
798
|
-
onClick: (
|
|
859
|
+
onClick: (a) => {
|
|
799
860
|
var l, n;
|
|
800
|
-
t(), (n = (l = e.props).onClick) == null || n.call(l,
|
|
861
|
+
t(), (n = (l = e.props).onClick) == null || n.call(l, a);
|
|
801
862
|
}
|
|
802
863
|
});
|
|
803
864
|
};
|
|
@@ -805,7 +866,7 @@ xe.displayName = "Offcanvas.Close";
|
|
|
805
866
|
const K = ({
|
|
806
867
|
isOpen: e,
|
|
807
868
|
onClose: t,
|
|
808
|
-
onOpen:
|
|
869
|
+
onOpen: a,
|
|
809
870
|
children: l,
|
|
810
871
|
className: n = "",
|
|
811
872
|
variant: r,
|
|
@@ -814,78 +875,78 @@ 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__ */
|
|
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__ */
|
|
939
|
+
/* @__PURE__ */ s("div", { className: S, onClick: $, children: /* @__PURE__ */ w("div", { className: A, children: [
|
|
879
940
|
E,
|
|
880
941
|
x,
|
|
881
|
-
j && /* @__PURE__ */
|
|
942
|
+
j && /* @__PURE__ */ s("div", { className: "clarity-offcanvas-scroll-indicator" }),
|
|
882
943
|
" ",
|
|
883
944
|
j
|
|
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;
|
|
@@ -893,7 +954,7 @@ K.displayName = "Offcanvas";
|
|
|
893
954
|
const it = L.forwardRef(({
|
|
894
955
|
type: e,
|
|
895
956
|
variant: t = "primary",
|
|
896
|
-
size:
|
|
957
|
+
size: a = "medium",
|
|
897
958
|
label: l,
|
|
898
959
|
helperText: n,
|
|
899
960
|
error: r = !1,
|
|
@@ -901,51 +962,51 @@ 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
|
-
`clarity-check-input--${
|
|
977
|
+
`clarity-check-input--${a}`,
|
|
917
978
|
t && `clarity-check-input--${t}`,
|
|
918
979
|
r && "clarity-check-input--error",
|
|
919
980
|
c && "clarity-check-input--disabled",
|
|
920
981
|
i
|
|
921
982
|
].filter(Boolean).join(" "), N = [
|
|
922
983
|
"clarity-check-input__label",
|
|
923
|
-
`clarity-check-input__label--${
|
|
984
|
+
`clarity-check-input__label--${a}`,
|
|
924
985
|
c && "clarity-check-input__label--disabled"
|
|
925
986
|
].filter(Boolean).join(" ");
|
|
926
|
-
return /* @__PURE__ */
|
|
927
|
-
/* @__PURE__ */
|
|
928
|
-
/* @__PURE__ */
|
|
987
|
+
return /* @__PURE__ */ w("div", { className: "clarity-check-input-container", children: [
|
|
988
|
+
/* @__PURE__ */ w("label", { className: h, htmlFor: d, children: [
|
|
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__ */
|
|
941
|
-
e === "checkbox" && /* @__PURE__ */
|
|
1001
|
+
/* @__PURE__ */ w("div", { className: "clarity-check-input__custom", children: [
|
|
1002
|
+
e === "checkbox" && /* @__PURE__ */ s(
|
|
942
1003
|
"svg",
|
|
943
1004
|
{
|
|
944
1005
|
className: "clarity-check-input__icon",
|
|
945
1006
|
viewBox: "0 0 16 16",
|
|
946
1007
|
fill: "none",
|
|
947
1008
|
xmlns: "http://www.w3.org/2000/svg",
|
|
948
|
-
children: /* @__PURE__ */
|
|
1009
|
+
children: /* @__PURE__ */ s(
|
|
949
1010
|
"path",
|
|
950
1011
|
{
|
|
951
1012
|
d: "M13.5 4.5L6 12L2.5 8.5",
|
|
@@ -957,18 +1018,18 @@ const it = L.forwardRef(({
|
|
|
957
1018
|
)
|
|
958
1019
|
}
|
|
959
1020
|
),
|
|
960
|
-
e === "radio" && /* @__PURE__ */
|
|
1021
|
+
e === "radio" && /* @__PURE__ */ s("div", { className: "clarity-check-input__radio-dot" })
|
|
961
1022
|
] }),
|
|
962
|
-
l && /* @__PURE__ */
|
|
1023
|
+
l && /* @__PURE__ */ s("span", { className: N, children: l })
|
|
963
1024
|
] }),
|
|
964
|
-
(n || r && o) && /* @__PURE__ */
|
|
1025
|
+
(n || r && o) && /* @__PURE__ */ s("div", { className: "clarity-check-input__helper-text", children: r && o ? o : n })
|
|
965
1026
|
] });
|
|
966
1027
|
});
|
|
967
1028
|
it.displayName = "CheckInput";
|
|
968
1029
|
const ot = L.forwardRef(({
|
|
969
1030
|
variant: e = "primary",
|
|
970
1031
|
size: t = "medium",
|
|
971
|
-
label:
|
|
1032
|
+
label: a,
|
|
972
1033
|
helperText: l,
|
|
973
1034
|
error: n = !1,
|
|
974
1035
|
errorMessage: r,
|
|
@@ -976,44 +1037,44 @@ 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__ */
|
|
1001
|
-
/* @__PURE__ */
|
|
1060
|
+
return /* @__PURE__ */ w("div", { className: "clarity-input-switch-container", children: [
|
|
1061
|
+
/* @__PURE__ */ w("label", { className: d, htmlFor: f, children: [
|
|
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
|
-
/* @__PURE__ */
|
|
1014
|
-
|
|
1074
|
+
/* @__PURE__ */ s("div", { className: "clarity-input-switch__track", children: /* @__PURE__ */ s("div", { className: "clarity-input-switch__thumb" }) }),
|
|
1075
|
+
a && /* @__PURE__ */ s("span", { className: y, children: a })
|
|
1015
1076
|
] }),
|
|
1016
|
-
(l || n && r) && /* @__PURE__ */
|
|
1077
|
+
(l || n && r) && /* @__PURE__ */ s("div", { className: "clarity-input-switch__helper-text", children: n && r ? r : l })
|
|
1017
1078
|
] });
|
|
1018
1079
|
});
|
|
1019
1080
|
ot.displayName = "InputSwitch";
|
|
@@ -1023,37 +1084,37 @@ const Te = z(null), de = () => {
|
|
|
1023
1084
|
throw new Error("useConfirmationDialog must be used within a ConfirmationDialog provider");
|
|
1024
1085
|
return e;
|
|
1025
1086
|
}, Be = ({ children: e, className: t = "" }) => {
|
|
1026
|
-
const { variant:
|
|
1027
|
-
return /* @__PURE__ */
|
|
1087
|
+
const { variant: a } = de(), l = `clarity-confirmation-dialog-header ${t} clarity-confirmation-dialog-header--${a}`;
|
|
1088
|
+
return /* @__PURE__ */ s("div", { className: l, children: e });
|
|
1028
1089
|
};
|
|
1029
1090
|
Be.displayName = "ConfirmationDialog.Header";
|
|
1030
|
-
const je = ({ children: e, className: t = "" }) => /* @__PURE__ */
|
|
1091
|
+
const je = ({ children: e, className: t = "" }) => /* @__PURE__ */ s("div", { className: `clarity-confirmation-dialog-content ${t}`, children: e });
|
|
1031
1092
|
je.displayName = "ConfirmationDialog.Content";
|
|
1032
|
-
const Le = ({ children: e, className: t = "" }) => /* @__PURE__ */
|
|
1093
|
+
const Le = ({ children: e, className: t = "" }) => /* @__PURE__ */ s("div", { className: `clarity-confirmation-dialog-footer ${t}`, children: e });
|
|
1033
1094
|
Le.displayName = "ConfirmationDialog.Footer";
|
|
1034
1095
|
const Ee = ({ children: e }) => W(e, {
|
|
1035
1096
|
onClick: (t) => {
|
|
1036
|
-
var
|
|
1037
|
-
(l = (
|
|
1097
|
+
var a, l;
|
|
1098
|
+
(l = (a = e.props).onClick) == null || l.call(a, t);
|
|
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
|
-
onClick: (
|
|
1105
|
+
onClick: (a) => {
|
|
1045
1106
|
var l, n;
|
|
1046
|
-
t(), (n = (l = e.props).onClick) == null || n.call(l,
|
|
1107
|
+
t(), (n = (l = e.props).onClick) == null || n.call(l, a);
|
|
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, {
|
|
1054
|
-
onClick: (
|
|
1115
|
+
onClick: (a) => {
|
|
1055
1116
|
var l, n;
|
|
1056
|
-
t(), (n = (l = e.props).onClick) == null || n.call(l,
|
|
1117
|
+
t(), (n = (l = e.props).onClick) == null || n.call(l, a);
|
|
1057
1118
|
}
|
|
1058
1119
|
});
|
|
1059
1120
|
};
|
|
@@ -1061,46 +1122,46 @@ Oe.displayName = "ConfirmationDialog.Confirm";
|
|
|
1061
1122
|
const Q = ({
|
|
1062
1123
|
isOpen: e,
|
|
1063
1124
|
onClose: t,
|
|
1064
|
-
onConfirm:
|
|
1125
|
+
onConfirm: a,
|
|
1065
1126
|
variant: l = "clarity-primary",
|
|
1066
1127
|
children: n
|
|
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
|
-
|
|
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__ */
|
|
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
|
-
tone:
|
|
1164
|
+
tone: a,
|
|
1104
1165
|
hoverTone: l,
|
|
1105
1166
|
size: n = "medium",
|
|
1106
1167
|
disabled: r = !1,
|
|
@@ -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 =
|
|
1127
|
-
"--custom-bg-color": `var(--clarity-${t}-${
|
|
1128
|
-
"--custom-hover-color": `var(--clarity-${t}-${l ||
|
|
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 ? {
|
|
1188
|
+
"--custom-bg-color": `var(--clarity-${t}-${a})`,
|
|
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,19 +1196,19 @@ 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
|
-
o && /* @__PURE__ */
|
|
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
|
-
tone:
|
|
1211
|
+
tone: a,
|
|
1151
1212
|
hoverTone: l,
|
|
1152
1213
|
size: n = "medium",
|
|
1153
1214
|
disabled: r = !1,
|
|
@@ -1155,55 +1216,55 @@ 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
|
-
},
|
|
1172
|
-
"--custom-color": `var(--clarity-${t}-${
|
|
1173
|
-
"--custom-hover-color": `var(--clarity-${t}-${l || N(
|
|
1230
|
+
const $ = parseInt(B);
|
|
1231
|
+
return $ >= 800 ? "900" : $ >= 700 ? "800" : $ >= 600 ? "700" : $ >= 500 ? "600" : $ >= 400 ? "500" : $ >= 300 ? "400" : $ >= 200 ? "300" : "200";
|
|
1232
|
+
}, b = d ? {
|
|
1233
|
+
"--custom-color": `var(--clarity-${t}-${a})`,
|
|
1234
|
+
"--custom-hover-color": `var(--clarity-${t}-${l || N(a)})`
|
|
1174
1235
|
} : {};
|
|
1175
|
-
return i ? /* @__PURE__ */
|
|
1236
|
+
return i ? /* @__PURE__ */ s(
|
|
1176
1237
|
"a",
|
|
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
|
-
) : /* @__PURE__ */
|
|
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;
|
|
1203
1264
|
}, ct = ({
|
|
1204
1265
|
variant: e = "primary",
|
|
1205
1266
|
product: t,
|
|
1206
|
-
tone:
|
|
1267
|
+
tone: a,
|
|
1207
1268
|
hoverTone: l,
|
|
1208
1269
|
defaultActiveKey: n,
|
|
1209
1270
|
alwaysOpen: r = !1,
|
|
@@ -1211,38 +1272,38 @@ 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 =
|
|
1228
|
-
"--custom-border-color": `var(--clarity-${t}-${
|
|
1229
|
-
"--custom-header-color": `var(--clarity-${t}-${
|
|
1230
|
-
"--custom-hover-color": `var(--clarity-${t}-${l ||
|
|
1231
|
-
} : {},
|
|
1232
|
-
activeKeys:
|
|
1233
|
-
toggleItem:
|
|
1288
|
+
}, B = h ? {
|
|
1289
|
+
"--custom-border-color": `var(--clarity-${t}-${a})`,
|
|
1290
|
+
"--custom-header-color": `var(--clarity-${t}-${a})`,
|
|
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,
|
|
1237
|
-
tone:
|
|
1298
|
+
tone: a,
|
|
1238
1299
|
hoverTone: l,
|
|
1239
1300
|
flush: o
|
|
1240
1301
|
};
|
|
1241
|
-
return /* @__PURE__ */
|
|
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,
|
|
1245
|
-
className:
|
|
1306
|
+
className: a = "",
|
|
1246
1307
|
children: l,
|
|
1247
1308
|
...n
|
|
1248
1309
|
}) => {
|
|
@@ -1250,9 +1311,9 @@ const xt = ({
|
|
|
1250
1311
|
`${o}__item`,
|
|
1251
1312
|
u && `${o}__item--active`,
|
|
1252
1313
|
t && `${o}__item--disabled`,
|
|
1253
|
-
|
|
1314
|
+
a
|
|
1254
1315
|
].filter(Boolean).join(" ");
|
|
1255
|
-
return /* @__PURE__ */
|
|
1316
|
+
return /* @__PURE__ */ s("div", { className: i, ...n, children: L.Children.map(l, (c) => L.isValidElement(c) ? L.cloneElement(c, {
|
|
1256
1317
|
...c.props,
|
|
1257
1318
|
eventKey: e,
|
|
1258
1319
|
disabled: t,
|
|
@@ -1261,16 +1322,16 @@ const xt = ({
|
|
|
1261
1322
|
}, mt = ({
|
|
1262
1323
|
className: e = "",
|
|
1263
1324
|
children: t,
|
|
1264
|
-
onClick:
|
|
1325
|
+
onClick: a,
|
|
1265
1326
|
eventKey: l,
|
|
1266
1327
|
disabled: n = !1,
|
|
1267
1328
|
isActive: r = !1,
|
|
1268
1329
|
...o
|
|
1269
1330
|
}) => {
|
|
1270
|
-
const { toggleItem: u } = De(), i = "clarity-accordion", c = (
|
|
1271
|
-
!n && l && u(l),
|
|
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(" "),
|
|
@@ -1280,8 +1341,8 @@ const xt = ({
|
|
|
1280
1341
|
"aria-controls": l ? `${i}-collapse-${l}` : void 0,
|
|
1281
1342
|
...o,
|
|
1282
1343
|
children: [
|
|
1283
|
-
/* @__PURE__ */
|
|
1284
|
-
/* @__PURE__ */
|
|
1344
|
+
/* @__PURE__ */ s("span", { className: `${i}__title`, children: t }),
|
|
1345
|
+
/* @__PURE__ */ s("span", { className: `${i}__icon`, children: /* @__PURE__ */ s(
|
|
1285
1346
|
"svg",
|
|
1286
1347
|
{
|
|
1287
1348
|
width: "16",
|
|
@@ -1289,7 +1350,7 @@ const xt = ({
|
|
|
1289
1350
|
viewBox: "0 0 16 16",
|
|
1290
1351
|
fill: "currentColor",
|
|
1291
1352
|
className: r ? `${i}__icon--rotated` : "",
|
|
1292
|
-
children: /* @__PURE__ */
|
|
1353
|
+
children: /* @__PURE__ */ s("path", { d: "M4.646 6.646a.5.5 0 0 1 .708 0L8 9.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z" })
|
|
1293
1354
|
}
|
|
1294
1355
|
) })
|
|
1295
1356
|
]
|
|
@@ -1298,40 +1359,40 @@ const xt = ({
|
|
|
1298
1359
|
}, ut = ({
|
|
1299
1360
|
className: e = "",
|
|
1300
1361
|
children: t,
|
|
1301
|
-
eventKey:
|
|
1362
|
+
eventKey: a,
|
|
1302
1363
|
isActive: l = !1,
|
|
1303
1364
|
...n
|
|
1304
1365
|
}) => {
|
|
1305
1366
|
const r = "clarity-accordion";
|
|
1306
|
-
return /* @__PURE__ */
|
|
1367
|
+
return /* @__PURE__ */ s(
|
|
1307
1368
|
"div",
|
|
1308
1369
|
{
|
|
1309
|
-
id:
|
|
1370
|
+
id: a ? `${r}-collapse-${a}` : void 0,
|
|
1310
1371
|
className: [
|
|
1311
1372
|
`${r}__collapse`,
|
|
1312
1373
|
l && `${r}__collapse--show`
|
|
1313
1374
|
].filter(Boolean).join(" "),
|
|
1314
|
-
children: /* @__PURE__ */
|
|
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:
|
|
1330
|
-
return /* @__PURE__ */
|
|
1390
|
+
const { setIsOpen: t, triggerRef: a } = Ae();
|
|
1391
|
+
return /* @__PURE__ */ s(
|
|
1331
1392
|
"button",
|
|
1332
1393
|
{
|
|
1333
1394
|
type: "button",
|
|
1334
|
-
ref:
|
|
1395
|
+
ref: a,
|
|
1335
1396
|
className: "dropdown__trigger",
|
|
1336
1397
|
onClick: () => t((l) => !l),
|
|
1337
1398
|
"aria-haspopup": "true",
|
|
@@ -1339,49 +1400,49 @@ const xt = ({
|
|
|
1339
1400
|
}
|
|
1340
1401
|
);
|
|
1341
1402
|
}, pt = ({ children: e }) => {
|
|
1342
|
-
const { isOpen: t, contentRef:
|
|
1343
|
-
return t ? /* @__PURE__ */
|
|
1344
|
-
}, ht = ({ children: e }) => /* @__PURE__ */
|
|
1345
|
-
const [l, n] = T(!1), [r, o] = T({}), u =
|
|
1403
|
+
const { isOpen: t, contentRef: a, styles: l } = Ae();
|
|
1404
|
+
return t ? /* @__PURE__ */ s("div", { ref: a, className: "dropdown__content", style: l, children: e }) : null;
|
|
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
|
-
}, []), /* @__PURE__ */
|
|
1439
|
+
}, []), /* @__PURE__ */ s(Re.Provider, { value: { isOpen: l, setIsOpen: n, triggerRef: i, contentRef: c, styles: r }, children: /* @__PURE__ */ s(
|
|
1379
1440
|
"div",
|
|
1380
1441
|
{
|
|
1381
1442
|
ref: u,
|
|
1382
1443
|
className: "dropdown",
|
|
1383
1444
|
title: e,
|
|
1384
|
-
children:
|
|
1445
|
+
children: a
|
|
1385
1446
|
}
|
|
1386
1447
|
) });
|
|
1387
1448
|
};
|
|
@@ -1390,65 +1451,65 @@ 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;
|
|
1398
|
-
}, He = ({ id: e, label: t, className:
|
|
1459
|
+
}, He = ({ id: e, label: t, className: a = "" }) => {
|
|
1399
1460
|
const { activeTab: l, setActiveTab: n, variant: r, orientation: o } = Ve(), u = l === e, i = [
|
|
1400
1461
|
"clarity-tab",
|
|
1401
|
-
|
|
1462
|
+
a,
|
|
1402
1463
|
u ? "active" : "",
|
|
1403
1464
|
u ? `variant-${r}` : "",
|
|
1404
1465
|
`orientation-${o}`
|
|
1405
1466
|
].filter(Boolean).join(" ");
|
|
1406
|
-
return /* @__PURE__ */
|
|
1467
|
+
return /* @__PURE__ */ s(
|
|
1407
1468
|
"button",
|
|
1408
1469
|
{
|
|
1409
1470
|
className: i,
|
|
1410
1471
|
onClick: () => n(e),
|
|
1411
1472
|
role: "tab",
|
|
1412
1473
|
"aria-selected": u,
|
|
1413
|
-
children: /* @__PURE__ */
|
|
1474
|
+
children: /* @__PURE__ */ s("span", { className: "clarity-tab-label", children: t })
|
|
1414
1475
|
}
|
|
1415
1476
|
);
|
|
1416
1477
|
};
|
|
1417
1478
|
He.displayName = "Tabs.Tab";
|
|
1418
|
-
const Me = ({ id: e, children: t, className:
|
|
1479
|
+
const Me = ({ id: e, children: t, className: a = "" }) => {
|
|
1419
1480
|
const { activeTab: l } = Ve(), n = l === e, r = {
|
|
1420
1481
|
visibility: n ? "visible" : "hidden",
|
|
1421
1482
|
gridArea: "1 / 1"
|
|
1422
1483
|
};
|
|
1423
|
-
return n || (r.pointerEvents = "none"), /* @__PURE__ */
|
|
1484
|
+
return n || (r.pointerEvents = "none"), /* @__PURE__ */ s("div", { className: `clarity-tab-content ${a}`, role: "tabpanel", style: r, children: t });
|
|
1424
1485
|
};
|
|
1425
1486
|
Me.displayName = "Tabs.Content";
|
|
1426
1487
|
const me = ({
|
|
1427
1488
|
children: e,
|
|
1428
1489
|
defaultTab: t,
|
|
1429
|
-
variant:
|
|
1490
|
+
variant: a = "primary",
|
|
1430
1491
|
orientation: l = "horizontal",
|
|
1431
1492
|
className: n = ""
|
|
1432
1493
|
}) => {
|
|
1433
1494
|
const [r, o] = T(t), u = Y(() => ({
|
|
1434
1495
|
activeTab: r,
|
|
1435
1496
|
setActiveTab: o,
|
|
1436
|
-
variant:
|
|
1497
|
+
variant: a,
|
|
1437
1498
|
orientation: l
|
|
1438
|
-
}), [r,
|
|
1499
|
+
}), [r, a, l]), i = [
|
|
1439
1500
|
"clarity-tabs-container",
|
|
1440
1501
|
n,
|
|
1441
1502
|
`orientation-${l}`
|
|
1442
1503
|
].filter(Boolean).join(" ");
|
|
1443
|
-
return /* @__PURE__ */
|
|
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
|
-
variant:
|
|
1512
|
+
variant: a = "primary",
|
|
1452
1513
|
product: l,
|
|
1453
1514
|
tone: n,
|
|
1454
1515
|
bgColor: r,
|
|
@@ -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__ */
|
|
1582
|
+
"aria-hidden": !h,
|
|
1583
|
+
children: /* @__PURE__ */ s("div", { className: I, children: e })
|
|
1523
1584
|
}
|
|
1524
1585
|
)
|
|
1525
1586
|
]
|
|
@@ -1533,32 +1594,32 @@ const jt = ({
|
|
|
1533
1594
|
}, Fe = ({
|
|
1534
1595
|
children: e,
|
|
1535
1596
|
className: t = "",
|
|
1536
|
-
variant:
|
|
1597
|
+
variant: a = "secondary",
|
|
1537
1598
|
emptyText: l = "No results found.",
|
|
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
|
-
`clarity-command--${
|
|
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,
|
|
1549
1610
|
setValue: c,
|
|
1550
|
-
variant:
|
|
1611
|
+
variant: a,
|
|
1551
1612
|
texts: {
|
|
1552
1613
|
empty: l,
|
|
1553
1614
|
inputPlaceholder: n
|
|
1554
1615
|
},
|
|
1555
|
-
isOpen:
|
|
1556
|
-
setIsOpen:
|
|
1557
|
-
}), [o, i,
|
|
1558
|
-
return /* @__PURE__ */
|
|
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
|
-
const Ge = ({ placeholder: e = "Search...", variant: t, onClick:
|
|
1622
|
+
const Ge = ({ placeholder: e = "Search...", variant: t, onClick: a }) => {
|
|
1562
1623
|
const { setIsOpen: l, variant: n } = ee(), [r, o] = T(!1);
|
|
1563
1624
|
O(() => {
|
|
1564
1625
|
o(/Mac|iPod|iPhone|iPad/.test(navigator.platform));
|
|
@@ -1567,11 +1628,11 @@ const Ge = ({ placeholder: e = "Search...", variant: t, onClick: s }) => {
|
|
|
1567
1628
|
"clarity-command-button",
|
|
1568
1629
|
`clarity-command-button--${t || n}`
|
|
1569
1630
|
].filter(Boolean).join(" ");
|
|
1570
|
-
return /* @__PURE__ */
|
|
1571
|
-
l(!0),
|
|
1631
|
+
return /* @__PURE__ */ w("button", { className: i, onClick: (m) => {
|
|
1632
|
+
l(!0), a == null || a(m);
|
|
1572
1633
|
}, children: [
|
|
1573
|
-
/* @__PURE__ */
|
|
1574
|
-
/* @__PURE__ */
|
|
1634
|
+
/* @__PURE__ */ s("span", { children: e }),
|
|
1635
|
+
/* @__PURE__ */ w("kbd", { className: "clarity-command-shortcut", children: [
|
|
1575
1636
|
r ? "⌘" : "Ctrl+",
|
|
1576
1637
|
"K"
|
|
1577
1638
|
] })
|
|
@@ -1579,17 +1640,17 @@ const Ge = ({ placeholder: e = "Search...", variant: t, onClick: s }) => {
|
|
|
1579
1640
|
};
|
|
1580
1641
|
Ge.displayName = "Command.Button";
|
|
1581
1642
|
const Ue = ({ children: e, ...t }) => {
|
|
1582
|
-
const { isOpen:
|
|
1643
|
+
const { isOpen: a, setIsOpen: l, variant: n } = ee();
|
|
1583
1644
|
return O(() => {
|
|
1584
1645
|
const r = (o) => {
|
|
1585
|
-
o.key === "k" && (o.metaKey || o.ctrlKey) && (o.preventDefault(), l(!
|
|
1646
|
+
o.key === "k" && (o.metaKey || o.ctrlKey) && (o.preventDefault(), l(!a));
|
|
1586
1647
|
};
|
|
1587
1648
|
return document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
|
|
1588
|
-
}, [
|
|
1649
|
+
}, [a, l]), /* @__PURE__ */ s(J, { isOpen: a, onClose: () => l(!1), size: "large", closeOnOverlayClick: !0, children: /* @__PURE__ */ s("div", { className: `clarity-command--${n}`, children: e }) });
|
|
1589
1650
|
};
|
|
1590
1651
|
Ue.displayName = "Command.Dialog";
|
|
1591
1652
|
const ze = ({ className: e = "", ...t }) => {
|
|
1592
|
-
const { searchTerm:
|
|
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());
|
|
@@ -1599,12 +1660,12 @@ const ze = ({ className: e = "", ...t }) => {
|
|
|
1599
1660
|
`clarity-command-input--${n}`,
|
|
1600
1661
|
e
|
|
1601
1662
|
].filter(Boolean).join(" ");
|
|
1602
|
-
return /* @__PURE__ */
|
|
1663
|
+
return /* @__PURE__ */ s("div", { className: "clarity-command-input__wrapper", children: /* @__PURE__ */ s(
|
|
1603
1664
|
"input",
|
|
1604
1665
|
{
|
|
1605
1666
|
ref: u,
|
|
1606
1667
|
className: i,
|
|
1607
|
-
value:
|
|
1668
|
+
value: a,
|
|
1608
1669
|
onChange: (c) => l(c.target.value),
|
|
1609
1670
|
placeholder: t.placeholder || r.inputPlaceholder,
|
|
1610
1671
|
...t
|
|
@@ -1612,55 +1673,55 @@ const ze = ({ className: e = "", ...t }) => {
|
|
|
1612
1673
|
) });
|
|
1613
1674
|
};
|
|
1614
1675
|
ze.displayName = "Command.Input";
|
|
1615
|
-
const qe = ({ children: e, className: t = "", ...
|
|
1676
|
+
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
|
-
!n && /* @__PURE__ */
|
|
1695
|
+
!n && /* @__PURE__ */ s(ue, {})
|
|
1635
1696
|
] });
|
|
1636
1697
|
};
|
|
1637
1698
|
qe.displayName = "Command.List";
|
|
1638
|
-
const ue = ({ children: e, className: t = "", ...
|
|
1699
|
+
const ue = ({ children: e, className: t = "", ...a }) => {
|
|
1639
1700
|
const { texts: l } = ee(), n = ["clarity-command-empty", t].filter(Boolean).join(" ");
|
|
1640
|
-
return /* @__PURE__ */
|
|
1701
|
+
return /* @__PURE__ */ s("div", { className: n, ...a, children: e || a.emptyText || l.empty });
|
|
1641
1702
|
};
|
|
1642
1703
|
ue.displayName = "Command.Empty";
|
|
1643
|
-
const Je = ({ children: e, className: t = "", ...
|
|
1704
|
+
const Je = ({ children: e, className: t = "", ...a }) => {
|
|
1644
1705
|
const l = ["clarity-command-group", t].filter(Boolean).join(" ");
|
|
1645
|
-
return /* @__PURE__ */
|
|
1706
|
+
return /* @__PURE__ */ s("div", { className: l, ...a, children: e });
|
|
1646
1707
|
};
|
|
1647
1708
|
Je.displayName = "Command.Group";
|
|
1648
|
-
const Qe = ({ children: e, className: t = "", ...
|
|
1709
|
+
const Qe = ({ children: e, className: t = "", ...a }) => {
|
|
1649
1710
|
const { setValue: l, variant: n } = ee(), r = ["clarity-command-item", `clarity-command-item--${n}`, t].filter(Boolean).join(" ");
|
|
1650
|
-
return /* @__PURE__ */
|
|
1711
|
+
return /* @__PURE__ */ s("div", { className: r, onClick: () => l((e == null ? void 0 : e.toString()) || ""), ...a, children: e });
|
|
1651
1712
|
};
|
|
1652
1713
|
Qe.displayName = "Command.Item";
|
|
1653
1714
|
const Xe = ({ className: e = "", ...t }) => {
|
|
1654
|
-
const
|
|
1655
|
-
return /* @__PURE__ */
|
|
1715
|
+
const a = ["clarity-command-separator", e].filter(Boolean).join(" ");
|
|
1716
|
+
return /* @__PURE__ */ s("hr", { className: a, ...t });
|
|
1656
1717
|
};
|
|
1657
1718
|
Xe.displayName = "Command.Separator";
|
|
1658
|
-
const Ye = ({ children: e, className: t = "", ...
|
|
1719
|
+
const Ye = ({ children: e, className: t = "", ...a }) => {
|
|
1659
1720
|
const l = ["clarity-command-shortcut", t].filter(Boolean).join(" ");
|
|
1660
|
-
return /* @__PURE__ */
|
|
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,
|
|
@@ -1671,93 +1732,93 @@ const Lt = Object.assign(Fe, {
|
|
|
1671
1732
|
Separator: Xe,
|
|
1672
1733
|
Shortcut: Ye
|
|
1673
1734
|
}), Ct = ({ columns: e, viewMode: t }) => {
|
|
1674
|
-
const
|
|
1675
|
-
return t === "card" ? /* @__PURE__ */
|
|
1676
|
-
/* @__PURE__ */
|
|
1677
|
-
/* @__PURE__ */
|
|
1678
|
-
] }) : /* @__PURE__ */
|
|
1679
|
-
/* @__PURE__ */
|
|
1680
|
-
/* @__PURE__ */
|
|
1735
|
+
const a = Array.from({ length: 5 }, (l, n) => n);
|
|
1736
|
+
return t === "card" ? /* @__PURE__ */ w("div", { className: "card-view-wrapper is-loading", children: [
|
|
1737
|
+
/* @__PURE__ */ s("div", { className: "skeleton card-view-header" }),
|
|
1738
|
+
/* @__PURE__ */ s("div", { className: "card-view-body", children: a.map((l) => /* @__PURE__ */ s("div", { className: "skeleton card-view-row" }, l)) })
|
|
1739
|
+
] }) : /* @__PURE__ */ s("div", { className: "table-wrapper is-loading", children: /* @__PURE__ */ w("table", { children: [
|
|
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)) }) }),
|
|
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
|
-
data:
|
|
1746
|
+
data: a,
|
|
1686
1747
|
viewMode: l = "table",
|
|
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
|
-
}), [
|
|
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
|
-
return /* @__PURE__ */
|
|
1698
|
-
const
|
|
1699
|
-
return l === "card" ? /* @__PURE__ */
|
|
1700
|
-
/* @__PURE__ */
|
|
1758
|
+
return /* @__PURE__ */ s(Ct, { columns: t, viewMode: l });
|
|
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__ */
|
|
1714
|
-
] }) : /* @__PURE__ */
|
|
1715
|
-
/* @__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__ */
|
|
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
|
-
tone:
|
|
1794
|
+
tone: a,
|
|
1734
1795
|
size: l = "medium",
|
|
1735
1796
|
color: n,
|
|
1736
1797
|
className: r = "",
|
|
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,
|
|
1754
|
-
children: /* @__PURE__ */
|
|
1815
|
+
children: /* @__PURE__ */ s("div", { className: `${i}__container`, children: /* @__PURE__ */ s(
|
|
1755
1816
|
"svg",
|
|
1756
1817
|
{
|
|
1757
1818
|
className: `${i}__svg`,
|
|
1758
1819
|
viewBox: "0 0 50 50",
|
|
1759
1820
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1760
|
-
children: /* @__PURE__ */
|
|
1821
|
+
children: /* @__PURE__ */ s(
|
|
1761
1822
|
"circle",
|
|
1762
1823
|
{
|
|
1763
1824
|
className: `${i}__circle`,
|
|
@@ -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
|
};
|