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