@davidbirchall/core 1.0.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 (54) hide show
  1. package/dist/components/Badge/Badge.stories.d.ts +33 -0
  2. package/dist/components/Badge/Badge.test.d.ts +1 -0
  3. package/dist/components/Button/Button.stories.d.ts +30 -0
  4. package/dist/components/Button/Button.test.d.ts +1 -0
  5. package/dist/components/Button/types.d.ts +4 -0
  6. package/dist/components/Calendar/Calendar.stories.d.ts +27 -0
  7. package/dist/components/Calendar/Calendar.test.d.ts +1 -0
  8. package/dist/components/Calendar/types.d.ts +22 -0
  9. package/dist/components/Card/Card.stories.d.ts +21 -0
  10. package/dist/components/Card/Card.test.d.ts +1 -0
  11. package/dist/components/Card/types.d.ts +3 -0
  12. package/dist/components/Checkbox/Checkbox.stories.d.ts +41 -0
  13. package/dist/components/Checkbox/Checkbox.test.d.ts +1 -0
  14. package/dist/components/Checkbox/types.d.ts +7 -0
  15. package/dist/components/DataTable/DataTable.stories.d.ts +29 -0
  16. package/dist/components/DataTable/DataTable.test.d.ts +1 -0
  17. package/dist/components/DataTable/types.d.ts +11 -0
  18. package/dist/components/DatePicker/DatePicker.stories.d.ts +15 -0
  19. package/dist/components/DatePicker/DatePicker.test.d.ts +1 -0
  20. package/dist/components/Dropdown/Dropdown.stories.d.ts +32 -0
  21. package/dist/components/Dropdown/types.d.ts +13 -0
  22. package/dist/components/EmptyState/EmptyState.stories.d.ts +54 -0
  23. package/dist/components/EmptyState/types.d.ts +8 -0
  24. package/dist/components/ErrorSummary/types.d.ts +4 -0
  25. package/dist/components/FormGroup/FormGroup.stories.d.ts +42 -0
  26. package/dist/components/FormGroup/FormGroup.test.d.ts +1 -0
  27. package/dist/components/Heading/Heading.stories.d.ts +32 -0
  28. package/dist/components/Heading/Heading.test.d.ts +1 -0
  29. package/dist/components/Heading/types.d.ts +6 -0
  30. package/dist/components/Input/Input.stories.d.ts +47 -0
  31. package/dist/components/Input/Input.test.d.ts +1 -0
  32. package/dist/components/Input/types.d.ts +11 -0
  33. package/dist/components/Modal/Modal.stories.d.ts +45 -0
  34. package/dist/components/Modal/Modal.test.d.ts +1 -0
  35. package/dist/components/ProgressBar/ProgressBar.stories.d.ts +72 -0
  36. package/dist/components/ProgressBar/ProgressBar.test.d.ts +1 -0
  37. package/dist/components/Select/Select.stories.d.ts +41 -0
  38. package/dist/components/Select/Select.test.d.ts +1 -0
  39. package/dist/components/Select/types.d.ts +15 -0
  40. package/dist/components/StatCard/StatCard.stories.d.ts +60 -0
  41. package/dist/components/StatCard/types.d.ts +12 -0
  42. package/dist/components/Tag/Tag.stories.d.ts +26 -0
  43. package/dist/components/Tag/Tag.test.d.ts +1 -0
  44. package/dist/components/Tag/types.d.ts +4 -0
  45. package/dist/components/TextArea/TextArea.stories.d.ts +49 -0
  46. package/dist/components/TextArea/TextArea.test.d.ts +1 -0
  47. package/dist/components/TextArea/types.d.ts +11 -0
  48. package/dist/components/index.d.ts +33 -0
  49. package/dist/core.css +1 -0
  50. package/dist/index.cjs +1 -0
  51. package/dist/index.d.ts +8 -0
  52. package/dist/index.js +1190 -0
  53. package/dist/test/setup.d.ts +1 -0
  54. package/package.json +59 -0
