vlite3 0.1.6 → 0.1.7

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.
@@ -1,15 +1,27 @@
1
- import { defineComponent as j, ref as v, useSlots as T, onMounted as L, onUnmounted as M, computed as m, provide as N, watch as P, openBlock as n, createElementBlock as d, normalizeClass as a, Fragment as w, createElementVNode as o, renderSlot as s, createVNode as p, createBlock as k, resolveDynamicComponent as E, withCtx as h, createCommentVNode as y, toDisplayString as V, createTextVNode as A } from "vue";
1
+ import { defineComponent as j, ref as y, useSlots as T, onMounted as L, onUnmounted as M, computed as g, provide as N, watch as P, openBlock as s, createElementBlock as r, normalizeClass as d, Fragment as k, createElementVNode as n, renderSlot as o, createVNode as h, createBlock as w, resolveDynamicComponent as E, withCtx as v, createCommentVNode as a, toDisplayString as V, createTextVNode as A } from "vue";
2
2
  import { useRoute as H } from "vue-router";
3
3
  import $ from "../Icon.vue.js";
4
4
  import O from "../SidePanel.vue.js";
5
5
  import D from "../Logo.vue.js";
6
- const U = { class: "flex items-center gap-4 shrink-0 z-10" }, F = { class: "shrink-0" }, R = { key: 1 }, Y = { key: 2 }, q = { class: "h-16 flex items-center px-6 shrink-0 z-10" }, G = { class: "flex-1 px-4 py-4 overflow-y-auto space-y-4 scrollbar-thin" }, I = { class: "p-4 border-t border-border shrink-0 bg-background mt-auto" }, J = { class: "flex flex-col space-y-6 pt-4 h-full" }, K = {
6
+ const U = { class: "flex items-center gap-4 shrink-0 z-10" }, F = {
7
+ key: 0,
8
+ class: "shrink-0"
9
+ }, R = { key: 1 }, Y = { key: 2 }, q = {
10
+ key: 0,
11
+ class: "h-16 flex items-center px-6 z-10"
12
+ }, G = { class: "flex-1 px-4 py-4 overflow-y-auto space-y-4 scrollbar-thin" }, I = {
13
+ key: 1,
14
+ class: "p-4 border-t border-border shrink-0 bg-background mt-auto"
15
+ }, J = { class: "flex flex-col space-y-6 pt-4 h-full" }, K = {
7
16
  key: 0,
8
17
  class: "flex flex-col space-y-1"
9
18
  }, Q = {
10
19
  key: 1,
11
20
  class: "flex flex-col space-y-4 flex-1 overflow-y-auto"
12
- }, W = { class: "mt-auto pt-4 border-t border-border" }, oe = /* @__PURE__ */ j({
21
+ }, W = {
22
+ key: 2,
23
+ class: "mt-auto pt-4 border-t border-border"
24
+ }, oe = /* @__PURE__ */ j({
13
25
  __name: "Navbar",
14
26
  props: {
15
27
  variant: { default: "header" },
@@ -27,47 +39,47 @@ const U = { class: "flex items-center gap-4 shrink-0 z-10" }, F = { class: "shri
27
39
  mobileBreakpoint: { default: "md" }
28
40
  },
29
41
  emits: ["toggle-mobile"],
30
- setup(u, { emit: X }) {
31
- const e = u, f = v(!1), g = v(!1);
42
+ setup(f, { emit: X }) {
43
+ const l = f, m = y(!1), b = y(!1);
32
44
  T();
33
45
  const x = () => {
34
- g.value = window.scrollY > 10;
46
+ b.value = window.scrollY > 10;
35
47
  };
36
48
  L(() => {
37
49
  window.addEventListener("scroll", x, { passive: !0 });
38
50
  }), M(() => {
39
51
  window.removeEventListener("scroll", x);
40
52
  });
41
- const C = m(() => {
42
- const l = e.variant === "sidebar", t = {
53
+ const C = g(() => {
54
+ const e = l.variant === "sidebar", t = {
43
55
  fixed: "fixed top-0 left-0 z-40",
44
56
  sticky: "sticky top-0 z-40",
45
57
  relative: "relative z-10",
46
58
  absolute: "absolute top-0 left-0 w-full z-40"
47
- }, i = "bg-body", b = [
48
- e.glass && (g.value || l || e.floating) ? "backdrop-blur-md bg-background/80 supports-[backdrop-filter]:bg-background/60" : "bg-background",
49
- e.border && !e.floating ? l ? "border-r border-border" : "border-b border-border" : "",
50
- e.floating ? "m-4 rounded-xl shadow-lg border border-border/50" : "",
51
- g.value && !e.floating && !l && e.position === "sticky" ? "shadow-sm" : ""
59
+ }, u = "bg-body", p = [
60
+ l.glass && (b.value || e || l.floating) ? "backdrop-blur-md bg-background/80 supports-[backdrop-filter]:bg-background/60" : "bg-background",
61
+ l.border && !l.floating ? e ? "border-r border-border" : "border-b border-border" : "",
62
+ l.floating ? "m-4 rounded-xl shadow-lg border border-border/50" : "",
63
+ b.value && !l.floating && !e && l.position === "sticky" ? "shadow-sm" : ""
52
64
  ];
53
65
  let c = "";
54
- return l ? c = r.value.sidebarLayout : c = `flex items-center gap-4 w-full px-4 sm:px-6 lg:px-8 ${e.height}`, [i, t[e.position], ...b, c, e.class].join(" ");
55
- }), r = m(() => {
56
- const l = e.mobileBreakpoint || "md", t = {
66
+ return e ? c = i.value.sidebarLayout : c = `flex items-center gap-4 w-full px-4 sm:px-6 lg:px-8 ${l.height}`, [u, t[l.position], ...p, c, l.class].join(" ");
67
+ }), i = g(() => {
68
+ const e = l.mobileBreakpoint || "md", t = {
57
69
  sm: "sm:hidden",
58
70
  md: "md:hidden",
59
71
  lg: "lg:hidden",
60
72
  xl: "xl:hidden"
61
- }, i = {
73
+ }, u = {
62
74
  sm: "hidden sm:flex",
63
75
  md: "hidden md:flex",
64
76
  lg: "hidden lg:flex",
65
77
  xl: "hidden xl:flex"
66
- }, b = {
67
- sm: `flex flex-col max-sm:w-full ${e.compact ? "w-20" : e.width} h-auto sm:h-full sm:max-h-screen`,
68
- md: `flex flex-col max-md:w-full ${e.compact ? "w-20" : e.width} h-auto md:h-full md:max-h-screen`,
69
- lg: `flex flex-col max-lg:w-full ${e.compact ? "w-20" : e.width} h-auto lg:h-full lg:max-h-screen`,
70
- xl: `flex flex-col max-xl:w-full ${e.compact ? "w-20" : e.width} h-auto xl:h-full xl:max-h-screen`
78
+ }, p = {
79
+ sm: `flex flex-col max-sm:w-full ${l.compact ? "w-20" : l.width} h-auto sm:h-full sm:max-h-screen`,
80
+ md: `flex flex-col max-md:w-full ${l.compact ? "w-20" : l.width} h-auto md:h-full md:max-h-screen`,
81
+ lg: `flex flex-col max-lg:w-full ${l.compact ? "w-20" : l.width} h-auto lg:h-full lg:max-h-screen`,
82
+ xl: `flex flex-col max-xl:w-full ${l.compact ? "w-20" : l.width} h-auto xl:h-full xl:max-h-screen`
71
83
  }, c = {
72
84
  sm: "sm:hidden flex items-center justify-between px-4 py-3 shrink-0 bg-background",
73
85
  md: "md:hidden flex items-center justify-between px-4 py-3 shrink-0 bg-background",
@@ -80,161 +92,163 @@ const U = { class: "flex items-center gap-4 shrink-0 z-10" }, F = { class: "shri
80
92
  xl: "hidden xl:flex flex-col h-full w-full overflow-hidden"
81
93
  };
82
94
  return {
83
- mobileTrigger: t[l],
84
- desktopContent: i[l],
85
- sidebarLayout: b[l],
86
- mobileHeader: c[l],
87
- desktopSidebar: S[l]
95
+ mobileTrigger: t[e],
96
+ desktopContent: u[e],
97
+ sidebarLayout: p[e],
98
+ mobileHeader: c[e],
99
+ desktopSidebar: S[e]
88
100
  };
89
- }), B = m(() => {
90
- if (e.variant === "sidebar") return "flex-1 py-4 overflow-y-auto";
91
- switch (e.centerPosition) {
101
+ }), B = g(() => {
102
+ if (l.variant === "sidebar") return "flex-1 py-4 overflow-y-auto";
103
+ switch (l.centerPosition) {
92
104
  case "left":
93
105
  return "flex items-center justify-start";
94
106
  case "right":
95
107
  return "flex items-center justify-end ml-auto";
96
108
  default:
97
- return `${r.value.desktopContent} items-center justify-center mx-auto`;
109
+ return `${i.value.desktopContent} items-center justify-center mx-auto`;
98
110
  }
99
111
  });
100
112
  N("navbar-context", {
101
- compact: m(() => e.compact)
113
+ compact: g(() => l.compact)
102
114
  });
103
115
  const z = H();
104
116
  return P(
105
117
  () => z.path,
106
118
  () => {
107
- f.value = !1;
119
+ m.value = !1;
108
120
  }
109
- ), (l, t) => (n(), d("nav", {
110
- class: a(C.value),
121
+ ), (e, t) => (s(), r("nav", {
122
+ class: d(C.value),
111
123
  role: "navigation"
112
124
  }, [
113
- u.variant === "header" ? (n(), d(w, { key: 0 }, [
114
- o("div", U, [
115
- s(l.$slots, "mobile-trigger", {}, () => [
116
- o("button", {
125
+ f.variant === "header" ? (s(), r(k, { key: 0 }, [
126
+ n("div", U, [
127
+ o(e.$slots, "mobile-trigger", {}, () => [
128
+ n("button", {
117
129
  type: "button",
118
- class: a(["p-2 -ml-2 text-muted-foreground hover:bg-accent rounded-md shrink-0", r.value.mobileTrigger]),
119
- onClick: t[0] || (t[0] = (i) => f.value = !0)
130
+ class: d(["p-2 -ml-2 text-muted-foreground hover:bg-accent rounded-md shrink-0", i.value.mobileTrigger]),
131
+ onClick: t[0] || (t[0] = (u) => m.value = !0)
120
132
  }, [
121
- p($, {
133
+ h($, {
122
134
  icon: "lucide:menu",
123
135
  class: "w-5 h-5"
124
136
  }),
125
- t[3] || (t[3] = o("span", { class: "sr-only" }, "Open Menu", -1))
137
+ t[3] || (t[3] = n("span", { class: "sr-only" }, "Open Menu", -1))
126
138
  ], 2)
127
139
  ]),
128
- o("div", F, [
129
- s(l.$slots, "logo", {}, () => [
130
- (n(), k(E(e.logo ? "img" : "div"), {
131
- src: e.logo,
140
+ e.$slots?.logo ? (s(), r("div", F, [
141
+ o(e.$slots, "logo", {}, () => [
142
+ (s(), w(E(l.logo ? "img" : "div"), {
143
+ src: l.logo,
132
144
  class: "h-8 w-auto font-bold text-xl flex items-center gap-2"
133
145
  }, {
134
- default: h(() => [
135
- e.logo ? y("", !0) : (n(), k(D, {
146
+ default: v(() => [
147
+ l.logo ? a("", !0) : (s(), w(D, {
136
148
  key: 0,
137
149
  class: "h-6 w-6"
138
150
  })),
139
- !e.logo && e.logoAlt ? (n(), d("span", R, V(e.logoAlt), 1)) : e.logo ? y("", !0) : (n(), d("span", Y, "Brand"))
151
+ !l.logo && l.logoAlt ? (s(), r("span", R, V(l.logoAlt), 1)) : l.logo ? a("", !0) : (s(), r("span", Y, "Brand"))
140
152
  ]),
141
153
  _: 1
142
154
  }, 8, ["src"]))
143
155
  ])
144
- ]),
145
- o("div", {
146
- class: a(["items-center gap-1 overflow-x-auto no-scrollbar mask-gradient", r.value.desktopContent])
156
+ ])) : a("", !0),
157
+ e.$slots?.left ? (s(), r("div", {
158
+ key: 1,
159
+ class: d(["items-center gap-1 overflow-x-auto no-scrollbar mask-gradient", i.value.desktopContent])
147
160
  }, [
148
- s(l.$slots, "left")
149
- ], 2)
161
+ o(e.$slots, "left")
162
+ ], 2)) : a("", !0)
150
163
  ]),
151
- o("div", {
152
- class: a([
164
+ e.$slots?.center ? (s(), r("div", {
165
+ key: 0,
166
+ class: d([
153
167
  B.value,
154
168
  // Width constraint to ensure it doesn't crush others, but allows simple resizing
155
169
  "max-w-full"
156
170
  ])
157
171
  }, [
158
- s(l.$slots, "center")
159
- ], 2),
160
- o("div", {
161
- class: a(["flex items-center gap-2 shrink-0 max-w-[40%] z-10", {
172
+ o(e.$slots, "center")
173
+ ], 2)) : a("", !0),
174
+ n("div", {
175
+ class: d(["flex items-center gap-2 shrink-0 max-w-[40%] z-10", {
162
176
  // Always push to end unless Center is pushing it.
163
177
  // If Center is 'center' (mx-auto) or 'right' (ml-auto), this naturally falls to end.
164
178
  // If Center is 'left', we MUST have ml-auto here.
165
- "ml-auto": u.centerPosition === "left" || u.centerPosition === "center"
179
+ "ml-auto": f.centerPosition === "left" || f.centerPosition === "center"
166
180
  // If center is 'right', Center has ml-auto. Right just sits next to it.
167
181
  // But if we add ml-auto here too, they might split space? No, flexbox parses strictly.
168
182
  }])
169
183
  }, [
170
- s(l.$slots, "right")
184
+ o(e.$slots, "right")
171
185
  ], 2)
172
- ], 64)) : (n(), d(w, { key: 1 }, [
173
- o("div", {
174
- class: a(r.value.mobileHeader)
186
+ ], 64)) : (s(), r(k, { key: 1 }, [
187
+ n("div", {
188
+ class: d(i.value.mobileHeader)
175
189
  }, [
176
- s(l.$slots, "logo", {}, () => [
177
- t[4] || (t[4] = o("div", { class: "font-bold text-xl truncate" }, "Brand", -1))
178
- ]),
179
- o("button", {
190
+ e.$slots?.right ? o(e.$slots, "logo", { key: 0 }, () => [
191
+ t[4] || (t[4] = n("div", { class: "font-bold text-xl truncate" }, "Brand", -1))
192
+ ]) : a("", !0),
193
+ n("button", {
180
194
  type: "button",
181
195
  class: "p-2 -mr-2 text-muted-foreground hover:bg-accent rounded-md",
182
- onClick: t[1] || (t[1] = (i) => f.value = !0)
196
+ onClick: t[1] || (t[1] = (u) => m.value = !0)
183
197
  }, [
184
- p($, {
198
+ h($, {
185
199
  icon: "lucide:menu",
186
200
  class: "w-5 h-5"
187
201
  }),
188
- t[5] || (t[5] = o("span", { class: "sr-only" }, "Open Menu", -1))
202
+ t[5] || (t[5] = n("span", { class: "sr-only" }, "Open Menu", -1))
189
203
  ])
190
204
  ], 2),
191
- o("div", {
192
- class: a(r.value.desktopSidebar)
205
+ n("div", {
206
+ class: d(i.value.desktopSidebar)
193
207
  }, [
194
- o("div", q, [
195
- s(l.$slots, "logo", {}, () => [
196
- t[6] || (t[6] = o("div", { class: "font-bold text-xl truncate" }, "Brand", -1))
208
+ e.$slots?.logo ? (s(), r("div", q, [
209
+ o(e.$slots, "logo", {}, () => [
210
+ t[6] || (t[6] = n("div", { class: "font-bold text-xl truncate" }, "Brand", -1))
197
211
  ])
212
+ ])) : a("", !0),
213
+ n("div", G, [
214
+ o(e.$slots, "left"),
215
+ o(e.$slots, "default"),
216
+ o(e.$slots, "center")
198
217
  ]),
199
- o("div", G, [
200
- s(l.$slots, "left"),
201
- s(l.$slots, "default"),
202
- s(l.$slots, "center")
203
- ]),
204
- o("div", I, [
205
- s(l.$slots, "right")
206
- ])
218
+ e.$slots?.right ? (s(), r("div", I, [
219
+ o(e.$slots, "right")
220
+ ])) : a("", !0)
207
221
  ], 2)
208
222
  ], 64)),
209
- p(O, {
210
- show: f.value,
211
- "onUpdate:show": t[2] || (t[2] = (i) => f.value = i),
223
+ h(O, {
224
+ show: m.value,
225
+ "onUpdate:show": t[2] || (t[2] = (u) => m.value = u),
212
226
  position: "left",
213
227
  size: "sm",
214
- triggerClass: r.value.mobileTrigger,
215
- class: a(["z-60", r.value.mobileTrigger])
228
+ triggerClass: i.value.mobileTrigger,
229
+ class: d(["z-60", i.value.mobileTrigger])
216
230
  }, {
217
- header: h(() => [
218
- s(l.$slots, "logo", {}, () => [
231
+ header: v(() => [
232
+ o(e.$slots, "logo", {}, () => [
219
233
  t[7] || (t[7] = A("Brand", -1))
220
234
  ])
221
235
  ]),
222
- default: h(() => [
223
- o("div", J, [
224
- u.variant === "header" ? (n(), d("div", K, [
225
- s(l.$slots, "mobile-menu", {}, () => [
226
- s(l.$slots, "left"),
227
- t[8] || (t[8] = o("div", { class: "h-px bg-border my-2" }, null, -1)),
228
- s(l.$slots, "center")
236
+ default: v(() => [
237
+ n("div", J, [
238
+ f.variant === "header" ? (s(), r("div", K, [
239
+ o(e.$slots, "mobile-menu", {}, () => [
240
+ o(e.$slots, "left"),
241
+ t[8] || (t[8] = n("div", { class: "h-px bg-border my-2" }, null, -1)),
242
+ o(e.$slots, "center")
229
243
  ])
230
- ])) : (n(), d("div", Q, [
231
- s(l.$slots, "left"),
232
- s(l.$slots, "default"),
233
- s(l.$slots, "center")
244
+ ])) : (s(), r("div", Q, [
245
+ o(e.$slots, "left"),
246
+ o(e.$slots, "default"),
247
+ o(e.$slots, "center")
234
248
  ])),
235
- o("div", W, [
236
- s(l.$slots, "right")
237
- ])
249
+ e.$slots?.right ? (s(), r("div", W, [
250
+ o(e.$slots, "right")
251
+ ])) : a("", !0)
238
252
  ])
239
253
  ]),
240
254
  _: 3
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "private": false,
4
4
  "description": "A Vue 3 UI component library built with Tailwind CSS.",
5
5
  "license": "MIT",
6
- "version": "0.1.6",
6
+ "version": "0.1.7",
7
7
  "type": "module",
8
8
  "main": "index.js",
9
9
  "module": "index.js",