adverich-kun-ui 0.1.26 → 0.1.28

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,5 +1,5 @@
1
- import { computed as u, createElementBlock as n, openBlock as a, normalizeClass as c, renderSlot as r, createCommentVNode as s, createElementVNode as g, createTextVNode as f, toDisplayString as p } from "vue";
2
- const x = ["disabled"], m = {
1
+ import { computed as u, createElementBlock as r, openBlock as a, normalizeClass as c, renderSlot as l, createCommentVNode as s, createElementVNode as g, createTextVNode as f, toDisplayString as x } from "vue";
2
+ const p = ["disabled"], m = {
3
3
  key: 1,
4
4
  class: "mr-2 flex items-center"
5
5
  }, y = {
@@ -23,10 +23,12 @@ const x = ["disabled"], m = {
23
23
  validator: (e) => ["default", "tonal", "plain", "outline", "soft"].includes(e)
24
24
  },
25
25
  disabled: { type: Boolean, default: !1 },
26
- loading: { type: Boolean, default: !1 }
26
+ loading: { type: Boolean, default: !1 },
27
+ bgColor: { type: String, default: null },
28
+ textColor: { type: String, default: null }
27
29
  },
28
30
  setup(e) {
29
- const o = e, i = (t) => {
31
+ const n = e, i = (t) => {
30
32
  switch (t) {
31
33
  case "xxs":
32
34
  return "px-1 py-1 text-xs";
@@ -44,7 +46,9 @@ const x = ["disabled"], m = {
44
46
  return "px-4 py-4 text-base";
45
47
  }
46
48
  }, d = u(() => {
47
- switch (o.variant) {
49
+ if (n.bgColor || n.textColor)
50
+ return `${n.bgColor ?? ""} ${n.textColor ?? ""}`;
51
+ switch (n.variant) {
48
52
  case "default":
49
53
  return "bg-green-700 text-white";
50
54
  case "tonal":
@@ -59,7 +63,7 @@ const x = ["disabled"], m = {
59
63
  return "";
60
64
  }
61
65
  });
62
- return (t, l) => (a(), n("button", {
66
+ return (t, o) => (a(), r("button", {
63
67
  type: "button",
64
68
  class: c(["flex items-center justify-center break-keep transition-all", [
65
69
  e.minWidth,
@@ -73,20 +77,20 @@ const x = ["disabled"], m = {
73
77
  ]]),
74
78
  disabled: e.loading || e.disabled
75
79
  }, [
76
- e.loading ? r(t.$slots, "loader", { key: 0 }, () => [
77
- l[0] || (l[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))
78
- ]) : t.$slots.prepend ? (a(), n("span", m, [
79
- r(t.$slots, "prepend")
80
+ e.loading ? l(t.$slots, "loader", { key: 0 }, () => [
81
+ o[0] || (o[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))
82
+ ]) : t.$slots.prepend ? (a(), r("span", m, [
83
+ l(t.$slots, "prepend")
80
84
  ])) : s("", !0),
81
- !e.loading && (t.$slots.default || e.text) ? (a(), n("span", y, [
82
- r(t.$slots, "default", {}, () => [
83
- f(p(e.text), 1)
85
+ !e.loading && (t.$slots.default || e.text) ? (a(), r("span", y, [
86
+ l(t.$slots, "default", {}, () => [
87
+ f(x(e.text), 1)
84
88
  ])
85
89
  ])) : s("", !0),
86
- !e.loading && t.$slots.append ? (a(), n("span", b, [
87
- r(t.$slots, "append")
90
+ !e.loading && t.$slots.append ? (a(), r("span", b, [
91
+ l(t.$slots, "append")
88
92
  ])) : s("", !0)
89
- ], 10, x));
93
+ ], 10, p));
90
94
  }
91
95
  };
92
96
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.26",
3
+ "version": "0.1.28",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",