adverich-kun-ui 0.1.282 → 0.1.284

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,7 +1,7 @@
1
- import { defineComponent as x, watch as C, onMounted as f, onBeforeUnmount as S, onUnmounted as k, createBlock as u, openBlock as o, Teleport as P, createVNode as a, Transition as m, withCtx as n, createElementBlock as B, createCommentVNode as y, mergeProps as V, renderSlot as E } from "vue";
2
- import W from "./KunDialogOverlay.vue.js";
3
- import $ from "./KunDialogContent.vue.js";
4
- const D = "fixed inset-0 z-250 flex", T = /* @__PURE__ */ x({
1
+ import { defineComponent as x, watch as C, onMounted as f, onBeforeUnmount as S, onUnmounted as k, createBlock as m, openBlock as a, Teleport as P, createVNode as o, Transition as u, withCtx as n, createElementBlock as B, createCommentVNode as h, mergeProps as V, renderSlot as E } from "vue";
2
+ import H from "./KunDialogOverlay.vue.js";
3
+ import W from "./KunDialogContent.vue.js";
4
+ const $ = "fixed inset-0 z-250 flex", T = /* @__PURE__ */ x({
5
5
  __name: "KunDialog",
6
6
  props: {
7
7
  modelValue: Boolean,
@@ -24,6 +24,7 @@ const D = "fixed inset-0 z-250 flex", T = /* @__PURE__ */ x({
24
24
  },
25
25
  contentClass: { type: String, default: "" },
26
26
  bgColor: { type: String, default: "bg-slate-100 dark:bg-slate-900" },
27
+ minHeigh: { type: String, default: "h-fit" },
27
28
  height: { type: String, default: "h-fit" },
28
29
  maxHeigh: { type: String, default: "max-h-[100vh]" },
29
30
  minWidth: { type: String, default: "min-w-1/3" },
@@ -31,8 +32,8 @@ const D = "fixed inset-0 z-250 flex", T = /* @__PURE__ */ x({
31
32
  maxWidth: { type: String, default: "max-w-full" }
32
33
  },
33
34
  emits: ["update:modelValue"],
34
- setup(e, { emit: h }) {
35
- const t = e, i = h, g = "justify-" + t.xPosition, p = "items-" + t.yPosition, w = t.yPosition === "top" ? "pt-15" : t.yPosition === "bottom" ? "pb-15" : "", b = [D, t.dialogClass, g, p, w], s = () => {
35
+ setup(e, { emit: y }) {
36
+ const t = e, i = y, g = "justify-" + t.xPosition, p = "items-" + t.yPosition, w = t.yPosition === "top" ? "pt-15" : t.yPosition === "bottom" ? "pb-15" : "", b = [$, t.dialogClass, g, p, w], s = () => {
36
37
  t.persistent || i("update:modelValue", !1);
37
38
  }, v = () => {
38
39
  s();
@@ -55,22 +56,22 @@ const D = "fixed inset-0 z-250 flex", T = /* @__PURE__ */ x({
55
56
  window.addEventListener("keydown", c);
56
57
  }), k(() => {
57
58
  window.removeEventListener("keydown", c);
58
- }), (l, H) => (o(), u(P, { to: "body" }, [
59
- a(m, {
59
+ }), (l, D) => (a(), m(P, { to: "body" }, [
60
+ o(u, {
60
61
  name: "fade",
61
62
  appear: ""
62
63
  }, {
63
64
  default: n(() => [
64
- e.modelValue ? (o(), B("div", V({
65
+ e.modelValue ? (a(), B("div", V({
65
66
  key: 0,
66
67
  class: b
67
68
  }, l.$attrs), [
68
- e.overlay ? (o(), u(W, {
69
+ e.overlay ? (a(), m(H, {
69
70
  key: 0,
70
71
  persistent: e.persistent,
71
72
  onClick: v
72
- }, null, 8, ["persistent"])) : y("", !0),
73
- a(m, {
73
+ }, null, 8, ["persistent"])) : h("", !0),
74
+ o(u, {
74
75
  name: "scale",
75
76
  "enter-active-class": "transition transform ease-out duration-300",
76
77
  "enter-from-class": "opacity-0 scale-95",
@@ -80,12 +81,13 @@ const D = "fixed inset-0 z-250 flex", T = /* @__PURE__ */ x({
80
81
  "leave-to-class": "opacity-0 scale-95"
81
82
  }, {
82
83
  default: n(() => [
83
- a($, {
84
+ o(W, {
84
85
  fullscreen: e.fullscreen,
85
86
  scrollable: e.scrollable,
86
87
  "min-width": e.minWidth,
87
88
  width: e.width,
88
89
  "max-width": e.maxWidth,
90
+ "min-height": e.minHeigh,
89
91
  height: e.height,
90
92
  "max-height": e.maxHeigh,
91
93
  "bg-color": e.bgColor,
@@ -96,11 +98,11 @@ const D = "fixed inset-0 z-250 flex", T = /* @__PURE__ */ x({
96
98
  E(l.$slots, "default")
97
99
  ]),
98
100
  _: 3
99
- }, 8, ["fullscreen", "scrollable", "min-width", "width", "max-width", "height", "max-height", "bg-color", "content-class"])
101
+ }, 8, ["fullscreen", "scrollable", "min-width", "width", "max-width", "min-height", "height", "max-height", "bg-color", "content-class"])
100
102
  ]),
101
103
  _: 3
102
104
  })
103
- ], 16)) : y("", !0)
105
+ ], 16)) : h("", !0)
104
106
  ]),
105
107
  _: 3
106
108
  })
@@ -1,4 +1,4 @@
1
- import { useAttrs as q, computed as i, ref as H, inject as R, onMounted as J, onBeforeUnmount as Q, createBlock as u, openBlock as n, unref as T, withCtx as B, resolveDynamicComponent as v, mergeProps as h, withKeys as L, withModifiers as N, createElementVNode as C, createElementBlock as a, createCommentVNode as s, renderSlot as c, normalizeClass as r, toDisplayString as I } from "vue";
1
+ import { useAttrs as q, computed as r, ref as H, inject as R, onMounted as J, onBeforeUnmount as Q, createBlock as u, openBlock as a, unref as T, withCtx as B, resolveDynamicComponent as v, mergeProps as h, withKeys as L, withModifiers as N, createElementVNode as C, createElementBlock as n, createCommentVNode as s, renderSlot as c, normalizeClass as i, toDisplayString as I } from "vue";
2
2
  import P from "../../../KunIcon/src/components/KunIcon.vue.js";
3
3
  import { RouterLink as W } from "vue-router";
4
4
  const X = { class: "flex w-full items-center" }, Y = {
@@ -10,10 +10,10 @@ const X = { class: "flex w-full items-center" }, Y = {
10
10
  }, ee = ["src"], te = { class: "flex w-full items-center" }, le = {
11
11
  key: 0,
12
12
  class: "shrink-0 flex items-center gap-2 me-2"
13
- }, ne = ["src"], ae = {
13
+ }, ae = ["src"], ne = {
14
14
  key: 1,
15
15
  class: "shrink-0 flex items-center gap-2 ms-3"
16
- }, se = ["src"], ie = "w-full flex transition duration-150 ease-in-out", oe = {
16
+ }, se = ["src"], re = "w-full flex transition duration-150 ease-in-out", oe = {
17
17
  __name: "KunListItem",
18
18
  props: {
19
19
  value: [String, Number, Boolean, Object, Array, null],
@@ -50,7 +50,7 @@ const X = { class: "flex w-full items-center" }, Y = {
50
50
  },
51
51
  emits: ["click"],
52
52
  setup(e, { emit: D }) {
53
- const $ = q(), x = i(() => $.class), j = i(() => {
53
+ const $ = q(), x = r(() => $.class), j = r(() => {
54
54
  const { class: l, ...m } = $;
55
55
  return m;
56
56
  }), t = e, G = D, f = H(null), y = R("registerListItemRef", null), o = R("kunListContext", null);
@@ -59,10 +59,10 @@ const X = { class: "flex w-full items-center" }, Y = {
59
59
  }), Q(() => {
60
60
  y && y(null);
61
61
  });
62
- const g = (l) => typeof l == "object" || typeof l == "function", E = i(() => !!(t.prependIcon || t.prependAvatar)), K = i(() => !!(t.appendIcon || t.appendAvatar)), S = i(() => {
62
+ const g = (l) => typeof l == "object" || typeof l == "function", E = r(() => !!(t.prependIcon || t.prependAvatar)), K = r(() => !!(t.appendIcon || t.appendAvatar)), S = r(() => {
63
63
  var l;
64
64
  return ((l = o == null ? void 0 : o.isSelected) == null ? void 0 : l.call(o, t.value)) ?? !1;
65
- }), w = i(() => t.active), M = i(() => !!t.to);
65
+ }), w = r(() => t.active), M = r(() => !!t.to);
66
66
  function b(l, m = null) {
67
67
  var p, k;
68
68
  if (t.disabled) return;
@@ -70,8 +70,22 @@ const X = { class: "flex w-full items-center" }, Y = {
70
70
  const d = ((p = f.value) == null ? void 0 : p.$el) ?? f.value;
71
71
  d != null && d.dispatchEvent && d.dispatchEvent(new CustomEvent("select", { detail: t.value, bubbles: !0 })), o && t.selectable && t.value !== null && ((k = o.toggleItem) == null || k.call(o, t.value), d != null && d.dispatchEvent && d.dispatchEvent(new CustomEvent("selected", { detail: t.value, bubbles: !0 }))), m && m(l);
72
72
  }
73
- const V = i(() => {
74
- }), z = i(() => {
73
+ const V = r(() => {
74
+ switch (t.variant) {
75
+ case "outlined":
76
+ return "border border-gray-300 dark:border-gray-700";
77
+ case "elevated":
78
+ return "shadow-md";
79
+ case "tonal":
80
+ return "bg-gray-100 dark:bg-gray-800";
81
+ case "flat":
82
+ return "bg-transparent";
83
+ case "plain":
84
+ return "";
85
+ default:
86
+ return "";
87
+ }
88
+ }), z = r(() => {
75
89
  switch (t.density) {
76
90
  case "comfortable":
77
91
  return "py-2";
@@ -80,8 +94,8 @@ const X = { class: "flex w-full items-center" }, Y = {
80
94
  default:
81
95
  return "py-3";
82
96
  }
83
- }), F = i(() => t.tile ? "rounded-none" : t.rounded === !0 ? "rounded-md" : t.rounded === !1 ? "" : `rounded-${t.rounded}`), U = i(() => t.ripple ? "relative overflow-hidden" : ""), O = i(() => [
84
- ie,
97
+ }), F = r(() => t.tile ? "rounded-none" : t.rounded === !0 ? "rounded-md" : t.rounded === !1 ? "" : `rounded-${t.rounded}`), U = r(() => t.ripple ? "relative overflow-hidden" : ""), O = r(() => [
98
+ re,
85
99
  V.value,
86
100
  z.value,
87
101
  F.value,
@@ -97,14 +111,14 @@ const X = { class: "flex w-full items-center" }, Y = {
97
111
  },
98
112
  t.containerClass
99
113
  ]);
100
- return (l, m) => M.value ? (n(), u(T(W), {
114
+ return (l, m) => M.value ? (a(), u(T(W), {
101
115
  key: 0,
102
116
  to: e.to,
103
117
  replace: e.replace,
104
118
  custom: !0
105
119
  }, {
106
120
  default: B(({ href: d, navigate: p, isActive: k }) => [
107
- (n(), u(v(e.tag), h({
121
+ (a(), u(v(e.tag), h({
108
122
  ref_key: "liRef",
109
123
  ref: f,
110
124
  href: d,
@@ -113,25 +127,24 @@ const X = { class: "flex w-full items-center" }, Y = {
113
127
  "aria-disabled": e.disabled,
114
128
  tabindex: "-1",
115
129
  class: O.value,
116
- 1: "",
117
130
  onClick: (A) => b(A, p),
118
131
  onKeydown: L(N((A) => b(A, p), ["prevent"]), ["enter"])
119
132
  }, l.$attrs), {
120
133
  default: B(() => [
121
134
  C("div", X, [
122
- E.value || l.$slots.prepend ? (n(), a("div", Y, [
135
+ E.value || l.$slots.prepend ? (a(), n("div", Y, [
123
136
  c(l.$slots, "prepend", {}, () => [
124
- e.prependAvatar ? (n(), a("img", {
137
+ e.prependAvatar ? (a(), n("img", {
125
138
  key: 0,
126
139
  src: e.prependAvatar,
127
- class: r(["rounded-full", e.prependClass])
128
- }, null, 10, Z)) : g(e.prependIcon) ? (n(), u(v(e.prependIcon), {
140
+ class: i(["rounded-full", e.prependClass])
141
+ }, null, 10, Z)) : g(e.prependIcon) ? (a(), u(v(e.prependIcon), {
129
142
  key: 1,
130
- class: r(e.prependClass)
131
- }, null, 8, ["class"])) : typeof e.prependIcon == "string" ? (n(), u(P, {
143
+ class: i(e.prependClass)
144
+ }, null, 8, ["class"])) : typeof e.prependIcon == "string" ? (a(), u(P, {
132
145
  key: 2,
133
146
  icon: e.prependIcon,
134
- class: r(e.prependClass)
147
+ class: i(e.prependClass)
135
148
  }, null, 8, ["icon", "class"])) : s("", !0)
136
149
  ])
137
150
  ])) : s("", !0),
@@ -140,32 +153,32 @@ const X = { class: "flex w-full items-center" }, Y = {
140
153
  }, j.value), [
141
154
  c(l.$slots, "default", {}, () => [
142
155
  c(l.$slots, "title", {}, () => [
143
- e.title ? (n(), a("div", {
156
+ e.title ? (a(), n("div", {
144
157
  key: 0,
145
- class: r(["truncate", e.titleClass])
158
+ class: i(["truncate", e.titleClass])
146
159
  }, I(e.title), 3)) : s("", !0)
147
160
  ]),
148
161
  c(l.$slots, "subtitle", {}, () => [
149
- e.subtitle ? (n(), a("div", {
162
+ e.subtitle ? (a(), n("div", {
150
163
  key: 0,
151
- class: r(["truncate", e.subtitleClass])
164
+ class: i(["truncate", e.subtitleClass])
152
165
  }, I(e.subtitle), 3)) : s("", !0)
153
166
  ])
154
167
  ])
155
168
  ], 16),
156
- K.value ? (n(), a("div", _, [
169
+ K.value ? (a(), n("div", _, [
157
170
  c(l.$slots, "append", {}, () => [
158
- e.appendAvatar ? (n(), a("img", {
171
+ e.appendAvatar ? (a(), n("img", {
159
172
  key: 0,
160
173
  src: e.appendAvatar,
161
174
  class: "w-8 h-8 rounded-full"
162
175
  }, null, 8, ee)) : s("", !0),
163
- g(e.appendIcon) ? (n(), u(v(e.appendIcon), {
176
+ g(e.appendIcon) ? (a(), u(v(e.appendIcon), {
164
177
  key: 1,
165
178
  class: "w-5 h-5"
166
- })) : e.appendIcon ? (n(), a("i", {
179
+ })) : e.appendIcon ? (a(), n("i", {
167
180
  key: 2,
168
- class: r([e.appendClass, "text-xl leading-none"])
181
+ class: i([e.appendClass, "text-xl leading-none"])
169
182
  }, null, 2)) : s("", !0)
170
183
  ])
171
184
  ])) : s("", !0)
@@ -175,7 +188,7 @@ const X = { class: "flex w-full items-center" }, Y = {
175
188
  }, 1040, ["href", "aria-selected", "aria-disabled", "class", "onClick", "onKeydown"]))
176
189
  ]),
177
190
  _: 3
178
- }, 8, ["to", "replace"])) : (n(), u(v(e.tag), h({
191
+ }, 8, ["to", "replace"])) : (a(), u(v(e.tag), h({
179
192
  key: 1,
180
193
  ref_key: "liRef",
181
194
  ref: f,
@@ -189,19 +202,19 @@ const X = { class: "flex w-full items-center" }, Y = {
189
202
  }, l.$attrs), {
190
203
  default: B(() => [
191
204
  C("div", te, [
192
- E.value || l.$slots.prepend ? (n(), a("div", le, [
205
+ E.value || l.$slots.prepend ? (a(), n("div", le, [
193
206
  c(l.$slots, "prepend", {}, () => [
194
- e.prependAvatar ? (n(), a("img", {
207
+ e.prependAvatar ? (a(), n("img", {
195
208
  key: 0,
196
209
  src: e.prependAvatar,
197
- class: r(["rounded-full", e.prependClass])
198
- }, null, 10, ne)) : g(e.prependIcon) ? (n(), u(v(e.prependIcon), {
210
+ class: i(["rounded-full", e.prependClass])
211
+ }, null, 10, ae)) : g(e.prependIcon) ? (a(), u(v(e.prependIcon), {
199
212
  key: 1,
200
- class: r(e.prependClass)
201
- }, null, 8, ["class"])) : typeof e.prependIcon == "string" ? (n(), u(P, {
213
+ class: i(e.prependClass)
214
+ }, null, 8, ["class"])) : typeof e.prependIcon == "string" ? (a(), u(P, {
202
215
  key: 2,
203
216
  icon: e.prependIcon,
204
- class: r(e.prependClass)
217
+ class: i(e.prependClass)
205
218
  }, null, 8, ["icon", "class"])) : s("", !0)
206
219
  ])
207
220
  ])) : s("", !0),
@@ -210,32 +223,32 @@ const X = { class: "flex w-full items-center" }, Y = {
210
223
  }, j.value), [
211
224
  c(l.$slots, "default", {}, () => [
212
225
  c(l.$slots, "title", {}, () => [
213
- e.title ? (n(), a("div", {
226
+ e.title ? (a(), n("div", {
214
227
  key: 0,
215
- class: r(["truncate", e.titleClass])
228
+ class: i(["truncate", e.titleClass])
216
229
  }, I(e.title), 3)) : s("", !0)
217
230
  ]),
218
231
  c(l.$slots, "subtitle", {}, () => [
219
- e.subtitle ? (n(), a("div", {
232
+ e.subtitle ? (a(), n("div", {
220
233
  key: 0,
221
- class: r(["truncate", e.subtitleClass])
234
+ class: i(["truncate", e.subtitleClass])
222
235
  }, I(e.subtitle), 3)) : s("", !0)
223
236
  ])
224
237
  ])
225
238
  ], 16),
226
- K.value ? (n(), a("div", ae, [
239
+ K.value ? (a(), n("div", ne, [
227
240
  c(l.$slots, "append", {}, () => [
228
- e.appendAvatar ? (n(), a("img", {
241
+ e.appendAvatar ? (a(), n("img", {
229
242
  key: 0,
230
243
  src: e.appendAvatar,
231
244
  class: "w-8 h-8 rounded-full"
232
245
  }, null, 8, se)) : s("", !0),
233
- g(e.appendIcon) ? (n(), u(v(e.appendIcon), {
246
+ g(e.appendIcon) ? (a(), u(v(e.appendIcon), {
234
247
  key: 1,
235
248
  class: "w-5 h-5"
236
- })) : e.appendIcon ? (n(), a("i", {
249
+ })) : e.appendIcon ? (a(), n("i", {
237
250
  key: 2,
238
- class: r([e.appendIcon, "text-xl leading-none"])
251
+ class: i([e.appendIcon, "text-xl leading-none"])
239
252
  }, null, 2)) : s("", !0)
240
253
  ])
241
254
  ])) : s("", !0)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.282",
3
+ "version": "0.1.284",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",