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