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