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