@ishtar-sink/vega 0.0.0-stage → 0.1.0

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.
Files changed (55) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +99 -2
  3. package/dist/autocomplete/autocomplete.d.ts +37 -0
  4. package/dist/badge/badge.d.ts +8 -0
  5. package/dist/brand-logo/brand-logo.d.ts +9 -0
  6. package/dist/button/button.d.ts +11 -0
  7. package/dist/calendar/calendar.d.ts +28 -0
  8. package/dist/card/card.d.ts +9 -0
  9. package/dist/checkbox/checkbox.d.ts +6 -0
  10. package/dist/color-field/color-field.d.ts +20 -0
  11. package/dist/color-field/color-picker.d.ts +42 -0
  12. package/dist/color-field/color.d.ts +11 -0
  13. package/dist/confirm-dialog/confirm-dialog.d.ts +15 -0
  14. package/dist/date-field/date-field.d.ts +38 -0
  15. package/dist/date-time-field/date-time-field.d.ts +33 -0
  16. package/dist/dialog/dialog.d.ts +21 -0
  17. package/dist/empty-state/empty-state.d.ts +10 -0
  18. package/dist/error-state/error-state.d.ts +12 -0
  19. package/dist/form-layout/form-layout.d.ts +17 -0
  20. package/dist/icon-button/icon-button.d.ts +10 -0
  21. package/dist/icons/index.d.ts +2 -0
  22. package/dist/icons/view-icons.d.ts +17 -0
  23. package/dist/index.d.ts +75 -0
  24. package/dist/index.js +2917 -0
  25. package/dist/item-swatch/item-swatch.d.ts +10 -0
  26. package/dist/item-swatch/palette.d.ts +6 -0
  27. package/dist/loading-state/loading-state.d.ts +13 -0
  28. package/dist/menu-button/menu-button.d.ts +26 -0
  29. package/dist/money-field/money-field.d.ts +13 -0
  30. package/dist/money-field/money-mask.d.ts +6 -0
  31. package/dist/page-header/page-header.d.ts +20 -0
  32. package/dist/period-field/period-field.d.ts +47 -0
  33. package/dist/period-field/period.d.ts +31 -0
  34. package/dist/progress-bar/progress-bar.d.ts +10 -0
  35. package/dist/segmented-field/segmented-field.d.ts +24 -0
  36. package/dist/select-field/select-field.d.ts +24 -0
  37. package/dist/style.css +2 -0
  38. package/dist/tabs/tabs.d.ts +19 -0
  39. package/dist/tag-field/tag-field.d.ts +20 -0
  40. package/dist/text-field/text-field.d.ts +10 -0
  41. package/dist/theme/contrast.d.ts +16 -0
  42. package/dist/theme/index.d.ts +5 -0
  43. package/dist/theme/theme.d.ts +15 -0
  44. package/dist/theme/tokens.d.ts +138 -0
  45. package/dist/time-field/parse-time.d.ts +4 -0
  46. package/dist/time-field/time-field.d.ts +20 -0
  47. package/dist/toast/toast.d.ts +11 -0
  48. package/dist/tokens.css +166 -0
  49. package/dist/toolbar/toolbar.d.ts +16 -0
  50. package/dist/view-switcher/view-switcher.d.ts +19 -0
  51. package/fonts/OFL-Inter.txt +92 -0
  52. package/fonts/OFL-Outfit.txt +93 -0
  53. package/fonts/inter-variable.woff2 +0 -0
  54. package/fonts/outfit-variable.ttf +0 -0
  55. package/package.json +65 -4
