adverich-kun-ui 0.1.50 → 0.1.51

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.
@@ -0,0 +1,59 @@
1
+ import { createBlock as n, openBlock as s, resolveDynamicComponent as y, unref as o, mergeProps as C, withModifiers as $, withCtx as b, createCommentVNode as l, renderSlot as r, createElementVNode as I, createElementBlock as V, toDisplayString as g } from "vue";
2
+ import { useChip as B } from "../composables/useChip.js";
3
+ import { kunChipProps as S } from "../composables/kunChipProps.js";
4
+ import t from "../../../KunIcon/src/components/KunIcon.vue.js";
5
+ const w = {
6
+ key: 0,
7
+ class: "mr-1"
8
+ }, D = { class: "truncate" }, A = {
9
+ __name: "KunChip",
10
+ props: S,
11
+ emits: ["update:modelValue", "click:close"],
12
+ setup(p, { emit: a }) {
13
+ const d = p, m = a, {
14
+ componentTag: c,
15
+ componentAttrs: u,
16
+ chipClass: k,
17
+ chipStyle: f,
18
+ handleClose: h
19
+ } = B(d, m);
20
+ return (e, i) => (s(), n(y(o(c)), C(o(u), {
21
+ class: o(k),
22
+ style: o(f),
23
+ disabled: e.isLink ? void 0 : e.disabled ? "" : void 0,
24
+ onClick: i[0] || (i[0] = $(() => {
25
+ }, ["stop"]))
26
+ }), {
27
+ default: b(() => [
28
+ e.prependIcon ? (s(), n(t, {
29
+ key: 0,
30
+ icon: e.prependIcon,
31
+ class: "mr-1 flex-shrink-0"
32
+ }, null, 8, ["icon"])) : l("", !0),
33
+ r(e.$slots, "prepend", {}, () => [
34
+ e.$slots.prepend ? (s(), V("span", w)) : l("", !0)
35
+ ]),
36
+ I("span", D, g(e.label || e.text), 1),
37
+ e.$slots.default && !(e.label || e.text) ? r(e.$slots, "default", { key: 1 }) : l("", !0),
38
+ e.appendIcon ? (s(), n(t, {
39
+ key: 2,
40
+ icon: e.appendIcon,
41
+ class: "ml-1 flex-shrink-0"
42
+ }, null, 8, ["icon"])) : e.$slots.append ? r(e.$slots, "append", {
43
+ key: 3,
44
+ class: "ml-1"
45
+ }) : l("", !0),
46
+ e.closable && e.modelValue ? (s(), n(t, {
47
+ key: 4,
48
+ icon: "$mdi-close",
49
+ class: "ml-1 flex-shrink-0 cursor-pointer",
50
+ onClick: o(h)
51
+ }, null, 8, ["onClick"])) : l("", !0)
52
+ ]),
53
+ _: 3
54
+ }, 16, ["class", "style", "disabled"]));
55
+ }
56
+ };
57
+ export {
58
+ A as default
59
+ };
@@ -0,0 +1,83 @@
1
+ const e = {
2
+ modelValue: {
3
+ type: Boolean,
4
+ default: !0
5
+ },
6
+ label: {
7
+ type: String,
8
+ default: null
9
+ },
10
+ closeLabel: {
11
+ type: String,
12
+ default: "Cerrar"
13
+ },
14
+ text: {
15
+ type: String,
16
+ default: null
17
+ },
18
+ color: {
19
+ type: String,
20
+ default: "bg-indigo-600"
21
+ },
22
+ textColor: {
23
+ type: String,
24
+ default: "text-white"
25
+ },
26
+ variant: {
27
+ type: String,
28
+ default: "default",
29
+ validator: (t) => ["default", "outlined", "flat", "pill"].includes(t)
30
+ },
31
+ closable: {
32
+ type: Boolean,
33
+ default: !1
34
+ },
35
+ disabled: {
36
+ type: Boolean,
37
+ default: !1
38
+ },
39
+ density: {
40
+ type: String,
41
+ default: "default",
42
+ validator: (t) => ["default", "comfortable", "compact"].includes(t)
43
+ },
44
+ icon: {
45
+ type: [String, Object, Function],
46
+ default: null
47
+ },
48
+ prependIcon: {
49
+ type: [String, Object, Function],
50
+ default: null
51
+ },
52
+ appendIcon: {
53
+ type: [String, Object, Function],
54
+ default: null
55
+ },
56
+ to: {
57
+ type: [String, Object],
58
+ default: null
59
+ },
60
+ href: {
61
+ type: String,
62
+ default: null
63
+ },
64
+ replace: {
65
+ type: Boolean,
66
+ default: !1
67
+ },
68
+ target: {
69
+ type: String,
70
+ default: null
71
+ },
72
+ class: {
73
+ type: [String, Array, Object],
74
+ default: null
75
+ },
76
+ style: {
77
+ type: Object,
78
+ default: null
79
+ }
80
+ };
81
+ export {
82
+ e as kunChipProps
83
+ };
@@ -0,0 +1,48 @@
1
+ import { computed as n } from "vue";
2
+ function s(e, l) {
3
+ const r = n(() => !!e.to || !!e.href), a = n(() => e.href ? "a" : e.to ? "router-link" : "button"), o = n(() => e.href ? {
4
+ href: e.href,
5
+ target: e.target ?? "_self",
6
+ rel: e.target === "_blank" ? "noopener noreferrer" : null
7
+ } : e.to ? {
8
+ to: e.to,
9
+ replace: e.replace
10
+ } : {
11
+ type: "button",
12
+ disabled: e.disabled
13
+ }), c = n(() => {
14
+ const t = [
15
+ "inline-flex items-center whitespace-nowrap select-none",
16
+ e.density === "compact" ? "px-2 py-0.5 text-xs" : "px-3 py-1 text-sm",
17
+ e.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer",
18
+ e.class
19
+ ];
20
+ switch (e.variant) {
21
+ case "flat":
22
+ t.push(`${e.color} ${e.textColor} shadow-none`);
23
+ break;
24
+ case "outlined":
25
+ t.push(`border border-current ${e.textColor} bg-transparent hover:bg-gray-100`);
26
+ break;
27
+ case "pill":
28
+ t.push(`${e.color} ${e.textColor} rounded-full`);
29
+ break;
30
+ default:
31
+ t.push(`${e.color} ${e.textColor} rounded-md shadow`);
32
+ }
33
+ return t.filter(Boolean);
34
+ }), u = n(() => e.style || {});
35
+ return {
36
+ isLink: r,
37
+ componentTag: a,
38
+ componentAttrs: o,
39
+ chipClass: c,
40
+ chipStyle: u,
41
+ handleClose: (t) => {
42
+ e.disabled || (l("update:modelValue", !1), l("click:close", t));
43
+ }
44
+ };
45
+ }
46
+ export {
47
+ s as useChip
48
+ };
package/dist/index.js CHANGED
@@ -8,24 +8,25 @@ import f from "./components/KunBudge/src/components/KunBudge.vue.js";
8
8
  import s from "./components/KunCard/src/components/KunCard.vue.js";
