adverich-kun-ui 0.1.43 → 0.1.45

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 { computed as u, createElementBlock as a, openBlock as r, normalizeClass as c, renderSlot as o, createCommentVNode as i, createElementVNode as g, createTextVNode as p, toDisplayString as f } from "vue";
2
- const y = ["disabled"], x = {
1
+ import { computed as a, createBlock as y, openBlock as o, resolveDynamicComponent as m, mergeProps as b, withCtx as x, renderSlot as s, createElementBlock as i, createCommentVNode as l, createElementVNode as h, createTextVNode as $, toDisplayString as v } from "vue";
2
+ import { RouterLink as S } from "../../../../node_modules/.pnpm/vue-router@4.5.1_vue@3.5.13/node_modules/vue-router/dist/vue-router.js";
3
+ const w = {
3
4
  key: 1,
4
5
  class: "mr-2 flex items-center"
5
- }, b = {
6
+ }, k = {
6
7
  key: 2,
7
8
  class: "truncate"
8
- }, m = {
9
+ }, C = {
9
10
  key: 3,
10
11
  class: "ml-2 flex items-center"
11
- }, $ = {
12
+ }, z = {
12
13
  __name: "KunBtn",
13
14
  props: {
14
15
  text: { type: String, default: null },
@@ -25,11 +26,22 @@ const y = ["disabled"], x = {
25
26
  disabled: { type: Boolean, default: !1 },
26
27
  loading: { type: Boolean, default: !1 },
27
28
  bgColor: { type: String, default: "bg-indigo-600" },
28
- textColor: { type: String, default: "text-white" }
29
+ textColor: { type: String, default: "text-white" },
30
+ to: [String, Object],
31
+ href: String
29
32
  },
30
33
  setup(t) {
31
- const s = t, l = (e) => {
32
- switch (e) {
34
+ const e = t, d = a(() => !!e.to || !!e.href), u = a(() => !d.value), c = a(() => e.href ? "a" : e.to ? S : "button"), f = a(() => e.href ? {
35
+ href: e.href,
36
+ target: e.target ?? "_self"
37
+ } : e.to ? {
38
+ to: e.to,
39
+ replace: e.replace
40
+ } : {
41
+ type: "button",
42
+ disabled: e.loading || e.disabled
43
+ }), g = (n) => {
44
+ switch (n) {
33
45
  case "xxs":
34
46
  return "px-1 py-1 text-xs";
35
47
  case "xs":
@@ -45,53 +57,55 @@ const y = ["disabled"], x = {
45
57
  case "xxl":
46
58
  return "px-4 py-4 text-base";
47
59
  }
48
- }, d = u(() => {
49
- const e = s.bgColor || "bg-indigo-600", n = s.textColor || "text-white";
50
- switch (s.variant) {
60
+ }, p = a(() => {
61
+ const n = e.bgColor || "bg-indigo-600", r = e.textColor || "text-white";
62
+ switch (e.variant) {
51
63
  case "default":
52
- return `${e} ${n} shadow hover:brightness-90 transition`;
64
+ return `${n} ${r} shadow hover:brightness-90 transition`;
53
65
  case "tonal":
54
- return `${e} ${n} bg-opacity-20 hover:bg-opacity-30 transition`;
66
+ return `${n} ${r} bg-opacity-20 hover:bg-opacity-30 transition`;
55
67
  case "plain":
56
- return `bg-transparent ${n} hover:bg-gray-100 transition`;
68
+ return `bg-transparent ${r} hover:bg-gray-100 transition`;
57
69
  case "outline":
58
- return `bg-transparent border ${e} ${n} border-opacity-80 hover:bg-opacity-10 transition`;
70
+ return `bg-transparent border ${n} ${r} border-opacity-80 hover:bg-opacity-10 transition`;
59
71
  case "soft":
60
- return `${e} ${n} shadow-md bg-opacity-30 hover:bg-opacity-40 transition`;
72
+ return `${n} ${r} shadow-md bg-opacity-30 hover:bg-opacity-40 transition`;
61
73
  default:
62
- return `${e} ${n}`;
74
+ return `${n} ${r}`;
63
75
  }
64
76
  });
65
- return (e, n) => (r(), a("button", {
66
- type: "button",
67
- class: c(["flex items-center justify-center break-keep transition-all", [
77
+ return (n, r) => (o(), y(m(c.value), b(f.value, {
78
+ class: ["flex items-center justify-center break-keep transition-all", [
68
79
  t.minWidth,
69
- l(t.size),
80
+ g(t.size),
70
81
  t.fontWeight,
71
- d.value,
82
+ p.value,
72
83
  t.rounded,
73
84
  t.textAlign,
74
85
  "whitespace-nowrap",
75
86
  t.loading || t.disabled ? "opacity-50 cursor-not-allowed" : "hover:opacity-90 focus:outline-none focus:ring-2 focus:ring-offset-2 active:scale-[.98] transition duration-100 ease-in-out cursor-pointer"
76
- ]]),
77
- disabled: t.loading || t.disabled
78
- }, [
79
- t.loading ? o(e.$slots, "loader", { key: 0 }, () => [
80
- n[0] || (n[0] = g("span", { class: "mr-2 h-5 w-5 border-[3px] border-current opacity-100 border-opacity-100 border-t-transparent rounded-full animate-spin" }, null, -1))
81
- ]) : e.$slots.prepend ? (r(), a("span", x, [
82
- o(e.$slots, "prepend")
83
- ])) : i("", !0),
84
- !t.loading && (e.$slots.default || t.text) ? (r(), a("span", b, [
85
- o(e.$slots, "default", {}, () => [
86
- p(f(t.text), 1)
87
- ])
88
- ])) : i("", !0),
89
- !t.loading && e.$slots.append ? (r(), a("span", m, [
90
- o(e.$slots, "append")
91
- ])) : i("", !0)
92
- ], 10, y));
87
+ ]],
88
+ disabled: u.value && (t.loading || t.disabled)
89
+ }), {
90
+ default: x(() => [
91
+ t.loading ? s(n.$slots, "loader", { key: 0 }, () => [
92
+ r[0] || (r[0] = h("span", { class: "mr-2 h-5 w-5 border-[3px] border-current opacity-100 border-opacity-100 border-t-transparent rounded-full animate-spin" }, null, -1))
93
+ ]) : n.$slots.prepend ? (o(), i("span", w, [
94
+ s(n.$slots, "prepend")
95
+ ])) : l("", !0),
96
+ !t.loading && (n.$slots.default || t.text) ? (o(), i("span", k, [
97
+ s(n.$slots, "default", {}, () => [
98
+ $(v(t.text), 1)
99
+ ])
100
+ ])) : l("", !0),
101
+ !t.loading && n.$slots.append ? (o(), i("span", C, [
102
+ s(n.$slots, "append")
103
+ ])) : l("", !0)
104
+ ]),
105
+ _: 3
106
+ }, 16, ["class", "disabled"]));
93
107
  }
94
108
  };
95
109
  export {
96
- $ as default
110
+ z as default
97
111
  };
@@ -0,0 +1,34 @@
1
+ import { computed as r, createElementBlock as a, openBlock as o, normalizeStyle as c, normalizeClass as i } from "vue";
2
+ const s = {
3
+ __name: "KunDivider",
4
+ props: {
5
+ vertical: Boolean,
6
+ inset: Boolean,
7
+ dashed: Boolean,
8
+ length: [String, Number],
9
+ color: {
10
+ type: String,
11
+ default: ""
12
+ }
13
+ },
14
+ setup(e) {
15
+ const t = e, n = r(() => {
16
+ const l = t.length != null ? typeof t.length == "number" ? `${t.length}px` : t.length : void 0;
17
+ return t.vertical ? { height: l } : { width: l };
18
+ });
19
+ return (l, u) => (o(), a("div", {
20
+ role: "separator",
21
+ class: i([
22
+ "shrink-0",
23
+ e.vertical ? "w-px h-full" : "h-px w-full",
24
+ e.dashed ? "border border-dashed border-current bg-transparent" : "bg-current",
25
+ e.inset ? e.vertical ? "ml-4" : "mx-4" : "",
26
+ e.color
27
+ ]),
28
+ style: c(n.value)
29
+ }, null, 6));
30
+ }
31
+ };
32
+ export {
33
+ s as default
34
+ };
package/dist/index.js CHANGED
@@ -1,34 +1,36 @@
1
1
  /* empty css */
2
2
  import m from "./components/KunAlert/src/components/KunAlert.vue.js";
3
- import t from "./components/KunAppbar/src/components/KunAppbar.vue.js";
4
- import i from "./components/KunAppbarTitle/src/components/KunAppbarTitle.vue.js";
3
+ import i from "./components/KunAppbar/src/components/KunAppbar.vue.js";
4
+ import t from "./components/KunAppbarTitle/src/components/KunAppbarTitle.vue.js";
5
5
  import a from "./components/KunAutocomplete/src/components/KunAutocomplete.vue.js";
6
- import p from "./components/KunBtn/src/components/KunBtn.vue.js";
7
- import u from "./components/KunBudge/src/components/KunBudge.vue.js";
6
+ import u from "./components/KunBtn/src/components/KunBtn.vue.js";
7
+ import p from "./components/KunBudge/src/components/KunBudge.vue.js";
8
8
  import f from "./components/KunCard/src/components/KunCard.vue.js";
9
9
  import s from "./components/KunCardText/src/components/KunCardText.vue.js";
10
10
  import K from "./components/KunCurrency/src/components/KunCurrency.vue.js";
11
- import c from "./components/KunIcon/src/components/KunIcon.vue.js";
12
- import e from "./components/KunList/src/components/KunList.vue.js";
13
- import _ from "./components/KunSpacer/src/components/KunSpacer.vue.js";
14
- import l from "./components/KunSwitch/src/components/KunSwitch.vue.js";
15
- import $ from "./components/KunTextField/src/components/KunTextField.vue.js";
11
+ import c from "./components/KunDivider/src/components/KunDivider.vue.js";
12
+ import e from "./components/KunIcon/src/components/KunIcon.vue.js";
13
+ import _ from "./components/KunList/src/components/KunList.vue.js";
14
+ import l from "./components/KunSpacer/src/components/KunSpacer.vue.js";
15
+ import $ from "./components/KunSwitch/src/components/KunSwitch.vue.js";
16
+ import d from "./components/KunTextField/src/components/KunTextField.vue.js";
16
17
  import A from "./components/KunToolbar/src/components/KunToolbar.vue.js";
17
18
  const r = {
18
19
  KunAlert: m,
19
- KunAppbar: t,
20
- KunAppbarTitle: i,
20
+ KunAppbar: i,
21
+ KunAppbarTitle: t,
21
22
  KunAutocomplete: a,
22
- KunBtn: p,
23
- KunBudge: u,
23
+ KunBtn: u,
24
+ KunBudge: p,
24
25
  KunCard: f,
25
26
  KunCardText: s,
26
27
  KunCurrency: K,
27
- KunIcon: c,
28
- KunList: e,
29
- KunSpacer: _,
30
- KunSwitch: l,
31
- KunTextField: $,
28
+ KunDivider: c,
29
+ KunIcon: e,
30
+ KunList: _,
31
+ KunSpacer: l,
32
+ KunSwitch: $,
33
+ KunTextField: d,
32
34
  KunToolbar: A
33
35
  };
34
36
  function q(o) {
@@ -37,19 +39,20 @@ function q(o) {
37
39
  }
38
40
  export {
39
41
  m as KunAlert,
40
- t as KunAppbar,
41
- i as KunAppbarTitle,
42
+ i as KunAppbar,
43
+ t as KunAppbarTitle,
42
44
  a as KunAutocomplete,
43
- p as KunBtn,
44
- u as KunBudge,
45
+ u as KunBtn,
46
+ p as KunBudge,
45
47
  f as KunCard,
46
48
  s as KunCardText,
47
49
  K as KunCurrency,
48
- c as KunIcon,
49
- e as KunList,
50
- _ as KunSpacer,
51
- l as KunSwitch,
52
- $ as KunTextField,
50
+ c as KunDivider,
51
+ e as KunIcon,
52
+ _ as KunList,
53
+ l as KunSpacer,
54
+ $ as KunSwitch,
55
+ d as KunTextField,
53
56
  A as KunToolbar,
54
57
  q as install
55
58
  };
@@ -0,0 +1,187 @@
1
+ import { defineComponent as R, reactive as D, inject as g, computed as a, h as L, unref as f, getCurrentInstance as I, watchEffect as P } from "vue";
2
+ /*!
3
+ * vue-router v4.5.1
4
+ * (c) 2025 Eduardo San Martin Morote
5
+ * @license MIT
6
+ */
7
+ const K = typeof document < "u", j = () => {
8
+ }, v = Array.isArray;
9
+ function E(t) {
10
+ const e = Array.from(arguments).slice(1);
11
+ console.warn.apply(console, ["[Vue Router warn]: " + t].concat(e));
12
+ }
13
+ function k(t, e) {
14
+ return (t.aliasOf || t) === (e.aliasOf || e);
15
+ }
16
+ function B(t, e) {
17
+ if (Object.keys(t).length !== Object.keys(e).length)
18
+ return !1;
19
+ for (const n in t)
20
+ if (!T(t[n], e[n]))
21
+ return !1;
22
+ return !0;
23
+ }
24
+ function T(t, e) {
25
+ return v(t) ? A(t, e) : v(e) ? A(e, t) : t === e;
26
+ }
27
+ function A(t, e) {
28
+ return v(e) ? t.length === e.length && t.every((n, o) => n === e[o]) : t.length === 1 && t[0] === e;
29
+ }
30
+ var _;
31
+ (function(t) {
32
+ t.pop = "pop", t.push = "push";
33
+ })(_ || (_ = {}));
34
+ var O;
35
+ (function(t) {
36
+ t.back = "back", t.forward = "forward", t.unknown = "";
37
+ })(O || (O = {}));
38
+ function V(t) {
39
+ return typeof t == "string" || t && typeof t == "object";
40
+ }
41
+ Symbol(process.env.NODE_ENV !== "production" ? "navigation failure" : "");
42
+ var w;
43
+ (function(t) {
44
+ t[t.aborted = 4] = "aborted", t[t.cancelled = 8] = "cancelled", t[t.duplicated = 16] = "duplicated";
45
+ })(w || (w = {}));
46
+ Symbol(process.env.NODE_ENV !== "production" ? "router view location matched" : "");
47
+ Symbol(process.env.NODE_ENV !== "production" ? "router view depth" : "");
48
+ const C = Symbol(process.env.NODE_ENV !== "production" ? "router" : ""), M = Symbol(process.env.NODE_ENV !== "production" ? "route location" : "");
49
+ Symbol(process.env.NODE_ENV !== "production" ? "router view location" : "");
50
+ function x(t) {
51
+ const e = g(C), n = g(M);
52
+ let o = !1, c = null;
53
+ const u = a(() => {
54
+ const r = f(t.to);
55
+ return process.env.NODE_ENV !== "production" && (!o || r !== c) && (V(r) || (o ? E(`Invalid value for prop "to" in useLink()
56
+ - to:`, r, `
57
+ - previous to:`, c, `
58
+ - props:`, t) : E(`Invalid value for prop "to" in useLink()
59
+ - to:`, r, `
60
+ - props:`, t)), c = r, o = !0), e.resolve(r);
61
+ }), s = a(() => {
62
+ const { matched: r } = u.value, { length: i } = r, h = r[i - 1], l = n.matched;
63
+ if (!h || !l.length)
64
+ return -1;
65
+ const m = l.findIndex(k.bind(null, h));
66
+ if (m > -1)
67
+ return m;
68
+ const y = b(r[i - 2]);
69
+ return (
70
+ // we are dealing with nested routes
71
+ i > 1 && // if the parent and matched route have the same path, this link is
72
+ // referring to the empty child. Or we currently are on a different
73
+ // child of the same parent
74
+ b(h) === y && // avoid comparing the child with its parent
75
+ l[l.length - 1].path !== y ? l.findIndex(k.bind(null, r[i - 2])) : m
76
+ );
77
+ }), d = a(() => s.value > -1 && H(n.params, u.value.params)), p = a(() => s.value > -1 && s.value === n.matched.length - 1 && B(n.params, u.value.params));
78
+ function N(r = {}) {
79
+ if (G(r)) {
80
+ const i = e[f(t.replace) ? "replace" : "push"](
81
+ f(t.to)
82
+ // avoid uncaught errors are they are logged anyway
83
+ ).catch(j);
84
+ return t.viewTransition && typeof document < "u" && "startViewTransition" in document && document.startViewTransition(() => i), i;
85
+ }
86
+ return Promise.resolve();
87
+ }
88
+ if (process.env.NODE_ENV !== "production" && K) {
89
+ const r = I();
90
+ if (r) {
91
+ const i = {
92
+ route: u.value,
93
+ isActive: d.value,
94
+ isExactActive: p.value,
95
+ error: null
96
+ };
97
+ r.__vrl_devtools = r.__vrl_devtools || [], r.__vrl_devtools.push(i), P(() => {
98
+ i.route = u.value, i.isActive = d.value, i.isExactActive = p.value, i.error = V(f(t.to)) ? null : 'Invalid "to" value';
99
+ }, { flush: "post" });
100
+ }
101
+ }
102
+ return {
103
+ route: u,
104
+ href: a(() => u.value.href),
105
+ isActive: d,
106
+ isExactActive: p,
107
+ navigate: N
108
+ };
109
+ }
110
+ function q(t) {
111
+ return t.length === 1 ? t[0] : t;
112
+ }
113
+ const z = /* @__PURE__ */ R({
114
+ name: "RouterLink",
115
+ compatConfig: { MODE: 3 },
116
+ props: {
117
+ to: {
118
+ type: [String, Object],
119
+ required: !0
120
+ },
121
+ replace: Boolean,
122
+ activeClass: String,
123
+ // inactiveClass: String,
124
+ exactActiveClass: String,
125
+ custom: Boolean,
126
+ ariaCurrentValue: {
127
+ type: String,
128
+ default: "page"
129
+ },
130
+ viewTransition: Boolean
131
+ },
132
+ useLink: x,
133
+ setup(t, { slots: e }) {
134
+ const n = D(x(t)), { options: o } = g(C), c = a(() => ({
135
+ [S(t.activeClass, o.linkActiveClass, "router-link-active")]: n.isActive,
136
+ // [getLinkClass(
137
+ // props.inactiveClass,
138
+ // options.linkInactiveClass,
139
+ // 'router-link-inactive'
140
+ // )]: !link.isExactActive,
141
+ [S(t.exactActiveClass, o.linkExactActiveClass, "router-link-exact-active")]: n.isExactActive
142
+ }));
143
+ return () => {
144
+ const u = e.default && q(e.default(n));
145
+ return t.custom ? u : L("a", {
146
+ "aria-current": n.isExactActive ? t.ariaCurrentValue : null,
147
+ href: n.href,
148
+ // this would override user added attrs but Vue will still add
149
+ // the listener, so we end up triggering both
150
+ onClick: n.navigate,
151
+ class: c.value
152
+ }, u);
153
+ };
154
+ }
155
+ }), Q = z;
156
+ function G(t) {
157
+ if (!(t.metaKey || t.altKey || t.ctrlKey || t.shiftKey) && !t.defaultPrevented && !(t.button !== void 0 && t.button !== 0)) {
158
+ if (t.currentTarget && t.currentTarget.getAttribute) {
159
+ const e = t.currentTarget.getAttribute("target");
160
+ if (/\b_blank\b/i.test(e))
161
+ return;
162
+ }
163
+ return t.preventDefault && t.preventDefault(), !0;
164
+ }
165
+ }
166
+ function H(t, e) {
167
+ for (const n in e) {
168
+ const o = e[n], c = t[n];
169
+ if (typeof o == "string") {
170
+ if (o !== c)
171
+ return !1;
172
+ } else if (!v(c) || c.length !== o.length || o.some((u, s) => u !== c[s]))
173
+ return !1;
174
+ }
175
+ return !0;
176
+ }
177
+ function b(t) {
178
+ return t ? t.aliasOf ? t.aliasOf.path : t.path : "";
179
+ }
180
+ const S = (t, e, n) => t ?? e ?? n;
181
+ export {
182
+ w as NavigationFailureType,
183
+ Q as RouterLink,
184
+ M as routeLocationKey,
185
+ C as routerKey,
186
+ x as useLink
187
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.43",
3
+ "version": "0.1.45",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",
@@ -49,5 +49,8 @@
49
49
  },
50
50
  "sideEffects": [
51
51
  "*.css"
52
- ]
52
+ ],
53
+ "dependencies": {
54
+ "vue-router": "^4.5.1"
55
+ }
53
56
  }