package/dist/index.js ADDED
@@ -0,0 +1,2917 @@
1
+ import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
2
+ import { useEffect as r, useId as i, useImperativeHandle as a, useLayoutEffect as o, useMemo as s, useRef as c, useState as l } from "react";
3
+ var u = {
4
+ root: "_root_1nm00_1",
5
+ primary: "_primary_1nm00_36",
6
+ secondary: "_secondary_1nm00_50",
7
+ ghost: "_ghost_1nm00_54",
8
+ muted: "_muted_1nm00_69",
9
+ tinted: "_tinted_1nm00_81",
10
+ success: "_success_1nm00_97",
11
+ spinner: "_spinner_1nm00_118",
12
+ buttonSpin: "_button-spin_1nm00_1"
13
+ };
14
+ // src/button/button.tsx
15
+ function d({ variant: e = "secondary", loading: r = !1, tint: i, type: a = "button", disabled: o, className: s, style: c, children: l, ...d }) {
16
+ let f = o === !0 || r, p = e === "muted" && i !== void 0, m = [
17
+ u.root,
18
+ u[e],
19
+ p ? u.tinted : "",
20
+ s
21
+ ].filter(Boolean).join(" ");
22
+ return /* @__PURE__ */ n("button", {
23
+ ...d,
24
+ type: a,
25
+ className: m,
26
+ style: p ? {
27
+ ...c,
28
+ "--button-tint": i
29
+ } : c,
30
+ disabled: f,
31
+ "aria-disabled": f || void 0,
32
+ "aria-busy": r || void 0,
33
+ children: [r ? /* @__PURE__ */ t("span", {
34
+ className: u.spinner,
35
+ "aria-hidden": "true",
36
+ "data-button-spinner": ""
37
+ }) : null, l]
38
+ });
39
+ }
40
+ var f = {
41
+ root: "_root_kpb9b_1",
42
+ secondary: "_secondary_kpb9b_32",
43
+ ghost: "_ghost_kpb9b_38",
44
+ icon: "_icon_kpb9b_42"
45
+ };
46
+ // src/icon-button/icon-button.tsx
47
+ function p({ icon: e, variant: n = "ghost", type: r = "button", className: i, ...a }) {
48
+ let o = [
49
+ f.root,
50
+ f[n],
51
+ i
52
+ ].filter(Boolean).join(" ");
53
+ return /* @__PURE__ */ t("button", {
54
+ ...a,
55
+ type: r,
56
+ className: o,
57
+ children: /* @__PURE__ */ t("span", {
58
+ className: f.icon,
59
+ "aria-hidden": "true",
60
+ children: e
61
+ })
62
+ });
63
+ }
64
+ var m = {
65
+ root: "_root_1whtz_1",
66
+ trigger: "_trigger_1whtz_6",
67
+ menu: "_menu_1whtz_32",
68
+ bottom: "_bottom_1whtz_45",
69
+ alignStart: "_alignStart_1whtz_50",
70
+ right: "_right_1whtz_55",
71
+ item: "_item_1whtz_60",
72
+ danger: "_danger_1whtz_88",
73
+ icon: "_icon_1whtz_92"
74
+ };
75
+ // src/menu-button/menu-button.tsx
76
+ function h({ label: s, menuLabel: u, trigger: d, items: f, placement: p = "bottom-end", className: h, menuClassName: g, triggerClassName: _, style: v, ref: y, ...b }) {
77
+ let x = i(), S = c(null), C = c(null), w = c(null);
78
+ a(y, () => S.current, []);
79
+ let [T, E] = l(!1), [D, O] = l(!1);
80
+ o(() => {
81
+ if (T) return p === "bottom-end" && (w.current?.getBoundingClientRect().left ?? 0) < 0 && O(!0), () => {
82
+ O(!1);
83
+ };
84
+ }, [T, p]);
85
+ let k = () => Array.from(w.current?.querySelectorAll("[role=\"menuitem\"]") ?? []);
86
+ function A(e) {
87
+ E(!1), e && C.current?.focus();
88
+ }
89
+ r(() => {
90
+ if (!T) return;
91
+ k()[0]?.focus();
92
+ let e = (e) => {
93
+ S.current?.contains(e.target) || E(!1);
94
+ };
95
+ return document.addEventListener("pointerdown", e, !0), () => {
96
+ document.removeEventListener("pointerdown", e, !0);
97
+ };
98
+ }, [T]);
99
+ function j(e) {
100
+ let t = k(), n = t.indexOf(document.activeElement);
101
+ switch (e.key) {
102
+ case "ArrowDown":
103
+ t[(n + 1) % t.length]?.focus();
104
+ break;
105
+ case "ArrowUp":
106
+ t[(n - 1 + t.length) % t.length]?.focus();
107
+ break;
108
+ case "Home":
109
+ t[0]?.focus();
110
+ break;
111
+ case "End":
112
+ t[t.length - 1]?.focus();
113
+ break;
114
+ case "Escape":
115
+ e.preventDefault(), e.stopPropagation(), A(!0);
116
+ return;
117
+ case "Tab":
118
+ A(!1);
119
+ return;
120
+ default: return;
121
+ }
122
+ e.preventDefault();
123
+ }
124
+ function M(e) {
125
+ A(!0), e.onSelect?.();
126
+ }
127
+ return /* @__PURE__ */ n("div", {
128
+ ...b,
129
+ className: [m.root, h].filter(Boolean).join(" "),
130
+ style: v,
131
+ ref: S,
132
+ children: [/* @__PURE__ */ t("button", {
133
+ ref: C,
134
+ type: "button",
135
+ className: _ ?? m.trigger,
136
+ "aria-label": s,
137
+ "aria-haspopup": "menu",
138
+ "aria-expanded": T,
139
+ "aria-controls": T ? x : void 0,
140
+ onClick: () => {
141
+ E((e) => !e);
142
+ },
143
+ children: d
144
+ }), T ? /* @__PURE__ */ t("div", {
145
+ ref: w,
146
+ id: x,
147
+ role: "menu",
148
+ tabIndex: -1,
149
+ "aria-label": u ?? s,
150
+ className: [
151
+ m.menu,
152
+ p === "right-end" ? m.right : m.bottom,
153
+ D ? m.alignStart : "",
154
+ g
155
+ ].filter(Boolean).join(" "),
156
+ onKeyDown: j,
157
+ children: f.map((r) => {
158
+ let i = {
159
+ role: "menuitem",
160
+ tabIndex: -1,
161
+ className: [m.item, r.tone === "danger" ? m.danger : ""].filter(Boolean).join(" "),
162
+ ...r.tone ? { "data-tone": r.tone } : {}
163
+ }, a = /* @__PURE__ */ n(e, { children: [r.icon ? /* @__PURE__ */ t("span", {
164
+ "aria-hidden": "true",
165
+ className: m.icon,
166
+ children: r.icon
167
+ }) : null, /* @__PURE__ */ t("span", { children: r.label })] });
168
+ return r.href ? /* @__PURE__ */ t("a", {
169
+ ...i,
170
+ href: r.href,
171
+ onClick: (e) => {
172
+ r.onSelect && !e.metaKey && !e.ctrlKey ? (e.preventDefault(), M(r)) : E(!1);
173
+ },
174
+ children: a
175
+ }, r.id) : /* @__PURE__ */ t("button", {
176
+ type: "button",
177
+ ...i,
178
+ onClick: () => {
179
+ M(r);
180
+ },
181
+ children: a
182
+ }, r.id);
183
+ })
184
+ }) : null]
185
+ });
186
+ }
187
+ var g = {
188
+ root: "_root_o7yxy_1",
189
+ label: "_label_o7yxy_8",
190
+ control: "_control_o7yxy_17",
191
+ help: "_help_o7yxy_41",
192
+ error: "_error_o7yxy_47"
193
+ };
194
+ // src/text-field/text-field.tsx
195
+ function _({ label: e, help: r, error: a, id: o, className: s, style: c, "aria-describedby": l, "aria-invalid": u, ...d }) {
196
+ let f = i(), p = o ?? f, m = `${p}-help`, h = `${p}-error`, _ = [
197
+ l,
198
+ r ? m : null,
199
+ a ? h : null
200
+ ].filter(Boolean).join(" ");
201
+ return /* @__PURE__ */ n("div", {
202
+ className: g.root,
203
+ children: [
204
+ /* @__PURE__ */ t("label", {
205
+ htmlFor: p,
206
+ className: g.label,
207
+ children: e
208
+ }),
209
+ /* @__PURE__ */ t("input", {
210
+ ...d,
211
+ id: p,
212
+ className: [g.control, s].filter(Boolean).join(" "),
213
+ style: c,
214
+ "aria-invalid": a ? !0 : u,
215
+ "aria-describedby": _ || void 0
216
+ }),
217
+ r ? /* @__PURE__ */ t("p", {
218
+ id: m,
219
+ className: g.help,
220
+ children: r
221
+ }) : null,
222
+ a ? /* @__PURE__ */ t("p", {
223
+ id: h,
224
+ role: "alert",
225
+ className: g.error,
226
+ children: a
227
+ }) : null
228
+ ]
229
+ });
230
+ }
231
+ var v = {
232
+ root: "_root_17ncm_1",
233
+ label: "_label_17ncm_8",
234
+ wrap: "_wrap_17ncm_17",
235
+ control: "_control_17ncm_21",
236
+ help: "_help_17ncm_51",
237
+ error: "_error_17ncm_57",
238
+ placeholder: "_placeholder_17ncm_72",
239
+ chevron: "_chevron_17ncm_76",
240
+ chevronOpen: "_chevronOpen_17ncm_82",
241
+ list: "_list_17ncm_86",
242
+ above: "_above_17ncm_108",
243
+ option: "_option_17ncm_113",
244
+ active: "_active_17ncm_126"
245
+ };
246
+ // src/select-field/select-field.tsx
247
+ function y() {
248
+ return /* @__PURE__ */ t("svg", {
249
+ viewBox: "0 0 24 24",
250
+ width: "16",
251
+ height: "16",
252
+ fill: "none",
253
+ stroke: "currentColor",
254
+ strokeWidth: "2",
255
+ strokeLinecap: "round",
256
+ strokeLinejoin: "round",
257
+ "aria-hidden": "true",
258
+ focusable: "false",
259
+ children: /* @__PURE__ */ t("path", { d: "m6 9 6 6 6-6" })
260
+ });
261
+ }
262
+ var b = 700, x = 250;
263
+ function S({ label: e, help: s, error: u, id: d, className: f, style: p, options: m, value: h, onChange: g, onBlur: _, placeholder: S, disabled: C, name: w, ref: T, "aria-describedby": E, "aria-invalid": D, ...O }) {
264
+ let k = i(), A = d ?? k, j = `${A}-label`, M = `${A}-value`, N = `${A}-list`, P = `${A}-help`, F = `${A}-error`, I = [
265
+ E,
266
+ s ? P : null,
267
+ u ? F : null
268
+ ].filter(Boolean).join(" "), L = c(null), R = c(null), z = c(null), B = c(0), V = c({
269
+ text: "",
270
+ at: 0
271
+ }), [H, U] = l(!1), [W, G] = l(0), [K, q] = l(!1);
272
+ a(T, () => R.current, []);
273
+ let ee = m.find((e) => e.value === h);
274
+ function te() {
275
+ C || (G(Math.max(0, m.findIndex((e) => e.value === h))), U(!0));
276
+ }
277
+ function J(e) {
278
+ U(!1), e && R.current?.focus();
279
+ }
280
+ function ne(e) {
281
+ let t = m[e];
282
+ t && t.value !== h && g(t.value), J(!0);
283
+ }
284
+ o(() => {
285
+ if (!H || !z.current || !L.current) return;
286
+ let e = L.current.getBoundingClientRect(), t = window.innerHeight - e.bottom;
287
+ q(t < z.current.offsetHeight + 8 && e.top > t), B.current = performance.now() + x, z.current.focus({ preventScroll: !0 });
288
+ }, [H]), r(() => {
289
+ if (!H) return;
290
+ let e = (e) => {
291
+ L.current?.contains(e.target) || J(!1);
292
+ }, t = (e) => {
293
+ performance.now() < B.current || z.current?.contains(e.target) || J(!1);
294
+ }, n = () => {
295
+ J(!1);
296
+ };
297
+ return document.addEventListener("pointerdown", e, !0), document.addEventListener("scroll", t, !0), window.addEventListener("resize", n), () => {
298
+ document.removeEventListener("pointerdown", e, !0), document.removeEventListener("scroll", t, !0), window.removeEventListener("resize", n);
299
+ };
300
+ }, [H]), r(() => {
301
+ H && (B.current = performance.now() + x, document.getElementById(`${N}-${String(W)}`)?.scrollIntoView({ block: "nearest" }));
302
+ }, [
303
+ H,
304
+ W,
305
+ N
306
+ ]);
307
+ function Y(e) {
308
+ ["ArrowDown", "ArrowUp"].includes(e.key) && (e.preventDefault(), te());
309
+ }
310
+ function X(e) {
311
+ let t = m.length - 1;
312
+ switch (e.key) {
313
+ case "ArrowDown":
314
+ G((e) => Math.min(t, e + 1));
315
+ break;
316
+ case "ArrowUp":
317
+ G((e) => Math.max(0, e - 1));
318
+ break;
319
+ case "Home":
320
+ G(0);
321
+ break;
322
+ case "End":
323
+ G(t);
324
+ break;
325
+ case "Enter":
326
+ case " ":
327
+ e.preventDefault(), ne(W);
328
+ return;
329
+ case "Escape":
330
+ e.preventDefault(), e.stopPropagation(), J(!0);
331
+ return;
332
+ case "Tab":
333
+ J(!1);
334
+ return;
335
+ default: {
336
+ if (e.key.length !== 1 || e.ctrlKey || e.metaKey) return;
337
+ let t = e.timeStamp, n = (t - V.current.at < b ? V.current.text : "") + e.key.toLowerCase();
338
+ V.current = {
339
+ text: n,
340
+ at: t
341
+ };
342
+ let r = m.findIndex((e) => e.label.toLowerCase().startsWith(n));
343
+ r >= 0 && G(r);
344
+ }
345
+ }
346
+ e.preventDefault();
347
+ }
348
+ return /* @__PURE__ */ n("div", {
349
+ className: v.root,
350
+ ref: L,
351
+ children: [
352
+ /* @__PURE__ */ t("label", {
353
+ id: j,
354
+ htmlFor: A,
355
+ className: v.label,
356
+ children: e
357
+ }),
358
+ /* @__PURE__ */ n("div", {
359
+ className: v.wrap,
360
+ children: [/* @__PURE__ */ n("button", {
361
+ ...O,
362
+ ref: R,
363
+ type: "button",
364
+ id: A,
365
+ className: [v.control, f].filter(Boolean).join(" "),
366
+ style: p,
367
+ "aria-haspopup": "listbox",
368
+ "aria-expanded": H,
369
+ "aria-controls": H ? N : void 0,
370
+ "aria-labelledby": `${j} ${M}`,
371
+ "aria-invalid": u ? !0 : D,
372
+ "aria-describedby": I || void 0,
373
+ disabled: C,
374
+ onClick: () => {
375
+ H ? J(!1) : te();
376
+ },
377
+ onKeyDown: Y,
378
+ onBlur: () => {
379
+ H || _?.();
380
+ },
381
+ children: [/* @__PURE__ */ t("span", {
382
+ id: M,
383
+ className: ee ? v.value : v.placeholder,
384
+ children: ee?.label ?? S ?? ""
385
+ }), /* @__PURE__ */ t("span", {
386
+ className: [v.chevron, H ? v.chevronOpen : ""].join(" "),
387
+ children: /* @__PURE__ */ t(y, {})
388
+ })]
389
+ }), H ? /* @__PURE__ */ t("ul", {
390
+ ref: z,
391
+ id: N,
392
+ role: "listbox",
393
+ tabIndex: 0,
394
+ "aria-labelledby": j,
395
+ "aria-activedescendant": `${N}-${String(W)}`,
396
+ className: [v.list, K ? v.above : ""].join(" "),
397
+ onKeyDown: X,
398
+ children: m.map((e, n) => /* @__PURE__ */ t("li", {
399
+ id: `${N}-${String(n)}`,
400
+ role: "option",
401
+ "aria-selected": e.value === h,
402
+ className: [v.option, n === W ? v.active : ""].join(" "),
403
+ onMouseMove: () => {
404
+ n !== W && G(n);
405
+ },
406
+ onClick: () => {
407
+ ne(n);
408
+ },
409
+ children: e.label
410
+ }, e.value))
411
+ }) : null]
412
+ }),
413
+ w ? /* @__PURE__ */ t("input", {
414
+ type: "hidden",
415
+ name: w,
416
+ value: h
417
+ }) : null,
418
+ s ? /* @__PURE__ */ t("p", {
419
+ id: P,
420
+ className: v.help,
421
+ children: s
422
+ }) : null,
423
+ u ? /* @__PURE__ */ t("p", {
424
+ id: F,
425
+ role: "alert",
426
+ className: v.error,
427
+ children: u
428
+ }) : null
429
+ ]
430
+ });
431
+ }
432
+ var C = {
433
+ root: "_root_114y1_1",
434
+ control: "_control_114y1_7",
435
+ label: "_label_114y1_20"
436
+ };
437
+ // src/checkbox/checkbox.tsx
438
+ function w({ label: e, id: r, className: a, style: o, ...s }) {
439
+ let c = i(), l = r ?? c;
440
+ return /* @__PURE__ */ n("div", {
441
+ className: C.root,
442
+ children: [/* @__PURE__ */ t("input", {
443
+ ...s,
444
+ id: l,
445
+ type: "checkbox",
446
+ className: [C.control, a].filter(Boolean).join(" "),
447
+ style: o
448
+ }), /* @__PURE__ */ t("label", {
449
+ htmlFor: l,
450
+ className: C.label,
451
+ children: e
452
+ })]
453
+ });
454
+ }
455
+ var T = {
456
+ root: "_root_161y9_1",
457
+ legend: "_legend_161y9_11",
458
+ group: "_group_161y9_22",
459
+ segment: "_segment_161y9_34",
460
+ input: "_input_161y9_39",
461
+ text: "_text_161y9_49",
462
+ help: "_help_161y9_74",
463
+ error: "_error_161y9_80"
464
+ };
465
+ // src/segmented-field/segmented-field.tsx
466
+ function E({ label: e, options: r, value: a, onChange: o, onBlur: s, name: c, error: l, help: u, className: d, style: f, "aria-describedby": p, ...m }) {
467
+ let h = i(), g = c ?? h, _ = `${h}-help`, v = `${h}-error`, y = [
468
+ p,
469
+ u ? _ : null,
470
+ l ? v : null
471
+ ].filter(Boolean).join(" ");
472
+ return /* @__PURE__ */ n("fieldset", {
473
+ ...m,
474
+ className: [T.root, d].filter(Boolean).join(" "),
475
+ style: f,
476
+ "aria-describedby": y || void 0,
477
+ children: [
478
+ /* @__PURE__ */ t("legend", {
479
+ className: T.legend,
480
+ children: e
481
+ }),
482
+ /* @__PURE__ */ t("div", {
483
+ role: "radiogroup",
484
+ "aria-label": e,
485
+ className: T.group,
486
+ children: r.map((e) => /* @__PURE__ */ n("label", {
487
+ className: T.segment,
488
+ children: [/* @__PURE__ */ t("input", {
489
+ type: "radio",
490
+ name: g,
491
+ value: e.value,
492
+ checked: e.value === a,
493
+ className: T.input,
494
+ onChange: () => {
495
+ o(e.value);
496
+ },
497
+ onBlur: s
498
+ }), /* @__PURE__ */ t("span", {
499
+ className: T.text,
500
+ children: e.label
501
+ })]
502
+ }, e.value))
503
+ }),
504
+ u ? /* @__PURE__ */ t("p", {
505
+ id: _,
506
+ className: T.help,
507
+ children: u
508
+ }) : null,
509
+ l ? /* @__PURE__ */ t("p", {
510
+ id: v,
511
+ role: "alert",
512
+ className: T.error,
513
+ children: l
514
+ }) : null
515
+ ]
516
+ });
517
+ }
518
+ var D = {
519
+ root: "_root_1m3wp_2",
520
+ label: "_label_1m3wp_9",
521
+ wrap: "_wrap_1m3wp_18",
522
+ control: "_control_1m3wp_22",
523
+ chevron: "_chevron_1m3wp_57",
524
+ help: "_help_1m3wp_67",
525
+ error: "_error_1m3wp_73",
526
+ popup: "_popup_1m3wp_82",
527
+ above: "_above_1m3wp_95",
528
+ list: "_list_1m3wp_100",
529
+ empty: "_empty_1m3wp_108",
530
+ option: "_option_1m3wp_115",
531
+ active: "_active_1m3wp_131",
532
+ check: "_check_1m3wp_135",
533
+ pills: "_pills_1m3wp_141",
534
+ pill: "_pill_1m3wp_141",
535
+ remove: "_remove_1m3wp_163"
536
+ }, O = "Nenhuma opção encontrada", k = (e) => `Remover ${e}`;
537
+ function A(e) {
538
+ return e.normalize("NFD").replace(/\p{Diacritic}/gu, "").toLowerCase().trim();
539
+ }
540
+ function j() {
541
+ return /* @__PURE__ */ t("svg", {
542
+ viewBox: "0 0 24 24",
543
+ width: "16",
544
+ height: "16",
545
+ fill: "none",
546
+ stroke: "currentColor",
547
+ strokeWidth: "2",
548
+ strokeLinecap: "round",
549
+ strokeLinejoin: "round",
550
+ "aria-hidden": "true",
551
+ focusable: "false",
552
+ children: /* @__PURE__ */ t("path", { d: "m6 9 6 6 6-6" })
553
+ });
554
+ }
555
+ function M() {
556
+ return /* @__PURE__ */ t("svg", {
557
+ viewBox: "0 0 24 24",
558
+ width: "16",
559
+ height: "16",
560
+ fill: "none",
561
+ stroke: "currentColor",
562
+ strokeWidth: "2.5",
563
+ strokeLinecap: "round",
564
+ strokeLinejoin: "round",
565
+ "aria-hidden": "true",
566
+ focusable: "false",
567
+ children: /* @__PURE__ */ t("path", { d: "m5 12 5 5 9-10" })
568
+ });
569
+ }
570
+ function N(e) {
571
+ let { label: s, options: u, emptyText: d = O, listLabel: f, removeLabel: p = k, help: m, error: h, id: g, className: _, style: v, disabled: y, name: b, ref: x, "aria-describedby": S, "aria-invalid": C, multiple: w, onBlur: T, value: E, onChange: N, ...P } = e, F = w === !0, I = i(), L = g ?? I, R = `${L}-label`, z = `${L}-list`, B = `${L}-help`, V = `${L}-error`, H = [
572
+ S,
573
+ m ? B : null,
574
+ h ? V : null
575
+ ].filter(Boolean).join(" "), U = c(null), W = c(null), G = c(null), [K, q] = l(!1), [ee, te] = l(!1), [J, ne] = l(""), [Y, X] = l(0), [re, ie] = l(!1);
576
+ a(x, () => W.current, []);
577
+ let ae = e.multiple ? e.value : e.value === null ? [] : [e.value], Z = e.multiple ? void 0 : u.find((t) => t.value === e.value), oe = ee ? u.filter((e) => A(e.label).includes(A(J))) : u, se = K && oe.length > 0, ce = se && oe[Y] ? `${z}-${String(Y)}` : void 0, le = ee ? J : F ? "" : Z?.label ?? "";
578
+ function ue() {
579
+ q(!1), te(!1), ne("");
580
+ }
581
+ function de() {
582
+ y || (X(0), q(!0));
583
+ }
584
+ function fe(t) {
585
+ if (e.multiple) {
586
+ let n = e.value.includes(t.value) ? e.value.filter((e) => e !== t.value) : [...e.value, t.value];
587
+ e.onChange(n), te(!1), ne(""), X(Math.max(0, u.indexOf(t)));
588
+ } else t.value !== e.value && e.onChange(t.value), ue();
589
+ }
590
+ function pe(t) {
591
+ e.multiple && (e.onChange(e.value.filter((e) => e !== t)), W.current?.focus());
592
+ }
593
+ o(() => {
594
+ if (!se || !G.current || !U.current) return;
595
+ let e = U.current.getBoundingClientRect(), t = window.innerHeight - e.bottom;
596
+ ie(t < G.current.offsetHeight + 8 && e.top > t);
597
+ }, [
598
+ K,
599
+ oe.length,
600
+ se
601
+ ]), r(() => {
602
+ if (!K) return;
603
+ let e = (e) => {
604
+ U.current?.contains(e.target) || ue();
605
+ };
606
+ return document.addEventListener("pointerdown", e, !0), window.addEventListener("resize", ue), () => {
607
+ document.removeEventListener("pointerdown", e, !0), window.removeEventListener("resize", ue);
608
+ };
609
+ }, [K]), r(() => {
610
+ K && document.getElementById(`${z}-${String(Y)}`)?.scrollIntoView({ block: "nearest" });
611
+ }, [
612
+ K,
613
+ Y,
614
+ z
615
+ ]);
616
+ function me(e) {
617
+ ne(e.target.value), te(!0), X(0), q(!0);
618
+ }
619
+ function he(t) {
620
+ if (y) return;
621
+ if (!K) {
622
+ t.key === "ArrowDown" || t.key === "ArrowUp" ? (t.preventDefault(), de()) : t.key === "Backspace" && e.multiple && le === "" && ae.length > 0 ? e.onChange(e.value.slice(0, -1)) : t.key === "Enter" && t.preventDefault();
623
+ return;
624
+ }
625
+ let n = oe.length - 1;
626
+ switch (t.key) {
627
+ case "ArrowDown":
628
+ t.preventDefault(), X((e) => Math.min(n, e + 1));
629
+ break;
630
+ case "ArrowUp":
631
+ t.preventDefault(), X((e) => Math.max(0, e - 1));
632
+ break;
633
+ case "Enter": {
634
+ t.preventDefault();
635
+ let e = oe[Y];
636
+ e && fe(e);
637
+ break;
638
+ }
639
+ case "Escape":
640
+ t.preventDefault(), t.stopPropagation(), ue();
641
+ break;
642
+ case "Tab":
643
+ ue();
644
+ break;
645
+ case "Backspace": e.multiple && le === "" && ae.length > 0 && e.onChange(e.value.slice(0, -1));
646
+ }
647
+ }
648
+ let ge = [D.popup, re ? D.above : ""].filter(Boolean).join(" ");
649
+ return /* @__PURE__ */ n("div", {
650
+ className: D.root,
651
+ ref: U,
652
+ children: [
653
+ /* @__PURE__ */ t("label", {
654
+ id: R,
655
+ htmlFor: L,
656
+ className: D.label,
657
+ children: s
658
+ }),
659
+ /* @__PURE__ */ n("div", {
660
+ className: D.wrap,
661
+ children: [
662
+ /* @__PURE__ */ t("input", {
663
+ autoComplete: "off",
664
+ ...P,
665
+ ref: W,
666
+ id: L,
667
+ type: "text",
668
+ role: "combobox",
669
+ className: [D.control, _].filter(Boolean).join(" "),
670
+ style: v,
671
+ "aria-autocomplete": "list",
672
+ "aria-expanded": se,
673
+ "aria-controls": se ? z : void 0,
674
+ "aria-activedescendant": ce,
675
+ "aria-invalid": h ? !0 : C,
676
+ "aria-describedby": H || void 0,
677
+ disabled: y,
678
+ value: le,
679
+ onChange: me,
680
+ onClick: () => {
681
+ K || y || (de(), W.current?.select());
682
+ },
683
+ onKeyDown: he,
684
+ onBlur: () => {
685
+ K || T?.();
686
+ }
687
+ }),
688
+ /* @__PURE__ */ t("span", {
689
+ className: D.chevron,
690
+ children: /* @__PURE__ */ t(j, {})
691
+ }),
692
+ K ? /* @__PURE__ */ t("div", {
693
+ ref: G,
694
+ className: ge,
695
+ children: se ? /* @__PURE__ */ t("ul", {
696
+ id: z,
697
+ role: "listbox",
698
+ "aria-labelledby": R,
699
+ "aria-multiselectable": F ? !0 : void 0,
700
+ className: D.list,
701
+ children: oe.map((e, r) => {
702
+ let i = ae.includes(e.value);
703
+ return /* @__PURE__ */ n("li", {
704
+ id: `${z}-${String(r)}`,
705
+ role: "option",
706
+ "aria-selected": i,
707
+ className: [D.option, r === Y ? D.active : ""].filter(Boolean).join(" "),
708
+ onMouseDown: (e) => {
709
+ e.preventDefault();
710
+ },
711
+ onMouseMove: () => {
712
+ r !== Y && X(r);
713
+ },
714
+ onClick: () => {
715
+ fe(e);
716
+ },
717
+ children: [e.label, F && i ? /* @__PURE__ */ t("span", {
718
+ className: D.check,
719
+ children: /* @__PURE__ */ t(M, {})
720
+ }) : null]
721
+ }, String(e.value));
722
+ })
723
+ }) : /* @__PURE__ */ t("p", {
724
+ role: "status",
725
+ className: D.empty,
726
+ children: d
727
+ })
728
+ }) : null
729
+ ]
730
+ }),
731
+ e.multiple && e.value.length > 0 ? /* @__PURE__ */ t("ul", {
732
+ "aria-label": f ?? `${s} escolhidas`,
733
+ className: D.pills,
734
+ children: e.value.map((e) => {
735
+ let r = u.find((t) => t.value === e)?.label ?? String(e);
736
+ return /* @__PURE__ */ n("li", {
737
+ className: D.pill,
738
+ children: [r, /* @__PURE__ */ t("button", {
739
+ type: "button",
740
+ className: D.remove,
741
+ "aria-label": p(r),
742
+ disabled: y,
743
+ onClick: () => {
744
+ pe(e);
745
+ },
746
+ children: /* @__PURE__ */ t("span", {
747
+ "aria-hidden": "true",
748
+ children: "×"
749
+ })
750
+ })]
751
+ }, String(e));
752
+ })
753
+ }) : null,
754
+ b ? ae.map((e) => /* @__PURE__ */ t("input", {
755
+ type: "hidden",
756
+ name: b,
757
+ value: String(e)
758
+ }, String(e))) : null,
759
+ b && !e.multiple && e.value === null ? /* @__PURE__ */ t("input", {
760
+ type: "hidden",
761
+ name: b,
762
+ value: ""
763
+ }) : null,
764
+ m ? /* @__PURE__ */ t("p", {
765
+ id: B,
766
+ className: D.help,
767
+ children: m
768
+ }) : null,
769
+ h ? /* @__PURE__ */ t("p", {
770
+ id: V,
771
+ role: "alert",
772
+ className: D.error,
773
+ children: h
774
+ }) : null
775
+ ]
776
+ });
777
+ }
778
+ var P = {
779
+ root: "_root_gtcmb_1",
780
+ label: "_label_gtcmb_8",
781
+ control: "_control_gtcmb_17",
782
+ pills: "_pills_gtcmb_42",
783
+ pill: "_pill_gtcmb_42",
784
+ remove: "_remove_gtcmb_64",
785
+ help: "_help_gtcmb_86",
786
+ error: "_error_gtcmb_92"
787
+ }, F = (e) => `Remover ${e}`;
788
+ function I({ label: e, value: r, onChange: o, onBlur: s, listLabel: u, removeLabel: d = F, help: f, error: p, id: m, className: h, style: g, ref: _, "aria-describedby": v, "aria-invalid": y, ...b }) {
789
+ let x = i(), S = m ?? x, C = `${S}-help`, w = `${S}-error`, T = [
790
+ v,
791
+ f ? C : null,
792
+ p ? w : null
793
+ ].filter(Boolean).join(" "), E = c(null), [D, O] = l("");
794
+ a(_, () => E.current, []);
795
+ function k(e) {
796
+ let t = e.trim().replace(/^#+/, "").trim();
797
+ O(""), t && (r.some((e) => e.toLowerCase() === t.toLowerCase()) || o([...r, t]));
798
+ }
799
+ function A(e) {
800
+ e.key === "Enter" || e.key === "," ? (e.preventDefault(), k(D)) : e.key === "Backspace" && D === "" && r.length > 0 && o(r.slice(0, -1));
801
+ }
802
+ return /* @__PURE__ */ n("div", {
803
+ className: P.root,
804
+ children: [
805
+ /* @__PURE__ */ t("label", {
806
+ htmlFor: S,
807
+ className: P.label,
808
+ children: e
809
+ }),
810
+ /* @__PURE__ */ t("input", {
811
+ autoComplete: "off",
812
+ ...b,
813
+ ref: E,
814
+ id: S,
815
+ type: "text",
816
+ className: [P.control, h].filter(Boolean).join(" "),
817
+ style: g,
818
+ value: D,
819
+ "aria-invalid": p ? !0 : y,
820
+ "aria-describedby": T || void 0,
821
+ onChange: (e) => {
822
+ let t = e.target.value;
823
+ t.includes(",") ? (t.split(",").slice(0, -1).forEach((e) => {
824
+ k(e);
825
+ }), O(t.slice(t.lastIndexOf(",") + 1))) : O(t);
826
+ },
827
+ onKeyDown: A,
828
+ onBlur: () => {
829
+ k(D), s?.();
830
+ }
831
+ }),
832
+ r.length > 0 ? /* @__PURE__ */ t("ul", {
833
+ "aria-label": u ?? `${e} adicionadas`,
834
+ className: P.pills,
835
+ children: r.map((e) => /* @__PURE__ */ n("li", {
836
+ className: P.pill,
837
+ children: [/* @__PURE__ */ t("span", { children: e }), /* @__PURE__ */ t("button", {
838
+ type: "button",
839
+ className: P.remove,
840
+ "aria-label": d(e),
841
+ onClick: () => {
842
+ o(r.filter((t) => t !== e)), E.current?.focus();
843
+ },
844
+ children: /* @__PURE__ */ t("span", {
845
+ "aria-hidden": "true",
846
+ children: "×"
847
+ })
848
+ })]
849
+ }, e))
850
+ }) : null,
851
+ f ? /* @__PURE__ */ t("p", {
852
+ id: C,
853
+ className: P.help,
854
+ children: f
855
+ }) : null,
856
+ p ? /* @__PURE__ */ t("p", {
857
+ id: w,
858
+ role: "alert",
859
+ className: P.error,
860
+ children: p
861
+ }) : null
862
+ ]
863
+ });
864
+ }
865
+ // src/color-field/color.ts
866
+ function L(e, t, n) {
867
+ return Math.min(n, Math.max(t, e));
868
+ }
869
+ function R(e, t, n) {
870
+ let r = t / 100, i = n / 100, a = (t) => (t + e / 30) % 12, o = r * Math.min(i, 1 - i), s = (e) => i - o * Math.max(-1, Math.min(a(e) - 3, 9 - a(e), 1));
871
+ return [
872
+ Math.round(s(0) * 255),
873
+ Math.round(s(8) * 255),
874
+ Math.round(s(4) * 255)
875
+ ];
876
+ }
877
+ function z(e, t, n) {
878
+ let r = e / 255, i = t / 255, a = n / 255, o = Math.max(r, i, a), s = Math.min(r, i, a), c = o - s, l = (o + s) / 2, u = c === 0 ? 0 : c / (1 - Math.abs(2 * l - 1)), d = 0;
879
+ return c && (d = o === r ? (i - a) / c % 6 : o === i ? (a - r) / c + 2 : (r - i) / c + 4, d = (d * 60 + 360) % 360), [
880
+ Math.round(d),
881
+ Math.round(u * 100),
882
+ Math.round(l * 100)
883
+ ];
884
+ }
885
+ function B(e) {
886
+ return `#${e.map((e) => L(Math.round(e), 0, 255).toString(16).padStart(2, "0")).join("").toUpperCase()}`;
887
+ }
888
+ function V(e) {
889
+ let t = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());
890
+ if (!t) return null;
891
+ let n = t[1] ?? "";
892
+ return n.length === 3 && (n = n.split("").map((e) => e + e).join("")), [
893
+ 0,
894
+ 2,
895
+ 4
896
+ ].map((e) => parseInt(n.slice(e, e + 2), 16));
897
+ }
898
+ var H = {
899
+ root: "_root_5gwtb_1",
900
+ label: "_label_5gwtb_8",
901
+ trigger: "_trigger_5gwtb_17",
902
+ swatch: "_swatch_5gwtb_44",
903
+ hexText: "_hexText_5gwtb_51",
904
+ dialog: "_dialog_5gwtb_55",
905
+ title: "_title_5gwtb_69",
906
+ picker: "_picker_5gwtb_75",
907
+ wheelWrap: "_wheelWrap_5gwtb_81",
908
+ wheel: "_wheel_5gwtb_81",
909
+ marker: "_marker_5gwtb_102",
910
+ controls: "_controls_5gwtb_113",
911
+ preview: "_preview_5gwtb_121",
912
+ numberLabel: "_numberLabel_5gwtb_127",
913
+ range: "_range_5gwtb_136",
914
+ input: "_input_5gwtb_141",
915
+ group: "_group_5gwtb_172",
916
+ buttons: "_buttons_5gwtb_189",
917
+ help: "_help_5gwtb_196",
918
+ error: "_error_5gwtb_202"
919
+ }, U = {
920
+ title: "Escolher cor",
921
+ lightness: "Luminosidade",
922
+ hex: "HEX",
923
+ rgb: "RGB",
924
+ red: "Vermelho",
925
+ green: "Verde",
926
+ blue: "Azul",
927
+ hsl: "HSL",
928
+ hue: "Matiz",
929
+ saturation: "Saturação",
930
+ cancel: "Cancelar",
931
+ apply: "Aplicar",
932
+ wheel: "Roda de cores",
933
+ wheelValue: (e, t) => `Matiz ${String(e)} graus, saturação ${String(t)}%`
934
+ }, W = 220, G = [
935
+ 124,
936
+ 58,
937
+ 237
938
+ ];
939
+ function K(e) {
940
+ let [t, n, r] = z(...e);
941
+ return {
942
+ h: t,
943
+ s: n,
944
+ l: r,
945
+ rgb: e
946
+ };
947
+ }
948
+ function q(e, t, n) {
949
+ return {
950
+ h: e,
951
+ s: t,
952
+ l: n,
953
+ rgb: R(e, t, n)
954
+ };
955
+ }
956
+ function ee({ value: e, onChange: i, labels: a, className: o, style: s, ...u }) {
957
+ let d = {
958
+ ...U,
959
+ ...a
960
+ }, [f, p] = l(() => K(V(e) ?? G)), [m, h] = l(null), g = c(null), _ = B(f.rgb);
961
+ function v(e) {
962
+ p(e), i(B(e.rgb));
963
+ }
964
+ r(() => {
965
+ let e = g.current?.getContext("2d");
966
+ if (!e) return;
967
+ let t = W / 2, n = e.createImageData(W, W);
968
+ for (let e = 0; e < W; e++) for (let r = 0; r < W; r++) {
969
+ let i = r - t, a = e - t, o = Math.sqrt(i * i + a * a), s = (e * W + r) * 4;
970
+ if (o > t) continue;
971
+ let c = R((Math.atan2(a, i) * 180 / Math.PI + 360) % 360, o / t * 100, f.l);
972
+ n.data[s] = c[0], n.data[s + 1] = c[1], n.data[s + 2] = c[2], n.data[s + 3] = 255;
973
+ }
974
+ e.putImageData(n, 0, 0);
975
+ }, [f.l]);
976
+ function y(e) {
977
+ let t = e.currentTarget.getBoundingClientRect(), n = (e.clientX - t.left) / t.width * 2 - 1, r = (e.clientY - t.top) / t.height * 2 - 1;
978
+ v(q(Math.round((Math.atan2(r, n) * 180 / Math.PI + 360) % 360), Math.round(L(Math.sqrt(n * n + r * r), 0, 1) * 100), f.l));
979
+ }
980
+ function b(e) {
981
+ let t = e.shiftKey ? 10 : 1, { key: n } = e;
982
+ if (n === "ArrowRight" || n === "ArrowLeft") v(q((f.h + (n === "ArrowRight" ? t : -t) + 360) % 360, f.s, f.l));
983
+ else if (n === "ArrowUp" || n === "ArrowDown") v(q(f.h, L(f.s + (n === "ArrowUp" ? t : -t), 0, 100), f.l));
984
+ else return;
985
+ e.preventDefault();
986
+ }
987
+ let x = W / 2, S = f.h * Math.PI / 180, C = f.s / 100 * x, w = {
988
+ left: `${String((x + Math.cos(S) * C) / W * 100)}%`,
989
+ top: `${String((x + Math.sin(S) * C) / W * 100)}%`,
990
+ backgroundColor: _
991
+ }, T = m?.key === "hex" && V(m.text) === null, E = (e, t) => L(Math.round(Number(e) || 0), 0, t);
992
+ function D(e, t) {
993
+ return m?.key === e ? m.text : String(t);
994
+ }
995
+ function O(e, r, i, a, o) {
996
+ return /* @__PURE__ */ n("label", {
997
+ className: H.numberLabel,
998
+ children: [/* @__PURE__ */ t("span", { children: r }), /* @__PURE__ */ t("input", {
999
+ type: "number",
1000
+ className: H.input,
1001
+ min: 0,
1002
+ max: o,
1003
+ value: D(e, i),
1004
+ onChange: (t) => {
1005
+ h({
1006
+ key: e,
1007
+ text: t.target.value
1008
+ }), a(E(t.target.value, o));
1009
+ },
1010
+ onBlur: () => {
1011
+ h(null);
1012
+ }
1013
+ })]
1014
+ });
1015
+ }
1016
+ let [k, A, j] = f.rgb, M = (e) => (t) => {
1017
+ let n = [...f.rgb];
1018
+ n[e] = t, v(K(n));
1019
+ };
1020
+ return /* @__PURE__ */ n("div", {
1021
+ ...u,
1022
+ className: [H.picker, o].filter(Boolean).join(" "),
1023
+ style: s,
1024
+ children: [/* @__PURE__ */ n("div", {
1025
+ className: H.wheelWrap,
1026
+ children: [/* @__PURE__ */ t("canvas", {
1027
+ ref: g,
1028
+ width: W,
1029
+ height: W,
1030
+ className: H.wheel,
1031
+ role: "slider",
1032
+ tabIndex: 0,
1033
+ "aria-label": d.wheel,
1034
+ "aria-valuemin": 0,
1035
+ "aria-valuemax": 360,
1036
+ "aria-valuenow": f.h,
1037
+ "aria-valuetext": d.wheelValue(f.h, f.s),
1038
+ onPointerDown: (e) => {
1039
+ e.currentTarget.setPointerCapture(e.pointerId), y(e);
1040
+ },
1041
+ onPointerMove: (e) => {
1042
+ e.currentTarget.hasPointerCapture(e.pointerId) && y(e);
1043
+ },
1044
+ onKeyDown: b
1045
+ }), /* @__PURE__ */ t("span", {
1046
+ className: H.marker,
1047
+ style: w,
1048
+ "aria-hidden": "true"
1049
+ })]
1050
+ }), /* @__PURE__ */ n("div", {
1051
+ className: H.controls,
1052
+ children: [
1053
+ /* @__PURE__ */ t("span", {
1054
+ className: H.preview,
1055
+ "data-preview": "",
1056
+ style: { backgroundColor: _ },
1057
+ "aria-hidden": "true"
1058
+ }),
1059
+ /* @__PURE__ */ n("label", {
1060
+ className: H.numberLabel,
1061
+ children: [/* @__PURE__ */ t("span", { children: d.lightness }), /* @__PURE__ */ t("input", {
1062
+ type: "range",
1063
+ min: 0,
1064
+ max: 100,
1065
+ className: H.range,
1066
+ value: f.l,
1067
+ onChange: (e) => {
1068
+ v(q(f.h, f.s, Number(e.target.value)));
1069
+ }
1070
+ })]
1071
+ }),
1072
+ /* @__PURE__ */ n("label", {
1073
+ className: H.numberLabel,
1074
+ children: [/* @__PURE__ */ t("span", { children: d.hex }), /* @__PURE__ */ t("input", {
1075
+ type: "text",
1076
+ className: H.input,
1077
+ autoComplete: "off",
1078
+ value: D("hex", _),
1079
+ "aria-invalid": T ? !0 : void 0,
1080
+ onChange: (e) => {
1081
+ h({
1082
+ key: "hex",
1083
+ text: e.target.value
1084
+ });
1085
+ let t = V(e.target.value);
1086
+ t && v(K(t));
1087
+ },
1088
+ onBlur: () => {
1089
+ h(null);
1090
+ }
1091
+ })]
1092
+ }),
1093
+ /* @__PURE__ */ n("fieldset", {
1094
+ className: H.group,
1095
+ children: [
1096
+ /* @__PURE__ */ t("legend", { children: d.rgb }),
1097
+ O("r", d.red, k, M(0), 255),
1098
+ O("g", d.green, A, M(1), 255),
1099
+ O("b", d.blue, j, M(2), 255)
1100
+ ]
1101
+ }),
1102
+ /* @__PURE__ */ n("fieldset", {
1103
+ className: H.group,
1104
+ children: [
1105
+ /* @__PURE__ */ t("legend", { children: d.hsl }),
1106
+ O("h", d.hue, f.h, (e) => {
1107
+ v(q(e % 360, f.s, f.l));
1108
+ }, 360),
1109
+ O("s", d.saturation, f.s, (e) => {
1110
+ v(q(f.h, e, f.l));
1111
+ }, 100),
1112
+ O("l", d.lightness, f.l, (e) => {
1113
+ v(q(f.h, f.s, e));
1114
+ }, 100)
1115
+ ]
1116
+ })
1117
+ ]
1118
+ })]
1119
+ });
1120
+ }
1121
+ // src/color-field/color-field.tsx
1122
+ function te({ label: e, value: o, onChange: s, onBlur: u, labels: f, error: p, help: m, id: h, className: g, style: _, ref: v, "aria-describedby": y, "aria-invalid": b, ...x }) {
1123
+ let S = {
1124
+ ...U,
1125
+ ...f
1126
+ }, C = i(), w = h ?? C, T = `${w}-label`, E = `${w}-value`, D = `${w}-title`, O = `${w}-help`, k = `${w}-error`, A = [
1127
+ y,
1128
+ m ? O : null,
1129
+ p ? k : null
1130
+ ].filter(Boolean).join(" "), j = c(null), M = c(null), [N, P] = l(!1), F = c(o);
1131
+ a(v, () => j.current, []);
1132
+ let I = V(o), L = I ? B(I) : o;
1133
+ r(() => {
1134
+ N && (M.current?.showModal(), M.current?.querySelector("[role=\"slider\"]")?.focus());
1135
+ }, [N]);
1136
+ function R() {
1137
+ P(!1), j.current?.focus(), u?.();
1138
+ }
1139
+ return /* @__PURE__ */ n("div", {
1140
+ className: H.root,
1141
+ children: [
1142
+ /* @__PURE__ */ t("span", {
1143
+ id: T,
1144
+ className: H.label,
1145
+ children: e
1146
+ }),
1147
+ /* @__PURE__ */ n("button", {
1148
+ ...x,
1149
+ ref: j,
1150
+ type: "button",
1151
+ id: w,
1152
+ className: [H.trigger, g].filter(Boolean).join(" "),
1153
+ style: _,
1154
+ "aria-haspopup": "dialog",
1155
+ "aria-labelledby": `${T} ${E}`,
1156
+ "aria-invalid": p ? !0 : b,
1157
+ "aria-describedby": A || void 0,
1158
+ onClick: () => {
1159
+ F.current = o, P(!0);
1160
+ },
1161
+ children: [/* @__PURE__ */ t("span", {
1162
+ className: H.swatch,
1163
+ "data-swatch": "",
1164
+ style: { backgroundColor: o }
1165
+ }), /* @__PURE__ */ t("span", {
1166
+ id: E,
1167
+ className: H.hexText,
1168
+ children: L
1169
+ })]
1170
+ }),
1171
+ N ? /* @__PURE__ */ n("dialog", {
1172
+ ref: M,
1173
+ "aria-labelledby": D,
1174
+ className: H.dialog,
1175
+ onCancel: (e) => {
1176
+ e.preventDefault(), R();
1177
+ },
1178
+ children: [
1179
+ /* @__PURE__ */ t("h2", {
1180
+ id: D,
1181
+ className: H.title,
1182
+ children: S.title
1183
+ }),
1184
+ /* @__PURE__ */ t(ee, {
1185
+ value: o,
1186
+ labels: S,
1187
+ onChange: (e) => {
1188
+ F.current = e;
1189
+ }
1190
+ }),
1191
+ /* @__PURE__ */ n("div", {
1192
+ className: H.buttons,
1193
+ children: [/* @__PURE__ */ t(d, {
1194
+ variant: "ghost",
1195
+ onClick: R,
1196
+ children: S.cancel
1197
+ }), /* @__PURE__ */ t(d, {
1198
+ variant: "primary",
1199
+ onClick: () => {
1200
+ s(F.current), R();
1201
+ },
1202
+ children: S.apply
1203
+ })]
1204
+ })
1205
+ ]
1206
+ }) : null,
1207
+ m ? /* @__PURE__ */ t("p", {
1208
+ id: O,
1209
+ className: H.help,
1210
+ children: m
1211
+ }) : null,
1212
+ p ? /* @__PURE__ */ t("p", {
1213
+ id: k,
1214
+ role: "alert",
1215
+ className: H.error,
1216
+ children: p
1217
+ }) : null
1218
+ ]
1219
+ });
1220
+ }
1221
+ var J = {
1222
+ root: "_root_7069v_1",
1223
+ head: "_head_7069v_9",
1224
+ title: "_title_7069v_15",
1225
+ grid: "_grid_7069v_27",
1226
+ dow: "_dow_7069v_33",
1227
+ day: "_day_7069v_42",
1228
+ outside: "_outside_7069v_67",
1229
+ today: "_today_7069v_71",
1230
+ inRange: "_inRange_7069v_75",
1231
+ edge: "_edge_7069v_80",
1232
+ row: "_row_7069v_87"
1233
+ }, ne = {
1234
+ previous: "Mês anterior",
1235
+ next: "Próximo mês",
1236
+ today: "hoje"
1237
+ }, Y = (e) => String(e).padStart(2, "0");
1238
+ function X(e) {
1239
+ return `${String(e.getFullYear())}-${Y(e.getMonth() + 1)}-${Y(e.getDate())}`;
1240
+ }
1241
+ function re(e) {
1242
+ let [t = 1970, n = 1, r = 1] = e.split("-").map(Number);
1243
+ return new Date(t, n - 1, r);
1244
+ }
1245
+ function ie({ left: e }) {
1246
+ return /* @__PURE__ */ t("svg", {
1247
+ viewBox: "0 0 24 24",
1248
+ width: "16",
1249
+ height: "16",
1250
+ fill: "none",
1251
+ stroke: "currentColor",
1252
+ strokeWidth: "2",
1253
+ strokeLinecap: "round",
1254
+ strokeLinejoin: "round",
1255
+ "aria-hidden": "true",
1256
+ focusable: "false",
1257
+ children: /* @__PURE__ */ t("path", { d: e ? "M15 18l-6-6 6-6" : "M9 18l6-6-6-6" })
1258
+ });
1259
+ }
1260
+ function ae({ mode: e, month: i, onMonthChange: o, value: l, onChange: u, today: d, locale: f = "pt-BR", labels: m, className: h, ref: g, ..._ }) {
1261
+ let v = c(null);
1262
+ a(g, () => v.current, []);
1263
+ let y = {
1264
+ ...ne,
1265
+ ...m
1266
+ }, b = c(null), [x, S] = i.split("-").map(Number), C = s(() => new Intl.DateTimeFormat(f, {
1267
+ month: "long",
1268
+ year: "numeric"
1269
+ }).format(new Date(x, S - 1, 1)), [
1270
+ f,
1271
+ x,
1272
+ S
1273
+ ]), w = s(() => {
1274
+ let e = new Intl.DateTimeFormat(f, { weekday: "narrow" }), t = new Intl.DateTimeFormat(f, { weekday: "long" });
1275
+ return Array.from({ length: 7 }, (n, r) => {
1276
+ let i = new Date(2026, 0, 4 + r);
1277
+ return {
1278
+ short: e.format(i),
1279
+ long: t.format(i)
1280
+ };
1281
+ });
1282
+ }, [f]), T = s(() => new Intl.DateTimeFormat(f, { dateStyle: "long" }), [f]), E = new Date(x, S - 1, 1), D = new Date(x, S - 1, 1 - E.getDay()), O = Array.from({ length: 42 }, (e, t) => {
1283
+ let n = new Date(D.getFullYear(), D.getMonth(), D.getDate() + t);
1284
+ return {
1285
+ iso: X(n),
1286
+ date: n
1287
+ };
1288
+ }), k = Array.from({ length: 6 }, (e, t) => O.slice(t * 7, t * 7 + 7)), A = l.from, j = e === "range" ? l.to ?? l.from : l.from, M = i, N = [
1289
+ A,
1290
+ d,
1291
+ `${i}-01`
1292
+ ].find((e) => e && e.slice(0, 7) === M) ?? `${i}-01`;
1293
+ function P(e) {
1294
+ b.current = e, e.slice(0, 7) === i ? v.current?.querySelector(`[data-day="${e}"]`)?.focus() : o(e.slice(0, 7));
1295
+ }
1296
+ r(() => {
1297
+ let e = b.current;
1298
+ e && e.slice(0, 7) === i && (b.current = null, v.current?.querySelector(`[data-day="${e}"]`)?.focus());
1299
+ }, [i]);
1300
+ function F(e) {
1301
+ let t = new Date(x, S - 1 + e, 1);
1302
+ o(`${String(t.getFullYear())}-${Y(t.getMonth() + 1)}`);
1303
+ }
1304
+ function I(t) {
1305
+ e === "single" || !l.from || l.to ? u({ from: t }) : t < l.from ? u({
1306
+ from: t,
1307
+ to: l.from
1308
+ }) : u({
1309
+ from: l.from,
1310
+ to: t
1311
+ });
1312
+ }
1313
+ function L(e, t) {
1314
+ let n = {
1315
+ ArrowLeft: -1,
1316
+ ArrowRight: 1,
1317
+ ArrowUp: -7,
1318
+ ArrowDown: 7
1319
+ }[e.key];
1320
+ if (n === void 0) return;
1321
+ e.preventDefault();
1322
+ let r = re(t);
1323
+ r.setDate(r.getDate() + n), P(X(r));
1324
+ }
1325
+ return /* @__PURE__ */ n("div", {
1326
+ ..._,
1327
+ ref: v,
1328
+ className: [J.root, h].filter(Boolean).join(" "),
1329
+ children: [/* @__PURE__ */ n("div", {
1330
+ className: J.head,
1331
+ children: [
1332
+ /* @__PURE__ */ t(p, {
1333
+ "aria-label": y.previous,
1334
+ icon: /* @__PURE__ */ t(ie, { left: !0 }),
1335
+ onClick: () => {
1336
+ F(-1);
1337
+ }
1338
+ }),
1339
+ /* @__PURE__ */ t("span", {
1340
+ className: J.title,
1341
+ children: C
1342
+ }),
1343
+ /* @__PURE__ */ t(p, {
1344
+ "aria-label": y.next,
1345
+ icon: /* @__PURE__ */ t(ie, { left: !1 }),
1346
+ onClick: () => {
1347
+ F(1);
1348
+ }
1349
+ })
1350
+ ]
1351
+ }), /* @__PURE__ */ n("div", {
1352
+ role: "grid",
1353
+ "aria-label": C,
1354
+ className: J.grid,
1355
+ children: [/* @__PURE__ */ t("div", {
1356
+ role: "row",
1357
+ className: J.row,
1358
+ children: w.map((e) => /* @__PURE__ */ t("span", {
1359
+ role: "columnheader",
1360
+ "aria-label": e.long,
1361
+ className: J.dow,
1362
+ children: e.short
1363
+ }, e.long))
1364
+ }), k.map((n) => /* @__PURE__ */ t("div", {
1365
+ role: "row",
1366
+ className: J.row,
1367
+ children: n.map(({ iso: n, date: r }) => {
1368
+ let a = n.slice(0, 7) !== i, o = e === "range" && A !== "" && n >= A && n <= j, s = A !== "" && (n === A || n === j), c = [
1369
+ J.day,
1370
+ a ? J.outside : "",
1371
+ o && !s ? J.inRange : "",
1372
+ s ? J.edge : "",
1373
+ n === d ? J.today : ""
1374
+ ].filter(Boolean).join(" ");
1375
+ return /* @__PURE__ */ t("span", {
1376
+ role: "gridcell",
1377
+ className: J.row,
1378
+ children: /* @__PURE__ */ t("button", {
1379
+ type: "button",
1380
+ "data-day": n,
1381
+ "data-outside": a ? "" : void 0,
1382
+ className: c,
1383
+ tabIndex: n === N ? 0 : -1,
1384
+ "aria-pressed": s,
1385
+ "aria-label": `${T.format(r)}${n === d ? `, ${y.today}` : ""}`,
1386
+ onClick: () => {
1387
+ I(n);
1388
+ },
1389
+ onKeyDown: (e) => {
1390
+ L(e, n);
1391
+ },
1392
+ children: r.getDate()
1393
+ })
1394
+ }, n);
1395
+ })
1396
+ }, n[0]?.iso))]
1397
+ })]
1398
+ });
1399
+ }
1400
+ var Z = {
1401
+ root: "_root_1fogs_1",
1402
+ label: "_label_1fogs_8",
1403
+ hidden: "_hidden_1fogs_17",
1404
+ wrap: "_wrap_1fogs_26",
1405
+ control: "_control_1fogs_30",
1406
+ value: "_value_1fogs_63",
1407
+ placeholder: "_placeholder_1fogs_68",
1408
+ popover: "_popover_1fogs_72",
1409
+ actions: "_actions_1fogs_87",
1410
+ help: "_help_1fogs_92",
1411
+ error: "_error_1fogs_98"
1412
+ }, oe = {
1413
+ placeholder: "Escolher data",
1414
+ today: "Hoje",
1415
+ clear: "Limpar",
1416
+ previous: "Mês anterior",
1417
+ next: "Próximo mês",
1418
+ todayMarker: "hoje"
1419
+ };
1420
+ function se() {
1421
+ return /* @__PURE__ */ n("svg", {
1422
+ viewBox: "0 0 24 24",
1423
+ width: "16",
1424
+ height: "16",
1425
+ fill: "none",
1426
+ stroke: "currentColor",
1427
+ strokeWidth: "2",
1428
+ strokeLinecap: "round",
1429
+ strokeLinejoin: "round",
1430
+ "aria-hidden": "true",
1431
+ focusable: "false",
1432
+ children: [/* @__PURE__ */ t("rect", {
1433
+ x: "3",
1434
+ y: "4",
1435
+ width: "18",
1436
+ height: "18",
1437
+ rx: "2"
1438
+ }), /* @__PURE__ */ t("path", { d: "M16 2v4M8 2v4M3 10h18" })]
1439
+ });
1440
+ }
1441
+ function ce() {
1442
+ let e = /* @__PURE__ */ new Date(), t = (e) => String(e).padStart(2, "0");
1443
+ return `${String(e.getFullYear())}-${t(e.getMonth() + 1)}-${t(e.getDate())}`;
1444
+ }
1445
+ function le(e, t) {
1446
+ let [n = 1970, r = 1, i = 1] = e.split("-").map(Number);
1447
+ return new Intl.DateTimeFormat(t).format(new Date(n, r - 1, i));
1448
+ }
1449
+ function ue({ label: e, value: o, onChange: s, onBlur: u, locale: f = "pt-BR", labels: p, today: m, hideLabel: h = !1, help: g, error: _, id: v, className: y, style: b, ref: x, ...S }) {
1450
+ let C = i(), w = v ?? C, T = `${w}-label`, E = `${w}-value`, D = `${w}-help`, O = `${w}-error`, k = [g ? D : null, _ ? O : null].filter(Boolean).join(" "), A = m ?? ce(), j = c(null), M = c(null);
1451
+ a(x, () => M.current, []);
1452
+ let N = {
1453
+ ...oe,
1454
+ ...p
1455
+ }, [P, F] = l(!1), [I, L] = l((o || A).slice(0, 7));
1456
+ function R(e) {
1457
+ F(!1), e ? M.current?.focus() : u?.();
1458
+ }
1459
+ function z(e) {
1460
+ s(e), R(!0);
1461
+ }
1462
+ r(() => {
1463
+ if (!P) return;
1464
+ j.current?.querySelector("[data-day][tabindex=\"0\"]")?.focus();
1465
+ let e = (e) => {
1466
+ j.current?.contains(e.target) || R(!1);
1467
+ }, t = (e) => {
1468
+ e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), R(!0));
1469
+ };
1470
+ return document.addEventListener("pointerdown", e, !0), document.addEventListener("keydown", t, !0), () => {
1471
+ document.removeEventListener("pointerdown", e, !0), document.removeEventListener("keydown", t, !0);
1472
+ };
1473
+ }, [P]);
1474
+ let B = {
1475
+ previous: N.previous,
1476
+ next: N.next,
1477
+ today: N.todayMarker
1478
+ };
1479
+ return /* @__PURE__ */ n("div", {
1480
+ className: Z.root,
1481
+ ref: j,
1482
+ children: [
1483
+ /* @__PURE__ */ t("span", {
1484
+ id: T,
1485
+ className: [Z.label, h ? Z.hidden : ""].filter(Boolean).join(" "),
1486
+ children: e
1487
+ }),
1488
+ /* @__PURE__ */ n("div", {
1489
+ className: Z.wrap,
1490
+ children: [/* @__PURE__ */ n("button", {
1491
+ ...S,
1492
+ ref: M,
1493
+ type: "button",
1494
+ id: w,
1495
+ className: [Z.control, y].filter(Boolean).join(" "),
1496
+ style: b,
1497
+ "aria-haspopup": "dialog",
1498
+ "aria-expanded": P,
1499
+ "aria-labelledby": `${T} ${E}`,
1500
+ "aria-invalid": _ ? !0 : void 0,
1501
+ "aria-describedby": k || void 0,
1502
+ onClick: () => {
1503
+ P ? R(!1) : (L((o || A).slice(0, 7)), F(!0));
1504
+ },
1505
+ children: [/* @__PURE__ */ t(se, {}), /* @__PURE__ */ t("span", {
1506
+ id: E,
1507
+ className: o ? Z.value : Z.placeholder,
1508
+ children: o ? le(o, f) : N.placeholder
1509
+ })]
1510
+ }), P ? /* @__PURE__ */ n("div", {
1511
+ role: "dialog",
1512
+ "aria-label": e,
1513
+ className: Z.popover,
1514
+ children: [/* @__PURE__ */ t(ae, {
1515
+ mode: "single",
1516
+ month: I,
1517
+ onMonthChange: L,
1518
+ value: { from: o },
1519
+ onChange: (e) => {
1520
+ z(e.from);
1521
+ },
1522
+ today: A,
1523
+ locale: f,
1524
+ labels: B
1525
+ }), /* @__PURE__ */ n("div", {
1526
+ className: Z.actions,
1527
+ children: [/* @__PURE__ */ t(d, {
1528
+ variant: "ghost",
1529
+ onClick: () => {
1530
+ z(A);
1531
+ },
1532
+ children: N.today
1533
+ }), /* @__PURE__ */ t(d, {
1534
+ variant: "ghost",
1535
+ onClick: () => {
1536
+ z("");
1537
+ },
1538
+ children: N.clear
1539
+ })]
1540
+ })]
1541
+ }) : null]
1542
+ }),
1543
+ g ? /* @__PURE__ */ t("p", {
1544
+ id: D,
1545
+ className: Z.help,
1546
+ children: g
1547
+ }) : null,
1548
+ _ ? /* @__PURE__ */ t("p", {
1549
+ id: O,
1550
+ role: "alert",
1551
+ className: Z.error,
1552
+ children: _
1553
+ }) : null
1554
+ ]
1555
+ });
1556
+ }
1557
+ // src/time-field/parse-time.ts
1558
+ function de(e) {
1559
+ let t = e.replace(/\D/g, "").slice(0, 4);
1560
+ if (t === "") return null;
1561
+ let n = t;
1562
+ n.length === 3 && (n = `0${n}`), n.length <= 2 && (n = `${n.padStart(2, "0")}00`);
1563
+ let r = Math.min(23, Number(n.slice(0, 2))), i = Math.min(59, Number(n.slice(2)));
1564
+ return `${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}`;
1565
+ }
1566
+ function fe(e) {
1567
+ let t = e.replace(/\D/g, "").slice(0, 4);
1568
+ return t.length > 2 ? `${t.slice(0, 2)}:${t.slice(2)}` : t;
1569
+ }
1570
+ var pe = {
1571
+ root: "_root_ntomw_1",
1572
+ label: "_label_ntomw_8",
1573
+ hidden: "_hidden_ntomw_17",
1574
+ wrap: "_wrap_ntomw_26",
1575
+ icon: "_icon_ntomw_30",
1576
+ control: "_control_ntomw_40",
1577
+ help: "_help_ntomw_65",
1578
+ error: "_error_ntomw_71"
1579
+ };
1580
+ // src/time-field/time-field.tsx
1581
+ function me() {
1582
+ return /* @__PURE__ */ n("svg", {
1583
+ viewBox: "0 0 24 24",
1584
+ width: "16",
1585
+ height: "16",
1586
+ fill: "none",
1587
+ stroke: "currentColor",
1588
+ strokeWidth: "2",
1589
+ strokeLinecap: "round",
1590
+ strokeLinejoin: "round",
1591
+ "aria-hidden": "true",
1592
+ focusable: "false",
1593
+ children: [/* @__PURE__ */ t("circle", {
1594
+ cx: "12",
1595
+ cy: "12",
1596
+ r: "9"
1597
+ }), /* @__PURE__ */ t("path", { d: "M12 7v5l3 2" })]
1598
+ });
1599
+ }
1600
+ function he({ label: e, value: r, onChange: a, onBlur: o, placeholder: s = "hh:mm", hideLabel: c = !1, help: u, error: d, id: f, className: p, style: m, ...h }) {
1601
+ let g = i(), _ = f ?? g, v = `${_}-help`, y = `${_}-error`, b = [u ? v : null, d ? y : null].filter(Boolean).join(" "), [x, S] = l(r), [C, w] = l(r);
1602
+ return C !== r && (w(r), S(r)), /* @__PURE__ */ n("div", {
1603
+ className: pe.root,
1604
+ children: [
1605
+ /* @__PURE__ */ t("label", {
1606
+ htmlFor: _,
1607
+ className: [pe.label, c ? pe.hidden : ""].filter(Boolean).join(" "),
1608
+ children: e
1609
+ }),
1610
+ /* @__PURE__ */ n("div", {
1611
+ className: pe.wrap,
1612
+ children: [/* @__PURE__ */ t("span", {
1613
+ className: pe.icon,
1614
+ children: /* @__PURE__ */ t(me, {})
1615
+ }), /* @__PURE__ */ t("input", {
1616
+ ...h,
1617
+ id: _,
1618
+ type: "text",
1619
+ inputMode: "numeric",
1620
+ maxLength: 5,
1621
+ autoComplete: "off",
1622
+ placeholder: s,
1623
+ value: x,
1624
+ className: [pe.control, p].filter(Boolean).join(" "),
1625
+ style: m,
1626
+ "aria-invalid": d ? !0 : void 0,
1627
+ "aria-describedby": b || void 0,
1628
+ onChange: (e) => {
1629
+ S(fe(e.target.value));
1630
+ },
1631
+ onBlur: () => {
1632
+ let e = de(x) ?? "";
1633
+ S(e), e !== r && a(e), o?.();
1634
+ }
1635
+ })]
1636
+ }),
1637
+ u ? /* @__PURE__ */ t("p", {
1638
+ id: v,
1639
+ className: pe.help,
1640
+ children: u
1641
+ }) : null,
1642
+ d ? /* @__PURE__ */ t("p", {
1643
+ id: y,
1644
+ role: "alert",
1645
+ className: pe.error,
1646
+ children: d
1647
+ }) : null
1648
+ ]
1649
+ });
1650
+ }
1651
+ var ge = {
1652
+ root: "_root_2fjcj_1",
1653
+ legend: "_legend_2fjcj_8",
1654
+ row: "_row_2fjcj_19",
1655
+ help: "_help_2fjcj_26"
1656
+ };
1657
+ // src/date-time-field/date-time-field.tsx
1658
+ function _e({ label: e, value: r, onChange: i, onBlur: a, locale: o = "pt-BR", labels: s, today: c, disabled: u, help: d, error: f, className: p, ...m }) {
1659
+ let h = s?.date ?? `${e}: data`, g = s?.time ?? `${e}: hora (24 horas)`, [_ = "", v = ""] = r.split("T"), [y, b] = l(_), [x, S] = l(v), C = y && x ? `${y}T${x}` : "", [w, T] = l(r);
1660
+ if (w !== r && (T(r), r !== C)) {
1661
+ let [e = "", t = ""] = r.split("T");
1662
+ b(e), S(t);
1663
+ }
1664
+ let E = (e, t) => {
1665
+ b(e), S(t), i(e && t ? `${e}T${t}` : "");
1666
+ };
1667
+ return /* @__PURE__ */ n("fieldset", {
1668
+ ...m,
1669
+ className: [ge.root, p].filter(Boolean).join(" "),
1670
+ children: [
1671
+ /* @__PURE__ */ t("legend", {
1672
+ className: ge.legend,
1673
+ children: e
1674
+ }),
1675
+ /* @__PURE__ */ n("div", {
1676
+ className: ge.row,
1677
+ children: [/* @__PURE__ */ t(ue, {
1678
+ label: h,
1679
+ hideLabel: !0,
1680
+ value: y,
1681
+ onChange: (e) => {
1682
+ E(e, x);
1683
+ },
1684
+ ...a ? { onBlur: a } : {},
1685
+ locale: o,
1686
+ labels: s ?? {},
1687
+ ...c ? { today: c } : {},
1688
+ ...u === void 0 ? {} : { disabled: u },
1689
+ ...f ? { error: f } : {}
1690
+ }), /* @__PURE__ */ t(he, {
1691
+ label: g,
1692
+ hideLabel: !0,
1693
+ value: x,
1694
+ onChange: (e) => {
1695
+ E(y, e);
1696
+ },
1697
+ ...a ? { onBlur: a } : {},
1698
+ placeholder: s?.timePlaceholder ?? "hh:mm",
1699
+ ...u === void 0 ? {} : { disabled: u }
1700
+ })]
1701
+ }),
1702
+ d ? /* @__PURE__ */ t("p", {
1703
+ className: ge.help,
1704
+ children: d
1705
+ }) : null
1706
+ ]
1707
+ });
1708
+ }
1709
+ // src/period-field/period.ts
1710
+ var ve = (e) => String(e).padStart(2, "0");
1711
+ function ye(e) {
1712
+ return `${String(e.getFullYear())}-${ve(e.getMonth() + 1)}-${ve(e.getDate())}`;
1713
+ }
1714
+ function be(e) {
1715
+ let [t = 1970, n = 1, r = 1] = e.split("-").map(Number);
1716
+ return new Date(t, n - 1, r);
1717
+ }
1718
+ function xe(e, t) {
1719
+ let n = be(e);
1720
+ return ye(new Date(n.getFullYear(), n.getMonth(), n.getDate() + t));
1721
+ }
1722
+ function Se(e, t, n = []) {
1723
+ if (e.preset === "custom") return {
1724
+ from: e.from ?? t,
1725
+ to: e.to ?? e.from ?? t
1726
+ };
1727
+ let r = n.find((t) => t.id === e.preset)?.range;
1728
+ return r === void 0 ? null : typeof r == "function" ? r(t) : r < 0 ? {
1729
+ from: xe(t, r),
1730
+ to: t
1731
+ } : {
1732
+ from: t,
1733
+ to: xe(t, r)
1734
+ };
1735
+ }
1736
+ var Q = {
1737
+ root: "_root_lfjll_1",
1738
+ label: "_label_lfjll_8",
1739
+ srOnly: "_srOnly_lfjll_17",
1740
+ wrap: "_wrap_lfjll_29",
1741
+ control: "_control_lfjll_33",
1742
+ popover: "_popover_lfjll_56",
1743
+ presets: "_presets_lfjll_72",
1744
+ preset: "_preset_lfjll_72",
1745
+ custom: "_custom_lfjll_89",
1746
+ customTitle: "_customTitle_lfjll_95",
1747
+ summary: "_summary_lfjll_105",
1748
+ error: "_error_lfjll_112"
1749
+ }, Ce = {
1750
+ title: "Escolher período",
1751
+ custom: "Personalizado",
1752
+ apply: "Aplicar",
1753
+ firstDay: "Escolha o primeiro dia.",
1754
+ lastDay: "escolha o último dia",
1755
+ firstDayError: "Escolha o primeiro dia no calendário.",
1756
+ previous: "Mês anterior",
1757
+ next: "Próximo mês",
1758
+ todayMarker: "hoje"
1759
+ }, we = 8;
1760
+ function Te() {
1761
+ let e = /* @__PURE__ */ new Date(), t = (e) => String(e).padStart(2, "0");
1762
+ return `${String(e.getFullYear())}-${t(e.getMonth() + 1)}-${t(e.getDate())}`;
1763
+ }
1764
+ function Ee() {
1765
+ return /* @__PURE__ */ n("svg", {
1766
+ viewBox: "0 0 24 24",
1767
+ width: "16",
1768
+ height: "16",
1769
+ fill: "none",
1770
+ stroke: "currentColor",
1771
+ strokeWidth: "2",
1772
+ strokeLinecap: "round",
1773
+ strokeLinejoin: "round",
1774
+ "aria-hidden": "true",
1775
+ focusable: "false",
1776
+ children: [/* @__PURE__ */ t("rect", {
1777
+ x: "3",
1778
+ y: "4",
1779
+ width: "18",
1780
+ height: "18",
1781
+ rx: "2"
1782
+ }), /* @__PURE__ */ t("path", { d: "M16 2v4M8 2v4M3 10h18" })]
1783
+ });
1784
+ }
1785
+ function De({ label: s, labelVisible: u = !0, value: f, onChange: p, presets: m, allowCustom: h = !0, placement: g, today: _, locale: v = "pt-BR", labels: y, name: b, className: x, style: S, ref: C, ...w }) {
1786
+ let T = i(), E = _ ?? Te(), D = {
1787
+ ...Ce,
1788
+ ...y
1789
+ }, O = c(null), k = c(null);
1790
+ a(C, () => k.current, []);
1791
+ let A = c(null), [j, M] = l(!1), [N, P] = l({ from: "" }), [F, I] = l(E.slice(0, 7)), [L, R] = l(!1), z = new Intl.DateTimeFormat(v), B = (e) => {
1792
+ let [t = 1970, n = 1, r = 1] = e.split("-").map(Number);
1793
+ return z.format(new Date(t, n - 1, r));
1794
+ }, V = Se(f, E, m), H = f.preset === "custom" && f.from && f.to ? `${B(f.from)} – ${B(f.to)}` : f.preset === "custom" ? D.custom : m.find((e) => e.id === f.preset)?.label ?? "";
1795
+ function U(e) {
1796
+ M(!1), e && k.current?.focus();
1797
+ }
1798
+ function W() {
1799
+ let e = f.preset === "custom" && f.from ? f.from : E;
1800
+ P(f.preset === "custom" && f.from ? {
1801
+ from: f.from,
1802
+ ...f.to ? { to: f.to } : {}
1803
+ } : { from: "" }), I(e.slice(0, 7)), R(!1), M(!0);
1804
+ }
1805
+ o(() => {
1806
+ if (!j) return;
1807
+ let e = () => {
1808
+ let e = A.current, t = k.current;
1809
+ if (!e || !t) return;
1810
+ let n = t.getBoundingClientRect();
1811
+ e.style.maxHeight = `${String(window.innerHeight - 16)}px`;
1812
+ let r = e.offsetWidth, i = e.offsetHeight, a = g === "form" ? n.left + (n.width - r) / 2 : n.right - r, o = Math.max(we, Math.min(a, window.innerWidth - r - we)), s = n.bottom + 6, c = s + i <= window.innerHeight - we ? s : Math.max(we, window.innerHeight - we - i);
1813
+ e.style.left = `${String(o)}px`, e.style.top = `${String(c)}px`;
1814
+ };
1815
+ return e(), window.addEventListener("resize", e), document.addEventListener("scroll", e, !0), () => {
1816
+ window.removeEventListener("resize", e), document.removeEventListener("scroll", e, !0);
1817
+ };
1818
+ }, [j, g]), r(() => {
1819
+ if (!j) return;
1820
+ A.current?.querySelector("[aria-pressed=\"true\"]")?.focus();
1821
+ let e = (e) => {
1822
+ O.current?.contains(e.target) || M(!1);
1823
+ }, t = (e) => {
1824
+ e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), U(!0));
1825
+ };
1826
+ return document.addEventListener("pointerdown", e, !0), document.addEventListener("keydown", t, !0), () => {
1827
+ document.removeEventListener("pointerdown", e, !0), document.removeEventListener("keydown", t, !0);
1828
+ };
1829
+ }, [j]);
1830
+ function G(e) {
1831
+ p({ preset: e.id }), U(!0);
1832
+ }
1833
+ function K(e) {
1834
+ e.preventDefault(), N.from ? (p({
1835
+ preset: "custom",
1836
+ from: N.from,
1837
+ to: N.to ?? N.from
1838
+ }), U(!0)) : R(!0);
1839
+ }
1840
+ let q = N.from ? N.to ? `${B(N.from)} – ${B(N.to)}` : `${B(N.from)} · ${D.lastDay}` : D.firstDay;
1841
+ return /* @__PURE__ */ n("div", {
1842
+ className: Q.root,
1843
+ ref: O,
1844
+ children: [
1845
+ s ? /* @__PURE__ */ t("span", {
1846
+ id: `${T}-label`,
1847
+ className: u ? Q.label : Q.srOnly,
1848
+ children: s
1849
+ }) : null,
1850
+ /* @__PURE__ */ n("div", {
1851
+ className: Q.wrap,
1852
+ children: [/* @__PURE__ */ n("button", {
1853
+ ...w,
1854
+ ref: k,
1855
+ type: "button",
1856
+ className: [Q.control, x].filter(Boolean).join(" "),
1857
+ style: S,
1858
+ "aria-haspopup": "dialog",
1859
+ "aria-expanded": j,
1860
+ ...s ? { "aria-labelledby": `${T}-label ${T}-value` } : {},
1861
+ onClick: () => {
1862
+ j ? U(!1) : W();
1863
+ },
1864
+ children: [/* @__PURE__ */ t(Ee, {}), /* @__PURE__ */ t("span", {
1865
+ id: `${T}-value`,
1866
+ children: H
1867
+ })]
1868
+ }), j ? /* @__PURE__ */ n("div", {
1869
+ ref: A,
1870
+ role: "dialog",
1871
+ "aria-label": D.title,
1872
+ className: Q.popover,
1873
+ children: [/* @__PURE__ */ t("div", {
1874
+ className: Q.presets,
1875
+ children: m.map((e) => /* @__PURE__ */ t(d, {
1876
+ variant: "ghost",
1877
+ className: Q.preset,
1878
+ "aria-pressed": f.preset === e.id,
1879
+ onClick: () => {
1880
+ G(e);
1881
+ },
1882
+ children: e.label
1883
+ }, e.id))
1884
+ }), h ? /* @__PURE__ */ n("form", {
1885
+ className: Q.custom,
1886
+ noValidate: !0,
1887
+ onSubmit: K,
1888
+ children: [
1889
+ /* @__PURE__ */ t("p", {
1890
+ className: Q.customTitle,
1891
+ children: D.custom
1892
+ }),
1893
+ /* @__PURE__ */ t(ae, {
1894
+ mode: "range",
1895
+ month: F,
1896
+ onMonthChange: I,
1897
+ value: N,
1898
+ onChange: (e) => {
1899
+ P(e), R(!1);
1900
+ },
1901
+ today: E,
1902
+ locale: v,
1903
+ labels: {
1904
+ previous: D.previous,
1905
+ next: D.next,
1906
+ today: D.todayMarker
1907
+ }
1908
+ }),
1909
+ /* @__PURE__ */ t("p", {
1910
+ className: Q.summary,
1911
+ "aria-live": "polite",
1912
+ children: q
1913
+ }),
1914
+ L ? /* @__PURE__ */ t("p", {
1915
+ role: "alert",
1916
+ className: Q.error,
1917
+ children: D.firstDayError
1918
+ }) : null,
1919
+ /* @__PURE__ */ t(d, {
1920
+ variant: "primary",
1921
+ type: "submit",
1922
+ children: D.apply
1923
+ })
1924
+ ]
1925
+ }) : null]
1926
+ }) : null]
1927
+ }),
1928
+ b ? /* @__PURE__ */ n(e, { children: [
1929
+ /* @__PURE__ */ t("input", {
1930
+ type: "hidden",
1931
+ name: b,
1932
+ value: f.preset
1933
+ }),
1934
+ /* @__PURE__ */ t("input", {
1935
+ type: "hidden",
1936
+ name: `${b}From`,
1937
+ value: V?.from ?? ""
1938
+ }),
1939
+ /* @__PURE__ */ t("input", {
1940
+ type: "hidden",
1941
+ name: `${b}To`,
1942
+ value: V?.to ?? ""
1943
+ })
1944
+ ] }) : null
1945
+ ]
1946
+ });
1947
+ }
1948
+ // src/money-field/money-mask.ts
1949
+ var Oe = /* @__PURE__ */ new Map();
1950
+ function ke(e, t) {
1951
+ let n = `${e}|${t}`, r = Oe.get(n);
1952
+ if (r) return r;
1953
+ let i = new Intl.NumberFormat(e, {
1954
+ style: "currency",
1955
+ currency: t
1956
+ }), a = i.formatToParts(1), o = a.findIndex((e) => e.type === "integer"), s = o;
1957
+ a.forEach((e, t) => {
1958
+ (e.type === "integer" || e.type === "fraction") && (s = t);
1959
+ });
1960
+ let c = i.formatToParts(1234567.5), l = {
1961
+ prefix: a.slice(0, o).map((e) => e.value).join(""),
1962
+ suffix: a.slice(s + 1).map((e) => e.value).join(""),
1963
+ group: c.find((e) => e.type === "group")?.value ?? "",
1964
+ decimal: c.find((e) => e.type === "decimal")?.value ?? ","
1965
+ };
1966
+ return Oe.set(n, l), l;
1967
+ }
1968
+ function Ae(e, t) {
1969
+ let n = e;
1970
+ return t.prefix.trim() !== "" && (n = n.split(t.prefix.trim()).join("")), t.suffix.trim() !== "" && (n = n.split(t.suffix.trim()).join("")), n;
1971
+ }
1972
+ function je(e, t) {
1973
+ let n = Ae(e, t), r = n.lastIndexOf(t.decimal), i = r >= 0, a = i ? n.slice(0, r) : n, o = i ? n.slice(r + t.decimal.length) : "";
1974
+ return {
1975
+ whole: a.replace(/\D/g, "").replace(/^0+/, ""),
1976
+ fraction: o.replace(/\D/g, "").slice(0, 2),
1977
+ hasDecimal: i
1978
+ };
1979
+ }
1980
+ function Me(e, t, n) {
1981
+ let r = ke(t, n), { whole: i, fraction: a, hasDecimal: o } = je(e, r);
1982
+ if (i === "" && a === "" && !o) return "";
1983
+ let s = (i === "" ? "0" : i).replace(/\B(?=(\d{3})+(?!\d))/g, r.group);
1984
+ return `${r.prefix}${s}${o ? r.decimal + a : ""}${r.suffix}`;
1985
+ }
1986
+ function Ne(e, t, n) {
1987
+ let { whole: r, fraction: i } = je(e, ke(t, n));
1988
+ if (r === "" && i === "") return null;
1989
+ let a = Number(r === "" ? "0" : r) * 100 + Number(i.padEnd(2, "0"));
1990
+ return Number.isSafeInteger(a) ? a : null;
1991
+ }
1992
+ function Pe(e, t, n) {
1993
+ return new Intl.NumberFormat(t, {
1994
+ style: "currency",
1995
+ currency: n,
1996
+ minimumFractionDigits: 2,
1997
+ maximumFractionDigits: 2
1998
+ }).format(e / 100);
1999
+ }
2000
+ var Fe = { root: "_root_13auc_2" };
2001
+ // src/money-field/money-field.tsx
2002
+ function Ie({ valueCents: e, onChange: n, locale: r = "pt-BR", currency: i = "BRL", onBlur: a, className: o, ...s }) {
2003
+ let [c, u] = l(() => e === null ? "" : Pe(e, r, i)), [d, f] = l({
2004
+ valueCents: e,
2005
+ locale: r,
2006
+ currency: i
2007
+ });
2008
+ return (d.valueCents !== e || d.locale !== r || d.currency !== i) && (f({
2009
+ valueCents: e,
2010
+ locale: r,
2011
+ currency: i
2012
+ }), Ne(c, r, i) !== e && u(e === null ? "" : Pe(e, r, i))), /* @__PURE__ */ t(_, {
2013
+ ...s,
2014
+ className: [Fe.root, o].filter(Boolean).join(" "),
2015
+ inputMode: "decimal",
2016
+ autoComplete: "off",
2017
+ value: c,
2018
+ onChange: (e) => {
2019
+ let t = Me(e.target.value, r, i);
2020
+ u(t), n(Ne(t, r, i));
2021
+ },
2022
+ onBlur: (e) => {
2023
+ let t = Ne(c, r, i);
2024
+ t !== null && u(Pe(t, r, i)), a?.(e);
2025
+ }
2026
+ });
2027
+ }
2028
+ var Le = {
2029
+ root: "_root_1v7mn_1",
2030
+ primary: "_primary_1v7mn_11",
2031
+ accent: "_accent_1v7mn_16",
2032
+ success: "_success_1v7mn_21",
2033
+ warning: "_warning_1v7mn_26",
2034
+ danger: "_danger_1v7mn_31",
2035
+ info: "_info_1v7mn_36"
2036
+ };
2037
+ // src/card/card.tsx
2038
+ function Re({ as: e = "div", tone: n = "default", className: r, ...i }) {
2039
+ let a = [
2040
+ Le.root,
2041
+ n === "default" ? null : Le[n],
2042
+ r
2043
+ ].filter(Boolean).join(" ");
2044
+ return /* @__PURE__ */ t(e, {
2045
+ ...i,
2046
+ className: a
2047
+ });
2048
+ }
2049
+ var ze = {
2050
+ root: "_root_rjx3r_1",
2051
+ titleBlock: "_titleBlock_rjx3r_11",
2052
+ back: "_back_rjx3r_15",
2053
+ stuck: "_stuck_rjx3r_19",
2054
+ compact: "_compact_rjx3r_23",
2055
+ pageHeading: "_pageHeading_rjx3r_23",
2056
+ eyebrow: "_eyebrow_rjx3r_36",
2057
+ subtitle: "_subtitle_rjx3r_61",
2058
+ actions: "_actions_rjx3r_69"
2059
+ };
2060
+ // src/page-header/page-header.tsx
2061
+ function Be({ title: e, eyebrow: r, subtitle: i, actions: a, back: o, stuck: s = !1, compact: c = !1, headingRef: l, className: u, ...d }) {
2062
+ let f = [
2063
+ ze.root,
2064
+ s ? ze.stuck : "",
2065
+ c ? ze.compact : "",
2066
+ u
2067
+ ].filter(Boolean).join(" ");
2068
+ return /* @__PURE__ */ n("header", {
2069
+ ...d,
2070
+ className: f,
2071
+ ...s ? { "data-stuck": "" } : {},
2072
+ ...c ? { "data-compact": "" } : {},
2073
+ children: [/* @__PURE__ */ n("div", {
2074
+ className: ze.titleBlock,
2075
+ children: [
2076
+ o ? /* @__PURE__ */ t("div", {
2077
+ className: ze.back,
2078
+ children: o
2079
+ }) : null,
2080
+ r ? /* @__PURE__ */ t("p", {
2081
+ className: ze.eyebrow,
2082
+ children: r
2083
+ }) : null,
2084
+ /* @__PURE__ */ t("h1", {
2085
+ ref: l,
2086
+ tabIndex: -1,
2087
+ "data-page-heading": "",
2088
+ className: ze.pageHeading,
2089
+ children: e
2090
+ }),
2091
+ i && !c ? /* @__PURE__ */ t("p", {
2092
+ className: ze.subtitle,
2093
+ children: i
2094
+ }) : null
2095
+ ]
2096
+ }), a ? /* @__PURE__ */ t("div", {
2097
+ className: ze.actions,
2098
+ children: a
2099
+ }) : null]
2100
+ });
2101
+ }
2102
+ var Ve = {
2103
+ root: "_root_1akxr_1",
2104
+ search: "_search_1akxr_9",
2105
+ filters: "_filters_1akxr_14",
2106
+ trailing: "_trailing_1akxr_21"
2107
+ };
2108
+ // src/toolbar/toolbar.tsx
2109
+ function He({ searchLabel: e = "Buscar", searchValue: r, onSearchChange: i, searchPlaceholder: a, filters: o, children: s, className: c, ...l }) {
2110
+ return /* @__PURE__ */ n("div", {
2111
+ ...l,
2112
+ className: [Ve.root, c].filter(Boolean).join(" "),
2113
+ children: [
2114
+ /* @__PURE__ */ t("div", {
2115
+ role: "search",
2116
+ className: Ve.search,
2117
+ children: /* @__PURE__ */ t(_, {
2118
+ type: "search",
2119
+ label: e,
2120
+ placeholder: a,
2121
+ value: r,
2122
+ onChange: (e) => {
2123
+ i(e.target.value);
2124
+ }
2125
+ })
2126
+ }),
2127
+ o ? /* @__PURE__ */ t("div", {
2128
+ className: Ve.filters,
2129
+ children: o
2130
+ }) : null,
2131
+ s ? /* @__PURE__ */ t("div", {
2132
+ className: Ve.trailing,
2133
+ children: s
2134
+ }) : null
2135
+ ]
2136
+ });
2137
+ }
2138
+ var Ue = {
2139
+ list: "_list_jx4ch_1",
2140
+ tab: "_tab_jx4ch_9",
2141
+ panel: "_panel_jx4ch_37"
2142
+ };
2143
+ // src/tabs/tabs.tsx
2144
+ function We({ label: e, tabs: r, value: a, defaultValue: o, onChange: s, ...u }) {
2145
+ let d = i(), [f, p] = l(o ?? r[0]?.id), m = c({}), [h, g] = l(void 0), _ = a ?? f, v = h ?? _;
2146
+ function y(e) {
2147
+ p(e), s?.(e);
2148
+ }
2149
+ function b(e) {
2150
+ let t = r[(e + r.length) % r.length];
2151
+ t && (g(t.id), m.current[t.id]?.focus());
2152
+ }
2153
+ function x(e, t) {
2154
+ let n = {
2155
+ ArrowRight: t + 1,
2156
+ ArrowLeft: t - 1,
2157
+ Home: 0,
2158
+ End: r.length - 1
2159
+ }[e.key];
2160
+ n !== void 0 && (e.preventDefault(), b(n));
2161
+ }
2162
+ return /* @__PURE__ */ n("div", {
2163
+ ...u,
2164
+ children: [/* @__PURE__ */ t("div", {
2165
+ role: "tablist",
2166
+ "aria-label": e,
2167
+ className: Ue.list,
2168
+ children: r.map((e, n) => {
2169
+ let r = e.id === _;
2170
+ return /* @__PURE__ */ t("button", {
2171
+ ref: (t) => {
2172
+ m.current[e.id] = t;
2173
+ },
2174
+ type: "button",
2175
+ role: "tab",
2176
+ id: `${d}-tab-${e.id}`,
2177
+ "aria-selected": r,
2178
+ "aria-controls": `${d}-panel-${e.id}`,
2179
+ tabIndex: e.id === v ? 0 : -1,
2180
+ className: Ue.tab,
2181
+ onClick: () => {
2182
+ y(e.id);
2183
+ },
2184
+ onFocus: () => {
2185
+ g(e.id);
2186
+ },
2187
+ onBlur: () => {
2188
+ g(void 0);
2189
+ },
2190
+ onKeyDown: (e) => {
2191
+ x(e, n);
2192
+ },
2193
+ children: e.label
2194
+ }, e.id);
2195
+ })
2196
+ }), r.map((e) => /* @__PURE__ */ t("div", {
2197
+ role: "tabpanel",
2198
+ id: `${d}-panel-${e.id}`,
2199
+ "aria-labelledby": `${d}-tab-${e.id}`,
2200
+ hidden: e.id !== _,
2201
+ className: Ue.panel,
2202
+ children: e.id === _ ? e.panel : null
2203
+ }, e.id))]
2204
+ });
2205
+ }
2206
+ var Ge = {
2207
+ root: "_root_1336w_1",
2208
+ option: "_option_1336w_12"
2209
+ };
2210
+ // src/view-switcher/view-switcher.tsx
2211
+ function Ke({ label: e, options: n, value: r, onChange: i, className: a, ...o }) {
2212
+ return /* @__PURE__ */ t("div", {
2213
+ ...o,
2214
+ role: "group",
2215
+ "aria-label": e,
2216
+ className: [Ge.root, a].filter(Boolean).join(" "),
2217
+ children: n.map((e) => /* @__PURE__ */ t("button", {
2218
+ type: "button",
2219
+ "aria-pressed": e.value === r,
2220
+ "aria-label": e.label,
2221
+ title: e.label,
2222
+ className: Ge.option,
2223
+ onClick: () => {
2224
+ i(e.value);
2225
+ },
2226
+ children: e.icon
2227
+ }, e.value))
2228
+ });
2229
+ }
2230
+ var qe = {
2231
+ grid: "_grid_11vah_2",
2232
+ actions: "_actions_11vah_21"
2233
+ };
2234
+ // src/form-layout/form-layout.tsx
2235
+ function Je({ className: e, ...n }) {
2236
+ return /* @__PURE__ */ t("div", {
2237
+ ...n,
2238
+ className: [qe.grid, e].filter(Boolean).join(" ")
2239
+ });
2240
+ }
2241
+ function Ye({ cancelLabel: e = "Cancelar", submitLabel: r = "Salvar", onCancel: i, loading: a = !1, submitDisabled: o = !1, className: s, ...c }) {
2242
+ return /* @__PURE__ */ n("div", {
2243
+ ...c,
2244
+ className: [qe.actions, s].filter(Boolean).join(" "),
2245
+ "data-span": "full",
2246
+ children: [/* @__PURE__ */ t(d, {
2247
+ variant: "muted",
2248
+ onClick: i,
2249
+ children: e
2250
+ }), /* @__PURE__ */ t(d, {
2251
+ variant: "primary",
2252
+ type: "submit",
2253
+ loading: a,
2254
+ disabled: o,
2255
+ children: r
2256
+ })]
2257
+ });
2258
+ }
2259
+ var Xe = {
2260
+ root: "_root_1n0kf_2",
2261
+ wide: "_wide_1n0kf_13",
2262
+ inner: "_inner_1n0kf_21",
2263
+ title: "_title_1n0kf_25",
2264
+ body: "_body_1n0kf_33",
2265
+ actions: "_actions_1n0kf_37"
2266
+ }, Ze = "button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])";
2267
+ function Qe(e) {
2268
+ return Array.from(e.querySelectorAll(Ze)).filter((e) => !e.hasAttribute("disabled"));
2269
+ }
2270
+ function $e({ open: e, title: o, onClose: s, children: l, actions: u, role: d = "dialog", size: f = "default", closeOnBackdrop: p = !1, "aria-describedby": m, className: h, ref: g, ..._ }) {
2271
+ let v = i(), y = c(null);
2272
+ a(g, () => y.current), r(() => {
2273
+ let t = y.current;
2274
+ if (!t || !e) return;
2275
+ let n = document.activeElement instanceof HTMLElement ? document.activeElement : null;
2276
+ t.showModal();
2277
+ let r = t.querySelector("[data-dialog-body]"), i = t.querySelector("[data-dialog-actions]");
2278
+ return (t.querySelector("[data-autofocus]") ?? (r ? Qe(r)[0] : void 0) ?? (i ? Qe(i)[0] : void 0))?.focus(), () => {
2279
+ t.close(), n?.focus();
2280
+ };
2281
+ }, [e]);
2282
+ function b(e) {
2283
+ if (_.onKeyDown?.(e), e.key === "Escape") {
2284
+ e.preventDefault(), s();
2285
+ return;
2286
+ }
2287
+ if (e.key !== "Tab") return;
2288
+ let t = Qe(e.currentTarget), n = t[0], r = t[t.length - 1];
2289
+ n && r && (e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus()));
2290
+ }
2291
+ if (!e) return null;
2292
+ let x = [
2293
+ Xe.root,
2294
+ f === "wide" ? Xe.wide : "",
2295
+ h
2296
+ ].filter(Boolean).join(" ");
2297
+ return /* @__PURE__ */ t("dialog", {
2298
+ ..._,
2299
+ ref: y,
2300
+ role: d,
2301
+ "aria-labelledby": `${v}-title`,
2302
+ "aria-describedby": m ?? (d === "alertdialog" ? `${v}-body` : void 0),
2303
+ className: x,
2304
+ onKeyDown: b,
2305
+ onCancel: (e) => {
2306
+ _.onCancel?.(e), e.preventDefault(), s();
2307
+ },
2308
+ onClick: (e) => {
2309
+ _.onClick?.(e), p && e.target === e.currentTarget && s();
2310
+ },
2311
+ children: /* @__PURE__ */ n("div", {
2312
+ className: Xe.inner,
2313
+ children: [
2314
+ /* @__PURE__ */ t("h2", {
2315
+ id: `${v}-title`,
2316
+ className: Xe.title,
2317
+ children: o
2318
+ }),
2319
+ /* @__PURE__ */ t("div", {
2320
+ id: `${v}-body`,
2321
+ className: Xe.body,
2322
+ "data-dialog-body": "",
2323
+ children: l
2324
+ }),
2325
+ /* @__PURE__ */ t("div", {
2326
+ className: Xe.actions,
2327
+ "data-dialog-actions": "",
2328
+ children: u
2329
+ })
2330
+ ]
2331
+ })
2332
+ });
2333
+ }
2334
+ var et = { description: "_description_1ftx2_1" };
2335
+ // src/confirm-dialog/confirm-dialog.tsx
2336
+ function tt({ description: r, confirmLabel: i = "Confirmar", cancelLabel: a = "Cancelar", onConfirm: o, onCancel: s, ...c }) {
2337
+ return /* @__PURE__ */ t($e, {
2338
+ ...c,
2339
+ role: "alertdialog",
2340
+ onClose: s,
2341
+ actions: /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t(d, {
2342
+ "data-autofocus": "",
2343
+ variant: "secondary",
2344
+ onClick: s,
2345
+ children: a
2346
+ }), /* @__PURE__ */ t(d, {
2347
+ variant: "primary",
2348
+ onClick: o,
2349
+ children: i
2350
+ })] }),
2351
+ children: /* @__PURE__ */ t("p", {
2352
+ className: et.description,
2353
+ children: r
2354
+ })
2355
+ });
2356
+ }
2357
+ var nt = {
2358
+ region: "_region_1l4ou_1",
2359
+ root: "_root_1l4ou_14",
2360
+ icon: "_icon_1l4ou_27",
2361
+ srOnly: "_srOnly_1l4ou_31",
2362
+ info: "_info_1l4ou_43",
2363
+ success: "_success_1l4ou_48",
2364
+ warning: "_warning_1l4ou_53",
2365
+ danger: "_danger_1l4ou_58"
2366
+ }, rt = {
2367
+ info: "Informação",
2368
+ success: "Sucesso",
2369
+ warning: "Atenção",
2370
+ danger: "Erro"
2371
+ }, it = {
2372
+ info: ["M12 11v5M12 8h.01"],
2373
+ success: ["M8 12l3 3 5-6"],
2374
+ warning: ["M12 10v4M12 17h.01"],
2375
+ danger: ["M9 9l6 6M15 9l-6 6"]
2376
+ };
2377
+ function at({ tone: e }) {
2378
+ return /* @__PURE__ */ n("svg", {
2379
+ className: nt.icon,
2380
+ width: "16",
2381
+ height: "16",
2382
+ viewBox: "0 0 24 24",
2383
+ fill: "none",
2384
+ stroke: "currentColor",
2385
+ strokeWidth: "2",
2386
+ strokeLinecap: "round",
2387
+ strokeLinejoin: "round",
2388
+ "aria-hidden": "true",
2389
+ focusable: "false",
2390
+ children: [e === "warning" ? /* @__PURE__ */ t("path", { d: "M12 3l9 16H3z" }) : /* @__PURE__ */ t("circle", {
2391
+ cx: "12",
2392
+ cy: "12",
2393
+ r: "9"
2394
+ }), it[e].map((e) => /* @__PURE__ */ t("path", { d: e }, e))]
2395
+ });
2396
+ }
2397
+ function ot({ className: e, ...n }) {
2398
+ return /* @__PURE__ */ t("div", {
2399
+ ...n,
2400
+ "aria-live": "polite",
2401
+ className: [nt.region, e].filter(Boolean).join(" ")
2402
+ });
2403
+ }
2404
+ function st({ tone: e = "info", toneLabel: r = rt[e], className: i, children: a, ...o }) {
2405
+ return /* @__PURE__ */ n("div", {
2406
+ ...o,
2407
+ className: [
2408
+ nt.root,
2409
+ nt[e],
2410
+ i
2411
+ ].filter(Boolean).join(" "),
2412
+ children: [
2413
+ /* @__PURE__ */ t(at, { tone: e }),
2414
+ /* @__PURE__ */ t("span", {
2415
+ className: nt.srOnly,
2416
+ children: `${r}: `
2417
+ }),
2418
+ /* @__PURE__ */ t("span", { children: a })
2419
+ ]
2420
+ });
2421
+ }
2422
+ var ct = {
2423
+ root: "_root_13abh_1",
2424
+ title: "_title_13abh_10",
2425
+ description: "_description_13abh_18",
2426
+ action: "_action_13abh_25"
2427
+ };
2428
+ // src/empty-state/empty-state.tsx
2429
+ function lt({ title: e, description: r, action: i, className: a, style: o, ...s }) {
2430
+ return /* @__PURE__ */ n("div", {
2431
+ ...s,
2432
+ className: [ct.root, a].filter(Boolean).join(" "),
2433
+ style: o,
2434
+ children: [
2435
+ /* @__PURE__ */ t("p", {
2436
+ className: ct.title,
2437
+ children: e
2438
+ }),
2439
+ /* @__PURE__ */ t("p", {
2440
+ className: ct.description,
2441
+ children: r
2442
+ }),
2443
+ i ? /* @__PURE__ */ t("div", {
2444
+ className: ct.action,
2445
+ children: i
2446
+ }) : null
2447
+ ]
2448
+ });
2449
+ }
2450
+ var ut = {
2451
+ root: "_root_1hr22_1",
2452
+ skeleton: "_skeleton_1hr22_5",
2453
+ row: "_row_1hr22_10",
2454
+ visuallyHidden: "_visuallyHidden_1hr22_17"
2455
+ };
2456
+ // src/loading-state/loading-state.tsx
2457
+ function dt({ rows: e = 3, className: n, style: r, ...i }) {
2458
+ return /* @__PURE__ */ t("div", {
2459
+ ...i,
2460
+ className: [ut.skeleton, n].filter(Boolean).join(" "),
2461
+ style: r,
2462
+ "aria-hidden": "true",
2463
+ children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ t("i", { className: ut.row }, n))
2464
+ });
2465
+ }
2466
+ function ft({ label: e = "Carregando", rows: r, className: i, style: a, ...o }) {
2467
+ return /* @__PURE__ */ n("div", {
2468
+ ...o,
2469
+ className: [ut.root, i].filter(Boolean).join(" "),
2470
+ style: a,
2471
+ role: "status",
2472
+ "aria-busy": "true",
2473
+ children: [/* @__PURE__ */ t("span", {
2474
+ className: ut.visuallyHidden,
2475
+ children: e
2476
+ }), /* @__PURE__ */ t(dt, { rows: r })]
2477
+ });
2478
+ }
2479
+ var pt = {
2480
+ root: "_root_gqjnf_1",
2481
+ title: "_title_gqjnf_10",
2482
+ description: "_description_gqjnf_17",
2483
+ action: "_action_gqjnf_24"
2484
+ };
2485
+ // src/error-state/error-state.tsx
2486
+ function mt({ title: e = "Não foi possível carregar.", description: r, retryLabel: i = "Tentar de novo", onRetry: a, className: o, style: s, ...c }) {
2487
+ return /* @__PURE__ */ n("div", {
2488
+ ...c,
2489
+ className: [pt.root, o].filter(Boolean).join(" "),
2490
+ style: s,
2491
+ role: "alert",
2492
+ children: [
2493
+ /* @__PURE__ */ t("p", {
2494
+ className: pt.title,
2495
+ children: e
2496
+ }),
2497
+ r ? /* @__PURE__ */ t("p", {
2498
+ className: pt.description,
2499
+ children: r
2500
+ }) : null,
2501
+ a ? /* @__PURE__ */ t("div", {
2502
+ className: pt.action,
2503
+ children: /* @__PURE__ */ t(d, {
2504
+ onClick: a,
2505
+ children: i
2506
+ })
2507
+ }) : null
2508
+ ]
2509
+ });
2510
+ }
2511
+ var ht = {
2512
+ root: "_root_1ikd9_1",
2513
+ fill: "_fill_1ikd9_8"
2514
+ };
2515
+ // src/progress-bar/progress-bar.tsx
2516
+ function gt({ label: e, value: n, max: r = 100, className: i, style: a, ...o }) {
2517
+ let s = Math.min(Math.max(n, 0), r), c = r > 0 ? s / r * 100 : 0;
2518
+ return /* @__PURE__ */ t("div", {
2519
+ ...o,
2520
+ className: [ht.root, i].filter(Boolean).join(" "),
2521
+ style: a,
2522
+ role: "progressbar",
2523
+ "aria-label": e,
2524
+ "aria-valuenow": s,
2525
+ "aria-valuemin": 0,
2526
+ "aria-valuemax": r,
2527
+ children: /* @__PURE__ */ t("span", {
2528
+ className: ht.fill,
2529
+ style: { width: `${String(c)}%` }
2530
+ })
2531
+ });
2532
+ }
2533
+ var _t = {
2534
+ root: "_root_1tkha_1",
2535
+ mark: "_mark_1tkha_8",
2536
+ name: "_name_1tkha_20"
2537
+ };
2538
+ // src/brand-logo/brand-logo.tsx
2539
+ function vt({ name: e, mark: r, className: i, ...a }) {
2540
+ return /* @__PURE__ */ n("div", {
2541
+ ...a,
2542
+ className: [_t.root, i].filter(Boolean).join(" "),
2543
+ children: [/* @__PURE__ */ t("span", {
2544
+ "aria-hidden": "true",
2545
+ className: _t.mark,
2546
+ children: r
2547
+ }), /* @__PURE__ */ t("span", {
2548
+ className: _t.name,
2549
+ children: e
2550
+ })]
2551
+ });
2552
+ }
2553
+ var yt = {
2554
+ root: "_root_1fzd7_1",
2555
+ neutral: "_neutral_1fzd7_11",
2556
+ primary: "_primary_1fzd7_16",
2557
+ accent: "_accent_1fzd7_21",
2558
+ success: "_success_1fzd7_26",
2559
+ warning: "_warning_1fzd7_31",
2560
+ danger: "_danger_1fzd7_36",
2561
+ info: "_info_1fzd7_41"
2562
+ };
2563
+ // src/badge/badge.tsx
2564
+ function bt({ tone: e = "primary", className: n, ...r }) {
2565
+ let i = [
2566
+ yt.root,
2567
+ yt[e],
2568
+ n
2569
+ ].filter(Boolean).join(" ");
2570
+ return /* @__PURE__ */ t("span", {
2571
+ ...r,
2572
+ className: i
2573
+ });
2574
+ }
2575
+ var xt = { root: "_root_1slwb_1" }, St = {
2576
+ bg: "#F3F0FA",
2577
+ bgElevated: "#FAF8FE",
2578
+ surface: "#FFFFFF",
2579
+ surfaceMuted: "#EAE5F6",
2580
+ surfaceHover: "#E1DAF2",
2581
+ border: "#D9D1EC",
2582
+ borderStrong: "#BFB3DD",
2583
+ elevation1: "#FFFFFF",
2584
+ elevation2: "#FFFFFF",
2585
+ elevation3: "#FFFFFF",
2586
+ primary: "#6D28D9",
2587
+ primaryHover: "#5B21B6",
2588
+ primaryBright: "#A855F7",
2589
+ primarySoft: "#EBE0FD",
2590
+ primaryOn: "#FFFFFF",
2591
+ accent: "#0E7490",
2592
+ accentFill: "#06B6D4",
2593
+ accentBright: "#22D3EE",
2594
+ accentSoft: "#D8F1F6",
2595
+ text: "#1A1230",
2596
+ textMuted: "#4F4469",
2597
+ textFaint: "#8B84A3",
2598
+ success: "#047857",
2599
+ successSoft: "#D9F3E7",
2600
+ warning: "#92400E",
2601
+ warningSoft: "#FCEFCF",
2602
+ danger: "#BE123C",
2603
+ dangerSoft: "#FDE2E9",
2604
+ info: "#0369A1",
2605
+ infoSoft: "#DAEEFB",
2606
+ shadowSm: "0 1px 2px rgba(42, 24, 96, 0.08)",
2607
+ shadowMd: "0 4px 12px rgba(42, 24, 96, 0.10), 0 1px 3px rgba(42, 24, 96, 0.06)",
2608
+ shadowLg: "0 18px 44px rgba(42, 24, 96, 0.20), 0 4px 12px rgba(42, 24, 96, 0.08)"
2609
+ }, Ct = {
2610
+ bg: "#0B0816",
2611
+ bgElevated: "#110B21",
2612
+ surface: "#181028",
2613
+ surfaceMuted: "#130D22",
2614
+ surfaceHover: "#241A3D",
2615
+ border: "#2F2250",
2616
+ borderStrong: "#45337A",
2617
+ elevation1: "#181028",
2618
+ elevation2: "#201638",
2619
+ elevation3: "#2A1D4A",
2620
+ primary: "#A78BFA",
2621
+ primaryHover: "#C4B5FD",
2622
+ primaryBright: "#C084FC",
2623
+ primarySoft: "#2B1D52",
2624
+ primaryOn: "#12082B",
2625
+ accent: "#22D3EE",
2626
+ accentFill: "#06B6D4",
2627
+ accentBright: "#67E8F9",
2628
+ accentSoft: "#0F3342",
2629
+ text: "#F5F1FF",
2630
+ textMuted: "#B1A5CF",
2631
+ textFaint: "#7A6C9E",
2632
+ success: "#34D399",
2633
+ successSoft: "#0E2E27",
2634
+ warning: "#FBBF24",
2635
+ warningSoft: "#33260B",
2636
+ danger: "#FB7185",
2637
+ dangerSoft: "#3A1222",
2638
+ info: "#38BDF8",
2639
+ infoSoft: "#0C2C42",
2640
+ shadowSm: "0 1px 2px rgba(0, 0, 0, 0.45)",
2641
+ shadowMd: "0 6px 16px rgba(0, 0, 0, 0.50), 0 0 0 1px rgba(167, 139, 250, 0.08)",
2642
+ shadowLg: "0 22px 52px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(167, 139, 250, 0.14)"
2643
+ }, wt = {
2644
+ sm: 8,
2645
+ md: 12,
2646
+ lg: 18,
2647
+ xl: 26,
2648
+ pill: 999
2649
+ }, Tt = (e) => e * 4, Et = {
2650
+ xs: 12,
2651
+ sm: 13,
2652
+ md: 14,
2653
+ base: 16,
2654
+ lg: 18,
2655
+ xl: 21,
2656
+ xxl: 30,
2657
+ xxxl: 36
2658
+ }, Dt = {
2659
+ semibold: 600,
2660
+ bold: 700,
2661
+ extrabold: 800
2662
+ }, Ot = {
2663
+ tight: 1.1,
2664
+ relaxed: 1.6
2665
+ }, kt = {
2666
+ dropdown: 40,
2667
+ popover: 45,
2668
+ toast: 200
2669
+ }, At = {
2670
+ unit: 4,
2671
+ steps: [
2672
+ 1,
2673
+ 2,
2674
+ 3,
2675
+ 4,
2676
+ 5,
2677
+ 6,
2678
+ 8,
2679
+ 10
2680
+ ]
2681
+ }, jt = {
2682
+ fast: 120,
2683
+ base: 200,
2684
+ slow: 320,
2685
+ ease: {
2686
+ standard: "cubic-bezier(0.4, 0, 0.2, 1)",
2687
+ enter: "cubic-bezier(0, 0, 0.2, 1)",
2688
+ exit: "cubic-bezier(0.4, 0, 1, 1)",
2689
+ linear: "linear"
2690
+ }
2691
+ }, Mt = {
2692
+ brand: ["#7C3AED", "#06B6D4"],
2693
+ deep: ["#6D28D9", "#7C3AED"],
2694
+ calm: ["#F3EBFF", "#E0F7FB"]
2695
+ }, Nt = {
2696
+ display: "'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif",
2697
+ body: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif"
2698
+ }, Pt = {
2699
+ md: 720,
2700
+ sm: 480,
2701
+ min: 360
2702
+ }, Ft = [
2703
+ ["#7C3AED", "#06B6D4"],
2704
+ ["#A855F7", "#22D3EE"],
2705
+ ["#6366F1", "#2DD4BF"],
2706
+ ["#8B5CF6", "#38BDF8"],
2707
+ ["#4C1D95", "#0E7490"],
2708
+ ["#9333EA", "#67E8F9"],
2709
+ ["#5B21B6", "#14B8A6"],
2710
+ ["#C084FC", "#0891B2"],
2711
+ ["#7E22CE", "#06B6D4"],
2712
+ ["#6D28D9", "#5EEAD4"]
2713
+ ], It = Ft.map((e, t) => [`var(--item-palette-${String(t + 1)}-from)`, `var(--item-palette-${String(t + 1)}-to)`]), Lt = ["var(--item-palette-1-from)", "var(--item-palette-1-to)"];
2714
+ function Rt(e, t = It) {
2715
+ let n = 0;
2716
+ for (let t = 0; t < e.length; t++) n = n * 31 + e.charCodeAt(t) >>> 0;
2717
+ let r = t.length > 0 ? t : It;
2718
+ return r[n % r.length] ?? Lt;
2719
+ }
2720
+ // src/item-swatch/item-swatch.tsx
2721
+ function zt({ id: e, palette: n, className: r, style: i, children: a, ...o }) {
2722
+ let [s, c] = Rt(e, n);
2723
+ return /* @__PURE__ */ t("span", {
2724
+ ...o,
2725
+ "aria-hidden": "true",
2726
+ className: [xt.root, r].filter(Boolean).join(" "),
2727
+ style: {
2728
+ ...i,
2729
+ background: `linear-gradient(135deg, ${s}, ${c})`
2730
+ },
2731
+ children: a
2732
+ });
2733
+ }
2734
+ // src/icons/view-icons.tsx
2735
+ function Bt({ size: e = 18, children: n, ...r }) {
2736
+ return /* @__PURE__ */ t("svg", {
2737
+ viewBox: "0 0 24 24",
2738
+ width: e,
2739
+ height: e,
2740
+ fill: "none",
2741
+ stroke: "currentColor",
2742
+ strokeWidth: "2",
2743
+ strokeLinecap: "round",
2744
+ strokeLinejoin: "round",
2745
+ ...r,
2746
+ "aria-hidden": "true",
2747
+ focusable: "false",
2748
+ children: n
2749
+ });
2750
+ }
2751
+ function Vt(e) {
2752
+ return /* @__PURE__ */ t(Bt, {
2753
+ ...e,
2754
+ children: /* @__PURE__ */ t("path", { d: "M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01" })
2755
+ });
2756
+ }
2757
+ function Ht(e) {
2758
+ return /* @__PURE__ */ n(Bt, {
2759
+ ...e,
2760
+ children: [
2761
+ /* @__PURE__ */ t("rect", {
2762
+ x: "3",
2763
+ y: "3",
2764
+ width: "7",
2765
+ height: "7",
2766
+ rx: "1"
2767
+ }),
2768
+ /* @__PURE__ */ t("rect", {
2769
+ x: "14",
2770
+ y: "3",
2771
+ width: "7",
2772
+ height: "7",
2773
+ rx: "1"
2774
+ }),
2775
+ /* @__PURE__ */ t("rect", {
2776
+ x: "3",
2777
+ y: "14",
2778
+ width: "7",
2779
+ height: "7",
2780
+ rx: "1"
2781
+ }),
2782
+ /* @__PURE__ */ t("rect", {
2783
+ x: "14",
2784
+ y: "14",
2785
+ width: "7",
2786
+ height: "7",
2787
+ rx: "1"
2788
+ })
2789
+ ]
2790
+ });
2791
+ }
2792
+ function Ut(e) {
2793
+ return /* @__PURE__ */ t(Bt, {
2794
+ ...e,
2795
+ children: /* @__PURE__ */ t("path", { d: "M4 20h16M6 4v16M10 4v16M14.5 5l3.5 15" })
2796
+ });
2797
+ }
2798
+ function Wt(e) {
2799
+ return /* @__PURE__ */ n(Bt, {
2800
+ ...e,
2801
+ children: [/* @__PURE__ */ t("rect", {
2802
+ x: "3",
2803
+ y: "4",
2804
+ width: "18",
2805
+ height: "16",
2806
+ rx: "2"
2807
+ }), /* @__PURE__ */ t("path", { d: "M3 10h18M9 4v16" })]
2808
+ });
2809
+ }
2810
+ function Gt(e) {
2811
+ return /* @__PURE__ */ n(Bt, {
2812
+ ...e,
2813
+ children: [/* @__PURE__ */ t("rect", {
2814
+ x: "3",
2815
+ y: "4",
2816
+ width: "18",
2817
+ height: "18",
2818
+ rx: "2"
2819
+ }), /* @__PURE__ */ t("path", { d: "M16 2v4M8 2v4M3 10h18M8 14h4v4H8z" })]
2820
+ });
2821
+ }
2822
+ function Kt(e) {
2823
+ return /* @__PURE__ */ n(Bt, {
2824
+ ...e,
2825
+ children: [
2826
+ /* @__PURE__ */ t("path", { d: "M6 3v18M10 6h10M10 12h10M10 18h7" }),
2827
+ /* @__PURE__ */ t("circle", {
2828
+ cx: "6",
2829
+ cy: "6",
2830
+ r: "1.5"
2831
+ }),
2832
+ /* @__PURE__ */ t("circle", {
2833
+ cx: "6",
2834
+ cy: "12",
2835
+ r: "1.5"
2836
+ }),
2837
+ /* @__PURE__ */ t("circle", {
2838
+ cx: "6",
2839
+ cy: "18",
2840
+ r: "1.5"
2841
+ })
2842
+ ]
2843
+ });
2844
+ }
2845
+ // src/theme/theme.ts
2846
+ function qt(e) {
2847
+ return e;
2848
+ }
2849
+ var Jt = qt({
2850
+ light: St,
2851
+ dark: Ct
2852
+ }), Yt = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
2853
+ function Xt(e) {
2854
+ let t = e / 255;
2855
+ return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
2856
+ }
2857
+ function Zt(e) {
2858
+ if (!Yt.test(e)) throw TypeError(`Cor fora do formato #RGB ou #RRGGBB: ${e}`);
2859
+ let t = e.slice(1);
2860
+ return t.length === 6 ? t : t.replace(/./g, (e) => e + e);
2861
+ }
2862
+ function Qt(e) {
2863
+ let t = parseInt(Zt(e), 16), n = Xt(t >> 16 & 255), r = Xt(t >> 8 & 255), i = Xt(t & 255);
2864
+ return .2126 * n + .7152 * r + .0722 * i;
2865
+ }
2866
+ function $t(e, t) {
2867
+ let n = Qt(e), r = Qt(t);
2868
+ return (Math.max(n, r) + .05) / (Math.min(n, r) + .05);
2869
+ }
2870
+ var en = 4.5, tn = 3;
2871
+ function $(e, t, n = en) {
2872
+ return {
2873
+ foreground: e,
2874
+ background: t,
2875
+ minimum: n
2876
+ };
2877
+ }
2878
+ var nn = [
2879
+ $("text", "bg"),
2880
+ $("text", "surface"),
2881
+ $("text", "surfaceMuted"),
2882
+ $("textMuted", "bg"),
2883
+ $("textMuted", "surface"),
2884
+ $("textMuted", "surfaceMuted"),
2885
+ $("primary", "bg"),
2886
+ $("primary", "surface"),
2887
+ $("primary", "primarySoft"),
2888
+ $("primaryOn", "primary"),
2889
+ $("primaryOn", "primaryHover"),
2890
+ $("accent", "bg"),
2891
+ $("accent", "surface"),
2892
+ $("accent", "accentSoft"),
2893
+ $("success", "successSoft"),
2894
+ $("warning", "warningSoft"),
2895
+ $("danger", "dangerSoft"),
2896
+ $("info", "infoSoft"),
2897
+ $("textFaint", "bg", tn),
2898
+ $("textFaint", "surface", tn)
2899
+ ];
2900
+ function rn(e) {
2901
+ let t = [];
2902
+ for (let n of ["light", "dark"]) {
2903
+ let r = e[n];
2904
+ for (let { foreground: e, background: i, minimum: a } of nn) {
2905
+ let o = $t(r[e], r[i]);
2906
+ o < a && t.push({
2907
+ theme: n,
2908
+ foreground: e,
2909
+ background: i,
2910
+ minimum: a,
2911
+ ratio: o
2912
+ });
2913
+ }
2914
+ }
2915
+ return t;
2916
+ }
2917
+ export { N as Autocomplete, bt as Badge, vt as BrandLogo, d as Button, nn as CONTRAST_REQUIREMENTS, ae as Calendar, Re as Card, w as Checkbox, te as ColorField, ee as ColorPicker, tt as ConfirmDialog, U as DEFAULT_COLOR_FIELD_LABELS, ue as DateField, _e as DateTimeField, Gt as DayIcon, $e as Dialog, lt as EmptyState, mt as ErrorState, Ye as FormActions, Je as FormGrid, Ht as GridIcon, p as IconButton, zt as ItemSwatch, Vt as ListIcon, ft as LoadingState, h as MenuButton, Ie as MoneyField, Be as PageHeader, De as PeriodField, gt as ProgressBar, E as SegmentedField, S as SelectField, Ut as ShelfIcon, dt as Skeleton, Wt as TableIcon, We as Tabs, I as TagField, _ as TextField, he as TimeField, Kt as TimelineIcon, st as Toast, ot as ToastRegion, He as Toolbar, Ke as ViewSwitcher, Pt as breakpoints, rn as checkThemeContrast, $t as contrastRatio, Ct as dark, qt as defineTheme, Et as fontSizes, Dt as fontWeights, Nt as fonts, Pe as formatCents, Mt as gradients, V as hexToRgb, R as hslToRgb, Jt as ishtarSinkTheme, Ft as itemPalette, St as light, Ot as lineHeights, Me as maskMoneyInput, fe as maskTime, jt as motion, Ne as parseMoneyInput, de as parseTime, wt as radii, Se as resolvePeriod, B as rgbToHex, z as rgbToHsl, Tt as space, At as spacing, kt as zIndices };