@nukleus-sports/ui-patterns 0.6.4 → 0.7.1
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/team.cjs +352 -328
- package/dist/team.cjs.map +1 -1
- package/dist/team.d.cts +13 -1
- package/dist/team.d.ts +13 -1
- package/dist/team.js +313 -290
- package/dist/team.js.map +1 -1
- package/package.json +3 -3
package/dist/team.cjs
CHANGED
|
@@ -30,6 +30,7 @@ __export(team_exports, {
|
|
|
30
30
|
StatRankingLeaderboardDialog: () => StatRankingLeaderboardDialog,
|
|
31
31
|
TeamFactsContent: () => TeamFactsContent,
|
|
32
32
|
TeamFactsWidget: () => TeamFactsWidget,
|
|
33
|
+
TeamHeaderCard: () => TeamHeaderCard,
|
|
33
34
|
TeamInfoCard: () => TeamInfoCard,
|
|
34
35
|
TeamScheduleTable: () => TeamScheduleTable,
|
|
35
36
|
TeamSeasonScheduleSummaryPanel: () => TeamSeasonScheduleSummaryPanel,
|
|
@@ -392,11 +393,34 @@ function TeamInfoCard({ team, resolveImageUrl, className }) {
|
|
|
392
393
|
);
|
|
393
394
|
}
|
|
394
395
|
|
|
395
|
-
// src/team/team-
|
|
396
|
-
var import_react = require("react");
|
|
396
|
+
// src/team/team-header-card.tsx
|
|
397
397
|
var import_ui_web3 = require("@nukleus-sports/ui-web");
|
|
398
398
|
var import_core2 = require("@nukleus-sports/core");
|
|
399
399
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
400
|
+
function TeamHeaderCard({ team, logoUrl, className }) {
|
|
401
|
+
const displayName = (0, import_core2.formatTeamName)(team.team, team.nickname) || "Team not found";
|
|
402
|
+
const initials = (0, import_core2.getTeamInitials)(team.team);
|
|
403
|
+
const conferenceInfo = (0, import_core2.getTeamConferenceInfo)(
|
|
404
|
+
team.specificData?.conference,
|
|
405
|
+
team.specificData?.division
|
|
406
|
+
);
|
|
407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ui_web3.Card, { className: (0, import_ui_web3.cn)("border-0", className), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ui_web3.CardContent, { className: "flex h-full items-center gap-6 p-4 sm:p-6", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex min-w-0 items-center gap-3 sm:gap-0", children: [
|
|
408
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_ui_web3.Avatar, { className: "h-20 w-20 shrink-0 rounded-none min-[400px]:h-28 min-[400px]:w-28 sm:h-40 sm:w-40", children: [
|
|
409
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ui_web3.AvatarImage, { src: logoUrl ?? void 0, alt: `${displayName} logo` }),
|
|
410
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ui_web3.AvatarFallback, { className: "text-2xl font-bold", children: initials })
|
|
411
|
+
] }),
|
|
412
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex min-w-0 flex-col justify-center gap-1 sm:gap-2 sm:px-4", children: [
|
|
413
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h1", { className: "break-words text-[20px] font-black leading-tight text-text-primary min-[400px]:text-[24px] sm:player-card-name", children: displayName }),
|
|
414
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-sm text-text-primary", children: conferenceInfo })
|
|
415
|
+
] })
|
|
416
|
+
] }) }) });
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
// src/team/team-staff-table.tsx
|
|
420
|
+
var import_react = require("react");
|
|
421
|
+
var import_ui_web4 = require("@nukleus-sports/ui-web");
|
|
422
|
+
var import_core3 = require("@nukleus-sports/core");
|
|
423
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
400
424
|
var CATEGORY_ORDER = [
|
|
401
425
|
"Head Coaches",
|
|
402
426
|
"Assistant Coaches",
|
|
@@ -424,7 +448,6 @@ function TeamStaffTable({
|
|
|
424
448
|
const [internalSorting, setInternalSorting] = (0, import_react.useState)(DEFAULT_SORT);
|
|
425
449
|
const activeSorting = sorting ?? internalSorting;
|
|
426
450
|
const handleSortingChange = onSortingChange ?? setInternalSorting;
|
|
427
|
-
const effectiveVirtualized = virtualized && !isSplitLayout;
|
|
428
451
|
const rows = (0, import_react.useMemo)(() => {
|
|
429
452
|
if (staff.length === 0) return [];
|
|
430
453
|
const grouped = /* @__PURE__ */ new Map();
|
|
@@ -434,7 +457,7 @@ function TeamStaffTable({
|
|
|
434
457
|
grouped.get(key).push(member);
|
|
435
458
|
}
|
|
436
459
|
grouped.forEach((list, key) => {
|
|
437
|
-
grouped.set(key, (0,
|
|
460
|
+
grouped.set(key, (0, import_core3.sortTeamStaff)(list, activeSorting));
|
|
438
461
|
});
|
|
439
462
|
const orderedKeys = [
|
|
440
463
|
...CATEGORY_ORDER.filter((k) => grouped.has(k)),
|
|
@@ -457,10 +480,10 @@ function TeamStaffTable({
|
|
|
457
480
|
}
|
|
458
481
|
return result;
|
|
459
482
|
}, [staff, activeSorting]);
|
|
460
|
-
const { visibleItems, sentinelRef, hasMore } = (0,
|
|
483
|
+
const { visibleItems, sentinelRef, hasMore } = (0, import_ui_web4.useInfiniteList)(rows, {
|
|
461
484
|
resetKey: `${staff.length}|${JSON.stringify(activeSorting)}`
|
|
462
485
|
});
|
|
463
|
-
const displayedRows =
|
|
486
|
+
const displayedRows = virtualized ? visibleItems : rows;
|
|
464
487
|
const columns = (0, import_react.useMemo)(() => {
|
|
465
488
|
const activate = (id) => onStaffClick?.(id);
|
|
466
489
|
const interactionProps = (id, ariaLabel) => interactive ? {
|
|
@@ -475,8 +498,8 @@ function TeamStaffTable({
|
|
|
475
498
|
role: "button",
|
|
476
499
|
"aria-label": ariaLabel
|
|
477
500
|
} : {};
|
|
478
|
-
const nameHeader = sortable ? (0,
|
|
479
|
-
const positionHeader = sortable ? (0,
|
|
501
|
+
const nameHeader = sortable ? (0, import_ui_web4.createClickableSortableHeader)("Name") : "Name";
|
|
502
|
+
const positionHeader = sortable ? (0, import_ui_web4.createClickableSortableHeader)("Position") : "Position";
|
|
480
503
|
return [
|
|
481
504
|
{
|
|
482
505
|
id: "name",
|
|
@@ -486,13 +509,13 @@ function TeamStaffTable({
|
|
|
486
509
|
const member = row.original;
|
|
487
510
|
const fullName = `${member.first_name} ${member.last_name}`.trim();
|
|
488
511
|
const labelText = `View ${fullName}'s profile`;
|
|
489
|
-
return /* @__PURE__ */ (0,
|
|
490
|
-
/* @__PURE__ */ (0,
|
|
512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex gap-2 items-center w-full line-clamp-2", children: [
|
|
513
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
491
514
|
"div",
|
|
492
515
|
{
|
|
493
|
-
className: (0,
|
|
516
|
+
className: (0, import_ui_web4.cn)("flex items-center justify-center", interactive && "cursor-pointer"),
|
|
494
517
|
...interactionProps(member.id, labelText),
|
|
495
|
-
children: /* @__PURE__ */ (0,
|
|
518
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
496
519
|
EntityAvatar,
|
|
497
520
|
{
|
|
498
521
|
entityType: "coach",
|
|
@@ -507,10 +530,10 @@ function TeamStaffTable({
|
|
|
507
530
|
)
|
|
508
531
|
}
|
|
509
532
|
),
|
|
510
|
-
/* @__PURE__ */ (0,
|
|
533
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
511
534
|
"div",
|
|
512
535
|
{
|
|
513
|
-
className: (0,
|
|
536
|
+
className: (0, import_ui_web4.cn)("line-clamp-2", interactive && "cursor-pointer"),
|
|
514
537
|
...interactionProps(member.id, labelText),
|
|
515
538
|
children: fullName
|
|
516
539
|
}
|
|
@@ -523,10 +546,10 @@ function TeamStaffTable({
|
|
|
523
546
|
id: "position",
|
|
524
547
|
header: positionHeader,
|
|
525
548
|
accessorFn: (row) => row.position || "-",
|
|
526
|
-
cell: ({ row }) => /* @__PURE__ */ (0,
|
|
549
|
+
cell: ({ row }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex items-center h-full min-h-[46px]", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
527
550
|
"span",
|
|
528
551
|
{
|
|
529
|
-
className: (0,
|
|
552
|
+
className: (0, import_ui_web4.cn)("line-clamp-2 break-words", interactive && "cursor-pointer"),
|
|
530
553
|
...interactionProps(
|
|
531
554
|
row.original.id,
|
|
532
555
|
`View ${row.original.first_name} ${row.original.last_name}'s position`
|
|
@@ -538,8 +561,8 @@ function TeamStaffTable({
|
|
|
538
561
|
}
|
|
539
562
|
];
|
|
540
563
|
}, [interactive, onStaffClick, sortable, isCompact, resolveImageUrl]);
|
|
541
|
-
return /* @__PURE__ */ (0,
|
|
542
|
-
|
|
564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "w-full xl:flex xl:h-full xl:flex-1 xl:min-h-0 xl:flex-col xl:overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
565
|
+
import_ui_web4.BaseTable,
|
|
543
566
|
{
|
|
544
567
|
columns,
|
|
545
568
|
data: displayedRows,
|
|
@@ -552,18 +575,18 @@ function TeamStaffTable({
|
|
|
552
575
|
loading,
|
|
553
576
|
emptyMessage: isError ? "Failed to load coaching staff. Please try again." : "No coaches found.",
|
|
554
577
|
pageSize: Math.max(displayedRows.length, 25),
|
|
555
|
-
hidePagination:
|
|
578
|
+
hidePagination: virtualized,
|
|
556
579
|
stickyHeader: true,
|
|
557
580
|
splitLayout: isSplitLayout,
|
|
558
581
|
numberOfColumns: 1,
|
|
559
582
|
splitLayoutGridCols: isCompact ? "!grid-cols-[minmax(120px,120px)_1fr]" : isSplitLayout ? "sm:!grid-cols-[minmax(220px,220px)_1fr]" : "",
|
|
560
|
-
containerClassName: (0,
|
|
561
|
-
className: (0,
|
|
583
|
+
containerClassName: (0, import_ui_web4.cn)("border-0 rounded-none xl:h-full", virtualized && "h-full"),
|
|
584
|
+
className: (0, import_ui_web4.cn)(
|
|
562
585
|
"border-none xl:flex-1 xl:min-h-0 xl:overflow-hidden",
|
|
563
|
-
|
|
586
|
+
virtualized && "h-full min-h-0 w-full",
|
|
564
587
|
className
|
|
565
588
|
),
|
|
566
|
-
bottomContent:
|
|
589
|
+
bottomContent: virtualized && hasMore ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { ref: sentinelRef, className: "h-px w-full" }) : null,
|
|
567
590
|
getRowBanner: (row) => row.__isCategoryRow ? row.__categoryLabel : null,
|
|
568
591
|
bannerRowClassName: "bg-greys-background-hover hover:bg-greys-background-hover",
|
|
569
592
|
getRowClassName: (row) => row.__isCategoryRow ? "hidden" : ""
|
|
@@ -572,11 +595,11 @@ function TeamStaffTable({
|
|
|
572
595
|
}
|
|
573
596
|
|
|
574
597
|
// src/team/stat-column.tsx
|
|
575
|
-
var
|
|
598
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
576
599
|
function StatColumn({ label, value, suffix, rankBadge }) {
|
|
577
|
-
return /* @__PURE__ */ (0,
|
|
578
|
-
/* @__PURE__ */ (0,
|
|
579
|
-
/* @__PURE__ */ (0,
|
|
600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-col items-center h-full justify-center flex-1 gap-1 sm:gap-3 w-full", children: [
|
|
601
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "label-xs-medium text-text-secondary leading-normal opacity-[0.8] ss05", children: label }),
|
|
602
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "text-[19px] font-semibold sm:text-[32px] sm:font-bold text-text-primary leading-normal title-text opacity-[0.8]", children: [
|
|
580
603
|
value,
|
|
581
604
|
suffix || ""
|
|
582
605
|
] }),
|
|
@@ -585,9 +608,9 @@ function StatColumn({ label, value, suffix, rankBadge }) {
|
|
|
585
608
|
}
|
|
586
609
|
|
|
587
610
|
// src/team/team-season-stats-summary-panel.tsx
|
|
588
|
-
var
|
|
589
|
-
var
|
|
590
|
-
var
|
|
611
|
+
var import_ui_web5 = require("@nukleus-sports/ui-web");
|
|
612
|
+
var import_core4 = require("@nukleus-sports/core");
|
|
613
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
591
614
|
function getStatusMessage({
|
|
592
615
|
isSupportedSport,
|
|
593
616
|
selectedYear,
|
|
@@ -610,17 +633,17 @@ function TeamSeasonStatsSummaryPanel({
|
|
|
610
633
|
isError,
|
|
611
634
|
className
|
|
612
635
|
}) {
|
|
613
|
-
const columns = (0,
|
|
636
|
+
const columns = (0, import_core4.getTeamStatColumns)(sportId);
|
|
614
637
|
const statusMessage = loading ? null : getStatusMessage({
|
|
615
|
-
isSupportedSport: (0,
|
|
638
|
+
isSupportedSport: (0, import_core4.isSupportedTeamStatsSport)(sportId),
|
|
616
639
|
selectedYear,
|
|
617
640
|
selectedType,
|
|
618
641
|
isError,
|
|
619
642
|
stats
|
|
620
643
|
});
|
|
621
|
-
return /* @__PURE__ */ (0,
|
|
622
|
-
/* @__PURE__ */ (0,
|
|
623
|
-
/* @__PURE__ */ (0,
|
|
644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_ui_web5.Card, { className: (0, import_ui_web5.cn)("border-0 p-4 flex flex-col gap-4", className), children: [
|
|
645
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ui_web5.CardHeader, { className: "p-0", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ui_web5.CardTitle, { className: "text-base text-text-primary font-medium leading-normal", children: "Season Stats" }) }),
|
|
646
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ui_web5.CardContent, { className: "p-0 flex-1 flex justify-center items-center", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex items-center justify-center w-full", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ui_web5.Skeleton, { className: "h-4 w-3/4" }) }) : statusMessage ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex items-center justify-center w-full text-14.5 text-text-secondary", children: statusMessage }) : stats && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("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__ */ (0, import_jsx_runtime6.jsx)(
|
|
624
647
|
StatColumn,
|
|
625
648
|
{
|
|
626
649
|
label: col.label,
|
|
@@ -633,8 +656,8 @@ function TeamSeasonStatsSummaryPanel({
|
|
|
633
656
|
}
|
|
634
657
|
|
|
635
658
|
// src/team/team-season-schedule-summary-panel.tsx
|
|
636
|
-
var
|
|
637
|
-
var
|
|
659
|
+
var import_ui_web6 = require("@nukleus-sports/ui-web");
|
|
660
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
638
661
|
function TeamSeasonScheduleSummaryPanel({
|
|
639
662
|
selectedYear,
|
|
640
663
|
selectedType,
|
|
@@ -643,11 +666,11 @@ function TeamSeasonScheduleSummaryPanel({
|
|
|
643
666
|
isError,
|
|
644
667
|
className
|
|
645
668
|
}) {
|
|
646
|
-
return /* @__PURE__ */ (0,
|
|
647
|
-
/* @__PURE__ */ (0,
|
|
648
|
-
/* @__PURE__ */ (0,
|
|
649
|
-
/* @__PURE__ */ (0,
|
|
650
|
-
/* @__PURE__ */ (0,
|
|
669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_ui_web6.Card, { className: (0, import_ui_web6.cn)("border-0 p-4 flex flex-col gap-4", className), children: [
|
|
670
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_ui_web6.CardHeader, { className: "p-0", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_ui_web6.CardTitle, { className: "text-base text-text-primary font-medium leading-normal", children: "Season Summary" }) }),
|
|
671
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_ui_web6.CardContent, { className: "p-0 flex-1 flex justify-center items-center", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex items-center justify-center w-full", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_ui_web6.Skeleton, { className: "h-4 w-3/4" }) }) : !selectedYear || selectedType === null ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("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__ */ (0, import_jsx_runtime7.jsx)("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__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex items-center justify-center w-full text-14.5 text-text-secondary", children: "No schedule data for the current season." }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w-full flex flex-col sm:flex-row gap-6 sm:gap-3 justify-between items-center", children: [
|
|
672
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(StatColumn, { label: "Record", value: summary.record }),
|
|
673
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
651
674
|
StatColumn,
|
|
652
675
|
{
|
|
653
676
|
label: "Games Played",
|
|
@@ -659,8 +682,8 @@ function TeamSeasonScheduleSummaryPanel({
|
|
|
659
682
|
}
|
|
660
683
|
|
|
661
684
|
// src/team/season-selector.tsx
|
|
662
|
-
var
|
|
663
|
-
var
|
|
685
|
+
var import_ui_web7 = require("@nukleus-sports/ui-web");
|
|
686
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
664
687
|
function SeasonSelector({
|
|
665
688
|
years,
|
|
666
689
|
types,
|
|
@@ -671,39 +694,39 @@ function SeasonSelector({
|
|
|
671
694
|
hideTypeOnMobile = false,
|
|
672
695
|
className
|
|
673
696
|
}) {
|
|
674
|
-
return /* @__PURE__ */ (0,
|
|
675
|
-
/* @__PURE__ */ (0,
|
|
676
|
-
|
|
697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_ui_web7.cn)("flex gap-3", className), children: [
|
|
698
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
699
|
+
import_ui_web7.Select,
|
|
677
700
|
{
|
|
678
701
|
value: selectedYear?.toString() ?? "",
|
|
679
702
|
onValueChange: (value) => onYearChange(Number(value)),
|
|
680
703
|
children: [
|
|
681
|
-
/* @__PURE__ */ (0,
|
|
682
|
-
/* @__PURE__ */ (0,
|
|
683
|
-
|
|
704
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_ui_web7.SelectTrigger, { variant: "widget", size: "widget", "aria-label": "Season year", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_ui_web7.SelectValue, { placeholder: "Select year" }) }),
|
|
705
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
706
|
+
import_ui_web7.SelectContent,
|
|
684
707
|
{
|
|
685
708
|
className: "bg-card border-border z-50 [&_.checkbox]:!flex",
|
|
686
709
|
classNameViewPort: "gap-2",
|
|
687
|
-
children: years.map((year) => /* @__PURE__ */ (0,
|
|
710
|
+
children: years.map((year) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_ui_web7.SelectItem, { value: year.value.toString(), className: "min-h-8", children: year.label }, year.value))
|
|
688
711
|
}
|
|
689
712
|
)
|
|
690
713
|
]
|
|
691
714
|
}
|
|
692
715
|
),
|
|
693
|
-
/* @__PURE__ */ (0,
|
|
694
|
-
|
|
716
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: (0, import_ui_web7.cn)(hideTypeOnMobile && "hidden sm:block"), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
717
|
+
import_ui_web7.Select,
|
|
695
718
|
{
|
|
696
719
|
value: selectedType?.toString() ?? "",
|
|
697
720
|
onValueChange: (value) => onTypeChange(Number(value)),
|
|
698
721
|
disabled: selectedYear === null,
|
|
699
722
|
children: [
|
|
700
|
-
/* @__PURE__ */ (0,
|
|
701
|
-
/* @__PURE__ */ (0,
|
|
702
|
-
|
|
723
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_ui_web7.SelectTrigger, { variant: "widget", size: "widget", "aria-label": "Season type", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_ui_web7.SelectValue, { placeholder: "Select type" }) }),
|
|
724
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
725
|
+
import_ui_web7.SelectContent,
|
|
703
726
|
{
|
|
704
727
|
className: "bg-card border-border z-50 [&_.checkbox]:!flex",
|
|
705
728
|
classNameViewPort: "gap-2",
|
|
706
|
-
children: types.map((type) => /* @__PURE__ */ (0,
|
|
729
|
+
children: types.map((type) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_ui_web7.SelectItem, { value: type.value.toString(), className: "min-h-8", children: type.label }, type.value))
|
|
707
730
|
}
|
|
708
731
|
)
|
|
709
732
|
]
|
|
@@ -714,8 +737,8 @@ function SeasonSelector({
|
|
|
714
737
|
|
|
715
738
|
// src/team/fact-pills.tsx
|
|
716
739
|
var import_react2 = require("react");
|
|
717
|
-
var
|
|
718
|
-
var
|
|
740
|
+
var import_ui_web8 = require("@nukleus-sports/ui-web");
|
|
741
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
719
742
|
var MAX_ROWS = 2;
|
|
720
743
|
var KEY_SEPARATOR = "";
|
|
721
744
|
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";
|
|
@@ -786,19 +809,19 @@ function FactPills({ items, capped = false }) {
|
|
|
786
809
|
setExpanded(false);
|
|
787
810
|
setVisibleCount(null);
|
|
788
811
|
};
|
|
789
|
-
return /* @__PURE__ */ (0,
|
|
812
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
790
813
|
"ul",
|
|
791
814
|
{
|
|
792
815
|
id: listId,
|
|
793
816
|
ref: listRef,
|
|
794
|
-
className: (0,
|
|
817
|
+
className: (0, import_ui_web8.cn)(
|
|
795
818
|
"flex w-full flex-wrap content-start items-start gap-1",
|
|
796
819
|
collapsible && "overflow-hidden"
|
|
797
820
|
),
|
|
798
821
|
style: collapsible && clipHeight !== null ? { maxHeight: clipHeight } : void 0,
|
|
799
822
|
children: [
|
|
800
|
-
items.slice(0, shownCount).map((item, index) => /* @__PURE__ */ (0,
|
|
801
|
-
truncated && /* @__PURE__ */ (0,
|
|
823
|
+
items.slice(0, shownCount).map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("li", { className: PILL_CLASS, title: String(item), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "truncate", children: item }) }, keys[index])),
|
|
824
|
+
truncated && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("li", { className: "flex shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
802
825
|
"button",
|
|
803
826
|
{
|
|
804
827
|
type: "button",
|
|
@@ -809,7 +832,7 @@ function FactPills({ items, capped = false }) {
|
|
|
809
832
|
children: "Show More"
|
|
810
833
|
}
|
|
811
834
|
) }),
|
|
812
|
-
capped && expanded && /* @__PURE__ */ (0,
|
|
835
|
+
capped && expanded && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("li", { className: "flex shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
813
836
|
"button",
|
|
814
837
|
{
|
|
815
838
|
type: "button",
|
|
@@ -826,9 +849,9 @@ function FactPills({ items, capped = false }) {
|
|
|
826
849
|
}
|
|
827
850
|
|
|
828
851
|
// src/team/fact-field.tsx
|
|
829
|
-
var
|
|
830
|
-
var
|
|
831
|
-
var
|
|
852
|
+
var import_ui_web9 = require("@nukleus-sports/ui-web");
|
|
853
|
+
var import_core5 = require("@nukleus-sports/core");
|
|
854
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
832
855
|
function numberFact(facts, key) {
|
|
833
856
|
const value = facts[key];
|
|
834
857
|
return typeof value === "number" ? value : null;
|
|
@@ -841,23 +864,23 @@ function textFact(facts, key) {
|
|
|
841
864
|
const value = facts[key];
|
|
842
865
|
return typeof value === "string" ? value : null;
|
|
843
866
|
}
|
|
844
|
-
function EmptyValue({ children =
|
|
845
|
-
return /* @__PURE__ */ (0,
|
|
867
|
+
function EmptyValue({ children = import_core5.EMPTY_FACT_VALUE }) {
|
|
868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "body-text font-ss02-ss05 text-text-secondary", children });
|
|
846
869
|
}
|
|
847
870
|
function FieldLabel({ children }) {
|
|
848
|
-
return /* @__PURE__ */ (0,
|
|
871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "w-full label-xs-text font-ss02-ss05 text-text-secondary", children });
|
|
849
872
|
}
|
|
850
873
|
function CountFact({
|
|
851
874
|
factKey,
|
|
852
875
|
data
|
|
853
876
|
}) {
|
|
854
877
|
const { facts, config } = data;
|
|
855
|
-
const pairedYears =
|
|
856
|
-
const years = pairedYears ? (0,
|
|
857
|
-
return /* @__PURE__ */ (0,
|
|
858
|
-
/* @__PURE__ */ (0,
|
|
859
|
-
/* @__PURE__ */ (0,
|
|
860
|
-
years.length > 0 && /* @__PURE__ */ (0,
|
|
878
|
+
const pairedYears = import_core5.TEAM_FACT_YEAR_PAIRS[factKey];
|
|
879
|
+
const years = pairedYears ? (0, import_core5.formatYearPills)(listFact(facts, pairedYears), config.formatChampionshipYear) : [];
|
|
880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex min-w-0 flex-col items-start gap-1", children: [
|
|
881
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FieldLabel, { children: config.labels[factKey] }),
|
|
882
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "stat-count-number title-text text-text-primary", children: (0, import_core5.formatTeamFactNumber)("count", numberFact(facts, factKey)) }),
|
|
883
|
+
years.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FactPills, { items: years, capped: true })
|
|
861
884
|
] });
|
|
862
885
|
}
|
|
863
886
|
function RivalValue({
|
|
@@ -867,14 +890,14 @@ function RivalValue({
|
|
|
867
890
|
}) {
|
|
868
891
|
switch (rival.status) {
|
|
869
892
|
case "none":
|
|
870
|
-
return /* @__PURE__ */ (0,
|
|
893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(EmptyValue, {});
|
|
871
894
|
case "loading":
|
|
872
|
-
return /* @__PURE__ */ (0,
|
|
895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_ui_web9.Skeleton, { className: "h-8 w-40", "aria-label": "Loading rival" });
|
|
873
896
|
case "error":
|
|
874
|
-
return /* @__PURE__ */ (0,
|
|
897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(EmptyValue, { children: "Couldn't load the rival team" });
|
|
875
898
|
case "ready": {
|
|
876
|
-
const content = /* @__PURE__ */ (0,
|
|
877
|
-
/* @__PURE__ */ (0,
|
|
899
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
900
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
878
901
|
EntityAvatar,
|
|
879
902
|
{
|
|
880
903
|
entityType: "initials",
|
|
@@ -885,37 +908,37 @@ function RivalValue({
|
|
|
885
908
|
className: "shrink-0"
|
|
886
909
|
}
|
|
887
910
|
),
|
|
888
|
-
/* @__PURE__ */ (0,
|
|
911
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "min-w-0", children: rival.rival.name })
|
|
889
912
|
] });
|
|
890
913
|
const className = "inline-flex max-w-full items-center gap-1.5 body-text-semibold font-ss02-ss05 text-primary-color-nuk-text";
|
|
891
|
-
return getRivalHref ? /* @__PURE__ */ (0,
|
|
914
|
+
return getRivalHref ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("a", { href: getRivalHref(rival.rival.id), className: (0, import_ui_web9.cn)(className, "hover:underline"), children: content }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className, children: content });
|
|
892
915
|
}
|
|
893
916
|
}
|
|
894
917
|
}
|
|
895
918
|
function factValue(factKey, layout, data, resolveImageUrl, getRivalHref) {
|
|
896
919
|
const { facts, config } = data;
|
|
897
|
-
const kind =
|
|
920
|
+
const kind = import_core5.TEAM_FACT_KINDS[factKey];
|
|
898
921
|
if (kind === "number" || kind === "year" || kind === "text") {
|
|
899
|
-
const display = kind === "text" ? textFact(facts, factKey) : (0,
|
|
900
|
-
const isEmpty = !display || display ===
|
|
901
|
-
return /* @__PURE__ */ (0,
|
|
922
|
+
const display = kind === "text" ? textFact(facts, factKey) : (0, import_core5.formatTeamFactNumber)(kind, numberFact(facts, factKey));
|
|
923
|
+
const isEmpty = !display || display === import_core5.EMPTY_FACT_VALUE;
|
|
924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
902
925
|
"span",
|
|
903
926
|
{
|
|
904
|
-
className: (0,
|
|
927
|
+
className: (0, import_ui_web9.cn)(
|
|
905
928
|
"w-full header-xl-medium-card font-ss02-ss05 [overflow-wrap:anywhere]",
|
|
906
929
|
isEmpty ? "text-text-secondary" : "text-text-primary"
|
|
907
930
|
),
|
|
908
|
-
children: display ??
|
|
931
|
+
children: display ?? import_core5.EMPTY_FACT_VALUE
|
|
909
932
|
}
|
|
910
933
|
);
|
|
911
934
|
}
|
|
912
935
|
if (kind === "years" || kind === "labeled_years" || kind === "list") {
|
|
913
936
|
const raw = listFact(facts, factKey);
|
|
914
|
-
const items = kind === "years" ? (0,
|
|
915
|
-
return items.length > 0 ? /* @__PURE__ */ (0,
|
|
937
|
+
const items = kind === "years" ? (0, import_core5.formatYearPills)(raw, config.formatChampionshipYear) : raw;
|
|
938
|
+
return items.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FactPills, { items, capped: layout === "grid" }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(EmptyValue, {});
|
|
916
939
|
}
|
|
917
940
|
if (kind === "rival") {
|
|
918
|
-
return /* @__PURE__ */ (0,
|
|
941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
919
942
|
RivalValue,
|
|
920
943
|
{
|
|
921
944
|
rival: data.rival,
|
|
@@ -925,14 +948,14 @@ function factValue(factKey, layout, data, resolveImageUrl, getRivalHref) {
|
|
|
925
948
|
);
|
|
926
949
|
}
|
|
927
950
|
const text = textFact(facts, factKey);
|
|
928
|
-
return /* @__PURE__ */ (0,
|
|
951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
929
952
|
"p",
|
|
930
953
|
{
|
|
931
|
-
className: (0,
|
|
954
|
+
className: (0, import_ui_web9.cn)(
|
|
932
955
|
"w-full body-text font-ss02-ss05 whitespace-pre-line",
|
|
933
956
|
text ? "text-text-primary" : "text-text-secondary"
|
|
934
957
|
),
|
|
935
|
-
children: text ??
|
|
958
|
+
children: text ?? import_core5.EMPTY_FACT_VALUE
|
|
936
959
|
}
|
|
937
960
|
);
|
|
938
961
|
}
|
|
@@ -943,18 +966,18 @@ function FactField({
|
|
|
943
966
|
resolveImageUrl,
|
|
944
967
|
getRivalHref
|
|
945
968
|
}) {
|
|
946
|
-
const kind =
|
|
947
|
-
if (kind === "count") return /* @__PURE__ */ (0,
|
|
948
|
-
return /* @__PURE__ */ (0,
|
|
969
|
+
const kind = import_core5.TEAM_FACT_KINDS[factKey];
|
|
970
|
+
if (kind === "count") return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CountFact, { factKey, data });
|
|
971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
949
972
|
"div",
|
|
950
973
|
{
|
|
951
|
-
className: (0,
|
|
974
|
+
className: (0, import_ui_web9.cn)(
|
|
952
975
|
"flex min-w-0 flex-col items-start gap-1.5",
|
|
953
976
|
layout === "row" && "flex-1",
|
|
954
977
|
layout === "grid" && kind !== "list" && "gap-1"
|
|
955
978
|
),
|
|
956
979
|
children: [
|
|
957
|
-
/* @__PURE__ */ (0,
|
|
980
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FieldLabel, { children: data.config.labels[factKey] }),
|
|
958
981
|
factValue(factKey, layout, data, resolveImageUrl, getRivalHref)
|
|
959
982
|
]
|
|
960
983
|
}
|
|
@@ -963,15 +986,15 @@ function FactField({
|
|
|
963
986
|
|
|
964
987
|
// src/team/venue-photo.tsx
|
|
965
988
|
var import_react3 = require("react");
|
|
966
|
-
var
|
|
989
|
+
var import_ui_web10 = require("@nukleus-sports/ui-web");
|
|
967
990
|
var import_icons = require("@nukleus-sports/icons");
|
|
968
|
-
var
|
|
969
|
-
var
|
|
991
|
+
var import_core6 = require("@nukleus-sports/core");
|
|
992
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
970
993
|
var PHOTO_WIDTHS = [640, 960, 1280];
|
|
971
994
|
var PHOTO_SIZES = "(min-width: 1280px) 420px, 100vw";
|
|
972
995
|
var LINK_CLASS = "inline-flex shrink-0 items-center gap-1 hover:text-text-primary";
|
|
973
996
|
function NewTabNote() {
|
|
974
|
-
return /* @__PURE__ */ (0,
|
|
997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "sr-only", children: " (opens in a new tab)" });
|
|
975
998
|
}
|
|
976
999
|
function resolvePhotoSources(path, resolveImageUrl) {
|
|
977
1000
|
const candidates = PHOTO_WIDTHS.flatMap((width) => {
|
|
@@ -986,18 +1009,18 @@ function resolvePhotoSources(path, resolveImageUrl) {
|
|
|
986
1009
|
}
|
|
987
1010
|
function VenueNameOnly({ name, label }) {
|
|
988
1011
|
if (!name) return null;
|
|
989
|
-
return /* @__PURE__ */ (0,
|
|
990
|
-
/* @__PURE__ */ (0,
|
|
991
|
-
/* @__PURE__ */ (0,
|
|
1012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex min-w-0 flex-col items-start gap-1.5", children: [
|
|
1013
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FieldLabel, { children: label }),
|
|
1014
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "w-full header-xl-medium-card font-ss02-ss05 text-text-primary", children: name })
|
|
992
1015
|
] });
|
|
993
1016
|
}
|
|
994
1017
|
function PhotoCaption({ name, image }) {
|
|
995
|
-
const credit = (0,
|
|
996
|
-
return /* @__PURE__ */ (0,
|
|
997
|
-
name && /* @__PURE__ */ (0,
|
|
998
|
-
/* @__PURE__ */ (0,
|
|
999
|
-
/* @__PURE__ */ (0,
|
|
1000
|
-
image.sourceUrl && /* @__PURE__ */ (0,
|
|
1018
|
+
const credit = (0, import_core6.facilityImageCredit)(image);
|
|
1019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("figcaption", { className: "flex w-full flex-col gap-1 xxs-body-text font-ss02-ss05", children: [
|
|
1020
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "w-full text-text-primary", children: name }),
|
|
1021
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex w-full items-start gap-2 text-greys-text-secondary", children: [
|
|
1022
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "min-w-0 flex-1", children: credit ? `Photo: ${credit}` : "Photo from Wikimedia Commons" }),
|
|
1023
|
+
image.sourceUrl && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1001
1024
|
"a",
|
|
1002
1025
|
{
|
|
1003
1026
|
href: image.sourceUrl,
|
|
@@ -1006,8 +1029,8 @@ function PhotoCaption({ name, image }) {
|
|
|
1006
1029
|
className: LINK_CLASS,
|
|
1007
1030
|
children: [
|
|
1008
1031
|
"Source",
|
|
1009
|
-
/* @__PURE__ */ (0,
|
|
1010
|
-
/* @__PURE__ */ (0,
|
|
1032
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(NewTabNote, {}),
|
|
1033
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { "aria-hidden": "true", className: "flex shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1011
1034
|
import_icons.XsViewInvoiceIcon,
|
|
1012
1035
|
{
|
|
1013
1036
|
width: 16,
|
|
@@ -1018,7 +1041,7 @@ function PhotoCaption({ name, image }) {
|
|
|
1018
1041
|
]
|
|
1019
1042
|
}
|
|
1020
1043
|
),
|
|
1021
|
-
image.licenseUrl && /* @__PURE__ */ (0,
|
|
1044
|
+
image.licenseUrl && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1022
1045
|
"a",
|
|
1023
1046
|
{
|
|
1024
1047
|
href: image.licenseUrl,
|
|
@@ -1027,7 +1050,7 @@ function PhotoCaption({ name, image }) {
|
|
|
1027
1050
|
className: LINK_CLASS,
|
|
1028
1051
|
children: [
|
|
1029
1052
|
"License",
|
|
1030
|
-
/* @__PURE__ */ (0,
|
|
1053
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(NewTabNote, {})
|
|
1031
1054
|
]
|
|
1032
1055
|
}
|
|
1033
1056
|
)
|
|
@@ -1041,9 +1064,9 @@ function VenuePhoto({ venue, label, resolveImageUrl }) {
|
|
|
1041
1064
|
const sources = image && resolveImageUrl ? resolvePhotoSources(image.path, resolveImageUrl) : null;
|
|
1042
1065
|
const useResized = failed === "none" && Boolean(sources?.srcSet);
|
|
1043
1066
|
const src = failed === "all" ? void 0 : useResized ? sources?.resized : sources?.original;
|
|
1044
|
-
if (!image || !src) return /* @__PURE__ */ (0,
|
|
1045
|
-
return /* @__PURE__ */ (0,
|
|
1046
|
-
/* @__PURE__ */ (0,
|
|
1067
|
+
if (!image || !src) return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(VenueNameOnly, { name, label });
|
|
1068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("figure", { className: "flex w-full flex-col gap-3", children: [
|
|
1069
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1047
1070
|
"img",
|
|
1048
1071
|
{
|
|
1049
1072
|
src,
|
|
@@ -1052,20 +1075,20 @@ function VenuePhoto({ venue, label, resolveImageUrl }) {
|
|
|
1052
1075
|
onLoad: () => setIsLoaded(true),
|
|
1053
1076
|
onError: () => setFailed(useResized ? "resized" : "all"),
|
|
1054
1077
|
alt: name ?? label,
|
|
1055
|
-
className: (0,
|
|
1078
|
+
className: (0, import_ui_web10.cn)(
|
|
1056
1079
|
"h-[150px] w-full rounded-[8px] bg-greys-background-hover object-cover",
|
|
1057
1080
|
!isLoaded && "animate-pulse"
|
|
1058
1081
|
),
|
|
1059
1082
|
loading: "lazy"
|
|
1060
1083
|
}
|
|
1061
1084
|
),
|
|
1062
|
-
/* @__PURE__ */ (0,
|
|
1085
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PhotoCaption, { name, image })
|
|
1063
1086
|
] });
|
|
1064
1087
|
}
|
|
1065
1088
|
|
|
1066
1089
|
// src/team/team-facts-content.tsx
|
|
1067
|
-
var
|
|
1068
|
-
var
|
|
1090
|
+
var import_core7 = require("@nukleus-sports/core");
|
|
1091
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1069
1092
|
var SECTION_FIELDS_CLASS = {
|
|
1070
1093
|
grid: "grid grid-cols-2 items-start gap-3",
|
|
1071
1094
|
row: "flex items-start gap-3",
|
|
@@ -1082,7 +1105,7 @@ function TeamFactsContent({
|
|
|
1082
1105
|
getRivalHref
|
|
1083
1106
|
}) {
|
|
1084
1107
|
const { config, venue, hasFacts } = data;
|
|
1085
|
-
const photo = /* @__PURE__ */ (0,
|
|
1108
|
+
const photo = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1086
1109
|
VenuePhoto,
|
|
1087
1110
|
{
|
|
1088
1111
|
venue,
|
|
@@ -1092,14 +1115,14 @@ function TeamFactsContent({
|
|
|
1092
1115
|
venue.image?.path ?? "none"
|
|
1093
1116
|
);
|
|
1094
1117
|
if (!hasFacts) {
|
|
1095
|
-
return /* @__PURE__ */ (0,
|
|
1096
|
-
/* @__PURE__ */ (0,
|
|
1097
|
-
(venue.image || venue.name) && /* @__PURE__ */ (0,
|
|
1118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
1119
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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." }),
|
|
1120
|
+
(venue.image || venue.name) && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("section", { className: SECTION_CLASS, children: photo })
|
|
1098
1121
|
] });
|
|
1099
1122
|
}
|
|
1100
|
-
return /* @__PURE__ */ (0,
|
|
1101
|
-
/* @__PURE__ */ (0,
|
|
1102
|
-
/* @__PURE__ */ (0,
|
|
1123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex flex-col gap-3", children: config.sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { "aria-label": section.title, className: SECTION_CLASS, children: [
|
|
1124
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { className: "label-xs-semibold-text font-ss02-ss05 uppercase text-greys-text-secondary", children: section.title }),
|
|
1125
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: SECTION_FIELDS_CLASS[section.layout], children: (0, import_core7.teamFactsDisplayFields)(section).map((key) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1103
1126
|
FactField,
|
|
1104
1127
|
{
|
|
1105
1128
|
factKey: key,
|
|
@@ -1115,8 +1138,8 @@ function TeamFactsContent({
|
|
|
1115
1138
|
}
|
|
1116
1139
|
|
|
1117
1140
|
// src/team/team-facts-widget.tsx
|
|
1118
|
-
var
|
|
1119
|
-
var
|
|
1141
|
+
var import_ui_web11 = require("@nukleus-sports/ui-web");
|
|
1142
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1120
1143
|
var SKELETON_KEYS = ["trophy-case", "tradition", "profile"];
|
|
1121
1144
|
function TeamFactsWidget({
|
|
1122
1145
|
state,
|
|
@@ -1125,32 +1148,32 @@ function TeamFactsWidget({
|
|
|
1125
1148
|
getRivalHref,
|
|
1126
1149
|
className
|
|
1127
1150
|
}) {
|
|
1128
|
-
return /* @__PURE__ */ (0,
|
|
1129
|
-
|
|
1151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1152
|
+
import_ui_web11.Card,
|
|
1130
1153
|
{
|
|
1131
|
-
className: (0,
|
|
1154
|
+
className: (0, import_ui_web11.cn)(
|
|
1132
1155
|
"flex w-full min-w-0 flex-col gap-3 rounded-[10px] border-0 px-4 pb-[22px] pt-4",
|
|
1133
1156
|
// Matches the Team Info card's desktop height (TeamInfoCard `md:min-h-[612px]`).
|
|
1134
1157
|
"xl:min-h-[612px] xl:self-stretch xl:[contain:size]",
|
|
1135
1158
|
className
|
|
1136
1159
|
),
|
|
1137
1160
|
children: [
|
|
1138
|
-
/* @__PURE__ */ (0,
|
|
1139
|
-
/* @__PURE__ */ (0,
|
|
1140
|
-
state.status === "loading" && /* @__PURE__ */ (0,
|
|
1141
|
-
state.status === "error" && /* @__PURE__ */ (0,
|
|
1161
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_ui_web11.CardHeader, { className: "flex h-8 shrink-0 flex-row items-center p-0", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_ui_web11.CardTitle, { className: "header-xl-medium-card font-ss02-ss05 text-text-primary", children: "Team Facts" }) }),
|
|
1162
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_ui_web11.CardContent, { className: "p-0 xl:min-h-0 xl:flex-1 xl:overflow-y-auto xl:[scrollbar-width:none] xl:[&::-webkit-scrollbar]:hidden", children: [
|
|
1163
|
+
state.status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex flex-col gap-3", role: "status", "aria-label": "Loading team facts", children: SKELETON_KEYS.map((key) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_ui_web11.Skeleton, { className: "h-[200px] w-full rounded-[10px]" }, key)) }),
|
|
1164
|
+
state.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1142
1165
|
"div",
|
|
1143
1166
|
{
|
|
1144
1167
|
role: "alert",
|
|
1145
1168
|
className: "flex h-[120px] flex-col items-center justify-center gap-2 text-14.5 text-text-secondary",
|
|
1146
1169
|
children: [
|
|
1147
|
-
/* @__PURE__ */ (0,
|
|
1148
|
-
state.devMessage && /* @__PURE__ */ (0,
|
|
1149
|
-
state.retry && /* @__PURE__ */ (0,
|
|
1170
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "Couldn't load team facts." }),
|
|
1171
|
+
state.devMessage && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "xxs-body-text", children: state.devMessage }),
|
|
1172
|
+
state.retry && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_ui_web11.Button, { type: "button", variant: "outline", size: "sm", onClick: state.retry, children: "Try again" })
|
|
1150
1173
|
]
|
|
1151
1174
|
}
|
|
1152
1175
|
),
|
|
1153
|
-
state.status === "ready" && /* @__PURE__ */ (0,
|
|
1176
|
+
state.status === "ready" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1154
1177
|
TeamFactsContent,
|
|
1155
1178
|
{
|
|
1156
1179
|
data: state.data,
|
|
@@ -1168,30 +1191,30 @@ function TeamFactsWidget({
|
|
|
1168
1191
|
|
|
1169
1192
|
// src/team/stat-ranking-leaderboard-dialog.tsx
|
|
1170
1193
|
var import_react4 = require("react");
|
|
1171
|
-
var
|
|
1194
|
+
var import_ui_web12 = require("@nukleus-sports/ui-web");
|
|
1172
1195
|
var import_icons2 = require("@nukleus-sports/icons");
|
|
1173
|
-
var
|
|
1174
|
-
var
|
|
1196
|
+
var import_core8 = require("@nukleus-sports/core");
|
|
1197
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1175
1198
|
var PAGE_BUTTON_BASE = "background";
|
|
1176
1199
|
var PAGE_BUTTON_DESKTOP = "!h-[32px] !w-[32px] p-[6px]";
|
|
1177
1200
|
var PAGE_BUTTON_MOBILE = "!h-11 !w-11 p-3 !outline-0 !border-0 !bg-inherit";
|
|
1178
1201
|
var HIGHLIGHT_CLASS = "text-semantic-color-status-priority-completed-copy bg-primary-color-total-row-table-2";
|
|
1179
1202
|
function formatRank(rank, tied) {
|
|
1180
|
-
return tied ? `T-${(0,
|
|
1203
|
+
return tied ? `T-${(0, import_core8.toOrdinal)(rank)}` : (0, import_core8.toOrdinal)(rank);
|
|
1181
1204
|
}
|
|
1182
1205
|
function Footnotes({ notes }) {
|
|
1183
|
-
return /* @__PURE__ */ (0,
|
|
1206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: notes.map((note) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { className: "alert-text-italic text-text-secondary", children: [
|
|
1184
1207
|
"* ",
|
|
1185
1208
|
note
|
|
1186
1209
|
] }, note)) });
|
|
1187
1210
|
}
|
|
1188
1211
|
function Pagination({ page, totalPages, isCountKnown, isSm, onPageChange }) {
|
|
1189
|
-
const buttonClass = (0,
|
|
1190
|
-
return /* @__PURE__ */ (0,
|
|
1191
|
-
/* @__PURE__ */ (0,
|
|
1192
|
-
/* @__PURE__ */ (0,
|
|
1193
|
-
/* @__PURE__ */ (0,
|
|
1194
|
-
|
|
1212
|
+
const buttonClass = (0, import_ui_web12.cn)(PAGE_BUTTON_BASE, isSm ? PAGE_BUTTON_DESKTOP : PAGE_BUTTON_MOBILE);
|
|
1213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
1214
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "label-xs-text text-text-secondary", children: isCountKnown ? `Page ${page} of ${totalPages}` : `Page ${page}` }),
|
|
1215
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
1216
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1217
|
+
import_ui_web12.Button,
|
|
1195
1218
|
{
|
|
1196
1219
|
variant: "secondary-greys",
|
|
1197
1220
|
size: "sm",
|
|
@@ -1199,11 +1222,11 @@ function Pagination({ page, totalPages, isCountKnown, isSm, onPageChange }) {
|
|
|
1199
1222
|
onClick: () => onPageChange(Math.max(1, page - 1)),
|
|
1200
1223
|
disabled: page === 1,
|
|
1201
1224
|
"aria-label": "Go to previous page",
|
|
1202
|
-
children: /* @__PURE__ */ (0,
|
|
1225
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons2.ChevronLeftIcon, { className: "h-4 w-4" })
|
|
1203
1226
|
}
|
|
1204
1227
|
),
|
|
1205
|
-
/* @__PURE__ */ (0,
|
|
1206
|
-
|
|
1228
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1229
|
+
import_ui_web12.Button,
|
|
1207
1230
|
{
|
|
1208
1231
|
variant: "secondary-greys",
|
|
1209
1232
|
size: "sm",
|
|
@@ -1211,7 +1234,7 @@ function Pagination({ page, totalPages, isCountKnown, isSm, onPageChange }) {
|
|
|
1211
1234
|
onClick: () => onPageChange(Math.min(totalPages, page + 1)),
|
|
1212
1235
|
disabled: !isCountKnown || page >= totalPages,
|
|
1213
1236
|
"aria-label": "Go to next page",
|
|
1214
|
-
children: /* @__PURE__ */ (0,
|
|
1237
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons2.ChevronRightIcon, { className: "h-4 w-4" })
|
|
1215
1238
|
}
|
|
1216
1239
|
)
|
|
1217
1240
|
] })
|
|
@@ -1237,7 +1260,7 @@ function useLeaderboardColumns(entityLabel, statLabel, formatValue, isSm) {
|
|
|
1237
1260
|
},
|
|
1238
1261
|
{
|
|
1239
1262
|
accessorKey: "value",
|
|
1240
|
-
header: () => /* @__PURE__ */ (0,
|
|
1263
|
+
header: () => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "text-right text-wrap line-clamp-2", title: statLabel, children: statLabel }),
|
|
1241
1264
|
meta: {
|
|
1242
1265
|
cellSize: isSm ? "m" : "xs",
|
|
1243
1266
|
rowCellClassName: "text-right tabular-nums break-all"
|
|
@@ -1257,12 +1280,12 @@ function LeaderboardTable(props) {
|
|
|
1257
1280
|
props.isSm
|
|
1258
1281
|
);
|
|
1259
1282
|
if (isConfigError) {
|
|
1260
|
-
return /* @__PURE__ */ (0,
|
|
1283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex items-center justify-center h-full text-14.5 text-text-secondary", children: "Couldn't load ranking details. Please try again." });
|
|
1261
1284
|
}
|
|
1262
|
-
return /* @__PURE__ */ (0,
|
|
1263
|
-
isError && rows.length > 0 && /* @__PURE__ */ (0,
|
|
1264
|
-
/* @__PURE__ */ (0,
|
|
1265
|
-
|
|
1285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1286
|
+
isError && rows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-12 text-destructive px-1 pb-2", children: "Couldn't refresh rankings. Showing the last loaded data." }),
|
|
1287
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1288
|
+
import_ui_web12.BaseTable,
|
|
1266
1289
|
{
|
|
1267
1290
|
columns,
|
|
1268
1291
|
data: rows,
|
|
@@ -1285,17 +1308,17 @@ function LeaderboardContent(props) {
|
|
|
1285
1308
|
const isCountKnown = totalCount !== void 0;
|
|
1286
1309
|
const totalPages = Math.max(1, Math.ceil((totalCount ?? 0) / pageSize));
|
|
1287
1310
|
const showPagination = page > 1 || isCountKnown && totalPages > 1;
|
|
1288
|
-
return /* @__PURE__ */ (0,
|
|
1289
|
-
/* @__PURE__ */ (0,
|
|
1290
|
-
subtitle && /* @__PURE__ */ (0,
|
|
1311
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-col h-full overflow-hidden", children: [
|
|
1312
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-col gap-6 sm:gap-4 overflow-hidden px-5", children: [
|
|
1313
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_ui_web12.DialogDescription, { className: "flex flex-col gap-1 header-xl-medium-card text-text-secondary sm:px-4 font-ss02 ss05 leading-normal", children: [
|
|
1291
1314
|
subtitle,
|
|
1292
|
-
!isSm && footnotes.length > 0 && /* @__PURE__ */ (0,
|
|
1315
|
+
!isSm && footnotes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Footnotes, { notes: footnotes })
|
|
1293
1316
|
] }),
|
|
1294
|
-
/* @__PURE__ */ (0,
|
|
1317
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LeaderboardTable, { ...props }) })
|
|
1295
1318
|
] }),
|
|
1296
|
-
(footnotes.length > 0 || showPagination) && /* @__PURE__ */ (0,
|
|
1297
|
-
footnotes.length > 0 && /* @__PURE__ */ (0,
|
|
1298
|
-
showPagination && /* @__PURE__ */ (0,
|
|
1319
|
+
(footnotes.length > 0 || showPagination) && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("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: [
|
|
1320
|
+
footnotes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Footnotes, { notes: footnotes }),
|
|
1321
|
+
showPagination && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1299
1322
|
Pagination,
|
|
1300
1323
|
{
|
|
1301
1324
|
page,
|
|
@@ -1311,13 +1334,13 @@ function LeaderboardContent(props) {
|
|
|
1311
1334
|
function StatRankingLeaderboardDialog(props) {
|
|
1312
1335
|
const { open, onOpenChange, title, isSm } = props;
|
|
1313
1336
|
if (isSm) {
|
|
1314
|
-
return /* @__PURE__ */ (0,
|
|
1315
|
-
/* @__PURE__ */ (0,
|
|
1316
|
-
/* @__PURE__ */ (0,
|
|
1337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_ui_web12.Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_ui_web12.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: [
|
|
1338
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_ui_web12.DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_ui_web12.DialogTitle, { className: "header-xl-medium-card", children: title }) }),
|
|
1339
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LeaderboardContent, { ...props })
|
|
1317
1340
|
] }) });
|
|
1318
1341
|
}
|
|
1319
|
-
return /* @__PURE__ */ (0,
|
|
1320
|
-
|
|
1342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1343
|
+
import_ui_web12.MobileModalLayout,
|
|
1321
1344
|
{
|
|
1322
1345
|
onCancel: () => onOpenChange(false),
|
|
1323
1346
|
isOpen: open,
|
|
@@ -1325,15 +1348,15 @@ function StatRankingLeaderboardDialog(props) {
|
|
|
1325
1348
|
title,
|
|
1326
1349
|
cancelButtonName: "Close",
|
|
1327
1350
|
childClassName: "h-auto min-h-full h-[calc(100vh-100px)]",
|
|
1328
|
-
children: /* @__PURE__ */ (0,
|
|
1351
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex flex-col h-full pt-6", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LeaderboardContent, { ...props }) })
|
|
1329
1352
|
}
|
|
1330
1353
|
);
|
|
1331
1354
|
}
|
|
1332
1355
|
|
|
1333
1356
|
// src/team/team-season-stats-widget.tsx
|
|
1334
|
-
var
|
|
1335
|
-
var
|
|
1336
|
-
var
|
|
1357
|
+
var import_ui_web13 = require("@nukleus-sports/ui-web");
|
|
1358
|
+
var import_core9 = require("@nukleus-sports/core");
|
|
1359
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1337
1360
|
var PRESEASON_TYPE = 1;
|
|
1338
1361
|
var RANK_TEXT_CLASS = "label-xs-medium text-text-secondary";
|
|
1339
1362
|
var RANK_LINK_CLASS = `${RANK_TEXT_CLASS} hover:text-text-primary hover:underline cursor-pointer transition-colors`;
|
|
@@ -1345,15 +1368,15 @@ function RankBadge({
|
|
|
1345
1368
|
onRankClick
|
|
1346
1369
|
}) {
|
|
1347
1370
|
if (isRankingsError) {
|
|
1348
|
-
return /* @__PURE__ */ (0,
|
|
1349
|
-
/* @__PURE__ */ (0,
|
|
1350
|
-
/* @__PURE__ */ (0,
|
|
1371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "label-xs-medium text-destructive", title: "Couldn't load ranking", children: [
|
|
1372
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { "aria-hidden": "true", children: "--" }),
|
|
1373
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sr-only", children: "Couldn't load ranking" })
|
|
1351
1374
|
] });
|
|
1352
1375
|
}
|
|
1353
1376
|
if (!rankText) return null;
|
|
1354
|
-
if (!onRankClick) return /* @__PURE__ */ (0,
|
|
1355
|
-
return /* @__PURE__ */ (0,
|
|
1356
|
-
|
|
1377
|
+
if (!onRankClick) return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: RANK_TEXT_CLASS, children: rankText });
|
|
1378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1379
|
+
import_ui_web13.Button,
|
|
1357
1380
|
{
|
|
1358
1381
|
type: "button",
|
|
1359
1382
|
variant: "unstyled",
|
|
@@ -1369,7 +1392,7 @@ function RankBadge({
|
|
|
1369
1392
|
);
|
|
1370
1393
|
}
|
|
1371
1394
|
function CenteredMessage({ children }) {
|
|
1372
|
-
return /* @__PURE__ */ (0,
|
|
1395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex items-center justify-center h-full text-14.5 text-text-secondary", children });
|
|
1373
1396
|
}
|
|
1374
1397
|
function StatsBody({
|
|
1375
1398
|
stats,
|
|
@@ -1381,21 +1404,21 @@ function StatsBody({
|
|
|
1381
1404
|
isRankingsError,
|
|
1382
1405
|
onRankClick
|
|
1383
1406
|
}) {
|
|
1384
|
-
const columns = (0,
|
|
1385
|
-
return /* @__PURE__ */ (0,
|
|
1386
|
-
isSummaryError && /* @__PURE__ */ (0,
|
|
1387
|
-
/* @__PURE__ */ (0,
|
|
1407
|
+
const columns = (0, import_core9.getTeamStatColumns)(sportId);
|
|
1408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-col gap-1.5 h-full w-full justify-center", children: [
|
|
1409
|
+
isSummaryError && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-12 text-destructive", children: "Couldn't refresh stats. Showing the last loaded data." }),
|
|
1410
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("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) => {
|
|
1388
1411
|
const configId = configIds?.[index];
|
|
1389
|
-
return /* @__PURE__ */ (0,
|
|
1412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1390
1413
|
StatColumn,
|
|
1391
1414
|
{
|
|
1392
1415
|
label: column.label,
|
|
1393
1416
|
value: stats.values[index],
|
|
1394
1417
|
suffix: column.suffix,
|
|
1395
|
-
rankBadge: showRanks && configId !== void 0 ? /* @__PURE__ */ (0,
|
|
1418
|
+
rankBadge: showRanks && configId !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1396
1419
|
RankBadge,
|
|
1397
1420
|
{
|
|
1398
|
-
rankText: (0,
|
|
1421
|
+
rankText: (0, import_core9.formatStatRankByConfig)(rankings, configId),
|
|
1399
1422
|
statLabel: column.label,
|
|
1400
1423
|
configId,
|
|
1401
1424
|
isRankingsError,
|
|
@@ -1426,22 +1449,22 @@ function TeamSeasonStatsWidget({
|
|
|
1426
1449
|
onRankClick,
|
|
1427
1450
|
className
|
|
1428
1451
|
}) {
|
|
1429
|
-
const isSupportedSport = sportId != null && (0,
|
|
1452
|
+
const isSupportedSport = sportId != null && (0, import_core9.isSupportedTeamStatsSport)(sportId);
|
|
1430
1453
|
const hasSeason = Boolean(seasons?.selectedYear) && seasons?.selectedType != null;
|
|
1431
|
-
const stats = isSupportedSport && hasSeason ? (0,
|
|
1432
|
-
const configIds = (0,
|
|
1454
|
+
const stats = isSupportedSport && hasSeason ? (0, import_core9.computeTeamSeasonStatsFromSummary)(summary, sportId) : null;
|
|
1455
|
+
const configIds = (0, import_core9.getTeamRankingConfigIds)(sportId, leagueId);
|
|
1433
1456
|
const showRanks = seasons?.selectedType !== PRESEASON_TYPE;
|
|
1434
1457
|
if (seasonsLoading) {
|
|
1435
|
-
return /* @__PURE__ */ (0,
|
|
1436
|
-
/* @__PURE__ */ (0,
|
|
1437
|
-
/* @__PURE__ */ (0,
|
|
1458
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_ui_web13.Card, { className: (0, import_ui_web13.cn)("border-0 p-4 h-[300px]", className), children: [
|
|
1459
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_ui_web13.CardHeader, { className: "p-0 pb-4", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_ui_web13.CardTitle, { className: "text-base font-medium", children: "Season Stats" }) }),
|
|
1460
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_ui_web13.CardContent, { className: "p-0", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "space-y-3 flex justify-center items-center w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_ui_web13.IconLoader, {}) }) })
|
|
1438
1461
|
] });
|
|
1439
1462
|
}
|
|
1440
1463
|
let body;
|
|
1441
1464
|
if (statsLoading) {
|
|
1442
|
-
body = /* @__PURE__ */ (0,
|
|
1465
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_ui_web13.Skeleton, { className: "h-4 w-3/4" }) });
|
|
1443
1466
|
} else if (isSupportedSport && stats) {
|
|
1444
|
-
body = /* @__PURE__ */ (0,
|
|
1467
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1445
1468
|
StatsBody,
|
|
1446
1469
|
{
|
|
1447
1470
|
stats,
|
|
@@ -1455,21 +1478,21 @@ function TeamSeasonStatsWidget({
|
|
|
1455
1478
|
}
|
|
1456
1479
|
);
|
|
1457
1480
|
} else {
|
|
1458
|
-
body = /* @__PURE__ */ (0,
|
|
1481
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CenteredMessage, { children: getEmptyMessage(isSupportedSport, hasSeason, isSummaryError) });
|
|
1459
1482
|
}
|
|
1460
|
-
return /* @__PURE__ */ (0,
|
|
1461
|
-
|
|
1483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1484
|
+
import_ui_web13.Card,
|
|
1462
1485
|
{
|
|
1463
|
-
className: (0,
|
|
1486
|
+
className: (0, import_ui_web13.cn)(
|
|
1464
1487
|
"border-0 px-4 py-3 sm:p-4 flex flex-col gap-[25px] sm:gap-4 sm:h-[300px]",
|
|
1465
1488
|
className
|
|
1466
1489
|
),
|
|
1467
1490
|
children: [
|
|
1468
|
-
/* @__PURE__ */ (0,
|
|
1469
|
-
/* @__PURE__ */ (0,
|
|
1470
|
-
isSupportedSport && seasons && seasons.years.length > 0 && /* @__PURE__ */ (0,
|
|
1491
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_ui_web13.CardHeader, { className: "p-0", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-row items-center justify-between w-full h-8", children: [
|
|
1492
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_ui_web13.CardTitle, { className: "header-xl-medium-card text-base text-text-primary", children: "Team Stats" }),
|
|
1493
|
+
isSupportedSport && seasons && seasons.years.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SeasonSelector, { ...seasons, hideTypeOnMobile: true })
|
|
1471
1494
|
] }) }),
|
|
1472
|
-
/* @__PURE__ */ (0,
|
|
1495
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_ui_web13.CardContent, { className: "p-0 h-auto sm:h-[220px] flex justify-center", children: body })
|
|
1473
1496
|
]
|
|
1474
1497
|
}
|
|
1475
1498
|
);
|
|
@@ -1477,9 +1500,9 @@ function TeamSeasonStatsWidget({
|
|
|
1477
1500
|
|
|
1478
1501
|
// src/team/recent-games-widget.tsx
|
|
1479
1502
|
var import_react5 = require("react");
|
|
1480
|
-
var
|
|
1503
|
+
var import_ui_web14 = require("@nukleus-sports/ui-web");
|
|
1481
1504
|
var import_icons3 = require("@nukleus-sports/icons");
|
|
1482
|
-
var
|
|
1505
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1483
1506
|
var DATE_FORMAT = new Intl.DateTimeFormat("en-US", {
|
|
1484
1507
|
weekday: "long",
|
|
1485
1508
|
month: "long",
|
|
@@ -1492,23 +1515,23 @@ var MESSAGES = {
|
|
|
1492
1515
|
"games-error": "Couldn't load games. Please try again."
|
|
1493
1516
|
};
|
|
1494
1517
|
function ResultText({ result }) {
|
|
1495
|
-
if (result.outcome === "none") return /* @__PURE__ */ (0,
|
|
1518
|
+
if (result.outcome === "none") return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-text-secondary text-14", children: "--" });
|
|
1496
1519
|
if (result.outcome === "tie") {
|
|
1497
|
-
return /* @__PURE__ */ (0,
|
|
1520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "text-14 font-medium text-text-primary", children: [
|
|
1498
1521
|
"T ",
|
|
1499
1522
|
result.detail
|
|
1500
1523
|
] });
|
|
1501
1524
|
}
|
|
1502
1525
|
const isWin = result.outcome === "win";
|
|
1503
|
-
return /* @__PURE__ */ (0,
|
|
1504
|
-
/* @__PURE__ */ (0,
|
|
1526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "text-14 font-medium", children: [
|
|
1527
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1505
1528
|
"span",
|
|
1506
1529
|
{
|
|
1507
1530
|
className: isWin ? "text-primary-color-nuk-text" : "text-semantic-color-status-priority-blocked-hot-copy",
|
|
1508
1531
|
children: isWin ? "W" : "L"
|
|
1509
1532
|
}
|
|
1510
1533
|
),
|
|
1511
|
-
/* @__PURE__ */ (0,
|
|
1534
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "text-text-primary", children: [
|
|
1512
1535
|
" ",
|
|
1513
1536
|
result.detail
|
|
1514
1537
|
] })
|
|
@@ -1518,7 +1541,7 @@ function OpponentLogo({ opponent, resolveImageUrl, defaultLogoUrl }) {
|
|
|
1518
1541
|
const [failedUrl, setFailedUrl] = (0, import_react5.useState)(null);
|
|
1519
1542
|
const { logo } = opponent;
|
|
1520
1543
|
const resolved = logo ? logo.stored ? resolveImageUrl?.(logo.url) : logo.url : void 0;
|
|
1521
|
-
return /* @__PURE__ */ (0,
|
|
1544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1522
1545
|
"img",
|
|
1523
1546
|
{
|
|
1524
1547
|
src: resolved && resolved !== failedUrl ? resolved : defaultLogoUrl,
|
|
@@ -1532,13 +1555,13 @@ function OpponentLogo({ opponent, resolveImageUrl, defaultLogoUrl }) {
|
|
|
1532
1555
|
);
|
|
1533
1556
|
}
|
|
1534
1557
|
function GameItem({ row, resolveImageUrl, defaultLogoUrl }) {
|
|
1535
|
-
return /* @__PURE__ */ (0,
|
|
1536
|
-
row.isFirstUpcoming && /* @__PURE__ */ (0,
|
|
1537
|
-
/* @__PURE__ */ (0,
|
|
1538
|
-
/* @__PURE__ */ (0,
|
|
1539
|
-
/* @__PURE__ */ (0,
|
|
1540
|
-
/* @__PURE__ */ (0,
|
|
1541
|
-
/* @__PURE__ */ (0,
|
|
1558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "border-b border-border last:border-0", children: [
|
|
1559
|
+
row.isFirstUpcoming && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "px-2 pt-2 text-12 font-medium uppercase tracking-wide text-text-secondary", children: "Upcoming" }),
|
|
1560
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex flex-col p-2 gap-[5px]", children: [
|
|
1561
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-14 font-normal text-text-secondary", children: DATE_FORMAT.format(new Date(row.gameDate)) }),
|
|
1562
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
1563
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-14 font-normal text-text-secondary shrink-0", children: row.isHome ? "vs " : "@ " }),
|
|
1564
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1542
1565
|
OpponentLogo,
|
|
1543
1566
|
{
|
|
1544
1567
|
opponent: row.opponent,
|
|
@@ -1546,18 +1569,18 @@ function GameItem({ row, resolveImageUrl, defaultLogoUrl }) {
|
|
|
1546
1569
|
defaultLogoUrl
|
|
1547
1570
|
}
|
|
1548
1571
|
),
|
|
1549
|
-
/* @__PURE__ */ (0,
|
|
1550
|
-
row.result && /* @__PURE__ */ (0,
|
|
1551
|
-
/* @__PURE__ */ (0,
|
|
1552
|
-
/* @__PURE__ */ (0,
|
|
1572
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-14.5 font-normal text-text-primary truncate", children: row.opponent.name }),
|
|
1573
|
+
row.result && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
1574
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-14 text-text-secondary", children: "-" }),
|
|
1575
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ResultText, { result: row.result })
|
|
1553
1576
|
] })
|
|
1554
1577
|
] }),
|
|
1555
|
-
row.time && /* @__PURE__ */ (0,
|
|
1578
|
+
row.time && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-14 font-normal text-text-secondary", children: row.time })
|
|
1556
1579
|
] })
|
|
1557
1580
|
] });
|
|
1558
1581
|
}
|
|
1559
1582
|
function Message({ children }) {
|
|
1560
|
-
return /* @__PURE__ */ (0,
|
|
1583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "text-text-primary text-14.5 px-1", children });
|
|
1561
1584
|
}
|
|
1562
1585
|
function Body({
|
|
1563
1586
|
status,
|
|
@@ -1566,11 +1589,11 @@ function Body({
|
|
|
1566
1589
|
defaultLogoUrl
|
|
1567
1590
|
}) {
|
|
1568
1591
|
if (status === "loading") {
|
|
1569
|
-
return /* @__PURE__ */ (0,
|
|
1592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "space-y-4 flex justify-center items-center w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_ui_web14.IconLoader, {}) });
|
|
1570
1593
|
}
|
|
1571
|
-
if (status !== "ready") return /* @__PURE__ */ (0,
|
|
1572
|
-
if (rows.length === 0) return /* @__PURE__ */ (0,
|
|
1573
|
-
return /* @__PURE__ */ (0,
|
|
1594
|
+
if (status !== "ready") return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Message, { children: MESSAGES[status] });
|
|
1595
|
+
if (rows.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Message, { children: "There are no games scheduled at this time." });
|
|
1596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex flex-col overflow-y-auto overflow-x-hidden gap-1", children: rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1574
1597
|
GameItem,
|
|
1575
1598
|
{
|
|
1576
1599
|
row,
|
|
@@ -1588,18 +1611,18 @@ function RecentGamesWidget({
|
|
|
1588
1611
|
onExpand,
|
|
1589
1612
|
className
|
|
1590
1613
|
}) {
|
|
1591
|
-
return /* @__PURE__ */ (0,
|
|
1592
|
-
|
|
1614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1615
|
+
import_ui_web14.Card,
|
|
1593
1616
|
{
|
|
1594
|
-
className: (0,
|
|
1617
|
+
className: (0, import_ui_web14.cn)(
|
|
1595
1618
|
"p-4 w-full xl:w-[420px] flex flex-col overflow-hidden border-none gap-3 h-full md:min-h-[612px]",
|
|
1596
1619
|
className
|
|
1597
1620
|
),
|
|
1598
1621
|
children: [
|
|
1599
|
-
/* @__PURE__ */ (0,
|
|
1600
|
-
/* @__PURE__ */ (0,
|
|
1601
|
-
onExpand && /* @__PURE__ */ (0,
|
|
1602
|
-
|
|
1622
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_ui_web14.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 p-0", children: [
|
|
1623
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_ui_web14.CardTitle, { children: "Recent Games" }),
|
|
1624
|
+
onExpand && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1625
|
+
import_ui_web14.Button,
|
|
1603
1626
|
{
|
|
1604
1627
|
type: "button",
|
|
1605
1628
|
variant: "ghost",
|
|
@@ -1607,11 +1630,11 @@ function RecentGamesWidget({
|
|
|
1607
1630
|
"aria-label": "View full schedule",
|
|
1608
1631
|
onClick: onExpand,
|
|
1609
1632
|
className: "outline-1 background outline-offset-[-1px] outline-[hsl(var(--color-ui-elem-strokes))] outline h-[32px] w-[32px]",
|
|
1610
|
-
children: /* @__PURE__ */ (0,
|
|
1633
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_icons3.ArrowUpRightIcon, { className: "text-greys-icons h-5 w-5" })
|
|
1611
1634
|
}
|
|
1612
1635
|
)
|
|
1613
1636
|
] }),
|
|
1614
|
-
/* @__PURE__ */ (0,
|
|
1637
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_ui_web14.CardContent, { className: "flex-1 flex flex-col overflow-hidden p-0", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1615
1638
|
Body,
|
|
1616
1639
|
{
|
|
1617
1640
|
status,
|
|
@@ -1627,9 +1650,9 @@ function RecentGamesWidget({
|
|
|
1627
1650
|
|
|
1628
1651
|
// src/team/team-stats-table.tsx
|
|
1629
1652
|
var import_react6 = require("react");
|
|
1630
|
-
var
|
|
1631
|
-
var
|
|
1632
|
-
var
|
|
1653
|
+
var import_ui_web15 = require("@nukleus-sports/ui-web");
|
|
1654
|
+
var import_core10 = require("@nukleus-sports/core");
|
|
1655
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1633
1656
|
function stripLeadingSlash(path) {
|
|
1634
1657
|
return path.startsWith("/") ? path.slice(1) : path;
|
|
1635
1658
|
}
|
|
@@ -1665,10 +1688,10 @@ function formatTeamStatDate(stat) {
|
|
|
1665
1688
|
const dateStr = stat.stat_details?.game_details?.date;
|
|
1666
1689
|
const date = dateStr ? new Date(dateStr) : null;
|
|
1667
1690
|
if (!date || Number.isNaN(date.getTime())) {
|
|
1668
|
-
return /* @__PURE__ */ (0,
|
|
1691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-text-primary body-text", children: "--" });
|
|
1669
1692
|
}
|
|
1670
1693
|
const formatted = date.toLocaleDateString("en-US", { month: "short", day: "numeric" });
|
|
1671
|
-
return /* @__PURE__ */ (0,
|
|
1694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "text-13.5 font-normal text-text-primary", children: formatted });
|
|
1672
1695
|
}
|
|
1673
1696
|
function getTeamStatResult(stat) {
|
|
1674
1697
|
const gameDetails = stat.stat_details?.game_details;
|
|
@@ -1687,9 +1710,9 @@ function getTeamStatResult(stat) {
|
|
|
1687
1710
|
const opponentScore = isHome ? awayScore : homeScore;
|
|
1688
1711
|
const score = `${teamScore}-${opponentScore}${gameDetails.status_alt_details ? ` ${gameDetails.status_alt_details}` : ""}`;
|
|
1689
1712
|
const colorClass = winLoss === "W" ? "text-primary-color-nuk-text" : winLoss === "L" ? "text-semantic-color-status-priority-blocked-hot-copy" : "text-text-primary";
|
|
1690
|
-
return /* @__PURE__ */ (0,
|
|
1691
|
-
/* @__PURE__ */ (0,
|
|
1692
|
-
/* @__PURE__ */ (0,
|
|
1713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-baseline gap-1 leading-tight", children: [
|
|
1714
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: (0, import_ui_web15.cn)(colorClass, "body-text"), children: winLoss }),
|
|
1715
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-text-primary body-text", children: score })
|
|
1693
1716
|
] });
|
|
1694
1717
|
}
|
|
1695
1718
|
function StatOpponentCell({
|
|
@@ -1703,13 +1726,13 @@ function StatOpponentCell({
|
|
|
1703
1726
|
const isHome = stat.team_id === gameDetails?.home_team_id;
|
|
1704
1727
|
const opponentName = isHome ? gameDetails?.away_team_name : gameDetails?.home_team_name;
|
|
1705
1728
|
const opponentLogoPath = isHome ? gameDetails?.away_team_logo : gameDetails?.home_team_logo;
|
|
1706
|
-
if (!opponentName) return /* @__PURE__ */ (0,
|
|
1729
|
+
if (!opponentName) return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_jsx_runtime17.Fragment, { children: "--" });
|
|
1707
1730
|
const prefix = isHome ? "vs" : "@";
|
|
1708
1731
|
const resolved = opponentLogoPath ? resolveOpponentLogoUrl(stripLeadingSlash(opponentLogoPath)) : null;
|
|
1709
1732
|
const logoSrc = resolved && resolved !== failedUrl ? resolved : defaultLogoUrl;
|
|
1710
|
-
return /* @__PURE__ */ (0,
|
|
1711
|
-
/* @__PURE__ */ (0,
|
|
1712
|
-
/* @__PURE__ */ (0,
|
|
1733
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "h-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex items-center h-full", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex max-sm:gap-1 gap-2 items-center font-normal leading-tight text-12", children: [
|
|
1734
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-text-primary body-text", children: prefix }),
|
|
1735
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1713
1736
|
"img",
|
|
1714
1737
|
{
|
|
1715
1738
|
src: logoSrc,
|
|
@@ -1720,7 +1743,7 @@ function StatOpponentCell({
|
|
|
1720
1743
|
}
|
|
1721
1744
|
}
|
|
1722
1745
|
),
|
|
1723
|
-
showName && /* @__PURE__ */ (0,
|
|
1746
|
+
showName && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-primary-color-nuk-text body-text line-clamp-2", children: opponentName })
|
|
1724
1747
|
] }) }) });
|
|
1725
1748
|
}
|
|
1726
1749
|
function buildStatsColumns({
|
|
@@ -1734,14 +1757,14 @@ function buildStatsColumns({
|
|
|
1734
1757
|
return [
|
|
1735
1758
|
{
|
|
1736
1759
|
id: "game_date",
|
|
1737
|
-
header: () => /* @__PURE__ */ (0,
|
|
1760
|
+
header: () => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w-[50px] shrink-0", children: "Date" }),
|
|
1738
1761
|
cell: ({ row }) => formatTeamStatDate(row.original),
|
|
1739
1762
|
meta: { cellSize: isSm ? "xs" : "xxs", headerClassName: "h-auto" }
|
|
1740
1763
|
},
|
|
1741
1764
|
{
|
|
1742
1765
|
id: "opponent",
|
|
1743
|
-
header: () => /* @__PURE__ */ (0,
|
|
1744
|
-
cell: ({ row }) => /* @__PURE__ */ (0,
|
|
1766
|
+
header: () => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { children: isSm ? "Opponent" : "Opp" }),
|
|
1767
|
+
cell: ({ row }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1745
1768
|
StatOpponentCell,
|
|
1746
1769
|
{
|
|
1747
1770
|
stat: row.original,
|
|
@@ -1793,33 +1816,33 @@ function StatsBody2({
|
|
|
1793
1816
|
isSmallLaptop,
|
|
1794
1817
|
emptyMessage
|
|
1795
1818
|
}) {
|
|
1796
|
-
return /* @__PURE__ */ (0,
|
|
1797
|
-
/* @__PURE__ */ (0,
|
|
1798
|
-
/* @__PURE__ */ (0,
|
|
1799
|
-
showsCategoryPicker && /* @__PURE__ */ (0,
|
|
1800
|
-
|
|
1819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
1820
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-2 min-[360px]:gap-3 xl:shrink-0", children: [
|
|
1821
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SeasonSelector, { ...seasons, className: "gap-2 min-[360px]:gap-3" }),
|
|
1822
|
+
showsCategoryPicker && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1823
|
+
import_ui_web15.Select,
|
|
1801
1824
|
{
|
|
1802
1825
|
value: selectedStatCategory,
|
|
1803
1826
|
onValueChange: onStatCategoryChange,
|
|
1804
1827
|
disabled: !seasons.selectedYear || seasons.selectedType === null,
|
|
1805
1828
|
children: [
|
|
1806
|
-
/* @__PURE__ */ (0,
|
|
1807
|
-
/* @__PURE__ */ (0,
|
|
1808
|
-
|
|
1829
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui_web15.SelectTrigger, { variant: "widget", size: "widget", "aria-label": "Stat category", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui_web15.SelectValue, { placeholder: "Select stat category" }) }),
|
|
1830
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1831
|
+
import_ui_web15.SelectContent,
|
|
1809
1832
|
{
|
|
1810
1833
|
className: "bg-popover border-border z-50 [&_.checkbox]:!flex",
|
|
1811
1834
|
classNameViewPort: "gap-2",
|
|
1812
|
-
children: availableStatCategories.map((category) => /* @__PURE__ */ (0,
|
|
1835
|
+
children: availableStatCategories.map((category) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui_web15.SelectItem, { value: category, className: "capitalize min-h-8", children: category.charAt(0).toUpperCase() + category.slice(1) }, category))
|
|
1813
1836
|
}
|
|
1814
1837
|
)
|
|
1815
1838
|
]
|
|
1816
1839
|
}
|
|
1817
1840
|
)
|
|
1818
1841
|
] }),
|
|
1819
|
-
/* @__PURE__ */ (0,
|
|
1820
|
-
isStatTypesError && !hasVisibleStatTypes && /* @__PURE__ */ (0,
|
|
1821
|
-
/* @__PURE__ */ (0,
|
|
1822
|
-
|
|
1842
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-col space-y-4 xl:flex-1 xl:min-h-0 xl:overflow-hidden", children: [
|
|
1843
|
+
isStatTypesError && !hasVisibleStatTypes && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-text-secondary text-13.5", children: "Couldn't load stat categories -- showing limited columns." }),
|
|
1844
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1845
|
+
import_ui_web15.BaseTable,
|
|
1823
1846
|
{
|
|
1824
1847
|
columns,
|
|
1825
1848
|
data: stats,
|
|
@@ -1862,28 +1885,28 @@ function TeamStatsTable({
|
|
|
1862
1885
|
availableStatCategories
|
|
1863
1886
|
);
|
|
1864
1887
|
if (isTeamError) {
|
|
1865
|
-
return /* @__PURE__ */ (0,
|
|
1888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui_web15.Card, { className: (0, import_ui_web15.cn)("border-0", className), children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui_web15.CardContent, { className: "p-4 flex justify-center items-center", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-text-secondary", children: "Couldn't load team information. Please try again." }) }) });
|
|
1866
1889
|
}
|
|
1867
1890
|
if (seasonsLoading || sportId === null) {
|
|
1868
|
-
return /* @__PURE__ */ (0,
|
|
1869
|
-
/* @__PURE__ */ (0,
|
|
1870
|
-
/* @__PURE__ */ (0,
|
|
1871
|
-
/* @__PURE__ */ (0,
|
|
1872
|
-
/* @__PURE__ */ (0,
|
|
1891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui_web15.Card, { className: (0, import_ui_web15.cn)("border-0", className), children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_ui_web15.CardContent, { className: "space-y-4 pt-6", children: [
|
|
1892
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-col gap-3 sm:flex-row justify-start", children: [
|
|
1893
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui_web15.Skeleton, { className: "h-7 w-[68px] bg-form rounded-[5px]" }),
|
|
1894
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui_web15.Skeleton, { className: "h-7 w-[142px] bg-form rounded-[5px]" }),
|
|
1895
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui_web15.Skeleton, { className: "h-7 w-[102px] bg-form rounded-[5px]" })
|
|
1873
1896
|
] }),
|
|
1874
|
-
/* @__PURE__ */ (0,
|
|
1897
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui_web15.Skeleton, { className: "h-40 w-full bg-form !mt-3" })
|
|
1875
1898
|
] }) });
|
|
1876
1899
|
}
|
|
1877
1900
|
if (!seasons || seasons.years.length === 0) {
|
|
1878
|
-
return /* @__PURE__ */ (0,
|
|
1901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui_web15.Card, { className: (0, import_ui_web15.cn)("border-none", className), children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui_web15.CardContent, { className: "pt-6", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "text-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("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." }) }) }) });
|
|
1879
1902
|
}
|
|
1880
|
-
const visibleStatTypes = (0,
|
|
1881
|
-
const filteredStatTypes = (0,
|
|
1903
|
+
const visibleStatTypes = (0, import_core10.getVisibleTeamStatTypes)(statTypes, sportId);
|
|
1904
|
+
const filteredStatTypes = (0, import_core10.getOrderedTeamStatTypesForCategory)(
|
|
1882
1905
|
visibleStatTypes,
|
|
1883
1906
|
sportId,
|
|
1884
1907
|
selectedStatCategory
|
|
1885
1908
|
);
|
|
1886
|
-
const showsCategoryPicker = availableStatCategories.length > 0 && (0,
|
|
1909
|
+
const showsCategoryPicker = availableStatCategories.length > 0 && (0, import_core10.showsTeamStatCategoryPicker)(sportId);
|
|
1887
1910
|
const columns = buildStatsColumns({
|
|
1888
1911
|
filteredStatTypes,
|
|
1889
1912
|
selectedStatCategory,
|
|
@@ -1893,16 +1916,16 @@ function TeamStatsTable({
|
|
|
1893
1916
|
isSmallLaptop
|
|
1894
1917
|
});
|
|
1895
1918
|
const emptyMessage = getStatsEmptyMessage(seasons, stats.length);
|
|
1896
|
-
return /* @__PURE__ */ (0,
|
|
1897
|
-
|
|
1919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1920
|
+
import_ui_web15.Card,
|
|
1898
1921
|
{
|
|
1899
|
-
className: (0,
|
|
1922
|
+
className: (0, import_ui_web15.cn)(
|
|
1900
1923
|
"border-none p-4 flex flex-col gap-3 xl:h-full xl:min-h-0 xl:flex-1 xl:overflow-hidden",
|
|
1901
1924
|
className
|
|
1902
1925
|
),
|
|
1903
1926
|
children: [
|
|
1904
|
-
/* @__PURE__ */ (0,
|
|
1905
|
-
/* @__PURE__ */ (0,
|
|
1927
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui_web15.CardHeader, { className: "p-0", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui_web15.CardTitle, { children: "Stats" }) }),
|
|
1928
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui_web15.CardContent, { className: "space-y-0 p-0 flex flex-col gap-3 xl:flex-1 xl:min-h-0 xl:overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1906
1929
|
StatsBody2,
|
|
1907
1930
|
{
|
|
1908
1931
|
seasons,
|
|
@@ -1927,8 +1950,8 @@ function TeamStatsTable({
|
|
|
1927
1950
|
}
|
|
1928
1951
|
|
|
1929
1952
|
// src/team/team-schedule-table.tsx
|
|
1930
|
-
var
|
|
1931
|
-
var
|
|
1953
|
+
var import_ui_web16 = require("@nukleus-sports/ui-web");
|
|
1954
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1932
1955
|
var SPECIAL_LOGO_LEAGUES = ["NFL", "NBA", "NHL", "MLB", "WNBA"];
|
|
1933
1956
|
var COLLEGE_LEAGUE_IDS = [2, 6, 13];
|
|
1934
1957
|
var COMPLETED_STATUS_ID = "3";
|
|
@@ -1977,12 +2000,12 @@ function showsMlbLeaders(leagueId) {
|
|
|
1977
2000
|
}
|
|
1978
2001
|
function leaderCell(leader, small = false) {
|
|
1979
2002
|
if (!leader) return "--";
|
|
1980
|
-
return /* @__PURE__ */ (0,
|
|
1981
|
-
/* @__PURE__ */ (0,
|
|
1982
|
-
/* @__PURE__ */ (0,
|
|
2003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col leading-tight", children: [
|
|
2004
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-text-primary font-normal truncate", children: leader.displayName }),
|
|
2005
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1983
2006
|
"span",
|
|
1984
2007
|
{
|
|
1985
|
-
className: (0,
|
|
2008
|
+
className: (0, import_ui_web16.cn)(
|
|
1986
2009
|
small ? "text-text-secondary text-11" : "text-text-primary body-text",
|
|
1987
2010
|
"truncate"
|
|
1988
2011
|
),
|
|
@@ -1999,7 +2022,7 @@ function formatScheduleDate(game) {
|
|
|
1999
2022
|
const [year, month, day] = rawDate.split("T")[0].split("-").map(Number);
|
|
2000
2023
|
return new Date(year, month - 1, day);
|
|
2001
2024
|
})();
|
|
2002
|
-
return /* @__PURE__ */ (0,
|
|
2025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-text-primary body-text", children: DATE_FORMAT2.format(date) });
|
|
2003
2026
|
} catch {
|
|
2004
2027
|
return "--";
|
|
2005
2028
|
}
|
|
@@ -2017,9 +2040,9 @@ function getScheduleResult(game, teamEspnId) {
|
|
|
2017
2040
|
const winLoss = tied ? "T" : own.winner === true ? "W" : "L";
|
|
2018
2041
|
const score = `${formatScore(own.score)}-${formatScore(other.score)}`;
|
|
2019
2042
|
const colorClass = winLoss === "W" ? "text-primary-color-nuk-text" : winLoss === "L" ? "text-semantic-color-status-priority-blocked-hot-copy" : "text-text-primary";
|
|
2020
|
-
return /* @__PURE__ */ (0,
|
|
2021
|
-
/* @__PURE__ */ (0,
|
|
2022
|
-
/* @__PURE__ */ (0,
|
|
2043
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-baseline gap-1 leading-tight", children: [
|
|
2044
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: (0, import_ui_web16.cn)(colorClass, "body-text"), children: winLoss }),
|
|
2045
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-text-primary body-text", children: score })
|
|
2023
2046
|
] });
|
|
2024
2047
|
}
|
|
2025
2048
|
function getScheduleRecord(game, teamEspnId) {
|
|
@@ -2030,7 +2053,7 @@ function getScheduleRecord(game, teamEspnId) {
|
|
|
2030
2053
|
function getWinningGoalie(game) {
|
|
2031
2054
|
const athlete = firstCompetition(game)?.featuredAthletes?.[0]?.athlete;
|
|
2032
2055
|
if (!athlete?.lastName) return "--";
|
|
2033
|
-
return /* @__PURE__ */ (0,
|
|
2056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex flex-col leading-tight", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-text-primary font-normal truncate", children: athlete.lastName }) });
|
|
2034
2057
|
}
|
|
2035
2058
|
function getHockeyTopPlayer(game) {
|
|
2036
2059
|
const competitors = firstCompetition(game)?.competitors;
|
|
@@ -2047,9 +2070,9 @@ function getMlbPitcher(game, pitcherType) {
|
|
|
2047
2070
|
const athlete = pitcher?.athlete;
|
|
2048
2071
|
if (!athlete?.lastName) return "--";
|
|
2049
2072
|
const stat = pitcherType === "savingPitcher" ? athlete.saves : athlete.record;
|
|
2050
|
-
return /* @__PURE__ */ (0,
|
|
2051
|
-
/* @__PURE__ */ (0,
|
|
2052
|
-
/* @__PURE__ */ (0,
|
|
2073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col leading-tight", children: [
|
|
2074
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-text-primary font-normal truncate", children: athlete.lastName }),
|
|
2075
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-text-secondary text-11 truncate", children: stat || "--" })
|
|
2053
2076
|
] });
|
|
2054
2077
|
}
|
|
2055
2078
|
function OpponentCell({
|
|
@@ -2062,15 +2085,15 @@ function OpponentCell({
|
|
|
2062
2085
|
showName
|
|
2063
2086
|
}) {
|
|
2064
2087
|
const match = findCompetitor(firstCompetition(game)?.competitors, teamEspnId);
|
|
2065
|
-
if (!match || leagueId === null || !leagueAbbreviation) return /* @__PURE__ */ (0,
|
|
2088
|
+
if (!match || leagueId === null || !leagueAbbreviation) return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, { children: "--" });
|
|
2066
2089
|
const prefix = match.own.homeAway === "home" ? "vs" : "@";
|
|
2067
2090
|
const opponentTeam = match.other.team;
|
|
2068
2091
|
const isSpecialLeague = SPECIAL_LOGO_LEAGUES.includes(leagueAbbreviation);
|
|
2069
2092
|
const identifier = isSpecialLeague ? opponentTeam.abbreviation : opponentTeam.id;
|
|
2070
2093
|
const folder = COLLEGE_LEAGUE_IDS.includes(leagueId) ? "NCAA" : leagueAbbreviation;
|
|
2071
|
-
return /* @__PURE__ */ (0,
|
|
2072
|
-
/* @__PURE__ */ (0,
|
|
2073
|
-
/* @__PURE__ */ (0,
|
|
2094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-1 sm:gap-2 h-full overflow-hidden", children: [
|
|
2095
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-text-primary body-text shrink-0 sm:w-4", children: prefix }),
|
|
2096
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2074
2097
|
"img",
|
|
2075
2098
|
{
|
|
2076
2099
|
src: resolveLogoUrl(folder, identifier),
|
|
@@ -2082,7 +2105,7 @@ function OpponentCell({
|
|
|
2082
2105
|
}
|
|
2083
2106
|
}
|
|
2084
2107
|
),
|
|
2085
|
-
showName && /* @__PURE__ */ (0,
|
|
2108
|
+
showName && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-primary-color-nuk-text body-text line-clamp-2", children: opponentTeam.displayName })
|
|
2086
2109
|
] });
|
|
2087
2110
|
}
|
|
2088
2111
|
function buildScheduleColumns({
|
|
@@ -2098,15 +2121,15 @@ function buildScheduleColumns({
|
|
|
2098
2121
|
return [
|
|
2099
2122
|
{
|
|
2100
2123
|
id: "game_date",
|
|
2101
|
-
header: () => /* @__PURE__ */ (0,
|
|
2124
|
+
header: () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w-[50px] shrink-0", children: "Date" }),
|
|
2102
2125
|
accessorFn: (row) => row.game_date,
|
|
2103
2126
|
cell: ({ row }) => formatScheduleDate(row.original),
|
|
2104
2127
|
meta: { cellSize: isSm ? "xs" : "xxs" }
|
|
2105
2128
|
},
|
|
2106
2129
|
{
|
|
2107
2130
|
id: "opponent",
|
|
2108
|
-
header: () => /* @__PURE__ */ (0,
|
|
2109
|
-
cell: ({ row }) => /* @__PURE__ */ (0,
|
|
2131
|
+
header: () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { children: isSm ? "Opponent" : "Opp" }),
|
|
2132
|
+
cell: ({ row }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2110
2133
|
OpponentCell,
|
|
2111
2134
|
{
|
|
2112
2135
|
game: row.original,
|
|
@@ -2222,15 +2245,15 @@ function ScheduleBody({
|
|
|
2222
2245
|
isSmallLaptop
|
|
2223
2246
|
}) {
|
|
2224
2247
|
if (seasonsLoading) {
|
|
2225
|
-
return /* @__PURE__ */ (0,
|
|
2248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex justify-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "text-sm text-text-primary", children: "Loading seasons..." }) });
|
|
2226
2249
|
}
|
|
2227
2250
|
if (!seasons || seasons.years.length === 0) {
|
|
2228
|
-
return /* @__PURE__ */ (0,
|
|
2251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "text-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-text-primary", children: isSeasonsError ? "Couldn't load seasons. Please try again." : "No seasons found" }) });
|
|
2229
2252
|
}
|
|
2230
|
-
return /* @__PURE__ */ (0,
|
|
2231
|
-
/* @__PURE__ */ (0,
|
|
2232
|
-
/* @__PURE__ */ (0,
|
|
2233
|
-
|
|
2253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col gap-3 xl:flex-1 xl:min-h-0 xl:overflow-hidden", children: [
|
|
2254
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SeasonSelector, { ...seasons, className: "gap-2 min-[360px]:gap-3 xl:shrink-0" }),
|
|
2255
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "xl:flex-1 xl:min-h-0 xl:overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2256
|
+
import_ui_web16.BaseTable,
|
|
2234
2257
|
{
|
|
2235
2258
|
columns,
|
|
2236
2259
|
data: games,
|
|
@@ -2273,24 +2296,24 @@ function TeamScheduleTable({
|
|
|
2273
2296
|
isSmallLaptop
|
|
2274
2297
|
});
|
|
2275
2298
|
if (isTeamError) {
|
|
2276
|
-
return /* @__PURE__ */ (0,
|
|
2299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_ui_web16.Card, { className: (0, import_ui_web16.cn)("border-0", className), children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_ui_web16.CardContent, { className: "p-4 flex justify-center items-center", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-text-secondary", children: "Couldn't load team information. Please try again." }) }) });
|
|
2277
2300
|
}
|
|
2278
2301
|
if (leagueId === null) {
|
|
2279
|
-
return /* @__PURE__ */ (0,
|
|
2280
|
-
/* @__PURE__ */ (0,
|
|
2281
|
-
/* @__PURE__ */ (0,
|
|
2302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_ui_web16.Card, { className: (0, import_ui_web16.cn)("border-0", className), children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_ui_web16.CardContent, { className: "p-4 flex justify-center items-center gap-2", children: [
|
|
2303
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_ui_web16.IconLoader, {}),
|
|
2304
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-text-secondary", children: "Loading team information..." })
|
|
2282
2305
|
] }) });
|
|
2283
2306
|
}
|
|
2284
|
-
return /* @__PURE__ */ (0,
|
|
2285
|
-
|
|
2307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2308
|
+
import_ui_web16.Card,
|
|
2286
2309
|
{
|
|
2287
|
-
className: (0,
|
|
2310
|
+
className: (0, import_ui_web16.cn)(
|
|
2288
2311
|
"border-none p-4 flex flex-col gap-3 xl:h-full xl:min-h-0 xl:flex-1 xl:overflow-hidden",
|
|
2289
2312
|
className
|
|
2290
2313
|
),
|
|
2291
2314
|
children: [
|
|
2292
|
-
/* @__PURE__ */ (0,
|
|
2293
|
-
/* @__PURE__ */ (0,
|
|
2315
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_ui_web16.CardHeader, { className: "p-0 flex flex-row items-center justify-between space-y-0", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_ui_web16.CardTitle, { children: "Schedule" }) }),
|
|
2316
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_ui_web16.CardContent, { className: "space-y-0 p-0 flex flex-col gap-3 xl:flex-1 xl:min-h-0 xl:overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2294
2317
|
ScheduleBody,
|
|
2295
2318
|
{
|
|
2296
2319
|
seasonsLoading,
|
|
@@ -2320,6 +2343,7 @@ function TeamScheduleTable({
|
|
|
2320
2343
|
StatRankingLeaderboardDialog,
|
|
2321
2344
|
TeamFactsContent,
|
|
2322
2345
|
TeamFactsWidget,
|
|
2346
|
+
TeamHeaderCard,
|
|
2323
2347
|
TeamInfoCard,
|
|
2324
2348
|
TeamScheduleTable,
|
|
2325
2349
|
TeamSeasonScheduleSummaryPanel,
|