northline 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 (84) hide show
  1. package/LICENSE +4 -0
  2. package/README.md +250 -0
  3. package/dist/chartSetup.d.ts +3 -0
  4. package/dist/chartTheme.d.ts +67 -0
  5. package/dist/components/Accordion.d.ts +17 -0
  6. package/dist/components/Alert.d.ts +9 -0
  7. package/dist/components/Avatar.d.ts +10 -0
  8. package/dist/components/AvatarGroup.d.ts +7 -0
  9. package/dist/components/Badge.d.ts +8 -0
  10. package/dist/components/Breadcrumbs.d.ts +8 -0
  11. package/dist/components/BulletChart.d.ts +10 -0
  12. package/dist/components/Button.d.ts +6 -0
  13. package/dist/components/ButtonGroup.d.ts +5 -0
  14. package/dist/components/Card.d.ts +7 -0
  15. package/dist/components/Carousel.d.ts +7 -0
  16. package/dist/components/ChartCard.d.ts +23 -0
  17. package/dist/components/ChartLegend.d.ts +10 -0
  18. package/dist/components/Checkbox.d.ts +8 -0
  19. package/dist/components/CodeBlock.d.ts +6 -0
  20. package/dist/components/ColorPicker.d.ts +7 -0
  21. package/dist/components/Combobox.d.ts +13 -0
  22. package/dist/components/Container.d.ts +7 -0
  23. package/dist/components/CopyButton.d.ts +5 -0
  24. package/dist/components/DatePicker.d.ts +9 -0
  25. package/dist/components/DateRangePicker.d.ts +9 -0
  26. package/dist/components/DescriptionList.d.ts +10 -0
  27. package/dist/components/Divider.d.ts +6 -0
  28. package/dist/components/Drawer.d.ts +11 -0
  29. package/dist/components/EmptyState.d.ts +8 -0
  30. package/dist/components/ErrorBoundary.d.ts +18 -0
  31. package/dist/components/Fieldset.d.ts +9 -0
  32. package/dist/components/FileUpload.d.ts +10 -0
  33. package/dist/components/Gauge.d.ts +10 -0
  34. package/dist/components/Grid.d.ts +8 -0
  35. package/dist/components/Heading.d.ts +7 -0
  36. package/dist/components/Icon.d.ts +8 -0
  37. package/dist/components/IconButton.d.ts +8 -0
  38. package/dist/components/InfoTooltip.d.ts +4 -0
  39. package/dist/components/Input.d.ts +10 -0
  40. package/dist/components/Kbd.d.ts +5 -0
  41. package/dist/components/Link.d.ts +6 -0
  42. package/dist/components/List.d.ts +11 -0
  43. package/dist/components/LoadingOverlay.d.ts +7 -0
  44. package/dist/components/Menu.d.ts +13 -0
  45. package/dist/components/MiniBar.d.ts +6 -0
  46. package/dist/components/Modal.d.ts +10 -0
  47. package/dist/components/Navbar.d.ts +7 -0
  48. package/dist/components/NumberStepper.d.ts +10 -0
  49. package/dist/components/OTPInput.d.ts +8 -0
  50. package/dist/components/Pagination.d.ts +6 -0
  51. package/dist/components/PasswordInput.d.ts +13 -0
  52. package/dist/components/Popover.d.ts +8 -0
  53. package/dist/components/Portal.d.ts +5 -0
  54. package/dist/components/ProgressBar.d.ts +9 -0
  55. package/dist/components/Radio.d.ts +23 -0
  56. package/dist/components/Rating.d.ts +7 -0
  57. package/dist/components/ScoreCard.d.ts +10 -0
  58. package/dist/components/SearchInput.d.ts +7 -0
  59. package/dist/components/SegmentedControl.d.ts +12 -0
  60. package/dist/components/Select.d.ts +22 -0
  61. package/dist/components/Sidebar.d.ts +14 -0
  62. package/dist/components/Skeleton.d.ts +8 -0
  63. package/dist/components/Slider.d.ts +13 -0
  64. package/dist/components/Sparkline.d.ts +6 -0
  65. package/dist/components/Spinner.d.ts +5 -0
  66. package/dist/components/Stack.d.ts +13 -0
  67. package/dist/components/StatusDot.d.ts +8 -0
  68. package/dist/components/Stepper.d.ts +11 -0
  69. package/dist/components/Switch.d.ts +8 -0
  70. package/dist/components/Table.d.ts +15 -0
  71. package/dist/components/Tabs.d.ts +12 -0
  72. package/dist/components/TagInput.d.ts +8 -0
  73. package/dist/components/Text.d.ts +11 -0
  74. package/dist/components/Textarea.d.ts +10 -0
  75. package/dist/components/Timeline.d.ts +13 -0
  76. package/dist/components/Toast.d.ts +14 -0
  77. package/dist/components/Tooltip.d.ts +7 -0
  78. package/dist/components/Tree.d.ts +13 -0
  79. package/dist/hooks/useClickOutside.d.ts +2 -0
  80. package/dist/index.d.ts +78 -0
  81. package/dist/index.js +2769 -0
  82. package/dist/index.js.map +1 -0
  83. package/dist/theme.css +2 -0
  84. package/package.json +46 -0
