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