vlite3 1.2.14 → 1.2.15

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 { defineComponent as N, useAttrs as T, computed as s, useSlots as A, withDirectives as G, openBlock as i, createElementBlock as l, normalizeClass as a, Fragment as C, createElementVNode as k, createBlock as f, createCommentVNode as c, renderSlot as S, createTextVNode as $, toDisplayString as v, unref as F } from "vue";
2
- import p from "./Icon.vue.js";
1
+ import { defineComponent as N, useAttrs as T, computed as s, useSlots as A, withDirectives as G, openBlock as i, createElementBlock as l, normalizeClass as a, Fragment as C, createElementVNode as k, createBlock as x, createCommentVNode as c, renderSlot as S, createTextVNode as $, toDisplayString as p, unref as F } from "vue";
2
+ import v from "./Icon.vue.js";
3
3
  import { vRipple as H } from "../directives/vRipple.js";
4
4
  import { $t as M } from "../utils/i18n.js";
5
5
  const O = ["type", "disabled", "data-testid"], Z = {
@@ -65,10 +65,10 @@ const O = ["type", "disabled", "data-testid"], Z = {
65
65
  md: "w-12 h-12",
66
66
  lg: "w-14 h-14",
67
67
  xl: "w-16 h-16"
68
- })[e.size]), r = s(() => e.textI18n ? M(e.textI18n) : e.text), B = A(), x = s(
68
+ })[e.size]), r = s(() => e.textI18n ? M(e.textI18n) : e.text), B = A(), m = s(
69
69
  () => e?.asIcon || e.icon && !r.value && !B.default
70
70
  ), u = s(() => e.icon ? e.icon.startsWith("http://") || e.icon.startsWith("https://") || e.icon.startsWith("data:image/") ? !0 : [".png", ".jpg", ".jpeg", ".gif", ".svg", ".webp", ".ico", ".avif"].some((g) => e.icon.toLowerCase().endsWith(g)) : !1), R = s(() => {
71
- const g = `inline-flex items-center justify-center whitespace-nowrap text-sm font-medium disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] cursor-pointer ${o.value === "tile" ? "flex-col gap-1.5 items-center" : o.value === "vertical" ? "flex-col gap-2" : e.description ? "gap-3" : "gap-2"} ${x.value ? "icon-only shrink-0" : ""}`, y = {
71
+ const g = `inline-flex items-center justify-center whitespace-nowrap text-sm font-medium disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] cursor-pointer ${o.value === "tile" ? "flex-col gap-1.5 items-center" : o.value === "vertical" ? "flex-col gap-2" : e.description ? "gap-3" : "gap-2"} ${m.value ? "icon-only shrink-0" : ""}`, y = {
72
72
  primary: "bg-primary text-primary-foreground hover:bg-primary/90",
73
73
  "primary-light": "bg-primary-light text-primary-fg-light hover:bg-primary/15",
74
74
  secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
@@ -114,7 +114,7 @@ const O = ["type", "disabled", "data-testid"], Z = {
114
114
  "2xl": "rounded-2xl",
115
115
  full: "rounded-full"
116
116
  };
117
- let w = x.value ? V[e.size] : d[e.size];
117
+ let w = m.value ? V[e.size] : d[e.size];
118
118
  o.value === "tile" ? w = {
119
119
  xs: "h-auto p-0!",
120
120
  sm: "h-auto p-0!",
@@ -134,7 +134,7 @@ const O = ["type", "disabled", "data-testid"], Z = {
134
134
  return [g, D, W[e.rounded], w, e.class].join(
135
135
  " "
136
136
  );
137
- }), m = s(() => {
137
+ }), f = s(() => {
138
138
  if (h.value && u.value)
139
139
  return `${b.value} object-cover`;
140
140
  const n = e.description && o.value === "horizontal", g = {
@@ -152,7 +152,7 @@ const O = ["type", "disabled", "data-testid"], Z = {
152
152
  lg: "w-4 h-4",
153
153
  xl: "w-4 h-4"
154
154
  };
155
- let d = x.value ? y[e.size] : g[e.size];
155
+ let d = m.value ? y[e.size] : g[e.size];
156
156
  return u.value && (d += " object-cover"), h.value ? d += " scale-[1.45]!" : o.value === "vertical" && (d += " scale-[1.35]! mt-1"), d;
157
157
  }), E = s(() => o.value === "vertical" ? "scale-[0.9]" : "");
158
158
  return (n, g) => G((i(), l("button", {
@@ -169,14 +169,14 @@ const O = ["type", "disabled", "data-testid"], Z = {
169
169
  u.value ? "" : b.value
170
170
  ]])
171
171
  }, [
172
- t.loading ? (i(), f(p, {
172
+ t.loading ? (i(), x(v, {
173
173
  key: 0,
174
174
  icon: "lucide:loader-2",
175
- class: a(["animate-spin pointer-events-none", [m.value, u.value ? b.value : ""]])
176
- }, null, 8, ["class"])) : t.icon ? (i(), f(p, {
175
+ class: a(["animate-spin pointer-events-none", [f.value, u.value ? b.value : ""]])
176
+ }, null, 8, ["class"])) : t.icon ? (i(), x(v, {
177
177
  key: 1,
178
178
  icon: t.icon,
179
- class: a(["pointer-events-none", [t.iconClass, m.value]])
179
+ class: a(["pointer-events-none", [t.iconClass, f.value]])
180
180
  }, null, 8, ["icon", "class"])) : c("", !0)
181
181
  ], 2),
182
182
  r.value || n.$slots.default || e.description ? (i(), l("span", {
@@ -185,38 +185,41 @@ const O = ["type", "disabled", "data-testid"], Z = {
185
185
  }, [
186
186
  r.value || n.$slots.default ? (i(), l("span", Z, [
187
187
  S(n.$slots, "default", {}, () => [
188
- $(v(r.value), 1)
188
+ $(p(r.value), 1)
189
189
  ])
190
190
  ])) : c("", !0),
191
- e.description ? (i(), l("span", q, v(e.description), 1)) : c("", !0)
191
+ e.description ? (i(), l("span", q, p(e.description), 1)) : c("", !0)
192
192
  ], 2)) : c("", !0)
193
193
  ], 64)) : (i(), l(C, { key: 1 }, [
194
- t.loading ? (i(), f(p, {
194
+ t.loading ? (i(), x(v, {
195
195
  key: 0,
196
196
  icon: "lucide:loader-2",
197
- class: a(["animate-spin pointer-events-none", m.value])
198
- }, null, 8, ["class"])) : t.icon ? (i(), f(p, {
197
+ class: a(["animate-spin pointer-events-none", f.value])
198
+ }, null, 8, ["class"])) : t.icon ? (i(), x(v, {
199
199
  key: 1,
200
200
  icon: t.icon,
201
- class: a(["pointer-events-none", [t.iconClass, m.value, x.value ? "mx-auto" : ""]])
201
+ class: a(["pointer-events-none", [t.iconClass, f.value, m.value ? "mx-auto" : ""]])
202
202
  }, null, 8, ["icon", "class"])) : c("", !0),
203
- r.value || n.$slots.default || e.description ? (i(), l("div", {
203
+ !m.value && (r.value || n.$slots.default || e.description) ? (i(), l("div", {
204
204
  key: 2,
205
- class: a(["flex flex-col justify-center flex-1 w-full", o.value === "vertical" ? "items-center text-center" : "items-start text-left"])
205
+ class: a(["flex flex-col justify-center", [
206
+ o.value === "vertical" ? "items-center text-center" : e.description ? "items-start text-left" : "items-center text-center",
207
+ !t.icon && !t.iconRight && !t.loading ? "flex-1 w-full" : ""
208
+ ]])
206
209
  }, [
207
210
  k("div", {
208
- class: a([[t.textClass, E.value], "leading-tight w-full"])
211
+ class: a([[t.textClass, E.value], "leading-tight w-full [&>:where(svg)]:mx-auto [&>:where(img)]:mx-auto"])
209
212
  }, [
210
213
  S(n.$slots, "default", {}, () => [
211
- $(v(r.value), 1)
214
+ $(p(r.value), 1)
212
215
  ])
213
216
  ], 2),
214
- e.description ? (i(), l("span", J, v(e.description), 1)) : c("", !0)
217
+ e.description ? (i(), l("span", J, p(e.description), 1)) : c("", !0)
215
218
  ], 2)) : c("", !0),
216
- t.iconRight && !t.loading ? (i(), f(p, {
219
+ t.iconRight && !t.loading ? (i(), x(v, {
217
220
  key: 3,
218
221
  icon: t.iconRight,
219
- class: a([[t.iconRightClass, m.value], "h-4 w-4 pointer-events-none"])
222
+ class: a([[t.iconRightClass, f.value], "h-4 w-4 pointer-events-none"])
220
223
  }, null, 8, ["icon", "class"])) : c("", !0)
221
224
  ], 64))
222
225
  ], 10, O)), [
@@ -15,7 +15,18 @@ export interface ClipboardProps {
15
15
  copiedTextI18n?: string;
16
16
  asIcon?: boolean;
17
17
  }
18
- declare const _default: import('vue').DefineComponent<ClipboardProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
18
+ declare function __VLS_template(): {
19
+ attrs: Partial<{}>;
20
+ slots: {
21
+ default?(_: {
22
+ copied: boolean;
23
+ }): any;
24
+ };
25
+ refs: {};
26
+ rootEl: HTMLButtonElement;
27
+ };
28
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
29
+ declare const __VLS_component: import('vue').DefineComponent<ClipboardProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
19
30
  copy: (text: string) => any;
20
31
  error: (err: Error) => any;
21
32
  }, string, import('vue').PublicProps, Readonly<ClipboardProps> & Readonly<{
@@ -31,4 +42,10 @@ declare const _default: import('vue').DefineComponent<ClipboardProps, {}, {}, {}
31
42
  defaultTextI18n: string;
32
43
  copiedTextI18n: string;
33
44
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
45
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
34
46
  export default _default;
47
+ type __VLS_WithTemplateSlots<T, S> = T & {
48
+ new (): {
49
+ $slots: S;
50
+ };
51
+ };
@@ -1,7 +1,7 @@
1
- import { defineComponent as f, ref as p, computed as i, openBlock as x, createBlock as m, normalizeClass as T } from "vue";
2
- import v from "./Button.vue.js";
3
- import { $t as l } from "../utils/i18n.js";
4
- const z = /* @__PURE__ */ f({
1
+ import { defineComponent as f, ref as p, computed as i, openBlock as m, createBlock as x, normalizeClass as T, withCtx as v, renderSlot as y, createCommentVNode as I } from "vue";
2
+ import C from "./Button.vue.js";
3
+ import { $t as d } from "../utils/i18n.js";
4
+ const w = /* @__PURE__ */ f({
5
5
  __name: "Clipboard",
6
6
  props: {
7
7
  textToCopy: {},
@@ -20,42 +20,50 @@ const z = /* @__PURE__ */ f({
20
20
  },
21
21
  emits: ["copy", "error"],
22
22
  setup(o, { emit: r }) {
23
- const e = o, c = r, a = p(!1);
23
+ const e = o, l = r, a = p(!1);
24
24
  let n = null;
25
- const d = i(() => a.value ? e.copiedIcon : e.defaultIcon), u = i(() => {
25
+ const u = i(() => a.value ? e.copiedIcon : e.defaultIcon), c = i(() => {
26
26
  if (!e.asIcon)
27
27
  if (a.value) {
28
28
  if (e.copiedText) return e.copiedText;
29
- const t = l(e.copiedTextI18n);
29
+ const t = d(e.copiedTextI18n);
30
30
  return t !== e.copiedTextI18n ? t : "Copied";
31
31
  } else {
32
32
  if (e.defaultText) return e.defaultText;
33
- const t = l(e.defaultTextI18n);
33
+ const t = d(e.defaultTextI18n);
34
34
  return t !== e.defaultTextI18n ? t : "Copy";
35
35
  }
36
36
  }), s = async () => {
37
37
  if (!e.disabled)
38
38
  try {
39
- await navigator.clipboard.writeText(e.textToCopy), a.value = !0, c("copy", e.textToCopy), n && clearTimeout(n), n = setTimeout(() => {
39
+ await navigator.clipboard.writeText(e.textToCopy), a.value = !0, l("copy", e.textToCopy), n && clearTimeout(n), n = setTimeout(() => {
40
40
  a.value = !1;
41
41
  }, 500);
42
42
  } catch (t) {
43
- c("error", t instanceof Error ? t : new Error("Copy failed"));
43
+ l("error", t instanceof Error ? t : new Error("Copy failed"));
44
44
  }
45
45
  };
46
- return (t, y) => (x(), m(v, {
46
+ return (t, b) => (m(), x(C, {
47
47
  variant: o.variant,
48
48
  size: o.size,
49
49
  rounded: o.rounded,
50
50
  class: T(e.class),
51
51
  disabled: o.disabled,
52
- icon: d.value,
53
- text: u.value,
52
+ icon: u.value,
53
+ text: c.value,
54
54
  "as-icon": o.asIcon,
55
55
  onClick: s
56
- }, null, 8, ["variant", "size", "rounded", "class", "disabled", "icon", "text", "as-icon"]));
56
+ }, {
57
+ default: v(() => [
58
+ !o.asIcon && !c.value ? y(t.$slots, "default", {
59
+ key: 0,
60
+ copied: a.value
61
+ }) : I("", !0)
62
+ ]),
63
+ _: 3
64
+ }, 8, ["variant", "size", "rounded", "class", "disabled", "icon", "text", "as-icon"]));
57
65
  }
58
66
  });
59
67
  export {
60
- z as default
68
+ w as default
61
69
  };
@@ -83,7 +83,7 @@ const U = {
83
83
  }, E = v(() => [
84
84
  "group relative flex items-center min-w-[120px] max-w-[240px] h-9 px-3 border-r border-border select-none cursor-pointer transition-all duration-200 ease-out",
85
85
  e.itemClass,
86
- e.isActive ? `bg-muted text-foreground ring-1 ring-border ring-b-0 z-10 ${e.activeItemClass}` : `text-muted-foreground hover:bg-accent/50 ${e.inactiveItemClass}`,
86
+ e.isActive ? `bg-secondary text-foreground ring-1 ring-border ring-b-0 z-10 ${e.activeItemClass}` : `text-muted-foreground hover:bg-accent/50 ${e.inactiveItemClass}`,
87
87
  e.isEditing ? "cursor-text" : ""
88
88
  ].filter(Boolean).join(" "));
89
89
  return (n, t) => (a(), d("div", {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "private": false,
4
4
  "description": "A Vue 3 UI component library built with Tailwind CSS.",
5
5
  "license": "MIT",
6
- "version": "1.2.14",
6
+ "version": "1.2.15",
7
7
  "type": "module",
8
8
  "main": "index.js",
9
9
  "module": "index.js",