@nukleus-sports/ui-patterns 0.7.1 → 0.8.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/dist/{chunk-4N2GUEA7.js → chunk-2KJMI6DZ.js} +5 -2
- package/dist/chunk-2KJMI6DZ.js.map +1 -0
- package/dist/client.cjs +4 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +1 -1
- package/dist/index.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +1 -1
- package/dist/marketing.cjs +4 -1
- package/dist/marketing.cjs.map +1 -1
- package/dist/marketing.js +1 -1
- package/dist/team.cjs +566 -327
- package/dist/team.cjs.map +1 -1
- package/dist/team.d.cts +36 -2
- package/dist/team.d.ts +36 -2
- package/dist/team.js +544 -297
- package/dist/team.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-4N2GUEA7.js.map +0 -1
package/dist/team.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EntityAvatar
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2KJMI6DZ.js";
|
|
4
4
|
|
|
5
5
|
// src/team/team-info-card.tsx
|
|
6
6
|
import {
|
|
@@ -12,7 +12,11 @@ import {
|
|
|
12
12
|
TabsTrigger,
|
|
13
13
|
cn
|
|
14
14
|
} from "@nukleus-sports/ui-web";
|
|
15
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
formatTeamName,
|
|
17
|
+
getTeamPlaceSummaries,
|
|
18
|
+
getTeamWebsiteHref
|
|
19
|
+
} from "@nukleus-sports/core";
|
|
16
20
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
21
|
function PlaceValueCell({ place }) {
|
|
18
22
|
if (!place.name) {
|
|
@@ -81,7 +85,7 @@ function TeamInfoCard({ team, resolveImageUrl, className }) {
|
|
|
81
85
|
/* @__PURE__ */ jsx("div", { className: "flex flex-col text-right", children: team.officialWebsite ? /* @__PURE__ */ jsxs(
|
|
82
86
|
"a",
|
|
83
87
|
{
|
|
84
|
-
href:
|
|
88
|
+
href: getTeamWebsiteHref(team.officialWebsite),
|
|
85
89
|
target: "_blank",
|
|
86
90
|
rel: "noopener noreferrer",
|
|
87
91
|
className: "text-primary-color-nuk-text body-text inline-flex items-center justify-end gap-1",
|
|
@@ -268,6 +272,7 @@ function TeamStaffTable({
|
|
|
268
272
|
coach_image_url: member.coach_image_url
|
|
269
273
|
},
|
|
270
274
|
resolveImageUrl,
|
|
275
|
+
preferInitials: true,
|
|
271
276
|
size: isCompact ? "xs" : "lg"
|
|
272
277
|
}
|
|
273
278
|
)
|
|
@@ -337,12 +342,252 @@ function TeamStaffTable({
|
|
|
337
342
|
) });
|
|
338
343
|
}
|
|
339
344
|
|
|
345
|
+
// src/team/team-roster-table.tsx
|
|
346
|
+
import { useMemo as useMemo2, useState as useState2 } from "react";
|
|
347
|
+
import {
|
|
348
|
+
BaseTable as BaseTable2,
|
|
349
|
+
createClickableSortableHeader as createClickableSortableHeader2,
|
|
350
|
+
useInfiniteList as useInfiniteList2,
|
|
351
|
+
cn as cn4
|
|
352
|
+
} from "@nukleus-sports/ui-web";
|
|
353
|
+
import {
|
|
354
|
+
getRosterCellValue,
|
|
355
|
+
getRosterColumns,
|
|
356
|
+
sortTeamPlayers
|
|
357
|
+
} from "@nukleus-sports/core";
|
|
358
|
+
import { Fragment, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
359
|
+
var DEFAULT_SORT2 = [{ id: "first_name", desc: false }];
|
|
360
|
+
var NO_SORT = [];
|
|
361
|
+
function cellSizeFor(key, isCompact) {
|
|
362
|
+
switch (key) {
|
|
363
|
+
case "first_name":
|
|
364
|
+
return isCompact ? "teamMobile" : "xl";
|
|
365
|
+
case "college":
|
|
366
|
+
case "birthplace":
|
|
367
|
+
case "hometown":
|
|
368
|
+
return "l";
|
|
369
|
+
default:
|
|
370
|
+
return "xxs";
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
function RosterNameCell({
|
|
374
|
+
player,
|
|
375
|
+
value,
|
|
376
|
+
rowClickable,
|
|
377
|
+
onPlayerClick,
|
|
378
|
+
isCompact,
|
|
379
|
+
resolveImageUrl
|
|
380
|
+
}) {
|
|
381
|
+
const content = /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
382
|
+
/* @__PURE__ */ jsx4(
|
|
383
|
+
EntityAvatar,
|
|
384
|
+
{
|
|
385
|
+
entityType: "player",
|
|
386
|
+
entityData: {
|
|
387
|
+
first_name: player.first_name,
|
|
388
|
+
last_name: player.last_name,
|
|
389
|
+
player_image_url: player.player_image_url
|
|
390
|
+
},
|
|
391
|
+
resolveImageUrl,
|
|
392
|
+
preferInitials: true,
|
|
393
|
+
size: "md",
|
|
394
|
+
className: isCompact ? "h-5 w-5" : "h-[34px] w-[34px]"
|
|
395
|
+
}
|
|
396
|
+
),
|
|
397
|
+
/* @__PURE__ */ jsx4("span", { className: "min-w-0 line-clamp-2 break-words", children: value })
|
|
398
|
+
] });
|
|
399
|
+
return rowClickable ? /* @__PURE__ */ jsx4(
|
|
400
|
+
"button",
|
|
401
|
+
{
|
|
402
|
+
type: "button",
|
|
403
|
+
className: "flex min-w-0 w-full items-center gap-2 text-left",
|
|
404
|
+
"aria-label": `View ${value}'s profile`,
|
|
405
|
+
onClick: (event) => {
|
|
406
|
+
event.stopPropagation();
|
|
407
|
+
onPlayerClick?.(player.id);
|
|
408
|
+
},
|
|
409
|
+
children: content
|
|
410
|
+
}
|
|
411
|
+
) : /* @__PURE__ */ jsx4("div", { className: "flex min-w-0 w-full items-center gap-2", children: content });
|
|
412
|
+
}
|
|
413
|
+
function splitGridCols(isCompact, isSplitLayout) {
|
|
414
|
+
if (isCompact) return "!grid-cols-[minmax(136px,136px)_1fr]";
|
|
415
|
+
return isSplitLayout ? "sm:!grid-cols-[minmax(220px,220px)_1fr]" : "";
|
|
416
|
+
}
|
|
417
|
+
function useRosterSorting({ sortable, sorting, onSortingChange }) {
|
|
418
|
+
const [internalSorting, setInternalSorting] = useState2(DEFAULT_SORT2);
|
|
419
|
+
const activeSorting = sortable ? sorting ?? internalSorting : NO_SORT;
|
|
420
|
+
const handleSortingChange = onSortingChange ?? setInternalSorting;
|
|
421
|
+
const tableSortingProps = sortable ? {
|
|
422
|
+
sorting: activeSorting,
|
|
423
|
+
manualSorting: true,
|
|
424
|
+
onSortingChange: ((updater) => {
|
|
425
|
+
const next = typeof updater === "function" ? updater(activeSorting) : updater;
|
|
426
|
+
handleSortingChange(next);
|
|
427
|
+
})
|
|
428
|
+
} : { manualSorting: false };
|
|
429
|
+
return { activeSorting, tableSortingProps };
|
|
430
|
+
}
|
|
431
|
+
function useRosterColumns({
|
|
432
|
+
leagueId,
|
|
433
|
+
sortable,
|
|
434
|
+
rowClickable,
|
|
435
|
+
onPlayerClick,
|
|
436
|
+
isCompact,
|
|
437
|
+
resolveImageUrl
|
|
438
|
+
}) {
|
|
439
|
+
return useMemo2(() => {
|
|
440
|
+
if (leagueId === null) return [];
|
|
441
|
+
const dataColumns = getRosterColumns(leagueId).map(
|
|
442
|
+
({ key, label }) => ({
|
|
443
|
+
id: key,
|
|
444
|
+
header: sortable ? createClickableSortableHeader2(label) : label,
|
|
445
|
+
accessorFn: (player) => getRosterCellValue(player, key, leagueId),
|
|
446
|
+
enableSorting: sortable,
|
|
447
|
+
enableMultiSort: false,
|
|
448
|
+
cell: ({ row }) => {
|
|
449
|
+
const player = row.original;
|
|
450
|
+
const value = getRosterCellValue(player, key, leagueId);
|
|
451
|
+
if (key !== "first_name") {
|
|
452
|
+
return /* @__PURE__ */ jsx4("div", { className: "flex items-center h-full min-h-[46px]", children: /* @__PURE__ */ jsx4("span", { className: "line-clamp-2 break-all", children: value }) });
|
|
453
|
+
}
|
|
454
|
+
return /* @__PURE__ */ jsx4(
|
|
455
|
+
RosterNameCell,
|
|
456
|
+
{
|
|
457
|
+
player,
|
|
458
|
+
value,
|
|
459
|
+
rowClickable,
|
|
460
|
+
onPlayerClick,
|
|
461
|
+
isCompact,
|
|
462
|
+
resolveImageUrl
|
|
463
|
+
}
|
|
464
|
+
);
|
|
465
|
+
},
|
|
466
|
+
meta: { cellSize: cellSizeFor(key, isCompact) }
|
|
467
|
+
})
|
|
468
|
+
);
|
|
469
|
+
return [
|
|
470
|
+
...dataColumns,
|
|
471
|
+
{
|
|
472
|
+
id: "empty",
|
|
473
|
+
header: "",
|
|
474
|
+
enableSorting: false,
|
|
475
|
+
cell: () => null,
|
|
476
|
+
meta: { cellSize: "" }
|
|
477
|
+
}
|
|
478
|
+
];
|
|
479
|
+
}, [leagueId, sortable, rowClickable, onPlayerClick, isCompact, resolveImageUrl]);
|
|
480
|
+
}
|
|
481
|
+
function TeamRosterTable({
|
|
482
|
+
players,
|
|
483
|
+
leagueId,
|
|
484
|
+
loading,
|
|
485
|
+
isError,
|
|
486
|
+
rowClickable = false,
|
|
487
|
+
onPlayerClick,
|
|
488
|
+
sortable = false,
|
|
489
|
+
sorting,
|
|
490
|
+
onSortingChange,
|
|
491
|
+
virtualized = false,
|
|
492
|
+
isSplitLayout = false,
|
|
493
|
+
isCompact = false,
|
|
494
|
+
resolveImageUrl,
|
|
495
|
+
className
|
|
496
|
+
}) {
|
|
497
|
+
const { activeSorting, tableSortingProps } = useRosterSorting({
|
|
498
|
+
sortable,
|
|
499
|
+
sorting,
|
|
500
|
+
onSortingChange
|
|
501
|
+
});
|
|
502
|
+
const sortedPlayers = useMemo2(
|
|
503
|
+
() => sortTeamPlayers(players, activeSorting, leagueId ?? void 0),
|
|
504
|
+
[players, activeSorting, leagueId]
|
|
505
|
+
);
|
|
506
|
+
const { visibleItems, sentinelRef, hasMore } = useInfiniteList2(sortedPlayers, {
|
|
507
|
+
resetKey: `${leagueId ?? ""}|${players.length}|${JSON.stringify(activeSorting)}`
|
|
508
|
+
});
|
|
509
|
+
const displayedPlayers = virtualized ? visibleItems : sortedPlayers;
|
|
510
|
+
const columns = useRosterColumns({
|
|
511
|
+
leagueId,
|
|
512
|
+
sortable,
|
|
513
|
+
rowClickable,
|
|
514
|
+
onPlayerClick,
|
|
515
|
+
isCompact,
|
|
516
|
+
resolveImageUrl
|
|
517
|
+
});
|
|
518
|
+
return /* @__PURE__ */ jsx4("div", { className: "w-full xl:flex xl:h-full xl:flex-1 xl:min-h-0 xl:flex-col xl:overflow-hidden", children: /* @__PURE__ */ jsx4(
|
|
519
|
+
BaseTable2,
|
|
520
|
+
{
|
|
521
|
+
columns,
|
|
522
|
+
data: displayedPlayers,
|
|
523
|
+
getRowId: (row) => String(row.id),
|
|
524
|
+
...tableSortingProps,
|
|
525
|
+
onRowClick: rowClickable ? (player) => onPlayerClick?.(player.id) : void 0,
|
|
526
|
+
loading,
|
|
527
|
+
emptyMessage: isError ? "Failed to load roster. Please try again." : "No roster found",
|
|
528
|
+
pageSize: Math.max(displayedPlayers.length, 25),
|
|
529
|
+
hidePagination: virtualized,
|
|
530
|
+
stickyHeader: true,
|
|
531
|
+
splitLayout: isSplitLayout,
|
|
532
|
+
numberOfColumns: 1,
|
|
533
|
+
splitLayoutGridCols: splitGridCols(isCompact, isSplitLayout),
|
|
534
|
+
containerClassName: cn4("border-0 rounded-none xl:h-full", virtualized && "h-full"),
|
|
535
|
+
className: cn4(
|
|
536
|
+
"border-none xl:flex-1 xl:min-h-0 xl:overflow-hidden",
|
|
537
|
+
virtualized && "h-full min-h-0 w-full",
|
|
538
|
+
className
|
|
539
|
+
),
|
|
540
|
+
bottomContent: virtualized && hasMore ? /* @__PURE__ */ jsx4("div", { ref: sentinelRef, className: "h-px w-full" }) : null
|
|
541
|
+
}
|
|
542
|
+
) });
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
// src/team/team-places-card.tsx
|
|
546
|
+
import { Fragment as Fragment2 } from "react";
|
|
547
|
+
import { Card as Card3, CardContent as CardContent3, cn as cn5 } from "@nukleus-sports/ui-web";
|
|
548
|
+
import { getTeamPlaceSummaries as getTeamPlaceSummaries2, getTeamWebsiteHref as getTeamWebsiteHref2 } from "@nukleus-sports/core";
|
|
549
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
550
|
+
function TeamPlacesCard({ team, className }) {
|
|
551
|
+
const { venue, facility } = getTeamPlaceSummaries2(team.specificData, team.leagueAbbreviation);
|
|
552
|
+
return /* @__PURE__ */ jsx5(Card3, { className: cn5("border-0", className), children: /* @__PURE__ */ jsx5(CardContent3, { className: "p-4", children: /* @__PURE__ */ jsxs5("div", { className: "grid h-full grid-cols-[auto_1fr] gap-x-3 gap-y-4 sm:gap-4", children: [
|
|
553
|
+
[venue, facility].map((place) => /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
554
|
+
/* @__PURE__ */ jsx5("div", { className: "flex flex-col max-sm:max-w-[96px]", children: /* @__PURE__ */ jsx5("p", { className: "mb-1 text-14.5 text-text-primary sm:text-base", children: place.label }) }),
|
|
555
|
+
/* @__PURE__ */ jsx5("div", { className: "flex flex-col break-words text-right max-sm:min-w-0", children: place.name ? /* @__PURE__ */ jsxs5("div", { className: "text-14.5 sm:text-base", children: [
|
|
556
|
+
/* @__PURE__ */ jsx5("p", { children: place.name }),
|
|
557
|
+
place.address ? /* @__PURE__ */ jsx5("p", { children: place.address }) : /* @__PURE__ */ jsx5("p", { className: "text-muted-foreground", children: "No address available" })
|
|
558
|
+
] }) : /* @__PURE__ */ jsx5("p", { className: "text-14.5 text-muted-foreground sm:text-base", children: "No address available" }) })
|
|
559
|
+
] }, place.label)),
|
|
560
|
+
/* @__PURE__ */ jsx5("div", { className: "flex flex-col max-sm:max-w-[96px]", children: /* @__PURE__ */ jsx5("p", { className: "mb-1 text-14.5 text-text-primary sm:text-base", children: "Website" }) }),
|
|
561
|
+
/* @__PURE__ */ jsx5("div", { className: "flex flex-col break-words text-right max-sm:min-w-0", children: team.officialWebsite ? /* @__PURE__ */ jsxs5(
|
|
562
|
+
"a",
|
|
563
|
+
{
|
|
564
|
+
href: getTeamWebsiteHref2(team.officialWebsite),
|
|
565
|
+
target: "_blank",
|
|
566
|
+
rel: "noopener noreferrer",
|
|
567
|
+
className: "inline-flex items-center justify-end gap-1 text-14.5 text-primary-color-nuk-text sm:text-base",
|
|
568
|
+
children: [
|
|
569
|
+
team.officialWebsite.replace(/^https?:\/\//i, ""),
|
|
570
|
+
/* @__PURE__ */ jsx5("svg", { className: "h-3 w-3", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5(
|
|
571
|
+
"path",
|
|
572
|
+
{
|
|
573
|
+
strokeLinecap: "round",
|
|
574
|
+
strokeLinejoin: "round",
|
|
575
|
+
strokeWidth: 2,
|
|
576
|
+
d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
|
|
577
|
+
}
|
|
578
|
+
) })
|
|
579
|
+
]
|
|
580
|
+
}
|
|
581
|
+
) : /* @__PURE__ */ jsx5("p", { className: "text-14.5 text-muted-foreground sm:text-base", children: "No website available" }) })
|
|
582
|
+
] }) }) });
|
|
583
|
+
}
|
|
584
|
+
|
|
340
585
|
// src/team/stat-column.tsx
|
|
341
|
-
import { jsx as
|
|
586
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
342
587
|
function StatColumn({ label, value, suffix, rankBadge }) {
|
|
343
|
-
return /* @__PURE__ */
|
|
344
|
-
/* @__PURE__ */
|
|
345
|
-
/* @__PURE__ */
|
|
588
|
+
return /* @__PURE__ */ jsxs6("div", { className: "flex flex-col items-center h-full justify-center flex-1 gap-1 sm:gap-3 w-full", children: [
|
|
589
|
+
/* @__PURE__ */ jsx6("span", { className: "label-xs-medium text-text-secondary leading-normal opacity-[0.8] ss05", children: label }),
|
|
590
|
+
/* @__PURE__ */ jsxs6("span", { className: "text-[19px] font-semibold sm:text-[32px] sm:font-bold text-text-primary leading-normal title-text opacity-[0.8]", children: [
|
|
346
591
|
value,
|
|
347
592
|
suffix || ""
|
|
348
593
|
] }),
|
|
@@ -351,12 +596,12 @@ function StatColumn({ label, value, suffix, rankBadge }) {
|
|
|
351
596
|
}
|
|
352
597
|
|
|
353
598
|
// src/team/team-season-stats-summary-panel.tsx
|
|
354
|
-
import { Card as
|
|
599
|
+
import { Card as Card4, CardContent as CardContent4, CardHeader, CardTitle, Skeleton, cn as cn6 } from "@nukleus-sports/ui-web";
|
|
355
600
|
import {
|
|
356
601
|
getTeamStatColumns,
|
|
357
602
|
isSupportedTeamStatsSport
|
|
358
603
|
} from "@nukleus-sports/core";
|
|
359
|
-
import { jsx as
|
|
604
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
360
605
|
function getStatusMessage({
|
|
361
606
|
isSupportedSport,
|
|
362
607
|
selectedYear,
|
|
@@ -387,9 +632,9 @@ function TeamSeasonStatsSummaryPanel({
|
|
|
387
632
|
isError,
|
|
388
633
|
stats
|
|
389
634
|
});
|
|
390
|
-
return /* @__PURE__ */
|
|
391
|
-
/* @__PURE__ */
|
|
392
|
-
/* @__PURE__ */
|
|
635
|
+
return /* @__PURE__ */ jsxs7(Card4, { className: cn6("border-0 p-4 flex flex-col gap-4", className), children: [
|
|
636
|
+
/* @__PURE__ */ jsx7(CardHeader, { className: "p-0", children: /* @__PURE__ */ jsx7(CardTitle, { className: "text-base text-text-primary font-medium leading-normal", children: "Season Stats" }) }),
|
|
637
|
+
/* @__PURE__ */ jsx7(CardContent4, { className: "p-0 flex-1 flex justify-center items-center", children: loading ? /* @__PURE__ */ jsx7("div", { className: "flex items-center justify-center w-full", children: /* @__PURE__ */ jsx7(Skeleton, { className: "h-4 w-3/4" }) }) : statusMessage ? /* @__PURE__ */ jsx7("div", { className: "flex items-center justify-center w-full text-14.5 text-text-secondary", children: statusMessage }) : stats && /* @__PURE__ */ jsx7("div", { className: "w-full flex flex-col sm:flex-row gap-6 sm:gap-3 justify-between items-center", children: columns.map((col, i) => /* @__PURE__ */ jsx7(
|
|
393
638
|
StatColumn,
|
|
394
639
|
{
|
|
395
640
|
label: col.label,
|
|
@@ -402,8 +647,8 @@ function TeamSeasonStatsSummaryPanel({
|
|
|
402
647
|
}
|
|
403
648
|
|
|
404
649
|
// src/team/team-season-schedule-summary-panel.tsx
|
|
405
|
-
import { Card as
|
|
406
|
-
import { jsx as
|
|
650
|
+
import { Card as Card5, CardContent as CardContent5, CardHeader as CardHeader2, CardTitle as CardTitle2, Skeleton as Skeleton2, cn as cn7 } from "@nukleus-sports/ui-web";
|
|
651
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
407
652
|
function TeamSeasonScheduleSummaryPanel({
|
|
408
653
|
selectedYear,
|
|
409
654
|
selectedType,
|
|
@@ -412,11 +657,11 @@ function TeamSeasonScheduleSummaryPanel({
|
|
|
412
657
|
isError,
|
|
413
658
|
className
|
|
414
659
|
}) {
|
|
415
|
-
return /* @__PURE__ */
|
|
416
|
-
/* @__PURE__ */
|
|
417
|
-
/* @__PURE__ */
|
|
418
|
-
/* @__PURE__ */
|
|
419
|
-
/* @__PURE__ */
|
|
660
|
+
return /* @__PURE__ */ jsxs8(Card5, { className: cn7("border-0 p-4 flex flex-col gap-4", className), children: [
|
|
661
|
+
/* @__PURE__ */ jsx8(CardHeader2, { className: "p-0", children: /* @__PURE__ */ jsx8(CardTitle2, { className: "text-base text-text-primary font-medium leading-normal", children: "Season Summary" }) }),
|
|
662
|
+
/* @__PURE__ */ jsx8(CardContent5, { className: "p-0 flex-1 flex justify-center items-center", children: loading ? /* @__PURE__ */ jsx8("div", { className: "flex items-center justify-center w-full", children: /* @__PURE__ */ jsx8(Skeleton2, { className: "h-4 w-3/4" }) }) : !selectedYear || selectedType === null ? /* @__PURE__ */ jsx8("div", { className: "flex items-center justify-center w-full text-14.5 text-text-secondary", children: "Select a season to view summary." }) : isError && !summary ? /* @__PURE__ */ jsx8("div", { className: "flex items-center justify-center w-full text-14.5 text-text-secondary", children: "Couldn't load the schedule summary. Please try again." }) : !summary ? /* @__PURE__ */ jsx8("div", { className: "flex items-center justify-center w-full text-14.5 text-text-secondary", children: "No schedule data for the current season." }) : /* @__PURE__ */ jsxs8("div", { className: "w-full flex flex-col sm:flex-row gap-6 sm:gap-3 justify-between items-center", children: [
|
|
663
|
+
/* @__PURE__ */ jsx8(StatColumn, { label: "Record", value: summary.record }),
|
|
664
|
+
/* @__PURE__ */ jsx8(
|
|
420
665
|
StatColumn,
|
|
421
666
|
{
|
|
422
667
|
label: "Games Played",
|
|
@@ -434,9 +679,9 @@ import {
|
|
|
434
679
|
SelectItem,
|
|
435
680
|
SelectTrigger,
|
|
436
681
|
SelectValue,
|
|
437
|
-
cn as
|
|
682
|
+
cn as cn8
|
|
438
683
|
} from "@nukleus-sports/ui-web";
|
|
439
|
-
import { jsx as
|
|
684
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
440
685
|
function SeasonSelector({
|
|
441
686
|
years,
|
|
442
687
|
types,
|
|
@@ -447,39 +692,39 @@ function SeasonSelector({
|
|
|
447
692
|
hideTypeOnMobile = false,
|
|
448
693
|
className
|
|
449
694
|
}) {
|
|
450
|
-
return /* @__PURE__ */
|
|
451
|
-
/* @__PURE__ */
|
|
695
|
+
return /* @__PURE__ */ jsxs9("div", { className: cn8("flex gap-3", className), children: [
|
|
696
|
+
/* @__PURE__ */ jsxs9(
|
|
452
697
|
Select,
|
|
453
698
|
{
|
|
454
699
|
value: selectedYear?.toString() ?? "",
|
|
455
700
|
onValueChange: (value) => onYearChange(Number(value)),
|
|
456
701
|
children: [
|
|
457
|
-
/* @__PURE__ */
|
|
458
|
-
/* @__PURE__ */
|
|
702
|
+
/* @__PURE__ */ jsx9(SelectTrigger, { variant: "widget", size: "widget", "aria-label": "Season year", children: /* @__PURE__ */ jsx9(SelectValue, { placeholder: "Select year" }) }),
|
|
703
|
+
/* @__PURE__ */ jsx9(
|
|
459
704
|
SelectContent,
|
|
460
705
|
{
|
|
461
706
|
className: "bg-card border-border z-50 [&_.checkbox]:!flex",
|
|
462
707
|
classNameViewPort: "gap-2",
|
|
463
|
-
children: years.map((year) => /* @__PURE__ */
|
|
708
|
+
children: years.map((year) => /* @__PURE__ */ jsx9(SelectItem, { value: year.value.toString(), className: "min-h-8", children: year.label }, year.value))
|
|
464
709
|
}
|
|
465
710
|
)
|
|
466
711
|
]
|
|
467
712
|
}
|
|
468
713
|
),
|
|
469
|
-
/* @__PURE__ */
|
|
714
|
+
/* @__PURE__ */ jsx9("div", { className: cn8(hideTypeOnMobile && "hidden sm:block"), children: /* @__PURE__ */ jsxs9(
|
|
470
715
|
Select,
|
|
471
716
|
{
|
|
472
717
|
value: selectedType?.toString() ?? "",
|
|
473
718
|
onValueChange: (value) => onTypeChange(Number(value)),
|
|
474
719
|
disabled: selectedYear === null,
|
|
475
720
|
children: [
|
|
476
|
-
/* @__PURE__ */
|
|
477
|
-
/* @__PURE__ */
|
|
721
|
+
/* @__PURE__ */ jsx9(SelectTrigger, { variant: "widget", size: "widget", "aria-label": "Season type", children: /* @__PURE__ */ jsx9(SelectValue, { placeholder: "Select type" }) }),
|
|
722
|
+
/* @__PURE__ */ jsx9(
|
|
478
723
|
SelectContent,
|
|
479
724
|
{
|
|
480
725
|
className: "bg-card border-border z-50 [&_.checkbox]:!flex",
|
|
481
726
|
classNameViewPort: "gap-2",
|
|
482
|
-
children: types.map((type) => /* @__PURE__ */
|
|
727
|
+
children: types.map((type) => /* @__PURE__ */ jsx9(SelectItem, { value: type.value.toString(), className: "min-h-8", children: type.label }, type.value))
|
|
483
728
|
}
|
|
484
729
|
)
|
|
485
730
|
]
|
|
@@ -489,9 +734,9 @@ function SeasonSelector({
|
|
|
489
734
|
}
|
|
490
735
|
|
|
491
736
|
// src/team/fact-pills.tsx
|
|
492
|
-
import { useId, useLayoutEffect, useRef, useState as
|
|
493
|
-
import { cn as
|
|
494
|
-
import { jsx as
|
|
737
|
+
import { useId, useLayoutEffect, useRef, useState as useState3 } from "react";
|
|
738
|
+
import { cn as cn9 } from "@nukleus-sports/ui-web";
|
|
739
|
+
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
495
740
|
var MAX_ROWS = 2;
|
|
496
741
|
var KEY_SEPARATOR = "";
|
|
497
742
|
var PILL_CLASS = "flex min-w-0 max-w-full shrink-0 items-center justify-center rounded-[6px] bg-greys-background-hover px-2 py-0.5 label-xs-table font-ss02-ss05 text-text-primary";
|
|
@@ -508,10 +753,10 @@ function pillKeys(items) {
|
|
|
508
753
|
function FactPills({ items, capped = false }) {
|
|
509
754
|
const listId = useId();
|
|
510
755
|
const listRef = useRef(null);
|
|
511
|
-
const [expanded, setExpanded] =
|
|
512
|
-
const [visibleCount, setVisibleCount] =
|
|
513
|
-
const [clipHeight, setClipHeight] =
|
|
514
|
-
const [width, setWidth] =
|
|
756
|
+
const [expanded, setExpanded] = useState3(false);
|
|
757
|
+
const [visibleCount, setVisibleCount] = useState3(null);
|
|
758
|
+
const [clipHeight, setClipHeight] = useState3(null);
|
|
759
|
+
const [width, setWidth] = useState3(0);
|
|
515
760
|
const contentKey = items.join(KEY_SEPARATOR);
|
|
516
761
|
const keys = pillKeys(items);
|
|
517
762
|
const collapsible = capped && !expanded;
|
|
@@ -526,7 +771,7 @@ function FactPills({ items, capped = false }) {
|
|
|
526
771
|
return () => observer.disconnect();
|
|
527
772
|
}, [capped]);
|
|
528
773
|
const measurementKey = `${width}:${contentKey}`;
|
|
529
|
-
const [measuredFor, setMeasuredFor] =
|
|
774
|
+
const [measuredFor, setMeasuredFor] = useState3(measurementKey);
|
|
530
775
|
if (measuredFor !== measurementKey) {
|
|
531
776
|
setMeasuredFor(measurementKey);
|
|
532
777
|
if (visibleCount !== null) setVisibleCount(null);
|
|
@@ -562,19 +807,19 @@ function FactPills({ items, capped = false }) {
|
|
|
562
807
|
setExpanded(false);
|
|
563
808
|
setVisibleCount(null);
|
|
564
809
|
};
|
|
565
|
-
return /* @__PURE__ */
|
|
810
|
+
return /* @__PURE__ */ jsxs10(
|
|
566
811
|
"ul",
|
|
567
812
|
{
|
|
568
813
|
id: listId,
|
|
569
814
|
ref: listRef,
|
|
570
|
-
className:
|
|
815
|
+
className: cn9(
|
|
571
816
|
"flex w-full flex-wrap content-start items-start gap-1",
|
|
572
817
|
collapsible && "overflow-hidden"
|
|
573
818
|
),
|
|
574
819
|
style: collapsible && clipHeight !== null ? { maxHeight: clipHeight } : void 0,
|
|
575
820
|
children: [
|
|
576
|
-
items.slice(0, shownCount).map((item, index) => /* @__PURE__ */
|
|
577
|
-
truncated && /* @__PURE__ */
|
|
821
|
+
items.slice(0, shownCount).map((item, index) => /* @__PURE__ */ jsx10("li", { className: PILL_CLASS, title: String(item), children: /* @__PURE__ */ jsx10("span", { className: "truncate", children: item }) }, keys[index])),
|
|
822
|
+
truncated && /* @__PURE__ */ jsx10("li", { className: "flex shrink-0", children: /* @__PURE__ */ jsx10(
|
|
578
823
|
"button",
|
|
579
824
|
{
|
|
580
825
|
type: "button",
|
|
@@ -585,7 +830,7 @@ function FactPills({ items, capped = false }) {
|
|
|
585
830
|
children: "Show More"
|
|
586
831
|
}
|
|
587
832
|
) }),
|
|
588
|
-
capped && expanded && /* @__PURE__ */
|
|
833
|
+
capped && expanded && /* @__PURE__ */ jsx10("li", { className: "flex shrink-0", children: /* @__PURE__ */ jsx10(
|
|
589
834
|
"button",
|
|
590
835
|
{
|
|
591
836
|
type: "button",
|
|
@@ -602,7 +847,7 @@ function FactPills({ items, capped = false }) {
|
|
|
602
847
|
}
|
|
603
848
|
|
|
604
849
|
// src/team/fact-field.tsx
|
|
605
|
-
import { Skeleton as Skeleton3, cn as
|
|
850
|
+
import { Skeleton as Skeleton3, cn as cn10 } from "@nukleus-sports/ui-web";
|
|
606
851
|
import {
|
|
607
852
|
EMPTY_FACT_VALUE,
|
|
608
853
|
formatTeamFactNumber,
|
|
@@ -610,7 +855,7 @@ import {
|
|
|
610
855
|
TEAM_FACT_KINDS,
|
|
611
856
|
TEAM_FACT_YEAR_PAIRS
|
|
612
857
|
} from "@nukleus-sports/core";
|
|
613
|
-
import { Fragment, jsx as
|
|
858
|
+
import { Fragment as Fragment3, jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
614
859
|
function numberFact(facts, key) {
|
|
615
860
|
const value = facts[key];
|
|
616
861
|
return typeof value === "number" ? value : null;
|
|
@@ -624,10 +869,10 @@ function textFact(facts, key) {
|
|
|
624
869
|
return typeof value === "string" ? value : null;
|
|
625
870
|
}
|
|
626
871
|
function EmptyValue({ children = EMPTY_FACT_VALUE }) {
|
|
627
|
-
return /* @__PURE__ */
|
|
872
|
+
return /* @__PURE__ */ jsx11("span", { className: "body-text font-ss02-ss05 text-text-secondary", children });
|
|
628
873
|
}
|
|
629
874
|
function FieldLabel({ children }) {
|
|
630
|
-
return /* @__PURE__ */
|
|
875
|
+
return /* @__PURE__ */ jsx11("span", { className: "w-full label-xs-text font-ss02-ss05 text-text-secondary", children });
|
|
631
876
|
}
|
|
632
877
|
function CountFact({
|
|
633
878
|
factKey,
|
|
@@ -636,10 +881,10 @@ function CountFact({
|
|
|
636
881
|
const { facts, config } = data;
|
|
637
882
|
const pairedYears = TEAM_FACT_YEAR_PAIRS[factKey];
|
|
638
883
|
const years = pairedYears ? formatYearPills(listFact(facts, pairedYears), config.formatChampionshipYear) : [];
|
|
639
|
-
return /* @__PURE__ */
|
|
640
|
-
/* @__PURE__ */
|
|
641
|
-
/* @__PURE__ */
|
|
642
|
-
years.length > 0 && /* @__PURE__ */
|
|
884
|
+
return /* @__PURE__ */ jsxs11("div", { className: "flex min-w-0 flex-col items-start gap-1", children: [
|
|
885
|
+
/* @__PURE__ */ jsx11(FieldLabel, { children: config.labels[factKey] }),
|
|
886
|
+
/* @__PURE__ */ jsx11("span", { className: "stat-count-number title-text text-text-primary", children: formatTeamFactNumber("count", numberFact(facts, factKey)) }),
|
|
887
|
+
years.length > 0 && /* @__PURE__ */ jsx11(FactPills, { items: years, capped: true })
|
|
643
888
|
] });
|
|
644
889
|
}
|
|
645
890
|
function RivalValue({
|
|
@@ -649,14 +894,14 @@ function RivalValue({
|
|
|
649
894
|
}) {
|
|
650
895
|
switch (rival.status) {
|
|
651
896
|
case "none":
|
|
652
|
-
return /* @__PURE__ */
|
|
897
|
+
return /* @__PURE__ */ jsx11(EmptyValue, {});
|
|
653
898
|
case "loading":
|
|
654
|
-
return /* @__PURE__ */
|
|
899
|
+
return /* @__PURE__ */ jsx11(Skeleton3, { className: "h-8 w-40", "aria-label": "Loading rival" });
|
|
655
900
|
case "error":
|
|
656
|
-
return /* @__PURE__ */
|
|
901
|
+
return /* @__PURE__ */ jsx11(EmptyValue, { children: "Couldn't load the rival team" });
|
|
657
902
|
case "ready": {
|
|
658
|
-
const content = /* @__PURE__ */
|
|
659
|
-
/* @__PURE__ */
|
|
903
|
+
const content = /* @__PURE__ */ jsxs11(Fragment3, { children: [
|
|
904
|
+
/* @__PURE__ */ jsx11(
|
|
660
905
|
EntityAvatar,
|
|
661
906
|
{
|
|
662
907
|
entityType: "initials",
|
|
@@ -667,10 +912,10 @@ function RivalValue({
|
|
|
667
912
|
className: "shrink-0"
|
|
668
913
|
}
|
|
669
914
|
),
|
|
670
|
-
/* @__PURE__ */
|
|
915
|
+
/* @__PURE__ */ jsx11("span", { className: "min-w-0", children: rival.rival.name })
|
|
671
916
|
] });
|
|
672
917
|
const className = "inline-flex max-w-full items-center gap-1.5 body-text-semibold font-ss02-ss05 text-primary-color-nuk-text";
|
|
673
|
-
return getRivalHref ? /* @__PURE__ */
|
|
918
|
+
return getRivalHref ? /* @__PURE__ */ jsx11("a", { href: getRivalHref(rival.rival.id), className: cn10(className, "hover:underline"), children: content }) : /* @__PURE__ */ jsx11("span", { className, children: content });
|
|
674
919
|
}
|
|
675
920
|
}
|
|
676
921
|
}
|
|
@@ -680,10 +925,10 @@ function factValue(factKey, layout, data, resolveImageUrl, getRivalHref) {
|
|
|
680
925
|
if (kind === "number" || kind === "year" || kind === "text") {
|
|
681
926
|
const display = kind === "text" ? textFact(facts, factKey) : formatTeamFactNumber(kind, numberFact(facts, factKey));
|
|
682
927
|
const isEmpty = !display || display === EMPTY_FACT_VALUE;
|
|
683
|
-
return /* @__PURE__ */
|
|
928
|
+
return /* @__PURE__ */ jsx11(
|
|
684
929
|
"span",
|
|
685
930
|
{
|
|
686
|
-
className:
|
|
931
|
+
className: cn10(
|
|
687
932
|
"w-full header-xl-medium-card font-ss02-ss05 [overflow-wrap:anywhere]",
|
|
688
933
|
isEmpty ? "text-text-secondary" : "text-text-primary"
|
|
689
934
|
),
|
|
@@ -694,10 +939,10 @@ function factValue(factKey, layout, data, resolveImageUrl, getRivalHref) {
|
|
|
694
939
|
if (kind === "years" || kind === "labeled_years" || kind === "list") {
|
|
695
940
|
const raw = listFact(facts, factKey);
|
|
696
941
|
const items = kind === "years" ? formatYearPills(raw, config.formatChampionshipYear) : raw;
|
|
697
|
-
return items.length > 0 ? /* @__PURE__ */
|
|
942
|
+
return items.length > 0 ? /* @__PURE__ */ jsx11(FactPills, { items, capped: layout === "grid" }) : /* @__PURE__ */ jsx11(EmptyValue, {});
|
|
698
943
|
}
|
|
699
944
|
if (kind === "rival") {
|
|
700
|
-
return /* @__PURE__ */
|
|
945
|
+
return /* @__PURE__ */ jsx11(
|
|
701
946
|
RivalValue,
|
|
702
947
|
{
|
|
703
948
|
rival: data.rival,
|
|
@@ -707,10 +952,10 @@ function factValue(factKey, layout, data, resolveImageUrl, getRivalHref) {
|
|
|
707
952
|
);
|
|
708
953
|
}
|
|
709
954
|
const text = textFact(facts, factKey);
|
|
710
|
-
return /* @__PURE__ */
|
|
955
|
+
return /* @__PURE__ */ jsx11(
|
|
711
956
|
"p",
|
|
712
957
|
{
|
|
713
|
-
className:
|
|
958
|
+
className: cn10(
|
|
714
959
|
"w-full body-text font-ss02-ss05 whitespace-pre-line",
|
|
715
960
|
text ? "text-text-primary" : "text-text-secondary"
|
|
716
961
|
),
|
|
@@ -726,17 +971,17 @@ function FactField({
|
|
|
726
971
|
getRivalHref
|
|
727
972
|
}) {
|
|
728
973
|
const kind = TEAM_FACT_KINDS[factKey];
|
|
729
|
-
if (kind === "count") return /* @__PURE__ */
|
|
730
|
-
return /* @__PURE__ */
|
|
974
|
+
if (kind === "count") return /* @__PURE__ */ jsx11(CountFact, { factKey, data });
|
|
975
|
+
return /* @__PURE__ */ jsxs11(
|
|
731
976
|
"div",
|
|
732
977
|
{
|
|
733
|
-
className:
|
|
978
|
+
className: cn10(
|
|
734
979
|
"flex min-w-0 flex-col items-start gap-1.5",
|
|
735
980
|
layout === "row" && "flex-1",
|
|
736
981
|
layout === "grid" && kind !== "list" && "gap-1"
|
|
737
982
|
),
|
|
738
983
|
children: [
|
|
739
|
-
/* @__PURE__ */
|
|
984
|
+
/* @__PURE__ */ jsx11(FieldLabel, { children: data.config.labels[factKey] }),
|
|
740
985
|
factValue(factKey, layout, data, resolveImageUrl, getRivalHref)
|
|
741
986
|
]
|
|
742
987
|
}
|
|
@@ -744,16 +989,16 @@ function FactField({
|
|
|
744
989
|
}
|
|
745
990
|
|
|
746
991
|
// src/team/venue-photo.tsx
|
|
747
|
-
import { useState as
|
|
748
|
-
import { cn as
|
|
992
|
+
import { useState as useState4 } from "react";
|
|
993
|
+
import { cn as cn11 } from "@nukleus-sports/ui-web";
|
|
749
994
|
import { XsViewInvoiceIcon } from "@nukleus-sports/icons";
|
|
750
995
|
import { facilityImageCredit } from "@nukleus-sports/core";
|
|
751
|
-
import { jsx as
|
|
996
|
+
import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
752
997
|
var PHOTO_WIDTHS = [640, 960, 1280];
|
|
753
998
|
var PHOTO_SIZES = "(min-width: 1280px) 420px, 100vw";
|
|
754
999
|
var LINK_CLASS = "inline-flex shrink-0 items-center gap-1 hover:text-text-primary";
|
|
755
1000
|
function NewTabNote() {
|
|
756
|
-
return /* @__PURE__ */
|
|
1001
|
+
return /* @__PURE__ */ jsx12("span", { className: "sr-only", children: " (opens in a new tab)" });
|
|
757
1002
|
}
|
|
758
1003
|
function resolvePhotoSources(path, resolveImageUrl) {
|
|
759
1004
|
const candidates = PHOTO_WIDTHS.flatMap((width) => {
|
|
@@ -768,18 +1013,18 @@ function resolvePhotoSources(path, resolveImageUrl) {
|
|
|
768
1013
|
}
|
|
769
1014
|
function VenueNameOnly({ name, label }) {
|
|
770
1015
|
if (!name) return null;
|
|
771
|
-
return /* @__PURE__ */
|
|
772
|
-
/* @__PURE__ */
|
|
773
|
-
/* @__PURE__ */
|
|
1016
|
+
return /* @__PURE__ */ jsxs12("div", { className: "flex min-w-0 flex-col items-start gap-1.5", children: [
|
|
1017
|
+
/* @__PURE__ */ jsx12(FieldLabel, { children: label }),
|
|
1018
|
+
/* @__PURE__ */ jsx12("span", { className: "w-full header-xl-medium-card font-ss02-ss05 text-text-primary", children: name })
|
|
774
1019
|
] });
|
|
775
1020
|
}
|
|
776
1021
|
function PhotoCaption({ name, image }) {
|
|
777
1022
|
const credit = facilityImageCredit(image);
|
|
778
|
-
return /* @__PURE__ */
|
|
779
|
-
name && /* @__PURE__ */
|
|
780
|
-
/* @__PURE__ */
|
|
781
|
-
/* @__PURE__ */
|
|
782
|
-
image.sourceUrl && /* @__PURE__ */
|
|
1023
|
+
return /* @__PURE__ */ jsxs12("figcaption", { className: "flex w-full flex-col gap-1 xxs-body-text font-ss02-ss05", children: [
|
|
1024
|
+
name && /* @__PURE__ */ jsx12("span", { className: "w-full text-text-primary", children: name }),
|
|
1025
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex w-full items-start gap-2 text-greys-text-secondary", children: [
|
|
1026
|
+
/* @__PURE__ */ jsx12("span", { className: "min-w-0 flex-1", children: credit ? `Photo: ${credit}` : "Photo from Wikimedia Commons" }),
|
|
1027
|
+
image.sourceUrl && /* @__PURE__ */ jsxs12(
|
|
783
1028
|
"a",
|
|
784
1029
|
{
|
|
785
1030
|
href: image.sourceUrl,
|
|
@@ -788,8 +1033,8 @@ function PhotoCaption({ name, image }) {
|
|
|
788
1033
|
className: LINK_CLASS,
|
|
789
1034
|
children: [
|
|
790
1035
|
"Source",
|
|
791
|
-
/* @__PURE__ */
|
|
792
|
-
/* @__PURE__ */
|
|
1036
|
+
/* @__PURE__ */ jsx12(NewTabNote, {}),
|
|
1037
|
+
/* @__PURE__ */ jsx12("span", { "aria-hidden": "true", className: "flex shrink-0", children: /* @__PURE__ */ jsx12(
|
|
793
1038
|
XsViewInvoiceIcon,
|
|
794
1039
|
{
|
|
795
1040
|
width: 16,
|
|
@@ -800,7 +1045,7 @@ function PhotoCaption({ name, image }) {
|
|
|
800
1045
|
]
|
|
801
1046
|
}
|
|
802
1047
|
),
|
|
803
|
-
image.licenseUrl && /* @__PURE__ */
|
|
1048
|
+
image.licenseUrl && /* @__PURE__ */ jsxs12(
|
|
804
1049
|
"a",
|
|
805
1050
|
{
|
|
806
1051
|
href: image.licenseUrl,
|
|
@@ -809,7 +1054,7 @@ function PhotoCaption({ name, image }) {
|
|
|
809
1054
|
className: LINK_CLASS,
|
|
810
1055
|
children: [
|
|
811
1056
|
"License",
|
|
812
|
-
/* @__PURE__ */
|
|
1057
|
+
/* @__PURE__ */ jsx12(NewTabNote, {})
|
|
813
1058
|
]
|
|
814
1059
|
}
|
|
815
1060
|
)
|
|
@@ -818,14 +1063,14 @@ function PhotoCaption({ name, image }) {
|
|
|
818
1063
|
}
|
|
819
1064
|
function VenuePhoto({ venue, label, resolveImageUrl }) {
|
|
820
1065
|
const { name, image } = venue;
|
|
821
|
-
const [failed, setFailed] =
|
|
822
|
-
const [isLoaded, setIsLoaded] =
|
|
1066
|
+
const [failed, setFailed] = useState4("none");
|
|
1067
|
+
const [isLoaded, setIsLoaded] = useState4(false);
|
|
823
1068
|
const sources = image && resolveImageUrl ? resolvePhotoSources(image.path, resolveImageUrl) : null;
|
|
824
1069
|
const useResized = failed === "none" && Boolean(sources?.srcSet);
|
|
825
1070
|
const src = failed === "all" ? void 0 : useResized ? sources?.resized : sources?.original;
|
|
826
|
-
if (!image || !src) return /* @__PURE__ */
|
|
827
|
-
return /* @__PURE__ */
|
|
828
|
-
/* @__PURE__ */
|
|
1071
|
+
if (!image || !src) return /* @__PURE__ */ jsx12(VenueNameOnly, { name, label });
|
|
1072
|
+
return /* @__PURE__ */ jsxs12("figure", { className: "flex w-full flex-col gap-3", children: [
|
|
1073
|
+
/* @__PURE__ */ jsx12(
|
|
829
1074
|
"img",
|
|
830
1075
|
{
|
|
831
1076
|
src,
|
|
@@ -834,14 +1079,14 @@ function VenuePhoto({ venue, label, resolveImageUrl }) {
|
|
|
834
1079
|
onLoad: () => setIsLoaded(true),
|
|
835
1080
|
onError: () => setFailed(useResized ? "resized" : "all"),
|
|
836
1081
|
alt: name ?? label,
|
|
837
|
-
className:
|
|
1082
|
+
className: cn11(
|
|
838
1083
|
"h-[150px] w-full rounded-[8px] bg-greys-background-hover object-cover",
|
|
839
1084
|
!isLoaded && "animate-pulse"
|
|
840
1085
|
),
|
|
841
1086
|
loading: "lazy"
|
|
842
1087
|
}
|
|
843
1088
|
),
|
|
844
|
-
/* @__PURE__ */
|
|
1089
|
+
/* @__PURE__ */ jsx12(PhotoCaption, { name, image })
|
|
845
1090
|
] });
|
|
846
1091
|
}
|
|
847
1092
|
|
|
@@ -849,7 +1094,7 @@ function VenuePhoto({ venue, label, resolveImageUrl }) {
|
|
|
849
1094
|
import {
|
|
850
1095
|
teamFactsDisplayFields
|
|
851
1096
|
} from "@nukleus-sports/core";
|
|
852
|
-
import { jsx as
|
|
1097
|
+
import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
853
1098
|
var SECTION_FIELDS_CLASS = {
|
|
854
1099
|
grid: "grid grid-cols-2 items-start gap-3",
|
|
855
1100
|
row: "flex items-start gap-3",
|
|
@@ -866,7 +1111,7 @@ function TeamFactsContent({
|
|
|
866
1111
|
getRivalHref
|
|
867
1112
|
}) {
|
|
868
1113
|
const { config, venue, hasFacts } = data;
|
|
869
|
-
const photo = /* @__PURE__ */
|
|
1114
|
+
const photo = /* @__PURE__ */ jsx13(
|
|
870
1115
|
VenuePhoto,
|
|
871
1116
|
{
|
|
872
1117
|
venue,
|
|
@@ -876,14 +1121,14 @@ function TeamFactsContent({
|
|
|
876
1121
|
venue.image?.path ?? "none"
|
|
877
1122
|
);
|
|
878
1123
|
if (!hasFacts) {
|
|
879
|
-
return /* @__PURE__ */
|
|
880
|
-
/* @__PURE__ */
|
|
881
|
-
(venue.image || venue.name) && /* @__PURE__ */
|
|
1124
|
+
return /* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-3", children: [
|
|
1125
|
+
/* @__PURE__ */ jsx13("div", { className: "flex h-[120px] items-center justify-center rounded-[10px] border border-dashed border-greys-grey-strokes-tables text-14.5 text-text-secondary", children: "No team facts yet." }),
|
|
1126
|
+
(venue.image || venue.name) && /* @__PURE__ */ jsx13("section", { className: SECTION_CLASS, children: photo })
|
|
882
1127
|
] });
|
|
883
1128
|
}
|
|
884
|
-
return /* @__PURE__ */
|
|
885
|
-
/* @__PURE__ */
|
|
886
|
-
/* @__PURE__ */
|
|
1129
|
+
return /* @__PURE__ */ jsx13("div", { className: "flex flex-col gap-3", children: config.sections.map((section) => /* @__PURE__ */ jsxs13("section", { "aria-label": section.title, className: SECTION_CLASS, children: [
|
|
1130
|
+
/* @__PURE__ */ jsx13("h3", { className: "label-xs-semibold-text font-ss02-ss05 uppercase text-greys-text-secondary", children: section.title }),
|
|
1131
|
+
/* @__PURE__ */ jsx13("div", { className: SECTION_FIELDS_CLASS[section.layout], children: teamFactsDisplayFields(section).map((key) => /* @__PURE__ */ jsx13(
|
|
887
1132
|
FactField,
|
|
888
1133
|
{
|
|
889
1134
|
factKey: key,
|
|
@@ -901,14 +1146,14 @@ function TeamFactsContent({
|
|
|
901
1146
|
// src/team/team-facts-widget.tsx
|
|
902
1147
|
import {
|
|
903
1148
|
Button,
|
|
904
|
-
Card as
|
|
905
|
-
CardContent as
|
|
1149
|
+
Card as Card6,
|
|
1150
|
+
CardContent as CardContent6,
|
|
906
1151
|
CardHeader as CardHeader3,
|
|
907
1152
|
CardTitle as CardTitle3,
|
|
908
1153
|
Skeleton as Skeleton4,
|
|
909
|
-
cn as
|
|
1154
|
+
cn as cn12
|
|
910
1155
|
} from "@nukleus-sports/ui-web";
|
|
911
|
-
import { jsx as
|
|
1156
|
+
import { jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
912
1157
|
var SKELETON_KEYS = ["trophy-case", "tradition", "profile"];
|
|
913
1158
|
function TeamFactsWidget({
|
|
914
1159
|
state,
|
|
@@ -917,32 +1162,32 @@ function TeamFactsWidget({
|
|
|
917
1162
|
getRivalHref,
|
|
918
1163
|
className
|
|
919
1164
|
}) {
|
|
920
|
-
return /* @__PURE__ */
|
|
921
|
-
|
|
1165
|
+
return /* @__PURE__ */ jsxs14(
|
|
1166
|
+
Card6,
|
|
922
1167
|
{
|
|
923
|
-
className:
|
|
1168
|
+
className: cn12(
|
|
924
1169
|
"flex w-full min-w-0 flex-col gap-3 rounded-[10px] border-0 px-4 pb-[22px] pt-4",
|
|
925
1170
|
// Matches the Team Info card's desktop height (TeamInfoCard `md:min-h-[612px]`).
|
|
926
1171
|
"xl:min-h-[612px] xl:self-stretch xl:[contain:size]",
|
|
927
1172
|
className
|
|
928
1173
|
),
|
|
929
1174
|
children: [
|
|
930
|
-
/* @__PURE__ */
|
|
931
|
-
/* @__PURE__ */
|
|
932
|
-
state.status === "loading" && /* @__PURE__ */
|
|
933
|
-
state.status === "error" && /* @__PURE__ */
|
|
1175
|
+
/* @__PURE__ */ jsx14(CardHeader3, { className: "flex h-8 shrink-0 flex-row items-center p-0", children: /* @__PURE__ */ jsx14(CardTitle3, { className: "header-xl-medium-card font-ss02-ss05 text-text-primary", children: "Team Facts" }) }),
|
|
1176
|
+
/* @__PURE__ */ jsxs14(CardContent6, { className: "p-0 xl:min-h-0 xl:flex-1 xl:overflow-y-auto xl:[scrollbar-width:none] xl:[&::-webkit-scrollbar]:hidden", children: [
|
|
1177
|
+
state.status === "loading" && /* @__PURE__ */ jsx14("div", { className: "flex flex-col gap-3", role: "status", "aria-label": "Loading team facts", children: SKELETON_KEYS.map((key) => /* @__PURE__ */ jsx14(Skeleton4, { className: "h-[200px] w-full rounded-[10px]" }, key)) }),
|
|
1178
|
+
state.status === "error" && /* @__PURE__ */ jsxs14(
|
|
934
1179
|
"div",
|
|
935
1180
|
{
|
|
936
1181
|
role: "alert",
|
|
937
1182
|
className: "flex h-[120px] flex-col items-center justify-center gap-2 text-14.5 text-text-secondary",
|
|
938
1183
|
children: [
|
|
939
|
-
/* @__PURE__ */
|
|
940
|
-
state.devMessage && /* @__PURE__ */
|
|
941
|
-
state.retry && /* @__PURE__ */
|
|
1184
|
+
/* @__PURE__ */ jsx14("span", { children: "Couldn't load team facts." }),
|
|
1185
|
+
state.devMessage && /* @__PURE__ */ jsx14("span", { className: "xxs-body-text", children: state.devMessage }),
|
|
1186
|
+
state.retry && /* @__PURE__ */ jsx14(Button, { type: "button", variant: "outline", size: "sm", onClick: state.retry, children: "Try again" })
|
|
942
1187
|
]
|
|
943
1188
|
}
|
|
944
1189
|
),
|
|
945
|
-
state.status === "ready" && /* @__PURE__ */
|
|
1190
|
+
state.status === "ready" && /* @__PURE__ */ jsx14(
|
|
946
1191
|
TeamFactsContent,
|
|
947
1192
|
{
|
|
948
1193
|
data: state.data,
|
|
@@ -959,9 +1204,9 @@ function TeamFactsWidget({
|
|
|
959
1204
|
}
|
|
960
1205
|
|
|
961
1206
|
// src/team/stat-ranking-leaderboard-dialog.tsx
|
|
962
|
-
import { useMemo as
|
|
1207
|
+
import { useMemo as useMemo3 } from "react";
|
|
963
1208
|
import {
|
|
964
|
-
BaseTable as
|
|
1209
|
+
BaseTable as BaseTable3,
|
|
965
1210
|
Button as Button2,
|
|
966
1211
|
Dialog,
|
|
967
1212
|
DialogContent,
|
|
@@ -969,11 +1214,11 @@ import {
|
|
|
969
1214
|
DialogHeader,
|
|
970
1215
|
DialogTitle,
|
|
971
1216
|
MobileModalLayout,
|
|
972
|
-
cn as
|
|
1217
|
+
cn as cn13
|
|
973
1218
|
} from "@nukleus-sports/ui-web";
|
|
974
1219
|
import { ChevronLeftIcon, ChevronRightIcon } from "@nukleus-sports/icons";
|
|
975
1220
|
import { toOrdinal } from "@nukleus-sports/core";
|
|
976
|
-
import { Fragment as
|
|
1221
|
+
import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
977
1222
|
var PAGE_BUTTON_BASE = "background";
|
|
978
1223
|
var PAGE_BUTTON_DESKTOP = "!h-[32px] !w-[32px] p-[6px]";
|
|
979
1224
|
var PAGE_BUTTON_MOBILE = "!h-11 !w-11 p-3 !outline-0 !border-0 !bg-inherit";
|
|
@@ -982,17 +1227,17 @@ function formatRank(rank, tied) {
|
|
|
982
1227
|
return tied ? `T-${toOrdinal(rank)}` : toOrdinal(rank);
|
|
983
1228
|
}
|
|
984
1229
|
function Footnotes({ notes }) {
|
|
985
|
-
return /* @__PURE__ */
|
|
1230
|
+
return /* @__PURE__ */ jsx15("div", { children: notes.map((note) => /* @__PURE__ */ jsxs15("p", { className: "alert-text-italic text-text-secondary", children: [
|
|
986
1231
|
"* ",
|
|
987
1232
|
note
|
|
988
1233
|
] }, note)) });
|
|
989
1234
|
}
|
|
990
1235
|
function Pagination({ page, totalPages, isCountKnown, isSm, onPageChange }) {
|
|
991
|
-
const buttonClass =
|
|
992
|
-
return /* @__PURE__ */
|
|
993
|
-
/* @__PURE__ */
|
|
994
|
-
/* @__PURE__ */
|
|
995
|
-
/* @__PURE__ */
|
|
1236
|
+
const buttonClass = cn13(PAGE_BUTTON_BASE, isSm ? PAGE_BUTTON_DESKTOP : PAGE_BUTTON_MOBILE);
|
|
1237
|
+
return /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between", children: [
|
|
1238
|
+
/* @__PURE__ */ jsx15("span", { className: "label-xs-text text-text-secondary", children: isCountKnown ? `Page ${page} of ${totalPages}` : `Page ${page}` }),
|
|
1239
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-3", children: [
|
|
1240
|
+
/* @__PURE__ */ jsx15(
|
|
996
1241
|
Button2,
|
|
997
1242
|
{
|
|
998
1243
|
variant: "secondary-greys",
|
|
@@ -1001,10 +1246,10 @@ function Pagination({ page, totalPages, isCountKnown, isSm, onPageChange }) {
|
|
|
1001
1246
|
onClick: () => onPageChange(Math.max(1, page - 1)),
|
|
1002
1247
|
disabled: page === 1,
|
|
1003
1248
|
"aria-label": "Go to previous page",
|
|
1004
|
-
children: /* @__PURE__ */
|
|
1249
|
+
children: /* @__PURE__ */ jsx15(ChevronLeftIcon, { className: "h-4 w-4" })
|
|
1005
1250
|
}
|
|
1006
1251
|
),
|
|
1007
|
-
/* @__PURE__ */
|
|
1252
|
+
/* @__PURE__ */ jsx15(
|
|
1008
1253
|
Button2,
|
|
1009
1254
|
{
|
|
1010
1255
|
variant: "secondary-greys",
|
|
@@ -1013,14 +1258,14 @@ function Pagination({ page, totalPages, isCountKnown, isSm, onPageChange }) {
|
|
|
1013
1258
|
onClick: () => onPageChange(Math.min(totalPages, page + 1)),
|
|
1014
1259
|
disabled: !isCountKnown || page >= totalPages,
|
|
1015
1260
|
"aria-label": "Go to next page",
|
|
1016
|
-
children: /* @__PURE__ */
|
|
1261
|
+
children: /* @__PURE__ */ jsx15(ChevronRightIcon, { className: "h-4 w-4" })
|
|
1017
1262
|
}
|
|
1018
1263
|
)
|
|
1019
1264
|
] })
|
|
1020
1265
|
] });
|
|
1021
1266
|
}
|
|
1022
1267
|
function useLeaderboardColumns(entityLabel, statLabel, formatValue, isSm) {
|
|
1023
|
-
return
|
|
1268
|
+
return useMemo3(
|
|
1024
1269
|
() => [
|
|
1025
1270
|
{
|
|
1026
1271
|
accessorKey: "rank",
|
|
@@ -1039,7 +1284,7 @@ function useLeaderboardColumns(entityLabel, statLabel, formatValue, isSm) {
|
|
|
1039
1284
|
},
|
|
1040
1285
|
{
|
|
1041
1286
|
accessorKey: "value",
|
|
1042
|
-
header: () => /* @__PURE__ */
|
|
1287
|
+
header: () => /* @__PURE__ */ jsx15("div", { className: "text-right text-wrap line-clamp-2", title: statLabel, children: statLabel }),
|
|
1043
1288
|
meta: {
|
|
1044
1289
|
cellSize: isSm ? "m" : "xs",
|
|
1045
1290
|
rowCellClassName: "text-right tabular-nums break-all"
|
|
@@ -1059,12 +1304,12 @@ function LeaderboardTable(props) {
|
|
|
1059
1304
|
props.isSm
|
|
1060
1305
|
);
|
|
1061
1306
|
if (isConfigError) {
|
|
1062
|
-
return /* @__PURE__ */
|
|
1307
|
+
return /* @__PURE__ */ jsx15("div", { className: "flex items-center justify-center h-full text-14.5 text-text-secondary", children: "Couldn't load ranking details. Please try again." });
|
|
1063
1308
|
}
|
|
1064
|
-
return /* @__PURE__ */
|
|
1065
|
-
isError && rows.length > 0 && /* @__PURE__ */
|
|
1066
|
-
/* @__PURE__ */
|
|
1067
|
-
|
|
1309
|
+
return /* @__PURE__ */ jsxs15(Fragment4, { children: [
|
|
1310
|
+
isError && rows.length > 0 && /* @__PURE__ */ jsx15("p", { className: "text-12 text-destructive px-1 pb-2", children: "Couldn't refresh rankings. Showing the last loaded data." }),
|
|
1311
|
+
/* @__PURE__ */ jsx15(
|
|
1312
|
+
BaseTable3,
|
|
1068
1313
|
{
|
|
1069
1314
|
columns,
|
|
1070
1315
|
data: rows,
|
|
@@ -1087,17 +1332,17 @@ function LeaderboardContent(props) {
|
|
|
1087
1332
|
const isCountKnown = totalCount !== void 0;
|
|
1088
1333
|
const totalPages = Math.max(1, Math.ceil((totalCount ?? 0) / pageSize));
|
|
1089
1334
|
const showPagination = page > 1 || isCountKnown && totalPages > 1;
|
|
1090
|
-
return /* @__PURE__ */
|
|
1091
|
-
/* @__PURE__ */
|
|
1092
|
-
subtitle && /* @__PURE__ */
|
|
1335
|
+
return /* @__PURE__ */ jsxs15("div", { className: "flex flex-col h-full overflow-hidden", children: [
|
|
1336
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex flex-col gap-6 sm:gap-4 overflow-hidden px-5", children: [
|
|
1337
|
+
subtitle && /* @__PURE__ */ jsxs15(DialogDescription, { className: "flex flex-col gap-1 header-xl-medium-card text-text-secondary sm:px-4 font-ss02 ss05 leading-normal", children: [
|
|
1093
1338
|
subtitle,
|
|
1094
|
-
!isSm && footnotes.length > 0 && /* @__PURE__ */
|
|
1339
|
+
!isSm && footnotes.length > 0 && /* @__PURE__ */ jsx15(Footnotes, { notes: footnotes })
|
|
1095
1340
|
] }),
|
|
1096
|
-
/* @__PURE__ */
|
|
1341
|
+
/* @__PURE__ */ jsx15("div", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsx15(LeaderboardTable, { ...props }) })
|
|
1097
1342
|
] }),
|
|
1098
|
-
(footnotes.length > 0 || showPagination) && /* @__PURE__ */
|
|
1099
|
-
footnotes.length > 0 && /* @__PURE__ */
|
|
1100
|
-
showPagination && /* @__PURE__ */
|
|
1343
|
+
(footnotes.length > 0 || showPagination) && /* @__PURE__ */ jsxs15("div", { className: "flex flex-col pt-3 pb-6 px-9 border-t border-border gap-3 relative z-10 shadow-[0_0_4px_0_rgba(0,0,0,0.25)]", children: [
|
|
1344
|
+
footnotes.length > 0 && /* @__PURE__ */ jsx15(Footnotes, { notes: footnotes }),
|
|
1345
|
+
showPagination && /* @__PURE__ */ jsx15(
|
|
1101
1346
|
Pagination,
|
|
1102
1347
|
{
|
|
1103
1348
|
page,
|
|
@@ -1113,12 +1358,12 @@ function LeaderboardContent(props) {
|
|
|
1113
1358
|
function StatRankingLeaderboardDialog(props) {
|
|
1114
1359
|
const { open, onOpenChange, title, isSm } = props;
|
|
1115
1360
|
if (isSm) {
|
|
1116
|
-
return /* @__PURE__ */
|
|
1117
|
-
/* @__PURE__ */
|
|
1118
|
-
/* @__PURE__ */
|
|
1361
|
+
return /* @__PURE__ */ jsx15(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs15(DialogContent, { className: "p-0 min-w-[536px] sm:max-w-[500px] pt-4 gap-6 bg-card border-0 flex flex-col max-h-[85vh]", children: [
|
|
1362
|
+
/* @__PURE__ */ jsx15(DialogHeader, { children: /* @__PURE__ */ jsx15(DialogTitle, { className: "header-xl-medium-card", children: title }) }),
|
|
1363
|
+
/* @__PURE__ */ jsx15(LeaderboardContent, { ...props })
|
|
1119
1364
|
] }) });
|
|
1120
1365
|
}
|
|
1121
|
-
return /* @__PURE__ */
|
|
1366
|
+
return /* @__PURE__ */ jsx15(
|
|
1122
1367
|
MobileModalLayout,
|
|
1123
1368
|
{
|
|
1124
1369
|
onCancel: () => onOpenChange(false),
|
|
@@ -1127,7 +1372,7 @@ function StatRankingLeaderboardDialog(props) {
|
|
|
1127
1372
|
title,
|
|
1128
1373
|
cancelButtonName: "Close",
|
|
1129
1374
|
childClassName: "h-auto min-h-full h-[calc(100vh-100px)]",
|
|
1130
|
-
children: /* @__PURE__ */
|
|
1375
|
+
children: /* @__PURE__ */ jsx15("div", { className: "flex flex-col h-full pt-6", children: /* @__PURE__ */ jsx15(LeaderboardContent, { ...props }) })
|
|
1131
1376
|
}
|
|
1132
1377
|
);
|
|
1133
1378
|
}
|
|
@@ -1135,13 +1380,13 @@ function StatRankingLeaderboardDialog(props) {
|
|
|
1135
1380
|
// src/team/team-season-stats-widget.tsx
|
|
1136
1381
|
import {
|
|
1137
1382
|
Button as Button3,
|
|
1138
|
-
Card as
|
|
1139
|
-
CardContent as
|
|
1383
|
+
Card as Card7,
|
|
1384
|
+
CardContent as CardContent7,
|
|
1140
1385
|
CardHeader as CardHeader4,
|
|
1141
1386
|
CardTitle as CardTitle4,
|
|
1142
1387
|
IconLoader,
|
|
1143
1388
|
Skeleton as Skeleton5,
|
|
1144
|
-
cn as
|
|
1389
|
+
cn as cn14
|
|
1145
1390
|
} from "@nukleus-sports/ui-web";
|
|
1146
1391
|
import {
|
|
1147
1392
|
computeTeamSeasonStatsFromSummary,
|
|
@@ -1150,7 +1395,7 @@ import {
|
|
|
1150
1395
|
getTeamStatColumns as getTeamStatColumns2,
|
|
1151
1396
|
isSupportedTeamStatsSport as isSupportedTeamStatsSport2
|
|
1152
1397
|
} from "@nukleus-sports/core";
|
|
1153
|
-
import { jsx as
|
|
1398
|
+
import { jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1154
1399
|
var PRESEASON_TYPE = 1;
|
|
1155
1400
|
var RANK_TEXT_CLASS = "label-xs-medium text-text-secondary";
|
|
1156
1401
|
var RANK_LINK_CLASS = `${RANK_TEXT_CLASS} hover:text-text-primary hover:underline cursor-pointer transition-colors`;
|
|
@@ -1162,14 +1407,14 @@ function RankBadge({
|
|
|
1162
1407
|
onRankClick
|
|
1163
1408
|
}) {
|
|
1164
1409
|
if (isRankingsError) {
|
|
1165
|
-
return /* @__PURE__ */
|
|
1166
|
-
/* @__PURE__ */
|
|
1167
|
-
/* @__PURE__ */
|
|
1410
|
+
return /* @__PURE__ */ jsxs16("span", { className: "label-xs-medium text-destructive", title: "Couldn't load ranking", children: [
|
|
1411
|
+
/* @__PURE__ */ jsx16("span", { "aria-hidden": "true", children: "--" }),
|
|
1412
|
+
/* @__PURE__ */ jsx16("span", { className: "sr-only", children: "Couldn't load ranking" })
|
|
1168
1413
|
] });
|
|
1169
1414
|
}
|
|
1170
1415
|
if (!rankText) return null;
|
|
1171
|
-
if (!onRankClick) return /* @__PURE__ */
|
|
1172
|
-
return /* @__PURE__ */
|
|
1416
|
+
if (!onRankClick) return /* @__PURE__ */ jsx16("span", { className: RANK_TEXT_CLASS, children: rankText });
|
|
1417
|
+
return /* @__PURE__ */ jsx16(
|
|
1173
1418
|
Button3,
|
|
1174
1419
|
{
|
|
1175
1420
|
type: "button",
|
|
@@ -1186,7 +1431,7 @@ function RankBadge({
|
|
|
1186
1431
|
);
|
|
1187
1432
|
}
|
|
1188
1433
|
function CenteredMessage({ children }) {
|
|
1189
|
-
return /* @__PURE__ */
|
|
1434
|
+
return /* @__PURE__ */ jsx16("div", { className: "flex items-center justify-center h-full text-14.5 text-text-secondary", children });
|
|
1190
1435
|
}
|
|
1191
1436
|
function StatsBody({
|
|
1192
1437
|
stats,
|
|
@@ -1199,17 +1444,17 @@ function StatsBody({
|
|
|
1199
1444
|
onRankClick
|
|
1200
1445
|
}) {
|
|
1201
1446
|
const columns = getTeamStatColumns2(sportId);
|
|
1202
|
-
return /* @__PURE__ */
|
|
1203
|
-
isSummaryError && /* @__PURE__ */
|
|
1204
|
-
/* @__PURE__ */
|
|
1447
|
+
return /* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-1.5 h-full w-full justify-center", children: [
|
|
1448
|
+
isSummaryError && /* @__PURE__ */ jsx16("p", { className: "text-12 text-destructive", children: "Couldn't refresh stats. Showing the last loaded data." }),
|
|
1449
|
+
/* @__PURE__ */ jsx16("div", { className: "grid grid-cols-2 gap-x-1.5 gap-y-1.5 sm:flex sm:flex-row sm:gap-3 sm:justify-between items-center w-full", children: columns.map((column, index) => {
|
|
1205
1450
|
const configId = configIds?.[index];
|
|
1206
|
-
return /* @__PURE__ */
|
|
1451
|
+
return /* @__PURE__ */ jsx16(
|
|
1207
1452
|
StatColumn,
|
|
1208
1453
|
{
|
|
1209
1454
|
label: column.label,
|
|
1210
1455
|
value: stats.values[index],
|
|
1211
1456
|
suffix: column.suffix,
|
|
1212
|
-
rankBadge: showRanks && configId !== void 0 ? /* @__PURE__ */
|
|
1457
|
+
rankBadge: showRanks && configId !== void 0 ? /* @__PURE__ */ jsx16(
|
|
1213
1458
|
RankBadge,
|
|
1214
1459
|
{
|
|
1215
1460
|
rankText: formatStatRankByConfig(rankings, configId),
|
|
@@ -1249,16 +1494,16 @@ function TeamSeasonStatsWidget({
|
|
|
1249
1494
|
const configIds = getTeamRankingConfigIds(sportId, leagueId);
|
|
1250
1495
|
const showRanks = seasons?.selectedType !== PRESEASON_TYPE;
|
|
1251
1496
|
if (seasonsLoading) {
|
|
1252
|
-
return /* @__PURE__ */
|
|
1253
|
-
/* @__PURE__ */
|
|
1254
|
-
/* @__PURE__ */
|
|
1497
|
+
return /* @__PURE__ */ jsxs16(Card7, { className: cn14("border-0 p-4 h-[300px]", className), children: [
|
|
1498
|
+
/* @__PURE__ */ jsx16(CardHeader4, { className: "p-0 pb-4", children: /* @__PURE__ */ jsx16(CardTitle4, { className: "text-base font-medium", children: "Season Stats" }) }),
|
|
1499
|
+
/* @__PURE__ */ jsx16(CardContent7, { className: "p-0", children: /* @__PURE__ */ jsx16("div", { className: "space-y-3 flex justify-center items-center w-full h-full", children: /* @__PURE__ */ jsx16(IconLoader, {}) }) })
|
|
1255
1500
|
] });
|
|
1256
1501
|
}
|
|
1257
1502
|
let body;
|
|
1258
1503
|
if (statsLoading) {
|
|
1259
|
-
body = /* @__PURE__ */
|
|
1504
|
+
body = /* @__PURE__ */ jsx16("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ jsx16(Skeleton5, { className: "h-4 w-3/4" }) });
|
|
1260
1505
|
} else if (isSupportedSport && stats) {
|
|
1261
|
-
body = /* @__PURE__ */
|
|
1506
|
+
body = /* @__PURE__ */ jsx16(
|
|
1262
1507
|
StatsBody,
|
|
1263
1508
|
{
|
|
1264
1509
|
stats,
|
|
@@ -1272,39 +1517,39 @@ function TeamSeasonStatsWidget({
|
|
|
1272
1517
|
}
|
|
1273
1518
|
);
|
|
1274
1519
|
} else {
|
|
1275
|
-
body = /* @__PURE__ */
|
|
1520
|
+
body = /* @__PURE__ */ jsx16(CenteredMessage, { children: getEmptyMessage(isSupportedSport, hasSeason, isSummaryError) });
|
|
1276
1521
|
}
|
|
1277
|
-
return /* @__PURE__ */
|
|
1278
|
-
|
|
1522
|
+
return /* @__PURE__ */ jsxs16(
|
|
1523
|
+
Card7,
|
|
1279
1524
|
{
|
|
1280
|
-
className:
|
|
1525
|
+
className: cn14(
|
|
1281
1526
|
"border-0 px-4 py-3 sm:p-4 flex flex-col gap-[25px] sm:gap-4 sm:h-[300px]",
|
|
1282
1527
|
className
|
|
1283
1528
|
),
|
|
1284
1529
|
children: [
|
|
1285
|
-
/* @__PURE__ */
|
|
1286
|
-
/* @__PURE__ */
|
|
1287
|
-
isSupportedSport && seasons && seasons.years.length > 0 && /* @__PURE__ */
|
|
1530
|
+
/* @__PURE__ */ jsx16(CardHeader4, { className: "p-0", children: /* @__PURE__ */ jsxs16("div", { className: "flex flex-row items-center justify-between w-full h-8", children: [
|
|
1531
|
+
/* @__PURE__ */ jsx16(CardTitle4, { className: "header-xl-medium-card text-base text-text-primary", children: "Team Stats" }),
|
|
1532
|
+
isSupportedSport && seasons && seasons.years.length > 0 && /* @__PURE__ */ jsx16(SeasonSelector, { ...seasons, hideTypeOnMobile: true })
|
|
1288
1533
|
] }) }),
|
|
1289
|
-
/* @__PURE__ */
|
|
1534
|
+
/* @__PURE__ */ jsx16(CardContent7, { className: "p-0 h-auto sm:h-[220px] flex justify-center", children: body })
|
|
1290
1535
|
]
|
|
1291
1536
|
}
|
|
1292
1537
|
);
|
|
1293
1538
|
}
|
|
1294
1539
|
|
|
1295
1540
|
// src/team/recent-games-widget.tsx
|
|
1296
|
-
import { useState as
|
|
1541
|
+
import { useState as useState5 } from "react";
|
|
1297
1542
|
import {
|
|
1298
1543
|
Button as Button4,
|
|
1299
|
-
Card as
|
|
1300
|
-
CardContent as
|
|
1544
|
+
Card as Card8,
|
|
1545
|
+
CardContent as CardContent8,
|
|
1301
1546
|
CardHeader as CardHeader5,
|
|
1302
1547
|
CardTitle as CardTitle5,
|
|
1303
1548
|
IconLoader as IconLoader2,
|
|
1304
|
-
cn as
|
|
1549
|
+
cn as cn15
|
|
1305
1550
|
} from "@nukleus-sports/ui-web";
|
|
1306
1551
|
import { ArrowUpRightIcon } from "@nukleus-sports/icons";
|
|
1307
|
-
import { Fragment as
|
|
1552
|
+
import { Fragment as Fragment5, jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1308
1553
|
var DATE_FORMAT = new Intl.DateTimeFormat("en-US", {
|
|
1309
1554
|
weekday: "long",
|
|
1310
1555
|
month: "long",
|
|
@@ -1317,33 +1562,33 @@ var MESSAGES = {
|
|
|
1317
1562
|
"games-error": "Couldn't load games. Please try again."
|
|
1318
1563
|
};
|
|
1319
1564
|
function ResultText({ result }) {
|
|
1320
|
-
if (result.outcome === "none") return /* @__PURE__ */
|
|
1565
|
+
if (result.outcome === "none") return /* @__PURE__ */ jsx17("span", { className: "text-text-secondary text-14", children: "--" });
|
|
1321
1566
|
if (result.outcome === "tie") {
|
|
1322
|
-
return /* @__PURE__ */
|
|
1567
|
+
return /* @__PURE__ */ jsxs17("span", { className: "text-14 font-medium text-text-primary", children: [
|
|
1323
1568
|
"T ",
|
|
1324
1569
|
result.detail
|
|
1325
1570
|
] });
|
|
1326
1571
|
}
|
|
1327
1572
|
const isWin = result.outcome === "win";
|
|
1328
|
-
return /* @__PURE__ */
|
|
1329
|
-
/* @__PURE__ */
|
|
1573
|
+
return /* @__PURE__ */ jsxs17("span", { className: "text-14 font-medium", children: [
|
|
1574
|
+
/* @__PURE__ */ jsx17(
|
|
1330
1575
|
"span",
|
|
1331
1576
|
{
|
|
1332
1577
|
className: isWin ? "text-primary-color-nuk-text" : "text-semantic-color-status-priority-blocked-hot-copy",
|
|
1333
1578
|
children: isWin ? "W" : "L"
|
|
1334
1579
|
}
|
|
1335
1580
|
),
|
|
1336
|
-
/* @__PURE__ */
|
|
1581
|
+
/* @__PURE__ */ jsxs17("span", { className: "text-text-primary", children: [
|
|
1337
1582
|
" ",
|
|
1338
1583
|
result.detail
|
|
1339
1584
|
] })
|
|
1340
1585
|
] });
|
|
1341
1586
|
}
|
|
1342
1587
|
function OpponentLogo({ opponent, resolveImageUrl, defaultLogoUrl }) {
|
|
1343
|
-
const [failedUrl, setFailedUrl] =
|
|
1588
|
+
const [failedUrl, setFailedUrl] = useState5(null);
|
|
1344
1589
|
const { logo } = opponent;
|
|
1345
1590
|
const resolved = logo ? logo.stored ? resolveImageUrl?.(logo.url) : logo.url : void 0;
|
|
1346
|
-
return /* @__PURE__ */
|
|
1591
|
+
return /* @__PURE__ */ jsx17(
|
|
1347
1592
|
"img",
|
|
1348
1593
|
{
|
|
1349
1594
|
src: resolved && resolved !== failedUrl ? resolved : defaultLogoUrl,
|
|
@@ -1357,13 +1602,13 @@ function OpponentLogo({ opponent, resolveImageUrl, defaultLogoUrl }) {
|
|
|
1357
1602
|
);
|
|
1358
1603
|
}
|
|
1359
1604
|
function GameItem({ row, resolveImageUrl, defaultLogoUrl }) {
|
|
1360
|
-
return /* @__PURE__ */
|
|
1361
|
-
row.isFirstUpcoming && /* @__PURE__ */
|
|
1362
|
-
/* @__PURE__ */
|
|
1363
|
-
/* @__PURE__ */
|
|
1364
|
-
/* @__PURE__ */
|
|
1365
|
-
/* @__PURE__ */
|
|
1366
|
-
/* @__PURE__ */
|
|
1605
|
+
return /* @__PURE__ */ jsxs17("div", { className: "border-b border-border last:border-0", children: [
|
|
1606
|
+
row.isFirstUpcoming && /* @__PURE__ */ jsx17("p", { className: "px-2 pt-2 text-12 font-medium uppercase tracking-wide text-text-secondary", children: "Upcoming" }),
|
|
1607
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex flex-col p-2 gap-[5px]", children: [
|
|
1608
|
+
/* @__PURE__ */ jsx17("p", { className: "text-14 font-normal text-text-secondary", children: DATE_FORMAT.format(new Date(row.gameDate)) }),
|
|
1609
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-3", children: [
|
|
1610
|
+
/* @__PURE__ */ jsx17("span", { className: "text-14 font-normal text-text-secondary shrink-0", children: row.isHome ? "vs " : "@ " }),
|
|
1611
|
+
/* @__PURE__ */ jsx17(
|
|
1367
1612
|
OpponentLogo,
|
|
1368
1613
|
{
|
|
1369
1614
|
opponent: row.opponent,
|
|
@@ -1371,18 +1616,18 @@ function GameItem({ row, resolveImageUrl, defaultLogoUrl }) {
|
|
|
1371
1616
|
defaultLogoUrl
|
|
1372
1617
|
}
|
|
1373
1618
|
),
|
|
1374
|
-
/* @__PURE__ */
|
|
1375
|
-
row.result && /* @__PURE__ */
|
|
1376
|
-
/* @__PURE__ */
|
|
1377
|
-
/* @__PURE__ */
|
|
1619
|
+
/* @__PURE__ */ jsx17("span", { className: "text-14.5 font-normal text-text-primary truncate", children: row.opponent.name }),
|
|
1620
|
+
row.result && /* @__PURE__ */ jsxs17(Fragment5, { children: [
|
|
1621
|
+
/* @__PURE__ */ jsx17("span", { className: "text-14 text-text-secondary", children: "-" }),
|
|
1622
|
+
/* @__PURE__ */ jsx17(ResultText, { result: row.result })
|
|
1378
1623
|
] })
|
|
1379
1624
|
] }),
|
|
1380
|
-
row.time && /* @__PURE__ */
|
|
1625
|
+
row.time && /* @__PURE__ */ jsx17("p", { className: "text-14 font-normal text-text-secondary", children: row.time })
|
|
1381
1626
|
] })
|
|
1382
1627
|
] });
|
|
1383
1628
|
}
|
|
1384
1629
|
function Message({ children }) {
|
|
1385
|
-
return /* @__PURE__ */
|
|
1630
|
+
return /* @__PURE__ */ jsx17("div", { className: "text-text-primary text-14.5 px-1", children });
|
|
1386
1631
|
}
|
|
1387
1632
|
function Body({
|
|
1388
1633
|
status,
|
|
@@ -1391,11 +1636,11 @@ function Body({
|
|
|
1391
1636
|
defaultLogoUrl
|
|
1392
1637
|
}) {
|
|
1393
1638
|
if (status === "loading") {
|
|
1394
|
-
return /* @__PURE__ */
|
|
1639
|
+
return /* @__PURE__ */ jsx17("div", { className: "space-y-4 flex justify-center items-center w-full h-full", children: /* @__PURE__ */ jsx17(IconLoader2, {}) });
|
|
1395
1640
|
}
|
|
1396
|
-
if (status !== "ready") return /* @__PURE__ */
|
|
1397
|
-
if (rows.length === 0) return /* @__PURE__ */
|
|
1398
|
-
return /* @__PURE__ */
|
|
1641
|
+
if (status !== "ready") return /* @__PURE__ */ jsx17(Message, { children: MESSAGES[status] });
|
|
1642
|
+
if (rows.length === 0) return /* @__PURE__ */ jsx17(Message, { children: "There are no games scheduled at this time." });
|
|
1643
|
+
return /* @__PURE__ */ jsx17("div", { className: "flex flex-col overflow-y-auto overflow-x-hidden gap-1", children: rows.map((row) => /* @__PURE__ */ jsx17(
|
|
1399
1644
|
GameItem,
|
|
1400
1645
|
{
|
|
1401
1646
|
row,
|
|
@@ -1413,17 +1658,17 @@ function RecentGamesWidget({
|
|
|
1413
1658
|
onExpand,
|
|
1414
1659
|
className
|
|
1415
1660
|
}) {
|
|
1416
|
-
return /* @__PURE__ */
|
|
1417
|
-
|
|
1661
|
+
return /* @__PURE__ */ jsxs17(
|
|
1662
|
+
Card8,
|
|
1418
1663
|
{
|
|
1419
|
-
className:
|
|
1664
|
+
className: cn15(
|
|
1420
1665
|
"p-4 w-full xl:w-[420px] flex flex-col overflow-hidden border-none gap-3 h-full md:min-h-[612px]",
|
|
1421
1666
|
className
|
|
1422
1667
|
),
|
|
1423
1668
|
children: [
|
|
1424
|
-
/* @__PURE__ */
|
|
1425
|
-
/* @__PURE__ */
|
|
1426
|
-
onExpand && /* @__PURE__ */
|
|
1669
|
+
/* @__PURE__ */ jsxs17(CardHeader5, { className: "flex flex-row items-center justify-between space-y-0 p-0", children: [
|
|
1670
|
+
/* @__PURE__ */ jsx17(CardTitle5, { children: "Recent Games" }),
|
|
1671
|
+
onExpand && /* @__PURE__ */ jsx17(
|
|
1427
1672
|
Button4,
|
|
1428
1673
|
{
|
|
1429
1674
|
type: "button",
|
|
@@ -1432,11 +1677,11 @@ function RecentGamesWidget({
|
|
|
1432
1677
|
"aria-label": "View full schedule",
|
|
1433
1678
|
onClick: onExpand,
|
|
1434
1679
|
className: "outline-1 background outline-offset-[-1px] outline-[hsl(var(--color-ui-elem-strokes))] outline h-[32px] w-[32px]",
|
|
1435
|
-
children: /* @__PURE__ */
|
|
1680
|
+
children: /* @__PURE__ */ jsx17(ArrowUpRightIcon, { className: "text-greys-icons h-5 w-5" })
|
|
1436
1681
|
}
|
|
1437
1682
|
)
|
|
1438
1683
|
] }),
|
|
1439
|
-
/* @__PURE__ */
|
|
1684
|
+
/* @__PURE__ */ jsx17(CardContent8, { className: "flex-1 flex flex-col overflow-hidden p-0", children: /* @__PURE__ */ jsx17(
|
|
1440
1685
|
Body,
|
|
1441
1686
|
{
|
|
1442
1687
|
status,
|
|
@@ -1451,11 +1696,11 @@ function RecentGamesWidget({
|
|
|
1451
1696
|
}
|
|
1452
1697
|
|
|
1453
1698
|
// src/team/team-stats-table.tsx
|
|
1454
|
-
import { useState as
|
|
1699
|
+
import { useState as useState6 } from "react";
|
|
1455
1700
|
import {
|
|
1456
|
-
BaseTable as
|
|
1457
|
-
Card as
|
|
1458
|
-
CardContent as
|
|
1701
|
+
BaseTable as BaseTable4,
|
|
1702
|
+
Card as Card9,
|
|
1703
|
+
CardContent as CardContent9,
|
|
1459
1704
|
CardHeader as CardHeader6,
|
|
1460
1705
|
CardTitle as CardTitle6,
|
|
1461
1706
|
Select as Select2,
|
|
@@ -1464,14 +1709,14 @@ import {
|
|
|
1464
1709
|
SelectTrigger as SelectTrigger2,
|
|
1465
1710
|
SelectValue as SelectValue2,
|
|
1466
1711
|
Skeleton as Skeleton6,
|
|
1467
|
-
cn as
|
|
1712
|
+
cn as cn16
|
|
1468
1713
|
} from "@nukleus-sports/ui-web";
|
|
1469
1714
|
import {
|
|
1470
1715
|
getOrderedTeamStatTypesForCategory,
|
|
1471
1716
|
getVisibleTeamStatTypes,
|
|
1472
1717
|
showsTeamStatCategoryPicker
|
|
1473
1718
|
} from "@nukleus-sports/core";
|
|
1474
|
-
import { Fragment as
|
|
1719
|
+
import { Fragment as Fragment6, jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1475
1720
|
function stripLeadingSlash(path) {
|
|
1476
1721
|
return path.startsWith("/") ? path.slice(1) : path;
|
|
1477
1722
|
}
|
|
@@ -1507,10 +1752,10 @@ function formatTeamStatDate(stat) {
|
|
|
1507
1752
|
const dateStr = stat.stat_details?.game_details?.date;
|
|
1508
1753
|
const date = dateStr ? new Date(dateStr) : null;
|
|
1509
1754
|
if (!date || Number.isNaN(date.getTime())) {
|
|
1510
|
-
return /* @__PURE__ */
|
|
1755
|
+
return /* @__PURE__ */ jsx18("span", { className: "text-text-primary body-text", children: "--" });
|
|
1511
1756
|
}
|
|
1512
1757
|
const formatted = date.toLocaleDateString("en-US", { month: "short", day: "numeric" });
|
|
1513
|
-
return /* @__PURE__ */
|
|
1758
|
+
return /* @__PURE__ */ jsx18("div", { className: "text-13.5 font-normal text-text-primary", children: formatted });
|
|
1514
1759
|
}
|
|
1515
1760
|
function getTeamStatResult(stat) {
|
|
1516
1761
|
const gameDetails = stat.stat_details?.game_details;
|
|
@@ -1529,9 +1774,9 @@ function getTeamStatResult(stat) {
|
|
|
1529
1774
|
const opponentScore = isHome ? awayScore : homeScore;
|
|
1530
1775
|
const score = `${teamScore}-${opponentScore}${gameDetails.status_alt_details ? ` ${gameDetails.status_alt_details}` : ""}`;
|
|
1531
1776
|
const colorClass = winLoss === "W" ? "text-primary-color-nuk-text" : winLoss === "L" ? "text-semantic-color-status-priority-blocked-hot-copy" : "text-text-primary";
|
|
1532
|
-
return /* @__PURE__ */
|
|
1533
|
-
/* @__PURE__ */
|
|
1534
|
-
/* @__PURE__ */
|
|
1777
|
+
return /* @__PURE__ */ jsxs18("div", { className: "flex items-baseline gap-1 leading-tight", children: [
|
|
1778
|
+
/* @__PURE__ */ jsx18("span", { className: cn16(colorClass, "body-text"), children: winLoss }),
|
|
1779
|
+
/* @__PURE__ */ jsx18("span", { className: "text-text-primary body-text", children: score })
|
|
1535
1780
|
] });
|
|
1536
1781
|
}
|
|
1537
1782
|
function StatOpponentCell({
|
|
@@ -1540,18 +1785,18 @@ function StatOpponentCell({
|
|
|
1540
1785
|
defaultLogoUrl,
|
|
1541
1786
|
showName
|
|
1542
1787
|
}) {
|
|
1543
|
-
const [failedUrl, setFailedUrl] =
|
|
1788
|
+
const [failedUrl, setFailedUrl] = useState6(null);
|
|
1544
1789
|
const gameDetails = stat.stat_details?.game_details;
|
|
1545
1790
|
const isHome = stat.team_id === gameDetails?.home_team_id;
|
|
1546
1791
|
const opponentName = isHome ? gameDetails?.away_team_name : gameDetails?.home_team_name;
|
|
1547
1792
|
const opponentLogoPath = isHome ? gameDetails?.away_team_logo : gameDetails?.home_team_logo;
|
|
1548
|
-
if (!opponentName) return /* @__PURE__ */
|
|
1793
|
+
if (!opponentName) return /* @__PURE__ */ jsx18(Fragment6, { children: "--" });
|
|
1549
1794
|
const prefix = isHome ? "vs" : "@";
|
|
1550
1795
|
const resolved = opponentLogoPath ? resolveOpponentLogoUrl(stripLeadingSlash(opponentLogoPath)) : null;
|
|
1551
1796
|
const logoSrc = resolved && resolved !== failedUrl ? resolved : defaultLogoUrl;
|
|
1552
|
-
return /* @__PURE__ */
|
|
1553
|
-
/* @__PURE__ */
|
|
1554
|
-
/* @__PURE__ */
|
|
1797
|
+
return /* @__PURE__ */ jsx18("div", { className: "h-full overflow-hidden", children: /* @__PURE__ */ jsx18("div", { className: "flex items-center h-full", children: /* @__PURE__ */ jsxs18("div", { className: "flex max-sm:gap-1 gap-2 items-center font-normal leading-tight text-12", children: [
|
|
1798
|
+
/* @__PURE__ */ jsx18("span", { className: "text-text-primary body-text", children: prefix }),
|
|
1799
|
+
/* @__PURE__ */ jsx18(
|
|
1555
1800
|
"img",
|
|
1556
1801
|
{
|
|
1557
1802
|
src: logoSrc,
|
|
@@ -1562,7 +1807,7 @@ function StatOpponentCell({
|
|
|
1562
1807
|
}
|
|
1563
1808
|
}
|
|
1564
1809
|
),
|
|
1565
|
-
showName && /* @__PURE__ */
|
|
1810
|
+
showName && /* @__PURE__ */ jsx18("span", { className: "text-primary-color-nuk-text body-text line-clamp-2", children: opponentName })
|
|
1566
1811
|
] }) }) });
|
|
1567
1812
|
}
|
|
1568
1813
|
function buildStatsColumns({
|
|
@@ -1576,14 +1821,14 @@ function buildStatsColumns({
|
|
|
1576
1821
|
return [
|
|
1577
1822
|
{
|
|
1578
1823
|
id: "game_date",
|
|
1579
|
-
header: () => /* @__PURE__ */
|
|
1824
|
+
header: () => /* @__PURE__ */ jsx18("div", { className: "w-[50px] shrink-0", children: "Date" }),
|
|
1580
1825
|
cell: ({ row }) => formatTeamStatDate(row.original),
|
|
1581
1826
|
meta: { cellSize: isSm ? "xs" : "xxs", headerClassName: "h-auto" }
|
|
1582
1827
|
},
|
|
1583
1828
|
{
|
|
1584
1829
|
id: "opponent",
|
|
1585
|
-
header: () => /* @__PURE__ */
|
|
1586
|
-
cell: ({ row }) => /* @__PURE__ */
|
|
1830
|
+
header: () => /* @__PURE__ */ jsx18("div", { children: isSm ? "Opponent" : "Opp" }),
|
|
1831
|
+
cell: ({ row }) => /* @__PURE__ */ jsx18(
|
|
1587
1832
|
StatOpponentCell,
|
|
1588
1833
|
{
|
|
1589
1834
|
stat: row.original,
|
|
@@ -1635,33 +1880,33 @@ function StatsBody2({
|
|
|
1635
1880
|
isSmallLaptop,
|
|
1636
1881
|
emptyMessage
|
|
1637
1882
|
}) {
|
|
1638
|
-
return /* @__PURE__ */
|
|
1639
|
-
/* @__PURE__ */
|
|
1640
|
-
/* @__PURE__ */
|
|
1641
|
-
showsCategoryPicker && /* @__PURE__ */
|
|
1883
|
+
return /* @__PURE__ */ jsxs18(Fragment6, { children: [
|
|
1884
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2 min-[360px]:gap-3 xl:shrink-0", children: [
|
|
1885
|
+
/* @__PURE__ */ jsx18(SeasonSelector, { ...seasons, className: "gap-2 min-[360px]:gap-3" }),
|
|
1886
|
+
showsCategoryPicker && /* @__PURE__ */ jsxs18(
|
|
1642
1887
|
Select2,
|
|
1643
1888
|
{
|
|
1644
1889
|
value: selectedStatCategory,
|
|
1645
1890
|
onValueChange: onStatCategoryChange,
|
|
1646
1891
|
disabled: !seasons.selectedYear || seasons.selectedType === null,
|
|
1647
1892
|
children: [
|
|
1648
|
-
/* @__PURE__ */
|
|
1649
|
-
/* @__PURE__ */
|
|
1893
|
+
/* @__PURE__ */ jsx18(SelectTrigger2, { variant: "widget", size: "widget", "aria-label": "Stat category", children: /* @__PURE__ */ jsx18(SelectValue2, { placeholder: "Select stat category" }) }),
|
|
1894
|
+
/* @__PURE__ */ jsx18(
|
|
1650
1895
|
SelectContent2,
|
|
1651
1896
|
{
|
|
1652
1897
|
className: "bg-popover border-border z-50 [&_.checkbox]:!flex",
|
|
1653
1898
|
classNameViewPort: "gap-2",
|
|
1654
|
-
children: availableStatCategories.map((category) => /* @__PURE__ */
|
|
1899
|
+
children: availableStatCategories.map((category) => /* @__PURE__ */ jsx18(SelectItem2, { value: category, className: "capitalize min-h-8", children: category.charAt(0).toUpperCase() + category.slice(1) }, category))
|
|
1655
1900
|
}
|
|
1656
1901
|
)
|
|
1657
1902
|
]
|
|
1658
1903
|
}
|
|
1659
1904
|
)
|
|
1660
1905
|
] }),
|
|
1661
|
-
/* @__PURE__ */
|
|
1662
|
-
isStatTypesError && !hasVisibleStatTypes && /* @__PURE__ */
|
|
1663
|
-
/* @__PURE__ */
|
|
1664
|
-
|
|
1906
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex flex-col space-y-4 xl:flex-1 xl:min-h-0 xl:overflow-hidden", children: [
|
|
1907
|
+
isStatTypesError && !hasVisibleStatTypes && /* @__PURE__ */ jsx18("p", { className: "text-text-secondary text-13.5", children: "Couldn't load stat categories -- showing limited columns." }),
|
|
1908
|
+
/* @__PURE__ */ jsx18(
|
|
1909
|
+
BaseTable4,
|
|
1665
1910
|
{
|
|
1666
1911
|
columns,
|
|
1667
1912
|
data: stats,
|
|
@@ -1697,27 +1942,27 @@ function TeamStatsTable({
|
|
|
1697
1942
|
isSmallLaptop,
|
|
1698
1943
|
className
|
|
1699
1944
|
}) {
|
|
1700
|
-
const [requestedStatCategory, setRequestedStatCategory] =
|
|
1945
|
+
const [requestedStatCategory, setRequestedStatCategory] = useState6(null);
|
|
1701
1946
|
const availableStatCategories = getAvailableStatCategories(stats);
|
|
1702
1947
|
const selectedStatCategory = deriveSelectedStatCategory(
|
|
1703
1948
|
requestedStatCategory,
|
|
1704
1949
|
availableStatCategories
|
|
1705
1950
|
);
|
|
1706
1951
|
if (isTeamError) {
|
|
1707
|
-
return /* @__PURE__ */
|
|
1952
|
+
return /* @__PURE__ */ jsx18(Card9, { className: cn16("border-0", className), children: /* @__PURE__ */ jsx18(CardContent9, { className: "p-4 flex justify-center items-center", children: /* @__PURE__ */ jsx18("p", { className: "text-text-secondary", children: "Couldn't load team information. Please try again." }) }) });
|
|
1708
1953
|
}
|
|
1709
1954
|
if (seasonsLoading || sportId === null) {
|
|
1710
|
-
return /* @__PURE__ */
|
|
1711
|
-
/* @__PURE__ */
|
|
1712
|
-
/* @__PURE__ */
|
|
1713
|
-
/* @__PURE__ */
|
|
1714
|
-
/* @__PURE__ */
|
|
1955
|
+
return /* @__PURE__ */ jsx18(Card9, { className: cn16("border-0", className), children: /* @__PURE__ */ jsxs18(CardContent9, { className: "space-y-4 pt-6", children: [
|
|
1956
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-3 sm:flex-row justify-start", children: [
|
|
1957
|
+
/* @__PURE__ */ jsx18(Skeleton6, { className: "h-7 w-[68px] bg-form rounded-[5px]" }),
|
|
1958
|
+
/* @__PURE__ */ jsx18(Skeleton6, { className: "h-7 w-[142px] bg-form rounded-[5px]" }),
|
|
1959
|
+
/* @__PURE__ */ jsx18(Skeleton6, { className: "h-7 w-[102px] bg-form rounded-[5px]" })
|
|
1715
1960
|
] }),
|
|
1716
|
-
/* @__PURE__ */
|
|
1961
|
+
/* @__PURE__ */ jsx18(Skeleton6, { className: "h-40 w-full bg-form !mt-3" })
|
|
1717
1962
|
] }) });
|
|
1718
1963
|
}
|
|
1719
1964
|
if (!seasons || seasons.years.length === 0) {
|
|
1720
|
-
return /* @__PURE__ */
|
|
1965
|
+
return /* @__PURE__ */ jsx18(Card9, { className: cn16("border-none", className), children: /* @__PURE__ */ jsx18(CardContent9, { className: "pt-6", children: /* @__PURE__ */ jsx18("div", { className: "text-center py-8", children: /* @__PURE__ */ jsx18("p", { className: "text-text-primary text-14.5 font-normal leading-normal", children: isSeasonsError ? "Couldn't load stats. Please try again." : "There are no stats for this team at this time." }) }) }) });
|
|
1721
1966
|
}
|
|
1722
1967
|
const visibleStatTypes = getVisibleTeamStatTypes(statTypes, sportId);
|
|
1723
1968
|
const filteredStatTypes = getOrderedTeamStatTypesForCategory(
|
|
@@ -1735,16 +1980,16 @@ function TeamStatsTable({
|
|
|
1735
1980
|
isSmallLaptop
|
|
1736
1981
|
});
|
|
1737
1982
|
const emptyMessage = getStatsEmptyMessage(seasons, stats.length);
|
|
1738
|
-
return /* @__PURE__ */
|
|
1739
|
-
|
|
1983
|
+
return /* @__PURE__ */ jsxs18(
|
|
1984
|
+
Card9,
|
|
1740
1985
|
{
|
|
1741
|
-
className:
|
|
1986
|
+
className: cn16(
|
|
1742
1987
|
"border-none p-4 flex flex-col gap-3 xl:h-full xl:min-h-0 xl:flex-1 xl:overflow-hidden",
|
|
1743
1988
|
className
|
|
1744
1989
|
),
|
|
1745
1990
|
children: [
|
|
1746
|
-
/* @__PURE__ */
|
|
1747
|
-
/* @__PURE__ */
|
|
1991
|
+
/* @__PURE__ */ jsx18(CardHeader6, { className: "p-0", children: /* @__PURE__ */ jsx18(CardTitle6, { children: "Stats" }) }),
|
|
1992
|
+
/* @__PURE__ */ jsx18(CardContent9, { className: "space-y-0 p-0 flex flex-col gap-3 xl:flex-1 xl:min-h-0 xl:overflow-hidden", children: /* @__PURE__ */ jsx18(
|
|
1748
1993
|
StatsBody2,
|
|
1749
1994
|
{
|
|
1750
1995
|
seasons,
|
|
@@ -1770,15 +2015,15 @@ function TeamStatsTable({
|
|
|
1770
2015
|
|
|
1771
2016
|
// src/team/team-schedule-table.tsx
|
|
1772
2017
|
import {
|
|
1773
|
-
BaseTable as
|
|
1774
|
-
Card as
|
|
1775
|
-
CardContent as
|
|
2018
|
+
BaseTable as BaseTable5,
|
|
2019
|
+
Card as Card10,
|
|
2020
|
+
CardContent as CardContent10,
|
|
1776
2021
|
CardHeader as CardHeader7,
|
|
1777
2022
|
CardTitle as CardTitle7,
|
|
1778
2023
|
IconLoader as IconLoader3,
|
|
1779
|
-
cn as
|
|
2024
|
+
cn as cn17
|
|
1780
2025
|
} from "@nukleus-sports/ui-web";
|
|
1781
|
-
import { Fragment as
|
|
2026
|
+
import { Fragment as Fragment7, jsx as jsx19, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1782
2027
|
var SPECIAL_LOGO_LEAGUES = ["NFL", "NBA", "NHL", "MLB", "WNBA"];
|
|
1783
2028
|
var COLLEGE_LEAGUE_IDS = [2, 6, 13];
|
|
1784
2029
|
var COMPLETED_STATUS_ID = "3";
|
|
@@ -1827,12 +2072,12 @@ function showsMlbLeaders(leagueId) {
|
|
|
1827
2072
|
}
|
|
1828
2073
|
function leaderCell(leader, small = false) {
|
|
1829
2074
|
if (!leader) return "--";
|
|
1830
|
-
return /* @__PURE__ */
|
|
1831
|
-
/* @__PURE__ */
|
|
1832
|
-
/* @__PURE__ */
|
|
2075
|
+
return /* @__PURE__ */ jsxs19("div", { className: "flex flex-col leading-tight", children: [
|
|
2076
|
+
/* @__PURE__ */ jsx19("span", { className: "text-text-primary font-normal truncate", children: leader.displayName }),
|
|
2077
|
+
/* @__PURE__ */ jsx19(
|
|
1833
2078
|
"span",
|
|
1834
2079
|
{
|
|
1835
|
-
className:
|
|
2080
|
+
className: cn17(
|
|
1836
2081
|
small ? "text-text-secondary text-11" : "text-text-primary body-text",
|
|
1837
2082
|
"truncate"
|
|
1838
2083
|
),
|
|
@@ -1849,7 +2094,7 @@ function formatScheduleDate(game) {
|
|
|
1849
2094
|
const [year, month, day] = rawDate.split("T")[0].split("-").map(Number);
|
|
1850
2095
|
return new Date(year, month - 1, day);
|
|
1851
2096
|
})();
|
|
1852
|
-
return /* @__PURE__ */
|
|
2097
|
+
return /* @__PURE__ */ jsx19("span", { className: "text-text-primary body-text", children: DATE_FORMAT2.format(date) });
|
|
1853
2098
|
} catch {
|
|
1854
2099
|
return "--";
|
|
1855
2100
|
}
|
|
@@ -1867,9 +2112,9 @@ function getScheduleResult(game, teamEspnId) {
|
|
|
1867
2112
|
const winLoss = tied ? "T" : own.winner === true ? "W" : "L";
|
|
1868
2113
|
const score = `${formatScore(own.score)}-${formatScore(other.score)}`;
|
|
1869
2114
|
const colorClass = winLoss === "W" ? "text-primary-color-nuk-text" : winLoss === "L" ? "text-semantic-color-status-priority-blocked-hot-copy" : "text-text-primary";
|
|
1870
|
-
return /* @__PURE__ */
|
|
1871
|
-
/* @__PURE__ */
|
|
1872
|
-
/* @__PURE__ */
|
|
2115
|
+
return /* @__PURE__ */ jsxs19("div", { className: "flex items-baseline gap-1 leading-tight", children: [
|
|
2116
|
+
/* @__PURE__ */ jsx19("span", { className: cn17(colorClass, "body-text"), children: winLoss }),
|
|
2117
|
+
/* @__PURE__ */ jsx19("span", { className: "text-text-primary body-text", children: score })
|
|
1873
2118
|
] });
|
|
1874
2119
|
}
|
|
1875
2120
|
function getScheduleRecord(game, teamEspnId) {
|
|
@@ -1880,7 +2125,7 @@ function getScheduleRecord(game, teamEspnId) {
|
|
|
1880
2125
|
function getWinningGoalie(game) {
|
|
1881
2126
|
const athlete = firstCompetition(game)?.featuredAthletes?.[0]?.athlete;
|
|
1882
2127
|
if (!athlete?.lastName) return "--";
|
|
1883
|
-
return /* @__PURE__ */
|
|
2128
|
+
return /* @__PURE__ */ jsx19("div", { className: "flex flex-col leading-tight", children: /* @__PURE__ */ jsx19("span", { className: "text-text-primary font-normal truncate", children: athlete.lastName }) });
|
|
1884
2129
|
}
|
|
1885
2130
|
function getHockeyTopPlayer(game) {
|
|
1886
2131
|
const competitors = firstCompetition(game)?.competitors;
|
|
@@ -1897,9 +2142,9 @@ function getMlbPitcher(game, pitcherType) {
|
|
|
1897
2142
|
const athlete = pitcher?.athlete;
|
|
1898
2143
|
if (!athlete?.lastName) return "--";
|
|
1899
2144
|
const stat = pitcherType === "savingPitcher" ? athlete.saves : athlete.record;
|
|
1900
|
-
return /* @__PURE__ */
|
|
1901
|
-
/* @__PURE__ */
|
|
1902
|
-
/* @__PURE__ */
|
|
2145
|
+
return /* @__PURE__ */ jsxs19("div", { className: "flex flex-col leading-tight", children: [
|
|
2146
|
+
/* @__PURE__ */ jsx19("span", { className: "text-text-primary font-normal truncate", children: athlete.lastName }),
|
|
2147
|
+
/* @__PURE__ */ jsx19("span", { className: "text-text-secondary text-11 truncate", children: stat || "--" })
|
|
1903
2148
|
] });
|
|
1904
2149
|
}
|
|
1905
2150
|
function OpponentCell({
|
|
@@ -1912,15 +2157,15 @@ function OpponentCell({
|
|
|
1912
2157
|
showName
|
|
1913
2158
|
}) {
|
|
1914
2159
|
const match = findCompetitor(firstCompetition(game)?.competitors, teamEspnId);
|
|
1915
|
-
if (!match || leagueId === null || !leagueAbbreviation) return /* @__PURE__ */
|
|
2160
|
+
if (!match || leagueId === null || !leagueAbbreviation) return /* @__PURE__ */ jsx19(Fragment7, { children: "--" });
|
|
1916
2161
|
const prefix = match.own.homeAway === "home" ? "vs" : "@";
|
|
1917
2162
|
const opponentTeam = match.other.team;
|
|
1918
2163
|
const isSpecialLeague = SPECIAL_LOGO_LEAGUES.includes(leagueAbbreviation);
|
|
1919
2164
|
const identifier = isSpecialLeague ? opponentTeam.abbreviation : opponentTeam.id;
|
|
1920
2165
|
const folder = COLLEGE_LEAGUE_IDS.includes(leagueId) ? "NCAA" : leagueAbbreviation;
|
|
1921
|
-
return /* @__PURE__ */
|
|
1922
|
-
/* @__PURE__ */
|
|
1923
|
-
/* @__PURE__ */
|
|
2166
|
+
return /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-1 sm:gap-2 h-full overflow-hidden", children: [
|
|
2167
|
+
/* @__PURE__ */ jsx19("span", { className: "text-text-primary body-text shrink-0 sm:w-4", children: prefix }),
|
|
2168
|
+
/* @__PURE__ */ jsx19(
|
|
1924
2169
|
"img",
|
|
1925
2170
|
{
|
|
1926
2171
|
src: resolveLogoUrl(folder, identifier),
|
|
@@ -1932,7 +2177,7 @@ function OpponentCell({
|
|
|
1932
2177
|
}
|
|
1933
2178
|
}
|
|
1934
2179
|
),
|
|
1935
|
-
showName && /* @__PURE__ */
|
|
2180
|
+
showName && /* @__PURE__ */ jsx19("span", { className: "text-primary-color-nuk-text body-text line-clamp-2", children: opponentTeam.displayName })
|
|
1936
2181
|
] });
|
|
1937
2182
|
}
|
|
1938
2183
|
function buildScheduleColumns({
|
|
@@ -1948,15 +2193,15 @@ function buildScheduleColumns({
|
|
|
1948
2193
|
return [
|
|
1949
2194
|
{
|
|
1950
2195
|
id: "game_date",
|
|
1951
|
-
header: () => /* @__PURE__ */
|
|
2196
|
+
header: () => /* @__PURE__ */ jsx19("div", { className: "w-[50px] shrink-0", children: "Date" }),
|
|
1952
2197
|
accessorFn: (row) => row.game_date,
|
|
1953
2198
|
cell: ({ row }) => formatScheduleDate(row.original),
|
|
1954
2199
|
meta: { cellSize: isSm ? "xs" : "xxs" }
|
|
1955
2200
|
},
|
|
1956
2201
|
{
|
|
1957
2202
|
id: "opponent",
|
|
1958
|
-
header: () => /* @__PURE__ */
|
|
1959
|
-
cell: ({ row }) => /* @__PURE__ */
|
|
2203
|
+
header: () => /* @__PURE__ */ jsx19("div", { children: isSm ? "Opponent" : "Opp" }),
|
|
2204
|
+
cell: ({ row }) => /* @__PURE__ */ jsx19(
|
|
1960
2205
|
OpponentCell,
|
|
1961
2206
|
{
|
|
1962
2207
|
game: row.original,
|
|
@@ -2072,15 +2317,15 @@ function ScheduleBody({
|
|
|
2072
2317
|
isSmallLaptop
|
|
2073
2318
|
}) {
|
|
2074
2319
|
if (seasonsLoading) {
|
|
2075
|
-
return /* @__PURE__ */
|
|
2320
|
+
return /* @__PURE__ */ jsx19("div", { className: "flex justify-center py-8", children: /* @__PURE__ */ jsx19("div", { className: "text-sm text-text-primary", children: "Loading seasons..." }) });
|
|
2076
2321
|
}
|
|
2077
2322
|
if (!seasons || seasons.years.length === 0) {
|
|
2078
|
-
return /* @__PURE__ */
|
|
2323
|
+
return /* @__PURE__ */ jsx19("div", { className: "text-center py-8", children: /* @__PURE__ */ jsx19("p", { className: "text-text-primary", children: isSeasonsError ? "Couldn't load seasons. Please try again." : "No seasons found" }) });
|
|
2079
2324
|
}
|
|
2080
|
-
return /* @__PURE__ */
|
|
2081
|
-
/* @__PURE__ */
|
|
2082
|
-
/* @__PURE__ */
|
|
2083
|
-
|
|
2325
|
+
return /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-3 xl:flex-1 xl:min-h-0 xl:overflow-hidden", children: [
|
|
2326
|
+
/* @__PURE__ */ jsx19(SeasonSelector, { ...seasons, className: "gap-2 min-[360px]:gap-3 xl:shrink-0" }),
|
|
2327
|
+
/* @__PURE__ */ jsx19("div", { className: "xl:flex-1 xl:min-h-0 xl:overflow-hidden", children: /* @__PURE__ */ jsx19(
|
|
2328
|
+
BaseTable5,
|
|
2084
2329
|
{
|
|
2085
2330
|
columns,
|
|
2086
2331
|
data: games,
|
|
@@ -2123,24 +2368,24 @@ function TeamScheduleTable({
|
|
|
2123
2368
|
isSmallLaptop
|
|
2124
2369
|
});
|
|
2125
2370
|
if (isTeamError) {
|
|
2126
|
-
return /* @__PURE__ */
|
|
2371
|
+
return /* @__PURE__ */ jsx19(Card10, { className: cn17("border-0", className), children: /* @__PURE__ */ jsx19(CardContent10, { className: "p-4 flex justify-center items-center", children: /* @__PURE__ */ jsx19("p", { className: "text-text-secondary", children: "Couldn't load team information. Please try again." }) }) });
|
|
2127
2372
|
}
|
|
2128
2373
|
if (leagueId === null) {
|
|
2129
|
-
return /* @__PURE__ */
|
|
2130
|
-
/* @__PURE__ */
|
|
2131
|
-
/* @__PURE__ */
|
|
2374
|
+
return /* @__PURE__ */ jsx19(Card10, { className: cn17("border-0", className), children: /* @__PURE__ */ jsxs19(CardContent10, { className: "p-4 flex justify-center items-center gap-2", children: [
|
|
2375
|
+
/* @__PURE__ */ jsx19(IconLoader3, {}),
|
|
2376
|
+
/* @__PURE__ */ jsx19("p", { className: "text-text-secondary", children: "Loading team information..." })
|
|
2132
2377
|
] }) });
|
|
2133
2378
|
}
|
|
2134
|
-
return /* @__PURE__ */
|
|
2135
|
-
|
|
2379
|
+
return /* @__PURE__ */ jsxs19(
|
|
2380
|
+
Card10,
|
|
2136
2381
|
{
|
|
2137
|
-
className:
|
|
2382
|
+
className: cn17(
|
|
2138
2383
|
"border-none p-4 flex flex-col gap-3 xl:h-full xl:min-h-0 xl:flex-1 xl:overflow-hidden",
|
|
2139
2384
|
className
|
|
2140
2385
|
),
|
|
2141
2386
|
children: [
|
|
2142
|
-
/* @__PURE__ */
|
|
2143
|
-
/* @__PURE__ */
|
|
2387
|
+
/* @__PURE__ */ jsx19(CardHeader7, { className: "p-0 flex flex-row items-center justify-between space-y-0", children: /* @__PURE__ */ jsx19(CardTitle7, { children: "Schedule" }) }),
|
|
2388
|
+
/* @__PURE__ */ jsx19(CardContent10, { className: "space-y-0 p-0 flex flex-col gap-3 xl:flex-1 xl:min-h-0 xl:overflow-hidden", children: /* @__PURE__ */ jsx19(
|
|
2144
2389
|
ScheduleBody,
|
|
2145
2390
|
{
|
|
2146
2391
|
seasonsLoading,
|
|
@@ -2171,6 +2416,8 @@ export {
|
|
|
2171
2416
|
TeamFactsWidget,
|
|
2172
2417
|
TeamHeaderCard,
|
|
2173
2418
|
TeamInfoCard,
|
|
2419
|
+
TeamPlacesCard,
|
|
2420
|
+
TeamRosterTable,
|
|
2174
2421
|
TeamScheduleTable,
|
|
2175
2422
|
TeamSeasonScheduleSummaryPanel,
|
|
2176
2423
|
TeamSeasonStatsSummaryPanel,
|