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