bav-react-ui 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 (52) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +20 -0
  3. package/dist/bav-ui.cjs +2 -0
  4. package/dist/bav-ui.cjs.map +1 -0
  5. package/dist/bav-ui.mjs +1601 -0
  6. package/dist/bav-ui.mjs.map +1 -0
  7. package/dist/components/Alert.d.ts +11 -0
  8. package/dist/components/Avatar.d.ts +8 -0
  9. package/dist/components/Badge.d.ts +10 -0
  10. package/dist/components/Breadcrumbs.d.ts +11 -0
  11. package/dist/components/Button.d.ts +12 -0
  12. package/dist/components/Card.d.ts +16 -0
  13. package/dist/components/Checkbox.d.ts +5 -0
  14. package/dist/components/ConfirmDialog.d.ts +1 -0
  15. package/dist/components/DescriptionList.d.ts +12 -0
  16. package/dist/components/Divider.d.ts +7 -0
  17. package/dist/components/EmptyState.d.ts +9 -0
  18. package/dist/components/FileInput.d.ts +9 -0
  19. package/dist/components/Flex.d.ts +13 -0
  20. package/dist/components/FormField.d.ts +14 -0
  21. package/dist/components/IconButton.d.ts +8 -0
  22. package/dist/components/Input.d.ts +7 -0
  23. package/dist/components/Kbd.d.ts +6 -0
  24. package/dist/components/Layout.d.ts +19 -0
  25. package/dist/components/Menu.d.ts +20 -0
  26. package/dist/components/Modal.d.ts +13 -0
  27. package/dist/components/Pagination.d.ts +10 -0
  28. package/dist/components/Panel.d.ts +11 -0
  29. package/dist/components/ProgressBar.d.ts +8 -0
  30. package/dist/components/Radio.d.ts +19 -0
  31. package/dist/components/SearchInput.d.ts +8 -0
  32. package/dist/components/Select.d.ts +13 -0
  33. package/dist/components/Skeleton.d.ts +9 -0
  34. package/dist/components/Spinner.d.ts +5 -0
  35. package/dist/components/Stat.d.ts +10 -0
  36. package/dist/components/Switch.d.ts +5 -0
  37. package/dist/components/Table.d.ts +23 -0
  38. package/dist/components/Tabs.d.ts +16 -0
  39. package/dist/components/Tag.d.ts +7 -0
  40. package/dist/components/Textarea.d.ts +5 -0
  41. package/dist/components/Toast.d.ts +1 -0
  42. package/dist/components/Tooltip.d.ts +8 -0
  43. package/dist/components/Typography.d.ts +27 -0
  44. package/dist/components/confirmStore.d.ts +21 -0
  45. package/dist/components/toastStore.d.ts +25 -0
  46. package/dist/index.css +1 -0
  47. package/dist/index.d.ts +43 -0
  48. package/dist/theme/ThemeProvider.d.ts +5 -0
  49. package/dist/theme/tokens.d.ts +23 -0
  50. package/dist/theme/useThemeStore.d.ts +21 -0
  51. package/dist/utils/cx.d.ts +2 -0
  52. package/package.json +59 -0
