@schumann-dev/ui 0.12.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 (48) hide show
  1. package/README.md +144 -0
  2. package/dist/atoms/Avatar/Avatar.d.ts +12 -0
  3. package/dist/atoms/Badge/Badge.d.ts +11 -0
  4. package/dist/atoms/Button/Button.d.ts +14 -0
  5. package/dist/atoms/Heading/Heading.d.ts +8 -0
  6. package/dist/atoms/Icon/Icon.d.ts +30 -0
  7. package/dist/atoms/IconButton/IconButton.d.ts +10 -0
  8. package/dist/atoms/Input/Input.d.ts +11 -0
  9. package/dist/atoms/Label/Label.d.ts +5 -0
  10. package/dist/atoms/ProgressBar/ProgressBar.d.ts +16 -0
  11. package/dist/atoms/Skeleton/Skeleton.d.ts +10 -0
  12. package/dist/atoms/Spinner/Spinner.d.ts +8 -0
  13. package/dist/atoms/Switch/Switch.d.ts +11 -0
  14. package/dist/atoms/Text/Text.d.ts +16 -0
  15. package/dist/chunks/Icon-xe35IPZg.js +141 -0
  16. package/dist/hooks/useControllableState.d.ts +8 -0
  17. package/dist/hooks/useFormField.d.ts +9 -0
  18. package/dist/icons/lucide.d.ts +1 -0
  19. package/dist/icons.js +16 -0
  20. package/dist/index.d.ts +72 -0
  21. package/dist/index.js +1814 -0
  22. package/dist/molecules/ColorPicker/ColorPicker.d.ts +19 -0
  23. package/dist/molecules/Combobox/Combobox.d.ts +18 -0
  24. package/dist/molecules/DateTimeInput/DateTimeInput.d.ts +10 -0
  25. package/dist/molecules/EmptyState/EmptyState.d.ts +14 -0
  26. package/dist/molecules/FormField/FormField.d.ts +16 -0
  27. package/dist/molecules/IconPicker/IconPicker.d.ts +17 -0
  28. package/dist/molecules/MoneyInput/MoneyInput.d.ts +12 -0
  29. package/dist/molecules/MonthPicker/MonthPicker.d.ts +20 -0
  30. package/dist/molecules/MultiSelect/MultiSelect.d.ts +21 -0
  31. package/dist/molecules/SegmentedControl/SegmentedControl.d.ts +19 -0
  32. package/dist/molecules/StatCard/StatCard.d.ts +18 -0
  33. package/dist/molecules/SwitchCard/SwitchCard.d.ts +11 -0
  34. package/dist/molecules/Tooltip/Tooltip.d.ts +17 -0
  35. package/dist/organisms/Card/Card.d.ts +18 -0
  36. package/dist/organisms/ConfirmModal/ConfirmModal.d.ts +19 -0
  37. package/dist/organisms/DataTable/DataTable.d.ts +41 -0
  38. package/dist/organisms/Menu/Menu.d.ts +24 -0
  39. package/dist/organisms/Modal/Modal.d.ts +30 -0
  40. package/dist/styles.css +1 -0
  41. package/dist/templates/AppShell/AppShell.d.ts +38 -0
  42. package/dist/templates/PageContainer/PageContainer.d.ts +7 -0
  43. package/dist/templates/PageHeader/PageHeader.d.ts +14 -0
  44. package/dist/utils/color.d.ts +10 -0
  45. package/dist/utils/cx.d.ts +3 -0
  46. package/dist/utils/dom.d.ts +19 -0
  47. package/dist/utils/text.d.ts +2 -0
  48. package/package.json +89 -0