package/dist/index.js ADDED
@@ -0,0 +1,2769 @@
1
+ import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
2
+ import { Component as r, createContext as i, useCallback as a, useContext as o, useEffect as s, useId as c, useMemo as l, useRef as u, useState as d } from "react";
3
+ import { createPortal as f } from "react-dom";
4
+ import { Chart as p, registerables as m } from "chart.js";
5
+ import h from "chartjs-plugin-datalabels";
6
+ //#region src/components/Sparkline.tsx
7
+ function g({ data: e, color: n = "#8FB4F5", height: r = 36 }) {
8
+ if (!e || e.length < 2) return null;
9
+ let i = Math.min(...e), a = Math.max(...e) - i || 1, o = e.map((t, n) => [n / (e.length - 1) * 200, 4 + (1 - (t - i) / a) * (r - 8)]).map(([e, t], n) => `${n === 0 ? "M" : "L"}${e.toFixed(1)},${t.toFixed(1)}`).join(" ");
10
+ return /* @__PURE__ */ t("svg", {
11
+ className: "score-card__sparkline",
12
+ viewBox: `0 0 200 ${r}`,
13
+ preserveAspectRatio: "none",
14
+ children: /* @__PURE__ */ t("path", {
15
+ d: o,
16
+ fill: "none",
17
+ stroke: n,
18
+ strokeWidth: "1.75",
19
+ strokeLinecap: "round",
20
+ strokeLinejoin: "round"
21
+ })
22
+ });
23
+ }
24
+ //#endregion
25
+ //#region src/components/ScoreCard.tsx
26
+ function _({ label: e, value: r, accent: i, sub: a, direction: o, trend: s }) {
27
+ return /* @__PURE__ */ n("div", {
28
+ className: `score-card score-card--${i}`,
29
+ children: [
30
+ /* @__PURE__ */ t("span", {
31
+ className: "score-card__label",
32
+ children: e
33
+ }),
34
+ /* @__PURE__ */ t("span", {
35
+ className: "score-card__value",
36
+ children: r
37
+ }),
38
+ a && /* @__PURE__ */ t("span", {
39
+ className: `score-card__sub${o ? ` score-card__sub--${o}` : ""}`,
40
+ children: a
41
+ }),
42
+ s && /* @__PURE__ */ t(g, {
43
+ data: s,
44
+ color: "var(--accent)"
45
+ })
46
+ ]
47
+ });
48
+ }
49
+ //#endregion
50
+ //#region src/components/Icon.tsx
51
+ var v = {
52
+ close: /* @__PURE__ */ t("path", { d: "M6 6L18 18M18 6L6 18" }),
53
+ check: /* @__PURE__ */ t("path", { d: "M5 12.5L9.5 17L19 7" }),
54
+ "chevron-left": /* @__PURE__ */ t("path", { d: "M15 6L9 12L15 18" }),
55
+ "chevron-right": /* @__PURE__ */ t("path", { d: "M9 6L15 12L9 18" }),
56
+ kebab: /* @__PURE__ */ n(e, { children: [
57
+ /* @__PURE__ */ t("circle", {
58
+ cx: "12",
59
+ cy: "5",
60
+ r: "1.5",
61
+ fill: "currentColor",
62
+ stroke: "none"
63
+ }),
64
+ /* @__PURE__ */ t("circle", {
65
+ cx: "12",
66
+ cy: "12",
67
+ r: "1.5",
68
+ fill: "currentColor",
69
+ stroke: "none"
70
+ }),
71
+ /* @__PURE__ */ t("circle", {
72
+ cx: "12",
73
+ cy: "19",
74
+ r: "1.5",
75
+ fill: "currentColor",
76
+ stroke: "none"
77
+ })
78
+ ] }),
79
+ "drag-handle": /* @__PURE__ */ n(e, { children: [
80
+ /* @__PURE__ */ t("circle", {
81
+ cx: "9",
82
+ cy: "6",
83
+ r: "1.3",
84
+ fill: "currentColor",
85
+ stroke: "none"
86
+ }),
87
+ /* @__PURE__ */ t("circle", {
88
+ cx: "15",
89
+ cy: "6",
90
+ r: "1.3",
91
+ fill: "currentColor",
92
+ stroke: "none"
93
+ }),
94
+ /* @__PURE__ */ t("circle", {
95
+ cx: "9",
96
+ cy: "12",
97
+ r: "1.3",
98
+ fill: "currentColor",
99
+ stroke: "none"
100
+ }),
101
+ /* @__PURE__ */ t("circle", {
102
+ cx: "15",
103
+ cy: "12",
104
+ r: "1.3",
105
+ fill: "currentColor",
106
+ stroke: "none"
107
+ }),
108
+ /* @__PURE__ */ t("circle", {
109
+ cx: "9",
110
+ cy: "18",
111
+ r: "1.3",
112
+ fill: "currentColor",
113
+ stroke: "none"
114
+ }),
115
+ /* @__PURE__ */ t("circle", {
116
+ cx: "15",
117
+ cy: "18",
118
+ r: "1.3",
119
+ fill: "currentColor",
120
+ stroke: "none"
121
+ })
122
+ ] }),
123
+ copy: /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("rect", {
124
+ x: "8",
125
+ y: "8",
126
+ width: "12",
127
+ height: "12",
128
+ rx: "2"
129
+ }), /* @__PURE__ */ t("path", { d: "M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2" })] }),
130
+ trash: /* @__PURE__ */ n(e, { children: [
131
+ /* @__PURE__ */ t("path", { d: "M5 7h14" }),
132
+ /* @__PURE__ */ t("path", { d: "M10 11v6M14 11v6" }),
133
+ /* @__PURE__ */ t("path", { d: "M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12" }),
134
+ /* @__PURE__ */ t("path", { d: "M9 7V5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2" })
135
+ ] }),
136
+ plus: /* @__PURE__ */ t("path", { d: "M12 5V19M5 12H19" }),
137
+ minus: /* @__PURE__ */ t("path", { d: "M5 12H19" }),
138
+ upload: /* @__PURE__ */ n(e, { children: [
139
+ /* @__PURE__ */ t("path", { d: "M12 4V15" }),
140
+ /* @__PURE__ */ t("path", { d: "M7 9L12 4L17 9" }),
141
+ /* @__PURE__ */ t("path", { d: "M5 16v2a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-2" })
142
+ ] }),
143
+ star: /* @__PURE__ */ t("path", {
144
+ d: "M12 3l2.6 5.8 6.2.6-4.7 4.2 1.4 6.2L12 16.9 6.5 19.8l1.4-6.2L3.2 9.4l6.2-.6L12 3z",
145
+ strokeLinejoin: "round"
146
+ }),
147
+ info: /* @__PURE__ */ n(e, { children: [
148
+ /* @__PURE__ */ t("circle", {
149
+ cx: "12",
150
+ cy: "12",
151
+ r: "9"
152
+ }),
153
+ /* @__PURE__ */ t("path", { d: "M12 11v5" }),
154
+ /* @__PURE__ */ t("circle", {
155
+ cx: "12",
156
+ cy: "8",
157
+ r: "0.5",
158
+ fill: "currentColor"
159
+ })
160
+ ] }),
161
+ warning: /* @__PURE__ */ n(e, { children: [
162
+ /* @__PURE__ */ t("path", {
163
+ d: "M12 3L22 20H2L12 3z",
164
+ strokeLinejoin: "round"
165
+ }),
166
+ /* @__PURE__ */ t("path", { d: "M12 10v4" }),
167
+ /* @__PURE__ */ t("circle", {
168
+ cx: "12",
169
+ cy: "17",
170
+ r: "0.5",
171
+ fill: "currentColor"
172
+ })
173
+ ] }),
174
+ settings: /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("circle", {
175
+ cx: "12",
176
+ cy: "12",
177
+ r: "3"
178
+ }), /* @__PURE__ */ t("path", { d: "M19 12a7 7 0 0 0-.1-1.2l2-1.6-2-3.4-2.4 1a7 7 0 0 0-2-1.2L14 3h-4l-.5 2.6a7 7 0 0 0-2 1.2l-2.4-1-2 3.4 2 1.6A7 7 0 0 0 5 12a7 7 0 0 0 .1 1.2l-2 1.6 2 3.4 2.4-1a7 7 0 0 0 2 1.2L10 21h4l.5-2.6a7 7 0 0 0 2-1.2l2.4 1 2-3.4-2-1.6c.067-.395.1-.796.1-1.2z" })] }),
179
+ inbox: /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("path", { d: "M4 12h4l2 3h4l2-3h4" }), /* @__PURE__ */ t("path", {
180
+ d: "M6 5h12l2 7v6a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-6l2-7z",
181
+ strokeLinejoin: "round"
182
+ })] }),
183
+ search: /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("circle", {
184
+ cx: "10.5",
185
+ cy: "10.5",
186
+ r: "6.5"
187
+ }), /* @__PURE__ */ t("path", { d: "M19.5 19.5L15 15" })] }),
188
+ calendar: /* @__PURE__ */ n(e, { children: [
189
+ /* @__PURE__ */ t("rect", {
190
+ x: "3.5",
191
+ y: "5",
192
+ width: "17",
193
+ height: "16",
194
+ rx: "2"
195
+ }),
196
+ /* @__PURE__ */ t("path", { d: "M3.5 10h17" }),
197
+ /* @__PURE__ */ t("path", { d: "M8 3v4M16 3v4" })
198
+ ] }),
199
+ eye: /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("path", {
200
+ d: "M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7z",
201
+ strokeLinejoin: "round"
202
+ }), /* @__PURE__ */ t("circle", {
203
+ cx: "12",
204
+ cy: "12",
205
+ r: "3"
206
+ })] }),
207
+ "eye-off": /* @__PURE__ */ n(e, { children: [
208
+ /* @__PURE__ */ t("path", { d: "M3 3l18 18" }),
209
+ /* @__PURE__ */ t("path", { d: "M10.6 5.2A10.6 10.6 0 0 1 12 5c6.5 0 10 7 10 7a15.6 15.6 0 0 1-3.4 4.3M6.6 6.6A15.7 15.7 0 0 0 2 12s3.5 7 10 7a10.4 10.4 0 0 0 3.4-.6" }),
210
+ /* @__PURE__ */ t("path", { d: "M9.9 9.9a3 3 0 0 0 4.2 4.2" })
211
+ ] })
212
+ };
213
+ function y({ name: e, size: n = 16, color: r = "currentColor", filled: i = !1 }) {
214
+ return /* @__PURE__ */ t("svg", {
215
+ width: n,
216
+ height: n,
217
+ viewBox: "0 0 24 24",
218
+ fill: i ? r : "none",
219
+ stroke: r,
220
+ strokeWidth: 1.8,
221
+ strokeLinecap: "round",
222
+ "aria-hidden": "true",
223
+ focusable: "false",
224
+ children: v[e]
225
+ });
226
+ }
227
+ //#endregion
228
+ //#region src/components/InfoTooltip.tsx
229
+ function b({ text: e }) {
230
+ return e ? /* @__PURE__ */ n("span", {
231
+ className: "info-tooltip",
232
+ tabIndex: 0,
233
+ role: "note",
234
+ "aria-label": e,
235
+ children: [/* @__PURE__ */ t("span", {
236
+ className: "info-tooltip__icon",
237
+ children: /* @__PURE__ */ t(y, {
238
+ name: "info",
239
+ size: 11
240
+ })
241
+ }), /* @__PURE__ */ t("span", {
242
+ className: "info-tooltip__bubble",
243
+ children: e
244
+ })]
245
+ }) : null;
246
+ }
247
+ //#endregion
248
+ //#region src/components/ChartCard.tsx
249
+ function x({ id: e, title: r, info: i, height: a = 320, width: o, children: c, onDragStart: l, onDragOver: d, onDrop: f, onDragEnd: p, onResize: m, registerRef: h, isDragOver: g, isDragging: _, draggable: v = !0 }) {
250
+ let x = u(null), S = u(m);
251
+ return S.current = m, s(() => {
252
+ let t = x.current;
253
+ if (!t) return;
254
+ let n = new ResizeObserver(([n]) => {
255
+ if (!n) return;
256
+ let r = n.borderBoxSize?.[0], i = r ? r.inlineSize : t.getBoundingClientRect().width, a = r ? r.blockSize : t.getBoundingClientRect().height;
257
+ (i !== 0 || a !== 0) && S.current?.(e, {
258
+ width: Math.round(i),
259
+ height: Math.round(a)
260
+ });
261
+ });
262
+ return n.observe(t), () => n.disconnect();
263
+ }, [e]), /* @__PURE__ */ n("div", {
264
+ ref: (t) => {
265
+ x.current = t, h?.(e, t);
266
+ },
267
+ className: `card chart-card${g ? " chart-card--drag-over" : ""}${_ ? " chart-card--dragging" : ""}`,
268
+ style: {
269
+ height: a,
270
+ width: o,
271
+ flex: "0 0 auto"
272
+ },
273
+ draggable: v,
274
+ onDragStart: v && l ? (t) => l(t, e) : void 0,
275
+ onDragOver: v && d ? (t) => {
276
+ t.preventDefault(), d(e);
277
+ } : void 0,
278
+ onDrop: v && f ? (t) => {
279
+ t.preventDefault(), f(e);
280
+ } : void 0,
281
+ onDragEnd: v && p ? p : void 0,
282
+ children: [/* @__PURE__ */ n("h2", {
283
+ className: "chart-card__title",
284
+ children: [
285
+ v && /* @__PURE__ */ t("span", {
286
+ className: "chart-card__handle",
287
+ title: "Drag to reorder",
288
+ children: /* @__PURE__ */ t(y, {
289
+ name: "drag-handle",
290
+ size: 14
291
+ })
292
+ }),
293
+ r,
294
+ /* @__PURE__ */ t(b, { text: i })
295
+ ]
296
+ }), /* @__PURE__ */ t("div", {
297
+ className: "chart-card__body",
298
+ children: c
299
+ })]
300
+ });
301
+ }
302
+ //#endregion
303
+ //#region src/components/Select.tsx
304
+ function S(e) {
305
+ let { options: r, label: i, multiple: a = !1 } = e, [o, c] = d(!1), l = u(null);
306
+ s(() => {
307
+ if (!o) return;
308
+ let e = (e) => {
309
+ l.current && !l.current.contains(e.target) && c(!1);
310
+ }, t = (e) => {
311
+ e.key === "Escape" && c(!1);
312
+ };
313
+ return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
314
+ document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
315
+ };
316
+ }, [o]);
317
+ let f = r[0]?.value, p = e.multiple ? e.value : [e.value], m = () => {
318
+ if (!e.multiple) return r.find((t) => t.value === e.value)?.label ?? e.value;
319
+ let t = e.value;
320
+ return !t.length || t.includes(f) ? r[0]?.label : t.length === 1 ? r.find((e) => e.value === t[0])?.label ?? t[0] : `${t.length} selected`;
321
+ }, h = (t) => {
322
+ if (!e.multiple) {
323
+ e.onChange(t), c(!1);
324
+ return;
325
+ }
326
+ if (t === f) {
327
+ e.onChange([f]);
328
+ return;
329
+ }
330
+ let n = e.value.filter((e) => e !== f), r = n.includes(t) ? n.filter((e) => e !== t) : [...n, t];
331
+ e.onChange(r.length ? r : [f]);
332
+ };
333
+ return /* @__PURE__ */ n("div", {
334
+ className: "select",
335
+ ref: l,
336
+ children: [/* @__PURE__ */ n("button", {
337
+ type: "button",
338
+ className: "select__trigger",
339
+ "aria-haspopup": "listbox",
340
+ "aria-expanded": o,
341
+ "aria-label": i,
342
+ onClick: () => c((e) => !e),
343
+ children: [/* @__PURE__ */ t("span", { children: m() }), /* @__PURE__ */ t("span", {
344
+ className: "select__chevron",
345
+ "aria-hidden": "true"
346
+ })]
347
+ }), o && /* @__PURE__ */ t("ul", {
348
+ className: "select__menu",
349
+ role: "listbox",
350
+ "aria-multiselectable": a,
351
+ "aria-label": i,
352
+ children: r.map((e) => {
353
+ let r = p.includes(e.value);
354
+ return /* @__PURE__ */ n("li", {
355
+ role: "option",
356
+ "aria-selected": r,
357
+ className: `select__option${r ? " select__option--selected" : ""}${a ? " select__option--multi" : ""}`,
358
+ onClick: () => h(e.value),
359
+ children: [a && /* @__PURE__ */ t("span", {
360
+ className: `select__checkbox${r ? " select__checkbox--checked" : ""}`,
361
+ "aria-hidden": "true"
362
+ }), e.label]
363
+ }, e.value);
364
+ })
365
+ })]
366
+ });
367
+ }
368
+ //#endregion
369
+ //#region src/components/DateRangePicker.tsx
370
+ var C = [
371
+ "Su",
372
+ "Mo",
373
+ "Tu",
374
+ "We",
375
+ "Th",
376
+ "Fr",
377
+ "Sa"
378
+ ], w = [
379
+ "January",
380
+ "February",
381
+ "March",
382
+ "April",
383
+ "May",
384
+ "June",
385
+ "July",
386
+ "August",
387
+ "September",
388
+ "October",
389
+ "November",
390
+ "December"
391
+ ];
392
+ function T(e) {
393
+ if (!e) return null;
394
+ let [t, n, r] = e.split("-").map(Number);
395
+ return t === void 0 || n === void 0 || r === void 0 ? null : new Date(t, n - 1, r);
396
+ }
397
+ function E(e) {
398
+ return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
399
+ }
400
+ function D(e) {
401
+ let t = T(e);
402
+ return t ? `${String(t.getMonth() + 1).padStart(2, "0")}/${String(t.getDate()).padStart(2, "0")}/${t.getFullYear()}` : "";
403
+ }
404
+ function O({ from: e, to: r, min: i, max: a, onChange: o, label: c = "Date range" }) {
405
+ let [l, f] = d(!1), [p, m] = d(null), h = T(e), g = T(r), _ = T(i), v = T(a), [b, x] = d(() => h ?? /* @__PURE__ */ new Date()), S = u(null);
406
+ s(() => {
407
+ l && (x(h ?? /* @__PURE__ */ new Date()), m(null));
408
+ }, [l]), s(() => {
409
+ if (!l) return;
410
+ let e = (e) => {
411
+ S.current && !S.current.contains(e.target) && f(!1);
412
+ }, t = (e) => {
413
+ e.key === "Escape" && f(!1);
414
+ };
415
+ return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
416
+ document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
417
+ };
418
+ }, [l]);
419
+ let O = b.getFullYear(), k = b.getMonth(), A = new Date(O, k, 1).getDay(), j = new Date(O, k + 1, 0).getDate(), M = [];
420
+ for (let e = 0; e < A; e++) M.push(null);
421
+ for (let e = 1; e <= j; e++) M.push(new Date(O, k, e));
422
+ let ee = (e) => !!(_ && e < _ || v && e > v), N = p ?? h, P = p ? null : g, F = (e) => !!(N && e.toDateString() === N.toDateString()), I = (e) => !!(P && e.toDateString() === P.toDateString()), L = (e) => !!(N && P && e > N && e < P), R = (e) => e.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), z = (e) => x(new Date(O, k + e, 1)), B = (e) => {
423
+ if (!p) {
424
+ m(e);
425
+ return;
426
+ }
427
+ let t = p, n = e;
428
+ n < t && ([t, n] = [n, t]), o(E(t), E(n)), m(null), f(!1);
429
+ };
430
+ return /* @__PURE__ */ n("div", {
431
+ className: "datepicker",
432
+ ref: S,
433
+ children: [/* @__PURE__ */ n("button", {
434
+ type: "button",
435
+ className: "select__trigger datepicker__trigger--range",
436
+ "aria-haspopup": "dialog",
437
+ "aria-expanded": l,
438
+ "aria-label": c,
439
+ onClick: () => f((e) => !e),
440
+ children: [/* @__PURE__ */ n("span", { children: [
441
+ D(e),
442
+ " – ",
443
+ D(r)
444
+ ] }), /* @__PURE__ */ t("span", {
445
+ className: "datepicker__icon",
446
+ "aria-hidden": "true"
447
+ })]
448
+ }), l && /* @__PURE__ */ n("div", {
449
+ className: "datepicker__panel",
450
+ role: "dialog",
451
+ "aria-label": c,
452
+ children: [
453
+ /* @__PURE__ */ n("div", {
454
+ className: "datepicker__header",
455
+ children: [
456
+ /* @__PURE__ */ t("button", {
457
+ type: "button",
458
+ className: "datepicker__nav",
459
+ onClick: () => z(-1),
460
+ "aria-label": "Previous month",
461
+ children: /* @__PURE__ */ t(y, {
462
+ name: "chevron-left",
463
+ size: 14
464
+ })
465
+ }),
466
+ /* @__PURE__ */ n("span", {
467
+ className: "datepicker__title",
468
+ children: [
469
+ w[k],
470
+ " ",
471
+ O
472
+ ]
473
+ }),
474
+ /* @__PURE__ */ t("button", {
475
+ type: "button",
476
+ className: "datepicker__nav",
477
+ onClick: () => z(1),
478
+ "aria-label": "Next month",
479
+ children: /* @__PURE__ */ t(y, {
480
+ name: "chevron-right",
481
+ size: 14
482
+ })
483
+ })
484
+ ]
485
+ }),
486
+ /* @__PURE__ */ t("p", {
487
+ className: "datepicker__hint",
488
+ children: p ? "Pick the end date" : "Pick the start date"
489
+ }),
490
+ /* @__PURE__ */ t("div", {
491
+ className: "datepicker__weekdays",
492
+ children: C.map((e) => /* @__PURE__ */ t("span", { children: e }, e))
493
+ }),
494
+ /* @__PURE__ */ t("div", {
495
+ className: "datepicker__grid",
496
+ children: M.map((e, n) => e ? /* @__PURE__ */ t("button", {
497
+ type: "button",
498
+ disabled: ee(e),
499
+ className: [
500
+ "datepicker__day",
501
+ (F(e) || I(e)) && "datepicker__day--selected",
502
+ L(e) && "datepicker__day--in-range",
503
+ R(e) && "datepicker__day--today"
504
+ ].filter(Boolean).join(" "),
505
+ onClick: () => B(e),
506
+ children: e.getDate()
507
+ }, n) : /* @__PURE__ */ t("span", {}, n))
508
+ })
509
+ ]
510
+ })]
511
+ });
512
+ }
513
+ //#endregion
514
+ //#region src/components/Tabs.tsx
515
+ function k({ tabs: e, active: r, onChange: i }) {
516
+ return /* @__PURE__ */ t("div", {
517
+ className: "tabs",
518
+ role: "tablist",
519
+ children: e.map((e) => /* @__PURE__ */ n("button", {
520
+ role: "tab",
521
+ "aria-selected": r === e.id,
522
+ disabled: e.comingSoon,
523
+ className: `tab${r === e.id ? " tab--active" : ""}`,
524
+ onClick: () => !e.comingSoon && i(e.id),
525
+ children: [e.label, e.comingSoon && /* @__PURE__ */ t("span", {
526
+ className: "tab__badge",
527
+ children: "Soon"
528
+ })]
529
+ }, e.id))
530
+ });
531
+ }
532
+ //#endregion
533
+ //#region src/components/Button.tsx
534
+ function A({ children: e, variant: n = "primary", size: r = "md", type: i = "button", disabled: a = !1, onClick: o, ...s }) {
535
+ return /* @__PURE__ */ t("button", {
536
+ type: i,
537
+ disabled: a,
538
+ onClick: o,
539
+ className: `btn btn--${n}${r === "sm" ? " btn--sm" : ""}`,
540
+ ...s,
541
+ children: e
542
+ });
543
+ }
544
+ //#endregion
545
+ //#region src/components/Badge.tsx
546
+ function j({ children: e, tone: r = "neutral", dot: i = !1 }) {
547
+ return /* @__PURE__ */ n("span", {
548
+ className: `badge${r === "neutral" ? "" : ` badge--${r}`}`,
549
+ children: [i && /* @__PURE__ */ t("span", {
550
+ className: "badge__dot",
551
+ "aria-hidden": "true"
552
+ }), e]
553
+ });
554
+ }
555
+ //#endregion
556
+ //#region src/components/Input.tsx
557
+ function M({ label: e, value: r, onChange: i, type: a = "text", placeholder: o, disabled: s = !1, error: l = !1, hint: u, id: d, ...f }) {
558
+ let p = c(), m = d ?? p;
559
+ return /* @__PURE__ */ n("div", {
560
+ className: `field${l ? " field--error" : ""}`,
561
+ children: [
562
+ e && /* @__PURE__ */ t("label", {
563
+ className: "field__label",
564
+ htmlFor: m,
565
+ children: e
566
+ }),
567
+ /* @__PURE__ */ t("input", {
568
+ id: m,
569
+ className: "field__input",
570
+ type: a,
571
+ value: r,
572
+ onChange: (e) => i?.(e.target.value),
573
+ placeholder: o,
574
+ disabled: s,
575
+ "aria-invalid": l || void 0,
576
+ ...f
577
+ }),
578
+ u && /* @__PURE__ */ t("span", {
579
+ className: "field__hint",
580
+ children: u
581
+ })
582
+ ]
583
+ });
584
+ }
585
+ //#endregion
586
+ //#region src/components/Switch.tsx
587
+ function ee({ checked: e, onChange: r, label: i, disabled: a = !1 }) {
588
+ let o = c();
589
+ return /* @__PURE__ */ n("label", {
590
+ htmlFor: o,
591
+ className: `switch${e ? " switch--checked" : ""}${a ? " switch--disabled" : ""}`,
592
+ children: [
593
+ /* @__PURE__ */ t("input", {
594
+ id: o,
595
+ type: "checkbox",
596
+ className: "switch__input",
597
+ checked: e,
598
+ disabled: a,
599
+ onChange: (e) => r?.(e.target.checked)
600
+ }),
601
+ /* @__PURE__ */ t("span", {
602
+ className: "switch__control",
603
+ "aria-hidden": "true"
604
+ }),
605
+ i && /* @__PURE__ */ t("span", {
606
+ className: "switch__label",
607
+ children: i
608
+ })
609
+ ]
610
+ });
611
+ }
612
+ //#endregion
613
+ //#region src/components/Table.tsx
614
+ function N({ columns: e, rows: r, getRowKey: i, onRowClick: a, emptyMessage: o = "No data" }) {
615
+ return /* @__PURE__ */ t("div", {
616
+ className: "nl-table-wrap",
617
+ children: /* @__PURE__ */ n("table", {
618
+ className: `nl-table${a ? " nl-table--hoverable" : ""}`,
619
+ children: [/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { children: e.map((e) => /* @__PURE__ */ t("th", {
620
+ "data-align": e.align,
621
+ children: e.header
622
+ }, e.key)) }) }), /* @__PURE__ */ n("tbody", { children: [r.length === 0 && /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
623
+ className: "nl-table__empty",
624
+ colSpan: e.length,
625
+ children: o
626
+ }) }), r.map((n, r) => /* @__PURE__ */ t("tr", {
627
+ onClick: () => a?.(n),
628
+ children: e.map((e) => /* @__PURE__ */ t("td", {
629
+ "data-align": e.align,
630
+ children: e.render ? e.render(n) : n[e.key]
631
+ }, e.key))
632
+ }, i ? i(n) : r))] })]
633
+ })
634
+ });
635
+ }
636
+ //#endregion
637
+ //#region src/components/Modal.tsx
638
+ function P({ open: e, onClose: r, title: i, children: a, footer: o, size: c = "md" }) {
639
+ return s(() => {
640
+ if (!e) return;
641
+ let t = (e) => {
642
+ e.key === "Escape" && r?.();
643
+ };
644
+ return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
645
+ }, [e, r]), e ? f(/* @__PURE__ */ t("div", {
646
+ className: "modal-backdrop",
647
+ onMouseDown: () => r?.(),
648
+ children: /* @__PURE__ */ n("div", {
649
+ className: `modal modal--${c}`,
650
+ role: "dialog",
651
+ "aria-modal": "true",
652
+ "aria-label": typeof i == "string" ? i : void 0,
653
+ onMouseDown: (e) => e.stopPropagation(),
654
+ children: [
655
+ i && /* @__PURE__ */ n("div", {
656
+ className: "modal__header",
657
+ children: [/* @__PURE__ */ t("h2", {
658
+ className: "modal__title",
659
+ children: i
660
+ }), /* @__PURE__ */ t("button", {
661
+ type: "button",
662
+ className: "modal__close",
663
+ "aria-label": "Close",
664
+ onClick: () => r?.(),
665
+ children: /* @__PURE__ */ t(y, {
666
+ name: "close",
667
+ size: 16
668
+ })
669
+ })]
670
+ }),
671
+ /* @__PURE__ */ t("div", {
672
+ className: "modal__body",
673
+ children: a
674
+ }),
675
+ o && /* @__PURE__ */ t("div", {
676
+ className: "modal__footer",
677
+ children: o
678
+ })
679
+ ]
680
+ })
681
+ }), document.body) : null;
682
+ }
683
+ //#endregion
684
+ //#region src/components/Toast.tsx
685
+ var F = i(null), I = 0;
686
+ function L({ children: e }) {
687
+ let [r, i] = d([]), o = u(/* @__PURE__ */ new Map()), s = a((e) => {
688
+ i((t) => t.filter((t) => t.id !== e));
689
+ let t = o.current.get(e);
690
+ t && clearTimeout(t), o.current.delete(e);
691
+ }, []), c = a((e, { tone: t = "neutral", duration: n = 4e3 } = {}) => {
692
+ let r = I += 1;
693
+ if (i((n) => [...n, {
694
+ id: r,
695
+ message: e,
696
+ tone: t
697
+ }]), n > 0) {
698
+ let e = setTimeout(() => s(r), n);
699
+ o.current.set(r, e);
700
+ }
701
+ return r;
702
+ }, [s]);
703
+ return /* @__PURE__ */ n(F.Provider, {
704
+ value: {
705
+ show: c,
706
+ dismiss: s
707
+ },
708
+ children: [e, f(/* @__PURE__ */ t("div", {
709
+ className: "toast-stack",
710
+ role: "status",
711
+ "aria-live": "polite",
712
+ children: r.map((e) => /* @__PURE__ */ n("div", {
713
+ className: `toast${e.tone === "neutral" ? "" : ` toast--${e.tone}`}`,
714
+ children: [/* @__PURE__ */ t("span", {
715
+ className: "toast__message",
716
+ children: e.message
717
+ }), /* @__PURE__ */ t("button", {
718
+ type: "button",
719
+ className: "toast__close",
720
+ "aria-label": "Dismiss",
721
+ onClick: () => s(e.id),
722
+ children: /* @__PURE__ */ t(y, {
723
+ name: "close",
724
+ size: 14
725
+ })
726
+ })]
727
+ }, e.id))
728
+ }), document.body)]
729
+ });
730
+ }
731
+ function R() {
732
+ let e = o(F);
733
+ if (!e) throw Error("useToast must be used within a ToastProvider");
734
+ return e;
735
+ }
736
+ //#endregion
737
+ //#region src/components/Checkbox.tsx
738
+ function z({ checked: e, onChange: r, label: i, disabled: a = !1 }) {
739
+ let o = c();
740
+ return /* @__PURE__ */ n("label", {
741
+ htmlFor: o,
742
+ className: `checkbox${a ? " checkbox--disabled" : ""}`,
743
+ children: [
744
+ /* @__PURE__ */ t("input", {
745
+ id: o,
746
+ type: "checkbox",
747
+ className: "checkbox__input",
748
+ checked: e,
749
+ disabled: a,
750
+ onChange: (e) => r?.(e.target.checked)
751
+ }),
752
+ /* @__PURE__ */ t("span", {
753
+ className: "checkbox__box",
754
+ "aria-hidden": "true"
755
+ }),
756
+ i && /* @__PURE__ */ t("span", {
757
+ className: "checkbox__label",
758
+ children: i
759
+ })
760
+ ]
761
+ });
762
+ }
763
+ //#endregion
764
+ //#region src/components/Radio.tsx
765
+ function B({ name: e, value: r, checked: i, onChange: a, label: o, disabled: s = !1 }) {
766
+ let l = c();
767
+ return /* @__PURE__ */ n("label", {
768
+ htmlFor: l,
769
+ className: `radio${s ? " radio--disabled" : ""}`,
770
+ children: [
771
+ /* @__PURE__ */ t("input", {
772
+ id: l,
773
+ type: "radio",
774
+ name: e,
775
+ className: "radio__input",
776
+ checked: i,
777
+ disabled: s,
778
+ onChange: () => a?.(r)
779
+ }),
780
+ /* @__PURE__ */ t("span", {
781
+ className: "radio__dot",
782
+ "aria-hidden": "true"
783
+ }),
784
+ o && /* @__PURE__ */ t("span", {
785
+ className: "radio__label",
786
+ children: o
787
+ })
788
+ ]
789
+ });
790
+ }
791
+ function te({ name: e, value: n, onChange: r, options: i, disabled: a = !1 }) {
792
+ return /* @__PURE__ */ t("div", {
793
+ className: "radio-group",
794
+ role: "radiogroup",
795
+ children: i.map((i) => /* @__PURE__ */ t(B, {
796
+ name: e,
797
+ value: i.value,
798
+ checked: n === i.value,
799
+ onChange: r,
800
+ label: i.label,
801
+ disabled: a || i.disabled
802
+ }, i.value))
803
+ });
804
+ }
805
+ //#endregion
806
+ //#region src/components/Textarea.tsx
807
+ function ne({ label: e, value: r, onChange: i, placeholder: a, disabled: o = !1, error: s = !1, hint: l, rows: u = 4, id: d, ...f }) {
808
+ let p = c(), m = d ?? p;
809
+ return /* @__PURE__ */ n("div", {
810
+ className: `field${s ? " field--error" : ""}`,
811
+ children: [
812
+ e && /* @__PURE__ */ t("label", {
813
+ className: "field__label",
814
+ htmlFor: m,
815
+ children: e
816
+ }),
817
+ /* @__PURE__ */ t("textarea", {
818
+ id: m,
819
+ className: "field__input field__input--textarea",
820
+ rows: u,
821
+ value: r,
822
+ onChange: (e) => i?.(e.target.value),
823
+ placeholder: a,
824
+ disabled: o,
825
+ "aria-invalid": s || void 0,
826
+ ...f
827
+ }),
828
+ l && /* @__PURE__ */ t("span", {
829
+ className: "field__hint",
830
+ children: l
831
+ })
832
+ ]
833
+ });
834
+ }
835
+ //#endregion
836
+ //#region src/components/Skeleton.tsx
837
+ function re({ variant: e = "text", width: n, height: r, radius: i }) {
838
+ return /* @__PURE__ */ t("span", {
839
+ className: "skeleton",
840
+ style: {
841
+ width: n ?? (e === "circle" ? 32 : "100%"),
842
+ height: r ?? (e === "circle" ? 32 : e === "rect" ? 120 : 14),
843
+ borderRadius: i ?? (e === "circle" ? "50%" : e === "rect" ? 8 : 4)
844
+ },
845
+ "aria-hidden": "true"
846
+ });
847
+ }
848
+ //#endregion
849
+ //#region src/components/Menu.tsx
850
+ function ie({ items: e, label: r = "Actions", trigger: i }) {
851
+ let [a, o] = d(!1), c = u(null);
852
+ return s(() => {
853
+ if (!a) return;
854
+ let e = (e) => {
855
+ c.current && !c.current.contains(e.target) && o(!1);
856
+ }, t = (e) => {
857
+ e.key === "Escape" && o(!1);
858
+ };
859
+ return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
860
+ document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
861
+ };
862
+ }, [a]), /* @__PURE__ */ n("div", {
863
+ className: "menu",
864
+ ref: c,
865
+ children: [i ? /* @__PURE__ */ t("span", {
866
+ onClick: () => o((e) => !e),
867
+ children: i
868
+ }) : /* @__PURE__ */ t("button", {
869
+ type: "button",
870
+ className: "menu__kebab",
871
+ "aria-haspopup": "menu",
872
+ "aria-expanded": a,
873
+ "aria-label": r,
874
+ onClick: () => o((e) => !e),
875
+ children: /* @__PURE__ */ t(y, {
876
+ name: "kebab",
877
+ size: 16
878
+ })
879
+ }), a && /* @__PURE__ */ t("ul", {
880
+ className: "menu__list",
881
+ role: "menu",
882
+ "aria-label": r,
883
+ children: e.map((e) => /* @__PURE__ */ t("li", {
884
+ role: "none",
885
+ children: /* @__PURE__ */ t("button", {
886
+ type: "button",
887
+ role: "menuitem",
888
+ disabled: e.disabled,
889
+ className: `menu__item${e.danger ? " menu__item--danger" : ""}`,
890
+ onClick: () => {
891
+ o(!1), e.onClick?.();
892
+ },
893
+ children: e.label
894
+ })
895
+ }, e.label))
896
+ })]
897
+ });
898
+ }
899
+ //#endregion
900
+ //#region src/components/Pagination.tsx
901
+ function ae(e, t) {
902
+ return [.../* @__PURE__ */ new Set([
903
+ 1,
904
+ t,
905
+ e,
906
+ e - 1,
907
+ e + 1
908
+ ])].filter((e) => e >= 1 && e <= t).sort((e, t) => e - t).reduce((e, t, n, r) => {
909
+ let i = r[n - 1];
910
+ return n > 0 && i !== void 0 && t - i > 1 && e.push("ellipsis-" + t), e.push(t), e;
911
+ }, []);
912
+ }
913
+ function oe({ page: e, pageCount: r, onChange: i }) {
914
+ if (r <= 1) return null;
915
+ let a = ae(e, r);
916
+ return /* @__PURE__ */ n("nav", {
917
+ className: "pagination",
918
+ "aria-label": "Pagination",
919
+ children: [
920
+ /* @__PURE__ */ t("button", {
921
+ type: "button",
922
+ className: "pagination__nav",
923
+ disabled: e <= 1,
924
+ onClick: () => i(e - 1),
925
+ "aria-label": "Previous page",
926
+ children: /* @__PURE__ */ t(y, {
927
+ name: "chevron-left",
928
+ size: 14
929
+ })
930
+ }),
931
+ a.map((n) => typeof n == "number" ? /* @__PURE__ */ t("button", {
932
+ type: "button",
933
+ className: `pagination__page${n === e ? " pagination__page--active" : ""}`,
934
+ "aria-current": n === e ? "page" : void 0,
935
+ onClick: () => i(n),
936
+ children: n
937
+ }, n) : /* @__PURE__ */ t("span", {
938
+ className: "pagination__ellipsis",
939
+ children: "…"
940
+ }, n)),
941
+ /* @__PURE__ */ t("button", {
942
+ type: "button",
943
+ className: "pagination__nav",
944
+ disabled: e >= r,
945
+ onClick: () => i(e + 1),
946
+ "aria-label": "Next page",
947
+ children: /* @__PURE__ */ t(y, {
948
+ name: "chevron-right",
949
+ size: 14
950
+ })
951
+ })
952
+ ]
953
+ });
954
+ }
955
+ //#endregion
956
+ //#region src/components/Breadcrumbs.tsx
957
+ function se({ items: e }) {
958
+ return /* @__PURE__ */ t("nav", {
959
+ className: "breadcrumbs",
960
+ "aria-label": "Breadcrumb",
961
+ children: e.map((r, i) => {
962
+ let a = i === e.length - 1;
963
+ return /* @__PURE__ */ n("span", {
964
+ className: "breadcrumbs__item",
965
+ children: [a ? /* @__PURE__ */ t("span", {
966
+ className: "breadcrumbs__current",
967
+ "aria-current": "page",
968
+ children: r.label
969
+ }) : /* @__PURE__ */ t("button", {
970
+ type: "button",
971
+ className: "breadcrumbs__link",
972
+ onClick: r.onClick,
973
+ children: r.label
974
+ }), !a && /* @__PURE__ */ t("span", {
975
+ className: "breadcrumbs__sep",
976
+ "aria-hidden": "true",
977
+ children: "/"
978
+ })]
979
+ }, r.label);
980
+ })
981
+ });
982
+ }
983
+ //#endregion
984
+ //#region src/components/ProgressBar.tsx
985
+ function ce({ value: e, max: r = 100, tone: i = "blue", label: a }) {
986
+ let o = Math.max(0, Math.min(100, e / r * 100));
987
+ return /* @__PURE__ */ n("div", {
988
+ className: "progress",
989
+ children: [a && /* @__PURE__ */ n("div", {
990
+ className: "progress__label-row",
991
+ children: [/* @__PURE__ */ t("span", {
992
+ className: "progress__label",
993
+ children: a
994
+ }), /* @__PURE__ */ n("span", {
995
+ className: "progress__value",
996
+ children: [Math.round(o), "%"]
997
+ })]
998
+ }), /* @__PURE__ */ t("div", {
999
+ className: "progress__track",
1000
+ role: "progressbar",
1001
+ "aria-valuenow": e,
1002
+ "aria-valuemin": 0,
1003
+ "aria-valuemax": r,
1004
+ children: /* @__PURE__ */ t("div", {
1005
+ className: `progress__fill progress__fill--${i}`,
1006
+ style: { width: `${o}%` }
1007
+ })
1008
+ })]
1009
+ });
1010
+ }
1011
+ //#endregion
1012
+ //#region src/components/Gauge.tsx
1013
+ function le({ value: e, max: r = 100, tone: i = "blue", size: a = 96, label: o }) {
1014
+ let s = Math.max(0, Math.min(100, e / r * 100)), c = a * .1, l = (a - c) / 2, u = 2 * Math.PI * l, d = u * (1 - s / 100);
1015
+ return /* @__PURE__ */ n("div", {
1016
+ className: "gauge",
1017
+ style: {
1018
+ width: a,
1019
+ height: a
1020
+ },
1021
+ children: [/* @__PURE__ */ n("svg", {
1022
+ viewBox: `0 0 ${a} ${a}`,
1023
+ width: a,
1024
+ height: a,
1025
+ children: [/* @__PURE__ */ t("circle", {
1026
+ cx: a / 2,
1027
+ cy: a / 2,
1028
+ r: l,
1029
+ fill: "none",
1030
+ stroke: "var(--neutral-100)",
1031
+ strokeWidth: c
1032
+ }), /* @__PURE__ */ t("circle", {
1033
+ cx: a / 2,
1034
+ cy: a / 2,
1035
+ r: l,
1036
+ fill: "none",
1037
+ stroke: `var(--chart-${i})`,
1038
+ strokeWidth: c,
1039
+ strokeLinecap: "round",
1040
+ strokeDasharray: u,
1041
+ strokeDashoffset: d,
1042
+ transform: `rotate(-90 ${a / 2} ${a / 2})`
1043
+ })]
1044
+ }), /* @__PURE__ */ n("div", {
1045
+ className: "gauge__center",
1046
+ children: [/* @__PURE__ */ n("span", {
1047
+ className: "gauge__value",
1048
+ children: [Math.round(s), "%"]
1049
+ }), o && /* @__PURE__ */ t("span", {
1050
+ className: "gauge__label",
1051
+ children: o
1052
+ })]
1053
+ })]
1054
+ });
1055
+ }
1056
+ //#endregion
1057
+ //#region src/components/Avatar.tsx
1058
+ var V = [
1059
+ "blue",
1060
+ "teal",
1061
+ "purple",
1062
+ "orange",
1063
+ "red",
1064
+ "green"
1065
+ ];
1066
+ function ue(e) {
1067
+ return V[[...e].reduce((e, t) => e + t.charCodeAt(0), 0) % V.length];
1068
+ }
1069
+ function de(e) {
1070
+ let t = e.trim().split(/\s+/), n = t[0] ?? "";
1071
+ if (t.length === 1) return n.slice(0, 2).toUpperCase();
1072
+ let r = t[t.length - 1] ?? "";
1073
+ return (n[0] ?? "").concat(r[0] ?? "").toUpperCase();
1074
+ }
1075
+ function H({ name: e, src: n, size: r = 32, tone: i }) {
1076
+ let a = i ?? ue(e ?? ""), o = {
1077
+ width: r,
1078
+ height: r,
1079
+ fontSize: Math.round(r * .4)
1080
+ };
1081
+ return n ? /* @__PURE__ */ t("img", {
1082
+ className: "avatar",
1083
+ style: o,
1084
+ src: n,
1085
+ alt: e ?? ""
1086
+ }) : /* @__PURE__ */ t("span", {
1087
+ className: `avatar avatar--${a}`,
1088
+ style: o,
1089
+ title: e,
1090
+ children: e ? de(e) : "?"
1091
+ });
1092
+ }
1093
+ //#endregion
1094
+ //#region src/components/Card.tsx
1095
+ function fe({ title: e, children: r, className: i }) {
1096
+ return /* @__PURE__ */ n("div", {
1097
+ className: `card${i ? ` ${i}` : ""}`,
1098
+ children: [e && /* @__PURE__ */ t("h2", { children: e }), r]
1099
+ });
1100
+ }
1101
+ //#endregion
1102
+ //#region src/components/EmptyState.tsx
1103
+ function pe({ icon: e, title: r, description: i, action: a }) {
1104
+ return /* @__PURE__ */ n("div", {
1105
+ className: "empty-state",
1106
+ children: [
1107
+ e && /* @__PURE__ */ t("div", {
1108
+ className: "empty-state__icon",
1109
+ children: e
1110
+ }),
1111
+ /* @__PURE__ */ t("h2", { children: r }),
1112
+ i && /* @__PURE__ */ t("p", { children: i }),
1113
+ a
1114
+ ]
1115
+ });
1116
+ }
1117
+ //#endregion
1118
+ //#region src/components/Spinner.tsx
1119
+ function U({ size: e = 32, label: n = "Loading" }) {
1120
+ return /* @__PURE__ */ t("span", {
1121
+ className: "spinner",
1122
+ role: "status",
1123
+ "aria-label": n,
1124
+ style: {
1125
+ width: e,
1126
+ height: e
1127
+ }
1128
+ });
1129
+ }
1130
+ //#endregion
1131
+ //#region src/components/Accordion.tsx
1132
+ function me({ items: e, openIds: r, onChange: i, allowMultiple: a = !1, defaultOpenIds: o = [] }) {
1133
+ let [s, c] = d(o), l = r ?? s, u = (e) => {
1134
+ let t = l.includes(e) ? l.filter((t) => t !== e) : a ? [...l, e] : [e];
1135
+ i ? i(t) : c(t);
1136
+ };
1137
+ return /* @__PURE__ */ t("div", {
1138
+ className: "accordion",
1139
+ children: e.map((e) => {
1140
+ let r = l.includes(e.id);
1141
+ return /* @__PURE__ */ n("div", {
1142
+ className: `accordion__item${r ? " accordion__item--open" : ""}`,
1143
+ children: [/* @__PURE__ */ n("button", {
1144
+ type: "button",
1145
+ className: "accordion__header",
1146
+ "aria-expanded": r,
1147
+ disabled: e.disabled,
1148
+ onClick: () => u(e.id),
1149
+ children: [/* @__PURE__ */ t("span", {
1150
+ className: "accordion__chevron",
1151
+ "aria-hidden": "true"
1152
+ }), e.title]
1153
+ }), r && /* @__PURE__ */ t("div", {
1154
+ className: "accordion__panel",
1155
+ children: e.content
1156
+ })]
1157
+ }, e.id);
1158
+ })
1159
+ });
1160
+ }
1161
+ //#endregion
1162
+ //#region src/components/SegmentedControl.tsx
1163
+ function he({ options: e, value: n, onChange: r, label: i = "Options" }) {
1164
+ return /* @__PURE__ */ t("div", {
1165
+ className: "segmented",
1166
+ role: "radiogroup",
1167
+ "aria-label": i,
1168
+ children: e.map((e) => /* @__PURE__ */ t("button", {
1169
+ type: "button",
1170
+ role: "radio",
1171
+ "aria-checked": e.value === n,
1172
+ disabled: e.disabled,
1173
+ className: `segmented__option${e.value === n ? " segmented__option--active" : ""}`,
1174
+ onClick: () => r(e.value),
1175
+ children: e.label
1176
+ }, e.value))
1177
+ });
1178
+ }
1179
+ //#endregion
1180
+ //#region src/components/ChartLegend.tsx
1181
+ function ge({ items: e, hidden: r = [], onToggle: i }) {
1182
+ return /* @__PURE__ */ t("ul", {
1183
+ className: "chart-legend",
1184
+ role: "list",
1185
+ children: e.map((e) => {
1186
+ let a = r.includes(e.label);
1187
+ return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ n("button", {
1188
+ type: "button",
1189
+ className: `chart-legend__item${a ? " chart-legend__item--hidden" : ""}${i ? "" : " chart-legend__item--static"}`,
1190
+ onClick: i ? () => i(e.label) : void 0,
1191
+ disabled: !i,
1192
+ children: [/* @__PURE__ */ t("span", {
1193
+ className: "chart-legend__swatch",
1194
+ style: { background: e.color },
1195
+ "aria-hidden": "true"
1196
+ }), e.label]
1197
+ }) }, e.label);
1198
+ })
1199
+ });
1200
+ }
1201
+ //#endregion
1202
+ //#region src/components/MiniBar.tsx
1203
+ function _e({ data: e, color: n = "#8FB4F5", height: r = 36 }) {
1204
+ if (!e || e.length === 0) return null;
1205
+ let i = Math.max(...e, 0) || 1, a = 200 / e.length - 2;
1206
+ return /* @__PURE__ */ t("svg", {
1207
+ className: "score-card__sparkline",
1208
+ viewBox: `0 0 200 ${r}`,
1209
+ preserveAspectRatio: "none",
1210
+ children: e.map((e, o) => {
1211
+ let s = Math.max(e / i * r, 1), c = o * (a + 2), l = r - s;
1212
+ return /* @__PURE__ */ t("rect", {
1213
+ x: c,
1214
+ y: l,
1215
+ width: a,
1216
+ height: s,
1217
+ fill: n,
1218
+ rx: 1
1219
+ }, o);
1220
+ })
1221
+ });
1222
+ }
1223
+ //#endregion
1224
+ //#region src/components/BulletChart.tsx
1225
+ function ve({ value: e, target: r, max: i, tone: a = "blue", label: o }) {
1226
+ let s = i ?? (Math.max(e, r) * 1.2 || 1), c = Math.max(0, Math.min(100, e / s * 100)), l = Math.max(0, Math.min(100, r / s * 100));
1227
+ return /* @__PURE__ */ n("div", {
1228
+ className: "bullet",
1229
+ children: [o && /* @__PURE__ */ n("div", {
1230
+ className: "bullet__label-row",
1231
+ children: [/* @__PURE__ */ t("span", {
1232
+ className: "progress__label",
1233
+ children: o
1234
+ }), /* @__PURE__ */ n("span", {
1235
+ className: "progress__value",
1236
+ children: [
1237
+ e,
1238
+ " / ",
1239
+ r
1240
+ ]
1241
+ })]
1242
+ }), /* @__PURE__ */ n("div", {
1243
+ className: "bullet__track",
1244
+ children: [/* @__PURE__ */ t("div", {
1245
+ className: `bullet__fill bullet__fill--${a}`,
1246
+ style: { width: `${c}%` }
1247
+ }), /* @__PURE__ */ t("div", {
1248
+ className: "bullet__target",
1249
+ style: { left: `${l}%` }
1250
+ })]
1251
+ })]
1252
+ });
1253
+ }
1254
+ //#endregion
1255
+ //#region src/components/Slider.tsx
1256
+ function ye({ value: e, onChange: r, min: i = 0, max: a = 100, step: o = 1, label: s, disabled: l = !1, formatValue: u }) {
1257
+ let d = c(), f = (e - i) / (a - i || 1) * 100;
1258
+ return /* @__PURE__ */ n("div", {
1259
+ className: "field",
1260
+ children: [s && /* @__PURE__ */ n("div", {
1261
+ className: "progress__label-row",
1262
+ children: [/* @__PURE__ */ t("label", {
1263
+ className: "field__label",
1264
+ htmlFor: d,
1265
+ children: s
1266
+ }), /* @__PURE__ */ t("span", {
1267
+ className: "progress__value",
1268
+ children: u ? u(e) : e
1269
+ })]
1270
+ }), /* @__PURE__ */ t("input", {
1271
+ id: d,
1272
+ type: "range",
1273
+ className: "slider",
1274
+ style: { "--slider-fill": `${f}%` },
1275
+ value: e,
1276
+ min: i,
1277
+ max: a,
1278
+ step: o,
1279
+ disabled: l,
1280
+ onChange: (e) => r(Number(e.target.value))
1281
+ })]
1282
+ });
1283
+ }
1284
+ //#endregion
1285
+ //#region src/components/Stepper.tsx
1286
+ function be({ steps: e, activeId: r, completedIds: i = [] }) {
1287
+ let a = e.findIndex((e) => e.id === r);
1288
+ return /* @__PURE__ */ t("div", {
1289
+ className: "stepper",
1290
+ role: "list",
1291
+ children: e.map((o, s) => {
1292
+ let c = i.includes(o.id) || s < a, l = o.id === r;
1293
+ return /* @__PURE__ */ n("div", {
1294
+ role: "listitem",
1295
+ className: `stepper__step${l ? " stepper__step--active" : ""}${c ? " stepper__step--completed" : ""}`,
1296
+ children: [
1297
+ /* @__PURE__ */ t("span", {
1298
+ className: "stepper__dot",
1299
+ "aria-hidden": "true",
1300
+ children: c ? /* @__PURE__ */ t(y, {
1301
+ name: "check",
1302
+ size: 13
1303
+ }) : s + 1
1304
+ }),
1305
+ /* @__PURE__ */ t("span", {
1306
+ className: "stepper__label",
1307
+ children: o.label
1308
+ }),
1309
+ s < e.length - 1 && /* @__PURE__ */ t("span", {
1310
+ className: "stepper__connector",
1311
+ "aria-hidden": "true"
1312
+ })
1313
+ ]
1314
+ }, o.id);
1315
+ })
1316
+ });
1317
+ }
1318
+ //#endregion
1319
+ //#region src/components/Drawer.tsx
1320
+ function xe({ open: e, onClose: r, title: i, children: a, footer: o, side: c = "right", width: l = 380 }) {
1321
+ return s(() => {
1322
+ if (!e) return;
1323
+ let t = (e) => {
1324
+ e.key === "Escape" && r?.();
1325
+ };
1326
+ return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
1327
+ }, [e, r]), e ? f(/* @__PURE__ */ t("div", {
1328
+ className: "drawer-backdrop",
1329
+ onMouseDown: () => r?.(),
1330
+ children: /* @__PURE__ */ n("div", {
1331
+ className: `drawer drawer--${c}`,
1332
+ style: { width: l },
1333
+ role: "dialog",
1334
+ "aria-modal": "true",
1335
+ "aria-label": typeof i == "string" ? i : void 0,
1336
+ onMouseDown: (e) => e.stopPropagation(),
1337
+ children: [
1338
+ i && /* @__PURE__ */ n("div", {
1339
+ className: "modal__header",
1340
+ children: [/* @__PURE__ */ t("h2", {
1341
+ className: "modal__title",
1342
+ children: i
1343
+ }), /* @__PURE__ */ t("button", {
1344
+ type: "button",
1345
+ className: "modal__close",
1346
+ "aria-label": "Close",
1347
+ onClick: () => r?.(),
1348
+ children: /* @__PURE__ */ t(y, {
1349
+ name: "close",
1350
+ size: 16
1351
+ })
1352
+ })]
1353
+ }),
1354
+ /* @__PURE__ */ t("div", {
1355
+ className: "drawer__body",
1356
+ children: a
1357
+ }),
1358
+ o && /* @__PURE__ */ t("div", {
1359
+ className: "modal__footer",
1360
+ children: o
1361
+ })
1362
+ ]
1363
+ })
1364
+ }), document.body) : null;
1365
+ }
1366
+ //#endregion
1367
+ //#region src/components/Popover.tsx
1368
+ function Se({ trigger: e, children: r, label: i = "More", align: a = "left" }) {
1369
+ let [o, c] = d(!1), l = u(null);
1370
+ return s(() => {
1371
+ if (!o) return;
1372
+ let e = (e) => {
1373
+ l.current && !l.current.contains(e.target) && c(!1);
1374
+ }, t = (e) => {
1375
+ e.key === "Escape" && c(!1);
1376
+ };
1377
+ return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
1378
+ document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
1379
+ };
1380
+ }, [o]), /* @__PURE__ */ n("div", {
1381
+ className: "popover",
1382
+ ref: l,
1383
+ children: [/* @__PURE__ */ t("span", {
1384
+ onClick: () => c((e) => !e),
1385
+ children: e
1386
+ }), o && /* @__PURE__ */ t("div", {
1387
+ className: `popover__panel popover__panel--${a}`,
1388
+ role: "dialog",
1389
+ "aria-label": i,
1390
+ children: r
1391
+ })]
1392
+ });
1393
+ }
1394
+ //#endregion
1395
+ //#region src/components/TagInput.tsx
1396
+ function Ce({ value: e, onChange: r, label: i, placeholder: a = "Add a tag...", disabled: o = !1 }) {
1397
+ let [s, l] = d(""), u = c(), f = () => {
1398
+ let t = s.trim();
1399
+ t && !e.includes(t) && r([...e, t]), l("");
1400
+ }, p = (t) => {
1401
+ t.key === "Enter" || t.key === "," ? (t.preventDefault(), f()) : t.key === "Backspace" && !s && e.length && r(e.slice(0, -1));
1402
+ }, m = (t) => r(e.filter((e, n) => n !== t));
1403
+ return /* @__PURE__ */ n("div", {
1404
+ className: "field",
1405
+ children: [i && /* @__PURE__ */ t("label", {
1406
+ className: "field__label",
1407
+ htmlFor: u,
1408
+ children: i
1409
+ }), /* @__PURE__ */ n("div", {
1410
+ className: `tag-input${o ? " tag-input--disabled" : ""}`,
1411
+ children: [e.map((e, r) => /* @__PURE__ */ n("span", {
1412
+ className: "tag-input__tag",
1413
+ children: [e, !o && /* @__PURE__ */ t("button", {
1414
+ type: "button",
1415
+ "aria-label": `Remove ${e}`,
1416
+ onClick: () => m(r),
1417
+ children: "×"
1418
+ })]
1419
+ }, e)), /* @__PURE__ */ t("input", {
1420
+ id: u,
1421
+ className: "tag-input__field",
1422
+ value: s,
1423
+ onChange: (e) => l(e.target.value),
1424
+ onKeyDown: p,
1425
+ onBlur: f,
1426
+ placeholder: e.length ? "" : a,
1427
+ disabled: o
1428
+ })]
1429
+ })]
1430
+ });
1431
+ }
1432
+ //#endregion
1433
+ //#region src/components/SearchInput.tsx
1434
+ function we({ value: e, onChange: r, placeholder: i = "Search...", disabled: a = !1 }) {
1435
+ return /* @__PURE__ */ n("div", {
1436
+ className: "search-input",
1437
+ children: [
1438
+ /* @__PURE__ */ t("span", {
1439
+ className: "search-input__icon",
1440
+ "aria-hidden": "true"
1441
+ }),
1442
+ /* @__PURE__ */ t("input", {
1443
+ className: "search-input__field",
1444
+ type: "search",
1445
+ value: e,
1446
+ onChange: (e) => r(e.target.value),
1447
+ placeholder: i,
1448
+ disabled: a
1449
+ }),
1450
+ e && /* @__PURE__ */ t("button", {
1451
+ type: "button",
1452
+ className: "search-input__clear",
1453
+ "aria-label": "Clear search",
1454
+ onClick: () => r(""),
1455
+ children: "×"
1456
+ })
1457
+ ]
1458
+ });
1459
+ }
1460
+ //#endregion
1461
+ //#region src/components/CopyButton.tsx
1462
+ function W({ text: e, label: n = "Copy" }) {
1463
+ let [r, i] = d(!1);
1464
+ return /* @__PURE__ */ t("button", {
1465
+ type: "button",
1466
+ className: "copy-button",
1467
+ "aria-label": r ? "Copied" : n,
1468
+ onClick: async () => {
1469
+ try {
1470
+ await navigator.clipboard.writeText(e);
1471
+ } catch {}
1472
+ i(!0), setTimeout(() => i(!1), 1500);
1473
+ },
1474
+ children: /* @__PURE__ */ t(y, {
1475
+ name: r ? "check" : "copy",
1476
+ size: 14
1477
+ })
1478
+ });
1479
+ }
1480
+ //#endregion
1481
+ //#region src/components/StatusDot.tsx
1482
+ function Te({ tone: e = "green", label: r, pulse: i = !1 }) {
1483
+ return /* @__PURE__ */ n("span", {
1484
+ className: "status-dot",
1485
+ children: [/* @__PURE__ */ t("span", {
1486
+ className: `status-dot__dot status-dot__dot--${e}${i ? " status-dot__dot--pulse" : ""}`,
1487
+ "aria-hidden": "true"
1488
+ }), r && /* @__PURE__ */ t("span", {
1489
+ className: "status-dot__label",
1490
+ children: r
1491
+ })]
1492
+ });
1493
+ }
1494
+ //#endregion
1495
+ //#region src/components/DescriptionList.tsx
1496
+ function Ee({ items: e, columns: r = 1 }) {
1497
+ return /* @__PURE__ */ t("dl", {
1498
+ className: "description-list",
1499
+ style: { gridTemplateColumns: `repeat(${r}, 1fr)` },
1500
+ children: e.map((e, r) => /* @__PURE__ */ n("div", {
1501
+ className: "description-list__item",
1502
+ children: [/* @__PURE__ */ t("dt", { children: e.label }), /* @__PURE__ */ t("dd", { children: e.value })]
1503
+ }, r))
1504
+ });
1505
+ }
1506
+ //#endregion
1507
+ //#region src/components/Text.tsx
1508
+ function De({ as: e = "p", size: n = "md", weight: r = "regular", color: i = "default", mono: a = !1, children: o, className: s }) {
1509
+ return /* @__PURE__ */ t(e, {
1510
+ className: `nl-text nl-text--${n} nl-text--${r} nl-text--${i}${a ? " nl-text--mono" : ""}${s ? ` ${s}` : ""}`,
1511
+ children: o
1512
+ });
1513
+ }
1514
+ //#endregion
1515
+ //#region src/components/Heading.tsx
1516
+ function Oe({ level: e = 2, children: n, className: r }) {
1517
+ let i = `h${e}`;
1518
+ return /* @__PURE__ */ t(i, {
1519
+ className: `nl-heading nl-heading--${e}${r ? ` ${r}` : ""}`,
1520
+ children: n
1521
+ });
1522
+ }
1523
+ //#endregion
1524
+ //#region src/components/Container.tsx
1525
+ function ke({ size: e = "lg", children: n, className: r }) {
1526
+ return /* @__PURE__ */ t("div", {
1527
+ className: `nl-container nl-container--${e}${r ? ` ${r}` : ""}`,
1528
+ children: n
1529
+ });
1530
+ }
1531
+ //#endregion
1532
+ //#region src/components/Stack.tsx
1533
+ function G({ direction: e = "column", gap: n = 12, align: r, justify: i, wrap: a = !1, children: o, className: s }) {
1534
+ return /* @__PURE__ */ t("div", {
1535
+ className: `nl-stack${s ? ` ${s}` : ""}`,
1536
+ style: {
1537
+ display: "flex",
1538
+ flexDirection: e,
1539
+ gap: n,
1540
+ alignItems: r,
1541
+ justifyContent: i,
1542
+ flexWrap: a ? "wrap" : "nowrap"
1543
+ },
1544
+ children: o
1545
+ });
1546
+ }
1547
+ function Ae(e) {
1548
+ return /* @__PURE__ */ t(G, {
1549
+ ...e,
1550
+ direction: "column"
1551
+ });
1552
+ }
1553
+ function je(e) {
1554
+ return /* @__PURE__ */ t(G, {
1555
+ ...e,
1556
+ direction: "row"
1557
+ });
1558
+ }
1559
+ //#endregion
1560
+ //#region src/components/Grid.tsx
1561
+ function Me({ columns: e = 12, gap: n = 16, children: r, className: i }) {
1562
+ let a = Math.max(120, Math.floor(1200 / e));
1563
+ return /* @__PURE__ */ t("div", {
1564
+ className: `nl-grid${i ? ` ${i}` : ""}`,
1565
+ style: {
1566
+ display: "grid",
1567
+ gridTemplateColumns: `repeat(auto-fit, minmax(${a}px, 1fr))`,
1568
+ gap: n
1569
+ },
1570
+ children: r
1571
+ });
1572
+ }
1573
+ //#endregion
1574
+ //#region src/components/Divider.tsx
1575
+ function Ne({ orientation: e = "horizontal", label: r }) {
1576
+ return e === "vertical" ? /* @__PURE__ */ t("span", {
1577
+ className: "nl-divider nl-divider--vertical",
1578
+ role: "separator"
1579
+ }) : r ? /* @__PURE__ */ n("div", {
1580
+ className: "nl-divider--labeled",
1581
+ role: "separator",
1582
+ children: [
1583
+ /* @__PURE__ */ t("span", { className: "nl-divider--labeled__line" }),
1584
+ /* @__PURE__ */ t("span", {
1585
+ className: "nl-divider--labeled__text",
1586
+ children: r
1587
+ }),
1588
+ /* @__PURE__ */ t("span", { className: "nl-divider--labeled__line" })
1589
+ ]
1590
+ }) : /* @__PURE__ */ t("hr", { className: "nl-divider" });
1591
+ }
1592
+ //#endregion
1593
+ //#region src/components/Link.tsx
1594
+ function Pe({ children: e, external: n = !1, ...r }) {
1595
+ return /* @__PURE__ */ t("a", {
1596
+ className: "nl-link",
1597
+ ...n ? {
1598
+ target: "_blank",
1599
+ rel: "noopener noreferrer"
1600
+ } : {},
1601
+ ...r,
1602
+ children: e
1603
+ });
1604
+ }
1605
+ //#endregion
1606
+ //#region src/components/Alert.tsx
1607
+ var Fe = {
1608
+ info: "info",
1609
+ success: "check",
1610
+ warning: "warning",
1611
+ danger: "close"
1612
+ };
1613
+ function K({ tone: e = "info", title: r, children: i, onDismiss: a }) {
1614
+ return /* @__PURE__ */ n("div", {
1615
+ className: `alert alert--${e}`,
1616
+ role: e === "danger" ? "alert" : "status",
1617
+ children: [
1618
+ /* @__PURE__ */ t("span", {
1619
+ className: "alert__icon",
1620
+ "aria-hidden": "true",
1621
+ children: /* @__PURE__ */ t(y, {
1622
+ name: Fe[e],
1623
+ size: 12,
1624
+ color: "var(--neutral-0)"
1625
+ })
1626
+ }),
1627
+ /* @__PURE__ */ n("div", {
1628
+ className: "alert__body",
1629
+ children: [r && /* @__PURE__ */ t("div", {
1630
+ className: "alert__title",
1631
+ children: r
1632
+ }), i && /* @__PURE__ */ t("div", {
1633
+ className: "alert__message",
1634
+ children: i
1635
+ })]
1636
+ }),
1637
+ a && /* @__PURE__ */ t("button", {
1638
+ type: "button",
1639
+ className: "alert__dismiss",
1640
+ "aria-label": "Dismiss",
1641
+ onClick: a,
1642
+ children: /* @__PURE__ */ t(y, {
1643
+ name: "close",
1644
+ size: 14
1645
+ })
1646
+ })
1647
+ ]
1648
+ });
1649
+ }
1650
+ //#endregion
1651
+ //#region src/components/IconButton.tsx
1652
+ function Ie({ children: e, variant: n = "ghost", size: r = "md", label: i, ...a }) {
1653
+ return /* @__PURE__ */ t("button", {
1654
+ type: "button",
1655
+ "aria-label": i,
1656
+ className: `icon-button icon-button--${n} icon-button--${r}`,
1657
+ ...a,
1658
+ children: e
1659
+ });
1660
+ }
1661
+ //#endregion
1662
+ //#region src/components/Tooltip.tsx
1663
+ function Le({ content: e, children: r, placement: i = "top" }) {
1664
+ return /* @__PURE__ */ n("span", {
1665
+ className: "tooltip-wrapper",
1666
+ children: [r, /* @__PURE__ */ t("span", {
1667
+ className: `tooltip-wrapper__bubble tooltip-wrapper__bubble--${i}`,
1668
+ role: "tooltip",
1669
+ children: e
1670
+ })]
1671
+ });
1672
+ }
1673
+ //#endregion
1674
+ //#region src/components/Fieldset.tsx
1675
+ function Re({ label: e, hint: r, error: i = !1, htmlFor: a, children: o }) {
1676
+ return /* @__PURE__ */ n("div", {
1677
+ className: `field${i ? " field--error" : ""}`,
1678
+ children: [
1679
+ e && /* @__PURE__ */ t("label", {
1680
+ className: "field__label",
1681
+ htmlFor: a,
1682
+ children: e
1683
+ }),
1684
+ o,
1685
+ r && /* @__PURE__ */ t("span", {
1686
+ className: "field__hint",
1687
+ children: r
1688
+ })
1689
+ ]
1690
+ });
1691
+ }
1692
+ //#endregion
1693
+ //#region src/components/Combobox.tsx
1694
+ function ze({ value: e, onChange: r, options: i, label: a, placeholder: o = "Search...", disabled: c = !1 }) {
1695
+ let [f, p] = d(!1), [m, h] = d(""), g = u(null), _ = i.find((t) => t.value === e)?.label ?? e;
1696
+ s(() => {
1697
+ f || h("");
1698
+ }, [f]), s(() => {
1699
+ if (!f) return;
1700
+ let e = (e) => {
1701
+ g.current && !g.current.contains(e.target) && p(!1);
1702
+ }, t = (e) => {
1703
+ e.key === "Escape" && p(!1);
1704
+ };
1705
+ return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
1706
+ document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
1707
+ };
1708
+ }, [f]);
1709
+ let v = l(() => {
1710
+ let e = m.trim().toLowerCase();
1711
+ return e ? i.filter((t) => t.label.toLowerCase().includes(e)) : i;
1712
+ }, [i, m]), y = (e) => {
1713
+ r(e.value), p(!1);
1714
+ };
1715
+ return /* @__PURE__ */ n("div", {
1716
+ className: "select combobox",
1717
+ ref: g,
1718
+ children: [f ? /* @__PURE__ */ t("input", {
1719
+ autoFocus: !0,
1720
+ className: "select__trigger",
1721
+ value: m,
1722
+ placeholder: _ || o,
1723
+ onChange: (e) => h(e.target.value),
1724
+ disabled: c
1725
+ }) : /* @__PURE__ */ n("button", {
1726
+ type: "button",
1727
+ className: "select__trigger",
1728
+ "aria-haspopup": "listbox",
1729
+ "aria-expanded": f,
1730
+ "aria-label": a,
1731
+ disabled: c,
1732
+ onClick: () => p(!0),
1733
+ children: [/* @__PURE__ */ t("span", { children: _ || /* @__PURE__ */ t("span", {
1734
+ className: "combobox__placeholder",
1735
+ children: o
1736
+ }) }), /* @__PURE__ */ t("span", {
1737
+ className: "select__chevron",
1738
+ "aria-hidden": "true"
1739
+ })]
1740
+ }), f && /* @__PURE__ */ n("ul", {
1741
+ className: "select__menu",
1742
+ role: "listbox",
1743
+ "aria-label": a,
1744
+ children: [v.length === 0 && /* @__PURE__ */ t("li", {
1745
+ className: "select__option combobox__empty",
1746
+ children: "No matches"
1747
+ }), v.map((n) => /* @__PURE__ */ t("li", {
1748
+ role: "option",
1749
+ "aria-selected": n.value === e,
1750
+ className: `select__option${n.value === e ? " select__option--selected" : ""}`,
1751
+ onClick: () => y(n),
1752
+ children: n.label
1753
+ }, n.value))]
1754
+ })]
1755
+ });
1756
+ }
1757
+ //#endregion
1758
+ //#region src/components/NumberStepper.tsx
1759
+ function Be({ value: e, onChange: r, min: i = -Infinity, max: a = Infinity, step: o = 1, label: s, disabled: c = !1 }) {
1760
+ let l = (e) => Math.min(a, Math.max(i, e)), u = (e) => r(l(e));
1761
+ return /* @__PURE__ */ n("div", {
1762
+ className: "number-stepper",
1763
+ role: "group",
1764
+ "aria-label": s,
1765
+ children: [
1766
+ /* @__PURE__ */ t("button", {
1767
+ type: "button",
1768
+ className: "number-stepper__btn",
1769
+ "aria-label": "Decrease",
1770
+ disabled: c || e <= i,
1771
+ onClick: () => u(e - o),
1772
+ children: /* @__PURE__ */ t(y, {
1773
+ name: "minus",
1774
+ size: 13
1775
+ })
1776
+ }),
1777
+ /* @__PURE__ */ t("input", {
1778
+ className: "number-stepper__field",
1779
+ type: "number",
1780
+ value: e,
1781
+ min: i === -Infinity ? void 0 : i,
1782
+ max: a === -Infinity ? void 0 : a,
1783
+ step: o,
1784
+ disabled: c,
1785
+ onChange: (e) => {
1786
+ let t = Number(e.target.value);
1787
+ Number.isNaN(t) || u(t);
1788
+ }
1789
+ }),
1790
+ /* @__PURE__ */ t("button", {
1791
+ type: "button",
1792
+ className: "number-stepper__btn",
1793
+ "aria-label": "Increase",
1794
+ disabled: c || e >= a,
1795
+ onClick: () => u(e + o),
1796
+ children: /* @__PURE__ */ t(y, {
1797
+ name: "plus",
1798
+ size: 13
1799
+ })
1800
+ })
1801
+ ]
1802
+ });
1803
+ }
1804
+ //#endregion
1805
+ //#region src/components/FileUpload.tsx
1806
+ function Ve({ onFiles: e, accept: r, multiple: i = !1, disabled: a = !1, label: o = "Drag files here or click to browse", hint: s }) {
1807
+ let [l, f] = d(!1), p = u(null), m = c(), h = (t) => {
1808
+ t && t.length && e(Array.from(t));
1809
+ };
1810
+ return /* @__PURE__ */ n("div", {
1811
+ className: `file-upload${l ? " file-upload--drag-over" : ""}${a ? " file-upload--disabled" : ""}`,
1812
+ onDragOver: (e) => {
1813
+ e.preventDefault(), a || f(!0);
1814
+ },
1815
+ onDragLeave: () => f(!1),
1816
+ onDrop: (e) => {
1817
+ e.preventDefault(), f(!1), a || h(e.dataTransfer.files);
1818
+ },
1819
+ onClick: () => !a && p.current?.click(),
1820
+ role: "button",
1821
+ tabIndex: a ? -1 : 0,
1822
+ "aria-disabled": a,
1823
+ children: [
1824
+ /* @__PURE__ */ t("input", {
1825
+ ref: p,
1826
+ id: m,
1827
+ type: "file",
1828
+ className: "file-upload__input",
1829
+ accept: r,
1830
+ multiple: i,
1831
+ disabled: a,
1832
+ onChange: (e) => h(e.target.files)
1833
+ }),
1834
+ /* @__PURE__ */ t("span", {
1835
+ className: "file-upload__icon",
1836
+ "aria-hidden": "true",
1837
+ children: /* @__PURE__ */ t(y, {
1838
+ name: "upload",
1839
+ size: 22
1840
+ })
1841
+ }),
1842
+ /* @__PURE__ */ t("span", {
1843
+ className: "file-upload__label",
1844
+ children: o
1845
+ }),
1846
+ s && /* @__PURE__ */ t("span", {
1847
+ className: "file-upload__hint",
1848
+ children: s
1849
+ })
1850
+ ]
1851
+ });
1852
+ }
1853
+ //#endregion
1854
+ //#region src/components/DatePicker.tsx
1855
+ var He = [
1856
+ "Su",
1857
+ "Mo",
1858
+ "Tu",
1859
+ "We",
1860
+ "Th",
1861
+ "Fr",
1862
+ "Sa"
1863
+ ], Ue = [
1864
+ "January",
1865
+ "February",
1866
+ "March",
1867
+ "April",
1868
+ "May",
1869
+ "June",
1870
+ "July",
1871
+ "August",
1872
+ "September",
1873
+ "October",
1874
+ "November",
1875
+ "December"
1876
+ ];
1877
+ function q(e) {
1878
+ if (!e) return null;
1879
+ let [t, n, r] = e.split("-").map(Number);
1880
+ return t === void 0 || n === void 0 || r === void 0 ? null : new Date(t, n - 1, r);
1881
+ }
1882
+ function We(e) {
1883
+ return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
1884
+ }
1885
+ function Ge(e) {
1886
+ let t = q(e);
1887
+ return t ? `${String(t.getMonth() + 1).padStart(2, "0")}/${String(t.getDate()).padStart(2, "0")}/${t.getFullYear()}` : "";
1888
+ }
1889
+ function Ke({ value: e, min: r, max: i, onChange: a, label: o = "Date", placeholder: c = "Select date" }) {
1890
+ let [l, f] = d(!1), p = q(e), m = q(r), h = q(i), [g, _] = d(() => p ?? /* @__PURE__ */ new Date()), v = u(null);
1891
+ s(() => {
1892
+ l && _(p ?? /* @__PURE__ */ new Date());
1893
+ }, [l]), s(() => {
1894
+ if (!l) return;
1895
+ let e = (e) => {
1896
+ v.current && !v.current.contains(e.target) && f(!1);
1897
+ }, t = (e) => {
1898
+ e.key === "Escape" && f(!1);
1899
+ };
1900
+ return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
1901
+ document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
1902
+ };
1903
+ }, [l]);
1904
+ let b = g.getFullYear(), x = g.getMonth(), S = new Date(b, x, 1).getDay(), C = new Date(b, x + 1, 0).getDate(), w = [];
1905
+ for (let e = 0; e < S; e++) w.push(null);
1906
+ for (let e = 1; e <= C; e++) w.push(new Date(b, x, e));
1907
+ let T = (e) => !!(m && e < m || h && e > h), E = (e) => !!(p && e.toDateString() === p.toDateString()), D = (e) => e.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), O = (e) => _(new Date(b, x + e, 1)), k = (e) => {
1908
+ a(We(e)), f(!1);
1909
+ };
1910
+ return /* @__PURE__ */ n("div", {
1911
+ className: "datepicker",
1912
+ ref: v,
1913
+ children: [/* @__PURE__ */ n("button", {
1914
+ type: "button",
1915
+ className: "select__trigger",
1916
+ "aria-haspopup": "dialog",
1917
+ "aria-expanded": l,
1918
+ "aria-label": o,
1919
+ onClick: () => f((e) => !e),
1920
+ children: [/* @__PURE__ */ t("span", { children: e ? Ge(e) : c }), /* @__PURE__ */ t("span", {
1921
+ className: "datepicker__icon",
1922
+ "aria-hidden": "true"
1923
+ })]
1924
+ }), l && /* @__PURE__ */ n("div", {
1925
+ className: "datepicker__panel",
1926
+ role: "dialog",
1927
+ "aria-label": o,
1928
+ children: [
1929
+ /* @__PURE__ */ n("div", {
1930
+ className: "datepicker__header",
1931
+ children: [
1932
+ /* @__PURE__ */ t("button", {
1933
+ type: "button",
1934
+ className: "datepicker__nav",
1935
+ onClick: () => O(-1),
1936
+ "aria-label": "Previous month",
1937
+ children: /* @__PURE__ */ t(y, {
1938
+ name: "chevron-left",
1939
+ size: 14
1940
+ })
1941
+ }),
1942
+ /* @__PURE__ */ n("span", {
1943
+ className: "datepicker__title",
1944
+ children: [
1945
+ Ue[x],
1946
+ " ",
1947
+ b
1948
+ ]
1949
+ }),
1950
+ /* @__PURE__ */ t("button", {
1951
+ type: "button",
1952
+ className: "datepicker__nav",
1953
+ onClick: () => O(1),
1954
+ "aria-label": "Next month",
1955
+ children: /* @__PURE__ */ t(y, {
1956
+ name: "chevron-right",
1957
+ size: 14
1958
+ })
1959
+ })
1960
+ ]
1961
+ }),
1962
+ /* @__PURE__ */ t("div", {
1963
+ className: "datepicker__weekdays",
1964
+ children: He.map((e) => /* @__PURE__ */ t("span", { children: e }, e))
1965
+ }),
1966
+ /* @__PURE__ */ t("div", {
1967
+ className: "datepicker__grid",
1968
+ children: w.map((e, n) => e ? /* @__PURE__ */ t("button", {
1969
+ type: "button",
1970
+ disabled: T(e),
1971
+ className: [
1972
+ "datepicker__day",
1973
+ E(e) && "datepicker__day--selected",
1974
+ D(e) && "datepicker__day--today"
1975
+ ].filter(Boolean).join(" "),
1976
+ onClick: () => k(e),
1977
+ children: e.getDate()
1978
+ }, n) : /* @__PURE__ */ t("span", {}, n))
1979
+ })
1980
+ ]
1981
+ })]
1982
+ });
1983
+ }
1984
+ //#endregion
1985
+ //#region src/components/Rating.tsx
1986
+ function qe({ value: e, onChange: n, max: r = 5, readOnly: i = !1 }) {
1987
+ let [a, o] = d(null), s = !i && !!n, c = a ?? e;
1988
+ return /* @__PURE__ */ t("div", {
1989
+ className: `rating${s ? "" : " rating--readonly"}`,
1990
+ role: s ? "radiogroup" : "img",
1991
+ "aria-label": `${e} out of ${r} stars`,
1992
+ onMouseLeave: () => o(null),
1993
+ children: Array.from({ length: r }, (e, t) => t + 1).map((r) => /* @__PURE__ */ t("span", {
1994
+ className: `rating__star${r <= c ? " rating__star--filled" : ""}`,
1995
+ onMouseEnter: () => s && o(r),
1996
+ onClick: () => s && n?.(r),
1997
+ role: s ? "radio" : void 0,
1998
+ "aria-checked": s ? r === e : void 0,
1999
+ "aria-hidden": !s || void 0,
2000
+ children: /* @__PURE__ */ t(y, {
2001
+ name: "star",
2002
+ size: 20,
2003
+ filled: r <= c
2004
+ })
2005
+ }, r))
2006
+ });
2007
+ }
2008
+ //#endregion
2009
+ //#region src/components/List.tsx
2010
+ function Je({ items: e, bordered: n = !0 }) {
2011
+ return /* @__PURE__ */ t("ul", {
2012
+ className: `nl-list${n ? " nl-list--bordered" : ""}`,
2013
+ children: e.map((e) => /* @__PURE__ */ t("li", {
2014
+ className: `nl-list__item${e.onClick ? " nl-list__item--clickable" : ""}`,
2015
+ onClick: e.onClick,
2016
+ children: e.content
2017
+ }, e.id))
2018
+ });
2019
+ }
2020
+ //#endregion
2021
+ //#region src/components/Timeline.tsx
2022
+ function Ye({ items: e }) {
2023
+ return /* @__PURE__ */ t("div", {
2024
+ className: "timeline",
2025
+ children: e.map((r, i) => /* @__PURE__ */ n("div", {
2026
+ className: "timeline__item",
2027
+ children: [/* @__PURE__ */ n("div", {
2028
+ className: "timeline__rail",
2029
+ children: [/* @__PURE__ */ t("span", { className: `timeline__dot${r.tone ? ` timeline__dot--${r.tone}` : ""}` }), i < e.length - 1 && /* @__PURE__ */ t("span", { className: "timeline__line" })]
2030
+ }), /* @__PURE__ */ n("div", {
2031
+ className: "timeline__content",
2032
+ children: [/* @__PURE__ */ n("div", {
2033
+ className: "timeline__header",
2034
+ children: [/* @__PURE__ */ t("span", {
2035
+ className: "timeline__title",
2036
+ children: r.title
2037
+ }), r.timestamp && /* @__PURE__ */ t("span", {
2038
+ className: "timeline__timestamp",
2039
+ children: r.timestamp
2040
+ })]
2041
+ }), r.description && /* @__PURE__ */ t("div", {
2042
+ className: "timeline__description",
2043
+ children: r.description
2044
+ })]
2045
+ })]
2046
+ }, r.id))
2047
+ });
2048
+ }
2049
+ //#endregion
2050
+ //#region src/components/AvatarGroup.tsx
2051
+ function Xe({ avatars: e, max: r = 4, size: i = 32 }) {
2052
+ let a = e.slice(0, r), o = e.length - a.length;
2053
+ return /* @__PURE__ */ n("div", {
2054
+ className: "avatar-group",
2055
+ children: [a.map((e, n) => /* @__PURE__ */ t("div", {
2056
+ className: "avatar-group__item",
2057
+ style: { zIndex: a.length - n },
2058
+ children: /* @__PURE__ */ t(H, {
2059
+ ...e,
2060
+ size: e.size ?? i
2061
+ })
2062
+ }, n)), o > 0 && /* @__PURE__ */ n("div", {
2063
+ className: "avatar-group__item avatar-group__overflow",
2064
+ style: {
2065
+ width: i,
2066
+ height: i,
2067
+ fontSize: Math.round(i * .35)
2068
+ },
2069
+ children: ["+", o]
2070
+ })]
2071
+ });
2072
+ }
2073
+ //#endregion
2074
+ //#region src/components/CodeBlock.tsx
2075
+ function Ze({ code: e, language: r, copyable: i = !0 }) {
2076
+ return /* @__PURE__ */ n("div", {
2077
+ className: "code-block",
2078
+ children: [(r || i) && /* @__PURE__ */ n("div", {
2079
+ className: "code-block__header",
2080
+ children: [r && /* @__PURE__ */ t("span", {
2081
+ className: "code-block__lang",
2082
+ children: r
2083
+ }), i && /* @__PURE__ */ t(W, { text: e })]
2084
+ }), /* @__PURE__ */ t("pre", {
2085
+ className: "code-block__body",
2086
+ children: /* @__PURE__ */ t("code", { children: e })
2087
+ })]
2088
+ });
2089
+ }
2090
+ //#endregion
2091
+ //#region src/components/Kbd.tsx
2092
+ function Qe({ children: e }) {
2093
+ return /* @__PURE__ */ t("kbd", {
2094
+ className: "kbd",
2095
+ children: e
2096
+ });
2097
+ }
2098
+ //#endregion
2099
+ //#region src/components/Tree.tsx
2100
+ function J({ node: e, expanded: r, toggle: i, onSelect: a, selectedId: o }) {
2101
+ let s = !!e.children?.length, c = r.has(e.id);
2102
+ return /* @__PURE__ */ n("li", {
2103
+ className: "tree__item",
2104
+ children: [/* @__PURE__ */ n("div", {
2105
+ className: `tree__row${e.id === o ? " tree__row--selected" : ""}`,
2106
+ onClick: () => {
2107
+ s && i(e.id), a?.(e.id);
2108
+ },
2109
+ children: [s ? /* @__PURE__ */ t("span", {
2110
+ className: `tree__chevron${c ? " tree__chevron--open" : ""}`,
2111
+ "aria-hidden": "true"
2112
+ }) : /* @__PURE__ */ t("span", {
2113
+ className: "tree__chevron tree__chevron--leaf",
2114
+ "aria-hidden": "true"
2115
+ }), /* @__PURE__ */ t("span", {
2116
+ className: "tree__label",
2117
+ children: e.label
2118
+ })]
2119
+ }), s && c && /* @__PURE__ */ t("ul", {
2120
+ className: "tree__children",
2121
+ children: e.children.map((e) => /* @__PURE__ */ t(J, {
2122
+ node: e,
2123
+ expanded: r,
2124
+ toggle: i,
2125
+ onSelect: a,
2126
+ selectedId: o
2127
+ }, e.id))
2128
+ })]
2129
+ });
2130
+ }
2131
+ function $e({ nodes: e, defaultExpandedIds: n = [], onSelect: r, selectedId: i }) {
2132
+ let [a, o] = d(new Set(n)), s = (e) => {
2133
+ o((t) => {
2134
+ let n = new Set(t);
2135
+ return n.has(e) ? n.delete(e) : n.add(e), n;
2136
+ });
2137
+ };
2138
+ return /* @__PURE__ */ t("ul", {
2139
+ className: "tree",
2140
+ role: "tree",
2141
+ children: e.map((e) => /* @__PURE__ */ t(J, {
2142
+ node: e,
2143
+ expanded: a,
2144
+ toggle: s,
2145
+ onSelect: r,
2146
+ selectedId: i
2147
+ }, e.id))
2148
+ });
2149
+ }
2150
+ //#endregion
2151
+ //#region src/components/Navbar.tsx
2152
+ function et({ brand: e, children: r, sticky: i = !1 }) {
2153
+ return /* @__PURE__ */ n("header", {
2154
+ className: `navbar${i ? " navbar--sticky" : ""}`,
2155
+ children: [e && /* @__PURE__ */ t("div", {
2156
+ className: "navbar__brand",
2157
+ children: e
2158
+ }), /* @__PURE__ */ t("div", {
2159
+ className: "navbar__actions",
2160
+ children: r
2161
+ })]
2162
+ });
2163
+ }
2164
+ //#endregion
2165
+ //#region src/components/Sidebar.tsx
2166
+ function tt({ items: e, activeId: r, collapsed: i = !1, header: a }) {
2167
+ return /* @__PURE__ */ n("nav", {
2168
+ className: `sidebar${i ? " sidebar--collapsed" : ""}`,
2169
+ children: [a && /* @__PURE__ */ t("div", {
2170
+ className: "sidebar__header",
2171
+ children: a
2172
+ }), /* @__PURE__ */ t("ul", {
2173
+ className: "sidebar__list",
2174
+ children: e.map((e) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ n("button", {
2175
+ type: "button",
2176
+ className: `sidebar__item${e.id === r ? " sidebar__item--active" : ""}`,
2177
+ onClick: e.onClick,
2178
+ title: i && typeof e.label == "string" ? e.label : void 0,
2179
+ children: [e.icon && /* @__PURE__ */ t("span", {
2180
+ className: "sidebar__icon",
2181
+ children: e.icon
2182
+ }), !i && /* @__PURE__ */ t("span", {
2183
+ className: "sidebar__label",
2184
+ children: e.label
2185
+ })]
2186
+ }) }, e.id))
2187
+ })]
2188
+ });
2189
+ }
2190
+ //#endregion
2191
+ //#region src/components/ButtonGroup.tsx
2192
+ function nt({ children: e }) {
2193
+ return /* @__PURE__ */ t("div", {
2194
+ className: "button-group",
2195
+ children: e
2196
+ });
2197
+ }
2198
+ //#endregion
2199
+ //#region src/components/ColorPicker.tsx
2200
+ var rt = [
2201
+ "#8FB4F5",
2202
+ "#7FD8C9",
2203
+ "#C9A8F0",
2204
+ "#F5C88F",
2205
+ "#F19A9A",
2206
+ "#8FCB9E"
2207
+ ];
2208
+ function it({ value: e, onChange: r, swatches: i = rt, label: a = "Color" }) {
2209
+ return /* @__PURE__ */ n("div", {
2210
+ className: "color-picker",
2211
+ role: "group",
2212
+ "aria-label": a,
2213
+ children: [i.map((n) => /* @__PURE__ */ t("button", {
2214
+ type: "button",
2215
+ className: `color-picker__swatch${n.toLowerCase() === e.toLowerCase() ? " color-picker__swatch--selected" : ""}`,
2216
+ style: { background: n },
2217
+ "aria-label": n,
2218
+ "aria-pressed": n.toLowerCase() === e.toLowerCase(),
2219
+ onClick: () => r(n)
2220
+ }, n)), /* @__PURE__ */ t("label", {
2221
+ className: "color-picker__custom",
2222
+ children: /* @__PURE__ */ t("input", {
2223
+ type: "color",
2224
+ value: e,
2225
+ onChange: (e) => r(e.target.value),
2226
+ "aria-label": "Custom color"
2227
+ })
2228
+ })]
2229
+ });
2230
+ }
2231
+ //#endregion
2232
+ //#region src/components/PasswordInput.tsx
2233
+ function at({ label: e, value: r, onChange: i, placeholder: a, disabled: o = !1, error: s = !1, hint: l, id: u, autoComplete: f = "current-password" }) {
2234
+ let [p, m] = d(!1), h = c(), g = u ?? h;
2235
+ return /* @__PURE__ */ n("div", {
2236
+ className: `field${s ? " field--error" : ""}`,
2237
+ children: [
2238
+ e && /* @__PURE__ */ t("label", {
2239
+ className: "field__label",
2240
+ htmlFor: g,
2241
+ children: e
2242
+ }),
2243
+ /* @__PURE__ */ n("div", {
2244
+ className: "password-input",
2245
+ children: [/* @__PURE__ */ t("input", {
2246
+ id: g,
2247
+ className: "field__input password-input__field",
2248
+ type: p ? "text" : "password",
2249
+ value: r,
2250
+ onChange: (e) => i(e.target.value),
2251
+ placeholder: a,
2252
+ disabled: o,
2253
+ autoComplete: f,
2254
+ "aria-invalid": s || void 0
2255
+ }), /* @__PURE__ */ t("button", {
2256
+ type: "button",
2257
+ className: "password-input__toggle",
2258
+ "aria-label": p ? "Hide password" : "Show password",
2259
+ disabled: o,
2260
+ onClick: () => m((e) => !e),
2261
+ children: /* @__PURE__ */ t(y, {
2262
+ name: p ? "eye-off" : "eye",
2263
+ size: 16
2264
+ })
2265
+ })]
2266
+ }),
2267
+ l && /* @__PURE__ */ t("span", {
2268
+ className: "field__hint",
2269
+ children: l
2270
+ })
2271
+ ]
2272
+ });
2273
+ }
2274
+ //#endregion
2275
+ //#region src/components/OTPInput.tsx
2276
+ function ot({ length: e = 6, value: n, onChange: r, disabled: i = !1, label: a = "Verification code" }) {
2277
+ let o = u([]), s = Array.from({ length: e }, (e, t) => n[t] ?? ""), c = (t, n) => {
2278
+ let i = s.slice();
2279
+ i[t] = n, r(i.join("").slice(0, e));
2280
+ }, l = (t, n) => {
2281
+ let r = n.slice(-1);
2282
+ c(t, r), r && t < e - 1 && o.current[t + 1]?.focus();
2283
+ }, d = (e, t) => {
2284
+ t.key === "Backspace" && !s[e] && e > 0 && o.current[e - 1]?.focus();
2285
+ }, f = (t) => {
2286
+ t.preventDefault();
2287
+ let n = t.clipboardData.getData("text").trim().slice(0, e);
2288
+ r(n), o.current[Math.min(n.length, e - 1)]?.focus();
2289
+ };
2290
+ return /* @__PURE__ */ t("div", {
2291
+ className: "otp-input",
2292
+ role: "group",
2293
+ "aria-label": a,
2294
+ children: s.map((n, r) => /* @__PURE__ */ t("input", {
2295
+ ref: (e) => {
2296
+ o.current[r] = e;
2297
+ },
2298
+ className: "otp-input__box",
2299
+ value: n,
2300
+ onChange: (e) => l(r, e.target.value),
2301
+ onKeyDown: (e) => d(r, e),
2302
+ onPaste: f,
2303
+ disabled: i,
2304
+ inputMode: "text",
2305
+ maxLength: 1,
2306
+ "aria-label": `Digit ${r + 1} of ${e}`
2307
+ }, r))
2308
+ });
2309
+ }
2310
+ //#endregion
2311
+ //#region src/components/LoadingOverlay.tsx
2312
+ function st({ active: e, children: r, label: i = "Loading" }) {
2313
+ return /* @__PURE__ */ n("div", {
2314
+ className: "loading-overlay",
2315
+ children: [r, e && /* @__PURE__ */ t("div", {
2316
+ className: "loading-overlay__veil",
2317
+ role: "status",
2318
+ "aria-label": i,
2319
+ children: /* @__PURE__ */ t(U, {})
2320
+ })]
2321
+ });
2322
+ }
2323
+ //#endregion
2324
+ //#region src/components/ErrorBoundary.tsx
2325
+ var ct = class extends r {
2326
+ state = { error: null };
2327
+ static getDerivedStateFromError(e) {
2328
+ return { error: e };
2329
+ }
2330
+ componentDidCatch(e, t) {
2331
+ this.props.onError?.(e, t);
2332
+ }
2333
+ reset = () => this.setState({ error: null });
2334
+ render() {
2335
+ let { error: e } = this.state;
2336
+ return e ? this.props.fallback ? this.props.fallback(e, this.reset) : /* @__PURE__ */ n(K, {
2337
+ tone: "danger",
2338
+ title: "Something went wrong",
2339
+ children: [/* @__PURE__ */ t("div", {
2340
+ className: "error-boundary__message",
2341
+ children: e.message
2342
+ }), /* @__PURE__ */ t("div", {
2343
+ className: "error-boundary__actions",
2344
+ children: /* @__PURE__ */ t(A, {
2345
+ variant: "secondary",
2346
+ size: "sm",
2347
+ onClick: this.reset,
2348
+ children: "Try again"
2349
+ })
2350
+ })]
2351
+ }) : this.props.children;
2352
+ }
2353
+ };
2354
+ //#endregion
2355
+ //#region src/components/Carousel.tsx
2356
+ function lt({ items: r, autoPlay: i = !1, interval: a = 4e3 }) {
2357
+ let [o, c] = d(0);
2358
+ if (s(() => {
2359
+ if (!i || r.length <= 1) return;
2360
+ let e = setInterval(() => c((e) => (e + 1) % r.length), a);
2361
+ return () => clearInterval(e);
2362
+ }, [
2363
+ i,
2364
+ a,
2365
+ r.length
2366
+ ]), !r.length) return null;
2367
+ let l = (e) => c((t) => (t + e + r.length) % r.length);
2368
+ return /* @__PURE__ */ n("div", {
2369
+ className: "carousel",
2370
+ children: [/* @__PURE__ */ n("div", {
2371
+ className: "carousel__viewport",
2372
+ children: [/* @__PURE__ */ t("div", {
2373
+ className: "carousel__slide",
2374
+ children: r[o]
2375
+ }, o), r.length > 1 && /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("button", {
2376
+ type: "button",
2377
+ className: "carousel__nav carousel__nav--prev",
2378
+ "aria-label": "Previous slide",
2379
+ onClick: () => l(-1),
2380
+ children: /* @__PURE__ */ t(y, {
2381
+ name: "chevron-left",
2382
+ size: 18
2383
+ })
2384
+ }), /* @__PURE__ */ t("button", {
2385
+ type: "button",
2386
+ className: "carousel__nav carousel__nav--next",
2387
+ "aria-label": "Next slide",
2388
+ onClick: () => l(1),
2389
+ children: /* @__PURE__ */ t(y, {
2390
+ name: "chevron-right",
2391
+ size: 18
2392
+ })
2393
+ })] })]
2394
+ }), r.length > 1 && /* @__PURE__ */ t("div", {
2395
+ className: "carousel__dots",
2396
+ role: "tablist",
2397
+ children: r.map((e, n) => /* @__PURE__ */ t("button", {
2398
+ type: "button",
2399
+ role: "tab",
2400
+ "aria-selected": n === o,
2401
+ "aria-label": `Go to slide ${n + 1}`,
2402
+ className: `carousel__dot${n === o ? " carousel__dot--active" : ""}`,
2403
+ onClick: () => c(n)
2404
+ }, n))
2405
+ })]
2406
+ });
2407
+ }
2408
+ //#endregion
2409
+ //#region src/components/Portal.tsx
2410
+ function ut({ children: e }) {
2411
+ return typeof document > "u" ? null : f(e, document.body);
2412
+ }
2413
+ //#endregion
2414
+ //#region src/hooks/useClickOutside.ts
2415
+ function dt(e, t, n = !0) {
2416
+ s(() => {
2417
+ if (!n) return;
2418
+ let r = (n) => {
2419
+ e.current && !e.current.contains(n.target) && t();
2420
+ }, i = (e) => {
2421
+ e.key === "Escape" && t();
2422
+ };
2423
+ return document.addEventListener("mousedown", r), document.addEventListener("keydown", i), () => {
2424
+ document.removeEventListener("mousedown", r), document.removeEventListener("keydown", i);
2425
+ };
2426
+ }, [
2427
+ e,
2428
+ t,
2429
+ n
2430
+ ]);
2431
+ }
2432
+ //#endregion
2433
+ //#region src/chartTheme.ts
2434
+ var ft = [
2435
+ "#8FB4F5",
2436
+ "#7FD8C9",
2437
+ "#C9A8F0",
2438
+ "#F5C88F",
2439
+ "#F19A9A",
2440
+ "#A9B4F0",
2441
+ "#8FCBEE",
2442
+ "#F5AFD1",
2443
+ "#B9DE9E"
2444
+ ], Y = {
2445
+ size: 11,
2446
+ family: "'IBM Plex Mono', monospace"
2447
+ }, X = {
2448
+ gridColor: "#F1F2F5",
2449
+ axisColor: "#9CA3AF",
2450
+ tooltip: {
2451
+ backgroundColor: "#FFFFFF",
2452
+ titleColor: "#0B0D12",
2453
+ bodyColor: "#4B5563",
2454
+ borderColor: "#E7E9EE"
2455
+ }
2456
+ };
2457
+ function Z() {
2458
+ if (typeof document > "u") return X;
2459
+ let e = getComputedStyle(document.documentElement), t = (t, n) => e.getPropertyValue(t).trim() || n;
2460
+ return {
2461
+ gridColor: t("--neutral-100", X.gridColor),
2462
+ axisColor: t("--neutral-400", X.axisColor),
2463
+ tooltip: {
2464
+ backgroundColor: t("--neutral-0", X.tooltip.backgroundColor),
2465
+ titleColor: t("--neutral-1000", X.tooltip.titleColor),
2466
+ bodyColor: t("--neutral-600", X.tooltip.bodyColor),
2467
+ borderColor: t("--card-border", X.tooltip.borderColor)
2468
+ }
2469
+ };
2470
+ }
2471
+ var pt = Z().axisColor, mt = Z().gridColor, ht = {
2472
+ ...Z().tooltip,
2473
+ borderWidth: 1,
2474
+ padding: 8,
2475
+ cornerRadius: 8,
2476
+ titleFont: {
2477
+ size: 12,
2478
+ weight: 600,
2479
+ family: "'Space Grotesk', sans-serif"
2480
+ },
2481
+ bodyFont: {
2482
+ size: 12,
2483
+ family: "'IBM Plex Mono', monospace"
2484
+ }
2485
+ };
2486
+ function Q() {
2487
+ return {
2488
+ ...Z().tooltip,
2489
+ borderWidth: 1,
2490
+ padding: 8,
2491
+ cornerRadius: 8,
2492
+ titleFont: {
2493
+ size: 12,
2494
+ weight: 600,
2495
+ family: "'Space Grotesk', sans-serif"
2496
+ },
2497
+ bodyFont: {
2498
+ size: 12,
2499
+ family: "'IBM Plex Mono', monospace"
2500
+ }
2501
+ };
2502
+ }
2503
+ var $ = {
2504
+ boxWidth: 10,
2505
+ font: {
2506
+ size: 11,
2507
+ family: "'IBM Plex Mono', monospace"
2508
+ }
2509
+ };
2510
+ function gt(e) {
2511
+ if (typeof window > "u") return () => {};
2512
+ let t = window.matchMedia("(prefers-color-scheme: dark)");
2513
+ t.addEventListener("change", e);
2514
+ let n = new MutationObserver(e);
2515
+ return n.observe(document.documentElement, {
2516
+ attributes: !0,
2517
+ attributeFilter: ["data-theme"]
2518
+ }), () => {
2519
+ t.removeEventListener("change", e), n.disconnect();
2520
+ };
2521
+ }
2522
+ function _t(e, { rotateXTicks: t = !1, maxTicks: n, longLabels: r = !1 } = {}) {
2523
+ let { gridColor: i, axisColor: a } = Z();
2524
+ return {
2525
+ responsive: !0,
2526
+ maintainAspectRatio: !1,
2527
+ layout: { padding: { bottom: t ? 8 : 0 } },
2528
+ animation: {
2529
+ duration: 500,
2530
+ easing: "easeOutQuad"
2531
+ },
2532
+ interaction: {
2533
+ mode: "index",
2534
+ intersect: !1
2535
+ },
2536
+ plugins: {
2537
+ legend: {
2538
+ position: "bottom",
2539
+ labels: $
2540
+ },
2541
+ tooltip: Q()
2542
+ },
2543
+ scales: {
2544
+ x: {
2545
+ ticks: {
2546
+ font: Y,
2547
+ color: a,
2548
+ autoSkip: !0,
2549
+ ...r ? {
2550
+ maxRotation: 90,
2551
+ minRotation: 0
2552
+ } : t ? {
2553
+ maxRotation: 35,
2554
+ minRotation: 35
2555
+ } : {},
2556
+ ...n ? { maxTicksLimit: n } : {}
2557
+ },
2558
+ grid: { color: i }
2559
+ },
2560
+ y: {
2561
+ position: "left",
2562
+ beginAtZero: !0,
2563
+ ticks: {
2564
+ font: Y,
2565
+ color: a
2566
+ },
2567
+ grid: { color: i }
2568
+ },
2569
+ y1: {
2570
+ position: "right",
2571
+ min: 0,
2572
+ max: 100,
2573
+ ticks: {
2574
+ font: Y,
2575
+ color: a,
2576
+ callback: (t) => `${t}${e}`
2577
+ },
2578
+ grid: { drawOnChartArea: !1 }
2579
+ }
2580
+ }
2581
+ };
2582
+ }
2583
+ function vt({ cutout: e = "65%", showLegend: t = !0 } = {}) {
2584
+ return {
2585
+ responsive: !0,
2586
+ maintainAspectRatio: !1,
2587
+ cutout: e,
2588
+ animation: {
2589
+ duration: 500,
2590
+ easing: "easeOutQuad"
2591
+ },
2592
+ plugins: {
2593
+ legend: t ? {
2594
+ position: "bottom",
2595
+ labels: $
2596
+ } : { display: !1 },
2597
+ tooltip: Q()
2598
+ }
2599
+ };
2600
+ }
2601
+ function yt({ maxTicks: e, beginAtZero: t = !0 } = {}) {
2602
+ let { gridColor: n, axisColor: r } = Z();
2603
+ return {
2604
+ indexAxis: "y",
2605
+ responsive: !0,
2606
+ maintainAspectRatio: !1,
2607
+ animation: {
2608
+ duration: 500,
2609
+ easing: "easeOutQuad"
2610
+ },
2611
+ plugins: {
2612
+ legend: { display: !1 },
2613
+ tooltip: Q()
2614
+ },
2615
+ scales: {
2616
+ x: {
2617
+ beginAtZero: t,
2618
+ ticks: {
2619
+ font: Y,
2620
+ color: r,
2621
+ ...e ? { maxTicksLimit: e } : {}
2622
+ },
2623
+ grid: { color: n }
2624
+ },
2625
+ y: {
2626
+ ticks: {
2627
+ font: Y,
2628
+ color: r
2629
+ },
2630
+ grid: { display: !1 }
2631
+ }
2632
+ }
2633
+ };
2634
+ }
2635
+ function bt({ maxTicks: e, beginAtZero: t = !0, unit: n = "" } = {}) {
2636
+ let { gridColor: r, axisColor: i } = Z();
2637
+ return {
2638
+ responsive: !0,
2639
+ maintainAspectRatio: !1,
2640
+ animation: {
2641
+ duration: 500,
2642
+ easing: "easeOutQuad"
2643
+ },
2644
+ interaction: {
2645
+ mode: "index",
2646
+ intersect: !1
2647
+ },
2648
+ plugins: {
2649
+ legend: { display: !1 },
2650
+ tooltip: Q()
2651
+ },
2652
+ scales: {
2653
+ x: {
2654
+ ticks: {
2655
+ font: Y,
2656
+ color: i,
2657
+ autoSkip: !0,
2658
+ ...e ? { maxTicksLimit: e } : {}
2659
+ },
2660
+ grid: { color: r }
2661
+ },
2662
+ y: {
2663
+ beginAtZero: t,
2664
+ ticks: {
2665
+ font: Y,
2666
+ color: i,
2667
+ callback: (e) => `${e}${n}`
2668
+ },
2669
+ grid: { color: r }
2670
+ }
2671
+ }
2672
+ };
2673
+ }
2674
+ function xt({ maxTicks: e, rotateXTicks: t = !1 } = {}) {
2675
+ let { gridColor: n, axisColor: r } = Z();
2676
+ return {
2677
+ responsive: !0,
2678
+ maintainAspectRatio: !1,
2679
+ animation: {
2680
+ duration: 500,
2681
+ easing: "easeOutQuad"
2682
+ },
2683
+ interaction: {
2684
+ mode: "index",
2685
+ intersect: !1
2686
+ },
2687
+ plugins: {
2688
+ legend: {
2689
+ position: "bottom",
2690
+ labels: $
2691
+ },
2692
+ tooltip: Q()
2693
+ },
2694
+ scales: {
2695
+ x: {
2696
+ stacked: !0,
2697
+ ticks: {
2698
+ font: Y,
2699
+ color: r,
2700
+ autoSkip: !0,
2701
+ ...t ? {
2702
+ maxRotation: 35,
2703
+ minRotation: 35
2704
+ } : {},
2705
+ ...e ? { maxTicksLimit: e } : {}
2706
+ },
2707
+ grid: { color: n }
2708
+ },
2709
+ y: {
2710
+ stacked: !0,
2711
+ beginAtZero: !0,
2712
+ ticks: {
2713
+ font: Y,
2714
+ color: r
2715
+ },
2716
+ grid: { color: n }
2717
+ }
2718
+ }
2719
+ };
2720
+ }
2721
+ function St() {
2722
+ let { gridColor: e, axisColor: t } = Z();
2723
+ return {
2724
+ responsive: !0,
2725
+ maintainAspectRatio: !1,
2726
+ animation: {
2727
+ duration: 500,
2728
+ easing: "easeOutQuad"
2729
+ },
2730
+ plugins: {
2731
+ legend: {
2732
+ position: "bottom",
2733
+ labels: $
2734
+ },
2735
+ tooltip: Q()
2736
+ },
2737
+ scales: { r: {
2738
+ angleLines: { color: e },
2739
+ grid: { color: e },
2740
+ pointLabels: {
2741
+ font: Y,
2742
+ color: t
2743
+ },
2744
+ ticks: {
2745
+ font: Y,
2746
+ color: t,
2747
+ backdropColor: "transparent"
2748
+ }
2749
+ } }
2750
+ };
2751
+ }
2752
+ function Ct(e, t, n) {
2753
+ return e.map((r, i) => {
2754
+ let a = Math.max(0, i - n + 1), o = e.slice(a, i + 1).filter((e) => e[t] != null);
2755
+ if (!o.length) return null;
2756
+ let s = o.reduce((e, n) => e + n[t], 0) / o.length;
2757
+ return Number(s.toFixed(1));
2758
+ });
2759
+ }
2760
+ //#endregion
2761
+ //#region src/chartSetup.ts
2762
+ var wt = !1;
2763
+ function Tt() {
2764
+ wt || (wt = !0, p.register(...m, h), p.defaults.set("plugins.datalabels", { display: !1 }));
2765
+ }
2766
+ //#endregion
2767
+ export { pt as AXIS_COLOR, Y as AXIS_TICK_FONT, me as Accordion, K as Alert, H as Avatar, Xe as AvatarGroup, j as Badge, se as Breadcrumbs, ve as BulletChart, A as Button, nt as ButtonGroup, fe as Card, lt as Carousel, x as ChartCard, ge as ChartLegend, z as Checkbox, Ze as CodeBlock, it as ColorPicker, ze as Combobox, ke as Container, W as CopyButton, Ke as DatePicker, O as DateRangePicker, Ee as DescriptionList, Ne as Divider, xe as Drawer, pe as EmptyState, ct as ErrorBoundary, Re as Fieldset, Ve as FileUpload, mt as GRID_COLOR, le as Gauge, Me as Grid, je as HStack, Oe as Heading, y as Icon, Ie as IconButton, b as InfoTooltip, M as Input, Qe as Kbd, Pe as Link, Je as List, st as LoadingOverlay, ie as Menu, _e as MiniBar, P as Modal, et as Navbar, Be as NumberStepper, ot as OTPInput, ft as PALETTE, oe as Pagination, at as PasswordInput, Se as Popover, ut as Portal, ce as ProgressBar, B as Radio, te as RadioGroup, qe as Rating, _ as ScoreCard, we as SearchInput, he as SegmentedControl, S as Select, tt as Sidebar, re as Skeleton, ye as Slider, g as Sparkline, U as Spinner, G as Stack, Te as StatusDot, be as Stepper, ee as Switch, ht as TOOLTIP_OPTS, N as Table, k as Tabs, Ce as TagInput, De as Text, ne as Textarea, Ye as Timeline, L as ToastProvider, Le as Tooltip, $e as Tree, Ae as VStack, bt as areaOptions, vt as donutOptions, _t as dualAxisOptions, Z as getChartColors, yt as horizontalBarOptions, Tt as installCharts, gt as onThemeChange, St as radarOptions, Ct as rollingAverage, xt as stackedBarOptions, dt as useClickOutside, R as useToast };
2768
+
2769
+ //# sourceMappingURL=index.js.map