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