9
9
  import K from "./components/KunCardActions/src/components/KunCardActions.vue.js";
10
10
  import _ from "./components/KunCardItem/src/components/KunCardItem.vue.js";
11
- import c from "./components/KunCardSubtitle/src/components/KunCardSubtitle.vue.js";
12
- import p from "./components/KunCardText/src/components/KunCardText.vue.js";
11
+ import p from "./components/KunCardSubtitle/src/components/KunCardSubtitle.vue.js";
12
+ import c from "./components/KunCardText/src/components/KunCardText.vue.js";
13
13
  import e from "./components/KunCardTitle/src/components/KunCardTitle.vue.js";
14
- import d from "./components/KunCol/src/components/KunCol.vue.js";
15
- import l from "./components/KunContainer/src/components/KunContainer.vue.js";
16
- import $ from "./components/KunCurrency/src/components/KunCurrency.vue.js";
17
- import C from "./components/KunDivider/src/components/KunDivider.vue.js";
18
- import T from "./components/KunForm/src/components/KunForm.vue.js";
19
- import b from "./components/KunIcon/src/components/KunIcon.vue.js";
20
- import A from "./components/KunList/src/components/KunList.vue.js";
21
- import S from "./components/KunLoaderCircular/src/components/KunLoaderCircular.vue.js";
14
+ import C from "./components/KunChip/src/components/KunChip.vue.js";
15
+ import $ from "./components/KunCol/src/components/KunCol.vue.js";
16
+ import d from "./components/KunContainer/src/components/KunContainer.vue.js";
17
+ import l from "./components/KunCurrency/src/components/KunCurrency.vue.js";
18
+ import T from "./components/KunDivider/src/components/KunDivider.vue.js";
19
+ import b from "./components/KunForm/src/components/KunForm.vue.js";
20
+ import A from "./components/KunIcon/src/components/KunIcon.vue.js";
21
+ import S from "./components/KunList/src/components/KunList.vue.js";
22
+ import h from "./components/KunLoaderCircular/src/components/KunLoaderCircular.vue.js";
22
23
  import x from "./components/KunRow/src/components/KunRow.vue.js";
