adverich-kun-ui 0.1.500 → 0.1.502

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,17 +1,17 @@
1
- import { useSlots as O, useAttrs as W, computed as r, ref as E, createBlock as i, openBlock as l, resolveDynamicComponent as c, mergeProps as N, unref as T, withCtx as V, createElementVNode as x, normalizeClass as y, renderSlot as u, createCommentVNode as d, createVNode as F, createElementBlock as m, createTextVNode as D, toDisplayString as L, h as q } from "vue";
2
- import { RouterLink as H } from "vue-router";
3
- import K from "../../../KunLoaderCircular/src/components/KunLoaderCircular.vue.js";
4
- import P from "../../../KunIcon/src/components/KunIcon.vue.js";
5
- const R = { class: "absolute inset-0 flex items-center justify-center z-10" }, G = {
1
+ import { useSlots as E, useAttrs as K, computed as a, ref as N, createBlock as u, openBlock as o, resolveDynamicComponent as c, mergeProps as T, unref as V, withCtx as F, createElementVNode as m, normalizeClass as v, renderSlot as d, createCommentVNode as f, createVNode as D, createElementBlock as g, createTextVNode as L, toDisplayString as q, h as H } from "vue";
2
+ import { RouterLink as P } from "vue-router";
3
+ import R from "../../../KunLoaderCircular/src/components/KunLoaderCircular.vue.js";
4
+ import G from "../../../KunIcon/src/components/KunIcon.vue.js";
5
+ const J = { class: "absolute inset-0 flex items-center justify-center z-10" }, M = {
6
6
  key: 0,
7
7
  class: "mr-2 flex items-center"
8
- }, J = {
8
+ }, Q = {
9
9
  key: 1,
10
10
  class: "truncate flex items-center justify-center"
11
- }, M = {
11
+ }, U = {
12
12
  key: 2,
13
13
  class: "ml-2 flex items-center"
14
- }, Z = {
14
+ }, ee = {
15
15
  __name: "KunBtn",
16
16
  props: {
17
17
  text: String,
@@ -47,13 +47,14 @@ const R = { class: "absolute inset-0 flex items-center justify-center z-10" }, G
47
47
  iconSize: { type: String, default: null },
48
48
  focusColor: { type: String, default: null }
49
49
  },
50
- setup(n, { expose: v }) {
51
- const g = O(), a = W(), t = n, k = r(() => !!t.to || !!t.href), S = r(() => !k.value), $ = r(() => t.href ? "a" : t.to ? H : "button"), f = (e) => !e || e === !1 || e === !0 && !t.icon ? null : q(P, {
50
+ emits: ["click", "keydown", "keyup", "keypress"],
51
+ setup(n, { expose: k, emit: S }) {
52
+ const y = E(), l = K(), t = n, i = S, $ = a(() => !!t.to || !!t.href), w = a(() => !$.value), C = a(() => t.href ? "a" : t.to ? P : "button"), p = (e) => !e || e === !1 || e === !0 && !t.icon ? null : H(G, {
52
53
  icon: e,
53
- size: z.value,
54
+ size: j.value,
54
55
  color: t.textColor ?? "text-font-color",
55
56
  disabled: t.disabled
56
- }), w = r(() => t.href ? {
57
+ }), z = a(() => t.href ? {
57
58
  href: t.href,
58
59
  target: t.target ?? "_self",
59
60
  rel: t.target === "_blank" ? "noopener noreferrer" : null
@@ -63,7 +64,7 @@ const R = { class: "absolute inset-0 flex items-center justify-center z-10" }, G
63
64
  } : {
64
65
  type: "button",
65
66
  disabled: t.loading || t.disabled
66
- }), C = (e) => {
67
+ }), B = (e) => {
67
68
  switch (e) {
68
69
  case "xxs":
69
70
  return "px-1 py-1 text-xs";
@@ -82,7 +83,7 @@ const R = { class: "absolute inset-0 flex items-center justify-center z-10" }, G
82
83
  default:
83
84
  return "px-3 py-2 text-sm";
84
85
  }
85
- }, z = r(() => {
86
+ }, j = a(() => {
86
87
  if (t.iconSize) return t.iconSize;
87
88
  switch (t.size) {
88
89
  case "xxs":
@@ -102,7 +103,7 @@ const R = { class: "absolute inset-0 flex items-center justify-center z-10" }, G
102
103
  default:
103
104
  return "text-base";
104
105
  }
105
- }), B = r(() => {
106
+ }), I = a(() => {
106
107
  const e = t.bgColor, s = t.textColor;
107
108
  switch (t.variant) {
108
109
  case "default":
@@ -120,27 +121,27 @@ const R = { class: "absolute inset-0 flex items-center justify-center z-10" }, G
120
121
  default:
121
122
  return `${e} ${s}`;
122
123
  }
123
- }), j = r(() => !!t.text), h = r(() => {
124
- var e, s, o;
125
- return ((e = a.class) == null ? void 0 : e.includes("w-")) || ((s = a.class) == null ? void 0 : s.includes("min-w-")) || ((o = a.class) == null ? void 0 : o.includes("max-w-"));
126
- }), I = r(() => {
127
- var e, s, o;
128
- return ((e = a.class) == null ? void 0 : e.includes("h-")) || ((s = a.class) == null ? void 0 : s.includes("min-h-")) || ((o = a.class) == null ? void 0 : o.includes("max-h-"));
129
- }), p = r(() => {
124
+ }), A = a(() => !!t.text), h = a(() => {
125
+ var e, s, r;
126
+ return ((e = l.class) == null ? void 0 : e.includes("w-")) || ((s = l.class) == null ? void 0 : s.includes("min-w-")) || ((r = l.class) == null ? void 0 : r.includes("max-w-"));
127
+ }), O = a(() => {
128
+ var e, s, r;
129
+ return ((e = l.class) == null ? void 0 : e.includes("h-")) || ((s = l.class) == null ? void 0 : s.includes("min-h-")) || ((r = l.class) == null ? void 0 : r.includes("max-h-"));
130
+ }), x = a(() => {
130
131
  var s;
131
- const e = ((s = t.text) == null ? void 0 : s.length) === 1 && !g.default && !t.icon;
132
- return !!t.icon && !t.text && !g.default || e;
133
- }), A = r(() => {
132
+ const e = ((s = t.text) == null ? void 0 : s.length) === 1 && !y.default && !t.icon;
133
+ return !!t.icon && !t.text && !y.default || e;
134
+ }), W = a(() => {
134
135
  const e = [
135
136
  "inline-flex items-center justify-center break-keep transition-all whitespace-nowrap",
136
- p.value ? "" : C(t.size),
137
+ x.value ? "" : B(t.size),
137
138
  t.fontWeight,
138
139
  t.rounded,
139
140
  t.textAlign,
140
- B.value,
141
+ I.value,
141
142
  "relative"
142
143
  ];
143
- if (a.class && e.push(a.class), p.value)
144
+ if (l.class && e.push(l.class), x.value)
144
145
  switch (e.push("aspect-square justify-center items-center"), t.size) {
145
146
  case "xxs":
146
147
  e.push("p-1");
@@ -173,50 +174,54 @@ const R = { class: "absolute inset-0 flex items-center justify-center z-10" }, G
173
174
  "active:scale-[.98]",
174
175
  "transition duration-100 ease-in-out",
175
176
  "cursor-pointer",
176
- t.focusColor ? `focus:${t.focusColor}` : ""
177
- ) : (e.push("pointer-events-none"), t.disabled && e.push("opacity-50 cursor-not-allowed")), j.value && !p.value && !h.value && e.push(t.minWidth), e.filter(Boolean);
178
- }), b = E(null);
179
- return v({
177
+ t.focusColor ? `${t.focusColor}` : ""
178
+ ) : (e.push("pointer-events-none"), t.disabled && e.push("opacity-50 cursor-not-allowed")), A.value && !x.value && !h.value && e.push(t.minWidth), e.filter(Boolean);
179
+ }), b = N(null);
180
+ return k({
180
181
  focus: () => {
181
182
  var e, s;
182
183
  return (s = (e = b.value) == null ? void 0 : e.focus) == null ? void 0 : s.call(e);
183
184
  }
184
- }), (e, s) => (l(), i(c($.value), N({
185
+ }), (e, s) => (o(), u(c(C.value), T({
185
186
  ref_key: "rootEl",
186
187
  ref: b
187
- }, w.value, {
188
- class: A.value,
189
- style: T(a).style,
190
- disabled: S.value && (n.loading || n.disabled)
188
+ }, z.value, {
189
+ class: W.value,
190
+ style: V(l).style,
191
+ disabled: w.value && (n.loading || n.disabled),
192
+ onClick: s[0] || (s[0] = (r) => i("click", r)),
193
+ onKeydown: s[1] || (s[1] = (r) => i("keydown", r)),
194
+ onKeyup: s[2] || (s[2] = (r) => i("keyup", r)),
195
+ onKeypress: s[3] || (s[3] = (r) => i("keypress", r))
191
196
  }), {
192
- default: V(() => [
193
- x("div", {
194
- class: y(["relative flex items-center justify-center", h.value ? "" : "w-full", I.value ? "" : "h-full"])
197
+ default: F(() => [
198
+ m("div", {
199
+ class: v(["relative flex items-center justify-center", h.value ? "" : "w-full", O.value ? "" : "h-full"])
195
200
  }, [
196
- n.loading ? u(e.$slots, "loader", { key: 0 }, () => [
197
- x("div", R, [
198
- F(K, {
201
+ n.loading ? d(e.$slots, "loader", { key: 0 }, () => [
202
+ m("div", J, [
203
+ D(R, {
199
204
  size: "20",
200
205
  width: "5"
201
206
  })
202
207
  ])
203
- ]) : d("", !0),
204
- x("div", {
205
- class: y([{ "opacity-50": n.loading }, "flex items-center justify-center w-full h-full"])
208
+ ]) : f("", !0),
209
+ m("div", {
210
+ class: v([{ "opacity-50": n.loading }, "flex items-center justify-center w-full h-full"])
206
211
  }, [
207
- e.$slots.prepend || n.prependIcon ? (l(), m("span", G, [
208
- u(e.$slots, "prepend"),
209
- (l(), i(c(f(n.prependIcon))))
210
- ])) : d("", !0),
211
- n.text || e.$slots.default || n.icon ? (l(), m("span", J, [
212
- n.icon && !n.text && !e.$slots.default ? (l(), i(c(f(n.icon)), { key: 0 })) : u(e.$slots, "default", { key: 1 }, () => [
213
- D(L(n.text), 1)
212
+ e.$slots.prepend || n.prependIcon ? (o(), g("span", M, [
213
+ d(e.$slots, "prepend"),
214
+ (o(), u(c(p(n.prependIcon))))
215
+ ])) : f("", !0),
216
+ n.text || e.$slots.default || n.icon ? (o(), g("span", Q, [
217
+ n.icon && !n.text && !e.$slots.default ? (o(), u(c(p(n.icon)), { key: 0 })) : d(e.$slots, "default", { key: 1 }, () => [
218
+ L(q(n.text), 1)
214
219
  ])
215
- ])) : d("", !0),
216
- e.$slots.append || n.appendIcon ? (l(), m("span", M, [
217
- u(e.$slots, "append"),
218
- (l(), i(c(f(n.appendIcon))))
219
- ])) : d("", !0)
220
+ ])) : f("", !0),
221
+ e.$slots.append || n.appendIcon ? (o(), g("span", U, [
222
+ d(e.$slots, "append"),
223
+ (o(), u(c(p(n.appendIcon))))
224
+ ])) : f("", !0)
220
225
  ], 2)
221
226
  ], 2)
222
227
  ]),
@@ -225,5 +230,5 @@ const R = { class: "absolute inset-0 flex items-center justify-center z-10" }, G
225
230
  }
226
231
  };
227
232
  export {
228
- Z as default
233
+ ee as default
229
234
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.500",
3
+ "version": "0.1.502",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",