@vasakgroup/vue-libvasak 0.3.1 → 0.3.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.
@@ -19,8 +19,8 @@ declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {},
19
19
  onClick?: (() => any) | undefined;
20
20
  }>, {
21
21
  type: "button" | "submit" | "reset";
22
- disabled: boolean;
23
22
  size: "sm" | "md" | "lg";
23
+ disabled: boolean;
24
24
  variant: "primary" | "secondary" | "danger";
25
25
  loading: boolean;
26
26
  customClass: string | Record<string, boolean>;
@@ -0,0 +1,24 @@
1
+ type __VLS_Props = {
2
+ label?: string;
3
+ };
4
+ type __VLS_ModelProps = {
5
+ modelValue: string | number;
6
+ };
7
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
8
+ declare var __VLS_1: {};
9
+ type __VLS_Slots = {} & {
10
+ default?: (props: typeof __VLS_1) => any;
11
+ };
12
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ "update:modelValue": (value: string | number) => any;
14
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
15
+ "onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
16
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
20
+ type __VLS_WithSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -11,8 +11,8 @@ declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {},
11
11
  }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
12
12
  onToggle?: ((value: boolean) => any) | undefined;
13
13
  }>, {
14
- disabled: boolean;
15
14
  size: "small" | "medium";
15
+ disabled: boolean;
16
16
  customClass: string;
17
17
  activeClass: string;
18
18
  inactiveClass: string;
@@ -0,0 +1,13 @@
1
+ type __VLS_Props = {
2
+ name: string;
3
+ type?: 'icon' | 'symbol';
4
+ size?: number;
5
+ alt?: string;
6
+ };
7
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
8
+ type: "icon" | "symbol";
9
+ size: number;
10
+ alt: string;
11
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -1,6 +1,8 @@
1
1
  import SideBar from "./sidebar/SideBar.vue";
2
2
  import SideButton from "./sidebar/SideButton.vue";
3
3
  import SideGroup from "./sidebar/SideGroup.vue";
4
+ import SelectField from "./forms/SelectField.vue";
5
+ import ThemeIcon from "./icons/ThemeIcon.vue";
4
6
  import WindowFrame from "./window/WindowFrame.vue";
5
7
  import ActionButton from "./controls/ActionButton.vue";
6
8
  import ConfigSection from "./layout/ConfigSection.vue";
@@ -16,5 +18,5 @@ declare const _default: {
16
18
  install(app: App): void;
17
19
  };
18
20
  export default _default;
19
- export { SideBar, SideButton, SideGroup, WindowFrame, ActionButton, ConfigSection, DeviceCard, FormGroup, ListCard, SliderControl, SwitchToggle, ToggleControl, TrayIconButton, };
21
+ export { SideBar, SideButton, SideGroup, SelectField, ThemeIcon, WindowFrame, ActionButton, ConfigSection, DeviceCard, FormGroup, ListCard, SliderControl, SwitchToggle, ToggleControl, TrayIconButton, };
20
22
  export type { SidebarCategory, SidebarItem } from "./sidebar/tipos";
@@ -0,0 +1,14 @@
1
+ import { type Ref } from 'vue';
2
+ /**
3
+ * Resolver un icono del tema del escritorio, y seguirlo cuando cambia.
4
+ *
5
+ * El pack de iconos cambia en caliente: sin escuchar el aviso, la ventana se
6
+ * queda con los del tema anterior hasta reabrirla. Y las resoluciones se
7
+ * cruzan —cambiar de icono y cambiar de tema resuelven en paralelo—, así que
8
+ * cada pedido lleva un testigo y sólo se aplica el último: sin él, la respuesta
9
+ * vieja llega última y deja puesto el icono de antes.
10
+ *
11
+ * Interno a propósito: lo comparten `ThemeIcon` y `SideButton`, y lo que las
12
+ * aplicaciones usan es el componente, no esto.
13
+ */
14
+ export declare function useIconoDelTema(nombre: Ref<string>, tipo: Ref<'icon' | 'symbol'>): Ref<string, string>;
@@ -12,15 +12,15 @@ type __VLS_Props = {
12
12
  collapseLabel?: string;
13
13
  expandLabel?: string;
14
14
  };
15
- declare var __VLS_1: {
15
+ declare var __VLS_6: {
16
16
  collapsed: false;
17
- }, __VLS_16: {
17
+ }, __VLS_26: {
18
18
  collapsed: boolean;
19
19
  };
20
20
  type __VLS_Slots = {} & {
21
- header?: (props: typeof __VLS_1) => any;
21
+ header?: (props: typeof __VLS_6) => any;
22
22
  } & {
23
- default?: (props: typeof __VLS_16) => any;
23
+ default?: (props: typeof __VLS_26) => any;
24
24
  };
25
25
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
26
26
  collapsed: import("vue").ComputedRef<boolean>;
@@ -11,8 +11,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
11
11
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
12
  onClick?: (() => any) | undefined;
13
13
  }>, {
14
- collapsed: boolean;
15
14
  icon: string;
15
+ collapsed: boolean;
16
16
  active: boolean;
17
17
  disabled: boolean;
18
18
  badge: string | number;
@@ -18,8 +18,8 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
18
18
  }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
19
19
  onClick?: (() => any) | undefined;
20
20
  }>, {
21
- badge: number | null;
22
21
  alt: string;
22
+ badge: number | null;
23
23
  customClass: string | Record<string, boolean>;
24
24
  tooltip: string;
25
25
  iconClass: string | Record<string, boolean>;
@@ -1,11 +1,56 @@
1
- import { defineComponent as h, ref as x, watch as L, createElementBlock as l, openBlock as a, createCommentVNode as u, createElementVNode as i, toDisplayString as m, normalizeClass as b, renderSlot as y, toRef as D, onMounted as T, onUnmounted as E, computed as w, onBeforeUnmount as O, Fragment as $, renderList as I, createBlock as A, withCtx as P, unref as z, createVNode as W, withModifiers as G } from "vue";
2
- import { getIconSource as C } from "@vasakgroup/plugin-vicons";
3
- import { listen as N } from "@tauri-apps/api/event";
4
- import { getCurrentWindow as R } from "@tauri-apps/api/window";
5
- const U = { class: "flex flex-col gap-2" }, q = ["aria-expanded"], H = {
1
+ import { ref as y, onMounted as V, onUnmounted as W, watch as j, defineComponent as g, toRef as D, computed as k, createElementBlock as l, unref as w, openBlock as a, normalizeStyle as F, createCommentVNode as m, createElementVNode as r, toDisplayString as b, normalizeClass as f, renderSlot as x, createBlock as A, onBeforeUnmount as R, createVNode as B, Fragment as S, renderList as L, withCtx as G, mergeModels as U, useAttrs as q, useId as H, useModel as J, withDirectives as K, mergeProps as Q, isRef as X, vModelSelect as Y, withModifiers as Z } from "vue";
2
+ import { listen as _ } from "@tauri-apps/api/event";
3
+ import { getSymbolSource as ee, getIconSource as $ } from "@vasakgroup/plugin-vicons";
4
+ import { getCurrentWindow as te } from "@tauri-apps/api/window";
5
+ function ae(e, s) {
6
+ const t = y("");
7
+ let n = null, i = !1, c = 0;
8
+ async function u() {
9
+ const d = ++c, o = e.value;
10
+ if (!o) {
11
+ t.value = "";
12
+ return;
13
+ }
14
+ const h = s.value === "symbol" ? await ee(o) : await $(o);
15
+ d === c && (t.value = h);
16
+ }
17
+ return V(async () => {
18
+ const d = await _("vicons:theme-changed", u);
19
+ if (i) {
20
+ d();
21
+ return;
22
+ }
23
+ n = d, await u();
24
+ }), W(() => {
25
+ i = !0, n?.();
26
+ }), j(e, u), t;
27
+ }
28
+ const le = ["src", "alt"], C = /* @__PURE__ */ g({
29
+ __name: "ThemeIcon",
30
+ props: {
31
+ name: {},
32
+ type: { default: "icon" },
33
+ size: { default: 18 },
34
+ alt: { default: "" }
35
+ },
36
+ setup(e) {
37
+ const s = e, t = ae(D(s, "name"), D(s, "type")), n = k(() => `${s.size}px`);
38
+ return (i, c) => w(t) ? (a(), l("img", {
39
+ key: 0,
40
+ src: w(t),
41
+ alt: e.alt,
42
+ style: F({ width: n.value, height: n.value }),
43
+ class: "shrink-0 object-contain"
44
+ }, null, 12, le)) : (a(), l("span", {
45
+ key: 1,
46
+ style: F({ width: n.value, height: n.value }),
47
+ class: "shrink-0"
48
+ }, null, 4));
49
+ }
50
+ }), ne = { class: "flex flex-col gap-2" }, se = ["aria-expanded"], oe = {
6
51
  key: 1,
7
52
  class: "flex flex-col gap-1"
8
- }, V = /* @__PURE__ */ h({
53
+ }, O = /* @__PURE__ */ g({
9
54
  __name: "SideGroup",
10
55
  props: {
11
56
  title: {},
@@ -13,37 +58,37 @@ const U = { class: "flex flex-col gap-2" }, q = ["aria-expanded"], H = {
13
58
  defaultOpen: { type: Boolean, default: !0 }
14
59
  },
15
60
  setup(e) {
16
- const s = e, t = x(s.defaultOpen);
17
- return L(
61
+ const s = e, t = y(s.defaultOpen);
62
+ return j(
18
63
  () => s.collapsed,
19
64
  (n) => {
20
65
  n && (t.value = !0);
21
66
  }
22
- ), (n, r) => (a(), l("section", U, [
23
- e.collapsed ? u("", !0) : (a(), l("button", {
67
+ ), (n, i) => (a(), l("section", ne, [
68
+ e.collapsed ? m("", !0) : (a(), l("button", {
24
69
  key: 0,
25
70
  type: "button",
26
71
  class: "group flex w-full items-center justify-between rounded-corner px-2 py-1 text-tx-muted text-xs uppercase tracking-[0.08em] hover:bg-ui-surface/60",
27
72
  "aria-expanded": t.value,
28
- onClick: r[0] || (r[0] = (c) => t.value = !t.value)
73
+ onClick: i[0] || (i[0] = (c) => t.value = !t.value)
29
74
  }, [
30
- i("span", null, m(e.title), 1),
31
- i("span", {
32
- class: b(["text-[10px] transition-transform duration-200", t.value ? "rotate-180" : ""])
75
+ r("span", null, b(e.title), 1),
76
+ r("span", {
77
+ class: f(["text-[10px] transition-transform duration-200", t.value ? "rotate-180" : ""])
33
78
  }, " v ", 2)
34
- ], 8, q)),
35
- t.value || e.collapsed ? (a(), l("div", H, [
36
- y(n.$slots, "default")
37
- ])) : u("", !0)
79
+ ], 8, se)),
80
+ t.value || e.collapsed ? (a(), l("div", oe, [
81
+ x(n.$slots, "default")
82
+ ])) : m("", !0)
38
83
  ]));
39
84
  }
40
- }), J = ["title", "aria-label", "disabled", "aria-current"], K = ["src"], Q = { key: 1 }, X = {
85
+ }), ie = ["title", "aria-label", "disabled", "aria-current"], re = { key: 1 }, ce = {
41
86
  key: 0,
42
87
  class: "min-w-0 flex-1 truncate font-medium"
43
- }, Y = {
88
+ }, de = {
44
89
  key: 1,
45
90
  class: "rounded-corner bg-ui-surface px-2 py-0.5 font-semibold text-tx-muted text-xs"
46
- }, M = /* @__PURE__ */ h({
91
+ }, P = /* @__PURE__ */ g({
47
92
  __name: "SideButton",
48
93
  props: {
49
94
  label: {},
@@ -55,70 +100,49 @@ const U = { class: "flex flex-col gap-2" }, q = ["aria-expanded"], H = {
55
100
  },
56
101
  emits: ["click"],
57
102
  setup(e) {
58
- const s = e, t = x(""), n = D(s, "icon");
59
- let r = null, c = !1, d = 0;
60
- async function f() {
61
- const o = ++d, g = n.value;
62
- if (!g) {
63
- t.value = "";
64
- return;
65
- }
66
- const p = await C(g);
67
- o === d && (t.value = p);
68
- }
69
- return T(async () => {
70
- const o = await N("vicons:theme-changed", f);
71
- if (c) {
72
- o();
73
- return;
74
- }
75
- r = o, await f();
76
- }), E(() => {
77
- c = !0, r?.();
78
- }), L(n, f), (o, g) => (a(), l("button", {
103
+ return (s, t) => (a(), l("button", {
79
104
  type: "button",
80
105
  title: e.collapsed ? e.label : void 0,
81
106
  "aria-label": e.collapsed ? e.label : void 0,
82
107
  disabled: e.disabled,
83
108
  "aria-current": e.active ? "page" : void 0,
84
- class: b(["group relative flex w-full items-center gap-3 rounded-corner border px-3 py-2 text-left text-sm transition-all duration-200", [
85
- e.active ? "border-secondary bg-primary/15 text-tx-main shadow-sm" : "border-transparent bg-ui-bg/30 hover:border-ui-border hover:bg-ui-surface/70",
109
+ class: f(["group relative flex w-full items-center gap-3 rounded-corner border px-3 py-2 text-left text-sm transition-all duration-200", [
110
+ e.active ? "border-secondary bg-primary/15 text-tx-main shadow-sm" : "border-transparent bg-transparent hover:border-ui-border hover:bg-ui-surface/70",
86
111
  e.disabled ? "cursor-not-allowed opacity-60" : "cursor-pointer",
87
112
  e.collapsed ? "justify-center px-2" : ""
88
113
  ]]),
89
- onClick: g[0] || (g[0] = (p) => o.$emit("click"))
114
+ onClick: t[0] || (t[0] = (n) => s.$emit("click"))
90
115
  }, [
91
- i("span", {
92
- class: b(["flex h-8 w-8 shrink-0 items-center justify-center rounded-corner font-semibold text-xs uppercase tracking-wide", e.active ? "border-secondary bg-primary/20" : ""]),
116
+ r("span", {
117
+ class: f(["flex h-8 w-8 shrink-0 items-center justify-center rounded-corner font-semibold text-xs uppercase tracking-wide", e.active ? "border-secondary bg-primary/20" : ""]),
93
118
  "aria-hidden": "true"
94
119
  }, [
95
- t.value ? (a(), l("img", {
120
+ e.icon ? (a(), A(C, {
96
121
  key: 0,
97
- src: t.value,
98
- alt: "",
99
- class: "h-8 w-8 object-contain"
100
- }, null, 8, K)) : (a(), l("span", Q, m(e.label.charAt(0).toUpperCase()), 1))
122
+ name: e.icon,
123
+ size: 20
124
+ }, null, 8, ["name"])) : (a(), l("span", re, b(e.label.charAt(0).toUpperCase()), 1))
101
125
  ], 2),
102
- e.collapsed ? u("", !0) : (a(), l("span", X, m(e.label), 1)),
103
- !e.collapsed && e.badge !== "" ? (a(), l("span", Y, m(e.badge), 1)) : u("", !0)
104
- ], 10, J));
126
+ e.collapsed ? m("", !0) : (a(), l("span", ce, b(e.label), 1)),
127
+ !e.collapsed && e.badge !== "" ? (a(), l("span", de, b(e.badge), 1)) : m("", !0)
128
+ ], 10, ie));
105
129
  }
106
- }), Z = {
130
+ }), ue = {
107
131
  key: 0,
108
132
  class: "flex flex-col gap-2 border-ui-border border-b p-2"
109
- }, _ = { class: "flex items-center gap-2" }, ee = ["aria-label", "aria-expanded"], te = {
133
+ }, me = { class: "flex items-center gap-2" }, fe = ["aria-label", "aria-expanded"], be = {
110
134
  key: 0,
111
135
  class: "min-w-0 flex-1"
112
- }, ae = {
136
+ }, ge = {
113
137
  key: 0,
114
138
  class: "truncate font-semibold text-sm"
115
- }, le = {
139
+ }, he = {
116
140
  key: 1,
117
141
  class: "truncate text-tx-muted text-xs"
118
- }, ne = { key: 0 }, oe = {
142
+ }, ve = { key: 0 }, ye = {
119
143
  key: 1,
120
- class: "flex justify-center border-ui-border border-b p-2"
121
- }, se = ["aria-label", "aria-expanded"], ie = { class: "flex-1 space-y-3 overflow-y-auto p-2" }, re = /* @__PURE__ */ h({
144
+ class: "flex border-ui-border border-b p-2"
145
+ }, xe = ["aria-label", "aria-expanded"], pe = { class: "flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto p-2" }, E = "hidden h-8 w-8 shrink-0 items-center justify-center rounded-corner border border-ui-border bg-ui-surface/70 transition-colors hover:bg-ui-surface md:inline-flex", ke = /* @__PURE__ */ g({
122
146
  __name: "SideBar",
123
147
  props: {
124
148
  title: { default: "" },
@@ -131,139 +155,194 @@ const U = { class: "flex flex-col gap-2" }, q = ["aria-expanded"], H = {
131
155
  },
132
156
  emits: ["update:modelValue", "update:collapsed", "change"],
133
157
  setup(e, { expose: s, emit: t }) {
134
- const n = e, r = t, c = x(n.collapsed ?? !1), d = x(!1);
135
- let f = null;
136
- const o = w(() => d.value || c.value), g = w(() => !!(n.title || n.subtitle));
137
- w(() => n.categories.length > 0);
138
- function p() {
139
- d.value = f?.matches ?? !1;
158
+ const n = e, i = t, c = y(n.collapsed ?? !1), u = y(!1);
159
+ let d = null;
160
+ const o = k(() => u.value || c.value), h = k(() => !!(n.title || n.subtitle));
161
+ k(() => n.categories.length > 0);
162
+ function I() {
163
+ u.value = d?.matches ?? !1;
140
164
  }
141
- function j() {
142
- c.value = !c.value, r("update:collapsed", c.value);
165
+ function M() {
166
+ c.value = !c.value, i("update:collapsed", c.value);
143
167
  }
144
- function F(v) {
145
- r("update:modelValue", v), r("change", v);
168
+ function N(v) {
169
+ i("update:modelValue", v), i("change", v);
146
170
  }
147
- return L(
171
+ return j(
148
172
  () => n.collapsed,
149
173
  (v) => {
150
174
  v !== void 0 && (c.value = v);
151
175
  }
152
- ), T(() => {
153
- f = window.matchMedia("(max-width: 767px)"), p(), f.addEventListener("change", p);
154
- }), O(() => f?.removeEventListener("change", p)), s({ collapsed: o }), (v, nt) => (a(), l("aside", {
155
- class: b(["relative z-30 flex h-full shrink-0 flex-col rounded-corner border border-ui-border bg-ui-bg/80 transition-all duration-300", ["w-[84px]", o.value ? "md:w-[84px]" : "md:w-72"]])
176
+ ), V(() => {
177
+ d = window.matchMedia("(max-width: 767px)"), I(), d.addEventListener("change", I);
178
+ }), R(() => d?.removeEventListener("change", I)), s({ collapsed: o }), (v, wt) => (a(), l("aside", {
179
+ class: f(["relative z-30 flex h-full shrink-0 flex-col rounded-corner border border-ui-border bg-ui-surface/70 transition-all duration-300", ["w-[84px]", o.value ? "md:w-[84px]" : "md:w-72"]])
156
180
  }, [
157
- g.value || v.$slots.header ? (a(), l("header", Z, [
158
- i("div", _, [
159
- i("button", {
181
+ h.value || v.$slots.header ? (a(), l("header", ue, [
182
+ r("div", me, [
183
+ r("button", {
160
184
  type: "button",
161
- class: "hidden h-10 w-10 items-center justify-center rounded-corner border border-ui-border bg-ui-surface/70 font-semibold text-sm md:inline-flex",
185
+ class: f(E),
162
186
  "aria-label": o.value ? e.expandLabel : e.collapseLabel,
163
187
  "aria-expanded": !o.value,
164
- onClick: j
165
- }, m(o.value ? ">" : "<"), 9, ee),
166
- g.value && !o.value ? (a(), l("div", te, [
167
- e.title ? (a(), l("p", ae, m(e.title), 1)) : u("", !0),
168
- e.subtitle ? (a(), l("p", le, m(e.subtitle), 1)) : u("", !0)
169
- ])) : u("", !0)
188
+ onClick: M
189
+ }, [
190
+ B(C, {
191
+ name: o.value ? "pan-end-symbolic" : "pan-start-symbolic",
192
+ type: "symbol",
193
+ size: 16
194
+ }, null, 8, ["name"])
195
+ ], 8, fe),
196
+ h.value && !o.value ? (a(), l("div", be, [
197
+ e.title ? (a(), l("p", ge, b(e.title), 1)) : m("", !0),
198
+ e.subtitle ? (a(), l("p", he, b(e.subtitle), 1)) : m("", !0)
199
+ ])) : m("", !0)
170
200
  ]),
171
- v.$slots.header && !o.value ? (a(), l("div", ne, [
172
- y(v.$slots, "header", { collapsed: o.value })
173
- ])) : u("", !0)
174
- ])) : (a(), l("div", oe, [
175
- i("button", {
201
+ v.$slots.header && !o.value ? (a(), l("div", ve, [
202
+ x(v.$slots, "header", { collapsed: o.value })
203
+ ])) : m("", !0)
204
+ ])) : (a(), l("div", ye, [
205
+ r("button", {
176
206
  type: "button",
177
- class: "hidden h-10 w-10 items-center justify-center rounded-corner border border-ui-border bg-ui-surface/70 font-semibold text-sm md:inline-flex",
207
+ class: f(E),
178
208
  "aria-label": o.value ? e.expandLabel : e.collapseLabel,
179
209
  "aria-expanded": !o.value,
180
- onClick: j
181
- }, m(o.value ? ">" : "<"), 9, se)
210
+ onClick: M
211
+ }, [
212
+ B(C, {
213
+ name: o.value ? "pan-end-symbolic" : "pan-start-symbolic",
214
+ type: "symbol",
215
+ size: 16
216
+ }, null, 8, ["name"])
217
+ ], 8, xe)
182
218
  ])),
183
- i("div", ie, [
184
- (a(!0), l($, null, I(e.categories, (S) => (a(), A(V, {
185
- key: S.id,
186
- title: S.title,
219
+ r("div", pe, [
220
+ (a(!0), l(S, null, L(e.categories, (T) => (a(), A(O, {
221
+ key: T.id,
222
+ title: T.title,
187
223
  collapsed: o.value
188
224
  }, {
189
- default: P(() => [
190
- (a(!0), l($, null, I(S.items, (k) => (a(), A(M, {
191
- key: k.id,
192
- label: k.label,
193
- icon: k.icon,
194
- badge: k.badge,
195
- disabled: k.disabled,
225
+ default: G(() => [
226
+ (a(!0), l(S, null, L(T.items, (p) => (a(), A(P, {
227
+ key: p.id,
228
+ label: p.label,
229
+ icon: p.icon,
230
+ badge: p.badge,
231
+ disabled: p.disabled,
196
232
  collapsed: o.value,
197
- active: e.modelValue === k.id,
198
- onClick: (ot) => F(k.id)
233
+ active: e.modelValue === p.id,
234
+ onClick: (Ct) => N(p.id)
199
235
  }, null, 8, ["label", "icon", "badge", "disabled", "collapsed", "active", "onClick"]))), 128))
200
236
  ]),
201
237
  _: 2
202
238
  }, 1032, ["title", "collapsed"]))), 128)),
203
- y(v.$slots, "default", { collapsed: o.value })
239
+ x(v.$slots, "default", { collapsed: o.value })
204
240
  ])
205
241
  ], 2));
206
242
  }
207
- }), ce = { "data-tauri-drag-region": "" }, de = ["src", "alt"], ue = { "data-tauri-drag-region": "" }, me = { "data-tauri-drag-region": "" }, fe = ["src"], be = ["src"], ge = ["src"], he = /* @__PURE__ */ h({
243
+ }), we = { class: "flex min-w-0 flex-col gap-1" }, Ce = ["for"], $e = { class: "relative flex min-w-0 items-center" }, Be = ["id"], Se = /* @__PURE__ */ g({
244
+ inheritAttrs: !1,
245
+ __name: "SelectField",
246
+ props: /* @__PURE__ */ U({
247
+ label: {}
248
+ }, {
249
+ modelValue: {
250
+ required: !0
251
+ },
252
+ modelModifiers: {}
253
+ }),
254
+ emits: ["update:modelValue"],
255
+ setup(e) {
256
+ const s = e, t = q(), n = H(), i = k(() => t.id ?? n), [c, u] = J(e, "modelValue", {
257
+ set(d) {
258
+ return u.number ? Number(d) : d;
259
+ }
260
+ });
261
+ return (d, o) => (a(), l("div", we, [
262
+ s.label ? (a(), l("label", {
263
+ key: 0,
264
+ for: i.value,
265
+ class: "text-tx-muted text-xs"
266
+ }, b(s.label), 9, Ce)) : m("", !0),
267
+ r("div", $e, [
268
+ K(r("select", Q({
269
+ id: i.value,
270
+ "onUpdate:modelValue": o[0] || (o[0] = (h) => X(c) ? c.value = h : null),
271
+ class: "min-w-0 flex-1 appearance-none truncate rounded-corner border border-ui-border bg-ui-surface/60 py-1.5 pr-8 pl-2 text-sm text-tx-main"
272
+ }, w(t)), [
273
+ x(d.$slots, "default")
274
+ ], 16, Be), [
275
+ [Y, w(c)]
276
+ ]),
277
+ B(C, {
278
+ name: "pan-down-symbolic",
279
+ type: "symbol",
280
+ size: 14,
281
+ class: "pointer-events-none absolute right-2"
282
+ })
283
+ ])
284
+ ]));
285
+ }
286
+ }), ze = { "data-tauri-drag-region": "" }, Ie = ["src", "alt"], Te = { "data-tauri-drag-region": "" }, Ae = { "data-tauri-drag-region": "" }, Le = ["src"], Ve = ["src"], je = ["src"], Me = /* @__PURE__ */ g({
208
287
  __name: "TopBar",
209
288
  props: {
210
289
  title: String,
211
290
  image: String
212
291
  },
213
292
  setup(e) {
214
- const s = x(null), t = R(), n = x(""), r = x(""), c = x(""), d = e;
215
- return T(async () => {
216
- n.value = await C("window-close"), r.value = await C("window-minimize"), c.value = await C("window-maximize");
217
- }), (f, o) => (a(), l("div", {
293
+ const s = y(null), t = te(), n = y(""), i = y(""), c = y(""), u = e;
294
+ return V(async () => {
295
+ n.value = await $("window-close"), i.value = await $("window-minimize"), c.value = await $("window-maximize");
296
+ }), (d, o) => (a(), l("div", {
218
297
  "data-tauri-drag-region": "",
219
298
  class: "flex h-8 px-4 py-1 bg-primary dark:bg-primary-dark rounded-t-corner-window justify-between align-center",
220
299
  ref_key: "bar",
221
300
  ref: s
222
301
  }, [
223
- i("div", ce, [
224
- i("img", {
225
- src: d.image,
302
+ r("div", ze, [
303
+ r("img", {
304
+ src: u.image,
226
305
  "data-tauri-drag-region": "",
227
306
  class: "h-6 w-auto",
228
- alt: d.title
229
- }, null, 8, de)
307
+ alt: u.title
308
+ }, null, 8, Ie)
230
309
  ]),
231
- i("div", ue, m(d.title), 1),
232
- i("div", me, [
233
- i("span", {
310
+ r("div", Te, b(u.title), 1),
311
+ r("div", Ae, [
312
+ r("span", {
234
313
  class: "win-button",
235
- onClick: o[0] || (o[0] = (g) => z(t).minimize())
314
+ onClick: o[0] || (o[0] = (h) => w(t).minimize())
236
315
  }, [
237
- i("img", {
238
- src: r.value,
316
+ r("img", {
317
+ src: i.value,
239
318
  class: "h-6 w-6 inline-block",
240
319
  alt: "Minimize"
241
- }, null, 8, fe)
320
+ }, null, 8, Le)
242
321
  ]),
243
- i("span", {
322
+ r("span", {
244
323
  class: "win-button",
245
- onClick: o[1] || (o[1] = (g) => z(t).toggleMaximize())
324
+ onClick: o[1] || (o[1] = (h) => w(t).toggleMaximize())
246
325
  }, [
247
- i("img", {
326
+ r("img", {
248
327
  src: c.value,
249
328
  class: "h-6 w-6 inline-block",
250
329
  alt: "Maximize"
251
- }, null, 8, be)
330
+ }, null, 8, Ve)
252
331
  ]),
253
- i("span", {
332
+ r("span", {
254
333
  class: "win-button",
255
- onClick: o[2] || (o[2] = (g) => z(t).close())
334
+ onClick: o[2] || (o[2] = (h) => w(t).close())
256
335
  }, [
257
- i("img", {
336
+ r("img", {
258
337
  src: n.value,
259
338
  class: "h-6 w-6 inline-block",
260
339
  alt: "Close"
261
- }, null, 8, ge)
340
+ }, null, 8, je)
262
341
  ])
263
342
  ])
264
343
  ], 512));
265
344
  }
266
- }), ve = /* @__PURE__ */ h({
345
+ }), De = /* @__PURE__ */ g({
267
346
  __name: "WindowFrame",
268
347
  props: {
269
348
  title: { default: "Vasak" },
@@ -271,18 +350,18 @@ const U = { class: "flex flex-col gap-2" }, q = ["aria-expanded"], H = {
271
350
  },
272
351
  setup(e) {
273
352
  const s = e;
274
- return (t, n) => (a(), l($, null, [
275
- W(he, {
353
+ return (t, n) => (a(), l(S, null, [
354
+ B(Me, {
276
355
  title: s.title,
277
356
  image: s.image
278
357
  }, null, 8, ["title", "image"]),
279
- y(t.$slots, "default")
358
+ x(t.$slots, "default")
280
359
  ], 64));
281
360
  }
282
- }), xe = ["type", "disabled"], ye = {
361
+ }), Fe = ["type", "disabled"], Ee = {
283
362
  key: 0,
284
363
  class: "w-4 h-4 animate-spin rounded-full border-2 border-current border-t-transparent"
285
- }, ke = ["src", "alt"], pe = { key: 2 }, we = ["src", "alt"], Ce = /* @__PURE__ */ h({
364
+ }, Oe = ["src", "alt"], Pe = { key: 2 }, Ne = ["src", "alt"], We = /* @__PURE__ */ g({
286
365
  __name: "ActionButton",
287
366
  props: {
288
367
  label: {},
@@ -301,7 +380,7 @@ const U = { class: "flex flex-col gap-2" }, q = ["aria-expanded"], H = {
301
380
  },
302
381
  emits: ["click"],
303
382
  setup(e, { emit: s }) {
304
- const t = e, n = s, r = {
383
+ const t = e, n = s, i = {
305
384
  primary: "bg-primary dark:bg-primary-dark text-tx-on-primary dark:text-tx-on-primary-dark hover:bg-primary/90 dark:hover:bg-primary-dark/90",
306
385
  secondary: "bg-secondary dark:bg-secondary-dark text-tx-on-primary dark:text-tx-on-primary-dark hover:bg-secondary/80 dark:hover:bg-secondary-dark/80",
307
386
  danger: "bg-status-error dark:bg-status-error-dark text-tx-on-primary dark:text-tx-on-primary-dark hover:bg-status-error/90 dark:hover:bg-status-error-dark/90"
@@ -309,14 +388,14 @@ const U = { class: "flex flex-col gap-2" }, q = ["aria-expanded"], H = {
309
388
  sm: "px-2 py-1 text-xs",
310
389
  md: "px-3 py-1 text-sm",
311
390
  lg: "px-4 py-2 text-base"
312
- }, d = (f) => {
313
- t.stopPropagation && f.stopPropagation(), t.preventDefault && f.preventDefault(), !t.disabled && !t.loading && n("click");
391
+ }, u = (d) => {
392
+ t.stopPropagation && d.stopPropagation(), t.preventDefault && d.preventDefault(), !t.disabled && !t.loading && n("click");
314
393
  };
315
- return (f, o) => (a(), l("button", {
394
+ return (d, o) => (a(), l("button", {
316
395
  type: t.type,
317
- onClick: d,
318
- class: b(["rounded-corner transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2", [
319
- r[t.variant],
396
+ onClick: u,
397
+ class: f(["rounded-corner transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2", [
398
+ i[t.variant],
320
399
  c[t.size],
321
400
  t.fullWidth ? "w-full" : "",
322
401
  t.iconSrc && !t.label ? "px-2 py-2" : "",
@@ -324,28 +403,28 @@ const U = { class: "flex flex-col gap-2" }, q = ["aria-expanded"], H = {
324
403
  ]]),
325
404
  disabled: t.disabled || t.loading
326
405
  }, [
327
- e.loading ? (a(), l("span", ye)) : u("", !0),
406
+ e.loading ? (a(), l("span", Ee)) : m("", !0),
328
407
  t.iconSrc && !t.iconRight ? (a(), l("img", {
329
408
  key: 1,
330
409
  src: t.iconSrc,
331
410
  alt: t.iconAlt || t.label,
332
411
  class: "w-4 h-4"
333
- }, null, 8, ke)) : u("", !0),
334
- t.label ? (a(), l("span", pe, m(t.label), 1)) : u("", !0),
412
+ }, null, 8, Oe)) : m("", !0),
413
+ t.label ? (a(), l("span", Pe, b(t.label), 1)) : m("", !0),
335
414
  t.iconSrc && t.iconRight ? (a(), l("img", {
336
415
  key: 3,
337
416
  src: t.iconSrc,
338
417
  alt: t.iconAlt || t.label,
339
418
  class: "w-4 h-4"
340
- }, null, 8, we)) : u("", !0)
341
- ], 10, xe));
419
+ }, null, 8, Ne)) : m("", !0)
420
+ ], 10, Fe));
342
421
  }
343
- }), B = (e, s) => {
422
+ }), z = (e, s) => {
344
423
  const t = e.__vccOpts || e;
345
- for (const [n, r] of s)
346
- t[n] = r;
424
+ for (const [n, i] of s)
425
+ t[n] = i;
347
426
  return t;
348
- }, $e = /* @__PURE__ */ B(Ce, [["__scopeId", "data-v-2eaf6e27"]]), Be = { class: "text-base font-semibold m-0 text-primary dark:text-primary-dark" }, Se = /* @__PURE__ */ h({
427
+ }, Re = /* @__PURE__ */ z(We, [["__scopeId", "data-v-2eaf6e27"]]), Ge = { class: "text-base font-semibold m-0 text-primary dark:text-primary-dark" }, Ue = /* @__PURE__ */ g({
349
428
  __name: "ConfigSection",
350
429
  props: {
351
430
  title: {},
@@ -354,25 +433,25 @@ const U = { class: "flex flex-col gap-2" }, q = ["aria-expanded"], H = {
354
433
  },
355
434
  setup(e) {
356
435
  return (s, t) => (a(), l("div", {
357
- class: b(["flex flex-col gap-4 p-4 background rounded-corner", e.customClass])
436
+ class: f(["flex flex-col gap-4 p-4 background rounded-corner", e.customClass])
358
437
  }, [
359
- i("h3", Be, m(e.icon ? `${e.icon} ${e.title}` : e.title), 1),
360
- y(s.$slots, "default", {}, void 0, !0)
438
+ r("h3", Ge, b(e.icon ? `${e.icon} ${e.title}` : e.title), 1),
439
+ x(s.$slots, "default", {}, void 0, !0)
361
440
  ], 2));
362
441
  }
363
- }), ze = /* @__PURE__ */ B(Se, [["__scopeId", "data-v-45bd4eab"]]), Ie = { class: "flex items-center gap-3 flex-1 min-w-0" }, Le = ["src", "alt"], Te = { class: "min-w-0" }, je = { class: "font-semibold truncate" }, Ae = {
442
+ }), qe = /* @__PURE__ */ z(Ue, [["__scopeId", "data-v-45bd4eab"]]), He = { class: "flex items-center gap-3 flex-1 min-w-0" }, Je = ["src", "alt"], Ke = { class: "min-w-0" }, Qe = { class: "font-semibold truncate" }, Xe = {
364
443
  key: 0,
365
444
  class: "text-xs text-gray-400 truncate"
366
- }, Ve = {
445
+ }, Ye = {
367
446
  key: 1,
368
447
  class: "text-xs text-gray-400 truncate"
369
- }, Me = {
448
+ }, Ze = {
370
449
  key: 2,
371
450
  class: "text-xs text-gray-400 flex gap-2 mt-1"
372
- }, Fe = {
451
+ }, _e = {
373
452
  key: 1,
374
453
  class: "w-2 h-2 rounded-full bg-green-500"
375
- }, De = /* @__PURE__ */ h({
454
+ }, et = /* @__PURE__ */ g({
376
455
  __name: "DeviceCard",
377
456
  props: {
378
457
  icon: {},
@@ -391,37 +470,37 @@ const U = { class: "flex flex-col gap-2" }, q = ["aria-expanded"], H = {
391
470
  setup(e, { emit: s }) {
392
471
  const t = s, n = () => {
393
472
  t("action");
394
- }, r = () => {
473
+ }, i = () => {
395
474
  t("click");
396
475
  };
397
- return (c, d) => (a(), l("div", {
398
- class: b(["flex items-center justify-between background rounded-vsk px-6 py-3 mb-4", [{ "border-l-4 border-green-500": e.isConnected }, e.customClass]]),
399
- onClick: r
476
+ return (c, u) => (a(), l("div", {
477
+ class: f(["flex items-center justify-between background rounded-vsk px-6 py-3 mb-4", [{ "border-l-4 border-green-500": e.isConnected }, e.customClass]]),
478
+ onClick: i
400
479
  }, [
401
- i("div", Ie, [
402
- i("img", {
480
+ r("div", He, [
481
+ r("img", {
403
482
  src: e.icon,
404
483
  alt: e.title,
405
484
  class: "h-7 w-7 shrink-0"
406
- }, null, 8, Le),
407
- i("div", Te, [
408
- i("div", je, m(e.title), 1),
409
- e.subtitle ? (a(), l("div", Ae, m(e.subtitle), 1)) : u("", !0),
410
- e.metadata ? (a(), l("div", Ve, m(e.metadata), 1)) : u("", !0),
411
- e.extraInfo && e.extraInfo.length > 0 ? (a(), l("div", Me, [
412
- (a(!0), l($, null, I(e.extraInfo, (f, o) => (a(), l("span", { key: o }, m(f), 1))), 128))
413
- ])) : u("", !0)
485
+ }, null, 8, Je),
486
+ r("div", Ke, [
487
+ r("div", Qe, b(e.title), 1),
488
+ e.subtitle ? (a(), l("div", Xe, b(e.subtitle), 1)) : m("", !0),
489
+ e.metadata ? (a(), l("div", Ye, b(e.metadata), 1)) : m("", !0),
490
+ e.extraInfo && e.extraInfo.length > 0 ? (a(), l("div", Ze, [
491
+ (a(!0), l(S, null, L(e.extraInfo, (d, o) => (a(), l("span", { key: o }, b(d), 1))), 128))
492
+ ])) : m("", !0)
414
493
  ])
415
494
  ]),
416
495
  e.showActionButton ? (a(), l("button", {
417
496
  key: 0,
418
497
  class: "bg-vsk-primary rounded-vsk px-4 py-2 text-sm font-semibold cursor-pointer hover:opacity-70",
419
- onClick: G(n, ["stop"])
420
- }, m(e.actionLabel), 1)) : u("", !0),
421
- e.showStatusIndicator && e.isConnected ? (a(), l("div", Fe)) : u("", !0)
498
+ onClick: Z(n, ["stop"])
499
+ }, b(e.actionLabel), 1)) : m("", !0),
500
+ e.showStatusIndicator && e.isConnected ? (a(), l("div", _e)) : m("", !0)
422
501
  ], 2));
423
502
  }
424
- }), Ee = ["for"], Oe = /* @__PURE__ */ h({
503
+ }), tt = ["for"], at = /* @__PURE__ */ g({
425
504
  __name: "FormGroup",
426
505
  props: {
427
506
  label: {},
@@ -431,17 +510,17 @@ const U = { class: "flex flex-col gap-2" }, q = ["aria-expanded"], H = {
431
510
  },
432
511
  setup(e) {
433
512
  return (s, t) => (a(), l("div", {
434
- class: b(["flex flex-col gap-2", e.customClass])
513
+ class: f(["flex flex-col gap-2", e.customClass])
435
514
  }, [
436
515
  e.label ? (a(), l("label", {
437
516
  key: 0,
438
517
  for: e.htmlFor,
439
- class: b(["text-sm font-medium text-primary dark:text-primary-dark", e.labelClass])
440
- }, m(e.label), 11, Ee)) : u("", !0),
441
- y(s.$slots, "default", {}, void 0, !0)
518
+ class: f(["text-sm font-medium text-primary dark:text-primary-dark", e.labelClass])
519
+ }, b(e.label), 11, tt)) : m("", !0),
520
+ x(s.$slots, "default", {}, void 0, !0)
442
521
  ], 2));
443
522
  }
444
- }), Pe = /* @__PURE__ */ B(Oe, [["__scopeId", "data-v-c0d9d9cb"]]), We = /* @__PURE__ */ h({
523
+ }), lt = /* @__PURE__ */ z(at, [["__scopeId", "data-v-c0d9d9cb"]]), nt = /* @__PURE__ */ g({
445
524
  __name: "ListCard",
446
525
  props: {
447
526
  clickable: { type: Boolean, default: !1 },
@@ -449,26 +528,26 @@ const U = { class: "flex flex-col gap-2" }, q = ["aria-expanded"], H = {
449
528
  },
450
529
  emits: ["click"],
451
530
  setup(e, { emit: s }) {
452
- const t = e, n = s, r = () => {
531
+ const t = e, n = s, i = () => {
453
532
  t.clickable && n("click");
454
533
  };
455
- return (c, d) => (a(), l("div", {
456
- class: b([
534
+ return (c, u) => (a(), l("div", {
535
+ class: f([
457
536
  "flex items-center justify-between background p-3 rounded-vsk border border-vsk-primary/70 transition-colors duration-200",
458
537
  {
459
538
  "hover:bg-vsk-primary/5 cursor-pointer": t.clickable
460
539
  },
461
540
  e.customClass
462
541
  ]),
463
- onClick: r
542
+ onClick: i
464
543
  }, [
465
- y(c.$slots, "default", {}, void 0, !0)
544
+ x(c.$slots, "default", {}, void 0, !0)
466
545
  ], 2));
467
546
  }
468
- }), Ge = /* @__PURE__ */ B(We, [["__scopeId", "data-v-f86d47da"]]), Ne = { class: "background rounded-corner flex flex-row items-center gap-2 justify-between w-full h-auto p-4 transition-all duration-200 hover:bg-ui-surface/80 dark:hover:bg-ui-surface-dark/80" }, Re = ["src", "alt", "title"], Ue = {
547
+ }), st = /* @__PURE__ */ z(nt, [["__scopeId", "data-v-f86d47da"]]), ot = { class: "background rounded-corner flex flex-row items-center gap-2 justify-between w-full h-auto p-4 transition-all duration-200 hover:bg-ui-surface/80 dark:hover:bg-ui-surface-dark/80" }, it = ["src", "alt", "title"], rt = {
469
548
  key: 1,
470
549
  class: "w-8 h-8 flex items-center justify-center"
471
- }, qe = ["src", "alt"], He = ["min", "max", "value"], Je = /* @__PURE__ */ h({
550
+ }, ct = ["src", "alt"], dt = ["min", "max", "value"], ut = /* @__PURE__ */ g({
472
551
  __name: "SliderControl",
473
552
  props: {
474
553
  icon: {},
@@ -483,49 +562,49 @@ const U = { class: "flex flex-col gap-2" }, q = ["aria-expanded"], H = {
483
562
  },
484
563
  emits: ["update:modelValue", "buttonClick"],
485
564
  setup(e, { emit: s }) {
486
- const t = e, n = s, r = w(() => {
565
+ const t = e, n = s, i = k(() => {
487
566
  if (t.max <= t.min) return 0;
488
- const o = t.max - t.min, g = t.modelValue - t.min;
489
- return Math.round(g / o * 100);
490
- }), c = w(() => t.getPercentageClass ? t.getPercentageClass(r.value) : ""), d = (o) => {
491
- const g = o.target;
492
- n("update:modelValue", Number(g.value));
493
- }, f = () => {
567
+ const o = t.max - t.min, h = t.modelValue - t.min;
568
+ return Math.round(h / o * 100);
569
+ }), c = k(() => t.getPercentageClass ? t.getPercentageClass(i.value) : ""), u = (o) => {
570
+ const h = o.target;
571
+ n("update:modelValue", Number(h.value));
572
+ }, d = () => {
494
573
  n("buttonClick");
495
574
  };
496
- return (o, g) => (a(), l("div", Ne, [
575
+ return (o, h) => (a(), l("div", ot, [
497
576
  e.showButton ? (a(), l("button", {
498
577
  key: 0,
499
- onClick: f,
578
+ onClick: d,
500
579
  class: "w-8 h-8 flex items-center justify-center rounded-corner transition-all duration-200 hover:bg-ui-surface/80 dark:hover:bg-ui-surface-dark/80 hover:scale-110 active:scale-95"
501
580
  }, [
502
- i("img", {
581
+ r("img", {
503
582
  src: e.icon,
504
583
  alt: e.alt,
505
584
  title: e.tooltip,
506
- class: b(["w-6 h-6 transition-all duration-200", e.iconClass])
507
- }, null, 10, Re)
508
- ])) : (a(), l("div", Ue, [
509
- i("img", {
585
+ class: f(["w-6 h-6 transition-all duration-200", e.iconClass])
586
+ }, null, 10, it)
587
+ ])) : (a(), l("div", rt, [
588
+ r("img", {
510
589
  src: e.icon,
511
590
  alt: e.alt,
512
591
  class: "w-6 h-6 transition-all duration-200"
513
- }, null, 8, qe)
592
+ }, null, 8, ct)
514
593
  ])),
515
- i("input", {
594
+ r("input", {
516
595
  type: "range",
517
596
  min: e.min,
518
597
  max: e.max,
519
598
  value: e.modelValue,
520
- onInput: d,
599
+ onInput: u,
521
600
  class: "flex-1 transition-all duration-200 hover:scale-105"
522
- }, null, 40, He),
523
- i("span", {
524
- class: b(["w-12 text-right transition-all duration-200 font-medium", c.value])
525
- }, m(r.value) + "% ", 3)
601
+ }, null, 40, dt),
602
+ r("span", {
603
+ class: f(["w-12 text-right transition-all duration-200 font-medium", c.value])
604
+ }, b(i.value) + "% ", 3)
526
605
  ]));
527
606
  }
528
- }), Ke = ["disabled"], Qe = /* @__PURE__ */ h({
607
+ }), mt = ["disabled"], ft = /* @__PURE__ */ g({
529
608
  __name: "SwitchToggle",
530
609
  props: {
531
610
  isOn: { type: Boolean },
@@ -537,14 +616,14 @@ const U = { class: "flex flex-col gap-2" }, q = ["aria-expanded"], H = {
537
616
  },
538
617
  emits: ["toggle"],
539
618
  setup(e, { emit: s }) {
540
- const t = e, n = s, r = () => {
619
+ const t = e, n = s, i = () => {
541
620
  n("toggle", !t.isOn);
542
621
  };
543
- return (c, d) => (a(), l("button", {
622
+ return (c, u) => (a(), l("button", {
544
623
  type: "button",
545
- onClick: r,
624
+ onClick: i,
546
625
  disabled: e.disabled,
547
- class: b([
626
+ class: f([
548
627
  "relative inline-flex items-center rounded-full transition-colors",
549
628
  e.size === "small" ? "h-6 w-11" : "h-7 w-12",
550
629
  e.isOn ? e.activeClass : e.inactiveClass,
@@ -552,16 +631,16 @@ const U = { class: "flex flex-col gap-2" }, q = ["aria-expanded"], H = {
552
631
  e.customClass
553
632
  ])
554
633
  }, [
555
- i("span", {
556
- class: b([
634
+ r("span", {
635
+ class: f([
557
636
  "inline-block transform rounded-full bg-white shadow transition-transform",
558
637
  e.size === "small" ? "h-4 w-4" : "h-6 w-6",
559
638
  e.isOn ? e.size === "small" ? "translate-x-6" : "translate-x-5" : "translate-x-1"
560
639
  ])
561
640
  }, null, 2)
562
- ], 10, Ke));
641
+ ], 10, mt));
563
642
  }
564
- }), Xe = ["disabled"], Ye = ["src", "alt", "title"], Ze = /* @__PURE__ */ h({
643
+ }), bt = ["disabled"], gt = ["src", "alt", "title"], ht = /* @__PURE__ */ g({
565
644
  __name: "ToggleControl",
566
645
  props: {
567
646
  icon: {},
@@ -577,9 +656,9 @@ const U = { class: "flex flex-col gap-2" }, q = ["aria-expanded"], H = {
577
656
  const t = s, n = () => {
578
657
  t("click");
579
658
  };
580
- return (r, c) => (a(), l("button", {
659
+ return (i, c) => (a(), l("button", {
581
660
  onClick: n,
582
- class: b(["p-2 rounded-corner background hover:opacity-50 transition-all duration-300 h-17.5 w-17.5 group relative overflow-hidden hover:scale-105 hover:shadow-lg active:scale-95", {
661
+ class: f(["p-2 rounded-corner background hover:opacity-50 transition-all duration-300 h-17.5 w-17.5 group relative overflow-hidden hover:scale-105 hover:shadow-lg active:scale-95", {
583
662
  "animate-pulse": e.isLoading,
584
663
  "ring-2 ring-primary dark:ring-primary-dark": e.isActive,
585
664
  "opacity-60": !e.isActive,
@@ -587,23 +666,23 @@ const U = { class: "flex flex-col gap-2" }, q = ["aria-expanded"], H = {
587
666
  }]),
588
667
  disabled: e.isLoading
589
668
  }, [
590
- i("img", {
669
+ r("img", {
591
670
  src: e.icon,
592
671
  alt: e.alt,
593
672
  title: e.tooltip,
594
- class: b(["m-auto w-12.5 h-12.5 transition-all duration-300 group-hover:scale-110 relative z-10", {
673
+ class: f(["m-auto w-12.5 h-12.5 transition-all duration-300 group-hover:scale-110 relative z-10", {
595
674
  "animate-spin": e.isLoading,
596
675
  "filter brightness-75": !e.isActive,
597
676
  "drop-shadow-lg": e.isActive,
598
677
  ...e.iconClass
599
678
  }])
600
- }, null, 10, Ye)
601
- ], 10, Xe));
679
+ }, null, 10, gt)
680
+ ], 10, bt));
602
681
  }
603
- }), _e = ["title"], et = ["src", "alt"], tt = {
682
+ }), vt = ["title"], yt = ["src", "alt"], xt = {
604
683
  key: 0,
605
684
  class: "absolute bottom-1 right-1 bg-primary dark:bg-primary-dark text-white text-xs rounded-full w-4 h-4 flex items-center justify-center font-bold animate-bounce"
606
- }, at = /* @__PURE__ */ h({
685
+ }, pt = /* @__PURE__ */ g({
607
686
  __name: "TrayIconButton",
608
687
  props: {
609
688
  icon: {},
@@ -618,69 +697,73 @@ const U = { class: "flex flex-col gap-2" }, q = ["aria-expanded"], H = {
618
697
  },
619
698
  emits: ["click"],
620
699
  setup(e, { emit: s }) {
621
- const t = s, n = x(!1), r = () => {
700
+ const t = s, n = y(!1), i = () => {
622
701
  t("click");
623
702
  };
624
- return (c, d) => (a(), l("div", {
625
- class: b(["p-1 rounded-corner relative hover:bg-primary dark:hover:bg-primary-dark group transition-all duration-300", e.customClass]),
703
+ return (c, u) => (a(), l("div", {
704
+ class: f(["p-1 rounded-corner relative hover:bg-primary dark:hover:bg-primary-dark group transition-all duration-300", e.customClass]),
626
705
  title: e.tooltip,
627
- onClick: r,
628
- onMouseenter: d[0] || (d[0] = (f) => n.value = !0),
629
- onMouseleave: d[1] || (d[1] = (f) => n.value = !1)
706
+ onClick: i,
707
+ onMouseenter: u[0] || (u[0] = (d) => n.value = !0),
708
+ onMouseleave: u[1] || (u[1] = (d) => n.value = !1)
630
709
  }, [
631
- i("img", {
710
+ r("img", {
632
711
  src: e.icon,
633
712
  alt: e.alt,
634
- class: b(["m-auto h-5.5 w-auto transition-all duration-300", e.iconClass])
635
- }, null, 10, et),
636
- e.badge !== null && e.badge > 0 ? (a(), l("div", tt, m(e.badge), 1)) : u("", !0),
713
+ class: f(["m-auto h-5.5 w-auto transition-all duration-300", e.iconClass])
714
+ }, null, 10, yt),
715
+ e.badge !== null && e.badge > 0 ? (a(), l("div", xt, b(e.badge), 1)) : m("", !0),
637
716
  e.showCustomTooltip && e.customTooltipText ? (a(), l("div", {
638
717
  key: 1,
639
- class: b(["absolute top-1 left-1/2 transform -translate-x-1/2 text-xs font-semibold p-1 rounded-corner transition-all duration-300 pointer-events-none background", [
718
+ class: f(["absolute top-1 left-1/2 transform -translate-x-1/2 text-xs font-semibold p-1 rounded-corner transition-all duration-300 pointer-events-none background", [
640
719
  e.tooltipClass,
641
720
  {
642
721
  "opacity-0 -translate-y-2": !n.value,
643
722
  "opacity-100 translate-y-0": n.value
644
723
  }
645
724
  ]])
646
- }, m(e.customTooltipText), 3)) : u("", !0),
647
- y(c.$slots, "default")
648
- ], 42, _e));
725
+ }, b(e.customTooltipText), 3)) : m("", !0),
726
+ x(c.$slots, "default")
727
+ ], 42, vt));
649
728
  }
650
- }), lt = [
651
- re,
652
- M,
653
- V,
654
- ve,
655
- $e,
656
- ze,
729
+ }), kt = [
730
+ ke,
731
+ P,
732
+ O,
733
+ Se,
734
+ C,
657
735
  De,
658
- Pe,
659
- Ge,
660
- Je,
661
- Qe,
662
- Ze,
663
- at
664
- ], dt = {
736
+ Re,
737
+ qe,
738
+ et,
739
+ lt,
740
+ st,
741
+ ut,
742
+ ft,
743
+ ht,
744
+ pt
745
+ ], It = {
665
746
  install(e) {
666
- lt.forEach((s) => {
747
+ kt.forEach((s) => {
667
748
  e.component(s.name, s);
668
749
  });
669
750
  }
670
751
  };
671
752
  export {
672
- $e as ActionButton,
673
- ze as ConfigSection,
674
- De as DeviceCard,
675
- Pe as FormGroup,
676
- Ge as ListCard,
677
- re as SideBar,
678
- M as SideButton,
679
- V as SideGroup,
680
- Je as SliderControl,
681
- Qe as SwitchToggle,
682
- Ze as ToggleControl,
683
- at as TrayIconButton,
684
- ve as WindowFrame,
685
- dt as default
753
+ Re as ActionButton,
754
+ qe as ConfigSection,
755
+ et as DeviceCard,
756
+ lt as FormGroup,
757
+ st as ListCard,
758
+ Se as SelectField,
759
+ ke as SideBar,
760
+ P as SideButton,
761
+ O as SideGroup,
762
+ ut as SliderControl,
763
+ ft as SwitchToggle,
764
+ C as ThemeIcon,
765
+ ht as ToggleControl,
766
+ pt as TrayIconButton,
767
+ De as WindowFrame,
768
+ It as default
686
769
  };
@@ -1 +1 @@
1
- (function(s,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@vasakgroup/plugin-vicons"),require("@tauri-apps/api/event"),require("@tauri-apps/api/window")):typeof define=="function"&&define.amd?define(["exports","vue","@vasakgroup/plugin-vicons","@tauri-apps/api/event","@tauri-apps/api/window"],e):(s=typeof globalThis<"u"?globalThis:s||self,e(s.VueLibVasak={},s.Vue,s.VasakVicons,s.TauriEvent,s.TauriWindow))})(this,(function(s,e,b,I,L){"use strict";const j={class:"flex flex-col gap-2"},A=["aria-expanded"],M={key:1,class:"flex flex-col gap-1"},g=e.defineComponent({__name:"SideGroup",props:{title:{},collapsed:{type:Boolean,default:!1},defaultOpen:{type:Boolean,default:!0}},setup(t){const n=t,a=e.ref(n.defaultOpen);return e.watch(()=>n.collapsed,l=>{l&&(a.value=!0)}),(l,i)=>(e.openBlock(),e.createElementBlock("section",j,[t.collapsed?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"group flex w-full items-center justify-between rounded-corner px-2 py-1 text-tx-muted text-xs uppercase tracking-[0.08em] hover:bg-ui-surface/60","aria-expanded":a.value,onClick:i[0]||(i[0]=r=>a.value=!a.value)},[e.createElementVNode("span",null,e.toDisplayString(t.title),1),e.createElementVNode("span",{class:e.normalizeClass(["text-[10px] transition-transform duration-200",a.value?"rotate-180":""])}," v ",2)],8,A)),a.value||t.collapsed?(e.openBlock(),e.createElementBlock("div",M,[e.renderSlot(l.$slots,"default")])):e.createCommentVNode("",!0)]))}}),F=["title","aria-label","disabled","aria-current"],O=["src"],P={key:1},W={key:0,class:"min-w-0 flex-1 truncate font-medium"},G={key:1,class:"rounded-corner bg-ui-surface px-2 py-0.5 font-semibold text-tx-muted text-xs"},h=e.defineComponent({__name:"SideButton",props:{label:{},icon:{default:""},active:{type:Boolean,default:!1},collapsed:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},badge:{default:""}},emits:["click"],setup(t){const n=t,a=e.ref(""),l=e.toRef(n,"icon");let i=null,r=!1,c=0;async function d(){const o=++c,m=l.value;if(!m){a.value="";return}const k=await b.getIconSource(m);o===c&&(a.value=k)}return e.onMounted(async()=>{const o=await I.listen("vicons:theme-changed",d);if(r){o();return}i=o,await d()}),e.onUnmounted(()=>{r=!0,i?.()}),e.watch(l,d),(o,m)=>(e.openBlock(),e.createElementBlock("button",{type:"button",title:t.collapsed?t.label:void 0,"aria-label":t.collapsed?t.label:void 0,disabled:t.disabled,"aria-current":t.active?"page":void 0,class:e.normalizeClass(["group relative flex w-full items-center gap-3 rounded-corner border px-3 py-2 text-left text-sm transition-all duration-200",[t.active?"border-secondary bg-primary/15 text-tx-main shadow-sm":"border-transparent bg-ui-bg/30 hover:border-ui-border hover:bg-ui-surface/70",t.disabled?"cursor-not-allowed opacity-60":"cursor-pointer",t.collapsed?"justify-center px-2":""]]),onClick:m[0]||(m[0]=k=>o.$emit("click"))},[e.createElementVNode("span",{class:e.normalizeClass(["flex h-8 w-8 shrink-0 items-center justify-center rounded-corner font-semibold text-xs uppercase tracking-wide",t.active?"border-secondary bg-primary/20":""]),"aria-hidden":"true"},[a.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.value,alt:"",class:"h-8 w-8 object-contain"},null,8,O)):(e.openBlock(),e.createElementBlock("span",P,e.toDisplayString(t.label.charAt(0).toUpperCase()),1))],2),t.collapsed?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",W,e.toDisplayString(t.label),1)),!t.collapsed&&t.badge!==""?(e.openBlock(),e.createElementBlock("span",G,e.toDisplayString(t.badge),1)):e.createCommentVNode("",!0)],10,F))}}),q={key:0,class:"flex flex-col gap-2 border-ui-border border-b p-2"},R={class:"flex items-center gap-2"},U=["aria-label","aria-expanded"],H={key:0,class:"min-w-0 flex-1"},J={key:0,class:"truncate font-semibold text-sm"},K={key:1,class:"truncate text-tx-muted text-xs"},Q={key:0},X={key:1,class:"flex justify-center border-ui-border border-b p-2"},Y=["aria-label","aria-expanded"],Z={class:"flex-1 space-y-3 overflow-y-auto p-2"},x=e.defineComponent({__name:"SideBar",props:{title:{default:""},subtitle:{default:""},categories:{default:()=>[]},modelValue:{default:""},collapsed:{type:Boolean,default:void 0},collapseLabel:{default:"Collapse"},expandLabel:{default:"Expand"}},emits:["update:modelValue","update:collapsed","change"],setup(t,{expose:n,emit:a}){const l=t,i=a,r=e.ref(l.collapsed??!1),c=e.ref(!1);let d=null;const o=e.computed(()=>c.value||r.value),m=e.computed(()=>!!(l.title||l.subtitle));e.computed(()=>l.categories.length>0);function k(){c.value=d?.matches??!1}function T(){r.value=!r.value,i("update:collapsed",r.value)}function Ae(u){i("update:modelValue",u),i("change",u)}return e.watch(()=>l.collapsed,u=>{u!==void 0&&(r.value=u)}),e.onMounted(()=>{d=window.matchMedia("(max-width: 767px)"),k(),d.addEventListener("change",k)}),e.onBeforeUnmount(()=>d?.removeEventListener("change",k)),n({collapsed:o}),(u,Pe)=>(e.openBlock(),e.createElementBlock("aside",{class:e.normalizeClass(["relative z-30 flex h-full shrink-0 flex-col rounded-corner border border-ui-border bg-ui-bg/80 transition-all duration-300",["w-[84px]",o.value?"md:w-[84px]":"md:w-72"]])},[m.value||u.$slots.header?(e.openBlock(),e.createElementBlock("header",q,[e.createElementVNode("div",R,[e.createElementVNode("button",{type:"button",class:"hidden h-10 w-10 items-center justify-center rounded-corner border border-ui-border bg-ui-surface/70 font-semibold text-sm md:inline-flex","aria-label":o.value?t.expandLabel:t.collapseLabel,"aria-expanded":!o.value,onClick:T},e.toDisplayString(o.value?">":"<"),9,U),m.value&&!o.value?(e.openBlock(),e.createElementBlock("div",H,[t.title?(e.openBlock(),e.createElementBlock("p",J,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.subtitle?(e.openBlock(),e.createElementBlock("p",K,e.toDisplayString(t.subtitle),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),u.$slots.header&&!o.value?(e.openBlock(),e.createElementBlock("div",Q,[e.renderSlot(u.$slots,"header",{collapsed:o.value})])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",X,[e.createElementVNode("button",{type:"button",class:"hidden h-10 w-10 items-center justify-center rounded-corner border border-ui-border bg-ui-surface/70 font-semibold text-sm md:inline-flex","aria-label":o.value?t.expandLabel:t.collapseLabel,"aria-expanded":!o.value,onClick:T},e.toDisplayString(o.value?">":"<"),9,Y)])),e.createElementVNode("div",Z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.categories,y=>(e.openBlock(),e.createBlock(g,{key:y.id,title:y.title,collapsed:o.value},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.items,f=>(e.openBlock(),e.createBlock(h,{key:f.id,label:f.label,icon:f.icon,badge:f.badge,disabled:f.disabled,collapsed:o.value,active:t.modelValue===f.id,onClick:We=>Ae(f.id)},null,8,["label","icon","badge","disabled","collapsed","active","onClick"]))),128))]),_:2},1032,["title","collapsed"]))),128)),e.renderSlot(u.$slots,"default",{collapsed:o.value})])],2))}}),_={"data-tauri-drag-region":""},v=["src","alt"],ee={"data-tauri-drag-region":""},te={"data-tauri-drag-region":""},ae=["src"],le=["src"],oe=["src"],ne=e.defineComponent({__name:"TopBar",props:{title:String,image:String},setup(t){const n=e.ref(null),a=L.getCurrentWindow(),l=e.ref(""),i=e.ref(""),r=e.ref(""),c=t;return e.onMounted(async()=>{l.value=await b.getIconSource("window-close"),i.value=await b.getIconSource("window-minimize"),r.value=await b.getIconSource("window-maximize")}),(d,o)=>(e.openBlock(),e.createElementBlock("div",{"data-tauri-drag-region":"",class:"flex h-8 px-4 py-1 bg-primary dark:bg-primary-dark rounded-t-corner-window justify-between align-center",ref_key:"bar",ref:n},[e.createElementVNode("div",_,[e.createElementVNode("img",{src:c.image,"data-tauri-drag-region":"",class:"h-6 w-auto",alt:c.title},null,8,v)]),e.createElementVNode("div",ee,e.toDisplayString(c.title),1),e.createElementVNode("div",te,[e.createElementVNode("span",{class:"win-button",onClick:o[0]||(o[0]=m=>e.unref(a).minimize())},[e.createElementVNode("img",{src:i.value,class:"h-6 w-6 inline-block",alt:"Minimize"},null,8,ae)]),e.createElementVNode("span",{class:"win-button",onClick:o[1]||(o[1]=m=>e.unref(a).toggleMaximize())},[e.createElementVNode("img",{src:r.value,class:"h-6 w-6 inline-block",alt:"Maximize"},null,8,le)]),e.createElementVNode("span",{class:"win-button",onClick:o[2]||(o[2]=m=>e.unref(a).close())},[e.createElementVNode("img",{src:l.value,class:"h-6 w-6 inline-block",alt:"Close"},null,8,oe)])])],512))}}),C=e.defineComponent({__name:"WindowFrame",props:{title:{default:"Vasak"},image:{default:""}},setup(t){const n=t;return(a,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(ne,{title:n.title,image:n.image},null,8,["title","image"]),e.renderSlot(a.$slots,"default")],64))}}),ie=["type","disabled"],se={key:0,class:"w-4 h-4 animate-spin rounded-full border-2 border-current border-t-transparent"},re=["src","alt"],ce={key:2},de=["src","alt"],me=e.defineComponent({__name:"ActionButton",props:{label:{},disabled:{type:Boolean,default:!1},variant:{default:"primary"},loading:{type:Boolean,default:!1},customClass:{default:()=>({})},size:{default:"md"},fullWidth:{type:Boolean,default:!1},iconSrc:{default:""},iconAlt:{default:""},iconRight:{type:Boolean,default:!1},type:{default:"button"},stopPropagation:{type:Boolean,default:!1},preventDefault:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:n}){const a=t,l=n,i={primary:"bg-primary dark:bg-primary-dark text-tx-on-primary dark:text-tx-on-primary-dark hover:bg-primary/90 dark:hover:bg-primary-dark/90",secondary:"bg-secondary dark:bg-secondary-dark text-tx-on-primary dark:text-tx-on-primary-dark hover:bg-secondary/80 dark:hover:bg-secondary-dark/80",danger:"bg-status-error dark:bg-status-error-dark text-tx-on-primary dark:text-tx-on-primary-dark hover:bg-status-error/90 dark:hover:bg-status-error-dark/90"},r={sm:"px-2 py-1 text-xs",md:"px-3 py-1 text-sm",lg:"px-4 py-2 text-base"},c=d=>{a.stopPropagation&&d.stopPropagation(),a.preventDefault&&d.preventDefault(),!a.disabled&&!a.loading&&l("click")};return(d,o)=>(e.openBlock(),e.createElementBlock("button",{type:a.type,onClick:c,class:e.normalizeClass(["rounded-corner transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",[i[a.variant],r[a.size],a.fullWidth?"w-full":"",a.iconSrc&&!a.label?"px-2 py-2":"",t.customClass]]),disabled:a.disabled||a.loading},[t.loading?(e.openBlock(),e.createElementBlock("span",se)):e.createCommentVNode("",!0),a.iconSrc&&!a.iconRight?(e.openBlock(),e.createElementBlock("img",{key:1,src:a.iconSrc,alt:a.iconAlt||a.label,class:"w-4 h-4"},null,8,re)):e.createCommentVNode("",!0),a.label?(e.openBlock(),e.createElementBlock("span",ce,e.toDisplayString(a.label),1)):e.createCommentVNode("",!0),a.iconSrc&&a.iconRight?(e.openBlock(),e.createElementBlock("img",{key:3,src:a.iconSrc,alt:a.iconAlt||a.label,class:"w-4 h-4"},null,8,de)):e.createCommentVNode("",!0)],10,ie))}}),p=(t,n)=>{const a=t.__vccOpts||t;for(const[l,i]of n)a[l]=i;return a},B=p(me,[["__scopeId","data-v-2eaf6e27"]]),ue={class:"text-base font-semibold m-0 text-primary dark:text-primary-dark"},w=p(e.defineComponent({__name:"ConfigSection",props:{title:{},icon:{default:""},customClass:{default:()=>({})}},setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-4 p-4 background rounded-corner",t.customClass])},[e.createElementVNode("h3",ue,e.toDisplayString(t.icon?`${t.icon} ${t.title}`:t.title),1),e.renderSlot(n.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-45bd4eab"]]),fe={class:"flex items-center gap-3 flex-1 min-w-0"},ke=["src","alt"],be={class:"min-w-0"},pe={class:"font-semibold truncate"},ge={key:0,class:"text-xs text-gray-400 truncate"},he={key:1,class:"text-xs text-gray-400 truncate"},ye={key:2,class:"text-xs text-gray-400 flex gap-2 mt-1"},xe={key:1,class:"w-2 h-2 rounded-full bg-green-500"},E=e.defineComponent({__name:"DeviceCard",props:{icon:{},title:{},subtitle:{default:""},metadata:{default:""},extraInfo:{default:()=>[]},isConnected:{type:Boolean,default:!1},showActionButton:{type:Boolean,default:!0},actionLabel:{default:"Conectar"},showStatusIndicator:{type:Boolean,default:!1},customClass:{default:""},clickable:{type:Boolean,default:!1}},emits:["action","click"],setup(t,{emit:n}){const a=n,l=()=>{a("action")},i=()=>{a("click")};return(r,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex items-center justify-between background rounded-vsk px-6 py-3 mb-4",[{"border-l-4 border-green-500":t.isConnected},t.customClass]]),onClick:i},[e.createElementVNode("div",fe,[e.createElementVNode("img",{src:t.icon,alt:t.title,class:"h-7 w-7 shrink-0"},null,8,ke),e.createElementVNode("div",be,[e.createElementVNode("div",pe,e.toDisplayString(t.title),1),t.subtitle?(e.openBlock(),e.createElementBlock("div",ge,e.toDisplayString(t.subtitle),1)):e.createCommentVNode("",!0),t.metadata?(e.openBlock(),e.createElementBlock("div",he,e.toDisplayString(t.metadata),1)):e.createCommentVNode("",!0),t.extraInfo&&t.extraInfo.length>0?(e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.extraInfo,(d,o)=>(e.openBlock(),e.createElementBlock("span",{key:o},e.toDisplayString(d),1))),128))])):e.createCommentVNode("",!0)])]),t.showActionButton?(e.openBlock(),e.createElementBlock("button",{key:0,class:"bg-vsk-primary rounded-vsk px-4 py-2 text-sm font-semibold cursor-pointer hover:opacity-70",onClick:e.withModifiers(l,["stop"])},e.toDisplayString(t.actionLabel),1)):e.createCommentVNode("",!0),t.showStatusIndicator&&t.isConnected?(e.openBlock(),e.createElementBlock("div",xe)):e.createCommentVNode("",!0)],2))}}),Ce=["for"],$=p(e.defineComponent({__name:"FormGroup",props:{label:{},htmlFor:{default:""},customClass:{default:()=>({})},labelClass:{default:()=>({})}},setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-2",t.customClass])},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:t.htmlFor,class:e.normalizeClass(["text-sm font-medium text-primary dark:text-primary-dark",t.labelClass])},e.toDisplayString(t.label),11,Ce)):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-c0d9d9cb"]]),V=p(e.defineComponent({__name:"ListCard",props:{clickable:{type:Boolean,default:!1},customClass:{default:()=>({})}},emits:["click"],setup(t,{emit:n}){const a=t,l=n,i=()=>{a.clickable&&l("click")};return(r,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex items-center justify-between background p-3 rounded-vsk border border-vsk-primary/70 transition-colors duration-200",{"hover:bg-vsk-primary/5 cursor-pointer":a.clickable},t.customClass]),onClick:i},[e.renderSlot(r.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-f86d47da"]]),Be={class:"background rounded-corner flex flex-row items-center gap-2 justify-between w-full h-auto p-4 transition-all duration-200 hover:bg-ui-surface/80 dark:hover:bg-ui-surface-dark/80"},we=["src","alt","title"],Ee={key:1,class:"w-8 h-8 flex items-center justify-center"},$e=["src","alt"],Ve=["min","max","value"],S=e.defineComponent({__name:"SliderControl",props:{icon:{},alt:{default:""},tooltip:{default:""},modelValue:{},min:{default:0},max:{default:100},showButton:{type:Boolean,default:!1},iconClass:{default:()=>({})},getPercentageClass:{type:Function,default:()=>""}},emits:["update:modelValue","buttonClick"],setup(t,{emit:n}){const a=t,l=n,i=e.computed(()=>{if(a.max<=a.min)return 0;const o=a.max-a.min,m=a.modelValue-a.min;return Math.round(m/o*100)}),r=e.computed(()=>a.getPercentageClass?a.getPercentageClass(i.value):""),c=o=>{const m=o.target;l("update:modelValue",Number(m.value))},d=()=>{l("buttonClick")};return(o,m)=>(e.openBlock(),e.createElementBlock("div",Be,[t.showButton?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:d,class:"w-8 h-8 flex items-center justify-center rounded-corner transition-all duration-200 hover:bg-ui-surface/80 dark:hover:bg-ui-surface-dark/80 hover:scale-110 active:scale-95"},[e.createElementVNode("img",{src:t.icon,alt:t.alt,title:t.tooltip,class:e.normalizeClass(["w-6 h-6 transition-all duration-200",t.iconClass])},null,10,we)])):(e.openBlock(),e.createElementBlock("div",Ee,[e.createElementVNode("img",{src:t.icon,alt:t.alt,class:"w-6 h-6 transition-all duration-200"},null,8,$e)])),e.createElementVNode("input",{type:"range",min:t.min,max:t.max,value:t.modelValue,onInput:c,class:"flex-1 transition-all duration-200 hover:scale-105"},null,40,Ve),e.createElementVNode("span",{class:e.normalizeClass(["w-12 text-right transition-all duration-200 font-medium",r.value])},e.toDisplayString(i.value)+"% ",3)]))}}),Se=["disabled"],N=e.defineComponent({__name:"SwitchToggle",props:{isOn:{type:Boolean},disabled:{type:Boolean,default:!1},size:{default:"small"},activeClass:{default:"bg-primary dark:bg-primary-dark"},inactiveClass:{default:"background"},customClass:{default:""}},emits:["toggle"],setup(t,{emit:n}){const a=t,l=n,i=()=>{l("toggle",!a.isOn)};return(r,c)=>(e.openBlock(),e.createElementBlock("button",{type:"button",onClick:i,disabled:t.disabled,class:e.normalizeClass(["relative inline-flex items-center rounded-full transition-colors",t.size==="small"?"h-6 w-11":"h-7 w-12",t.isOn?t.activeClass:t.inactiveClass,t.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer",t.customClass])},[e.createElementVNode("span",{class:e.normalizeClass(["inline-block transform rounded-full bg-white shadow transition-transform",t.size==="small"?"h-4 w-4":"h-6 w-6",t.isOn?t.size==="small"?"translate-x-6":"translate-x-5":"translate-x-1"])},null,2)],10,Se))}}),Ne=["disabled"],ze=["src","alt","title"],z=e.defineComponent({__name:"ToggleControl",props:{icon:{},alt:{default:""},tooltip:{default:""},isActive:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1},iconClass:{default:()=>({})},customClass:{default:()=>({})}},emits:["click"],setup(t,{emit:n}){const a=n,l=()=>{a("click")};return(i,r)=>(e.openBlock(),e.createElementBlock("button",{onClick:l,class:e.normalizeClass(["p-2 rounded-corner background hover:opacity-50 transition-all duration-300 h-17.5 w-17.5 group relative overflow-hidden hover:scale-105 hover:shadow-lg active:scale-95",{"animate-pulse":t.isLoading,"ring-2 ring-primary dark:ring-primary-dark":t.isActive,"opacity-60":!t.isActive,...t.customClass}]),disabled:t.isLoading},[e.createElementVNode("img",{src:t.icon,alt:t.alt,title:t.tooltip,class:e.normalizeClass(["m-auto w-12.5 h-12.5 transition-all duration-300 group-hover:scale-110 relative z-10",{"animate-spin":t.isLoading,"filter brightness-75":!t.isActive,"drop-shadow-lg":t.isActive,...t.iconClass}])},null,10,ze)],10,Ne))}}),De=["title"],Te=["src","alt"],Ie={key:0,class:"absolute bottom-1 right-1 bg-primary dark:bg-primary-dark text-white text-xs rounded-full w-4 h-4 flex items-center justify-center font-bold animate-bounce"},D=e.defineComponent({__name:"TrayIconButton",props:{icon:{},alt:{default:""},tooltip:{default:""},badge:{default:null},iconClass:{default:()=>({})},customClass:{default:""},tooltipClass:{default:""},showCustomTooltip:{type:Boolean,default:!1},customTooltipText:{default:""}},emits:["click"],setup(t,{emit:n}){const a=n,l=e.ref(!1),i=()=>{a("click")};return(r,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["p-1 rounded-corner relative hover:bg-primary dark:hover:bg-primary-dark group transition-all duration-300",t.customClass]),title:t.tooltip,onClick:i,onMouseenter:c[0]||(c[0]=d=>l.value=!0),onMouseleave:c[1]||(c[1]=d=>l.value=!1)},[e.createElementVNode("img",{src:t.icon,alt:t.alt,class:e.normalizeClass(["m-auto h-5.5 w-auto transition-all duration-300",t.iconClass])},null,10,Te),t.badge!==null&&t.badge>0?(e.openBlock(),e.createElementBlock("div",Ie,e.toDisplayString(t.badge),1)):e.createCommentVNode("",!0),t.showCustomTooltip&&t.customTooltipText?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["absolute top-1 left-1/2 transform -translate-x-1/2 text-xs font-semibold p-1 rounded-corner transition-all duration-300 pointer-events-none background",[t.tooltipClass,{"opacity-0 -translate-y-2":!l.value,"opacity-100 translate-y-0":l.value}]])},e.toDisplayString(t.customTooltipText),3)):e.createCommentVNode("",!0),e.renderSlot(r.$slots,"default")],42,De))}}),Le=[x,h,g,C,B,w,E,$,V,S,N,z,D],je={install(t){Le.forEach(n=>{t.component(n.name,n)})}};s.ActionButton=B,s.ConfigSection=w,s.DeviceCard=E,s.FormGroup=$,s.ListCard=V,s.SideBar=x,s.SideButton=h,s.SideGroup=g,s.SliderControl=S,s.SwitchToggle=N,s.ToggleControl=z,s.TrayIconButton=D,s.WindowFrame=C,s.default=je,Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ (function(r,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@tauri-apps/api/event"),require("@vasakgroup/plugin-vicons"),require("@tauri-apps/api/window")):typeof define=="function"&&define.amd?define(["exports","vue","@tauri-apps/api/event","@vasakgroup/plugin-vicons","@tauri-apps/api/window"],e):(r=typeof globalThis<"u"?globalThis:r||self,e(r.VueLibVasak={},r.Vue,r.TauriEvent,r.VasakVicons,r.TauriWindow))})(this,(function(r,e,M,p,j){"use strict";function F(t,o){const a=e.ref("");let l=null,s=!1,i=0;async function d(){const c=++i,n=t.value;if(!n){a.value="";return}const m=o.value==="symbol"?await p.getSymbolSource(n):await p.getIconSource(n);c===i&&(a.value=m)}return e.onMounted(async()=>{const c=await M.listen("vicons:theme-changed",d);if(s){c();return}l=c,await d()}),e.onUnmounted(()=>{s=!0,l?.()}),e.watch(t,d),a}const O=["src","alt"],k=e.defineComponent({__name:"ThemeIcon",props:{name:{},type:{default:"icon"},size:{default:18},alt:{default:""}},setup(t){const o=t,a=F(e.toRef(o,"name"),e.toRef(o,"type")),l=e.computed(()=>`${o.size}px`);return(s,i)=>e.unref(a)?(e.openBlock(),e.createElementBlock("img",{key:0,src:e.unref(a),alt:t.alt,style:e.normalizeStyle({width:l.value,height:l.value}),class:"shrink-0 object-contain"},null,12,O)):(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle({width:l.value,height:l.value}),class:"shrink-0"},null,4))}}),P={class:"flex flex-col gap-2"},W=["aria-expanded"],R={key:1,class:"flex flex-col gap-1"},g=e.defineComponent({__name:"SideGroup",props:{title:{},collapsed:{type:Boolean,default:!1},defaultOpen:{type:Boolean,default:!0}},setup(t){const o=t,a=e.ref(o.defaultOpen);return e.watch(()=>o.collapsed,l=>{l&&(a.value=!0)}),(l,s)=>(e.openBlock(),e.createElementBlock("section",P,[t.collapsed?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"group flex w-full items-center justify-between rounded-corner px-2 py-1 text-tx-muted text-xs uppercase tracking-[0.08em] hover:bg-ui-surface/60","aria-expanded":a.value,onClick:s[0]||(s[0]=i=>a.value=!a.value)},[e.createElementVNode("span",null,e.toDisplayString(t.title),1),e.createElementVNode("span",{class:e.normalizeClass(["text-[10px] transition-transform duration-200",a.value?"rotate-180":""])}," v ",2)],8,W)),a.value||t.collapsed?(e.openBlock(),e.createElementBlock("div",R,[e.renderSlot(l.$slots,"default")])):e.createCommentVNode("",!0)]))}}),q=["title","aria-label","disabled","aria-current"],G={key:1},U={key:0,class:"min-w-0 flex-1 truncate font-medium"},_={key:1,class:"rounded-corner bg-ui-surface px-2 py-0.5 font-semibold text-tx-muted text-xs"},h=e.defineComponent({__name:"SideButton",props:{label:{},icon:{default:""},active:{type:Boolean,default:!1},collapsed:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},badge:{default:""}},emits:["click"],setup(t){return(o,a)=>(e.openBlock(),e.createElementBlock("button",{type:"button",title:t.collapsed?t.label:void 0,"aria-label":t.collapsed?t.label:void 0,disabled:t.disabled,"aria-current":t.active?"page":void 0,class:e.normalizeClass(["group relative flex w-full items-center gap-3 rounded-corner border px-3 py-2 text-left text-sm transition-all duration-200",[t.active?"border-secondary bg-primary/15 text-tx-main shadow-sm":"border-transparent bg-transparent hover:border-ui-border hover:bg-ui-surface/70",t.disabled?"cursor-not-allowed opacity-60":"cursor-pointer",t.collapsed?"justify-center px-2":""]]),onClick:a[0]||(a[0]=l=>o.$emit("click"))},[e.createElementVNode("span",{class:e.normalizeClass(["flex h-8 w-8 shrink-0 items-center justify-center rounded-corner font-semibold text-xs uppercase tracking-wide",t.active?"border-secondary bg-primary/20":""]),"aria-hidden":"true"},[t.icon?(e.openBlock(),e.createBlock(k,{key:0,name:t.icon,size:20},null,8,["name"])):(e.openBlock(),e.createElementBlock("span",G,e.toDisplayString(t.label.charAt(0).toUpperCase()),1))],2),t.collapsed?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",U,e.toDisplayString(t.label),1)),!t.collapsed&&t.badge!==""?(e.openBlock(),e.createElementBlock("span",_,e.toDisplayString(t.badge),1)):e.createCommentVNode("",!0)],10,q))}}),H={key:0,class:"flex flex-col gap-2 border-ui-border border-b p-2"},J={class:"flex items-center gap-2"},K=["aria-label","aria-expanded"],Q={key:0,class:"min-w-0 flex-1"},X={key:0,class:"truncate font-semibold text-sm"},Y={key:1,class:"truncate text-tx-muted text-xs"},Z={key:0},v={key:1,class:"flex border-ui-border border-b p-2"},ee=["aria-label","aria-expanded"],te={class:"flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto p-2"},C="hidden h-8 w-8 shrink-0 items-center justify-center rounded-corner border border-ui-border bg-ui-surface/70 transition-colors hover:bg-ui-surface md:inline-flex",B=e.defineComponent({__name:"SideBar",props:{title:{default:""},subtitle:{default:""},categories:{default:()=>[]},modelValue:{default:""},collapsed:{type:Boolean,default:void 0},collapseLabel:{default:"Collapse"},expandLabel:{default:"Expand"}},emits:["update:modelValue","update:collapsed","change"],setup(t,{expose:o,emit:a}){const l=t,s=a,i=e.ref(l.collapsed??!1),d=e.ref(!1);let c=null;const n=e.computed(()=>d.value||i.value),m=e.computed(()=>!!(l.title||l.subtitle));e.computed(()=>l.categories.length>0);function y(){d.value=c?.matches??!1}function A(){i.value=!i.value,s("update:collapsed",i.value)}function Ge(f){s("update:modelValue",f),s("change",f)}return e.watch(()=>l.collapsed,f=>{f!==void 0&&(i.value=f)}),e.onMounted(()=>{c=window.matchMedia("(max-width: 767px)"),y(),c.addEventListener("change",y)}),e.onBeforeUnmount(()=>c?.removeEventListener("change",y)),o({collapsed:n}),(f,Je)=>(e.openBlock(),e.createElementBlock("aside",{class:e.normalizeClass(["relative z-30 flex h-full shrink-0 flex-col rounded-corner border border-ui-border bg-ui-surface/70 transition-all duration-300",["w-[84px]",n.value?"md:w-[84px]":"md:w-72"]])},[m.value||f.$slots.header?(e.openBlock(),e.createElementBlock("header",H,[e.createElementVNode("div",J,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(C),"aria-label":n.value?t.expandLabel:t.collapseLabel,"aria-expanded":!n.value,onClick:A},[e.createVNode(k,{name:n.value?"pan-end-symbolic":"pan-start-symbolic",type:"symbol",size:16},null,8,["name"])],8,K),m.value&&!n.value?(e.openBlock(),e.createElementBlock("div",Q,[t.title?(e.openBlock(),e.createElementBlock("p",X,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.subtitle?(e.openBlock(),e.createElementBlock("p",Y,e.toDisplayString(t.subtitle),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),f.$slots.header&&!n.value?(e.openBlock(),e.createElementBlock("div",Z,[e.renderSlot(f.$slots,"header",{collapsed:n.value})])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(C),"aria-label":n.value?t.expandLabel:t.collapseLabel,"aria-expanded":!n.value,onClick:A},[e.createVNode(k,{name:n.value?"pan-end-symbolic":"pan-start-symbolic",type:"symbol",size:16},null,8,["name"])],8,ee)])),e.createElementVNode("div",te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.categories,x=>(e.openBlock(),e.createBlock(g,{key:x.id,title:x.title,collapsed:n.value},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.items,u=>(e.openBlock(),e.createBlock(h,{key:u.id,label:u.label,icon:u.icon,badge:u.badge,disabled:u.disabled,collapsed:n.value,active:t.modelValue===u.id,onClick:Ke=>Ge(u.id)},null,8,["label","icon","badge","disabled","collapsed","active","onClick"]))),128))]),_:2},1032,["title","collapsed"]))),128)),e.renderSlot(f.$slots,"default",{collapsed:n.value})])],2))}}),ae={class:"flex min-w-0 flex-col gap-1"},le=["for"],oe={class:"relative flex min-w-0 items-center"},ne=["id"],w=e.defineComponent({inheritAttrs:!1,__name:"SelectField",props:e.mergeModels({label:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=t,a=e.useAttrs(),l=e.useId(),s=e.computed(()=>a.id??l),[i,d]=e.useModel(t,"modelValue",{set(c){return d.number?Number(c):c}});return(c,n)=>(e.openBlock(),e.createElementBlock("div",ae,[o.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:s.value,class:"text-tx-muted text-xs"},e.toDisplayString(o.label),9,le)):e.createCommentVNode("",!0),e.createElementVNode("div",oe,[e.withDirectives(e.createElementVNode("select",e.mergeProps({id:s.value,"onUpdate:modelValue":n[0]||(n[0]=m=>e.isRef(i)?i.value=m:null),class:"min-w-0 flex-1 appearance-none truncate rounded-corner border border-ui-border bg-ui-surface/60 py-1.5 pr-8 pl-2 text-sm text-tx-main"},e.unref(a)),[e.renderSlot(c.$slots,"default")],16,ne),[[e.vModelSelect,e.unref(i)]]),e.createVNode(k,{name:"pan-down-symbolic",type:"symbol",size:14,class:"pointer-events-none absolute right-2"})])]))}}),se={"data-tauri-drag-region":""},ie=["src","alt"],re={"data-tauri-drag-region":""},ce={"data-tauri-drag-region":""},de=["src"],me=["src"],fe=["src"],ue=e.defineComponent({__name:"TopBar",props:{title:String,image:String},setup(t){const o=e.ref(null),a=j.getCurrentWindow(),l=e.ref(""),s=e.ref(""),i=e.ref(""),d=t;return e.onMounted(async()=>{l.value=await p.getIconSource("window-close"),s.value=await p.getIconSource("window-minimize"),i.value=await p.getIconSource("window-maximize")}),(c,n)=>(e.openBlock(),e.createElementBlock("div",{"data-tauri-drag-region":"",class:"flex h-8 px-4 py-1 bg-primary dark:bg-primary-dark rounded-t-corner-window justify-between align-center",ref_key:"bar",ref:o},[e.createElementVNode("div",se,[e.createElementVNode("img",{src:d.image,"data-tauri-drag-region":"",class:"h-6 w-auto",alt:d.title},null,8,ie)]),e.createElementVNode("div",re,e.toDisplayString(d.title),1),e.createElementVNode("div",ce,[e.createElementVNode("span",{class:"win-button",onClick:n[0]||(n[0]=m=>e.unref(a).minimize())},[e.createElementVNode("img",{src:s.value,class:"h-6 w-6 inline-block",alt:"Minimize"},null,8,de)]),e.createElementVNode("span",{class:"win-button",onClick:n[1]||(n[1]=m=>e.unref(a).toggleMaximize())},[e.createElementVNode("img",{src:i.value,class:"h-6 w-6 inline-block",alt:"Maximize"},null,8,me)]),e.createElementVNode("span",{class:"win-button",onClick:n[2]||(n[2]=m=>e.unref(a).close())},[e.createElementVNode("img",{src:l.value,class:"h-6 w-6 inline-block",alt:"Close"},null,8,fe)])])],512))}}),E=e.defineComponent({__name:"WindowFrame",props:{title:{default:"Vasak"},image:{default:""}},setup(t){const o=t;return(a,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(ue,{title:o.title,image:o.image},null,8,["title","image"]),e.renderSlot(a.$slots,"default")],64))}}),ke=["type","disabled"],pe={key:0,class:"w-4 h-4 animate-spin rounded-full border-2 border-current border-t-transparent"},be=["src","alt"],ge={key:2},he=["src","alt"],ye=e.defineComponent({__name:"ActionButton",props:{label:{},disabled:{type:Boolean,default:!1},variant:{default:"primary"},loading:{type:Boolean,default:!1},customClass:{default:()=>({})},size:{default:"md"},fullWidth:{type:Boolean,default:!1},iconSrc:{default:""},iconAlt:{default:""},iconRight:{type:Boolean,default:!1},type:{default:"button"},stopPropagation:{type:Boolean,default:!1},preventDefault:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:o}){const a=t,l=o,s={primary:"bg-primary dark:bg-primary-dark text-tx-on-primary dark:text-tx-on-primary-dark hover:bg-primary/90 dark:hover:bg-primary-dark/90",secondary:"bg-secondary dark:bg-secondary-dark text-tx-on-primary dark:text-tx-on-primary-dark hover:bg-secondary/80 dark:hover:bg-secondary-dark/80",danger:"bg-status-error dark:bg-status-error-dark text-tx-on-primary dark:text-tx-on-primary-dark hover:bg-status-error/90 dark:hover:bg-status-error-dark/90"},i={sm:"px-2 py-1 text-xs",md:"px-3 py-1 text-sm",lg:"px-4 py-2 text-base"},d=c=>{a.stopPropagation&&c.stopPropagation(),a.preventDefault&&c.preventDefault(),!a.disabled&&!a.loading&&l("click")};return(c,n)=>(e.openBlock(),e.createElementBlock("button",{type:a.type,onClick:d,class:e.normalizeClass(["rounded-corner transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",[s[a.variant],i[a.size],a.fullWidth?"w-full":"",a.iconSrc&&!a.label?"px-2 py-2":"",t.customClass]]),disabled:a.disabled||a.loading},[t.loading?(e.openBlock(),e.createElementBlock("span",pe)):e.createCommentVNode("",!0),a.iconSrc&&!a.iconRight?(e.openBlock(),e.createElementBlock("img",{key:1,src:a.iconSrc,alt:a.iconAlt||a.label,class:"w-4 h-4"},null,8,be)):e.createCommentVNode("",!0),a.label?(e.openBlock(),e.createElementBlock("span",ge,e.toDisplayString(a.label),1)):e.createCommentVNode("",!0),a.iconSrc&&a.iconRight?(e.openBlock(),e.createElementBlock("img",{key:3,src:a.iconSrc,alt:a.iconAlt||a.label,class:"w-4 h-4"},null,8,he)):e.createCommentVNode("",!0)],10,ke))}}),b=(t,o)=>{const a=t.__vccOpts||t;for(const[l,s]of o)a[l]=s;return a},$=b(ye,[["__scopeId","data-v-2eaf6e27"]]),xe={class:"text-base font-semibold m-0 text-primary dark:text-primary-dark"},V=b(e.defineComponent({__name:"ConfigSection",props:{title:{},icon:{default:""},customClass:{default:()=>({})}},setup(t){return(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-4 p-4 background rounded-corner",t.customClass])},[e.createElementVNode("h3",xe,e.toDisplayString(t.icon?`${t.icon} ${t.title}`:t.title),1),e.renderSlot(o.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-45bd4eab"]]),Ce={class:"flex items-center gap-3 flex-1 min-w-0"},Be=["src","alt"],we={class:"min-w-0"},Ee={class:"font-semibold truncate"},$e={key:0,class:"text-xs text-gray-400 truncate"},Ve={key:1,class:"text-xs text-gray-400 truncate"},Se={key:2,class:"text-xs text-gray-400 flex gap-2 mt-1"},Ne={key:1,class:"w-2 h-2 rounded-full bg-green-500"},S=e.defineComponent({__name:"DeviceCard",props:{icon:{},title:{},subtitle:{default:""},metadata:{default:""},extraInfo:{default:()=>[]},isConnected:{type:Boolean,default:!1},showActionButton:{type:Boolean,default:!0},actionLabel:{default:"Conectar"},showStatusIndicator:{type:Boolean,default:!1},customClass:{default:""},clickable:{type:Boolean,default:!1}},emits:["action","click"],setup(t,{emit:o}){const a=o,l=()=>{a("action")},s=()=>{a("click")};return(i,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex items-center justify-between background rounded-vsk px-6 py-3 mb-4",[{"border-l-4 border-green-500":t.isConnected},t.customClass]]),onClick:s},[e.createElementVNode("div",Ce,[e.createElementVNode("img",{src:t.icon,alt:t.title,class:"h-7 w-7 shrink-0"},null,8,Be),e.createElementVNode("div",we,[e.createElementVNode("div",Ee,e.toDisplayString(t.title),1),t.subtitle?(e.openBlock(),e.createElementBlock("div",$e,e.toDisplayString(t.subtitle),1)):e.createCommentVNode("",!0),t.metadata?(e.openBlock(),e.createElementBlock("div",Ve,e.toDisplayString(t.metadata),1)):e.createCommentVNode("",!0),t.extraInfo&&t.extraInfo.length>0?(e.openBlock(),e.createElementBlock("div",Se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.extraInfo,(c,n)=>(e.openBlock(),e.createElementBlock("span",{key:n},e.toDisplayString(c),1))),128))])):e.createCommentVNode("",!0)])]),t.showActionButton?(e.openBlock(),e.createElementBlock("button",{key:0,class:"bg-vsk-primary rounded-vsk px-4 py-2 text-sm font-semibold cursor-pointer hover:opacity-70",onClick:e.withModifiers(l,["stop"])},e.toDisplayString(t.actionLabel),1)):e.createCommentVNode("",!0),t.showStatusIndicator&&t.isConnected?(e.openBlock(),e.createElementBlock("div",Ne)):e.createCommentVNode("",!0)],2))}}),ze=["for"],N=b(e.defineComponent({__name:"FormGroup",props:{label:{},htmlFor:{default:""},customClass:{default:()=>({})},labelClass:{default:()=>({})}},setup(t){return(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-2",t.customClass])},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:t.htmlFor,class:e.normalizeClass(["text-sm font-medium text-primary dark:text-primary-dark",t.labelClass])},e.toDisplayString(t.label),11,ze)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-c0d9d9cb"]]),z=b(e.defineComponent({__name:"ListCard",props:{clickable:{type:Boolean,default:!1},customClass:{default:()=>({})}},emits:["click"],setup(t,{emit:o}){const a=t,l=o,s=()=>{a.clickable&&l("click")};return(i,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex items-center justify-between background p-3 rounded-vsk border border-vsk-primary/70 transition-colors duration-200",{"hover:bg-vsk-primary/5 cursor-pointer":a.clickable},t.customClass]),onClick:s},[e.renderSlot(i.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-f86d47da"]]),De={class:"background rounded-corner flex flex-row items-center gap-2 justify-between w-full h-auto p-4 transition-all duration-200 hover:bg-ui-surface/80 dark:hover:bg-ui-surface-dark/80"},Te=["src","alt","title"],Ie={key:1,class:"w-8 h-8 flex items-center justify-center"},Le=["src","alt"],Ae=["min","max","value"],D=e.defineComponent({__name:"SliderControl",props:{icon:{},alt:{default:""},tooltip:{default:""},modelValue:{},min:{default:0},max:{default:100},showButton:{type:Boolean,default:!1},iconClass:{default:()=>({})},getPercentageClass:{type:Function,default:()=>""}},emits:["update:modelValue","buttonClick"],setup(t,{emit:o}){const a=t,l=o,s=e.computed(()=>{if(a.max<=a.min)return 0;const n=a.max-a.min,m=a.modelValue-a.min;return Math.round(m/n*100)}),i=e.computed(()=>a.getPercentageClass?a.getPercentageClass(s.value):""),d=n=>{const m=n.target;l("update:modelValue",Number(m.value))},c=()=>{l("buttonClick")};return(n,m)=>(e.openBlock(),e.createElementBlock("div",De,[t.showButton?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:c,class:"w-8 h-8 flex items-center justify-center rounded-corner transition-all duration-200 hover:bg-ui-surface/80 dark:hover:bg-ui-surface-dark/80 hover:scale-110 active:scale-95"},[e.createElementVNode("img",{src:t.icon,alt:t.alt,title:t.tooltip,class:e.normalizeClass(["w-6 h-6 transition-all duration-200",t.iconClass])},null,10,Te)])):(e.openBlock(),e.createElementBlock("div",Ie,[e.createElementVNode("img",{src:t.icon,alt:t.alt,class:"w-6 h-6 transition-all duration-200"},null,8,Le)])),e.createElementVNode("input",{type:"range",min:t.min,max:t.max,value:t.modelValue,onInput:d,class:"flex-1 transition-all duration-200 hover:scale-105"},null,40,Ae),e.createElementVNode("span",{class:e.normalizeClass(["w-12 text-right transition-all duration-200 font-medium",i.value])},e.toDisplayString(s.value)+"% ",3)]))}}),Me=["disabled"],T=e.defineComponent({__name:"SwitchToggle",props:{isOn:{type:Boolean},disabled:{type:Boolean,default:!1},size:{default:"small"},activeClass:{default:"bg-primary dark:bg-primary-dark"},inactiveClass:{default:"background"},customClass:{default:""}},emits:["toggle"],setup(t,{emit:o}){const a=t,l=o,s=()=>{l("toggle",!a.isOn)};return(i,d)=>(e.openBlock(),e.createElementBlock("button",{type:"button",onClick:s,disabled:t.disabled,class:e.normalizeClass(["relative inline-flex items-center rounded-full transition-colors",t.size==="small"?"h-6 w-11":"h-7 w-12",t.isOn?t.activeClass:t.inactiveClass,t.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer",t.customClass])},[e.createElementVNode("span",{class:e.normalizeClass(["inline-block transform rounded-full bg-white shadow transition-transform",t.size==="small"?"h-4 w-4":"h-6 w-6",t.isOn?t.size==="small"?"translate-x-6":"translate-x-5":"translate-x-1"])},null,2)],10,Me))}}),je=["disabled"],Fe=["src","alt","title"],I=e.defineComponent({__name:"ToggleControl",props:{icon:{},alt:{default:""},tooltip:{default:""},isActive:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1},iconClass:{default:()=>({})},customClass:{default:()=>({})}},emits:["click"],setup(t,{emit:o}){const a=o,l=()=>{a("click")};return(s,i)=>(e.openBlock(),e.createElementBlock("button",{onClick:l,class:e.normalizeClass(["p-2 rounded-corner background hover:opacity-50 transition-all duration-300 h-17.5 w-17.5 group relative overflow-hidden hover:scale-105 hover:shadow-lg active:scale-95",{"animate-pulse":t.isLoading,"ring-2 ring-primary dark:ring-primary-dark":t.isActive,"opacity-60":!t.isActive,...t.customClass}]),disabled:t.isLoading},[e.createElementVNode("img",{src:t.icon,alt:t.alt,title:t.tooltip,class:e.normalizeClass(["m-auto w-12.5 h-12.5 transition-all duration-300 group-hover:scale-110 relative z-10",{"animate-spin":t.isLoading,"filter brightness-75":!t.isActive,"drop-shadow-lg":t.isActive,...t.iconClass}])},null,10,Fe)],10,je))}}),Oe=["title"],Pe=["src","alt"],We={key:0,class:"absolute bottom-1 right-1 bg-primary dark:bg-primary-dark text-white text-xs rounded-full w-4 h-4 flex items-center justify-center font-bold animate-bounce"},L=e.defineComponent({__name:"TrayIconButton",props:{icon:{},alt:{default:""},tooltip:{default:""},badge:{default:null},iconClass:{default:()=>({})},customClass:{default:""},tooltipClass:{default:""},showCustomTooltip:{type:Boolean,default:!1},customTooltipText:{default:""}},emits:["click"],setup(t,{emit:o}){const a=o,l=e.ref(!1),s=()=>{a("click")};return(i,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["p-1 rounded-corner relative hover:bg-primary dark:hover:bg-primary-dark group transition-all duration-300",t.customClass]),title:t.tooltip,onClick:s,onMouseenter:d[0]||(d[0]=c=>l.value=!0),onMouseleave:d[1]||(d[1]=c=>l.value=!1)},[e.createElementVNode("img",{src:t.icon,alt:t.alt,class:e.normalizeClass(["m-auto h-5.5 w-auto transition-all duration-300",t.iconClass])},null,10,Pe),t.badge!==null&&t.badge>0?(e.openBlock(),e.createElementBlock("div",We,e.toDisplayString(t.badge),1)):e.createCommentVNode("",!0),t.showCustomTooltip&&t.customTooltipText?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["absolute top-1 left-1/2 transform -translate-x-1/2 text-xs font-semibold p-1 rounded-corner transition-all duration-300 pointer-events-none background",[t.tooltipClass,{"opacity-0 -translate-y-2":!l.value,"opacity-100 translate-y-0":l.value}]])},e.toDisplayString(t.customTooltipText),3)):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"default")],42,Oe))}}),Re=[B,h,g,w,k,E,$,V,S,N,z,D,T,I,L],qe={install(t){Re.forEach(o=>{t.component(o.name,o)})}};r.ActionButton=$,r.ConfigSection=V,r.DeviceCard=S,r.FormGroup=N,r.ListCard=z,r.SelectField=w,r.SideBar=B,r.SideButton=h,r.SideGroup=g,r.SliderControl=D,r.SwitchToggle=T,r.ThemeIcon=k,r.ToggleControl=I,r.TrayIconButton=L,r.WindowFrame=E,r.default=qe,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vasakgroup/vue-libvasak",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Vue componenets for VSK Applications",
5
5
  "main": "./dist/vue-libvasak.umd.js",
6
6
  "module": "./dist/vue-libvasak.es.js",