beth-clarity 1.2.3 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/clarity-design-system.es.js +1059 -1059
- package/dist/clarity-design-system.umd.js +2 -2
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +0 -1
- package/dist/components/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/components/CheckInput/CheckInput.d.ts +2 -0
- package/dist/components/CheckInput/CheckInput.d.ts.map +1 -1
- package/dist/components/InputSwitch/InputSwitch.d.ts +2 -0
- package/dist/components/InputSwitch/InputSwitch.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts +2 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +2 -0
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts +2 -0
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/styles/index.css +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as e, jsxs as w, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as w, Fragment as St } from "react/jsx-runtime";
|
|
2
|
+
import W, { useState as z, useRef as at, useEffect as Q, useLayoutEffect as Et, forwardRef as we, isValidElement as ot, createContext as ct, cloneElement as rt, useContext as dt, useMemo as gt, useCallback as _t, Children as Ne } from "react";
|
|
3
|
+
import Ce, { createPortal as $e } from "react-dom";
|
|
4
|
+
const ta = ({
|
|
5
5
|
variant: t = "primary",
|
|
6
6
|
size: a = "medium",
|
|
7
7
|
bgColor: r,
|
|
@@ -13,21 +13,21 @@ const Ke = ({
|
|
|
13
13
|
...d
|
|
14
14
|
}) => {
|
|
15
15
|
const i = "clarity-badge", u = !!r;
|
|
16
|
-
let
|
|
17
|
-
u ?
|
|
16
|
+
let y = "";
|
|
17
|
+
u ? y = `${i}--custom-bg` : y = `${i}--${t}`;
|
|
18
18
|
const p = [
|
|
19
19
|
i,
|
|
20
|
-
|
|
20
|
+
y,
|
|
21
21
|
`${i}--${a}`,
|
|
22
22
|
s ? `${i}--rounded` : "",
|
|
23
23
|
c ? `${i}--outlined` : "",
|
|
24
24
|
o
|
|
25
|
-
].filter(Boolean).join(" "),
|
|
26
|
-
return u && (
|
|
25
|
+
].filter(Boolean).join(" "), f = {};
|
|
26
|
+
return u && (f.backgroundColor = r, l && (f.color = l)), /* @__PURE__ */ e(
|
|
27
27
|
"span",
|
|
28
28
|
{
|
|
29
29
|
className: p,
|
|
30
|
-
style:
|
|
30
|
+
style: f,
|
|
31
31
|
...d,
|
|
32
32
|
children: n
|
|
33
33
|
}
|
|
@@ -59,7 +59,7 @@ const Ke = ({
|
|
|
59
59
|
wide: "0.025em",
|
|
60
60
|
wider: "0.05em"
|
|
61
61
|
}
|
|
62
|
-
},
|
|
62
|
+
}, $t = (t) => {
|
|
63
63
|
if (t) {
|
|
64
64
|
if (t.startsWith("#") || t.startsWith("rgb") || t.startsWith("hsl") || t === "transparent")
|
|
65
65
|
return t;
|
|
@@ -69,7 +69,7 @@ const Ke = ({
|
|
|
69
69
|
}
|
|
70
70
|
return `var(--clarity-${t})`;
|
|
71
71
|
}
|
|
72
|
-
}, nt = (t) => t !== void 0 ? `var(--clarity-spacing-${t})` : void 0,
|
|
72
|
+
}, nt = (t) => t !== void 0 ? `var(--clarity-spacing-${t})` : void 0, xe = W.forwardRef(
|
|
73
73
|
(t, a) => {
|
|
74
74
|
const {
|
|
75
75
|
children: r,
|
|
@@ -81,80 +81,80 @@ const Ke = ({
|
|
|
81
81
|
justifyContent: d,
|
|
82
82
|
gap: i,
|
|
83
83
|
m: u,
|
|
84
|
-
mt:
|
|
84
|
+
mt: y,
|
|
85
85
|
mr: p,
|
|
86
|
-
mb:
|
|
87
|
-
ml:
|
|
88
|
-
mx:
|
|
86
|
+
mb: f,
|
|
87
|
+
ml: b,
|
|
88
|
+
mx: v,
|
|
89
89
|
my: N,
|
|
90
90
|
p: m,
|
|
91
|
-
pt:
|
|
92
|
-
pr:
|
|
91
|
+
pt: g,
|
|
92
|
+
pr: C,
|
|
93
93
|
pb: x,
|
|
94
|
-
pl:
|
|
95
|
-
px:
|
|
96
|
-
py:
|
|
97
|
-
bg:
|
|
98
|
-
color:
|
|
99
|
-
fontSize:
|
|
100
|
-
fontWeight:
|
|
101
|
-
textAlign:
|
|
102
|
-
lineHeight:
|
|
103
|
-
letterSpacing:
|
|
104
|
-
borderRadius:
|
|
105
|
-
borderTopLeftRadius:
|
|
106
|
-
borderTopRightRadius:
|
|
107
|
-
borderBottomLeftRadius:
|
|
108
|
-
borderBottomRightRadius:
|
|
109
|
-
boxShadow:
|
|
110
|
-
borderWidth:
|
|
111
|
-
borderTopWidth:
|
|
112
|
-
borderRightWidth:
|
|
113
|
-
borderBottomWidth:
|
|
114
|
-
borderLeftWidth:
|
|
115
|
-
borderXWidth:
|
|
116
|
-
borderYWidth:
|
|
117
|
-
borderColor:
|
|
118
|
-
overflow:
|
|
119
|
-
...
|
|
120
|
-
} = t,
|
|
121
|
-
if (
|
|
122
|
-
const
|
|
123
|
-
return `${
|
|
124
|
-
},
|
|
94
|
+
pl: B,
|
|
95
|
+
px: k,
|
|
96
|
+
py: j,
|
|
97
|
+
bg: $,
|
|
98
|
+
color: S,
|
|
99
|
+
fontSize: _,
|
|
100
|
+
fontWeight: M,
|
|
101
|
+
textAlign: I,
|
|
102
|
+
lineHeight: E,
|
|
103
|
+
letterSpacing: X,
|
|
104
|
+
borderRadius: L,
|
|
105
|
+
borderTopLeftRadius: U,
|
|
106
|
+
borderTopRightRadius: H,
|
|
107
|
+
borderBottomLeftRadius: D,
|
|
108
|
+
borderBottomRightRadius: V,
|
|
109
|
+
boxShadow: F,
|
|
110
|
+
borderWidth: tt,
|
|
111
|
+
borderTopWidth: K,
|
|
112
|
+
borderRightWidth: Y,
|
|
113
|
+
borderBottomWidth: P,
|
|
114
|
+
borderLeftWidth: R,
|
|
115
|
+
borderXWidth: Z,
|
|
116
|
+
borderYWidth: q,
|
|
117
|
+
borderColor: A,
|
|
118
|
+
overflow: et,
|
|
119
|
+
...lt
|
|
120
|
+
} = t, h = (T, G) => {
|
|
121
|
+
if (T === void 0 || T === 0) return;
|
|
122
|
+
const J = `var(--clarity-border-width-${T})`, it = G ? $t(G) : "currentColor";
|
|
123
|
+
return `${J} solid ${it}`;
|
|
124
|
+
}, O = W.useMemo(() => ({
|
|
125
125
|
display: n,
|
|
126
126
|
position: o,
|
|
127
127
|
flexDirection: s,
|
|
128
128
|
alignItems: c,
|
|
129
129
|
justifyContent: d,
|
|
130
130
|
gap: nt(i),
|
|
131
|
-
marginTop: nt(
|
|
132
|
-
marginRight: nt(p ??
|
|
133
|
-
marginBottom: nt(
|
|
134
|
-
marginLeft: nt(
|
|
135
|
-
paddingTop: nt(
|
|
136
|
-
paddingRight: nt(
|
|
137
|
-
paddingBottom: nt(x ??
|
|
138
|
-
paddingLeft: nt(
|
|
139
|
-
backgroundColor:
|
|
140
|
-
color:
|
|
141
|
-
fontSize:
|
|
142
|
-
fontWeight:
|
|
143
|
-
textAlign:
|
|
144
|
-
lineHeight:
|
|
145
|
-
letterSpacing:
|
|
146
|
-
borderRadius:
|
|
147
|
-
borderTopLeftRadius:
|
|
148
|
-
borderTopRightRadius:
|
|
149
|
-
borderBottomLeftRadius:
|
|
150
|
-
borderBottomRightRadius:
|
|
151
|
-
boxShadow:
|
|
152
|
-
border:
|
|
153
|
-
borderTop:
|
|
154
|
-
borderRight:
|
|
155
|
-
borderBottom:
|
|
156
|
-
borderLeft:
|
|
157
|
-
overflow:
|
|
131
|
+
marginTop: nt(y ?? N ?? u),
|
|
132
|
+
marginRight: nt(p ?? v ?? u),
|
|
133
|
+
marginBottom: nt(f ?? N ?? u),
|
|
134
|
+
marginLeft: nt(b ?? v ?? u),
|
|
135
|
+
paddingTop: nt(g ?? j ?? m),
|
|
136
|
+
paddingRight: nt(C ?? k ?? m),
|
|
137
|
+
paddingBottom: nt(x ?? j ?? m),
|
|
138
|
+
paddingLeft: nt(B ?? k ?? m),
|
|
139
|
+
backgroundColor: $ ? $t($) : void 0,
|
|
140
|
+
color: S ? $t(S) : void 0,
|
|
141
|
+
fontSize: _ ? `var(--clarity-font-size-${_})` : void 0,
|
|
142
|
+
fontWeight: M ? Bt.fontWeight[M] : void 0,
|
|
143
|
+
textAlign: I,
|
|
144
|
+
lineHeight: E,
|
|
145
|
+
letterSpacing: X ? Bt.letterSpacing[X] : void 0,
|
|
146
|
+
borderRadius: L ? `var(--clarity-radius-${L})` : void 0,
|
|
147
|
+
borderTopLeftRadius: U ? `var(--clarity-radius-${U})` : void 0,
|
|
148
|
+
borderTopRightRadius: H ? `var(--clarity-radius-${H})` : void 0,
|
|
149
|
+
borderBottomLeftRadius: D ? `var(--clarity-radius-${D})` : void 0,
|
|
150
|
+
borderBottomRightRadius: V ? `var(--clarity-radius-${V})` : void 0,
|
|
151
|
+
boxShadow: F ? `var(--clarity-shadow-${F})` : void 0,
|
|
152
|
+
border: h(tt, A),
|
|
153
|
+
borderTop: h(K ?? q),
|
|
154
|
+
borderRight: h(Y ?? Z),
|
|
155
|
+
borderBottom: h(P ?? q),
|
|
156
|
+
borderLeft: h(R ?? Z),
|
|
157
|
+
overflow: et
|
|
158
158
|
}), [
|
|
159
159
|
n,
|
|
160
160
|
o,
|
|
@@ -163,47 +163,47 @@ const Ke = ({
|
|
|
163
163
|
d,
|
|
164
164
|
i,
|
|
165
165
|
u,
|
|
166
|
-
|
|
166
|
+
y,
|
|
167
167
|
p,
|
|
168
|
-
|
|
169
|
-
g,
|
|
168
|
+
f,
|
|
170
169
|
b,
|
|
170
|
+
v,
|
|
171
171
|
N,
|
|
172
172
|
m,
|
|
173
|
-
|
|
174
|
-
_,
|
|
175
|
-
x,
|
|
176
|
-
E,
|
|
173
|
+
g,
|
|
177
174
|
C,
|
|
175
|
+
x,
|
|
178
176
|
B,
|
|
179
|
-
R,
|
|
180
|
-
$,
|
|
181
177
|
k,
|
|
182
|
-
|
|
183
|
-
|
|
178
|
+
j,
|
|
179
|
+
$,
|
|
184
180
|
S,
|
|
185
|
-
|
|
181
|
+
_,
|
|
186
182
|
M,
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
183
|
+
I,
|
|
184
|
+
E,
|
|
185
|
+
X,
|
|
190
186
|
L,
|
|
187
|
+
U,
|
|
188
|
+
H,
|
|
189
|
+
D,
|
|
190
|
+
V,
|
|
191
|
+
F,
|
|
192
|
+
tt,
|
|
191
193
|
K,
|
|
194
|
+
Y,
|
|
192
195
|
P,
|
|
196
|
+
R,
|
|
193
197
|
Z,
|
|
194
198
|
q,
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
X,
|
|
198
|
-
V,
|
|
199
|
-
Y,
|
|
200
|
-
lt
|
|
199
|
+
A,
|
|
200
|
+
et
|
|
201
201
|
]);
|
|
202
|
-
return /* @__PURE__ */ e("div", { ref: a, className: `clarity-box ${l || ""}`.trim(), style:
|
|
202
|
+
return /* @__PURE__ */ e("div", { ref: a, className: `clarity-box ${l || ""}`.trim(), style: O, ...lt, children: r });
|
|
203
203
|
}
|
|
204
204
|
);
|
|
205
|
-
|
|
206
|
-
const
|
|
205
|
+
xe.displayName = "Box";
|
|
206
|
+
const ke = ({
|
|
207
207
|
variant: t = "primary",
|
|
208
208
|
size: a = "medium",
|
|
209
209
|
disabled: r = !1,
|
|
@@ -215,101 +215,96 @@ const Pe = ({
|
|
|
215
215
|
title: d,
|
|
216
216
|
customColor: i,
|
|
217
217
|
customColorHover: u,
|
|
218
|
-
...
|
|
218
|
+
...y
|
|
219
219
|
}) => {
|
|
220
|
-
const p = "clarity-button",
|
|
220
|
+
const p = "clarity-button", f = [
|
|
221
221
|
p,
|
|
222
222
|
!i && `${p}--${t}`,
|
|
223
223
|
`${p}--${a}`,
|
|
224
224
|
l && `${p}--loading`,
|
|
225
225
|
r && `${p}--disabled`,
|
|
226
226
|
c
|
|
227
|
-
].filter(Boolean).join(" "),
|
|
228
|
-
return i && (
|
|
227
|
+
].filter(Boolean).join(" "), b = {};
|
|
228
|
+
return i && (b["--button-bg"] = i, b["--button-hover-bg"] = u || `${i}E6`, b["--button-border"] = i, b["--button-hover-border"] = u || `${i}E6`, b["--button-fg"] = "#fff"), /* @__PURE__ */ w(
|
|
229
229
|
"button",
|
|
230
230
|
{
|
|
231
|
-
className:
|
|
232
|
-
style:
|
|
231
|
+
className: f,
|
|
232
|
+
style: b,
|
|
233
233
|
disabled: r || l,
|
|
234
234
|
onClick: o,
|
|
235
235
|
type: s,
|
|
236
236
|
title: d,
|
|
237
|
-
...
|
|
237
|
+
...y,
|
|
238
238
|
children: [
|
|
239
239
|
l && /* @__PURE__ */ e("div", { className: `${p}__spinner` }),
|
|
240
240
|
n
|
|
241
241
|
]
|
|
242
242
|
}
|
|
243
243
|
);
|
|
244
|
-
},
|
|
244
|
+
}, ea = ({
|
|
245
245
|
variant: t = "primary",
|
|
246
246
|
size: a = "medium",
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
...i
|
|
247
|
+
items: r,
|
|
248
|
+
value: l,
|
|
249
|
+
multiple: n = !1,
|
|
250
|
+
disabled: o = !1,
|
|
251
|
+
onChange: s,
|
|
252
|
+
className: c = "",
|
|
253
|
+
...d
|
|
255
254
|
}) => {
|
|
256
|
-
const
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
!
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
if (!(N != null && N.disabled))
|
|
267
|
-
if (o) {
|
|
268
|
-
const m = Array.isArray(n) ? n : [], y = m.includes(b) ? m.filter((_) => _ !== b) : [...m, b];
|
|
269
|
-
c(y);
|
|
255
|
+
const i = "clarity-button-group", u = [
|
|
256
|
+
i,
|
|
257
|
+
c
|
|
258
|
+
].filter(Boolean).join(" "), y = (f) => {
|
|
259
|
+
if (o || !s) return;
|
|
260
|
+
const b = r.find((v) => v.id === f);
|
|
261
|
+
if (!(b != null && b.disabled))
|
|
262
|
+
if (n) {
|
|
263
|
+
const v = Array.isArray(l) ? l : [], N = v.includes(f) ? v.filter((m) => m !== f) : [...v, f];
|
|
264
|
+
s(N);
|
|
270
265
|
} else
|
|
271
|
-
|
|
272
|
-
},
|
|
266
|
+
s(f);
|
|
267
|
+
}, p = (f) => n ? Array.isArray(l) && l.includes(f) : l === f;
|
|
273
268
|
return /* @__PURE__ */ e(
|
|
274
269
|
"div",
|
|
275
270
|
{
|
|
276
|
-
className:
|
|
271
|
+
className: u,
|
|
277
272
|
role: "group",
|
|
278
|
-
...
|
|
279
|
-
children:
|
|
280
|
-
const
|
|
281
|
-
`${
|
|
282
|
-
|
|
283
|
-
b
|
|
284
|
-
|
|
285
|
-
N === l.length - 1 && `${u}__item--last`
|
|
273
|
+
...d,
|
|
274
|
+
children: r.map((f, b) => {
|
|
275
|
+
const v = p(f.id), N = v ? t : `${t}-outline`, m = [
|
|
276
|
+
`${i}__item`,
|
|
277
|
+
v && `${i}__item--selected`,
|
|
278
|
+
b === 0 && `${i}__item--first`,
|
|
279
|
+
b === r.length - 1 && `${i}__item--last`
|
|
286
280
|
].filter(Boolean).join(" ");
|
|
287
281
|
return /* @__PURE__ */ w(
|
|
288
|
-
|
|
282
|
+
ke,
|
|
289
283
|
{
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
284
|
+
variant: N,
|
|
285
|
+
size: a,
|
|
286
|
+
className: m,
|
|
287
|
+
onClick: () => y(f.id),
|
|
288
|
+
disabled: o || f.disabled,
|
|
289
|
+
"aria-pressed": v,
|
|
295
290
|
children: [
|
|
296
|
-
|
|
297
|
-
/* @__PURE__ */ e("span", { className: `${
|
|
291
|
+
f.icon && /* @__PURE__ */ e("span", { className: `${i}__item-icon`, children: f.icon }),
|
|
292
|
+
/* @__PURE__ */ e("span", { className: `${i}__item-label`, children: f.label })
|
|
298
293
|
]
|
|
299
294
|
},
|
|
300
|
-
|
|
295
|
+
f.id
|
|
301
296
|
);
|
|
302
297
|
})
|
|
303
298
|
}
|
|
304
299
|
);
|
|
305
300
|
};
|
|
306
|
-
var
|
|
301
|
+
var Lt = {
|
|
307
302
|
color: void 0,
|
|
308
303
|
size: void 0,
|
|
309
304
|
className: void 0,
|
|
310
305
|
style: void 0,
|
|
311
306
|
attr: void 0
|
|
312
|
-
},
|
|
307
|
+
}, jt = W.createContext && W.createContext(Lt), st = function() {
|
|
313
308
|
return st = Object.assign || function(t) {
|
|
314
309
|
for (var a, r = 1, l = arguments.length; r < l; r++) {
|
|
315
310
|
a = arguments[r];
|
|
@@ -317,31 +312,31 @@ var Et = {
|
|
|
317
312
|
}
|
|
318
313
|
return t;
|
|
319
314
|
}, st.apply(this, arguments);
|
|
320
|
-
},
|
|
315
|
+
}, Te = function(t, a) {
|
|
321
316
|
var r = {};
|
|
322
317
|
for (var l in t) Object.prototype.hasOwnProperty.call(t, l) && a.indexOf(l) < 0 && (r[l] = t[l]);
|
|
323
318
|
if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var n = 0, l = Object.getOwnPropertySymbols(t); n < l.length; n++)
|
|
324
319
|
a.indexOf(l[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, l[n]) && (r[l[n]] = t[l[n]]);
|
|
325
320
|
return r;
|
|
326
321
|
};
|
|
327
|
-
function
|
|
322
|
+
function Rt(t) {
|
|
328
323
|
return t && t.map(function(a, r) {
|
|
329
|
-
return
|
|
324
|
+
return W.createElement(a.tag, st({
|
|
330
325
|
key: r
|
|
331
|
-
}, a.attr),
|
|
326
|
+
}, a.attr), Rt(a.child));
|
|
332
327
|
});
|
|
333
328
|
}
|
|
334
|
-
function
|
|
329
|
+
function Be(t) {
|
|
335
330
|
return function(a) {
|
|
336
|
-
return
|
|
331
|
+
return W.createElement(je, st({
|
|
337
332
|
attr: st({}, t.attr)
|
|
338
|
-
}, a),
|
|
333
|
+
}, a), Rt(t.child));
|
|
339
334
|
};
|
|
340
335
|
}
|
|
341
|
-
function
|
|
336
|
+
function je(t) {
|
|
342
337
|
var a = function(r) {
|
|
343
|
-
var l = t.attr, n = t.size, o = t.title, s =
|
|
344
|
-
return r.className && (d = r.className), t.className && (d = (d ? d + " " : "") + t.className),
|
|
338
|
+
var l = t.attr, n = t.size, o = t.title, s = Te(t, ["attr", "size", "title"]), c = n || r.size || "1em", d;
|
|
339
|
+
return r.className && (d = r.className), t.className && (d = (d ? d + " " : "") + t.className), W.createElement("svg", st({
|
|
345
340
|
stroke: "currentColor",
|
|
346
341
|
fill: "currentColor",
|
|
347
342
|
strokeWidth: "0"
|
|
@@ -353,16 +348,16 @@ function ke(t) {
|
|
|
353
348
|
height: c,
|
|
354
349
|
width: c,
|
|
355
350
|
xmlns: "http://www.w3.org/2000/svg"
|
|
356
|
-
}), o &&
|
|
351
|
+
}), o && W.createElement("title", null, o), t.children);
|
|
357
352
|
};
|
|
358
|
-
return
|
|
353
|
+
return jt !== void 0 ? W.createElement(jt.Consumer, null, function(r) {
|
|
359
354
|
return a(r);
|
|
360
|
-
}) : a(
|
|
355
|
+
}) : a(Lt);
|
|
361
356
|
}
|
|
362
|
-
function
|
|
363
|
-
return
|
|
357
|
+
function pt(t) {
|
|
358
|
+
return Be({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z" } }] })(t);
|
|
364
359
|
}
|
|
365
|
-
const
|
|
360
|
+
const yt = ({
|
|
366
361
|
content: t,
|
|
367
362
|
position: a = "top",
|
|
368
363
|
variant: r = "primary",
|
|
@@ -374,28 +369,28 @@ const pt = ({
|
|
|
374
369
|
disabled: d = !1,
|
|
375
370
|
delay: i = 200,
|
|
376
371
|
hideDelay: u = 100,
|
|
377
|
-
trigger:
|
|
372
|
+
trigger: y = "hover",
|
|
378
373
|
arrow: p = !0,
|
|
379
|
-
...
|
|
374
|
+
...f
|
|
380
375
|
}) => {
|
|
381
|
-
const [
|
|
382
|
-
let
|
|
383
|
-
|
|
384
|
-
const
|
|
385
|
-
|
|
386
|
-
`${
|
|
376
|
+
const [b, v] = z(!1), [N, m] = z(a), [g, C] = z({ top: 0, left: 0 }), [x, B] = z(null), k = at(null), j = at(null), $ = "clarity-tooltip", S = 8, _ = !!l || o;
|
|
377
|
+
let M = "";
|
|
378
|
+
_ ? M = `${$}__content--custom-bg` : M = `${$}__content--${r}`;
|
|
379
|
+
const I = [
|
|
380
|
+
$,
|
|
381
|
+
`${$}--${N}`,
|
|
387
382
|
c
|
|
388
|
-
].filter(Boolean).join(" "),
|
|
389
|
-
`${
|
|
390
|
-
|
|
391
|
-
p && `${
|
|
392
|
-
].filter(Boolean).join(" "),
|
|
393
|
-
|
|
394
|
-
const
|
|
395
|
-
...
|
|
396
|
-
...Object.keys(
|
|
397
|
-
top:
|
|
398
|
-
left:
|
|
383
|
+
].filter(Boolean).join(" "), E = [
|
|
384
|
+
`${$}__content`,
|
|
385
|
+
M,
|
|
386
|
+
p && `${$}__content--arrow`
|
|
387
|
+
].filter(Boolean).join(" "), X = {}, L = {};
|
|
388
|
+
_ && (L["--tooltip-bg-color"] = l || "#FFFFFF"), (n || o) && (L["--tooltip-text-color"] = n || "var(--clarity-gray-900)");
|
|
389
|
+
const U = {
|
|
390
|
+
...X,
|
|
391
|
+
...Object.keys(L).length > 0 ? L : {},
|
|
392
|
+
top: g.top,
|
|
393
|
+
left: g.left,
|
|
399
394
|
// Resetar estilos que vêm do CSS para posicionamento relativo
|
|
400
395
|
position: "absolute",
|
|
401
396
|
bottom: "auto",
|
|
@@ -404,72 +399,72 @@ const pt = ({
|
|
|
404
399
|
transform: "none",
|
|
405
400
|
zIndex: 99999
|
|
406
401
|
// Garantir que fique acima de modais (geralmente 1000-2000)
|
|
407
|
-
},
|
|
402
|
+
}, H = () => {
|
|
408
403
|
if (d) return;
|
|
409
404
|
x && clearTimeout(x);
|
|
410
|
-
const
|
|
411
|
-
|
|
405
|
+
const R = setTimeout(() => {
|
|
406
|
+
v(!0);
|
|
412
407
|
}, i);
|
|
413
|
-
|
|
414
|
-
},
|
|
408
|
+
B(R);
|
|
409
|
+
}, D = () => {
|
|
415
410
|
x && clearTimeout(x);
|
|
416
|
-
const
|
|
417
|
-
|
|
411
|
+
const R = setTimeout(() => {
|
|
412
|
+
v(!1);
|
|
418
413
|
}, u);
|
|
419
|
-
|
|
420
|
-
},
|
|
421
|
-
d || (
|
|
422
|
-
},
|
|
423
|
-
d ||
|
|
424
|
-
},
|
|
425
|
-
|
|
414
|
+
B(R);
|
|
415
|
+
}, V = () => {
|
|
416
|
+
d || (b ? D() : H());
|
|
417
|
+
}, F = () => {
|
|
418
|
+
d || H();
|
|
419
|
+
}, tt = () => {
|
|
420
|
+
D();
|
|
426
421
|
};
|
|
427
|
-
|
|
422
|
+
Q(() => () => {
|
|
428
423
|
x && clearTimeout(x);
|
|
429
424
|
}, [x]);
|
|
430
|
-
const
|
|
431
|
-
if (!
|
|
432
|
-
const
|
|
425
|
+
const K = () => {
|
|
426
|
+
if (!b || !j.current || !k.current) return;
|
|
427
|
+
const R = j.current.getBoundingClientRect(), Z = k.current.getBoundingClientRect(), q = window.scrollX, A = window.scrollY, et = window.innerWidth, lt = window.innerHeight, h = {
|
|
433
428
|
top: {
|
|
434
|
-
top:
|
|
435
|
-
left:
|
|
429
|
+
top: R.top + A - Z.height - S,
|
|
430
|
+
left: R.left + q + (R.width - Z.width) / 2
|
|
436
431
|
},
|
|
437
432
|
bottom: {
|
|
438
|
-
top:
|
|
439
|
-
left:
|
|
433
|
+
top: R.bottom + A + S,
|
|
434
|
+
left: R.left + q + (R.width - Z.width) / 2
|
|
440
435
|
},
|
|
441
436
|
left: {
|
|
442
|
-
top:
|
|
443
|
-
left:
|
|
437
|
+
top: R.top + A + (R.height - Z.height) / 2,
|
|
438
|
+
left: R.left + q - Z.width - S
|
|
444
439
|
},
|
|
445
440
|
right: {
|
|
446
|
-
top:
|
|
447
|
-
left:
|
|
441
|
+
top: R.top + A + (R.height - Z.height) / 2,
|
|
442
|
+
left: R.right + q + S
|
|
448
443
|
},
|
|
449
444
|
"top-left": {
|
|
450
|
-
top:
|
|
451
|
-
left:
|
|
445
|
+
top: R.top + A - Z.height - S,
|
|
446
|
+
left: R.left + q
|
|
452
447
|
},
|
|
453
448
|
"top-right": {
|
|
454
|
-
top:
|
|
455
|
-
left:
|
|
449
|
+
top: R.top + A - Z.height - S,
|
|
450
|
+
left: R.right + q - Z.width
|
|
456
451
|
},
|
|
457
452
|
"bottom-left": {
|
|
458
|
-
top:
|
|
459
|
-
left:
|
|
453
|
+
top: R.bottom + A + S,
|
|
454
|
+
left: R.left + q
|
|
460
455
|
},
|
|
461
456
|
"bottom-right": {
|
|
462
|
-
top:
|
|
463
|
-
left:
|
|
457
|
+
top: R.bottom + A + S,
|
|
458
|
+
left: R.right + q - Z.width
|
|
464
459
|
}
|
|
465
460
|
};
|
|
466
|
-
let
|
|
467
|
-
const
|
|
468
|
-
const
|
|
469
|
-
return it >= 0 && it +
|
|
461
|
+
let O = a;
|
|
462
|
+
const T = (G) => {
|
|
463
|
+
const J = h[G], it = J.top - A, ft = J.left - q;
|
|
464
|
+
return it >= 0 && it + Z.height <= lt && ft >= 0 && ft + Z.width <= et;
|
|
470
465
|
};
|
|
471
|
-
if (!
|
|
472
|
-
const
|
|
466
|
+
if (!T(O)) {
|
|
467
|
+
const J = {
|
|
473
468
|
top: "bottom",
|
|
474
469
|
bottom: "top",
|
|
475
470
|
left: "right",
|
|
@@ -478,53 +473,53 @@ const pt = ({
|
|
|
478
473
|
"top-right": "bottom-right",
|
|
479
474
|
"bottom-left": "top-left",
|
|
480
475
|
"bottom-right": "top-right"
|
|
481
|
-
}[
|
|
482
|
-
|
|
476
|
+
}[O];
|
|
477
|
+
J && T(J) && (O = J);
|
|
483
478
|
}
|
|
484
|
-
if (m(
|
|
485
|
-
const
|
|
486
|
-
|
|
479
|
+
if (m(O), C(h[O]), k.current) {
|
|
480
|
+
const G = Math.round(R.width / 2);
|
|
481
|
+
k.current.style.setProperty("--tooltip-arrow-offset", `${G}px`);
|
|
487
482
|
}
|
|
488
483
|
};
|
|
489
|
-
|
|
490
|
-
if (
|
|
491
|
-
return
|
|
492
|
-
window.removeEventListener("scroll",
|
|
484
|
+
Et(() => {
|
|
485
|
+
if (b)
|
|
486
|
+
return K(), window.addEventListener("scroll", K, !0), window.addEventListener("resize", K), () => {
|
|
487
|
+
window.removeEventListener("scroll", K, !0), window.removeEventListener("resize", K);
|
|
493
488
|
};
|
|
494
|
-
}, [
|
|
495
|
-
const
|
|
496
|
-
let
|
|
489
|
+
}, [b, a, t]);
|
|
490
|
+
const Y = {};
|
|
491
|
+
let P = y;
|
|
497
492
|
if (typeof window < "u") {
|
|
498
|
-
const
|
|
499
|
-
|
|
493
|
+
const R = "ontouchstart" in window || navigator.maxTouchPoints > 0 || window.matchMedia && window.matchMedia("(pointer: coarse)").matches;
|
|
494
|
+
y === "hover" && R && (P = "focus");
|
|
500
495
|
}
|
|
501
|
-
return
|
|
496
|
+
return P === "hover" ? (Y.onMouseEnter = H, Y.onMouseLeave = D) : P === "click" ? Y.onClick = V : P === "focus" && (Y.onFocus = F, Y.onBlur = tt), /* @__PURE__ */ w(St, { children: [
|
|
502
497
|
/* @__PURE__ */ e(
|
|
503
498
|
"div",
|
|
504
499
|
{
|
|
505
|
-
ref:
|
|
506
|
-
className: `${
|
|
507
|
-
...
|
|
508
|
-
...
|
|
500
|
+
ref: j,
|
|
501
|
+
className: `${$}__trigger`,
|
|
502
|
+
...Y,
|
|
503
|
+
...f,
|
|
509
504
|
children: s
|
|
510
505
|
}
|
|
511
506
|
),
|
|
512
|
-
|
|
507
|
+
b && $e(
|
|
513
508
|
/* @__PURE__ */ e(
|
|
514
509
|
"div",
|
|
515
510
|
{
|
|
516
|
-
ref:
|
|
517
|
-
className:
|
|
518
|
-
style:
|
|
511
|
+
ref: k,
|
|
512
|
+
className: I,
|
|
513
|
+
style: U,
|
|
519
514
|
role: "tooltip",
|
|
520
|
-
"aria-hidden": !
|
|
521
|
-
children: /* @__PURE__ */ e("div", { className:
|
|
515
|
+
"aria-hidden": !b,
|
|
516
|
+
children: /* @__PURE__ */ e("div", { className: E, children: t })
|
|
522
517
|
}
|
|
523
518
|
),
|
|
524
519
|
document.body
|
|
525
520
|
)
|
|
526
521
|
] });
|
|
527
|
-
},
|
|
522
|
+
}, Se = W.forwardRef(({
|
|
528
523
|
variant: t = "primary",
|
|
529
524
|
size: a = "medium",
|
|
530
525
|
label: r,
|
|
@@ -536,335 +531,337 @@ const pt = ({
|
|
|
536
531
|
helper: d = !1,
|
|
537
532
|
helperPosition: i = "top-right",
|
|
538
533
|
className: u = "",
|
|
539
|
-
disabled:
|
|
534
|
+
disabled: y = !1,
|
|
540
535
|
value: p,
|
|
541
|
-
defaultValue:
|
|
542
|
-
onFocus:
|
|
543
|
-
onBlur:
|
|
536
|
+
defaultValue: f,
|
|
537
|
+
onFocus: b,
|
|
538
|
+
onBlur: v,
|
|
544
539
|
...N
|
|
545
540
|
}, m) => {
|
|
546
|
-
const [
|
|
547
|
-
|
|
548
|
-
const
|
|
549
|
-
|
|
550
|
-
}, [p,
|
|
551
|
-
const
|
|
552
|
-
if (!
|
|
553
|
-
const
|
|
554
|
-
const
|
|
555
|
-
|
|
541
|
+
const [g, C] = z(!1), [x, B] = z(!1), k = at(null), j = N.id || `input-${Math.random().toString(36).substr(2, 9)}`, $ = at(null), [S, _] = z(!1);
|
|
542
|
+
W.useImperativeHandle(m, () => k.current), Q(() => {
|
|
543
|
+
const H = k.current;
|
|
544
|
+
H && B(H.value.length > 0);
|
|
545
|
+
}, [p, f]), Q(() => {
|
|
546
|
+
const H = $.current;
|
|
547
|
+
if (!H) return;
|
|
548
|
+
const D = () => {
|
|
549
|
+
const F = H.scrollWidth > H.clientWidth;
|
|
550
|
+
_((tt) => tt !== F ? F : tt);
|
|
556
551
|
};
|
|
557
|
-
|
|
558
|
-
const
|
|
559
|
-
return
|
|
560
|
-
}, [r,
|
|
561
|
-
const
|
|
562
|
-
|
|
563
|
-
},
|
|
564
|
-
|
|
565
|
-
},
|
|
552
|
+
D();
|
|
553
|
+
const V = new ResizeObserver(() => D());
|
|
554
|
+
return V.observe(H), () => V.disconnect();
|
|
555
|
+
}, [r, g, x, a, s, c]);
|
|
556
|
+
const M = (H) => {
|
|
557
|
+
C(!0), b == null || b(H);
|
|
558
|
+
}, I = (H) => {
|
|
559
|
+
C(!1), B(H.target.value.length > 0), v == null || v(H);
|
|
560
|
+
}, E = [
|
|
566
561
|
"clarity-input",
|
|
567
562
|
"clarity-input--outlined",
|
|
568
563
|
`clarity-input--${a}`,
|
|
569
564
|
t && `clarity-input--${t}`,
|
|
570
565
|
n && "clarity-input--error",
|
|
571
|
-
|
|
572
|
-
|
|
566
|
+
y && "clarity-input--disabled",
|
|
567
|
+
g && "clarity-input--focused",
|
|
573
568
|
x && "clarity-input--has-value",
|
|
574
569
|
s && "clarity-input--with-start-icon",
|
|
575
570
|
c && "clarity-input--with-end-icon",
|
|
576
571
|
u
|
|
577
|
-
].filter(Boolean).join(" "),
|
|
572
|
+
].filter(Boolean).join(" "), X = [
|
|
578
573
|
"clarity-input__label",
|
|
579
|
-
|
|
580
|
-
].filter(Boolean).join(" "),
|
|
574
|
+
S && "clarity-input__label--truncate"
|
|
575
|
+
].filter(Boolean).join(" "), L = i != null && i.endsWith("left") ? "left" : "right", U = (H, D) => {
|
|
581
576
|
if (!d) return null;
|
|
582
|
-
const
|
|
577
|
+
const V = typeof d == "object" ? d : void 0, F = (V == null ? void 0 : V.content) ?? "Ajuda", tt = (V == null ? void 0 : V.plain) === !0, K = V == null ? void 0 : V.variant, Y = V == null ? void 0 : V.bgColor, P = V == null ? void 0 : V.textColor;
|
|
583
578
|
return /* @__PURE__ */ e(
|
|
584
|
-
|
|
579
|
+
yt,
|
|
585
580
|
{
|
|
586
|
-
content:
|
|
587
|
-
position:
|
|
581
|
+
content: F,
|
|
582
|
+
position: H === "middle" ? D === "left" ? "left" : "right" : H === "top" ? D === "left" ? "top-left" : "top-right" : D === "left" ? "bottom-left" : "bottom-right",
|
|
588
583
|
trigger: "hover",
|
|
589
|
-
variant:
|
|
590
|
-
plain:
|
|
591
|
-
bgColor:
|
|
592
|
-
textColor:
|
|
593
|
-
children: /* @__PURE__ */ e("button", { type: "button", className: "clarity-input__helper-icon", "aria-label": "Helper", children: /* @__PURE__ */ e(
|
|
584
|
+
variant: K || t,
|
|
585
|
+
plain: tt,
|
|
586
|
+
bgColor: Y,
|
|
587
|
+
textColor: P,
|
|
588
|
+
children: /* @__PURE__ */ e("button", { type: "button", className: "clarity-input__helper-icon", "aria-label": "Helper", children: /* @__PURE__ */ e(pt, { size: H === "middle" ? 20 : 16 }) })
|
|
594
589
|
}
|
|
595
590
|
);
|
|
596
591
|
};
|
|
597
592
|
return /* @__PURE__ */ w("div", { className: "clarity-input-wrapper", children: [
|
|
598
|
-
d && (i == null ? void 0 : i.startsWith("top")) && /* @__PURE__ */ e("div", { className: `clarity-input__helper-row clarity-input__helper-row--top clarity-input__helper-row--${
|
|
599
|
-
d && (i != null && i.startsWith("middle")) ? /* @__PURE__ */ w("div", { className: `clarity-input__middle-row clarity-input__middle-row--${
|
|
600
|
-
|
|
601
|
-
/* @__PURE__ */ w("div", { className:
|
|
593
|
+
d && (i == null ? void 0 : i.startsWith("top")) && /* @__PURE__ */ e("div", { className: `clarity-input__helper-row clarity-input__helper-row--top clarity-input__helper-row--${L}`, children: U("top", L) }),
|
|
594
|
+
d && (i != null && i.startsWith("middle")) ? /* @__PURE__ */ w("div", { className: `clarity-input__middle-row clarity-input__middle-row--${L}`, children: [
|
|
595
|
+
L === "left" && U("middle", L),
|
|
596
|
+
/* @__PURE__ */ w("div", { className: E, children: [
|
|
602
597
|
s && /* @__PURE__ */ e("div", { className: "clarity-input__start-icon", children: s }),
|
|
603
598
|
/* @__PURE__ */ w("div", { className: "clarity-input__field", children: [
|
|
604
599
|
/* @__PURE__ */ e(
|
|
605
600
|
"input",
|
|
606
601
|
{
|
|
607
|
-
ref:
|
|
608
|
-
id:
|
|
602
|
+
ref: k,
|
|
603
|
+
id: j,
|
|
609
604
|
className: "clarity-input__element",
|
|
610
|
-
disabled:
|
|
605
|
+
disabled: y,
|
|
611
606
|
value: p,
|
|
612
|
-
defaultValue:
|
|
613
|
-
onFocus:
|
|
614
|
-
onBlur:
|
|
607
|
+
defaultValue: f,
|
|
608
|
+
onFocus: M,
|
|
609
|
+
onBlur: I,
|
|
615
610
|
"aria-label": l,
|
|
616
611
|
...N
|
|
617
612
|
}
|
|
618
613
|
),
|
|
619
|
-
r && /* @__PURE__ */ e("label", { ref:
|
|
614
|
+
r && /* @__PURE__ */ e("label", { ref: $, className: X, htmlFor: j, children: r })
|
|
620
615
|
] }),
|
|
621
616
|
c && /* @__PURE__ */ e("div", { className: "clarity-input__end-icon", children: c })
|
|
622
617
|
] }),
|
|
623
|
-
|
|
624
|
-
] }) : /* @__PURE__ */ w("div", { className:
|
|
618
|
+
L === "right" && U("middle", L)
|
|
619
|
+
] }) : /* @__PURE__ */ w("div", { className: E, children: [
|
|
625
620
|
s && /* @__PURE__ */ e("div", { className: "clarity-input__start-icon", children: s }),
|
|
626
621
|
/* @__PURE__ */ w("div", { className: "clarity-input__field", children: [
|
|
627
622
|
/* @__PURE__ */ e(
|
|
628
623
|
"input",
|
|
629
624
|
{
|
|
630
|
-
ref:
|
|
631
|
-
id:
|
|
625
|
+
ref: k,
|
|
626
|
+
id: j,
|
|
632
627
|
className: "clarity-input__element",
|
|
633
|
-
disabled:
|
|
628
|
+
disabled: y,
|
|
634
629
|
value: p,
|
|
635
|
-
defaultValue:
|
|
636
|
-
onFocus:
|
|
637
|
-
onBlur:
|
|
630
|
+
defaultValue: f,
|
|
631
|
+
onFocus: M,
|
|
632
|
+
onBlur: I,
|
|
638
633
|
"aria-label": l,
|
|
639
634
|
...N
|
|
640
635
|
}
|
|
641
636
|
),
|
|
642
|
-
r && /* @__PURE__ */ e("label", { ref:
|
|
637
|
+
r && /* @__PURE__ */ e("label", { ref: $, className: X, htmlFor: j, children: r })
|
|
643
638
|
] }),
|
|
644
639
|
c && /* @__PURE__ */ e("div", { className: "clarity-input__end-icon", children: c })
|
|
645
640
|
] }),
|
|
646
|
-
d && (i == null ? void 0 : i.startsWith("bottom")) && /* @__PURE__ */ e("div", { className: `clarity-input__helper-row clarity-input__helper-row--bottom clarity-input__helper-row--${
|
|
647
|
-
n && o && /* @__PURE__ */ e("div", { className: "clarity-input__helper-text", children: o })
|
|
641
|
+
d && (i == null ? void 0 : i.startsWith("bottom")) && /* @__PURE__ */ e("div", { className: `clarity-input__helper-row clarity-input__helper-row--bottom clarity-input__helper-row--${L}`, children: U("bottom", L) }),
|
|
642
|
+
(n && o || reserveErrorSpace) && /* @__PURE__ */ e("div", { className: "clarity-input__helper-text", style: o ? void 0 : { minHeight: "1.2em" }, children: o || " " })
|
|
648
643
|
] });
|
|
649
644
|
});
|
|
650
|
-
|
|
651
|
-
const
|
|
645
|
+
Se.displayName = "Input";
|
|
646
|
+
const Ee = W.forwardRef(({
|
|
652
647
|
variant: t = "primary",
|
|
653
648
|
size: a = "medium",
|
|
654
649
|
label: r,
|
|
655
650
|
helper: l = !1,
|
|
656
651
|
helperPosition: n = "middle-right",
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
652
|
+
reserveErrorSpace: o = !1,
|
|
653
|
+
error: s = !1,
|
|
654
|
+
errorMessage: c,
|
|
655
|
+
startIcon: d,
|
|
656
|
+
endIcon: i,
|
|
657
|
+
className: u = "",
|
|
658
|
+
disabled: y = !1,
|
|
659
|
+
value: p,
|
|
660
|
+
defaultValue: f,
|
|
661
|
+
onFocus: b,
|
|
662
|
+
onBlur: v,
|
|
663
|
+
rows: N = 3,
|
|
664
|
+
minHeight: m,
|
|
665
|
+
maxHeight: g,
|
|
666
|
+
resizable: C = !0,
|
|
667
|
+
...x
|
|
668
|
+
}, B) => {
|
|
669
|
+
const [k, j] = z(!1), [$, S] = z(!1), _ = at(null);
|
|
670
|
+
W.useImperativeHandle(B, () => _.current), Q(() => {
|
|
671
|
+
const D = _.current;
|
|
672
|
+
D && S(D.value.length > 0);
|
|
673
|
+
}, [p, f]);
|
|
674
|
+
const M = (D) => {
|
|
675
|
+
j(!0), b == null || b(D);
|
|
676
|
+
}, I = (D) => {
|
|
677
|
+
j(!1), S(D.target.value.length > 0), v == null || v(D);
|
|
678
|
+
}, E = [
|
|
683
679
|
"clarity-textarea",
|
|
684
680
|
"clarity-textarea--outlined",
|
|
685
681
|
`clarity-textarea--${a}`,
|
|
686
682
|
t && `clarity-textarea--${t}`,
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
].filter(Boolean).join(" "),
|
|
695
|
-
resize:
|
|
696
|
-
minHeight:
|
|
697
|
-
maxHeight:
|
|
698
|
-
},
|
|
683
|
+
s && "clarity-textarea--error",
|
|
684
|
+
y && "clarity-textarea--disabled",
|
|
685
|
+
k && "clarity-textarea--focused",
|
|
686
|
+
$ && "clarity-textarea--has-value",
|
|
687
|
+
d && "clarity-textarea--with-start-icon",
|
|
688
|
+
i && "clarity-textarea--with-end-icon",
|
|
689
|
+
u
|
|
690
|
+
].filter(Boolean).join(" "), X = {
|
|
691
|
+
resize: C ? "vertical" : "none",
|
|
692
|
+
minHeight: m ? `${m}px` : void 0,
|
|
693
|
+
maxHeight: g ? `${g}px` : void 0
|
|
694
|
+
}, L = n != null && n.endsWith("left") ? "left" : "right", U = (D, V) => {
|
|
699
695
|
if (!l) return null;
|
|
700
|
-
const
|
|
696
|
+
const F = typeof l == "object" ? l : void 0, tt = (F == null ? void 0 : F.content) ?? "Ajuda", K = (F == null ? void 0 : F.plain) === !0, Y = F == null ? void 0 : F.variant, P = F == null ? void 0 : F.bgColor, R = F == null ? void 0 : F.textColor;
|
|
701
697
|
return /* @__PURE__ */ e(
|
|
702
|
-
|
|
698
|
+
yt,
|
|
703
699
|
{
|
|
704
|
-
content:
|
|
705
|
-
position:
|
|
700
|
+
content: tt,
|
|
701
|
+
position: D === "middle" ? V === "left" ? "left" : "right" : D === "top" ? V === "left" ? "top-left" : "top-right" : V === "left" ? "bottom-left" : "bottom-right",
|
|
706
702
|
trigger: "hover",
|
|
707
|
-
variant:
|
|
708
|
-
plain:
|
|
709
|
-
bgColor:
|
|
710
|
-
textColor:
|
|
711
|
-
children: /* @__PURE__ */ e("button", { type: "button", className: "clarity-textarea__helper-icon", "aria-label": "Helper", children: /* @__PURE__ */ e(
|
|
703
|
+
variant: Y || t,
|
|
704
|
+
plain: K,
|
|
705
|
+
bgColor: P,
|
|
706
|
+
textColor: R,
|
|
707
|
+
children: /* @__PURE__ */ e("button", { type: "button", className: "clarity-textarea__helper-icon", "aria-label": "Helper", children: /* @__PURE__ */ e(pt, { size: D === "middle" ? 20 : 16 }) })
|
|
712
708
|
}
|
|
713
709
|
);
|
|
714
|
-
},
|
|
715
|
-
/* @__PURE__ */ w("div", { className:
|
|
716
|
-
|
|
710
|
+
}, H = /* @__PURE__ */ w("div", { className: "clarity-textarea-wrapper", children: [
|
|
711
|
+
/* @__PURE__ */ w("div", { className: E, children: [
|
|
712
|
+
d && /* @__PURE__ */ e("div", { className: "clarity-textarea__start-icon", children: d }),
|
|
717
713
|
/* @__PURE__ */ w("div", { className: "clarity-textarea__field", children: [
|
|
718
714
|
/* @__PURE__ */ e(
|
|
719
715
|
"textarea",
|
|
720
716
|
{
|
|
721
|
-
ref:
|
|
717
|
+
ref: _,
|
|
722
718
|
className: "clarity-textarea__element",
|
|
723
|
-
disabled:
|
|
724
|
-
value:
|
|
725
|
-
defaultValue:
|
|
726
|
-
onFocus:
|
|
727
|
-
onBlur:
|
|
728
|
-
rows:
|
|
729
|
-
style:
|
|
730
|
-
...
|
|
719
|
+
disabled: y,
|
|
720
|
+
value: p,
|
|
721
|
+
defaultValue: f,
|
|
722
|
+
onFocus: M,
|
|
723
|
+
onBlur: I,
|
|
724
|
+
rows: N,
|
|
725
|
+
style: X,
|
|
726
|
+
...x
|
|
731
727
|
}
|
|
732
728
|
),
|
|
733
729
|
r && /* @__PURE__ */ e("label", { className: "clarity-textarea__label", children: r })
|
|
734
730
|
] }),
|
|
735
|
-
|
|
731
|
+
i && /* @__PURE__ */ e("div", { className: "clarity-textarea__end-icon", children: i })
|
|
736
732
|
] }),
|
|
737
|
-
|
|
733
|
+
(s && c || o) && /* @__PURE__ */ e("div", { className: "clarity-textarea__helper-text", style: c ? void 0 : { minHeight: "1.2em" }, children: c || " " })
|
|
738
734
|
] });
|
|
739
735
|
return /* @__PURE__ */ w("div", { className: "clarity-textarea-container", children: [
|
|
740
|
-
l && (n == null ? void 0 : n.startsWith("top")) && /* @__PURE__ */ e("div", { className: `clarity-textarea__helper-row clarity-textarea__helper-row--top clarity-textarea__helper-row--${
|
|
741
|
-
l && (n != null && n.startsWith("middle")) ? /* @__PURE__ */ w("div", { className: `clarity-textarea__middle-row clarity-textarea__middle-row--${
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
] }) :
|
|
746
|
-
l && (n == null ? void 0 : n.startsWith("bottom")) && /* @__PURE__ */ e("div", { className: `clarity-textarea__helper-row clarity-textarea__helper-row--bottom clarity-textarea__helper-row--${
|
|
736
|
+
l && (n == null ? void 0 : n.startsWith("top")) && /* @__PURE__ */ e("div", { className: `clarity-textarea__helper-row clarity-textarea__helper-row--top clarity-textarea__helper-row--${L}`, children: U("top", L) }),
|
|
737
|
+
l && (n != null && n.startsWith("middle")) ? /* @__PURE__ */ w("div", { className: `clarity-textarea__middle-row clarity-textarea__middle-row--${L}`, children: [
|
|
738
|
+
L === "left" && U("middle", L),
|
|
739
|
+
H,
|
|
740
|
+
L === "right" && U("middle", L)
|
|
741
|
+
] }) : H,
|
|
742
|
+
l && (n == null ? void 0 : n.startsWith("bottom")) && /* @__PURE__ */ e("div", { className: `clarity-textarea__helper-row clarity-textarea__helper-row--bottom clarity-textarea__helper-row--${L}`, children: U("bottom", L) })
|
|
747
743
|
] });
|
|
748
744
|
});
|
|
749
|
-
|
|
750
|
-
const Le =
|
|
745
|
+
Ee.displayName = "Textarea";
|
|
746
|
+
const Le = W.forwardRef(({
|
|
751
747
|
variant: t = "primary",
|
|
752
748
|
size: a = "medium",
|
|
753
749
|
label: r,
|
|
754
750
|
helper: l = !1,
|
|
755
751
|
helperPosition: n = "top-right",
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
I
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
752
|
+
reserveErrorSpace: o = !1,
|
|
753
|
+
error: s = !1,
|
|
754
|
+
errorMessage: c,
|
|
755
|
+
startIcon: d,
|
|
756
|
+
endIcon: i,
|
|
757
|
+
className: u = "",
|
|
758
|
+
disabled: y = !1,
|
|
759
|
+
value: p,
|
|
760
|
+
defaultValue: f,
|
|
761
|
+
onFocus: b,
|
|
762
|
+
onBlur: v,
|
|
763
|
+
onChange: N,
|
|
764
|
+
options: m = [],
|
|
765
|
+
placeholder: g = "Selecione uma opção",
|
|
766
|
+
isClearable: C = !1,
|
|
767
|
+
isSearchable: x = !1,
|
|
768
|
+
...B
|
|
769
|
+
}, k) => {
|
|
770
|
+
const [j, $] = z(!1), [S, _] = z(!1), [M, I] = z(p || f || ""), [E, X] = z(""), L = at(null), U = at(null), H = Array.isArray(m) ? m : [];
|
|
771
|
+
W.useImperativeHandle(k, () => L.current), Q(() => {
|
|
772
|
+
p !== void 0 && I(p);
|
|
773
|
+
}, [p]), Q(() => {
|
|
774
|
+
const h = (O) => {
|
|
775
|
+
L.current && !L.current.contains(O.target) && ($(!1), _(!1), v == null || v());
|
|
779
776
|
};
|
|
780
|
-
return document.addEventListener("mousedown",
|
|
781
|
-
}, [
|
|
782
|
-
const
|
|
783
|
-
(
|
|
784
|
-
) :
|
|
785
|
-
|
|
786
|
-
var
|
|
787
|
-
(
|
|
777
|
+
return document.addEventListener("mousedown", h), () => document.removeEventListener("mousedown", h);
|
|
778
|
+
}, [v]);
|
|
779
|
+
const D = x && E ? H.filter(
|
|
780
|
+
(h) => h.label.toLowerCase().includes(E.toLowerCase())
|
|
781
|
+
) : H, V = () => {
|
|
782
|
+
y || ($(!j), _(!j), j ? (v == null || v(), x && X("")) : (b == null || b(), x && setTimeout(() => {
|
|
783
|
+
var h;
|
|
784
|
+
(h = U.current) == null || h.focus();
|
|
788
785
|
}, 0)));
|
|
789
|
-
},
|
|
790
|
-
|
|
791
|
-
},
|
|
792
|
-
|
|
793
|
-
},
|
|
794
|
-
|
|
795
|
-
},
|
|
796
|
-
|
|
797
|
-
const
|
|
798
|
-
|
|
799
|
-
},
|
|
786
|
+
}, F = (h, O) => {
|
|
787
|
+
h.disabled || (I(h.value), $(!1), _(!1), X(""), N == null || N(h, O), v == null || v());
|
|
788
|
+
}, tt = (h) => {
|
|
789
|
+
X(h.target.value);
|
|
790
|
+
}, K = (h) => {
|
|
791
|
+
h.key === "Escape" ? ($(!1), _(!1), X("")) : h.key === "Enter" && D.length > 0 && D[0] && F(D[0], h);
|
|
792
|
+
}, Y = H.find((h) => h.value === M), P = M !== "" && M !== void 0, R = (h) => {
|
|
793
|
+
h.stopPropagation(), I("");
|
|
794
|
+
const O = { value: "", label: "" };
|
|
795
|
+
N == null || N(O, h);
|
|
796
|
+
}, Z = P || S || g || x && E, q = [
|
|
800
797
|
"clarity-select",
|
|
801
798
|
"clarity-select--outlined",
|
|
802
799
|
`clarity-select--${a}`,
|
|
803
800
|
t && `clarity-select--${t}`,
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
(
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
(
|
|
812
|
-
|
|
813
|
-
].filter(Boolean).join(" "),
|
|
801
|
+
s && "clarity-select--error",
|
|
802
|
+
y && "clarity-select--disabled",
|
|
803
|
+
(S || j) && "clarity-select--focused",
|
|
804
|
+
Z && "clarity-select--label-up",
|
|
805
|
+
j && "clarity-select--open",
|
|
806
|
+
x && "clarity-select--searchable",
|
|
807
|
+
d && "clarity-select--with-start-icon",
|
|
808
|
+
(i || C) && "clarity-select--with-end-icon",
|
|
809
|
+
u
|
|
810
|
+
].filter(Boolean).join(" "), A = n != null && n.endsWith("left") ? "left" : "right", et = (h, O) => {
|
|
814
811
|
if (!l) return null;
|
|
815
|
-
const T = typeof l == "object" ? l : void 0, G = (T == null ? void 0 : T.content) ?? "Ajuda",
|
|
812
|
+
const T = typeof l == "object" ? l : void 0, G = (T == null ? void 0 : T.content) ?? "Ajuda", J = (T == null ? void 0 : T.plain) === !0, it = T == null ? void 0 : T.variant, ft = T == null ? void 0 : T.bgColor, Ct = T == null ? void 0 : T.textColor;
|
|
816
813
|
return /* @__PURE__ */ e(
|
|
817
|
-
|
|
814
|
+
yt,
|
|
818
815
|
{
|
|
819
816
|
content: G,
|
|
820
|
-
position:
|
|
817
|
+
position: h === "middle" ? O === "left" ? "left" : "right" : h === "top" ? O === "left" ? "top-left" : "top-right" : O === "left" ? "bottom-left" : "bottom-right",
|
|
821
818
|
trigger: "hover",
|
|
822
|
-
variant:
|
|
823
|
-
plain:
|
|
824
|
-
bgColor:
|
|
825
|
-
textColor:
|
|
826
|
-
children: /* @__PURE__ */ e("button", { type: "button", className: "clarity-select__helper-icon", "aria-label": "Helper", children: /* @__PURE__ */ e(
|
|
819
|
+
variant: it || t,
|
|
820
|
+
plain: J,
|
|
821
|
+
bgColor: ft,
|
|
822
|
+
textColor: Ct,
|
|
823
|
+
children: /* @__PURE__ */ e("button", { type: "button", className: "clarity-select__helper-icon", "aria-label": "Helper", children: /* @__PURE__ */ e(pt, { size: h === "middle" ? 20 : 16 }) })
|
|
827
824
|
}
|
|
828
825
|
);
|
|
829
826
|
}, lt = /* @__PURE__ */ w(
|
|
830
827
|
"div",
|
|
831
828
|
{
|
|
832
|
-
ref:
|
|
833
|
-
className:
|
|
834
|
-
onClick:
|
|
829
|
+
ref: L,
|
|
830
|
+
className: q,
|
|
831
|
+
onClick: x ? void 0 : V,
|
|
835
832
|
role: "combobox",
|
|
836
|
-
"aria-expanded":
|
|
833
|
+
"aria-expanded": j,
|
|
837
834
|
"aria-haspopup": "listbox",
|
|
838
|
-
tabIndex:
|
|
839
|
-
...
|
|
835
|
+
tabIndex: y || x ? -1 : 0,
|
|
836
|
+
...B,
|
|
840
837
|
children: [
|
|
841
|
-
|
|
838
|
+
d && /* @__PURE__ */ e("div", { className: "clarity-select__start-icon", children: d }),
|
|
842
839
|
/* @__PURE__ */ w("div", { className: "clarity-select__field", children: [
|
|
843
|
-
|
|
840
|
+
x ? /* @__PURE__ */ e(
|
|
844
841
|
"input",
|
|
845
842
|
{
|
|
846
|
-
ref:
|
|
843
|
+
ref: U,
|
|
847
844
|
type: "text",
|
|
848
845
|
className: "clarity-select__search-input",
|
|
849
|
-
value:
|
|
850
|
-
onChange:
|
|
851
|
-
onKeyDown:
|
|
846
|
+
value: j ? E : Y ? Y.label : "",
|
|
847
|
+
onChange: tt,
|
|
848
|
+
onKeyDown: K,
|
|
852
849
|
onFocus: () => {
|
|
853
|
-
|
|
850
|
+
j || ($(!0), _(!0), b == null || b());
|
|
854
851
|
},
|
|
855
|
-
placeholder:
|
|
856
|
-
disabled:
|
|
857
|
-
readOnly: !
|
|
852
|
+
placeholder: Y ? Y.label : g,
|
|
853
|
+
disabled: y,
|
|
854
|
+
readOnly: !j
|
|
858
855
|
}
|
|
859
|
-
) : /* @__PURE__ */ e("div", { className: "clarity-select__display", children:
|
|
856
|
+
) : /* @__PURE__ */ e("div", { className: "clarity-select__display", children: Y ? Y.label : g }),
|
|
860
857
|
r && /* @__PURE__ */ e("label", { className: "clarity-select__label", children: r })
|
|
861
858
|
] }),
|
|
862
|
-
|
|
859
|
+
C && P && /* @__PURE__ */ e(
|
|
863
860
|
"button",
|
|
864
861
|
{
|
|
865
862
|
type: "button",
|
|
866
863
|
className: "clarity-select__clear-button",
|
|
867
|
-
onClick:
|
|
864
|
+
onClick: R,
|
|
868
865
|
"aria-label": "Limpar seleção",
|
|
869
866
|
children: /* @__PURE__ */ e(
|
|
870
867
|
"svg",
|
|
@@ -891,8 +888,8 @@ const Le = I.forwardRef(({
|
|
|
891
888
|
"div",
|
|
892
889
|
{
|
|
893
890
|
className: "clarity-select__end-icon",
|
|
894
|
-
onClick:
|
|
895
|
-
children:
|
|
891
|
+
onClick: x ? V : void 0,
|
|
892
|
+
children: i || /* @__PURE__ */ e(
|
|
896
893
|
"svg",
|
|
897
894
|
{
|
|
898
895
|
className: "clarity-select__arrow",
|
|
@@ -914,37 +911,37 @@ const Le = I.forwardRef(({
|
|
|
914
911
|
)
|
|
915
912
|
}
|
|
916
913
|
),
|
|
917
|
-
|
|
914
|
+
j && /* @__PURE__ */ e("div", { className: "clarity-select__dropdown", children: /* @__PURE__ */ e("ul", { className: "clarity-select__options", role: "listbox", children: D.length > 0 ? D.map((h) => /* @__PURE__ */ e(
|
|
918
915
|
"li",
|
|
919
916
|
{
|
|
920
917
|
className: [
|
|
921
918
|
"clarity-select__option",
|
|
922
|
-
|
|
923
|
-
|
|
919
|
+
h.disabled && "clarity-select__option--disabled",
|
|
920
|
+
M === h.value && "clarity-select__option--selected"
|
|
924
921
|
].filter(Boolean).join(" "),
|
|
925
|
-
onClick: (
|
|
922
|
+
onClick: (O) => F(h, O),
|
|
926
923
|
role: "option",
|
|
927
|
-
"aria-selected":
|
|
928
|
-
children:
|
|
924
|
+
"aria-selected": M === h.value,
|
|
925
|
+
children: h.label
|
|
929
926
|
},
|
|
930
|
-
|
|
927
|
+
h.value
|
|
931
928
|
)) : /* @__PURE__ */ e("li", { className: "clarity-select__option clarity-select__option--no-results", children: "Nenhum resultado encontrado" }) }) })
|
|
932
929
|
]
|
|
933
930
|
}
|
|
934
931
|
);
|
|
935
932
|
return /* @__PURE__ */ w("div", { className: "clarity-select-wrapper", children: [
|
|
936
|
-
l && (n == null ? void 0 : n.startsWith("top")) && /* @__PURE__ */ e("div", { className: `clarity-select__helper-row clarity-select__helper-row--top clarity-select__helper-row--${
|
|
937
|
-
l && (n != null && n.startsWith("middle")) ? /* @__PURE__ */ w("div", { className: `clarity-select__middle-row clarity-select__middle-row--${
|
|
938
|
-
|
|
933
|
+
l && (n == null ? void 0 : n.startsWith("top")) && /* @__PURE__ */ e("div", { className: `clarity-select__helper-row clarity-select__helper-row--top clarity-select__helper-row--${A}`, children: et("top", A) }),
|
|
934
|
+
l && (n != null && n.startsWith("middle")) ? /* @__PURE__ */ w("div", { className: `clarity-select__middle-row clarity-select__middle-row--${A}`, children: [
|
|
935
|
+
A === "left" && et("middle", A),
|
|
939
936
|
lt,
|
|
940
|
-
|
|
937
|
+
A === "right" && et("middle", A)
|
|
941
938
|
] }) : lt,
|
|
942
|
-
l && (n == null ? void 0 : n.startsWith("bottom")) && /* @__PURE__ */ e("div", { className: `clarity-select__helper-row clarity-select__helper-row--bottom clarity-select__helper-row--${
|
|
943
|
-
|
|
939
|
+
l && (n == null ? void 0 : n.startsWith("bottom")) && /* @__PURE__ */ e("div", { className: `clarity-select__helper-row clarity-select__helper-row--bottom clarity-select__helper-row--${A}`, children: et("bottom", A) }),
|
|
940
|
+
(s && c || o) && /* @__PURE__ */ e("div", { className: "clarity-select__helper-text", style: c ? void 0 : { minHeight: "1.2em" }, children: c || " " })
|
|
944
941
|
] });
|
|
945
942
|
});
|
|
946
943
|
Le.displayName = "Select";
|
|
947
|
-
const
|
|
944
|
+
const Re = we(({
|
|
948
945
|
options: t = [],
|
|
949
946
|
value: a = [],
|
|
950
947
|
onChange: r,
|
|
@@ -952,67 +949,68 @@ const Ee = be(({
|
|
|
952
949
|
label: n,
|
|
953
950
|
helper: o = !1,
|
|
954
951
|
helperPosition: s = "top-right",
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
952
|
+
reserveErrorSpace: c = !1,
|
|
953
|
+
error: d = !1,
|
|
954
|
+
errorMessage: i,
|
|
955
|
+
disabled: u = !1,
|
|
956
|
+
variant: y = "primary",
|
|
957
|
+
size: p = "medium",
|
|
958
|
+
maxSelectedLabels: f = 3,
|
|
959
|
+
selectionLimit: b,
|
|
960
|
+
className: v = "",
|
|
961
|
+
id: N,
|
|
962
|
+
name: m,
|
|
963
|
+
required: g = !1,
|
|
964
|
+
"data-testid": C,
|
|
965
|
+
...x
|
|
966
|
+
}, B) => {
|
|
967
|
+
const [k, j] = z(!1), [$, S] = z(""), [_, M] = z(!1), I = at(null), E = at(null), X = at(null), L = Array.isArray(t) ? t : [], U = (h) => {
|
|
968
|
+
I.current = h, B && (typeof B == "function" ? B(h) : B.current = h);
|
|
971
969
|
};
|
|
972
|
-
|
|
973
|
-
const
|
|
974
|
-
|
|
970
|
+
Q(() => {
|
|
971
|
+
const h = (O) => {
|
|
972
|
+
I.current && !I.current.contains(O.target) && (j(!1), M(!1), S(""));
|
|
975
973
|
};
|
|
976
|
-
return document.addEventListener("click",
|
|
974
|
+
return document.addEventListener("click", h), () => document.removeEventListener("click", h);
|
|
977
975
|
}, []);
|
|
978
|
-
const
|
|
979
|
-
(
|
|
980
|
-
),
|
|
981
|
-
|
|
982
|
-
var
|
|
983
|
-
(
|
|
976
|
+
const H = L.filter(
|
|
977
|
+
(h) => h.label.toLowerCase().includes($.toLowerCase())
|
|
978
|
+
), D = () => {
|
|
979
|
+
u || (j(!k), M(!k), k ? S("") : setTimeout(() => {
|
|
980
|
+
var h;
|
|
981
|
+
(h = E.current) == null || h.focus();
|
|
984
982
|
}, 100));
|
|
985
|
-
},
|
|
986
|
-
if (
|
|
983
|
+
}, V = (h, O) => {
|
|
984
|
+
if (u)
|
|
987
985
|
return;
|
|
988
|
-
|
|
989
|
-
const T = a.includes(
|
|
986
|
+
O && (O.stopPropagation(), O.preventDefault());
|
|
987
|
+
const T = a.includes(h);
|
|
990
988
|
let G;
|
|
991
|
-
T ? G = a.filter((
|
|
992
|
-
},
|
|
993
|
-
if (
|
|
994
|
-
const T = a.filter((G) => G !==
|
|
989
|
+
T ? G = a.filter((J) => J !== h) : G = [...a, h], r && r(G);
|
|
990
|
+
}, F = (h, O) => {
|
|
991
|
+
if (O.stopPropagation(), u) return;
|
|
992
|
+
const T = a.filter((G) => G !== h);
|
|
995
993
|
r == null || r(T);
|
|
996
|
-
},
|
|
997
|
-
|
|
998
|
-
},
|
|
999
|
-
|
|
1000
|
-
},
|
|
1001
|
-
|
|
1002
|
-
},
|
|
994
|
+
}, tt = (h) => {
|
|
995
|
+
h.stopPropagation(), !u && (r == null || r([]));
|
|
996
|
+
}, K = (h) => {
|
|
997
|
+
S(h.target.value);
|
|
998
|
+
}, Y = (h) => {
|
|
999
|
+
h.key === "Escape" && (j(!1), M(!1), S(""));
|
|
1000
|
+
}, P = _ || k || a.length > 0, R = () => {
|
|
1003
1001
|
if (a.length === 0) return null;
|
|
1004
|
-
const
|
|
1005
|
-
(G) =>
|
|
1006
|
-
).filter(Boolean),
|
|
1002
|
+
const h = a.map(
|
|
1003
|
+
(G) => L.find((J) => J.value === G)
|
|
1004
|
+
).filter(Boolean), O = h.slice(0, f), T = h.length - f;
|
|
1007
1005
|
return /* @__PURE__ */ w("div", { className: "clarity-multiselect__chips", children: [
|
|
1008
|
-
|
|
1006
|
+
O.map((G) => /* @__PURE__ */ w("div", { className: "clarity-multiselect__chip", children: [
|
|
1009
1007
|
/* @__PURE__ */ e("span", { className: "clarity-multiselect__chip-label", children: G.label }),
|
|
1010
|
-
!
|
|
1008
|
+
!u && /* @__PURE__ */ e(
|
|
1011
1009
|
"button",
|
|
1012
1010
|
{
|
|
1013
1011
|
type: "button",
|
|
1014
1012
|
className: "clarity-multiselect__chip-remove",
|
|
1015
|
-
onClick: (
|
|
1013
|
+
onClick: (J) => F(G.value, J),
|
|
1016
1014
|
"aria-label": `Remover ${G.label}`,
|
|
1017
1015
|
children: "×"
|
|
1018
1016
|
}
|
|
@@ -1024,61 +1022,61 @@ const Ee = be(({
|
|
|
1024
1022
|
" mais"
|
|
1025
1023
|
] })
|
|
1026
1024
|
] });
|
|
1027
|
-
},
|
|
1025
|
+
}, Z = [
|
|
1028
1026
|
"clarity-multiselect-wrapper",
|
|
1029
|
-
|
|
1030
|
-
].filter(Boolean).join(" "),
|
|
1027
|
+
v
|
|
1028
|
+
].filter(Boolean).join(" "), q = [
|
|
1031
1029
|
"clarity-multiselect",
|
|
1032
|
-
`clarity-multiselect--${
|
|
1033
|
-
`clarity-multiselect--${
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1030
|
+
`clarity-multiselect--${y}`,
|
|
1031
|
+
`clarity-multiselect--${p}`,
|
|
1032
|
+
k && "clarity-multiselect--open",
|
|
1033
|
+
_ && "clarity-multiselect--focused",
|
|
1034
|
+
P && "clarity-multiselect--label-up",
|
|
1035
|
+
d && "clarity-multiselect--error",
|
|
1036
|
+
u && "clarity-multiselect--disabled",
|
|
1039
1037
|
a.length > 0 && "clarity-multiselect--has-value"
|
|
1040
|
-
].filter(Boolean).join(" "),
|
|
1038
|
+
].filter(Boolean).join(" "), A = s != null && s.endsWith("left") ? "left" : "right", et = (h, O) => {
|
|
1041
1039
|
if (!o) return null;
|
|
1042
|
-
const T = typeof o == "object" ? o : void 0, G = (T == null ? void 0 : T.content) ?? "Ajuda",
|
|
1040
|
+
const T = typeof o == "object" ? o : void 0, G = (T == null ? void 0 : T.content) ?? "Ajuda", J = (T == null ? void 0 : T.plain) === !0, it = T == null ? void 0 : T.variant, ft = T == null ? void 0 : T.bgColor, Ct = T == null ? void 0 : T.textColor;
|
|
1043
1041
|
return /* @__PURE__ */ e(
|
|
1044
|
-
|
|
1042
|
+
yt,
|
|
1045
1043
|
{
|
|
1046
1044
|
content: G,
|
|
1047
|
-
position:
|
|
1045
|
+
position: h === "middle" ? O === "left" ? "left" : "right" : h === "top" ? O === "left" ? "top-left" : "top-right" : O === "left" ? "bottom-left" : "bottom-right",
|
|
1048
1046
|
trigger: "hover",
|
|
1049
|
-
variant:
|
|
1050
|
-
plain:
|
|
1051
|
-
bgColor:
|
|
1052
|
-
textColor:
|
|
1053
|
-
children: /* @__PURE__ */ e("button", { type: "button", className: "clarity-multiselect__helper-icon", "aria-label": "Helper", children: /* @__PURE__ */ e(
|
|
1047
|
+
variant: it || y,
|
|
1048
|
+
plain: J,
|
|
1049
|
+
bgColor: ft,
|
|
1050
|
+
textColor: Ct,
|
|
1051
|
+
children: /* @__PURE__ */ e("button", { type: "button", className: "clarity-multiselect__helper-icon", "aria-label": "Helper", children: /* @__PURE__ */ e(pt, { size: h === "middle" ? 20 : 16 }) })
|
|
1054
1052
|
}
|
|
1055
1053
|
);
|
|
1056
1054
|
}, lt = /* @__PURE__ */ w(
|
|
1057
1055
|
"div",
|
|
1058
1056
|
{
|
|
1059
|
-
ref:
|
|
1060
|
-
className:
|
|
1061
|
-
"data-testid":
|
|
1062
|
-
...
|
|
1057
|
+
ref: U,
|
|
1058
|
+
className: q,
|
|
1059
|
+
"data-testid": C,
|
|
1060
|
+
...x,
|
|
1063
1061
|
children: [
|
|
1064
1062
|
/* @__PURE__ */ w(
|
|
1065
1063
|
"div",
|
|
1066
1064
|
{
|
|
1067
1065
|
className: "clarity-multiselect__field",
|
|
1068
|
-
onClick:
|
|
1066
|
+
onClick: D,
|
|
1069
1067
|
children: [
|
|
1070
1068
|
n && /* @__PURE__ */ w("label", { className: "clarity-multiselect__label", children: [
|
|
1071
1069
|
n,
|
|
1072
|
-
|
|
1070
|
+
g && /* @__PURE__ */ e("span", { className: "clarity-multiselect__required", children: "*" })
|
|
1073
1071
|
] }),
|
|
1074
|
-
/* @__PURE__ */ e("div", { className: "clarity-multiselect__content", children: a.length > 0 ?
|
|
1072
|
+
/* @__PURE__ */ e("div", { className: "clarity-multiselect__content", children: a.length > 0 ? R() : /* @__PURE__ */ e("span", { className: "clarity-multiselect__placeholder", children: l }) }),
|
|
1075
1073
|
/* @__PURE__ */ w("div", { className: "clarity-multiselect__icons", children: [
|
|
1076
|
-
a.length > 0 && !
|
|
1074
|
+
a.length > 0 && !u && /* @__PURE__ */ e(
|
|
1077
1075
|
"button",
|
|
1078
1076
|
{
|
|
1079
1077
|
type: "button",
|
|
1080
1078
|
className: "clarity-multiselect__clear-button",
|
|
1081
|
-
onClick:
|
|
1079
|
+
onClick: tt,
|
|
1082
1080
|
"aria-label": "Limpar seleção",
|
|
1083
1081
|
children: "×"
|
|
1084
1082
|
}
|
|
@@ -1097,35 +1095,35 @@ const Ee = be(({
|
|
|
1097
1095
|
]
|
|
1098
1096
|
}
|
|
1099
1097
|
),
|
|
1100
|
-
|
|
1098
|
+
k && /* @__PURE__ */ w("div", { ref: X, className: "clarity-multiselect__dropdown", children: [
|
|
1101
1099
|
/* @__PURE__ */ e("div", { className: "clarity-multiselect__search", children: /* @__PURE__ */ e(
|
|
1102
1100
|
"input",
|
|
1103
1101
|
{
|
|
1104
|
-
ref:
|
|
1102
|
+
ref: E,
|
|
1105
1103
|
type: "text",
|
|
1106
1104
|
className: "clarity-multiselect__search-input",
|
|
1107
1105
|
placeholder: "Buscar opções...",
|
|
1108
|
-
value:
|
|
1109
|
-
onChange:
|
|
1110
|
-
onKeyDown:
|
|
1106
|
+
value: $,
|
|
1107
|
+
onChange: K,
|
|
1108
|
+
onKeyDown: Y
|
|
1111
1109
|
}
|
|
1112
1110
|
) }),
|
|
1113
|
-
/* @__PURE__ */ e("ul", { className: "clarity-multiselect__options", children:
|
|
1114
|
-
const
|
|
1111
|
+
/* @__PURE__ */ e("ul", { className: "clarity-multiselect__options", children: H.length > 0 ? H.map((h) => {
|
|
1112
|
+
const O = a.includes(h.value), T = h.disabled || u;
|
|
1115
1113
|
return /* @__PURE__ */ w(
|
|
1116
1114
|
"li",
|
|
1117
1115
|
{
|
|
1118
1116
|
className: [
|
|
1119
1117
|
"clarity-multiselect__option",
|
|
1120
|
-
|
|
1118
|
+
O && "clarity-multiselect__option--selected",
|
|
1121
1119
|
T && "clarity-multiselect__option--disabled"
|
|
1122
1120
|
].filter(Boolean).join(" "),
|
|
1123
|
-
onClick: (G) => !T &&
|
|
1121
|
+
onClick: (G) => !T && V(h.value, G),
|
|
1124
1122
|
children: [
|
|
1125
1123
|
/* @__PURE__ */ e("div", { className: "clarity-multiselect__option-checkbox", children: /* @__PURE__ */ e("div", { className: [
|
|
1126
1124
|
"clarity-multiselect__checkbox",
|
|
1127
|
-
|
|
1128
|
-
].filter(Boolean).join(" "), children:
|
|
1125
|
+
O && "clarity-multiselect__checkbox--checked"
|
|
1126
|
+
].filter(Boolean).join(" "), children: O && /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ e(
|
|
1129
1127
|
"path",
|
|
1130
1128
|
{
|
|
1131
1129
|
d: "M2 6L5 9L10 3",
|
|
@@ -1135,39 +1133,39 @@ const Ee = be(({
|
|
|
1135
1133
|
strokeLinejoin: "round"
|
|
1136
1134
|
}
|
|
1137
1135
|
) }) }) }),
|
|
1138
|
-
/* @__PURE__ */ e("span", { className: "clarity-multiselect__option-label", children:
|
|
1136
|
+
/* @__PURE__ */ e("span", { className: "clarity-multiselect__option-label", children: h.label })
|
|
1139
1137
|
]
|
|
1140
1138
|
},
|
|
1141
|
-
|
|
1139
|
+
h.value
|
|
1142
1140
|
);
|
|
1143
1141
|
}) : /* @__PURE__ */ e("li", { className: "clarity-multiselect__option clarity-multiselect__option--no-results", children: "Nenhum resultado encontrado" }) })
|
|
1144
1142
|
] })
|
|
1145
1143
|
]
|
|
1146
1144
|
}
|
|
1147
1145
|
);
|
|
1148
|
-
return /* @__PURE__ */ w("div", { className:
|
|
1149
|
-
o && (s == null ? void 0 : s.startsWith("top")) && /* @__PURE__ */ e("div", { className: `clarity-multiselect__helper-row clarity-multiselect__helper-row--top clarity-multiselect__helper-row--${
|
|
1150
|
-
o && (s != null && s.startsWith("middle")) ? /* @__PURE__ */ w("div", { className: `clarity-multiselect__middle-row clarity-multiselect__middle-row--${
|
|
1151
|
-
|
|
1146
|
+
return /* @__PURE__ */ w("div", { className: Z, children: [
|
|
1147
|
+
o && (s == null ? void 0 : s.startsWith("top")) && /* @__PURE__ */ e("div", { className: `clarity-multiselect__helper-row clarity-multiselect__helper-row--top clarity-multiselect__helper-row--${A}`, children: et("top", A) }),
|
|
1148
|
+
o && (s != null && s.startsWith("middle")) ? /* @__PURE__ */ w("div", { className: `clarity-multiselect__middle-row clarity-multiselect__middle-row--${A}`, children: [
|
|
1149
|
+
A === "left" && et("middle", A),
|
|
1152
1150
|
lt,
|
|
1153
|
-
|
|
1151
|
+
A === "right" && et("middle", A)
|
|
1154
1152
|
] }) : lt,
|
|
1155
|
-
o && (s == null ? void 0 : s.startsWith("bottom")) && /* @__PURE__ */ e("div", { className: `clarity-multiselect__helper-row clarity-multiselect__helper-row--bottom clarity-multiselect__helper-row--${
|
|
1156
|
-
|
|
1153
|
+
o && (s == null ? void 0 : s.startsWith("bottom")) && /* @__PURE__ */ e("div", { className: `clarity-multiselect__helper-row clarity-multiselect__helper-row--bottom clarity-multiselect__helper-row--${A}`, children: et("bottom", A) }),
|
|
1154
|
+
(d && i || c) && /* @__PURE__ */ e("div", { className: "clarity-multiselect__helper", style: i ? void 0 : { minHeight: "1.2em" }, children: /* @__PURE__ */ e("span", { className: "clarity-multiselect__error-message", children: i || " " }) })
|
|
1157
1155
|
] });
|
|
1158
1156
|
});
|
|
1159
|
-
|
|
1160
|
-
const
|
|
1161
|
-
const t = dt(
|
|
1157
|
+
Re.displayName = "MultiSelect";
|
|
1158
|
+
const Ot = ct(null), Wt = () => {
|
|
1159
|
+
const t = dt(Ot);
|
|
1162
1160
|
if (!t)
|
|
1163
1161
|
throw new Error("useModal must be used within a Modal provider");
|
|
1164
1162
|
return t;
|
|
1165
|
-
},
|
|
1163
|
+
}, It = ({
|
|
1166
1164
|
children: t,
|
|
1167
1165
|
className: a = "",
|
|
1168
1166
|
title: r
|
|
1169
1167
|
}) => {
|
|
1170
|
-
const { onClose: l, variant: n, showCloseButton: o } =
|
|
1168
|
+
const { onClose: l, variant: n, showCloseButton: o } = Wt(), s = [
|
|
1171
1169
|
"clarity-modal-header",
|
|
1172
1170
|
a,
|
|
1173
1171
|
n && `clarity-modal-header--${n}`
|
|
@@ -1183,23 +1181,23 @@ const Rt = ct(null), Ot = () => {
|
|
|
1183
1181
|
}, children: "×" })
|
|
1184
1182
|
] });
|
|
1185
1183
|
};
|
|
1186
|
-
|
|
1187
|
-
const
|
|
1188
|
-
|
|
1189
|
-
const
|
|
1184
|
+
It.displayName = "Modal.Header";
|
|
1185
|
+
const Ht = ({ children: t, className: a = "" }) => /* @__PURE__ */ e("div", { className: `clarity-modal-content ${a}`, children: t });
|
|
1186
|
+
Ht.displayName = "Modal.Content";
|
|
1187
|
+
const Dt = ({ children: t, className: a = "" }) => /* @__PURE__ */ w("div", { className: `clarity-modal-footer ${a}`, children: [
|
|
1190
1188
|
/* @__PURE__ */ e("div", { className: "clarity-modal-scroll-indicator" }),
|
|
1191
1189
|
t
|
|
1192
1190
|
] });
|
|
1193
|
-
|
|
1194
|
-
const
|
|
1191
|
+
Dt.displayName = "Modal.Footer";
|
|
1192
|
+
const Vt = ({ children: t, onClick: a }) => rt(t, {
|
|
1195
1193
|
onClick: (r) => {
|
|
1196
1194
|
var l, n;
|
|
1197
1195
|
a == null || a(), (n = (l = t.props).onClick) == null || n.call(l, r);
|
|
1198
1196
|
}
|
|
1199
1197
|
});
|
|
1200
|
-
|
|
1201
|
-
const
|
|
1202
|
-
const { onClose: a } =
|
|
1198
|
+
Vt.displayName = "Modal.Trigger";
|
|
1199
|
+
const At = ({ children: t }) => {
|
|
1200
|
+
const { onClose: a } = Wt();
|
|
1203
1201
|
return rt(t, {
|
|
1204
1202
|
onClick: (r) => {
|
|
1205
1203
|
var l, n;
|
|
@@ -1207,7 +1205,7 @@ const Vt = ({ children: t }) => {
|
|
|
1207
1205
|
}
|
|
1208
1206
|
});
|
|
1209
1207
|
};
|
|
1210
|
-
|
|
1208
|
+
At.displayName = "Modal.Close";
|
|
1211
1209
|
const mt = ({
|
|
1212
1210
|
isOpen: t,
|
|
1213
1211
|
onClose: a,
|
|
@@ -1219,54 +1217,54 @@ const mt = ({
|
|
|
1219
1217
|
showCloseButton: c = !0,
|
|
1220
1218
|
closeOnOverlayClick: d = !0
|
|
1221
1219
|
}) => {
|
|
1222
|
-
const [i, u] =
|
|
1220
|
+
const [i, u] = z(!1), p = t !== void 0 ? t : i, f = W.useCallback(() => {
|
|
1223
1221
|
a ? a() : u(!1);
|
|
1224
1222
|
}, [a]);
|
|
1225
|
-
|
|
1223
|
+
Q(() => {
|
|
1226
1224
|
p && (r == null || r());
|
|
1227
|
-
}, [p, r]),
|
|
1228
|
-
const
|
|
1229
|
-
|
|
1225
|
+
}, [p, r]), Q(() => {
|
|
1226
|
+
const g = (C) => {
|
|
1227
|
+
C.key === "Escape" && f();
|
|
1230
1228
|
};
|
|
1231
|
-
return p ? (document.addEventListener("keydown",
|
|
1232
|
-
document.removeEventListener("keydown",
|
|
1229
|
+
return p ? (document.addEventListener("keydown", g), document.body.style.overflow = "hidden") : document.body.style.overflow = "unset", () => {
|
|
1230
|
+
document.removeEventListener("keydown", g), document.body.style.overflow = "unset";
|
|
1233
1231
|
};
|
|
1234
|
-
}, [p,
|
|
1235
|
-
const
|
|
1236
|
-
d &&
|
|
1237
|
-
},
|
|
1238
|
-
(
|
|
1239
|
-
), N =
|
|
1240
|
-
(
|
|
1232
|
+
}, [p, f]);
|
|
1233
|
+
const b = (g) => {
|
|
1234
|
+
d && g.target === g.currentTarget && f();
|
|
1235
|
+
}, v = W.Children.toArray(l).find(
|
|
1236
|
+
(g) => ot(g) && g.type.displayName === "Modal.Trigger"
|
|
1237
|
+
), N = W.Children.toArray(l).filter(
|
|
1238
|
+
(g) => ot(g) && g.type.displayName !== "Modal.Trigger"
|
|
1241
1239
|
), m = ["clarity-modal", n, `clarity-modal--${s}`].filter(Boolean).join(" ");
|
|
1242
|
-
return /* @__PURE__ */ w(
|
|
1243
|
-
|
|
1244
|
-
p && /* @__PURE__ */ e("div", { className: "clarity-modal-overlay", onClick:
|
|
1240
|
+
return /* @__PURE__ */ w(Ot.Provider, { value: { onClose: f, variant: o, showCloseButton: c }, children: [
|
|
1241
|
+
v && rt(v, { onClick: () => u(!0) }),
|
|
1242
|
+
p && /* @__PURE__ */ e("div", { className: "clarity-modal-overlay", onClick: b, children: /* @__PURE__ */ e("div", { className: m, children: N }) })
|
|
1245
1243
|
] });
|
|
1246
1244
|
};
|
|
1247
|
-
mt.Header =
|
|
1248
|
-
mt.Content =
|
|
1249
|
-
mt.Footer =
|
|
1250
|
-
mt.Trigger =
|
|
1251
|
-
mt.Close =
|
|
1245
|
+
mt.Header = It;
|
|
1246
|
+
mt.Content = Ht;
|
|
1247
|
+
mt.Footer = Dt;
|
|
1248
|
+
mt.Trigger = Vt;
|
|
1249
|
+
mt.Close = At;
|
|
1252
1250
|
mt.displayName = "Modal";
|
|
1253
|
-
const zt = ct(void 0),
|
|
1251
|
+
const zt = ct(void 0), aa = () => {
|
|
1254
1252
|
const t = dt(zt);
|
|
1255
1253
|
if (!t)
|
|
1256
1254
|
throw new Error("useToast must be used within a ToastProvider");
|
|
1257
1255
|
return t;
|
|
1258
|
-
},
|
|
1259
|
-
const [s, c] =
|
|
1260
|
-
|
|
1256
|
+
}, Oe = ({ id: t, message: a, variant: r, duration: l, onClose: n, invertColors: o }) => {
|
|
1257
|
+
const [s, c] = z("entering");
|
|
1258
|
+
Q(() => {
|
|
1261
1259
|
const i = setTimeout(() => {
|
|
1262
1260
|
c("visible");
|
|
1263
1261
|
}, 10), u = setTimeout(() => {
|
|
1264
1262
|
c("exiting");
|
|
1265
|
-
}, l * 1e3 - 300),
|
|
1263
|
+
}, l * 1e3 - 300), y = setTimeout(() => {
|
|
1266
1264
|
n(t);
|
|
1267
1265
|
}, l * 1e3);
|
|
1268
1266
|
return () => {
|
|
1269
|
-
clearTimeout(i), clearTimeout(u), clearTimeout(
|
|
1267
|
+
clearTimeout(i), clearTimeout(u), clearTimeout(y);
|
|
1270
1268
|
};
|
|
1271
1269
|
}, [t, l, n]);
|
|
1272
1270
|
const d = [
|
|
@@ -1286,15 +1284,15 @@ const zt = ct(void 0), ea = () => {
|
|
|
1286
1284
|
}
|
|
1287
1285
|
)
|
|
1288
1286
|
] });
|
|
1289
|
-
},
|
|
1290
|
-
const [a, r] =
|
|
1287
|
+
}, ra = ({ children: t }) => {
|
|
1288
|
+
const [a, r] = z([]), l = gt(() => {
|
|
1291
1289
|
if (typeof document < "u") {
|
|
1292
1290
|
const d = document.createElement("div");
|
|
1293
1291
|
return d.id = "toast-portal-root", d;
|
|
1294
1292
|
}
|
|
1295
1293
|
return null;
|
|
1296
1294
|
}, []);
|
|
1297
|
-
|
|
1295
|
+
Q(() => {
|
|
1298
1296
|
if (l)
|
|
1299
1297
|
return document.body.appendChild(l), () => {
|
|
1300
1298
|
document.body.removeChild(l);
|
|
@@ -1307,30 +1305,30 @@ const zt = ct(void 0), ea = () => {
|
|
|
1307
1305
|
// position: 'right-top',
|
|
1308
1306
|
...d
|
|
1309
1307
|
};
|
|
1310
|
-
r((
|
|
1311
|
-
const p = [u, ...
|
|
1308
|
+
r((y) => {
|
|
1309
|
+
const p = [u, ...y];
|
|
1312
1310
|
return p.length > 4 ? p.slice(0, 4) : p;
|
|
1313
1311
|
});
|
|
1314
1312
|
}, []), o = _t((d) => {
|
|
1315
1313
|
r((i) => i.filter((u) => u.id !== d));
|
|
1316
|
-
}, []), s =
|
|
1314
|
+
}, []), s = gt(() => a.reduce((d, i) => (d[i.position] || (d[i.position] = []), d[i.position].push(i), d), {}), [a]), c = gt(() => ({ show: n }), [n]);
|
|
1317
1315
|
return /* @__PURE__ */ w(zt.Provider, { value: c, children: [
|
|
1318
1316
|
t,
|
|
1319
|
-
l &&
|
|
1320
|
-
Object.entries(s).map(([d, i]) => /* @__PURE__ */ e("div", { className: `cl-toast-container ${d}`, children: i.map((u) => /* @__PURE__ */ e(
|
|
1317
|
+
l && Ce.createPortal(
|
|
1318
|
+
Object.entries(s).map(([d, i]) => /* @__PURE__ */ e("div", { className: `cl-toast-container ${d}`, children: i.map((u) => /* @__PURE__ */ e(Oe, { ...u, onClose: o }, u.id)) }, d)),
|
|
1321
1319
|
l
|
|
1322
1320
|
)
|
|
1323
1321
|
] });
|
|
1324
|
-
},
|
|
1325
|
-
const t = dt(
|
|
1322
|
+
}, Mt = ct(null), Ft = () => {
|
|
1323
|
+
const t = dt(Mt);
|
|
1326
1324
|
if (!t)
|
|
1327
1325
|
throw new Error("useOffcanvas must be used within an Offcanvas provider");
|
|
1328
1326
|
return t;
|
|
1329
|
-
},
|
|
1327
|
+
}, Gt = ({
|
|
1330
1328
|
children: t,
|
|
1331
1329
|
className: a = ""
|
|
1332
1330
|
}) => {
|
|
1333
|
-
const { onClose: r, variant: l, showCloseButton: n, title: o } =
|
|
1331
|
+
const { onClose: r, variant: l, showCloseButton: n, title: o } = Ft(), s = [
|
|
1334
1332
|
"clarity-offcanvas-header",
|
|
1335
1333
|
a
|
|
1336
1334
|
].filter(Boolean).join(" "), c = [
|
|
@@ -1348,21 +1346,21 @@ const zt = ct(void 0), ea = () => {
|
|
|
1348
1346
|
}, children: "×" })
|
|
1349
1347
|
] });
|
|
1350
1348
|
};
|
|
1351
|
-
|
|
1352
|
-
const
|
|
1353
|
-
|
|
1354
|
-
const
|
|
1349
|
+
Gt.displayName = "Offcanvas.Header";
|
|
1350
|
+
const Ut = ({ children: t, className: a = "" }) => /* @__PURE__ */ e("div", { className: `clarity-offcanvas-content ${a}`, children: t });
|
|
1351
|
+
Ut.displayName = "Offcanvas.Content";
|
|
1352
|
+
const Xt = ({ children: t, onClick: a, variant: r }) => rt(t, {
|
|
1355
1353
|
onClick: (l) => {
|
|
1356
1354
|
var n, o;
|
|
1357
1355
|
a == null || a(), (o = (n = t.props).onClick) == null || o.call(n, l);
|
|
1358
1356
|
},
|
|
1359
1357
|
variant: r
|
|
1360
1358
|
});
|
|
1361
|
-
|
|
1362
|
-
const
|
|
1363
|
-
|
|
1364
|
-
const
|
|
1365
|
-
const { onClose: a } =
|
|
1359
|
+
Xt.displayName = "Offcanvas.Trigger";
|
|
1360
|
+
const xt = ({ children: t, className: a = "" }) => /* @__PURE__ */ e("div", { className: `clarity-offcanvas-footer ${a}`, children: t });
|
|
1361
|
+
xt.displayName = "Offcanvas.Footer";
|
|
1362
|
+
const Yt = ({ children: t }) => {
|
|
1363
|
+
const { onClose: a } = Ft();
|
|
1366
1364
|
return rt(t, {
|
|
1367
1365
|
onClick: (r) => {
|
|
1368
1366
|
var l, n;
|
|
@@ -1370,7 +1368,7 @@ const Xt = ({ children: t }) => {
|
|
|
1370
1368
|
}
|
|
1371
1369
|
});
|
|
1372
1370
|
};
|
|
1373
|
-
|
|
1371
|
+
Yt.displayName = "Offcanvas.Close";
|
|
1374
1372
|
const ht = ({
|
|
1375
1373
|
isOpen: t,
|
|
1376
1374
|
onClose: a,
|
|
@@ -1383,83 +1381,83 @@ const ht = ({
|
|
|
1383
1381
|
showCloseButton: d = !0,
|
|
1384
1382
|
title: i
|
|
1385
1383
|
}) => {
|
|
1386
|
-
const [u,
|
|
1387
|
-
a ? a() :
|
|
1388
|
-
}, [a]),
|
|
1389
|
-
N ||
|
|
1384
|
+
const [u, y] = z(!1), [p, f] = z(!1), [b, v] = z(!1), N = t !== void 0, m = N ? t : u, g = _t(() => {
|
|
1385
|
+
a ? a() : y(!1);
|
|
1386
|
+
}, [a]), C = _t(() => {
|
|
1387
|
+
N || y(!0), r == null || r();
|
|
1390
1388
|
}, [N, r]);
|
|
1391
|
-
|
|
1389
|
+
Q(() => {
|
|
1392
1390
|
if (m) {
|
|
1393
|
-
|
|
1394
|
-
const
|
|
1395
|
-
|
|
1391
|
+
v(!0);
|
|
1392
|
+
const E = setTimeout(() => {
|
|
1393
|
+
f(!0);
|
|
1396
1394
|
}, 50);
|
|
1397
|
-
return () => clearTimeout(
|
|
1395
|
+
return () => clearTimeout(E);
|
|
1398
1396
|
} else {
|
|
1399
|
-
|
|
1400
|
-
const
|
|
1401
|
-
|
|
1397
|
+
f(!1);
|
|
1398
|
+
const E = setTimeout(() => {
|
|
1399
|
+
v(!1);
|
|
1402
1400
|
}, 300);
|
|
1403
|
-
return () => clearTimeout(
|
|
1401
|
+
return () => clearTimeout(E);
|
|
1404
1402
|
}
|
|
1405
|
-
}, [m]),
|
|
1406
|
-
const
|
|
1407
|
-
|
|
1403
|
+
}, [m]), Q(() => {
|
|
1404
|
+
const E = (X) => {
|
|
1405
|
+
X.key === "Escape" && g();
|
|
1408
1406
|
};
|
|
1409
|
-
return m ? (document.addEventListener("keydown",
|
|
1410
|
-
document.removeEventListener("keydown",
|
|
1407
|
+
return m ? (document.addEventListener("keydown", E), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", E), document.body.style.overflow = "unset"), () => {
|
|
1408
|
+
document.removeEventListener("keydown", E), document.body.style.overflow = "unset";
|
|
1411
1409
|
};
|
|
1412
|
-
}, [m,
|
|
1413
|
-
const x = (
|
|
1414
|
-
c &&
|
|
1415
|
-
},
|
|
1416
|
-
let
|
|
1417
|
-
|
|
1418
|
-
if (ot(
|
|
1419
|
-
if (
|
|
1420
|
-
|
|
1421
|
-
else if (
|
|
1422
|
-
|
|
1423
|
-
else if (
|
|
1424
|
-
|
|
1425
|
-
const
|
|
1426
|
-
|
|
1427
|
-
} else
|
|
1428
|
-
}),
|
|
1429
|
-
children: /* @__PURE__ */ w(
|
|
1430
|
-
|
|
1431
|
-
|
|
1410
|
+
}, [m, g]);
|
|
1411
|
+
const x = (E) => {
|
|
1412
|
+
c && E.target === E.currentTarget && g();
|
|
1413
|
+
}, B = W.Children.toArray(l);
|
|
1414
|
+
let k, j, $, S, _;
|
|
1415
|
+
B.forEach((E) => {
|
|
1416
|
+
if (ot(E))
|
|
1417
|
+
if (E.type.displayName === "Offcanvas.Trigger")
|
|
1418
|
+
k = E;
|
|
1419
|
+
else if (E.type.displayName === "Offcanvas.Header")
|
|
1420
|
+
j = E;
|
|
1421
|
+
else if (E.type.displayName === "Offcanvas.Content") {
|
|
1422
|
+
$ = E;
|
|
1423
|
+
const L = W.Children.toArray($.props.children).filter((U) => ot(U) && U.type.displayName === "Offcanvas.Close" ? (_ = U, !1) : !0);
|
|
1424
|
+
$ = rt($, { children: L });
|
|
1425
|
+
} else E.type.displayName === "Offcanvas.Footer" && (S = E);
|
|
1426
|
+
}), _ && (S ? S = rt(S, {
|
|
1427
|
+
children: /* @__PURE__ */ w(St, { children: [
|
|
1428
|
+
S.props.children,
|
|
1429
|
+
_
|
|
1432
1430
|
] })
|
|
1433
|
-
}) :
|
|
1434
|
-
const
|
|
1431
|
+
}) : S = /* @__PURE__ */ e(xt, { children: _ }));
|
|
1432
|
+
const M = [
|
|
1435
1433
|
"clarity-offcanvas",
|
|
1436
1434
|
n,
|
|
1437
1435
|
`clarity-offcanvas--${s}`,
|
|
1438
1436
|
o && `clarity-offcanvas--${o}`,
|
|
1439
1437
|
p ? "clarity-offcanvas--open" : "clarity-offcanvas--closed"
|
|
1440
|
-
].filter(Boolean).join(" "),
|
|
1438
|
+
].filter(Boolean).join(" "), I = [
|
|
1441
1439
|
"clarity-offcanvas-overlay",
|
|
1442
1440
|
p ? "clarity-offcanvas-overlay--visible" : ""
|
|
1443
1441
|
].filter(Boolean).join(" ");
|
|
1444
|
-
return /* @__PURE__ */ w(
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
/* @__PURE__ */ e("div", { className:
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1442
|
+
return /* @__PURE__ */ w(Mt.Provider, { value: { onClose: g, variant: o, showCloseButton: d, placement: s, title: i }, children: [
|
|
1443
|
+
k && rt(k, { onClick: C, variant: o }),
|
|
1444
|
+
b && // Only render if shouldRender is true
|
|
1445
|
+
/* @__PURE__ */ e("div", { className: I, onClick: x, children: /* @__PURE__ */ w("div", { className: M, children: [
|
|
1446
|
+
j,
|
|
1447
|
+
$,
|
|
1448
|
+
S && /* @__PURE__ */ e("div", { className: "clarity-offcanvas-scroll-indicator" }),
|
|
1451
1449
|
" ",
|
|
1452
|
-
|
|
1450
|
+
S
|
|
1453
1451
|
] }) })
|
|
1454
1452
|
] });
|
|
1455
1453
|
};
|
|
1456
|
-
ht.Header =
|
|
1457
|
-
ht.Content =
|
|
1458
|
-
ht.Footer =
|
|
1459
|
-
ht.Trigger =
|
|
1460
|
-
ht.Close =
|
|
1454
|
+
ht.Header = Gt;
|
|
1455
|
+
ht.Content = Ut;
|
|
1456
|
+
ht.Footer = xt;
|
|
1457
|
+
ht.Trigger = Xt;
|
|
1458
|
+
ht.Close = Yt;
|
|
1461
1459
|
ht.displayName = "Offcanvas";
|
|
1462
|
-
const
|
|
1460
|
+
const We = W.forwardRef(({
|
|
1463
1461
|
type: t,
|
|
1464
1462
|
variant: a = "primary",
|
|
1465
1463
|
size: r = "medium",
|
|
@@ -1467,59 +1465,60 @@ const Re = I.forwardRef(({
|
|
|
1467
1465
|
helperText: n,
|
|
1468
1466
|
helper: o = !1,
|
|
1469
1467
|
helperPosition: s = "middle-right",
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1468
|
+
reserveErrorSpace: c = !1,
|
|
1469
|
+
error: d = !1,
|
|
1470
|
+
errorMessage: i,
|
|
1471
|
+
labelPosition: u = "right",
|
|
1472
|
+
className: y = "",
|
|
1473
|
+
disabled: p = !1,
|
|
1474
|
+
checked: f,
|
|
1475
|
+
id: b,
|
|
1476
|
+
...v
|
|
1477
|
+
}, N) => {
|
|
1478
|
+
const m = b || `check-input-${Math.random().toString(36).substr(2, 9)}`, g = [
|
|
1480
1479
|
"clarity-check-input-wrapper",
|
|
1481
|
-
`clarity-check-input-wrapper--${
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
].filter(Boolean).join(" "),
|
|
1480
|
+
`clarity-check-input-wrapper--${u}`,
|
|
1481
|
+
p && "clarity-check-input-wrapper--disabled",
|
|
1482
|
+
d && "clarity-check-input-wrapper--error"
|
|
1483
|
+
].filter(Boolean).join(" "), C = [
|
|
1485
1484
|
"clarity-check-input",
|
|
1486
1485
|
`clarity-check-input--${t}`,
|
|
1487
1486
|
`clarity-check-input--${r}`,
|
|
1488
1487
|
a && `clarity-check-input--${a}`,
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
].filter(Boolean).join(" "),
|
|
1488
|
+
d && "clarity-check-input--error",
|
|
1489
|
+
p && "clarity-check-input--disabled",
|
|
1490
|
+
y
|
|
1491
|
+
].filter(Boolean).join(" "), x = [
|
|
1493
1492
|
"clarity-check-input__label",
|
|
1494
1493
|
`clarity-check-input__label--${r}`,
|
|
1495
|
-
|
|
1496
|
-
].filter(Boolean).join(" "),
|
|
1494
|
+
p && "clarity-check-input__label--disabled"
|
|
1495
|
+
].filter(Boolean).join(" "), B = s != null && s.endsWith("left") ? "left" : "right", k = ($, S) => {
|
|
1497
1496
|
if (!o) return null;
|
|
1498
|
-
const
|
|
1497
|
+
const _ = typeof o == "object" ? o : void 0, M = (_ == null ? void 0 : _.content) ?? "Ajuda", I = (_ == null ? void 0 : _.plain) === !0, E = _ == null ? void 0 : _.variant, X = _ == null ? void 0 : _.bgColor, L = _ == null ? void 0 : _.textColor;
|
|
1499
1498
|
return /* @__PURE__ */ e(
|
|
1500
|
-
|
|
1499
|
+
yt,
|
|
1501
1500
|
{
|
|
1502
|
-
content:
|
|
1503
|
-
position:
|
|
1501
|
+
content: M,
|
|
1502
|
+
position: $ === "middle" ? S === "left" ? "left" : "right" : $ === "top" ? S === "left" ? "top-left" : "top-right" : S === "left" ? "bottom-left" : "bottom-right",
|
|
1504
1503
|
trigger: "hover",
|
|
1505
|
-
variant:
|
|
1506
|
-
plain:
|
|
1507
|
-
bgColor:
|
|
1508
|
-
textColor:
|
|
1509
|
-
children: /* @__PURE__ */ e("button", { type: "button", className: "clarity-check-input__helper-icon", "aria-label": "Helper", children: /* @__PURE__ */ e(
|
|
1504
|
+
variant: E || a,
|
|
1505
|
+
plain: I,
|
|
1506
|
+
bgColor: X,
|
|
1507
|
+
textColor: L,
|
|
1508
|
+
children: /* @__PURE__ */ e("button", { type: "button", className: "clarity-check-input__helper-icon", "aria-label": "Helper", children: /* @__PURE__ */ e(pt, { size: $ === "middle" ? 20 : 16 }) })
|
|
1510
1509
|
}
|
|
1511
1510
|
);
|
|
1512
|
-
},
|
|
1511
|
+
}, j = /* @__PURE__ */ w("label", { className: g, htmlFor: m, children: [
|
|
1513
1512
|
/* @__PURE__ */ e(
|
|
1514
1513
|
"input",
|
|
1515
1514
|
{
|
|
1516
|
-
ref:
|
|
1517
|
-
id:
|
|
1515
|
+
ref: N,
|
|
1516
|
+
id: m,
|
|
1518
1517
|
type: t,
|
|
1519
|
-
className:
|
|
1520
|
-
disabled:
|
|
1521
|
-
checked:
|
|
1522
|
-
...
|
|
1518
|
+
className: C,
|
|
1519
|
+
disabled: p,
|
|
1520
|
+
checked: f,
|
|
1521
|
+
...v
|
|
1523
1522
|
}
|
|
1524
1523
|
),
|
|
1525
1524
|
/* @__PURE__ */ w("div", { className: "clarity-check-input__custom", children: [
|
|
@@ -1544,111 +1543,112 @@ const Re = I.forwardRef(({
|
|
|
1544
1543
|
),
|
|
1545
1544
|
t === "radio" && /* @__PURE__ */ e("div", { className: "clarity-check-input__radio-dot" })
|
|
1546
1545
|
] }),
|
|
1547
|
-
l && /* @__PURE__ */ e("span", { className:
|
|
1546
|
+
l && /* @__PURE__ */ e("span", { className: x, children: l })
|
|
1548
1547
|
] });
|
|
1549
1548
|
return /* @__PURE__ */ w("div", { className: "clarity-check-input-container", children: [
|
|
1550
|
-
o && (s == null ? void 0 : s.startsWith("top")) && /* @__PURE__ */ e("div", { className: `clarity-check-input__helper-row clarity-check-input__helper-row--top clarity-check-input__helper-row--${
|
|
1551
|
-
o && (s != null && s.startsWith("middle")) ? /* @__PURE__ */ w("div", { className: `clarity-check-input__middle-row clarity-check-input__middle-row--${
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
] }) :
|
|
1556
|
-
o && (s == null ? void 0 : s.startsWith("bottom")) && /* @__PURE__ */ e("div", { className: `clarity-check-input__helper-row clarity-check-input__helper-row--bottom clarity-check-input__helper-row--${
|
|
1557
|
-
(n ||
|
|
1549
|
+
o && (s == null ? void 0 : s.startsWith("top")) && /* @__PURE__ */ e("div", { className: `clarity-check-input__helper-row clarity-check-input__helper-row--top clarity-check-input__helper-row--${B}`, children: k("top", B) }),
|
|
1550
|
+
o && (s != null && s.startsWith("middle")) ? /* @__PURE__ */ w("div", { className: `clarity-check-input__middle-row clarity-check-input__middle-row--${B}`, children: [
|
|
1551
|
+
B === "left" && k("middle", B),
|
|
1552
|
+
j,
|
|
1553
|
+
B === "right" && k("middle", B)
|
|
1554
|
+
] }) : j,
|
|
1555
|
+
o && (s == null ? void 0 : s.startsWith("bottom")) && /* @__PURE__ */ e("div", { className: `clarity-check-input__helper-row clarity-check-input__helper-row--bottom clarity-check-input__helper-row--${B}`, children: k("bottom", B) }),
|
|
1556
|
+
(n || d && i || c) && /* @__PURE__ */ e("div", { className: "clarity-check-input__helper-text", style: !n && !i ? { minHeight: "1.2em" } : void 0, children: (d && i ? i : n) || " " })
|
|
1558
1557
|
] });
|
|
1559
1558
|
});
|
|
1560
|
-
|
|
1561
|
-
const
|
|
1559
|
+
We.displayName = "CheckInput";
|
|
1560
|
+
const Ie = W.forwardRef(({
|
|
1562
1561
|
variant: t = "primary",
|
|
1563
1562
|
size: a = "medium",
|
|
1564
1563
|
label: r,
|
|
1565
1564
|
helper: l = !1,
|
|
1566
1565
|
helperPosition: n = "middle-right",
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1566
|
+
reserveErrorSpace: o = !1,
|
|
1567
|
+
error: s = !1,
|
|
1568
|
+
errorMessage: c,
|
|
1569
|
+
labelPosition: d = "right",
|
|
1570
|
+
className: i = "",
|
|
1571
|
+
disabled: u = !1,
|
|
1572
|
+
checked: y,
|
|
1573
|
+
id: p,
|
|
1574
|
+
...f
|
|
1575
|
+
}, b) => {
|
|
1576
|
+
const v = p || `input-switch-${Math.random().toString(36).substr(2, 9)}`, N = [
|
|
1577
1577
|
"clarity-input-switch-wrapper",
|
|
1578
|
-
`clarity-input-switch-wrapper--${
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
].filter(Boolean).join(" "),
|
|
1578
|
+
`clarity-input-switch-wrapper--${d}`,
|
|
1579
|
+
u && "clarity-input-switch-wrapper--disabled",
|
|
1580
|
+
s && "clarity-input-switch-wrapper--error"
|
|
1581
|
+
].filter(Boolean).join(" "), m = [
|
|
1582
1582
|
"clarity-input-switch",
|
|
1583
1583
|
`clarity-input-switch--${a}`,
|
|
1584
1584
|
t && `clarity-input-switch--${t}`,
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
].filter(Boolean).join(" "),
|
|
1585
|
+
s && "clarity-input-switch--error",
|
|
1586
|
+
u && "clarity-input-switch--disabled",
|
|
1587
|
+
i
|
|
1588
|
+
].filter(Boolean).join(" "), g = [
|
|
1589
1589
|
"clarity-input-switch__label",
|
|
1590
1590
|
`clarity-input-switch__label--${a}`,
|
|
1591
1591
|
t && `clarity-input-switch__label--${t}`,
|
|
1592
|
-
|
|
1593
|
-
].filter(Boolean).join(" "),
|
|
1592
|
+
u && "clarity-input-switch__label--disabled"
|
|
1593
|
+
].filter(Boolean).join(" "), C = n != null && n.endsWith("left") ? "left" : "right", x = (k, j) => {
|
|
1594
1594
|
if (!l) return null;
|
|
1595
|
-
const
|
|
1595
|
+
const $ = typeof l == "object" ? l : void 0, S = ($ == null ? void 0 : $.content) ?? "Ajuda", _ = ($ == null ? void 0 : $.plain) === !0, M = $ == null ? void 0 : $.variant, I = $ == null ? void 0 : $.bgColor, E = $ == null ? void 0 : $.textColor;
|
|
1596
1596
|
return /* @__PURE__ */ e(
|
|
1597
|
-
|
|
1597
|
+
yt,
|
|
1598
1598
|
{
|
|
1599
|
-
content:
|
|
1600
|
-
position:
|
|
1599
|
+
content: S,
|
|
1600
|
+
position: k === "middle" ? j === "left" ? "left" : "right" : k === "top" ? j === "left" ? "top-left" : "top-right" : j === "left" ? "bottom-left" : "bottom-right",
|
|
1601
1601
|
trigger: "hover",
|
|
1602
|
-
variant:
|
|
1603
|
-
plain:
|
|
1604
|
-
bgColor:
|
|
1605
|
-
textColor:
|
|
1606
|
-
children: /* @__PURE__ */ e("button", { type: "button", className: "clarity-input-switch__helper-icon", "aria-label": "Helper", children: /* @__PURE__ */ e(
|
|
1602
|
+
variant: M || t,
|
|
1603
|
+
plain: _,
|
|
1604
|
+
bgColor: I,
|
|
1605
|
+
textColor: E,
|
|
1606
|
+
children: /* @__PURE__ */ e("button", { type: "button", className: "clarity-input-switch__helper-icon", "aria-label": "Helper", children: /* @__PURE__ */ e(pt, { size: k === "middle" ? 20 : 16 }) })
|
|
1607
1607
|
}
|
|
1608
1608
|
);
|
|
1609
|
-
},
|
|
1609
|
+
}, B = /* @__PURE__ */ w("label", { className: N, htmlFor: v, children: [
|
|
1610
1610
|
/* @__PURE__ */ e(
|
|
1611
1611
|
"input",
|
|
1612
1612
|
{
|
|
1613
|
-
ref:
|
|
1614
|
-
id:
|
|
1613
|
+
ref: b,
|
|
1614
|
+
id: v,
|
|
1615
1615
|
type: "checkbox",
|
|
1616
|
-
className:
|
|
1617
|
-
disabled:
|
|
1618
|
-
checked:
|
|
1619
|
-
...
|
|
1616
|
+
className: m,
|
|
1617
|
+
disabled: u,
|
|
1618
|
+
checked: y,
|
|
1619
|
+
...f
|
|
1620
1620
|
}
|
|
1621
1621
|
),
|
|
1622
1622
|
/* @__PURE__ */ e("div", { className: "clarity-input-switch__track", children: /* @__PURE__ */ e("div", { className: "clarity-input-switch__thumb" }) }),
|
|
1623
|
-
r && /* @__PURE__ */ e("span", { className:
|
|
1623
|
+
r && /* @__PURE__ */ e("span", { className: g, children: r })
|
|
1624
1624
|
] });
|
|
1625
1625
|
return /* @__PURE__ */ w("div", { className: "clarity-input-switch-container", children: [
|
|
1626
|
-
l && (n == null ? void 0 : n.startsWith("top")) && /* @__PURE__ */ e("div", { className: `clarity-input-switch__helper-row clarity-input-switch__helper-row--top clarity-input-switch__helper-row--${
|
|
1627
|
-
l && (n != null && n.startsWith("middle")) ? /* @__PURE__ */ w("div", { className: `clarity-input-switch__middle-row clarity-input-switch__middle-row--${
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
] }) :
|
|
1632
|
-
l && (n == null ? void 0 : n.startsWith("bottom")) && /* @__PURE__ */ e("div", { className: `clarity-input-switch__helper-row clarity-input-switch__helper-row--bottom clarity-input-switch__helper-row--${
|
|
1633
|
-
|
|
1626
|
+
l && (n == null ? void 0 : n.startsWith("top")) && /* @__PURE__ */ e("div", { className: `clarity-input-switch__helper-row clarity-input-switch__helper-row--top clarity-input-switch__helper-row--${C}`, children: x("top", C) }),
|
|
1627
|
+
l && (n != null && n.startsWith("middle")) ? /* @__PURE__ */ w("div", { className: `clarity-input-switch__middle-row clarity-input-switch__middle-row--${C}`, children: [
|
|
1628
|
+
C === "left" && x("middle", C),
|
|
1629
|
+
B,
|
|
1630
|
+
C === "right" && x("middle", C)
|
|
1631
|
+
] }) : B,
|
|
1632
|
+
l && (n == null ? void 0 : n.startsWith("bottom")) && /* @__PURE__ */ e("div", { className: `clarity-input-switch__helper-row clarity-input-switch__helper-row--bottom clarity-input-switch__helper-row--${C}`, children: x("bottom", C) }),
|
|
1633
|
+
(s && c || o) && /* @__PURE__ */ e("div", { className: "clarity-input-switch__error-text", style: c ? void 0 : { minHeight: "1.2em" }, children: c || " " })
|
|
1634
1634
|
] });
|
|
1635
1635
|
});
|
|
1636
|
-
|
|
1637
|
-
const
|
|
1638
|
-
const t = dt(
|
|
1636
|
+
Ie.displayName = "InputSwitch";
|
|
1637
|
+
const Zt = ct(null), wt = () => {
|
|
1638
|
+
const t = dt(Zt);
|
|
1639
1639
|
if (!t)
|
|
1640
1640
|
throw new Error("useConfirmationDialog must be used within a ConfirmationDialog provider");
|
|
1641
1641
|
return t;
|
|
1642
|
-
},
|
|
1642
|
+
}, qt = ({ children: t, className: a = "" }) => {
|
|
1643
1643
|
const { variant: r } = wt(), l = `clarity-confirmation-dialog-header ${a} clarity-confirmation-dialog-header--${r}`;
|
|
1644
1644
|
return /* @__PURE__ */ e("div", { className: l, children: t });
|
|
1645
1645
|
};
|
|
1646
|
-
|
|
1647
|
-
const
|
|
1648
|
-
|
|
1649
|
-
const
|
|
1650
|
-
|
|
1651
|
-
const
|
|
1646
|
+
qt.displayName = "ConfirmationDialog.Header";
|
|
1647
|
+
const Jt = ({ children: t, className: a = "" }) => /* @__PURE__ */ e("div", { className: `clarity-confirmation-dialog-content ${a}`, children: t });
|
|
1648
|
+
Jt.displayName = "ConfirmationDialog.Content";
|
|
1649
|
+
const Qt = ({ children: t, className: a = "" }) => /* @__PURE__ */ e("div", { className: `clarity-confirmation-dialog-footer ${a}`, children: t });
|
|
1650
|
+
Qt.displayName = "ConfirmationDialog.Footer";
|
|
1651
|
+
const Kt = ({ children: t }) => {
|
|
1652
1652
|
const { onOpen: a } = wt();
|
|
1653
1653
|
return rt(t, {
|
|
1654
1654
|
onClick: (r) => {
|
|
@@ -1657,8 +1657,8 @@ const Qt = ({ children: t }) => {
|
|
|
1657
1657
|
}
|
|
1658
1658
|
});
|
|
1659
1659
|
};
|
|
1660
|
-
|
|
1661
|
-
const
|
|
1660
|
+
Kt.displayName = "ConfirmationDialog.Trigger";
|
|
1661
|
+
const Pt = ({ children: t }) => {
|
|
1662
1662
|
const { onClose: a } = wt();
|
|
1663
1663
|
return rt(t, {
|
|
1664
1664
|
onClick: (r) => {
|
|
@@ -1667,8 +1667,8 @@ const Kt = ({ children: t }) => {
|
|
|
1667
1667
|
}
|
|
1668
1668
|
});
|
|
1669
1669
|
};
|
|
1670
|
-
|
|
1671
|
-
const
|
|
1670
|
+
Pt.displayName = "ConfirmationDialog.Close";
|
|
1671
|
+
const te = ({ children: t }) => {
|
|
1672
1672
|
const { onConfirm: a } = wt();
|
|
1673
1673
|
return rt(t, {
|
|
1674
1674
|
onClick: (r) => {
|
|
@@ -1677,7 +1677,7 @@ const Pt = ({ children: t }) => {
|
|
|
1677
1677
|
}
|
|
1678
1678
|
});
|
|
1679
1679
|
};
|
|
1680
|
-
|
|
1680
|
+
te.displayName = "ConfirmationDialog.Confirm";
|
|
1681
1681
|
const ut = ({
|
|
1682
1682
|
isOpen: t,
|
|
1683
1683
|
onClose: a,
|
|
@@ -1686,39 +1686,39 @@ const ut = ({
|
|
|
1686
1686
|
children: n,
|
|
1687
1687
|
blockScroll: o = !0
|
|
1688
1688
|
}) => {
|
|
1689
|
-
const [s, c] =
|
|
1689
|
+
const [s, c] = z(!1), d = t !== void 0, i = d ? t : s, u = () => {
|
|
1690
1690
|
d || c(!0);
|
|
1691
|
-
},
|
|
1691
|
+
}, y = W.useCallback(() => {
|
|
1692
1692
|
a ? a() : c(!1);
|
|
1693
1693
|
}, [a]), p = () => {
|
|
1694
|
-
r && r(),
|
|
1694
|
+
r && r(), y();
|
|
1695
1695
|
};
|
|
1696
|
-
|
|
1696
|
+
Q(() => {
|
|
1697
1697
|
const N = (m) => {
|
|
1698
|
-
m.key === "Escape" &&
|
|
1698
|
+
m.key === "Escape" && y();
|
|
1699
1699
|
};
|
|
1700
1700
|
return i ? (document.addEventListener("keydown", N), o && (document.body.style.overflow = "hidden")) : document.body.style.overflow = "unset", () => {
|
|
1701
1701
|
document.removeEventListener("keydown", N), document.body.style.overflow = "unset";
|
|
1702
1702
|
};
|
|
1703
|
-
}, [i,
|
|
1704
|
-
const
|
|
1703
|
+
}, [i, y, o]);
|
|
1704
|
+
const f = W.Children.toArray(n).find(
|
|
1705
1705
|
(N) => ot(N) && N.type.displayName === "ConfirmationDialog.Trigger"
|
|
1706
|
-
),
|
|
1706
|
+
), b = W.Children.toArray(n).filter(
|
|
1707
1707
|
(N) => ot(N) && N.type.displayName !== "ConfirmationDialog.Trigger"
|
|
1708
|
-
),
|
|
1709
|
-
return /* @__PURE__ */ w(
|
|
1710
|
-
|
|
1711
|
-
i && /* @__PURE__ */ e("div", { className: "clarity-modal-overlay", children: /* @__PURE__ */ e("div", { className:
|
|
1708
|
+
), v = `clarity-confirmation-dialog clarity-confirmation-dialog--${l}`;
|
|
1709
|
+
return /* @__PURE__ */ w(Zt.Provider, { value: { variant: l, onClose: y, onConfirm: p, onOpen: u }, children: [
|
|
1710
|
+
f,
|
|
1711
|
+
i && /* @__PURE__ */ e("div", { className: "clarity-modal-overlay", children: /* @__PURE__ */ e("div", { className: v, children: b }) })
|
|
1712
1712
|
] });
|
|
1713
1713
|
};
|
|
1714
|
-
ut.Header =
|
|
1715
|
-
ut.Content =
|
|
1716
|
-
ut.Footer =
|
|
1717
|
-
ut.Trigger =
|
|
1718
|
-
ut.Close =
|
|
1719
|
-
ut.Confirm =
|
|
1714
|
+
ut.Header = qt;
|
|
1715
|
+
ut.Content = Jt;
|
|
1716
|
+
ut.Footer = Qt;
|
|
1717
|
+
ut.Trigger = Kt;
|
|
1718
|
+
ut.Close = Pt;
|
|
1719
|
+
ut.Confirm = te;
|
|
1720
1720
|
ut.displayName = "ConfirmationDialog";
|
|
1721
|
-
const
|
|
1721
|
+
const la = ({
|
|
1722
1722
|
variant: t = "primary",
|
|
1723
1723
|
size: a = "medium",
|
|
1724
1724
|
disabled: r = !1,
|
|
@@ -1730,35 +1730,35 @@ const ra = ({
|
|
|
1730
1730
|
"aria-label": d,
|
|
1731
1731
|
title: i,
|
|
1732
1732
|
customColor: u,
|
|
1733
|
-
customColorHover:
|
|
1733
|
+
customColorHover: y,
|
|
1734
1734
|
...p
|
|
1735
1735
|
}) => {
|
|
1736
|
-
const
|
|
1737
|
-
|
|
1738
|
-
!u && `${
|
|
1739
|
-
`${
|
|
1740
|
-
l && `${
|
|
1741
|
-
r && `${
|
|
1736
|
+
const f = "clarity-button-icon", b = [
|
|
1737
|
+
f,
|
|
1738
|
+
!u && `${f}--${t}`,
|
|
1739
|
+
`${f}--${a}`,
|
|
1740
|
+
l && `${f}--loading`,
|
|
1741
|
+
r && `${f}--disabled`,
|
|
1742
1742
|
c
|
|
1743
|
-
].filter(Boolean).join(" "),
|
|
1744
|
-
return u && (
|
|
1743
|
+
].filter(Boolean).join(" "), v = {};
|
|
1744
|
+
return u && (v["--button-icon-bg"] = u, v["--button-icon-hover-bg"] = y || `${u}E6`), /* @__PURE__ */ w(
|
|
1745
1745
|
"button",
|
|
1746
1746
|
{
|
|
1747
|
-
className:
|
|
1747
|
+
className: b,
|
|
1748
1748
|
disabled: r || l,
|
|
1749
1749
|
onClick: o,
|
|
1750
1750
|
type: s,
|
|
1751
1751
|
"aria-label": d,
|
|
1752
1752
|
title: i,
|
|
1753
|
-
style:
|
|
1753
|
+
style: v,
|
|
1754
1754
|
...p,
|
|
1755
1755
|
children: [
|
|
1756
|
-
l && /* @__PURE__ */ e("div", { className: `${
|
|
1756
|
+
l && /* @__PURE__ */ e("div", { className: `${f}__spinner` }),
|
|
1757
1757
|
!l && n
|
|
1758
1758
|
]
|
|
1759
1759
|
}
|
|
1760
1760
|
);
|
|
1761
|
-
},
|
|
1761
|
+
}, na = ({
|
|
1762
1762
|
variant: t = "primary",
|
|
1763
1763
|
product: a,
|
|
1764
1764
|
tone: r,
|
|
@@ -1770,19 +1770,19 @@ const ra = ({
|
|
|
1770
1770
|
href: d,
|
|
1771
1771
|
target: i,
|
|
1772
1772
|
rel: u,
|
|
1773
|
-
className:
|
|
1773
|
+
className: y = "",
|
|
1774
1774
|
...p
|
|
1775
1775
|
}) => {
|
|
1776
|
-
const
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
`${
|
|
1780
|
-
o && `${
|
|
1781
|
-
|
|
1782
|
-
].filter(Boolean).join(" "), m = (
|
|
1783
|
-
const x = parseInt(
|
|
1776
|
+
const f = "clarity-button-link", b = a && r, v = b ? `${f}--custom` : `${f}--${t}`, N = [
|
|
1777
|
+
f,
|
|
1778
|
+
v,
|
|
1779
|
+
`${f}--${n}`,
|
|
1780
|
+
o && `${f}--disabled`,
|
|
1781
|
+
y
|
|
1782
|
+
].filter(Boolean).join(" "), m = (C) => {
|
|
1783
|
+
const x = parseInt(C);
|
|
1784
1784
|
return x >= 800 ? "900" : x >= 700 ? "800" : x >= 600 ? "700" : x >= 500 ? "600" : x >= 400 ? "500" : x >= 300 ? "400" : x >= 200 ? "300" : "200";
|
|
1785
|
-
},
|
|
1785
|
+
}, g = b ? {
|
|
1786
1786
|
"--custom-color": `var(--clarity-${a}-${r})`,
|
|
1787
1787
|
"--custom-hover-color": `var(--clarity-${a}-${l || m(r)})`
|
|
1788
1788
|
} : {};
|
|
@@ -1793,7 +1793,7 @@ const ra = ({
|
|
|
1793
1793
|
target: i,
|
|
1794
1794
|
rel: u || (i === "_blank" ? "noopener noreferrer" : void 0),
|
|
1795
1795
|
className: N,
|
|
1796
|
-
style:
|
|
1796
|
+
style: g,
|
|
1797
1797
|
onClick: o ? void 0 : c,
|
|
1798
1798
|
...p,
|
|
1799
1799
|
children: s
|
|
@@ -1802,19 +1802,19 @@ const ra = ({
|
|
|
1802
1802
|
"button",
|
|
1803
1803
|
{
|
|
1804
1804
|
className: N,
|
|
1805
|
-
style:
|
|
1805
|
+
style: g,
|
|
1806
1806
|
disabled: o,
|
|
1807
1807
|
onClick: c,
|
|
1808
1808
|
...p,
|
|
1809
1809
|
children: s
|
|
1810
1810
|
}
|
|
1811
1811
|
);
|
|
1812
|
-
},
|
|
1813
|
-
const t = dt(
|
|
1812
|
+
}, ee = ct(void 0), ae = () => {
|
|
1813
|
+
const t = dt(ee);
|
|
1814
1814
|
if (!t)
|
|
1815
1815
|
throw new Error("Accordion components must be used within an Accordion");
|
|
1816
1816
|
return t;
|
|
1817
|
-
},
|
|
1817
|
+
}, He = ({
|
|
1818
1818
|
variant: t = "primary",
|
|
1819
1819
|
product: a,
|
|
1820
1820
|
tone: r,
|
|
@@ -1827,24 +1827,24 @@ const ra = ({
|
|
|
1827
1827
|
onSelect: i,
|
|
1828
1828
|
...u
|
|
1829
1829
|
}) => {
|
|
1830
|
-
const [
|
|
1831
|
-
let
|
|
1832
|
-
o ?
|
|
1833
|
-
},
|
|
1834
|
-
|
|
1830
|
+
const [y, p] = z(() => n ? Array.isArray(n) ? n : [n] : []), f = (B) => {
|
|
1831
|
+
let k;
|
|
1832
|
+
o ? k = y.includes(B) ? y.filter((j) => j !== B) : [...y, B] : k = y.includes(B) ? [] : [B], p(k), i && i(y.includes(B) ? null : B, {});
|
|
1833
|
+
}, b = "clarity-accordion", v = a && r, N = v ? `${b}--custom` : `${b}--${t}`, m = [
|
|
1834
|
+
b,
|
|
1835
1835
|
N,
|
|
1836
|
-
s && `${
|
|
1836
|
+
s && `${b}--flush`,
|
|
1837
1837
|
c
|
|
1838
|
-
].filter(Boolean).join(" "),
|
|
1839
|
-
const
|
|
1840
|
-
return
|
|
1841
|
-
},
|
|
1838
|
+
].filter(Boolean).join(" "), g = (B) => {
|
|
1839
|
+
const k = parseInt(B);
|
|
1840
|
+
return k >= 800 ? "900" : k >= 700 ? "800" : k >= 600 ? "700" : k >= 500 ? "600" : k >= 400 ? "500" : k >= 300 ? "400" : k >= 200 ? "300" : "200";
|
|
1841
|
+
}, C = v ? {
|
|
1842
1842
|
"--custom-border-color": `var(--clarity-${a}-${r})`,
|
|
1843
1843
|
"--custom-header-color": `var(--clarity-${a}-${r})`,
|
|
1844
|
-
"--custom-hover-color": `var(--clarity-${a}-${l ||
|
|
1844
|
+
"--custom-hover-color": `var(--clarity-${a}-${l || g(r)})`
|
|
1845
1845
|
} : {}, x = {
|
|
1846
|
-
activeKeys:
|
|
1847
|
-
toggleItem:
|
|
1846
|
+
activeKeys: y,
|
|
1847
|
+
toggleItem: f,
|
|
1848
1848
|
alwaysOpen: o,
|
|
1849
1849
|
variant: t,
|
|
1850
1850
|
product: a,
|
|
@@ -1852,27 +1852,27 @@ const ra = ({
|
|
|
1852
1852
|
hoverTone: l,
|
|
1853
1853
|
flush: s
|
|
1854
1854
|
};
|
|
1855
|
-
return /* @__PURE__ */ e(
|
|
1856
|
-
},
|
|
1855
|
+
return /* @__PURE__ */ e(ee.Provider, { value: x, children: /* @__PURE__ */ e("div", { className: m, style: C, ...u, children: d }) });
|
|
1856
|
+
}, De = ({
|
|
1857
1857
|
eventKey: t,
|
|
1858
1858
|
disabled: a = !1,
|
|
1859
1859
|
className: r = "",
|
|
1860
1860
|
children: l,
|
|
1861
1861
|
...n
|
|
1862
1862
|
}) => {
|
|
1863
|
-
const { activeKeys: o } =
|
|
1863
|
+
const { activeKeys: o } = ae(), s = "clarity-accordion", c = o.includes(t), d = [
|
|
1864
1864
|
`${s}__item`,
|
|
1865
1865
|
c && `${s}__item--active`,
|
|
1866
1866
|
a && `${s}__item--disabled`,
|
|
1867
1867
|
r
|
|
1868
1868
|
].filter(Boolean).join(" ");
|
|
1869
|
-
return /* @__PURE__ */ e("div", { className: d, ...n, children:
|
|
1869
|
+
return /* @__PURE__ */ e("div", { className: d, ...n, children: W.Children.map(l, (i) => W.isValidElement(i) ? W.cloneElement(i, {
|
|
1870
1870
|
...i.props,
|
|
1871
1871
|
eventKey: t,
|
|
1872
1872
|
disabled: a,
|
|
1873
1873
|
isActive: c
|
|
1874
1874
|
}) : i) });
|
|
1875
|
-
},
|
|
1875
|
+
}, Ve = ({
|
|
1876
1876
|
className: t = "",
|
|
1877
1877
|
children: a,
|
|
1878
1878
|
onClick: r,
|
|
@@ -1881,7 +1881,7 @@ const ra = ({
|
|
|
1881
1881
|
isActive: o = !1,
|
|
1882
1882
|
...s
|
|
1883
1883
|
}) => {
|
|
1884
|
-
const { toggleItem: c } =
|
|
1884
|
+
const { toggleItem: c } = ae(), d = "clarity-accordion", i = (u) => {
|
|
1885
1885
|
!n && l && c(l), r == null || r(u);
|
|
1886
1886
|
};
|
|
1887
1887
|
return /* @__PURE__ */ w(
|
|
@@ -1909,7 +1909,7 @@ const ra = ({
|
|
|
1909
1909
|
]
|
|
1910
1910
|
}
|
|
1911
1911
|
);
|
|
1912
|
-
},
|
|
1912
|
+
}, Ae = ({
|
|
1913
1913
|
className: t = "",
|
|
1914
1914
|
children: a,
|
|
1915
1915
|
eventKey: r,
|
|
@@ -1928,19 +1928,19 @@ const ra = ({
|
|
|
1928
1928
|
children: /* @__PURE__ */ e("div", { className: [`${o}__body`, t].filter(Boolean).join(" "), ...n, children: a })
|
|
1929
1929
|
}
|
|
1930
1930
|
);
|
|
1931
|
-
},
|
|
1932
|
-
Item:
|
|
1933
|
-
Header:
|
|
1934
|
-
Body:
|
|
1935
|
-
}),
|
|
1931
|
+
}, ia = Object.assign(He, {
|
|
1932
|
+
Item: De,
|
|
1933
|
+
Header: Ve,
|
|
1934
|
+
Body: Ae
|
|
1935
|
+
}), re = ct(
|
|
1936
1936
|
void 0
|
|
1937
|
-
),
|
|
1938
|
-
const t = dt(
|
|
1937
|
+
), le = () => {
|
|
1938
|
+
const t = dt(re);
|
|
1939
1939
|
if (!t)
|
|
1940
1940
|
throw new Error("useDropdown must be used within a DropdownProvider");
|
|
1941
1941
|
return t;
|
|
1942
|
-
},
|
|
1943
|
-
const { setIsOpen: a, triggerRef: r } =
|
|
1942
|
+
}, ze = ({ children: t }) => {
|
|
1943
|
+
const { setIsOpen: a, triggerRef: r } = le();
|
|
1944
1944
|
return /* @__PURE__ */ e(
|
|
1945
1945
|
"button",
|
|
1946
1946
|
{
|
|
@@ -1952,44 +1952,44 @@ const ra = ({
|
|
|
1952
1952
|
children: t
|
|
1953
1953
|
}
|
|
1954
1954
|
);
|
|
1955
|
-
},
|
|
1956
|
-
const { isOpen: a, contentRef: r, styles: l } =
|
|
1955
|
+
}, Me = ({ children: t }) => {
|
|
1956
|
+
const { isOpen: a, contentRef: r, styles: l } = le();
|
|
1957
1957
|
return a ? /* @__PURE__ */ e("div", { ref: r, className: "dropdown__content", style: l, children: t }) : null;
|
|
1958
|
-
},
|
|
1959
|
-
const [l, n] =
|
|
1960
|
-
return
|
|
1958
|
+
}, Fe = ({ children: t }) => /* @__PURE__ */ e("div", { className: "dropdown__menu", children: t }), Ge = ({ as: t, children: a, ...r }) => /* @__PURE__ */ e(t || "a", { ...r, className: "dropdown__item", children: a }), Ue = () => /* @__PURE__ */ e("hr", { className: "dropdown__separator" }), vt = ({ title: t, position: a = "bottom", children: r }) => {
|
|
1959
|
+
const [l, n] = z(!1), [o, s] = z({}), c = at(null), d = at(null), i = at(null);
|
|
1960
|
+
return Et(() => {
|
|
1961
1961
|
if (l) {
|
|
1962
|
-
const u = d.current,
|
|
1963
|
-
if (!u || !
|
|
1964
|
-
const p = u.getBoundingClientRect(),
|
|
1962
|
+
const u = d.current, y = i.current;
|
|
1963
|
+
if (!u || !y) return;
|
|
1964
|
+
const p = u.getBoundingClientRect(), f = y.getBoundingClientRect(), b = window.innerHeight, v = window.innerWidth;
|
|
1965
1965
|
let N = a;
|
|
1966
|
-
a === "bottom" && p.bottom +
|
|
1966
|
+
a === "bottom" && p.bottom + f.height > b && (N = "top"), a === "top" && p.top - f.height < 0 && (N = "bottom"), a === "right" && p.right + f.width > v && (N = "left"), a === "left" && p.left - f.width < 0 && (N = "right");
|
|
1967
1967
|
const m = {};
|
|
1968
1968
|
switch (N) {
|
|
1969
1969
|
case "top":
|
|
1970
|
-
m.bottom = p.height + 4, m.left = p.width / 2 -
|
|
1970
|
+
m.bottom = p.height + 4, m.left = p.width / 2 - f.width / 2;
|
|
1971
1971
|
break;
|
|
1972
1972
|
case "right":
|
|
1973
|
-
m.left = p.width + 4, m.top = p.height / 2 -
|
|
1973
|
+
m.left = p.width + 4, m.top = p.height / 2 - f.height / 2;
|
|
1974
1974
|
break;
|
|
1975
1975
|
case "left":
|
|
1976
|
-
m.right = p.width + 4, m.top = p.height / 2 -
|
|
1976
|
+
m.right = p.width + 4, m.top = p.height / 2 - f.height / 2;
|
|
1977
1977
|
break;
|
|
1978
1978
|
case "bottom":
|
|
1979
1979
|
default:
|
|
1980
|
-
m.top = p.height + 4, m.left = p.width / 2 -
|
|
1980
|
+
m.top = p.height + 4, m.left = p.width / 2 - f.width / 2;
|
|
1981
1981
|
break;
|
|
1982
1982
|
}
|
|
1983
1983
|
s(m);
|
|
1984
1984
|
}
|
|
1985
|
-
}, [l, a]),
|
|
1986
|
-
const u = (
|
|
1987
|
-
c.current && !c.current.contains(
|
|
1985
|
+
}, [l, a]), Q(() => {
|
|
1986
|
+
const u = (y) => {
|
|
1987
|
+
c.current && !c.current.contains(y.target) && n(!1);
|
|
1988
1988
|
};
|
|
1989
1989
|
return document.addEventListener("mousedown", u), () => {
|
|
1990
1990
|
document.removeEventListener("mousedown", u);
|
|
1991
1991
|
};
|
|
1992
|
-
}, []), /* @__PURE__ */ e(
|
|
1992
|
+
}, []), /* @__PURE__ */ e(re.Provider, { value: { isOpen: l, setIsOpen: n, triggerRef: d, contentRef: i, styles: o }, children: /* @__PURE__ */ e(
|
|
1993
1993
|
"div",
|
|
1994
1994
|
{
|
|
1995
1995
|
ref: c,
|
|
@@ -1999,12 +1999,12 @@ const ra = ({
|
|
|
1999
1999
|
}
|
|
2000
2000
|
) });
|
|
2001
2001
|
};
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
const
|
|
2002
|
+
vt.Trigger = ze;
|
|
2003
|
+
vt.Content = Me;
|
|
2004
|
+
vt.Menu = Fe;
|
|
2005
|
+
vt.Item = Ge;
|
|
2006
|
+
vt.Separator = Ue;
|
|
2007
|
+
const kt = ({
|
|
2008
2008
|
as: t = "button",
|
|
2009
2009
|
id: a,
|
|
2010
2010
|
children: r,
|
|
@@ -2037,8 +2037,8 @@ const xt = ({
|
|
|
2037
2037
|
}
|
|
2038
2038
|
);
|
|
2039
2039
|
};
|
|
2040
|
-
|
|
2041
|
-
const
|
|
2040
|
+
kt.displayName = "Tabs.Tab";
|
|
2041
|
+
const ne = ({
|
|
2042
2042
|
children: t,
|
|
2043
2043
|
activeTab: a,
|
|
2044
2044
|
onTabChange: r,
|
|
@@ -2055,12 +2055,12 @@ const le = ({
|
|
|
2055
2055
|
`orientation-${n}`,
|
|
2056
2056
|
n === "horizontal" ? c : ""
|
|
2057
2057
|
].filter(Boolean).join(" "), i = [], u = [];
|
|
2058
|
-
return
|
|
2059
|
-
ot(
|
|
2058
|
+
return Ne.forEach(t, (y) => {
|
|
2059
|
+
ot(y) && y.type === kt ? i.push(y) : u.push(y);
|
|
2060
2060
|
}), /* @__PURE__ */ w("div", { className: d, children: [
|
|
2061
2061
|
/* @__PURE__ */ e("div", { className: "clarity-tab-list", role: "tablist", children: i.map(
|
|
2062
|
-
(
|
|
2063
|
-
isActive:
|
|
2062
|
+
(y) => rt(y, {
|
|
2063
|
+
isActive: W.isValidElement(y) && y.props.id === a,
|
|
2064
2064
|
onClick: r,
|
|
2065
2065
|
variant: l,
|
|
2066
2066
|
orientation: n
|
|
@@ -2069,14 +2069,14 @@ const le = ({
|
|
|
2069
2069
|
u
|
|
2070
2070
|
] });
|
|
2071
2071
|
};
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
const
|
|
2075
|
-
const t = dt(
|
|
2072
|
+
ne.Tab = kt;
|
|
2073
|
+
ne.displayName = "Tabs";
|
|
2074
|
+
const ie = ct(null), bt = () => {
|
|
2075
|
+
const t = dt(ie);
|
|
2076
2076
|
if (!t)
|
|
2077
2077
|
throw new Error("useCommand must be used within a Command provider");
|
|
2078
2078
|
return t;
|
|
2079
|
-
},
|
|
2079
|
+
}, se = ({
|
|
2080
2080
|
children: t,
|
|
2081
2081
|
className: a = "",
|
|
2082
2082
|
variant: r = "secondary",
|
|
@@ -2084,11 +2084,11 @@ const ne = ct(null), yt = () => {
|
|
|
2084
2084
|
inputPlaceholder: n = "Search...",
|
|
2085
2085
|
...o
|
|
2086
2086
|
}) => {
|
|
2087
|
-
const [s, c] =
|
|
2087
|
+
const [s, c] = z(""), [d, i] = z(null), [u, y] = z(!1), p = [
|
|
2088
2088
|
"clarity-command",
|
|
2089
2089
|
`clarity-command--${r}`,
|
|
2090
2090
|
a
|
|
2091
|
-
].filter(Boolean).join(" "),
|
|
2091
|
+
].filter(Boolean).join(" "), f = gt(() => ({
|
|
2092
2092
|
searchTerm: s,
|
|
2093
2093
|
setSearchTerm: c,
|
|
2094
2094
|
value: d,
|
|
@@ -2099,14 +2099,14 @@ const ne = ct(null), yt = () => {
|
|
|
2099
2099
|
inputPlaceholder: n
|
|
2100
2100
|
},
|
|
2101
2101
|
isOpen: u,
|
|
2102
|
-
setIsOpen:
|
|
2102
|
+
setIsOpen: y
|
|
2103
2103
|
}), [s, d, r, l, n, u]);
|
|
2104
|
-
return /* @__PURE__ */ e(
|
|
2104
|
+
return /* @__PURE__ */ e(ie.Provider, { value: f, children: /* @__PURE__ */ e("div", { className: p, ...o, children: t }) });
|
|
2105
2105
|
};
|
|
2106
|
-
|
|
2107
|
-
const
|
|
2108
|
-
const { setIsOpen: l, variant: n } =
|
|
2109
|
-
|
|
2106
|
+
se.displayName = "Command";
|
|
2107
|
+
const oe = ({ placeholder: t = "Search...", variant: a, onClick: r }) => {
|
|
2108
|
+
const { setIsOpen: l, variant: n } = bt(), [o, s] = z(!1);
|
|
2109
|
+
Q(() => {
|
|
2110
2110
|
s(/Mac|iPod|iPhone|iPad/.test(navigator.platform));
|
|
2111
2111
|
}, []);
|
|
2112
2112
|
const d = [
|
|
@@ -2123,20 +2123,20 @@ const se = ({ placeholder: t = "Search...", variant: a, onClick: r }) => {
|
|
|
2123
2123
|
] })
|
|
2124
2124
|
] });
|
|
2125
2125
|
};
|
|
2126
|
-
|
|
2127
|
-
const
|
|
2128
|
-
const { isOpen: a, setIsOpen: r, variant: l } =
|
|
2129
|
-
return
|
|
2126
|
+
oe.displayName = "Command.Button";
|
|
2127
|
+
const ce = ({ children: t }) => {
|
|
2128
|
+
const { isOpen: a, setIsOpen: r, variant: l } = bt();
|
|
2129
|
+
return Q(() => {
|
|
2130
2130
|
const n = (o) => {
|
|
2131
2131
|
o.key === "k" && (o.metaKey || o.ctrlKey) && (o.preventDefault(), r(!a));
|
|
2132
2132
|
};
|
|
2133
2133
|
return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
|
|
2134
2134
|
}, [a, r]), /* @__PURE__ */ e(mt, { isOpen: a, onClose: () => r(!1), size: "large", closeOnOverlayClick: !0, children: /* @__PURE__ */ e("div", { className: `clarity-command--${l}`, children: t }) });
|
|
2135
2135
|
};
|
|
2136
|
-
|
|
2137
|
-
const
|
|
2138
|
-
const { searchTerm: r, setSearchTerm: l, variant: n, texts: o, isOpen: s } =
|
|
2139
|
-
|
|
2136
|
+
ce.displayName = "Command.Dialog";
|
|
2137
|
+
const de = ({ className: t = "", ...a }) => {
|
|
2138
|
+
const { searchTerm: r, setSearchTerm: l, variant: n, texts: o, isOpen: s } = bt(), c = at(null);
|
|
2139
|
+
Q(() => {
|
|
2140
2140
|
var i;
|
|
2141
2141
|
s && ((i = c.current) == null || i.focus());
|
|
2142
2142
|
}, [s]);
|
|
@@ -2157,66 +2157,66 @@ const ce = ({ className: t = "", ...a }) => {
|
|
|
2157
2157
|
}
|
|
2158
2158
|
) });
|
|
2159
2159
|
};
|
|
2160
|
-
|
|
2161
|
-
const
|
|
2162
|
-
const { searchTerm: l } =
|
|
2160
|
+
de.displayName = "Command.Input";
|
|
2161
|
+
const me = ({ children: t, className: a = "", ...r }) => {
|
|
2162
|
+
const { searchTerm: l } = bt();
|
|
2163
2163
|
let n = !1;
|
|
2164
|
-
const o = (d) =>
|
|
2165
|
-
var
|
|
2166
|
-
if (!
|
|
2164
|
+
const o = (d) => W.Children.toArray(d).map((i) => {
|
|
2165
|
+
var y;
|
|
2166
|
+
if (!W.isValidElement(i)) return i;
|
|
2167
2167
|
const u = i.type.displayName;
|
|
2168
2168
|
if (u === "Command.Empty")
|
|
2169
2169
|
return null;
|
|
2170
2170
|
if (u === "Command.Item")
|
|
2171
|
-
return (((
|
|
2171
|
+
return (((y = i.props.children) == null ? void 0 : y.toString().toLowerCase()) || "").includes(l.toLowerCase()) ? (n = !0, i) : null;
|
|
2172
2172
|
if (u === "Command.Group") {
|
|
2173
2173
|
const p = o(i.props.children);
|
|
2174
|
-
return
|
|
2174
|
+
return W.Children.toArray(p).some((b) => W.isValidElement(b) && b.type.displayName === "Command.Item") ? W.cloneElement(i, { ...i.props, children: p }) : null;
|
|
2175
2175
|
}
|
|
2176
2176
|
return i;
|
|
2177
2177
|
}).filter(Boolean), s = o(t), c = ["clarity-command-list", a].filter(Boolean).join(" ");
|
|
2178
2178
|
return /* @__PURE__ */ w("div", { className: c, ...r, children: [
|
|
2179
2179
|
s,
|
|
2180
|
-
!n && /* @__PURE__ */ e(
|
|
2180
|
+
!n && /* @__PURE__ */ e(Tt, {})
|
|
2181
2181
|
] });
|
|
2182
2182
|
};
|
|
2183
|
-
|
|
2184
|
-
const
|
|
2185
|
-
const { texts: l } =
|
|
2183
|
+
me.displayName = "Command.List";
|
|
2184
|
+
const Tt = ({ children: t, className: a = "", ...r }) => {
|
|
2185
|
+
const { texts: l } = bt(), n = ["clarity-command-empty", a].filter(Boolean).join(" ");
|
|
2186
2186
|
return /* @__PURE__ */ e("div", { className: n, ...r, children: t || r.emptyText || l.empty });
|
|
2187
2187
|
};
|
|
2188
|
-
|
|
2189
|
-
const
|
|
2188
|
+
Tt.displayName = "Command.Empty";
|
|
2189
|
+
const ue = ({ children: t, className: a = "", ...r }) => {
|
|
2190
2190
|
const l = ["clarity-command-group", a].filter(Boolean).join(" ");
|
|
2191
2191
|
return /* @__PURE__ */ e("div", { className: l, ...r, children: t });
|
|
2192
2192
|
};
|
|
2193
|
-
|
|
2194
|
-
const
|
|
2195
|
-
const { setValue: l, variant: n } =
|
|
2193
|
+
ue.displayName = "Command.Group";
|
|
2194
|
+
const fe = ({ children: t, className: a = "", ...r }) => {
|
|
2195
|
+
const { setValue: l, variant: n } = bt(), o = ["clarity-command-item", `clarity-command-item--${n}`, a].filter(Boolean).join(" ");
|
|
2196
2196
|
return /* @__PURE__ */ e("div", { className: o, onClick: () => l((t == null ? void 0 : t.toString()) || ""), ...r, children: t });
|
|
2197
2197
|
};
|
|
2198
|
-
|
|
2199
|
-
const
|
|
2198
|
+
fe.displayName = "Command.Item";
|
|
2199
|
+
const pe = ({ className: t = "", ...a }) => {
|
|
2200
2200
|
const r = ["clarity-command-separator", t].filter(Boolean).join(" ");
|
|
2201
2201
|
return /* @__PURE__ */ e("hr", { className: r, ...a });
|
|
2202
2202
|
};
|
|
2203
|
-
|
|
2204
|
-
const
|
|
2203
|
+
pe.displayName = "Command.Separator";
|
|
2204
|
+
const ye = ({ children: t, className: a = "", ...r }) => {
|
|
2205
2205
|
const l = ["clarity-command-shortcut", a].filter(Boolean).join(" ");
|
|
2206
2206
|
return /* @__PURE__ */ e("span", { className: l, ...r, children: t });
|
|
2207
2207
|
};
|
|
2208
|
-
|
|
2209
|
-
const
|
|
2210
|
-
Button:
|
|
2211
|
-
Dialog:
|
|
2212
|
-
Input:
|
|
2213
|
-
List:
|
|
2214
|
-
Empty:
|
|
2215
|
-
Group:
|
|
2216
|
-
Item:
|
|
2217
|
-
Separator:
|
|
2218
|
-
Shortcut:
|
|
2219
|
-
}),
|
|
2208
|
+
ye.displayName = "Command.Shortcut";
|
|
2209
|
+
const sa = Object.assign(se, {
|
|
2210
|
+
Button: oe,
|
|
2211
|
+
Dialog: ce,
|
|
2212
|
+
Input: de,
|
|
2213
|
+
List: me,
|
|
2214
|
+
Empty: Tt,
|
|
2215
|
+
Group: ue,
|
|
2216
|
+
Item: fe,
|
|
2217
|
+
Separator: pe,
|
|
2218
|
+
Shortcut: ye
|
|
2219
|
+
}), Xe = ({ columns: t, viewMode: a }) => {
|
|
2220
2220
|
const r = Array.from({ length: 5 }, (l, n) => n);
|
|
2221
2221
|
return a === "card" ? /* @__PURE__ */ w("div", { className: "card-view-wrapper is-loading", children: [
|
|
2222
2222
|
/* @__PURE__ */ e("div", { className: "skeleton card-view-header" }),
|
|
@@ -2225,7 +2225,7 @@ const ia = Object.assign(ie, {
|
|
|
2225
2225
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { className: "table-row", children: t.map((l) => /* @__PURE__ */ e("th", { className: "table-header-cell", children: /* @__PURE__ */ e("div", { className: "skeleton skeleton-text" }) }, l.key)) }) }),
|
|
2226
2226
|
/* @__PURE__ */ e("tbody", { children: r.map((l) => /* @__PURE__ */ e("tr", { className: "table-row", children: t.map((n) => /* @__PURE__ */ e("td", { className: "table-cell", children: /* @__PURE__ */ e("div", { className: "skeleton skeleton-text" }) }, n.key)) }, l)) })
|
|
2227
2227
|
] }) });
|
|
2228
|
-
},
|
|
2228
|
+
}, oa = ({
|
|
2229
2229
|
variant: t = "secondary",
|
|
2230
2230
|
columns: a,
|
|
2231
2231
|
data: r,
|
|
@@ -2234,48 +2234,48 @@ const ia = Object.assign(ie, {
|
|
|
2234
2234
|
isLoading: o = !1,
|
|
2235
2235
|
pagination: s
|
|
2236
2236
|
}) => {
|
|
2237
|
-
const [c, d] =
|
|
2238
|
-
m.sortable && (c === m.key ? u((
|
|
2239
|
-
}, p =
|
|
2240
|
-
const
|
|
2241
|
-
return
|
|
2242
|
-
}), [r, c, i]),
|
|
2237
|
+
const [c, d] = z(null), [i, u] = z("none"), y = (m) => {
|
|
2238
|
+
m.sortable && (c === m.key ? u((g) => g === "asc" ? "desc" : g === "desc" ? "none" : "asc") : (d(m.key), u("asc")));
|
|
2239
|
+
}, p = gt(() => i === "none" || !c ? r : [...r].sort((m, g) => {
|
|
2240
|
+
const C = m[c], x = g[c];
|
|
2241
|
+
return C < x ? i === "asc" ? -1 : 1 : C > x ? i === "asc" ? 1 : -1 : 0;
|
|
2242
|
+
}), [r, c, i]), f = (m) => m.sortable ? c !== m.key || i === "none" ? /* @__PURE__ */ e("span", { className: "sort-icon", children: "↕" }) : i === "asc" ? /* @__PURE__ */ e("span", { className: "sort-icon", children: "↑" }) : /* @__PURE__ */ e("span", { className: "sort-icon", children: "↓" }) : null;
|
|
2243
2243
|
if (o)
|
|
2244
|
-
return /* @__PURE__ */ e(
|
|
2245
|
-
const
|
|
2244
|
+
return /* @__PURE__ */ e(Xe, { columns: a, viewMode: l });
|
|
2245
|
+
const b = `table-variant-${t} ${n ? "is-scrollable" : ""}`, v = () => {
|
|
2246
2246
|
if (!s) return null;
|
|
2247
2247
|
const {
|
|
2248
2248
|
currentPage: m,
|
|
2249
|
-
totalPages:
|
|
2250
|
-
onPageChange:
|
|
2249
|
+
totalPages: g,
|
|
2250
|
+
onPageChange: C,
|
|
2251
2251
|
totalItems: x,
|
|
2252
|
-
itemsPerPage:
|
|
2253
|
-
position:
|
|
2252
|
+
itemsPerPage: B,
|
|
2253
|
+
position: k = "right"
|
|
2254
2254
|
} = s;
|
|
2255
|
-
if (typeof
|
|
2255
|
+
if (typeof g != "number" || typeof m != "number")
|
|
2256
2256
|
return console.warn("Table Pagination: Invalid pagination props", s), null;
|
|
2257
|
-
if (x <=
|
|
2257
|
+
if (x <= B)
|
|
2258
2258
|
return null;
|
|
2259
|
-
const
|
|
2260
|
-
const
|
|
2261
|
-
if (
|
|
2262
|
-
for (let
|
|
2259
|
+
const j = (m - 1) * B + 1, $ = Math.min(m * B, x), S = () => {
|
|
2260
|
+
const _ = [];
|
|
2261
|
+
if (g <= 5)
|
|
2262
|
+
for (let I = 1; I <= g; I++) _.push(I);
|
|
2263
2263
|
else if (m <= 3) {
|
|
2264
|
-
for (let
|
|
2265
|
-
|
|
2266
|
-
} else if (m >=
|
|
2267
|
-
|
|
2268
|
-
for (let
|
|
2264
|
+
for (let I = 1; I <= 4; I++) _.push(I);
|
|
2265
|
+
_.push("..."), _.push(g);
|
|
2266
|
+
} else if (m >= g - 2) {
|
|
2267
|
+
_.push(1), _.push("...");
|
|
2268
|
+
for (let I = g - 3; I <= g; I++) _.push(I);
|
|
2269
2269
|
} else
|
|
2270
|
-
|
|
2271
|
-
return
|
|
2270
|
+
_.push(1), _.push("..."), _.push(m - 1), _.push(m), _.push(m + 1), _.push("..."), _.push(g);
|
|
2271
|
+
return _;
|
|
2272
2272
|
};
|
|
2273
|
-
return /* @__PURE__ */ w("div", { className: `table-pagination align-${
|
|
2273
|
+
return /* @__PURE__ */ w("div", { className: `table-pagination align-${k}`, children: [
|
|
2274
2274
|
/* @__PURE__ */ w("div", { className: "pagination-info", children: [
|
|
2275
2275
|
"Exibindo ",
|
|
2276
|
-
|
|
2276
|
+
j,
|
|
2277
2277
|
" a ",
|
|
2278
|
-
|
|
2278
|
+
$,
|
|
2279
2279
|
" de ",
|
|
2280
2280
|
x,
|
|
2281
2281
|
" resultados"
|
|
@@ -2285,7 +2285,7 @@ const ia = Object.assign(ie, {
|
|
|
2285
2285
|
"button",
|
|
2286
2286
|
{
|
|
2287
2287
|
className: "pagination-button",
|
|
2288
|
-
onClick: () =>
|
|
2288
|
+
onClick: () => C(1),
|
|
2289
2289
|
disabled: m === 1,
|
|
2290
2290
|
"aria-label": "Primeira página",
|
|
2291
2291
|
children: "«"
|
|
@@ -2295,28 +2295,28 @@ const ia = Object.assign(ie, {
|
|
|
2295
2295
|
"button",
|
|
2296
2296
|
{
|
|
2297
2297
|
className: "pagination-button",
|
|
2298
|
-
onClick: () =>
|
|
2298
|
+
onClick: () => C(m - 1),
|
|
2299
2299
|
disabled: m === 1,
|
|
2300
2300
|
"aria-label": "Página anterior",
|
|
2301
2301
|
children: "‹"
|
|
2302
2302
|
}
|
|
2303
2303
|
),
|
|
2304
|
-
|
|
2304
|
+
S().map((_, M) => /* @__PURE__ */ e(
|
|
2305
2305
|
"button",
|
|
2306
2306
|
{
|
|
2307
|
-
className: `pagination-button ${
|
|
2308
|
-
onClick: () => typeof
|
|
2309
|
-
disabled: typeof
|
|
2310
|
-
children:
|
|
2307
|
+
className: `pagination-button ${_ === m ? "active" : ""}`,
|
|
2308
|
+
onClick: () => typeof _ == "number" && C(_),
|
|
2309
|
+
disabled: typeof _ != "number",
|
|
2310
|
+
children: _
|
|
2311
2311
|
},
|
|
2312
|
-
|
|
2312
|
+
M
|
|
2313
2313
|
)),
|
|
2314
2314
|
/* @__PURE__ */ e(
|
|
2315
2315
|
"button",
|
|
2316
2316
|
{
|
|
2317
2317
|
className: "pagination-button",
|
|
2318
|
-
onClick: () =>
|
|
2319
|
-
disabled: m ===
|
|
2318
|
+
onClick: () => C(m + 1),
|
|
2319
|
+
disabled: m === g,
|
|
2320
2320
|
"aria-label": "Próxima página",
|
|
2321
2321
|
children: "›"
|
|
2322
2322
|
}
|
|
@@ -2325,51 +2325,51 @@ const ia = Object.assign(ie, {
|
|
|
2325
2325
|
"button",
|
|
2326
2326
|
{
|
|
2327
2327
|
className: "pagination-button",
|
|
2328
|
-
onClick: () =>
|
|
2329
|
-
disabled: m ===
|
|
2328
|
+
onClick: () => C(g),
|
|
2329
|
+
disabled: m === g,
|
|
2330
2330
|
"aria-label": "Última página",
|
|
2331
2331
|
children: "»"
|
|
2332
2332
|
}
|
|
2333
2333
|
)
|
|
2334
2334
|
] })
|
|
2335
2335
|
] });
|
|
2336
|
-
}, N = /* @__PURE__ */ w("div", { className: `table-wrapper ${
|
|
2336
|
+
}, N = /* @__PURE__ */ w("div", { className: `table-wrapper ${b}`, children: [
|
|
2337
2337
|
/* @__PURE__ */ w("table", { children: [
|
|
2338
2338
|
/* @__PURE__ */ e("thead", { className: "table-header", children: /* @__PURE__ */ e("tr", { className: "table-row", children: a.map((m) => /* @__PURE__ */ w(
|
|
2339
2339
|
"th",
|
|
2340
2340
|
{
|
|
2341
2341
|
className: `table-header-cell ${m.sortable ? "sortable" : ""} table-header-cell-${t}`,
|
|
2342
|
-
onClick: () =>
|
|
2342
|
+
onClick: () => y(m),
|
|
2343
2343
|
style: { minWidth: m.minWidth },
|
|
2344
2344
|
children: [
|
|
2345
2345
|
m.header,
|
|
2346
|
-
|
|
2346
|
+
f(m)
|
|
2347
2347
|
]
|
|
2348
2348
|
},
|
|
2349
2349
|
m.key
|
|
2350
2350
|
)) }) }),
|
|
2351
|
-
/* @__PURE__ */ e("tbody", { children: p.length === 0 ? /* @__PURE__ */ e("tr", { className: "table-row", children: /* @__PURE__ */ e("td", { colSpan: a.length, className: "table-cell", style: { textAlign: "center", padding: "2rem" }, children: "Nenhum resultado encontrado" }) }) : p.map((m,
|
|
2351
|
+
/* @__PURE__ */ e("tbody", { children: p.length === 0 ? /* @__PURE__ */ e("tr", { className: "table-row", children: /* @__PURE__ */ e("td", { colSpan: a.length, className: "table-cell", style: { textAlign: "center", padding: "2rem" }, children: "Nenhum resultado encontrado" }) }) : p.map((m, g) => /* @__PURE__ */ e("tr", { className: `table-row table-row-${t}`, children: a.map((C) => /* @__PURE__ */ e("td", { className: `table-cell ${C.align ? `table-cell-align-${C.align}` : ""}`, style: { minWidth: C.minWidth }, children: C.render ? C.render(m) : m[C.key] }, C.key)) }, g)) })
|
|
2352
2352
|
] }),
|
|
2353
|
-
|
|
2353
|
+
v()
|
|
2354
2354
|
] });
|
|
2355
|
-
return l === "card" ? /* @__PURE__ */ w("div", { className: `card-view-wrapper ${
|
|
2355
|
+
return l === "card" ? /* @__PURE__ */ w("div", { className: `card-view-wrapper ${b}`, children: [
|
|
2356
2356
|
/* @__PURE__ */ e("div", { className: `card-view-header table-header-cell-${t}`, children: a.map((m) => /* @__PURE__ */ w(
|
|
2357
2357
|
"div",
|
|
2358
2358
|
{
|
|
2359
2359
|
className: `card-view-header-cell ${m.sortable ? "sortable" : ""}`,
|
|
2360
|
-
onClick: () =>
|
|
2360
|
+
onClick: () => y(m),
|
|
2361
2361
|
style: { minWidth: m.minWidth },
|
|
2362
2362
|
children: [
|
|
2363
2363
|
m.header,
|
|
2364
|
-
|
|
2364
|
+
f(m)
|
|
2365
2365
|
]
|
|
2366
2366
|
},
|
|
2367
2367
|
m.key
|
|
2368
2368
|
)) }),
|
|
2369
|
-
/* @__PURE__ */ e("div", { className: "card-view-body", children: p.length === 0 ? /* @__PURE__ */ e("div", { className: `card-view-row table-row-${t}`, style: { justifyContent: "center", padding: "2rem" }, children: "Nenhum resultado encontrado" }) : p.map((m,
|
|
2370
|
-
|
|
2369
|
+
/* @__PURE__ */ e("div", { className: "card-view-body", children: p.length === 0 ? /* @__PURE__ */ e("div", { className: `card-view-row table-row-${t}`, style: { justifyContent: "center", padding: "2rem" }, children: "Nenhum resultado encontrado" }) : p.map((m, g) => /* @__PURE__ */ e("div", { className: `card-view-row table-row-${t}`, children: a.map((C) => /* @__PURE__ */ e("div", { className: `card-view-cell ${C.align ? `table-cell-align-${C.align}` : ""}`, style: { minWidth: C.minWidth }, children: C.render ? C.render(m) : m[C.key] }, C.key)) }, g)) }),
|
|
2370
|
+
v()
|
|
2371
2371
|
] }) : N;
|
|
2372
|
-
},
|
|
2372
|
+
}, ca = ({
|
|
2373
2373
|
variant: t = "primary",
|
|
2374
2374
|
size: a = "medium",
|
|
2375
2375
|
color: r,
|
|
@@ -2412,7 +2412,7 @@ const ia = Object.assign(ie, {
|
|
|
2412
2412
|
) })
|
|
2413
2413
|
}
|
|
2414
2414
|
);
|
|
2415
|
-
},
|
|
2415
|
+
}, Ye = ({
|
|
2416
2416
|
className: t = "",
|
|
2417
2417
|
noGutters: a,
|
|
2418
2418
|
justify: r,
|
|
@@ -2428,10 +2428,10 @@ const ia = Object.assign(ie, {
|
|
|
2428
2428
|
l ? `clarity-row--align-${l}` : "",
|
|
2429
2429
|
t
|
|
2430
2430
|
].filter(Boolean).join(" ");
|
|
2431
|
-
return
|
|
2431
|
+
return W.createElement(o, { className: c, ...s }, n);
|
|
2432
2432
|
};
|
|
2433
|
-
|
|
2434
|
-
const
|
|
2433
|
+
Ye.displayName = "Row";
|
|
2434
|
+
const Ze = (t) => `${t / 12 * 100}%`, qe = (t) => `${t / 12 * 100}%`, Je = ({
|
|
2435
2435
|
className: t = "",
|
|
2436
2436
|
xs: a,
|
|
2437
2437
|
sm: r,
|
|
@@ -2443,26 +2443,26 @@ const Xe = (t) => `${t / 12 * 100}%`, Ye = (t) => `${t / 12 * 100}%`, Ze = ({
|
|
|
2443
2443
|
children: d,
|
|
2444
2444
|
as: i = "div",
|
|
2445
2445
|
style: u,
|
|
2446
|
-
...
|
|
2446
|
+
...y
|
|
2447
2447
|
}) => {
|
|
2448
|
-
const p = { ...u },
|
|
2448
|
+
const p = { ...u }, f = (N, m) => {
|
|
2449
2449
|
if (m === void 0) return;
|
|
2450
|
-
const
|
|
2451
|
-
p[
|
|
2452
|
-
},
|
|
2450
|
+
const g = `--clarity-col-width-${N}`;
|
|
2451
|
+
p[g] = typeof m == "number" ? Ze(m) : "auto";
|
|
2452
|
+
}, b = (N, m) => {
|
|
2453
2453
|
if (m === void 0) return;
|
|
2454
|
-
const
|
|
2455
|
-
p[
|
|
2454
|
+
const g = `--clarity-col-offset-${N}`;
|
|
2455
|
+
p[g] = qe(m);
|
|
2456
2456
|
};
|
|
2457
|
-
|
|
2458
|
-
const
|
|
2459
|
-
return
|
|
2457
|
+
f("xs", a), f("sm", r), f("md", l), f("lg", n), f("xl", o), f("xxl", s), b("xs", c == null ? void 0 : c.xs), b("sm", c == null ? void 0 : c.sm), b("md", c == null ? void 0 : c.md), b("lg", c == null ? void 0 : c.lg), b("xl", c == null ? void 0 : c.xl), b("xxl", c == null ? void 0 : c.xxl);
|
|
2458
|
+
const v = ["clarity-col", t].filter(Boolean).join(" ");
|
|
2459
|
+
return W.createElement(i, { className: v, style: p, ...y }, d);
|
|
2460
2460
|
};
|
|
2461
|
-
|
|
2461
|
+
Je.displayName = "Col";
|
|
2462
2462
|
const he = ({ children: t, className: a, ...r }) => /* @__PURE__ */ e("div", { className: `clarity-card__header ${a || ""}`, ...r, children: t });
|
|
2463
2463
|
he.displayName = "Card.Header";
|
|
2464
|
-
const
|
|
2465
|
-
|
|
2464
|
+
const be = ({ children: t, className: a, ...r }) => /* @__PURE__ */ e("div", { className: `clarity-card__content ${a || ""}`, ...r, children: t });
|
|
2465
|
+
be.displayName = "Card.Content";
|
|
2466
2466
|
const ge = ({ children: t, className: a, align: r = "left", ...l }) => {
|
|
2467
2467
|
const n = r ? `clarity-card__footer--align-${r}` : "";
|
|
2468
2468
|
return /* @__PURE__ */ e("div", { className: `clarity-card__footer ${n} ${a || ""}`, ...l, children: t });
|
|
@@ -2470,10 +2470,10 @@ const ge = ({ children: t, className: a, align: r = "left", ...l }) => {
|
|
|
2470
2470
|
ge.displayName = "Card.Footer";
|
|
2471
2471
|
const Nt = ({ children: t, className: a, ...r }) => /* @__PURE__ */ e("div", { className: `clarity-card ${a || ""}`, ...r, children: t });
|
|
2472
2472
|
Nt.Header = he;
|
|
2473
|
-
Nt.Content =
|
|
2473
|
+
Nt.Content = be;
|
|
2474
2474
|
Nt.Footer = ge;
|
|
2475
2475
|
Nt.displayName = "Card";
|
|
2476
|
-
const
|
|
2476
|
+
const da = {
|
|
2477
2477
|
primary: {
|
|
2478
2478
|
50: "#f0f9ff",
|
|
2479
2479
|
100: "#e0f2fe",
|
|
@@ -2522,7 +2522,7 @@ const ca = {
|
|
|
2522
2522
|
800: "#065f46",
|
|
2523
2523
|
900: "#064e3b"
|
|
2524
2524
|
}
|
|
2525
|
-
},
|
|
2525
|
+
}, ma = {
|
|
2526
2526
|
xs: "4px",
|
|
2527
2527
|
sm: "8px",
|
|
2528
2528
|
md: "16px",
|
|
@@ -2530,38 +2530,38 @@ const ca = {
|
|
|
2530
2530
|
xl: "32px",
|
|
2531
2531
|
"2xl": "48px",
|
|
2532
2532
|
"3xl": "64px"
|
|
2533
|
-
},
|
|
2533
|
+
}, ua = (...t) => t.filter(Boolean).join(" "), fa = () => Math.random().toString(36).substr(2, 9);
|
|
2534
2534
|
export {
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2535
|
+
ia as Accordion,
|
|
2536
|
+
ta as Badge,
|
|
2537
|
+
xe as Box,
|
|
2538
|
+
ke as Button,
|
|
2539
|
+
ea as ButtonGroup,
|
|
2540
|
+
la as ButtonIcon,
|
|
2541
|
+
na as ButtonLink,
|
|
2542
2542
|
Nt as Card,
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2543
|
+
We as CheckInput,
|
|
2544
|
+
Je as Col,
|
|
2545
|
+
sa as Command,
|
|
2546
2546
|
ut as ConfirmationDialog,
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2547
|
+
vt as Dropdown,
|
|
2548
|
+
Se as Input,
|
|
2549
|
+
Ie as InputSwitch,
|
|
2550
2550
|
mt as Modal,
|
|
2551
|
-
|
|
2551
|
+
Re as MultiSelect,
|
|
2552
2552
|
ht as Offcanvas,
|
|
2553
|
-
|
|
2553
|
+
Ye as Row,
|
|
2554
2554
|
Le as Select,
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2555
|
+
ca as Spinner,
|
|
2556
|
+
oa as Table,
|
|
2557
|
+
ne as Tabs,
|
|
2558
|
+
Ee as Textarea,
|
|
2559
|
+
ra as ToastProvider,
|
|
2560
|
+
yt as Tooltip,
|
|
2561
|
+
ua as cn,
|
|
2562
|
+
da as colors,
|
|
2563
|
+
fa as generateId,
|
|
2564
|
+
ma as spacing,
|
|
2565
2565
|
Bt as typography,
|
|
2566
|
-
|
|
2566
|
+
aa as useToast
|
|
2567
2567
|
};
|