package/dist/index.js ADDED
@@ -0,0 +1,1814 @@
1
+ import { jsx as e, jsxs as h, Fragment as ee } from "react/jsx-runtime";
2
+ import { forwardRef as ue, useContext as ye, createContext as ke, useState as S, useCallback as xe, useId as we, useRef as K, useEffect as H, useMemo as se, useLayoutEffect as Ce } from "react";
3
+ import { c as w, a as P, b as Se } from "./chunks/Icon-xe35IPZg.js";
4
+ import { I as Lt, g as It, i as Tt, d as Rt, r as At } from "./chunks/Icon-xe35IPZg.js";
5
+ import * as W from "@radix-ui/react-tooltip";
6
+ import * as F from "@radix-ui/react-dialog";
7
+ function Me({ size: t = 16, label: a, className: n }) {
8
+ const s = { "--sui-spinner-size": `${t}px` };
9
+ return /* @__PURE__ */ e(
10
+ "span",
11
+ {
12
+ className: w("sui-spinner", n),
13
+ style: s,
14
+ role: a ? "status" : void 0,
15
+ "aria-label": a,
16
+ "aria-hidden": a ? void 0 : !0
17
+ }
18
+ );
19
+ }
20
+ const me = ue(function({
21
+ variant: a = "primary",
22
+ size: n = "md",
23
+ loading: s = !1,
24
+ fullWidth: l = !1,
25
+ leftIcon: i,
26
+ rightIcon: r,
27
+ disabled: c,
28
+ type: o = "button",
29
+ className: p,
30
+ children: d,
31
+ ...v
32
+ }, f) {
33
+ const k = c || s;
34
+ return /* @__PURE__ */ h(
35
+ "button",
36
+ {
37
+ ref: f,
38
+ type: o,
39
+ className: w("sui-btn", l && "sui-btn--full", p),
40
+ "data-variant": a,
41
+ "data-size": n,
42
+ "data-loading": s || void 0,
43
+ disabled: k,
44
+ "aria-busy": s || void 0,
45
+ ...v,
46
+ children: [
47
+ s && /* @__PURE__ */ e(Me, { size: n === "lg" ? 18 : 15, className: "sui-btn__spinner" }),
48
+ !s && i && /* @__PURE__ */ e("span", { className: "sui-btn__icon", children: i }),
49
+ d != null && /* @__PURE__ */ e("span", { className: "sui-btn__label", children: d }),
50
+ !s && r && /* @__PURE__ */ e("span", { className: "sui-btn__icon", children: r })
51
+ ]
52
+ }
53
+ );
54
+ }), De = ue(function({ variant: a = "ghost", size: n = "md", shape: s = "square", className: l, type: i = "button", ...r }, c) {
55
+ return /* @__PURE__ */ e(
56
+ "button",
57
+ {
58
+ ref: c,
59
+ type: i,
60
+ className: w("sui-iconbtn", l),
61
+ "data-variant": a,
62
+ "data-size": n,
63
+ "data-shape": s,
64
+ ...r
65
+ }
66
+ );
67
+ }), fe = ke(null);
68
+ function ie() {
69
+ return ye(fe);
70
+ }
71
+ const _e = ue(function({ inputSize: a = "md", invalid: n, leftAddon: s, rightAddon: l, disabled: i, className: r, id: c, ...o }, p) {
72
+ const d = ie(), v = c ?? (d == null ? void 0 : d.id), f = n ?? (d == null ? void 0 : d.invalid) ?? !1;
73
+ return /* @__PURE__ */ h(
74
+ "div",
75
+ {
76
+ className: w("sui-input", r),
77
+ "data-size": a,
78
+ "data-invalid": f || void 0,
79
+ "data-disabled": i || void 0,
80
+ children: [
81
+ s && /* @__PURE__ */ e("span", { className: "sui-input__addon sui-input__addon--left", children: s }),
82
+ /* @__PURE__ */ e(
83
+ "input",
84
+ {
85
+ ref: p,
86
+ id: v,
87
+ className: "sui-input__control",
88
+ disabled: i,
89
+ "aria-invalid": f || void 0,
90
+ "aria-describedby": d == null ? void 0 : d.describedBy,
91
+ ...o
92
+ }
93
+ ),
94
+ l && /* @__PURE__ */ e("span", { className: "sui-input__addon sui-input__addon--right", children: l })
95
+ ]
96
+ }
97
+ );
98
+ });
99
+ function pe({
100
+ as: t = "span",
101
+ size: a = "sm",
102
+ weight: n = "regular",
103
+ tone: s = "primary",
104
+ align: l,
105
+ truncate: i,
106
+ mono: r,
107
+ className: c,
108
+ ...o
109
+ }) {
110
+ return /* @__PURE__ */ e(
111
+ t,
112
+ {
113
+ className: w("sui-text", i && "sui-text--truncate", r && "sui-text--mono", c),
114
+ "data-size": a,
115
+ "data-weight": n,
116
+ "data-tone": s,
117
+ "data-align": l,
118
+ ...o
119
+ }
120
+ );
121
+ }
122
+ function ze({ level: t = 2, as: a, className: n, ...s }) {
123
+ const l = a ?? `h${t}`;
124
+ return /* @__PURE__ */ e(l, { className: w("sui-heading", n), "data-level": t, ...s });
125
+ }
126
+ function Ee({ required: t, className: a, children: n, ...s }) {
127
+ return /* @__PURE__ */ h("label", { className: w("sui-label", a), ...s, children: [
128
+ n,
129
+ t && /* @__PURE__ */ e("span", { className: "sui-label__required", "aria-hidden": "true", children: "*" })
130
+ ] });
131
+ }
132
+ function it({
133
+ status: t = "neutral",
134
+ size: a = "md",
135
+ dot: n = !1,
136
+ leftIcon: s,
137
+ className: l,
138
+ children: i,
139
+ ...r
140
+ }) {
141
+ return /* @__PURE__ */ h(
142
+ "span",
143
+ {
144
+ className: w("sui-badge", l),
145
+ "data-status": t,
146
+ "data-size": a,
147
+ ...r,
148
+ children: [
149
+ n && /* @__PURE__ */ e("span", { className: "sui-badge__dot", "aria-hidden": "true" }),
150
+ s && /* @__PURE__ */ e("span", { className: "sui-badge__icon", children: s }),
151
+ i
152
+ ]
153
+ }
154
+ );
155
+ }
156
+ function $e(t) {
157
+ return t.trim().split(/\s+/).slice(0, 2).map((a) => a[0] ?? "").join("").toUpperCase();
158
+ }
159
+ function rt({ src: t, name: a, size: n = 30, className: s, style: l }) {
160
+ return /* @__PURE__ */ e(
161
+ "span",
162
+ {
163
+ className: w("sui-avatar", s),
164
+ style: { width: n, height: n, fontSize: n * 0.38, ...l },
165
+ children: t ? /* @__PURE__ */ e("img", { src: t, alt: "" }) : $e(a) || "?"
166
+ }
167
+ );
168
+ }
169
+ function de({
170
+ value: t,
171
+ defaultValue: a,
172
+ onChange: n
173
+ }) {
174
+ const [s, l] = S(a), i = t !== void 0, r = i ? t : s, c = xe(
175
+ (o) => {
176
+ i || l(o), n == null || n(o);
177
+ },
178
+ [i, n]
179
+ );
180
+ return [r, c];
181
+ }
182
+ function Le({
183
+ checked: t,
184
+ defaultChecked: a = !1,
185
+ onCheckedChange: n,
186
+ disabled: s,
187
+ id: l,
188
+ className: i,
189
+ ...r
190
+ }) {
191
+ const c = ie(), [o, p] = de({
192
+ value: t,
193
+ defaultValue: a,
194
+ onChange: n
195
+ });
196
+ return /* @__PURE__ */ e(
197
+ "button",
198
+ {
199
+ type: "button",
200
+ role: "switch",
201
+ "aria-checked": o,
202
+ id: l ?? (c == null ? void 0 : c.id),
203
+ "aria-describedby": c == null ? void 0 : c.describedBy,
204
+ disabled: s,
205
+ onClick: () => p(!o),
206
+ className: w("sui-switch", i),
207
+ "data-checked": o || void 0,
208
+ ...r,
209
+ children: /* @__PURE__ */ e("span", { className: "sui-switch__thumb" })
210
+ }
211
+ );
212
+ }
213
+ function lt({ width: t = "100%", height: a = 16, radius: n = 9, className: s, style: l }) {
214
+ return /* @__PURE__ */ e(
215
+ "span",
216
+ {
217
+ className: w("sui-skeleton", s),
218
+ "aria-hidden": "true",
219
+ style: { width: t, height: a, borderRadius: n, ...l }
220
+ }
221
+ );
222
+ }
223
+ function ot({
224
+ value: t,
225
+ max: a = 1,
226
+ color: n = "var(--interactive-primary)",
227
+ dangerColor: s = "var(--text-error)",
228
+ dangerThreshold: l = 0.85,
229
+ height: i = 6,
230
+ label: r,
231
+ className: c
232
+ }) {
233
+ const o = a > 0 ? Math.min(Math.max(t / a, 0), 1) : 0, p = o >= l ? s : n;
234
+ return /* @__PURE__ */ e(
235
+ "div",
236
+ {
237
+ className: w("sui-progressbar", c),
238
+ style: { height: i },
239
+ role: "progressbar",
240
+ "aria-valuenow": Math.round(o * 100),
241
+ "aria-valuemin": 0,
242
+ "aria-valuemax": 100,
243
+ "aria-label": r,
244
+ children: /* @__PURE__ */ e("div", { className: "sui-progressbar__fill", style: { width: `${o * 100}%`, background: p } })
245
+ }
246
+ );
247
+ }
248
+ function ct({
249
+ label: t,
250
+ hint: a,
251
+ error: n,
252
+ required: s,
253
+ id: l,
254
+ className: i,
255
+ children: r
256
+ }) {
257
+ const c = we(), o = l ?? c, p = n != null && n !== !1, d = `${o}-hint`, v = `${o}-error`, f = p ? v : a ? d : void 0;
258
+ return /* @__PURE__ */ h("div", { className: w("sui-formfield", i), children: [
259
+ t && /* @__PURE__ */ e(Ee, { htmlFor: o, required: s, children: t }),
260
+ /* @__PURE__ */ e(fe.Provider, { value: { id: o, invalid: p, describedBy: f }, children: r }),
261
+ p ? /* @__PURE__ */ e(pe, { as: "p", id: v, size: "xs", tone: "error", role: "alert", children: n }) : a ? /* @__PURE__ */ e(pe, { as: "p", id: d, size: "xs", tone: "secondary", children: a }) : null
262
+ ] });
263
+ }
264
+ function q(t) {
265
+ return t.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
266
+ }
267
+ function ut({
268
+ value: t,
269
+ onChange: a,
270
+ options: n,
271
+ placeholder: s = "Selecionar...",
272
+ emptyText: l = "Nenhum resultado",
273
+ disabled: i = !1,
274
+ className: r
275
+ }) {
276
+ const c = ie(), [o, p] = S(!1), [d, v] = S(""), [f, k] = S(0), M = K(null), E = n.find((m) => m.value === t) ?? null, $ = d.trim() ? n.filter((m) => q(m.label).includes(q(d))) : n, z = () => {
277
+ i || p(!0);
278
+ }, L = () => {
279
+ p(!1), v("");
280
+ }, T = (m) => {
281
+ i || a(m), L();
282
+ }, R = () => {
283
+ if (i) return;
284
+ const m = $[f];
285
+ m && T(m.value);
286
+ };
287
+ H(() => {
288
+ k(0);
289
+ }, [d, o]);
290
+ const b = (m) => {
291
+ if (m.target === m.currentTarget) {
292
+ if (i) {
293
+ m.preventDefault();
294
+ return;
295
+ }
296
+ m.key === "Enter" ? (m.preventDefault(), o ? R() : z()) : m.key === " " || m.key === "ArrowDown" ? (m.preventDefault(), o ? k((y) => Math.min(y + 1, $.length - 1)) : z()) : m.key === "ArrowUp" && (m.preventDefault(), o ? k((y) => Math.max(y - 1, 0)) : z());
297
+ }
298
+ };
299
+ return /* @__PURE__ */ h("div", { className: w("sui-combobox", r), children: [
300
+ /* @__PURE__ */ h(
301
+ "div",
302
+ {
303
+ onClick: z,
304
+ onFocus: (m) => {
305
+ m.target === m.currentTarget && !o && z();
306
+ },
307
+ onKeyDown: b,
308
+ tabIndex: i ? -1 : 0,
309
+ role: "combobox",
310
+ "aria-expanded": o,
311
+ "aria-haspopup": "listbox",
312
+ "aria-disabled": i ? "true" : void 0,
313
+ "aria-describedby": c == null ? void 0 : c.describedBy,
314
+ id: c == null ? void 0 : c.id,
315
+ className: "sui-combobox__trigger",
316
+ "data-disabled": i || void 0,
317
+ "data-invalid": (c == null ? void 0 : c.invalid) || void 0,
318
+ children: [
319
+ E && !o && E.leading && /* @__PURE__ */ e("span", { className: "sui-combobox__leading", children: E.leading }),
320
+ o ? /* @__PURE__ */ e(
321
+ "input",
322
+ {
323
+ ref: M,
324
+ autoFocus: !0,
325
+ onFocus: (m) => m.currentTarget.select(),
326
+ value: d,
327
+ onChange: (m) => v(m.target.value),
328
+ onKeyDown: (m) => {
329
+ if (i) {
330
+ m.preventDefault();
331
+ return;
332
+ }
333
+ m.key === "Enter" ? (m.preventDefault(), R()) : m.key === "ArrowDown" ? (m.preventDefault(), k((y) => Math.min(y + 1, $.length - 1))) : m.key === "ArrowUp" ? (m.preventDefault(), k((y) => Math.max(y - 1, 0))) : m.key === "Escape" && L();
334
+ },
335
+ placeholder: E ? E.label : s,
336
+ className: "sui-combobox__search"
337
+ }
338
+ ) : /* @__PURE__ */ e("span", { className: w("sui-combobox__value", !E && "sui-combobox__value--empty"), children: E ? E.label : s }),
339
+ /* @__PURE__ */ e("span", { className: "sui-combobox__chev", children: /* @__PURE__ */ e(P, { name: "chevDown", size: 15 }) })
340
+ ]
341
+ }
342
+ ),
343
+ o && !i && /* @__PURE__ */ h(ee, { children: [
344
+ /* @__PURE__ */ e("div", { className: "sui-combobox__backdrop", onClick: L }),
345
+ /* @__PURE__ */ h("div", { className: "sui-combobox__list", role: "listbox", children: [
346
+ $.length === 0 && /* @__PURE__ */ e("div", { className: "sui-combobox__empty", children: l }),
347
+ $.map((m, y) => /* @__PURE__ */ h(
348
+ "button",
349
+ {
350
+ type: "button",
351
+ role: "option",
352
+ "aria-selected": m.value === t,
353
+ onMouseEnter: () => k(y),
354
+ onClick: () => T(m.value),
355
+ className: "sui-combobox__option",
356
+ "data-highlight": y === f || void 0,
357
+ "data-selected": m.value === t || void 0,
358
+ children: [
359
+ m.leading && /* @__PURE__ */ e("span", { className: "sui-combobox__leading", children: m.leading }),
360
+ /* @__PURE__ */ e("span", { className: "sui-combobox__option-label", children: m.label })
361
+ ]
362
+ },
363
+ m.value
364
+ ))
365
+ ] })
366
+ ] })
367
+ ] });
368
+ }
369
+ function U(t, a) {
370
+ const n = t.replace("#", ""), s = parseInt(n.slice(0, 2), 16), l = parseInt(n.slice(2, 4), 16), i = parseInt(n.slice(4, 6), 16);
371
+ return `rgba(${s},${l},${i},${a})`;
372
+ }
373
+ function re(t) {
374
+ const a = t.replace("#", "").padEnd(6, "0");
375
+ return [
376
+ parseInt(a.slice(0, 2), 16) || 0,
377
+ parseInt(a.slice(2, 4), 16) || 0,
378
+ parseInt(a.slice(4, 6), 16) || 0
379
+ ];
380
+ }
381
+ function ne(t, a, n) {
382
+ const s = (l) => Math.round(Math.max(0, Math.min(255, l))).toString(16).padStart(2, "0");
383
+ return `#${s(t)}${s(a)}${s(n)}`;
384
+ }
385
+ function le(t, a, n) {
386
+ t /= 255, a /= 255, n /= 255;
387
+ const s = Math.max(t, a, n), l = Math.min(t, a, n), i = s - l;
388
+ let r = 0;
389
+ return i && (s === t ? r = (a - n) / i % 6 : s === a ? r = (n - t) / i + 2 : r = (t - a) / i + 4, r *= 60, r < 0 && (r += 360)), { h: r, s: s ? i / s : 0, v: s };
390
+ }
391
+ function oe(t, a, n) {
392
+ const s = n * a, l = s * (1 - Math.abs(t / 60 % 2 - 1)), i = n - s;
393
+ let r = 0, c = 0, o = 0;
394
+ return t < 60 ? [r, c, o] = [s, l, 0] : t < 120 ? [r, c, o] = [l, s, 0] : t < 180 ? [r, c, o] = [0, s, l] : t < 240 ? [r, c, o] = [0, l, s] : t < 300 ? [r, c, o] = [l, 0, s] : [r, c, o] = [s, 0, l], [Math.round((r + i) * 255), Math.round((c + i) * 255), Math.round((o + i) * 255)];
395
+ }
396
+ function Ie(t) {
397
+ let a = (t == null ? void 0 : t.parentElement) ?? null;
398
+ for (; a && a !== document.body && a !== document.documentElement; ) {
399
+ const n = getComputedStyle(a);
400
+ if (n.transform !== "none" || n.perspective !== "none" || n.filter !== "none" || n.willChange === "transform" || n.willChange === "filter" || n.willChange === "perspective" || n.contain === "strict" || n.contain === "content" || n.contain.includes("paint") || n.contain.includes("layout"))
401
+ return a;
402
+ a = a.parentElement;
403
+ }
404
+ return null;
405
+ }
406
+ function ve(t) {
407
+ const a = Ie(t);
408
+ if (!a) return { top: 0, left: 0 };
409
+ const n = a.getBoundingClientRect();
410
+ return { top: n.top, left: n.left };
411
+ }
412
+ const Q = "#5961f7";
413
+ function dt({
414
+ options: t,
415
+ selected: a,
416
+ onChange: n,
417
+ placeholder: s = "Selecionar...",
418
+ emptyText: l = "Nenhuma opção disponível",
419
+ noResultsText: i = "Nenhum resultado",
420
+ className: r
421
+ }) {
422
+ const c = ie(), [o, p] = S(!1), [d, v] = S(""), [f, k] = S(0), [M, E] = S(null), $ = K(null), z = K(null), L = a.map((u) => t.find((g) => g.value === u)).filter((u) => !!u), T = (u) => n(a.includes(u) ? a.filter((g) => g !== u) : [...a, u]), R = d.trim() ? t.filter((u) => q(u.label).includes(q(d))) : t;
423
+ H(() => {
424
+ if (!o) return;
425
+ const u = () => {
426
+ var D;
427
+ const g = (D = $.current) == null ? void 0 : D.getBoundingClientRect();
428
+ if (!g) return;
429
+ const C = ve($.current);
430
+ E({ top: g.bottom - C.top + 6, left: g.left - C.left, width: g.width });
431
+ };
432
+ return u(), window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), () => {
433
+ window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
434
+ };
435
+ }, [o]), H(() => {
436
+ k(0);
437
+ }, [d, o]);
438
+ const b = () => {
439
+ const u = R[f];
440
+ u && T(u.value), v("");
441
+ }, m = () => requestAnimationFrame(() => {
442
+ var u;
443
+ return (u = z.current) == null ? void 0 : u.focus();
444
+ }), y = () => {
445
+ p(!0), m();
446
+ };
447
+ return /* @__PURE__ */ h("div", { ref: $, className: w("sui-multiselect", r), children: [
448
+ /* @__PURE__ */ h(
449
+ "div",
450
+ {
451
+ onClick: y,
452
+ onFocus: (u) => {
453
+ u.target === u.currentTarget && y();
454
+ },
455
+ onKeyDown: (u) => {
456
+ u.target === u.currentTarget && (u.key === "Enter" ? (u.preventDefault(), o ? b() : y()) : u.key === " " || u.key === "ArrowDown" ? (u.preventDefault(), o ? k((g) => Math.min(g + 1, R.length - 1)) : y()) : u.key === "ArrowUp" && (u.preventDefault(), o ? k((g) => Math.max(g - 1, 0)) : y()));
457
+ },
458
+ tabIndex: 0,
459
+ role: "combobox",
460
+ "aria-expanded": o,
461
+ "aria-haspopup": "listbox",
462
+ id: c == null ? void 0 : c.id,
463
+ "aria-describedby": c == null ? void 0 : c.describedBy,
464
+ "data-invalid": (c == null ? void 0 : c.invalid) || void 0,
465
+ className: "sui-multiselect__trigger",
466
+ children: [
467
+ /* @__PURE__ */ h("div", { className: "sui-multiselect__chips", children: [
468
+ L.map((u) => /* @__PURE__ */ h(
469
+ "span",
470
+ {
471
+ className: "sui-multiselect__chip",
472
+ style: {
473
+ background: U(u.color ?? Q, 0.14),
474
+ color: u.color ?? Q
475
+ },
476
+ children: [
477
+ u.icon ?? /* @__PURE__ */ e(
478
+ "span",
479
+ {
480
+ className: "sui-multiselect__dot",
481
+ style: { background: u.color ?? Q }
482
+ }
483
+ ),
484
+ u.label,
485
+ /* @__PURE__ */ e(
486
+ "button",
487
+ {
488
+ type: "button",
489
+ "aria-label": `Remover ${u.label}`,
490
+ onClick: (g) => {
491
+ g.stopPropagation(), T(u.value);
492
+ },
493
+ className: "sui-multiselect__chip-x",
494
+ children: "×"
495
+ }
496
+ )
497
+ ]
498
+ },
499
+ u.value
500
+ )),
501
+ /* @__PURE__ */ e(
502
+ "input",
503
+ {
504
+ ref: z,
505
+ value: d,
506
+ onChange: (u) => {
507
+ v(u.target.value), p(!0);
508
+ },
509
+ onFocus: () => p(!0),
510
+ onKeyDown: (u) => {
511
+ var g;
512
+ u.key === "Enter" ? (u.preventDefault(), b()) : u.key === "ArrowDown" ? (u.preventDefault(), p(!0), k((C) => Math.min(C + 1, R.length - 1))) : u.key === "ArrowUp" ? (u.preventDefault(), k((C) => Math.max(C - 1, 0))) : u.key === "Escape" && (p(!1), (g = z.current) == null || g.blur());
513
+ },
514
+ placeholder: L.length === 0 ? s : "",
515
+ className: "sui-multiselect__search"
516
+ }
517
+ )
518
+ ] }),
519
+ /* @__PURE__ */ e("span", { className: "sui-multiselect__chev", children: /* @__PURE__ */ e(P, { name: "chevDown", size: 15 }) })
520
+ ]
521
+ }
522
+ ),
523
+ o && M && /* @__PURE__ */ h(ee, { children: [
524
+ /* @__PURE__ */ e("div", { className: "sui-multiselect__backdrop", onClick: () => p(!1) }),
525
+ /* @__PURE__ */ h(
526
+ "div",
527
+ {
528
+ className: "sui-multiselect__list",
529
+ role: "listbox",
530
+ "aria-multiselectable": "true",
531
+ style: { top: M.top, left: M.left, width: M.width },
532
+ children: [
533
+ R.length === 0 && /* @__PURE__ */ e("div", { className: "sui-multiselect__empty", children: t.length === 0 ? l : i }),
534
+ R.map((u, g) => {
535
+ const C = a.includes(u.value);
536
+ return /* @__PURE__ */ h(
537
+ "button",
538
+ {
539
+ type: "button",
540
+ role: "option",
541
+ "aria-selected": C,
542
+ onMouseEnter: () => k(g),
543
+ onClick: () => {
544
+ var D;
545
+ T(u.value), v(""), (D = z.current) == null || D.focus();
546
+ },
547
+ className: "sui-multiselect__option",
548
+ "data-highlight": g === f || void 0,
549
+ "data-checked": C || void 0,
550
+ children: [
551
+ /* @__PURE__ */ e(
552
+ "span",
553
+ {
554
+ className: "sui-multiselect__check",
555
+ style: C ? {
556
+ background: u.color ?? Q,
557
+ borderColor: u.color ?? Q
558
+ } : void 0,
559
+ children: C && /* @__PURE__ */ e(P, { name: "check", size: 12, color: "#fff", strokeWidth: 3 })
560
+ }
561
+ ),
562
+ u.icon ?? /* @__PURE__ */ e(
563
+ "span",
564
+ {
565
+ className: "sui-multiselect__dot sui-multiselect__dot--lg",
566
+ style: { background: u.color ?? Q }
567
+ }
568
+ ),
569
+ /* @__PURE__ */ h("span", { className: "sui-multiselect__option-text", children: [
570
+ /* @__PURE__ */ e("span", { className: "sui-multiselect__option-label", children: u.label }),
571
+ u.sublabel && /* @__PURE__ */ e(
572
+ "span",
573
+ {
574
+ className: "sui-multiselect__option-sub",
575
+ style: u.sublabelColor ? { color: u.sublabelColor } : void 0,
576
+ children: u.sublabel
577
+ }
578
+ )
579
+ ] })
580
+ ]
581
+ },
582
+ u.value
583
+ );
584
+ })
585
+ ]
586
+ }
587
+ )
588
+ ] })
589
+ ] });
590
+ }
591
+ const Te = "#5961f7";
592
+ function ht({
593
+ options: t,
594
+ value: a,
595
+ onChange: n,
596
+ variant: s = "pill",
597
+ className: l
598
+ }) {
599
+ return /* @__PURE__ */ e("div", { className: w("sui-segmented", l), "data-variant": s, role: "group", children: t.map((i) => {
600
+ const r = a === i.value, c = i.color ?? Te;
601
+ return /* @__PURE__ */ h(
602
+ "button",
603
+ {
604
+ type: "button",
605
+ "aria-pressed": r,
606
+ onClick: () => n(i.value),
607
+ className: "sui-segmented__option",
608
+ "data-on": r || void 0,
609
+ style: r ? s === "pill" ? { background: U(c, 0.13), color: c } : s === "card" ? { background: U(c, 0.16), borderColor: U(c, 0.5) } : void 0 : void 0,
610
+ children: [
611
+ s === "pill" && /* @__PURE__ */ e(
612
+ "span",
613
+ {
614
+ className: "sui-segmented__dot",
615
+ style: { background: c, opacity: r ? 1 : 0.4 }
616
+ }
617
+ ),
618
+ /* @__PURE__ */ e("span", { className: "sui-segmented__label", children: i.label }),
619
+ s === "card" && i.sublabel != null && /* @__PURE__ */ e(
620
+ "span",
621
+ {
622
+ className: "sui-segmented__sublabel",
623
+ style: r ? { color: c } : void 0,
624
+ children: i.sublabel
625
+ }
626
+ )
627
+ ]
628
+ },
629
+ i.value
630
+ );
631
+ }) });
632
+ }
633
+ function mt({
634
+ title: t,
635
+ description: a,
636
+ checked: n,
637
+ onCheckedChange: s,
638
+ disabled: l,
639
+ className: i
640
+ }) {
641
+ return /* @__PURE__ */ h(
642
+ "div",
643
+ {
644
+ className: w("sui-switchcard", i),
645
+ "data-disabled": l || void 0,
646
+ onClick: () => !l && s(!n),
647
+ children: [
648
+ /* @__PURE__ */ h("div", { className: "sui-switchcard__text", children: [
649
+ /* @__PURE__ */ e("div", { className: "sui-switchcard__title", children: t }),
650
+ a && /* @__PURE__ */ e("div", { className: "sui-switchcard__desc", children: a })
651
+ ] }),
652
+ /* @__PURE__ */ e("span", { onClick: (r) => r.stopPropagation(), style: { display: "inline-flex" }, children: /* @__PURE__ */ e(
653
+ Le,
654
+ {
655
+ checked: n,
656
+ onCheckedChange: (r) => s(r),
657
+ disabled: l,
658
+ "aria-label": typeof t == "string" ? t : void 0
659
+ }
660
+ ) })
661
+ ]
662
+ }
663
+ );
664
+ }
665
+ function Re(t) {
666
+ if (t === "") return "";
667
+ const a = Math.round((Number(t) || 0) * 100);
668
+ return String(Math.max(a, 0));
669
+ }
670
+ function Ae(t) {
671
+ const a = t.padStart(3, "0"), n = a.slice(0, -2).replace(/^0+(?=\d)/, "");
672
+ return `${Number(n).toLocaleString("pt-BR")},${a.slice(-2)}`;
673
+ }
674
+ function pt({
675
+ value: t,
676
+ onChange: a,
677
+ currency: n = "R$",
678
+ placeholder: s = "0,00",
679
+ disabled: l,
680
+ invalid: i
681
+ }) {
682
+ const r = K(null), c = Re(t);
683
+ return H(() => {
684
+ const o = r.current;
685
+ o && document.activeElement === o && o.setSelectionRange(o.value.length, o.value.length);
686
+ }), /* @__PURE__ */ e(
687
+ _e,
688
+ {
689
+ ref: r,
690
+ type: "text",
691
+ inputMode: "decimal",
692
+ className: "sui-moneyinput",
693
+ leftAddon: /* @__PURE__ */ e("span", { className: "sui-moneyinput__currency", children: n }),
694
+ value: c ? Ae(c) : "",
695
+ onChange: (o) => {
696
+ const p = o.target.value.replace(/\D/g, "");
697
+ a(p ? (Number(p) / 100).toFixed(2) : "");
698
+ },
699
+ placeholder: s,
700
+ disabled: l,
701
+ invalid: i
702
+ }
703
+ );
704
+ }
705
+ function Pe(t) {
706
+ return t.replace(/\D+/g, "").slice(0, 12);
707
+ }
708
+ function Be(t) {
709
+ const a = t.slice(0, 2), n = t.slice(2, 4), s = t.slice(4, 8), l = t.slice(8, 10), i = t.slice(10, 12);
710
+ let r = "";
711
+ return a && (r += a, a.length === 2 && n && (r += "/")), n && (r += n, n.length === 2 && s && (r += "/")), s && (r += s, s.length === 4 && (l || i) && (r += " ")), l && (r += l, l.length === 2 && i && (r += ":")), i && (r += i), r;
712
+ }
713
+ function ce(t) {
714
+ const a = /^(\d{2})\/(\d{2})\/(\d{4})\s+(\d{2}):(\d{2})$/.exec(t.trim());
715
+ if (!a) return null;
716
+ const [, n, s, l, i, r] = a, c = Number(n), o = Number(s), p = Number(l), d = Number(i), v = Number(r);
717
+ if (o < 1 || o > 12 || c < 1 || c > 31 || d < 0 || d > 23 || v < 0 || v > 59) return null;
718
+ const f = new Date(p, o - 1, c, d, v);
719
+ return Number.isNaN(f.getTime()) || f.getFullYear() !== p || f.getMonth() !== o - 1 || f.getDate() !== c ? null : `${l}-${s}-${n}T${i}:${r}`;
720
+ }
721
+ function Fe(t) {
722
+ const a = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/.exec(t ?? "");
723
+ return a ? `${a[3]}/${a[2]}/${a[1]} ${a[4]}:${a[5]}` : "";
724
+ }
725
+ function ft({
726
+ value: t,
727
+ onChange: a,
728
+ placeholder: n = "dd/mm/aaaa hh:mm",
729
+ disabled: s
730
+ }) {
731
+ const [l, i] = S(""), r = Fe(t);
732
+ H(() => {
733
+ i(r);
734
+ }, [r]);
735
+ const c = l === "" || !!ce(l);
736
+ return /* @__PURE__ */ e(
737
+ _e,
738
+ {
739
+ type: "text",
740
+ inputMode: "numeric",
741
+ value: l,
742
+ onChange: (o) => {
743
+ const p = Be(Pe(o.target.value));
744
+ i(p);
745
+ const d = ce(p);
746
+ d && a(d);
747
+ },
748
+ onBlur: () => {
749
+ !ce(l) && t && i(r);
750
+ },
751
+ placeholder: n,
752
+ disabled: s,
753
+ invalid: !c
754
+ }
755
+ );
756
+ }
757
+ const Oe = [
758
+ "Janeiro",
759
+ "Fevereiro",
760
+ "Março",
761
+ "Abril",
762
+ "Maio",
763
+ "Junho",
764
+ "Julho",
765
+ "Agosto",
766
+ "Setembro",
767
+ "Outubro",
768
+ "Novembro",
769
+ "Dezembro"
770
+ ];
771
+ function _t({
772
+ value: t,
773
+ onChange: a,
774
+ monthLabels: n = Oe,
775
+ formatLabel: s,
776
+ prevLabel: l = "Mês anterior",
777
+ nextLabel: i = "Próximo mês",
778
+ className: r
779
+ }) {
780
+ const [c, o] = S(!1), [p, d] = S(t.year), v = (b) => s ? s(b) : `${n[b.month - 1]} ${b.year}`, f = v(t), k = n.indexOf(n.reduce((b, m) => m.length > b.length ? m : b)) + 1, M = v({ year: t.year, month: k }), E = (b) => b.slice(0, 3), $ = (b) => {
781
+ let m = t.month + b, y = t.year;
782
+ m < 1 ? (m = 12, y -= 1) : m > 12 && (m = 1, y += 1), a({ year: y, month: m }), d(y);
783
+ }, z = () => {
784
+ d(t.year), o((b) => !b);
785
+ };
786
+ H(() => {
787
+ if (!c) return;
788
+ const b = (m) => {
789
+ m.key === "Escape" && o(!1);
790
+ };
791
+ return document.addEventListener("keydown", b), () => document.removeEventListener("keydown", b);
792
+ }, [c]);
793
+ const L = /* @__PURE__ */ new Date(), T = L.getFullYear(), R = L.getMonth() + 1;
794
+ return /* @__PURE__ */ h("div", { className: w("sui-monthpicker", r), children: [
795
+ /* @__PURE__ */ h("div", { className: "sui-monthpicker__bar", children: [
796
+ /* @__PURE__ */ h(
797
+ "button",
798
+ {
799
+ type: "button",
800
+ className: "sui-monthpicker__label",
801
+ "aria-expanded": c,
802
+ "aria-haspopup": "dialog",
803
+ onClick: z,
804
+ children: [
805
+ /* @__PURE__ */ e(P, { name: "calendar", size: 16, color: "var(--text-brand)" }),
806
+ /* @__PURE__ */ h("span", { className: "sui-monthpicker__label-text", children: [
807
+ /* @__PURE__ */ e("span", { className: "sui-monthpicker__label-ghost", "aria-hidden": "true", children: M }),
808
+ /* @__PURE__ */ e("span", { className: "sui-monthpicker__label-value", children: f })
809
+ ] })
810
+ ]
811
+ }
812
+ ),
813
+ /* @__PURE__ */ e("span", { className: "sui-monthpicker__divider", "aria-hidden": "true" }),
814
+ /* @__PURE__ */ e("button", { type: "button", className: "sui-monthpicker__step", "aria-label": l, onClick: () => $(-1), children: /* @__PURE__ */ e(P, { name: "chevLeft", size: 16 }) }),
815
+ /* @__PURE__ */ e("button", { type: "button", className: "sui-monthpicker__step", "aria-label": i, onClick: () => $(1), children: /* @__PURE__ */ e(P, { name: "chevRight", size: 16 }) })
816
+ ] }),
817
+ c && /* @__PURE__ */ h(ee, { children: [
818
+ /* @__PURE__ */ e("div", { className: "sui-monthpicker__backdrop", onClick: () => o(!1) }),
819
+ /* @__PURE__ */ h("div", { className: "sui-monthpicker__panel", role: "dialog", "aria-label": f, children: [
820
+ /* @__PURE__ */ h("div", { className: "sui-monthpicker__yearbar", children: [
821
+ /* @__PURE__ */ e(
822
+ "button",
823
+ {
824
+ type: "button",
825
+ className: "sui-monthpicker__step sui-monthpicker__step--year",
826
+ "aria-label": "Ano anterior",
827
+ onClick: () => d((b) => b - 1),
828
+ children: /* @__PURE__ */ e(P, { name: "chevLeft", size: 16 })
829
+ }
830
+ ),
831
+ /* @__PURE__ */ e("span", { className: "sui-monthpicker__year", children: p }),
832
+ /* @__PURE__ */ e(
833
+ "button",
834
+ {
835
+ type: "button",
836
+ className: "sui-monthpicker__step sui-monthpicker__step--year",
837
+ "aria-label": "Próximo ano",
838
+ onClick: () => d((b) => b + 1),
839
+ children: /* @__PURE__ */ e(P, { name: "chevRight", size: 16 })
840
+ }
841
+ )
842
+ ] }),
843
+ /* @__PURE__ */ e("div", { className: "sui-monthpicker__grid", children: n.map((b, m) => {
844
+ const y = m + 1, u = t.year === p && t.month === y;
845
+ return /* @__PURE__ */ e(
846
+ "button",
847
+ {
848
+ type: "button",
849
+ "aria-pressed": u,
850
+ className: "sui-monthpicker__month",
851
+ "data-selected": u || void 0,
852
+ "data-current": T === p && R === y || void 0,
853
+ onClick: () => {
854
+ a({ year: p, month: y }), o(!1);
855
+ },
856
+ children: E(b)
857
+ },
858
+ y
859
+ );
860
+ }) })
861
+ ] })
862
+ ] })
863
+ ] });
864
+ }
865
+ const He = [
866
+ "#5961f7",
867
+ "#15b887",
868
+ "#f7547a",
869
+ "#f59e0b",
870
+ "#38bdf8",
871
+ "#8b5cf6",
872
+ "#ec4899",
873
+ "#10b981",
874
+ "#6366f1",
875
+ "#94a3b8"
876
+ ];
877
+ function vt({
878
+ value: t,
879
+ onChange: a,
880
+ swatches: n = He,
881
+ defaultOpen: s = !1,
882
+ open: l,
883
+ onOpenChange: i,
884
+ showInput: r = !0,
885
+ customLabel: c = "Cor personalizada",
886
+ className: o
887
+ }) {
888
+ const p = n[0] ?? "#5961f7", [d, v] = de({
889
+ value: l,
890
+ defaultValue: s,
891
+ onChange: i
892
+ }), [f, k] = S(() => le(...re(t || p))), [M, E] = S("hex"), [$, z] = S(() => (t || p).replace("#", "")), L = K(null), T = K(null), R = K(null);
893
+ H(() => {
894
+ const N = ne(...oe(f.h, f.s, f.v));
895
+ (t || p).toLowerCase() !== N.toLowerCase() && k(le(...re(t || p)));
896
+ }, [t]), H(() => {
897
+ ("#" + $).toLowerCase() !== (t || p).toLowerCase() && z((t || p).replace("#", ""));
898
+ }, [t]);
899
+ const b = (N) => {
900
+ const x = { ...f, ...N };
901
+ k(x), a(ne(...oe(x.h, x.s, x.v)));
902
+ }, m = (N) => {
903
+ var A;
904
+ const x = (A = L.current) == null ? void 0 : A.getBoundingClientRect();
905
+ x && b({
906
+ s: Math.min(1, Math.max(0, (N.clientX - x.left) / x.width)),
907
+ v: 1 - Math.min(1, Math.max(0, (N.clientY - x.top) / x.height))
908
+ });
909
+ }, y = (N) => {
910
+ var A;
911
+ const x = (A = T.current) == null ? void 0 : A.getBoundingClientRect();
912
+ x && b({ h: Math.min(1, Math.max(0, (N.clientX - x.left) / x.width)) * 360 });
913
+ };
914
+ H(() => {
915
+ const N = (A) => {
916
+ R.current === "sv" ? m(A) : R.current === "hue" && y(A);
917
+ }, x = () => {
918
+ R.current = null;
919
+ };
920
+ return window.addEventListener("pointermove", N), window.addEventListener("pointerup", x), () => {
921
+ window.removeEventListener("pointermove", N), window.removeEventListener("pointerup", x);
922
+ };
923
+ }, [f]);
924
+ const [u, g, C] = oe(f.h, f.s, f.v), D = ne(u, g, C), Y = `hsl(${f.h},100%,50%)`, O = n.some((N) => N.toLowerCase() === D.toLowerCase()), X = (N) => {
925
+ k(le(...re(N))), a(N);
926
+ }, G = (N) => {
927
+ const x = N.replace("#", "");
928
+ z(x), /^[0-9a-fA-F]{6}$/.test(x) && X("#" + x.toLowerCase());
929
+ }, J = (N, x) => {
930
+ const A = Math.max(0, Math.min(255, parseInt(x, 10) || 0)), V = [u, g, C];
931
+ V[N] = A, X(ne(...V));
932
+ };
933
+ return /* @__PURE__ */ h("div", { className: w("sui-colorpicker", o), children: [
934
+ /* @__PURE__ */ h("div", { className: "sui-colorpicker__swatches", children: [
935
+ n.map((N) => {
936
+ const x = N.toLowerCase() === D.toLowerCase();
937
+ return /* @__PURE__ */ e(
938
+ "button",
939
+ {
940
+ type: "button",
941
+ "aria-label": N,
942
+ "aria-pressed": x,
943
+ onClick: () => X(N),
944
+ className: "sui-colorpicker__swatch",
945
+ style: {
946
+ background: N,
947
+ boxShadow: x ? `0 0 0 2px var(--surface-card), 0 0 0 4px ${N}, 0 4px 14px ${U(N, 0.35)}` : "inset 0 0 0 1px rgba(255,255,255,0.10)"
948
+ },
949
+ children: x && /* @__PURE__ */ e(P, { name: "check", size: 14, color: "#fff", strokeWidth: 3 })
950
+ },
951
+ N
952
+ );
953
+ }),
954
+ /* @__PURE__ */ e(
955
+ "button",
956
+ {
957
+ type: "button",
958
+ title: c,
959
+ "aria-label": c,
960
+ "aria-expanded": d,
961
+ onClick: () => v(!d),
962
+ className: "sui-colorpicker__wheel",
963
+ style: {
964
+ boxShadow: !O || d ? "0 0 0 2px var(--surface-card), 0 0 0 4px var(--text-secondary)" : "inset 0 0 0 1px rgba(255,255,255,0.10)"
965
+ },
966
+ children: /* @__PURE__ */ e(
967
+ "span",
968
+ {
969
+ className: "sui-colorpicker__wheel-center",
970
+ style: { background: O ? "var(--surface-card)" : D },
971
+ children: O && /* @__PURE__ */ e(P, { name: "plus", size: 12, color: "var(--text-secondary)", strokeWidth: 2.5 })
972
+ }
973
+ )
974
+ }
975
+ )
976
+ ] }),
977
+ d && /* @__PURE__ */ h("div", { className: "sui-colorpicker__panel", children: [
978
+ /* @__PURE__ */ e(
979
+ "div",
980
+ {
981
+ ref: L,
982
+ onPointerDown: (N) => {
983
+ R.current = "sv", m(N);
984
+ },
985
+ className: "sui-colorpicker__sv",
986
+ style: { backgroundImage: `linear-gradient(to top, #000, rgba(0,0,0,0)), linear-gradient(to right, #fff, ${Y})` },
987
+ children: /* @__PURE__ */ e(
988
+ "div",
989
+ {
990
+ className: "sui-colorpicker__knob",
991
+ style: { left: `${f.s * 100}%`, top: `${(1 - f.v) * 100}%`, background: D }
992
+ }
993
+ )
994
+ }
995
+ ),
996
+ /* @__PURE__ */ e(
997
+ "div",
998
+ {
999
+ ref: T,
1000
+ onPointerDown: (N) => {
1001
+ R.current = "hue", y(N);
1002
+ },
1003
+ className: "sui-colorpicker__hue",
1004
+ children: /* @__PURE__ */ e(
1005
+ "div",
1006
+ {
1007
+ className: "sui-colorpicker__knob",
1008
+ style: { left: `${f.h / 360 * 100}%`, top: "50%", background: Y }
1009
+ }
1010
+ )
1011
+ }
1012
+ ),
1013
+ r && /* @__PURE__ */ h("div", { className: "sui-colorpicker__inputrow", children: [
1014
+ /* @__PURE__ */ e(
1015
+ "div",
1016
+ {
1017
+ className: "sui-colorpicker__preview",
1018
+ style: { background: D, boxShadow: `inset 0 0 0 1px rgba(255,255,255,0.18), 0 4px 16px ${U(D, 0.35)}` }
1019
+ }
1020
+ ),
1021
+ /* @__PURE__ */ e("div", { className: "sui-colorpicker__field", children: M === "hex" ? /* @__PURE__ */ h(ee, { children: [
1022
+ /* @__PURE__ */ e("span", { className: "sui-colorpicker__prefix", children: "#" }),
1023
+ /* @__PURE__ */ e(
1024
+ "input",
1025
+ {
1026
+ value: $,
1027
+ onChange: (N) => G(N.target.value),
1028
+ spellCheck: !1,
1029
+ maxLength: 6,
1030
+ "aria-label": "Valor hexadecimal",
1031
+ className: "sui-colorpicker__hexinput"
1032
+ }
1033
+ )
1034
+ ] }) : /* @__PURE__ */ e("div", { className: "sui-colorpicker__rgbfields", children: ["R", "G", "B"].map((N, x) => /* @__PURE__ */ h("div", { className: "sui-colorpicker__rgbfield-wrap", children: [
1035
+ /* @__PURE__ */ e(
1036
+ "input",
1037
+ {
1038
+ value: String([u, g, C][x]),
1039
+ onChange: (A) => J(x, A.target.value),
1040
+ spellCheck: !1,
1041
+ maxLength: 3,
1042
+ inputMode: "numeric",
1043
+ "aria-label": N,
1044
+ className: "sui-colorpicker__rgbinput"
1045
+ }
1046
+ ),
1047
+ x < 2 && /* @__PURE__ */ e("span", { className: "sui-colorpicker__rgbsep", children: "·" })
1048
+ ] }, N)) }) }),
1049
+ /* @__PURE__ */ h("div", { className: "sui-colorpicker__modetoggle", children: [
1050
+ /* @__PURE__ */ e(
1051
+ "button",
1052
+ {
1053
+ type: "button",
1054
+ "aria-pressed": M === "hex",
1055
+ onClick: () => E("hex"),
1056
+ className: "sui-colorpicker__modetab",
1057
+ "data-active": M === "hex" || void 0,
1058
+ children: "HEX"
1059
+ }
1060
+ ),
1061
+ /* @__PURE__ */ e(
1062
+ "button",
1063
+ {
1064
+ type: "button",
1065
+ "aria-pressed": M === "rgb",
1066
+ onClick: () => E("rgb"),
1067
+ className: "sui-colorpicker__modetab",
1068
+ "data-active": M === "rgb" || void 0,
1069
+ children: "RGB"
1070
+ }
1071
+ )
1072
+ ] })
1073
+ ] })
1074
+ ] })
1075
+ ] });
1076
+ }
1077
+ const Ve = [
1078
+ "tag",
1079
+ "building",
1080
+ "utensils",
1081
+ "car",
1082
+ "heart",
1083
+ "gamepad",
1084
+ "shopping",
1085
+ "trending",
1086
+ "wallet",
1087
+ "briefcase",
1088
+ "dollar",
1089
+ "card",
1090
+ "repeat",
1091
+ "target",
1092
+ "bell",
1093
+ "calendar",
1094
+ "gift",
1095
+ "plane",
1096
+ "home",
1097
+ "coffee",
1098
+ "book",
1099
+ "music",
1100
+ "phone",
1101
+ "tool",
1102
+ "pet",
1103
+ "shirt",
1104
+ "fuel",
1105
+ "pill"
1106
+ ];
1107
+ function bt({
1108
+ value: t,
1109
+ onChange: a,
1110
+ color: n,
1111
+ icons: s = Ve,
1112
+ searchable: l,
1113
+ searchPlaceholder: i = "Buscar ícone...",
1114
+ emptyText: r = "Nenhum ícone encontrado",
1115
+ className: c
1116
+ }) {
1117
+ const [o, p] = S(""), d = l ?? s.length > 40, v = se(() => {
1118
+ if (!d || !o.trim()) return s;
1119
+ const f = q(o);
1120
+ return s.filter((k) => q(k).includes(f));
1121
+ }, [s, o, d]);
1122
+ return /* @__PURE__ */ h("div", { className: w("sui-iconpicker", c), children: [
1123
+ d && /* @__PURE__ */ e(
1124
+ "input",
1125
+ {
1126
+ className: "sui-iconpicker__search",
1127
+ value: o,
1128
+ onChange: (f) => p(f.target.value),
1129
+ placeholder: i,
1130
+ "aria-label": i
1131
+ }
1132
+ ),
1133
+ /* @__PURE__ */ h("div", { className: "sui-iconpicker__grid", "data-scroll": d || void 0, children: [
1134
+ v.length === 0 && /* @__PURE__ */ e("div", { className: "sui-iconpicker__empty", children: r }),
1135
+ v.map((f) => {
1136
+ const k = t === f;
1137
+ return /* @__PURE__ */ e(
1138
+ "button",
1139
+ {
1140
+ type: "button",
1141
+ title: f,
1142
+ "aria-label": f,
1143
+ "aria-pressed": k,
1144
+ onClick: () => a(f),
1145
+ className: "sui-iconpicker__cell",
1146
+ "data-on": k || void 0,
1147
+ style: k ? { background: n, borderColor: "transparent" } : void 0,
1148
+ children: /* @__PURE__ */ e(
1149
+ P,
1150
+ {
1151
+ name: f,
1152
+ size: 17,
1153
+ color: k ? "#fff" : "var(--text-secondary)",
1154
+ strokeWidth: 1.9
1155
+ }
1156
+ )
1157
+ },
1158
+ f
1159
+ );
1160
+ })
1161
+ ] })
1162
+ ] });
1163
+ }
1164
+ function gt({
1165
+ label: t,
1166
+ value: a,
1167
+ sublabel: n,
1168
+ icon: s,
1169
+ accent: l,
1170
+ interactive: i,
1171
+ onClick: r,
1172
+ className: c
1173
+ }) {
1174
+ const o = l ? { "--sui-stat-accent": l } : void 0;
1175
+ return /* @__PURE__ */ h(
1176
+ "div",
1177
+ {
1178
+ className: w("sui-statcard", (i || r) && "sui-statcard--interactive", c),
1179
+ style: o,
1180
+ "data-accent": l ? "" : void 0,
1181
+ onClick: r,
1182
+ role: r ? "button" : void 0,
1183
+ tabIndex: r ? 0 : void 0,
1184
+ onKeyDown: r ? (p) => {
1185
+ (p.key === "Enter" || p.key === " ") && (p.preventDefault(), r());
1186
+ } : void 0,
1187
+ children: [
1188
+ /* @__PURE__ */ h("div", { className: "sui-statcard__head", children: [
1189
+ s && /* @__PURE__ */ e("span", { className: "sui-statcard__icon", children: s }),
1190
+ /* @__PURE__ */ e("span", { className: "sui-statcard__label", children: t })
1191
+ ] }),
1192
+ /* @__PURE__ */ e("div", { className: "sui-statcard__value", children: a }),
1193
+ n && /* @__PURE__ */ e("div", { className: "sui-statcard__sub", children: n })
1194
+ ]
1195
+ }
1196
+ );
1197
+ }
1198
+ function Nt({ icon: t, title: a, description: n, actions: s, dashed: l, className: i }) {
1199
+ return /* @__PURE__ */ h("div", { className: w("sui-emptystate", l && "sui-emptystate--dashed", i), children: [
1200
+ t && /* @__PURE__ */ e("div", { className: "sui-emptystate__icon", children: t }),
1201
+ /* @__PURE__ */ e("div", { className: "sui-emptystate__title", children: a }),
1202
+ n && /* @__PURE__ */ e("div", { className: "sui-emptystate__desc", children: n }),
1203
+ s && /* @__PURE__ */ e("div", { className: "sui-emptystate__actions", children: s })
1204
+ ] });
1205
+ }
1206
+ function yt({
1207
+ content: t,
1208
+ children: a,
1209
+ side: n = "top",
1210
+ align: s = "center",
1211
+ delayDuration: l = 200,
1212
+ className: i
1213
+ }) {
1214
+ return (
1215
+ // Provider embutido para uso avulso; envolver a app com <TooltipProvider>
1216
+ // é opcional (compartilha o timing entre tooltips). Providers aninhados são ok.
1217
+ /* @__PURE__ */ e(W.Provider, { delayDuration: l, children: /* @__PURE__ */ h(W.Root, { children: [
1218
+ /* @__PURE__ */ e(W.Trigger, { asChild: !0, children: a }),
1219
+ /* @__PURE__ */ e(W.Portal, { children: /* @__PURE__ */ h(
1220
+ W.Content,
1221
+ {
1222
+ className: w("sui-tooltip", i),
1223
+ side: n,
1224
+ align: s,
1225
+ sideOffset: 6,
1226
+ children: [
1227
+ t,
1228
+ /* @__PURE__ */ e(W.Arrow, { className: "sui-tooltip__arrow" })
1229
+ ]
1230
+ }
1231
+ ) })
1232
+ ] }) })
1233
+ );
1234
+ }
1235
+ const kt = W.Provider;
1236
+ function Ke({ interactive: t, className: a, ...n }) {
1237
+ return /* @__PURE__ */ e(
1238
+ "div",
1239
+ {
1240
+ className: w("sui-card", t && "sui-card--interactive", a),
1241
+ ...n
1242
+ }
1243
+ );
1244
+ }
1245
+ function qe({ className: t, ...a }) {
1246
+ return /* @__PURE__ */ e("div", { className: w("sui-card__header", t), ...a });
1247
+ }
1248
+ function We({ children: t, className: a, ...n }) {
1249
+ return /* @__PURE__ */ e(ze, { level: 4, className: w("sui-card__title", a), ...n, children: t });
1250
+ }
1251
+ function Ue({ className: t, ...a }) {
1252
+ return /* @__PURE__ */ e("div", { className: w("sui-card__content", t), ...a });
1253
+ }
1254
+ function Ye({ className: t, ...a }) {
1255
+ return /* @__PURE__ */ e("div", { className: w("sui-card__footer", t), ...a });
1256
+ }
1257
+ const xt = Object.assign(Ke, {
1258
+ Header: qe,
1259
+ Title: We,
1260
+ Content: Ue,
1261
+ Footer: Ye
1262
+ });
1263
+ function je({ open: t, defaultOpen: a, onOpenChange: n, children: s }) {
1264
+ return /* @__PURE__ */ e(F.Root, { open: t, defaultOpen: a, onOpenChange: n, children: s });
1265
+ }
1266
+ function Qe({
1267
+ title: t,
1268
+ description: a,
1269
+ maxWidth: n = 480,
1270
+ hideClose: s,
1271
+ className: l,
1272
+ children: i
1273
+ }) {
1274
+ return /* @__PURE__ */ h(F.Portal, { children: [
1275
+ /* @__PURE__ */ e(F.Overlay, { className: "sui-modal__overlay" }),
1276
+ /* @__PURE__ */ h(
1277
+ F.Content,
1278
+ {
1279
+ className: w("sui-modal__content", l),
1280
+ style: { maxWidth: n },
1281
+ children: [
1282
+ /* @__PURE__ */ h("div", { className: "sui-modal__header", children: [
1283
+ /* @__PURE__ */ h("div", { className: "sui-modal__heading", children: [
1284
+ /* @__PURE__ */ e(F.Title, { className: "sui-modal__title", children: t }),
1285
+ a && /* @__PURE__ */ e(F.Description, { className: "sui-modal__desc", children: a })
1286
+ ] }),
1287
+ !s && /* @__PURE__ */ e(F.Close, { className: "sui-modal__close", "aria-label": "Fechar", children: /* @__PURE__ */ e("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ e(
1288
+ "path",
1289
+ {
1290
+ d: "M6 6l12 12M18 6L6 18",
1291
+ stroke: "currentColor",
1292
+ strokeWidth: "2",
1293
+ strokeLinecap: "round"
1294
+ }
1295
+ ) }) })
1296
+ ] }),
1297
+ /* @__PURE__ */ e("div", { className: "sui-modal__body", children: i })
1298
+ ]
1299
+ }
1300
+ )
1301
+ ] });
1302
+ }
1303
+ function Xe({ className: t, ...a }) {
1304
+ return /* @__PURE__ */ e("div", { className: w("sui-modal__footer", t), ...a });
1305
+ }
1306
+ const wt = Object.assign(je, {
1307
+ Trigger: F.Trigger,
1308
+ Close: F.Close,
1309
+ Content: Qe,
1310
+ Footer: Xe
1311
+ }), Ge = "#B91C1C";
1312
+ function Je(t) {
1313
+ return t instanceof Error ? t.message : "Ocorreu um erro. Tente novamente.";
1314
+ }
1315
+ function Ct({
1316
+ open: t,
1317
+ onOpenChange: a,
1318
+ title: n,
1319
+ message: s,
1320
+ confirmLabel: l = "Confirmar",
1321
+ cancelLabel: i = "Cancelar",
1322
+ busyLabel: r = "Aguarde...",
1323
+ confirmVariant: c = "danger",
1324
+ icon: o,
1325
+ onConfirm: p,
1326
+ formatError: d = Je
1327
+ }) {
1328
+ const [v, f] = S(!1), [k, M] = S(null), E = async () => {
1329
+ if (!v) {
1330
+ f(!0), M(null);
1331
+ try {
1332
+ await p(), a(!1);
1333
+ } catch (z) {
1334
+ M(d(z));
1335
+ } finally {
1336
+ f(!1);
1337
+ }
1338
+ }
1339
+ }, $ = (z) => {
1340
+ v || (z || M(null), a(z));
1341
+ };
1342
+ return /* @__PURE__ */ e(F.Root, { open: t, onOpenChange: $, children: /* @__PURE__ */ h(F.Portal, { children: [
1343
+ /* @__PURE__ */ e(F.Overlay, { className: "sui-confirm__overlay" }),
1344
+ /* @__PURE__ */ h(F.Content, { className: "sui-confirm", children: [
1345
+ /* @__PURE__ */ h("div", { className: "sui-confirm__head", children: [
1346
+ o ?? /* @__PURE__ */ e(Se, { size: 44, radius: 12, bg: U(Ge, 0.15), children: /* @__PURE__ */ e(P, { name: "alert", size: 20, color: "var(--status-error-fg)" }) }),
1347
+ /* @__PURE__ */ h("div", { children: [
1348
+ /* @__PURE__ */ e(F.Title, { className: "sui-confirm__title", children: n }),
1349
+ /* @__PURE__ */ e(F.Description, { className: "sui-confirm__message", children: s })
1350
+ ] })
1351
+ ] }),
1352
+ k != null && /* @__PURE__ */ e("div", { className: "sui-confirm__error", role: "alert", children: k }),
1353
+ /* @__PURE__ */ h("div", { className: "sui-confirm__actions", children: [
1354
+ /* @__PURE__ */ e(me, { variant: "secondary", fullWidth: !0, disabled: v, onClick: () => $(!1), children: i }),
1355
+ /* @__PURE__ */ e(
1356
+ me,
1357
+ {
1358
+ variant: c,
1359
+ fullWidth: !0,
1360
+ loading: v,
1361
+ onClick: () => void E(),
1362
+ children: v ? r : l
1363
+ }
1364
+ )
1365
+ ] })
1366
+ ] })
1367
+ ] }) });
1368
+ }
1369
+ function Ze({ x: t, y: a, items: n, onClose: s, align: l = "end", className: i }) {
1370
+ const r = K(null), [c, o] = S({ top: 0, left: 0 });
1371
+ Ce(() => {
1372
+ o(ve(r.current));
1373
+ }, []), H(() => {
1374
+ var d, v;
1375
+ (v = (d = r.current) == null ? void 0 : d.querySelector(".sui-menu__item")) == null || v.focus({ preventScroll: !0 });
1376
+ }, []), H(() => {
1377
+ const d = (v) => {
1378
+ v.key === "Escape" && s();
1379
+ };
1380
+ return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
1381
+ }, [s]);
1382
+ const p = (d) => {
1383
+ var M, E;
1384
+ if (d.key !== "ArrowDown" && d.key !== "ArrowUp") return;
1385
+ d.preventDefault();
1386
+ const v = Array.from(((M = r.current) == null ? void 0 : M.querySelectorAll(".sui-menu__item")) ?? []), f = v.indexOf(document.activeElement), k = d.key === "ArrowDown" ? Math.min(f + 1, v.length - 1) : Math.max(f - 1, 0);
1387
+ (E = v[k]) == null || E.focus();
1388
+ };
1389
+ return /* @__PURE__ */ h(ee, { children: [
1390
+ /* @__PURE__ */ e("div", { className: "sui-menu__backdrop", onClick: s }),
1391
+ /* @__PURE__ */ e(
1392
+ "div",
1393
+ {
1394
+ ref: r,
1395
+ className: w("sui-menu", i),
1396
+ role: "menu",
1397
+ onKeyDown: p,
1398
+ style: {
1399
+ left: t - c.left,
1400
+ top: a + 6 - c.top,
1401
+ transform: l === "end" ? "translateX(-100%)" : void 0
1402
+ },
1403
+ children: n.map(
1404
+ (d, v) => d.sep ? /* @__PURE__ */ e("div", { className: "sui-menu__sep", role: "separator" }, v) : /* @__PURE__ */ h(
1405
+ "button",
1406
+ {
1407
+ type: "button",
1408
+ role: "menuitem",
1409
+ onClick: () => {
1410
+ var f;
1411
+ (f = d.onClick) == null || f.call(d), s();
1412
+ },
1413
+ className: "sui-menu__item",
1414
+ "data-danger": d.danger || void 0,
1415
+ children: [
1416
+ typeof d.icon == "string" ? /* @__PURE__ */ e(P, { name: d.icon, size: 15, color: d.danger ? "var(--status-error-fg)" : "var(--text-secondary)" }) : d.icon,
1417
+ /* @__PURE__ */ e("span", { children: d.label })
1418
+ ]
1419
+ },
1420
+ v
1421
+ )
1422
+ )
1423
+ }
1424
+ )
1425
+ ] });
1426
+ }
1427
+ const et = {
1428
+ pageSizePrefix: "Exibir",
1429
+ pageSizeItem: (t) => `${t} registros`,
1430
+ pageSizeSuffix: "registros",
1431
+ selected: (t) => `${t} selecionado(s)`,
1432
+ range: (t, a, n) => `Mostrando ${t}–${a} de ${n}`
1433
+ };
1434
+ function St({
1435
+ columns: t,
1436
+ data: a,
1437
+ keyField: n = "id",
1438
+ searchable: s = !0,
1439
+ searchPlaceholder: l = "Buscar...",
1440
+ selectable: i = !1,
1441
+ initialSelectedIds: r,
1442
+ pageSize: c = 10,
1443
+ pageSizeOptions: o = null,
1444
+ onRowClick: p,
1445
+ toolbarTitle: d,
1446
+ toolbarActions: v,
1447
+ bulkActions: f,
1448
+ emptyMessage: k = "Nenhum registro encontrado.",
1449
+ loadingMessage: M = "Carregando...",
1450
+ loading: E = !1,
1451
+ labels: $,
1452
+ className: z
1453
+ }) {
1454
+ const L = { ...et, ...$ }, [T, R] = S(""), [b, m] = S(null), [y, u] = S("asc"), [g, C] = S(
1455
+ () => new Set(r ?? [])
1456
+ ), [D, Y] = S(0), [O, X] = S(c), [G, J] = S(null), N = se(() => {
1457
+ if (!T.trim()) return a;
1458
+ const _ = T.toLowerCase();
1459
+ return a.filter(
1460
+ (I) => t.some((B) => {
1461
+ const Z = B.searchValue ? B.searchValue(I) : I[B.key];
1462
+ return Z != null && String(Z).toLowerCase().includes(_);
1463
+ })
1464
+ );
1465
+ }, [a, T, t]), x = se(() => {
1466
+ if (!b) return N;
1467
+ const _ = t.find((B) => B.key === b), I = [...N];
1468
+ return I.sort((B, Z) => {
1469
+ const te = _ != null && _.sortValue ? _.sortValue(B) : B[b], ae = _ != null && _.sortValue ? _.sortValue(Z) : Z[b];
1470
+ return te == null ? 1 : ae == null ? -1 : typeof te == "number" && typeof ae == "number" ? te - ae : String(te).localeCompare(String(ae));
1471
+ }), y === "desc" && I.reverse(), I;
1472
+ }, [N, b, y, t]), A = Math.max(1, Math.ceil(x.length / O)), V = Math.min(D, A - 1), j = x.slice(V * O, V * O + O);
1473
+ H(() => {
1474
+ Y(0);
1475
+ }, [T, b, y, O]);
1476
+ const be = (_) => {
1477
+ _.sortable && (b !== _.key ? (m(_.key), u("asc")) : y === "asc" ? u("desc") : (m(null), u("asc")));
1478
+ }, he = j.length > 0 && j.every((_) => g.has(_[n])), ge = () => {
1479
+ const _ = new Set(g);
1480
+ he ? j.forEach((I) => _.delete(I[n])) : j.forEach((I) => _.add(I[n])), C(_);
1481
+ }, Ne = (_) => {
1482
+ const I = new Set(g);
1483
+ I.has(_) ? I.delete(_) : I.add(_), C(I);
1484
+ };
1485
+ return /* @__PURE__ */ h("div", { className: w("sui-datatable", z), children: [
1486
+ (d || s || v) && /* @__PURE__ */ h("div", { className: "sui-datatable__toolbar", children: [
1487
+ d && /* @__PURE__ */ e("h3", { className: "sui-datatable__title", children: d }),
1488
+ o && /* @__PURE__ */ h("div", { className: "sui-datatable__pagesize", children: [
1489
+ /* @__PURE__ */ e("span", { children: L.pageSizePrefix }),
1490
+ /* @__PURE__ */ h(
1491
+ "button",
1492
+ {
1493
+ type: "button",
1494
+ onClick: (_) => {
1495
+ const I = _.currentTarget.getBoundingClientRect();
1496
+ J({ x: I.right, y: I.bottom });
1497
+ },
1498
+ className: "sui-datatable__pagesize-btn",
1499
+ children: [
1500
+ O,
1501
+ /* @__PURE__ */ e(P, { name: "chevDown", size: 12, strokeWidth: 2.5 })
1502
+ ]
1503
+ }
1504
+ ),
1505
+ G && /* @__PURE__ */ e(
1506
+ Ze,
1507
+ {
1508
+ x: G.x,
1509
+ y: G.y,
1510
+ onClose: () => J(null),
1511
+ items: o.map((_) => ({
1512
+ label: L.pageSizeItem(_),
1513
+ icon: _ === O ? "check" : void 0,
1514
+ onClick: () => {
1515
+ X(_), J(null);
1516
+ }
1517
+ }))
1518
+ }
1519
+ ),
1520
+ /* @__PURE__ */ e("span", { children: L.pageSizeSuffix })
1521
+ ] }),
1522
+ s && /* @__PURE__ */ h("div", { className: "sui-datatable__search", children: [
1523
+ /* @__PURE__ */ e(P, { name: "search", size: 14, color: "var(--text-muted)" }),
1524
+ /* @__PURE__ */ e(
1525
+ "input",
1526
+ {
1527
+ value: T,
1528
+ onChange: (_) => R(_.target.value),
1529
+ placeholder: l,
1530
+ "aria-label": l
1531
+ }
1532
+ )
1533
+ ] }),
1534
+ /* @__PURE__ */ e("div", { className: "sui-datatable__actions", children: v })
1535
+ ] }),
1536
+ i && g.size > 0 && /* @__PURE__ */ h("div", { className: "sui-datatable__bulkbar", children: [
1537
+ /* @__PURE__ */ e("span", { className: "sui-datatable__bulkcount", children: L.selected(g.size) }),
1538
+ /* @__PURE__ */ e("div", { className: "sui-datatable__bulkactions", children: f == null ? void 0 : f(g, () => C(/* @__PURE__ */ new Set())) })
1539
+ ] }),
1540
+ /* @__PURE__ */ e("div", { className: "sui-datatable__scroll", children: /* @__PURE__ */ h("table", { children: [
1541
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ h("tr", { children: [
1542
+ i && /* @__PURE__ */ e("th", { className: "sui-datatable__th sui-datatable__th--check", children: /* @__PURE__ */ e(
1543
+ "input",
1544
+ {
1545
+ type: "checkbox",
1546
+ checked: he,
1547
+ onChange: ge,
1548
+ "aria-label": "Selecionar página"
1549
+ }
1550
+ ) }),
1551
+ t.map((_) => /* @__PURE__ */ e(
1552
+ "th",
1553
+ {
1554
+ className: "sui-datatable__th",
1555
+ "data-align": _.align ?? "left",
1556
+ "data-sortable": _.sortable || void 0,
1557
+ style: { width: _.width },
1558
+ onClick: () => be(_),
1559
+ "aria-sort": b === _.key ? y === "asc" ? "ascending" : "descending" : void 0,
1560
+ children: /* @__PURE__ */ h("span", { className: "sui-datatable__th-inner", children: [
1561
+ _.header,
1562
+ _.sortable && /* @__PURE__ */ e(
1563
+ "span",
1564
+ {
1565
+ className: "sui-datatable__sort",
1566
+ "data-active": b === _.key || void 0,
1567
+ children: b === _.key ? y === "asc" ? "▲" : "▼" : "▾"
1568
+ }
1569
+ )
1570
+ ] })
1571
+ },
1572
+ _.key
1573
+ ))
1574
+ ] }) }),
1575
+ /* @__PURE__ */ h("tbody", { children: [
1576
+ j.length === 0 && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
1577
+ "td",
1578
+ {
1579
+ colSpan: t.length + (i ? 1 : 0),
1580
+ className: "sui-datatable__empty",
1581
+ children: E ? M : k
1582
+ }
1583
+ ) }),
1584
+ j.map((_) => {
1585
+ const I = g.has(_[n]);
1586
+ return /* @__PURE__ */ h(
1587
+ "tr",
1588
+ {
1589
+ onClick: () => p == null ? void 0 : p(_),
1590
+ className: "sui-datatable__row",
1591
+ "data-selected": I || void 0,
1592
+ "data-clickable": p ? !0 : void 0,
1593
+ children: [
1594
+ i && /* @__PURE__ */ e("td", { className: "sui-datatable__td", onClick: (B) => B.stopPropagation(), children: /* @__PURE__ */ e(
1595
+ "input",
1596
+ {
1597
+ type: "checkbox",
1598
+ checked: I,
1599
+ onChange: () => Ne(_[n]),
1600
+ "aria-label": "Selecionar linha"
1601
+ }
1602
+ ) }),
1603
+ t.map((B) => /* @__PURE__ */ e("td", { className: "sui-datatable__td", "data-align": B.align ?? "left", children: B.render ? B.render(_) : String(_[B.key] ?? "") }, B.key))
1604
+ ]
1605
+ },
1606
+ String(_[n])
1607
+ );
1608
+ })
1609
+ ] })
1610
+ ] }) }),
1611
+ x.length > 0 && /* @__PURE__ */ h("div", { className: "sui-datatable__footer", children: [
1612
+ /* @__PURE__ */ e("span", { className: "sui-datatable__range", children: L.range(V * O + 1, Math.min(x.length, (V + 1) * O), x.length) }),
1613
+ /* @__PURE__ */ h("div", { className: "sui-datatable__pager", children: [
1614
+ /* @__PURE__ */ e(
1615
+ "button",
1616
+ {
1617
+ type: "button",
1618
+ disabled: V === 0,
1619
+ onClick: () => Y((_) => Math.max(0, _ - 1)),
1620
+ "aria-label": "Página anterior",
1621
+ children: "‹"
1622
+ }
1623
+ ),
1624
+ /* @__PURE__ */ h("span", { className: "sui-datatable__pageinfo", children: [
1625
+ V + 1,
1626
+ " / ",
1627
+ A
1628
+ ] }),
1629
+ /* @__PURE__ */ e(
1630
+ "button",
1631
+ {
1632
+ type: "button",
1633
+ disabled: V >= A - 1,
1634
+ onClick: () => Y((_) => Math.min(A - 1, _ + 1)),
1635
+ "aria-label": "Próxima página",
1636
+ children: "›"
1637
+ }
1638
+ )
1639
+ ] })
1640
+ ] })
1641
+ ] });
1642
+ }
1643
+ function Mt({ maxWidth: t = 1280, className: a, style: n, ...s }) {
1644
+ return /* @__PURE__ */ e(
1645
+ "div",
1646
+ {
1647
+ className: w("sui-page", a),
1648
+ style: { "--sui-page-max": `${t}px`, ...n },
1649
+ ...s
1650
+ }
1651
+ );
1652
+ }
1653
+ function tt() {
1654
+ const [t, a] = S(() => typeof window > "u" ? 1280 : window.innerWidth);
1655
+ return H(() => {
1656
+ const n = () => a(window.innerWidth);
1657
+ return window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
1658
+ }, []), t;
1659
+ }
1660
+ function Dt({
1661
+ nav: t,
1662
+ logo: a,
1663
+ topbarCenter: n,
1664
+ topbarEnd: s,
1665
+ sidebarFooter: l,
1666
+ searchable: i = !1,
1667
+ searchPlaceholder: r = "Procurar",
1668
+ collapsed: c,
1669
+ defaultCollapsed: o = !1,
1670
+ onCollapsedChange: p,
1671
+ mobileBreakpoint: d = 860,
1672
+ menuButtonLabel: v = "Menu",
1673
+ children: f,
1674
+ className: k
1675
+ }) {
1676
+ const [M, E] = de({
1677
+ value: c,
1678
+ defaultValue: o,
1679
+ onChange: p
1680
+ }), [$, z] = S(!1), [L, T] = S(""), b = tt() < d, m = b ? !0 : !M, y = se(() => {
1681
+ const g = q(L.trim());
1682
+ return g ? t.map((C) => ({
1683
+ ...C,
1684
+ items: C.items.filter(
1685
+ (D) => typeof D.label == "string" ? q(D.label).includes(g) : !0
1686
+ )
1687
+ })).filter((C) => C.items.length > 0) : t;
1688
+ }, [t, L]), u = (g) => {
1689
+ var C;
1690
+ (C = g.onSelect) == null || C.call(g), z(!1);
1691
+ };
1692
+ return /* @__PURE__ */ h(
1693
+ "div",
1694
+ {
1695
+ className: w("sui-appshell", k),
1696
+ "data-mobile": b || void 0,
1697
+ "data-collapsed": !b && M || void 0,
1698
+ children: [
1699
+ /* @__PURE__ */ h("header", { className: "sui-appshell__topbar", children: [
1700
+ /* @__PURE__ */ h("div", { className: "sui-appshell__topbar-start", children: [
1701
+ /* @__PURE__ */ e(
1702
+ De,
1703
+ {
1704
+ "aria-label": v,
1705
+ variant: "ghost",
1706
+ onClick: () => b ? z(!$) : E(!M),
1707
+ children: /* @__PURE__ */ e(P, { name: "menu", size: 20 })
1708
+ }
1709
+ ),
1710
+ a && /* @__PURE__ */ e("div", { className: "sui-appshell__logo", children: a })
1711
+ ] }),
1712
+ n && /* @__PURE__ */ e("div", { className: "sui-appshell__topbar-center", children: n }),
1713
+ /* @__PURE__ */ e("div", { className: "sui-appshell__topbar-end", children: s })
1714
+ ] }),
1715
+ /* @__PURE__ */ h("aside", { className: "sui-appshell__sidebar", "data-open": b && $ || void 0, children: [
1716
+ i && m && /* @__PURE__ */ h("div", { className: "sui-appshell__search", children: [
1717
+ /* @__PURE__ */ e(P, { name: "search", size: 15, color: "var(--text-muted)" }),
1718
+ /* @__PURE__ */ e(
1719
+ "input",
1720
+ {
1721
+ value: L,
1722
+ onChange: (g) => T(g.target.value),
1723
+ placeholder: r,
1724
+ "aria-label": r
1725
+ }
1726
+ )
1727
+ ] }),
1728
+ /* @__PURE__ */ e("div", { className: "sui-appshell__nav", children: y.map((g, C) => /* @__PURE__ */ h("div", { className: "sui-appshell__navgroup", children: [
1729
+ m && g.label && /* @__PURE__ */ e("h4", { className: "sui-appshell__navlabel", children: g.label }),
1730
+ g.items.map((D) => /* @__PURE__ */ h(
1731
+ "button",
1732
+ {
1733
+ type: "button",
1734
+ title: typeof D.label == "string" ? D.label : void 0,
1735
+ onClick: () => u(D),
1736
+ className: "sui-appshell__navitem",
1737
+ "data-active": D.active || void 0,
1738
+ "data-icon-only": !m || void 0,
1739
+ "aria-current": D.active ? "page" : void 0,
1740
+ children: [
1741
+ D.icon && /* @__PURE__ */ e("span", { className: "sui-appshell__navicon", children: D.icon }),
1742
+ m && /* @__PURE__ */ e("span", { className: "sui-appshell__navtext", children: D.label })
1743
+ ]
1744
+ },
1745
+ D.key
1746
+ ))
1747
+ ] }, C)) }),
1748
+ l && /* @__PURE__ */ e("div", { className: "sui-appshell__sidebar-footer", children: l })
1749
+ ] }),
1750
+ /* @__PURE__ */ e("main", { className: "sui-appshell__content", children: f }),
1751
+ b && $ && /* @__PURE__ */ e("div", { className: "sui-appshell__scrim", onClick: () => z(!1) })
1752
+ ]
1753
+ }
1754
+ );
1755
+ }
1756
+ function zt({ eyebrow: t, title: a, description: n, actions: s, className: l }) {
1757
+ return /* @__PURE__ */ h("div", { className: w("sui-pageheader", l), children: [
1758
+ /* @__PURE__ */ h("div", { className: "sui-pageheader__text", children: [
1759
+ t && /* @__PURE__ */ e("span", { className: "sui-pageheader__eyebrow", children: t }),
1760
+ /* @__PURE__ */ e("h1", { className: "sui-pageheader__title", children: a }),
1761
+ n && /* @__PURE__ */ e("p", { className: "sui-pageheader__desc", children: n })
1762
+ ] }),
1763
+ s && /* @__PURE__ */ e("div", { className: "sui-pageheader__actions", children: s })
1764
+ ] });
1765
+ }
1766
+ export {
1767
+ Dt as AppShell,
1768
+ rt as Avatar,
1769
+ it as Badge,
1770
+ me as Button,
1771
+ xt as Card,
1772
+ vt as ColorPicker,
1773
+ ut as Combobox,
1774
+ Ct as ConfirmModal,
1775
+ Ve as DEFAULT_PICKER_ICONS,
1776
+ He as DEFAULT_SWATCHES,
1777
+ St as DataTable,
1778
+ ft as DateTimeInput,
1779
+ Nt as EmptyState,
1780
+ ct as FormField,
1781
+ ze as Heading,
1782
+ Lt as ICON_PATHS,
1783
+ P as Icon,
1784
+ Se as IconBox,
1785
+ De as IconButton,
1786
+ bt as IconPicker,
1787
+ _e as Input,
1788
+ Ee as Label,
1789
+ Ze as Menu,
1790
+ wt as Modal,
1791
+ pt as MoneyInput,
1792
+ _t as MonthPicker,
1793
+ dt as MultiSelect,
1794
+ Mt as PageContainer,
1795
+ zt as PageHeader,
1796
+ ot as ProgressBar,
1797
+ ht as SegmentedControl,
1798
+ lt as Skeleton,
1799
+ Me as Spinner,
1800
+ gt as StatCard,
1801
+ Le as Switch,
1802
+ mt as SwitchCard,
1803
+ pe as Text,
1804
+ yt as Tooltip,
1805
+ kt as TooltipProvider,
1806
+ w as cx,
1807
+ It as getIconNames,
1808
+ U as hexA,
1809
+ Tt as isImageIconSource,
1810
+ q as normalizeSearch,
1811
+ Rt as registerIconAliases,
1812
+ At as registerIcons,
1813
+ de as useControllableState
1814
+ };