@@ -0,0 +1,1601 @@
1
+ import { create as e } from "zustand";
2
+ import { Fragment as t, createContext as n, forwardRef as r, useContext as i, useEffect as a, useId as o, useRef as s, useState as c } from "react";
3
+ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
4
+ import { AlertCircle as f, AlertTriangle as p, Check as m, CheckCircle as ee, ChevronDown as te, ChevronLeft as ne, ChevronRight as re, Inbox as ie, Info as ae, Search as oe, Smile as se, X as h } from "react-feather";
5
+ import { createPortal as ce } from "react-dom";
6
+ import './index.css';//#region src/theme/tokens.ts
7
+ var le = {
8
+ primary: "#ffffff",
9
+ bg: "#000000",
10
+ panel: "#111111",
11
+ card: "#1a1a1a",
12
+ border: "#333333",
13
+ text: "#ffffff",
14
+ muted: "#b3b3b3",
15
+ accent: "#60a5fa",
16
+ danger: "#ff4444",
17
+ success: "#4caf50",
18
+ warning: "#f59e0b",
19
+ focus: "rgba(255, 255, 255, 0.3)",
20
+ chipsBackground: "rgba(255, 255, 255, 0.04)",
21
+ chipsBackgroundActive: "rgba(255, 255, 255, 0.12)",
22
+ buttons: "#2a2a2a",
23
+ shadow: "rgba(0, 0, 0, 0.2)"
24
+ }, ue = {
25
+ primary: "#000000",
26
+ bg: "#ffffff",
27
+ panel: "#eeeeee",
28
+ card: "#efefef",
29
+ border: "#bbbbbb",
30
+ text: "#000000",
31
+ muted: "#323232",
32
+ accent: "#2563eb",
33
+ danger: "#ff4444",
34
+ success: "#4caf50",
35
+ warning: "#d97706",
36
+ focus: "rgba(0, 0, 0, 0.25)",
37
+ chipsBackground: "#efefef",
38
+ chipsBackgroundActive: "rgba(0, 0, 0, 0.08)",
39
+ buttons: "#dcdcdc",
40
+ shadow: "rgba(0, 0, 0, 0.12)"
41
+ }, g = {
42
+ dark: le,
43
+ light: ue
44
+ }, de = {
45
+ primary: "--primary",
46
+ bg: "--bg",
47
+ panel: "--panel",
48
+ card: "--card",
49
+ border: "--border",
50
+ text: "--text",
51
+ muted: "--muted",
52
+ accent: "--accent",
53
+ danger: "--danger",
54
+ success: "--success",
55
+ warning: "--warning",
56
+ focus: "--focus",
57
+ chipsBackground: "--chips-background",
58
+ chipsBackgroundActive: "--chips-background-active",
59
+ buttons: "--buttons",
60
+ shadow: "--shadow"
61
+ };
62
+ function fe(e) {
63
+ let t = {};
64
+ for (let n of Object.keys(e)) t[de[n]] = e[n];
65
+ return t;
66
+ }
67
+ //#endregion
68
+ //#region node_modules/.bun/zustand@5.0.14+93dbe784b8baa420/node_modules/zustand/esm/middleware.mjs
69
+ function pe(e, t) {
70
+ let n;
71
+ try {
72
+ n = e();
73
+ } catch {
74
+ return;
75
+ }
76
+ return {
77
+ getItem: (e) => {
78
+ let r = (e) => e === null ? null : JSON.parse(e, t?.reviver), i = n.getItem(e) ?? null;
79
+ return i instanceof Promise ? i.then(r) : r(i);
80
+ },
81
+ setItem: (e, r) => n.setItem(e, JSON.stringify(r, t?.replacer)),
82
+ removeItem: (e) => n.removeItem(e)
83
+ };
84
+ }
85
+ var _ = (e) => (t) => {
86
+ try {
87
+ let n = e(t);
88
+ return n instanceof Promise ? n : {
89
+ then(e) {
90
+ return _(e)(n);
91
+ },
92
+ catch(e) {
93
+ return this;
94
+ }
95
+ };
96
+ } catch (e) {
97
+ return {
98
+ then(e) {
99
+ return this;
100
+ },
101
+ catch(t) {
102
+ return _(t)(e);
103
+ }
104
+ };
105
+ }
106
+ }, v = e()(((e, t) => (n, r, i) => {
107
+ let a = {
108
+ storage: pe(() => window.localStorage),
109
+ partialize: (e) => e,
110
+ version: 0,
111
+ merge: (e, t) => ({
112
+ ...t,
113
+ ...e
114
+ }),
115
+ ...t
116
+ }, o = !1, s = 0, c = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), u = a.storage;
117
+ if (!u) return e((...e) => {
118
+ console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`), n(...e);
119
+ }, r, i);
120
+ let d = () => {
121
+ let e = a.partialize({ ...r() });
122
+ return u.setItem(a.name, {
123
+ state: e,
124
+ version: a.version
125
+ });
126
+ }, f = i.setState;
127
+ i.setState = (e, t) => (f(e, t), d());
128
+ let p = e((...e) => (n(...e), d()), r, i);
129
+ i.getInitialState = () => p;
130
+ let m, ee = () => {
131
+ if (!u) return;
132
+ let e = ++s;
133
+ o = !1, c.forEach((e) => e(r() ?? p));
134
+ let t = a.onRehydrateStorage?.call(a, r() ?? p) || void 0;
135
+ return _(u.getItem.bind(u))(a.name).then((e) => {
136
+ if (e) if (typeof e.version == "number" && e.version !== a.version) {
137
+ if (a.migrate) {
138
+ let t = a.migrate(e.state, e.version);
139
+ return t instanceof Promise ? t.then((e) => [!0, e]) : [!0, t];
140
+ }
141
+ console.error("State loaded from storage couldn't be migrated since no migrate function was provided");
142
+ } else return [!1, e.state];
143
+ return [!1, void 0];
144
+ }).then((t) => {
145
+ if (e !== s) return;
146
+ let [i, o] = t;
147
+ if (m = a.merge(o, r() ?? p), n(m, !0), i) return d();
148
+ }).then(() => {
149
+ e === s && (t?.(r(), void 0), m = r(), o = !0, l.forEach((e) => e(m)));
150
+ }).catch((n) => {
151
+ e === s && t?.(void 0, n);
152
+ });
153
+ };
154
+ return i.persist = {
155
+ setOptions: (e) => {
156
+ a = {
157
+ ...a,
158
+ ...e
159
+ }, e.storage && (u = e.storage);
160
+ },
161
+ clearStorage: () => {
162
+ u?.removeItem(a.name);
163
+ },
164
+ getOptions: () => a,
165
+ rehydrate: () => ee(),
166
+ hasHydrated: () => o,
167
+ onHydrate: (e) => (c.add(e), () => {
168
+ c.delete(e);
169
+ }),
170
+ onFinishHydration: (e) => (l.add(e), () => {
171
+ l.delete(e);
172
+ })
173
+ }, a.skipHydration || ee(), m || p;
174
+ })((e, t) => ({
175
+ currentTheme: "dark",
176
+ tokens: g.dark,
177
+ setTheme: (t) => e({
178
+ currentTheme: t,
179
+ tokens: g[t]
180
+ }),
181
+ toggleTheme: () => {
182
+ let n = t().currentTheme === "dark" ? "light" : "dark";
183
+ e({
184
+ currentTheme: n,
185
+ tokens: g[n]
186
+ });
187
+ }
188
+ }), { name: "bav-theme" }));
189
+ //#endregion
190
+ //#region src/theme/ThemeProvider.tsx
191
+ function me({ children: e }) {
192
+ let t = v((e) => e.tokens), n = v((e) => e.currentTheme);
193
+ return a(() => {
194
+ let e = document.documentElement, r = fe(t);
195
+ for (let [t, n] of Object.entries(r)) e.style.setProperty(t, n);
196
+ e.setAttribute("data-theme", n);
197
+ }, [t, n]), /* @__PURE__ */ u(l, { children: e });
198
+ }
199
+ //#endregion
200
+ //#region src/utils/cx.ts
201
+ var y = (...e) => e.filter((e) => typeof e == "string" && e.length > 0).join(" "), he = {
202
+ spinner: "_spinner_102nw_1",
203
+ "bav-spin": "_bav-spin_102nw_1"
204
+ };
205
+ //#endregion
206
+ //#region src/components/Spinner.tsx
207
+ function ge({ size: e, className: t }) {
208
+ return /* @__PURE__ */ u("span", {
209
+ className: `${he.spinner} ${t}`,
210
+ style: {
211
+ width: e,
212
+ height: e
213
+ },
214
+ role: "status",
215
+ "aria-label": "Loading"
216
+ });
217
+ }
218
+ var b = {
219
+ button: "_button_1ejsq_1",
220
+ sm: "_sm_1ejsq_40",
221
+ md: "_md_1ejsq_45",
222
+ lg: "_lg_1ejsq_50",
223
+ primary: "_primary_1ejsq_56",
224
+ danger: "_danger_1ejsq_66",
225
+ subtle: "_subtle_1ejsq_76",
226
+ ghost: "_ghost_1ejsq_80",
227
+ block: "_block_1ejsq_89",
228
+ loading: "_loading_1ejsq_93",
229
+ spinner: "_spinner_1ejsq_97",
230
+ icon: "_icon_1ejsq_105"
231
+ }, _e = {
232
+ default: "",
233
+ primary: b.primary,
234
+ danger: b.danger,
235
+ subtle: b.subtle,
236
+ ghost: b.ghost
237
+ };
238
+ function ve({ variant: e, size: t, block: n, loading: r, leftIcon: i, rightIcon: a, className: o, type: s, disabled: c, children: l, ...f }) {
239
+ return /* @__PURE__ */ d("button", {
240
+ type: s,
241
+ disabled: c || r,
242
+ className: y(b.button, b[t], _e[e], n && b.block, r && b.loading, o),
243
+ ...f,
244
+ children: [
245
+ r && /* @__PURE__ */ u("span", {
246
+ className: b.spinner,
247
+ children: /* @__PURE__ */ u(ge, { size: t === "lg" ? 20 : 16 })
248
+ }),
249
+ i && /* @__PURE__ */ u("span", {
250
+ className: b.icon,
251
+ children: i
252
+ }),
253
+ l,
254
+ a && /* @__PURE__ */ u("span", {
255
+ className: b.icon,
256
+ children: a
257
+ })
258
+ ]
259
+ });
260
+ }
261
+ var x = {
262
+ button: "_button_1bhk3_1",
263
+ solid: "_solid_1bhk3_32",
264
+ danger: "_danger_1bhk3_35",
265
+ sm: "_sm_1bhk3_40",
266
+ md: "_md_1bhk3_44",
267
+ lg: "_lg_1bhk3_48"
268
+ };
269
+ //#endregion
270
+ //#region src/components/IconButton.tsx
271
+ function ye({ label: e, size: t, variant: n, className: r, type: i, children: a, ...o }) {
272
+ return /* @__PURE__ */ u("button", {
273
+ type: i,
274
+ "aria-label": e,
275
+ title: e,
276
+ className: y(x.button, x[t], n === "solid" && x.solid, n === "danger" && x.danger, r),
277
+ ...o,
278
+ children: a
279
+ });
280
+ }
281
+ var S = {
282
+ wrap: "_wrap_mj8y3_1",
283
+ input: "_input_mj8y3_8",
284
+ sm: "_sm_mj8y3_32",
285
+ md: "_md_mj8y3_37",
286
+ invalid: "_invalid_mj8y3_43",
287
+ hasIcon: "_hasIcon_mj8y3_51",
288
+ icon: "_icon_mj8y3_57"
289
+ }, be = r(function({ inputSize: e, invalid: t, leftIcon: n, className: r, ...i }, a) {
290
+ return /* @__PURE__ */ d("span", {
291
+ className: S.wrap,
292
+ children: [n && /* @__PURE__ */ u("span", {
293
+ className: S.icon,
294
+ children: n
295
+ }), /* @__PURE__ */ u("input", {
296
+ ref: a,
297
+ "aria-invalid": t || void 0,
298
+ className: y(S.input, S[e], n && S.hasIcon, t && S.invalid, r),
299
+ ...i
300
+ })]
301
+ });
302
+ }), xe = {
303
+ textarea: "_textarea_1v6em_1",
304
+ invalid: "_invalid_1v6em_29"
305
+ }, Se = r(function({ invalid: e, className: t, ...n }, r) {
306
+ return /* @__PURE__ */ u("textarea", {
307
+ ref: r,
308
+ "aria-invalid": e || void 0,
309
+ className: y(xe.textarea, e && xe.invalid, t),
310
+ ...n
311
+ });
312
+ }), C = {
313
+ wrap: "_wrap_6tkeb_1",
314
+ select: "_select_6tkeb_8",
315
+ sm: "_sm_6tkeb_32",
316
+ invalid: "_invalid_6tkeb_36",
317
+ chevron: "_chevron_6tkeb_40"
318
+ }, Ce = r(function({ selectSize: e, invalid: t, options: n, placeholder: r, className: i, children: a, ...o }, s) {
319
+ return /* @__PURE__ */ d("span", {
320
+ className: C.wrap,
321
+ children: [/* @__PURE__ */ d("select", {
322
+ ref: s,
323
+ "aria-invalid": t || void 0,
324
+ className: y(C.select, e === "sm" && C.sm, t && C.invalid, i),
325
+ ...o,
326
+ children: [r && /* @__PURE__ */ u("option", {
327
+ value: "",
328
+ disabled: !0,
329
+ children: r
330
+ }), n ? n.map((e) => /* @__PURE__ */ u("option", {
331
+ value: e.value,
332
+ disabled: e.disabled,
333
+ children: e.label
334
+ }, e.value)) : a]
335
+ }), /* @__PURE__ */ u(te, { className: C.chevron })]
336
+ });
337
+ }), w = {
338
+ label: "_label_glwcp_1",
339
+ disabled: "_disabled_glwcp_10",
340
+ native: "_native_glwcp_15",
341
+ box: "_box_glwcp_22"
342
+ }, we = r(function({ children: e, className: t, disabled: n, ...r }, i) {
343
+ return /* @__PURE__ */ d("label", {
344
+ className: y(w.label, n && w.disabled, t),
345
+ children: [
346
+ /* @__PURE__ */ u("input", {
347
+ ref: i,
348
+ type: "checkbox",
349
+ className: w.native,
350
+ disabled: n,
351
+ ...r
352
+ }),
353
+ /* @__PURE__ */ u("span", {
354
+ className: w.box,
355
+ "aria-hidden": "true",
356
+ children: /* @__PURE__ */ u(m, {})
357
+ }),
358
+ e && /* @__PURE__ */ u("span", { children: e })
359
+ ]
360
+ });
361
+ }), T = {
362
+ label: "_label_1qs2n_1",
363
+ disabled: "_disabled_1qs2n_10",
364
+ native: "_native_1qs2n_15",
365
+ track: "_track_1qs2n_22",
366
+ thumb: "_thumb_1qs2n_34"
367
+ }, Te = r(function({ children: e, className: t, disabled: n, ...r }, i) {
368
+ return /* @__PURE__ */ d("label", {
369
+ className: y(T.label, n && T.disabled, t),
370
+ children: [
371
+ /* @__PURE__ */ u("input", {
372
+ ref: i,
373
+ type: "checkbox",
374
+ role: "switch",
375
+ className: T.native,
376
+ disabled: n,
377
+ ...r
378
+ }),
379
+ /* @__PURE__ */ u("span", {
380
+ className: T.track,
381
+ "aria-hidden": "true",
382
+ children: /* @__PURE__ */ u("span", { className: T.thumb })
383
+ }),
384
+ e && /* @__PURE__ */ u("span", { children: e })
385
+ ]
386
+ });
387
+ }), E = {
388
+ group: "_group_vvdcv_1",
389
+ horizontal: "_horizontal_vvdcv_6",
390
+ label: "_label_vvdcv_12",
391
+ disabled: "_disabled_vvdcv_21",
392
+ native: "_native_vvdcv_26",
393
+ dot: "_dot_vvdcv_33"
394
+ };
395
+ //#endregion
396
+ //#region src/components/Radio.tsx
397
+ function Ee({ children: e, className: t, disabled: n, ...r }) {
398
+ return /* @__PURE__ */ d("label", {
399
+ className: y(E.label, n && E.disabled, t),
400
+ children: [
401
+ /* @__PURE__ */ u("input", {
402
+ type: "radio",
403
+ className: E.native,
404
+ disabled: n,
405
+ ...r
406
+ }),
407
+ /* @__PURE__ */ u("span", {
408
+ className: E.dot,
409
+ "aria-hidden": "true"
410
+ }),
411
+ e && /* @__PURE__ */ u("span", { children: e })
412
+ ]
413
+ });
414
+ }
415
+ function De({ name: e, value: t, options: n, onChange: r, horizontal: i, className: a }) {
416
+ return /* @__PURE__ */ u("div", {
417
+ role: "radiogroup",
418
+ className: y(E.group, i && E.horizontal, a),
419
+ children: n.map((n) => /* @__PURE__ */ u(Ee, {
420
+ name: e,
421
+ value: n.value,
422
+ checked: t === n.value,
423
+ disabled: n.disabled,
424
+ onChange: (e) => r?.(e.target.value),
425
+ children: n.label
426
+ }, n.value))
427
+ });
428
+ }
429
+ var D = {
430
+ field: "_field_1toma_1",
431
+ labelRow: "_labelRow_1toma_8",
432
+ label: "_label_1toma_8",
433
+ required: "_required_1toma_20",
434
+ optional: "_optional_1toma_25",
435
+ hint: "_hint_1toma_30",
436
+ error: "_error_1toma_34"
437
+ };
438
+ //#endregion
439
+ //#region src/components/FormField.tsx
440
+ function Oe({ label: e, hint: t, error: n, required: r, optional: i, className: a, children: s }) {
441
+ let c = o(), l = !!n;
442
+ return /* @__PURE__ */ d("div", {
443
+ className: y(D.field, a),
444
+ children: [
445
+ (e || i) && /* @__PURE__ */ d("div", {
446
+ className: D.labelRow,
447
+ children: [e && /* @__PURE__ */ d("label", {
448
+ htmlFor: c,
449
+ className: D.label,
450
+ children: [e, r && /* @__PURE__ */ u("span", {
451
+ className: D.required,
452
+ children: "*"
453
+ })]
454
+ }), i && !r && /* @__PURE__ */ u("span", {
455
+ className: D.optional,
456
+ children: "Optional"
457
+ })]
458
+ }),
459
+ typeof s == "function" ? s({
460
+ id: c,
461
+ invalid: l
462
+ }) : s,
463
+ n ? /* @__PURE__ */ u("span", {
464
+ className: D.error,
465
+ children: n
466
+ }) : t ? /* @__PURE__ */ u("span", {
467
+ className: D.hint,
468
+ children: t
469
+ }) : null
470
+ ]
471
+ });
472
+ }
473
+ var O = {
474
+ drop: "_drop_4v9xi_1",
475
+ input: "_input_4v9xi_27",
476
+ disabled: "_disabled_4v9xi_40",
477
+ invalid: "_invalid_4v9xi_45",
478
+ icon: "_icon_4v9xi_49",
479
+ label: "_label_4v9xi_61"
480
+ }, ke = r(function({ onFileChange: e, fileName: t, placeholder: n, icon: r, invalid: i, disabled: a, className: o, ...s }, c) {
481
+ return /* @__PURE__ */ d("label", {
482
+ className: y(O.drop, i && O.invalid, a && O.disabled, o),
483
+ "data-has-file": t ? "true" : void 0,
484
+ children: [
485
+ /* @__PURE__ */ u("input", {
486
+ ref: c,
487
+ type: "file",
488
+ disabled: a,
489
+ className: O.input,
490
+ onChange: (t) => e?.(t.target.files?.[0] ?? null),
491
+ ...s
492
+ }),
493
+ r && /* @__PURE__ */ u("span", {
494
+ className: O.icon,
495
+ children: r
496
+ }),
497
+ /* @__PURE__ */ u("span", {
498
+ className: O.label,
499
+ children: t ?? n
500
+ })
501
+ ]
502
+ });
503
+ }), k = {
504
+ row: "_row_1vo45_1",
505
+ icon: "_icon_1vo45_7",
506
+ input: "_input_1vo45_20",
507
+ clear: "_clear_1vo45_49",
508
+ shortcut: "_shortcut_1vo45_74"
509
+ }, Ae = r(function({ value: e, onValueChange: t, shortcut: n, placeholder: r, className: i, ...a }, o) {
510
+ let s = e.length > 0;
511
+ return /* @__PURE__ */ d("div", {
512
+ className: y(k.row, i),
513
+ children: [
514
+ /* @__PURE__ */ u("span", {
515
+ className: k.icon,
516
+ children: /* @__PURE__ */ u(oe, {})
517
+ }),
518
+ /* @__PURE__ */ u("input", {
519
+ ref: o,
520
+ type: "search",
521
+ className: k.input,
522
+ value: e,
523
+ placeholder: r,
524
+ onChange: (e) => t(e.target.value),
525
+ ...a
526
+ }),
527
+ s ? /* @__PURE__ */ u("button", {
528
+ type: "button",
529
+ className: k.clear,
530
+ onClick: () => t(""),
531
+ "aria-label": "Clear search",
532
+ children: /* @__PURE__ */ u(h, {})
533
+ }) : n && /* @__PURE__ */ u("span", {
534
+ className: k.shortcut,
535
+ children: n
536
+ })
537
+ ]
538
+ });
539
+ }), A = {
540
+ badge: "_badge_1u5ss_1",
541
+ square: "_square_1u5ss_13",
542
+ mono: "_mono_1u5ss_16",
543
+ neutral: "_neutral_1u5ss_20",
544
+ accent: "_accent_1u5ss_24",
545
+ success: "_success_1u5ss_29",
546
+ warning: "_warning_1u5ss_34",
547
+ danger: "_danger_1u5ss_39",
548
+ dot: "_dot_1u5ss_45"
549
+ };
550
+ //#endregion
551
+ //#region src/components/Badge.tsx
552
+ function je({ tone: e, square: t, mono: n, dot: r, className: i, children: a, ...o }) {
553
+ return /* @__PURE__ */ d("span", {
554
+ className: y(A.badge, A[e], t && A.square, n && A.mono, i),
555
+ ...o,
556
+ children: [r && /* @__PURE__ */ u("span", { className: A.dot }), a]
557
+ });
558
+ }
559
+ var j = {
560
+ tag: "_tag_i8fnf_1",
561
+ noClose: "_noClose_i8fnf_15",
562
+ close: "_close_i8fnf_18"
563
+ };
564
+ //#endregion
565
+ //#region src/components/Tag.tsx
566
+ function Me({ children: e, onRemove: t, className: n }) {
567
+ return /* @__PURE__ */ d("span", {
568
+ className: y(j.tag, !t && j.noClose, n),
569
+ children: [e, t && /* @__PURE__ */ u("button", {
570
+ type: "button",
571
+ className: j.close,
572
+ onClick: t,
573
+ "aria-label": "Remove",
574
+ children: /* @__PURE__ */ u(h, {})
575
+ })]
576
+ });
577
+ }
578
+ var Ne = { kbd: "_kbd_1b6zb_1" };
579
+ //#endregion
580
+ //#region src/components/Kbd.tsx
581
+ function Pe({ children: e, className: t }) {
582
+ return /* @__PURE__ */ u("kbd", {
583
+ className: y(Ne.kbd, t),
584
+ children: e
585
+ });
586
+ }
587
+ var M = {
588
+ avatar: "_avatar_ernyw_1",
589
+ square: "_square_ernyw_15",
590
+ img: "_img_ernyw_18",
591
+ sm: "_sm_ernyw_24",
592
+ md: "_md_ernyw_29",
593
+ lg: "_lg_ernyw_34"
594
+ }, Fe = (e) => {
595
+ if (!e) return "?";
596
+ let t = e.trim().split(/\s+/);
597
+ return ((t[0]?.[0] ?? "") + (t.length > 1 ? t[t.length - 1][0] : "")).slice(0, 2);
598
+ };
599
+ function Ie({ name: e, src: t, size: n, square: r, className: i }) {
600
+ return /* @__PURE__ */ u("span", {
601
+ className: y(M.avatar, M[n], r && M.square, i),
602
+ "aria-label": e,
603
+ title: e,
604
+ children: t ? /* @__PURE__ */ u("img", {
605
+ className: M.img,
606
+ src: t,
607
+ alt: e ?? ""
608
+ }) : Fe(e)
609
+ });
610
+ }
611
+ var N = {
612
+ skeleton: "_skeleton_n45ub_1",
613
+ "bav-skeleton": "_bav-skeleton_n45ub_1",
614
+ text: "_text_n45ub_13",
615
+ circle: "_circle_n45ub_18"
616
+ };
617
+ //#endregion
618
+ //#region src/components/Skeleton.tsx
619
+ function Le({ variant: e, width: t, height: n, lines: r, radius: i, className: a }) {
620
+ let o = {
621
+ width: t,
622
+ height: n ?? (e === "circle" ? t : void 0),
623
+ borderRadius: i
624
+ };
625
+ return e === "text" && r && r > 1 ? /* @__PURE__ */ u("span", { children: Array.from({ length: r }).map((e, t) => /* @__PURE__ */ u("span", {
626
+ className: y(N.skeleton, N.text, a),
627
+ style: { width: t === r - 1 ? "70%" : "100%" }
628
+ }, t)) }) : /* @__PURE__ */ u("span", {
629
+ className: y(N.skeleton, e === "text" && N.text, e === "circle" && N.circle, a),
630
+ style: o
631
+ });
632
+ }
633
+ var P = {
634
+ divider: "_divider_xkemn_1",
635
+ horizontal: "_horizontal_xkemn_5",
636
+ vertical: "_vertical_xkemn_10",
637
+ labelled: "_labelled_xkemn_16"
638
+ };
639
+ //#endregion
640
+ //#region src/components/Divider.tsx
641
+ function Re({ orientation: e, children: t, className: n }) {
642
+ return t ? /* @__PURE__ */ u("div", {
643
+ className: y(P.labelled, n),
644
+ role: "separator",
645
+ children: t
646
+ }) : /* @__PURE__ */ u("hr", {
647
+ className: y(P.divider, P[e], n),
648
+ "aria-orientation": e
649
+ });
650
+ }
651
+ var F = {
652
+ wrap: "_wrap_1fpxy_1",
653
+ head: "_head_1fpxy_7",
654
+ value: "_value_1fpxy_14",
655
+ track: "_track_1fpxy_20",
656
+ sm: "_sm_1fpxy_27",
657
+ lg: "_lg_1fpxy_30",
658
+ bar: "_bar_1fpxy_34",
659
+ indeterminate: "_indeterminate_1fpxy_41",
660
+ "bav-indeterminate": "_bav-indeterminate_1fpxy_1",
661
+ "bav-shimmer": "_bav-shimmer_1fpxy_1"
662
+ };
663
+ //#endregion
664
+ //#region src/components/ProgressBar.tsx
665
+ function ze({ value: e, size: t, label: n, showValue: r, className: i }) {
666
+ let a = e == null, o = a ? 0 : Math.max(0, Math.min(100, e));
667
+ return /* @__PURE__ */ d("div", {
668
+ className: y(F.wrap, i),
669
+ children: [(n || r) && /* @__PURE__ */ d("div", {
670
+ className: F.head,
671
+ children: [n && /* @__PURE__ */ u("span", { children: n }), r && !a && /* @__PURE__ */ d("span", {
672
+ className: F.value,
673
+ children: [Math.round(o), "%"]
674
+ })]
675
+ }), /* @__PURE__ */ u("div", {
676
+ className: y(F.track, t === "sm" && F.sm, t === "lg" && F.lg),
677
+ role: "progressbar",
678
+ "aria-valuenow": a ? void 0 : Math.round(o),
679
+ "aria-valuemin": 0,
680
+ "aria-valuemax": 100,
681
+ children: /* @__PURE__ */ u("div", {
682
+ className: y(F.bar, a && F.indeterminate),
683
+ style: a ? void 0 : { width: `${o}%` }
684
+ })
685
+ })]
686
+ });
687
+ }
688
+ var I = {
689
+ stat: "_stat_12af2_1",
690
+ label: "_label_12af2_6",
691
+ valueRow: "_valueRow_12af2_12",
692
+ value: "_value_12af2_12",
693
+ delta: "_delta_12af2_24",
694
+ up: "_up_12af2_28",
695
+ down: "_down_12af2_31",
696
+ hint: "_hint_12af2_34"
697
+ };
698
+ //#endregion
699
+ //#region src/components/Stat.tsx
700
+ function Be({ label: e, value: t, delta: n, trend: r, hint: i, className: a }) {
701
+ return /* @__PURE__ */ d("div", {
702
+ className: y(I.stat, a),
703
+ children: [
704
+ /* @__PURE__ */ u("span", {
705
+ className: I.label,
706
+ children: e
707
+ }),
708
+ /* @__PURE__ */ d("div", {
709
+ className: I.valueRow,
710
+ children: [/* @__PURE__ */ u("span", {
711
+ className: I.value,
712
+ children: t
713
+ }), n && /* @__PURE__ */ u("span", {
714
+ className: y(I.delta, r === "up" && I.up, r === "down" && I.down),
715
+ children: n
716
+ })]
717
+ }),
718
+ i && /* @__PURE__ */ u("span", {
719
+ className: I.hint,
720
+ children: i
721
+ })
722
+ ]
723
+ });
724
+ }
725
+ var L = {
726
+ card: "_card_8qptx_1",
727
+ interactive: "_interactive_8qptx_10",
728
+ header: "_header_8qptx_23",
729
+ headTitles: "_headTitles_8qptx_30",
730
+ title: "_title_8qptx_36",
731
+ subtitle: "_subtitle_8qptx_42",
732
+ headEnd: "_headEnd_8qptx_46",
733
+ body: "_body_8qptx_50",
734
+ footer: "_footer_8qptx_58"
735
+ };
736
+ //#endregion
737
+ //#region src/components/Card.tsx
738
+ function Ve({ interactive: e, className: t, children: n, ...r }) {
739
+ return /* @__PURE__ */ u("div", {
740
+ className: y(L.card, e && L.interactive, t),
741
+ ...r,
742
+ children: n
743
+ });
744
+ }
745
+ function He({ title: e, subtitle: t, media: n, actions: r, className: i, children: a }) {
746
+ return /* @__PURE__ */ d("div", {
747
+ className: y(L.header, i),
748
+ children: [
749
+ n,
750
+ (e || t) && /* @__PURE__ */ d("div", {
751
+ className: L.headTitles,
752
+ children: [e && /* @__PURE__ */ u("h3", {
753
+ className: L.title,
754
+ children: e
755
+ }), t && /* @__PURE__ */ u("span", {
756
+ className: L.subtitle,
757
+ children: t
758
+ })]
759
+ }),
760
+ a,
761
+ r && /* @__PURE__ */ u("div", {
762
+ className: L.headEnd,
763
+ children: r
764
+ })
765
+ ]
766
+ });
767
+ }
768
+ function Ue({ className: e, children: t, ...n }) {
769
+ return /* @__PURE__ */ u("div", {
770
+ className: y(L.body, e),
771
+ ...n,
772
+ children: t
773
+ });
774
+ }
775
+ function We({ className: e, children: t, ...n }) {
776
+ return /* @__PURE__ */ u("div", {
777
+ className: y(L.footer, e),
778
+ ...n,
779
+ children: t
780
+ });
781
+ }
782
+ var R = {
783
+ panel: "_panel_1ahhx_1",
784
+ header: "_header_1ahhx_11",
785
+ title: "_title_1ahhx_21",
786
+ headerEnd: "_headerEnd_1ahhx_28",
787
+ body: "_body_1ahhx_35",
788
+ noPadding: "_noPadding_1ahhx_39"
789
+ };
790
+ //#endregion
791
+ //#region src/components/Panel.tsx
792
+ function Ge({ headerTitle: e, headerChildren: t, headerActions: n, disableHeader: r, flush: i, className: a, children: o }) {
793
+ let s = !r && (e || t || n);
794
+ return /* @__PURE__ */ d("section", {
795
+ className: y(R.panel, i && R.noPadding, a),
796
+ children: [s && /* @__PURE__ */ d("header", {
797
+ className: R.header,
798
+ children: [
799
+ e && /* @__PURE__ */ u("h2", {
800
+ className: R.title,
801
+ children: e
802
+ }),
803
+ t,
804
+ n && /* @__PURE__ */ u("div", {
805
+ className: R.headerEnd,
806
+ children: n
807
+ })
808
+ ]
809
+ }), /* @__PURE__ */ u("div", {
810
+ className: R.body,
811
+ children: o
812
+ })]
813
+ });
814
+ }
815
+ var z = {
816
+ container: "_container_1lpv0_1",
817
+ table: "_table_1lpv0_6",
818
+ clickable: "_clickable_1lpv0_44",
819
+ compact: "_compact_1lpv0_48",
820
+ numeric: "_numeric_1lpv0_53",
821
+ mono: "_mono_1lpv0_58",
822
+ muted: "_muted_1lpv0_62",
823
+ empty: "_empty_1lpv0_66"
824
+ };
825
+ //#endregion
826
+ //#region src/components/Table.tsx
827
+ function Ke({ compact: e, clickableRows: t, className: n, children: r, ...i }) {
828
+ return /* @__PURE__ */ u("div", {
829
+ className: z.container,
830
+ children: /* @__PURE__ */ u("table", {
831
+ className: y(z.table, e && z.compact, t && z.clickable, n),
832
+ ...i,
833
+ children: r
834
+ })
835
+ });
836
+ }
837
+ function qe({ className: e, ...t }) {
838
+ return /* @__PURE__ */ u("thead", {
839
+ className: e,
840
+ ...t
841
+ });
842
+ }
843
+ function Je({ className: e, ...t }) {
844
+ return /* @__PURE__ */ u("tbody", {
845
+ className: e,
846
+ ...t
847
+ });
848
+ }
849
+ function Ye({ className: e, ...t }) {
850
+ return /* @__PURE__ */ u("tr", {
851
+ className: e,
852
+ ...t
853
+ });
854
+ }
855
+ function Xe({ numeric: e, className: t, ...n }) {
856
+ return /* @__PURE__ */ u("th", {
857
+ className: y(e && z.numeric, t),
858
+ ...n
859
+ });
860
+ }
861
+ function Ze({ numeric: e, mono: t, muted: n, className: r, ...i }) {
862
+ return /* @__PURE__ */ u("td", {
863
+ className: y(e && z.numeric, t && z.mono, n && z.muted, r),
864
+ ...i
865
+ });
866
+ }
867
+ function Qe({ colSpan: e, children: t }) {
868
+ return /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
869
+ colSpan: e,
870
+ className: z.empty,
871
+ children: t
872
+ }) });
873
+ }
874
+ var B = {
875
+ list: "_list_jq2cc_1",
876
+ columns2: "_columns2_jq2cc_8",
877
+ row: "_row_jq2cc_12",
878
+ label: "_label_jq2cc_19",
879
+ value: "_value_jq2cc_27",
880
+ mono: "_mono_jq2cc_34"
881
+ };
882
+ //#endregion
883
+ //#region src/components/DescriptionList.tsx
884
+ function $e({ items: e, wide: t, className: n }) {
885
+ return /* @__PURE__ */ u("dl", {
886
+ className: y(B.list, t && B.columns2, n),
887
+ children: e.map((e, t) => /* @__PURE__ */ d("div", {
888
+ className: B.row,
889
+ children: [/* @__PURE__ */ u("dt", {
890
+ className: B.label,
891
+ children: e.label
892
+ }), /* @__PURE__ */ u("dd", {
893
+ className: y(B.value, e.mono && B.mono),
894
+ children: e.value ?? "—"
895
+ })]
896
+ }, t))
897
+ });
898
+ }
899
+ //#endregion
900
+ //#region src/components/Flex.tsx
901
+ var et = {
902
+ small: 8,
903
+ middle: 16,
904
+ large: 24
905
+ };
906
+ function tt({ vertical: e, align: t, justify: n, gap: r, wrap: i, flex: a, as: o = "div", style: s, children: c, ...l }) {
907
+ let d = typeof r == "string" ? et[r] : r;
908
+ return /* @__PURE__ */ u(o, {
909
+ style: {
910
+ display: "flex",
911
+ flexDirection: e ? "column" : "row",
912
+ alignItems: t,
913
+ justifyContent: n,
914
+ gap: d,
915
+ flexWrap: i ? "wrap" : void 0,
916
+ flex: a,
917
+ minWidth: 0,
918
+ ...s
919
+ },
920
+ ...l,
921
+ children: c
922
+ });
923
+ }
924
+ //#endregion
925
+ //#region src/components/Layout.tsx
926
+ var nt = (e) => e === 0 ? "0" : `var(--space-${e})`;
927
+ function rt({ gap: e, align: t, justify: n, as: r = "div", style: i, children: a, ...o }) {
928
+ return /* @__PURE__ */ u(r, {
929
+ style: {
930
+ display: "flex",
931
+ flexDirection: "column",
932
+ gap: nt(e),
933
+ alignItems: t,
934
+ justifyContent: n,
935
+ ...i
936
+ },
937
+ ...o,
938
+ children: a
939
+ });
940
+ }
941
+ function it({ gap: e, align: t, justify: n, wrap: r, as: i = "div", style: a, children: o, ...s }) {
942
+ return /* @__PURE__ */ u(i, {
943
+ style: {
944
+ display: "flex",
945
+ flexDirection: "row",
946
+ gap: nt(e),
947
+ alignItems: t,
948
+ justifyContent: n,
949
+ flexWrap: r ? "wrap" : void 0,
950
+ ...a
951
+ },
952
+ ...s,
953
+ children: o
954
+ });
955
+ }
956
+ var V = {
957
+ title: "_title_4aj6y_1",
958
+ h1: "_h1_4aj6y_8",
959
+ h2: "_h2_4aj6y_11",
960
+ h3: "_h3_4aj6y_14",
961
+ h4: "_h4_4aj6y_17",
962
+ h5: "_h5_4aj6y_21",
963
+ noMargin: "_noMargin_4aj6y_26",
964
+ text: "_text_4aj6y_30",
965
+ secondary: "_secondary_4aj6y_34",
966
+ success: "_success_4aj6y_37",
967
+ warning: "_warning_4aj6y_40",
968
+ danger: "_danger_4aj6y_43",
969
+ accent: "_accent_4aj6y_46",
970
+ strong: "_strong_4aj6y_50",
971
+ code: "_code_4aj6y_54",
972
+ mono: "_mono_4aj6y_63",
973
+ xs: "_xs_4aj6y_67",
974
+ sm: "_sm_4aj6y_70",
975
+ lg: "_lg_4aj6y_73",
976
+ uppercase: "_uppercase_4aj6y_77",
977
+ paragraph: "_paragraph_4aj6y_82"
978
+ }, H = {
979
+ default: void 0,
980
+ secondary: V.secondary,
981
+ success: V.success,
982
+ warning: V.warning,
983
+ danger: V.danger,
984
+ accent: V.accent
985
+ };
986
+ function at({ level: e, type: t, noMargin: n, className: r, ...i }) {
987
+ return /* @__PURE__ */ u(`h${e}`, {
988
+ className: y(V.title, V[`h${e}`], H[t], n && V.noMargin, r),
989
+ ...i
990
+ });
991
+ }
992
+ function ot({ type: e, size: t, strong: n, code: r, mono: i, uppercase: a, className: o, ...s }) {
993
+ return /* @__PURE__ */ u("span", {
994
+ className: y(V.text, H[e], t !== "md" && V[t], n && V.strong, r && V.code, i && V.mono, a && V.uppercase, o),
995
+ ...s
996
+ });
997
+ }
998
+ function st({ type: e, className: t, ...n }) {
999
+ return /* @__PURE__ */ u("p", {
1000
+ className: y(V.paragraph, H[e], t),
1001
+ ...n
1002
+ });
1003
+ }
1004
+ var ct = {
1005
+ Title: at,
1006
+ Text: ot,
1007
+ Paragraph: st
1008
+ }, U = {
1009
+ nav: "_nav_13bns_1",
1010
+ list: "_list_13bns_9",
1011
+ item: "_item_13bns_18",
1012
+ link: "_link_13bns_24",
1013
+ current: "_current_13bns_36",
1014
+ separator: "_separator_13bns_41"
1015
+ };
1016
+ //#endregion
1017
+ //#region src/components/Breadcrumbs.tsx
1018
+ function lt({ items: e, renderLink: n, className: r }) {
1019
+ let i = n ?? ((e, t) => /* @__PURE__ */ u("a", {
1020
+ className: U.link,
1021
+ href: e,
1022
+ children: t
1023
+ }));
1024
+ return /* @__PURE__ */ u("nav", {
1025
+ "aria-label": "Breadcrumb",
1026
+ className: y(U.nav, r),
1027
+ children: /* @__PURE__ */ u("ol", {
1028
+ className: U.list,
1029
+ children: e.map((n, r) => {
1030
+ let a = r === e.length - 1;
1031
+ return /* @__PURE__ */ d(t, { children: [/* @__PURE__ */ u("li", {
1032
+ className: U.item,
1033
+ children: n.href && !a ? i(n.href, n.title) : /* @__PURE__ */ u("span", {
1034
+ className: a ? U.current : void 0,
1035
+ "aria-current": a ? "page" : void 0,
1036
+ children: n.title
1037
+ })
1038
+ }), !a && /* @__PURE__ */ u("span", {
1039
+ className: U.separator,
1040
+ "aria-hidden": "true",
1041
+ children: /* @__PURE__ */ u(re, {})
1042
+ })] }, r);
1043
+ })
1044
+ })
1045
+ });
1046
+ }
1047
+ var W = {
1048
+ list: "_list_mc9sc_1",
1049
+ fitted: "_fitted_mc9sc_7",
1050
+ tab: "_tab_mc9sc_10",
1051
+ active: "_active_mc9sc_52",
1052
+ count: "_count_mc9sc_62"
1053
+ };
1054
+ //#endregion
1055
+ //#region src/components/Tabs.tsx
1056
+ function ut({ items: e, value: t, onChange: n, fitted: r, className: i }) {
1057
+ return /* @__PURE__ */ u("div", {
1058
+ className: y(W.list, r && W.fitted, i),
1059
+ role: "tablist",
1060
+ children: e.map((e) => {
1061
+ let r = e.value === t;
1062
+ return /* @__PURE__ */ d("button", {
1063
+ type: "button",
1064
+ role: "tab",
1065
+ "aria-selected": r,
1066
+ disabled: e.disabled,
1067
+ className: y(W.tab, r && W.active),
1068
+ onClick: () => n(e.value),
1069
+ children: [
1070
+ e.icon,
1071
+ e.label,
1072
+ typeof e.count == "number" && /* @__PURE__ */ u("span", {
1073
+ className: W.count,
1074
+ children: e.count
1075
+ })
1076
+ ]
1077
+ }, e.value);
1078
+ })
1079
+ });
1080
+ }
1081
+ var G = {
1082
+ bar: "_bar_mwt55_1",
1083
+ count: "_count_mwt55_8",
1084
+ nav: "_nav_mwt55_18",
1085
+ arrow: "_arrow_mwt55_23",
1086
+ pages: "_pages_mwt55_52",
1087
+ page: "_page_mwt55_52",
1088
+ active: "_active_mwt55_78",
1089
+ ellipsis: "_ellipsis_mwt55_89"
1090
+ }, dt = "…";
1091
+ function ft(e, t, n) {
1092
+ if (t <= n) return Array.from({ length: t }, (e, t) => t + 1);
1093
+ let r = Math.max(1, Math.floor((n - 3) / 2)), i = Math.max(2, e - r), a = Math.min(t - 1, e + r), o = [1];
1094
+ i > 2 && o.push(dt);
1095
+ for (let e = i; e <= a; e++) o.push(e);
1096
+ return a < t - 1 && o.push(dt), o.push(t), o;
1097
+ }
1098
+ function pt({ page: e, pageCount: t, onChange: n, totalItems: r, pageSize: i, siblingCount: a, className: o }) {
1099
+ if (t <= 1 && r === void 0) return null;
1100
+ let s = ft(e, t, Math.max(5, a)), c = (r) => r >= 1 && r <= t && r !== e && n(r), l = r !== void 0 && i ? (() => {
1101
+ let t = r === 0 ? 0 : (e - 1) * i + 1, n = Math.min(e * i, r);
1102
+ return /* @__PURE__ */ d("span", {
1103
+ className: G.count,
1104
+ children: [
1105
+ /* @__PURE__ */ u("strong", { children: t }),
1106
+ "–",
1107
+ /* @__PURE__ */ u("strong", { children: n }),
1108
+ " of ",
1109
+ /* @__PURE__ */ u("strong", { children: r })
1110
+ ]
1111
+ });
1112
+ })() : null;
1113
+ return /* @__PURE__ */ d("div", {
1114
+ className: y(G.bar, o),
1115
+ children: [l ?? /* @__PURE__ */ u("span", {}), /* @__PURE__ */ d("div", {
1116
+ className: G.nav,
1117
+ children: [
1118
+ /* @__PURE__ */ u("button", {
1119
+ type: "button",
1120
+ className: G.arrow,
1121
+ onClick: () => c(e - 1),
1122
+ disabled: e <= 1,
1123
+ "aria-label": "Previous page",
1124
+ children: /* @__PURE__ */ u(ne, {})
1125
+ }),
1126
+ /* @__PURE__ */ u("div", {
1127
+ className: G.pages,
1128
+ children: s.map((t, n) => typeof t == "number" ? /* @__PURE__ */ u("button", {
1129
+ type: "button",
1130
+ className: y(G.page, t === e && G.active),
1131
+ "aria-current": t === e ? "page" : void 0,
1132
+ onClick: () => c(t),
1133
+ children: t
1134
+ }, t) : /* @__PURE__ */ u("span", {
1135
+ className: G.ellipsis,
1136
+ children: t
1137
+ }, `e${n}`))
1138
+ }),
1139
+ /* @__PURE__ */ u("button", {
1140
+ type: "button",
1141
+ className: G.arrow,
1142
+ onClick: () => c(e + 1),
1143
+ disabled: e >= t,
1144
+ "aria-label": "Next page",
1145
+ children: /* @__PURE__ */ u(re, {})
1146
+ })
1147
+ ]
1148
+ })]
1149
+ });
1150
+ }
1151
+ var K = {
1152
+ root: "_root_mpq46_1",
1153
+ panel: "_panel_mpq46_5",
1154
+ "bav-pop-in": "_bav-pop-in_mpq46_1",
1155
+ start: "_start_mpq46_17",
1156
+ end: "_end_mpq46_20",
1157
+ item: "_item_mpq46_24",
1158
+ itemIcon: "_itemIcon_mpq46_50",
1159
+ danger: "_danger_mpq46_58",
1160
+ separator: "_separator_mpq46_68",
1161
+ label: "_label_mpq46_73"
1162
+ }, mt = n(null);
1163
+ function ht({ trigger: e, align: t, children: n, className: r }) {
1164
+ let [i, o] = c(!1), l = s(null);
1165
+ return a(() => {
1166
+ if (!i) return;
1167
+ let e = (e) => {
1168
+ l.current?.contains(e.target) || o(!1);
1169
+ }, t = (e) => e.key === "Escape" && o(!1);
1170
+ return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
1171
+ document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
1172
+ };
1173
+ }, [i]), /* @__PURE__ */ d("div", {
1174
+ ref: l,
1175
+ className: y(K.root, r),
1176
+ children: [/* @__PURE__ */ u("span", {
1177
+ onClick: () => o((e) => !e),
1178
+ children: e
1179
+ }), i && /* @__PURE__ */ u("div", {
1180
+ className: y(K.panel, K[t]),
1181
+ role: "menu",
1182
+ children: /* @__PURE__ */ u(mt.Provider, {
1183
+ value: { close: () => o(!1) },
1184
+ children: n
1185
+ })
1186
+ })]
1187
+ });
1188
+ }
1189
+ function gt({ onSelect: e, icon: t, danger: n, disabled: r, children: a }) {
1190
+ let o = i(mt);
1191
+ return /* @__PURE__ */ d("button", {
1192
+ type: "button",
1193
+ role: "menuitem",
1194
+ disabled: r,
1195
+ className: y(K.item, n && K.danger),
1196
+ onClick: () => {
1197
+ e?.(), o?.close();
1198
+ },
1199
+ children: [t && /* @__PURE__ */ u("span", {
1200
+ className: K.itemIcon,
1201
+ children: t
1202
+ }), a]
1203
+ });
1204
+ }
1205
+ function _t() {
1206
+ return /* @__PURE__ */ u("div", {
1207
+ className: K.separator,
1208
+ role: "separator"
1209
+ });
1210
+ }
1211
+ function vt({ children: e }) {
1212
+ return /* @__PURE__ */ u("div", {
1213
+ className: K.label,
1214
+ children: e
1215
+ });
1216
+ }
1217
+ var q = {
1218
+ backdrop: "_backdrop_2jxpm_1",
1219
+ "bav-fade-in": "_bav-fade-in_2jxpm_1",
1220
+ modal: "_modal_2jxpm_14",
1221
+ "bav-pop-in": "_bav-pop-in_2jxpm_1",
1222
+ sm: "_sm_2jxpm_26",
1223
+ md: "_md_2jxpm_29",
1224
+ lg: "_lg_2jxpm_32",
1225
+ header: "_header_2jxpm_36",
1226
+ title: "_title_2jxpm_42",
1227
+ close: "_close_2jxpm_48",
1228
+ body: "_body_2jxpm_73",
1229
+ footer: "_footer_2jxpm_81"
1230
+ };
1231
+ //#endregion
1232
+ //#region src/components/Modal.tsx
1233
+ function yt({ open: e, onClose: t, title: n, size: r, footer: i, dismissible: o, showClose: s, className: c, children: l }) {
1234
+ return a(() => {
1235
+ if (!e) return;
1236
+ let n = (e) => {
1237
+ e.key === "Escape" && o && t();
1238
+ };
1239
+ document.addEventListener("keydown", n);
1240
+ let r = document.body.style.overflow;
1241
+ return document.body.style.overflow = "hidden", () => {
1242
+ document.removeEventListener("keydown", n), document.body.style.overflow = r;
1243
+ };
1244
+ }, [
1245
+ e,
1246
+ o,
1247
+ t
1248
+ ]), !e || typeof document > "u" ? null : ce(/* @__PURE__ */ u("div", {
1249
+ className: q.backdrop,
1250
+ onClick: () => o && t(),
1251
+ role: "presentation",
1252
+ children: /* @__PURE__ */ d("div", {
1253
+ className: y(q.modal, q[r], c),
1254
+ role: "dialog",
1255
+ "aria-modal": "true",
1256
+ onClick: (e) => e.stopPropagation(),
1257
+ children: [
1258
+ (n || s) && /* @__PURE__ */ d("div", {
1259
+ className: q.header,
1260
+ children: [n && /* @__PURE__ */ u("h2", {
1261
+ className: q.title,
1262
+ children: n
1263
+ }), s && /* @__PURE__ */ u("button", {
1264
+ type: "button",
1265
+ className: q.close,
1266
+ onClick: t,
1267
+ "aria-label": "Close",
1268
+ children: /* @__PURE__ */ u(h, {})
1269
+ })]
1270
+ }),
1271
+ /* @__PURE__ */ u("div", {
1272
+ className: q.body,
1273
+ children: l
1274
+ }),
1275
+ i && /* @__PURE__ */ u("div", {
1276
+ className: q.footer,
1277
+ children: i
1278
+ })
1279
+ ]
1280
+ })
1281
+ }), document.body);
1282
+ }
1283
+ var J = {
1284
+ wrap: "_wrap_i3jd9_1",
1285
+ bubble: "_bubble_i3jd9_5",
1286
+ top: "_top_i3jd9_30",
1287
+ bottom: "_bottom_i3jd9_35",
1288
+ left: "_left_i3jd9_40",
1289
+ right: "_right_i3jd9_45"
1290
+ };
1291
+ //#endregion
1292
+ //#region src/components/Tooltip.tsx
1293
+ function bt({ label: e, placement: t, children: n, className: r }) {
1294
+ return /* @__PURE__ */ d("span", {
1295
+ className: y(J.wrap, r),
1296
+ children: [n, /* @__PURE__ */ u("span", {
1297
+ role: "tooltip",
1298
+ className: y(J.bubble, J[t]),
1299
+ children: e
1300
+ })]
1301
+ });
1302
+ }
1303
+ var Y = {
1304
+ alert: "_alert_11x8q_1",
1305
+ icon: "_icon_11x8q_13",
1306
+ content: "_content_11x8q_22",
1307
+ title: "_title_11x8q_26",
1308
+ close: "_close_11x8q_30",
1309
+ info: "_info_11x8q_53",
1310
+ success: "_success_11x8q_60",
1311
+ warning: "_warning_11x8q_67",
1312
+ danger: "_danger_11x8q_74"
1313
+ }, xt = {
1314
+ info: /* @__PURE__ */ u(ae, {}),
1315
+ success: /* @__PURE__ */ u(ee, {}),
1316
+ warning: /* @__PURE__ */ u(p, {}),
1317
+ danger: /* @__PURE__ */ u(f, {})
1318
+ };
1319
+ function St({ tone: e, title: t, children: n, onClose: r, icon: i, className: a }) {
1320
+ let o = i !== null;
1321
+ return /* @__PURE__ */ d("div", {
1322
+ className: y(Y.alert, Y[e], a),
1323
+ role: "alert",
1324
+ children: [
1325
+ o && /* @__PURE__ */ u("span", {
1326
+ className: Y.icon,
1327
+ children: i ?? xt[e]
1328
+ }),
1329
+ /* @__PURE__ */ d("div", {
1330
+ className: Y.content,
1331
+ children: [t && /* @__PURE__ */ u("div", {
1332
+ className: Y.title,
1333
+ children: t
1334
+ }), n]
1335
+ }),
1336
+ r && /* @__PURE__ */ u("button", {
1337
+ type: "button",
1338
+ className: Y.close,
1339
+ onClick: r,
1340
+ "aria-label": "Dismiss",
1341
+ children: /* @__PURE__ */ u(h, {})
1342
+ })
1343
+ ]
1344
+ });
1345
+ }
1346
+ var X = {
1347
+ empty: "_empty_gusco_1",
1348
+ icon: "_icon_gusco_10",
1349
+ title: "_title_gusco_24",
1350
+ description: "_description_gusco_30",
1351
+ actions: "_actions_gusco_37"
1352
+ };
1353
+ //#endregion
1354
+ //#region src/components/EmptyState.tsx
1355
+ function Ct({ icon: e, title: t, description: n, actions: r, className: i }) {
1356
+ return /* @__PURE__ */ d("div", {
1357
+ className: y(X.empty, i),
1358
+ children: [
1359
+ /* @__PURE__ */ u("div", {
1360
+ className: X.icon,
1361
+ children: e ?? /* @__PURE__ */ u(ie, {})
1362
+ }),
1363
+ /* @__PURE__ */ u("h3", {
1364
+ className: X.title,
1365
+ children: t
1366
+ }),
1367
+ n && /* @__PURE__ */ u("p", {
1368
+ className: X.description,
1369
+ children: n
1370
+ }),
1371
+ r && /* @__PURE__ */ u("div", {
1372
+ className: X.actions,
1373
+ children: r
1374
+ })
1375
+ ]
1376
+ });
1377
+ }
1378
+ var Z = {
1379
+ viewport: "_viewport_10jk7_1",
1380
+ toast: "_toast_10jk7_14",
1381
+ visible: "_visible_10jk7_33",
1382
+ leaving: "_leaving_10jk7_38",
1383
+ error: "_error_10jk7_46",
1384
+ iconWrapper: "_iconWrapper_10jk7_49",
1385
+ progressBar: "_progressBar_10jk7_50",
1386
+ success: "_success_10jk7_54",
1387
+ info: "_info_10jk7_62",
1388
+ warning: "_warning_10jk7_70",
1389
+ message: "_message_10jk7_94",
1390
+ closeButton: "_closeButton_10jk7_102",
1391
+ progressTrack: "_progressTrack_10jk7_132",
1392
+ shrink: "_shrink_10jk7_1"
1393
+ }, Q = e((e) => ({
1394
+ toasts: [],
1395
+ push: (t, n) => {
1396
+ let r = Math.random().toString(36).slice(2);
1397
+ return e((e) => ({ toasts: [...e.toasts, {
1398
+ id: r,
1399
+ message: t,
1400
+ type: n?.type ?? "info",
1401
+ duration: n?.duration ?? 6e3
1402
+ }] })), r;
1403
+ },
1404
+ dismiss: (t) => e((e) => ({ toasts: e.toasts.filter((e) => e.id !== t) }))
1405
+ })), wt = {
1406
+ show: (e, t = "info", n) => Q.getState().push(e, {
1407
+ type: t,
1408
+ duration: n
1409
+ }),
1410
+ success: (e, t) => Q.getState().push(e, {
1411
+ type: "success",
1412
+ duration: t
1413
+ }),
1414
+ error: (e, t) => Q.getState().push(e, {
1415
+ type: "error",
1416
+ duration: t
1417
+ }),
1418
+ info: (e, t) => Q.getState().push(e, {
1419
+ type: "info",
1420
+ duration: t
1421
+ }),
1422
+ warning: (e, t) => Q.getState().push(e, {
1423
+ type: "warning",
1424
+ duration: t
1425
+ })
1426
+ }, Tt = {
1427
+ error: f,
1428
+ success: se,
1429
+ info: ae,
1430
+ warning: p
1431
+ };
1432
+ function Et({ toast: e, onClose: t }) {
1433
+ let [n, r] = c(!1), [i, o] = c(!1);
1434
+ a(() => {
1435
+ requestAnimationFrame(() => r(!0));
1436
+ let t = setTimeout(s, e.duration);
1437
+ return () => clearTimeout(t);
1438
+ }, [e.duration]);
1439
+ let s = () => {
1440
+ o(!0), setTimeout(t, 280);
1441
+ }, l = Tt[e.type];
1442
+ return /* @__PURE__ */ d("div", {
1443
+ className: [
1444
+ Z.toast,
1445
+ Z[e.type],
1446
+ n ? Z.visible : "",
1447
+ i ? Z.leaving : ""
1448
+ ].filter(Boolean).join(" "),
1449
+ role: "alert",
1450
+ children: [
1451
+ /* @__PURE__ */ u("div", {
1452
+ className: Z.iconWrapper,
1453
+ children: /* @__PURE__ */ u(l, {})
1454
+ }),
1455
+ /* @__PURE__ */ u("p", {
1456
+ className: Z.message,
1457
+ children: e.message
1458
+ }),
1459
+ /* @__PURE__ */ u("button", {
1460
+ type: "button",
1461
+ className: Z.closeButton,
1462
+ onClick: s,
1463
+ "aria-label": "Dismiss",
1464
+ children: /* @__PURE__ */ u(h, {})
1465
+ }),
1466
+ /* @__PURE__ */ u("div", {
1467
+ className: Z.progressTrack,
1468
+ children: /* @__PURE__ */ u("div", {
1469
+ className: Z.progressBar,
1470
+ style: { animationDuration: `${e.duration}ms` }
1471
+ })
1472
+ })
1473
+ ]
1474
+ });
1475
+ }
1476
+ function Dt() {
1477
+ let e = Q((e) => e.toasts), t = Q((e) => e.dismiss);
1478
+ return /* @__PURE__ */ u("div", {
1479
+ className: Z.viewport,
1480
+ children: e.map((e) => /* @__PURE__ */ u(Et, {
1481
+ toast: e,
1482
+ onClose: () => t(e.id)
1483
+ }, e.id))
1484
+ });
1485
+ }
1486
+ var $ = {
1487
+ backdrop: "_backdrop_u5sma_1",
1488
+ modal: "_modal_u5sma_13",
1489
+ header: "_header_u5sma_22",
1490
+ headerContent: "_headerContent_u5sma_26",
1491
+ icon: "_icon_u5sma_32",
1492
+ danger: "_danger_u5sma_37",
1493
+ title: "_title_u5sma_41",
1494
+ body: "_body_u5sma_48",
1495
+ error: "_error_u5sma_55",
1496
+ actions: "_actions_u5sma_67"
1497
+ }, Ot = e((e) => ({
1498
+ isOpen: !1,
1499
+ options: null,
1500
+ isLoading: !1,
1501
+ confirm: (t) => e({
1502
+ isOpen: !0,
1503
+ options: t,
1504
+ isLoading: !1
1505
+ }),
1506
+ close: () => e({
1507
+ isOpen: !1,
1508
+ options: null,
1509
+ isLoading: !1
1510
+ }),
1511
+ setLoading: (t) => e({ isLoading: t })
1512
+ })), kt = (e) => Ot.getState().confirm(e);
1513
+ //#endregion
1514
+ //#region src/components/ConfirmDialog.tsx
1515
+ function At() {
1516
+ let { isOpen: e, options: t, isLoading: n, close: r, setLoading: i } = Ot(), [o, s] = c(null), l = async () => {
1517
+ if (t) {
1518
+ i(!0), s(null);
1519
+ try {
1520
+ await t.onConfirm(), r();
1521
+ } catch (e) {
1522
+ s(e instanceof Error ? e.message : "An error occurred"), i(!1);
1523
+ }
1524
+ }
1525
+ }, p = () => {
1526
+ n || (t?.onCancel?.(), s(null), r());
1527
+ };
1528
+ if (a(() => {
1529
+ if (!e) return;
1530
+ let t = (e) => {
1531
+ e.key === "Escape" && p(), e.key === "Enter" && !n && !o && l();
1532
+ };
1533
+ return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
1534
+ }, [
1535
+ e,
1536
+ n,
1537
+ o
1538
+ ]), !e || !t) return null;
1539
+ let m = `${$.modal} ${t.danger ? $.danger : ""}`;
1540
+ return /* @__PURE__ */ u("div", {
1541
+ className: $.backdrop,
1542
+ onClick: p,
1543
+ role: "presentation",
1544
+ children: /* @__PURE__ */ d("div", {
1545
+ className: m,
1546
+ onClick: (e) => e.stopPropagation(),
1547
+ role: "alertdialog",
1548
+ "aria-modal": "true",
1549
+ "aria-labelledby": "bav-confirm-title",
1550
+ children: [
1551
+ /* @__PURE__ */ u("div", {
1552
+ className: $.header,
1553
+ children: /* @__PURE__ */ d("div", {
1554
+ className: $.headerContent,
1555
+ children: [/* @__PURE__ */ u(f, {
1556
+ className: $.icon,
1557
+ "aria-hidden": "true"
1558
+ }), /* @__PURE__ */ u("h2", {
1559
+ className: $.title,
1560
+ id: "bav-confirm-title",
1561
+ children: t.title
1562
+ })]
1563
+ })
1564
+ }),
1565
+ /* @__PURE__ */ d("div", {
1566
+ className: $.body,
1567
+ children: [typeof t.message == "string" ? /* @__PURE__ */ u("p", {
1568
+ style: { margin: 0 },
1569
+ children: t.message
1570
+ }) : t.message, o && /* @__PURE__ */ d("div", {
1571
+ className: $.error,
1572
+ role: "alert",
1573
+ children: [/* @__PURE__ */ u(f, {
1574
+ size: 16,
1575
+ "aria-hidden": "true"
1576
+ }), /* @__PURE__ */ u("span", { children: o })]
1577
+ })]
1578
+ }),
1579
+ /* @__PURE__ */ d("div", {
1580
+ className: $.actions,
1581
+ children: [/* @__PURE__ */ u(ve, {
1582
+ variant: "ghost",
1583
+ onClick: p,
1584
+ disabled: n,
1585
+ children: t.cancelText ?? "Cancel"
1586
+ }), /* @__PURE__ */ u(ve, {
1587
+ variant: t.danger ? "danger" : "primary",
1588
+ onClick: l,
1589
+ disabled: n,
1590
+ autoFocus: !0,
1591
+ children: n ? "Please wait…" : t.confirmText ?? "Confirm"
1592
+ })]
1593
+ })
1594
+ ]
1595
+ })
1596
+ });
1597
+ }
1598
+ //#endregion
1599
+ export { St as Alert, Ie as Avatar, je as Badge, lt as Breadcrumbs, ve as Button, Ve as Card, Ue as CardBody, We as CardFooter, He as CardHeader, we as Checkbox, At as ConfirmDialog, $e as DescriptionList, Re as Divider, Ct as EmptyState, ke as FileInput, tt as Flex, Oe as FormField, ye as IconButton, it as Inline, be as Input, Pe as Kbd, ht as Menu, gt as MenuItem, vt as MenuLabel, _t as MenuSeparator, yt as Modal, pt as Pagination, Ge as Panel, st as Paragraph, ze as ProgressBar, Ee as Radio, De as RadioGroup, Ae as SearchInput, Ce as Select, Le as Skeleton, ge as Spinner, rt as Stack, Be as Stat, Te as Switch, Ke as Table, Je as TableBody, Ze as TableCell, Qe as TableEmpty, Xe as TableHead, qe as TableHeader, Ye as TableRow, ut as Tabs, Me as Tag, ot as Text, Se as Textarea, me as ThemeProvider, at as Title, Dt as ToastViewport, bt as Tooltip, ct as Typography, kt as confirm, y as cx, le as darkTheme, ue as lightTheme, g as themes, fe as toCssVars, wt as toast, Ot as useConfirmStore, v as useThemeStore, Q as useToastStore };
1600
+
1601
+ //# sourceMappingURL=bav-ui.mjs.map