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