fansunited-frontend-components 0.0.78 → 0.0.79
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/List.js +140 -130
- package/index.js +1 -1
- package/package.json +2 -2
package/List.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
1
|
+
import { jsx as o, jsxs as v } from "react/jsx-runtime";
|
|
2
2
|
import * as D from "react";
|
|
3
|
-
import { useState as z, useRef as O, useCallback as V, useEffect as
|
|
4
|
-
import { H as lt, I as dt, J as pt, _ as $, K as
|
|
3
|
+
import { useState as z, useRef as O, useCallback as V, useEffect as it, lazy as Q, Suspense as ct } from "react";
|
|
4
|
+
import { H as lt, I as dt, J as pt, _ as $, K as ut, L as h, g as mt, u as ft, f as ht, d as gt, a as J, i as et, B as x, b as yt, y as Ct, W as xt } from "./chunks/PrizeCard-DG54vy2l.js";
|
|
5
5
|
import { P as It } from "./chunks/Portal-B5LOp_VA.js";
|
|
6
6
|
import "react-dom";
|
|
7
7
|
import { S as nt } from "./chunks/Spinner-CfnxZwI6.js";
|
|
8
|
-
import { a as
|
|
8
|
+
import { a as bt } from "./chunks/index-D5NQUqT3.js";
|
|
9
9
|
import { C as St } from "./chunks/Card-Bp7sboHu.js";
|
|
10
|
-
import { s as
|
|
11
|
-
import { C as
|
|
12
|
-
import { C as
|
|
10
|
+
import { s as wt, b as Tt, c as Pt, d as Et, T as Z } from "./chunks/Typography-ECqxGAdq.js";
|
|
11
|
+
import { C as vt } from "./chunks/CardContent-BZDBKTQD.js";
|
|
12
|
+
import { C as Mt } from "./chunks/Chip-Bm-Ccjvy.js";
|
|
13
13
|
import { c as Lt } from "./chunks/createLucideIcon-YBRjY5Kl.js";
|
|
14
14
|
import { M as Ut, a as Rt } from "./chunks/ModalDialog-DyJQmPgR.js";
|
|
15
15
|
import { M as _t } from "./chunks/ModalClose-C-dgGCpP.js";
|
|
@@ -23,7 +23,7 @@ function Nt(e) {
|
|
|
23
23
|
lt("MuiCardCover", ["root"]);
|
|
24
24
|
const Bt = ["className", "component", "children", "slots", "slotProps"], Ht = () => Et({
|
|
25
25
|
root: ["root"]
|
|
26
|
-
}, Nt, {}), Qt =
|
|
26
|
+
}, Nt, {}), Qt = wt("div", {
|
|
27
27
|
name: "JoyCardCover",
|
|
28
28
|
slot: "Root",
|
|
29
29
|
overridesResolver: (e, n) => n.root
|
|
@@ -61,19 +61,19 @@ const Bt = ["className", "component", "children", "slots", "slotProps"], Ht = ()
|
|
|
61
61
|
name: "JoyCardCover"
|
|
62
62
|
}), {
|
|
63
63
|
className: l,
|
|
64
|
-
component:
|
|
64
|
+
component: i = "div",
|
|
65
65
|
children: r,
|
|
66
66
|
slots: c = {},
|
|
67
67
|
slotProps: C = {}
|
|
68
|
-
} = d,
|
|
69
|
-
component:
|
|
70
|
-
}),
|
|
71
|
-
component:
|
|
68
|
+
} = d, a = pt(d, Bt), P = $({}, d, {
|
|
69
|
+
component: i
|
|
70
|
+
}), M = Ht(), A = $({}, a, {
|
|
71
|
+
component: i,
|
|
72
72
|
slots: c,
|
|
73
73
|
slotProps: C
|
|
74
74
|
}), [L, _] = Pt("root", {
|
|
75
75
|
ref: t,
|
|
76
|
-
className:
|
|
76
|
+
className: ut(M.root, l),
|
|
77
77
|
elementType: Qt,
|
|
78
78
|
externalForwardedProps: A,
|
|
79
79
|
ownerState: P
|
|
@@ -204,12 +204,12 @@ const jt = Lt("Users", [
|
|
|
204
204
|
const n = (t = rt(e)) == null ? void 0 : t.status;
|
|
205
205
|
return !!(n && kt.has(n));
|
|
206
206
|
}, Dt = 50, Vt = 3, Wt = (e, n, t, d) => {
|
|
207
|
-
const l = d === "paged",
|
|
208
|
-
async (
|
|
207
|
+
const l = d === "paged", i = d === "limited", [r, c] = z([]), [C, a] = z(!1), [P, M] = z(!1), [A, L] = z(!l), [_, I] = z(1), [S, N] = z(1), w = O([]), T = O([]), B = O(/* @__PURE__ */ new Set()), U = O(1), p = O(!1), m = O(!1), s = O(null), E = O(0), b = V(
|
|
208
|
+
async (u, g) => {
|
|
209
209
|
var H;
|
|
210
210
|
const f = await e.lists.getListContent(n, {
|
|
211
211
|
limit: g,
|
|
212
|
-
page:
|
|
212
|
+
page: u
|
|
213
213
|
}), y = (H = f.meta) == null ? void 0 : H.pagination, R = f.data ?? [];
|
|
214
214
|
return {
|
|
215
215
|
valid: R.filter(Zt),
|
|
@@ -219,81 +219,81 @@ const jt = Lt("Users", [
|
|
|
219
219
|
},
|
|
220
220
|
[e, n]
|
|
221
221
|
), F = V(async () => {
|
|
222
|
-
if (
|
|
223
|
-
const
|
|
222
|
+
if (m.current || !e || !n) return;
|
|
223
|
+
const u = E.current, g = () => u !== E.current, f = i ? t - T.current.length : t;
|
|
224
224
|
if (f <= 0) {
|
|
225
225
|
L(!1);
|
|
226
226
|
return;
|
|
227
227
|
}
|
|
228
|
-
if (
|
|
229
|
-
|
|
228
|
+
if (w.current.length < f && !p.current) {
|
|
229
|
+
m.current = !0, a(!0);
|
|
230
230
|
try {
|
|
231
231
|
let R = 0;
|
|
232
|
-
for (;
|
|
232
|
+
for (; w.current.length < f && !p.current && R < Vt; ) {
|
|
233
233
|
const {
|
|
234
234
|
valid: H,
|
|
235
235
|
rawCount: st,
|
|
236
|
-
pageCount:
|
|
237
|
-
} = await
|
|
236
|
+
pageCount: at
|
|
237
|
+
} = await b(U.current, Dt);
|
|
238
238
|
if (g()) return;
|
|
239
239
|
R += 1;
|
|
240
240
|
const X = H.filter(
|
|
241
241
|
(K) => !B.current.has(K.entityId)
|
|
242
242
|
);
|
|
243
|
-
X.forEach((K) => B.current.add(K.entityId)),
|
|
243
|
+
X.forEach((K) => B.current.add(K.entityId)), w.current.push(...X), (st === 0 || U.current >= at) && (p.current = !0), U.current += 1;
|
|
244
244
|
}
|
|
245
245
|
} catch (R) {
|
|
246
246
|
if (g()) return;
|
|
247
|
-
console.warn("Error fetching list content:", R),
|
|
247
|
+
console.warn("Error fetching list content:", R), M(!0);
|
|
248
248
|
return;
|
|
249
249
|
} finally {
|
|
250
|
-
g() || (
|
|
250
|
+
g() || (m.current = !1, a(!1));
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
if (g()) return;
|
|
254
|
-
const y = [...T.current, ...
|
|
254
|
+
const y = [...T.current, ...w.current.splice(0, f)];
|
|
255
255
|
T.current = y, c(y), L(
|
|
256
|
-
!
|
|
256
|
+
!i && (w.current.length > 0 || !p.current)
|
|
257
257
|
);
|
|
258
|
-
}, [
|
|
259
|
-
(
|
|
260
|
-
const f = Math.max(1, Math.ceil(
|
|
261
|
-
c(
|
|
258
|
+
}, [b, i, t, n, e]), j = V(
|
|
259
|
+
(u, g) => {
|
|
260
|
+
const f = Math.max(1, Math.ceil(u.length / t)), y = Math.min(Math.max(g, 1), f);
|
|
261
|
+
c(u.slice((y - 1) * t, y * t)), N(f), I(y);
|
|
262
262
|
},
|
|
263
263
|
[t]
|
|
264
264
|
), k = V(
|
|
265
|
-
async (
|
|
266
|
-
if (
|
|
265
|
+
async (u) => {
|
|
266
|
+
if (u < 1) return;
|
|
267
267
|
if (s.current) {
|
|
268
|
-
j(s.current,
|
|
268
|
+
j(s.current, u);
|
|
269
269
|
return;
|
|
270
270
|
}
|
|
271
|
-
if (
|
|
271
|
+
if (m.current || !e || !n) return;
|
|
272
272
|
const g = E.current, f = () => g !== E.current;
|
|
273
|
-
|
|
273
|
+
m.current = !0, a(!0);
|
|
274
274
|
try {
|
|
275
275
|
const {
|
|
276
276
|
valid: y,
|
|
277
277
|
rawCount: R,
|
|
278
278
|
pageCount: H
|
|
279
|
-
} = await
|
|
279
|
+
} = await b(u, t);
|
|
280
280
|
if (f()) return;
|
|
281
281
|
if (R > t) {
|
|
282
|
-
s.current = y, j(y,
|
|
282
|
+
s.current = y, j(y, u);
|
|
283
283
|
return;
|
|
284
284
|
}
|
|
285
|
-
c(y), N(H), I(
|
|
285
|
+
c(y), N(H), I(u);
|
|
286
286
|
} catch (y) {
|
|
287
287
|
if (f()) return;
|
|
288
|
-
console.warn("Error fetching list content:", y),
|
|
288
|
+
console.warn("Error fetching list content:", y), M(!0);
|
|
289
289
|
} finally {
|
|
290
|
-
f() || (
|
|
290
|
+
f() || (m.current = !1, a(!1));
|
|
291
291
|
}
|
|
292
292
|
},
|
|
293
|
-
[
|
|
293
|
+
[b, t, n, e, j]
|
|
294
294
|
);
|
|
295
|
-
return
|
|
296
|
-
E.current += 1,
|
|
295
|
+
return it(() => {
|
|
296
|
+
E.current += 1, m.current = !1, w.current = [], T.current = [], B.current = /* @__PURE__ */ new Set(), U.current = 1, p.current = !1, s.current = null, c([]), M(!1), L(!l), I(1), N(1), l ? k(1) : F();
|
|
297
297
|
}, [l, k, F]), {
|
|
298
298
|
items: r,
|
|
299
299
|
loading: C,
|
|
@@ -305,7 +305,7 @@ const jt = Lt("Users", [
|
|
|
305
305
|
goToPage: k
|
|
306
306
|
};
|
|
307
307
|
}, G = () => {
|
|
308
|
-
const e =
|
|
308
|
+
const e = mt(), n = ft(), t = ht(), d = gt();
|
|
309
309
|
return {
|
|
310
310
|
fonts: n,
|
|
311
311
|
spacing: d,
|
|
@@ -358,9 +358,9 @@ const jt = Lt("Users", [
|
|
|
358
358
|
imagePlaceholder: d,
|
|
359
359
|
onClick: l
|
|
360
360
|
}) => {
|
|
361
|
-
var
|
|
362
|
-
const { t:
|
|
363
|
-
return /* @__PURE__ */
|
|
361
|
+
var a, P;
|
|
362
|
+
const { t: i } = J(), r = G(), c = et(), C = $t(n.branding, c);
|
|
363
|
+
return /* @__PURE__ */ v(
|
|
364
364
|
St,
|
|
365
365
|
{
|
|
366
366
|
onClick: () => l(e),
|
|
@@ -386,15 +386,15 @@ const jt = Lt("Users", [
|
|
|
386
386
|
/* @__PURE__ */ o(q, { children: /* @__PURE__ */ o(
|
|
387
387
|
"img",
|
|
388
388
|
{
|
|
389
|
-
src: ((
|
|
389
|
+
src: ((a = n.images) == null ? void 0 : a.cover) || ((P = n.images) == null ? void 0 : P.main) || d || bt,
|
|
390
390
|
alt: n.title,
|
|
391
391
|
loading: "lazy",
|
|
392
392
|
style: { transition: "transform 0.4s ease-out" }
|
|
393
393
|
}
|
|
394
394
|
) }),
|
|
395
395
|
/* @__PURE__ */ o(q, { sx: { background: r.onImage.scrim } }),
|
|
396
|
-
/* @__PURE__ */
|
|
397
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ v(vt, { sx: { justifyContent: "flex-end", gap: 0 }, children: [
|
|
397
|
+
/* @__PURE__ */ v(
|
|
398
398
|
x,
|
|
399
399
|
{
|
|
400
400
|
sx: {
|
|
@@ -404,8 +404,8 @@ const jt = Lt("Users", [
|
|
|
404
404
|
gap: r.spacing.md
|
|
405
405
|
},
|
|
406
406
|
children: [
|
|
407
|
-
/* @__PURE__ */
|
|
408
|
-
/* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ v(x, { children: [
|
|
408
|
+
/* @__PURE__ */ v(
|
|
409
409
|
x,
|
|
410
410
|
{
|
|
411
411
|
sx: {
|
|
@@ -416,7 +416,7 @@ const jt = Lt("Users", [
|
|
|
416
416
|
},
|
|
417
417
|
children: [
|
|
418
418
|
t && /* @__PURE__ */ o(
|
|
419
|
-
|
|
419
|
+
Mt,
|
|
420
420
|
{
|
|
421
421
|
size: "sm",
|
|
422
422
|
color: "neutral",
|
|
@@ -463,7 +463,7 @@ const jt = Lt("Users", [
|
|
|
463
463
|
}
|
|
464
464
|
)
|
|
465
465
|
] }),
|
|
466
|
-
C && !c && /* @__PURE__ */
|
|
466
|
+
C && !c && /* @__PURE__ */ v(
|
|
467
467
|
x,
|
|
468
468
|
{
|
|
469
469
|
sx: {
|
|
@@ -485,7 +485,7 @@ const jt = Lt("Users", [
|
|
|
485
485
|
textShadow: r.onImage.labelShadow,
|
|
486
486
|
textAlign: "center"
|
|
487
487
|
},
|
|
488
|
-
children:
|
|
488
|
+
children: i("list.sponsoredBy")
|
|
489
489
|
}
|
|
490
490
|
),
|
|
491
491
|
/* @__PURE__ */ o(
|
|
@@ -498,7 +498,7 @@ const jt = Lt("Users", [
|
|
|
498
498
|
maxWidth: "100%"
|
|
499
499
|
}
|
|
500
500
|
},
|
|
501
|
-
children: /* @__PURE__ */ o("img", { src: C, alt:
|
|
501
|
+
children: /* @__PURE__ */ o("img", { src: C, alt: i("list.sponsoredBy") })
|
|
502
502
|
}
|
|
503
503
|
)
|
|
504
504
|
]
|
|
@@ -507,7 +507,7 @@ const jt = Lt("Users", [
|
|
|
507
507
|
]
|
|
508
508
|
}
|
|
509
509
|
),
|
|
510
|
-
C && c && /* @__PURE__ */
|
|
510
|
+
C && c && /* @__PURE__ */ v(
|
|
511
511
|
x,
|
|
512
512
|
{
|
|
513
513
|
sx: {
|
|
@@ -529,7 +529,7 @@ const jt = Lt("Users", [
|
|
|
529
529
|
fontFamily: r.fonts.secondary,
|
|
530
530
|
color: r.onImage.dimStrong
|
|
531
531
|
},
|
|
532
|
-
children:
|
|
532
|
+
children: i("list.sponsoredBy")
|
|
533
533
|
}
|
|
534
534
|
),
|
|
535
535
|
/* @__PURE__ */ o(
|
|
@@ -542,7 +542,7 @@ const jt = Lt("Users", [
|
|
|
542
542
|
objectFit: "contain"
|
|
543
543
|
}
|
|
544
544
|
},
|
|
545
|
-
children: /* @__PURE__ */ o("img", { src: C, alt:
|
|
545
|
+
children: /* @__PURE__ */ o("img", { src: C, alt: i("list.sponsoredBy") })
|
|
546
546
|
}
|
|
547
547
|
)
|
|
548
548
|
]
|
|
@@ -560,49 +560,49 @@ const jt = Lt("Users", [
|
|
|
560
560
|
onClose: t,
|
|
561
561
|
listProps: d
|
|
562
562
|
}) => {
|
|
563
|
-
const { t: l } = J(),
|
|
563
|
+
const { t: l } = J(), i = G(), { shadowRootElement: r } = yt(Ct), {
|
|
564
564
|
sdk: c,
|
|
565
565
|
language: C,
|
|
566
|
-
themeOptions:
|
|
566
|
+
themeOptions: a,
|
|
567
567
|
userIsLoggedIn: P,
|
|
568
|
-
signInCTA:
|
|
568
|
+
signInCTA: M,
|
|
569
569
|
additionalCTA: A,
|
|
570
570
|
shareCTA: L,
|
|
571
571
|
rulesDisplay: _,
|
|
572
572
|
leads: I,
|
|
573
573
|
consents: S,
|
|
574
574
|
chanceGameVariant: N,
|
|
575
|
-
showAnswerExplanations:
|
|
575
|
+
showAnswerExplanations: w,
|
|
576
576
|
optionsLayout: T,
|
|
577
577
|
imagePosition: B,
|
|
578
578
|
defaultImagePlaceholderUrl: U,
|
|
579
579
|
matchQuiz: p,
|
|
580
|
-
eventGame:
|
|
580
|
+
eventGame: m,
|
|
581
581
|
callbacks: s
|
|
582
582
|
} = d, E = {
|
|
583
583
|
sdk: c,
|
|
584
584
|
language: C,
|
|
585
|
-
themeOptions:
|
|
585
|
+
themeOptions: a,
|
|
586
586
|
leads: I,
|
|
587
587
|
consents: S,
|
|
588
588
|
userIsLoggedIn: P,
|
|
589
|
-
signInCTA:
|
|
589
|
+
signInCTA: M,
|
|
590
590
|
additionalCTA: A,
|
|
591
591
|
rulesDisplay: _,
|
|
592
592
|
defaultImagePlaceholderUrl: U,
|
|
593
593
|
template: xt.STANDARD,
|
|
594
594
|
imagePosition: B
|
|
595
|
-
},
|
|
595
|
+
}, b = { ...E, chanceGameVariant: N }, F = () => {
|
|
596
596
|
if (!e) return null;
|
|
597
597
|
switch (e.entityType) {
|
|
598
598
|
case "CLASSIC_QUIZ":
|
|
599
599
|
return /* @__PURE__ */ o(
|
|
600
600
|
Jt,
|
|
601
601
|
{
|
|
602
|
-
...
|
|
602
|
+
...b,
|
|
603
603
|
entityId: e.entityId,
|
|
604
604
|
shareCTA: L,
|
|
605
|
-
showAnswerExplanations:
|
|
605
|
+
showAnswerExplanations: w,
|
|
606
606
|
optionsLayout: T,
|
|
607
607
|
callbacks: {
|
|
608
608
|
onFinish: s == null ? void 0 : s.onFinish,
|
|
@@ -614,9 +614,9 @@ const jt = Lt("Users", [
|
|
|
614
614
|
return /* @__PURE__ */ o(
|
|
615
615
|
Xt,
|
|
616
616
|
{
|
|
617
|
-
...
|
|
617
|
+
...b,
|
|
618
618
|
entityId: e.entityId,
|
|
619
|
-
showAnswerExplanations:
|
|
619
|
+
showAnswerExplanations: w,
|
|
620
620
|
optionsLayout: T,
|
|
621
621
|
callbacks: { onFinish: s == null ? void 0 : s.onFinish }
|
|
622
622
|
}
|
|
@@ -625,7 +625,7 @@ const jt = Lt("Users", [
|
|
|
625
625
|
return /* @__PURE__ */ o(
|
|
626
626
|
te,
|
|
627
627
|
{
|
|
628
|
-
...
|
|
628
|
+
...b,
|
|
629
629
|
entityId: e.entityId,
|
|
630
630
|
optionsLayout: T,
|
|
631
631
|
callbacks: { onFinish: s == null ? void 0 : s.onFinish }
|
|
@@ -644,7 +644,7 @@ const jt = Lt("Users", [
|
|
|
644
644
|
return /* @__PURE__ */ o(
|
|
645
645
|
ne,
|
|
646
646
|
{
|
|
647
|
-
...
|
|
647
|
+
...b,
|
|
648
648
|
entityId: e.entityId,
|
|
649
649
|
showPredictionDetails: (p == null ? void 0 : p.showPredictionDetails) ?? !0,
|
|
650
650
|
showCountdown: (p == null ? void 0 : p.showCountdown) ?? !0,
|
|
@@ -657,23 +657,23 @@ const jt = Lt("Users", [
|
|
|
657
657
|
return /* @__PURE__ */ o(
|
|
658
658
|
oe,
|
|
659
659
|
{
|
|
660
|
-
...
|
|
660
|
+
...b,
|
|
661
661
|
entityId: e.entityId,
|
|
662
662
|
optionsLayout: T,
|
|
663
|
-
showPredictionDetails: (
|
|
664
|
-
showCountdown: (
|
|
665
|
-
showPoints: (
|
|
663
|
+
showPredictionDetails: (m == null ? void 0 : m.showPredictionDetails) ?? !0,
|
|
664
|
+
showCountdown: (m == null ? void 0 : m.showCountdown) ?? !0,
|
|
665
|
+
showPoints: (m == null ? void 0 : m.showPoints) ?? !0,
|
|
666
666
|
callbacks: { onFinish: s == null ? void 0 : s.onFinish }
|
|
667
667
|
}
|
|
668
668
|
);
|
|
669
669
|
default:
|
|
670
|
-
return /* @__PURE__ */ o(x, { sx: { padding:
|
|
670
|
+
return /* @__PURE__ */ o(x, { sx: { padding: i.spacing.md, textAlign: "center" }, children: /* @__PURE__ */ o(
|
|
671
671
|
Z,
|
|
672
672
|
{
|
|
673
673
|
sx: {
|
|
674
674
|
fontSize: "1em",
|
|
675
|
-
fontFamily:
|
|
676
|
-
color:
|
|
675
|
+
fontFamily: i.fonts.secondary,
|
|
676
|
+
color: i.colors.text
|
|
677
677
|
},
|
|
678
678
|
children: l("list.unsupportedContentType", { type: e.entityType })
|
|
679
679
|
}
|
|
@@ -687,23 +687,33 @@ const jt = Lt("Users", [
|
|
|
687
687
|
onClose: t,
|
|
688
688
|
container: r,
|
|
689
689
|
sx: { zIndex: 1300 },
|
|
690
|
-
children: /* @__PURE__ */
|
|
690
|
+
children: /* @__PURE__ */ v(
|
|
691
691
|
Rt,
|
|
692
692
|
{
|
|
693
693
|
sx: {
|
|
694
694
|
fontSize: "1em",
|
|
695
|
-
fontFamily:
|
|
695
|
+
fontFamily: i.fonts.secondary,
|
|
696
696
|
maxWidth: "95vw",
|
|
697
697
|
maxHeight: "95vh",
|
|
698
698
|
overflowY: "auto",
|
|
699
699
|
overflowX: "hidden",
|
|
700
700
|
padding: 0,
|
|
701
|
-
borderRadius:
|
|
702
|
-
backgroundColor:
|
|
701
|
+
borderRadius: i.radius.md,
|
|
702
|
+
backgroundColor: i.colors.surface
|
|
703
703
|
},
|
|
704
704
|
children: [
|
|
705
|
-
/* @__PURE__ */ o(
|
|
706
|
-
|
|
705
|
+
/* @__PURE__ */ o(
|
|
706
|
+
_t,
|
|
707
|
+
{
|
|
708
|
+
sx: {
|
|
709
|
+
zIndex: 1,
|
|
710
|
+
// Joy's plain hover/active fill reads as a white tile over the item's image.
|
|
711
|
+
"&:hover": { backgroundColor: "transparent" },
|
|
712
|
+
"&:active": { backgroundColor: "transparent" }
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
),
|
|
716
|
+
/* @__PURE__ */ o(x, { sx: { position: "relative", zIndex: 0, fontSize: "1em" }, children: /* @__PURE__ */ o(ct, { fallback: /* @__PURE__ */ o(nt, { my: 4 }), children: F() }) })
|
|
707
717
|
]
|
|
708
718
|
}
|
|
709
719
|
)
|
|
@@ -713,17 +723,17 @@ const jt = Lt("Users", [
|
|
|
713
723
|
const t = [];
|
|
714
724
|
for (let d = e; d <= n; d += 1) t.push(d);
|
|
715
725
|
return t;
|
|
716
|
-
},
|
|
726
|
+
}, ae = (e, n) => {
|
|
717
727
|
if (n <= 0) return [];
|
|
718
728
|
const t = [1], d = Math.max(2, e - 1), l = Math.min(n - 1, e + 1);
|
|
719
729
|
return d > 2 && t.push("gap-start"), t.push(...se(d, l)), l < n - 1 && t.push("gap-end"), n > 1 && t.push(n), t;
|
|
720
|
-
},
|
|
730
|
+
}, ie = ({
|
|
721
731
|
page: e,
|
|
722
732
|
count: n,
|
|
723
733
|
disabled: t = !1,
|
|
724
734
|
onChange: d
|
|
725
735
|
}) => {
|
|
726
|
-
const l = G(),
|
|
736
|
+
const l = G(), i = (c) => {
|
|
727
737
|
c >= 1 && c <= n && c !== e && d(c);
|
|
728
738
|
}, r = {
|
|
729
739
|
minWidth: "2em",
|
|
@@ -733,7 +743,7 @@ const jt = Lt("Users", [
|
|
|
733
743
|
fontSize: "0.875em",
|
|
734
744
|
color: l.colors.text
|
|
735
745
|
};
|
|
736
|
-
return /* @__PURE__ */
|
|
746
|
+
return /* @__PURE__ */ v(
|
|
737
747
|
x,
|
|
738
748
|
{
|
|
739
749
|
sx: {
|
|
@@ -750,7 +760,7 @@ const jt = Lt("Users", [
|
|
|
750
760
|
variant: "plain",
|
|
751
761
|
color: "neutral",
|
|
752
762
|
disabled: t || e === 1,
|
|
753
|
-
onClick: () =>
|
|
763
|
+
onClick: () => i(1),
|
|
754
764
|
sx: r,
|
|
755
765
|
children: /* @__PURE__ */ o(W, { children: /* @__PURE__ */ o(Ft, { size: 18 }) })
|
|
756
766
|
}
|
|
@@ -761,12 +771,12 @@ const jt = Lt("Users", [
|
|
|
761
771
|
variant: "plain",
|
|
762
772
|
color: "neutral",
|
|
763
773
|
disabled: t || e === 1,
|
|
764
|
-
onClick: () =>
|
|
774
|
+
onClick: () => i(e - 1),
|
|
765
775
|
sx: r,
|
|
766
776
|
children: /* @__PURE__ */ o(W, { children: /* @__PURE__ */ o(zt, { size: 18 }) })
|
|
767
777
|
}
|
|
768
778
|
),
|
|
769
|
-
|
|
779
|
+
ae(e, n).map((c, C) => {
|
|
770
780
|
if (typeof c == "string")
|
|
771
781
|
return /* @__PURE__ */ o(
|
|
772
782
|
x,
|
|
@@ -782,21 +792,21 @@ const jt = Lt("Users", [
|
|
|
782
792
|
},
|
|
783
793
|
`${c}-${C}`
|
|
784
794
|
);
|
|
785
|
-
const
|
|
795
|
+
const a = c === e;
|
|
786
796
|
return /* @__PURE__ */ o(
|
|
787
797
|
ot,
|
|
788
798
|
{
|
|
789
799
|
variant: "plain",
|
|
790
800
|
color: "neutral",
|
|
791
801
|
disabled: t,
|
|
792
|
-
onClick: () =>
|
|
802
|
+
onClick: () => i(c),
|
|
793
803
|
sx: {
|
|
794
804
|
...r,
|
|
795
|
-
fontWeight:
|
|
796
|
-
bgcolor:
|
|
797
|
-
color:
|
|
805
|
+
fontWeight: a ? 600 : 400,
|
|
806
|
+
bgcolor: a ? l.colors.primary : "transparent",
|
|
807
|
+
color: a ? l.colors.onPrimary : l.colors.text,
|
|
798
808
|
"&:hover": {
|
|
799
|
-
bgcolor:
|
|
809
|
+
bgcolor: a ? l.colors.primary : l.colors.surface
|
|
800
810
|
}
|
|
801
811
|
},
|
|
802
812
|
children: c
|
|
@@ -810,7 +820,7 @@ const jt = Lt("Users", [
|
|
|
810
820
|
variant: "plain",
|
|
811
821
|
color: "neutral",
|
|
812
822
|
disabled: t || e === n,
|
|
813
|
-
onClick: () =>
|
|
823
|
+
onClick: () => i(e + 1),
|
|
814
824
|
sx: r,
|
|
815
825
|
children: /* @__PURE__ */ o(W, { children: /* @__PURE__ */ o(At, { size: 18 }) })
|
|
816
826
|
}
|
|
@@ -821,7 +831,7 @@ const jt = Lt("Users", [
|
|
|
821
831
|
variant: "plain",
|
|
822
832
|
color: "neutral",
|
|
823
833
|
disabled: t || e === n,
|
|
824
|
-
onClick: () =>
|
|
834
|
+
onClick: () => i(n),
|
|
825
835
|
sx: r,
|
|
826
836
|
children: /* @__PURE__ */ o(W, { children: /* @__PURE__ */ o(Ot, { size: 18 }) })
|
|
827
837
|
}
|
|
@@ -842,50 +852,50 @@ const jt = Lt("Users", [
|
|
|
842
852
|
sdk: t,
|
|
843
853
|
itemsCount: d = 10,
|
|
844
854
|
itemsPerRow: l = 2,
|
|
845
|
-
widgetMode:
|
|
855
|
+
widgetMode: i = "load-more",
|
|
846
856
|
urls: r,
|
|
847
857
|
defaultImagePlaceholderUrl: c
|
|
848
|
-
} = e, { t: C } = J(),
|
|
858
|
+
} = e, { t: C } = J(), a = G(), P = et(), [M, A] = z(null), [L, _] = z(!1), {
|
|
849
859
|
items: I,
|
|
850
860
|
loading: S,
|
|
851
861
|
error: N,
|
|
852
|
-
hasMore:
|
|
862
|
+
hasMore: w,
|
|
853
863
|
loadMore: T,
|
|
854
864
|
page: B,
|
|
855
865
|
pageCount: U,
|
|
856
866
|
goToPage: p
|
|
857
|
-
} = Wt(t, n, d,
|
|
858
|
-
const g = Kt(
|
|
867
|
+
} = Wt(t, n, d, i), m = Gt(r), s = i === "paged", E = (u) => {
|
|
868
|
+
const g = Kt(u, r);
|
|
859
869
|
if (g) {
|
|
860
870
|
window.location.href = g;
|
|
861
871
|
return;
|
|
862
872
|
}
|
|
863
|
-
|
|
864
|
-
},
|
|
865
|
-
return N || !S && I.length === 0 && !F ? null : /* @__PURE__ */
|
|
873
|
+
m || (A(u), _(!0));
|
|
874
|
+
}, b = P ? 1 : Math.max(1, Math.floor(l)), F = s && U > 1, j = !s && w && !S, k = !(s && S);
|
|
875
|
+
return N || !S && I.length === 0 && !F ? null : /* @__PURE__ */ v(x, { sx: { fontSize: "1em", fontFamily: a.fonts.secondary }, children: [
|
|
866
876
|
k && /* @__PURE__ */ o(
|
|
867
877
|
x,
|
|
868
878
|
{
|
|
869
879
|
sx: {
|
|
870
880
|
display: "grid",
|
|
871
|
-
gridTemplateColumns: `repeat(${
|
|
872
|
-
gap:
|
|
873
|
-
marginBottom:
|
|
881
|
+
gridTemplateColumns: `repeat(${b}, minmax(0, 1fr))`,
|
|
882
|
+
gap: a.spacing.xs,
|
|
883
|
+
marginBottom: a.spacing.md
|
|
874
884
|
},
|
|
875
|
-
children: I.map((
|
|
876
|
-
const g = rt(
|
|
885
|
+
children: I.map((u) => {
|
|
886
|
+
const g = rt(u);
|
|
877
887
|
if (!g) return null;
|
|
878
|
-
const f = ce[
|
|
888
|
+
const f = ce[u.entityType];
|
|
879
889
|
return /* @__PURE__ */ o(
|
|
880
890
|
qt,
|
|
881
891
|
{
|
|
882
|
-
item:
|
|
892
|
+
item: u,
|
|
883
893
|
entityData: g,
|
|
884
894
|
typeLabel: f ? C(f) : "",
|
|
885
895
|
imagePlaceholder: c || "",
|
|
886
896
|
onClick: E
|
|
887
897
|
},
|
|
888
|
-
|
|
898
|
+
u.entityId
|
|
889
899
|
);
|
|
890
900
|
})
|
|
891
901
|
}
|
|
@@ -897,7 +907,7 @@ const jt = Lt("Users", [
|
|
|
897
907
|
sx: {
|
|
898
908
|
display: "flex",
|
|
899
909
|
justifyContent: "center",
|
|
900
|
-
marginTop:
|
|
910
|
+
marginTop: a.spacing.md
|
|
901
911
|
},
|
|
902
912
|
children: /* @__PURE__ */ o(
|
|
903
913
|
ot,
|
|
@@ -905,12 +915,12 @@ const jt = Lt("Users", [
|
|
|
905
915
|
variant: "soft",
|
|
906
916
|
onClick: T,
|
|
907
917
|
sx: {
|
|
908
|
-
borderRadius:
|
|
918
|
+
borderRadius: a.radius.xl,
|
|
909
919
|
py: "10px",
|
|
910
920
|
px: "16px",
|
|
911
|
-
bgcolor:
|
|
912
|
-
color:
|
|
913
|
-
fontFamily:
|
|
921
|
+
bgcolor: a.colors.primary,
|
|
922
|
+
color: a.colors.onPrimary,
|
|
923
|
+
fontFamily: a.fonts.primary,
|
|
914
924
|
fontSize: "0.9375em",
|
|
915
925
|
fontWeight: 500,
|
|
916
926
|
lineHeight: "24px",
|
|
@@ -919,11 +929,11 @@ const jt = Lt("Users", [
|
|
|
919
929
|
transition: "all 300ms cubic-bezier(0.2, 0, 0, 1)",
|
|
920
930
|
transform: "scale(1)",
|
|
921
931
|
"&:hover": {
|
|
922
|
-
bgcolor:
|
|
932
|
+
bgcolor: a.colors.primary,
|
|
923
933
|
transform: "scale(1.02)"
|
|
924
934
|
},
|
|
925
935
|
"&:active": {
|
|
926
|
-
color:
|
|
936
|
+
color: a.colors.onPrimary,
|
|
927
937
|
transform: "scale(0.98)"
|
|
928
938
|
}
|
|
929
939
|
},
|
|
@@ -932,8 +942,8 @@ const jt = Lt("Users", [
|
|
|
932
942
|
)
|
|
933
943
|
}
|
|
934
944
|
),
|
|
935
|
-
F && /* @__PURE__ */ o(x, { sx: { marginTop:
|
|
936
|
-
|
|
945
|
+
F && /* @__PURE__ */ o(x, { sx: { marginTop: a.spacing.md }, children: /* @__PURE__ */ o(
|
|
946
|
+
ie,
|
|
937
947
|
{
|
|
938
948
|
page: B,
|
|
939
949
|
count: U,
|
|
@@ -944,7 +954,7 @@ const jt = Lt("Users", [
|
|
|
944
954
|
/* @__PURE__ */ o(
|
|
945
955
|
re,
|
|
946
956
|
{
|
|
947
|
-
item:
|
|
957
|
+
item: M,
|
|
948
958
|
open: L,
|
|
949
959
|
onClose: () => _(!1),
|
|
950
960
|
listProps: e
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fansunited-frontend-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.79",
|
|
4
4
|
"description": "Various user centric components for Fans United features",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"fansunited-frontend-core": "0.0.
|
|
83
|
+
"fansunited-frontend-core": "0.0.79",
|
|
84
84
|
"react": ">=16.8.0",
|
|
85
85
|
"react-dom": ">=16.8.0"
|
|
86
86
|
},
|