beth-clarity 1.1.27 → 1.1.29

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