beth-clarity 1.2.4 → 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 +1109 -1114
- package/dist/clarity-design-system.umd.js +2 -2
- package/dist/components/CheckInput/CheckInput.d.ts +0 -2
- package/dist/components/CheckInput/CheckInput.d.ts.map +1 -1
- package/dist/components/InputSwitch/InputSwitch.d.ts +0 -2
- package/dist/components/InputSwitch/InputSwitch.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts +0 -2
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +0 -2
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts +0 -2
- 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
|
|
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 ta = ({
|
|
|
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"]
|
|
@@ -59,7 +59,7 @@ const ta = ({
|
|
|
59
59
|
wide: "0.025em",
|
|
60
60
|
wider: "0.05em"
|
|
61
61
|
}
|
|
62
|
-
},
|
|
62
|
+
}, Ct = (t) => {
|
|
63
63
|
if (t) {
|
|
64
64
|
if (t.startsWith("#") || t.startsWith("rgb") || t.startsWith("hsl") || t === "transparent")
|
|
65
65
|
return t;
|
|
@@ -69,7 +69,7 @@ const ta = ({
|
|
|
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,81 +80,81 @@ const ta = ({
|
|
|
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:
|
|
92
|
-
pr:
|
|
91
|
+
pt: b,
|
|
92
|
+
pr: _,
|
|
93
93
|
pb: x,
|
|
94
|
-
pl:
|
|
95
|
-
px:
|
|
96
|
-
py:
|
|
97
|
-
bg:
|
|
98
|
-
color:
|
|
99
|
-
fontSize:
|
|
100
|
-
fontWeight:
|
|
101
|
-
textAlign:
|
|
102
|
-
lineHeight:
|
|
103
|
-
letterSpacing:
|
|
104
|
-
borderRadius:
|
|
105
|
-
borderTopLeftRadius:
|
|
106
|
-
borderTopRightRadius:
|
|
107
|
-
borderBottomLeftRadius:
|
|
108
|
-
borderBottomRightRadius:
|
|
109
|
-
boxShadow:
|
|
110
|
-
borderWidth:
|
|
111
|
-
borderTopWidth:
|
|
112
|
-
borderRightWidth:
|
|
113
|
-
borderBottomWidth:
|
|
114
|
-
borderLeftWidth:
|
|
115
|
-
borderXWidth:
|
|
116
|
-
borderYWidth:
|
|
117
|
-
borderColor:
|
|
118
|
-
overflow:
|
|
119
|
-
...
|
|
120
|
-
} = t,
|
|
121
|
-
if (
|
|
122
|
-
const
|
|
123
|
-
return `${
|
|
124
|
-
},
|
|
94
|
+
pl: E,
|
|
95
|
+
px: C,
|
|
96
|
+
py: T,
|
|
97
|
+
bg: L,
|
|
98
|
+
color: $,
|
|
99
|
+
fontSize: k,
|
|
100
|
+
fontWeight: z,
|
|
101
|
+
textAlign: H,
|
|
102
|
+
lineHeight: R,
|
|
103
|
+
letterSpacing: V,
|
|
104
|
+
borderRadius: M,
|
|
105
|
+
borderTopLeftRadius: F,
|
|
106
|
+
borderTopRightRadius: j,
|
|
107
|
+
borderBottomLeftRadius: U,
|
|
108
|
+
borderBottomRightRadius: S,
|
|
109
|
+
boxShadow: K,
|
|
110
|
+
borderWidth: P,
|
|
111
|
+
borderTopWidth: Z,
|
|
112
|
+
borderRightWidth: q,
|
|
113
|
+
borderBottomWidth: tt,
|
|
114
|
+
borderLeftWidth: W,
|
|
115
|
+
borderXWidth: X,
|
|
116
|
+
borderYWidth: D,
|
|
117
|
+
borderColor: Y,
|
|
118
|
+
overflow: lt,
|
|
119
|
+
...g
|
|
120
|
+
} = t, O = (G, Q) => {
|
|
121
|
+
if (G === void 0 || G === 0) return;
|
|
122
|
+
const at = `var(--clarity-border-width-${G})`, it = Q ? Ct(Q) : "currentColor";
|
|
123
|
+
return `${at} solid ${it}`;
|
|
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(
|
|
136
|
-
paddingRight: nt(
|
|
137
|
-
paddingBottom: nt(x ??
|
|
138
|
-
paddingLeft: nt(
|
|
139
|
-
backgroundColor:
|
|
140
|
-
color:
|
|
141
|
-
fontSize:
|
|
142
|
-
fontWeight:
|
|
143
|
-
textAlign:
|
|
144
|
-
lineHeight:
|
|
145
|
-
letterSpacing:
|
|
146
|
-
borderRadius:
|
|
147
|
-
borderTopLeftRadius:
|
|
148
|
-
borderTopRightRadius:
|
|
149
|
-
borderBottomLeftRadius:
|
|
150
|
-
borderBottomRightRadius:
|
|
151
|
-
boxShadow:
|
|
152
|
-
border:
|
|
153
|
-
borderTop:
|
|
154
|
-
borderRight:
|
|
155
|
-
borderBottom:
|
|
156
|
-
borderLeft:
|
|
157
|
-
overflow:
|
|
131
|
+
marginTop: nt(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
|
+
paddingRight: nt(_ ?? C ?? m),
|
|
137
|
+
paddingBottom: nt(x ?? T ?? m),
|
|
138
|
+
paddingLeft: nt(E ?? C ?? m),
|
|
139
|
+
backgroundColor: L ? Ct(L) : void 0,
|
|
140
|
+
color: $ ? Ct($) : void 0,
|
|
141
|
+
fontSize: k ? `var(--clarity-font-size-${k})` : void 0,
|
|
142
|
+
fontWeight: z ? Tt.fontWeight[z] : void 0,
|
|
143
|
+
textAlign: H,
|
|
144
|
+
lineHeight: R,
|
|
145
|
+
letterSpacing: V ? Tt.letterSpacing[V] : void 0,
|
|
146
|
+
borderRadius: M ? `var(--clarity-radius-${M})` : void 0,
|
|
147
|
+
borderTopLeftRadius: F ? `var(--clarity-radius-${F})` : void 0,
|
|
148
|
+
borderTopRightRadius: j ? `var(--clarity-radius-${j})` : void 0,
|
|
149
|
+
borderBottomLeftRadius: U ? `var(--clarity-radius-${U})` : void 0,
|
|
150
|
+
borderBottomRightRadius: S ? `var(--clarity-radius-${S})` : void 0,
|
|
151
|
+
boxShadow: K ? `var(--clarity-shadow-${K})` : void 0,
|
|
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
|
+
overflow: lt
|
|
158
158
|
}), [
|
|
159
159
|
n,
|
|
160
160
|
o,
|
|
@@ -162,48 +162,48 @@ const ta = ({
|
|
|
162
162
|
c,
|
|
163
163
|
d,
|
|
164
164
|
i,
|
|
165
|
-
u,
|
|
166
|
-
y,
|
|
167
|
-
p,
|
|
168
165
|
f,
|
|
169
|
-
|
|
170
|
-
|
|
166
|
+
p,
|
|
167
|
+
y,
|
|
168
|
+
u,
|
|
169
|
+
h,
|
|
170
|
+
w,
|
|
171
171
|
N,
|
|
172
172
|
m,
|
|
173
|
-
|
|
174
|
-
C,
|
|
175
|
-
x,
|
|
176
|
-
B,
|
|
177
|
-
k,
|
|
178
|
-
j,
|
|
179
|
-
$,
|
|
180
|
-
S,
|
|
173
|
+
b,
|
|
181
174
|
_,
|
|
182
|
-
|
|
183
|
-
I,
|
|
175
|
+
x,
|
|
184
176
|
E,
|
|
185
|
-
|
|
177
|
+
C,
|
|
178
|
+
T,
|
|
186
179
|
L,
|
|
187
|
-
|
|
180
|
+
$,
|
|
181
|
+
k,
|
|
182
|
+
z,
|
|
188
183
|
H,
|
|
189
|
-
|
|
184
|
+
R,
|
|
190
185
|
V,
|
|
186
|
+
M,
|
|
191
187
|
F,
|
|
192
|
-
|
|
188
|
+
j,
|
|
189
|
+
U,
|
|
190
|
+
S,
|
|
193
191
|
K,
|
|
194
|
-
Y,
|
|
195
192
|
P,
|
|
196
|
-
R,
|
|
197
193
|
Z,
|
|
198
194
|
q,
|
|
199
|
-
|
|
200
|
-
|
|
195
|
+
tt,
|
|
196
|
+
W,
|
|
197
|
+
X,
|
|
198
|
+
D,
|
|
199
|
+
Y,
|
|
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,34 +214,34 @@ const ke = ({
|
|
|
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
|
}
|
|
243
243
|
);
|
|
244
|
-
},
|
|
244
|
+
}, ta = ({
|
|
245
245
|
variant: t = "primary",
|
|
246
246
|
size: a = "medium",
|
|
247
247
|
items: r,
|
|
@@ -252,59 +252,59 @@ const ke = ({
|
|
|
252
252
|
className: c = "",
|
|
253
253
|
...d
|
|
254
254
|
}) => {
|
|
255
|
-
const i = "clarity-button-group",
|
|
255
|
+
const i = "clarity-button-group", f = [
|
|
256
256
|
i,
|
|
257
257
|
c
|
|
258
|
-
].filter(Boolean).join(" "),
|
|
258
|
+
].filter(Boolean).join(" "), p = (u) => {
|
|
259
259
|
if (o || !s) return;
|
|
260
|
-
const
|
|
261
|
-
if (!(
|
|
260
|
+
const h = r.find((w) => w.id === u);
|
|
261
|
+
if (!(h != null && h.disabled))
|
|
262
262
|
if (n) {
|
|
263
|
-
const
|
|
263
|
+
const w = Array.isArray(l) ? l : [], N = w.includes(u) ? w.filter((m) => m !== u) : [...w, u];
|
|
264
264
|
s(N);
|
|
265
265
|
} else
|
|
266
|
-
s(
|
|
267
|
-
},
|
|
266
|
+
s(u);
|
|
267
|
+
}, y = (u) => n ? Array.isArray(l) && l.includes(u) : l === u;
|
|
268
268
|
return /* @__PURE__ */ e(
|
|
269
269
|
"div",
|
|
270
270
|
{
|
|
271
|
-
className:
|
|
271
|
+
className: f,
|
|
272
272
|
role: "group",
|
|
273
273
|
...d,
|
|
274
|
-
children: r.map((
|
|
275
|
-
const
|
|
274
|
+
children: r.map((u, h) => {
|
|
275
|
+
const w = y(u.id), N = w ? t : `${t}-outline`, m = [
|
|
276
276
|
`${i}__item`,
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
277
|
+
w && `${i}__item--selected`,
|
|
278
|
+
h === 0 && `${i}__item--first`,
|
|
279
|
+
h === r.length - 1 && `${i}__item--last`
|
|
280
280
|
].filter(Boolean).join(" ");
|
|
281
|
-
return /* @__PURE__ */
|
|
282
|
-
|
|
281
|
+
return /* @__PURE__ */ v(
|
|
282
|
+
xe,
|
|
283
283
|
{
|
|
284
284
|
variant: N,
|
|
285
285
|
size: a,
|
|
286
286
|
className: m,
|
|
287
|
-
onClick: () =>
|
|
288
|
-
disabled: o ||
|
|
289
|
-
"aria-pressed":
|
|
287
|
+
onClick: () => p(u.id),
|
|
288
|
+
disabled: o || u.disabled,
|
|
289
|
+
"aria-pressed": w,
|
|
290
290
|
children: [
|
|
291
|
-
|
|
292
|
-
/* @__PURE__ */ e("span", { className: `${i}__item-label`, children:
|
|
291
|
+
u.icon && /* @__PURE__ */ e("span", { className: `${i}__item-icon`, children: u.icon }),
|
|
292
|
+
/* @__PURE__ */ e("span", { className: `${i}__item-label`, children: u.label })
|
|
293
293
|
]
|
|
294
294
|
},
|
|
295
|
-
|
|
295
|
+
u.id
|
|
296
296
|
);
|
|
297
297
|
})
|
|
298
298
|
}
|
|
299
299
|
);
|
|
300
300
|
};
|
|
301
|
-
var
|
|
301
|
+
var Et = {
|
|
302
302
|
color: void 0,
|
|
303
303
|
size: void 0,
|
|
304
304
|
className: void 0,
|
|
305
305
|
style: void 0,
|
|
306
306
|
attr: void 0
|
|
307
|
-
},
|
|
307
|
+
}, Bt = I.createContext && I.createContext(Et), st = function() {
|
|
308
308
|
return st = Object.assign || function(t) {
|
|
309
309
|
for (var a, r = 1, l = arguments.length; r < l; r++) {
|
|
310
310
|
a = arguments[r];
|
|
@@ -312,31 +312,31 @@ var Lt = {
|
|
|
312
312
|
}
|
|
313
313
|
return t;
|
|
314
314
|
}, st.apply(this, arguments);
|
|
315
|
-
},
|
|
315
|
+
}, ke = function(t, a) {
|
|
316
316
|
var r = {};
|
|
317
317
|
for (var l in t) Object.prototype.hasOwnProperty.call(t, l) && a.indexOf(l) < 0 && (r[l] = t[l]);
|
|
318
318
|
if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var n = 0, l = Object.getOwnPropertySymbols(t); n < l.length; n++)
|
|
319
319
|
a.indexOf(l[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, l[n]) && (r[l[n]] = t[l[n]]);
|
|
320
320
|
return r;
|
|
321
321
|
};
|
|
322
|
-
function
|
|
322
|
+
function Lt(t) {
|
|
323
323
|
return t && t.map(function(a, r) {
|
|
324
|
-
return
|
|
324
|
+
return I.createElement(a.tag, st({
|
|
325
325
|
key: r
|
|
326
|
-
}, a.attr),
|
|
326
|
+
}, a.attr), Lt(a.child));
|
|
327
327
|
});
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function Te(t) {
|
|
330
330
|
return function(a) {
|
|
331
|
-
return
|
|
331
|
+
return I.createElement(Be, st({
|
|
332
332
|
attr: st({}, t.attr)
|
|
333
|
-
}, a),
|
|
333
|
+
}, a), Lt(t.child));
|
|
334
334
|
};
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function Be(t) {
|
|
337
337
|
var a = function(r) {
|
|
338
|
-
var l = t.attr, n = t.size, o = t.title, s =
|
|
339
|
-
return r.className && (d = r.className), t.className && (d = (d ? d + " " : "") + t.className),
|
|
338
|
+
var l = t.attr, n = t.size, o = t.title, s = ke(t, ["attr", "size", "title"]), c = n || r.size || "1em", d;
|
|
339
|
+
return r.className && (d = r.className), t.className && (d = (d ? d + " " : "") + t.className), I.createElement("svg", st({
|
|
340
340
|
stroke: "currentColor",
|
|
341
341
|
fill: "currentColor",
|
|
342
342
|
strokeWidth: "0"
|
|
@@ -348,14 +348,14 @@ function je(t) {
|
|
|
348
348
|
height: c,
|
|
349
349
|
width: c,
|
|
350
350
|
xmlns: "http://www.w3.org/2000/svg"
|
|
351
|
-
}), o &&
|
|
351
|
+
}), o && I.createElement("title", null, o), t.children);
|
|
352
352
|
};
|
|
353
|
-
return
|
|
353
|
+
return Bt !== void 0 ? I.createElement(Bt.Consumer, null, function(r) {
|
|
354
354
|
return a(r);
|
|
355
|
-
}) : a(
|
|
355
|
+
}) : a(Et);
|
|
356
356
|
}
|
|
357
357
|
function pt(t) {
|
|
358
|
-
return
|
|
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);
|
|
359
359
|
}
|
|
360
360
|
const yt = ({
|
|
361
361
|
content: t,
|
|
@@ -368,29 +368,29 @@ const yt = ({
|
|
|
368
368
|
className: c = "",
|
|
369
369
|
disabled: d = !1,
|
|
370
370
|
delay: i = 200,
|
|
371
|
-
hideDelay:
|
|
372
|
-
trigger:
|
|
373
|
-
arrow:
|
|
374
|
-
...
|
|
371
|
+
hideDelay: f = 100,
|
|
372
|
+
trigger: p = "hover",
|
|
373
|
+
arrow: y = !0,
|
|
374
|
+
...u
|
|
375
375
|
}) => {
|
|
376
|
-
const [
|
|
377
|
-
let
|
|
378
|
-
|
|
379
|
-
const
|
|
380
|
-
|
|
381
|
-
`${
|
|
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}`;
|
|
379
|
+
const H = [
|
|
380
|
+
L,
|
|
381
|
+
`${L}--${N}`,
|
|
382
382
|
c
|
|
383
|
-
].filter(Boolean).join(" "),
|
|
384
|
-
`${
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
].filter(Boolean).join(" "),
|
|
388
|
-
|
|
389
|
-
const
|
|
390
|
-
...
|
|
391
|
-
...Object.keys(
|
|
392
|
-
top:
|
|
393
|
-
left:
|
|
383
|
+
].filter(Boolean).join(" "), R = [
|
|
384
|
+
`${L}__content`,
|
|
385
|
+
z,
|
|
386
|
+
y && `${L}__content--arrow`
|
|
387
|
+
].filter(Boolean).join(" "), V = {}, M = {};
|
|
388
|
+
k && (M["--tooltip-bg-color"] = l || "#FFFFFF"), (n || o) && (M["--tooltip-text-color"] = n || "var(--clarity-gray-900)");
|
|
389
|
+
const F = {
|
|
390
|
+
...V,
|
|
391
|
+
...Object.keys(M).length > 0 ? M : {},
|
|
392
|
+
top: b.top,
|
|
393
|
+
left: b.left,
|
|
394
394
|
// Resetar estilos que vêm do CSS para posicionamento relativo
|
|
395
395
|
position: "absolute",
|
|
396
396
|
bottom: "auto",
|
|
@@ -399,72 +399,72 @@ const yt = ({
|
|
|
399
399
|
transform: "none",
|
|
400
400
|
zIndex: 99999
|
|
401
401
|
// Garantir que fique acima de modais (geralmente 1000-2000)
|
|
402
|
-
},
|
|
402
|
+
}, j = () => {
|
|
403
403
|
if (d) return;
|
|
404
404
|
x && clearTimeout(x);
|
|
405
|
-
const
|
|
406
|
-
|
|
405
|
+
const W = setTimeout(() => {
|
|
406
|
+
w(!0);
|
|
407
407
|
}, i);
|
|
408
|
-
|
|
409
|
-
},
|
|
408
|
+
E(W);
|
|
409
|
+
}, U = () => {
|
|
410
410
|
x && clearTimeout(x);
|
|
411
|
-
const
|
|
412
|
-
|
|
413
|
-
},
|
|
414
|
-
|
|
415
|
-
},
|
|
416
|
-
d || (
|
|
417
|
-
},
|
|
418
|
-
d ||
|
|
419
|
-
},
|
|
420
|
-
|
|
411
|
+
const W = setTimeout(() => {
|
|
412
|
+
w(!1);
|
|
413
|
+
}, f);
|
|
414
|
+
E(W);
|
|
415
|
+
}, S = () => {
|
|
416
|
+
d || (h ? U() : j());
|
|
417
|
+
}, K = () => {
|
|
418
|
+
d || j();
|
|
419
|
+
}, P = () => {
|
|
420
|
+
U();
|
|
421
421
|
};
|
|
422
|
-
|
|
422
|
+
J(() => () => {
|
|
423
423
|
x && clearTimeout(x);
|
|
424
424
|
}, [x]);
|
|
425
|
-
const
|
|
426
|
-
if (!
|
|
427
|
-
const
|
|
425
|
+
const Z = () => {
|
|
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 = {
|
|
428
428
|
top: {
|
|
429
|
-
top:
|
|
430
|
-
left:
|
|
429
|
+
top: W.top + Y - X.height - $,
|
|
430
|
+
left: W.left + D + (W.width - X.width) / 2
|
|
431
431
|
},
|
|
432
432
|
bottom: {
|
|
433
|
-
top:
|
|
434
|
-
left:
|
|
433
|
+
top: W.bottom + Y + $,
|
|
434
|
+
left: W.left + D + (W.width - X.width) / 2
|
|
435
435
|
},
|
|
436
436
|
left: {
|
|
437
|
-
top:
|
|
438
|
-
left:
|
|
437
|
+
top: W.top + Y + (W.height - X.height) / 2,
|
|
438
|
+
left: W.left + D - X.width - $
|
|
439
439
|
},
|
|
440
440
|
right: {
|
|
441
|
-
top:
|
|
442
|
-
left:
|
|
441
|
+
top: W.top + Y + (W.height - X.height) / 2,
|
|
442
|
+
left: W.right + D + $
|
|
443
443
|
},
|
|
444
444
|
"top-left": {
|
|
445
|
-
top:
|
|
446
|
-
left:
|
|
445
|
+
top: W.top + Y - X.height - $,
|
|
446
|
+
left: W.left + D
|
|
447
447
|
},
|
|
448
448
|
"top-right": {
|
|
449
|
-
top:
|
|
450
|
-
left:
|
|
449
|
+
top: W.top + Y - X.height - $,
|
|
450
|
+
left: W.right + D - X.width
|
|
451
451
|
},
|
|
452
452
|
"bottom-left": {
|
|
453
|
-
top:
|
|
454
|
-
left:
|
|
453
|
+
top: W.bottom + Y + $,
|
|
454
|
+
left: W.left + D
|
|
455
455
|
},
|
|
456
456
|
"bottom-right": {
|
|
457
|
-
top:
|
|
458
|
-
left:
|
|
457
|
+
top: W.bottom + Y + $,
|
|
458
|
+
left: W.right + D - X.width
|
|
459
459
|
}
|
|
460
460
|
};
|
|
461
|
-
let
|
|
462
|
-
const
|
|
463
|
-
const
|
|
464
|
-
return it >= 0 && it +
|
|
461
|
+
let B = a;
|
|
462
|
+
const G = (Q) => {
|
|
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;
|
|
465
465
|
};
|
|
466
|
-
if (!
|
|
467
|
-
const
|
|
466
|
+
if (!G(B)) {
|
|
467
|
+
const at = {
|
|
468
468
|
top: "bottom",
|
|
469
469
|
bottom: "top",
|
|
470
470
|
left: "right",
|
|
@@ -473,53 +473,53 @@ const yt = ({
|
|
|
473
473
|
"top-right": "bottom-right",
|
|
474
474
|
"bottom-left": "top-left",
|
|
475
475
|
"bottom-right": "top-right"
|
|
476
|
-
}[
|
|
477
|
-
|
|
476
|
+
}[B];
|
|
477
|
+
at && G(at) && (B = at);
|
|
478
478
|
}
|
|
479
|
-
if (m(
|
|
480
|
-
const
|
|
481
|
-
|
|
479
|
+
if (m(B), _(O[B]), C.current) {
|
|
480
|
+
const Q = Math.round(W.width / 2);
|
|
481
|
+
C.current.style.setProperty("--tooltip-arrow-offset", `${Q}px`);
|
|
482
482
|
}
|
|
483
483
|
};
|
|
484
|
-
|
|
485
|
-
if (
|
|
486
|
-
return
|
|
487
|
-
window.removeEventListener("scroll",
|
|
484
|
+
St(() => {
|
|
485
|
+
if (h)
|
|
486
|
+
return Z(), window.addEventListener("scroll", Z, !0), window.addEventListener("resize", Z), () => {
|
|
487
|
+
window.removeEventListener("scroll", Z, !0), window.removeEventListener("resize", Z);
|
|
488
488
|
};
|
|
489
|
-
}, [
|
|
490
|
-
const
|
|
491
|
-
let
|
|
489
|
+
}, [h, a, t]);
|
|
490
|
+
const q = {};
|
|
491
|
+
let tt = p;
|
|
492
492
|
if (typeof window < "u") {
|
|
493
|
-
const
|
|
494
|
-
|
|
493
|
+
const W = "ontouchstart" in window || navigator.maxTouchPoints > 0 || window.matchMedia && window.matchMedia("(pointer: coarse)").matches;
|
|
494
|
+
p === "hover" && W && (tt = "focus");
|
|
495
495
|
}
|
|
496
|
-
return
|
|
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: [
|
|
497
497
|
/* @__PURE__ */ e(
|
|
498
498
|
"div",
|
|
499
499
|
{
|
|
500
|
-
ref:
|
|
501
|
-
className: `${
|
|
502
|
-
...
|
|
503
|
-
...
|
|
500
|
+
ref: T,
|
|
501
|
+
className: `${L}__trigger`,
|
|
502
|
+
...q,
|
|
503
|
+
...u,
|
|
504
504
|
children: s
|
|
505
505
|
}
|
|
506
506
|
),
|
|
507
|
-
|
|
507
|
+
h && Ce(
|
|
508
508
|
/* @__PURE__ */ e(
|
|
509
509
|
"div",
|
|
510
510
|
{
|
|
511
|
-
ref:
|
|
512
|
-
className:
|
|
513
|
-
style:
|
|
511
|
+
ref: C,
|
|
512
|
+
className: H,
|
|
513
|
+
style: F,
|
|
514
514
|
role: "tooltip",
|
|
515
|
-
"aria-hidden": !
|
|
516
|
-
children: /* @__PURE__ */ e("div", { className:
|
|
515
|
+
"aria-hidden": !h,
|
|
516
|
+
children: /* @__PURE__ */ e("div", { className: R, children: t })
|
|
517
517
|
}
|
|
518
518
|
),
|
|
519
519
|
document.body
|
|
520
520
|
)
|
|
521
521
|
] });
|
|
522
|
-
},
|
|
522
|
+
}, je = I.forwardRef(({
|
|
523
523
|
variant: t = "primary",
|
|
524
524
|
size: a = "medium",
|
|
525
525
|
label: r,
|
|
@@ -530,338 +530,336 @@ const yt = ({
|
|
|
530
530
|
endIcon: c,
|
|
531
531
|
helper: d = !1,
|
|
532
532
|
helperPosition: i = "top-right",
|
|
533
|
-
className:
|
|
534
|
-
disabled:
|
|
535
|
-
value:
|
|
536
|
-
defaultValue:
|
|
537
|
-
onFocus:
|
|
538
|
-
onBlur:
|
|
533
|
+
className: f = "",
|
|
534
|
+
disabled: p = !1,
|
|
535
|
+
value: y,
|
|
536
|
+
defaultValue: u,
|
|
537
|
+
onFocus: h,
|
|
538
|
+
onBlur: w,
|
|
539
539
|
...N
|
|
540
540
|
}, m) => {
|
|
541
|
-
const [
|
|
542
|
-
|
|
543
|
-
const
|
|
544
|
-
|
|
545
|
-
}, [
|
|
546
|
-
const
|
|
547
|
-
if (!
|
|
548
|
-
const
|
|
549
|
-
const
|
|
550
|
-
|
|
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);
|
|
542
|
+
I.useImperativeHandle(m, () => C.current), J(() => {
|
|
543
|
+
const j = C.current;
|
|
544
|
+
j && E(j.value.length > 0);
|
|
545
|
+
}, [y, u]), J(() => {
|
|
546
|
+
const j = L.current;
|
|
547
|
+
if (!j) return;
|
|
548
|
+
const U = () => {
|
|
549
|
+
const K = j.scrollWidth > j.clientWidth;
|
|
550
|
+
k((P) => P !== K ? K : P);
|
|
551
551
|
};
|
|
552
|
-
|
|
553
|
-
const
|
|
554
|
-
return
|
|
555
|
-
}, [r,
|
|
556
|
-
const
|
|
557
|
-
|
|
558
|
-
},
|
|
559
|
-
|
|
560
|
-
},
|
|
552
|
+
U();
|
|
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);
|
|
558
|
+
}, H = (j) => {
|
|
559
|
+
_(!1), E(j.target.value.length > 0), w == null || w(j);
|
|
560
|
+
}, R = [
|
|
561
561
|
"clarity-input",
|
|
562
562
|
"clarity-input--outlined",
|
|
563
563
|
`clarity-input--${a}`,
|
|
564
564
|
t && `clarity-input--${t}`,
|
|
565
565
|
n && "clarity-input--error",
|
|
566
|
-
|
|
567
|
-
|
|
566
|
+
p && "clarity-input--disabled",
|
|
567
|
+
b && "clarity-input--focused",
|
|
568
568
|
x && "clarity-input--has-value",
|
|
569
569
|
s && "clarity-input--with-start-icon",
|
|
570
570
|
c && "clarity-input--with-end-icon",
|
|
571
|
-
|
|
572
|
-
].filter(Boolean).join(" "),
|
|
571
|
+
f
|
|
572
|
+
].filter(Boolean).join(" "), V = [
|
|
573
573
|
"clarity-input__label",
|
|
574
|
-
|
|
575
|
-
].filter(Boolean).join(" "),
|
|
574
|
+
$ && "clarity-input__label--truncate"
|
|
575
|
+
].filter(Boolean).join(" "), M = i != null && i.endsWith("left") ? "left" : "right", F = (j, U) => {
|
|
576
576
|
if (!d) return null;
|
|
577
|
-
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;
|
|
578
578
|
return /* @__PURE__ */ e(
|
|
579
579
|
yt,
|
|
580
580
|
{
|
|
581
|
-
content:
|
|
582
|
-
position:
|
|
581
|
+
content: K,
|
|
582
|
+
position: j === "middle" ? U === "left" ? "left" : "right" : j === "top" ? U === "left" ? "top-left" : "top-right" : U === "left" ? "bottom-left" : "bottom-right",
|
|
583
583
|
trigger: "hover",
|
|
584
|
-
variant:
|
|
585
|
-
plain:
|
|
586
|
-
bgColor:
|
|
587
|
-
textColor:
|
|
588
|
-
children: /* @__PURE__ */ e("button", { type: "button", className: "clarity-input__helper-icon", "aria-label": "Helper", children: /* @__PURE__ */ e(pt, { size:
|
|
584
|
+
variant: Z || t,
|
|
585
|
+
plain: P,
|
|
586
|
+
bgColor: q,
|
|
587
|
+
textColor: tt,
|
|
588
|
+
children: /* @__PURE__ */ e("button", { type: "button", className: "clarity-input__helper-icon", "aria-label": "Helper", children: /* @__PURE__ */ e(pt, { size: j === "middle" ? 20 : 16 }) })
|
|
589
589
|
}
|
|
590
590
|
);
|
|
591
591
|
};
|
|
592
|
-
return /* @__PURE__ */
|
|
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--${
|
|
594
|
-
d && (i != null && i.startsWith("middle")) ? /* @__PURE__ */
|
|
595
|
-
|
|
596
|
-
/* @__PURE__ */
|
|
592
|
+
return /* @__PURE__ */ v("div", { className: "clarity-input-wrapper", children: [
|
|
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) }),
|
|
594
|
+
d && (i != null && i.startsWith("middle")) ? /* @__PURE__ */ v("div", { className: `clarity-input__middle-row clarity-input__middle-row--${M}`, children: [
|
|
595
|
+
M === "left" && F("middle", M),
|
|
596
|
+
/* @__PURE__ */ v("div", { className: R, children: [
|
|
597
597
|
s && /* @__PURE__ */ e("div", { className: "clarity-input__start-icon", children: s }),
|
|
598
|
-
/* @__PURE__ */
|
|
598
|
+
/* @__PURE__ */ v("div", { className: "clarity-input__field", children: [
|
|
599
599
|
/* @__PURE__ */ e(
|
|
600
600
|
"input",
|
|
601
601
|
{
|
|
602
|
-
ref:
|
|
603
|
-
id:
|
|
602
|
+
ref: C,
|
|
603
|
+
id: T,
|
|
604
604
|
className: "clarity-input__element",
|
|
605
|
-
disabled:
|
|
606
|
-
value:
|
|
607
|
-
defaultValue:
|
|
608
|
-
onFocus:
|
|
609
|
-
onBlur:
|
|
605
|
+
disabled: p,
|
|
606
|
+
value: y,
|
|
607
|
+
defaultValue: u,
|
|
608
|
+
onFocus: z,
|
|
609
|
+
onBlur: H,
|
|
610
610
|
"aria-label": l,
|
|
611
611
|
...N
|
|
612
612
|
}
|
|
613
613
|
),
|
|
614
|
-
r && /* @__PURE__ */ e("label", { ref:
|
|
614
|
+
r && /* @__PURE__ */ e("label", { ref: L, className: V, htmlFor: T, children: r })
|
|
615
615
|
] }),
|
|
616
616
|
c && /* @__PURE__ */ e("div", { className: "clarity-input__end-icon", children: c })
|
|
617
617
|
] }),
|
|
618
|
-
|
|
619
|
-
] }) : /* @__PURE__ */
|
|
618
|
+
M === "right" && F("middle", M)
|
|
619
|
+
] }) : /* @__PURE__ */ v("div", { className: R, children: [
|
|
620
620
|
s && /* @__PURE__ */ e("div", { className: "clarity-input__start-icon", children: s }),
|
|
621
|
-
/* @__PURE__ */
|
|
621
|
+
/* @__PURE__ */ v("div", { className: "clarity-input__field", children: [
|
|
622
622
|
/* @__PURE__ */ e(
|
|
623
623
|
"input",
|
|
624
624
|
{
|
|
625
|
-
ref:
|
|
626
|
-
id:
|
|
625
|
+
ref: C,
|
|
626
|
+
id: T,
|
|
627
627
|
className: "clarity-input__element",
|
|
628
|
-
disabled:
|
|
629
|
-
value:
|
|
630
|
-
defaultValue:
|
|
631
|
-
onFocus:
|
|
632
|
-
onBlur:
|
|
628
|
+
disabled: p,
|
|
629
|
+
value: y,
|
|
630
|
+
defaultValue: u,
|
|
631
|
+
onFocus: z,
|
|
632
|
+
onBlur: H,
|
|
633
633
|
"aria-label": l,
|
|
634
634
|
...N
|
|
635
635
|
}
|
|
636
636
|
),
|
|
637
|
-
r && /* @__PURE__ */ e("label", { ref:
|
|
637
|
+
r && /* @__PURE__ */ e("label", { ref: L, className: V, htmlFor: T, children: r })
|
|
638
638
|
] }),
|
|
639
639
|
c && /* @__PURE__ */ e("div", { className: "clarity-input__end-icon", children: c })
|
|
640
640
|
] }),
|
|
641
|
-
d && (i == null ? void 0 : i.startsWith("bottom")) && /* @__PURE__ */ e("div", { className: `clarity-input__helper-row clarity-input__helper-row--bottom clarity-input__helper-row--${
|
|
642
|
-
|
|
641
|
+
d && (i == null ? void 0 : i.startsWith("bottom")) && /* @__PURE__ */ e("div", { className: `clarity-input__helper-row clarity-input__helper-row--bottom clarity-input__helper-row--${M}`, children: F("bottom", M) }),
|
|
642
|
+
n && o && /* @__PURE__ */ e("div", { className: "clarity-input__helper-text", children: o })
|
|
643
643
|
] });
|
|
644
644
|
});
|
|
645
|
-
|
|
646
|
-
const
|
|
645
|
+
je.displayName = "Input";
|
|
646
|
+
const Se = I.forwardRef(({
|
|
647
647
|
variant: t = "primary",
|
|
648
648
|
size: a = "medium",
|
|
649
649
|
label: r,
|
|
650
650
|
helper: l = !1,
|
|
651
651
|
helperPosition: n = "middle-right",
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
disabled: y = !1,
|
|
652
|
+
error: o = !1,
|
|
653
|
+
errorMessage: s,
|
|
654
|
+
startIcon: c,
|
|
655
|
+
endIcon: d,
|
|
656
|
+
className: i = "",
|
|
657
|
+
disabled: f = !1,
|
|
659
658
|
value: p,
|
|
660
|
-
defaultValue:
|
|
661
|
-
onFocus:
|
|
662
|
-
onBlur:
|
|
663
|
-
rows:
|
|
664
|
-
minHeight:
|
|
665
|
-
maxHeight:
|
|
666
|
-
resizable:
|
|
667
|
-
...
|
|
668
|
-
},
|
|
669
|
-
const [
|
|
670
|
-
|
|
671
|
-
const
|
|
672
|
-
|
|
673
|
-
}, [p,
|
|
674
|
-
const
|
|
675
|
-
|
|
676
|
-
},
|
|
677
|
-
|
|
678
|
-
},
|
|
659
|
+
defaultValue: y,
|
|
660
|
+
onFocus: u,
|
|
661
|
+
onBlur: h,
|
|
662
|
+
rows: w = 3,
|
|
663
|
+
minHeight: N,
|
|
664
|
+
maxHeight: m,
|
|
665
|
+
resizable: b = !0,
|
|
666
|
+
..._
|
|
667
|
+
}, x) => {
|
|
668
|
+
const [E, C] = A(!1), [T, L] = A(!1), $ = et(null);
|
|
669
|
+
I.useImperativeHandle(x, () => $.current), J(() => {
|
|
670
|
+
const j = $.current;
|
|
671
|
+
j && L(j.value.length > 0);
|
|
672
|
+
}, [p, y]);
|
|
673
|
+
const k = (j) => {
|
|
674
|
+
C(!0), u == null || u(j);
|
|
675
|
+
}, z = (j) => {
|
|
676
|
+
C(!1), L(j.target.value.length > 0), h == null || h(j);
|
|
677
|
+
}, H = [
|
|
679
678
|
"clarity-textarea",
|
|
680
679
|
"clarity-textarea--outlined",
|
|
681
680
|
`clarity-textarea--${a}`,
|
|
682
681
|
t && `clarity-textarea--${t}`,
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
].filter(Boolean).join(" "),
|
|
691
|
-
resize:
|
|
692
|
-
minHeight:
|
|
693
|
-
maxHeight:
|
|
694
|
-
},
|
|
682
|
+
o && "clarity-textarea--error",
|
|
683
|
+
f && "clarity-textarea--disabled",
|
|
684
|
+
E && "clarity-textarea--focused",
|
|
685
|
+
T && "clarity-textarea--has-value",
|
|
686
|
+
c && "clarity-textarea--with-start-icon",
|
|
687
|
+
d && "clarity-textarea--with-end-icon",
|
|
688
|
+
i
|
|
689
|
+
].filter(Boolean).join(" "), R = {
|
|
690
|
+
resize: b ? "vertical" : "none",
|
|
691
|
+
minHeight: N ? `${N}px` : void 0,
|
|
692
|
+
maxHeight: m ? `${m}px` : void 0
|
|
693
|
+
}, V = n != null && n.endsWith("left") ? "left" : "right", M = (j, U) => {
|
|
695
694
|
if (!l) return null;
|
|
696
|
-
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;
|
|
697
696
|
return /* @__PURE__ */ e(
|
|
698
697
|
yt,
|
|
699
698
|
{
|
|
700
|
-
content:
|
|
701
|
-
position:
|
|
699
|
+
content: K,
|
|
700
|
+
position: j === "middle" ? U === "left" ? "left" : "right" : j === "top" ? U === "left" ? "top-left" : "top-right" : U === "left" ? "bottom-left" : "bottom-right",
|
|
702
701
|
trigger: "hover",
|
|
703
|
-
variant:
|
|
704
|
-
plain:
|
|
705
|
-
bgColor:
|
|
706
|
-
textColor:
|
|
707
|
-
children: /* @__PURE__ */ e("button", { type: "button", className: "clarity-textarea__helper-icon", "aria-label": "Helper", children: /* @__PURE__ */ e(pt, { size:
|
|
702
|
+
variant: Z || t,
|
|
703
|
+
plain: P,
|
|
704
|
+
bgColor: q,
|
|
705
|
+
textColor: tt,
|
|
706
|
+
children: /* @__PURE__ */ e("button", { type: "button", className: "clarity-textarea__helper-icon", "aria-label": "Helper", children: /* @__PURE__ */ e(pt, { size: j === "middle" ? 20 : 16 }) })
|
|
708
707
|
}
|
|
709
708
|
);
|
|
710
|
-
},
|
|
711
|
-
/* @__PURE__ */
|
|
712
|
-
|
|
713
|
-
/* @__PURE__ */
|
|
709
|
+
}, F = /* @__PURE__ */ v("div", { className: "clarity-textarea-wrapper", children: [
|
|
710
|
+
/* @__PURE__ */ v("div", { className: H, children: [
|
|
711
|
+
c && /* @__PURE__ */ e("div", { className: "clarity-textarea__start-icon", children: c }),
|
|
712
|
+
/* @__PURE__ */ v("div", { className: "clarity-textarea__field", children: [
|
|
714
713
|
/* @__PURE__ */ e(
|
|
715
714
|
"textarea",
|
|
716
715
|
{
|
|
717
|
-
ref:
|
|
716
|
+
ref: $,
|
|
718
717
|
className: "clarity-textarea__element",
|
|
719
|
-
disabled:
|
|
718
|
+
disabled: f,
|
|
720
719
|
value: p,
|
|
721
|
-
defaultValue:
|
|
722
|
-
onFocus:
|
|
723
|
-
onBlur:
|
|
724
|
-
rows:
|
|
725
|
-
style:
|
|
726
|
-
...
|
|
720
|
+
defaultValue: y,
|
|
721
|
+
onFocus: k,
|
|
722
|
+
onBlur: z,
|
|
723
|
+
rows: w,
|
|
724
|
+
style: R,
|
|
725
|
+
..._
|
|
727
726
|
}
|
|
728
727
|
),
|
|
729
728
|
r && /* @__PURE__ */ e("label", { className: "clarity-textarea__label", children: r })
|
|
730
729
|
] }),
|
|
731
|
-
|
|
730
|
+
d && /* @__PURE__ */ e("div", { className: "clarity-textarea__end-icon", children: d })
|
|
732
731
|
] }),
|
|
733
|
-
|
|
732
|
+
o && s && /* @__PURE__ */ e("div", { className: "clarity-textarea__helper-text", children: s })
|
|
734
733
|
] });
|
|
735
|
-
return /* @__PURE__ */
|
|
736
|
-
l && (n == null ? void 0 : n.startsWith("top")) && /* @__PURE__ */ e("div", { className: `clarity-textarea__helper-row clarity-textarea__helper-row--top clarity-textarea__helper-row--${
|
|
737
|
-
l && (n != null && n.startsWith("middle")) ? /* @__PURE__ */
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
] }) :
|
|
742
|
-
l && (n == null ? void 0 : n.startsWith("bottom")) && /* @__PURE__ */ e("div", { className: `clarity-textarea__helper-row clarity-textarea__helper-row--bottom clarity-textarea__helper-row--${
|
|
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),
|
|
738
|
+
F,
|
|
739
|
+
V === "right" && M("middle", V)
|
|
740
|
+
] }) : F,
|
|
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) })
|
|
743
742
|
] });
|
|
744
743
|
});
|
|
745
|
-
|
|
746
|
-
const
|
|
744
|
+
Se.displayName = "Textarea";
|
|
745
|
+
const Ee = I.forwardRef(({
|
|
747
746
|
variant: t = "primary",
|
|
748
747
|
size: a = "medium",
|
|
749
748
|
label: r,
|
|
750
749
|
helper: l = !1,
|
|
751
750
|
helperPosition: n = "top-right",
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
disabled: y = !1,
|
|
751
|
+
error: o = !1,
|
|
752
|
+
errorMessage: s,
|
|
753
|
+
startIcon: c,
|
|
754
|
+
endIcon: d,
|
|
755
|
+
className: i = "",
|
|
756
|
+
disabled: f = !1,
|
|
759
757
|
value: p,
|
|
760
|
-
defaultValue:
|
|
761
|
-
onFocus:
|
|
762
|
-
onBlur:
|
|
763
|
-
onChange:
|
|
764
|
-
options:
|
|
765
|
-
placeholder:
|
|
766
|
-
isClearable:
|
|
767
|
-
isSearchable:
|
|
768
|
-
...
|
|
769
|
-
},
|
|
770
|
-
const [
|
|
771
|
-
|
|
772
|
-
p !== void 0 &&
|
|
773
|
-
}, [p]),
|
|
774
|
-
const
|
|
775
|
-
|
|
758
|
+
defaultValue: y,
|
|
759
|
+
onFocus: u,
|
|
760
|
+
onBlur: h,
|
|
761
|
+
onChange: w,
|
|
762
|
+
options: N = [],
|
|
763
|
+
placeholder: m = "Selecione uma opção",
|
|
764
|
+
isClearable: b = !1,
|
|
765
|
+
isSearchable: _ = !1,
|
|
766
|
+
...x
|
|
767
|
+
}, E) => {
|
|
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());
|
|
776
774
|
};
|
|
777
|
-
return document.addEventListener("mousedown",
|
|
778
|
-
}, [
|
|
779
|
-
const
|
|
780
|
-
(
|
|
781
|
-
) :
|
|
782
|
-
|
|
783
|
-
var
|
|
784
|
-
(
|
|
775
|
+
return document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
|
|
776
|
+
}, [h]);
|
|
777
|
+
const j = _ && H ? F.filter(
|
|
778
|
+
(g) => g.label.toLowerCase().includes(H.toLowerCase())
|
|
779
|
+
) : F, U = () => {
|
|
780
|
+
f || (T(!C), $(!C), C ? (h == null || h(), _ && R("")) : (u == null || u(), _ && setTimeout(() => {
|
|
781
|
+
var g;
|
|
782
|
+
(g = M.current) == null || g.focus();
|
|
785
783
|
}, 0)));
|
|
786
|
-
},
|
|
787
|
-
|
|
788
|
-
},
|
|
789
|
-
|
|
790
|
-
},
|
|
791
|
-
|
|
792
|
-
},
|
|
793
|
-
|
|
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("");
|
|
794
792
|
const O = { value: "", label: "" };
|
|
795
|
-
|
|
796
|
-
},
|
|
793
|
+
w == null || w(O, g);
|
|
794
|
+
}, W = q || L || m || _ && H, X = [
|
|
797
795
|
"clarity-select",
|
|
798
796
|
"clarity-select--outlined",
|
|
799
797
|
`clarity-select--${a}`,
|
|
800
798
|
t && `clarity-select--${t}`,
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
(
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
(
|
|
809
|
-
|
|
810
|
-
].filter(Boolean).join(" "),
|
|
799
|
+
o && "clarity-select--error",
|
|
800
|
+
f && "clarity-select--disabled",
|
|
801
|
+
(L || C) && "clarity-select--focused",
|
|
802
|
+
W && "clarity-select--label-up",
|
|
803
|
+
C && "clarity-select--open",
|
|
804
|
+
_ && "clarity-select--searchable",
|
|
805
|
+
c && "clarity-select--with-start-icon",
|
|
806
|
+
(d || b) && "clarity-select--with-end-icon",
|
|
807
|
+
i
|
|
808
|
+
].filter(Boolean).join(" "), D = n != null && n.endsWith("left") ? "left" : "right", Y = (g, O) => {
|
|
811
809
|
if (!l) return null;
|
|
812
|
-
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;
|
|
813
811
|
return /* @__PURE__ */ e(
|
|
814
812
|
yt,
|
|
815
813
|
{
|
|
816
814
|
content: G,
|
|
817
|
-
position:
|
|
815
|
+
position: g === "middle" ? O === "left" ? "left" : "right" : g === "top" ? O === "left" ? "top-left" : "top-right" : O === "left" ? "bottom-left" : "bottom-right",
|
|
818
816
|
trigger: "hover",
|
|
819
|
-
variant:
|
|
820
|
-
plain:
|
|
821
|
-
bgColor:
|
|
822
|
-
textColor:
|
|
823
|
-
children: /* @__PURE__ */ e("button", { type: "button", className: "clarity-select__helper-icon", "aria-label": "Helper", children: /* @__PURE__ */ e(pt, { size:
|
|
817
|
+
variant: at || t,
|
|
818
|
+
plain: Q,
|
|
819
|
+
bgColor: it,
|
|
820
|
+
textColor: ft,
|
|
821
|
+
children: /* @__PURE__ */ e("button", { type: "button", className: "clarity-select__helper-icon", "aria-label": "Helper", children: /* @__PURE__ */ e(pt, { size: g === "middle" ? 20 : 16 }) })
|
|
824
822
|
}
|
|
825
823
|
);
|
|
826
|
-
}, lt = /* @__PURE__ */
|
|
824
|
+
}, lt = /* @__PURE__ */ v(
|
|
827
825
|
"div",
|
|
828
826
|
{
|
|
829
|
-
ref:
|
|
830
|
-
className:
|
|
831
|
-
onClick:
|
|
827
|
+
ref: V,
|
|
828
|
+
className: X,
|
|
829
|
+
onClick: _ ? void 0 : U,
|
|
832
830
|
role: "combobox",
|
|
833
|
-
"aria-expanded":
|
|
831
|
+
"aria-expanded": C,
|
|
834
832
|
"aria-haspopup": "listbox",
|
|
835
|
-
tabIndex:
|
|
836
|
-
...
|
|
833
|
+
tabIndex: f || _ ? -1 : 0,
|
|
834
|
+
...x,
|
|
837
835
|
children: [
|
|
838
|
-
|
|
839
|
-
/* @__PURE__ */
|
|
840
|
-
|
|
836
|
+
c && /* @__PURE__ */ e("div", { className: "clarity-select__start-icon", children: c }),
|
|
837
|
+
/* @__PURE__ */ v("div", { className: "clarity-select__field", children: [
|
|
838
|
+
_ ? /* @__PURE__ */ e(
|
|
841
839
|
"input",
|
|
842
840
|
{
|
|
843
|
-
ref:
|
|
841
|
+
ref: M,
|
|
844
842
|
type: "text",
|
|
845
843
|
className: "clarity-select__search-input",
|
|
846
|
-
value:
|
|
847
|
-
onChange:
|
|
848
|
-
onKeyDown:
|
|
844
|
+
value: C ? H : Z ? Z.label : "",
|
|
845
|
+
onChange: K,
|
|
846
|
+
onKeyDown: P,
|
|
849
847
|
onFocus: () => {
|
|
850
|
-
|
|
848
|
+
C || (T(!0), $(!0), u == null || u());
|
|
851
849
|
},
|
|
852
|
-
placeholder:
|
|
853
|
-
disabled:
|
|
854
|
-
readOnly: !
|
|
850
|
+
placeholder: Z ? Z.label : m,
|
|
851
|
+
disabled: f,
|
|
852
|
+
readOnly: !C
|
|
855
853
|
}
|
|
856
|
-
) : /* @__PURE__ */ e("div", { className: "clarity-select__display", children:
|
|
854
|
+
) : /* @__PURE__ */ e("div", { className: "clarity-select__display", children: Z ? Z.label : m }),
|
|
857
855
|
r && /* @__PURE__ */ e("label", { className: "clarity-select__label", children: r })
|
|
858
856
|
] }),
|
|
859
|
-
|
|
857
|
+
b && q && /* @__PURE__ */ e(
|
|
860
858
|
"button",
|
|
861
859
|
{
|
|
862
860
|
type: "button",
|
|
863
861
|
className: "clarity-select__clear-button",
|
|
864
|
-
onClick:
|
|
862
|
+
onClick: tt,
|
|
865
863
|
"aria-label": "Limpar seleção",
|
|
866
864
|
children: /* @__PURE__ */ e(
|
|
867
865
|
"svg",
|
|
@@ -888,8 +886,8 @@ const Le = W.forwardRef(({
|
|
|
888
886
|
"div",
|
|
889
887
|
{
|
|
890
888
|
className: "clarity-select__end-icon",
|
|
891
|
-
onClick:
|
|
892
|
-
children:
|
|
889
|
+
onClick: _ ? U : void 0,
|
|
890
|
+
children: d || /* @__PURE__ */ e(
|
|
893
891
|
"svg",
|
|
894
892
|
{
|
|
895
893
|
className: "clarity-select__arrow",
|
|
@@ -911,37 +909,37 @@ const Le = W.forwardRef(({
|
|
|
911
909
|
)
|
|
912
910
|
}
|
|
913
911
|
),
|
|
914
|
-
|
|
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(
|
|
915
913
|
"li",
|
|
916
914
|
{
|
|
917
915
|
className: [
|
|
918
916
|
"clarity-select__option",
|
|
919
|
-
|
|
920
|
-
|
|
917
|
+
g.disabled && "clarity-select__option--disabled",
|
|
918
|
+
k === g.value && "clarity-select__option--selected"
|
|
921
919
|
].filter(Boolean).join(" "),
|
|
922
|
-
onClick: (O) =>
|
|
920
|
+
onClick: (O) => S(g, O),
|
|
923
921
|
role: "option",
|
|
924
|
-
"aria-selected":
|
|
925
|
-
children:
|
|
922
|
+
"aria-selected": k === g.value,
|
|
923
|
+
children: g.label
|
|
926
924
|
},
|
|
927
|
-
|
|
925
|
+
g.value
|
|
928
926
|
)) : /* @__PURE__ */ e("li", { className: "clarity-select__option clarity-select__option--no-results", children: "Nenhum resultado encontrado" }) }) })
|
|
929
927
|
]
|
|
930
928
|
}
|
|
931
929
|
);
|
|
932
|
-
return /* @__PURE__ */
|
|
933
|
-
l && (n == null ? void 0 : n.startsWith("top")) && /* @__PURE__ */ e("div", { className: `clarity-select__helper-row clarity-select__helper-row--top clarity-select__helper-row--${
|
|
934
|
-
l && (n != null && n.startsWith("middle")) ? /* @__PURE__ */
|
|
935
|
-
|
|
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),
|
|
936
934
|
lt,
|
|
937
|
-
|
|
935
|
+
D === "right" && Y("middle", D)
|
|
938
936
|
] }) : lt,
|
|
939
|
-
l && (n == null ? void 0 : n.startsWith("bottom")) && /* @__PURE__ */ e("div", { className: `clarity-select__helper-row clarity-select__helper-row--bottom clarity-select__helper-row--${
|
|
940
|
-
|
|
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) }),
|
|
938
|
+
o && s && /* @__PURE__ */ e("div", { className: "clarity-select__helper-text", children: s })
|
|
941
939
|
] });
|
|
942
940
|
});
|
|
943
|
-
|
|
944
|
-
const
|
|
941
|
+
Ee.displayName = "Select";
|
|
942
|
+
const Le = _e(({
|
|
945
943
|
options: t = [],
|
|
946
944
|
value: a = [],
|
|
947
945
|
onChange: r,
|
|
@@ -949,134 +947,133 @@ const Re = we(({
|
|
|
949
947
|
label: n,
|
|
950
948
|
helper: o = !1,
|
|
951
949
|
helperPosition: s = "top-right",
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
variant: y = "primary",
|
|
950
|
+
error: c = !1,
|
|
951
|
+
errorMessage: d,
|
|
952
|
+
disabled: i = !1,
|
|
953
|
+
variant: f = "primary",
|
|
957
954
|
size: p = "medium",
|
|
958
|
-
maxSelectedLabels:
|
|
959
|
-
selectionLimit:
|
|
960
|
-
className:
|
|
961
|
-
id:
|
|
962
|
-
name:
|
|
963
|
-
required:
|
|
964
|
-
"data-testid":
|
|
965
|
-
...
|
|
966
|
-
},
|
|
967
|
-
const [
|
|
968
|
-
|
|
955
|
+
maxSelectedLabels: y = 3,
|
|
956
|
+
selectionLimit: u,
|
|
957
|
+
className: h = "",
|
|
958
|
+
id: w,
|
|
959
|
+
name: N,
|
|
960
|
+
required: m = !1,
|
|
961
|
+
"data-testid": b,
|
|
962
|
+
..._
|
|
963
|
+
}, x) => {
|
|
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);
|
|
969
966
|
};
|
|
970
|
-
|
|
971
|
-
const
|
|
972
|
-
|
|
967
|
+
J(() => {
|
|
968
|
+
const g = (O) => {
|
|
969
|
+
z.current && !z.current.contains(O.target) && (C(!1), k(!1), L(""));
|
|
973
970
|
};
|
|
974
|
-
return document.addEventListener("click",
|
|
971
|
+
return document.addEventListener("click", g), () => document.removeEventListener("click", g);
|
|
975
972
|
}, []);
|
|
976
|
-
const
|
|
977
|
-
(
|
|
978
|
-
),
|
|
979
|
-
|
|
980
|
-
var
|
|
981
|
-
(
|
|
973
|
+
const F = V.filter(
|
|
974
|
+
(g) => g.label.toLowerCase().includes(T.toLowerCase())
|
|
975
|
+
), j = () => {
|
|
976
|
+
i || (C(!E), k(!E), E ? L("") : setTimeout(() => {
|
|
977
|
+
var g;
|
|
978
|
+
(g = H.current) == null || g.focus();
|
|
982
979
|
}, 100));
|
|
983
|
-
},
|
|
984
|
-
if (
|
|
980
|
+
}, U = (g, O) => {
|
|
981
|
+
if (i)
|
|
985
982
|
return;
|
|
986
983
|
O && (O.stopPropagation(), O.preventDefault());
|
|
987
|
-
const
|
|
984
|
+
const B = a.includes(g);
|
|
988
985
|
let G;
|
|
989
|
-
|
|
990
|
-
},
|
|
991
|
-
if (O.stopPropagation(),
|
|
992
|
-
const
|
|
993
|
-
r == null || r(
|
|
994
|
-
},
|
|
995
|
-
|
|
996
|
-
},
|
|
997
|
-
|
|
998
|
-
},
|
|
999
|
-
|
|
1000
|
-
},
|
|
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(""));
|
|
997
|
+
}, q = $ || E || a.length > 0, tt = () => {
|
|
1001
998
|
if (a.length === 0) return null;
|
|
1002
|
-
const
|
|
1003
|
-
(G) =>
|
|
1004
|
-
).filter(Boolean), O =
|
|
1005
|
-
return /* @__PURE__ */
|
|
1006
|
-
O.map((G) => /* @__PURE__ */
|
|
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: [
|
|
1007
1004
|
/* @__PURE__ */ e("span", { className: "clarity-multiselect__chip-label", children: G.label }),
|
|
1008
|
-
!
|
|
1005
|
+
!i && /* @__PURE__ */ e(
|
|
1009
1006
|
"button",
|
|
1010
1007
|
{
|
|
1011
1008
|
type: "button",
|
|
1012
1009
|
className: "clarity-multiselect__chip-remove",
|
|
1013
|
-
onClick: (
|
|
1010
|
+
onClick: (Q) => S(G.value, Q),
|
|
1014
1011
|
"aria-label": `Remover ${G.label}`,
|
|
1015
1012
|
children: "×"
|
|
1016
1013
|
}
|
|
1017
1014
|
)
|
|
1018
1015
|
] }, G.value)),
|
|
1019
|
-
|
|
1016
|
+
B > 0 && /* @__PURE__ */ v("div", { className: "clarity-multiselect__chip clarity-multiselect__chip--count", children: [
|
|
1020
1017
|
"+",
|
|
1021
|
-
|
|
1018
|
+
B,
|
|
1022
1019
|
" mais"
|
|
1023
1020
|
] })
|
|
1024
1021
|
] });
|
|
1025
|
-
},
|
|
1022
|
+
}, W = [
|
|
1026
1023
|
"clarity-multiselect-wrapper",
|
|
1027
|
-
|
|
1028
|
-
].filter(Boolean).join(" "),
|
|
1024
|
+
h
|
|
1025
|
+
].filter(Boolean).join(" "), X = [
|
|
1029
1026
|
"clarity-multiselect",
|
|
1030
|
-
`clarity-multiselect--${
|
|
1027
|
+
`clarity-multiselect--${f}`,
|
|
1031
1028
|
`clarity-multiselect--${p}`,
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1029
|
+
E && "clarity-multiselect--open",
|
|
1030
|
+
$ && "clarity-multiselect--focused",
|
|
1031
|
+
q && "clarity-multiselect--label-up",
|
|
1032
|
+
c && "clarity-multiselect--error",
|
|
1033
|
+
i && "clarity-multiselect--disabled",
|
|
1037
1034
|
a.length > 0 && "clarity-multiselect--has-value"
|
|
1038
|
-
].filter(Boolean).join(" "),
|
|
1035
|
+
].filter(Boolean).join(" "), D = s != null && s.endsWith("left") ? "left" : "right", Y = (g, O) => {
|
|
1039
1036
|
if (!o) return null;
|
|
1040
|
-
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;
|
|
1041
1038
|
return /* @__PURE__ */ e(
|
|
1042
1039
|
yt,
|
|
1043
1040
|
{
|
|
1044
1041
|
content: G,
|
|
1045
|
-
position:
|
|
1042
|
+
position: g === "middle" ? O === "left" ? "left" : "right" : g === "top" ? O === "left" ? "top-left" : "top-right" : O === "left" ? "bottom-left" : "bottom-right",
|
|
1046
1043
|
trigger: "hover",
|
|
1047
|
-
variant:
|
|
1048
|
-
plain:
|
|
1049
|
-
bgColor:
|
|
1050
|
-
textColor:
|
|
1051
|
-
children: /* @__PURE__ */ e("button", { type: "button", className: "clarity-multiselect__helper-icon", "aria-label": "Helper", children: /* @__PURE__ */ e(pt, { size:
|
|
1044
|
+
variant: at || f,
|
|
1045
|
+
plain: Q,
|
|
1046
|
+
bgColor: it,
|
|
1047
|
+
textColor: ft,
|
|
1048
|
+
children: /* @__PURE__ */ e("button", { type: "button", className: "clarity-multiselect__helper-icon", "aria-label": "Helper", children: /* @__PURE__ */ e(pt, { size: g === "middle" ? 20 : 16 }) })
|
|
1052
1049
|
}
|
|
1053
1050
|
);
|
|
1054
|
-
}, lt = /* @__PURE__ */
|
|
1051
|
+
}, lt = /* @__PURE__ */ v(
|
|
1055
1052
|
"div",
|
|
1056
1053
|
{
|
|
1057
|
-
ref:
|
|
1058
|
-
className:
|
|
1059
|
-
"data-testid":
|
|
1060
|
-
...
|
|
1054
|
+
ref: M,
|
|
1055
|
+
className: X,
|
|
1056
|
+
"data-testid": b,
|
|
1057
|
+
..._,
|
|
1061
1058
|
children: [
|
|
1062
|
-
/* @__PURE__ */
|
|
1059
|
+
/* @__PURE__ */ v(
|
|
1063
1060
|
"div",
|
|
1064
1061
|
{
|
|
1065
1062
|
className: "clarity-multiselect__field",
|
|
1066
|
-
onClick:
|
|
1063
|
+
onClick: j,
|
|
1067
1064
|
children: [
|
|
1068
|
-
n && /* @__PURE__ */
|
|
1065
|
+
n && /* @__PURE__ */ v("label", { className: "clarity-multiselect__label", children: [
|
|
1069
1066
|
n,
|
|
1070
|
-
|
|
1067
|
+
m && /* @__PURE__ */ e("span", { className: "clarity-multiselect__required", children: "*" })
|
|
1071
1068
|
] }),
|
|
1072
|
-
/* @__PURE__ */ e("div", { className: "clarity-multiselect__content", children: a.length > 0 ?
|
|
1073
|
-
/* @__PURE__ */
|
|
1074
|
-
a.length > 0 && !
|
|
1069
|
+
/* @__PURE__ */ e("div", { className: "clarity-multiselect__content", children: a.length > 0 ? tt() : /* @__PURE__ */ e("span", { className: "clarity-multiselect__placeholder", children: l }) }),
|
|
1070
|
+
/* @__PURE__ */ v("div", { className: "clarity-multiselect__icons", children: [
|
|
1071
|
+
a.length > 0 && !i && /* @__PURE__ */ e(
|
|
1075
1072
|
"button",
|
|
1076
1073
|
{
|
|
1077
1074
|
type: "button",
|
|
1078
1075
|
className: "clarity-multiselect__clear-button",
|
|
1079
|
-
onClick:
|
|
1076
|
+
onClick: K,
|
|
1080
1077
|
"aria-label": "Limpar seleção",
|
|
1081
1078
|
children: "×"
|
|
1082
1079
|
}
|
|
@@ -1095,30 +1092,30 @@ const Re = we(({
|
|
|
1095
1092
|
]
|
|
1096
1093
|
}
|
|
1097
1094
|
),
|
|
1098
|
-
|
|
1095
|
+
E && /* @__PURE__ */ v("div", { ref: R, className: "clarity-multiselect__dropdown", children: [
|
|
1099
1096
|
/* @__PURE__ */ e("div", { className: "clarity-multiselect__search", children: /* @__PURE__ */ e(
|
|
1100
1097
|
"input",
|
|
1101
1098
|
{
|
|
1102
|
-
ref:
|
|
1099
|
+
ref: H,
|
|
1103
1100
|
type: "text",
|
|
1104
1101
|
className: "clarity-multiselect__search-input",
|
|
1105
1102
|
placeholder: "Buscar opções...",
|
|
1106
|
-
value:
|
|
1107
|
-
onChange:
|
|
1108
|
-
onKeyDown:
|
|
1103
|
+
value: T,
|
|
1104
|
+
onChange: P,
|
|
1105
|
+
onKeyDown: Z
|
|
1109
1106
|
}
|
|
1110
1107
|
) }),
|
|
1111
|
-
/* @__PURE__ */ e("ul", { className: "clarity-multiselect__options", children:
|
|
1112
|
-
const O = a.includes(
|
|
1113
|
-
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(
|
|
1114
1111
|
"li",
|
|
1115
1112
|
{
|
|
1116
1113
|
className: [
|
|
1117
1114
|
"clarity-multiselect__option",
|
|
1118
1115
|
O && "clarity-multiselect__option--selected",
|
|
1119
|
-
|
|
1116
|
+
B && "clarity-multiselect__option--disabled"
|
|
1120
1117
|
].filter(Boolean).join(" "),
|
|
1121
|
-
onClick: (G) => !
|
|
1118
|
+
onClick: (G) => !B && U(g.value, G),
|
|
1122
1119
|
children: [
|
|
1123
1120
|
/* @__PURE__ */ e("div", { className: "clarity-multiselect__option-checkbox", children: /* @__PURE__ */ e("div", { className: [
|
|
1124
1121
|
"clarity-multiselect__checkbox",
|
|
@@ -1133,39 +1130,39 @@ const Re = we(({
|
|
|
1133
1130
|
strokeLinejoin: "round"
|
|
1134
1131
|
}
|
|
1135
1132
|
) }) }) }),
|
|
1136
|
-
/* @__PURE__ */ e("span", { className: "clarity-multiselect__option-label", children:
|
|
1133
|
+
/* @__PURE__ */ e("span", { className: "clarity-multiselect__option-label", children: g.label })
|
|
1137
1134
|
]
|
|
1138
1135
|
},
|
|
1139
|
-
|
|
1136
|
+
g.value
|
|
1140
1137
|
);
|
|
1141
1138
|
}) : /* @__PURE__ */ e("li", { className: "clarity-multiselect__option clarity-multiselect__option--no-results", children: "Nenhum resultado encontrado" }) })
|
|
1142
1139
|
] })
|
|
1143
1140
|
]
|
|
1144
1141
|
}
|
|
1145
1142
|
);
|
|
1146
|
-
return /* @__PURE__ */
|
|
1147
|
-
o && (s == null ? void 0 : s.startsWith("top")) && /* @__PURE__ */ e("div", { className: `clarity-multiselect__helper-row clarity-multiselect__helper-row--top clarity-multiselect__helper-row--${
|
|
1148
|
-
o && (s != null && s.startsWith("middle")) ? /* @__PURE__ */
|
|
1149
|
-
|
|
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),
|
|
1150
1147
|
lt,
|
|
1151
|
-
|
|
1148
|
+
D === "right" && Y("middle", D)
|
|
1152
1149
|
] }) : lt,
|
|
1153
|
-
o && (s == null ? void 0 : s.startsWith("bottom")) && /* @__PURE__ */ e("div", { className: `clarity-multiselect__helper-row clarity-multiselect__helper-row--bottom clarity-multiselect__helper-row--${
|
|
1154
|
-
|
|
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) }),
|
|
1151
|
+
c && d && /* @__PURE__ */ e("div", { className: "clarity-multiselect__helper", children: /* @__PURE__ */ e("span", { className: "clarity-multiselect__error-message", children: d }) })
|
|
1155
1152
|
] });
|
|
1156
1153
|
});
|
|
1157
|
-
|
|
1158
|
-
const
|
|
1159
|
-
const t = dt(
|
|
1154
|
+
Le.displayName = "MultiSelect";
|
|
1155
|
+
const Rt = ct(null), Ot = () => {
|
|
1156
|
+
const t = dt(Rt);
|
|
1160
1157
|
if (!t)
|
|
1161
1158
|
throw new Error("useModal must be used within a Modal provider");
|
|
1162
1159
|
return t;
|
|
1163
|
-
},
|
|
1160
|
+
}, Wt = ({
|
|
1164
1161
|
children: t,
|
|
1165
1162
|
className: a = "",
|
|
1166
1163
|
title: r
|
|
1167
1164
|
}) => {
|
|
1168
|
-
const { onClose: l, variant: n, showCloseButton: o } =
|
|
1165
|
+
const { onClose: l, variant: n, showCloseButton: o } = Ot(), s = [
|
|
1169
1166
|
"clarity-modal-header",
|
|
1170
1167
|
a,
|
|
1171
1168
|
n && `clarity-modal-header--${n}`
|
|
@@ -1173,7 +1170,7 @@ const Ot = ct(null), Wt = () => {
|
|
|
1173
1170
|
"clarity-modal-close",
|
|
1174
1171
|
n && `clarity-modal-close--${n}`
|
|
1175
1172
|
].filter(Boolean).join(" ");
|
|
1176
|
-
return /* @__PURE__ */
|
|
1173
|
+
return /* @__PURE__ */ v("div", { className: s, children: [
|
|
1177
1174
|
r && /* @__PURE__ */ e("h2", { className: "clarity-modal-title", children: r }),
|
|
1178
1175
|
t,
|
|
1179
1176
|
o && /* @__PURE__ */ e("button", { className: c, onClick: (d) => {
|
|
@@ -1181,23 +1178,23 @@ const Ot = ct(null), Wt = () => {
|
|
|
1181
1178
|
}, children: "×" })
|
|
1182
1179
|
] });
|
|
1183
1180
|
};
|
|
1184
|
-
|
|
1185
|
-
const
|
|
1186
|
-
|
|
1187
|
-
const
|
|
1181
|
+
Wt.displayName = "Modal.Header";
|
|
1182
|
+
const It = ({ children: t, className: a = "" }) => /* @__PURE__ */ e("div", { className: `clarity-modal-content ${a}`, children: t });
|
|
1183
|
+
It.displayName = "Modal.Content";
|
|
1184
|
+
const Ht = ({ children: t, className: a = "" }) => /* @__PURE__ */ v("div", { className: `clarity-modal-footer ${a}`, children: [
|
|
1188
1185
|
/* @__PURE__ */ e("div", { className: "clarity-modal-scroll-indicator" }),
|
|
1189
1186
|
t
|
|
1190
1187
|
] });
|
|
1191
|
-
|
|
1192
|
-
const
|
|
1188
|
+
Ht.displayName = "Modal.Footer";
|
|
1189
|
+
const Dt = ({ children: t, onClick: a }) => rt(t, {
|
|
1193
1190
|
onClick: (r) => {
|
|
1194
1191
|
var l, n;
|
|
1195
1192
|
a == null || a(), (n = (l = t.props).onClick) == null || n.call(l, r);
|
|
1196
1193
|
}
|
|
1197
1194
|
});
|
|
1198
|
-
|
|
1199
|
-
const
|
|
1200
|
-
const { onClose: a } =
|
|
1195
|
+
Dt.displayName = "Modal.Trigger";
|
|
1196
|
+
const Vt = ({ children: t }) => {
|
|
1197
|
+
const { onClose: a } = Ot();
|
|
1201
1198
|
return rt(t, {
|
|
1202
1199
|
onClick: (r) => {
|
|
1203
1200
|
var l, n;
|
|
@@ -1205,7 +1202,7 @@ const At = ({ children: t }) => {
|
|
|
1205
1202
|
}
|
|
1206
1203
|
});
|
|
1207
1204
|
};
|
|
1208
|
-
|
|
1205
|
+
Vt.displayName = "Modal.Close";
|
|
1209
1206
|
const mt = ({
|
|
1210
1207
|
isOpen: t,
|
|
1211
1208
|
onClose: a,
|
|
@@ -1217,54 +1214,54 @@ const mt = ({
|
|
|
1217
1214
|
showCloseButton: c = !0,
|
|
1218
1215
|
closeOnOverlayClick: d = !0
|
|
1219
1216
|
}) => {
|
|
1220
|
-
const [i,
|
|
1221
|
-
a ? a() :
|
|
1217
|
+
const [i, f] = A(!1), y = t !== void 0 ? t : i, u = I.useCallback(() => {
|
|
1218
|
+
a ? a() : f(!1);
|
|
1222
1219
|
}, [a]);
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
}, [
|
|
1226
|
-
const
|
|
1227
|
-
|
|
1220
|
+
J(() => {
|
|
1221
|
+
y && (r == null || r());
|
|
1222
|
+
}, [y, r]), J(() => {
|
|
1223
|
+
const b = (_) => {
|
|
1224
|
+
_.key === "Escape" && u();
|
|
1228
1225
|
};
|
|
1229
|
-
return
|
|
1230
|
-
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";
|
|
1231
1228
|
};
|
|
1232
|
-
}, [
|
|
1233
|
-
const
|
|
1234
|
-
d &&
|
|
1235
|
-
},
|
|
1236
|
-
(
|
|
1237
|
-
), N =
|
|
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"
|
|
1234
|
+
), N = I.Children.toArray(l).filter(
|
|
1235
|
+
(b) => ot(b) && b.type.displayName !== "Modal.Trigger"
|
|
1239
1236
|
), m = ["clarity-modal", n, `clarity-modal--${s}`].filter(Boolean).join(" ");
|
|
1240
|
-
return /* @__PURE__ */
|
|
1241
|
-
|
|
1242
|
-
|
|
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 }) })
|
|
1243
1240
|
] });
|
|
1244
1241
|
};
|
|
1245
|
-
mt.Header =
|
|
1246
|
-
mt.Content =
|
|
1247
|
-
mt.Footer =
|
|
1248
|
-
mt.Trigger =
|
|
1249
|
-
mt.Close =
|
|
1242
|
+
mt.Header = Wt;
|
|
1243
|
+
mt.Content = It;
|
|
1244
|
+
mt.Footer = Ht;
|
|
1245
|
+
mt.Trigger = Dt;
|
|
1246
|
+
mt.Close = Vt;
|
|
1250
1247
|
mt.displayName = "Modal";
|
|
1251
|
-
const
|
|
1252
|
-
const t = dt(
|
|
1248
|
+
const At = ct(void 0), ea = () => {
|
|
1249
|
+
const t = dt(At);
|
|
1253
1250
|
if (!t)
|
|
1254
1251
|
throw new Error("useToast must be used within a ToastProvider");
|
|
1255
1252
|
return t;
|
|
1256
|
-
},
|
|
1257
|
-
const [s, c] =
|
|
1258
|
-
|
|
1253
|
+
}, Re = ({ id: t, message: a, variant: r, duration: l, onClose: n, invertColors: o }) => {
|
|
1254
|
+
const [s, c] = A("entering");
|
|
1255
|
+
J(() => {
|
|
1259
1256
|
const i = setTimeout(() => {
|
|
1260
1257
|
c("visible");
|
|
1261
|
-
}, 10),
|
|
1258
|
+
}, 10), f = setTimeout(() => {
|
|
1262
1259
|
c("exiting");
|
|
1263
|
-
}, l * 1e3 - 300),
|
|
1260
|
+
}, l * 1e3 - 300), p = setTimeout(() => {
|
|
1264
1261
|
n(t);
|
|
1265
1262
|
}, l * 1e3);
|
|
1266
1263
|
return () => {
|
|
1267
|
-
clearTimeout(i), clearTimeout(
|
|
1264
|
+
clearTimeout(i), clearTimeout(f), clearTimeout(p);
|
|
1268
1265
|
};
|
|
1269
1266
|
}, [t, l, n]);
|
|
1270
1267
|
const d = [
|
|
@@ -1273,7 +1270,7 @@ const zt = ct(void 0), aa = () => {
|
|
|
1273
1270
|
o ? "colored-background" : "",
|
|
1274
1271
|
`cl-toast-${s}`
|
|
1275
1272
|
].filter(Boolean).join(" ");
|
|
1276
|
-
return /* @__PURE__ */
|
|
1273
|
+
return /* @__PURE__ */ v("div", { className: d, children: [
|
|
1277
1274
|
/* @__PURE__ */ e("div", { className: "cl-toast-message", children: a }),
|
|
1278
1275
|
/* @__PURE__ */ e("button", { onClick: () => c("exiting"), className: "cl-toast-close-button", children: "×" }),
|
|
1279
1276
|
/* @__PURE__ */ e(
|
|
@@ -1284,51 +1281,51 @@ const zt = ct(void 0), aa = () => {
|
|
|
1284
1281
|
}
|
|
1285
1282
|
)
|
|
1286
1283
|
] });
|
|
1287
|
-
},
|
|
1288
|
-
const [a, r] =
|
|
1284
|
+
}, aa = ({ children: t }) => {
|
|
1285
|
+
const [a, r] = A([]), l = gt(() => {
|
|
1289
1286
|
if (typeof document < "u") {
|
|
1290
1287
|
const d = document.createElement("div");
|
|
1291
1288
|
return d.id = "toast-portal-root", d;
|
|
1292
1289
|
}
|
|
1293
1290
|
return null;
|
|
1294
1291
|
}, []);
|
|
1295
|
-
|
|
1292
|
+
J(() => {
|
|
1296
1293
|
if (l)
|
|
1297
1294
|
return document.body.appendChild(l), () => {
|
|
1298
1295
|
document.body.removeChild(l);
|
|
1299
1296
|
};
|
|
1300
1297
|
}, [l]);
|
|
1301
1298
|
const n = _t((d) => {
|
|
1302
|
-
const
|
|
1299
|
+
const f = {
|
|
1303
1300
|
id: (/* @__PURE__ */ new Date()).toISOString() + Math.random(),
|
|
1304
1301
|
// duration: 5,
|
|
1305
1302
|
// position: 'right-top',
|
|
1306
1303
|
...d
|
|
1307
1304
|
};
|
|
1308
|
-
r((
|
|
1309
|
-
const
|
|
1310
|
-
return
|
|
1305
|
+
r((p) => {
|
|
1306
|
+
const y = [f, ...p];
|
|
1307
|
+
return y.length > 4 ? y.slice(0, 4) : y;
|
|
1311
1308
|
});
|
|
1312
1309
|
}, []), o = _t((d) => {
|
|
1313
|
-
r((i) => i.filter((
|
|
1310
|
+
r((i) => i.filter((f) => f.id !== d));
|
|
1314
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]);
|
|
1315
|
-
return /* @__PURE__ */
|
|
1312
|
+
return /* @__PURE__ */ v(At.Provider, { value: c, children: [
|
|
1316
1313
|
t,
|
|
1317
|
-
l &&
|
|
1318
|
-
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)),
|
|
1319
1316
|
l
|
|
1320
1317
|
)
|
|
1321
1318
|
] });
|
|
1322
|
-
}, Mt = ct(null),
|
|
1319
|
+
}, Mt = ct(null), zt = () => {
|
|
1323
1320
|
const t = dt(Mt);
|
|
1324
1321
|
if (!t)
|
|
1325
1322
|
throw new Error("useOffcanvas must be used within an Offcanvas provider");
|
|
1326
1323
|
return t;
|
|
1327
|
-
},
|
|
1324
|
+
}, Ft = ({
|
|
1328
1325
|
children: t,
|
|
1329
1326
|
className: a = ""
|
|
1330
1327
|
}) => {
|
|
1331
|
-
const { onClose: r, variant: l, showCloseButton: n, title: o } =
|
|
1328
|
+
const { onClose: r, variant: l, showCloseButton: n, title: o } = zt(), s = [
|
|
1332
1329
|
"clarity-offcanvas-header",
|
|
1333
1330
|
a
|
|
1334
1331
|
].filter(Boolean).join(" "), c = [
|
|
@@ -1338,7 +1335,7 @@ const zt = ct(void 0), aa = () => {
|
|
|
1338
1335
|
"clarity-offcanvas-title",
|
|
1339
1336
|
l && `clarity-offcanvas-title--${l}`
|
|
1340
1337
|
].filter(Boolean).join(" ");
|
|
1341
|
-
return /* @__PURE__ */
|
|
1338
|
+
return /* @__PURE__ */ v("div", { className: s, children: [
|
|
1342
1339
|
o && /* @__PURE__ */ e("h2", { className: d, children: o }),
|
|
1343
1340
|
t,
|
|
1344
1341
|
n && /* @__PURE__ */ e("button", { className: c, onClick: (i) => {
|
|
@@ -1346,21 +1343,21 @@ const zt = ct(void 0), aa = () => {
|
|
|
1346
1343
|
}, children: "×" })
|
|
1347
1344
|
] });
|
|
1348
1345
|
};
|
|
1349
|
-
|
|
1350
|
-
const
|
|
1351
|
-
|
|
1352
|
-
const
|
|
1346
|
+
Ft.displayName = "Offcanvas.Header";
|
|
1347
|
+
const Gt = ({ children: t, className: a = "" }) => /* @__PURE__ */ e("div", { className: `clarity-offcanvas-content ${a}`, children: t });
|
|
1348
|
+
Gt.displayName = "Offcanvas.Content";
|
|
1349
|
+
const Ut = ({ children: t, onClick: a, variant: r }) => rt(t, {
|
|
1353
1350
|
onClick: (l) => {
|
|
1354
1351
|
var n, o;
|
|
1355
1352
|
a == null || a(), (o = (n = t.props).onClick) == null || o.call(n, l);
|
|
1356
1353
|
},
|
|
1357
1354
|
variant: r
|
|
1358
1355
|
});
|
|
1359
|
-
|
|
1360
|
-
const
|
|
1361
|
-
|
|
1362
|
-
const
|
|
1363
|
-
const { onClose: a } =
|
|
1356
|
+
Ut.displayName = "Offcanvas.Trigger";
|
|
1357
|
+
const $t = ({ children: t, className: a = "" }) => /* @__PURE__ */ e("div", { className: `clarity-offcanvas-footer ${a}`, children: t });
|
|
1358
|
+
$t.displayName = "Offcanvas.Footer";
|
|
1359
|
+
const Xt = ({ children: t }) => {
|
|
1360
|
+
const { onClose: a } = zt();
|
|
1364
1361
|
return rt(t, {
|
|
1365
1362
|
onClick: (r) => {
|
|
1366
1363
|
var l, n;
|
|
@@ -1368,7 +1365,7 @@ const Yt = ({ children: t }) => {
|
|
|
1368
1365
|
}
|
|
1369
1366
|
});
|
|
1370
1367
|
};
|
|
1371
|
-
|
|
1368
|
+
Xt.displayName = "Offcanvas.Close";
|
|
1372
1369
|
const ht = ({
|
|
1373
1370
|
isOpen: t,
|
|
1374
1371
|
onClose: a,
|
|
@@ -1381,83 +1378,83 @@ const ht = ({
|
|
|
1381
1378
|
showCloseButton: d = !0,
|
|
1382
1379
|
title: i
|
|
1383
1380
|
}) => {
|
|
1384
|
-
const [
|
|
1385
|
-
a ? a() :
|
|
1386
|
-
}, [a]),
|
|
1387
|
-
N ||
|
|
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);
|
|
1383
|
+
}, [a]), _ = _t(() => {
|
|
1384
|
+
N || p(!0), r == null || r();
|
|
1388
1385
|
}, [N, r]);
|
|
1389
|
-
|
|
1386
|
+
J(() => {
|
|
1390
1387
|
if (m) {
|
|
1391
|
-
|
|
1392
|
-
const
|
|
1393
|
-
|
|
1388
|
+
w(!0);
|
|
1389
|
+
const R = setTimeout(() => {
|
|
1390
|
+
u(!0);
|
|
1394
1391
|
}, 50);
|
|
1395
|
-
return () => clearTimeout(
|
|
1392
|
+
return () => clearTimeout(R);
|
|
1396
1393
|
} else {
|
|
1397
|
-
|
|
1398
|
-
const
|
|
1399
|
-
|
|
1394
|
+
u(!1);
|
|
1395
|
+
const R = setTimeout(() => {
|
|
1396
|
+
w(!1);
|
|
1400
1397
|
}, 300);
|
|
1401
|
-
return () => clearTimeout(
|
|
1398
|
+
return () => clearTimeout(R);
|
|
1402
1399
|
}
|
|
1403
|
-
}, [m]),
|
|
1404
|
-
const
|
|
1405
|
-
|
|
1400
|
+
}, [m]), J(() => {
|
|
1401
|
+
const R = (V) => {
|
|
1402
|
+
V.key === "Escape" && b();
|
|
1406
1403
|
};
|
|
1407
|
-
return m ? (document.addEventListener("keydown",
|
|
1408
|
-
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";
|
|
1409
1406
|
};
|
|
1410
|
-
}, [m,
|
|
1411
|
-
const x = (
|
|
1412
|
-
c &&
|
|
1413
|
-
},
|
|
1414
|
-
let
|
|
1415
|
-
|
|
1416
|
-
if (ot(
|
|
1417
|
-
if (
|
|
1418
|
-
|
|
1419
|
-
else if (
|
|
1420
|
-
|
|
1421
|
-
else if (
|
|
1422
|
-
|
|
1423
|
-
const
|
|
1424
|
-
|
|
1425
|
-
} else
|
|
1426
|
-
}),
|
|
1427
|
-
children: /* @__PURE__ */
|
|
1428
|
-
|
|
1429
|
-
|
|
1407
|
+
}, [m, b]);
|
|
1408
|
+
const x = (R) => {
|
|
1409
|
+
c && R.target === R.currentTarget && b();
|
|
1410
|
+
}, E = I.Children.toArray(l);
|
|
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);
|
|
1423
|
+
}), k && ($ ? $ = rt($, {
|
|
1424
|
+
children: /* @__PURE__ */ v(jt, { children: [
|
|
1425
|
+
$.props.children,
|
|
1426
|
+
k
|
|
1430
1427
|
] })
|
|
1431
|
-
}) :
|
|
1432
|
-
const
|
|
1428
|
+
}) : $ = /* @__PURE__ */ e($t, { children: k }));
|
|
1429
|
+
const z = [
|
|
1433
1430
|
"clarity-offcanvas",
|
|
1434
1431
|
n,
|
|
1435
1432
|
`clarity-offcanvas--${s}`,
|
|
1436
1433
|
o && `clarity-offcanvas--${o}`,
|
|
1437
|
-
|
|
1438
|
-
].filter(Boolean).join(" "),
|
|
1434
|
+
y ? "clarity-offcanvas--open" : "clarity-offcanvas--closed"
|
|
1435
|
+
].filter(Boolean).join(" "), H = [
|
|
1439
1436
|
"clarity-offcanvas-overlay",
|
|
1440
|
-
|
|
1437
|
+
y ? "clarity-offcanvas-overlay--visible" : ""
|
|
1441
1438
|
].filter(Boolean).join(" ");
|
|
1442
|
-
return /* @__PURE__ */
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
/* @__PURE__ */ e("div", { className:
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1439
|
+
return /* @__PURE__ */ v(Mt.Provider, { value: { onClose: b, variant: o, showCloseButton: d, placement: s, title: i }, children: [
|
|
1440
|
+
C && rt(C, { onClick: _, variant: o }),
|
|
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,
|
|
1445
|
+
$ && /* @__PURE__ */ e("div", { className: "clarity-offcanvas-scroll-indicator" }),
|
|
1449
1446
|
" ",
|
|
1450
|
-
|
|
1447
|
+
$
|
|
1451
1448
|
] }) })
|
|
1452
1449
|
] });
|
|
1453
1450
|
};
|
|
1454
|
-
ht.Header =
|
|
1455
|
-
ht.Content =
|
|
1456
|
-
ht.Footer =
|
|
1457
|
-
ht.Trigger =
|
|
1458
|
-
ht.Close =
|
|
1451
|
+
ht.Header = Ft;
|
|
1452
|
+
ht.Content = Gt;
|
|
1453
|
+
ht.Footer = $t;
|
|
1454
|
+
ht.Trigger = Ut;
|
|
1455
|
+
ht.Close = Xt;
|
|
1459
1456
|
ht.displayName = "Offcanvas";
|
|
1460
|
-
const
|
|
1457
|
+
const Oe = I.forwardRef(({
|
|
1461
1458
|
type: t,
|
|
1462
1459
|
variant: a = "primary",
|
|
1463
1460
|
size: r = "medium",
|
|
@@ -1465,63 +1462,62 @@ const We = W.forwardRef(({
|
|
|
1465
1462
|
helperText: n,
|
|
1466
1463
|
helper: o = !1,
|
|
1467
1464
|
helperPosition: s = "middle-right",
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
className: y = "",
|
|
1465
|
+
error: c = !1,
|
|
1466
|
+
errorMessage: d,
|
|
1467
|
+
labelPosition: i = "right",
|
|
1468
|
+
className: f = "",
|
|
1473
1469
|
disabled: p = !1,
|
|
1474
|
-
checked:
|
|
1475
|
-
id:
|
|
1476
|
-
...
|
|
1477
|
-
},
|
|
1478
|
-
const
|
|
1470
|
+
checked: y,
|
|
1471
|
+
id: u,
|
|
1472
|
+
...h
|
|
1473
|
+
}, w) => {
|
|
1474
|
+
const N = u || `check-input-${Math.random().toString(36).substr(2, 9)}`, m = [
|
|
1479
1475
|
"clarity-check-input-wrapper",
|
|
1480
|
-
`clarity-check-input-wrapper--${
|
|
1476
|
+
`clarity-check-input-wrapper--${i}`,
|
|
1481
1477
|
p && "clarity-check-input-wrapper--disabled",
|
|
1482
|
-
|
|
1483
|
-
].filter(Boolean).join(" "),
|
|
1478
|
+
c && "clarity-check-input-wrapper--error"
|
|
1479
|
+
].filter(Boolean).join(" "), b = [
|
|
1484
1480
|
"clarity-check-input",
|
|
1485
1481
|
`clarity-check-input--${t}`,
|
|
1486
1482
|
`clarity-check-input--${r}`,
|
|
1487
1483
|
a && `clarity-check-input--${a}`,
|
|
1488
|
-
|
|
1484
|
+
c && "clarity-check-input--error",
|
|
1489
1485
|
p && "clarity-check-input--disabled",
|
|
1490
|
-
|
|
1491
|
-
].filter(Boolean).join(" "),
|
|
1486
|
+
f
|
|
1487
|
+
].filter(Boolean).join(" "), _ = [
|
|
1492
1488
|
"clarity-check-input__label",
|
|
1493
1489
|
`clarity-check-input__label--${r}`,
|
|
1494
1490
|
p && "clarity-check-input__label--disabled"
|
|
1495
|
-
].filter(Boolean).join(" "),
|
|
1491
|
+
].filter(Boolean).join(" "), x = s != null && s.endsWith("left") ? "left" : "right", E = (T, L) => {
|
|
1496
1492
|
if (!o) return null;
|
|
1497
|
-
const
|
|
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;
|
|
1498
1494
|
return /* @__PURE__ */ e(
|
|
1499
1495
|
yt,
|
|
1500
1496
|
{
|
|
1501
|
-
content:
|
|
1502
|
-
position:
|
|
1497
|
+
content: k,
|
|
1498
|
+
position: T === "middle" ? L === "left" ? "left" : "right" : T === "top" ? L === "left" ? "top-left" : "top-right" : L === "left" ? "bottom-left" : "bottom-right",
|
|
1503
1499
|
trigger: "hover",
|
|
1504
|
-
variant:
|
|
1505
|
-
plain:
|
|
1506
|
-
bgColor:
|
|
1507
|
-
textColor:
|
|
1508
|
-
children: /* @__PURE__ */ e("button", { type: "button", className: "clarity-check-input__helper-icon", "aria-label": "Helper", children: /* @__PURE__ */ e(pt, { size:
|
|
1500
|
+
variant: H || a,
|
|
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 }) })
|
|
1509
1505
|
}
|
|
1510
1506
|
);
|
|
1511
|
-
},
|
|
1507
|
+
}, C = /* @__PURE__ */ v("label", { className: m, htmlFor: N, children: [
|
|
1512
1508
|
/* @__PURE__ */ e(
|
|
1513
1509
|
"input",
|
|
1514
1510
|
{
|
|
1515
|
-
ref:
|
|
1516
|
-
id:
|
|
1511
|
+
ref: w,
|
|
1512
|
+
id: N,
|
|
1517
1513
|
type: t,
|
|
1518
|
-
className:
|
|
1514
|
+
className: b,
|
|
1519
1515
|
disabled: p,
|
|
1520
|
-
checked:
|
|
1521
|
-
...
|
|
1516
|
+
checked: y,
|
|
1517
|
+
...h
|
|
1522
1518
|
}
|
|
1523
1519
|
),
|
|
1524
|
-
/* @__PURE__ */
|
|
1520
|
+
/* @__PURE__ */ v("div", { className: "clarity-check-input__custom", children: [
|
|
1525
1521
|
t === "checkbox" && /* @__PURE__ */ e(
|
|
1526
1522
|
"svg",
|
|
1527
1523
|
{
|
|
@@ -1543,112 +1539,111 @@ const We = W.forwardRef(({
|
|
|
1543
1539
|
),
|
|
1544
1540
|
t === "radio" && /* @__PURE__ */ e("div", { className: "clarity-check-input__radio-dot" })
|
|
1545
1541
|
] }),
|
|
1546
|
-
l && /* @__PURE__ */ e("span", { className:
|
|
1542
|
+
l && /* @__PURE__ */ e("span", { className: _, children: l })
|
|
1547
1543
|
] });
|
|
1548
|
-
return /* @__PURE__ */
|
|
1549
|
-
o && (s == null ? void 0 : s.startsWith("top")) && /* @__PURE__ */ e("div", { className: `clarity-check-input__helper-row clarity-check-input__helper-row--top clarity-check-input__helper-row--${
|
|
1550
|
-
o && (s != null && s.startsWith("middle")) ? /* @__PURE__ */
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
] }) :
|
|
1555
|
-
o && (s == null ? void 0 : s.startsWith("bottom")) && /* @__PURE__ */ e("div", { className: `clarity-check-input__helper-row clarity-check-input__helper-row--bottom clarity-check-input__helper-row--${
|
|
1556
|
-
(n ||
|
|
1544
|
+
return /* @__PURE__ */ v("div", { className: "clarity-check-input-container", children: [
|
|
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) }),
|
|
1546
|
+
o && (s != null && s.startsWith("middle")) ? /* @__PURE__ */ v("div", { className: `clarity-check-input__middle-row clarity-check-input__middle-row--${x}`, children: [
|
|
1547
|
+
x === "left" && E("middle", x),
|
|
1548
|
+
C,
|
|
1549
|
+
x === "right" && E("middle", x)
|
|
1550
|
+
] }) : C,
|
|
1551
|
+
o && (s == null ? void 0 : s.startsWith("bottom")) && /* @__PURE__ */ e("div", { className: `clarity-check-input__helper-row clarity-check-input__helper-row--bottom clarity-check-input__helper-row--${x}`, children: E("bottom", x) }),
|
|
1552
|
+
(n || c && d) && /* @__PURE__ */ e("div", { className: "clarity-check-input__helper-text", children: c && d ? d : n })
|
|
1557
1553
|
] });
|
|
1558
1554
|
});
|
|
1559
|
-
|
|
1560
|
-
const
|
|
1555
|
+
Oe.displayName = "CheckInput";
|
|
1556
|
+
const We = I.forwardRef(({
|
|
1561
1557
|
variant: t = "primary",
|
|
1562
1558
|
size: a = "medium",
|
|
1563
1559
|
label: r,
|
|
1564
1560
|
helper: l = !1,
|
|
1565
1561
|
helperPosition: n = "middle-right",
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
checked: y,
|
|
1562
|
+
error: o = !1,
|
|
1563
|
+
errorMessage: s,
|
|
1564
|
+
labelPosition: c = "right",
|
|
1565
|
+
className: d = "",
|
|
1566
|
+
disabled: i = !1,
|
|
1567
|
+
checked: f,
|
|
1573
1568
|
id: p,
|
|
1574
|
-
...
|
|
1575
|
-
},
|
|
1576
|
-
const
|
|
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
|
-
`clarity-input-switch-wrapper--${
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
].filter(Boolean).join(" "),
|
|
1573
|
+
`clarity-input-switch-wrapper--${c}`,
|
|
1574
|
+
i && "clarity-input-switch-wrapper--disabled",
|
|
1575
|
+
o && "clarity-input-switch-wrapper--error"
|
|
1576
|
+
].filter(Boolean).join(" "), N = [
|
|
1582
1577
|
"clarity-input-switch",
|
|
1583
1578
|
`clarity-input-switch--${a}`,
|
|
1584
1579
|
t && `clarity-input-switch--${t}`,
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
].filter(Boolean).join(" "),
|
|
1580
|
+
o && "clarity-input-switch--error",
|
|
1581
|
+
i && "clarity-input-switch--disabled",
|
|
1582
|
+
d
|
|
1583
|
+
].filter(Boolean).join(" "), m = [
|
|
1589
1584
|
"clarity-input-switch__label",
|
|
1590
1585
|
`clarity-input-switch__label--${a}`,
|
|
1591
1586
|
t && `clarity-input-switch__label--${t}`,
|
|
1592
|
-
|
|
1593
|
-
].filter(Boolean).join(" "),
|
|
1587
|
+
i && "clarity-input-switch__label--disabled"
|
|
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:
|
|
1600
|
-
position:
|
|
1594
|
+
content: L,
|
|
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
|
-
variant:
|
|
1603
|
-
plain:
|
|
1604
|
-
bgColor:
|
|
1605
|
-
textColor:
|
|
1606
|
-
children: /* @__PURE__ */ e("button", { type: "button", className: "clarity-input-switch__helper-icon", "aria-label": "Helper", children: /* @__PURE__ */ e(pt, { size:
|
|
1597
|
+
variant: k || t,
|
|
1598
|
+
plain: $,
|
|
1599
|
+
bgColor: z,
|
|
1600
|
+
textColor: H,
|
|
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
|
-
},
|
|
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
|
-
className:
|
|
1617
|
-
disabled:
|
|
1618
|
-
checked:
|
|
1619
|
-
...
|
|
1611
|
+
className: N,
|
|
1612
|
+
disabled: i,
|
|
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
|
-
r && /* @__PURE__ */ e("span", { className:
|
|
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
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
] }) :
|
|
1632
|
-
l && (n == null ? void 0 : n.startsWith("bottom")) && /* @__PURE__ */ e("div", { className: `clarity-input-switch__helper-row clarity-input-switch__helper-row--bottom clarity-input-switch__helper-row--${
|
|
1633
|
-
|
|
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),
|
|
1624
|
+
x,
|
|
1625
|
+
b === "right" && _("middle", b)
|
|
1626
|
+
] }) : x,
|
|
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) }),
|
|
1628
|
+
o && s && /* @__PURE__ */ e("div", { className: "clarity-input-switch__error-text", children: s })
|
|
1634
1629
|
] });
|
|
1635
1630
|
});
|
|
1636
|
-
|
|
1637
|
-
const
|
|
1638
|
-
const t = dt(
|
|
1631
|
+
We.displayName = "InputSwitch";
|
|
1632
|
+
const Yt = ct(null), wt = () => {
|
|
1633
|
+
const t = dt(Yt);
|
|
1639
1634
|
if (!t)
|
|
1640
1635
|
throw new Error("useConfirmationDialog must be used within a ConfirmationDialog provider");
|
|
1641
1636
|
return t;
|
|
1642
|
-
},
|
|
1637
|
+
}, Zt = ({ children: t, className: a = "" }) => {
|
|
1643
1638
|
const { variant: r } = wt(), l = `clarity-confirmation-dialog-header ${a} clarity-confirmation-dialog-header--${r}`;
|
|
1644
1639
|
return /* @__PURE__ */ e("div", { className: l, children: t });
|
|
1645
1640
|
};
|
|
1646
|
-
|
|
1647
|
-
const
|
|
1648
|
-
|
|
1649
|
-
const
|
|
1650
|
-
|
|
1651
|
-
const
|
|
1641
|
+
Zt.displayName = "ConfirmationDialog.Header";
|
|
1642
|
+
const qt = ({ children: t, className: a = "" }) => /* @__PURE__ */ e("div", { className: `clarity-confirmation-dialog-content ${a}`, children: t });
|
|
1643
|
+
qt.displayName = "ConfirmationDialog.Content";
|
|
1644
|
+
const Jt = ({ children: t, className: a = "" }) => /* @__PURE__ */ e("div", { className: `clarity-confirmation-dialog-footer ${a}`, children: t });
|
|
1645
|
+
Jt.displayName = "ConfirmationDialog.Footer";
|
|
1646
|
+
const Qt = ({ children: t }) => {
|
|
1652
1647
|
const { onOpen: a } = wt();
|
|
1653
1648
|
return rt(t, {
|
|
1654
1649
|
onClick: (r) => {
|
|
@@ -1657,8 +1652,8 @@ const Kt = ({ children: t }) => {
|
|
|
1657
1652
|
}
|
|
1658
1653
|
});
|
|
1659
1654
|
};
|
|
1660
|
-
|
|
1661
|
-
const
|
|
1655
|
+
Qt.displayName = "ConfirmationDialog.Trigger";
|
|
1656
|
+
const Kt = ({ children: t }) => {
|
|
1662
1657
|
const { onClose: a } = wt();
|
|
1663
1658
|
return rt(t, {
|
|
1664
1659
|
onClick: (r) => {
|
|
@@ -1667,8 +1662,8 @@ const Pt = ({ children: t }) => {
|
|
|
1667
1662
|
}
|
|
1668
1663
|
});
|
|
1669
1664
|
};
|
|
1670
|
-
|
|
1671
|
-
const
|
|
1665
|
+
Kt.displayName = "ConfirmationDialog.Close";
|
|
1666
|
+
const Pt = ({ children: t }) => {
|
|
1672
1667
|
const { onConfirm: a } = wt();
|
|
1673
1668
|
return rt(t, {
|
|
1674
1669
|
onClick: (r) => {
|
|
@@ -1677,7 +1672,7 @@ const te = ({ children: t }) => {
|
|
|
1677
1672
|
}
|
|
1678
1673
|
});
|
|
1679
1674
|
};
|
|
1680
|
-
|
|
1675
|
+
Pt.displayName = "ConfirmationDialog.Confirm";
|
|
1681
1676
|
const ut = ({
|
|
1682
1677
|
isOpen: t,
|
|
1683
1678
|
onClose: a,
|
|
@@ -1686,39 +1681,39 @@ 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
|
-
ut.Header =
|
|
1715
|
-
ut.Content =
|
|
1716
|
-
ut.Footer =
|
|
1717
|
-
ut.Trigger =
|
|
1718
|
-
ut.Close =
|
|
1719
|
-
ut.Confirm =
|
|
1709
|
+
ut.Header = Zt;
|
|
1710
|
+
ut.Content = qt;
|
|
1711
|
+
ut.Footer = Jt;
|
|
1712
|
+
ut.Trigger = Qt;
|
|
1713
|
+
ut.Close = Kt;
|
|
1714
|
+
ut.Confirm = Pt;
|
|
1720
1715
|
ut.displayName = "ConfirmationDialog";
|
|
1721
|
-
const
|
|
1716
|
+
const ra = ({
|
|
1722
1717
|
variant: t = "primary",
|
|
1723
1718
|
size: a = "medium",
|
|
1724
1719
|
disabled: r = !1,
|
|
@@ -1729,36 +1724,36 @@ const la = ({
|
|
|
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
|
}
|
|
1760
1755
|
);
|
|
1761
|
-
},
|
|
1756
|
+
}, la = ({
|
|
1762
1757
|
variant: t = "primary",
|
|
1763
1758
|
product: a,
|
|
1764
1759
|
tone: r,
|
|
@@ -1769,20 +1764,20 @@ const la = ({
|
|
|
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
|
-
|
|
1782
|
-
].filter(Boolean).join(" "), m = (
|
|
1783
|
-
const x = parseInt(
|
|
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
|
|
1777
|
+
].filter(Boolean).join(" "), m = (_) => {
|
|
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,30 +1786,30 @@ const la = ({
|
|
|
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
|
);
|
|
1812
|
-
},
|
|
1813
|
-
const t = dt(
|
|
1807
|
+
}, te = ct(void 0), ee = () => {
|
|
1808
|
+
const t = dt(te);
|
|
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 la = ({
|
|
|
1825
1820
|
className: c = "",
|
|
1826
1821
|
children: d,
|
|
1827
1822
|
onSelect: i,
|
|
1828
|
-
...
|
|
1823
|
+
...f
|
|
1829
1824
|
}) => {
|
|
1830
|
-
const [
|
|
1831
|
-
let
|
|
1832
|
-
o ?
|
|
1833
|
-
},
|
|
1834
|
-
|
|
1825
|
+
const [p, y] = A(() => n ? Array.isArray(n) ? n : [n] : []), u = (E) => {
|
|
1826
|
+
let C;
|
|
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(" "),
|
|
1839
|
-
const
|
|
1840
|
-
return
|
|
1841
|
-
},
|
|
1833
|
+
].filter(Boolean).join(" "), b = (E) => {
|
|
1834
|
+
const C = parseInt(E);
|
|
1835
|
+
return C >= 800 ? "900" : C >= 700 ? "800" : C >= 600 ? "700" : C >= 500 ? "600" : C >= 400 ? "500" : C >= 300 ? "400" : C >= 200 ? "300" : "200";
|
|
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,27 +1847,27 @@ const la = ({
|
|
|
1852
1847
|
hoverTone: l,
|
|
1853
1848
|
flush: s
|
|
1854
1849
|
};
|
|
1855
|
-
return /* @__PURE__ */ e(
|
|
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 = "",
|
|
1860
1855
|
children: l,
|
|
1861
1856
|
...n
|
|
1862
1857
|
}) => {
|
|
1863
|
-
const { activeKeys: o } =
|
|
1858
|
+
const { activeKeys: o } = ee(), s = "clarity-accordion", c = o.includes(t), d = [
|
|
1864
1859
|
`${s}__item`,
|
|
1865
1860
|
c && `${s}__item--active`,
|
|
1866
1861
|
a && `${s}__item--disabled`,
|
|
1867
1862
|
r
|
|
1868
1863
|
].filter(Boolean).join(" ");
|
|
1869
|
-
return /* @__PURE__ */ e("div", { className: d, ...n, children:
|
|
1864
|
+
return /* @__PURE__ */ e("div", { className: d, ...n, children: I.Children.map(l, (i) => I.isValidElement(i) ? I.cloneElement(i, {
|
|
1870
1865
|
...i.props,
|
|
1871
1866
|
eventKey: t,
|
|
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 la = ({
|
|
|
1881
1876
|
isActive: o = !1,
|
|
1882
1877
|
...s
|
|
1883
1878
|
}) => {
|
|
1884
|
-
const { toggleItem: c } =
|
|
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 la = ({
|
|
|
1909
1904
|
]
|
|
1910
1905
|
}
|
|
1911
1906
|
);
|
|
1912
|
-
},
|
|
1907
|
+
}, Ve = ({
|
|
1913
1908
|
className: t = "",
|
|
1914
1909
|
children: a,
|
|
1915
1910
|
eventKey: r,
|
|
@@ -1928,19 +1923,19 @@ const la = ({
|
|
|
1928
1923
|
children: /* @__PURE__ */ e("div", { className: [`${o}__body`, t].filter(Boolean).join(" "), ...n, children: a })
|
|
1929
1924
|
}
|
|
1930
1925
|
);
|
|
1931
|
-
},
|
|
1932
|
-
Item:
|
|
1933
|
-
Header:
|
|
1934
|
-
Body:
|
|
1935
|
-
}),
|
|
1926
|
+
}, na = Object.assign(Ie, {
|
|
1927
|
+
Item: He,
|
|
1928
|
+
Header: De,
|
|
1929
|
+
Body: Ve
|
|
1930
|
+
}), ae = ct(
|
|
1936
1931
|
void 0
|
|
1937
|
-
),
|
|
1938
|
-
const t = dt(
|
|
1932
|
+
), re = () => {
|
|
1933
|
+
const t = dt(ae);
|
|
1939
1934
|
if (!t)
|
|
1940
1935
|
throw new Error("useDropdown must be used within a DropdownProvider");
|
|
1941
1936
|
return t;
|
|
1942
|
-
},
|
|
1943
|
-
const { setIsOpen: a, triggerRef: r } =
|
|
1937
|
+
}, Ae = ({ children: t }) => {
|
|
1938
|
+
const { setIsOpen: a, triggerRef: r } = re();
|
|
1944
1939
|
return /* @__PURE__ */ e(
|
|
1945
1940
|
"button",
|
|
1946
1941
|
{
|
|
@@ -1953,43 +1948,43 @@ const la = ({
|
|
|
1953
1948
|
}
|
|
1954
1949
|
);
|
|
1955
1950
|
}, Me = ({ children: t }) => {
|
|
1956
|
-
const { isOpen: a, contentRef: r, styles: l } =
|
|
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
|
-
}, [l, a]),
|
|
1986
|
-
const
|
|
1987
|
-
c.current && !c.current.contains(
|
|
1980
|
+
}, [l, a]), J(() => {
|
|
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
|
-
}, []), /* @__PURE__ */ e(
|
|
1987
|
+
}, []), /* @__PURE__ */ e(ae.Provider, { value: { isOpen: l, setIsOpen: n, triggerRef: d, contentRef: i, styles: o }, children: /* @__PURE__ */ e(
|
|
1993
1988
|
"div",
|
|
1994
1989
|
{
|
|
1995
1990
|
ref: c,
|
|
@@ -1999,12 +1994,12 @@ const la = ({
|
|
|
1999
1994
|
}
|
|
2000
1995
|
) });
|
|
2001
1996
|
};
|
|
2002
|
-
vt.Trigger =
|
|
1997
|
+
vt.Trigger = Ae;
|
|
2003
1998
|
vt.Content = Me;
|
|
2004
|
-
vt.Menu =
|
|
2005
|
-
vt.Item =
|
|
2006
|
-
vt.Separator =
|
|
2007
|
-
const
|
|
1999
|
+
vt.Menu = ze;
|
|
2000
|
+
vt.Item = Fe;
|
|
2001
|
+
vt.Separator = Ge;
|
|
2002
|
+
const xt = ({
|
|
2008
2003
|
as: t = "button",
|
|
2009
2004
|
id: a,
|
|
2010
2005
|
children: r,
|
|
@@ -2037,8 +2032,8 @@ const kt = ({
|
|
|
2037
2032
|
}
|
|
2038
2033
|
);
|
|
2039
2034
|
};
|
|
2040
|
-
|
|
2041
|
-
const
|
|
2035
|
+
xt.displayName = "Tabs.Tab";
|
|
2036
|
+
const le = ({
|
|
2042
2037
|
children: t,
|
|
2043
2038
|
activeTab: a,
|
|
2044
2039
|
onTabChange: r,
|
|
@@ -2054,29 +2049,29 @@ const ne = ({
|
|
|
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:
|
|
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
|
-
|
|
2073
|
-
|
|
2074
|
-
const
|
|
2075
|
-
const t = dt(
|
|
2067
|
+
le.Tab = xt;
|
|
2068
|
+
le.displayName = "Tabs";
|
|
2069
|
+
const ne = ct(null), bt = () => {
|
|
2070
|
+
const t = dt(ne);
|
|
2076
2071
|
if (!t)
|
|
2077
2072
|
throw new Error("useCommand must be used within a Command provider");
|
|
2078
2073
|
return t;
|
|
2079
|
-
},
|
|
2074
|
+
}, ie = ({
|
|
2080
2075
|
children: t,
|
|
2081
2076
|
className: a = "",
|
|
2082
2077
|
variant: r = "secondary",
|
|
@@ -2084,11 +2079,11 @@ const ie = ct(null), bt = () => {
|
|
|
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,45 +2093,45 @@ const ie = ct(null), bt = () => {
|
|
|
2098
2093
|
empty: l,
|
|
2099
2094
|
inputPlaceholder: n
|
|
2100
2095
|
},
|
|
2101
|
-
isOpen:
|
|
2102
|
-
setIsOpen:
|
|
2103
|
-
}), [s, d, r, l, n,
|
|
2104
|
-
return /* @__PURE__ */ e(
|
|
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
|
-
|
|
2107
|
-
const
|
|
2108
|
-
const { setIsOpen: l, variant: n } = bt(), [o, s] =
|
|
2109
|
-
|
|
2101
|
+
ie.displayName = "Command";
|
|
2102
|
+
const se = ({ placeholder: t = "Search...", variant: a, onClick: r }) => {
|
|
2103
|
+
const { setIsOpen: l, variant: n } = bt(), [o, s] = A(!1);
|
|
2104
|
+
J(() => {
|
|
2110
2105
|
s(/Mac|iPod|iPhone|iPad/.test(navigator.platform));
|
|
2111
2106
|
}, []);
|
|
2112
2107
|
const d = [
|
|
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
|
] })
|
|
2124
2119
|
] });
|
|
2125
2120
|
};
|
|
2126
|
-
|
|
2127
|
-
const
|
|
2121
|
+
se.displayName = "Command.Button";
|
|
2122
|
+
const oe = ({ children: t }) => {
|
|
2128
2123
|
const { isOpen: a, setIsOpen: r, variant: l } = bt();
|
|
2129
|
-
return
|
|
2124
|
+
return J(() => {
|
|
2130
2125
|
const n = (o) => {
|
|
2131
2126
|
o.key === "k" && (o.metaKey || o.ctrlKey) && (o.preventDefault(), r(!a));
|
|
2132
2127
|
};
|
|
2133
2128
|
return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
|
|
2134
2129
|
}, [a, r]), /* @__PURE__ */ e(mt, { isOpen: a, onClose: () => r(!1), size: "large", closeOnOverlayClick: !0, children: /* @__PURE__ */ e("div", { className: `clarity-command--${l}`, children: t }) });
|
|
2135
2130
|
};
|
|
2136
|
-
|
|
2137
|
-
const
|
|
2138
|
-
const { searchTerm: r, setSearchTerm: l, variant: n, texts: o, isOpen: s } = bt(), c =
|
|
2139
|
-
|
|
2131
|
+
oe.displayName = "Command.Dialog";
|
|
2132
|
+
const ce = ({ className: t = "", ...a }) => {
|
|
2133
|
+
const { searchTerm: r, setSearchTerm: l, variant: n, texts: o, isOpen: s } = bt(), c = et(null);
|
|
2134
|
+
J(() => {
|
|
2140
2135
|
var i;
|
|
2141
2136
|
s && ((i = c.current) == null || i.focus());
|
|
2142
2137
|
}, [s]);
|
|
@@ -2157,75 +2152,75 @@ const de = ({ className: t = "", ...a }) => {
|
|
|
2157
2152
|
}
|
|
2158
2153
|
) });
|
|
2159
2154
|
};
|
|
2160
|
-
|
|
2161
|
-
const
|
|
2155
|
+
ce.displayName = "Command.Input";
|
|
2156
|
+
const de = ({ children: t, className: a = "", ...r }) => {
|
|
2162
2157
|
const { searchTerm: l } = bt();
|
|
2163
2158
|
let n = !1;
|
|
2164
|
-
const o = (d) =>
|
|
2165
|
-
var
|
|
2166
|
-
if (!
|
|
2167
|
-
const
|
|
2168
|
-
if (
|
|
2159
|
+
const o = (d) => I.Children.toArray(d).map((i) => {
|
|
2160
|
+
var p;
|
|
2161
|
+
if (!I.isValidElement(i)) return i;
|
|
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
|
|
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
|
-
!n && /* @__PURE__ */ e(
|
|
2175
|
+
!n && /* @__PURE__ */ e(kt, {})
|
|
2181
2176
|
] });
|
|
2182
2177
|
};
|
|
2183
|
-
|
|
2184
|
-
const
|
|
2178
|
+
de.displayName = "Command.List";
|
|
2179
|
+
const kt = ({ children: t, className: a = "", ...r }) => {
|
|
2185
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
|
-
|
|
2189
|
-
const
|
|
2183
|
+
kt.displayName = "Command.Empty";
|
|
2184
|
+
const me = ({ children: t, className: a = "", ...r }) => {
|
|
2190
2185
|
const l = ["clarity-command-group", a].filter(Boolean).join(" ");
|
|
2191
2186
|
return /* @__PURE__ */ e("div", { className: l, ...r, children: t });
|
|
2192
2187
|
};
|
|
2193
|
-
|
|
2194
|
-
const
|
|
2188
|
+
me.displayName = "Command.Group";
|
|
2189
|
+
const ue = ({ children: t, className: a = "", ...r }) => {
|
|
2195
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
|
-
|
|
2199
|
-
const
|
|
2193
|
+
ue.displayName = "Command.Item";
|
|
2194
|
+
const fe = ({ className: t = "", ...a }) => {
|
|
2200
2195
|
const r = ["clarity-command-separator", t].filter(Boolean).join(" ");
|
|
2201
2196
|
return /* @__PURE__ */ e("hr", { className: r, ...a });
|
|
2202
2197
|
};
|
|
2203
|
-
|
|
2204
|
-
const
|
|
2198
|
+
fe.displayName = "Command.Separator";
|
|
2199
|
+
const pe = ({ children: t, className: a = "", ...r }) => {
|
|
2205
2200
|
const l = ["clarity-command-shortcut", a].filter(Boolean).join(" ");
|
|
2206
2201
|
return /* @__PURE__ */ e("span", { className: l, ...r, children: t });
|
|
2207
2202
|
};
|
|
2208
|
-
|
|
2209
|
-
const
|
|
2210
|
-
Button:
|
|
2211
|
-
Dialog:
|
|
2212
|
-
Input:
|
|
2213
|
-
List:
|
|
2214
|
-
Empty:
|
|
2215
|
-
Group:
|
|
2216
|
-
Item:
|
|
2217
|
-
Separator:
|
|
2218
|
-
Shortcut:
|
|
2219
|
-
}),
|
|
2203
|
+
pe.displayName = "Command.Shortcut";
|
|
2204
|
+
const ia = Object.assign(ie, {
|
|
2205
|
+
Button: se,
|
|
2206
|
+
Dialog: oe,
|
|
2207
|
+
Input: ce,
|
|
2208
|
+
List: de,
|
|
2209
|
+
Empty: kt,
|
|
2210
|
+
Group: me,
|
|
2211
|
+
Item: ue,
|
|
2212
|
+
Separator: fe,
|
|
2213
|
+
Shortcut: pe
|
|
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
|
] }) });
|
|
2228
|
-
},
|
|
2223
|
+
}, sa = ({
|
|
2229
2224
|
variant: t = "secondary",
|
|
2230
2225
|
columns: a,
|
|
2231
2226
|
data: r,
|
|
@@ -2234,58 +2229,58 @@ const sa = Object.assign(se, {
|
|
|
2234
2229
|
isLoading: o = !1,
|
|
2235
2230
|
pagination: s
|
|
2236
2231
|
}) => {
|
|
2237
|
-
const [c, d] =
|
|
2238
|
-
m.sortable && (c === m.key ?
|
|
2239
|
-
},
|
|
2240
|
-
const
|
|
2241
|
-
return
|
|
2242
|
-
}), [r, c, i]),
|
|
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];
|
|
2236
|
+
return _ < x ? i === "asc" ? -1 : 1 : _ > x ? i === "asc" ? 1 : -1 : 0;
|
|
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:
|
|
2250
|
-
onPageChange:
|
|
2244
|
+
totalPages: b,
|
|
2245
|
+
onPageChange: _,
|
|
2251
2246
|
totalItems: x,
|
|
2252
|
-
itemsPerPage:
|
|
2253
|
-
position:
|
|
2247
|
+
itemsPerPage: E,
|
|
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
|
-
if (x <=
|
|
2252
|
+
if (x <= E)
|
|
2258
2253
|
return null;
|
|
2259
|
-
const
|
|
2260
|
-
const
|
|
2261
|
-
if (
|
|
2262
|
-
for (let
|
|
2254
|
+
const T = (m - 1) * E + 1, L = Math.min(m * E, x), $ = () => {
|
|
2255
|
+
const k = [];
|
|
2256
|
+
if (b <= 5)
|
|
2257
|
+
for (let H = 1; H <= b; H++) k.push(H);
|
|
2263
2258
|
else if (m <= 3) {
|
|
2264
|
-
for (let
|
|
2265
|
-
|
|
2266
|
-
} else if (m >=
|
|
2267
|
-
|
|
2268
|
-
for (let
|
|
2259
|
+
for (let H = 1; H <= 4; H++) k.push(H);
|
|
2260
|
+
k.push("..."), k.push(b);
|
|
2261
|
+
} else if (m >= b - 2) {
|
|
2262
|
+
k.push(1), k.push("...");
|
|
2263
|
+
for (let H = b - 3; H <= b; H++) k.push(H);
|
|
2269
2264
|
} else
|
|
2270
|
-
|
|
2271
|
-
return
|
|
2265
|
+
k.push(1), k.push("..."), k.push(m - 1), k.push(m), k.push(m + 1), k.push("..."), k.push(b);
|
|
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
|
{
|
|
2287
2282
|
className: "pagination-button",
|
|
2288
|
-
onClick: () =>
|
|
2283
|
+
onClick: () => _(1),
|
|
2289
2284
|
disabled: m === 1,
|
|
2290
2285
|
"aria-label": "Primeira página",
|
|
2291
2286
|
children: "«"
|
|
@@ -2295,28 +2290,28 @@ const sa = Object.assign(se, {
|
|
|
2295
2290
|
"button",
|
|
2296
2291
|
{
|
|
2297
2292
|
className: "pagination-button",
|
|
2298
|
-
onClick: () =>
|
|
2293
|
+
onClick: () => _(m - 1),
|
|
2299
2294
|
disabled: m === 1,
|
|
2300
2295
|
"aria-label": "Página anterior",
|
|
2301
2296
|
children: "‹"
|
|
2302
2297
|
}
|
|
2303
2298
|
),
|
|
2304
|
-
|
|
2299
|
+
$().map((k, z) => /* @__PURE__ */ e(
|
|
2305
2300
|
"button",
|
|
2306
2301
|
{
|
|
2307
|
-
className: `pagination-button ${
|
|
2308
|
-
onClick: () => typeof
|
|
2309
|
-
disabled: typeof
|
|
2310
|
-
children:
|
|
2302
|
+
className: `pagination-button ${k === m ? "active" : ""}`,
|
|
2303
|
+
onClick: () => typeof k == "number" && _(k),
|
|
2304
|
+
disabled: typeof k != "number",
|
|
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
|
-
onClick: () =>
|
|
2319
|
-
disabled: m ===
|
|
2313
|
+
onClick: () => _(m + 1),
|
|
2314
|
+
disabled: m === b,
|
|
2320
2315
|
"aria-label": "Próxima página",
|
|
2321
2316
|
children: "›"
|
|
2322
2317
|
}
|
|
@@ -2325,51 +2320,51 @@ const sa = Object.assign(se, {
|
|
|
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",
|
|
2374
2369
|
size: a = "medium",
|
|
2375
2370
|
color: r,
|
|
@@ -2382,12 +2377,12 @@ const sa = Object.assign(se, {
|
|
|
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 sa = Object.assign(se, {
|
|
|
2412
2407
|
) })
|
|
2413
2408
|
}
|
|
2414
2409
|
);
|
|
2415
|
-
},
|
|
2410
|
+
}, Xe = ({
|
|
2416
2411
|
className: t = "",
|
|
2417
2412
|
noGutters: a,
|
|
2418
2413
|
justify: r,
|
|
@@ -2428,10 +2423,10 @@ const sa = Object.assign(se, {
|
|
|
2428
2423
|
l ? `clarity-row--align-${l}` : "",
|
|
2429
2424
|
t
|
|
2430
2425
|
].filter(Boolean).join(" ");
|
|
2431
|
-
return
|
|
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,38 +2437,38 @@ const Ze = (t) => `${t / 12 * 100}%`, qe = (t) => `${t / 12 * 100}%`, Je = ({
|
|
|
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
|
|
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
|
-
const
|
|
2471
|
+
const ca = {
|
|
2477
2472
|
primary: {
|
|
2478
2473
|
50: "#f0f9ff",
|
|
2479
2474
|
100: "#e0f2fe",
|
|
@@ -2522,7 +2517,7 @@ const da = {
|
|
|
2522
2517
|
800: "#065f46",
|
|
2523
2518
|
900: "#064e3b"
|
|
2524
2519
|
}
|
|
2525
|
-
},
|
|
2520
|
+
}, da = {
|
|
2526
2521
|
xs: "4px",
|
|
2527
2522
|
sm: "8px",
|
|
2528
2523
|
md: "16px",
|
|
@@ -2530,38 +2525,38 @@ const da = {
|
|
|
2530
2525
|
xl: "32px",
|
|
2531
2526
|
"2xl": "48px",
|
|
2532
2527
|
"3xl": "64px"
|
|
2533
|
-
},
|
|
2528
|
+
}, ma = (...t) => t.filter(Boolean).join(" "), ua = () => Math.random().toString(36).substr(2, 9);
|
|
2534
2529
|
export {
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2530
|
+
na as Accordion,
|
|
2531
|
+
Pe as Badge,
|
|
2532
|
+
$e as Box,
|
|
2533
|
+
xe as Button,
|
|
2534
|
+
ta as ButtonGroup,
|
|
2535
|
+
ra as ButtonIcon,
|
|
2536
|
+
la as ButtonLink,
|
|
2542
2537
|
Nt as Card,
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2538
|
+
Oe as CheckInput,
|
|
2539
|
+
qe as Col,
|
|
2540
|
+
ia as Command,
|
|
2546
2541
|
ut as ConfirmationDialog,
|
|
2547
2542
|
vt as Dropdown,
|
|
2548
|
-
|
|
2549
|
-
|
|
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
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2548
|
+
Xe as Row,
|
|
2549
|
+
Ee as Select,
|
|
2550
|
+
oa as Spinner,
|
|
2551
|
+
sa as Table,
|
|
2552
|
+
le as Tabs,
|
|
2553
|
+
Se as Textarea,
|
|
2554
|
+
aa as ToastProvider,
|
|
2560
2555
|
yt as Tooltip,
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2556
|
+
ma as cn,
|
|
2557
|
+
ca as colors,
|
|
2558
|
+
ua as generateId,
|
|
2559
|
+
da as spacing,
|
|
2560
|
+
Tt as typography,
|
|
2561
|
+
ea as useToast
|
|
2567
2562
|
};
|