adverich-kun-ui 0.1.176 → 0.1.178

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 { useAttrs as B, computed as r, createBlock as l, openBlock as a, resolveDynamicComponent as o, mergeProps as C, unref as j, withCtx as z, createElementVNode as p, renderSlot as i, createCommentVNode as c, createVNode as I, normalizeClass as A, createElementBlock as f, createTextVNode as O, toDisplayString as N } from "vue";
2
- import { RouterLink as V } from "vue-router";
3
- import W from "../../../KunLoaderCircular/src/components/KunLoaderCircular.vue.js";
4
- import F from "../../../KunIcon/src/components/KunIcon.vue.js";
5
- const T = { class: "relative flex items-center justify-center w-full h-full" }, D = { class: "absolute inset-0 flex items-center justify-center z-10" }, E = {
1
+ import { useSlots as z, useAttrs as B, computed as r, createBlock as l, openBlock as a, resolveDynamicComponent as o, mergeProps as C, unref as j, withCtx as I, createElementVNode as p, renderSlot as i, createCommentVNode as c, createVNode as A, normalizeClass as O, createElementBlock as f, createTextVNode as N, toDisplayString as V, h as W } from "vue";
2
+ import { RouterLink as F } from "vue-router";
3
+ import T from "../../../KunLoaderCircular/src/components/KunLoaderCircular.vue.js";
4
+ import D from "../../../KunIcon/src/components/KunIcon.vue.js";
5
+ const E = { class: "relative flex items-center justify-center w-full h-full" }, L = { class: "absolute inset-0 flex items-center justify-center z-10" }, q = {
6
6
  key: 0,
7
7
  class: "mr-2 flex items-center"
8
- }, L = {
8
+ }, K = {
9
9
  key: 1,
10
10
  class: "truncate flex items-center justify-center"
11
- }, q = {
11
+ }, P = {
12
12
  key: 2,
13
13
  class: "ml-2 flex items-center"
14
- }, H = {
14
+ }, M = {
15
15
  __name: "KunBtn",
16
16
  props: {
17
17
  text: String,
@@ -46,10 +46,11 @@ const T = { class: "relative flex items-center justify-center w-full h-full" },
46
46
  ring: Boolean,
47
47
  icon: [Boolean, String, Function, Object, Array],
48
48
  prependIcon: [String, Function, Object, Array],
49
- appendIcon: [String, Function, Object, Array]
49
+ appendIcon: [String, Function, Object, Array],
50
+ iconSize: { type: String, default: null }
50
51
  },
51
52
  setup(n) {
52
- const t = n, u = B(), x = r(() => !!t.to || !!t.href), g = r(() => !x.value), m = r(() => t.href ? "a" : t.to ? V : "button"), d = (e) => !e || e === !1 || e === !0 && !t.icon ? null : h(F, {
53
+ const x = z(), t = n, u = B(), g = r(() => !!t.to || !!t.href), m = r(() => !g.value), h = r(() => t.href ? "a" : t.to ? F : "button"), d = (e) => !e || e === !1 || e === !0 && !t.icon ? null : W(D, {
53
54
  icon: e,
54
55
  size: v.value,
55
56
  color: t.textColor ?? "text-font-color",
@@ -84,6 +85,7 @@ const T = { class: "relative flex items-center justify-center w-full h-full" },
84
85
  return "px-3 py-2 text-sm";
85
86
  }
86
87
  }, v = r(() => {
88
+ if (t.iconSize) return t.iconSize;
87
89
  switch (t.size) {
88
90
  case "xxs":
89
91
  return "text-xs";
@@ -120,7 +122,7 @@ const T = { class: "relative flex items-center justify-center w-full h-full" },
120
122
  default:
121
123
  return `${e} ${s}`;
122
124
  }
123
- }), $ = r(() => !!t.text), S = r(() => {
125
+ }), S = r(() => !!t.text), $ = r(() => {
124
126
  const e = [
125
127
  "inline-flex items-center justify-center break-keep transition-all whitespace-nowrap",
126
128
  y(t.size),
@@ -164,36 +166,36 @@ const T = { class: "relative flex items-center justify-center w-full h-full" },
164
166
  "active:scale-[.98]",
165
167
  "transition duration-100 ease-in-out",
166
168
  "cursor-pointer"
167
- ) : (e.push("pointer-events-none"), t.disabled && e.push("opacity-50 cursor-not-allowed")), $.value && e.push(t.minWidth), u.class && e.push(u.class), e.filter(Boolean);
168
- }), w = r(() => !!t.icon && !t.text && !$slots.default);
169
- return (e, s) => (a(), l(o(m.value), C(b.value, {
170
- class: S.value,
169
+ ) : (e.push("pointer-events-none"), t.disabled && e.push("opacity-50 cursor-not-allowed")), S.value && e.push(t.minWidth), u.class && e.push(u.class), e.filter(Boolean);
170
+ }), w = r(() => !!t.icon && !t.text && !x.default);
171
+ return (e, s) => (a(), l(o(h.value), C(b.value, {
172
+ class: $.value,
171
173
  style: j(u).style,
172
- disabled: g.value && (n.loading || n.disabled)
174
+ disabled: m.value && (n.loading || n.disabled)
173
175
  }), {
174
- default: z(() => [
175
- p("div", T, [
176
+ default: I(() => [
177
+ p("div", E, [
176
178
  n.loading ? i(e.$slots, "loader", { key: 0 }, () => [
177
- p("div", D, [
178
- I(W, {
179
+ p("div", L, [
180
+ A(T, {
179
181
  size: "20",
180
182
  width: "5"
181
183
  })
182
184
  ])
183
185
  ]) : c("", !0),
184
186
  p("div", {
185
- class: A([{ "opacity-50": n.loading }, "flex items-center justify-center w-full h-full"])
187
+ class: O([{ "opacity-50": n.loading }, "flex items-center justify-center w-full h-full"])
186
188
  }, [
187
- e.$slots.prepend || n.prependIcon ? (a(), f("span", E, [
189
+ e.$slots.prepend || n.prependIcon ? (a(), f("span", q, [
188
190
  i(e.$slots, "prepend"),
189
191
  (a(), l(o(d(n.prependIcon))))
190
192
  ])) : c("", !0),
191
- n.text || e.$slots.default || n.icon ? (a(), f("span", L, [
193
+ n.text || e.$slots.default || n.icon ? (a(), f("span", K, [
192
194
  n.icon && !n.text && !e.$slots.default ? (a(), l(o(d(n.icon)), { key: 0 })) : i(e.$slots, "default", { key: 1 }, () => [
193
- O(N(n.text), 1)
195
+ N(V(n.text), 1)
194
196
  ])
195
197
  ])) : c("", !0),
196
- e.$slots.append || n.appendIcon ? (a(), f("span", q, [
198
+ e.$slots.append || n.appendIcon ? (a(), f("span", P, [
197
199
  i(e.$slots, "append"),
198
200
  (a(), l(o(d(n.appendIcon))))
199
201
  ])) : c("", !0)
@@ -205,5 +207,5 @@ const T = { class: "relative flex items-center justify-center w-full h-full" },
205
207
  }
206
208
  };
207
209
  export {
208
- H as default
210
+ M as default
209
211
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.176",
3
+ "version": "0.1.178",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",