@davidbirchall/core 1.0.4 → 1.0.6

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