vlite3 1.2.15 → 1.2.16
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.
package/components/Button.vue.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { vRipple as
|
|
4
|
-
import { $t as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as L, useAttrs as N, computed as s, useSlots as G, Comment as F, Fragment as C, Text as H, withDirectives as M, openBlock as r, createElementBlock as c, normalizeClass as a, createElementVNode as $, createBlock as f, createCommentVNode as u, renderSlot as I, createTextVNode as j, toDisplayString as b, unref as O } from "vue";
|
|
2
|
+
import x from "./Icon.vue.js";
|
|
3
|
+
import { vRipple as Z } from "../directives/vRipple.js";
|
|
4
|
+
import { $t as q } from "../utils/i18n.js";
|
|
5
|
+
const J = ["type", "disabled", "data-testid"], K = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "text-xs font-medium leading-tight truncate max-w-full"
|
|
8
|
-
},
|
|
8
|
+
}, P = {
|
|
9
9
|
key: 1,
|
|
10
10
|
class: "text-[10px] font-normal opacity-70 mt-0.5 leading-tight truncate max-w-full"
|
|
11
|
-
},
|
|
11
|
+
}, Q = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "text-[0.75em] font-normal opacity-70 mt-0.5 leading-tight"
|
|
14
|
-
},
|
|
14
|
+
}, ee = /* @__PURE__ */ L({
|
|
15
15
|
__name: "Button",
|
|
16
16
|
props: {
|
|
17
17
|
description: {},
|
|
@@ -33,7 +33,7 @@ const O = ["type", "disabled", "data-testid"], Z = {
|
|
|
33
33
|
layout: { default: "horizontal" }
|
|
34
34
|
},
|
|
35
35
|
setup(t) {
|
|
36
|
-
const
|
|
36
|
+
const k = {
|
|
37
37
|
primary: "bg-primary text-primary-foreground",
|
|
38
38
|
"primary-light": "bg-primary-light text-primary-fg-light",
|
|
39
39
|
secondary: "bg-secondary text-secondary-foreground",
|
|
@@ -55,20 +55,20 @@ const O = ["type", "disabled", "data-testid"], Z = {
|
|
|
55
55
|
ghost: "bg-accent text-accent-foreground",
|
|
56
56
|
link: "bg-primary/10 text-primary",
|
|
57
57
|
transparent: "bg-muted text-foreground"
|
|
58
|
-
}, e = t,
|
|
59
|
-
const n = e.layout ||
|
|
58
|
+
}, e = t, B = N(), o = s(() => {
|
|
59
|
+
const n = e.layout || B.layout;
|
|
60
60
|
return n === "tile" ? "tile" : n === "vertical" ? "vertical" : "horizontal";
|
|
61
|
-
}), h = s(() => o.value === "tile"),
|
|
61
|
+
}), h = s(() => o.value === "tile"), R = s(() => k[e.variant] ?? k.primary), y = s(() => ({
|
|
62
62
|
xs: "w-9 h-9",
|
|
63
63
|
sm: "w-10 h-10",
|
|
64
64
|
sm2: "w-11 h-11",
|
|
65
65
|
md: "w-12 h-12",
|
|
66
66
|
lg: "w-14 h-14",
|
|
67
67
|
xl: "w-16 h-16"
|
|
68
|
-
})[e.size]),
|
|
69
|
-
() => e?.asIcon || e.icon && !
|
|
70
|
-
),
|
|
71
|
-
const
|
|
68
|
+
})[e.size]), l = s(() => e.textI18n ? q(e.textI18n) : e.text), S = G(), p = s(() => S.default ? S.default().some((i) => !(i.type === F || i.type === C && Array.isArray(i.children) && i.children.length === 0 || i.type === H && typeof i.children == "string" && i.children.trim() === "")) : !1), v = s(
|
|
69
|
+
() => e?.asIcon || e.icon && !l.value && !p.value
|
|
70
|
+
), g = 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((i) => e.icon.toLowerCase().endsWith(i)) : !1), A = s(() => {
|
|
71
|
+
const i = `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"} ${v.value ? "icon-only shrink-0" : ""}`, w = {
|
|
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",
|
|
@@ -97,14 +97,14 @@ const O = ["type", "disabled", "data-testid"], Z = {
|
|
|
97
97
|
md: e.description ? "h-auto py-2.5 px-4" : "h-9 px-4 py-2",
|
|
98
98
|
lg: e.description ? "h-auto py-3 px-4" : "h-10 px-4",
|
|
99
99
|
xl: e.description ? "h-auto py-4 px-10" : "h-12 px-10"
|
|
100
|
-
},
|
|
100
|
+
}, T = {
|
|
101
101
|
xs: "h-6.5 w-6.5 min-h-6.5 min-w-6.5",
|
|
102
102
|
sm: "h-7.5 w-7.5 min-h-7.5 min-w-7.5",
|
|
103
103
|
sm2: "h-8 w-8 min-h-8 min-w-8",
|
|
104
104
|
md: "h-9 w-9 min-h-9 min-w-9",
|
|
105
105
|
lg: "h-10 w-10 min-h-10 min-w-10",
|
|
106
106
|
xl: "h-12 w-12 min-h-12 min-w-12"
|
|
107
|
-
},
|
|
107
|
+
}, V = {
|
|
108
108
|
none: "rounded-none",
|
|
109
109
|
sm: "rounded-sm",
|
|
110
110
|
sm2: "rounded-sm",
|
|
@@ -114,15 +114,15 @@ const O = ["type", "disabled", "data-testid"], Z = {
|
|
|
114
114
|
"2xl": "rounded-2xl",
|
|
115
115
|
full: "rounded-full"
|
|
116
116
|
};
|
|
117
|
-
let
|
|
118
|
-
o.value === "tile" ?
|
|
117
|
+
let z = v.value ? T[e.size] : d[e.size];
|
|
118
|
+
o.value === "tile" ? z = {
|
|
119
119
|
xs: "h-auto p-0!",
|
|
120
120
|
sm: "h-auto p-0!",
|
|
121
121
|
sm2: "h-auto p-0!",
|
|
122
122
|
md: "h-auto p-0!",
|
|
123
123
|
lg: "h-auto p-0!",
|
|
124
124
|
xl: "h-auto p-0!"
|
|
125
|
-
}[e.size] : o.value === "vertical" && (
|
|
125
|
+
}[e.size] : o.value === "vertical" && (z = {
|
|
126
126
|
xs: "h-auto py-1.5 px-2 min-w-16",
|
|
127
127
|
sm: "h-auto py-2 px-3 min-w-20",
|
|
128
128
|
sm2: "h-auto py-2 px-3 min-w-20",
|
|
@@ -130,21 +130,21 @@ const O = ["type", "disabled", "data-testid"], Z = {
|
|
|
130
130
|
lg: "h-auto py-3 px-4 min-w-28",
|
|
131
131
|
xl: "h-auto py-4 px-10 min-w-32"
|
|
132
132
|
}[e.size]);
|
|
133
|
-
const
|
|
134
|
-
return [
|
|
133
|
+
const W = h.value ? "group text-foreground focus:outline-none focus-visible:outline-none active:scale-100!" : w[e.variant];
|
|
134
|
+
return [i, W, V[e.rounded], z, e.class].join(
|
|
135
135
|
" "
|
|
136
136
|
);
|
|
137
|
-
}),
|
|
138
|
-
if (h.value &&
|
|
139
|
-
return `${
|
|
140
|
-
const n = e.description && o.value === "horizontal",
|
|
137
|
+
}), m = s(() => {
|
|
138
|
+
if (h.value && g.value)
|
|
139
|
+
return `${y.value} object-cover`;
|
|
140
|
+
const n = e.description && o.value === "horizontal", i = {
|
|
141
141
|
xs: n ? "w-3.5 h-3.5" : "w-3 h-3",
|
|
142
142
|
sm: n ? "w-5 h-5" : "w-4 h-4",
|
|
143
143
|
sm2: n ? "w-5 h-5" : "w-4 h-4",
|
|
144
144
|
md: n ? "w-5 h-5" : "w-4 h-4",
|
|
145
145
|
lg: n ? "w-5 h-5" : "w-4 h-4",
|
|
146
146
|
xl: n ? "w-5 h-5" : "w-4 h-4"
|
|
147
|
-
},
|
|
147
|
+
}, w = {
|
|
148
148
|
xs: "w-3 h-3",
|
|
149
149
|
sm: "w-4 h-4",
|
|
150
150
|
sm2: "w-4 h-4",
|
|
@@ -152,81 +152,81 @@ 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 =
|
|
156
|
-
return
|
|
155
|
+
let d = v.value ? w[e.size] : i[e.size];
|
|
156
|
+
return g.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
|
-
return (n,
|
|
158
|
+
return (n, i) => M((r(), c("button", {
|
|
159
159
|
type: t.type,
|
|
160
|
-
class: a([
|
|
160
|
+
class: a([A.value, "cursor-pointer"]),
|
|
161
161
|
disabled: t.disabled || t.loading,
|
|
162
|
-
"data-testid": n.$attrs["data-testid"] || (
|
|
162
|
+
"data-testid": n.$attrs["data-testid"] || (l.value ? `btn-${l.value.toString().toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : t.icon ? `btn-${t.icon.replace(/[^a-zA-Z0-9]+/g, "-")}` : "button")
|
|
163
163
|
}, [
|
|
164
|
-
h.value ? (
|
|
165
|
-
|
|
164
|
+
h.value ? (r(), c(C, { key: 0 }, [
|
|
165
|
+
$("span", {
|
|
166
166
|
class: a(["inline-flex items-center justify-center shrink-0 transition-transform duration-150 ease-out group-active:scale-[0.92]", [
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
167
|
+
g.value ? "" : "rounded-full",
|
|
168
|
+
g.value ? "" : R.value,
|
|
169
|
+
g.value ? "" : y.value
|
|
170
170
|
]])
|
|
171
171
|
}, [
|
|
172
|
-
t.loading ? (
|
|
172
|
+
t.loading ? (r(), f(x, {
|
|
173
173
|
key: 0,
|
|
174
174
|
icon: "lucide:loader-2",
|
|
175
|
-
class: a(["animate-spin pointer-events-none", [
|
|
176
|
-
}, null, 8, ["class"])) : t.icon ? (
|
|
175
|
+
class: a(["animate-spin pointer-events-none", [m.value, g.value ? y.value : ""]])
|
|
176
|
+
}, null, 8, ["class"])) : t.icon ? (r(), f(x, {
|
|
177
177
|
key: 1,
|
|
178
178
|
icon: t.icon,
|
|
179
|
-
class: a(["pointer-events-none", [t.iconClass,
|
|
180
|
-
}, null, 8, ["icon", "class"])) :
|
|
179
|
+
class: a(["pointer-events-none", [t.iconClass, m.value]])
|
|
180
|
+
}, null, 8, ["icon", "class"])) : u("", !0)
|
|
181
181
|
], 2),
|
|
182
|
-
|
|
182
|
+
l.value || p.value || e.description ? (r(), c("span", {
|
|
183
183
|
key: 0,
|
|
184
184
|
class: a(["flex flex-col items-center max-w-full", t.textClass])
|
|
185
185
|
}, [
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
186
|
+
l.value || p.value ? (r(), c("span", K, [
|
|
187
|
+
I(n.$slots, "default", {}, () => [
|
|
188
|
+
j(b(l.value), 1)
|
|
189
189
|
])
|
|
190
|
-
])) :
|
|
191
|
-
e.description ? (
|
|
192
|
-
], 2)) :
|
|
193
|
-
], 64)) : (
|
|
194
|
-
t.loading ? (
|
|
190
|
+
])) : u("", !0),
|
|
191
|
+
e.description ? (r(), c("span", P, b(e.description), 1)) : u("", !0)
|
|
192
|
+
], 2)) : u("", !0)
|
|
193
|
+
], 64)) : (r(), c(C, { key: 1 }, [
|
|
194
|
+
t.loading ? (r(), f(x, {
|
|
195
195
|
key: 0,
|
|
196
196
|
icon: "lucide:loader-2",
|
|
197
|
-
class: a(["animate-spin pointer-events-none",
|
|
198
|
-
}, null, 8, ["class"])) : t.icon ? (
|
|
197
|
+
class: a(["animate-spin pointer-events-none", m.value])
|
|
198
|
+
}, null, 8, ["class"])) : t.icon ? (r(), f(x, {
|
|
199
199
|
key: 1,
|
|
200
200
|
icon: t.icon,
|
|
201
|
-
class: a(["pointer-events-none", [t.iconClass,
|
|
202
|
-
}, null, 8, ["icon", "class"])) :
|
|
203
|
-
|
|
201
|
+
class: a(["pointer-events-none", [t.iconClass, m.value, v.value ? "mx-auto" : ""]])
|
|
202
|
+
}, null, 8, ["icon", "class"])) : u("", !0),
|
|
203
|
+
l.value || p.value || e.description ? (r(), c("div", {
|
|
204
204
|
key: 2,
|
|
205
205
|
class: a(["flex flex-col justify-center", [
|
|
206
206
|
o.value === "vertical" ? "items-center text-center" : e.description ? "items-start text-left" : "items-center text-center",
|
|
207
207
|
!t.icon && !t.iconRight && !t.loading ? "flex-1 w-full" : ""
|
|
208
208
|
]])
|
|
209
209
|
}, [
|
|
210
|
-
|
|
210
|
+
$("div", {
|
|
211
211
|
class: a([[t.textClass, E.value], "leading-tight w-full [&>:where(svg)]:mx-auto [&>:where(img)]:mx-auto"])
|
|
212
212
|
}, [
|
|
213
|
-
|
|
214
|
-
|
|
213
|
+
I(n.$slots, "default", {}, () => [
|
|
214
|
+
j(b(l.value), 1)
|
|
215
215
|
])
|
|
216
216
|
], 2),
|
|
217
|
-
e.description ? (
|
|
218
|
-
], 2)) :
|
|
219
|
-
t.iconRight && !t.loading ? (
|
|
217
|
+
e.description ? (r(), c("span", Q, b(e.description), 1)) : u("", !0)
|
|
218
|
+
], 2)) : u("", !0),
|
|
219
|
+
t.iconRight && !t.loading ? (r(), f(x, {
|
|
220
220
|
key: 3,
|
|
221
221
|
icon: t.iconRight,
|
|
222
|
-
class: a([[t.iconRightClass,
|
|
223
|
-
}, null, 8, ["icon", "class"])) :
|
|
222
|
+
class: a([[t.iconRightClass, m.value], "h-4 w-4 pointer-events-none"])
|
|
223
|
+
}, null, 8, ["icon", "class"])) : u("", !0)
|
|
224
224
|
], 64))
|
|
225
|
-
], 10,
|
|
226
|
-
[
|
|
225
|
+
], 10, J)), [
|
|
226
|
+
[O(Z), !h.value]
|
|
227
227
|
]);
|
|
228
228
|
}
|
|
229
229
|
});
|
|
230
230
|
export {
|
|
231
|
-
|
|
231
|
+
ee as default
|
|
232
232
|
};
|
|
@@ -4,7 +4,7 @@ import k from "../Icon.vue.js";
|
|
|
4
4
|
import { $t as E } from "../../utils/i18n.js";
|
|
5
5
|
import { useCommandPaletteItems as Y } from "./useCommandPaletteItems.js";
|
|
6
6
|
import { useCommandPaletteNav as Z } from "./useCommandPaletteNav.js";
|
|
7
|
-
import ee from "./CommandPaletteItem.
|
|
7
|
+
import ee from "./CommandPaletteItem.vue.js";
|
|
8
8
|
const te = { class: "command-palette-content flex flex-col w-full h-full max-h-[70vh]" }, oe = { class: "flex items-center gap-3 px-4 py-3 border-b border-border/80 shrink-0" }, se = ["placeholder"], ne = ["aria-label"], re = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "flex flex-col items-center justify-center py-14 px-6 text-center select-none",
|
|
@@ -3,7 +3,7 @@ import L from "./Icon.vue.js";
|
|
|
3
3
|
import v from "./Modal.vue.js";
|
|
4
4
|
import N from "./CommandPalette/CommandPaletteContent.vue.js";
|
|
5
5
|
import { $t as U } from "../utils/i18n.js";
|
|
6
|
-
/* empty css
|
|
6
|
+
/* empty css */
|
|
7
7
|
const V = { class: "block truncate -text-fs-1.5" }, S = { class: "ml-auto inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] font-mono font-medium border border-border/80 bg-background text-muted-foreground ml-1" }, A = /* @__PURE__ */ x({
|
|
8
8
|
__name: "NavbarCommandPalette",
|
|
9
9
|
props: {
|