@wishbone-media/spark 0.5.0 → 0.5.2

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.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { computed as y, resolveComponent as h, createElementBlock as c, openBlock as r, normalizeClass as g, createElementVNode as s, createVNode as u, unref as l, renderSlot as Y, Fragment as D, renderList as S, createCommentVNode as x, toDisplayString as M, reactive as k, ref as E, inject as te, provide as se, markRaw as J, createBlock as z, withCtx as B, resolveDynamicComponent as T, mergeProps as q, toHandlers as F, createTextVNode as Q, withModifiers as P } from "vue";
1
+ import { computed as y, resolveComponent as C, createElementBlock as i, openBlock as r, normalizeClass as g, createElementVNode as s, createVNode as u, unref as c, renderSlot as M, Fragment as D, renderList as S, createCommentVNode as x, toDisplayString as h, reactive as k, ref as E, inject as te, provide as se, markRaw as J, createBlock as Y, withCtx as B, resolveDynamicComponent as T, mergeProps as q, toHandlers as F, createTextVNode as Q, withModifiers as P } from "vue";
2
2
  import { library as N } from "@fortawesome/fontawesome-svg-core";
3
3
  import { FontAwesomeIcon as ne } from "@fortawesome/vue-fontawesome";
4
- import { faXmark as ae, faTimes as oe, faStreetView as re, faSortUp as le, faSortDown as ie, faSort as ce, faScaleBalanced as Ae, faSatelliteDish as me, faLayerPlus as fe, faLaptopMobile as de, faInfoCircle as ue, faGripDotsVertical as ve, faGearComplex as ge, faFlag as pe, faFaceSmileWink as xe, faFaceSmileRelaxed as ye, faExclamationTriangle as Be, faEllipsisVertical as be, faEllipsis as we, faEdit as Me, faComments as he, faCircleXmark as Ce, faCircleUser as ze, faChevronUp as Ye, faChevronRight as De, faChevronLeft as Pe, faChevronDown as He, faCheckCircle as Se, faCheck as Ee, faBullhorn as ke, faBellRing as Qe, faBarsSort as Ge, faArrowRightToLine as Ze, faArrowLeftToLine as je } from "@fortawesome/pro-regular-svg-icons";
4
+ import { faXmark as ae, faTimes as oe, faStreetView as re, faSortUp as le, faSortDown as ie, faSort as ce, faScaleBalanced as Ae, faSatelliteDish as me, faLayerPlus as de, faLaptopMobile as fe, faInfoCircle as ue, faGripDotsVertical as ve, faGearComplex as ge, faFlag as pe, faFaceSmileWink as xe, faFaceSmileRelaxed as ye, faExclamationTriangle as Be, faEllipsisVertical as be, faEllipsis as we, faEdit as he, faComments as Me, faCircleXmark as Ce, faCircleUser as ze, faChevronUp as Ye, faChevronRight as De, faChevronLeft as Pe, faChevronDown as He, faCheckCircle as Se, faCheck as Ee, faBullhorn as ke, faBellRing as Qe, faBarsSort as Ge, faArrowRightToLine as Ze, faArrowLeftToLine as je } from "@fortawesome/pro-regular-svg-icons";
5
5
  import { defineStore as I } from "pinia";
6
6
  import { TransitionRoot as U, Dialog as R, TransitionChild as G, DialogPanel as X } from "@headlessui/vue";
7
7
  import { useRouter as Ie } from "vue-router";
