adverich-kun-ui 0.1.177 → 0.1.179

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,4 +1,4 @@
1
- import { useSlots as B, useAttrs as C, computed as s, createBlock as l, openBlock as a, resolveDynamicComponent as o, mergeProps as j, unref as z, 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";
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
2
  import { RouterLink as F } from "vue-router";
3
3
  import T from "../../../KunLoaderCircular/src/components/KunLoaderCircular.vue.js";
4
4
  import D from "../../../KunIcon/src/components/KunIcon.vue.js";
@@ -46,15 +46,16 @@ const E = { 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 x = B(), t = n, u = C(), g = s(() => !!t.to || !!t.href), m = s(() => !g.value), h = s(() => t.href ? "a" : t.to ? F : "button"), d = (e) => !e || e === !1 || e === !0 && !t.icon ? null : W(D, {
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",
56
57
  disabled: t.disabled
57
- }), b = s(() => t.href ? {
58
+ }), b = r(() => t.href ? {
58
59
  href: t.href,
59
60
  target: t.target ?? "_self",
60
61
  rel: t.target === "_blank" ? "noopener noreferrer" : null
@@ -83,7 +84,8 @@ const E = { class: "relative flex items-center justify-center w-full h-full" },
83
84
  default:
84
85
  return "px-3 py-2 text-sm";
85
86
  }
86
- }, v = s(() => {
87
+ }, v = r(() => {
88
+ if (t.iconSize) return t.iconSize;
87
89
  switch (t.size) {
88
90
  case "xxs":
89
91
  return "text-xs";
@@ -102,25 +104,25 @@ const E = { class: "relative flex items-center justify-center w-full h-full" },
102
104
  default:
103
105
  return "text-base";
104
106
  }
105
- }), k = s(() => {
106
- const e = t.bgColor, r = t.textColor;
107
+ }), k = r(() => {
108
+ const e = t.bgColor, s = t.textColor;
107
109
  switch (t.variant) {
108
110
  case "default":
109
- return `${e} ${r} shadow hover:brightness-95`;
111
+ return `${e} ${s} shadow hover:brightness-95`;
110
112
  case "tonal":
111
- return `${e} ${r} shadow-sm hover:shadow-md`;
113
+ return `${e} ${s} shadow-sm hover:shadow-md`;
112
114
  case "soft":
113
- return `${e} ${r} hover:bg-opacity-30 shadow-sm`;
115
+ return `${e} ${s} hover:bg-opacity-30 shadow-sm`;
114
116
  case "outlined":
115
- return `bg-transparent ${r} border ${e} border-opacity-40 hover:bg-black/5`;
117
+ return `bg-transparent ${s} border ${e} border-opacity-40 hover:bg-black/5`;
116
118
  case "plain":
117
- return `bg-transparent ${r} hover:bg-transparent active:bg-black/10`;
119
+ return `bg-transparent ${s} hover:bg-transparent active:bg-black/10`;
118
120
  case "text":
119
- return `${e} ${r} hover:bg-opacity-10 active:bg-black/5`;
121
+ return `${e} ${s} hover:bg-opacity-10 active:bg-black/5`;
120
122
  default:
121
- return `${e} ${r}`;
123
+ return `${e} ${s}`;
122
124
  }
123
- }), $ = s(() => !!t.text), S = s(() => {
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),
@@ -131,7 +133,7 @@ const E = { class: "relative flex items-center justify-center w-full h-full" },
131
133
  "relative"
132
134
  // 🔹 Hace que los hijos `absolute` se posicionen correctamente
133
135
  ];
134
- if (w.value)
136
+ if (u.class && e.push(u.class), w.value)
135
137
  switch (e.push("aspect-square justify-center items-center"), t.size) {
136
138
  case "xxs":
137
139
  e.push("p-1");
@@ -164,11 +166,11 @@ const E = { 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 = s(() => !!t.icon && !t.text && !x.default);
169
- return (e, r) => (a(), l(o(h.value), j(b.value, {
170
- class: S.value,
171
- style: z(u).style,
169
+ ) : (e.push("pointer-events-none"), t.disabled && e.push("opacity-50 cursor-not-allowed")), S.value && e.push(t.minWidth), 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,
173
+ style: j(u).style,
172
174
  disabled: m.value && (n.loading || n.disabled)
173
175
  }), {
174
176
  default: I(() => [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.177",
3
+ "version": "0.1.179",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",