@quikturn/logos-vue 1.0.0
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/README.md +361 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +200 -0
- package/dist/index.d.ts +200 -0
- package/dist/index.mjs +559 -0
- package/package.json +77 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,559 @@
|
|
|
1
|
+
import { inject as ue, computed as v, toValue as te, defineComponent as V, onMounted as W, unref as q, openBlock as c, createElementBlock as m, normalizeStyle as b, normalizeClass as R, createElementVNode as S, Fragment as x, renderList as G, createBlock as ae, resolveDynamicComponent as le, watch as j, ref as $, onUnmounted as de, createCommentVNode as ce } from "vue";
|
|
2
|
+
import { logoUrl as F, BASE_URL as fe } from "@quikturn/logos";
|
|
3
|
+
const oe = Symbol("quikturn"), Ce = {
|
|
4
|
+
install(n, e) {
|
|
5
|
+
n.provide(oe, { token: e.token, baseUrl: e.baseUrl });
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
function N() {
|
|
9
|
+
return ue(oe);
|
|
10
|
+
}
|
|
11
|
+
function Ee(n, e) {
|
|
12
|
+
const t = N();
|
|
13
|
+
return v(() => {
|
|
14
|
+
const a = e ? te(e) : void 0, g = (a == null ? void 0 : a.token) ?? (t == null ? void 0 : t.token), f = (a == null ? void 0 : a.baseUrl) ?? (t == null ? void 0 : t.baseUrl);
|
|
15
|
+
return F(te(n), {
|
|
16
|
+
token: g,
|
|
17
|
+
baseUrl: f,
|
|
18
|
+
size: a == null ? void 0 : a.size,
|
|
19
|
+
format: a == null ? void 0 : a.format,
|
|
20
|
+
greyscale: a == null ? void 0 : a.greyscale,
|
|
21
|
+
theme: a == null ? void 0 : a.theme
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const ne = /* @__PURE__ */ new Set();
|
|
26
|
+
function Y(n) {
|
|
27
|
+
if (typeof window > "u" || !n || n.startsWith("sk_") || ne.has(n)) return;
|
|
28
|
+
ne.add(n);
|
|
29
|
+
const e = new Image();
|
|
30
|
+
e.src = `${fe}/_beacon?token=${n}&page=${encodeURIComponent(location.href)}`;
|
|
31
|
+
}
|
|
32
|
+
function K(n) {
|
|
33
|
+
try {
|
|
34
|
+
const e = new URL(n, "https://placeholder.invalid");
|
|
35
|
+
return e.protocol === "https:" || e.protocol === "http:";
|
|
36
|
+
} catch {
|
|
37
|
+
return !1;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const ve = ["href"], me = ["src", "alt", "loading"], ge = ["src", "alt", "loading"], he = ["src", "alt", "loading"], He = /* @__PURE__ */ V({
|
|
41
|
+
__name: "QuikturnLogo",
|
|
42
|
+
props: {
|
|
43
|
+
domain: {},
|
|
44
|
+
token: {},
|
|
45
|
+
baseUrl: {},
|
|
46
|
+
size: {},
|
|
47
|
+
format: {},
|
|
48
|
+
greyscale: { type: Boolean },
|
|
49
|
+
theme: {},
|
|
50
|
+
alt: {},
|
|
51
|
+
href: {},
|
|
52
|
+
class: {},
|
|
53
|
+
style: {},
|
|
54
|
+
loading: { default: "lazy" }
|
|
55
|
+
},
|
|
56
|
+
emits: ["error", "load"],
|
|
57
|
+
setup(n, { emit: e }) {
|
|
58
|
+
const t = n, a = e, g = N(), f = v(() => t.token ?? (g == null ? void 0 : g.token) ?? ""), h = v(() => t.baseUrl ?? (g == null ? void 0 : g.baseUrl)), r = v(
|
|
59
|
+
() => F(t.domain, {
|
|
60
|
+
token: f.value || void 0,
|
|
61
|
+
size: t.size,
|
|
62
|
+
format: t.format,
|
|
63
|
+
greyscale: t.greyscale,
|
|
64
|
+
theme: t.theme,
|
|
65
|
+
baseUrl: h.value
|
|
66
|
+
})
|
|
67
|
+
), l = v(() => t.alt ?? `${t.domain} logo`);
|
|
68
|
+
return W(() => {
|
|
69
|
+
f.value && Y(f.value);
|
|
70
|
+
}), (i, u) => n.href && q(K)(n.href) ? (c(), m("a", {
|
|
71
|
+
key: 0,
|
|
72
|
+
href: n.href,
|
|
73
|
+
target: "_blank",
|
|
74
|
+
rel: "noopener noreferrer",
|
|
75
|
+
class: R(t.class),
|
|
76
|
+
style: b(t.style)
|
|
77
|
+
}, [
|
|
78
|
+
S("img", {
|
|
79
|
+
src: r.value,
|
|
80
|
+
alt: l.value,
|
|
81
|
+
loading: n.loading,
|
|
82
|
+
onError: u[0] || (u[0] = (d) => a("error", d)),
|
|
83
|
+
onLoad: u[1] || (u[1] = (d) => a("load", d))
|
|
84
|
+
}, null, 40, me)
|
|
85
|
+
], 14, ve)) : t.class || t.style ? (c(), m("span", {
|
|
86
|
+
key: 1,
|
|
87
|
+
class: R(t.class),
|
|
88
|
+
style: b(t.style)
|
|
89
|
+
}, [
|
|
90
|
+
S("img", {
|
|
91
|
+
src: r.value,
|
|
92
|
+
alt: l.value,
|
|
93
|
+
loading: n.loading,
|
|
94
|
+
onError: u[2] || (u[2] = (d) => a("error", d)),
|
|
95
|
+
onLoad: u[3] || (u[3] = (d) => a("load", d))
|
|
96
|
+
}, null, 40, ge)
|
|
97
|
+
], 6)) : (c(), m("img", {
|
|
98
|
+
key: 2,
|
|
99
|
+
src: r.value,
|
|
100
|
+
alt: l.value,
|
|
101
|
+
loading: n.loading,
|
|
102
|
+
onError: u[4] || (u[4] = (d) => a("error", d)),
|
|
103
|
+
onLoad: u[5] || (u[5] = (d) => a("load", d))
|
|
104
|
+
}, null, 40, he));
|
|
105
|
+
}
|
|
106
|
+
}), ye = ["aria-label"], pe = {
|
|
107
|
+
key: 1,
|
|
108
|
+
style: { display: "flex", alignItems: "center", justifyContent: "center" }
|
|
109
|
+
}, ke = ["href", "aria-label"], be = ["src", "alt"], $e = ["src", "alt"], Te = /* @__PURE__ */ V({
|
|
110
|
+
__name: "QuikturnLogoGrid",
|
|
111
|
+
props: {
|
|
112
|
+
domains: {},
|
|
113
|
+
logos: {},
|
|
114
|
+
token: {},
|
|
115
|
+
baseUrl: {},
|
|
116
|
+
columns: { default: 4 },
|
|
117
|
+
gap: { default: 24 },
|
|
118
|
+
logoSize: {},
|
|
119
|
+
logoFormat: {},
|
|
120
|
+
logoGreyscale: { type: Boolean },
|
|
121
|
+
logoTheme: {},
|
|
122
|
+
renderItem: {},
|
|
123
|
+
class: {},
|
|
124
|
+
style: {},
|
|
125
|
+
ariaLabel: { default: "Company logos" }
|
|
126
|
+
},
|
|
127
|
+
setup(n) {
|
|
128
|
+
const e = n, t = N(), a = v(() => e.token ?? (t == null ? void 0 : t.token) ?? ""), g = v(() => e.baseUrl ?? (t == null ? void 0 : t.baseUrl)), f = v(() => (e.logos ?? (e.domains ?? []).map((l) => ({ domain: l }))).map((l) => ({
|
|
129
|
+
domain: l.domain,
|
|
130
|
+
alt: l.alt ?? `${l.domain} logo`,
|
|
131
|
+
href: l.href,
|
|
132
|
+
url: F(l.domain, {
|
|
133
|
+
token: a.value || void 0,
|
|
134
|
+
size: l.size ?? e.logoSize,
|
|
135
|
+
format: l.format ?? e.logoFormat,
|
|
136
|
+
greyscale: l.greyscale ?? e.logoGreyscale,
|
|
137
|
+
theme: l.theme ?? e.logoTheme,
|
|
138
|
+
baseUrl: g.value
|
|
139
|
+
})
|
|
140
|
+
}))), h = v(() => ({
|
|
141
|
+
display: "grid",
|
|
142
|
+
gridTemplateColumns: `repeat(${e.columns}, 1fr)`,
|
|
143
|
+
gap: `${e.gap}px`,
|
|
144
|
+
alignItems: "center",
|
|
145
|
+
justifyItems: "center",
|
|
146
|
+
...e.style ?? {}
|
|
147
|
+
}));
|
|
148
|
+
return W(() => {
|
|
149
|
+
a.value && Y(a.value);
|
|
150
|
+
}), (r, l) => (c(), m("div", {
|
|
151
|
+
role: "region",
|
|
152
|
+
"aria-label": n.ariaLabel,
|
|
153
|
+
class: R(e.class),
|
|
154
|
+
style: b(h.value)
|
|
155
|
+
}, [
|
|
156
|
+
(c(!0), m(x, null, G(f.value, (i, u) => (c(), m(x, {
|
|
157
|
+
key: i.domain
|
|
158
|
+
}, [
|
|
159
|
+
n.renderItem ? (c(), ae(le(n.renderItem(i, u)), { key: 0 })) : (c(), m("div", pe, [
|
|
160
|
+
i.href && q(K)(i.href) ? (c(), m("a", {
|
|
161
|
+
key: 0,
|
|
162
|
+
href: i.href,
|
|
163
|
+
target: "_blank",
|
|
164
|
+
rel: "noopener noreferrer",
|
|
165
|
+
"aria-label": i.alt
|
|
166
|
+
}, [
|
|
167
|
+
S("img", {
|
|
168
|
+
src: i.url,
|
|
169
|
+
alt: i.alt,
|
|
170
|
+
loading: "lazy",
|
|
171
|
+
style: { maxWidth: "100%", height: "auto", display: "block" }
|
|
172
|
+
}, null, 8, be)
|
|
173
|
+
], 8, ke)) : (c(), m("img", {
|
|
174
|
+
key: 1,
|
|
175
|
+
src: i.url,
|
|
176
|
+
alt: i.alt,
|
|
177
|
+
loading: "lazy",
|
|
178
|
+
style: { maxWidth: "100%", height: "auto", display: "block" }
|
|
179
|
+
}, null, 8, $e))
|
|
180
|
+
]))
|
|
181
|
+
], 64))), 128))
|
|
182
|
+
], 14, ye));
|
|
183
|
+
}
|
|
184
|
+
}), U = {
|
|
185
|
+
SMOOTH_TAU: 0.25,
|
|
186
|
+
MIN_COPIES: 2,
|
|
187
|
+
COPY_HEADROOM: 2
|
|
188
|
+
};
|
|
189
|
+
function we(n, e, t) {
|
|
190
|
+
j(
|
|
191
|
+
t,
|
|
192
|
+
(a, g, f) => {
|
|
193
|
+
if (typeof window > "u") return;
|
|
194
|
+
if (!window.ResizeObserver) {
|
|
195
|
+
const r = () => n();
|
|
196
|
+
window.addEventListener("resize", r), n(), f(() => window.removeEventListener("resize", r));
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
const h = e.map((r) => {
|
|
200
|
+
const l = r.value;
|
|
201
|
+
if (!l) return null;
|
|
202
|
+
const i = new ResizeObserver(n);
|
|
203
|
+
return i.observe(l), i;
|
|
204
|
+
});
|
|
205
|
+
n(), f(() => {
|
|
206
|
+
h.forEach((r) => r == null ? void 0 : r.disconnect());
|
|
207
|
+
});
|
|
208
|
+
},
|
|
209
|
+
{ immediate: !0 }
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
function Me(n, e, t) {
|
|
213
|
+
j(
|
|
214
|
+
t,
|
|
215
|
+
(a, g, f) => {
|
|
216
|
+
var i;
|
|
217
|
+
const h = ((i = n.value) == null ? void 0 : i.querySelectorAll("img")) ?? [];
|
|
218
|
+
if (h.length === 0) {
|
|
219
|
+
e();
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
let r = h.length;
|
|
223
|
+
const l = () => {
|
|
224
|
+
r -= 1, r === 0 && e();
|
|
225
|
+
};
|
|
226
|
+
h.forEach((u) => {
|
|
227
|
+
const d = u;
|
|
228
|
+
d.complete ? l() : (d.addEventListener("load", l, { once: !0 }), d.addEventListener("error", l, { once: !0 }));
|
|
229
|
+
}), f(() => {
|
|
230
|
+
h.forEach((u) => {
|
|
231
|
+
u.removeEventListener("load", l), u.removeEventListener("error", l);
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
},
|
|
235
|
+
{ immediate: !0 }
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
function Se(n, e, t, a, g, f, h) {
|
|
239
|
+
const r = $(null), l = $(null), i = $(0), u = $(0);
|
|
240
|
+
j(
|
|
241
|
+
() => [
|
|
242
|
+
e(),
|
|
243
|
+
t(),
|
|
244
|
+
a(),
|
|
245
|
+
g(),
|
|
246
|
+
f(),
|
|
247
|
+
h()
|
|
248
|
+
],
|
|
249
|
+
(d, k, O) => {
|
|
250
|
+
var T;
|
|
251
|
+
const M = n.value;
|
|
252
|
+
if (!M) return;
|
|
253
|
+
const Q = typeof window < "u" && ((T = window.matchMedia) == null ? void 0 : T.call(window, "(prefers-reduced-motion: reduce)").matches), z = h(), w = z ? a() : t();
|
|
254
|
+
if (w > 0 && (i.value = (i.value % w + w) % w, M.style.transform = z ? `translate3d(0, ${-i.value}px, 0)` : `translate3d(${-i.value}px, 0, 0)`), Q) {
|
|
255
|
+
M.style.transform = "translate3d(0, 0, 0)", O(() => {
|
|
256
|
+
l.value = null;
|
|
257
|
+
});
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
const H = (_) => {
|
|
261
|
+
l.value === null && (l.value = _);
|
|
262
|
+
const B = Math.max(0, _ - l.value) / 1e3;
|
|
263
|
+
l.value = _;
|
|
264
|
+
const A = f(), I = g() && A !== void 0 ? A : e(), P = 1 - Math.exp(-B / U.SMOOTH_TAU);
|
|
265
|
+
if (u.value += (I - u.value) * P, w > 0) {
|
|
266
|
+
let L = i.value + u.value * B;
|
|
267
|
+
L = (L % w + w) % w, i.value = L, M.style.transform = z ? `translate3d(0, ${-i.value}px, 0)` : `translate3d(${-i.value}px, 0, 0)`;
|
|
268
|
+
}
|
|
269
|
+
r.value = requestAnimationFrame(H);
|
|
270
|
+
};
|
|
271
|
+
r.value = requestAnimationFrame(H), O(() => {
|
|
272
|
+
r.value !== null && (cancelAnimationFrame(r.value), r.value = null), l.value = null;
|
|
273
|
+
});
|
|
274
|
+
},
|
|
275
|
+
{ immediate: !0 }
|
|
276
|
+
), de(() => {
|
|
277
|
+
r.value !== null && (cancelAnimationFrame(r.value), r.value = null);
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
const Oe = ["aria-label"], _e = ["aria-hidden"], Ie = ["href", "aria-label"], Ue = ["src", "alt"], xe = ["src", "alt"], Be = /* @__PURE__ */ V({
|
|
281
|
+
__name: "QuikturnLogoCarousel",
|
|
282
|
+
props: {
|
|
283
|
+
domains: { default: void 0 },
|
|
284
|
+
logos: { default: void 0 },
|
|
285
|
+
token: { default: void 0 },
|
|
286
|
+
baseUrl: { default: void 0 },
|
|
287
|
+
speed: { default: 120 },
|
|
288
|
+
direction: { default: "left" },
|
|
289
|
+
pauseOnHover: { type: Boolean, default: void 0 },
|
|
290
|
+
hoverSpeed: { default: void 0 },
|
|
291
|
+
logoHeight: { default: 28 },
|
|
292
|
+
gap: { default: 32 },
|
|
293
|
+
width: { default: "100%" },
|
|
294
|
+
fadeOut: { type: Boolean, default: !1 },
|
|
295
|
+
fadeOutColor: { default: void 0 },
|
|
296
|
+
scaleOnHover: { type: Boolean, default: !1 },
|
|
297
|
+
logoSize: { default: void 0 },
|
|
298
|
+
logoFormat: { default: void 0 },
|
|
299
|
+
logoGreyscale: { type: Boolean, default: void 0 },
|
|
300
|
+
logoTheme: { default: void 0 },
|
|
301
|
+
renderItem: { type: Function, default: void 0 },
|
|
302
|
+
class: {},
|
|
303
|
+
style: {},
|
|
304
|
+
ariaLabel: { default: "Company logos" }
|
|
305
|
+
},
|
|
306
|
+
setup(n) {
|
|
307
|
+
const e = n, t = N(), a = v(() => e.token ?? (t == null ? void 0 : t.token) ?? ""), g = v(() => e.baseUrl ?? (t == null ? void 0 : t.baseUrl)), f = $(null), h = $(null), r = $(null), l = $(0), i = $(0), u = $(U.MIN_COPIES), d = $(!1), k = v(
|
|
308
|
+
() => e.direction === "up" || e.direction === "down"
|
|
309
|
+
), O = v(() => (e.logos ?? (e.domains ?? []).map((s) => ({ domain: s }))).map((s) => ({
|
|
310
|
+
domain: s.domain,
|
|
311
|
+
alt: s.alt ?? `${s.domain} logo`,
|
|
312
|
+
href: s.href,
|
|
313
|
+
url: F(s.domain, {
|
|
314
|
+
token: a.value || void 0,
|
|
315
|
+
size: s.size ?? e.logoSize,
|
|
316
|
+
format: s.format ?? e.logoFormat,
|
|
317
|
+
greyscale: s.greyscale ?? e.logoGreyscale,
|
|
318
|
+
theme: s.theme ?? e.logoTheme,
|
|
319
|
+
baseUrl: g.value
|
|
320
|
+
})
|
|
321
|
+
}))), M = v(() => {
|
|
322
|
+
if (e.hoverSpeed !== void 0) return e.hoverSpeed;
|
|
323
|
+
if (e.pauseOnHover === !0) return 0;
|
|
324
|
+
}), Q = v(() => {
|
|
325
|
+
const o = Math.abs(e.speed), s = k.value ? e.direction === "up" ? 1 : -1 : e.direction === "left" ? 1 : -1, y = e.speed < 0 ? -1 : 1;
|
|
326
|
+
return o * s * y;
|
|
327
|
+
}), z = v(() => {
|
|
328
|
+
const o = e.width;
|
|
329
|
+
return typeof o == "number" ? `${o}px` : o ?? void 0;
|
|
330
|
+
}), w = v(() => ({
|
|
331
|
+
position: "relative",
|
|
332
|
+
overflow: "hidden",
|
|
333
|
+
width: k.value ? void 0 : z.value ?? "100%",
|
|
334
|
+
height: k.value ? "100%" : void 0,
|
|
335
|
+
display: k.value ? "inline-block" : void 0
|
|
336
|
+
})), H = v(() => ({
|
|
337
|
+
display: "flex",
|
|
338
|
+
flexDirection: k.value ? "column" : "row",
|
|
339
|
+
width: k.value ? "100%" : "max-content",
|
|
340
|
+
willChange: "transform",
|
|
341
|
+
userSelect: "none",
|
|
342
|
+
position: "relative",
|
|
343
|
+
zIndex: 0
|
|
344
|
+
})), T = v(
|
|
345
|
+
() => Array.from({ length: u.value }, (o, s) => s)
|
|
346
|
+
);
|
|
347
|
+
W(() => {
|
|
348
|
+
a.value && Y(a.value);
|
|
349
|
+
});
|
|
350
|
+
function _() {
|
|
351
|
+
var C, ee;
|
|
352
|
+
const o = f.value, s = (C = r.value) == null ? void 0 : C.getBoundingClientRect(), y = (s == null ? void 0 : s.width) ?? 0, p = (s == null ? void 0 : s.height) ?? 0;
|
|
353
|
+
if (k.value) {
|
|
354
|
+
const E = ((ee = o == null ? void 0 : o.parentElement) == null ? void 0 : ee.clientHeight) ?? 0;
|
|
355
|
+
if (o && E > 0 && (o.style.height = `${Math.ceil(E)}px`), p > 0) {
|
|
356
|
+
i.value = Math.ceil(p);
|
|
357
|
+
const D = (o == null ? void 0 : o.clientHeight) ?? E ?? p, ie = Math.ceil(D / p) + U.COPY_HEADROOM;
|
|
358
|
+
u.value = Math.max(U.MIN_COPIES, ie);
|
|
359
|
+
}
|
|
360
|
+
} else if (y > 0) {
|
|
361
|
+
l.value = Math.ceil(y);
|
|
362
|
+
const E = (o == null ? void 0 : o.clientWidth) ?? 0, D = Math.ceil(E / y) + U.COPY_HEADROOM;
|
|
363
|
+
u.value = Math.max(U.MIN_COPIES, D);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
we(_, [f, r], () => [
|
|
367
|
+
O.value,
|
|
368
|
+
e.gap,
|
|
369
|
+
e.logoHeight,
|
|
370
|
+
k.value
|
|
371
|
+
]), Me(r, _, () => [
|
|
372
|
+
O.value,
|
|
373
|
+
e.gap,
|
|
374
|
+
e.logoHeight,
|
|
375
|
+
k.value
|
|
376
|
+
]), Se(
|
|
377
|
+
h,
|
|
378
|
+
() => Q.value,
|
|
379
|
+
() => l.value,
|
|
380
|
+
() => i.value,
|
|
381
|
+
() => d.value,
|
|
382
|
+
() => M.value,
|
|
383
|
+
() => k.value
|
|
384
|
+
);
|
|
385
|
+
function B() {
|
|
386
|
+
M.value !== void 0 && (d.value = !0);
|
|
387
|
+
}
|
|
388
|
+
function A() {
|
|
389
|
+
M.value !== void 0 && (d.value = !1);
|
|
390
|
+
}
|
|
391
|
+
const I = {
|
|
392
|
+
position: "absolute",
|
|
393
|
+
pointerEvents: "none",
|
|
394
|
+
zIndex: 1
|
|
395
|
+
};
|
|
396
|
+
function P() {
|
|
397
|
+
const o = e.fadeOutColor ?? "#ffffff";
|
|
398
|
+
return k.value ? {
|
|
399
|
+
...I,
|
|
400
|
+
top: "0",
|
|
401
|
+
left: "0",
|
|
402
|
+
right: "0",
|
|
403
|
+
height: "clamp(24px, 8%, 120px)",
|
|
404
|
+
background: `linear-gradient(to bottom, ${o} 0%, transparent 100%)`
|
|
405
|
+
} : {
|
|
406
|
+
...I,
|
|
407
|
+
top: "0",
|
|
408
|
+
bottom: "0",
|
|
409
|
+
left: "0",
|
|
410
|
+
width: "clamp(24px, 8%, 120px)",
|
|
411
|
+
background: `linear-gradient(to right, ${o} 0%, transparent 100%)`
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
function L() {
|
|
415
|
+
const o = e.fadeOutColor ?? "#ffffff";
|
|
416
|
+
return k.value ? {
|
|
417
|
+
...I,
|
|
418
|
+
bottom: "0",
|
|
419
|
+
left: "0",
|
|
420
|
+
right: "0",
|
|
421
|
+
height: "clamp(24px, 8%, 120px)",
|
|
422
|
+
background: `linear-gradient(to top, ${o} 0%, transparent 100%)`
|
|
423
|
+
} : {
|
|
424
|
+
...I,
|
|
425
|
+
top: "0",
|
|
426
|
+
bottom: "0",
|
|
427
|
+
right: "0",
|
|
428
|
+
width: "clamp(24px, 8%, 120px)",
|
|
429
|
+
background: `linear-gradient(to left, ${o} 0%, transparent 100%)`
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
function J() {
|
|
433
|
+
return {
|
|
434
|
+
height: `${e.logoHeight}px`,
|
|
435
|
+
width: "auto",
|
|
436
|
+
display: "block",
|
|
437
|
+
objectFit: "contain",
|
|
438
|
+
userSelect: "none",
|
|
439
|
+
pointerEvents: "none",
|
|
440
|
+
...e.scaleOnHover ? { transition: "transform 300ms cubic-bezier(0.4, 0, 0.2, 1)" } : {}
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
function X(o) {
|
|
444
|
+
if (!e.scaleOnHover) return;
|
|
445
|
+
const s = o.currentTarget.closest("li"), y = s == null ? void 0 : s.querySelector("img");
|
|
446
|
+
y && (y.style.transform = "scale(1.2)");
|
|
447
|
+
}
|
|
448
|
+
function Z(o) {
|
|
449
|
+
if (!e.scaleOnHover) return;
|
|
450
|
+
const s = o.currentTarget.closest("li"), y = s == null ? void 0 : s.querySelector("img");
|
|
451
|
+
y && (y.style.transform = "");
|
|
452
|
+
}
|
|
453
|
+
function re() {
|
|
454
|
+
return {
|
|
455
|
+
flex: "none",
|
|
456
|
+
...k.value ? { marginBottom: `${e.gap}px` } : { marginRight: `${e.gap}px` }
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
function se() {
|
|
460
|
+
return {
|
|
461
|
+
display: "flex",
|
|
462
|
+
flexDirection: k.value ? "column" : "row",
|
|
463
|
+
alignItems: "center",
|
|
464
|
+
listStyle: "none",
|
|
465
|
+
margin: "0",
|
|
466
|
+
padding: "0"
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
return (o, s) => (c(), m("div", {
|
|
470
|
+
ref_key: "containerRef",
|
|
471
|
+
ref: f,
|
|
472
|
+
role: "region",
|
|
473
|
+
"aria-label": n.ariaLabel,
|
|
474
|
+
class: R(o.$props.class),
|
|
475
|
+
style: b([w.value, o.$props.style])
|
|
476
|
+
}, [
|
|
477
|
+
n.fadeOut ? (c(), m(x, { key: 0 }, [
|
|
478
|
+
S("div", {
|
|
479
|
+
"aria-hidden": "true",
|
|
480
|
+
"data-testid": "fade-overlay",
|
|
481
|
+
style: b(P())
|
|
482
|
+
}, null, 4),
|
|
483
|
+
S("div", {
|
|
484
|
+
"aria-hidden": "true",
|
|
485
|
+
"data-testid": "fade-overlay",
|
|
486
|
+
style: b(L())
|
|
487
|
+
}, null, 4)
|
|
488
|
+
], 64)) : ce("", !0),
|
|
489
|
+
S("div", {
|
|
490
|
+
ref_key: "trackRef",
|
|
491
|
+
ref: h,
|
|
492
|
+
style: b(H.value),
|
|
493
|
+
onMouseenter: B,
|
|
494
|
+
onMouseleave: A
|
|
495
|
+
}, [
|
|
496
|
+
(c(!0), m(x, null, G(T.value, (y) => (c(), m("ul", {
|
|
497
|
+
key: y,
|
|
498
|
+
ref_for: !0,
|
|
499
|
+
ref: (p) => {
|
|
500
|
+
y === 0 && (r.value = p);
|
|
501
|
+
},
|
|
502
|
+
role: "list",
|
|
503
|
+
"aria-hidden": y > 0 ? !0 : void 0,
|
|
504
|
+
style: b(se())
|
|
505
|
+
}, [
|
|
506
|
+
(c(!0), m(x, null, G(O.value, (p, C) => (c(), m("li", {
|
|
507
|
+
key: `${y}-${C}`,
|
|
508
|
+
role: "listitem",
|
|
509
|
+
style: b(re())
|
|
510
|
+
}, [
|
|
511
|
+
n.renderItem ? (c(), ae(le(() => n.renderItem(p, C)), { key: 0 })) : (c(), m(x, { key: 1 }, [
|
|
512
|
+
p.href && q(K)(p.href) ? (c(), m("a", {
|
|
513
|
+
key: 0,
|
|
514
|
+
href: p.href,
|
|
515
|
+
target: "_blank",
|
|
516
|
+
rel: "noopener noreferrer",
|
|
517
|
+
"aria-label": p.alt,
|
|
518
|
+
style: { display: "inline-flex", "align-items": "center", "text-decoration": "none" },
|
|
519
|
+
onMouseenter: X,
|
|
520
|
+
onMouseleave: Z
|
|
521
|
+
}, [
|
|
522
|
+
S("img", {
|
|
523
|
+
src: p.url,
|
|
524
|
+
alt: p.alt,
|
|
525
|
+
loading: "lazy",
|
|
526
|
+
decoding: "async",
|
|
527
|
+
draggable: !1,
|
|
528
|
+
style: b(J())
|
|
529
|
+
}, null, 12, Ue)
|
|
530
|
+
], 40, Ie)) : (c(), m("span", {
|
|
531
|
+
key: 1,
|
|
532
|
+
style: { display: "inline-flex", "align-items": "center" },
|
|
533
|
+
onMouseenter: X,
|
|
534
|
+
onMouseleave: Z
|
|
535
|
+
}, [
|
|
536
|
+
S("img", {
|
|
537
|
+
src: p.url,
|
|
538
|
+
alt: p.alt,
|
|
539
|
+
loading: "lazy",
|
|
540
|
+
decoding: "async",
|
|
541
|
+
draggable: !1,
|
|
542
|
+
style: b(J())
|
|
543
|
+
}, null, 12, xe)
|
|
544
|
+
], 32))
|
|
545
|
+
], 64))
|
|
546
|
+
], 4))), 128))
|
|
547
|
+
], 12, _e))), 128))
|
|
548
|
+
], 36)
|
|
549
|
+
], 14, Oe));
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
export {
|
|
553
|
+
He as QuikturnLogo,
|
|
554
|
+
Be as QuikturnLogoCarousel,
|
|
555
|
+
Te as QuikturnLogoGrid,
|
|
556
|
+
Ce as QuikturnPlugin,
|
|
557
|
+
Ee as useLogoUrl,
|
|
558
|
+
N as useQuikturnContext
|
|
559
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@quikturn/logos-vue",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Vue 3 components for the Quikturn Logos API — QuikturnLogo, LogoCarousel, LogoGrid",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Quikturn",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": {
|
|
12
|
+
"import": "./dist/index.d.ts",
|
|
13
|
+
"require": "./dist/index.d.cts"
|
|
14
|
+
},
|
|
15
|
+
"import": "./dist/index.mjs",
|
|
16
|
+
"require": "./dist/index.cjs"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"main": "./dist/index.cjs",
|
|
20
|
+
"module": "./dist/index.mjs",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://github.com/Quikturn-PowerPoint-Add-In/Logo-SDK.git",
|
|
28
|
+
"directory": "packages/vue"
|
|
29
|
+
},
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/Quikturn-PowerPoint-Add-In/Logo-SDK/issues"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://github.com/Quikturn-PowerPoint-Add-In/Logo-SDK/tree/main/packages/vue#readme",
|
|
34
|
+
"keywords": [
|
|
35
|
+
"quikturn",
|
|
36
|
+
"logos",
|
|
37
|
+
"vue",
|
|
38
|
+
"company-logos",
|
|
39
|
+
"brand-assets"
|
|
40
|
+
],
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=20"
|
|
43
|
+
},
|
|
44
|
+
"files": [
|
|
45
|
+
"dist",
|
|
46
|
+
"LICENSE",
|
|
47
|
+
"README.md"
|
|
48
|
+
],
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "vite build",
|
|
51
|
+
"test": "vitest run",
|
|
52
|
+
"test:watch": "vitest",
|
|
53
|
+
"typecheck": "vue-tsc --noEmit",
|
|
54
|
+
"lint": "eslint src/ tests/"
|
|
55
|
+
},
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"@quikturn/logos": "workspace:^"
|
|
58
|
+
},
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"vue": "^3.3.0"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
64
|
+
"@semantic-release/git": "^10.0.1",
|
|
65
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
66
|
+
"@testing-library/vue": "^8.1.0",
|
|
67
|
+
"@vitejs/plugin-vue": "^5.2.0",
|
|
68
|
+
"jsdom": "^28.0.0",
|
|
69
|
+
"semantic-release": "^25.0.3",
|
|
70
|
+
"typescript": "^5.9.3",
|
|
71
|
+
"vite": "^6.0.0",
|
|
72
|
+
"vite-plugin-dts": "^4.5.0",
|
|
73
|
+
"vitest": "^4.0.18",
|
|
74
|
+
"vue": "^3.5.0",
|
|
75
|
+
"vue-tsc": "^2.2.0"
|
|
76
|
+
}
|
|
77
|
+
}
|