@@ -19,8 +19,8 @@ const b = {
19
19
  farChevronUp: Ye,
20
20
  farCircleUser: ze,
21
21
  farCircleXmark: Ce,
22
- farComments: he,
23
- farEdit: Me,
22
+ farComments: Me,
23
+ farEdit: he,
24
24
  farEllipsis: we,
25
25
  farEllipsisVertical: be,
26
26
  farExclamationTriangle: Be,
@@ -30,8 +30,8 @@ const b = {
30
30
  farGearComplex: ge,
31
31
  farGripDotsVertical: ve,
32
32
  farInfoCircle: ue,
33
- farLaptopMobile: de,
34
- farLayerPlus: fe,
33
+ farLaptopMobile: fe,
34
+ farLayerPlus: de,
35
35
  farSatelliteDish: me,
36
36
  farScaleBalanced: Ae,
37
37
  farSort: ce,
@@ -41,13 +41,13 @@ const b = {
41
41
  farTimes: oe,
42
42
  farXmark: ae
43
43
  };
44
- function ys() {
45
- N.add(...Object.values(b));
46
- }
47
44
  function Bs(e) {
45
+ Object.assign(b, e), N.add(...Object.values(e));
46
+ }
47
+ function bs(e) {
48
48
  N.add(...Object.values(b)), e.component("FontAwesomeIcon", ne);
49
49
  }
50
- const Le = { class: "flex items-center" }, We = { class: "shrink-0 self-start" }, Oe = { class: "ml-3" }, Je = { class: "ml-auto pl-3 pt-1 self-start" }, Te = { class: "-mx-1.5 -my-1.5" }, bs = {
50
+ const Le = { class: "flex items-center" }, We = { class: "shrink-0 self-start" }, Oe = { class: "ml-3" }, Je = { class: "ml-auto pl-3 pt-1 self-start" }, Te = { class: "-mx-1.5 -my-1.5" }, ws = {
51
51
  __name: "SparkAlert",
52
52
  props: {
53
53
  type: {
@@ -63,12 +63,12 @@ const Le = { class: "flex items-center" }, We = { class: "shrink-0 self-start" }
63
63
  warning: "bg-yellow-50 border-yellow-200 text-yellow-700",
64
64
  danger: "bg-red-50 border-red-200 text-red-700",
65
65
  info: "bg-blue-50 border-blue-200 text-blue-700"
66
- })[a.type]), i = y(() => ({
66
+ })[a.type]), A = y(() => ({
67
67
  success: "text-green-400",
68
68
  warning: "text-yellow-400",
69
69
  danger: "text-red-400",
70
70
  info: "text-blue-400"
71
- })[a.type]), d = y(() => ({
71
+ })[a.type]), f = y(() => ({
72
72
  success: "farCheckCircle",
73
73
  warning: "farExclamationTriangle",
74
74
  danger: "farCircleXmark",
@@ -79,30 +79,30 @@ const Le = { class: "flex items-center" }, We = { class: "shrink-0 self-start" }
79
79
  danger: "text-red-400 hover:bg-red-100",
80
80
  info: "text-blue-400 hover:bg-blue-100"
81
81
  })[a.type]);
82
- return (m, f) => {
83
- const t = h("font-awesome-icon");
84
- return r(), c("div", {
82
+ return (d, l) => {
83
+ const t = C("font-awesome-icon");
84
+ return r(), i("div", {
85
85
  class: g(["rounded-md border p-4", n.value])
86
86
  }, [
87
87
  s("div", Le, [
88
88
  s("div", We, [
89
89
  u(t, {
90
- icon: l(b)[d.value],
91
- class: g(i.value)
90
+ icon: c(b)[f.value],
91
+ class: g(A.value)
92
92
  }, null, 8, ["icon", "class"])
93
93
  ]),
94
94
  s("div", Oe, [
95
- Y(m.$slots, "default")
95
+ M(d.$slots, "default")
96
96
  ]),
97
97
  s("div", Je, [
98
98
  s("div", Te, [
99
99
  s("button", {
100
100
  type: "button",
101
101
  class: g(["inline-flex rounded-md px-2 py-1.5", v.value]),
102
- onClick: f[0] || (f[0] = (o) => m.$emit("close"))
102
+ onClick: l[0] || (l[0] = (o) => d.$emit("close"))
103
103
  }, [
104
104
  u(t, {
105
- icon: l(b).farXmark
105
+ icon: c(b).farXmark
106
106
  }, null, 8, ["icon"])
107
107
  ], 2)
108
108
  ])
@@ -167,49 +167,49 @@ const Le = { class: "flex items-center" }, We = { class: "shrink-0 self-start" }
167
167
  },
168
168
  emits: ["close", "select"],
169
169
  setup(e, { emit: a }) {
170
- const n = e, i = a, d = y(() => n.appItems.map((m) => ({
171
- ...m,
172
- current: m.name === n.currentApp
173
- }))), v = (m) => {
174
- window.open(m.href, "_blank"), i("select", m);
170
+ const n = e, A = a, f = y(() => n.appItems.map((d) => ({
171
+ ...d,
172
+ current: d.name === n.currentApp
173
+ }))), v = (d) => {
174
+ window.open(d.href, "_blank"), A("select", d);
175
175
  };
176
- return (m, f) => {
177
- const t = h("font-awesome-icon");
178
- return r(), c("div", qe, [
176
+ return (d, l) => {
177
+ const t = C("font-awesome-icon");
178
+ return r(), i("div", qe, [
179
179
  s("div", Fe, [
180
180
  s("div", Ne, [
181
181
  s("div", Ue, [
182
- f[1] || (f[1] = s("div", null, "Mr Group Network", -1)),
182
+ l[1] || (l[1] = s("div", null, "Mr Group Network", -1)),
183
183
  s("div", Re, [
184
184
  u(t, {
185
- icon: l(b).farTimes,
185
+ icon: c(b).farTimes,
186
186
  class: "h-[15px] w-[15px] shrink-0 text-gray-400 cursor-pointer",
187
- onClick: f[0] || (f[0] = (o) => i("close"))
187
+ onClick: l[0] || (l[0] = (o) => A("close"))
188
188
  }, null, 8, ["icon"])
189
189
  ])
190
190
  ]),
191
- (r(!0), c(D, null, S(d.value, (o) => (r(), c("div", {
191
+ (r(!0), i(D, null, S(f.value, (o) => (r(), i("div", {
192
192
  key: o.name,
193
193
  class: g([o.current ? "bg-gray-50" : "hover:bg-gray-50", "flex px-[22px] py-[15px] cursor-pointer"]),
194
194
  onClick: (p) => v(o)
195
195
  }, [
196
196
  s("div", Ke, [
197
197
  s("div", Ve, [
198
- s("div", _e, M(o.name), 1),
199
- o.current ? (r(), c("span", $e, " Active ")) : x("", !0)
198
+ s("div", _e, h(o.name), 1),
199
+ o.current ? (r(), i("span", $e, " Active ")) : x("", !0)
200
200
  ]),
201
- s("div", et, M(o.description), 1)
201
+ s("div", et, h(o.description), 1)
202
202
  ]),
203
203
  s("div", tt, [
204
204
  u(t, {
205
205
  class: g([o.current ? "text-gray-700" : "text-gray-400", "h-5 w-5 shrink-0"]),
206
- icon: l(b)[o.icon]
206
+ icon: c(b)[o.icon]
207
207
  }, null, 8, ["class", "icon"])
208
208
  ])
209
209
  ], 10, Xe))), 128)),
210
- f[2] || (f[2] = s("div", null, null, -1))
210
+ l[2] || (l[2] = s("div", null, null, -1))
211
211
  ]),
212
- f[3] || (f[3] = s("div", { class: "mt-auto" }, [
212
+ l[3] || (l[3] = s("div", { class: "mt-auto" }, [
213
213
  s("div", { class: "p-6" }, "Learn More"),
214
214
  s("div", { class: "bg-gray-50 p-6" }, "Footer")
215
215
  ], -1))
@@ -232,49 +232,49 @@ const Le = { class: "flex items-center" }, We = { class: "shrink-0 self-start" }
232
232
  },
233
233
  { name: "Mr Antenna", logo: ot, current: !0 }
234
234
  ]
235
- }), a = y(() => e.brands.find((d) => d.current)), n = y(() => e.brands);
235
+ }), a = y(() => e.brands.find((f) => f.current)), n = y(() => e.brands);
236
236
  return {
237
237
  state: e,
238
238
  currentBrand: a,
239
239
  allBrands: n,
240
- toggleBrand: (d) => {
240
+ toggleBrand: (f) => {
241
241
  e.brands.forEach((v) => {
242
- v.current = v === d;
242
+ v.current = v === f;
243
243
  });
244
244
  }
245
245
  };
246
- }), rt = { class: "flex grow flex-col gap-y-5 overflow-y-auto bg-white rounded-lg" }, lt = { class: "flex flex-1 flex-col" }, it = { class: "divide-y divide-gray-200" }, ct = { class: "flex px-[22px] py-2.5 text-[12px] items-center" }, At = { class: "ml-auto flex items-center" }, mt = ["onClick"], ft = { class: "gap-y-1 flex" }, dt = { class: "flex items-center mr-4" }, ut = ["src", "alt"], vt = { class: "ml-auto flex flex-col" }, gt = { class: "text-base text-gray-800 flex items-center" }, pt = { class: "font-medium" }, xt = {
246
+ }), rt = { class: "flex grow flex-col gap-y-5 overflow-y-auto bg-white rounded-lg" }, lt = { class: "flex flex-1 flex-col" }, it = { class: "divide-y divide-gray-200" }, ct = { class: "flex px-[22px] py-2.5 text-[12px] items-center" }, At = { class: "ml-auto flex items-center" }, mt = ["onClick"], dt = { class: "gap-y-1 flex" }, ft = { class: "flex items-center mr-4" }, ut = ["src", "alt"], vt = { class: "ml-auto flex flex-col" }, gt = { class: "text-base text-gray-800 flex items-center" }, pt = { class: "font-medium" }, xt = {
247
247
  key: 0,
248
248
  class: "inline-flex items-center rounded-full bg-green-100 px-1.5 py-0.5 text-xs font-medium text-green-700 ml-1"
249
249
  }, yt = { class: "text-sm text-gray-500" }, Bt = {
250
250
  __name: "SparkBrandSelector",
251
251
  emits: ["close", "select"],
252
252
  setup(e, { emit: a }) {
253
- const n = a, i = K(), d = (v) => {
253
+ const n = a, A = K(), f = (v) => {
254
254
  n("select", v);
255
255
  };
256
- return (v, m) => {
257
- const f = h("font-awesome-icon");
258
- return r(), c("div", rt, [
256
+ return (v, d) => {
257
+ const l = C("font-awesome-icon");
258
+ return r(), i("div", rt, [
259
259
  s("div", lt, [
260
260
  s("div", it, [
261
261
  s("div", ct, [
262
- m[1] || (m[1] = s("div", null, "Filter by Brand", -1)),
262
+ d[1] || (d[1] = s("div", null, "Filter by Brand", -1)),
263
263
  s("div", At, [
264
- u(f, {
265
- icon: l(b).farTimes,
264
+ u(l, {
265
+ icon: c(b).farTimes,
266
266
  class: "size-4 text-gray-400 cursor-pointer",
267
- onClick: m[0] || (m[0] = (t) => n("close"))
267
+ onClick: d[0] || (d[0] = (t) => n("close"))
268
268
  }, null, 8, ["icon"])
269
269
  ])
270
270
  ]),
271
- (r(!0), c(D, null, S(l(i).allBrands, (t) => (r(), c("div", {
271
+ (r(!0), i(D, null, S(c(A).allBrands, (t) => (r(), i("div", {
272
272
  key: t.name,
273
273
  class: g([t.current ? "bg-gray-50" : "hover:bg-gray-50", "flex px-[22px] py-[15px] cursor-pointer"]),
274
- onClick: (o) => d(t)
274
+ onClick: (o) => f(t)
275
275
  }, [
276
- s("div", ft, [
277
- s("div", dt, [
276
+ s("div", dt, [
277
+ s("div", ft, [
278
278
  s("img", {
279
279
  src: t.logo,
280
280
  alt: `${t.name} logo`,
@@ -283,16 +283,16 @@ const Le = { class: "flex items-center" }, We = { class: "shrink-0 self-start" }
283
283
  ]),
284
284
  s("div", vt, [
285
285
  s("div", gt, [
286
- s("div", pt, M(t.name), 1),
287
- t.current ? (r(), c("span", xt, " Current ")) : x("", !0)
286
+ s("div", pt, h(t.name), 1),
287
+ t.current ? (r(), i("span", xt, " Current ")) : x("", !0)
288
288
  ]),
289
- s("div", yt, M(t.current ? "Current Brand" : "Change to"), 1)
289
+ s("div", yt, h(t.current ? "Current Brand" : "Change to"), 1)
290
290
  ])
291
291
  ])
292
292
  ], 10, mt))), 128)),
293
- m[2] || (m[2] = s("div", null, null, -1))
293
+ d[2] || (d[2] = s("div", null, null, -1))
294
294
  ]),
295
- m[3] || (m[3] = s("div", { class: "mt-auto" }, null, -1))
295
+ d[3] || (d[3] = s("div", { class: "mt-auto" }, null, -1))
296
296
  ])
297
297
  ]);
298
298
  };
@@ -319,9 +319,9 @@ const Le = { class: "flex items-center" }, We = { class: "shrink-0 self-start" }
319
319
  }
320
320
  },
321
321
  setup(e) {
322
- const a = e, n = E(null), i = te("buttonGroup", null), d = y(() => {
323
- if (!i?.isInGroup || !n.value) return null;
324
- const t = i.getButtonIndex(n.value), o = i.getButtonCount();
322
+ const a = e, n = E(null), A = te("buttonGroup", null), f = y(() => {
323
+ if (!A?.isInGroup || !n.value) return null;
324
+ const t = A.getButtonIndex(n.value), o = A.getButtonCount();
325
325
  return {
326
326
  isFirst: t === 0,
327
327
  isLast: t === o - 1,
@@ -338,18 +338,18 @@ const Le = { class: "flex items-center" }, We = { class: "shrink-0 self-start" }
338
338
  borderRadius: /^rounded-/,
339
339
  background: /^bg-/,
340
340
  text: /^text-(?!white|black)/
341
- }, m = (t, o) => {
341
+ }, d = (t, o) => {
342
342
  if (!o) return t;
343
- const p = t.split(" ").filter(Boolean), A = o.split(" ").filter(Boolean);
344
- return [...p.filter((Z) => !A.some((_) => {
343
+ const p = t.split(" ").filter(Boolean), m = o.split(" ").filter(Boolean);
344
+ return [...p.filter((Z) => !m.some((_) => {
345
345
  const L = Object.entries(v).find(
346
346
  ([ee, j]) => j.test(Z)
347
347
  )?.[0], $ = Object.entries(v).find(
348
348
  ([ee, j]) => j.test(_)
349
349
  )?.[0];
350
350
  return L && L === $;
351
- })), ...A].join(" ");
352
- }, f = y(() => {
351
+ })), ...m].join(" ");
352
+ }, l = y(() => {
353
353
  let t = "", o = "";
354
354
  switch (a.size) {
355
355
  case "xs":
@@ -368,9 +368,9 @@ const Le = { class: "flex items-center" }, We = { class: "shrink-0 self-start" }
368
368
  t += " px-3.5 py-2.5 text-sm", o = "md";
369
369
  break;
370
370
  }
371
- if (i?.isInGroup && d.value) {
372
- const { isFirst: p, isLast: A } = d.value;
373
- t += " relative inline-flex items-center focus:z-10", p && A ? t += ` rounded-${o}` : p ? t += ` rounded-l-${o} rounded-r-none` : A ? t += ` rounded-r-${o} rounded-l-none -ml-px` : t += " rounded-none -ml-px";
371
+ if (A?.isInGroup && f.value) {
372
+ const { isFirst: p, isLast: m } = f.value;
373
+ t += " relative inline-flex items-center focus:z-10", p && m ? t += ` rounded-${o}` : p ? t += ` rounded-l-${o} rounded-r-none` : m ? t += ` rounded-r-${o} rounded-l-none -ml-px` : t += " rounded-none -ml-px";
374
374
  } else
375
375
  t += ` shadow-xs rounded-${o}`;
376
376
  switch (a.variant) {
@@ -395,39 +395,39 @@ const Le = { class: "flex items-center" }, We = { class: "shrink-0 self-start" }
395
395
  default:
396
396
  t += ` bg-${a.variant}-600 hover:bg-${a.variant}-500 text-white`;
397
397
  }
398
- return t = m(t, a.buttonClass), t;
398
+ return t = d(t, a.buttonClass), t;
399
399
  });
400
- return (t, o) => (r(), c("button", {
400
+ return (t, o) => (r(), i("button", {
401
401
  type: "button",
402
402
  ref_key: "buttonRef",
403
403
  ref: n,
404
- class: g(f.value),
404
+ class: g(l.value),
405
405
  disabled: e.disabled,
406
406
  onClick: o[0] || (o[0] = (p) => t.$emit("click"))
407
407
  }, [
408
- Y(t.$slots, "default")
408
+ M(t.$slots, "default")
409
409
  ], 10, bt));
410
410
  }
411
- }, ws = {
411
+ }, hs = {
412
412
  __name: "SparkButtonGroup",
413
413
  setup(e) {
414
414
  const a = E(null);
415
415
  return se("buttonGroup", {
416
416
  isInGroup: !0,
417
- getButtonIndex: (d) => a.value ? Array.from(a.value.children).indexOf(d) : -1,
417
+ getButtonIndex: (f) => a.value ? Array.from(a.value.children).indexOf(f) : -1,
418
418
  getButtonCount: () => a.value?.children.length || 0
419
- }), (d, v) => (r(), c("div", {
419
+ }), (f, v) => (r(), i("div", {
420
420
  class: "inline-flex rounded-md shadow-xs",
421
421
  ref_key: "groupRef",
422
422
  ref: a
423
423
  }, [
424
- Y(d.$slots, "default")
424
+ M(f.$slots, "default")
425
425
  ], 512));
426
426
  }
427
- }, wt = { class: "divide-y divide-gray-300 rounded-lg border border-gray-300 text-gray-700 bg-gray-100" }, Mt = {
427
+ }, wt = { class: "divide-y divide-gray-300 rounded-lg border border-gray-300 text-gray-700 bg-gray-100" }, ht = {
428
428
  key: 0,
429
429
  class: "p-5"
430
- }, ht = {
430
+ }, Mt = {
431
431
  key: 1,
432
432
  class: "p-5"
433
433
  }, Ms = {
@@ -444,17 +444,17 @@ const Le = { class: "flex items-center" }, We = { class: "shrink-0 self-start" }
444
444
  },
445
445
  setup(e) {
446
446
  const a = e;
447
- return (n, i) => (r(), c("div", wt, [
448
- n.$slots.header ? (r(), c("div", Mt, [
449
- Y(n.$slots, "header")
447
+ return (n, A) => (r(), i("div", wt, [
448
+ n.$slots.header ? (r(), i("div", ht, [
449
+ M(n.$slots, "header")
450
450
  ])) : x("", !0),
451
451
  s("div", {
452
452
  class: g([a.padded ? a.paddedClass : ""])
453
453
  }, [
454
- Y(n.$slots, "default")
454
+ M(n.$slots, "default")
455
455
  ], 2),
456
- n.$slots.footer ? (r(), c("div", ht, [
457
- Y(n.$slots, "footer")
456
+ n.$slots.footer ? (r(), i("div", Mt, [
457
+ M(n.$slots, "footer")
458
458
  ])) : x("", !0)
459
459
  ]));
460
460
  }
@@ -468,8 +468,8 @@ class Ct {
468
468
  eventHandlers: {}
469
469
  });
470
470
  }
471
- show = (a, n = {}, i = {}) => {
472
- this.state.content = J(a), this.state.props = n, this.state.eventHandlers = i, this.state.isVisible = !0;
471
+ show = (a, n = {}, A = {}) => {
472
+ this.state.content = J(a), this.state.props = n, this.state.eventHandlers = A, this.state.isVisible = !0;
473
473
  };
474
474
  hide = () => {
475
475
  this.state.isVisible = !1, this.state.eventHandlers = {};
@@ -478,17 +478,17 @@ class Ct {
478
478
  const H = new Ct(), zt = { class: "fixed inset-0 z-10 w-screen overflow-y-auto" }, Yt = { class: "flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0" }, Dt = {
479
479
  __name: "SparkModalContainer",
480
480
  setup(e) {
481
- return (a, n) => (r(), z(l(U), {
481
+ return (a, n) => (r(), Y(c(U), {
482
482
  as: "template",
483
- show: l(H).state.isVisible
483
+ show: c(H).state.isVisible
484
484
  }, {
485
485
  default: B(() => [
486
- u(l(R), {
486
+ u(c(R), {
487
487
  class: "relative z-50",
488
- onClose: l(H).hide
488
+ onClose: c(H).hide
489
489
  }, {
490
490
  default: B(() => [
491
- u(l(G), {
491
+ u(c(G), {
492
492
  as: "template",
493
493
  enter: "ease-out duration-300",
494
494
  "enter-from": "opacity-0",
@@ -504,7 +504,7 @@ const H = new Ct(), zt = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
504
504
  }),
505
505
  s("div", zt, [
506
506
  s("div", Yt, [
507
- u(l(G), {
507
+ u(c(G), {
508
508
  as: "template",
509
509
  enter: "ease-out duration-300",
510
510
  "enter-from": "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
@@ -514,9 +514,9 @@ const H = new Ct(), zt = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
514
514
  "leave-to": "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
515
515
  }, {
516
516
  default: B(() => [
517
- u(l(X), { class: "relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg" }, {
517
+ u(c(X), { class: "relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg" }, {
518
518
  default: B(() => [
519
- (r(), z(T(l(H).state.content), q(l(H).state.props, F(l(H).state.eventHandlers)), null, 16))
519
+ (r(), Y(T(c(H).state.content), q(c(H).state.props, F(c(H).state.eventHandlers)), null, 16))
520
520
  ]),
521
521
  _: 1
522
522
  })
@@ -535,7 +535,7 @@ const H = new Ct(), zt = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
535
535
  }, Pt = { class: "px-4 pt-5 pb-4 sm:p-6" }, Ht = {
536
536
  key: 0,
537
537
  class: "text-lg font-medium text-gray-900"
538
- }, hs = {
538
+ }, Cs = {
539
539
  __name: "SparkModalDialog",
540
540
  props: {
541
541
  title: {
@@ -585,7 +585,7 @@ const H = new Ct(), zt = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
585
585
  "input"
586
586
  ],
587
587
  setup(e) {
588
- const a = e, n = y(() => !a.buttons || a.buttons.length === 0 ? [{ text: "OK", variant: "primary", event: "ok" }] : a.buttons), i = y(() => {
588
+ const a = e, n = y(() => !a.buttons || a.buttons.length === 0 ? [{ text: "OK", variant: "primary", event: "ok" }] : a.buttons), A = y(() => {
589
589
  switch (n.value.length) {
590
590
  case 1:
591
591
  return "sm:grid sm:grid-flow-row-dense";
@@ -596,53 +596,53 @@ const H = new Ct(), zt = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
596
596
  default:
597
597
  return "flex flex-col gap-3";
598
598
  }
599
- }), d = {
599
+ }), f = {
600
600
  info: "farInfoCircle",
601
601
  success: "farCheckCircle",
602
602
  warning: "farExclamationTriangle",
603
603
  danger: "farCircleXmark"
604
- }, v = y(() => a.icon || d[a.type]), m = y(() => ({
604
+ }, v = y(() => a.icon || f[a.type]), d = y(() => ({
605
605
  info: "bg-blue-100",
606
606
  success: "bg-green-100",
607
607
  warning: "bg-yellow-100",
608
608
  danger: "bg-red-100"
609
- })[a.type]), f = y(() => ({
609
+ })[a.type]), l = y(() => ({
610
610
  info: "text-blue-400",
611
611
  success: "text-green-400",
612
612
  warning: "text-yellow-400",
613
613
  danger: "text-red-400"
614
614
  })[a.type]);
615
615
  return (t, o) => {
616
- const p = h("font-awesome-icon");
617
- return r(), c("div", Pt, [
618
- v.value ? (r(), c("div", {
616
+ const p = C("font-awesome-icon");
617
+ return r(), i("div", Pt, [
618
+ v.value ? (r(), i("div", {
619
619
  key: 0,
620
- class: g(["mx-auto flex size-12 items-center justify-center rounded-full", m.value])
620
+ class: g(["mx-auto flex size-12 items-center justify-center rounded-full", d.value])
621
621
  }, [
622
622
  u(p, {
623
- icon: l(b)[v.value],
624
- class: g(["h-5 w-5", f.value])
623
+ icon: c(b)[v.value],
624
+ class: g(["h-5 w-5", l.value])
625
625
  }, null, 8, ["icon", "class"])
626
626
  ], 2)) : x("", !0),
627
627
  s("div", {
628
628
  class: g(["text-center", { "mt-3 sm:mt-5": v.value }])
629
629
  }, [
630
- e.title ? (r(), c("h3", Ht, M(e.title), 1)) : x("", !0),
631
- e.message ? (r(), c("div", {
630
+ e.title ? (r(), i("h3", Ht, h(e.title), 1)) : x("", !0),
631
+ e.message ? (r(), i("div", {
632
632
  key: 1,
633
633
  class: g([{ "mt-2": e.title }, "text-sm text-gray-500"])
634
- }, M(e.message), 3)) : x("", !0)
634
+ }, h(e.message), 3)) : x("", !0)
635
635
  ], 2),
636
636
  s("div", {
637
- class: g(["mt-5 sm:mt-6", i.value])
637
+ class: g(["mt-5 sm:mt-6", A.value])
638
638
  }, [
639
- (r(!0), c(D, null, S(n.value, (A, w) => (r(), z(l(V), {
639
+ (r(!0), i(D, null, S(n.value, (m, w) => (r(), Y(c(V), {
640
640
  key: w,
641
- variant: A.variant,
642
- onClick: (Z) => t.$emit(A.event, A)
641
+ variant: m.variant,
642
+ onClick: (Z) => t.$emit(m.event, m)
643
643
  }, {
644
644
  default: B(() => [
645
- Q(M(A.text), 1)
645
+ Q(h(m.text), 1)
646
646
  ]),
647
647
  _: 2
648
648
  }, 1032, ["variant", "onClick"]))), 128))
@@ -665,18 +665,18 @@ const H = new Ct(), zt = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
665
665
  },
666
666
  setup(e) {
667
667
  const a = E(null);
668
- return (n, i) => (r(), z(l(U), {
668
+ return (n, A) => (r(), Y(c(U), {
669
669
  show: e.overlayInstance.state.isVisible,
670
670
  as: "template"
671
671
  }, {
672
672
  default: B(() => [
673
- u(l(R), {
673
+ u(c(R), {
674
674
  initialFocus: a.value,
675
675
  class: "relative z-200",
676
676
  onClose: e.overlayInstance.close
677
677
  }, {
678
678
  default: B(() => [
679
- u(l(G), {
679
+ u(c(G), {
680
680
  as: "template",
681
681
  enter: "transition-opacity ease-linear duration-150",
682
682
  "enter-from": "opacity-0",
@@ -685,13 +685,13 @@ const H = new Ct(), zt = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
685
685
  "leave-from": "opacity-100",
686
686
  "leave-to": "opacity-0"
687
687
  }, {
688
- default: B(() => [...i[0] || (i[0] = [
688
+ default: B(() => [...A[0] || (A[0] = [
689
689
  s("div", { class: "fixed inset-0 bg-gray-600/30" }, null, -1)
690
690
  ])]),
691
691
  _: 1
692
692
  }),
693
693
  s("div", St, [
694
- u(l(G), {
694
+ u(c(G), {
695
695
  as: "template",
696
696
  enter: "transition ease-in-out duration-150 transform",
697
697
  "enter-from": e.position === "left" ? "-translate-x-full opacity-0" : "translate-x-full opacity-0",
@@ -701,7 +701,7 @@ const H = new Ct(), zt = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
701
701
  "leave-to": e.position === "left" ? "-translate-x-full opacity-0" : "translate-x-full opacity-0"
702
702
  }, {
703
703
  default: B(() => [
704
- u(l(X), {
704
+ u(c(X), {
705
705
  ref_key: "panelRef",
706
706
  ref: a,
707
707
  class: g([
@@ -710,7 +710,7 @@ const H = new Ct(), zt = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
710
710
  ])
711
711
  }, {
712
712
  default: B(() => [
713
- (r(), z(T(e.overlayInstance.state.content), q({ ...n.$attrs, ...e.overlayInstance.state.props }, F(e.overlayInstance.state.eventHandlers)), null, 16))
713
+ (r(), Y(T(e.overlayInstance.state.content), q({ ...n.$attrs, ...e.overlayInstance.state.props }, F(e.overlayInstance.state.eventHandlers)), null, 16))
714
714
  ]),
715
715
  _: 1
716
716
  }, 8, ["class"])
@@ -736,19 +736,19 @@ function O() {
736
736
  e.isVisible = !e.isVisible;
737
737
  }, n = () => {
738
738
  e.isVisible = !1, e.eventHandlers = {};
739
- }, i = () => {
739
+ }, A = () => {
740
740
  e.isVisible = !0;
741
- }, d = (m, f = {}, t = {}) => {
742
- e.content = J(m), e.props = f, e.eventHandlers = t;
741
+ }, f = (d, l = {}, t = {}) => {
742
+ e.content = J(d), e.props = l, e.eventHandlers = t;
743
743
  };
744
744
  return {
745
745
  state: e,
746
746
  toggle: a,
747
747
  close: n,
748
- open: i,
749
- setContent: d,
750
- show: (m, f = {}, t = {}) => {
751
- m && d(m, f, t), i();
748
+ open: A,
749
+ setContent: f,
750
+ show: (d, l = {}, t = {}) => {
751
+ d && f(d, l, t), A();
752
752
  }
753
753
  };
754
754
  }
@@ -756,11 +756,11 @@ class Et {
756
756
  constructor() {
757
757
  this.left = O(), this.right = O();
758
758
  }
759
- showLeft = (a, n = {}, i = {}) => {
760
- this.left.show(a, n, i);
759
+ showLeft = (a, n = {}, A = {}) => {
760
+ this.left.show(a, n, A);
761
761
  };
762
- showRight = (a, n = {}, i = {}) => {
763
- this.right.show(a, n, i);
762
+ showRight = (a, n = {}, A = {}) => {
763
+ this.right.show(a, n, A);
764
764
  };
765
765
  closeLeft = () => {
766
766
  this.left.close();
@@ -772,7 +772,7 @@ class Et {
772
772
  this.left.close(), this.right.close();
773
773
  };
774
774
  }
775
- const C = new Et(), kt = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, Qt = { class: "flex flex-1 flex-col" }, Gt = {
775
+ const z = new Et(), kt = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, Qt = { class: "flex flex-1 flex-col" }, Gt = {
776
776
  class: "flex flex-1 flex-col gap-y-7",
777
777
  role: "list"
778
778
  }, Zt = { role: "list" }, jt = { class: "flex items-center pb-8" }, It = ["href", "onClick"], Lt = {
@@ -784,7 +784,7 @@ const C = new Et(), kt = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, Qt =
784
784
  }, Ot = ["href", "onClick"], Jt = {
785
785
  key: 1,
786
786
  class: "text-[13px]"
787
- }, Tt = { class: "mt-auto" }, qt = { class: "p-[10px] flex-shrink-0" }, Ft = { class: "flex flex-1 items-center gap-x-6" }, Nt = { class: "relative flex flex-1 items-center justify-between" }, Ut = { class: "cursor-pointer" }, Rt = ["src"], Xt = { class: "mr-[10px] pb-[10px] flex-1 flex flex-col" }, Cs = {
787
+ }, Tt = { class: "mt-auto" }, qt = { class: "p-[10px] flex-shrink-0" }, Ft = { class: "flex flex-1 items-center gap-x-6" }, Nt = { class: "relative flex flex-1 items-center gap-4" }, Ut = { class: "cursor-pointer" }, Rt = ["src"], Xt = { class: "ml-auto" }, Kt = { class: "mr-[10px] pb-[10px] flex-1 flex flex-col" }, zs = {
788
788
  __name: "SparkDefaultContainer",
789
789
  props: {
790
790
  appStore: {
@@ -797,24 +797,24 @@ const C = new Et(), kt = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, Qt =
797
797
  }
798
798
  },
799
799
  setup(e) {
800
- const a = e, n = K(), i = () => {
801
- C.showRight(st, {
800
+ const a = e, n = K(), A = () => {
801
+ z.showRight(st, {
802
802
  currentApp: a.appStore.state.app
803
803
  });
804
- }, d = () => {
805
- C.showLeft(
804
+ }, f = () => {
805
+ z.showLeft(
806
806
  Bt,
807
807
  {},
808
808
  {
809
- select: (f) => {
810
- n.toggleBrand(f), C.closeLeft();
809
+ select: (l) => {
810
+ n.toggleBrand(l), z.closeLeft();
811
811
  }
812
812
  }
813
813
  );
814
- }, v = y(() => a.mainNavStore.state.hidden ? ["w-0 overflow-hidden"] : [a.mainNavStore.state.collapsed ? "w-[80px]" : "w-[240px]"]), m = y(() => a.mainNavStore.state.hidden ? ["pl-2.5"] : [a.mainNavStore.state.collapsed ? "pl-[80px]" : "pl-[240px]"]);
815
- return (f, t) => {
816
- const o = h("font-awesome-icon"), p = h("router-view");
817
- return r(), c(D, null, [
814
+ }, v = y(() => a.mainNavStore.state.hidden ? ["w-0 overflow-hidden"] : [a.mainNavStore.state.collapsed ? "w-[80px]" : "w-[240px]"]), d = y(() => a.mainNavStore.state.hidden ? ["pl-2.5"] : [a.mainNavStore.state.collapsed ? "pl-[80px]" : "pl-[240px]"]);
815
+ return (l, t) => {
816
+ const o = C("font-awesome-icon"), p = C("router-view");
817
+ return r(), i(D, null, [
818
818
  s("div", {
819
819
  class: g([v.value, "fixed inset-y-0 flex transition-all z-100"])
820
820
  }, [
@@ -826,52 +826,52 @@ const C = new Et(), kt = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, Qt =
826
826
  s("li", jt, [
827
827
  s("a", {
828
828
  class: "grid w-[40px] h-[40px] place-items-center rounded-md bg-primary-600 text-white text-[13px] cursor-pointer",
829
- onClick: t[0] || (t[0] = P((A) => e.mainNavStore.goto("dashboard"), ["prevent"]))
829
+ onClick: t[0] || (t[0] = P((m) => e.mainNavStore.goto(e.appStore.state.homeRoute), ["prevent"]))
830
830
  }, [
831
831
  u(o, {
832
- icon: l(b)[e.appStore.state.icon],
832
+ icon: c(b)[e.appStore.state.icon],
833
833
  class: "size-5"
834
834
  }, null, 8, ["icon"])
835
835
  ]),
836
- e.mainNavStore.state.collapsed ? x("", !0) : (r(), c("a", {
836
+ e.mainNavStore.state.collapsed ? x("", !0) : (r(), i("a", {
837
837
  key: 0,
838
- onClick: t[1] || (t[1] = P((A) => e.mainNavStore.goto("dashboard"), ["prevent"])),
838
+ onClick: t[1] || (t[1] = P((m) => e.mainNavStore.goto(e.appStore.state.homeRoute), ["prevent"])),
839
839
  class: "font-medium text-gray-800 ml-[10px] cursor-pointer"
840
- }, M(e.appStore.state.app), 1))
840
+ }, h(e.appStore.state.app), 1))
841
841
  ]),
842
- (r(!0), c(D, null, S(e.mainNavStore.state.menu, (A) => (r(), c("li", {
843
- key: A.name,
842
+ (r(!0), i(D, null, S(e.mainNavStore.state.menu, (m) => (r(), i("li", {
843
+ key: m.name,
844
844
  class: g({
845
- "mt-[10px]": A.children
845
+ "mt-[10px]": m.children
846
846
  })
847
847
  }, [
848
848
  s("a", {
849
849
  class: g([{
850
- "bg-gray-100": A.current,
851
- "hover:bg-gray-100": A?.href
850
+ "bg-gray-100": m.current,
851
+ "hover:bg-gray-100": m?.href
852
852
  }, "h-[37px] sgroup flex items-center gap-x-2 rounded-md p-3 text-gray-800 leading-5 transition-all duration-300 ease-in-out"]),
853
- href: A?.href,
854
- onClick: P((w) => e.mainNavStore.goto(A.href), ["prevent"])
853
+ href: m?.href,
854
+ onClick: P((w) => e.mainNavStore.goto(m.href), ["prevent"])
855
855
  }, [
856
- A.icon ? (r(), z(o, {
856
+ m.icon ? (r(), Y(o, {
857
857
  key: 0,
858
- icon: l(b)[A.icon],
859
- class: g([[(A.current, "text-gray-400")], "size-4"])
858
+ icon: c(b)[m.icon],
859
+ class: g([[(m.current, "text-gray-400")], "size-4"])
860
860
  }, null, 8, ["icon", "class"])) : x("", !0),
861
- e.mainNavStore.state.collapsed ? A?.children ? (r(), c("div", Lt, [...t[4] || (t[4] = [
861
+ e.mainNavStore.state.collapsed ? m?.children ? (r(), i("div", Lt, [...t[4] || (t[4] = [
862
862
  s("div", { class: "w-[10px] h-px bg-gray-400" }, null, -1)
863
- ])])) : x("", !0) : (r(), c("span", {
863
+ ])])) : x("", !0) : (r(), i("span", {
864
864
  key: 1,
865
865
  class: g({
866
- "text-[11px]": A?.children,
867
- "text-[13px]": !A?.children,
868
- "font-semibold": A?.children,
869
- "text-gray-500": A?.children
866
+ "text-[11px]": m?.children,
867
+ "text-[13px]": !m?.children,
868
+ "font-semibold": m?.children,
869
+ "text-gray-500": m?.children
870
870
  })
871
- }, M(A.name), 3))
871
+ }, h(m.name), 3))
872
872
  ], 10, It),
873
- A.children ? (r(), c("ul", Wt, [
874
- (r(!0), c(D, null, S(A.children, (w) => (r(), c("li", {
873
+ m.children ? (r(), i("ul", Wt, [
874
+ (r(!0), i(D, null, S(m.children, (w) => (r(), i("li", {
875
875
  key: w.name
876
876
  }, [
877
877
  s("a", {
@@ -879,12 +879,12 @@ const C = new Et(), kt = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, Qt =
879
879
  href: w.href,
880
880
  onClick: P((Z) => e.mainNavStore.goto(w.href), ["prevent"])
881
881
  }, [
882
- w.icon ? (r(), z(o, {
882
+ w.icon ? (r(), Y(o, {
883
883
  key: 0,
884
- icon: l(b)[w.icon],
884
+ icon: c(b)[w.icon],
885
885
  class: g([[(w.current, "text-gray-400")], "size-4"])
886
886
  }, null, 8, ["icon", "class"])) : x("", !0),
887
- e.mainNavStore.state.collapsed ? x("", !0) : (r(), c("span", Jt, M(w.name), 1))
887
+ e.mainNavStore.state.collapsed ? x("", !0) : (r(), i("span", Jt, h(w.name), 1))
888
888
  ], 10, Ot)
889
889
  ]))), 128))
890
890
  ])) : x("", !0)
@@ -892,13 +892,14 @@ const C = new Et(), kt = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, Qt =
892
892
  ])
893
893
  ]),
894
894
  s("li", Tt, [
895
+ M(l.$slots, "sidebar-footer"),
895
896
  s("a", {
896
897
  class: "font-medium grid place-content-center gap-x-3 rounded-md h-10 p-2.5 text-gray-800 text-[13px] hover:bg-gray-100 transition-all duration-300 ease-in-out",
897
898
  href: "#",
898
- onClick: t[2] || (t[2] = P((A) => e.mainNavStore.toggleCollapsed(), ["prevent"]))
899
+ onClick: t[2] || (t[2] = P((m) => e.mainNavStore.toggleCollapsed(), ["prevent"]))
899
900
  }, [
900
901
  u(o, {
901
- icon: l(b)[e.mainNavStore.state.collapsed ? "farArrowRightToLine" : "farArrowLeftToLine"],
902
+ icon: c(b)[e.mainNavStore.state.collapsed ? "farArrowRightToLine" : "farArrowLeftToLine"],
902
903
  class: "class-5"
903
904
  }, null, 8, ["icon"])
904
905
  ])
@@ -908,95 +909,108 @@ const C = new Et(), kt = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, Qt =
908
909
  ])
909
910
  ], 2),
910
911
  s("div", {
911
- class: g([m.value, "h-full transition-all flex flex-col"])
912
+ class: g([d.value, "h-full transition-all flex flex-col"])
912
913
  }, [
913
914
  s("div", qt, [
914
915
  s("div", Ft, [
915
916
  s("div", Nt, [
916
- s("div", Ut, [
917
- u(o, {
918
- icon: l(b).farBarsSort,
919
- class: "size-5",
920
- onClick: t[3] || (t[3] = (A) => e.mainNavStore.toggleHidden())
921
- }, null, 8, ["icon"])
917
+ M(l.$slots, "header-left", {}, () => [
918
+ s("div", Ut, [
919
+ u(o, {
920
+ icon: c(b).farBarsSort,
921
+ class: "size-5",
922
+ onClick: t[3] || (t[3] = (m) => e.mainNavStore.toggleHidden())
923
+ }, null, 8, ["icon"])
924
+ ])
922
925
  ]),
923
- s("div", {
924
- class: "cursor-pointer h-9 flex items-center",
925
- onClick: d
926
- }, [
927
- l(n).currentBrand ? (r(), c("img", {
926
+ M(l.$slots, "header-center", {}, () => [
927
+ e.appStore.state.showBrandSelector ? (r(), i("div", {
928
928
  key: 0,
929
- src: l(n).currentBrand.logo,
930
- alt: "",
931
- class: "h-[30px] w-auto"
932
- }, null, 8, Rt)) : x("", !0)
929
+ class: "absolute left-1/2 -translate-x-1/2 cursor-pointer h-9 flex items-center",
930
+ onClick: f
931
+ }, [
932
+ c(n).currentBrand ? (r(), i("img", {
933
+ key: 0,
934
+ src: c(n).currentBrand.logo,
935
+ alt: "",
936
+ class: "h-[30px] w-auto"
937
+ }, null, 8, Rt)) : x("", !0)
938
+ ])) : x("", !0)
933
939
  ]),
934
- s("button", {
935
- class: "rounded-sm bg-white w-[42px] h-[42px] ring-1 ring-inset ring-gray-300",
936
- type: "button",
937
- onClick: i
938
- }, [
939
- u(o, {
940
- icon: l(b).farGripDotsVertical,
941
- class: "size-4 text-gray-400"
942
- }, null, 8, ["icon"])
940
+ s("div", Xt, [
941
+ M(l.$slots, "header-right", {}, () => [
942
+ e.appStore.state.showAppSelector ? (r(), i("button", {
943
+ key: 0,
944
+ class: "rounded-sm bg-white w-[42px] h-[42px] ring-1 ring-inset ring-gray-300",
945
+ type: "button",
946
+ onClick: A
947
+ }, [
948
+ u(o, {
949
+ icon: c(b).farGripDotsVertical,
950
+ class: "size-4 text-gray-400"
951
+ }, null, 8, ["icon"])
952
+ ])) : x("", !0)
953
+ ])
943
954
  ])
944
955
  ])
945
956
  ])
946
957
  ]),
947
- s("main", Xt, [
958
+ s("main", Kt, [
948
959
  u(p)
949
960
  ])
950
961
  ], 2),
951
- u(l(W), {
962
+ u(c(W), {
952
963
  position: "left",
953
- "overlay-instance": l(C).left,
954
- onClose: l(C).closeLeft
964
+ "overlay-instance": c(z).left,
965
+ onClose: c(z).closeLeft
955
966
  }, null, 8, ["overlay-instance", "onClose"]),
956
- u(l(W), {
967
+ u(c(W), {
957
968
  position: "right",
958
- "overlay-instance": l(C).right,
959
- onClose: l(C).closeRight
969
+ "overlay-instance": c(z).right,
970
+ onClose: c(z).closeRight
960
971
  }, null, 8, ["overlay-instance", "onClose"]),
961
- u(l(Dt))
972
+ u(c(Dt))
962
973
  ], 64);
963
974
  };
964
975
  }
965
- }, Kt = (e, a) => {
976
+ }, Vt = (e, a) => {
966
977
  const n = e.__vccOpts || e;
967
- for (const [i, d] of a)
968
- n[i] = d;
978
+ for (const [A, f] of a)
979
+ n[A] = f;
969
980
  return n;
970
- }, Vt = {}, _t = { class: "h-full" };
971
- function $t(e, a) {
972
- const n = h("router-view");
973
- return r(), c("main", _t, [
981
+ }, _t = {}, $t = { class: "h-full" };
982
+ function es(e, a) {
983
+ const n = C("router-view");
984
+ return r(), i("main", $t, [
974
985
  u(n)
975
986
  ]);
976
987
  }
977
- const zs = /* @__PURE__ */ Kt(Vt, [["render", $t]]), Ys = I("sparkApp", () => {
988
+ const Ys = /* @__PURE__ */ Vt(_t, [["render", es]]), Ds = I("sparkApp", () => {
978
989
  const e = k({
979
990
  app: "",
980
- icon: ""
991
+ icon: "",
992
+ homeRoute: "dashboard",
993
+ showBrandSelector: !0,
994
+ showAppSelector: !0
981
995
  });
982
996
  return {
983
997
  state: e,
984
998
  initialize: (n = {}) => {
985
- e.app = n.app || "", e.icon = n.icon || "";
999
+ e.app = n.app || "", e.icon = n.icon || "", e.homeRoute = n.homeRoute ?? "dashboard", e.showBrandSelector = n.showBrandSelector ?? !0, e.showAppSelector = n.showAppSelector ?? !0;
986
1000
  }
987
1001
  };
988
- }), Ds = I("sparkNav", () => {
1002
+ }), Ps = I("sparkNav", () => {
989
1003
  const e = k({
990
1004
  menu: [],
991
1005
  collapsed: !1,
992
1006
  hidden: !1
993
- }), a = Ie(), n = (f = []) => {
994
- e.menu = f;
995
- }, i = (f, t) => {
996
- for (const o of f) {
1007
+ }), a = Ie(), n = (l = []) => {
1008
+ e.menu = l;
1009
+ }, A = (l, t) => {
1010
+ for (const o of l) {
997
1011
  if (o.href === t) return o;
998
1012
  if (o.children) {
999
- const p = i(o.children, t);
1013
+ const p = A(o.children, t);
1000
1014
  if (p) return p;
1001
1015
  }
1002
1016
  }
@@ -1005,20 +1019,20 @@ const zs = /* @__PURE__ */ Kt(Vt, [["render", $t]]), Ys = I("sparkApp", () => {
1005
1019
  return {
1006
1020
  state: e,
1007
1021
  initialize: n,
1008
- goto: async (f) => {
1009
- if (f) {
1022
+ goto: async (l) => {
1023
+ if (l) {
1010
1024
  const t = (p) => {
1011
- p.forEach((A) => {
1012
- A.current = A.href === f, A.children && t(A.children);
1025
+ p.forEach((m) => {
1026
+ m.current = m.href === l, m.children && t(m.children);
1013
1027
  });
1014
1028
  };
1015
1029
  t(e.menu);
1016
- const o = i(e.menu, f);
1030
+ const o = A(e.menu, l);
1017
1031
  if (o && typeof o.action == "function") {
1018
1032
  o.action();
1019
1033
  return;
1020
1034
  }
1021
- await a.push(f);
1035
+ await a.push(l);
1022
1036
  }
1023
1037
  },
1024
1038
  toggleCollapsed: () => {
@@ -1028,20 +1042,20 @@ const zs = /* @__PURE__ */ Kt(Vt, [["render", $t]]), Ys = I("sparkApp", () => {
1028
1042
  e.hidden = !e.hidden;
1029
1043
  }
1030
1044
  };
1031
- }), es = { class: "h-full grid place-content-center relative" }, ts = { class: "absolute top-8 left-8" }, ss = ["src"], ns = {
1045
+ }), ts = { class: "h-full grid place-content-center relative" }, ss = { class: "absolute top-8 left-8" }, ns = ["src"], as = {
1032
1046
  key: 1,
1033
1047
  width: "59",
1034
1048
  height: "23",
1035
1049
  viewBox: "0 0 59 23",
1036
1050
  fill: "none",
1037
1051
  xmlns: "http://www.w3.org/2000/svg"
1038
- }, as = { class: "max-w-sm grid gap-y-1 -mt-8" }, os = { class: "mb-7" }, rs = { class: "text-gray-600" }, ls = { class: "grid grid-flow-col justify-between my-1" }, is = {
1052
+ }, os = { class: "max-w-sm grid gap-y-1 -mt-8" }, rs = { class: "mb-7" }, ls = { class: "text-gray-600" }, is = { class: "grid grid-flow-col justify-between my-1" }, cs = {
1039
1053
  key: 0,
1040
1054
  class: "text-red-600 text-sm mb-2"
1041
- }, cs = { key: 0 }, As = { key: 1 }, ms = {
1055
+ }, As = { key: 0 }, ms = { key: 1 }, ds = {
1042
1056
  key: 0,
1043
1057
  class: "mt-4 text-center text-sm text-gray-600"
1044
- }, Ps = {
1058
+ }, Hs = {
1045
1059
  __name: "SparkLoginView",
1046
1060
  props: {
1047
1061
  logo: {
@@ -1067,26 +1081,26 @@ const zs = /* @__PURE__ */ Kt(Vt, [["render", $t]]), Ys = I("sparkApp", () => {
1067
1081
  },
1068
1082
  emits: ["login-success", "login-error"],
1069
1083
  setup(e, { emit: a }) {
1070
- const n = e, i = a, d = E(!1), v = E(""), m = async (f) => {
1071
- d.value = !0, v.value = "";
1084
+ const n = e, A = a, f = E(!1), v = E(""), d = async (l) => {
1085
+ f.value = !0, v.value = "";
1072
1086
  try {
1073
- await n.onLogin(f), i("login-success");
1087
+ await n.onLogin(l), A("login-success");
1074
1088
  } catch (t) {
1075
- v.value = t.message || "Login failed. Please try again.", i("login-error", t);
1089
+ v.value = t.message || "Login failed. Please try again.", A("login-error", t);
1076
1090
  } finally {
1077
- d.value = !1;
1091
+ f.value = !1;
1078
1092
  }
1079
1093
  };
1080
- return (f, t) => {
1081
- const o = h("FormKit"), p = h("router-link");
1082
- return r(), c("div", es, [
1083
- s("div", ts, [
1084
- n.logo ? (r(), c("img", {
1094
+ return (l, t) => {
1095
+ const o = C("FormKit"), p = C("router-link");
1096
+ return r(), i("div", ts, [
1097
+ s("div", ss, [
1098
+ n.logo ? (r(), i("img", {
1085
1099
  key: 0,
1086
1100
  src: n.logo,
1087
1101
  alt: "Logo",
1088
1102
  class: "h-[23px] w-auto"
1089
- }, null, 8, ss)) : (r(), c("svg", ns, [...t[0] || (t[0] = [
1103
+ }, null, 8, ns)) : (r(), i("svg", as, [...t[0] || (t[0] = [
1090
1104
  s("path", {
1091
1105
  d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
1092
1106
  fill: "#1C64F2"
@@ -1105,14 +1119,14 @@ const zs = /* @__PURE__ */ Kt(Vt, [["render", $t]]), Ys = I("sparkApp", () => {
1105
1119
  }, null, -1)
1106
1120
  ])]))
1107
1121
  ]),
1108
- s("div", as, [
1109
- s("div", os, [
1122
+ s("div", os, [
1123
+ s("div", rs, [
1110
1124
  t[1] || (t[1] = s("h1", { class: "text-4xl text-gray-900 semibold tracking-tight mb-3" }, "Log in", -1)),
1111
- s("p", rs, " Welcome back" + M(n.appName ? ` to ${n.appName}` : "") + "! Please enter your details. ", 1)
1125
+ s("p", ls, " Welcome back" + h(n.appName ? ` to ${n.appName}` : "") + "! Please enter your details. ", 1)
1112
1126
  ]),
1113
1127
  u(o, {
1114
1128
  type: "form",
1115
- onSubmit: m,
1129
+ onSubmit: d,
1116
1130
  actions: !1
1117
1131
  }, {
1118
1132
  default: B(() => [
@@ -1132,7 +1146,7 @@ const zs = /* @__PURE__ */ Kt(Vt, [["render", $t]]), Ys = I("sparkApp", () => {
1132
1146
  validation: "required",
1133
1147
  "outer-class": "max-w-full"
1134
1148
  }),
1135
- s("div", ls, [
1149
+ s("div", is, [
1136
1150
  u(o, {
1137
1151
  label: "Remember me",
1138
1152
  name: "remember",
@@ -1148,22 +1162,22 @@ const zs = /* @__PURE__ */ Kt(Vt, [["render", $t]]), Ys = I("sparkApp", () => {
1148
1162
  _: 1
1149
1163
  }, 8, ["to"])
1150
1164
  ]),
1151
- v.value ? (r(), c("div", is, M(v.value), 1)) : x("", !0),
1152
- u(l(V), {
1165
+ v.value ? (r(), i("div", cs, h(v.value), 1)) : x("", !0),
1166
+ u(c(V), {
1153
1167
  type: "submit",
1154
1168
  size: "xl",
1155
- disabled: d.value,
1169
+ disabled: f.value,
1156
1170
  "button-class": "w-full"
1157
1171
  }, {
1158
1172
  default: B(() => [
1159
- d.value ? (r(), c("span", As, "Signing in...")) : (r(), c("span", cs, "Sign in"))
1173
+ f.value ? (r(), i("span", ms, "Signing in...")) : (r(), i("span", As, "Sign in"))
1160
1174
  ]),
1161
1175
  _: 1
1162
1176
  }, 8, ["disabled"])
1163
1177
  ]),
1164
1178
  _: 1
1165
1179
  }),
1166
- n.signupRoute ? (r(), c("div", ms, [
1180
+ n.signupRoute ? (r(), i("div", ds, [
1167
1181
  t[4] || (t[4] = Q(" Don't have an account? ", -1)),
1168
1182
  u(p, {
1169
1183
  to: n.signupRoute,
@@ -1182,24 +1196,24 @@ const zs = /* @__PURE__ */ Kt(Vt, [["render", $t]]), Ys = I("sparkApp", () => {
1182
1196
  };
1183
1197
  export {
1184
1198
  b as Icons,
1185
- bs as SparkAlert,
1199
+ ws as SparkAlert,
1186
1200
  st as SparkAppSelector,
1187
1201
  Bt as SparkBrandSelector,
1188
1202
  V as SparkButton,
1189
- ws as SparkButtonGroup,
1203
+ hs as SparkButtonGroup,
1190
1204
  Ms as SparkCard,
1191
- Cs as SparkDefaultContainer,
1192
- Ps as SparkLoginView,
1205
+ zs as SparkDefaultContainer,
1206
+ Hs as SparkLoginView,
1193
1207
  Dt as SparkModalContainer,
1194
- hs as SparkModalDialog,
1208
+ Cs as SparkModalDialog,
1195
1209
  W as SparkOverlay,
1196
- zs as SparkPublicContainer,
1197
- ys as addSparkIcons,
1198
- Bs as setupFontAwesome,
1210
+ Ys as SparkPublicContainer,
1211
+ Bs as addIcons,
1212
+ bs as setupFontAwesome,
1199
1213
  H as sparkModalService,
1200
- C as sparkOverlayService,
1201
- Ys as useSparkAppStore,
1214
+ z as sparkOverlayService,
1215
+ Ds as useSparkAppStore,
1202
1216
  K as useSparkBrandFilterStore,
1203
- Ds as useSparkNavStore,
1217
+ Ps as useSparkNavStore,
1204
1218
  O as useSparkOverlay
1205
1219
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wishbone-media/spark",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -8,12 +8,12 @@
8
8
  <li class="flex items-center pb-8">
9
9
  <a
10
10
  class="grid w-[40px] h-[40px] place-items-center rounded-md bg-primary-600 text-white text-[13px] cursor-pointer"
11
- @click.prevent="mainNavStore.goto('dashboard')"
11
+ @click.prevent="mainNavStore.goto(appStore.state.homeRoute)"
12
12
  >
13
13
  <font-awesome-icon :icon="Icons[appStore.state.icon]" class="size-5" />
14
14
  </a>
15
15
  <a
16
- @click.prevent="mainNavStore.goto('dashboard')"
16
+ @click.prevent="mainNavStore.goto(appStore.state.homeRoute)"
17
17
  v-if="!mainNavStore.state.collapsed"
18
18
  class="font-medium text-gray-800 ml-[10px] cursor-pointer"
19
19
  >
@@ -81,6 +81,7 @@
81
81
  </ul>
82
82
  </li>
83
83
  <li class="mt-auto">
84
+ <slot name="sidebar-footer" />
84
85
  <a
85
86
  class="font-medium grid place-content-center gap-x-3 rounded-md h-10 p-2.5 text-gray-800 text-[13px] hover:bg-gray-100 transition-all duration-300 ease-in-out"
86
87
  href="#"
@@ -102,31 +103,44 @@
102
103
  <div :class="contentClass" class="h-full transition-all flex flex-col">
103
104
  <div class="p-[10px] flex-shrink-0">
104
105
  <div class="flex flex-1 items-center gap-x-6">
105
- <div class="relative flex flex-1 items-center justify-between">
106
- <div class="cursor-pointer">
107
- <font-awesome-icon
108
- :icon="Icons.farBarsSort"
109
- class="size-5"
110
- @click="mainNavStore.toggleHidden()"
111
- />
112
- </div>
106
+ <div class="relative flex flex-1 items-center gap-4">
107
+ <slot name="header-left">
108
+ <div class="cursor-pointer">
109
+ <font-awesome-icon
110
+ :icon="Icons.farBarsSort"
111
+ class="size-5"
112
+ @click="mainNavStore.toggleHidden()"
113
+ />
114
+ </div>
115
+ </slot>
113
116
 
114
- <div class="cursor-pointer h-9 flex items-center" @click="toggleBrandSelector">
115
- <img
116
- v-if="sparkBrandFilterStore.currentBrand"
117
- :src="sparkBrandFilterStore.currentBrand.logo"
118
- alt=""
119
- class="h-[30px] w-auto"
120
- />
121
- </div>
117
+ <slot name="header-center">
118
+ <div
119
+ v-if="appStore.state.showBrandSelector"
120
+ class="absolute left-1/2 -translate-x-1/2 cursor-pointer h-9 flex items-center"
121
+ @click="toggleBrandSelector"
122
+ >
123
+ <img
124
+ v-if="sparkBrandFilterStore.currentBrand"
125
+ :src="sparkBrandFilterStore.currentBrand.logo"
126
+ alt=""
127
+ class="h-[30px] w-auto"
128
+ />
129
+ </div>
130
+ </slot>
122
131
 
123
- <button
124
- class="rounded-sm bg-white w-[42px] h-[42px] ring-1 ring-inset ring-gray-300"
125
- type="button"
126
- @click="toggleAppSelector"
127
- >
128
- <font-awesome-icon :icon="Icons.farGripDotsVertical" class="size-4 text-gray-400" />
129
- </button>
132
+ <div class="ml-auto">
133
+ <slot name="header-right">
134
+ <button
135
+ v-if="appStore.state.showAppSelector"
136
+ class="rounded-sm bg-white w-[42px] h-[42px] ring-1 ring-inset ring-gray-300"
137
+ type="button"
138
+ @click="toggleAppSelector"
139
+ >
140
+ <font-awesome-icon :icon="Icons.farGripDotsVertical" class="size-4 text-gray-400" />
141
+ </button>
142
+ </slot>
143
+ </div>
130
144
  </div>
131
145
  </div>
132
146
  </div>
@@ -75,8 +75,9 @@ export const Icons = {
75
75
  farXmark: faXmark,
76
76
  }
77
77
 
78
- export function addSparkIcons() {
79
- library.add(...Object.values(Icons))
78
+ export function addIcons(newIcons) {
79
+ Object.assign(Icons, newIcons)
80
+ library.add(...Object.values(newIcons))
80
81
  }
81
82
 
82
83
  export function setupFontAwesome(app) {
@@ -1 +1 @@
1
- export { Icons, addSparkIcons, setupFontAwesome } from './fontawesome.js'
1
+ export { Icons, addIcons, setupFontAwesome } from './fontawesome.js'
package/src/stores/app.js CHANGED
@@ -5,11 +5,17 @@ export const useSparkAppStore = defineStore('sparkApp', () => {
5
5
  const state = reactive({
6
6
  app: '',
7
7
  icon: '',
8
+ homeRoute: 'dashboard',
9
+ showBrandSelector: true,
10
+ showAppSelector: true,
8
11
  })
9
12
 
10
13
  const initialize = (config = {}) => {
11
14
  state.app = config.app || ''
12
15
  state.icon = config.icon || ''
16
+ state.homeRoute = config.homeRoute ?? 'dashboard'
17
+ state.showBrandSelector = config.showBrandSelector ?? true
18
+ state.showAppSelector = config.showAppSelector ?? true
13
19
  }
14
20
 
15
21
  return {