vlite3 0.1.2 → 0.1.4

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,6 +1,6 @@
1
- import { defineComponent as k, defineAsyncComponent as t, computed as o, markRaw as V, openBlock as w, createBlock as x, resolveDynamicComponent as C, mergeProps as P, toHandlers as U } from "vue";
2
- import { isComponent as i } from "./utils/form.utils.js";
3
- import s from "../Input.vue.js";
1
+ import { defineComponent as k, defineAsyncComponent as t, computed as i, markRaw as V, openBlock as w, createBlock as x, resolveDynamicComponent as C, mergeProps as P, toHandlers as U } from "vue";
2
+ import { isComponent as o } from "./utils/form.utils.js";
3
+ import d from "../Input.vue.js";
4
4
  import z from "../Switch.vue.js";
5
5
  import S from "../CheckBox.vue.js";
6
6
  import F from "../Textarea.vue.js";
@@ -21,26 +21,14 @@ const M = /* @__PURE__ */ k({
21
21
  isUpdate: { type: Boolean, default: !1 }
22
22
  },
23
23
  emits: ["change"],
24
- setup(d, { emit: c }) {
25
- const u = t(
26
- () => import("../Dropdown/Dropdown.vue2.js")
27
- ), f = t(
28
- () => import("../MultiSelect/MultiSelect.vue2.js")
29
- ), p = t(
30
- () => import("../DatePicker.vue2.js")
31
- ), m = t(
32
- () => import("../ColorPicker/ColorPicker.vue2.js")
33
- ), h = t(
34
- () => import("../IconPicker.vue2.js")
35
- ), v = t(
36
- () => import("./CustomFields.vue.js")
37
- ), r = d, n = c, l = (e, a) => {
38
- n("change", { value: e, data: a });
39
- }, _ = (e) => {
40
- n("change", { value: e });
41
- }, y = o(() => {
24
+ setup(n, { emit: c }) {
25
+ const u = t(() => import("../Dropdown/Dropdown.vue2.js")), f = t(() => import("../MultiSelect/MultiSelect.vue2.js")), p = t(() => import("../DatePicker.vue2.js")), m = t(() => import("../ColorPicker/ColorPicker.vue2.js")), h = t(() => import("../IconPicker.vue2.js")), v = t(() => import("./CustomFields.vue.js")), r = n, s = c, l = (e, a) => {
26
+ s("change", { value: e, data: a });
27
+ }, y = (e) => {
28
+ s("change", { value: e });
29
+ }, g = i(() => {
42
30
  const e = r.field.type;
43
- if (i(e))
31
+ if (o(e))
44
32
  return V(e);
45
33
  switch (e) {
46
34
  case "text":
@@ -50,7 +38,7 @@ const M = /* @__PURE__ */ k({
50
38
  case "tel":
51
39
  case "url":
52
40
  case "search":
53
- return s;
41
+ return d;
54
42
  case "textarea":
55
43
  return F;
56
44
  case "switch":
@@ -76,9 +64,9 @@ const M = /* @__PURE__ */ k({
76
64
  case "customFields":
77
65
  return v;
78
66
  default:
79
- return s;
67
+ return d;
80
68
  }
81
- }), g = o(() => {
69
+ }), _ = i(() => {
82
70
  const e = r.field.type, a = {
83
71
  disabled: r.disabled || r.field.disabled === !0,
84
72
  ...r.field.props || {}
@@ -162,15 +150,15 @@ const M = /* @__PURE__ */ k({
162
150
  size: r.size,
163
151
  rounded: r.rounded,
164
152
  isUpdate: r.isUpdate
165
- } : i(e) ? {
153
+ } : o(e) ? {
166
154
  ...a,
167
155
  value: r.value,
168
156
  values: r.values
169
157
  } : a;
170
- }), b = o(() => {
158
+ }), b = i(() => {
171
159
  const e = r.field.type;
172
160
  return e === "text" || e === "email" || e === "password" || e === "number" || e === "tel" || e === "url" || e === "search" || e === "textarea" || e === "switch" || e === "check" || !e ? {
173
- "update:modelValue": _
161
+ "update:modelValue": y
174
162
  } : e === "select" ? {
175
163
  onSelect: (a) => {
176
164
  l(a.value, a.data);
@@ -193,13 +181,16 @@ const M = /* @__PURE__ */ k({
193
181
  onSelect: (a) => l(a)
194
182
  } : e === "customFields" ? {
195
183
  change: (a) => l(a)
196
- } : i(e) ? {
184
+ } : o(e) ? {
197
185
  onChange: (a) => {
198
186
  l(a.value, a.data);
199
187
  }
200
188
  } : {};
201
189
  });
202
- return (e, a) => (w(), x(C(y.value), P(g.value, U(b.value)), null, 16));
190
+ return (e, a) => (w(), x(C(g.value), P({
191
+ ..._.value,
192
+ ...n.field?.props || {}
193
+ }, U(b.value)), null, 16));
203
194
  }
204
195
  });
205
196
  export {
@@ -4,6 +4,7 @@ export interface UseFormOptions {
4
4
  schema: IForm[] | IForm[][];
5
5
  values?: Record<string, any>;
6
6
  isUpdate?: boolean;
7
+ folderId?: string;
7
8
  onSubmit?: (payload: IFormSubmitPayload) => void | Promise<void>;
8
9
  }
9
10
  export interface UseFormReturn {
@@ -1,8 +1,8 @@
1
1
  import { ref as u, computed as $, watch as k } from "vue";
2
2
  import { initializeFormValues as j, deepClone as c, getNestedValue as N, evaluateConditional as y, setNestedValue as h, collectFileFields as B, filterNullCustomFields as G } from "../utils/form.utils.js";
3
3
  import { useFileUpload as H } from "./useFileUpload.js";
4
- function X(q) {
5
- const { schema: i, values: V, isUpdate: d = !1, onSubmit: b } = q, { handleUploadFile: x, loading: I } = H(), t = u(j(i, V)), r = u({}), v = u(!1), n = u(!1), m = u(c(t.value)), f = $(() => i ? Array.isArray(i[0]) ? i.flat() : i : []);
4
+ function Y(q) {
5
+ const { schema: i, values: V, isUpdate: d = !1, folderId: x, onSubmit: b } = q, { handleUploadFile: D, loading: J } = H(), t = u(j(i, V)), r = u({}), v = u(!1), n = u(!1), m = u(c(t.value)), f = $(() => i ? Array.isArray(i[0]) ? i.flat() : i : []);
6
6
  k(
7
7
  () => V,
8
8
  (e) => {
@@ -13,11 +13,11 @@ function X(q) {
13
13
  const p = () => ({
14
14
  values: t.value,
15
15
  isUpdate: d
16
- }), g = (e) => N(t.value, e), D = (e) => r.value[e] || "", A = (e, l) => {
16
+ }), g = (e) => N(t.value, e), O = (e) => r.value[e] || "", A = (e, l) => {
17
17
  l ? r.value[e] = l : delete r.value[e];
18
18
  }, F = () => {
19
19
  r.value = {};
20
- }, S = (e) => e.when ? y(e.when, p()) : !0, w = (e) => y(e.disabled, p()), O = (e) => y(e.readonly, p()), C = (e) => {
20
+ }, S = (e) => e.when ? y(e.when, p()) : !0, w = (e) => y(e.disabled, p()), z = (e) => y(e.readonly, p()), C = (e) => {
21
21
  const l = g(e.name);
22
22
  let a = "";
23
23
  return e.required && (l == null || l === "" || Array.isArray(l) && l.length === 0) && (a = `${e.label || e.name} is required`), !a && e.validation && (a = e.validation({
@@ -33,7 +33,7 @@ function X(q) {
33
33
  C(l) && (e = !1);
34
34
  }
35
35
  return e;
36
- }, z = (e, l, a) => {
36
+ }, I = (e, l, a) => {
37
37
  t.value = h(t.value, e, l), n.value = !0, delete r.value[e];
38
38
  const o = f.value.find((s) => s.name === e);
39
39
  if (o?.updateValues) {
@@ -48,9 +48,9 @@ function X(q) {
48
48
  }, L = async () => {
49
49
  const e = c(t.value), l = B(i, e);
50
50
  for (const a of l) {
51
- const { name: o, value: s, type: M } = a;
51
+ const { name: o, value: s, type: P } = a;
52
52
  if (s instanceof File || s && typeof s == "object" && s.file instanceof File) {
53
- const U = await x(s);
53
+ const U = await D(s, x);
54
54
  U && Object.assign(e, h(e, o, U));
55
55
  }
56
56
  }
@@ -72,14 +72,14 @@ function X(q) {
72
72
  errors: r,
73
73
  isSubmitting: v,
74
74
  isDirty: n,
75
- handleFieldChange: z,
75
+ handleFieldChange: I,
76
76
  validateField: C,
77
77
  validateAll: E,
78
78
  isFieldVisible: S,
79
79
  isFieldDisabled: w,
80
- isFieldReadonly: O,
80
+ isFieldReadonly: z,
81
81
  getFieldValue: g,
82
- getFieldError: D,
82
+ getFieldError: O,
83
83
  setFieldError: A,
84
84
  clearErrors: F,
85
85
  resetForm: () => {
@@ -105,5 +105,5 @@ function X(q) {
105
105
  };
106
106
  }
107
107
  export {
108
- X as useForm
108
+ Y as useForm
109
109
  };
@@ -140,6 +140,8 @@ export interface IFormProps {
140
140
  showCancel?: boolean;
141
141
  /** Whether this is an update operation */
142
142
  isUpdate?: boolean;
143
+ /** Folder ID for file uploads */
144
+ folderId?: string;
143
145
  /** Custom class for form element */
144
146
  class?: string;
145
147
  /** Custom class for the grid layout (overrides columns) */
@@ -41,7 +41,7 @@ const Y = ["type", "value", "placeholder", "disabled", "min", "max"], Z = { clas
41
41
  ].join(" ")), T = u(() => ["relative flex w-full items-stretch", e.labelPosition !== "top" ? "flex-1" : ""].join(
42
42
  " "
43
43
  )), R = u(() => {
44
- const l = "block w-full bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground/50 disabled:cursor-not-allowed disabled:opacity-50 transition-all focus-visible:outline-none", o = {
44
+ const l = "block w-full bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground/50 disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none", o = {
45
45
  solid: "bg-muted border-transparent focus-visible:border-primary",
46
46
  outline: "border border-input focus-visible:border-primary",
47
47
  "outline-b": "border-b border-input bg-transparent rounded-none focus-visible:border-primary",
@@ -1,13 +1,14 @@
1
- import { defineComponent as C, ref as w, watch as m, onUnmounted as B, openBlock as o, createElementBlock as n, Fragment as $, createElementVNode as d, normalizeClass as l, withModifiers as y, renderSlot as i, createCommentVNode as r, createBlock as b, Teleport as O, createVNode as h, Transition as S, withCtx as z, toDisplayString as v, resolveDynamicComponent as E, mergeProps as N } from "vue";
2
- import P from "./Button.vue.js";
3
- import { useKeyStroke as V } from "../composables/useKeyStroke.js";
4
- const j = {
1
+ import { defineComponent as w, ref as $, watch as m, provide as B, onUnmounted as O, openBlock as s, createElementBlock as a, Fragment as S, createElementVNode as n, mergeProps as y, withModifiers as b, renderSlot as i, createCommentVNode as r, createBlock as h, Teleport as z, createVNode as v, Transition as E, withCtx as N, normalizeClass as d, toDisplayString as p, resolveDynamicComponent as P } from "vue";
2
+ import V from "./Button.vue.js";
3
+ import { useKeyStroke as j } from "../composables/useKeyStroke.js";
4
+ const D = {
5
5
  key: 0,
6
6
  class: "flex-none flex flex-col space-y-1.5 pb-0 border-b"
7
- }, D = { class: "text-lg font-semibold leading-none tracking-tight" }, K = {
7
+ }, K = { class: "text-lg font-semibold leading-none tracking-tight" }, M = {
8
8
  key: 0,
9
9
  class: "text-sm text-muted-foreground mb-2"
10
- }, F = /* @__PURE__ */ C({
10
+ }, F = /* @__PURE__ */ w({
11
+ inheritAttrs: !1,
11
12
  __name: "Modal",
12
13
  props: {
13
14
  show: { type: Boolean, default: !1 },
@@ -24,36 +25,38 @@ const j = {
24
25
  bodyProps: {}
25
26
  },
26
27
  emits: ["close", "update:show", "onOpen"],
27
- setup(e, { emit: x }) {
28
- const c = e, u = x, a = w(c.show);
28
+ setup(e, { emit: g }) {
29
+ const c = e, u = g, l = $(c.show);
29
30
  m(
30
31
  () => c.show,
31
32
  (t) => {
32
- a.value = t, t && u("onOpen");
33
+ l.value = t, t && u("onOpen");
33
34
  }
34
35
  );
35
- const g = () => {
36
- a.value = !0;
37
- }, s = () => {
38
- a.value = !1, u("update:show", !1), u("close");
39
- }, p = () => {
40
- c.closeOutside && s();
41
- }, { onKeyStroke: k } = V();
42
- return k("Escape", s), m(a, (t) => {
36
+ const x = () => {
37
+ l.value = !0;
38
+ }, o = () => {
39
+ l.value = !1, u("update:show", !1), u("close");
40
+ };
41
+ B("modal-context", { close: o });
42
+ const k = () => {
43
+ c.closeOutside && o();
44
+ }, { onKeyStroke: C } = j();
45
+ return C("Escape", o), m(l, (t) => {
43
46
  t ? document.body.style.overflow = "hidden" : document.body.style.overflow = "";
44
- }), B(() => {
47
+ }), O(() => {
45
48
  document.body.style.overflow = "";
46
- }), (t, f) => (o(), n($, null, [
47
- d("span", {
48
- onClick: y(g, ["stop"]),
49
- class: l(`${e.triggerClass}`)
50
- }, [
49
+ }), (t, f) => (s(), a(S, null, [
50
+ n("span", y({
51
+ onClick: b(x, ["stop"]),
52
+ class: `${e.triggerClass}`
53
+ }, t.$attrs), [
51
54
  i(t.$slots, "trigger", {}, () => [
52
55
  e.body ? i(t.$slots, "default", { key: 0 }) : r("", !0)
53
56
  ])
54
- ], 2),
55
- (o(), b(O, { to: "body" }, [
56
- h(S, {
57
+ ], 16),
58
+ (s(), h(z, { to: "body" }, [
59
+ v(E, {
57
60
  "enter-active-class": "transition duration-200 ease-out",
58
61
  "enter-from-class": "opacity-0",
59
62
  "enter-to-class": "opacity-100",
@@ -61,46 +64,46 @@ const j = {
61
64
  "leave-from-class": "opacity-100",
62
65
  "leave-to-class": "opacity-0"
63
66
  }, {
64
- default: z(() => [
65
- a.value ? (o(), n("div", {
67
+ default: N(() => [
68
+ l.value ? (s(), a("div", {
66
69
  key: 0,
67
- class: l(["fixed inset-0 z-50 flex items-center justify-center bg-[#00000051] p-4", e.backdrop && "backdrop-blur-[2px]"]),
68
- onClick: p
70
+ class: d(["fixed inset-0 z-50 flex items-center justify-center bg-[#00000051] p-4", e.backdrop && "backdrop-blur-[2px]"]),
71
+ onClick: k
69
72
  }, [
70
- d("div", {
71
- class: l(["modal-body relative w-full rounded border border-border bg-body text-foreground shadow-lg flex flex-col max-h-[85vh] sm:max-h-[90vh]", [e.maxWidth]]),
72
- onClick: f[0] || (f[0] = y(() => {
73
+ n("div", {
74
+ class: d(["modal-body relative w-full rounded border border-border bg-body text-foreground shadow-lg flex flex-col max-h-[85vh] sm:max-h-[90vh]", [e.maxWidth]]),
75
+ onClick: f[0] || (f[0] = b(() => {
73
76
  }, ["stop"]))
74
77
  }, [
75
- e.title ? (o(), n("div", j, [
76
- d("div", {
77
- class: l(["flex items-center justify-between bg-muted-light py-1 px-4 rounded-t-md", e.headerClass])
78
+ e.title ? (s(), a("div", D, [
79
+ n("div", {
80
+ class: d(["flex items-center justify-between bg-muted-light py-1 px-4 rounded-t-md", e.headerClass])
78
81
  }, [
79
- d("h3", D, v(e.title), 1),
80
- h(P, {
82
+ n("h3", K, p(e.title), 1),
83
+ v(V, {
81
84
  rounded: "full",
82
85
  size: "sm",
83
86
  icon: "lucide:x",
84
87
  variant: "ghost",
85
88
  class: "hover:bg-gray-250/25!",
86
- onClick: s
89
+ onClick: o
87
90
  })
88
91
  ], 2)
89
92
  ])) : r("", !0),
90
- d("div", {
91
- class: l(["flex-1 overflow-y-auto px-4 py-4 min-h-0 shadow-xl", e.bodyClass])
93
+ n("div", {
94
+ class: d(["flex-1 overflow-y-auto px-4 pt-4 pb-3.5 min-h-0 shadow-xl", e.bodyClass])
92
95
  }, [
93
- e.description ? (o(), n("p", K, v(e.description), 1)) : r("", !0),
94
- e.body ? (o(), b(E(e.body), N({ key: 1 }, e.bodyProps, { close: s }), null, 16)) : i(t.$slots, "default", {
96
+ e.description ? (s(), a("p", M, p(e.description), 1)) : r("", !0),
97
+ e.body ? (s(), h(P(e.body), y({ key: 1 }, { ...e.bodyProps, ...t.$attrs }, { close: o }), null, 16)) : i(t.$slots, "default", {
95
98
  key: 2,
96
- close: s
99
+ close: o
97
100
  })
98
101
  ], 2),
99
- t.$slots.footer ? (o(), n("div", {
102
+ t.$slots.footer ? (s(), a("div", {
100
103
  key: 1,
101
- class: l([e.footerClass, "flex-none flex items-center px-4 py-2.5 border-t rounded-b-xl"])
104
+ class: d([e.footerClass, "flex-none flex items-center px-4 py-2.5 border-t rounded-b-xl"])
102
105
  }, [
103
- i(t.$slots, "footer", { close: s })
106
+ i(t.$slots, "footer", { close: o })
104
107
  ], 2)) : r("", !0)
105
108
  ], 2)
106
109
  ], 2)) : r("", !0)
@@ -41,6 +41,7 @@ declare const __VLS_component: import('vue').DefineComponent<NavbarProps, {}, {}
41
41
  centerPosition: import('../../types/navbar.type').NavbarCenterPosition;
42
42
  glass: boolean;
43
43
  floating: boolean;
44
+ mobileBreakpoint: "sm" | "md" | "lg" | "xl";
44
45
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLElement>;
45
46
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
46
47
  export default _default;
@@ -1,14 +1,14 @@
1
- import { defineComponent as C, ref as v, useSlots as z, onMounted as S, onUnmounted as j, computed as f, provide as M, openBlock as n, createElementBlock as r, normalizeClass as m, Fragment as h, createElementVNode as s, renderSlot as l, createVNode as p, createBlock as y, resolveDynamicComponent as N, withCtx as b, createCommentVNode as w, toDisplayString as P, createTextVNode as E } from "vue";
2
- import x from "../Icon.vue.js";
3
- import V from "../SidePanel.vue.js";
4
- import A from "../Logo.vue.js";
5
- const O = { class: "flex items-center gap-4 shrink-0 z-10" }, D = { class: "shrink-0" }, L = { key: 1 }, U = { key: 2 }, W = { class: "hidden md:flex items-center gap-1 overflow-x-auto no-scrollbar mask-gradient" }, F = { class: "md:hidden flex items-center justify-between px-4 py-3 shrink-0 bg-background" }, T = { class: "hidden md:flex flex-col h-full w-full overflow-hidden" }, Y = { class: "h-16 flex items-center px-6 shrink-0 z-10" }, q = { class: "flex-1 px-4 py-4 overflow-y-auto space-y-4 scrollbar-thin" }, G = { class: "p-4 border-t border-border shrink-0 bg-background mt-auto" }, H = { class: "flex flex-col space-y-6 pt-4 h-full" }, I = {
1
+ import { defineComponent as z, ref as h, useSlots as S, onMounted as j, onUnmounted as M, computed as f, provide as N, openBlock as r, createElementBlock as i, normalizeClass as a, Fragment as y, createElementVNode as s, renderSlot as l, createVNode as p, createBlock as k, resolveDynamicComponent as P, withCtx as g, createCommentVNode as w, toDisplayString as T, createTextVNode as E } from "vue";
2
+ import $ from "../Icon.vue.js";
3
+ import L from "../SidePanel.vue.js";
4
+ import V from "../Logo.vue.js";
5
+ const A = { class: "flex items-center gap-4 shrink-0 z-10" }, O = { class: "shrink-0" }, D = { key: 1 }, H = { key: 2 }, U = { class: "h-16 flex items-center px-6 shrink-0 z-10" }, F = { class: "flex-1 px-4 py-4 overflow-y-auto space-y-4 scrollbar-thin" }, Y = { class: "p-4 border-t border-border shrink-0 bg-background mt-auto" }, q = { class: "flex flex-col space-y-6 pt-4 h-full" }, G = {
6
6
  key: 0,
7
7
  class: "flex flex-col space-y-1"
8
- }, J = {
8
+ }, I = {
9
9
  key: 1,
10
10
  class: "flex flex-col space-y-4 flex-1 overflow-y-auto"
11
- }, K = { class: "mt-auto pt-4 border-t border-border" }, te = /* @__PURE__ */ C({
11
+ }, J = { class: "mt-auto pt-4 border-t border-border" }, Z = /* @__PURE__ */ z({
12
12
  __name: "Navbar",
13
13
  props: {
14
14
  variant: { default: "header" },
@@ -22,35 +22,50 @@ const O = { class: "flex items-center gap-4 shrink-0 z-10" }, D = { class: "shri
22
22
  width: { default: "w-64" },
23
23
  compact: { type: Boolean, default: !1 },
24
24
  logo: {},
25
- logoAlt: {}
25
+ logoAlt: {},
26
+ mobileBreakpoint: { default: "md" }
26
27
  },
27
28
  emits: ["toggle-mobile"],
28
- setup(a, { emit: Q }) {
29
- const t = a, d = v(!1), u = v(!1);
30
- z();
31
- const g = () => {
32
- u.value = window.scrollY > 10;
29
+ setup(d, { emit: K }) {
30
+ const t = d, c = h(!1), m = h(!1);
31
+ S();
32
+ const v = () => {
33
+ m.value = window.scrollY > 10;
33
34
  };
34
- S(() => {
35
- window.addEventListener("scroll", g, { passive: !0 });
36
- }), j(() => {
37
- window.removeEventListener("scroll", g);
35
+ j(() => {
36
+ window.addEventListener("scroll", v, { passive: !0 });
37
+ }), M(() => {
38
+ window.removeEventListener("scroll", v);
38
39
  });
39
- const k = f(() => {
40
+ const x = f(() => {
40
41
  const e = t.variant === "sidebar", o = {
41
42
  fixed: "fixed top-0 left-0 z-40",
42
43
  sticky: "sticky top-0 z-40",
43
44
  relative: "relative z-10",
44
45
  absolute: "absolute top-0 left-0 w-full z-40"
45
- }, i = "transition-all duration-300 ease-in-out bg-body", B = [
46
- t.glass && (u.value || e || t.floating) ? "backdrop-blur-md bg-background/80 supports-[backdrop-filter]:bg-background/60" : "bg-background",
46
+ }, u = "transition-all duration-300 ease-in-out bg-body", B = [
47
+ t.glass && (m.value || e || t.floating) ? "backdrop-blur-md bg-background/80 supports-[backdrop-filter]:bg-background/60" : "bg-background",
47
48
  t.border && !t.floating ? e ? "border-r border-border" : "border-b border-border" : "",
48
49
  t.floating ? "m-4 rounded-xl shadow-lg border border-border/50" : "",
49
- u.value && !t.floating && !e && t.position === "sticky" ? "shadow-sm" : ""
50
+ m.value && !t.floating && !e && t.position === "sticky" ? "shadow-sm" : ""
50
51
  ];
51
- let c = "";
52
- return e ? c = `flex flex-col max-md:w-full ${t.compact ? "w-20" : t.width} h-auto md:h-full md:max-h-screen` : c = `flex items-center gap-4 w-full px-4 sm:px-6 lg:px-8 ${t.height}`, [i, o[t.position], ...B, c, t.class].join(" ");
53
- }), $ = f(() => {
52
+ let b = "";
53
+ return e ? b = n.value.sidebarLayout : b = `flex items-center gap-4 w-full px-4 sm:px-6 lg:px-8 ${t.height}`, [u, o[t.position], ...B, b, t.class].join(" ");
54
+ }), n = f(() => {
55
+ const e = t.mobileBreakpoint || "md";
56
+ return {
57
+ // Show on mobile (up to breakpoint), hide on desktop (breakpoint and up)
58
+ mobileTrigger: `${e}:hidden`,
59
+ // Hide on mobile, show on desktop
60
+ desktopContent: `hidden ${e}:flex`,
61
+ // Sidebar: Mobile (auto height, full width) -> Desktop (fixed width based on prop, full height constrained to viewport)
62
+ sidebarLayout: `flex flex-col max-${e}:w-full ${t.compact ? "w-20" : t.width} h-auto ${e}:h-full ${e}:max-h-screen`,
63
+ // Mobile Header (visible only on small screens)
64
+ mobileHeader: `${e}:hidden flex items-center justify-between px-4 py-3 shrink-0 bg-background`,
65
+ // Desktop Sidebar Content (hidden on small screens)
66
+ desktopSidebar: `hidden ${e}:flex flex-col h-full w-full overflow-hidden`
67
+ };
68
+ }), C = f(() => {
54
69
  if (t.variant === "sidebar") return "flex-1 py-4 overflow-y-auto";
55
70
  switch (t.centerPosition) {
56
71
  case "left":
@@ -58,54 +73,56 @@ const O = { class: "flex items-center gap-4 shrink-0 z-10" }, D = { class: "shri
58
73
  case "right":
59
74
  return "flex items-center justify-end ml-auto";
60
75
  default:
61
- return "hidden md:flex items-center justify-center mx-auto";
76
+ return `${n.value.desktopContent} items-center justify-center mx-auto`;
62
77
  }
63
78
  });
64
- return M("navbar-context", {
79
+ return N("navbar-context", {
65
80
  compact: f(() => t.compact)
66
- }), (e, o) => (n(), r("nav", {
67
- class: m(k.value),
81
+ }), (e, o) => (r(), i("nav", {
82
+ class: a(x.value),
68
83
  role: "navigation"
69
84
  }, [
70
- a.variant === "header" ? (n(), r(h, { key: 0 }, [
71
- s("div", O, [
85
+ d.variant === "header" ? (r(), i(y, { key: 0 }, [
86
+ s("div", A, [
72
87
  l(e.$slots, "mobile-trigger", {}, () => [
73
88
  s("button", {
74
89
  type: "button",
75
- class: "md:hidden p-2 -ml-2 text-muted-foreground hover:bg-accent rounded-md shrink-0",
76
- onClick: o[0] || (o[0] = (i) => d.value = !0)
90
+ class: a(["p-2 -ml-2 text-muted-foreground hover:bg-accent rounded-md shrink-0", n.value.mobileTrigger]),
91
+ onClick: o[0] || (o[0] = (u) => c.value = !0)
77
92
  }, [
78
- p(x, {
93
+ p($, {
79
94
  icon: "lucide:menu",
80
95
  class: "w-5 h-5"
81
96
  }),
82
97
  o[3] || (o[3] = s("span", { class: "sr-only" }, "Open Menu", -1))
83
- ])
98
+ ], 2)
84
99
  ]),
85
- s("div", D, [
100
+ s("div", O, [
86
101
  l(e.$slots, "logo", {}, () => [
87
- (n(), y(N(t.logo ? "img" : "div"), {
102
+ (r(), k(P(t.logo ? "img" : "div"), {
88
103
  src: t.logo,
89
104
  class: "h-8 w-auto font-bold text-xl flex items-center gap-2"
90
105
  }, {
91
- default: b(() => [
92
- t.logo ? w("", !0) : (n(), y(A, {
106
+ default: g(() => [
107
+ t.logo ? w("", !0) : (r(), k(V, {
93
108
  key: 0,
94
109
  class: "h-6 w-6"
95
110
  })),
96
- !t.logo && t.logoAlt ? (n(), r("span", L, P(t.logoAlt), 1)) : t.logo ? w("", !0) : (n(), r("span", U, "Brand"))
111
+ !t.logo && t.logoAlt ? (r(), i("span", D, T(t.logoAlt), 1)) : t.logo ? w("", !0) : (r(), i("span", H, "Brand"))
97
112
  ]),
98
113
  _: 1
99
114
  }, 8, ["src"]))
100
115
  ])
101
116
  ]),
102
- s("div", W, [
117
+ s("div", {
118
+ class: a(["items-center gap-1 overflow-x-auto no-scrollbar mask-gradient", n.value.desktopContent])
119
+ }, [
103
120
  l(e.$slots, "left")
104
- ])
121
+ ], 2)
105
122
  ]),
106
123
  s("div", {
107
- class: m([
108
- $.value,
124
+ class: a([
125
+ C.value,
109
126
  // Width constraint to ensure it doesn't crush others, but allows simple resizing
110
127
  "max-w-full"
111
128
  ])
@@ -113,86 +130,90 @@ const O = { class: "flex items-center gap-4 shrink-0 z-10" }, D = { class: "shri
113
130
  l(e.$slots, "center")
114
131
  ], 2),
115
132
  s("div", {
116
- class: m(["flex items-center gap-2 shrink-0 max-w-[40%] z-10", {
133
+ class: a(["flex items-center gap-2 shrink-0 max-w-[40%] z-10", {
117
134
  // Always push to end unless Center is pushing it.
118
135
  // If Center is 'center' (mx-auto) or 'right' (ml-auto), this naturally falls to end.
119
136
  // If Center is 'left', we MUST have ml-auto here.
120
- "ml-auto": a.centerPosition === "left" || a.centerPosition === "center"
137
+ "ml-auto": d.centerPosition === "left" || d.centerPosition === "center"
121
138
  // If center is 'right', Center has ml-auto. Right just sits next to it.
122
139
  // But if we add ml-auto here too, they might split space? No, flexbox parses strictly.
123
140
  }])
124
141
  }, [
125
142
  l(e.$slots, "right")
126
143
  ], 2)
127
- ], 64)) : (n(), r(h, { key: 1 }, [
128
- s("div", F, [
144
+ ], 64)) : (r(), i(y, { key: 1 }, [
145
+ s("div", {
146
+ class: a(n.value.mobileHeader)
147
+ }, [
129
148
  l(e.$slots, "logo", {}, () => [
130
149
  o[4] || (o[4] = s("div", { class: "font-bold text-xl truncate" }, "Brand", -1))
131
150
  ]),
132
151
  s("button", {
133
152
  type: "button",
134
153
  class: "p-2 -mr-2 text-muted-foreground hover:bg-accent rounded-md",
135
- onClick: o[1] || (o[1] = (i) => d.value = !0)
154
+ onClick: o[1] || (o[1] = (u) => c.value = !0)
136
155
  }, [
137
- p(x, {
156
+ p($, {
138
157
  icon: "lucide:menu",
139
158
  class: "w-5 h-5"
140
159
  }),
141
160
  o[5] || (o[5] = s("span", { class: "sr-only" }, "Open Menu", -1))
142
161
  ])
143
- ]),
144
- s("div", T, [
145
- s("div", Y, [
162
+ ], 2),
163
+ s("div", {
164
+ class: a(n.value.desktopSidebar)
165
+ }, [
166
+ s("div", U, [
146
167
  l(e.$slots, "logo", {}, () => [
147
168
  o[6] || (o[6] = s("div", { class: "font-bold text-xl truncate" }, "Brand", -1))
148
169
  ])
149
170
  ]),
150
- s("div", q, [
171
+ s("div", F, [
151
172
  l(e.$slots, "left"),
152
173
  l(e.$slots, "default"),
153
174
  l(e.$slots, "center")
154
175
  ]),
155
- s("div", G, [
176
+ s("div", Y, [
156
177
  l(e.$slots, "right")
157
178
  ])
158
- ])
179
+ ], 2)
159
180
  ], 64)),
160
- p(V, {
161
- show: d.value,
162
- "onUpdate:show": o[2] || (o[2] = (i) => d.value = i),
181
+ p(L, {
182
+ show: c.value,
183
+ "onUpdate:show": o[2] || (o[2] = (u) => c.value = u),
163
184
  position: "left",
164
185
  size: "sm",
165
- triggerClass: "sm:hidden",
166
- class: "z-60 sm:hidden"
186
+ triggerClass: n.value.mobileTrigger,
187
+ class: a(["z-60", n.value.mobileTrigger])
167
188
  }, {
168
- header: b(() => [
189
+ header: g(() => [
169
190
  l(e.$slots, "logo", {}, () => [
170
191
  o[7] || (o[7] = E("Brand", -1))
171
192
  ])
172
193
  ]),
173
- default: b(() => [
174
- s("div", H, [
175
- a.variant === "header" ? (n(), r("div", I, [
194
+ default: g(() => [
195
+ s("div", q, [
196
+ d.variant === "header" ? (r(), i("div", G, [
176
197
  l(e.$slots, "mobile-menu", {}, () => [
177
198
  l(e.$slots, "left"),
178
199
  o[8] || (o[8] = s("div", { class: "h-px bg-border my-2" }, null, -1)),
179
200
  l(e.$slots, "center")
180
201
  ])
181
- ])) : (n(), r("div", J, [
202
+ ])) : (r(), i("div", I, [
182
203
  l(e.$slots, "left"),
183
204
  l(e.$slots, "default"),
184
205
  l(e.$slots, "center")
185
206
  ])),
186
- s("div", K, [
207
+ s("div", J, [
187
208
  l(e.$slots, "right")
188
209
  ])
189
210
  ])
190
211
  ]),
191
212
  _: 3
192
- }, 8, ["show"])
213
+ }, 8, ["show", "triggerClass", "class"])
193
214
  ], 2));
194
215
  }
195
216
  });
196
217
  export {
197
- te as default
218
+ Z as default
198
219
  };