package/dist/index.js ADDED
@@ -0,0 +1,1190 @@
1
+ import { defineComponent as C, openBlock as a, createBlock as W, resolveDynamicComponent as K, mergeProps as fe, toHandlers as ve, withCtx as j, renderSlot as D, createElementBlock as l, createCommentVNode as c, normalizeClass as w, ref as V, computed as M, createElementVNode as n, withModifiers as O, toDisplayString as r, Fragment as L, renderList as A, createTextVNode as Y, watch as Q, onMounted as Z, onBeforeUnmount as ee, Teleport as J, normalizeStyle as U, createVNode as X, onUnmounted as he, Transition as te } from "vue";
2
+ const be = {
3
+ key: 0,
4
+ class: "sr-only"
5
+ }, ye = /* @__PURE__ */ C({
6
+ __name: "Button",
7
+ props: {
8
+ variant: { default: "primary" },
9
+ disabled: { type: Boolean, default: !1 },
10
+ url: {},
11
+ target: { default: "_self" }
12
+ },
13
+ emits: ["click"],
14
+ setup(e, { emit: m }) {
15
+ const t = e, f = m, u = (v) => {
16
+ t.disabled ? (v.preventDefault(), v.stopImmediatePropagation()) : f("click", v);
17
+ };
18
+ return (v, d) => (a(), W(K(e.url ? "a" : "button"), fe({
19
+ href: e.url,
20
+ target: e.url ? e.target : void 0,
21
+ rel: e.url && e.target === "_blank" ? "noopener noreferrer" : void 0,
22
+ class: ["btn", `btn--${e.variant}`, { "btn--disabled": e.disabled }],
23
+ disabled: !e.url && e.disabled,
24
+ "aria-disabled": e.disabled
25
+ }, ve(e.url ? {} : { click: u })), {
26
+ default: j(() => [
27
+ D(v.$slots, "default", {}, void 0, !0),
28
+ e.url && e.target === "_blank" ? (a(), l("span", be, "(opens in new window)")) : c("", !0)
29
+ ]),
30
+ _: 3
31
+ }, 16, ["href", "target", "rel", "class", "disabled", "aria-disabled"]));
32
+ }
33
+ }), x = (e, m) => {
34
+ const t = e.__vccOpts || e;
35
+ for (const [f, u] of m)
36
+ t[f] = u;
37
+ return t;
38
+ }, ge = /* @__PURE__ */ x(ye, [["__scopeId", "data-v-86500989"]]), pe = /* @__PURE__ */ C({
39
+ __name: "Badge",
40
+ props: {
41
+ variant: { default: "primary" },
42
+ size: { default: "medium" }
43
+ },
44
+ setup(e) {
45
+ return (m, t) => (a(), l("span", {
46
+ class: w(["badge", `badge--${e.variant}`, `badge--${e.size}`])
47
+ }, [
48
+ D(m.$slots, "default", {}, void 0, !0)
49
+ ], 2));
50
+ }
51
+ }), ke = /* @__PURE__ */ x(pe, [["__scopeId", "data-v-f310f0d4"]]), $e = { class: "calendar" }, _e = { class: "calendar-header" }, we = { class: "calendar-title" }, Ve = {
52
+ key: 0,
53
+ class: "calendar-body"
54
+ }, De = { class: "calendar-weekdays" }, Ce = { class: "calendar-days" }, xe = ["onClick", "disabled"], Ie = {
55
+ key: 1,
56
+ class: "calendar-picker"
57
+ }, Se = { class: "calendar-picker-grid" }, Be = ["onClick"], Me = {
58
+ key: 2,
59
+ class: "calendar-picker"
60
+ }, Pe = { class: "calendar-picker-nav" }, Te = { class: "calendar-picker-range" }, Oe = { class: "calendar-picker-grid" }, Ee = ["onClick"], Le = /* @__PURE__ */ C({
61
+ __name: "Calendar",
62
+ props: {
63
+ modelValue: {},
64
+ mode: { default: "single" },
65
+ minDate: {},
66
+ maxDate: {},
67
+ disabledDates: {},
68
+ locale: { default: "en-US" },
69
+ firstDayOfWeek: { default: 0 },
70
+ initialDate: {}
71
+ },
72
+ emits: ["update:modelValue"],
73
+ setup(e, { emit: m }) {
74
+ const t = e, f = m, v = (() => {
75
+ if (t.initialDate) {
76
+ const [s, _, i] = t.initialDate.split("-").map(Number);
77
+ return new Date(s, _ - 1, i);
78
+ }
79
+ if (t.modelValue) {
80
+ if (typeof t.modelValue == "string") {
81
+ const [s, _, i] = t.modelValue.split("-").map(Number);
82
+ return new Date(s, _ - 1, i);
83
+ }
84
+ if (typeof t.modelValue == "object" && "start" in t.modelValue && t.modelValue.start) {
85
+ const [s, _, i] = t.modelValue.start.split("-").map(Number);
86
+ return new Date(s, _ - 1, i);
87
+ }
88
+ if (Array.isArray(t.modelValue) && t.modelValue.length > 0) {
89
+ const [s, _, i] = t.modelValue[0].split("-").map(Number);
90
+ return new Date(s, _ - 1, i);
91
+ }
92
+ }
93
+ return /* @__PURE__ */ new Date();
94
+ })(), d = V(v.getMonth()), g = V(v.getFullYear()), o = V(null), h = V(null), b = V(Math.floor(v.getFullYear() / 12) * 12), I = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], R = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], P = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], N = M(() => R[d.value]), $ = M(() => {
95
+ const s = [...P];
96
+ return t.firstDayOfWeek > 0 ? [...s.slice(t.firstDayOfWeek), ...s.slice(0, t.firstDayOfWeek)] : s;
97
+ }), y = M(() => Array.from({ length: 12 }, (s, _) => b.value + _)), p = M(() => {
98
+ const s = b.value, _ = s + 11;
99
+ return `${s} - ${_}`;
100
+ }), S = M(() => {
101
+ const s = [], _ = new Date(g.value, d.value, 1), i = new Date(g.value, d.value + 1, 0);
102
+ let T = _.getDay() - t.firstDayOfWeek;
103
+ T < 0 && (T += 7);
104
+ const G = new Date(g.value, d.value, 0).getDate();
105
+ for (let E = T - 1; E >= 0; E--) {
106
+ const F = new Date(g.value, d.value - 1, G - E);
107
+ s.push(k(F, !1));
108
+ }
109
+ for (let E = 1; E <= i.getDate(); E++) {
110
+ const F = new Date(g.value, d.value, E);
111
+ s.push(k(F, !0));
112
+ }
113
+ const me = 42 - s.length;
114
+ for (let E = 1; E <= me; E++) {
115
+ const F = new Date(g.value, d.value + 1, E);
116
+ s.push(k(F, !1));
117
+ }
118
+ return s;
119
+ }), k = (s, _) => {
120
+ const i = B(s), T = B(/* @__PURE__ */ new Date());
121
+ return {
122
+ date: s,
123
+ dateString: i,
124
+ isCurrentMonth: _,
125
+ isToday: i === T,
126
+ isSelected: q(i),
127
+ isDisabled: z(i),
128
+ isInRange: H(i)
129
+ };
130
+ }, B = (s) => {
131
+ const _ = s.getFullYear(), i = String(s.getMonth() + 1).padStart(2, "0"), T = String(s.getDate()).padStart(2, "0");
132
+ return `${_}-${i}-${T}`;
133
+ }, q = (s) => t.modelValue ? t.mode === "single" ? t.modelValue === s : t.mode === "multiple" && Array.isArray(t.modelValue) ? t.modelValue.includes(s) : t.mode === "range" && typeof t.modelValue == "object" && "start" in t.modelValue ? s === t.modelValue.start || s === t.modelValue.end : !1 : !1, z = (s) => !!(t.minDate && s < t.minDate || t.maxDate && s > t.maxDate || t.disabledDates?.includes(s)), H = (s) => {
134
+ if (t.mode !== "range" || typeof t.modelValue != "object" || !("start" in t.modelValue)) return !1;
135
+ const { start: _, end: i } = t.modelValue;
136
+ return !_ || !i ? !1 : s > _ && s < i;
137
+ }, le = (s) => {
138
+ if (!s.isDisabled) {
139
+ if (t.mode === "single")
140
+ f("update:modelValue", s.dateString);
141
+ else if (t.mode === "multiple") {
142
+ const _ = Array.isArray(t.modelValue) ? [...t.modelValue] : [], i = _.indexOf(s.dateString);
143
+ i > -1 ? _.splice(i, 1) : _.push(s.dateString), f("update:modelValue", _);
144
+ } else if (t.mode === "range")
145
+ if (!h.value)
146
+ h.value = s.dateString, f("update:modelValue", { start: s.dateString, end: s.dateString });
147
+ else {
148
+ const _ = h.value < s.dateString ? h.value : s.dateString, i = h.value < s.dateString ? s.dateString : h.value;
149
+ f("update:modelValue", { start: _, end: i }), h.value = null;
150
+ }
151
+ }
152
+ }, ne = () => {
153
+ d.value === 0 ? (d.value = 11, g.value--) : d.value--;
154
+ }, se = () => {
155
+ d.value === 11 ? (d.value = 0, g.value++) : d.value++;
156
+ }, oe = () => {
157
+ o.value = o.value === "month" ? null : "month";
158
+ }, re = () => {
159
+ o.value !== "year" && (b.value = Math.floor(g.value / 12) * 12), o.value = o.value === "year" ? null : "year";
160
+ }, de = (s) => {
161
+ d.value = s, o.value = null;
162
+ }, ie = (s) => {
163
+ g.value = s, o.value = null;
164
+ }, ce = () => {
165
+ b.value -= 12;
166
+ }, ue = () => {
167
+ b.value += 12;
168
+ };
169
+ return (s, _) => (a(), l("div", $e, [
170
+ n("div", _e, [
171
+ n("button", {
172
+ onClick: O(ne, ["stop"]),
173
+ class: "calendar-nav",
174
+ type: "button"
175
+ }, " ‹ "),
176
+ n("div", we, [
177
+ n("button", {
178
+ onClick: O(oe, ["stop"]),
179
+ class: "calendar-month-btn",
180
+ type: "button"
181
+ }, r(N.value), 1),
182
+ n("button", {
183
+ onClick: O(re, ["stop"]),
184
+ class: "calendar-year-btn",
185
+ type: "button"
186
+ }, r(g.value), 1)
187
+ ]),
188
+ n("button", {
189
+ onClick: O(se, ["stop"]),
190
+ class: "calendar-nav",
191
+ type: "button"
192
+ }, " › ")
193
+ ]),
194
+ o.value ? o.value === "month" ? (a(), l("div", Ie, [
195
+ n("div", Se, [
196
+ (a(), l(L, null, A(I, (i, T) => n("button", {
197
+ key: i,
198
+ onClick: O((G) => de(T), ["stop"]),
199
+ type: "button",
200
+ class: w([
201
+ "calendar-picker-item",
202
+ { "calendar-picker-item--selected": T === d.value }
203
+ ])
204
+ }, r(i), 11, Be)), 64))
205
+ ])
206
+ ])) : o.value === "year" ? (a(), l("div", Me, [
207
+ n("div", Pe, [
208
+ n("button", {
209
+ onClick: O(ce, ["stop"]),
210
+ class: "calendar-nav",
211
+ type: "button"
212
+ }, " ‹ "),
213
+ n("span", Te, r(p.value), 1),
214
+ n("button", {
215
+ onClick: O(ue, ["stop"]),
216
+ class: "calendar-nav",
217
+ type: "button"
218
+ }, " › ")
219
+ ]),
220
+ n("div", Oe, [
221
+ (a(!0), l(L, null, A(y.value, (i) => (a(), l("button", {
222
+ key: i,
223
+ onClick: O((T) => ie(i), ["stop"]),
224
+ type: "button",
225
+ class: w([
226
+ "calendar-picker-item",
227
+ { "calendar-picker-item--selected": i === g.value }
228
+ ])
229
+ }, r(i), 11, Ee))), 128))
230
+ ])
231
+ ])) : c("", !0) : (a(), l("div", Ve, [
232
+ n("div", De, [
233
+ (a(!0), l(L, null, A($.value, (i) => (a(), l("div", {
234
+ key: i,
235
+ class: "calendar-weekday"
236
+ }, r(i), 1))), 128))
237
+ ]),
238
+ n("div", Ce, [
239
+ (a(!0), l(L, null, A(S.value, (i) => (a(), l("button", {
240
+ key: i.dateString,
241
+ onClick: (T) => le(i),
242
+ type: "button",
243
+ disabled: i.isDisabled,
244
+ class: w([
245
+ "calendar-day",
246
+ {
247
+ "calendar-day--other-month": !i.isCurrentMonth,
248
+ "calendar-day--today": i.isToday,
249
+ "calendar-day--selected": i.isSelected,
250
+ "calendar-day--disabled": i.isDisabled,
251
+ "calendar-day--in-range": i.isInRange
252
+ }
253
+ ])
254
+ }, r(i.date.getDate()), 11, xe))), 128))
255
+ ])
256
+ ]))
257
+ ]));
258
+ }
259
+ }), ae = /* @__PURE__ */ x(Le, [["__scopeId", "data-v-446fa187"]]), Ae = {
260
+ key: 0,
261
+ class: "card__header"
262
+ }, Re = { class: "card__body" }, Ne = {
263
+ key: 1,
264
+ class: "card__footer"
265
+ }, qe = /* @__PURE__ */ C({
266
+ __name: "Card",
267
+ props: {
268
+ hoverable: { type: Boolean, default: !1 }
269
+ },
270
+ setup(e) {
271
+ return (m, t) => (a(), l("div", {
272
+ class: w(["card", { "card--hoverable": e.hoverable }])
273
+ }, [
274
+ m.$slots.header ? (a(), l("div", Ae, [
275
+ D(m.$slots, "header", {}, void 0, !0)
276
+ ])) : c("", !0),
277
+ n("div", Re, [
278
+ D(m.$slots, "default", {}, void 0, !0)
279
+ ]),
280
+ m.$slots.footer ? (a(), l("div", Ne, [
281
+ D(m.$slots, "footer", {}, void 0, !0)
282
+ ])) : c("", !0)
283
+ ], 2));
284
+ }
285
+ }), ze = /* @__PURE__ */ x(qe, [["__scopeId", "data-v-3c027648"]]), Ye = { class: "checkbox-wrapper" }, Fe = ["checked", "disabled", "required"], We = {
286
+ key: 0,
287
+ class: "checkbox-text"
288
+ }, He = {
289
+ key: 0,
290
+ class: "checkbox-error"
291
+ }, Ue = /* @__PURE__ */ C({
292
+ __name: "Checkbox",
293
+ props: {
294
+ modelValue: { type: Boolean, default: !1 },
295
+ label: {},
296
+ disabled: { type: Boolean, default: !1 },
297
+ required: { type: Boolean, default: !1 },
298
+ error: {}
299
+ },
300
+ emits: ["update:modelValue"],
301
+ setup(e, { emit: m }) {
302
+ const t = m, f = (u) => {
303
+ const v = u.target;
304
+ t("update:modelValue", v.checked);
305
+ };
306
+ return (u, v) => (a(), l("div", Ye, [
307
+ n("label", {
308
+ class: w(["checkbox-label", { "checkbox-label--disabled": e.disabled }])
309
+ }, [
310
+ n("input", {
311
+ type: "checkbox",
312
+ class: "checkbox-input",
313
+ checked: e.modelValue,
314
+ disabled: e.disabled,
315
+ required: e.required,
316
+ onChange: f
317
+ }, null, 40, Fe),
318
+ v[0] || (v[0] = n("span", { class: "checkbox-box" }, null, -1)),
319
+ e.label ? (a(), l("span", We, r(e.label), 1)) : c("", !0)
320
+ ], 2),
321
+ e.error ? (a(), l("span", He, r(e.error), 1)) : c("", !0)
322
+ ]));
323
+ }
324
+ }), je = /* @__PURE__ */ x(Ue, [["__scopeId", "data-v-a2254693"]]), Je = { class: "data-table" }, Xe = { class: "data-table__wrapper" }, Ge = { class: "data-table__table" }, Ke = { class: "data-table__head" }, Qe = ["onClick"], Ze = { class: "data-table__header-content" }, et = {
325
+ key: 0,
326
+ class: "data-table__sort-icon"
327
+ }, tt = { key: 0 }, at = {
328
+ key: 1,
329
+ class: "data-table__sort-icon--inactive"
330
+ }, lt = { key: 0 }, nt = ["colspan"], st = /* @__PURE__ */ C({
331
+ __name: "DataTable",
332
+ props: {
333
+ columns: {},
334
+ data: {},
335
+ hoverable: { type: Boolean, default: !0 },
336
+ emptyText: { default: "No data available" }
337
+ },
338
+ setup(e) {
339
+ const m = e, t = V(null), f = V("asc"), u = (d) => {
340
+ t.value === d ? f.value = f.value === "asc" ? "desc" : "asc" : (t.value = d, f.value = "asc");
341
+ }, v = M(() => t.value ? [...m.data].sort((d, g) => {
342
+ const o = d[t.value], h = g[t.value];
343
+ if (o === h) return 0;
344
+ let b = 0;
345
+ return typeof o == "number" && typeof h == "number" ? b = o - h : b = String(o).localeCompare(String(h)), f.value === "asc" ? b : -b;
346
+ }) : m.data);
347
+ return (d, g) => (a(), l("div", Je, [
348
+ n("div", Xe, [
349
+ n("table", Ge, [
350
+ n("thead", Ke, [
351
+ n("tr", null, [
352
+ (a(!0), l(L, null, A(e.columns, (o) => (a(), l("th", {
353
+ key: o.key,
354
+ class: w(["data-table__header", { "data-table__header--sortable": o.sortable }]),
355
+ onClick: (h) => o.sortable ? u(o.key) : void 0
356
+ }, [
357
+ n("div", Ze, [
358
+ Y(r(o.label) + " ", 1),
359
+ o.sortable ? (a(), l("span", et, [
360
+ t.value === o.key ? (a(), l("span", tt, r(f.value === "asc" ? "↑" : "↓"), 1)) : (a(), l("span", at, "↕"))
361
+ ])) : c("", !0)
362
+ ])
363
+ ], 10, Qe))), 128))
364
+ ])
365
+ ]),
366
+ n("tbody", null, [
367
+ (a(!0), l(L, null, A(v.value, (o, h) => (a(), l("tr", {
368
+ key: h,
369
+ class: "data-table__row"
370
+ }, [
371
+ (a(!0), l(L, null, A(e.columns, (b) => (a(), l("td", {
372
+ key: b.key,
373
+ class: "data-table__cell"
374
+ }, [
375
+ D(d.$slots, `cell-${b.key}`, {
376
+ row: o,
377
+ value: o[b.key]
378
+ }, () => [
379
+ Y(r(o[b.key]), 1)
380
+ ], !0)
381
+ ]))), 128))
382
+ ]))), 128)),
383
+ v.value.length === 0 ? (a(), l("tr", lt, [
384
+ n("td", {
385
+ colspan: e.columns.length,
386
+ class: "data-table__cell data-table__cell--empty"
387
+ }, r(e.emptyText), 9, nt)
388
+ ])) : c("", !0)
389
+ ])
390
+ ])
391
+ ])
392
+ ]));
393
+ }
394
+ }), ot = /* @__PURE__ */ x(st, [["__scopeId", "data-v-511dc0a4"]]), rt = ["id", "value", "placeholder", "disabled"], dt = {
395
+ key: 0,
396
+ class: "date-error"
397
+ }, it = /* @__PURE__ */ C({
398
+ __name: "DatePicker",
399
+ props: {
400
+ modelValue: {},
401
+ id: {},
402
+ placeholder: { default: "Select date" },
403
+ disabled: { type: Boolean },
404
+ format: { default: "short" },
405
+ error: {},
406
+ mode: { default: "single" },
407
+ minDate: {},
408
+ maxDate: {},
409
+ disabledDates: {},
410
+ locale: {},
411
+ firstDayOfWeek: { default: 0 },
412
+ initialDate: {}
413
+ },
414
+ emits: ["update:modelValue"],
415
+ setup(e, { emit: m }) {
416
+ const t = e, f = m, u = V(!1);
417
+ let v = 0;
418
+ const d = `date-input-${++v}`, g = M(() => t.id || d), o = V(null), h = V(null), b = V({
419
+ top: "0px",
420
+ left: "0px",
421
+ width: "320px"
422
+ }), I = V(t.modelValue);
423
+ Q(() => t.modelValue, (k) => {
424
+ I.value = k;
425
+ }, { immediate: !0 });
426
+ const R = M(() => {
427
+ if (!t.modelValue) return "";
428
+ if (t.mode === "single" && typeof t.modelValue == "string")
429
+ return P(t.modelValue);
430
+ if (t.mode === "multiple" && Array.isArray(t.modelValue))
431
+ return t.modelValue.map((k) => P(k)).join(", ");
432
+ if (t.mode === "range" && typeof t.modelValue == "object" && "start" in t.modelValue) {
433
+ const { start: k, end: B } = t.modelValue;
434
+ if (k && B)
435
+ return `${P(k)} - ${P(B)}`;
436
+ if (k) return P(k);
437
+ }
438
+ return "";
439
+ }), P = (k) => {
440
+ const [B, q, z] = k.split("-").map(Number), H = new Date(B, q - 1, z);
441
+ return t.format === "long" ? H.toLocaleDateString("en-US", {
442
+ year: "numeric",
443
+ month: "long",
444
+ day: "numeric"
445
+ }) : H.toLocaleDateString("en-US", {
446
+ year: "numeric",
447
+ month: "short",
448
+ day: "numeric"
449
+ });
450
+ }, N = () => {
451
+ t.disabled || (u.value ? y() : $());
452
+ }, $ = () => {
453
+ u.value = !0, setTimeout(() => {
454
+ if (o.value) {
455
+ const k = o.value.getBoundingClientRect(), q = window.innerHeight - k.bottom, z = 400;
456
+ q < z && k.top > z ? b.value = {
457
+ top: `${k.top - z + window.scrollY}px`,
458
+ left: `${k.left + window.scrollX}px`,
459
+ width: "320px"
460
+ } : b.value = {
461
+ top: `${k.bottom + 4 + window.scrollY}px`,
462
+ left: `${k.left + window.scrollX}px`,
463
+ width: "320px"
464
+ };
465
+ }
466
+ }, 0);
467
+ }, y = () => {
468
+ u.value = !1;
469
+ }, p = (k) => {
470
+ I.value = k, f("update:modelValue", k), t.mode === "single" && setTimeout(() => {
471
+ y();
472
+ }, 200), t.mode === "range" && typeof k == "object" && "start" in k && k.end && setTimeout(() => {
473
+ y();
474
+ }, 200);
475
+ }, S = (k) => {
476
+ if (!u.value) return;
477
+ const B = k.target;
478
+ o.value?.contains(B) || h.value?.contains(B) || y();
479
+ };
480
+ return Z(() => {
481
+ document.addEventListener("click", S);
482
+ }), ee(() => {
483
+ document.removeEventListener("click", S);
484
+ }), (k, B) => (a(), l("div", {
485
+ class: "date-picker",
486
+ ref_key: "datePickerRef",
487
+ ref: o
488
+ }, [
489
+ n("div", {
490
+ class: "date-picker-input",
491
+ onClick: N
492
+ }, [
493
+ n("input", {
494
+ type: "text",
495
+ id: g.value,
496
+ value: R.value,
497
+ placeholder: e.placeholder,
498
+ readonly: "",
499
+ disabled: e.disabled,
500
+ class: w(["date-input", { "date-input--error": e.error }])
501
+ }, null, 10, rt),
502
+ B[1] || (B[1] = n("span", { class: "date-icon" }, "📅", -1))
503
+ ]),
504
+ e.error ? (a(), l("span", dt, r(e.error), 1)) : c("", !0),
505
+ (a(), W(J, { to: "body" }, [
506
+ u.value ? (a(), l("div", {
507
+ key: 0,
508
+ ref_key: "dropdownRef",
509
+ ref: h,
510
+ class: "date-picker-dropdown",
511
+ style: U(b.value)
512
+ }, [
513
+ X(ae, {
514
+ modelValue: I.value,
515
+ "onUpdate:modelValue": [
516
+ B[0] || (B[0] = (q) => I.value = q),
517
+ p
518
+ ],
519
+ mode: e.mode,
520
+ "min-date": e.minDate,
521
+ "max-date": e.maxDate,
522
+ "disabled-dates": e.disabledDates,
523
+ "first-day-of-week": e.firstDayOfWeek,
524
+ "initial-date": typeof e.modelValue == "string" ? e.modelValue : void 0
525
+ }, null, 8, ["modelValue", "mode", "min-date", "max-date", "disabled-dates", "first-day-of-week", "initial-date"])
526
+ ], 4)) : c("", !0)
527
+ ])),
528
+ u.value ? (a(), l("div", {
529
+ key: 1,
530
+ class: "date-picker-overlay",
531
+ onClick: y
532
+ })) : c("", !0)
533
+ ], 512));
534
+ }
535
+ }), ct = /* @__PURE__ */ x(it, [["__scopeId", "data-v-0b550c0b"]]), ut = {
536
+ key: 0,
537
+ class: "dropdown__header"
538
+ }, mt = { class: "dropdown__content" }, ft = {
539
+ key: 0,
540
+ class: "dropdown__divider"
541
+ }, vt = ["disabled", "onClick"], ht = {
542
+ key: 0,
543
+ class: "dropdown__item-icon"
544
+ }, bt = { class: "dropdown__item-label" }, yt = {
545
+ key: 1,
546
+ class: "dropdown__footer"
547
+ }, gt = /* @__PURE__ */ C({
548
+ __name: "Dropdown",
549
+ props: {
550
+ items: { default: () => [] },
551
+ placement: { default: "bottom-left" },
552
+ closeOnClick: { type: Boolean, default: !0 },
553
+ disabled: { type: Boolean, default: !1 }
554
+ },
555
+ emits: ["select", "open", "close"],
556
+ setup(e, { emit: m }) {
557
+ const t = e, f = m, u = V(null), v = V(null), d = V(!1), g = V({}), o = () => {
558
+ t.disabled || (d.value ? b() : h());
559
+ }, h = () => {
560
+ d.value = !0, f("open"), setTimeout(() => {
561
+ I();
562
+ }, 0);
563
+ }, b = () => {
564
+ d.value = !1, f("close");
565
+ }, I = () => {
566
+ if (!u.value || !v.value) return;
567
+ const $ = u.value.getBoundingClientRect(), y = v.value.getBoundingClientRect();
568
+ let p = 0, S = 0;
569
+ switch (t.placement) {
570
+ case "bottom-left":
571
+ p = $.bottom + 8, S = $.left;
572
+ break;
573
+ case "bottom-right":
574
+ p = $.bottom + 8, S = $.right - y.width;
575
+ break;
576
+ case "top-left":
577
+ p = $.top - y.height - 8, S = $.left;
578
+ break;
579
+ case "top-right":
580
+ p = $.top - y.height - 8, S = $.right - y.width;
581
+ break;
582
+ }
583
+ g.value = {
584
+ top: `${p}px`,
585
+ left: `${S}px`
586
+ };
587
+ }, R = ($) => {
588
+ $.disabled || (f("select", $), t.closeOnClick && b());
589
+ }, P = ($) => {
590
+ $.stopPropagation();
591
+ }, N = ($) => {
592
+ if (!u.value || !v.value) return;
593
+ const y = $.target;
594
+ !u.value.contains(y) && !v.value.contains(y) && b();
595
+ };
596
+ return Z(() => {
597
+ document.addEventListener("click", N), window.addEventListener("scroll", I, !0), window.addEventListener("resize", I);
598
+ }), he(() => {
599
+ document.removeEventListener("click", N), window.removeEventListener("scroll", I, !0), window.removeEventListener("resize", I);
600
+ }), ($, y) => (a(), l("div", {
601
+ ref_key: "dropdownRef",
602
+ ref: u,
603
+ class: w(["dropdown", { "dropdown--disabled": e.disabled }])
604
+ }, [
605
+ n("div", {
606
+ onClick: o,
607
+ class: "dropdown__trigger"
608
+ }, [
609
+ D($.$slots, "trigger", {}, () => [
610
+ y[0] || (y[0] = n("button", {
611
+ type: "button",
612
+ class: "dropdown__button"
613
+ }, " Menu ", -1))
614
+ ], !0)
615
+ ]),
616
+ (a(), W(J, { to: "body" }, [
617
+ X(te, { name: "dropdown-fade" }, {
618
+ default: j(() => [
619
+ d.value ? (a(), l("div", {
620
+ key: 0,
621
+ ref_key: "dropdownMenuRef",
622
+ ref: v,
623
+ class: w(["dropdown__menu", `dropdown__menu--${e.placement}`]),
624
+ style: U(g.value),
625
+ onClick: P
626
+ }, [
627
+ $.$slots.header ? (a(), l("div", ut, [
628
+ D($.$slots, "header", {}, void 0, !0)
629
+ ])) : c("", !0),
630
+ n("div", mt, [
631
+ D($.$slots, "default", {}, () => [
632
+ (a(!0), l(L, null, A(e.items, (p, S) => (a(), l(L, { key: S }, [
633
+ p.divider ? (a(), l("div", ft)) : (a(), l("button", {
634
+ key: 1,
635
+ type: "button",
636
+ class: w(["dropdown__item", { "dropdown__item--disabled": p.disabled }]),
637
+ disabled: p.disabled,
638
+ onClick: () => R(p)
639
+ }, [
640
+ p.icon ? (a(), l("span", ht, r(p.icon), 1)) : c("", !0),
641
+ n("span", bt, r(p.label), 1)
642
+ ], 10, vt))
643
+ ], 64))), 128))
644
+ ], !0)
645
+ ]),
646
+ $.$slots.footer ? (a(), l("div", yt, [
647
+ D($.$slots, "footer", {}, void 0, !0)
648
+ ])) : c("", !0)
649
+ ], 6)) : c("", !0)
650
+ ]),
651
+ _: 3
652
+ })
653
+ ]))
654
+ ], 2));
655
+ }
656
+ }), pt = /* @__PURE__ */ x(gt, [["__scopeId", "data-v-d2e8b407"]]), kt = {
657
+ key: 0,
658
+ class: "empty-state__icon"
659
+ }, $t = { class: "empty-state__icon-text" }, _t = { class: "empty-state__content" }, wt = {
660
+ key: 0,
661
+ class: "empty-state__title"
662
+ }, Vt = {
663
+ key: 1,
664
+ class: "empty-state__description"
665
+ }, Dt = {
666
+ key: 2,
667
+ class: "empty-state__body"
668
+ }, Ct = {
669
+ key: 1,
670
+ class: "empty-state__actions"
671
+ }, xt = /* @__PURE__ */ C({
672
+ __name: "EmptyState",
673
+ props: {
674
+ title: { default: "" },
675
+ description: { default: "" },
676
+ icon: { default: "" },
677
+ actionText: { default: "" },
678
+ actionVariant: { default: "primary" },
679
+ size: { default: "medium" }
680
+ },
681
+ emits: ["action"],
682
+ setup(e, { emit: m }) {
683
+ const t = m, f = () => {
684
+ t("action");
685
+ };
686
+ return (u, v) => (a(), l("div", {
687
+ class: w(["empty-state", `empty-state--${e.size}`])
688
+ }, [
689
+ e.icon || u.$slots.icon ? (a(), l("div", kt, [
690
+ D(u.$slots, "icon", {}, () => [
691
+ n("span", $t, r(e.icon), 1)
692
+ ], !0)
693
+ ])) : c("", !0),
694
+ n("div", _t, [
695
+ e.title || u.$slots.title ? (a(), l("h3", wt, [
696
+ D(u.$slots, "title", {}, () => [
697
+ Y(r(e.title), 1)
698
+ ], !0)
699
+ ])) : c("", !0),
700
+ e.description || u.$slots.description ? (a(), l("p", Vt, [
701
+ D(u.$slots, "description", {}, () => [
702
+ Y(r(e.description), 1)
703
+ ], !0)
704
+ ])) : c("", !0),
705
+ u.$slots.default ? (a(), l("div", Dt, [
706
+ D(u.$slots, "default", {}, void 0, !0)
707
+ ])) : c("", !0)
708
+ ]),
709
+ e.actionText || u.$slots.action ? (a(), l("div", Ct, [
710
+ D(u.$slots, "action", {}, () => [
711
+ e.actionText ? (a(), l("button", {
712
+ key: 0,
713
+ type: "button",
714
+ class: w(["empty-state__button", `empty-state__button--${e.actionVariant}`]),
715
+ onClick: f
716
+ }, r(e.actionText), 3)) : c("", !0)
717
+ ], !0)
718
+ ])) : c("", !0)
719
+ ], 2));
720
+ }
721
+ }), It = /* @__PURE__ */ x(xt, [["__scopeId", "data-v-05083d32"]]), St = {
722
+ key: 0,
723
+ class: "error-summary",
724
+ role: "alert",
725
+ "aria-live": "assertive"
726
+ }, Bt = { class: "error-summary__header" }, Mt = { class: "error-summary__title" }, Pt = { class: "error-summary__subtitle" }, Tt = { key: 0 }, Ot = { class: "error-summary__list" }, Et = ["href"], Lt = /* @__PURE__ */ C({
727
+ __name: "ErrorSummary",
728
+ props: {
729
+ title: { default: "There is a problem" },
730
+ errors: {}
731
+ },
732
+ setup(e) {
733
+ return (m, t) => e.errors.length ? (a(), l("div", St, [
734
+ n("div", Bt, [
735
+ t[1] || (t[1] = n("span", { class: "error-summary__icon" }, "⚠️", -1)),
736
+ n("div", null, [
737
+ n("h4", Mt, r(e.title), 1),
738
+ n("p", Pt, [
739
+ Y("Please fix the following " + r(e.errors.length) + " issue", 1),
740
+ e.errors.length !== 1 ? (a(), l("span", Tt, "s")) : c("", !0),
741
+ t[0] || (t[0] = Y(":", -1))
742
+ ])
743
+ ])
744
+ ]),
745
+ n("ul", Ot, [
746
+ (a(!0), l(L, null, A(e.errors, (f) => (a(), l("li", {
747
+ key: f.id,
748
+ class: "error-summary__item"
749
+ }, [
750
+ n("a", {
751
+ href: `#${f.id}`,
752
+ class: "error-summary__link"
753
+ }, r(f.message), 9, Et)
754
+ ]))), 128))
755
+ ])
756
+ ])) : c("", !0);
757
+ }
758
+ }), At = /* @__PURE__ */ x(Lt, [["__scopeId", "data-v-2eeef3a2"]]), Rt = ["for"], Nt = {
759
+ key: 1,
760
+ class: "form-group__hint"
761
+ }, qt = {
762
+ key: 2,
763
+ class: "form-group__error"
764
+ }, zt = /* @__PURE__ */ C({
765
+ __name: "FormGroup",
766
+ props: {
767
+ label: { default: "" },
768
+ id: { default: "" },
769
+ hint: { default: "" },
770
+ error: { default: "" },
771
+ required: { type: Boolean, default: !1 }
772
+ },
773
+ setup(e) {
774
+ return (m, t) => (a(), l("div", {
775
+ class: w(["form-group", { "form-group--error": e.error }])
776
+ }, [
777
+ e.label ? (a(), l("label", {
778
+ key: 0,
779
+ for: e.id,
780
+ class: "form-group__label"
781
+ }, r(e.label), 9, Rt)) : c("", !0),
782
+ D(m.$slots, "default", {}, void 0, !0),
783
+ e.hint && !e.error ? (a(), l("small", Nt, r(e.hint), 1)) : c("", !0),
784
+ e.error ? (a(), l("small", qt, r(e.error), 1)) : c("", !0)
785
+ ], 2));
786
+ }
787
+ }), Yt = /* @__PURE__ */ x(zt, [["__scopeId", "data-v-328da37c"]]), Ft = /* @__PURE__ */ C({
788
+ __name: "Heading",
789
+ props: {
790
+ tag: { default: "h2" },
791
+ size: { default: "2" },
792
+ weight: { default: "bold" },
793
+ align: { default: "left" }
794
+ },
795
+ setup(e) {
796
+ return (m, t) => (a(), W(K(e.tag), {
797
+ class: w(["heading", `heading--${e.size}`, `heading--${e.weight}`, { [`heading--${e.align}`]: e.align }])
798
+ }, {
799
+ default: j(() => [
800
+ D(m.$slots, "default", {}, void 0, !0)
801
+ ]),
802
+ _: 3
803
+ }, 8, ["class"]));
804
+ }
805
+ }), Wt = /* @__PURE__ */ x(Ft, [["__scopeId", "data-v-4857de4b"]]), Ht = { class: "input-wrapper" }, Ut = ["for"], jt = ["id", "type", "value", "placeholder", "disabled", "required"], Jt = {
806
+ key: 1,
807
+ class: "input-error"
808
+ }, Xt = {
809
+ key: 2,
810
+ class: "input-hint"
811
+ }, Gt = /* @__PURE__ */ C({
812
+ __name: "Input",
813
+ props: {
814
+ modelValue: {},
815
+ id: {},
816
+ label: {},
817
+ type: { default: "text" },
818
+ placeholder: {},
819
+ disabled: { type: Boolean, default: !1 },
820
+ required: { type: Boolean, default: !1 },
821
+ error: {},
822
+ hint: {}
823
+ },
824
+ emits: ["update:modelValue"],
825
+ setup(e, { emit: m }) {
826
+ let t = 0;
827
+ const f = e, u = m, v = `input-${++t}`, d = M(() => f.id || v), g = (o) => {
828
+ const h = o.target;
829
+ u("update:modelValue", h.value);
830
+ };
831
+ return (o, h) => (a(), l("div", Ht, [
832
+ e.label ? (a(), l("label", {
833
+ key: 0,
834
+ for: d.value,
835
+ class: "input-label"
836
+ }, r(e.label), 9, Ut)) : c("", !0),
837
+ n("input", {
838
+ id: d.value,
839
+ type: e.type,
840
+ value: e.modelValue,
841
+ placeholder: e.placeholder,
842
+ disabled: e.disabled,
843
+ required: e.required,
844
+ class: w(["input-field", { "input-field--error": e.error, "input-field--disabled": e.disabled }]),
845
+ onInput: g
846
+ }, null, 42, jt),
847
+ e.error ? (a(), l("span", Jt, r(e.error), 1)) : c("", !0),
848
+ e.hint && !e.error ? (a(), l("span", Xt, r(e.hint), 1)) : c("", !0)
849
+ ]));
850
+ }
851
+ }), Kt = /* @__PURE__ */ x(Gt, [["__scopeId", "data-v-95616b7b"]]), Qt = { class: "modal-header" }, Zt = { class: "modal-title" }, ea = { class: "modal-body" }, ta = {
852
+ key: 0,
853
+ class: "modal-footer"
854
+ }, aa = /* @__PURE__ */ C({
855
+ __name: "Modal",
856
+ props: {
857
+ modelValue: { type: Boolean },
858
+ title: { default: "" },
859
+ size: { default: "medium" },
860
+ closable: { type: Boolean, default: !0 },
861
+ closeOnOverlay: { type: Boolean, default: !0 }
862
+ },
863
+ emits: ["update:modelValue", "close"],
864
+ setup(e, { emit: m }) {
865
+ const t = e, f = m, u = () => {
866
+ f("update:modelValue", !1), f("close");
867
+ }, v = V(null), d = V(!1), g = V(!1), o = V(0), h = V(0), b = V(null), I = V(null), R = (y) => {
868
+ if (!d.value) return;
869
+ const p = Math.abs(y.clientX - o.value), S = Math.abs(y.clientY - h.value);
870
+ (p > 5 || S > 5) && (g.value = !0);
871
+ }, P = (y) => {
872
+ if (window.removeEventListener("pointermove", R), window.removeEventListener("pointerup", P), !d.value || I.value !== "overlay") {
873
+ d.value = !1, g.value = !1, I.value = null;
874
+ return;
875
+ }
876
+ const p = v.value, S = p && y.target === p;
877
+ t.closeOnOverlay && S && !g.value && u(), p && b.value !== null && p.hasPointerCapture(b.value) && p.releasePointerCapture(b.value), b.value = null, d.value = !1, g.value = !1, I.value = null;
878
+ }, N = (y) => {
879
+ if (!t.closeOnOverlay || y.target !== y.currentTarget) return;
880
+ d.value = !0, g.value = !1, I.value = "overlay", o.value = y.clientX, h.value = y.clientY;
881
+ const p = v.value;
882
+ p && (b.value = y.pointerId, p.setPointerCapture(y.pointerId)), window.addEventListener("pointermove", R), window.addEventListener("pointerup", P);
883
+ }, $ = () => {
884
+ I.value = "content";
885
+ };
886
+ return ee(() => {
887
+ window.removeEventListener("pointermove", R), window.removeEventListener("pointerup", P);
888
+ }), Q(() => t.modelValue, (y) => {
889
+ y ? document.body.style.overflow = "hidden" : document.body.style.overflow = "";
890
+ }), (y, p) => (a(), W(J, { to: "body" }, [
891
+ X(te, { name: "modal" }, {
892
+ default: j(() => [
893
+ e.modelValue ? (a(), l("div", {
894
+ key: 0,
895
+ ref_key: "overlayRef",
896
+ ref: v,
897
+ class: "modal-overlay",
898
+ onPointerdown: O(N, ["self"])
899
+ }, [
900
+ n("div", {
901
+ class: w(["modal-content", [`modal-content--${e.size}`]]),
902
+ onClick: p[0] || (p[0] = O(() => {
903
+ }, ["stop"])),
904
+ onPointerdown: O($, ["stop"]),
905
+ onPointerup: p[1] || (p[1] = O(() => {
906
+ }, ["stop"]))
907
+ }, [
908
+ n("div", Qt, [
909
+ D(y.$slots, "header", {}, () => [
910
+ n("h3", Zt, r(e.title), 1)
911
+ ], !0),
912
+ e.closable ? (a(), l("button", {
913
+ key: 0,
914
+ onClick: u,
915
+ class: "modal-close",
916
+ "aria-label": "Close modal"
917
+ }, " × ")) : c("", !0)
918
+ ]),
919
+ n("div", ea, [
920
+ D(y.$slots, "default", {}, void 0, !0)
921
+ ]),
922
+ y.$slots.footer ? (a(), l("div", ta, [
923
+ D(y.$slots, "footer", {}, void 0, !0)
924
+ ])) : c("", !0)
925
+ ], 34)
926
+ ], 544)) : c("", !0)
927
+ ]),
928
+ _: 3
929
+ })
930
+ ]));
931
+ }
932
+ }), la = /* @__PURE__ */ x(aa, [["__scopeId", "data-v-0621c687"]]), na = { class: "progress-bar" }, sa = {
933
+ key: 0,
934
+ class: "progress-bar__header"
935
+ }, oa = { class: "progress-bar__label" }, ra = { class: "progress-bar__percentage" }, da = {
936
+ key: 0,
937
+ class: "progress-bar__text"
938
+ }, ia = /* @__PURE__ */ C({
939
+ __name: "ProgressBar",
940
+ props: {
941
+ percentage: { default: 0 },
942
+ label: { default: "" },
943
+ showLabel: { type: Boolean, default: !0 },
944
+ showPercentageInBar: { type: Boolean, default: !1 },
945
+ height: { default: 12 },
946
+ variant: { default: "primary" },
947
+ animated: { type: Boolean, default: !0 }
948
+ },
949
+ setup(e) {
950
+ const m = e, t = M(() => Math.min(Math.max(m.percentage, 0), 100)), f = M(() => Math.round(t.value));
951
+ return (u, v) => (a(), l("div", na, [
952
+ e.showLabel ? (a(), l("div", sa, [
953
+ n("span", oa, r(e.label), 1),
954
+ n("span", ra, r(f.value) + "%", 1)
955
+ ])) : c("", !0),
956
+ n("div", {
957
+ class: "progress-bar__track",
958
+ style: U({ height: `${e.height}px` })
959
+ }, [
960
+ n("div", {
961
+ class: w(["progress-bar__fill", [
962
+ `progress-bar__fill--${e.variant}`,
963
+ { "progress-bar__fill--animated": e.animated }
964
+ ]]),
965
+ style: U({ width: `${t.value}%` })
966
+ }, [
967
+ e.showPercentageInBar ? (a(), l("span", da, r(f.value) + "% ", 1)) : c("", !0)
968
+ ], 6)
969
+ ], 4)
970
+ ]));
971
+ }
972
+ }), ca = /* @__PURE__ */ x(ia, [["__scopeId", "data-v-1ee50aa7"]]), ua = { class: "select-wrapper" }, ma = ["for"], fa = ["id", "value", "disabled", "required"], va = {
973
+ key: 0,
974
+ value: "",
975
+ disabled: ""
976
+ }, ha = ["value"], ba = {
977
+ key: 1,
978
+ class: "select-error"
979
+ }, ya = {
980
+ key: 2,
981
+ class: "select-hint"
982
+ }, ga = /* @__PURE__ */ C({
983
+ __name: "Select",
984
+ props: {
985
+ modelValue: {},
986
+ id: {},
987
+ label: {},
988
+ options: { default: () => [] },
989
+ placeholder: {},
990
+ disabled: { type: Boolean, default: !1 },
991
+ required: { type: Boolean, default: !1 },
992
+ error: {},
993
+ hint: {}
994
+ },
995
+ emits: ["update:modelValue"],
996
+ setup(e, { emit: m }) {
997
+ let t = 0;
998
+ const f = e, u = m, v = `select-${++t}`, d = M(() => f.id || v), g = (o) => {
999
+ const h = o.target;
1000
+ u("update:modelValue", h.value);
1001
+ };
1002
+ return (o, h) => (a(), l("div", ua, [
1003
+ e.label ? (a(), l("label", {
1004
+ key: 0,
1005
+ for: d.value,
1006
+ class: "select-label"
1007
+ }, r(e.label), 9, ma)) : c("", !0),
1008
+ n("select", {
1009
+ id: d.value,
1010
+ value: e.modelValue,
1011
+ disabled: e.disabled,
1012
+ required: e.required,
1013
+ class: w([
1014
+ "select-field",
1015
+ {
1016
+ "select-field--error": e.error,
1017
+ "select-field--disabled": e.disabled,
1018
+ "select-field--placeholder": !e.modelValue || e.modelValue === ""
1019
+ }
1020
+ ]),
1021
+ onChange: g
1022
+ }, [
1023
+ e.placeholder ? (a(), l("option", va, r(e.placeholder), 1)) : c("", !0),
1024
+ (a(!0), l(L, null, A(e.options, (b) => (a(), l("option", {
1025
+ key: b.value,
1026
+ value: b.value
1027
+ }, r(b.label), 9, ha))), 128))
1028
+ ], 42, fa),
1029
+ e.error ? (a(), l("span", ba, r(e.error), 1)) : c("", !0),
1030
+ e.hint && !e.error ? (a(), l("span", ya, r(e.hint), 1)) : c("", !0)
1031
+ ]));
1032
+ }
1033
+ }), pa = /* @__PURE__ */ x(ga, [["__scopeId", "data-v-aeafe36b"]]), ka = { class: "stat-card__title" }, $a = {
1034
+ key: 0,
1035
+ class: "stat-card__input-wrapper"
1036
+ }, _a = {
1037
+ key: 0,
1038
+ class: "stat-card__prefix"
1039
+ }, wa = ["value", "placeholder"], Va = {
1040
+ key: 1,
1041
+ class: "stat-card__suffix"
1042
+ }, Da = {
1043
+ key: 1,
1044
+ class: "stat-card__value-wrapper"
1045
+ }, Ca = {
1046
+ key: 0,
1047
+ class: "stat-card__prefix"
1048
+ }, xa = {
1049
+ key: 1,
1050
+ class: "stat-card__suffix"
1051
+ }, Ia = { class: "stat-card__trend-icon" }, Sa = { class: "stat-card__trend-value" }, Ba = /* @__PURE__ */ C({
1052
+ __name: "StatCard",
1053
+ props: {
1054
+ title: {},
1055
+ value: {},
1056
+ variant: { default: "default" },
1057
+ prefix: { default: "" },
1058
+ suffix: { default: "" },
1059
+ editable: { type: Boolean, default: !1 },
1060
+ trend: {}
1061
+ },
1062
+ emits: ["input", "change"],
1063
+ setup(e, { emit: m }) {
1064
+ const t = e, f = m, u = M(() => typeof t.value == "number" ? t.value.toLocaleString() : t.value), v = M(() => typeof t.value == "number" && t.value < 0), d = (o) => {
1065
+ const h = o.target, b = h.valueAsNumber || h.value;
1066
+ f("input", b);
1067
+ }, g = (o) => {
1068
+ const h = o.target, b = h.valueAsNumber || h.value;
1069
+ f("change", b);
1070
+ };
1071
+ return (o, h) => (a(), l("div", {
1072
+ class: w(["stat-card", `stat-card--${e.variant}`])
1073
+ }, [
1074
+ n("h3", ka, r(e.title), 1),
1075
+ e.editable ? (a(), l("div", $a, [
1076
+ e.prefix ? (a(), l("span", _a, r(e.prefix), 1)) : c("", !0),
1077
+ n("input", {
1078
+ value: e.value,
1079
+ onInput: d,
1080
+ onChange: g,
1081
+ type: "number",
1082
+ class: "stat-card__input",
1083
+ placeholder: String(e.value)
1084
+ }, null, 40, wa),
1085
+ e.suffix ? (a(), l("span", Va, r(e.suffix), 1)) : c("", !0)
1086
+ ])) : (a(), l("div", Da, [
1087
+ n("p", {
1088
+ class: w(["stat-card__value", { "stat-card__value--negative": v.value }])
1089
+ }, [
1090
+ e.prefix ? (a(), l("span", Ca, r(e.prefix), 1)) : c("", !0),
1091
+ n("span", null, r(u.value), 1),
1092
+ e.suffix ? (a(), l("span", xa, r(e.suffix), 1)) : c("", !0)
1093
+ ], 2),
1094
+ e.trend ? (a(), l("div", {
1095
+ key: 0,
1096
+ class: w(["stat-card__trend", `stat-card__trend--${e.trend.direction}`])
1097
+ }, [
1098
+ n("span", Ia, r(e.trend.direction === "up" ? "↑" : "↓"), 1),
1099
+ n("span", Sa, r(Math.abs(e.trend.value)) + "%", 1)
1100
+ ], 2)) : c("", !0)
1101
+ ])),
1102
+ D(o.$slots, "footer", {}, void 0, !0)
1103
+ ], 2));
1104
+ }
1105
+ }), Ma = /* @__PURE__ */ x(Ba, [["__scopeId", "data-v-7858d875"]]), Pa = /* @__PURE__ */ C({
1106
+ __name: "Tag",
1107
+ props: {
1108
+ variant: { default: "default" },
1109
+ size: { default: "medium" }
1110
+ },
1111
+ setup(e) {
1112
+ return (m, t) => (a(), l("span", {
1113
+ class: w(["tag", `tag--${e.variant}`, `tag--${e.size}`])
1114
+ }, [
1115
+ D(m.$slots, "default", {}, void 0, !0)
1116
+ ], 2));
1117
+ }
1118
+ }), Ta = /* @__PURE__ */ x(Pa, [["__scopeId", "data-v-df5365be"]]), Oa = { class: "textarea-wrapper" }, Ea = ["for"], La = ["id", "value", "placeholder", "disabled", "required", "rows"], Aa = {
1119
+ key: 1,
1120
+ class: "textarea-error"
1121
+ }, Ra = {
1122
+ key: 2,
1123
+ class: "textarea-hint"
1124
+ }, Na = /* @__PURE__ */ C({
1125
+ __name: "TextArea",
1126
+ props: {
1127
+ modelValue: {},
1128
+ id: {},
1129
+ label: {},
1130
+ placeholder: {},
1131
+ disabled: { type: Boolean, default: !1 },
1132
+ required: { type: Boolean, default: !1 },
1133
+ rows: { default: 4 },
1134
+ error: {},
1135
+ hint: {}
1136
+ },
1137
+ emits: ["update:modelValue"],
1138
+ setup(e, { emit: m }) {
1139
+ let t = 0;
1140
+ const f = e, u = m, v = `textarea-${++t}`, d = M(() => f.id || v), g = (o) => {
1141
+ const h = o.target;
1142
+ u("update:modelValue", h.value);
1143
+ };
1144
+ return (o, h) => (a(), l("div", Oa, [
1145
+ e.label ? (a(), l("label", {
1146
+ key: 0,
1147
+ for: d.value,
1148
+ class: "textarea-label"
1149
+ }, r(e.label), 9, Ea)) : c("", !0),
1150
+ n("textarea", {
1151
+ id: d.value,
1152
+ value: e.modelValue,
1153
+ placeholder: e.placeholder,
1154
+ disabled: e.disabled,
1155
+ required: e.required,
1156
+ rows: e.rows,
1157
+ class: w(["textarea-field", { "textarea-field--error": e.error, "textarea-field--disabled": e.disabled }]),
1158
+ onInput: g
1159
+ }, null, 42, La),
1160
+ e.error ? (a(), l("span", Aa, r(e.error), 1)) : c("", !0),
1161
+ e.hint && !e.error ? (a(), l("span", Ra, r(e.hint), 1)) : c("", !0)
1162
+ ]));
1163
+ }
1164
+ }), qa = /* @__PURE__ */ x(Na, [["__scopeId", "data-v-00775f79"]]), Ya = {
1165
+ install(e) {
1166
+ e.component("VBadge", ke), e.component("VButton", ge), e.component("VCalendar", ae), e.component("VCard", ze), e.component("VCheckbox", je), e.component("VDataTable", ot), e.component("VDatePicker", ct), e.component("VDropdown", pt), e.component("VEmptyState", It), e.component("VErrorSummary", At), e.component("VFormGroup", Yt), e.component("VHeading", Wt), e.component("VInput", Kt), e.component("VModal", la), e.component("VProgressBar", ca), e.component("VSelect", pa), e.component("VStatCard", Ma), e.component("VTag", Ta), e.component("VTextArea", qa);
1167
+ }
1168
+ };
1169
+ export {
1170
+ ke as VBadge,
1171
+ ge as VButton,
1172
+ ae as VCalendar,
1173
+ ze as VCard,
1174
+ je as VCheckbox,
1175
+ ot as VDataTable,
1176
+ ct as VDatePicker,
1177
+ pt as VDropdown,
1178
+ It as VEmptyState,
1179
+ At as VErrorSummary,
1180
+ Yt as VFormGroup,
1181
+ Wt as VHeading,
1182
+ Kt as VInput,
1183
+ la as VModal,
1184
+ ca as VProgressBar,
1185
+ pa as VSelect,
1186
+ Ma as VStatCard,
1187
+ Ta as VTag,
1188
+ qa as VTextArea,
1189
+ Ya as default
1190
+ };