veloce-vue 0.25.0 → 0.27.0

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,14 +1,15 @@
1
- import { defineComponent as v, mergeModels as h, useModel as g, computed as n, createElementBlock as d, openBlock as u, Fragment as w, createElementVNode as o, renderSlot as i, normalizeClass as f, createCommentVNode as x, createVNode as k, toDisplayString as c, unref as m } from "vue";
1
+ import { defineComponent as v, mergeModels as h, useModel as g, computed as n, createElementBlock as d, openBlock as u, Fragment as w, createElementVNode as o, renderSlot as i, normalizeClass as f, createCommentVNode as x, createVNode as k, toDisplayString as m, unref as c } from "vue";
2
2
  /* empty css */
3
3
  import y from "../icons/Close.vue.js";
4
4
  import "motion-v";
5
5
  import C from "./Button.vue.js";
6
+ import "@vueuse/integrations/useCookies";
6
7
  import "@vueuse/core";
7
8
  /* empty css */
8
9
  const V = { class: "border-b p-2" }, $ = { class: "flex items-center justify-between gap-2" }, B = { class: "text-[0.95em] font-medium" }, S = { class: "text-muted text-sm" }, z = { class: "size-full overflow-auto p-2" }, F = {
9
10
  key: 0,
10
11
  class: "border-t p-2"
11
- }, q = /* @__PURE__ */ v({
12
+ }, A = /* @__PURE__ */ v({
12
13
  __name: "Drawer",
13
14
  props: /* @__PURE__ */ h({
14
15
  direction: { type: String, default: "bottom", options: ["left", "bottom", "right"] },
@@ -64,16 +65,16 @@ const V = { class: "border-b p-2" }, $ = { class: "flex items-center justify-bet
64
65
  }, [
65
66
  o("div", V, [
66
67
  o("div", $, [
67
- o("h4", B, c(s.title), 1),
68
- k(m(C), {
69
- icon: m(y),
68
+ o("h4", B, m(s.title), 1),
69
+ k(c(C), {
70
+ icon: c(y),
70
71
  class: "p-1!",
71
72
  circle: "",
72
73
  variant: "ghost",
73
74
  onClick: l[1] || (l[1] = (a) => t.value = !1)
74
75
  }, null, 8, ["icon"])
75
76
  ]),
76
- o("p", S, c(s.description), 1)
77
+ o("p", S, m(s.description), 1)
77
78
  ]),
78
79
  o("div", z, [
79
80
  i(e.$slots, "content")
@@ -90,5 +91,5 @@ const V = { class: "border-b p-2" }, $ = { class: "flex items-center justify-bet
90
91
  }
91
92
  });
92
93
  export {
93
- q as default
94
+ A as default
94
95
  };
@@ -14,10 +14,11 @@ import j from "./typography/Span.vue.js";
14
14
  /* empty css */
15
15
  import "motion-v";
16
16
  /* empty css */
17
- import "@vueuse/core";
17
+ import "@vueuse/integrations/useCookies";
18
18
  import q from "./Message.vue.js";
19
+ import "@vueuse/core";
19
20
  /* empty css */
20
- const v = { class: "*:first:mt-0 *:last:mb-0" }, U = /* @__PURE__ */ _({
21
+ const v = { class: "*:first:mt-0 *:last:mb-0" }, W = /* @__PURE__ */ _({
21
22
  __name: "JsonRenderer",
22
23
  props: {
23
24
  json: { type: Array, required: !0 }
@@ -59,5 +60,5 @@ const v = { class: "*:first:mt-0 *:last:mb-0" }, U = /* @__PURE__ */ _({
59
60
  }
60
61
  });
61
62
  export {
62
- U as default
63
+ W as default
63
64
  };
@@ -5,7 +5,7 @@ declare function __VLS_template(): {
5
5
  'left-actions'?(_: {}): any;
6
6
  'right-actions'?(_: {}): any;
7
7
  sidebar?(_: {
8
- showSidebar: true;
8
+ showSidebar: any;
9
9
  onClose: () => void;
10
10
  }): any;
11
11
  view?(_: {}): any;
@@ -1,42 +1,48 @@
1
- import { defineComponent as u, ref as f, onMounted as p, createElementBlock as h, openBlock as n, Fragment as b, createElementVNode as o, createVNode as l, renderSlot as i, unref as e, withCtx as c, createBlock as v, createCommentVNode as _, normalizeClass as g } from "vue";
1
+ import { defineComponent as p, ref as l, onMounted as h, createElementBlock as v, openBlock as c, Fragment as b, createElementVNode as t, createVNode as m, renderSlot as a, unref as s, withCtx as d, createBlock as g, createCommentVNode as _, normalizeClass as w } from "vue";
2
2
  /* empty css */
3
- import w from "../icons/Hamburger.vue.js";
4
- import { AnimatePresence as x, motion as k } from "motion-v";
5
- import C from "./Button.vue.js";
6
- import { useStorage as S } from "@vueuse/core";
3
+ import x from "../icons/Hamburger.vue.js";
4
+ import { AnimatePresence as k, motion as C } from "motion-v";
5
+ import S from "./Button.vue.js";
6
+ import { useCookies as B } from "@vueuse/integrations/useCookies";
7
+ import "@vueuse/core";
7
8
  /* empty css */
8
- const B = { class: "flex h-14 items-center justify-between gap-4 border-b px-4" }, $ = { class: "flex items-center gap-2" }, y = { class: "header-actions flex items-center gap-2" }, z = { class: "relative h-[calc(100dvh-3.5rem)] overflow-hidden" }, M = /* @__PURE__ */ u({
9
+ const $ = { class: "flex h-14 items-center justify-between gap-4 border-b px-4" }, y = { class: "flex items-center gap-2" }, z = { class: "header-actions flex items-center gap-2" }, N = { class: "relative h-[calc(100dvh-3.5rem)] overflow-hidden" }, T = /* @__PURE__ */ p({
9
10
  __name: "Layout",
10
11
  emits: ["sidebar"],
11
- setup(N, { emit: d }) {
12
- const m = d, t = S("showSidebar", !1), a = f(!0);
13
- p(() => setTimeout(() => a.value = !1, 100));
14
- const r = () => {
15
- t.value = !t.value, m("sidebar", t.value);
12
+ setup(V, { emit: u }) {
13
+ const i = B(["showSidebar"]), f = u, e = l(i.get("showSidebar") ?? !0), r = l(!0);
14
+ h(() => setTimeout(() => r.value = !1, 100));
15
+ const n = () => {
16
+ e.value = !e.value, i.set("showSidebar", e.value, {
17
+ path: "/",
18
+ sameSite: "lax",
19
+ maxAge: 3600 * 24 * 365
20
+ // 1 year
21
+ }), f("sidebar", e.value);
16
22
  };
17
- return (s, V) => (n(), h(b, null, [
18
- o("header", B, [
19
- o("div", $, [
20
- l(e(C), {
21
- icon: e(w),
23
+ return (o, A) => (c(), v(b, null, [
24
+ t("header", $, [
25
+ t("div", y, [
26
+ m(s(S), {
27
+ icon: s(x),
22
28
  iconClass: "size-6",
23
29
  class: "p-1!",
24
30
  variant: "soft",
25
- onClick: r
31
+ onClick: n
26
32
  }, null, 8, ["icon"]),
27
- i(s.$slots, "left-actions")
33
+ a(o.$slots, "left-actions")
28
34
  ]),
29
- o("div", y, [
30
- i(s.$slots, "right-actions")
35
+ t("div", z, [
36
+ a(o.$slots, "right-actions")
31
37
  ])
32
38
  ]),
33
- o("main", z, [
34
- l(e(x), null, {
35
- default: c(() => [
36
- e(t) ? (n(), v(e(k).div, {
39
+ t("main", N, [
40
+ m(s(k), null, {
41
+ default: d(() => [
42
+ e.value ? (c(), g(s(C).div, {
37
43
  key: 0,
38
44
  class: "bg-background absolute bottom-0 left-0 top-0 z-50 w-[240px] shrink-0 overflow-hidden border-r",
39
- initial: a.value && e(t) ? { x: 0 } : { x: -240 },
45
+ initial: r.value && e.value ? { x: 0 } : { x: -240 },
40
46
  animate: { x: 0 },
41
47
  exit: { x: -240 },
42
48
  transition: {
@@ -44,10 +50,10 @@ const B = { class: "flex h-14 items-center justify-between gap-4 border-b px-4"
44
50
  ease: [0.4, 0, 0.2, 1]
45
51
  }
46
52
  }, {
47
- default: c(() => [
48
- i(s.$slots, "sidebar", {
49
- showSidebar: e(t),
50
- onClose: r
53
+ default: d(() => [
54
+ a(o.$slots, "sidebar", {
55
+ showSidebar: e.value,
56
+ onClose: n
51
57
  })
52
58
  ]),
53
59
  _: 3
@@ -55,15 +61,15 @@ const B = { class: "flex h-14 items-center justify-between gap-4 border-b px-4"
55
61
  ]),
56
62
  _: 3
57
63
  }),
58
- o("div", {
59
- class: g([{ "lg:ml-[240px]": e(t) }, "h-full overflow-auto p-2 transition-[margin-left] duration-300 ease-in-out"])
64
+ t("div", {
65
+ class: w([{ "lg:ml-[240px]": e.value }, "h-full overflow-auto p-2 transition-[margin-left] duration-300 ease-in-out"])
60
66
  }, [
61
- i(s.$slots, "view")
67
+ a(o.$slots, "view")
62
68
  ], 2)
63
69
  ])
64
70
  ], 64));
65
71
  }
66
72
  });
67
73
  export {
68
- M as default
74
+ T as default
69
75
  };
@@ -3,6 +3,7 @@ import { defineComponent as f, useModel as x, createElementBlock as n, openBlock
3
3
  import w from "../icons/Close.vue.js";
4
4
  import { AnimatePresence as y, motion as b } from "motion-v";
5
5
  import k from "./Button.vue.js";
6
+ import "@vueuse/integrations/useCookies";
6
7
  import { useWindowSize as g } from "@vueuse/core";
7
8
  /* empty css */
8
9
  const C = {
@@ -11,7 +12,7 @@ const C = {
11
12
  }, V = { class: "flex items-center gap-4 border-b px-4 py-2" }, _ = { class: "max-h-[calc(100dvh-100px)] flex-1 overflow-auto px-4 py-2 sm:max-h-[75vh]" }, $ = {
12
13
  key: 0,
13
14
  class: "border-t px-4 py-2"
14
- }, j = /* @__PURE__ */ f({
15
+ }, A = /* @__PURE__ */ f({
15
16
  __name: "Modal",
16
17
  props: {
17
18
  modelValue: {},
@@ -69,5 +70,5 @@ const C = {
69
70
  }
70
71
  });
71
72
  export {
72
- j as default
73
+ A as default
73
74
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as j, mergeModels as w, useModel as A, computed as d, ref as v, useTemplateRef as D, watch as b, createElementBlock as s, openBlock as n, createVNode as y, unref as a, withCtx as O, createBlock as C, createCommentVNode as f, createElementVNode as z, Fragment as E, renderList as W, normalizeClass as S, toDisplayString as q } from "vue";
1
+ import { defineComponent as j, mergeModels as w, useModel as A, computed as d, ref as v, useTemplateRef as D, watch as b, createElementBlock as s, openBlock as n, createVNode as y, unref as a, withCtx as O, createBlock as C, createCommentVNode as m, createElementVNode as z, Fragment as E, renderList as W, normalizeClass as S, toDisplayString as q } from "vue";
2
2
  /* empty css */
3
3
  import H from "../icons/Check.vue.js";
4
4
  import P from "../icons/ChevronDown.vue.js";
@@ -7,12 +7,13 @@ import R from "./icon/Icon.vue.js";
7
7
  import { AnimatePresence as T, motion as U } from "motion-v";
8
8
  import _ from "./Button.vue.js";
9
9
  import G from "./Input.vue.js";
10
+ import "@vueuse/integrations/useCookies";
10
11
  import { onClickOutside as I } from "@vueuse/core";
11
12
  /* empty css */
12
13
  const J = {
13
14
  key: 0,
14
15
  class: "border-b p-2"
15
- }, K = { class: "h-full max-h-[220px] overflow-y-auto overflow-x-hidden p-2" }, X = ["onClick"], ue = /* @__PURE__ */ j({
16
+ }, K = { class: "h-full max-h-[220px] overflow-y-auto overflow-x-hidden p-2" }, X = ["onClick"], ce = /* @__PURE__ */ j({
16
17
  __name: "Select",
17
18
  props: /* @__PURE__ */ w({
18
19
  options: { type: Array, required: !0 },
@@ -29,7 +30,7 @@ const J = {
29
30
  }),
30
31
  emits: /* @__PURE__ */ w(["update:isOpen"], ["update:modelValue"]),
31
32
  setup(l, { emit: V }) {
32
- const r = l, B = V, g = A(l, "modelValue"), u = d(() => g.value), e = v(r.isOpen ?? !1), m = v(!1), h = D("target");
33
+ const r = l, B = V, g = A(l, "modelValue"), u = d(() => g.value), e = v(r.isOpen ?? !1), f = v(!1), h = D("target");
33
34
  I(h, () => {
34
35
  r.closeOnClickOutside, e.value = !1, p();
35
36
  }), b(
@@ -43,7 +44,7 @@ const J = {
43
44
  }, L = (t) => {
44
45
  g.value = t, p();
45
46
  }, p = () => {
46
- e.value = !1, m.value = !1, i.value = "";
47
+ e.value = !1, f.value = !1, i.value = "";
47
48
  }, i = v(""), k = d(() => i.value ? r.options.filter((t) => t.toLowerCase().includes(i.value.toLowerCase())) : r.options), x = d(() => {
48
49
  switch (r.size) {
49
50
  case "sm":
@@ -95,12 +96,12 @@ const J = {
95
96
  placeholder: "Search",
96
97
  size: l.size
97
98
  }, null, 8, ["modelValue", "trailing-icon", "size"])
98
- ])) : f("", !0),
99
+ ])) : m("", !0),
99
100
  z("ul", K, [
100
101
  (n(!0), s(E, null, W(k.value, (o, $) => (n(), s("li", {
101
102
  key: $,
102
- class: S([[x.value, { "dark:text-neutral-300": o !== u.value }, { "bg-neutral-100/75 dark:bg-neutral-800/75": o === u.value && !m.value }], "flex w-full cursor-pointer items-center justify-between rounded border border-transparent text-left transition-colors duration-150 hover:bg-neutral-100/75 dark:hover:bg-neutral-800/75"]),
103
- onMouseenter: c[1] || (c[1] = (F) => m.value = !0),
103
+ class: S([[x.value, { "dark:text-neutral-300": o !== u.value }, { "bg-neutral-100/75 dark:bg-neutral-800/75": o === u.value && !f.value }], "flex w-full cursor-pointer items-center justify-between rounded border border-transparent text-left transition-colors duration-150 hover:bg-neutral-100/75 dark:hover:bg-neutral-800/75"]),
104
+ onMouseenter: c[1] || (c[1] = (F) => f.value = !0),
104
105
  onClick: (F) => L(o)
105
106
  }, [
106
107
  z("span", null, q(o), 1),
@@ -108,16 +109,16 @@ const J = {
108
109
  key: 0,
109
110
  icon: a(H),
110
111
  class: "size-5"
111
- }, null, 8, ["icon"])) : f("", !0)
112
+ }, null, 8, ["icon"])) : m("", !0)
112
113
  ], 42, X))), 128)),
113
114
  k.value.length === 0 ? (n(), s("li", {
114
115
  key: 0,
115
116
  class: S([x.value, ""])
116
- }, "No options found", 2)) : f("", !0)
117
+ }, "No options found", 2)) : m("", !0)
117
118
  ])
118
119
  ]),
119
120
  _: 1
120
- })) : f("", !0)
121
+ })) : m("", !0)
121
122
  ]),
122
123
  _: 1
123
124
  })
@@ -125,5 +126,5 @@ const J = {
125
126
  }
126
127
  });
127
128
  export {
128
- ue as default
129
+ ce as default
129
130
  };
@@ -7,9 +7,10 @@ import E from "../Button.vue.js";
7
7
  import { getTypography as N } from "../../utils/typography.js";
8
8
  import { getMargin as P } from "../../utils/margin.js";
9
9
  import { getPadding as V } from "../../utils/padding.js";
10
+ import "@vueuse/integrations/useCookies";
10
11
  import "@vueuse/core";
11
12
  /* empty css */
12
- const U = /* @__PURE__ */ T({
13
+ const X = /* @__PURE__ */ T({
13
14
  __name: "Code",
14
15
  props: {
15
16
  text: { type: String, default: "" },
@@ -33,8 +34,8 @@ const U = /* @__PURE__ */ T({
33
34
  paddingBottom: { type: String, default: "" }
34
35
  },
35
36
  setup(n) {
36
- const { fontSizes: r, fontWeights: o, textColors: g, letterSpacings: p, lineHeights: d } = N(), { margin: l, marginLeft: m, marginRight: f, marginTop: u, marginBottom: s } = P(), { padding: c, paddingLeft: y, paddingRight: S, paddingTop: h, paddingBottom: b } = V(), t = n, k = v(() => [
37
- r[t.fontSize],
37
+ const { fontSizes: a, fontWeights: o, textColors: g, letterSpacings: p, lineHeights: d } = N(), { margin: l, marginLeft: m, marginRight: f, marginTop: u, marginBottom: s } = P(), { padding: c, paddingLeft: y, paddingRight: S, paddingTop: h, paddingBottom: b } = V(), t = n, k = v(() => [
38
+ a[t.fontSize],
38
39
  g[t.color],
39
40
  o[t.fontWeight],
40
41
  d[t.lineHeight],
@@ -52,9 +53,9 @@ const U = /* @__PURE__ */ T({
52
53
  h[t.paddingTop],
53
54
  b[t.paddingBottom]
54
55
  ]), e = C(!1), B = async () => {
55
- navigator.clipboard.writeText(t.text), e.value = !0, await new Promise((a) => setTimeout(a, 3e3)), e.value = !1;
56
+ navigator.clipboard.writeText(t.text), e.value = !0, await new Promise((r) => setTimeout(r, 3e3)), e.value = !1;
56
57
  };
57
- return (a, D) => (L(), x("code", {
58
+ return (r, D) => (L(), x("code", {
58
59
  class: R([[k.value, n.block ? "block p-2.5" : "px-1.5 py-0.5"], "relative rounded border border-neutral-200 bg-neutral-100 dark:border-neutral-700 dark:bg-neutral-800"])
59
60
  }, [
60
61
  z("span", null, w(t.text), 1),
@@ -70,5 +71,5 @@ const U = /* @__PURE__ */ T({
70
71
  }
71
72
  });
72
73
  export {
73
- U as default
74
+ X as default
74
75
  };
@@ -1,9 +1,29 @@
1
- import { computed as a, watch as l, onBeforeMount as d } from "vue";
2
- import { useStorage as s } from "@vueuse/core";
3
- const m = () => {
4
- const e = s("color-mode", "dark"), o = a(() => e.value === "dark"), t = () => e.value = o.value ? "light" : "dark";
5
- return l(e, (r) => document.documentElement.classList.toggle("dark", r === "dark")), d(() => document.documentElement.classList.toggle("dark", o.value)), { mode: e, isDark: o, toggleDark: t };
1
+ import { computed as a, watch as r, onBeforeMount as s } from "vue";
2
+ import { useCookies as u } from "@vueuse/integrations/useCookies";
3
+ const i = () => {
4
+ const c = u(["color-mode"], {
5
+ autoUpdateDependencies: !0
6
+ }), o = a({
7
+ get: () => c.get("color-mode") || "dark",
8
+ set: (e) => {
9
+ c.set("color-mode", e, {
10
+ path: "/",
11
+ sameSite: "lax",
12
+ maxAge: 3600 * 24 * 365
13
+ // 1 year
14
+ });
15
+ }
16
+ }), t = a(() => o.value === "dark"), d = () => {
17
+ o.value = t.value ? "light" : "dark";
18
+ }, n = (e) => {
19
+ typeof document < "u" && (document.documentElement.classList.toggle("dark", e), document.documentElement.style.background = e ? "oklch(20.5% 0 0)" : "#fff");
20
+ };
21
+ return r(o, (e) => {
22
+ n(e === "dark");
23
+ }), s(() => {
24
+ n(t.value);
25
+ }), { mode: o, isDark: t, toggleDark: d };
6
26
  };
7
27
  export {
8
- m as useColorMode
28
+ i as useColorMode
9
29
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veloce-vue",
3
- "version": "0.25.0",
3
+ "version": "0.27.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "A Vue 3 library built with Vite + TypeScript + Tailwind CSS.",
@@ -58,8 +58,10 @@
58
58
  "./styles.css": "./veloce.css"
59
59
  },
60
60
  "peerDependencies": {
61
- "vue": "^3.3.0",
62
- "motion-v": "^1.7.4"
61
+ "@vueuse/core": "^13.9.0",
62
+ "@vueuse/integrations": "^14.0.0",
63
+ "motion-v": "^1.7.4",
64
+ "vue": "^3.3.0"
63
65
  },
64
66
  "sideEffects": [
65
67
  "**/*.css",