beth-clarity 1.1.18 → 1.1.19
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,7 +1,7 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { jsx as a, jsxs as w, Fragment as ot } from "react/jsx-runtime";
|
|
2
|
+
import E, { useState as T, useRef as M, useEffect as D, forwardRef as ct, isValidElement as se, createContext as Q, cloneElement as z, useContext as Z, useMemo as te, useCallback as ce, useLayoutEffect as dt } from "react";
|
|
3
|
+
import mt from "react-dom";
|
|
4
|
+
const Dt = ({
|
|
5
5
|
variant: e = "primary",
|
|
6
6
|
product: t,
|
|
7
7
|
tone: s,
|
|
@@ -9,24 +9,24 @@ const xt = ({
|
|
|
9
9
|
bgColor: l,
|
|
10
10
|
textColor: i,
|
|
11
11
|
children: d,
|
|
12
|
-
className:
|
|
12
|
+
className: o = "",
|
|
13
13
|
rounded: r = !1,
|
|
14
|
-
outlined:
|
|
15
|
-
...
|
|
14
|
+
outlined: c = !1,
|
|
15
|
+
...p
|
|
16
16
|
}) => {
|
|
17
17
|
const v = "clarity-badge", m = !!l, f = t && s && !m;
|
|
18
|
-
let
|
|
19
|
-
m ?
|
|
18
|
+
let u = "";
|
|
19
|
+
m ? u = `${v}--custom-bg` : f ? u = `${v}--custom` : u = `${v}--${e}`;
|
|
20
20
|
const h = [
|
|
21
21
|
v,
|
|
22
|
-
|
|
22
|
+
u,
|
|
23
23
|
`${v}--${n}`,
|
|
24
24
|
r ? `${v}--rounded` : "",
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
c ? `${v}--outlined` : "",
|
|
26
|
+
o
|
|
27
27
|
].filter(Boolean).join(" "), y = {};
|
|
28
28
|
m && (y.backgroundColor = l, i && (y.color = i));
|
|
29
|
-
const
|
|
29
|
+
const b = f && t && s ? {
|
|
30
30
|
"--custom-bg-color": `var(--clarity-${t}-${s})`,
|
|
31
31
|
"--custom-text-color": s && parseInt(s) >= 500 ? "white" : `var(--clarity-${t}-800)`
|
|
32
32
|
} : {};
|
|
@@ -36,13 +36,13 @@ const xt = ({
|
|
|
36
36
|
className: h,
|
|
37
37
|
style: {
|
|
38
38
|
...y,
|
|
39
|
-
...
|
|
39
|
+
...b
|
|
40
40
|
},
|
|
41
|
-
...
|
|
41
|
+
...p,
|
|
42
42
|
children: d
|
|
43
43
|
}
|
|
44
44
|
);
|
|
45
|
-
},
|
|
45
|
+
}, At = ({
|
|
46
46
|
variant: e = "primary",
|
|
47
47
|
size: t = "medium",
|
|
48
48
|
disabled: s = !1,
|
|
@@ -50,25 +50,25 @@ const xt = ({
|
|
|
50
50
|
children: l,
|
|
51
51
|
onClick: i,
|
|
52
52
|
type: d = "button",
|
|
53
|
-
className:
|
|
53
|
+
className: o = "",
|
|
54
54
|
title: r,
|
|
55
|
-
customColor:
|
|
56
|
-
customColorHover:
|
|
55
|
+
customColor: c,
|
|
56
|
+
customColorHover: p,
|
|
57
57
|
...v
|
|
58
58
|
}) => {
|
|
59
59
|
const m = "clarity-button", f = [
|
|
60
60
|
m,
|
|
61
|
-
!
|
|
61
|
+
!c && `${m}--${e}`,
|
|
62
62
|
`${m}--${t}`,
|
|
63
63
|
n && `${m}--loading`,
|
|
64
64
|
s && `${m}--disabled`,
|
|
65
|
-
|
|
66
|
-
].filter(Boolean).join(" "),
|
|
67
|
-
return
|
|
65
|
+
o
|
|
66
|
+
].filter(Boolean).join(" "), u = {};
|
|
67
|
+
return c && (u["--button-bg"] = c, u["--button-hover-bg"] = p || `${c}E6`, u["--button-border"] = c, u["--button-hover-border"] = p || `${c}E6`, u["--button-fg"] = "#fff"), /* @__PURE__ */ w(
|
|
68
68
|
"button",
|
|
69
69
|
{
|
|
70
70
|
className: f,
|
|
71
|
-
style:
|
|
71
|
+
style: u,
|
|
72
72
|
disabled: s || n,
|
|
73
73
|
onClick: i,
|
|
74
74
|
type: d,
|
|
@@ -80,7 +80,7 @@ const xt = ({
|
|
|
80
80
|
]
|
|
81
81
|
}
|
|
82
82
|
);
|
|
83
|
-
},
|
|
83
|
+
}, Pt = ({
|
|
84
84
|
variant: e = "primary",
|
|
85
85
|
size: t = "medium",
|
|
86
86
|
filled: s = !0,
|
|
@@ -88,52 +88,52 @@ const xt = ({
|
|
|
88
88
|
value: l,
|
|
89
89
|
multiple: i = !1,
|
|
90
90
|
disabled: d = !1,
|
|
91
|
-
onChange:
|
|
91
|
+
onChange: o,
|
|
92
92
|
className: r = "",
|
|
93
|
-
...
|
|
93
|
+
...c
|
|
94
94
|
}) => {
|
|
95
|
-
const
|
|
96
|
-
|
|
95
|
+
const p = "clarity-button-group", v = `${p}--${e}`, m = [
|
|
96
|
+
p,
|
|
97
97
|
v,
|
|
98
|
-
`${
|
|
99
|
-
!s && `${
|
|
100
|
-
d && `${
|
|
98
|
+
`${p}--${t}`,
|
|
99
|
+
!s && `${p}--outline`,
|
|
100
|
+
d && `${p}--disabled`,
|
|
101
101
|
r
|
|
102
102
|
].filter(Boolean).join(" "), f = (h) => {
|
|
103
|
-
if (d || !
|
|
104
|
-
const y = n.find((
|
|
103
|
+
if (d || !o) return;
|
|
104
|
+
const y = n.find((b) => b.id === h);
|
|
105
105
|
if (!(y != null && y.disabled))
|
|
106
106
|
if (i) {
|
|
107
|
-
const
|
|
108
|
-
|
|
107
|
+
const b = Array.isArray(l) ? l : [], N = b.includes(h) ? b.filter((B) => B !== h) : [...b, h];
|
|
108
|
+
o(N);
|
|
109
109
|
} else
|
|
110
|
-
|
|
111
|
-
},
|
|
110
|
+
o(h);
|
|
111
|
+
}, u = (h) => i ? Array.isArray(l) && l.includes(h) : l === h;
|
|
112
112
|
return /* @__PURE__ */ a(
|
|
113
113
|
"div",
|
|
114
114
|
{
|
|
115
115
|
className: m,
|
|
116
116
|
role: "group",
|
|
117
|
-
...
|
|
117
|
+
...c,
|
|
118
118
|
children: n.map((h, y) => {
|
|
119
|
-
const
|
|
120
|
-
`${
|
|
121
|
-
|
|
122
|
-
h.disabled && `${
|
|
123
|
-
y === 0 && `${
|
|
124
|
-
y === n.length - 1 && `${
|
|
119
|
+
const b = u(h.id), N = [
|
|
120
|
+
`${p}__item`,
|
|
121
|
+
b && `${p}__item--selected`,
|
|
122
|
+
h.disabled && `${p}__item--disabled`,
|
|
123
|
+
y === 0 && `${p}__item--first`,
|
|
124
|
+
y === n.length - 1 && `${p}__item--last`
|
|
125
125
|
].filter(Boolean).join(" ");
|
|
126
|
-
return /* @__PURE__ */
|
|
126
|
+
return /* @__PURE__ */ w(
|
|
127
127
|
"button",
|
|
128
128
|
{
|
|
129
|
-
className:
|
|
129
|
+
className: N,
|
|
130
130
|
onClick: () => f(h.id),
|
|
131
131
|
disabled: d || h.disabled,
|
|
132
132
|
type: "button",
|
|
133
|
-
"aria-pressed":
|
|
133
|
+
"aria-pressed": b,
|
|
134
134
|
children: [
|
|
135
|
-
h.icon && /* @__PURE__ */ a("span", { className: `${
|
|
136
|
-
/* @__PURE__ */ a("span", { className: `${
|
|
135
|
+
h.icon && /* @__PURE__ */ a("span", { className: `${p}__item-icon`, children: h.icon }),
|
|
136
|
+
/* @__PURE__ */ a("span", { className: `${p}__item-label`, children: h.label })
|
|
137
137
|
]
|
|
138
138
|
},
|
|
139
139
|
h.id
|
|
@@ -141,7 +141,7 @@ const xt = ({
|
|
|
141
141
|
})
|
|
142
142
|
}
|
|
143
143
|
);
|
|
144
|
-
},
|
|
144
|
+
}, ut = E.forwardRef(({
|
|
145
145
|
variant: e,
|
|
146
146
|
size: t = "medium",
|
|
147
147
|
label: s,
|
|
@@ -149,63 +149,63 @@ const xt = ({
|
|
|
149
149
|
error: l = !1,
|
|
150
150
|
errorMessage: i,
|
|
151
151
|
startIcon: d,
|
|
152
|
-
endIcon:
|
|
152
|
+
endIcon: o,
|
|
153
153
|
className: r = "",
|
|
154
|
-
disabled:
|
|
155
|
-
value:
|
|
154
|
+
disabled: c = !1,
|
|
155
|
+
value: p,
|
|
156
156
|
defaultValue: v,
|
|
157
157
|
onFocus: m,
|
|
158
158
|
onBlur: f,
|
|
159
|
-
...
|
|
159
|
+
...u
|
|
160
160
|
}, h) => {
|
|
161
|
-
const [y,
|
|
162
|
-
|
|
163
|
-
const k =
|
|
164
|
-
k &&
|
|
165
|
-
}, [
|
|
166
|
-
const
|
|
167
|
-
|
|
161
|
+
const [y, b] = T(!1), [N, B] = T(!1), x = M(null);
|
|
162
|
+
E.useImperativeHandle(h, () => x.current), D(() => {
|
|
163
|
+
const k = x.current;
|
|
164
|
+
k && B(k.value.length > 0);
|
|
165
|
+
}, [p, v]);
|
|
166
|
+
const _ = (k) => {
|
|
167
|
+
b(!0), m == null || m(k);
|
|
168
168
|
}, $ = (k) => {
|
|
169
|
-
|
|
169
|
+
b(!1), B(k.target.value.length > 0), f == null || f(k);
|
|
170
170
|
}, L = [
|
|
171
171
|
"clarity-input",
|
|
172
172
|
"clarity-input--outlined",
|
|
173
173
|
`clarity-input--${t}`,
|
|
174
174
|
e && `clarity-input--${e}`,
|
|
175
175
|
l && "clarity-input--error",
|
|
176
|
-
|
|
176
|
+
c && "clarity-input--disabled",
|
|
177
177
|
y && "clarity-input--focused",
|
|
178
|
-
|
|
178
|
+
N && "clarity-input--has-value",
|
|
179
179
|
d && "clarity-input--with-start-icon",
|
|
180
|
-
|
|
180
|
+
o && "clarity-input--with-end-icon",
|
|
181
181
|
r
|
|
182
182
|
].filter(Boolean).join(" ");
|
|
183
|
-
return /* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */
|
|
183
|
+
return /* @__PURE__ */ w("div", { className: "clarity-input-wrapper", children: [
|
|
184
|
+
/* @__PURE__ */ w("div", { className: L, children: [
|
|
185
185
|
d && /* @__PURE__ */ a("div", { className: "clarity-input__start-icon", children: d }),
|
|
186
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ w("div", { className: "clarity-input__field", children: [
|
|
187
187
|
/* @__PURE__ */ a(
|
|
188
188
|
"input",
|
|
189
189
|
{
|
|
190
|
-
ref:
|
|
190
|
+
ref: x,
|
|
191
191
|
className: "clarity-input__element",
|
|
192
|
-
disabled:
|
|
193
|
-
value:
|
|
192
|
+
disabled: c,
|
|
193
|
+
value: p,
|
|
194
194
|
defaultValue: v,
|
|
195
|
-
onFocus:
|
|
195
|
+
onFocus: _,
|
|
196
196
|
onBlur: $,
|
|
197
|
-
...
|
|
197
|
+
...u
|
|
198
198
|
}
|
|
199
199
|
),
|
|
200
200
|
s && /* @__PURE__ */ a("label", { className: "clarity-input__label", children: s })
|
|
201
201
|
] }),
|
|
202
|
-
|
|
202
|
+
o && /* @__PURE__ */ a("div", { className: "clarity-input__end-icon", children: o })
|
|
203
203
|
] }),
|
|
204
204
|
(n || l && i) && /* @__PURE__ */ a("div", { className: "clarity-input__helper-text", children: l && i ? i : n })
|
|
205
205
|
] });
|
|
206
206
|
});
|
|
207
|
-
|
|
208
|
-
const
|
|
207
|
+
ut.displayName = "Input";
|
|
208
|
+
const pt = E.forwardRef(({
|
|
209
209
|
variant: e,
|
|
210
210
|
size: t = "medium",
|
|
211
211
|
label: s,
|
|
@@ -213,73 +213,73 @@ const at = B.forwardRef(({
|
|
|
213
213
|
error: l = !1,
|
|
214
214
|
errorMessage: i,
|
|
215
215
|
startIcon: d,
|
|
216
|
-
endIcon:
|
|
216
|
+
endIcon: o,
|
|
217
217
|
className: r = "",
|
|
218
|
-
disabled:
|
|
219
|
-
value:
|
|
218
|
+
disabled: c = !1,
|
|
219
|
+
value: p,
|
|
220
220
|
defaultValue: v,
|
|
221
221
|
onFocus: m,
|
|
222
222
|
onBlur: f,
|
|
223
|
-
rows:
|
|
223
|
+
rows: u = 3,
|
|
224
224
|
minHeight: h,
|
|
225
225
|
maxHeight: y,
|
|
226
|
-
resizable:
|
|
227
|
-
...
|
|
228
|
-
},
|
|
229
|
-
const [
|
|
230
|
-
|
|
226
|
+
resizable: b = !0,
|
|
227
|
+
...N
|
|
228
|
+
}, B) => {
|
|
229
|
+
const [x, _] = T(!1), [$, L] = T(!1), k = M(null);
|
|
230
|
+
E.useImperativeHandle(B, () => k.current), D(() => {
|
|
231
231
|
const g = k.current;
|
|
232
232
|
g && L(g.value.length > 0);
|
|
233
|
-
}, [
|
|
234
|
-
const
|
|
235
|
-
|
|
233
|
+
}, [p, v]);
|
|
234
|
+
const j = (g) => {
|
|
235
|
+
_(!0), m == null || m(g);
|
|
236
236
|
}, I = (g) => {
|
|
237
|
-
|
|
237
|
+
_(!1), L(g.target.value.length > 0), f == null || f(g);
|
|
238
238
|
}, A = [
|
|
239
239
|
"clarity-textarea",
|
|
240
240
|
"clarity-textarea--outlined",
|
|
241
241
|
`clarity-textarea--${t}`,
|
|
242
242
|
e && `clarity-textarea--${e}`,
|
|
243
243
|
l && "clarity-textarea--error",
|
|
244
|
-
|
|
245
|
-
|
|
244
|
+
c && "clarity-textarea--disabled",
|
|
245
|
+
x && "clarity-textarea--focused",
|
|
246
246
|
$ && "clarity-textarea--has-value",
|
|
247
247
|
d && "clarity-textarea--with-start-icon",
|
|
248
|
-
|
|
248
|
+
o && "clarity-textarea--with-end-icon",
|
|
249
249
|
r
|
|
250
250
|
].filter(Boolean).join(" "), O = {
|
|
251
|
-
resize:
|
|
251
|
+
resize: b ? "vertical" : "none",
|
|
252
252
|
minHeight: h ? `${h}px` : void 0,
|
|
253
253
|
maxHeight: y ? `${y}px` : void 0
|
|
254
254
|
};
|
|
255
|
-
return /* @__PURE__ */
|
|
256
|
-
/* @__PURE__ */
|
|
255
|
+
return /* @__PURE__ */ w("div", { className: "clarity-textarea-wrapper", children: [
|
|
256
|
+
/* @__PURE__ */ w("div", { className: A, children: [
|
|
257
257
|
d && /* @__PURE__ */ a("div", { className: "clarity-textarea__start-icon", children: d }),
|
|
258
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ w("div", { className: "clarity-textarea__field", children: [
|
|
259
259
|
/* @__PURE__ */ a(
|
|
260
260
|
"textarea",
|
|
261
261
|
{
|
|
262
262
|
ref: k,
|
|
263
263
|
className: "clarity-textarea__element",
|
|
264
|
-
disabled:
|
|
265
|
-
value:
|
|
264
|
+
disabled: c,
|
|
265
|
+
value: p,
|
|
266
266
|
defaultValue: v,
|
|
267
|
-
onFocus:
|
|
267
|
+
onFocus: j,
|
|
268
268
|
onBlur: I,
|
|
269
|
-
rows:
|
|
269
|
+
rows: u,
|
|
270
270
|
style: O,
|
|
271
|
-
...
|
|
271
|
+
...N
|
|
272
272
|
}
|
|
273
273
|
),
|
|
274
274
|
s && /* @__PURE__ */ a("label", { className: "clarity-textarea__label", children: s })
|
|
275
275
|
] }),
|
|
276
|
-
|
|
276
|
+
o && /* @__PURE__ */ a("div", { className: "clarity-textarea__end-icon", children: o })
|
|
277
277
|
] }),
|
|
278
278
|
(n || l && i) && /* @__PURE__ */ a("div", { className: "clarity-textarea__helper-text", children: l && i ? i : n })
|
|
279
279
|
] });
|
|
280
280
|
});
|
|
281
|
-
|
|
282
|
-
const
|
|
281
|
+
pt.displayName = "Textarea";
|
|
282
|
+
const ft = E.forwardRef(({
|
|
283
283
|
variant: e,
|
|
284
284
|
size: t = "medium",
|
|
285
285
|
label: s,
|
|
@@ -287,99 +287,99 @@ const nt = B.forwardRef(({
|
|
|
287
287
|
error: l = !1,
|
|
288
288
|
errorMessage: i,
|
|
289
289
|
startIcon: d,
|
|
290
|
-
endIcon:
|
|
290
|
+
endIcon: o,
|
|
291
291
|
className: r = "",
|
|
292
|
-
disabled:
|
|
293
|
-
value:
|
|
292
|
+
disabled: c = !1,
|
|
293
|
+
value: p,
|
|
294
294
|
defaultValue: v,
|
|
295
295
|
onFocus: m,
|
|
296
296
|
onBlur: f,
|
|
297
|
-
onChange:
|
|
297
|
+
onChange: u,
|
|
298
298
|
options: h,
|
|
299
299
|
placeholder: y = "Selecione uma opção",
|
|
300
|
-
isClearable:
|
|
301
|
-
isSearchable:
|
|
302
|
-
...
|
|
303
|
-
},
|
|
304
|
-
const [
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}, [
|
|
308
|
-
const
|
|
309
|
-
g.current && !g.current.contains(
|
|
300
|
+
isClearable: b = !1,
|
|
301
|
+
isSearchable: N = !1,
|
|
302
|
+
...B
|
|
303
|
+
}, x) => {
|
|
304
|
+
const [_, $] = T(!1), [L, k] = T(!1), [j, I] = T(p || v || ""), [A, O] = T(""), g = M(null), V = M(null);
|
|
305
|
+
E.useImperativeHandle(x, () => g.current), D(() => {
|
|
306
|
+
p !== void 0 && I(p);
|
|
307
|
+
}, [p]), D(() => {
|
|
308
|
+
const C = (S) => {
|
|
309
|
+
g.current && !g.current.contains(S.target) && ($(!1), k(!1), f == null || f());
|
|
310
310
|
};
|
|
311
|
-
return document.addEventListener("mousedown",
|
|
311
|
+
return document.addEventListener("mousedown", C), () => document.removeEventListener("mousedown", C);
|
|
312
312
|
}, [f]);
|
|
313
|
-
const
|
|
314
|
-
(
|
|
315
|
-
) : h,
|
|
316
|
-
|
|
317
|
-
var
|
|
318
|
-
(
|
|
313
|
+
const H = N && A ? h.filter(
|
|
314
|
+
(C) => C.label.toLowerCase().includes(A.toLowerCase())
|
|
315
|
+
) : h, W = () => {
|
|
316
|
+
c || ($(!_), k(!_), _ ? (f == null || f(), N && O("")) : (m == null || m(), N && setTimeout(() => {
|
|
317
|
+
var C;
|
|
318
|
+
(C = V.current) == null || C.focus();
|
|
319
319
|
}, 0)));
|
|
320
|
-
},
|
|
321
|
-
|
|
322
|
-
},
|
|
323
|
-
O(
|
|
324
|
-
},
|
|
325
|
-
|
|
326
|
-
},
|
|
327
|
-
|
|
328
|
-
}, re =
|
|
320
|
+
}, q = (C) => {
|
|
321
|
+
C.disabled || (I(C.value), $(!1), k(!1), O(""), u == null || u(C.value), f == null || f());
|
|
322
|
+
}, X = (C) => {
|
|
323
|
+
O(C.target.value);
|
|
324
|
+
}, F = (C) => {
|
|
325
|
+
C.key === "Escape" ? ($(!1), k(!1), O("")) : C.key === "Enter" && H.length > 0 && H[0] && q(H[0]);
|
|
326
|
+
}, P = h.find((C) => C.value === j), Y = j !== "" && j !== void 0, le = (C) => {
|
|
327
|
+
C.stopPropagation(), I(""), u == null || u("");
|
|
328
|
+
}, re = Y || L || y || N && A, ie = [
|
|
329
329
|
"clarity-select",
|
|
330
330
|
"clarity-select--outlined",
|
|
331
331
|
`clarity-select--${t}`,
|
|
332
332
|
e && `clarity-select--${e}`,
|
|
333
333
|
l && "clarity-select--error",
|
|
334
|
-
|
|
335
|
-
(L ||
|
|
334
|
+
c && "clarity-select--disabled",
|
|
335
|
+
(L || _) && "clarity-select--focused",
|
|
336
336
|
re && "clarity-select--label-up",
|
|
337
|
-
|
|
338
|
-
|
|
337
|
+
_ && "clarity-select--open",
|
|
338
|
+
N && "clarity-select--searchable",
|
|
339
339
|
d && "clarity-select--with-start-icon",
|
|
340
|
-
(
|
|
340
|
+
(o || b) && "clarity-select--with-end-icon",
|
|
341
341
|
r
|
|
342
342
|
].filter(Boolean).join(" ");
|
|
343
|
-
return /* @__PURE__ */
|
|
344
|
-
/* @__PURE__ */
|
|
343
|
+
return /* @__PURE__ */ w("div", { className: "clarity-select-wrapper", children: [
|
|
344
|
+
/* @__PURE__ */ w(
|
|
345
345
|
"div",
|
|
346
346
|
{
|
|
347
347
|
ref: g,
|
|
348
|
-
className:
|
|
349
|
-
onClick:
|
|
348
|
+
className: ie,
|
|
349
|
+
onClick: N ? void 0 : W,
|
|
350
350
|
role: "combobox",
|
|
351
|
-
"aria-expanded":
|
|
351
|
+
"aria-expanded": _,
|
|
352
352
|
"aria-haspopup": "listbox",
|
|
353
|
-
tabIndex:
|
|
354
|
-
...
|
|
353
|
+
tabIndex: c || N ? -1 : 0,
|
|
354
|
+
...B,
|
|
355
355
|
children: [
|
|
356
356
|
d && /* @__PURE__ */ a("div", { className: "clarity-select__start-icon", children: d }),
|
|
357
|
-
/* @__PURE__ */
|
|
358
|
-
|
|
357
|
+
/* @__PURE__ */ w("div", { className: "clarity-select__field", children: [
|
|
358
|
+
N ? /* @__PURE__ */ a(
|
|
359
359
|
"input",
|
|
360
360
|
{
|
|
361
|
-
ref:
|
|
361
|
+
ref: V,
|
|
362
362
|
type: "text",
|
|
363
363
|
className: "clarity-select__search-input",
|
|
364
|
-
value:
|
|
365
|
-
onChange:
|
|
366
|
-
onKeyDown:
|
|
364
|
+
value: _ ? A : P ? P.label : "",
|
|
365
|
+
onChange: X,
|
|
366
|
+
onKeyDown: F,
|
|
367
367
|
onFocus: () => {
|
|
368
|
-
|
|
368
|
+
_ || ($(!0), k(!0), m == null || m());
|
|
369
369
|
},
|
|
370
|
-
placeholder:
|
|
371
|
-
disabled:
|
|
372
|
-
readOnly: !
|
|
370
|
+
placeholder: P ? P.label : y,
|
|
371
|
+
disabled: c,
|
|
372
|
+
readOnly: !_
|
|
373
373
|
}
|
|
374
|
-
) : /* @__PURE__ */ a("div", { className: "clarity-select__display", children:
|
|
374
|
+
) : /* @__PURE__ */ a("div", { className: "clarity-select__display", children: P ? P.label : y }),
|
|
375
375
|
s && /* @__PURE__ */ a("label", { className: "clarity-select__label", children: s })
|
|
376
376
|
] }),
|
|
377
|
-
|
|
377
|
+
b && Y && /* @__PURE__ */ a(
|
|
378
378
|
"button",
|
|
379
379
|
{
|
|
380
380
|
type: "button",
|
|
381
381
|
className: "clarity-select__clear-button",
|
|
382
|
-
onClick:
|
|
382
|
+
onClick: le,
|
|
383
383
|
"aria-label": "Limpar seleção",
|
|
384
384
|
children: /* @__PURE__ */ a(
|
|
385
385
|
"svg",
|
|
@@ -406,8 +406,8 @@ const nt = B.forwardRef(({
|
|
|
406
406
|
"div",
|
|
407
407
|
{
|
|
408
408
|
className: "clarity-select__end-icon",
|
|
409
|
-
onClick:
|
|
410
|
-
children:
|
|
409
|
+
onClick: N ? W : void 0,
|
|
410
|
+
children: o || /* @__PURE__ */ a(
|
|
411
411
|
"svg",
|
|
412
412
|
{
|
|
413
413
|
className: "clarity-select__arrow",
|
|
@@ -429,20 +429,20 @@ const nt = B.forwardRef(({
|
|
|
429
429
|
)
|
|
430
430
|
}
|
|
431
431
|
),
|
|
432
|
-
|
|
432
|
+
_ && /* @__PURE__ */ a("div", { className: "clarity-select__dropdown", children: /* @__PURE__ */ a("ul", { className: "clarity-select__options", role: "listbox", children: H.length > 0 ? H.map((C) => /* @__PURE__ */ a(
|
|
433
433
|
"li",
|
|
434
434
|
{
|
|
435
435
|
className: [
|
|
436
436
|
"clarity-select__option",
|
|
437
|
-
|
|
438
|
-
|
|
437
|
+
C.disabled && "clarity-select__option--disabled",
|
|
438
|
+
j === C.value && "clarity-select__option--selected"
|
|
439
439
|
].filter(Boolean).join(" "),
|
|
440
|
-
onClick: () =>
|
|
440
|
+
onClick: () => q(C),
|
|
441
441
|
role: "option",
|
|
442
|
-
"aria-selected":
|
|
443
|
-
children:
|
|
442
|
+
"aria-selected": j === C.value,
|
|
443
|
+
children: C.label
|
|
444
444
|
},
|
|
445
|
-
|
|
445
|
+
C.value
|
|
446
446
|
)) : /* @__PURE__ */ a("li", { className: "clarity-select__option clarity-select__option--no-results", children: "Nenhum resultado encontrado" }) }) })
|
|
447
447
|
]
|
|
448
448
|
}
|
|
@@ -450,8 +450,8 @@ const nt = B.forwardRef(({
|
|
|
450
450
|
(n || l && i) && /* @__PURE__ */ a("div", { className: "clarity-select__helper-text", children: l && i ? i : n })
|
|
451
451
|
] });
|
|
452
452
|
});
|
|
453
|
-
|
|
454
|
-
const
|
|
453
|
+
ft.displayName = "Select";
|
|
454
|
+
const ht = ct(({
|
|
455
455
|
options: e = [],
|
|
456
456
|
value: t = [],
|
|
457
457
|
onChange: s,
|
|
@@ -459,118 +459,118 @@ const lt = Ke(({
|
|
|
459
459
|
label: l,
|
|
460
460
|
helperText: i,
|
|
461
461
|
error: d = !1,
|
|
462
|
-
errorMessage:
|
|
462
|
+
errorMessage: o,
|
|
463
463
|
disabled: r = !1,
|
|
464
|
-
variant:
|
|
465
|
-
size:
|
|
464
|
+
variant: c = "primary",
|
|
465
|
+
size: p = "medium",
|
|
466
466
|
maxSelectedLabels: v = 3,
|
|
467
467
|
selectionLimit: m,
|
|
468
468
|
className: f = "",
|
|
469
|
-
id:
|
|
469
|
+
id: u,
|
|
470
470
|
name: h,
|
|
471
471
|
required: y = !1,
|
|
472
|
-
"data-testid":
|
|
473
|
-
...
|
|
474
|
-
},
|
|
475
|
-
const [
|
|
476
|
-
I.current =
|
|
472
|
+
"data-testid": b,
|
|
473
|
+
...N
|
|
474
|
+
}, B) => {
|
|
475
|
+
const [x, _] = T(!1), [$, L] = T(""), [k, j] = T(!1), I = M(null), A = M(null), O = M(null), g = (C) => {
|
|
476
|
+
I.current = C, B && (typeof B == "function" ? B(C) : B.current = C);
|
|
477
477
|
};
|
|
478
|
-
|
|
479
|
-
const
|
|
480
|
-
I.current && !I.current.contains(
|
|
478
|
+
D(() => {
|
|
479
|
+
const C = (S) => {
|
|
480
|
+
I.current && !I.current.contains(S.target) && (_(!1), j(!1), L(""));
|
|
481
481
|
};
|
|
482
|
-
return document.addEventListener("click",
|
|
482
|
+
return document.addEventListener("click", C), () => document.removeEventListener("click", C);
|
|
483
483
|
}, []);
|
|
484
|
-
const
|
|
485
|
-
(
|
|
486
|
-
),
|
|
487
|
-
r || (
|
|
488
|
-
var
|
|
489
|
-
(
|
|
484
|
+
const V = e.filter(
|
|
485
|
+
(C) => C.label.toLowerCase().includes($.toLowerCase())
|
|
486
|
+
), H = () => {
|
|
487
|
+
r || (_(!x), j(!x), x ? L("") : setTimeout(() => {
|
|
488
|
+
var C;
|
|
489
|
+
(C = A.current) == null || C.focus();
|
|
490
490
|
}, 100));
|
|
491
|
-
},
|
|
491
|
+
}, W = (C, S) => {
|
|
492
492
|
if (r)
|
|
493
493
|
return;
|
|
494
|
-
|
|
495
|
-
const
|
|
496
|
-
let
|
|
497
|
-
|
|
498
|
-
},
|
|
499
|
-
if (
|
|
500
|
-
const
|
|
501
|
-
s == null || s(
|
|
502
|
-
},
|
|
503
|
-
|
|
504
|
-
},
|
|
505
|
-
L(
|
|
506
|
-
},
|
|
507
|
-
|
|
508
|
-
},
|
|
494
|
+
S && (S.stopPropagation(), S.preventDefault());
|
|
495
|
+
const G = t.includes(C);
|
|
496
|
+
let R;
|
|
497
|
+
G ? R = t.filter((J) => J !== C) : R = [...t, C], s && s(R);
|
|
498
|
+
}, q = (C, S) => {
|
|
499
|
+
if (S.stopPropagation(), r) return;
|
|
500
|
+
const G = t.filter((R) => R !== C);
|
|
501
|
+
s == null || s(G);
|
|
502
|
+
}, X = (C) => {
|
|
503
|
+
C.stopPropagation(), !r && (s == null || s([]));
|
|
504
|
+
}, F = (C) => {
|
|
505
|
+
L(C.target.value);
|
|
506
|
+
}, P = (C) => {
|
|
507
|
+
C.key === "Escape" && (_(!1), j(!1), L(""));
|
|
508
|
+
}, Y = k || x || t.length > 0, le = () => {
|
|
509
509
|
if (t.length === 0) return null;
|
|
510
|
-
const
|
|
511
|
-
(
|
|
512
|
-
).filter(Boolean),
|
|
513
|
-
return /* @__PURE__ */
|
|
514
|
-
|
|
515
|
-
/* @__PURE__ */ a("span", { className: "clarity-multiselect__chip-label", children:
|
|
510
|
+
const C = t.map(
|
|
511
|
+
(R) => e.find((J) => J.value === R)
|
|
512
|
+
).filter(Boolean), S = C.slice(0, v), G = C.length - v;
|
|
513
|
+
return /* @__PURE__ */ w("div", { className: "clarity-multiselect__chips", children: [
|
|
514
|
+
S.map((R) => /* @__PURE__ */ w("div", { className: "clarity-multiselect__chip", children: [
|
|
515
|
+
/* @__PURE__ */ a("span", { className: "clarity-multiselect__chip-label", children: R.label }),
|
|
516
516
|
!r && /* @__PURE__ */ a(
|
|
517
517
|
"button",
|
|
518
518
|
{
|
|
519
519
|
type: "button",
|
|
520
520
|
className: "clarity-multiselect__chip-remove",
|
|
521
|
-
onClick: (
|
|
522
|
-
"aria-label": `Remover ${
|
|
521
|
+
onClick: (J) => q(R.value, J),
|
|
522
|
+
"aria-label": `Remover ${R.label}`,
|
|
523
523
|
children: "×"
|
|
524
524
|
}
|
|
525
525
|
)
|
|
526
|
-
] },
|
|
527
|
-
|
|
526
|
+
] }, R.value)),
|
|
527
|
+
G > 0 && /* @__PURE__ */ w("div", { className: "clarity-multiselect__chip clarity-multiselect__chip--count", children: [
|
|
528
528
|
"+",
|
|
529
|
-
|
|
529
|
+
G,
|
|
530
530
|
" mais"
|
|
531
531
|
] })
|
|
532
532
|
] });
|
|
533
533
|
}, re = [
|
|
534
534
|
"clarity-multiselect-wrapper",
|
|
535
535
|
f
|
|
536
|
-
].filter(Boolean).join(" "),
|
|
536
|
+
].filter(Boolean).join(" "), ie = [
|
|
537
537
|
"clarity-multiselect",
|
|
538
|
-
`clarity-multiselect--${
|
|
539
|
-
`clarity-multiselect--${
|
|
540
|
-
|
|
538
|
+
`clarity-multiselect--${c}`,
|
|
539
|
+
`clarity-multiselect--${p}`,
|
|
540
|
+
x && "clarity-multiselect--open",
|
|
541
541
|
k && "clarity-multiselect--focused",
|
|
542
|
-
|
|
542
|
+
Y && "clarity-multiselect--label-up",
|
|
543
543
|
d && "clarity-multiselect--error",
|
|
544
544
|
r && "clarity-multiselect--disabled",
|
|
545
545
|
t.length > 0 && "clarity-multiselect--has-value"
|
|
546
546
|
].filter(Boolean).join(" ");
|
|
547
|
-
return /* @__PURE__ */
|
|
548
|
-
/* @__PURE__ */
|
|
547
|
+
return /* @__PURE__ */ w("div", { className: re, children: [
|
|
548
|
+
/* @__PURE__ */ w(
|
|
549
549
|
"div",
|
|
550
550
|
{
|
|
551
551
|
ref: g,
|
|
552
|
-
className:
|
|
553
|
-
"data-testid":
|
|
554
|
-
...
|
|
552
|
+
className: ie,
|
|
553
|
+
"data-testid": b,
|
|
554
|
+
...N,
|
|
555
555
|
children: [
|
|
556
|
-
/* @__PURE__ */
|
|
556
|
+
/* @__PURE__ */ w(
|
|
557
557
|
"div",
|
|
558
558
|
{
|
|
559
559
|
className: "clarity-multiselect__field",
|
|
560
|
-
onClick:
|
|
560
|
+
onClick: H,
|
|
561
561
|
children: [
|
|
562
|
-
l && /* @__PURE__ */
|
|
562
|
+
l && /* @__PURE__ */ w("label", { className: "clarity-multiselect__label", children: [
|
|
563
563
|
l,
|
|
564
564
|
y && /* @__PURE__ */ a("span", { className: "clarity-multiselect__required", children: "*" })
|
|
565
565
|
] }),
|
|
566
|
-
/* @__PURE__ */ a("div", { className: "clarity-multiselect__content", children: t.length > 0 ?
|
|
567
|
-
/* @__PURE__ */
|
|
566
|
+
/* @__PURE__ */ a("div", { className: "clarity-multiselect__content", children: t.length > 0 ? le() : /* @__PURE__ */ a("span", { className: "clarity-multiselect__placeholder", children: n }) }),
|
|
567
|
+
/* @__PURE__ */ w("div", { className: "clarity-multiselect__icons", children: [
|
|
568
568
|
t.length > 0 && !r && /* @__PURE__ */ a(
|
|
569
569
|
"button",
|
|
570
570
|
{
|
|
571
571
|
type: "button",
|
|
572
572
|
className: "clarity-multiselect__clear-button",
|
|
573
|
-
onClick:
|
|
573
|
+
onClick: X,
|
|
574
574
|
"aria-label": "Limpar seleção",
|
|
575
575
|
children: "×"
|
|
576
576
|
}
|
|
@@ -589,7 +589,7 @@ const lt = Ke(({
|
|
|
589
589
|
]
|
|
590
590
|
}
|
|
591
591
|
),
|
|
592
|
-
|
|
592
|
+
x && /* @__PURE__ */ w("div", { ref: O, className: "clarity-multiselect__dropdown", children: [
|
|
593
593
|
/* @__PURE__ */ a("div", { className: "clarity-multiselect__search", children: /* @__PURE__ */ a(
|
|
594
594
|
"input",
|
|
595
595
|
{
|
|
@@ -598,26 +598,26 @@ const lt = Ke(({
|
|
|
598
598
|
className: "clarity-multiselect__search-input",
|
|
599
599
|
placeholder: "Buscar opções...",
|
|
600
600
|
value: $,
|
|
601
|
-
onChange:
|
|
602
|
-
onKeyDown:
|
|
601
|
+
onChange: F,
|
|
602
|
+
onKeyDown: P
|
|
603
603
|
}
|
|
604
604
|
) }),
|
|
605
|
-
/* @__PURE__ */ a("ul", { className: "clarity-multiselect__options", children:
|
|
606
|
-
const
|
|
607
|
-
return /* @__PURE__ */
|
|
605
|
+
/* @__PURE__ */ a("ul", { className: "clarity-multiselect__options", children: V.length > 0 ? V.map((C) => {
|
|
606
|
+
const S = t.includes(C.value), G = C.disabled || r;
|
|
607
|
+
return /* @__PURE__ */ w(
|
|
608
608
|
"li",
|
|
609
609
|
{
|
|
610
610
|
className: [
|
|
611
611
|
"clarity-multiselect__option",
|
|
612
|
-
|
|
613
|
-
|
|
612
|
+
S && "clarity-multiselect__option--selected",
|
|
613
|
+
G && "clarity-multiselect__option--disabled"
|
|
614
614
|
].filter(Boolean).join(" "),
|
|
615
|
-
onClick: (
|
|
615
|
+
onClick: (R) => !G && W(C.value, R),
|
|
616
616
|
children: [
|
|
617
617
|
/* @__PURE__ */ a("div", { className: "clarity-multiselect__option-checkbox", children: /* @__PURE__ */ a("div", { className: [
|
|
618
618
|
"clarity-multiselect__checkbox",
|
|
619
|
-
|
|
620
|
-
].filter(Boolean).join(" "), children:
|
|
619
|
+
S && "clarity-multiselect__checkbox--checked"
|
|
620
|
+
].filter(Boolean).join(" "), children: S && /* @__PURE__ */ a("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ a(
|
|
621
621
|
"path",
|
|
622
622
|
{
|
|
623
623
|
d: "M2 6L5 9L10 3",
|
|
@@ -627,72 +627,72 @@ const lt = Ke(({
|
|
|
627
627
|
strokeLinejoin: "round"
|
|
628
628
|
}
|
|
629
629
|
) }) }) }),
|
|
630
|
-
/* @__PURE__ */ a("span", { className: "clarity-multiselect__option-label", children:
|
|
630
|
+
/* @__PURE__ */ a("span", { className: "clarity-multiselect__option-label", children: C.label })
|
|
631
631
|
]
|
|
632
632
|
},
|
|
633
|
-
|
|
633
|
+
C.value
|
|
634
634
|
);
|
|
635
635
|
}) : /* @__PURE__ */ a("li", { className: "clarity-multiselect__option clarity-multiselect__option--no-results", children: "Nenhum resultado encontrado" }) })
|
|
636
636
|
] })
|
|
637
637
|
]
|
|
638
638
|
}
|
|
639
639
|
),
|
|
640
|
-
(i || d &&
|
|
640
|
+
(i || d && o) && /* @__PURE__ */ a("div", { className: "clarity-multiselect__helper", children: d && o ? /* @__PURE__ */ a("span", { className: "clarity-multiselect__error-message", children: o }) : i && /* @__PURE__ */ a("span", { className: "clarity-multiselect__helper-text", children: i }) })
|
|
641
641
|
] });
|
|
642
642
|
});
|
|
643
|
-
|
|
644
|
-
const
|
|
645
|
-
const e =
|
|
643
|
+
ht.displayName = "MultiSelect";
|
|
644
|
+
const be = Q(null), Ce = () => {
|
|
645
|
+
const e = Z(be);
|
|
646
646
|
if (!e)
|
|
647
647
|
throw new Error("useModal must be used within a Modal provider");
|
|
648
648
|
return e;
|
|
649
|
-
},
|
|
649
|
+
}, Ne = ({
|
|
650
650
|
children: e,
|
|
651
651
|
className: t = "",
|
|
652
652
|
title: s
|
|
653
653
|
}) => {
|
|
654
|
-
const { onClose: n, variant: l, showCloseButton: i } =
|
|
654
|
+
const { onClose: n, variant: l, showCloseButton: i } = Ce(), d = [
|
|
655
655
|
"clarity-modal-header",
|
|
656
656
|
t,
|
|
657
657
|
l && `clarity-modal-header--${l}`
|
|
658
|
-
].filter(Boolean).join(" "),
|
|
658
|
+
].filter(Boolean).join(" "), o = [
|
|
659
659
|
"clarity-modal-close",
|
|
660
660
|
l && `clarity-modal-close--${l}`
|
|
661
661
|
].filter(Boolean).join(" ");
|
|
662
|
-
return /* @__PURE__ */
|
|
662
|
+
return /* @__PURE__ */ w("div", { className: d, children: [
|
|
663
663
|
s && /* @__PURE__ */ a("h2", { className: "clarity-modal-title", children: s }),
|
|
664
664
|
e,
|
|
665
|
-
i && /* @__PURE__ */ a("button", { className:
|
|
665
|
+
i && /* @__PURE__ */ a("button", { className: o, onClick: (r) => {
|
|
666
666
|
r.stopPropagation(), n();
|
|
667
667
|
}, children: "×" })
|
|
668
668
|
] });
|
|
669
669
|
};
|
|
670
|
-
|
|
671
|
-
const
|
|
672
|
-
|
|
673
|
-
const
|
|
670
|
+
Ne.displayName = "Modal.Header";
|
|
671
|
+
const we = ({ children: e, className: t = "" }) => /* @__PURE__ */ a("div", { className: `clarity-modal-content ${t}`, children: e });
|
|
672
|
+
we.displayName = "Modal.Content";
|
|
673
|
+
const _e = ({ children: e, className: t = "" }) => /* @__PURE__ */ w("div", { className: `clarity-modal-footer ${t}`, children: [
|
|
674
674
|
/* @__PURE__ */ a("div", { className: "clarity-modal-scroll-indicator" }),
|
|
675
675
|
e
|
|
676
676
|
] });
|
|
677
|
-
|
|
678
|
-
const
|
|
677
|
+
_e.displayName = "Modal.Footer";
|
|
678
|
+
const ge = ({ children: e, onClick: t }) => z(e, {
|
|
679
679
|
onClick: (s) => {
|
|
680
680
|
var n, l;
|
|
681
681
|
t == null || t(), (l = (n = e.props).onClick) == null || l.call(n, s);
|
|
682
682
|
}
|
|
683
683
|
});
|
|
684
|
-
|
|
685
|
-
const
|
|
686
|
-
const { onClose: t } =
|
|
687
|
-
return
|
|
684
|
+
ge.displayName = "Modal.Trigger";
|
|
685
|
+
const $e = ({ children: e }) => {
|
|
686
|
+
const { onClose: t } = Ce();
|
|
687
|
+
return z(e, {
|
|
688
688
|
onClick: (s) => {
|
|
689
689
|
var n, l;
|
|
690
690
|
t(), (l = (n = e.props).onClick) == null || l.call(n, s);
|
|
691
691
|
}
|
|
692
692
|
});
|
|
693
693
|
};
|
|
694
|
-
|
|
695
|
-
const
|
|
694
|
+
$e.displayName = "Modal.Close";
|
|
695
|
+
const K = ({
|
|
696
696
|
isOpen: e,
|
|
697
697
|
onClose: t,
|
|
698
698
|
onOpen: s,
|
|
@@ -700,57 +700,57 @@ const J = ({
|
|
|
700
700
|
className: l = "",
|
|
701
701
|
variant: i,
|
|
702
702
|
size: d = "medium",
|
|
703
|
-
showCloseButton:
|
|
703
|
+
showCloseButton: o = !0,
|
|
704
704
|
closeOnOverlayClick: r = !0
|
|
705
705
|
}) => {
|
|
706
|
-
const [
|
|
707
|
-
|
|
706
|
+
const [c, p] = T(!1), m = e !== void 0 ? e : c, f = t || (() => {
|
|
707
|
+
p(!1);
|
|
708
708
|
});
|
|
709
|
-
|
|
709
|
+
D(() => {
|
|
710
710
|
m && (s == null || s());
|
|
711
|
-
}, [m, s]),
|
|
712
|
-
const
|
|
713
|
-
|
|
711
|
+
}, [m, s]), D(() => {
|
|
712
|
+
const N = (B) => {
|
|
713
|
+
B.key === "Escape" && f();
|
|
714
714
|
};
|
|
715
|
-
return m ? (document.addEventListener("keydown",
|
|
716
|
-
document.removeEventListener("keydown",
|
|
715
|
+
return m ? (document.addEventListener("keydown", N), document.body.style.overflow = "hidden") : document.body.style.overflow = "unset", () => {
|
|
716
|
+
document.removeEventListener("keydown", N), document.body.style.overflow = "unset";
|
|
717
717
|
};
|
|
718
718
|
}, [m, f]);
|
|
719
|
-
const
|
|
720
|
-
r &&
|
|
721
|
-
}, h =
|
|
722
|
-
(
|
|
723
|
-
), y =
|
|
724
|
-
(
|
|
725
|
-
),
|
|
726
|
-
return /* @__PURE__ */
|
|
727
|
-
h &&
|
|
728
|
-
m && /* @__PURE__ */ a("div", { className: "clarity-modal-overlay", onClick:
|
|
719
|
+
const u = (N) => {
|
|
720
|
+
r && N.target === N.currentTarget && f();
|
|
721
|
+
}, h = E.Children.toArray(n).find(
|
|
722
|
+
(N) => se(N) && N.type.displayName === "Modal.Trigger"
|
|
723
|
+
), y = E.Children.toArray(n).filter(
|
|
724
|
+
(N) => se(N) && N.type.displayName !== "Modal.Trigger"
|
|
725
|
+
), b = ["clarity-modal", l, `clarity-modal--${d}`].filter(Boolean).join(" ");
|
|
726
|
+
return /* @__PURE__ */ w(be.Provider, { value: { onClose: f, variant: i, showCloseButton: o }, children: [
|
|
727
|
+
h && z(h, { onClick: () => p(!0) }),
|
|
728
|
+
m && /* @__PURE__ */ a("div", { className: "clarity-modal-overlay", onClick: u, children: /* @__PURE__ */ a("div", { className: b, children: y }) })
|
|
729
729
|
] });
|
|
730
730
|
};
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
const
|
|
738
|
-
const e =
|
|
731
|
+
K.Header = Ne;
|
|
732
|
+
K.Content = we;
|
|
733
|
+
K.Footer = _e;
|
|
734
|
+
K.Trigger = ge;
|
|
735
|
+
K.Close = $e;
|
|
736
|
+
K.displayName = "Modal";
|
|
737
|
+
const ke = Q(void 0), Vt = () => {
|
|
738
|
+
const e = Z(ke);
|
|
739
739
|
if (!e)
|
|
740
740
|
throw new Error("useToast must be used within a ToastProvider");
|
|
741
741
|
return e;
|
|
742
|
-
},
|
|
743
|
-
const [d,
|
|
744
|
-
|
|
745
|
-
const
|
|
746
|
-
|
|
747
|
-
}, 10),
|
|
748
|
-
|
|
742
|
+
}, yt = ({ id: e, message: t, variant: s, duration: n, onClose: l, invertColors: i }) => {
|
|
743
|
+
const [d, o] = T("entering");
|
|
744
|
+
D(() => {
|
|
745
|
+
const c = setTimeout(() => {
|
|
746
|
+
o("visible");
|
|
747
|
+
}, 10), p = setTimeout(() => {
|
|
748
|
+
o("exiting");
|
|
749
749
|
}, n * 1e3 - 300), v = setTimeout(() => {
|
|
750
750
|
l(e);
|
|
751
751
|
}, n * 1e3);
|
|
752
752
|
return () => {
|
|
753
|
-
clearTimeout(
|
|
753
|
+
clearTimeout(c), clearTimeout(p), clearTimeout(v);
|
|
754
754
|
};
|
|
755
755
|
}, [e, n, l]);
|
|
756
756
|
const r = [
|
|
@@ -759,9 +759,9 @@ const Ce = U(void 0), jt = () => {
|
|
|
759
759
|
i ? "colored-background" : "",
|
|
760
760
|
`cl-toast-${d}`
|
|
761
761
|
].filter(Boolean).join(" ");
|
|
762
|
-
return /* @__PURE__ */
|
|
762
|
+
return /* @__PURE__ */ w("div", { className: r, children: [
|
|
763
763
|
/* @__PURE__ */ a("div", { className: "cl-toast-message", children: t }),
|
|
764
|
-
/* @__PURE__ */ a("button", { onClick: () =>
|
|
764
|
+
/* @__PURE__ */ a("button", { onClick: () => o("exiting"), className: "cl-toast-close-button", children: "×" }),
|
|
765
765
|
/* @__PURE__ */ a(
|
|
766
766
|
"div",
|
|
767
767
|
{
|
|
@@ -770,92 +770,92 @@ const Ce = U(void 0), jt = () => {
|
|
|
770
770
|
}
|
|
771
771
|
)
|
|
772
772
|
] });
|
|
773
|
-
},
|
|
774
|
-
const [t, s] =
|
|
773
|
+
}, Ht = ({ children: e }) => {
|
|
774
|
+
const [t, s] = T([]), n = te(() => {
|
|
775
775
|
if (typeof document < "u") {
|
|
776
776
|
const r = document.createElement("div");
|
|
777
777
|
return r.id = "toast-portal-root", r;
|
|
778
778
|
}
|
|
779
779
|
return null;
|
|
780
780
|
}, []);
|
|
781
|
-
|
|
781
|
+
D(() => {
|
|
782
782
|
if (n)
|
|
783
783
|
return document.body.appendChild(n), () => {
|
|
784
784
|
document.body.removeChild(n);
|
|
785
785
|
};
|
|
786
786
|
}, [n]);
|
|
787
|
-
const l =
|
|
788
|
-
const
|
|
787
|
+
const l = ce((r) => {
|
|
788
|
+
const p = {
|
|
789
789
|
id: (/* @__PURE__ */ new Date()).toISOString() + Math.random(),
|
|
790
790
|
// duration: 5,
|
|
791
791
|
// position: 'right-top',
|
|
792
792
|
...r
|
|
793
793
|
};
|
|
794
794
|
s((v) => {
|
|
795
|
-
const m = [
|
|
795
|
+
const m = [p, ...v];
|
|
796
796
|
return m.length > 4 ? m.slice(0, 4) : m;
|
|
797
797
|
});
|
|
798
|
-
}, []), i =
|
|
799
|
-
s((
|
|
800
|
-
}, []), d =
|
|
801
|
-
return /* @__PURE__ */
|
|
798
|
+
}, []), i = ce((r) => {
|
|
799
|
+
s((c) => c.filter((p) => p.id !== r));
|
|
800
|
+
}, []), d = te(() => t.reduce((r, c) => (r[c.position] || (r[c.position] = []), r[c.position].push(c), r), {}), [t]), o = te(() => ({ show: l }), [l]);
|
|
801
|
+
return /* @__PURE__ */ w(ke.Provider, { value: o, children: [
|
|
802
802
|
e,
|
|
803
|
-
n &&
|
|
804
|
-
Object.entries(d).map(([r,
|
|
803
|
+
n && mt.createPortal(
|
|
804
|
+
Object.entries(d).map(([r, c]) => /* @__PURE__ */ a("div", { className: `cl-toast-container ${r}`, children: c.map((p) => /* @__PURE__ */ a(yt, { ...p, onClose: i }, p.id)) }, r)),
|
|
805
805
|
n
|
|
806
806
|
)
|
|
807
807
|
] });
|
|
808
|
-
},
|
|
809
|
-
const e =
|
|
808
|
+
}, xe = Q(null), Te = () => {
|
|
809
|
+
const e = Z(xe);
|
|
810
810
|
if (!e)
|
|
811
811
|
throw new Error("useOffcanvas must be used within an Offcanvas provider");
|
|
812
812
|
return e;
|
|
813
|
-
},
|
|
813
|
+
}, Be = ({
|
|
814
814
|
children: e,
|
|
815
815
|
className: t = ""
|
|
816
816
|
}) => {
|
|
817
|
-
const { onClose: s, variant: n, showCloseButton: l, title: i } =
|
|
817
|
+
const { onClose: s, variant: n, showCloseButton: l, title: i } = Te(), d = [
|
|
818
818
|
"clarity-offcanvas-header",
|
|
819
819
|
t
|
|
820
|
-
].filter(Boolean).join(" "),
|
|
820
|
+
].filter(Boolean).join(" "), o = [
|
|
821
821
|
"clarity-offcanvas-close",
|
|
822
822
|
n && `clarity-offcanvas-close--${n}`
|
|
823
823
|
].filter(Boolean).join(" "), r = [
|
|
824
824
|
"clarity-offcanvas-title",
|
|
825
825
|
n && `clarity-offcanvas-title--${n}`
|
|
826
826
|
].filter(Boolean).join(" ");
|
|
827
|
-
return /* @__PURE__ */
|
|
827
|
+
return /* @__PURE__ */ w("div", { className: d, children: [
|
|
828
828
|
i && /* @__PURE__ */ a("h2", { className: r, children: i }),
|
|
829
829
|
e,
|
|
830
|
-
l && /* @__PURE__ */ a("button", { className:
|
|
831
|
-
|
|
830
|
+
l && /* @__PURE__ */ a("button", { className: o, onClick: (c) => {
|
|
831
|
+
c.stopPropagation(), s();
|
|
832
832
|
}, children: "×" })
|
|
833
833
|
] });
|
|
834
834
|
};
|
|
835
|
-
|
|
836
|
-
const
|
|
837
|
-
|
|
838
|
-
const
|
|
835
|
+
Be.displayName = "Offcanvas.Header";
|
|
836
|
+
const je = ({ children: e, className: t = "" }) => /* @__PURE__ */ a("div", { className: `clarity-offcanvas-content ${t}`, children: e });
|
|
837
|
+
je.displayName = "Offcanvas.Content";
|
|
838
|
+
const Ee = ({ children: e, onClick: t, variant: s }) => z(e, {
|
|
839
839
|
onClick: (n) => {
|
|
840
840
|
var l, i;
|
|
841
841
|
t == null || t(), (i = (l = e.props).onClick) == null || i.call(l, n);
|
|
842
842
|
},
|
|
843
843
|
variant: s
|
|
844
844
|
});
|
|
845
|
-
|
|
846
|
-
const
|
|
847
|
-
|
|
848
|
-
const
|
|
849
|
-
const { onClose: t } =
|
|
850
|
-
return
|
|
845
|
+
Ee.displayName = "Offcanvas.Trigger";
|
|
846
|
+
const pe = ({ children: e, className: t = "" }) => /* @__PURE__ */ a("div", { className: `clarity-offcanvas-footer ${t}`, children: e });
|
|
847
|
+
pe.displayName = "Offcanvas.Footer";
|
|
848
|
+
const Le = ({ children: e }) => {
|
|
849
|
+
const { onClose: t } = Te();
|
|
850
|
+
return z(e, {
|
|
851
851
|
onClick: (s) => {
|
|
852
852
|
var n, l;
|
|
853
853
|
t(), (l = (n = e.props).onClick) == null || l.call(n, s);
|
|
854
854
|
}
|
|
855
855
|
});
|
|
856
856
|
};
|
|
857
|
-
|
|
858
|
-
const
|
|
857
|
+
Le.displayName = "Offcanvas.Close";
|
|
858
|
+
const ae = ({
|
|
859
859
|
isOpen: e,
|
|
860
860
|
onClose: t,
|
|
861
861
|
onOpen: s,
|
|
@@ -863,17 +863,17 @@ const K = ({
|
|
|
863
863
|
className: l = "",
|
|
864
864
|
variant: i,
|
|
865
865
|
placement: d = "right",
|
|
866
|
-
closeOnOverlayClick:
|
|
866
|
+
closeOnOverlayClick: o = !0,
|
|
867
867
|
showCloseButton: r = !0,
|
|
868
|
-
title:
|
|
868
|
+
title: c
|
|
869
869
|
}) => {
|
|
870
|
-
const [
|
|
870
|
+
const [p, v] = T(!1), [m, f] = T(!1), [u, h] = T(!1), y = e !== void 0, b = y ? e : p, N = ce(() => {
|
|
871
871
|
t ? t() : v(!1);
|
|
872
|
-
}, [t]),
|
|
872
|
+
}, [t]), B = ce(() => {
|
|
873
873
|
y || v(!0), s == null || s();
|
|
874
874
|
}, [y, s]);
|
|
875
|
-
|
|
876
|
-
if (
|
|
875
|
+
D(() => {
|
|
876
|
+
if (b) {
|
|
877
877
|
h(!0);
|
|
878
878
|
const g = setTimeout(() => {
|
|
879
879
|
f(!0);
|
|
@@ -886,35 +886,35 @@ const K = ({
|
|
|
886
886
|
}, 300);
|
|
887
887
|
return () => clearTimeout(g);
|
|
888
888
|
}
|
|
889
|
-
}, [
|
|
890
|
-
const g = (
|
|
891
|
-
|
|
889
|
+
}, [b]), D(() => {
|
|
890
|
+
const g = (V) => {
|
|
891
|
+
V.key === "Escape" && N();
|
|
892
892
|
};
|
|
893
|
-
return
|
|
893
|
+
return b ? (document.addEventListener("keydown", g), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", g), document.body.style.overflow = "unset"), () => {
|
|
894
894
|
document.removeEventListener("keydown", g), document.body.style.overflow = "unset";
|
|
895
895
|
};
|
|
896
|
-
}, [
|
|
897
|
-
const
|
|
898
|
-
|
|
899
|
-
},
|
|
900
|
-
let $, L, k,
|
|
901
|
-
|
|
902
|
-
if (
|
|
896
|
+
}, [b, N]);
|
|
897
|
+
const x = (g) => {
|
|
898
|
+
o && g.target === g.currentTarget && N();
|
|
899
|
+
}, _ = E.Children.toArray(n);
|
|
900
|
+
let $, L, k, j, I;
|
|
901
|
+
_.forEach((g) => {
|
|
902
|
+
if (se(g))
|
|
903
903
|
if (g.type.displayName === "Offcanvas.Trigger")
|
|
904
904
|
$ = g;
|
|
905
905
|
else if (g.type.displayName === "Offcanvas.Header")
|
|
906
906
|
L = g;
|
|
907
907
|
else if (g.type.displayName === "Offcanvas.Content") {
|
|
908
908
|
k = g;
|
|
909
|
-
const
|
|
910
|
-
k =
|
|
911
|
-
} else g.type.displayName === "Offcanvas.Footer" && (
|
|
912
|
-
}), I && (
|
|
913
|
-
children: /* @__PURE__ */
|
|
914
|
-
|
|
909
|
+
const H = E.Children.toArray(k.props.children).filter((W) => se(W) && W.type.displayName === "Offcanvas.Close" ? (I = W, !1) : !0);
|
|
910
|
+
k = z(k, { children: H });
|
|
911
|
+
} else g.type.displayName === "Offcanvas.Footer" && (j = g);
|
|
912
|
+
}), I && (j ? j = z(j, {
|
|
913
|
+
children: /* @__PURE__ */ w(ot, { children: [
|
|
914
|
+
j.props.children,
|
|
915
915
|
I
|
|
916
916
|
] })
|
|
917
|
-
}) :
|
|
917
|
+
}) : j = /* @__PURE__ */ a(pe, { children: I }));
|
|
918
918
|
const A = [
|
|
919
919
|
"clarity-offcanvas",
|
|
920
920
|
l,
|
|
@@ -925,25 +925,25 @@ const K = ({
|
|
|
925
925
|
"clarity-offcanvas-overlay",
|
|
926
926
|
m ? "clarity-offcanvas-overlay--visible" : ""
|
|
927
927
|
].filter(Boolean).join(" ");
|
|
928
|
-
return /* @__PURE__ */
|
|
929
|
-
$ &&
|
|
930
|
-
|
|
931
|
-
/* @__PURE__ */ a("div", { className: O, onClick:
|
|
928
|
+
return /* @__PURE__ */ w(xe.Provider, { value: { onClose: N, variant: i, showCloseButton: r, placement: d, title: c }, children: [
|
|
929
|
+
$ && z($, { onClick: B, variant: i }),
|
|
930
|
+
u && // Only render if shouldRender is true
|
|
931
|
+
/* @__PURE__ */ a("div", { className: O, onClick: x, children: /* @__PURE__ */ w("div", { className: A, children: [
|
|
932
932
|
L,
|
|
933
933
|
k,
|
|
934
|
-
|
|
934
|
+
j && /* @__PURE__ */ a("div", { className: "clarity-offcanvas-scroll-indicator" }),
|
|
935
935
|
" ",
|
|
936
|
-
|
|
936
|
+
j
|
|
937
937
|
] }) })
|
|
938
938
|
] });
|
|
939
939
|
};
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
const
|
|
940
|
+
ae.Header = Be;
|
|
941
|
+
ae.Content = je;
|
|
942
|
+
ae.Footer = pe;
|
|
943
|
+
ae.Trigger = Ee;
|
|
944
|
+
ae.Close = Le;
|
|
945
|
+
ae.displayName = "Offcanvas";
|
|
946
|
+
const vt = E.forwardRef(({
|
|
947
947
|
type: e,
|
|
948
948
|
variant: t = "primary",
|
|
949
949
|
size: s = "medium",
|
|
@@ -951,17 +951,17 @@ const rt = B.forwardRef(({
|
|
|
951
951
|
helperText: l,
|
|
952
952
|
error: i = !1,
|
|
953
953
|
errorMessage: d,
|
|
954
|
-
labelPosition:
|
|
954
|
+
labelPosition: o = "right",
|
|
955
955
|
className: r = "",
|
|
956
|
-
disabled:
|
|
957
|
-
checked:
|
|
956
|
+
disabled: c = !1,
|
|
957
|
+
checked: p,
|
|
958
958
|
id: v,
|
|
959
959
|
...m
|
|
960
960
|
}, f) => {
|
|
961
|
-
const
|
|
961
|
+
const u = v || `check-input-${Math.random().toString(36).substr(2, 9)}`, h = [
|
|
962
962
|
"clarity-check-input-wrapper",
|
|
963
|
-
`clarity-check-input-wrapper--${
|
|
964
|
-
|
|
963
|
+
`clarity-check-input-wrapper--${o}`,
|
|
964
|
+
c && "clarity-check-input-wrapper--disabled",
|
|
965
965
|
i && "clarity-check-input-wrapper--error"
|
|
966
966
|
].filter(Boolean).join(" "), y = [
|
|
967
967
|
"clarity-check-input",
|
|
@@ -969,28 +969,28 @@ const rt = B.forwardRef(({
|
|
|
969
969
|
`clarity-check-input--${s}`,
|
|
970
970
|
t && `clarity-check-input--${t}`,
|
|
971
971
|
i && "clarity-check-input--error",
|
|
972
|
-
|
|
972
|
+
c && "clarity-check-input--disabled",
|
|
973
973
|
r
|
|
974
|
-
].filter(Boolean).join(" "),
|
|
974
|
+
].filter(Boolean).join(" "), b = [
|
|
975
975
|
"clarity-check-input__label",
|
|
976
976
|
`clarity-check-input__label--${s}`,
|
|
977
|
-
|
|
977
|
+
c && "clarity-check-input__label--disabled"
|
|
978
978
|
].filter(Boolean).join(" ");
|
|
979
|
-
return /* @__PURE__ */
|
|
980
|
-
/* @__PURE__ */
|
|
979
|
+
return /* @__PURE__ */ w("div", { className: "clarity-check-input-container", children: [
|
|
980
|
+
/* @__PURE__ */ w("label", { className: h, htmlFor: u, children: [
|
|
981
981
|
/* @__PURE__ */ a(
|
|
982
982
|
"input",
|
|
983
983
|
{
|
|
984
984
|
ref: f,
|
|
985
|
-
id:
|
|
985
|
+
id: u,
|
|
986
986
|
type: e,
|
|
987
987
|
className: y,
|
|
988
|
-
disabled:
|
|
989
|
-
checked:
|
|
988
|
+
disabled: c,
|
|
989
|
+
checked: p,
|
|
990
990
|
...m
|
|
991
991
|
}
|
|
992
992
|
),
|
|
993
|
-
/* @__PURE__ */
|
|
993
|
+
/* @__PURE__ */ w("div", { className: "clarity-check-input__custom", children: [
|
|
994
994
|
e === "checkbox" && /* @__PURE__ */ a(
|
|
995
995
|
"svg",
|
|
996
996
|
{
|
|
@@ -1012,13 +1012,13 @@ const rt = B.forwardRef(({
|
|
|
1012
1012
|
),
|
|
1013
1013
|
e === "radio" && /* @__PURE__ */ a("div", { className: "clarity-check-input__radio-dot" })
|
|
1014
1014
|
] }),
|
|
1015
|
-
n && /* @__PURE__ */ a("span", { className:
|
|
1015
|
+
n && /* @__PURE__ */ a("span", { className: b, children: n })
|
|
1016
1016
|
] }),
|
|
1017
1017
|
(l || i && d) && /* @__PURE__ */ a("div", { className: "clarity-check-input__helper-text", children: i && d ? d : l })
|
|
1018
1018
|
] });
|
|
1019
1019
|
});
|
|
1020
|
-
|
|
1021
|
-
const
|
|
1020
|
+
vt.displayName = "CheckInput";
|
|
1021
|
+
const bt = E.forwardRef(({
|
|
1022
1022
|
variant: e = "primary",
|
|
1023
1023
|
size: t = "medium",
|
|
1024
1024
|
label: s,
|
|
@@ -1026,13 +1026,13 @@ const ct = B.forwardRef(({
|
|
|
1026
1026
|
error: l = !1,
|
|
1027
1027
|
errorMessage: i,
|
|
1028
1028
|
labelPosition: d = "right",
|
|
1029
|
-
className:
|
|
1029
|
+
className: o = "",
|
|
1030
1030
|
disabled: r = !1,
|
|
1031
|
-
checked:
|
|
1032
|
-
id:
|
|
1031
|
+
checked: c,
|
|
1032
|
+
id: p,
|
|
1033
1033
|
...v
|
|
1034
1034
|
}, m) => {
|
|
1035
|
-
const f =
|
|
1035
|
+
const f = p || `input-switch-${Math.random().toString(36).substr(2, 9)}`, u = [
|
|
1036
1036
|
"clarity-input-switch-wrapper",
|
|
1037
1037
|
`clarity-input-switch-wrapper--${d}`,
|
|
1038
1038
|
r && "clarity-input-switch-wrapper--disabled",
|
|
@@ -1043,14 +1043,14 @@ const ct = B.forwardRef(({
|
|
|
1043
1043
|
e && `clarity-input-switch--${e}`,
|
|
1044
1044
|
l && "clarity-input-switch--error",
|
|
1045
1045
|
r && "clarity-input-switch--disabled",
|
|
1046
|
-
|
|
1046
|
+
o
|
|
1047
1047
|
].filter(Boolean).join(" "), y = [
|
|
1048
1048
|
"clarity-input-switch__label",
|
|
1049
1049
|
`clarity-input-switch__label--${t}`,
|
|
1050
1050
|
r && "clarity-input-switch__label--disabled"
|
|
1051
1051
|
].filter(Boolean).join(" ");
|
|
1052
|
-
return /* @__PURE__ */
|
|
1053
|
-
/* @__PURE__ */
|
|
1052
|
+
return /* @__PURE__ */ w("div", { className: "clarity-input-switch-container", children: [
|
|
1053
|
+
/* @__PURE__ */ w("label", { className: u, htmlFor: f, children: [
|
|
1054
1054
|
/* @__PURE__ */ a(
|
|
1055
1055
|
"input",
|
|
1056
1056
|
{
|
|
@@ -1059,7 +1059,7 @@ const ct = B.forwardRef(({
|
|
|
1059
1059
|
type: "checkbox",
|
|
1060
1060
|
className: h,
|
|
1061
1061
|
disabled: r,
|
|
1062
|
-
checked:
|
|
1062
|
+
checked: c,
|
|
1063
1063
|
...v
|
|
1064
1064
|
}
|
|
1065
1065
|
),
|
|
@@ -1069,88 +1069,88 @@ const ct = B.forwardRef(({
|
|
|
1069
1069
|
(n || l && i) && /* @__PURE__ */ a("div", { className: "clarity-input-switch__helper-text", children: l && i ? i : n })
|
|
1070
1070
|
] });
|
|
1071
1071
|
});
|
|
1072
|
-
|
|
1073
|
-
const
|
|
1074
|
-
const e =
|
|
1072
|
+
bt.displayName = "InputSwitch";
|
|
1073
|
+
const Se = Q(null), fe = () => {
|
|
1074
|
+
const e = Z(Se);
|
|
1075
1075
|
if (!e)
|
|
1076
1076
|
throw new Error("useConfirmationDialog must be used within a ConfirmationDialog provider");
|
|
1077
1077
|
return e;
|
|
1078
|
-
},
|
|
1079
|
-
const { variant: s } =
|
|
1078
|
+
}, Oe = ({ children: e, className: t = "" }) => {
|
|
1079
|
+
const { variant: s } = fe(), n = `clarity-confirmation-dialog-header ${t} clarity-confirmation-dialog-header--${s}`;
|
|
1080
1080
|
return /* @__PURE__ */ a("div", { className: n, children: e });
|
|
1081
1081
|
};
|
|
1082
|
-
|
|
1083
|
-
const
|
|
1084
|
-
|
|
1085
|
-
const
|
|
1086
|
-
|
|
1087
|
-
const
|
|
1082
|
+
Oe.displayName = "ConfirmationDialog.Header";
|
|
1083
|
+
const Ie = ({ children: e, className: t = "" }) => /* @__PURE__ */ a("div", { className: `clarity-confirmation-dialog-content ${t}`, children: e });
|
|
1084
|
+
Ie.displayName = "ConfirmationDialog.Content";
|
|
1085
|
+
const Re = ({ children: e, className: t = "" }) => /* @__PURE__ */ a("div", { className: `clarity-confirmation-dialog-footer ${t}`, children: e });
|
|
1086
|
+
Re.displayName = "ConfirmationDialog.Footer";
|
|
1087
|
+
const De = ({ children: e }) => z(e, {
|
|
1088
1088
|
onClick: (t) => {
|
|
1089
1089
|
var s, n;
|
|
1090
1090
|
(n = (s = e.props).onClick) == null || n.call(s, t);
|
|
1091
1091
|
}
|
|
1092
1092
|
});
|
|
1093
|
-
|
|
1094
|
-
const
|
|
1095
|
-
const { onClose: t } =
|
|
1096
|
-
return
|
|
1093
|
+
De.displayName = "ConfirmationDialog.Trigger";
|
|
1094
|
+
const Ae = ({ children: e }) => {
|
|
1095
|
+
const { onClose: t } = fe();
|
|
1096
|
+
return z(e, {
|
|
1097
1097
|
onClick: (s) => {
|
|
1098
1098
|
var n, l;
|
|
1099
1099
|
t(), (l = (n = e.props).onClick) == null || l.call(n, s);
|
|
1100
1100
|
}
|
|
1101
1101
|
});
|
|
1102
1102
|
};
|
|
1103
|
-
|
|
1104
|
-
const
|
|
1105
|
-
const { onConfirm: t } =
|
|
1106
|
-
return
|
|
1103
|
+
Ae.displayName = "ConfirmationDialog.Close";
|
|
1104
|
+
const Pe = ({ children: e }) => {
|
|
1105
|
+
const { onConfirm: t } = fe();
|
|
1106
|
+
return z(e, {
|
|
1107
1107
|
onClick: (s) => {
|
|
1108
1108
|
var n, l;
|
|
1109
1109
|
t(), (l = (n = e.props).onClick) == null || l.call(n, s);
|
|
1110
1110
|
}
|
|
1111
1111
|
});
|
|
1112
1112
|
};
|
|
1113
|
-
|
|
1114
|
-
const
|
|
1113
|
+
Pe.displayName = "ConfirmationDialog.Confirm";
|
|
1114
|
+
const ee = ({
|
|
1115
1115
|
isOpen: e,
|
|
1116
1116
|
onClose: t,
|
|
1117
1117
|
onConfirm: s,
|
|
1118
1118
|
variant: n = "clarity-primary",
|
|
1119
1119
|
children: l
|
|
1120
1120
|
}) => {
|
|
1121
|
-
const [i, d] =
|
|
1122
|
-
|
|
1123
|
-
},
|
|
1121
|
+
const [i, d] = T(!1), o = e !== void 0, r = o ? e : i, c = () => {
|
|
1122
|
+
o || d(!0);
|
|
1123
|
+
}, p = () => {
|
|
1124
1124
|
t ? t() : d(!1);
|
|
1125
1125
|
}, v = () => {
|
|
1126
|
-
s && s(),
|
|
1126
|
+
s && s(), p();
|
|
1127
1127
|
};
|
|
1128
|
-
|
|
1128
|
+
D(() => {
|
|
1129
1129
|
const h = (y) => {
|
|
1130
|
-
y.key === "Escape" &&
|
|
1130
|
+
y.key === "Escape" && p();
|
|
1131
1131
|
};
|
|
1132
1132
|
return r ? (document.addEventListener("keydown", h), document.body.style.overflow = "hidden") : document.body.style.overflow = "unset", () => {
|
|
1133
1133
|
document.removeEventListener("keydown", h), document.body.style.overflow = "unset";
|
|
1134
1134
|
};
|
|
1135
|
-
}, [r,
|
|
1136
|
-
const m =
|
|
1137
|
-
(h) =>
|
|
1138
|
-
), f =
|
|
1139
|
-
(h) =>
|
|
1140
|
-
),
|
|
1141
|
-
return /* @__PURE__ */
|
|
1135
|
+
}, [r, p]);
|
|
1136
|
+
const m = E.Children.toArray(l).find(
|
|
1137
|
+
(h) => se(h) && h.type.displayName === "ConfirmationDialog.Trigger"
|
|
1138
|
+
), f = E.Children.toArray(l).filter(
|
|
1139
|
+
(h) => se(h) && h.type.displayName !== "ConfirmationDialog.Trigger"
|
|
1140
|
+
), u = `clarity-confirmation-dialog clarity-confirmation-dialog--${n}`;
|
|
1141
|
+
return /* @__PURE__ */ w(Se.Provider, { value: { variant: n, onClose: p, onConfirm: v, onOpen: c }, children: [
|
|
1142
1142
|
m,
|
|
1143
|
-
r && /* @__PURE__ */ a("div", { className: "clarity-modal-overlay", children: /* @__PURE__ */ a("div", { className:
|
|
1143
|
+
r && /* @__PURE__ */ a("div", { className: "clarity-modal-overlay", children: /* @__PURE__ */ a("div", { className: u, children: f }) })
|
|
1144
1144
|
] });
|
|
1145
1145
|
};
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
const
|
|
1146
|
+
ee.Header = Oe;
|
|
1147
|
+
ee.Content = Ie;
|
|
1148
|
+
ee.Footer = Re;
|
|
1149
|
+
ee.Trigger = De;
|
|
1150
|
+
ee.Close = Ae;
|
|
1151
|
+
ee.Confirm = Pe;
|
|
1152
|
+
ee.displayName = "ConfirmationDialog";
|
|
1153
|
+
const Mt = ({
|
|
1154
1154
|
variant: e = "primary",
|
|
1155
1155
|
size: t = "medium",
|
|
1156
1156
|
disabled: s = !1,
|
|
@@ -1158,30 +1158,30 @@ const Lt = ({
|
|
|
1158
1158
|
children: l,
|
|
1159
1159
|
onClick: i,
|
|
1160
1160
|
type: d = "button",
|
|
1161
|
-
className:
|
|
1161
|
+
className: o = "",
|
|
1162
1162
|
"aria-label": r,
|
|
1163
|
-
title:
|
|
1164
|
-
customColor:
|
|
1163
|
+
title: c,
|
|
1164
|
+
customColor: p,
|
|
1165
1165
|
customColorHover: v,
|
|
1166
1166
|
...m
|
|
1167
1167
|
}) => {
|
|
1168
|
-
const f = "clarity-button-icon",
|
|
1168
|
+
const f = "clarity-button-icon", u = [
|
|
1169
1169
|
f,
|
|
1170
|
-
!
|
|
1170
|
+
!p && `${f}--${e}`,
|
|
1171
1171
|
`${f}--${t}`,
|
|
1172
1172
|
n && `${f}--loading`,
|
|
1173
1173
|
s && `${f}--disabled`,
|
|
1174
|
-
|
|
1174
|
+
o
|
|
1175
1175
|
].filter(Boolean).join(" "), h = {};
|
|
1176
|
-
return
|
|
1176
|
+
return p && (h["--button-icon-bg"] = p, h["--button-icon-hover-bg"] = v || `${p}E6`), /* @__PURE__ */ w(
|
|
1177
1177
|
"button",
|
|
1178
1178
|
{
|
|
1179
|
-
className:
|
|
1179
|
+
className: u,
|
|
1180
1180
|
disabled: s || n,
|
|
1181
1181
|
onClick: i,
|
|
1182
1182
|
type: d,
|
|
1183
1183
|
"aria-label": r,
|
|
1184
|
-
title:
|
|
1184
|
+
title: c,
|
|
1185
1185
|
style: h,
|
|
1186
1186
|
...m,
|
|
1187
1187
|
children: [
|
|
@@ -1190,7 +1190,7 @@ const Lt = ({
|
|
|
1190
1190
|
]
|
|
1191
1191
|
}
|
|
1192
1192
|
);
|
|
1193
|
-
},
|
|
1193
|
+
}, Wt = ({
|
|
1194
1194
|
variant: e = "primary",
|
|
1195
1195
|
product: t,
|
|
1196
1196
|
tone: s,
|
|
@@ -1198,35 +1198,35 @@ const Lt = ({
|
|
|
1198
1198
|
size: l = "medium",
|
|
1199
1199
|
disabled: i = !1,
|
|
1200
1200
|
children: d,
|
|
1201
|
-
onClick:
|
|
1201
|
+
onClick: o,
|
|
1202
1202
|
href: r,
|
|
1203
|
-
target:
|
|
1204
|
-
rel:
|
|
1203
|
+
target: c,
|
|
1204
|
+
rel: p,
|
|
1205
1205
|
className: v = "",
|
|
1206
1206
|
...m
|
|
1207
1207
|
}) => {
|
|
1208
|
-
const f = "clarity-button-link",
|
|
1208
|
+
const f = "clarity-button-link", u = t && s, h = u ? `${f}--custom` : `${f}--${e}`, y = [
|
|
1209
1209
|
f,
|
|
1210
1210
|
h,
|
|
1211
1211
|
`${f}--${l}`,
|
|
1212
1212
|
i && `${f}--disabled`,
|
|
1213
1213
|
v
|
|
1214
|
-
].filter(Boolean).join(" "),
|
|
1215
|
-
const
|
|
1216
|
-
return
|
|
1217
|
-
},
|
|
1214
|
+
].filter(Boolean).join(" "), b = (B) => {
|
|
1215
|
+
const x = parseInt(B);
|
|
1216
|
+
return x >= 800 ? "900" : x >= 700 ? "800" : x >= 600 ? "700" : x >= 500 ? "600" : x >= 400 ? "500" : x >= 300 ? "400" : x >= 200 ? "300" : "200";
|
|
1217
|
+
}, N = u ? {
|
|
1218
1218
|
"--custom-color": `var(--clarity-${t}-${s})`,
|
|
1219
|
-
"--custom-hover-color": `var(--clarity-${t}-${n ||
|
|
1219
|
+
"--custom-hover-color": `var(--clarity-${t}-${n || b(s)})`
|
|
1220
1220
|
} : {};
|
|
1221
1221
|
return r ? /* @__PURE__ */ a(
|
|
1222
1222
|
"a",
|
|
1223
1223
|
{
|
|
1224
1224
|
href: r,
|
|
1225
|
-
target:
|
|
1226
|
-
rel:
|
|
1225
|
+
target: c,
|
|
1226
|
+
rel: p || (c === "_blank" ? "noopener noreferrer" : void 0),
|
|
1227
1227
|
className: y,
|
|
1228
|
-
style:
|
|
1229
|
-
onClick: i ? void 0 :
|
|
1228
|
+
style: N,
|
|
1229
|
+
onClick: i ? void 0 : o,
|
|
1230
1230
|
...m,
|
|
1231
1231
|
children: d
|
|
1232
1232
|
}
|
|
@@ -1234,19 +1234,19 @@ const Lt = ({
|
|
|
1234
1234
|
"button",
|
|
1235
1235
|
{
|
|
1236
1236
|
className: y,
|
|
1237
|
-
style:
|
|
1237
|
+
style: N,
|
|
1238
1238
|
disabled: i,
|
|
1239
|
-
onClick:
|
|
1239
|
+
onClick: o,
|
|
1240
1240
|
...m,
|
|
1241
1241
|
children: d
|
|
1242
1242
|
}
|
|
1243
1243
|
);
|
|
1244
|
-
},
|
|
1245
|
-
const e =
|
|
1244
|
+
}, Ve = Q(void 0), He = () => {
|
|
1245
|
+
const e = Z(Ve);
|
|
1246
1246
|
if (!e)
|
|
1247
1247
|
throw new Error("Accordion components must be used within an Accordion");
|
|
1248
1248
|
return e;
|
|
1249
|
-
},
|
|
1249
|
+
}, Ct = ({
|
|
1250
1250
|
variant: e = "primary",
|
|
1251
1251
|
product: t,
|
|
1252
1252
|
tone: s,
|
|
@@ -1254,27 +1254,27 @@ const Lt = ({
|
|
|
1254
1254
|
defaultActiveKey: l,
|
|
1255
1255
|
alwaysOpen: i = !1,
|
|
1256
1256
|
flush: d = !1,
|
|
1257
|
-
className:
|
|
1257
|
+
className: o = "",
|
|
1258
1258
|
children: r,
|
|
1259
|
-
onSelect:
|
|
1260
|
-
...
|
|
1259
|
+
onSelect: c,
|
|
1260
|
+
...p
|
|
1261
1261
|
}) => {
|
|
1262
|
-
const [v, m] =
|
|
1262
|
+
const [v, m] = T(() => l ? Array.isArray(l) ? l : [l] : []), f = (_) => {
|
|
1263
1263
|
let $;
|
|
1264
|
-
i ? $ = v.includes(
|
|
1265
|
-
},
|
|
1266
|
-
|
|
1264
|
+
i ? $ = v.includes(_) ? v.filter((L) => L !== _) : [...v, _] : $ = v.includes(_) ? [] : [_], m($), c && c(v.includes(_) ? null : _, {});
|
|
1265
|
+
}, u = "clarity-accordion", h = t && s, y = h ? `${u}--custom` : `${u}--${e}`, b = [
|
|
1266
|
+
u,
|
|
1267
1267
|
y,
|
|
1268
|
-
d && `${
|
|
1269
|
-
|
|
1270
|
-
].filter(Boolean).join(" "),
|
|
1271
|
-
const $ = parseInt(
|
|
1268
|
+
d && `${u}--flush`,
|
|
1269
|
+
o
|
|
1270
|
+
].filter(Boolean).join(" "), N = (_) => {
|
|
1271
|
+
const $ = parseInt(_);
|
|
1272
1272
|
return $ >= 800 ? "900" : $ >= 700 ? "800" : $ >= 600 ? "700" : $ >= 500 ? "600" : $ >= 400 ? "500" : $ >= 300 ? "400" : $ >= 200 ? "300" : "200";
|
|
1273
|
-
},
|
|
1273
|
+
}, B = h ? {
|
|
1274
1274
|
"--custom-border-color": `var(--clarity-${t}-${s})`,
|
|
1275
1275
|
"--custom-header-color": `var(--clarity-${t}-${s})`,
|
|
1276
|
-
"--custom-hover-color": `var(--clarity-${t}-${n ||
|
|
1277
|
-
} : {},
|
|
1276
|
+
"--custom-hover-color": `var(--clarity-${t}-${n || N(s)})`
|
|
1277
|
+
} : {}, x = {
|
|
1278
1278
|
activeKeys: v,
|
|
1279
1279
|
toggleItem: f,
|
|
1280
1280
|
alwaysOpen: i,
|
|
@@ -1284,27 +1284,27 @@ const Lt = ({
|
|
|
1284
1284
|
hoverTone: n,
|
|
1285
1285
|
flush: d
|
|
1286
1286
|
};
|
|
1287
|
-
return /* @__PURE__ */ a(
|
|
1288
|
-
},
|
|
1287
|
+
return /* @__PURE__ */ a(Ve.Provider, { value: x, children: /* @__PURE__ */ a("div", { className: b, style: B, ...p, children: r }) });
|
|
1288
|
+
}, Nt = ({
|
|
1289
1289
|
eventKey: e,
|
|
1290
1290
|
disabled: t = !1,
|
|
1291
1291
|
className: s = "",
|
|
1292
1292
|
children: n,
|
|
1293
1293
|
...l
|
|
1294
1294
|
}) => {
|
|
1295
|
-
const { activeKeys: i } =
|
|
1295
|
+
const { activeKeys: i } = He(), d = "clarity-accordion", o = i.includes(e), r = [
|
|
1296
1296
|
`${d}__item`,
|
|
1297
|
-
|
|
1297
|
+
o && `${d}__item--active`,
|
|
1298
1298
|
t && `${d}__item--disabled`,
|
|
1299
1299
|
s
|
|
1300
1300
|
].filter(Boolean).join(" ");
|
|
1301
|
-
return /* @__PURE__ */ a("div", { className: r, ...l, children:
|
|
1302
|
-
...
|
|
1301
|
+
return /* @__PURE__ */ a("div", { className: r, ...l, children: E.Children.map(n, (c) => E.isValidElement(c) ? E.cloneElement(c, {
|
|
1302
|
+
...c.props,
|
|
1303
1303
|
eventKey: e,
|
|
1304
1304
|
disabled: t,
|
|
1305
|
-
isActive:
|
|
1306
|
-
}) :
|
|
1307
|
-
},
|
|
1305
|
+
isActive: o
|
|
1306
|
+
}) : c) });
|
|
1307
|
+
}, wt = ({
|
|
1308
1308
|
className: e = "",
|
|
1309
1309
|
children: t,
|
|
1310
1310
|
onClick: s,
|
|
@@ -1313,14 +1313,14 @@ const Lt = ({
|
|
|
1313
1313
|
isActive: i = !1,
|
|
1314
1314
|
...d
|
|
1315
1315
|
}) => {
|
|
1316
|
-
const { toggleItem:
|
|
1317
|
-
!l && n &&
|
|
1316
|
+
const { toggleItem: o } = He(), r = "clarity-accordion", c = (p) => {
|
|
1317
|
+
!l && n && o(n), s == null || s(p);
|
|
1318
1318
|
};
|
|
1319
|
-
return /* @__PURE__ */
|
|
1319
|
+
return /* @__PURE__ */ w(
|
|
1320
1320
|
"button",
|
|
1321
1321
|
{
|
|
1322
1322
|
className: [`${r}__header`, e].filter(Boolean).join(" "),
|
|
1323
|
-
onClick:
|
|
1323
|
+
onClick: c,
|
|
1324
1324
|
disabled: l,
|
|
1325
1325
|
"aria-expanded": i,
|
|
1326
1326
|
"aria-controls": n ? `${r}-collapse-${n}` : void 0,
|
|
@@ -1341,7 +1341,7 @@ const Lt = ({
|
|
|
1341
1341
|
]
|
|
1342
1342
|
}
|
|
1343
1343
|
);
|
|
1344
|
-
},
|
|
1344
|
+
}, _t = ({
|
|
1345
1345
|
className: e = "",
|
|
1346
1346
|
children: t,
|
|
1347
1347
|
eventKey: s,
|
|
@@ -1360,19 +1360,19 @@ const Lt = ({
|
|
|
1360
1360
|
children: /* @__PURE__ */ a("div", { className: [`${i}__body`, e].filter(Boolean).join(" "), ...l, children: t })
|
|
1361
1361
|
}
|
|
1362
1362
|
);
|
|
1363
|
-
},
|
|
1364
|
-
Item:
|
|
1365
|
-
Header:
|
|
1366
|
-
Body:
|
|
1367
|
-
}),
|
|
1363
|
+
}, Ft = Object.assign(Ct, {
|
|
1364
|
+
Item: Nt,
|
|
1365
|
+
Header: wt,
|
|
1366
|
+
Body: _t
|
|
1367
|
+
}), Me = Q(
|
|
1368
1368
|
void 0
|
|
1369
|
-
),
|
|
1370
|
-
const e =
|
|
1369
|
+
), We = () => {
|
|
1370
|
+
const e = Z(Me);
|
|
1371
1371
|
if (!e)
|
|
1372
1372
|
throw new Error("useDropdown must be used within a DropdownProvider");
|
|
1373
1373
|
return e;
|
|
1374
|
-
},
|
|
1375
|
-
const { setIsOpen: t, triggerRef: s } =
|
|
1374
|
+
}, gt = ({ children: e }) => {
|
|
1375
|
+
const { setIsOpen: t, triggerRef: s } = We();
|
|
1376
1376
|
return /* @__PURE__ */ a(
|
|
1377
1377
|
"button",
|
|
1378
1378
|
{
|
|
@@ -1384,69 +1384,69 @@ const Lt = ({
|
|
|
1384
1384
|
children: e
|
|
1385
1385
|
}
|
|
1386
1386
|
);
|
|
1387
|
-
},
|
|
1388
|
-
const { isOpen: t, contentRef: s, styles: n } =
|
|
1387
|
+
}, $t = ({ children: e }) => {
|
|
1388
|
+
const { isOpen: t, contentRef: s, styles: n } = We();
|
|
1389
1389
|
return t ? /* @__PURE__ */ a("div", { ref: s, className: "dropdown__content", style: n, children: e }) : null;
|
|
1390
|
-
},
|
|
1391
|
-
const [n, l] =
|
|
1392
|
-
return
|
|
1390
|
+
}, kt = ({ children: e }) => /* @__PURE__ */ a("div", { className: "dropdown__menu", children: e }), xt = ({ as: e, children: t, ...s }) => /* @__PURE__ */ a(e || "a", { ...s, className: "dropdown__item", children: t }), Tt = () => /* @__PURE__ */ a("hr", { className: "dropdown__separator" }), oe = ({ title: e, position: t = "bottom", children: s }) => {
|
|
1391
|
+
const [n, l] = T(!1), [i, d] = T({}), o = M(null), r = M(null), c = M(null);
|
|
1392
|
+
return dt(() => {
|
|
1393
1393
|
if (n) {
|
|
1394
|
-
const
|
|
1395
|
-
if (!
|
|
1396
|
-
const m =
|
|
1394
|
+
const p = r.current, v = c.current;
|
|
1395
|
+
if (!p || !v) return;
|
|
1396
|
+
const m = p.getBoundingClientRect(), f = v.getBoundingClientRect(), u = window.innerHeight, h = window.innerWidth;
|
|
1397
1397
|
let y = t;
|
|
1398
|
-
t === "bottom" && m.bottom + f.height >
|
|
1399
|
-
const
|
|
1398
|
+
t === "bottom" && m.bottom + f.height > u && (y = "top"), t === "top" && m.top - f.height < 0 && (y = "bottom"), t === "right" && m.right + f.width > h && (y = "left"), t === "left" && m.left - f.width < 0 && (y = "right");
|
|
1399
|
+
const b = {};
|
|
1400
1400
|
switch (y) {
|
|
1401
1401
|
case "top":
|
|
1402
|
-
|
|
1402
|
+
b.bottom = m.height + 4, b.left = m.width / 2 - f.width / 2;
|
|
1403
1403
|
break;
|
|
1404
1404
|
case "right":
|
|
1405
|
-
|
|
1405
|
+
b.left = m.width + 4, b.top = m.height / 2 - f.height / 2;
|
|
1406
1406
|
break;
|
|
1407
1407
|
case "left":
|
|
1408
|
-
|
|
1408
|
+
b.right = m.width + 4, b.top = m.height / 2 - f.height / 2;
|
|
1409
1409
|
break;
|
|
1410
1410
|
case "bottom":
|
|
1411
1411
|
default:
|
|
1412
|
-
|
|
1412
|
+
b.top = m.height + 4, b.left = m.width / 2 - f.width / 2;
|
|
1413
1413
|
break;
|
|
1414
1414
|
}
|
|
1415
|
-
d(
|
|
1415
|
+
d(b);
|
|
1416
1416
|
}
|
|
1417
|
-
}, [n, t]),
|
|
1418
|
-
const
|
|
1419
|
-
|
|
1417
|
+
}, [n, t]), D(() => {
|
|
1418
|
+
const p = (v) => {
|
|
1419
|
+
o.current && !o.current.contains(v.target) && l(!1);
|
|
1420
1420
|
};
|
|
1421
|
-
return document.addEventListener("mousedown",
|
|
1422
|
-
document.removeEventListener("mousedown",
|
|
1421
|
+
return document.addEventListener("mousedown", p), () => {
|
|
1422
|
+
document.removeEventListener("mousedown", p);
|
|
1423
1423
|
};
|
|
1424
|
-
}, []), /* @__PURE__ */ a(
|
|
1424
|
+
}, []), /* @__PURE__ */ a(Me.Provider, { value: { isOpen: n, setIsOpen: l, triggerRef: r, contentRef: c, styles: i }, children: /* @__PURE__ */ a(
|
|
1425
1425
|
"div",
|
|
1426
1426
|
{
|
|
1427
|
-
ref:
|
|
1427
|
+
ref: o,
|
|
1428
1428
|
className: "dropdown",
|
|
1429
1429
|
title: e,
|
|
1430
1430
|
children: s
|
|
1431
1431
|
}
|
|
1432
1432
|
) });
|
|
1433
1433
|
};
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
const
|
|
1440
|
-
const e =
|
|
1434
|
+
oe.Trigger = gt;
|
|
1435
|
+
oe.Content = $t;
|
|
1436
|
+
oe.Menu = kt;
|
|
1437
|
+
oe.Item = xt;
|
|
1438
|
+
oe.Separator = Tt;
|
|
1439
|
+
const Fe = Q(null), Ge = () => {
|
|
1440
|
+
const e = Z(Fe);
|
|
1441
1441
|
if (!e)
|
|
1442
1442
|
throw new Error("useTabs must be used within a Tabs provider");
|
|
1443
1443
|
return e;
|
|
1444
|
-
},
|
|
1445
|
-
const { activeTab: n, setActiveTab: l, variant: i, orientation: d } =
|
|
1444
|
+
}, ze = ({ id: e, label: t, className: s = "" }) => {
|
|
1445
|
+
const { activeTab: n, setActiveTab: l, variant: i, orientation: d } = Ge(), o = n === e, r = [
|
|
1446
1446
|
"clarity-tab",
|
|
1447
1447
|
s,
|
|
1448
|
-
|
|
1449
|
-
|
|
1448
|
+
o ? "active" : "",
|
|
1449
|
+
o ? `variant-${i}` : "",
|
|
1450
1450
|
`orientation-${d}`
|
|
1451
1451
|
].filter(Boolean).join(" ");
|
|
1452
1452
|
return /* @__PURE__ */ a(
|
|
@@ -1455,21 +1455,21 @@ const Pe = U(null), Ve = () => {
|
|
|
1455
1455
|
className: r,
|
|
1456
1456
|
onClick: () => l(e),
|
|
1457
1457
|
role: "tab",
|
|
1458
|
-
"aria-selected":
|
|
1458
|
+
"aria-selected": o,
|
|
1459
1459
|
children: /* @__PURE__ */ a("span", { className: "clarity-tab-label", children: t })
|
|
1460
1460
|
}
|
|
1461
1461
|
);
|
|
1462
1462
|
};
|
|
1463
|
-
|
|
1464
|
-
const
|
|
1465
|
-
const { activeTab: n } =
|
|
1463
|
+
ze.displayName = "Tabs.Tab";
|
|
1464
|
+
const Ue = ({ id: e, children: t, className: s = "" }) => {
|
|
1465
|
+
const { activeTab: n } = Ge(), l = n === e, i = {
|
|
1466
1466
|
visibility: l ? "visible" : "hidden",
|
|
1467
1467
|
gridArea: "1 / 1"
|
|
1468
1468
|
};
|
|
1469
1469
|
return l || (i.pointerEvents = "none"), /* @__PURE__ */ a("div", { className: `clarity-tab-content ${s}`, role: "tabpanel", style: i, children: t });
|
|
1470
1470
|
};
|
|
1471
|
-
|
|
1472
|
-
const
|
|
1471
|
+
Ue.displayName = "Tabs.Content";
|
|
1472
|
+
const he = ({
|
|
1473
1473
|
children: e,
|
|
1474
1474
|
defaultTab: t,
|
|
1475
1475
|
variant: s = "primary",
|
|
@@ -1477,8 +1477,8 @@ const me = ({
|
|
|
1477
1477
|
className: l = "",
|
|
1478
1478
|
useUrl: i = !1
|
|
1479
1479
|
}) => {
|
|
1480
|
-
const d = () => window.location.hash.replace("#", ""), [
|
|
1481
|
-
|
|
1480
|
+
const d = () => window.location.hash.replace("#", ""), [o, r] = T(() => i && d() || t);
|
|
1481
|
+
D(() => {
|
|
1482
1482
|
if (i) {
|
|
1483
1483
|
const m = () => {
|
|
1484
1484
|
const f = d();
|
|
@@ -1489,24 +1489,24 @@ const me = ({
|
|
|
1489
1489
|
};
|
|
1490
1490
|
}
|
|
1491
1491
|
}, [i]);
|
|
1492
|
-
const
|
|
1492
|
+
const c = (m) => {
|
|
1493
1493
|
i && (window.location.hash = String(m)), r(m);
|
|
1494
|
-
},
|
|
1495
|
-
activeTab:
|
|
1496
|
-
setActiveTab:
|
|
1494
|
+
}, p = te(() => ({
|
|
1495
|
+
activeTab: o,
|
|
1496
|
+
setActiveTab: c,
|
|
1497
1497
|
variant: s,
|
|
1498
1498
|
orientation: n
|
|
1499
|
-
}), [
|
|
1499
|
+
}), [o, s, n]), v = [
|
|
1500
1500
|
"clarity-tabs-container",
|
|
1501
1501
|
l,
|
|
1502
1502
|
`orientation-${n}`
|
|
1503
1503
|
].filter(Boolean).join(" ");
|
|
1504
|
-
return /* @__PURE__ */ a(
|
|
1504
|
+
return /* @__PURE__ */ a(Fe.Provider, { value: p, children: /* @__PURE__ */ a("div", { className: v, children: e }) });
|
|
1505
1505
|
};
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
const
|
|
1506
|
+
he.Tab = ze;
|
|
1507
|
+
he.Content = Ue;
|
|
1508
|
+
he.displayName = "Tabs";
|
|
1509
|
+
const Gt = ({
|
|
1510
1510
|
content: e,
|
|
1511
1511
|
position: t = "top",
|
|
1512
1512
|
variant: s = "primary",
|
|
@@ -1514,69 +1514,69 @@ const It = ({
|
|
|
1514
1514
|
tone: l,
|
|
1515
1515
|
bgColor: i,
|
|
1516
1516
|
textColor: d,
|
|
1517
|
-
children:
|
|
1517
|
+
children: o,
|
|
1518
1518
|
className: r = "",
|
|
1519
|
-
disabled:
|
|
1520
|
-
delay:
|
|
1519
|
+
disabled: c = !1,
|
|
1520
|
+
delay: p = 200,
|
|
1521
1521
|
hideDelay: v = 100,
|
|
1522
1522
|
trigger: m = "hover",
|
|
1523
1523
|
arrow: f = !0,
|
|
1524
|
-
...
|
|
1524
|
+
...u
|
|
1525
1525
|
}) => {
|
|
1526
|
-
const [h, y] =
|
|
1526
|
+
const [h, y] = T(!1), [b, N] = T(null), B = M(null), x = M(null), _ = "clarity-tooltip", $ = !!i, L = n && l && !$;
|
|
1527
1527
|
let k = "";
|
|
1528
|
-
$ ? k = `${
|
|
1529
|
-
const
|
|
1530
|
-
|
|
1531
|
-
`${
|
|
1528
|
+
$ ? k = `${_}__content--custom-bg` : L ? k = `${_}__content--custom` : k = `${_}__content--${s}`;
|
|
1529
|
+
const j = [
|
|
1530
|
+
_,
|
|
1531
|
+
`${_}--${t}`,
|
|
1532
1532
|
r
|
|
1533
1533
|
].filter(Boolean).join(" "), I = [
|
|
1534
|
-
`${
|
|
1534
|
+
`${_}__content`,
|
|
1535
1535
|
k,
|
|
1536
|
-
f && `${
|
|
1536
|
+
f && `${_}__content--arrow`
|
|
1537
1537
|
].filter(Boolean).join(" "), A = {}, O = {};
|
|
1538
1538
|
$ && i && (O["--tooltip-bg-color"] = i), d && (O["--tooltip-text-color"] = d), L && n && l && (O["--tooltip-product"] = n, O["--tooltip-tone"] = l);
|
|
1539
1539
|
const g = {
|
|
1540
1540
|
...A,
|
|
1541
1541
|
...Object.keys(O).length > 0 ? O : {}
|
|
1542
|
-
}, H = () => {
|
|
1543
|
-
if (o) return;
|
|
1544
|
-
N && clearTimeout(N);
|
|
1545
|
-
const M = setTimeout(() => {
|
|
1546
|
-
y(!0);
|
|
1547
|
-
}, u);
|
|
1548
|
-
C(M);
|
|
1549
1542
|
}, V = () => {
|
|
1550
|
-
|
|
1551
|
-
|
|
1543
|
+
if (c) return;
|
|
1544
|
+
b && clearTimeout(b);
|
|
1545
|
+
const P = setTimeout(() => {
|
|
1546
|
+
y(!0);
|
|
1547
|
+
}, p);
|
|
1548
|
+
N(P);
|
|
1549
|
+
}, H = () => {
|
|
1550
|
+
b && clearTimeout(b);
|
|
1551
|
+
const P = setTimeout(() => {
|
|
1552
1552
|
y(!1);
|
|
1553
1553
|
}, v);
|
|
1554
|
-
|
|
1555
|
-
},
|
|
1556
|
-
|
|
1554
|
+
N(P);
|
|
1555
|
+
}, W = () => {
|
|
1556
|
+
c || y(!h);
|
|
1557
|
+
}, q = () => {
|
|
1558
|
+
c || V();
|
|
1557
1559
|
}, X = () => {
|
|
1558
|
-
|
|
1559
|
-
}, te = () => {
|
|
1560
|
-
V();
|
|
1560
|
+
H();
|
|
1561
1561
|
};
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
}, [
|
|
1565
|
-
const
|
|
1566
|
-
return m === "hover" ? (
|
|
1562
|
+
D(() => () => {
|
|
1563
|
+
b && clearTimeout(b);
|
|
1564
|
+
}, [b]);
|
|
1565
|
+
const F = {};
|
|
1566
|
+
return m === "hover" ? (F.onMouseEnter = V, F.onMouseLeave = H) : m === "click" ? F.onClick = W : m === "focus" && (F.onFocus = q, F.onBlur = X), /* @__PURE__ */ w(
|
|
1567
1567
|
"div",
|
|
1568
1568
|
{
|
|
1569
|
-
ref:
|
|
1570
|
-
className: `${
|
|
1571
|
-
...
|
|
1572
|
-
...
|
|
1569
|
+
ref: x,
|
|
1570
|
+
className: `${_}__trigger`,
|
|
1571
|
+
...F,
|
|
1572
|
+
...u,
|
|
1573
1573
|
children: [
|
|
1574
|
-
|
|
1574
|
+
o,
|
|
1575
1575
|
h && /* @__PURE__ */ a(
|
|
1576
1576
|
"div",
|
|
1577
1577
|
{
|
|
1578
|
-
ref:
|
|
1579
|
-
className:
|
|
1578
|
+
ref: B,
|
|
1579
|
+
className: j,
|
|
1580
1580
|
style: g,
|
|
1581
1581
|
role: "tooltip",
|
|
1582
1582
|
"aria-hidden": !h,
|
|
@@ -1586,12 +1586,12 @@ const It = ({
|
|
|
1586
1586
|
]
|
|
1587
1587
|
}
|
|
1588
1588
|
);
|
|
1589
|
-
},
|
|
1590
|
-
const e =
|
|
1589
|
+
}, qe = Q(null), ne = () => {
|
|
1590
|
+
const e = Z(qe);
|
|
1591
1591
|
if (!e)
|
|
1592
1592
|
throw new Error("useCommand must be used within a Command provider");
|
|
1593
1593
|
return e;
|
|
1594
|
-
},
|
|
1594
|
+
}, Je = ({
|
|
1595
1595
|
children: e,
|
|
1596
1596
|
className: t = "",
|
|
1597
1597
|
variant: s = "secondary",
|
|
@@ -1599,61 +1599,61 @@ const It = ({
|
|
|
1599
1599
|
inputPlaceholder: l = "Search...",
|
|
1600
1600
|
...i
|
|
1601
1601
|
}) => {
|
|
1602
|
-
const [d,
|
|
1602
|
+
const [d, o] = T(""), [r, c] = T(null), [p, v] = T(!1), m = [
|
|
1603
1603
|
"clarity-command",
|
|
1604
1604
|
`clarity-command--${s}`,
|
|
1605
1605
|
t
|
|
1606
|
-
].filter(Boolean).join(" "), f =
|
|
1606
|
+
].filter(Boolean).join(" "), f = te(() => ({
|
|
1607
1607
|
searchTerm: d,
|
|
1608
|
-
setSearchTerm:
|
|
1608
|
+
setSearchTerm: o,
|
|
1609
1609
|
value: r,
|
|
1610
|
-
setValue:
|
|
1610
|
+
setValue: c,
|
|
1611
1611
|
variant: s,
|
|
1612
1612
|
texts: {
|
|
1613
1613
|
empty: n,
|
|
1614
1614
|
inputPlaceholder: l
|
|
1615
1615
|
},
|
|
1616
|
-
isOpen:
|
|
1616
|
+
isOpen: p,
|
|
1617
1617
|
setIsOpen: v
|
|
1618
|
-
}), [d, r, s, n, l,
|
|
1619
|
-
return /* @__PURE__ */ a(
|
|
1618
|
+
}), [d, r, s, n, l, p]);
|
|
1619
|
+
return /* @__PURE__ */ a(qe.Provider, { value: f, children: /* @__PURE__ */ a("div", { className: m, ...i, children: e }) });
|
|
1620
1620
|
};
|
|
1621
|
-
|
|
1622
|
-
const
|
|
1623
|
-
const { setIsOpen: n, variant: l } =
|
|
1624
|
-
|
|
1621
|
+
Je.displayName = "Command";
|
|
1622
|
+
const Qe = ({ placeholder: e = "Search...", variant: t, onClick: s }) => {
|
|
1623
|
+
const { setIsOpen: n, variant: l } = ne(), [i, d] = T(!1);
|
|
1624
|
+
D(() => {
|
|
1625
1625
|
d(/Mac|iPod|iPhone|iPad/.test(navigator.platform));
|
|
1626
1626
|
}, []);
|
|
1627
1627
|
const r = [
|
|
1628
1628
|
"clarity-command-button",
|
|
1629
1629
|
`clarity-command-button--${t || l}`
|
|
1630
1630
|
].filter(Boolean).join(" ");
|
|
1631
|
-
return /* @__PURE__ */
|
|
1632
|
-
n(!0), s == null || s(
|
|
1631
|
+
return /* @__PURE__ */ w("button", { className: r, onClick: (p) => {
|
|
1632
|
+
n(!0), s == null || s(p);
|
|
1633
1633
|
}, children: [
|
|
1634
1634
|
/* @__PURE__ */ a("span", { children: e }),
|
|
1635
|
-
/* @__PURE__ */
|
|
1635
|
+
/* @__PURE__ */ w("kbd", { className: "clarity-command-shortcut", children: [
|
|
1636
1636
|
i ? "⌘" : "Ctrl+",
|
|
1637
1637
|
"K"
|
|
1638
1638
|
] })
|
|
1639
1639
|
] });
|
|
1640
1640
|
};
|
|
1641
|
-
|
|
1642
|
-
const
|
|
1643
|
-
const { isOpen: s, setIsOpen: n, variant: l } =
|
|
1644
|
-
return
|
|
1641
|
+
Qe.displayName = "Command.Button";
|
|
1642
|
+
const Ze = ({ children: e, ...t }) => {
|
|
1643
|
+
const { isOpen: s, setIsOpen: n, variant: l } = ne();
|
|
1644
|
+
return D(() => {
|
|
1645
1645
|
const i = (d) => {
|
|
1646
1646
|
d.key === "k" && (d.metaKey || d.ctrlKey) && (d.preventDefault(), n(!s));
|
|
1647
1647
|
};
|
|
1648
1648
|
return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
|
|
1649
|
-
}, [s, n]), /* @__PURE__ */ a(
|
|
1649
|
+
}, [s, n]), /* @__PURE__ */ a(K, { isOpen: s, onClose: () => n(!1), size: "large", closeOnOverlayClick: !0, children: /* @__PURE__ */ a("div", { className: `clarity-command--${l}`, children: e }) });
|
|
1650
1650
|
};
|
|
1651
|
-
|
|
1652
|
-
const
|
|
1653
|
-
const { searchTerm: s, setSearchTerm: n, variant: l, texts: i, isOpen: d } =
|
|
1654
|
-
|
|
1655
|
-
var
|
|
1656
|
-
d && ((
|
|
1651
|
+
Ze.displayName = "Command.Dialog";
|
|
1652
|
+
const Xe = ({ className: e = "", ...t }) => {
|
|
1653
|
+
const { searchTerm: s, setSearchTerm: n, variant: l, texts: i, isOpen: d } = ne(), o = M(null);
|
|
1654
|
+
D(() => {
|
|
1655
|
+
var c;
|
|
1656
|
+
d && ((c = o.current) == null || c.focus());
|
|
1657
1657
|
}, [d]);
|
|
1658
1658
|
const r = [
|
|
1659
1659
|
"clarity-command-input",
|
|
@@ -1663,84 +1663,84 @@ const Ue = ({ className: e = "", ...t }) => {
|
|
|
1663
1663
|
return /* @__PURE__ */ a("div", { className: "clarity-command-input__wrapper", children: /* @__PURE__ */ a(
|
|
1664
1664
|
"input",
|
|
1665
1665
|
{
|
|
1666
|
-
ref:
|
|
1666
|
+
ref: o,
|
|
1667
1667
|
className: r,
|
|
1668
1668
|
value: s,
|
|
1669
|
-
onChange: (
|
|
1669
|
+
onChange: (c) => n(c.target.value),
|
|
1670
1670
|
placeholder: t.placeholder || i.inputPlaceholder,
|
|
1671
1671
|
...t
|
|
1672
1672
|
}
|
|
1673
1673
|
) });
|
|
1674
1674
|
};
|
|
1675
|
-
|
|
1676
|
-
const
|
|
1677
|
-
const { searchTerm: n } =
|
|
1675
|
+
Xe.displayName = "Command.Input";
|
|
1676
|
+
const Ye = ({ children: e, className: t = "", ...s }) => {
|
|
1677
|
+
const { searchTerm: n } = ne();
|
|
1678
1678
|
let l = !1;
|
|
1679
|
-
const i = (r) =>
|
|
1679
|
+
const i = (r) => E.Children.toArray(r).map((c) => {
|
|
1680
1680
|
var v;
|
|
1681
|
-
if (!
|
|
1682
|
-
const
|
|
1683
|
-
if (
|
|
1681
|
+
if (!E.isValidElement(c)) return c;
|
|
1682
|
+
const p = c.type.displayName;
|
|
1683
|
+
if (p === "Command.Empty")
|
|
1684
1684
|
return null;
|
|
1685
|
-
if (
|
|
1686
|
-
return (((v =
|
|
1687
|
-
if (
|
|
1688
|
-
const m = i(
|
|
1689
|
-
return
|
|
1685
|
+
if (p === "Command.Item")
|
|
1686
|
+
return (((v = c.props.children) == null ? void 0 : v.toString().toLowerCase()) || "").includes(n.toLowerCase()) ? (l = !0, c) : null;
|
|
1687
|
+
if (p === "Command.Group") {
|
|
1688
|
+
const m = i(c.props.children);
|
|
1689
|
+
return E.Children.toArray(m).some((u) => E.isValidElement(u) && u.type.displayName === "Command.Item") ? E.cloneElement(c, { ...c.props, children: m }) : null;
|
|
1690
1690
|
}
|
|
1691
|
-
return
|
|
1692
|
-
}).filter(Boolean), d = i(e),
|
|
1693
|
-
return /* @__PURE__ */
|
|
1691
|
+
return c;
|
|
1692
|
+
}).filter(Boolean), d = i(e), o = ["clarity-command-list", t].filter(Boolean).join(" ");
|
|
1693
|
+
return /* @__PURE__ */ w("div", { className: o, ...s, children: [
|
|
1694
1694
|
d,
|
|
1695
|
-
!l && /* @__PURE__ */ a(
|
|
1695
|
+
!l && /* @__PURE__ */ a(ye, {})
|
|
1696
1696
|
] });
|
|
1697
1697
|
};
|
|
1698
|
-
|
|
1699
|
-
const
|
|
1700
|
-
const { texts: n } =
|
|
1698
|
+
Ye.displayName = "Command.List";
|
|
1699
|
+
const ye = ({ children: e, className: t = "", ...s }) => {
|
|
1700
|
+
const { texts: n } = ne(), l = ["clarity-command-empty", t].filter(Boolean).join(" ");
|
|
1701
1701
|
return /* @__PURE__ */ a("div", { className: l, ...s, children: e || s.emptyText || n.empty });
|
|
1702
1702
|
};
|
|
1703
|
-
|
|
1704
|
-
const
|
|
1703
|
+
ye.displayName = "Command.Empty";
|
|
1704
|
+
const Ke = ({ children: e, className: t = "", ...s }) => {
|
|
1705
1705
|
const n = ["clarity-command-group", t].filter(Boolean).join(" ");
|
|
1706
1706
|
return /* @__PURE__ */ a("div", { className: n, ...s, children: e });
|
|
1707
1707
|
};
|
|
1708
|
-
|
|
1709
|
-
const
|
|
1710
|
-
const { setValue: n, variant: l } =
|
|
1708
|
+
Ke.displayName = "Command.Group";
|
|
1709
|
+
const et = ({ children: e, className: t = "", ...s }) => {
|
|
1710
|
+
const { setValue: n, variant: l } = ne(), i = ["clarity-command-item", `clarity-command-item--${l}`, t].filter(Boolean).join(" ");
|
|
1711
1711
|
return /* @__PURE__ */ a("div", { className: i, onClick: () => n((e == null ? void 0 : e.toString()) || ""), ...s, children: e });
|
|
1712
1712
|
};
|
|
1713
|
-
|
|
1714
|
-
const
|
|
1713
|
+
et.displayName = "Command.Item";
|
|
1714
|
+
const tt = ({ className: e = "", ...t }) => {
|
|
1715
1715
|
const s = ["clarity-command-separator", e].filter(Boolean).join(" ");
|
|
1716
1716
|
return /* @__PURE__ */ a("hr", { className: s, ...t });
|
|
1717
1717
|
};
|
|
1718
|
-
|
|
1719
|
-
const
|
|
1718
|
+
tt.displayName = "Command.Separator";
|
|
1719
|
+
const st = ({ children: e, className: t = "", ...s }) => {
|
|
1720
1720
|
const n = ["clarity-command-shortcut", t].filter(Boolean).join(" ");
|
|
1721
1721
|
return /* @__PURE__ */ a("span", { className: n, ...s, children: e });
|
|
1722
1722
|
};
|
|
1723
|
-
|
|
1724
|
-
const
|
|
1725
|
-
Button:
|
|
1726
|
-
Dialog:
|
|
1727
|
-
Input:
|
|
1728
|
-
List:
|
|
1729
|
-
Empty:
|
|
1730
|
-
Group:
|
|
1731
|
-
Item:
|
|
1732
|
-
Separator:
|
|
1733
|
-
Shortcut:
|
|
1734
|
-
}),
|
|
1723
|
+
st.displayName = "Command.Shortcut";
|
|
1724
|
+
const zt = Object.assign(Je, {
|
|
1725
|
+
Button: Qe,
|
|
1726
|
+
Dialog: Ze,
|
|
1727
|
+
Input: Xe,
|
|
1728
|
+
List: Ye,
|
|
1729
|
+
Empty: ye,
|
|
1730
|
+
Group: Ke,
|
|
1731
|
+
Item: et,
|
|
1732
|
+
Separator: tt,
|
|
1733
|
+
Shortcut: st
|
|
1734
|
+
}), Bt = ({ columns: e, viewMode: t }) => {
|
|
1735
1735
|
const s = Array.from({ length: 5 }, (n, l) => l);
|
|
1736
|
-
return t === "card" ? /* @__PURE__ */
|
|
1736
|
+
return t === "card" ? /* @__PURE__ */ w("div", { className: "card-view-wrapper is-loading", children: [
|
|
1737
1737
|
/* @__PURE__ */ a("div", { className: "skeleton card-view-header" }),
|
|
1738
1738
|
/* @__PURE__ */ a("div", { className: "card-view-body", children: s.map((n) => /* @__PURE__ */ a("div", { className: "skeleton card-view-row" }, n)) })
|
|
1739
|
-
] }) : /* @__PURE__ */ a("div", { className: "table-wrapper is-loading", children: /* @__PURE__ */
|
|
1739
|
+
] }) : /* @__PURE__ */ a("div", { className: "table-wrapper is-loading", children: /* @__PURE__ */ w("table", { children: [
|
|
1740
1740
|
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ a("tr", { className: "table-row", children: e.map((n) => /* @__PURE__ */ a("th", { className: "table-header-cell", children: /* @__PURE__ */ a("div", { className: "skeleton skeleton-text" }) }, n.key)) }) }),
|
|
1741
1741
|
/* @__PURE__ */ a("tbody", { children: s.map((n) => /* @__PURE__ */ a("tr", { className: "table-row", children: e.map((l) => /* @__PURE__ */ a("td", { className: "table-cell", children: /* @__PURE__ */ a("div", { className: "skeleton skeleton-text" }) }, l.key)) }, n)) })
|
|
1742
1742
|
] }) });
|
|
1743
|
-
},
|
|
1743
|
+
}, Ut = ({
|
|
1744
1744
|
variant: e = "secondary",
|
|
1745
1745
|
columns: t,
|
|
1746
1746
|
data: s,
|
|
@@ -1748,47 +1748,47 @@ const Rt = Object.assign(Fe, {
|
|
|
1748
1748
|
isScrollable: l = !1,
|
|
1749
1749
|
isLoading: i = !1
|
|
1750
1750
|
}) => {
|
|
1751
|
-
const [d,
|
|
1752
|
-
|
|
1753
|
-
}, v =
|
|
1754
|
-
const y =
|
|
1755
|
-
return y <
|
|
1756
|
-
}), [s, d, r]), m = (
|
|
1751
|
+
const [d, o] = T(null), [r, c] = T("none"), p = (u) => {
|
|
1752
|
+
u.sortable && (d === u.key ? c((h) => h === "asc" ? "desc" : h === "desc" ? "none" : "asc") : (o(u.key), c("asc")));
|
|
1753
|
+
}, v = te(() => r === "none" || !d ? s : [...s].sort((u, h) => {
|
|
1754
|
+
const y = u[d], b = h[d];
|
|
1755
|
+
return y < b ? r === "asc" ? -1 : 1 : y > b ? r === "asc" ? 1 : -1 : 0;
|
|
1756
|
+
}), [s, d, r]), m = (u) => u.sortable ? d !== u.key || r === "none" ? /* @__PURE__ */ a("span", { className: "sort-icon", children: "↕" }) : r === "asc" ? /* @__PURE__ */ a("span", { className: "sort-icon", children: "↑" }) : /* @__PURE__ */ a("span", { className: "sort-icon", children: "↓" }) : null;
|
|
1757
1757
|
if (i)
|
|
1758
|
-
return /* @__PURE__ */ a(
|
|
1758
|
+
return /* @__PURE__ */ a(Bt, { columns: t, viewMode: n });
|
|
1759
1759
|
const f = `table-variant-${e} ${l ? "is-scrollable" : ""}`;
|
|
1760
|
-
return n === "card" ? /* @__PURE__ */
|
|
1761
|
-
/* @__PURE__ */ a("div", { className: `card-view-header table-header-cell-${e}`, children: t.map((
|
|
1760
|
+
return n === "card" ? /* @__PURE__ */ w("div", { className: `card-view-wrapper ${f}`, children: [
|
|
1761
|
+
/* @__PURE__ */ a("div", { className: `card-view-header table-header-cell-${e}`, children: t.map((u) => /* @__PURE__ */ w(
|
|
1762
1762
|
"div",
|
|
1763
1763
|
{
|
|
1764
|
-
className: `card-view-header-cell ${
|
|
1765
|
-
onClick: () => u
|
|
1766
|
-
style: { minWidth:
|
|
1764
|
+
className: `card-view-header-cell ${u.sortable ? "sortable" : ""}`,
|
|
1765
|
+
onClick: () => p(u),
|
|
1766
|
+
style: { minWidth: u.minWidth },
|
|
1767
1767
|
children: [
|
|
1768
|
-
|
|
1769
|
-
m(
|
|
1768
|
+
u.header,
|
|
1769
|
+
m(u)
|
|
1770
1770
|
]
|
|
1771
1771
|
},
|
|
1772
|
-
|
|
1772
|
+
u.key
|
|
1773
1773
|
)) }),
|
|
1774
|
-
/* @__PURE__ */ a("div", { className: "card-view-body", children: v.map((
|
|
1775
|
-
] }) : /* @__PURE__ */ a("div", { className: `table-wrapper ${f}`, children: /* @__PURE__ */
|
|
1776
|
-
/* @__PURE__ */ a("thead", { className: "table-header", children: /* @__PURE__ */ a("tr", { className: "table-row", children: t.map((
|
|
1774
|
+
/* @__PURE__ */ a("div", { className: "card-view-body", children: v.map((u, h) => /* @__PURE__ */ a("div", { className: `card-view-row table-row-${e}`, children: t.map((y) => /* @__PURE__ */ a("div", { className: `card-view-cell ${y.align ? `table-cell-align-${y.align}` : ""}`, style: { minWidth: y.minWidth }, children: y.render ? y.render(u) : u[y.key] }, y.key)) }, h)) })
|
|
1775
|
+
] }) : /* @__PURE__ */ a("div", { className: `table-wrapper ${f}`, children: /* @__PURE__ */ w("table", { children: [
|
|
1776
|
+
/* @__PURE__ */ a("thead", { className: "table-header", children: /* @__PURE__ */ a("tr", { className: "table-row", children: t.map((u) => /* @__PURE__ */ w(
|
|
1777
1777
|
"th",
|
|
1778
1778
|
{
|
|
1779
|
-
className: `table-header-cell ${
|
|
1780
|
-
onClick: () => u
|
|
1781
|
-
style: { minWidth:
|
|
1779
|
+
className: `table-header-cell ${u.sortable ? "sortable" : ""} table-header-cell-${e}`,
|
|
1780
|
+
onClick: () => p(u),
|
|
1781
|
+
style: { minWidth: u.minWidth },
|
|
1782
1782
|
children: [
|
|
1783
|
-
|
|
1784
|
-
m(
|
|
1783
|
+
u.header,
|
|
1784
|
+
m(u)
|
|
1785
1785
|
]
|
|
1786
1786
|
},
|
|
1787
|
-
|
|
1787
|
+
u.key
|
|
1788
1788
|
)) }) }),
|
|
1789
|
-
/* @__PURE__ */ a("tbody", { children: v.map((
|
|
1789
|
+
/* @__PURE__ */ a("tbody", { children: v.map((u, h) => /* @__PURE__ */ a("tr", { className: `table-row table-row-${e}`, children: t.map((y) => /* @__PURE__ */ a("td", { className: `table-cell ${y.align ? `table-cell-align-${y.align}` : ""}`, style: { minWidth: y.minWidth }, children: y.render ? y.render(u) : u[y.key] }, y.key)) }, h)) })
|
|
1790
1790
|
] }) });
|
|
1791
|
-
},
|
|
1791
|
+
}, qt = ({
|
|
1792
1792
|
variant: e = "primary",
|
|
1793
1793
|
product: t,
|
|
1794
1794
|
tone: s,
|
|
@@ -1796,7 +1796,7 @@ const Rt = Object.assign(Fe, {
|
|
|
1796
1796
|
color: l,
|
|
1797
1797
|
className: i = "",
|
|
1798
1798
|
"aria-label": d = "Carregando...",
|
|
1799
|
-
...
|
|
1799
|
+
...o
|
|
1800
1800
|
}) => {
|
|
1801
1801
|
const r = "clarity-spinner", v = l ? `${r}--custom` : t && s ? `${r}--custom` : `${r}--${e}`, m = [
|
|
1802
1802
|
r,
|
|
@@ -1811,7 +1811,7 @@ const Rt = Object.assign(Fe, {
|
|
|
1811
1811
|
style: f,
|
|
1812
1812
|
role: "status",
|
|
1813
1813
|
"aria-label": d,
|
|
1814
|
-
...
|
|
1814
|
+
...o,
|
|
1815
1815
|
children: /* @__PURE__ */ a("div", { className: `${r}__container`, children: /* @__PURE__ */ a(
|
|
1816
1816
|
"svg",
|
|
1817
1817
|
{
|
|
@@ -1833,7 +1833,7 @@ const Rt = Object.assign(Fe, {
|
|
|
1833
1833
|
) })
|
|
1834
1834
|
}
|
|
1835
1835
|
);
|
|
1836
|
-
},
|
|
1836
|
+
}, jt = ({
|
|
1837
1837
|
className: e = "",
|
|
1838
1838
|
noGutters: t,
|
|
1839
1839
|
justify: s,
|
|
@@ -1842,17 +1842,17 @@ const Rt = Object.assign(Fe, {
|
|
|
1842
1842
|
as: i = "div",
|
|
1843
1843
|
...d
|
|
1844
1844
|
}) => {
|
|
1845
|
-
const
|
|
1845
|
+
const o = [
|
|
1846
1846
|
"clarity-row",
|
|
1847
1847
|
t ? "clarity-row--no-gutters" : "",
|
|
1848
1848
|
s ? `clarity-row--justify-${s}` : "",
|
|
1849
1849
|
n ? `clarity-row--align-${n}` : "",
|
|
1850
1850
|
e
|
|
1851
1851
|
].filter(Boolean).join(" ");
|
|
1852
|
-
return
|
|
1852
|
+
return E.createElement(i, { className: o, ...d }, l);
|
|
1853
1853
|
};
|
|
1854
|
-
|
|
1855
|
-
const
|
|
1854
|
+
jt.displayName = "Row";
|
|
1855
|
+
const Et = (e) => `${e / 12 * 100}%`, Lt = (e) => `${e / 12 * 100}%`, St = ({
|
|
1856
1856
|
className: e = "",
|
|
1857
1857
|
xs: t,
|
|
1858
1858
|
sm: s,
|
|
@@ -1860,27 +1860,159 @@ const Ct = (e) => `${e / 12 * 100}%`, _t = (e) => `${e / 12 * 100}%`, wt = ({
|
|
|
1860
1860
|
lg: l,
|
|
1861
1861
|
xl: i,
|
|
1862
1862
|
xxl: d,
|
|
1863
|
-
offset:
|
|
1863
|
+
offset: o,
|
|
1864
1864
|
children: r,
|
|
1865
|
-
as:
|
|
1866
|
-
style:
|
|
1865
|
+
as: c = "div",
|
|
1866
|
+
style: p,
|
|
1867
1867
|
...v
|
|
1868
1868
|
}) => {
|
|
1869
|
-
const m = { ...
|
|
1870
|
-
if (
|
|
1871
|
-
const
|
|
1872
|
-
m[
|
|
1873
|
-
},
|
|
1874
|
-
if (
|
|
1875
|
-
const
|
|
1876
|
-
m[
|
|
1869
|
+
const m = { ...p }, f = (y, b) => {
|
|
1870
|
+
if (b === void 0) return;
|
|
1871
|
+
const N = `--clarity-col-width-${y}`;
|
|
1872
|
+
m[N] = typeof b == "number" ? Et(b) : "auto";
|
|
1873
|
+
}, u = (y, b) => {
|
|
1874
|
+
if (b === void 0) return;
|
|
1875
|
+
const N = `--clarity-col-offset-${y}`;
|
|
1876
|
+
m[N] = Lt(b);
|
|
1877
1877
|
};
|
|
1878
|
-
f("xs", t), f("sm", s), f("md", n), f("lg", l), f("xl", i), f("xxl", d),
|
|
1878
|
+
f("xs", t), f("sm", s), f("md", n), f("lg", l), f("xl", i), f("xxl", d), u("xs", o == null ? void 0 : o.xs), u("sm", o == null ? void 0 : o.sm), u("md", o == null ? void 0 : o.md), u("lg", o == null ? void 0 : o.lg), u("xl", o == null ? void 0 : o.xl), u("xxl", o == null ? void 0 : o.xxl);
|
|
1879
1879
|
const h = ["clarity-col", e].filter(Boolean).join(" ");
|
|
1880
|
-
return
|
|
1880
|
+
return E.createElement(c, { className: h, style: m, ...v }, r);
|
|
1881
1881
|
};
|
|
1882
|
-
|
|
1883
|
-
const
|
|
1882
|
+
St.displayName = "Col";
|
|
1883
|
+
const ve = {
|
|
1884
|
+
fontFamily: {
|
|
1885
|
+
sans: ["Inter", "system-ui", "sans-serif"],
|
|
1886
|
+
mono: ["Fira Code", "monospace"]
|
|
1887
|
+
},
|
|
1888
|
+
fontSize: {
|
|
1889
|
+
xs: "12px",
|
|
1890
|
+
sm: "14px",
|
|
1891
|
+
base: "16px",
|
|
1892
|
+
lg: "18px",
|
|
1893
|
+
xl: "20px",
|
|
1894
|
+
"2xl": "24px",
|
|
1895
|
+
"3xl": "30px"
|
|
1896
|
+
},
|
|
1897
|
+
fontWeight: {
|
|
1898
|
+
normal: 400,
|
|
1899
|
+
medium: 500,
|
|
1900
|
+
semibold: 600,
|
|
1901
|
+
bold: 700
|
|
1902
|
+
},
|
|
1903
|
+
letterSpacing: {
|
|
1904
|
+
tighter: "-0.05em",
|
|
1905
|
+
tight: "-0.025em",
|
|
1906
|
+
normal: "0em",
|
|
1907
|
+
wide: "0.025em",
|
|
1908
|
+
wider: "0.05em"
|
|
1909
|
+
}
|
|
1910
|
+
}, ue = (e) => {
|
|
1911
|
+
if (e) {
|
|
1912
|
+
if (e.includes(".")) {
|
|
1913
|
+
const [t, s] = e.split(".");
|
|
1914
|
+
return `var(--clarity-${t}-${s})`;
|
|
1915
|
+
}
|
|
1916
|
+
return `var(--clarity-${e})`;
|
|
1917
|
+
}
|
|
1918
|
+
}, U = (e) => e !== void 0 ? `var(--clarity-spacing-${e})` : void 0, de = E.forwardRef(({
|
|
1919
|
+
as: e,
|
|
1920
|
+
children: t,
|
|
1921
|
+
className: s,
|
|
1922
|
+
display: n,
|
|
1923
|
+
flexDirection: l,
|
|
1924
|
+
alignItems: i,
|
|
1925
|
+
justifyContent: d,
|
|
1926
|
+
gap: o,
|
|
1927
|
+
m: r,
|
|
1928
|
+
mt: c,
|
|
1929
|
+
mr: p,
|
|
1930
|
+
mb: v,
|
|
1931
|
+
ml: m,
|
|
1932
|
+
mx: f,
|
|
1933
|
+
my: u,
|
|
1934
|
+
p: h,
|
|
1935
|
+
pt: y,
|
|
1936
|
+
pr: b,
|
|
1937
|
+
pb: N,
|
|
1938
|
+
pl: B,
|
|
1939
|
+
px: x,
|
|
1940
|
+
py: _,
|
|
1941
|
+
bg: $,
|
|
1942
|
+
color: L,
|
|
1943
|
+
fontSize: k,
|
|
1944
|
+
fontWeight: j,
|
|
1945
|
+
textAlign: I,
|
|
1946
|
+
lineHeight: A,
|
|
1947
|
+
letterSpacing: O,
|
|
1948
|
+
borderRadius: g,
|
|
1949
|
+
boxShadow: V,
|
|
1950
|
+
borderWidth: H,
|
|
1951
|
+
borderTopWidth: W,
|
|
1952
|
+
borderRightWidth: q,
|
|
1953
|
+
borderBottomWidth: X,
|
|
1954
|
+
borderLeftWidth: F,
|
|
1955
|
+
borderXWidth: P,
|
|
1956
|
+
borderYWidth: Y,
|
|
1957
|
+
borderColor: le,
|
|
1958
|
+
...re
|
|
1959
|
+
}, ie) => {
|
|
1960
|
+
const C = e || "div", S = (R, J) => {
|
|
1961
|
+
if (R === void 0 || R === 0) return;
|
|
1962
|
+
const rt = `var(--clarity-border-width-${R})`, it = J ? ue(J) : "currentColor";
|
|
1963
|
+
return `${rt} solid ${it}`;
|
|
1964
|
+
}, G = {
|
|
1965
|
+
display: n,
|
|
1966
|
+
flexDirection: l,
|
|
1967
|
+
alignItems: i,
|
|
1968
|
+
justifyContent: d,
|
|
1969
|
+
gap: U(o),
|
|
1970
|
+
marginTop: U(c ?? u ?? r),
|
|
1971
|
+
marginRight: U(p ?? f ?? r),
|
|
1972
|
+
marginBottom: U(v ?? u ?? r),
|
|
1973
|
+
marginLeft: U(m ?? f ?? r),
|
|
1974
|
+
paddingTop: U(y ?? _ ?? h),
|
|
1975
|
+
paddingRight: U(b ?? x ?? h),
|
|
1976
|
+
paddingBottom: U(N ?? _ ?? h),
|
|
1977
|
+
paddingLeft: U(B ?? x ?? h),
|
|
1978
|
+
backgroundColor: $ ? ue($) : void 0,
|
|
1979
|
+
color: L ? ue(L) : void 0,
|
|
1980
|
+
fontSize: k ? `var(--clarity-font-size-${k})` : void 0,
|
|
1981
|
+
fontWeight: j ? ve.fontWeight[j] : void 0,
|
|
1982
|
+
textAlign: I,
|
|
1983
|
+
lineHeight: A,
|
|
1984
|
+
letterSpacing: O ? ve.letterSpacing[O] : void 0,
|
|
1985
|
+
borderRadius: g ? `var(--clarity-radius-${g})` : void 0,
|
|
1986
|
+
boxShadow: V ? `var(--clarity-shadow-${V})` : void 0,
|
|
1987
|
+
border: S(H, le),
|
|
1988
|
+
borderTop: S(W ?? Y),
|
|
1989
|
+
borderRight: S(q ?? P),
|
|
1990
|
+
borderBottom: S(X ?? Y),
|
|
1991
|
+
borderLeft: S(F ?? P)
|
|
1992
|
+
};
|
|
1993
|
+
return /* @__PURE__ */ a(C, { ref: ie, className: `clarity-box ${s || ""}`.trim(), style: G, ...re, children: t });
|
|
1994
|
+
}), at = ({ children: e, className: t }) => /* @__PURE__ */ a(de, { as: "header", p: 4, borderBottomWidth: 1, borderColor: "gray.200", className: t, children: e });
|
|
1995
|
+
at.displayName = "Card.Header";
|
|
1996
|
+
const nt = ({ children: e, className: t }) => /* @__PURE__ */ a(de, { p: 4, className: t, children: e });
|
|
1997
|
+
nt.displayName = "Card.Content";
|
|
1998
|
+
const lt = ({ children: e, className: t }) => /* @__PURE__ */ a(de, { as: "footer", p: 4, borderTopWidth: 1, borderColor: "gray.200", display: "flex", justifyContent: "flex-end", gap: 3, className: t, children: e });
|
|
1999
|
+
lt.displayName = "Card.Footer";
|
|
2000
|
+
const me = ({ children: e, ...t }) => /* @__PURE__ */ a(
|
|
2001
|
+
de,
|
|
2002
|
+
{
|
|
2003
|
+
bg: "white",
|
|
2004
|
+
borderRadius: 3,
|
|
2005
|
+
boxShadow: 1,
|
|
2006
|
+
overflow: "hidden",
|
|
2007
|
+
...t,
|
|
2008
|
+
children: e
|
|
2009
|
+
}
|
|
2010
|
+
);
|
|
2011
|
+
me.Header = at;
|
|
2012
|
+
me.Content = nt;
|
|
2013
|
+
me.Footer = lt;
|
|
2014
|
+
me.displayName = "Card";
|
|
2015
|
+
const Jt = {
|
|
1884
2016
|
primary: {
|
|
1885
2017
|
50: "#f0f9ff",
|
|
1886
2018
|
100: "#e0f2fe",
|
|
@@ -1929,7 +2061,7 @@ const Pt = {
|
|
|
1929
2061
|
800: "#065f46",
|
|
1930
2062
|
900: "#064e3b"
|
|
1931
2063
|
}
|
|
1932
|
-
},
|
|
2064
|
+
}, Qt = {
|
|
1933
2065
|
xs: "4px",
|
|
1934
2066
|
sm: "8px",
|
|
1935
2067
|
md: "16px",
|
|
@@ -1937,56 +2069,37 @@ const Pt = {
|
|
|
1937
2069
|
xl: "32px",
|
|
1938
2070
|
"2xl": "48px",
|
|
1939
2071
|
"3xl": "64px"
|
|
1940
|
-
},
|
|
1941
|
-
fontFamily: {
|
|
1942
|
-
sans: ["Inter", "system-ui", "sans-serif"],
|
|
1943
|
-
mono: ["Fira Code", "monospace"]
|
|
1944
|
-
},
|
|
1945
|
-
fontSize: {
|
|
1946
|
-
xs: "12px",
|
|
1947
|
-
sm: "14px",
|
|
1948
|
-
base: "16px",
|
|
1949
|
-
lg: "18px",
|
|
1950
|
-
xl: "20px",
|
|
1951
|
-
"2xl": "24px",
|
|
1952
|
-
"3xl": "30px"
|
|
1953
|
-
},
|
|
1954
|
-
fontWeight: {
|
|
1955
|
-
normal: 400,
|
|
1956
|
-
medium: 500,
|
|
1957
|
-
semibold: 600,
|
|
1958
|
-
bold: 700
|
|
1959
|
-
}
|
|
1960
|
-
}, Ht = (...e) => e.filter(Boolean).join(" "), Wt = () => Math.random().toString(36).substr(2, 9);
|
|
2072
|
+
}, Zt = (...e) => e.filter(Boolean).join(" "), Xt = () => Math.random().toString(36).substr(2, 9);
|
|
1961
2073
|
export {
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
2074
|
+
Ft as Accordion,
|
|
2075
|
+
Dt as Badge,
|
|
2076
|
+
At as Button,
|
|
2077
|
+
Pt as ButtonGroup,
|
|
2078
|
+
Mt as ButtonIcon,
|
|
2079
|
+
Wt as ButtonLink,
|
|
2080
|
+
me as Card,
|
|
2081
|
+
vt as CheckInput,
|
|
2082
|
+
St as Col,
|
|
2083
|
+
zt as Command,
|
|
2084
|
+
ee as ConfirmationDialog,
|
|
2085
|
+
oe as Dropdown,
|
|
2086
|
+
ut as Input,
|
|
2087
|
+
bt as InputSwitch,
|
|
2088
|
+
K as Modal,
|
|
2089
|
+
ht as MultiSelect,
|
|
2090
|
+
ae as Offcanvas,
|
|
2091
|
+
jt as Row,
|
|
2092
|
+
ft as Select,
|
|
2093
|
+
qt as Spinner,
|
|
2094
|
+
Ut as Table,
|
|
2095
|
+
he as Tabs,
|
|
2096
|
+
pt as Textarea,
|
|
2097
|
+
Ht as ToastProvider,
|
|
2098
|
+
Gt as Tooltip,
|
|
2099
|
+
Zt as cn,
|
|
2100
|
+
Jt as colors,
|
|
2101
|
+
Xt as generateId,
|
|
2102
|
+
Qt as spacing,
|
|
2103
|
+
ve as typography,
|
|
2104
|
+
Vt as useToast
|
|
1992
2105
|
};
|