23
24
  import w from "./components/KunSlider/src/components/KunSlider.vue.js";
24
25
  import F from "./components/KunSpacer/src/components/KunSpacer.vue.js";
25
26
  import I from "./components/KunSwitch/src/components/KunSwitch.vue.js";
26
- import h from "./components/KunTextField/src/components/KunTextField.vue.js";
27
- import B from "./components/KunToolbar/src/components/KunToolbar.vue.js";
28
- const n = {
27
+ import B from "./components/KunTextField/src/components/KunTextField.vue.js";
28
+ import L from "./components/KunToolbar/src/components/KunToolbar.vue.js";
29
+ const r = {
29
30
  KunAlert: o,
30
31
  KunAppbar: i,
31
32
  KunAppbarTitle: a,
@@ -35,27 +36,28 @@ const n = {
35
36
  KunCard: s,
36
37
  KunCardActions: K,
37
38
  KunCardItem: _,
38
- KunCardSubtitle: c,
39
- KunCardText: p,
39
+ KunCardSubtitle: p,
40
+ KunCardText: c,
40
41
  KunCardTitle: e,
41
- KunCol: d,
42
- KunContainer: l,
43
- KunCurrency: $,
44
- KunDivider: C,
45
- KunForm: T,
46
- KunIcon: b,
47
- KunList: A,
48
- KunLoaderCircular: S,
42
+ KunChip: C,
43
+ KunCol: $,
44
+ KunContainer: d,
45
+ KunCurrency: l,
46
+ KunDivider: T,
47
+ KunForm: b,
48
+ KunIcon: A,
49
+ KunList: S,
50
+ KunLoaderCircular: h,
49
51
  KunRow: x,
50
52
  KunSlider: w,
51
53
  KunSpacer: F,
52
54
  KunSwitch: I,
53
- KunTextField: h,
54
- KunToolbar: B
55
+ KunTextField: B,
56
+ KunToolbar: L
55
57
  };
56
- function mr(m) {
57
- for (const r in n)
58
- m.component(r, n[r]);
58
+ function an(m) {
59
+ for (const n in r)
60
+ m.component(n, r[n]);
59
61
  }
60
62
  export {
61
63
  o as KunAlert,
@@ -67,22 +69,23 @@ export {
67
69
  s as KunCard,
68
70
  K as KunCardActions,
69
71
  _ as KunCardItem,
70
- c as KunCardSubtitle,
71
- p as KunCardText,
72
+ p as KunCardSubtitle,
73
+ c as KunCardText,
72
74
  e as KunCardTitle,
73
- d as KunCol,
74
- l as KunContainer,
75
- $ as KunCurrency,
76
- C as KunDivider,
77
- T as KunForm,
78
- b as KunIcon,
79
- A as KunList,
80
- S as KunLoaderCircular,
75
+ C as KunChip,
76
+ $ as KunCol,
77
+ d as KunContainer,
78
+ l as KunCurrency,
79
+ T as KunDivider,
80
+ b as KunForm,
81
+ A as KunIcon,
82
+ S as KunList,
83
+ h as KunLoaderCircular,
81
84
  x as KunRow,
82
85
  w as KunSlider,
83
86
  F as KunSpacer,
84
87
  I as KunSwitch,
85
- h as KunTextField,
86
- B as KunToolbar,
87
- mr as install
88
+ B as KunTextField,
89
+ L as KunToolbar,
90
+ an as install
88
91
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.50",
3
+ "version": "0.1.51",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",