veloce-vue 0.22.0 → 0.23.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,34 +1,24 @@
1
- import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
2
  declare function __VLS_template(): {
3
3
  attrs: Partial<{}>;
4
4
  slots: {
5
- 'header-actions'?(_: {}): any;
5
+ 'left-actions'?(_: {}): any;
6
+ 'right-actions'?(_: {}): any;
6
7
  sidebar?(_: {
7
8
  showSidebar: true;
8
9
  onClose: () => void;
9
10
  }): any;
11
+ view?(_: {}): any;
10
12
  };
11
13
  refs: {};
12
14
  rootEl: any;
13
15
  };
14
16
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
15
- declare const __VLS_component: DefineComponent<ExtractPropTypes<{
16
- brandName: {
17
- type: StringConstructor;
18
- default: string;
19
- };
20
- }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
17
+ declare const __VLS_component: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
21
18
  sidebar: (showSidebar: boolean) => any;
22
- }, string, PublicProps, Readonly< ExtractPropTypes<{
23
- brandName: {
24
- type: StringConstructor;
25
- default: string;
26
- };
27
- }>> & Readonly<{
19
+ }, string, PublicProps, Readonly<{}> & Readonly<{
28
20
  onSidebar?: ((showSidebar: boolean) => any) | undefined;
29
- }>, {
30
- brandName: string;
31
- }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
21
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
32
22
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
33
23
  export default _default;
34
24
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -1,83 +1,69 @@
1
- import { defineComponent as v, ref as g, onMounted as x, resolveComponent as d, createElementBlock as w, openBlock as a, Fragment as k, createElementVNode as o, createVNode as r, createBlock as m, createCommentVNode as u, unref as e, withCtx as n, toDisplayString as C, renderSlot as f, normalizeClass as S } from "vue";
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";
2
2
  /* empty css */
3
- import y from "../icons/Hamburger.vue.js";
4
- import { AnimatePresence as N, motion as V } from "motion-v";
5
- import B from "./Button.vue.js";
6
- import { useStorage as z } from "@vueuse/core";
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";
7
7
  /* empty css */
8
- const E = { class: "flex h-14 items-center justify-between gap-4 border-b px-4" }, L = { class: "flex items-center gap-2" }, $ = { class: "text-base font-medium" }, j = { class: "header-actions flex items-center gap-2" }, A = { class: "relative h-[calc(100dvh-3.5rem)] overflow-hidden" }, G = /* @__PURE__ */ v({
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
9
  __name: "Layout",
10
- props: {
11
- brandName: { type: String, default: "VeloceVue" }
12
- },
13
10
  emits: ["sidebar"],
14
- setup(i, { emit: p }) {
15
- const h = p, t = z("showSidebar", !1), s = g(!0);
16
- x(() => setTimeout(() => s.value = !1, 100));
17
- const l = () => {
18
- t.value = !t.value, h("sidebar", t.value);
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);
19
16
  };
20
- return (c, D) => {
21
- const _ = d("router-link"), b = d("router-view");
22
- return a(), w(k, null, [
23
- o("header", E, [
24
- o("div", L, [
25
- r(e(B), {
26
- icon: e(y),
27
- iconClass: "size-6",
28
- class: "p-1!",
29
- variant: "soft",
30
- onClick: l
31
- }, null, 8, ["icon"]),
32
- i.brandName ? (a(), m(_, {
17
+ return (s, V) => (n(), h(b, null, [
18
+ o("header", B, [
19
+ o("div", $, [
20
+ l(e(C), {
21
+ icon: e(w),
22
+ iconClass: "size-6",
23
+ class: "p-1!",
24
+ variant: "soft",
25
+ onClick: r
26
+ }, null, 8, ["icon"]),
27
+ i(s.$slots, "left-actions")
28
+ ]),
29
+ o("div", y, [
30
+ i(s.$slots, "right-actions")
31
+ ])
32
+ ]),
33
+ o("main", z, [
34
+ l(e(x), null, {
35
+ default: c(() => [
36
+ e(t) ? (n(), v(e(k).div, {
33
37
  key: 0,
34
- to: "/"
38
+ 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 },
40
+ animate: { x: 0 },
41
+ exit: { x: -240 },
42
+ transition: {
43
+ duration: 0.3,
44
+ ease: [0.4, 0, 0.2, 1]
45
+ }
35
46
  }, {
36
- default: n(() => [
37
- o("h1", $, C(i.brandName), 1)
47
+ default: c(() => [
48
+ i(s.$slots, "sidebar", {
49
+ showSidebar: e(t),
50
+ onClose: r
51
+ })
38
52
  ]),
39
- _: 1
40
- })) : u("", !0)
53
+ _: 3
54
+ }, 8, ["initial"])) : _("", !0)
41
55
  ]),
42
- o("div", j, [
43
- f(c.$slots, "header-actions")
44
- ])
45
- ]),
46
- o("main", A, [
47
- r(e(N), null, {
48
- default: n(() => [
49
- e(t) ? (a(), m(e(V).div, {
50
- key: 0,
51
- class: "bg-background absolute bottom-0 left-0 top-0 z-50 w-[240px] shrink-0 overflow-hidden border-r",
52
- initial: s.value && e(t) ? { x: 0 } : { x: -240 },
53
- animate: { x: 0 },
54
- exit: { x: -240 },
55
- transition: {
56
- duration: 0.3,
57
- ease: [0.4, 0, 0.2, 1]
58
- }
59
- }, {
60
- default: n(() => [
61
- f(c.$slots, "sidebar", {
62
- showSidebar: e(t),
63
- onClose: l
64
- })
65
- ]),
66
- _: 3
67
- }, 8, ["initial"])) : u("", !0)
68
- ]),
69
- _: 3
70
- }),
71
- o("div", {
72
- class: S([{ "lg:ml-[240px]": e(t) }, "h-full overflow-auto p-2 transition-[margin-left] duration-300 ease-in-out"])
73
- }, [
74
- r(b)
75
- ], 2)
76
- ])
77
- ], 64);
78
- };
56
+ _: 3
57
+ }),
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"])
60
+ }, [
61
+ i(s.$slots, "view")
62
+ ], 2)
63
+ ])
64
+ ], 64));
79
65
  }
80
66
  });
81
67
  export {
82
- G as default
68
+ M as default
83
69
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veloce-vue",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "A Vue 3 library built with Vite + TypeScript + Tailwind CSS.",