@nukleus-sports/ui-patterns 0.7.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-4N2GUEA7.js → chunk-2KJMI6DZ.js} +5 -2
- package/dist/chunk-2KJMI6DZ.js.map +1 -0
- package/dist/client.cjs +4 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +1 -1
- package/dist/index.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +1 -1
- package/dist/marketing.cjs +4 -1
- package/dist/marketing.cjs.map +1 -1
- package/dist/marketing.js +1 -1
- package/dist/team.cjs +566 -327
- package/dist/team.cjs.map +1 -1
- package/dist/team.d.cts +36 -2
- package/dist/team.d.ts +36 -2
- package/dist/team.js +544 -297
- package/dist/team.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-4N2GUEA7.js.map +0 -1
package/dist/team.cjs
CHANGED
|
@@ -32,6 +32,8 @@ __export(team_exports, {
|
|
|
32
32
|
TeamFactsWidget: () => TeamFactsWidget,
|
|
33
33
|
TeamHeaderCard: () => TeamHeaderCard,
|
|
34
34
|
TeamInfoCard: () => TeamInfoCard,
|
|
35
|
+
TeamPlacesCard: () => TeamPlacesCard,
|
|
36
|
+
TeamRosterTable: () => TeamRosterTable,
|
|
35
37
|
TeamScheduleTable: () => TeamScheduleTable,
|
|
36
38
|
TeamSeasonScheduleSummaryPanel: () => TeamSeasonScheduleSummaryPanel,
|
|
37
39
|
TeamSeasonStatsSummaryPanel: () => TeamSeasonStatsSummaryPanel,
|
|
@@ -97,6 +99,7 @@ function EntityAvatar({
|
|
|
97
99
|
className,
|
|
98
100
|
fallbackClassName,
|
|
99
101
|
showInitials = true,
|
|
102
|
+
preferInitials = false,
|
|
100
103
|
cacheBreaker
|
|
101
104
|
}) {
|
|
102
105
|
const extractedFirstName = firstName || entityData?.first_name || "";
|
|
@@ -241,6 +244,8 @@ function EntityAvatar({
|
|
|
241
244
|
return "Avatar";
|
|
242
245
|
}
|
|
243
246
|
};
|
|
247
|
+
const hasNameInitials = Boolean(extractedFirstName[0] || extractedLastName[0]);
|
|
248
|
+
const showsInitialsText = entityType === "contact" || entityType === "initials" || preferInitials && showInitials && hasNameInitials;
|
|
244
249
|
const processedImageUrl = getImageUrl();
|
|
245
250
|
const defaultImageUrl = getDefaultImageUrl();
|
|
246
251
|
const initials = getInitials();
|
|
@@ -258,7 +263,7 @@ function EntityAvatar({
|
|
|
258
263
|
isSquared && "rounded-lg bg-greys-grey-table-h",
|
|
259
264
|
fallbackClassName
|
|
260
265
|
),
|
|
261
|
-
children:
|
|
266
|
+
children: showsInitialsText ? initials : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
262
267
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
263
268
|
"img",
|
|
264
269
|
{
|
|
@@ -343,7 +348,7 @@ function TeamInfoCard({ team, resolveImageUrl, className }) {
|
|
|
343
348
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "flex flex-col text-right", children: team.officialWebsite ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
344
349
|
"a",
|
|
345
350
|
{
|
|
346
|
-
href:
|
|
351
|
+
href: (0, import_core.getTeamWebsiteHref)(team.officialWebsite),
|
|
347
352
|
target: "_blank",
|
|
348
353
|
rel: "noopener noreferrer",
|
|
349
354
|
className: "text-primary-color-nuk-text body-text inline-flex items-center justify-end gap-1",
|
|
@@ -525,6 +530,7 @@ function TeamStaffTable({
|
|
|
525
530
|
coach_image_url: member.coach_image_url
|
|
526
531
|
},
|
|
527
532
|
resolveImageUrl,
|
|
533
|
+
preferInitials: true,
|
|
528
534
|
size: isCompact ? "xs" : "lg"
|
|
529
535
|
}
|
|
530
536
|
)
|
|
@@ -594,12 +600,243 @@ function TeamStaffTable({
|
|
|
594
600
|
) });
|
|
595
601
|
}
|
|
596
602
|
|
|
597
|
-
// src/team/
|
|
603
|
+
// src/team/team-roster-table.tsx
|
|
604
|
+
var import_react2 = require("react");
|
|
605
|
+
var import_ui_web5 = require("@nukleus-sports/ui-web");
|
|
606
|
+
var import_core4 = require("@nukleus-sports/core");
|
|
598
607
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
608
|
+
var DEFAULT_SORT2 = [{ id: "first_name", desc: false }];
|
|
609
|
+
var NO_SORT = [];
|
|
610
|
+
function cellSizeFor(key, isCompact) {
|
|
611
|
+
switch (key) {
|
|
612
|
+
case "first_name":
|
|
613
|
+
return isCompact ? "teamMobile" : "xl";
|
|
614
|
+
case "college":
|
|
615
|
+
case "birthplace":
|
|
616
|
+
case "hometown":
|
|
617
|
+
return "l";
|
|
618
|
+
default:
|
|
619
|
+
return "xxs";
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
function RosterNameCell({
|
|
623
|
+
player,
|
|
624
|
+
value,
|
|
625
|
+
rowClickable,
|
|
626
|
+
onPlayerClick,
|
|
627
|
+
isCompact,
|
|
628
|
+
resolveImageUrl
|
|
629
|
+
}) {
|
|
630
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
631
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
632
|
+
EntityAvatar,
|
|
633
|
+
{
|
|
634
|
+
entityType: "player",
|
|
635
|
+
entityData: {
|
|
636
|
+
first_name: player.first_name,
|
|
637
|
+
last_name: player.last_name,
|
|
638
|
+
player_image_url: player.player_image_url
|
|
639
|
+
},
|
|
640
|
+
resolveImageUrl,
|
|
641
|
+
preferInitials: true,
|
|
642
|
+
size: "md",
|
|
643
|
+
className: isCompact ? "h-5 w-5" : "h-[34px] w-[34px]"
|
|
644
|
+
}
|
|
645
|
+
),
|
|
646
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "min-w-0 line-clamp-2 break-words", children: value })
|
|
647
|
+
] });
|
|
648
|
+
return rowClickable ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
649
|
+
"button",
|
|
650
|
+
{
|
|
651
|
+
type: "button",
|
|
652
|
+
className: "flex min-w-0 w-full items-center gap-2 text-left",
|
|
653
|
+
"aria-label": `View ${value}'s profile`,
|
|
654
|
+
onClick: (event) => {
|
|
655
|
+
event.stopPropagation();
|
|
656
|
+
onPlayerClick?.(player.id);
|
|
657
|
+
},
|
|
658
|
+
children: content
|
|
659
|
+
}
|
|
660
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex min-w-0 w-full items-center gap-2", children: content });
|
|
661
|
+
}
|
|
662
|
+
function splitGridCols(isCompact, isSplitLayout) {
|
|
663
|
+
if (isCompact) return "!grid-cols-[minmax(136px,136px)_1fr]";
|
|
664
|
+
return isSplitLayout ? "sm:!grid-cols-[minmax(220px,220px)_1fr]" : "";
|
|
665
|
+
}
|
|
666
|
+
function useRosterSorting({ sortable, sorting, onSortingChange }) {
|
|
667
|
+
const [internalSorting, setInternalSorting] = (0, import_react2.useState)(DEFAULT_SORT2);
|
|
668
|
+
const activeSorting = sortable ? sorting ?? internalSorting : NO_SORT;
|
|
669
|
+
const handleSortingChange = onSortingChange ?? setInternalSorting;
|
|
670
|
+
const tableSortingProps = sortable ? {
|
|
671
|
+
sorting: activeSorting,
|
|
672
|
+
manualSorting: true,
|
|
673
|
+
onSortingChange: ((updater) => {
|
|
674
|
+
const next = typeof updater === "function" ? updater(activeSorting) : updater;
|
|
675
|
+
handleSortingChange(next);
|
|
676
|
+
})
|
|
677
|
+
} : { manualSorting: false };
|
|
678
|
+
return { activeSorting, tableSortingProps };
|
|
679
|
+
}
|
|
680
|
+
function useRosterColumns({
|
|
681
|
+
leagueId,
|
|
682
|
+
sortable,
|
|
683
|
+
rowClickable,
|
|
684
|
+
onPlayerClick,
|
|
685
|
+
isCompact,
|
|
686
|
+
resolveImageUrl
|
|
687
|
+
}) {
|
|
688
|
+
return (0, import_react2.useMemo)(() => {
|
|
689
|
+
if (leagueId === null) return [];
|
|
690
|
+
const dataColumns = (0, import_core4.getRosterColumns)(leagueId).map(
|
|
691
|
+
({ key, label }) => ({
|
|
692
|
+
id: key,
|
|
693
|
+
header: sortable ? (0, import_ui_web5.createClickableSortableHeader)(label) : label,
|
|
694
|
+
accessorFn: (player) => (0, import_core4.getRosterCellValue)(player, key, leagueId),
|
|
695
|
+
enableSorting: sortable,
|
|
696
|
+
enableMultiSort: false,
|
|
697
|
+
cell: ({ row }) => {
|
|
698
|
+
const player = row.original;
|
|
699
|
+
const value = (0, import_core4.getRosterCellValue)(player, key, leagueId);
|
|
700
|
+
if (key !== "first_name") {
|
|
701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex items-center h-full min-h-[46px]", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "line-clamp-2 break-all", children: value }) });
|
|
702
|
+
}
|
|
703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
704
|
+
RosterNameCell,
|
|
705
|
+
{
|
|
706
|
+
player,
|
|
707
|
+
value,
|
|
708
|
+
rowClickable,
|
|
709
|
+
onPlayerClick,
|
|
710
|
+
isCompact,
|
|
711
|
+
resolveImageUrl
|
|
712
|
+
}
|
|
713
|
+
);
|
|
714
|
+
},
|
|
715
|
+
meta: { cellSize: cellSizeFor(key, isCompact) }
|
|
716
|
+
})
|
|
717
|
+
);
|
|
718
|
+
return [
|
|
719
|
+
...dataColumns,
|
|
720
|
+
{
|
|
721
|
+
id: "empty",
|
|
722
|
+
header: "",
|
|
723
|
+
enableSorting: false,
|
|
724
|
+
cell: () => null,
|
|
725
|
+
meta: { cellSize: "" }
|
|
726
|
+
}
|
|
727
|
+
];
|
|
728
|
+
}, [leagueId, sortable, rowClickable, onPlayerClick, isCompact, resolveImageUrl]);
|
|
729
|
+
}
|
|
730
|
+
function TeamRosterTable({
|
|
731
|
+
players,
|
|
732
|
+
leagueId,
|
|
733
|
+
loading,
|
|
734
|
+
isError,
|
|
735
|
+
rowClickable = false,
|
|
736
|
+
onPlayerClick,
|
|
737
|
+
sortable = false,
|
|
738
|
+
sorting,
|
|
739
|
+
onSortingChange,
|
|
740
|
+
virtualized = false,
|
|
741
|
+
isSplitLayout = false,
|
|
742
|
+
isCompact = false,
|
|
743
|
+
resolveImageUrl,
|
|
744
|
+
className
|
|
745
|
+
}) {
|
|
746
|
+
const { activeSorting, tableSortingProps } = useRosterSorting({
|
|
747
|
+
sortable,
|
|
748
|
+
sorting,
|
|
749
|
+
onSortingChange
|
|
750
|
+
});
|
|
751
|
+
const sortedPlayers = (0, import_react2.useMemo)(
|
|
752
|
+
() => (0, import_core4.sortTeamPlayers)(players, activeSorting, leagueId ?? void 0),
|
|
753
|
+
[players, activeSorting, leagueId]
|
|
754
|
+
);
|
|
755
|
+
const { visibleItems, sentinelRef, hasMore } = (0, import_ui_web5.useInfiniteList)(sortedPlayers, {
|
|
756
|
+
resetKey: `${leagueId ?? ""}|${players.length}|${JSON.stringify(activeSorting)}`
|
|
757
|
+
});
|
|
758
|
+
const displayedPlayers = virtualized ? visibleItems : sortedPlayers;
|
|
759
|
+
const columns = useRosterColumns({
|
|
760
|
+
leagueId,
|
|
761
|
+
sortable,
|
|
762
|
+
rowClickable,
|
|
763
|
+
onPlayerClick,
|
|
764
|
+
isCompact,
|
|
765
|
+
resolveImageUrl
|
|
766
|
+
});
|
|
767
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.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_runtime5.jsx)(
|
|
768
|
+
import_ui_web5.BaseTable,
|
|
769
|
+
{
|
|
770
|
+
columns,
|
|
771
|
+
data: displayedPlayers,
|
|
772
|
+
getRowId: (row) => String(row.id),
|
|
773
|
+
...tableSortingProps,
|
|
774
|
+
onRowClick: rowClickable ? (player) => onPlayerClick?.(player.id) : void 0,
|
|
775
|
+
loading,
|
|
776
|
+
emptyMessage: isError ? "Failed to load roster. Please try again." : "No roster found",
|
|
777
|
+
pageSize: Math.max(displayedPlayers.length, 25),
|
|
778
|
+
hidePagination: virtualized,
|
|
779
|
+
stickyHeader: true,
|
|
780
|
+
splitLayout: isSplitLayout,
|
|
781
|
+
numberOfColumns: 1,
|
|
782
|
+
splitLayoutGridCols: splitGridCols(isCompact, isSplitLayout),
|
|
783
|
+
containerClassName: (0, import_ui_web5.cn)("border-0 rounded-none xl:h-full", virtualized && "h-full"),
|
|
784
|
+
className: (0, import_ui_web5.cn)(
|
|
785
|
+
"border-none xl:flex-1 xl:min-h-0 xl:overflow-hidden",
|
|
786
|
+
virtualized && "h-full min-h-0 w-full",
|
|
787
|
+
className
|
|
788
|
+
),
|
|
789
|
+
bottomContent: virtualized && hasMore ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { ref: sentinelRef, className: "h-px w-full" }) : null
|
|
790
|
+
}
|
|
791
|
+
) });
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
// src/team/team-places-card.tsx
|
|
795
|
+
var import_react3 = require("react");
|
|
796
|
+
var import_ui_web6 = require("@nukleus-sports/ui-web");
|
|
797
|
+
var import_core5 = require("@nukleus-sports/core");
|
|
798
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
799
|
+
function TeamPlacesCard({ team, className }) {
|
|
800
|
+
const { venue, facility } = (0, import_core5.getTeamPlaceSummaries)(team.specificData, team.leagueAbbreviation);
|
|
801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ui_web6.Card, { className: (0, import_ui_web6.cn)("border-0", className), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ui_web6.CardContent, { className: "p-4", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "grid h-full grid-cols-[auto_1fr] gap-x-3 gap-y-4 sm:gap-4", children: [
|
|
802
|
+
[venue, facility].map((place) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react3.Fragment, { children: [
|
|
803
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex flex-col max-sm:max-w-[96px]", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "mb-1 text-14.5 text-text-primary sm:text-base", children: place.label }) }),
|
|
804
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex flex-col break-words text-right max-sm:min-w-0", children: place.name ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "text-14.5 sm:text-base", children: [
|
|
805
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: place.name }),
|
|
806
|
+
place.address ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: place.address }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-muted-foreground", children: "No address available" })
|
|
807
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-14.5 text-muted-foreground sm:text-base", children: "No address available" }) })
|
|
808
|
+
] }, place.label)),
|
|
809
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex flex-col max-sm:max-w-[96px]", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "mb-1 text-14.5 text-text-primary sm:text-base", children: "Website" }) }),
|
|
810
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex flex-col break-words text-right max-sm:min-w-0", children: team.officialWebsite ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
811
|
+
"a",
|
|
812
|
+
{
|
|
813
|
+
href: (0, import_core5.getTeamWebsiteHref)(team.officialWebsite),
|
|
814
|
+
target: "_blank",
|
|
815
|
+
rel: "noopener noreferrer",
|
|
816
|
+
className: "inline-flex items-center justify-end gap-1 text-14.5 text-primary-color-nuk-text sm:text-base",
|
|
817
|
+
children: [
|
|
818
|
+
team.officialWebsite.replace(/^https?:\/\//i, ""),
|
|
819
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { className: "h-3 w-3", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
820
|
+
"path",
|
|
821
|
+
{
|
|
822
|
+
strokeLinecap: "round",
|
|
823
|
+
strokeLinejoin: "round",
|
|
824
|
+
strokeWidth: 2,
|
|
825
|
+
d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
|
|
826
|
+
}
|
|
827
|
+
) })
|
|
828
|
+
]
|
|
829
|
+
}
|
|
830
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-14.5 text-muted-foreground sm:text-base", children: "No website available" }) })
|
|
831
|
+
] }) }) });
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
// src/team/stat-column.tsx
|
|
835
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
599
836
|
function StatColumn({ label, value, suffix, rankBadge }) {
|
|
600
|
-
return /* @__PURE__ */ (0,
|
|
601
|
-
/* @__PURE__ */ (0,
|
|
602
|
-
/* @__PURE__ */ (0,
|
|
837
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col items-center h-full justify-center flex-1 gap-1 sm:gap-3 w-full", children: [
|
|
838
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "label-xs-medium text-text-secondary leading-normal opacity-[0.8] ss05", children: label }),
|
|
839
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "text-[19px] font-semibold sm:text-[32px] sm:font-bold text-text-primary leading-normal title-text opacity-[0.8]", children: [
|
|
603
840
|
value,
|
|
604
841
|
suffix || ""
|
|
605
842
|
] }),
|
|
@@ -608,9 +845,9 @@ function StatColumn({ label, value, suffix, rankBadge }) {
|
|
|
608
845
|
}
|
|
609
846
|
|
|
610
847
|
// src/team/team-season-stats-summary-panel.tsx
|
|
611
|
-
var
|
|
612
|
-
var
|
|
613
|
-
var
|
|
848
|
+
var import_ui_web7 = require("@nukleus-sports/ui-web");
|
|
849
|
+
var import_core6 = require("@nukleus-sports/core");
|
|
850
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
614
851
|
function getStatusMessage({
|
|
615
852
|
isSupportedSport,
|
|
616
853
|
selectedYear,
|
|
@@ -633,17 +870,17 @@ function TeamSeasonStatsSummaryPanel({
|
|
|
633
870
|
isError,
|
|
634
871
|
className
|
|
635
872
|
}) {
|
|
636
|
-
const columns = (0,
|
|
873
|
+
const columns = (0, import_core6.getTeamStatColumns)(sportId);
|
|
637
874
|
const statusMessage = loading ? null : getStatusMessage({
|
|
638
|
-
isSupportedSport: (0,
|
|
875
|
+
isSupportedSport: (0, import_core6.isSupportedTeamStatsSport)(sportId),
|
|
639
876
|
selectedYear,
|
|
640
877
|
selectedType,
|
|
641
878
|
isError,
|
|
642
879
|
stats
|
|
643
880
|
});
|
|
644
|
-
return /* @__PURE__ */ (0,
|
|
645
|
-
/* @__PURE__ */ (0,
|
|
646
|
-
/* @__PURE__ */ (0,
|
|
881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_ui_web7.Card, { className: (0, import_ui_web7.cn)("border-0 p-4 flex flex-col gap-4", className), children: [
|
|
882
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_ui_web7.CardHeader, { className: "p-0", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_ui_web7.CardTitle, { className: "text-base text-text-primary font-medium leading-normal", children: "Season Stats" }) }),
|
|
883
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_ui_web7.CardContent, { className: "p-0 flex-1 flex justify-center items-center", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex items-center justify-center w-full", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_ui_web7.Skeleton, { className: "h-4 w-3/4" }) }) : statusMessage ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex items-center justify-center w-full text-14.5 text-text-secondary", children: statusMessage }) : stats && /* @__PURE__ */ (0, import_jsx_runtime8.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_runtime8.jsx)(
|
|
647
884
|
StatColumn,
|
|
648
885
|
{
|
|
649
886
|
label: col.label,
|
|
@@ -656,8 +893,8 @@ function TeamSeasonStatsSummaryPanel({
|
|
|
656
893
|
}
|
|
657
894
|
|
|
658
895
|
// src/team/team-season-schedule-summary-panel.tsx
|
|
659
|
-
var
|
|
660
|
-
var
|
|
896
|
+
var import_ui_web8 = require("@nukleus-sports/ui-web");
|
|
897
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
661
898
|
function TeamSeasonScheduleSummaryPanel({
|
|
662
899
|
selectedYear,
|
|
663
900
|
selectedType,
|
|
@@ -666,11 +903,11 @@ function TeamSeasonScheduleSummaryPanel({
|
|
|
666
903
|
isError,
|
|
667
904
|
className
|
|
668
905
|
}) {
|
|
669
|
-
return /* @__PURE__ */ (0,
|
|
670
|
-
/* @__PURE__ */ (0,
|
|
671
|
-
/* @__PURE__ */ (0,
|
|
672
|
-
/* @__PURE__ */ (0,
|
|
673
|
-
/* @__PURE__ */ (0,
|
|
906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_ui_web8.Card, { className: (0, import_ui_web8.cn)("border-0 p-4 flex flex-col gap-4", className), children: [
|
|
907
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_ui_web8.CardHeader, { className: "p-0", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_ui_web8.CardTitle, { className: "text-base text-text-primary font-medium leading-normal", children: "Season Summary" }) }),
|
|
908
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_ui_web8.CardContent, { className: "p-0 flex-1 flex justify-center items-center", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex items-center justify-center w-full", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_ui_web8.Skeleton, { className: "h-4 w-3/4" }) }) : !selectedYear || selectedType === null ? /* @__PURE__ */ (0, import_jsx_runtime9.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_runtime9.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_runtime9.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_runtime9.jsxs)("div", { className: "w-full flex flex-col sm:flex-row gap-6 sm:gap-3 justify-between items-center", children: [
|
|
909
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(StatColumn, { label: "Record", value: summary.record }),
|
|
910
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
674
911
|
StatColumn,
|
|
675
912
|
{
|
|
676
913
|
label: "Games Played",
|
|
@@ -682,8 +919,8 @@ function TeamSeasonScheduleSummaryPanel({
|
|
|
682
919
|
}
|
|
683
920
|
|
|
684
921
|
// src/team/season-selector.tsx
|
|
685
|
-
var
|
|
686
|
-
var
|
|
922
|
+
var import_ui_web9 = require("@nukleus-sports/ui-web");
|
|
923
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
687
924
|
function SeasonSelector({
|
|
688
925
|
years,
|
|
689
926
|
types,
|
|
@@ -694,39 +931,39 @@ function SeasonSelector({
|
|
|
694
931
|
hideTypeOnMobile = false,
|
|
695
932
|
className
|
|
696
933
|
}) {
|
|
697
|
-
return /* @__PURE__ */ (0,
|
|
698
|
-
/* @__PURE__ */ (0,
|
|
699
|
-
|
|
934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: (0, import_ui_web9.cn)("flex gap-3", className), children: [
|
|
935
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
936
|
+
import_ui_web9.Select,
|
|
700
937
|
{
|
|
701
938
|
value: selectedYear?.toString() ?? "",
|
|
702
939
|
onValueChange: (value) => onYearChange(Number(value)),
|
|
703
940
|
children: [
|
|
704
|
-
/* @__PURE__ */ (0,
|
|
705
|
-
/* @__PURE__ */ (0,
|
|
706
|
-
|
|
941
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_ui_web9.SelectTrigger, { variant: "widget", size: "widget", "aria-label": "Season year", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_ui_web9.SelectValue, { placeholder: "Select year" }) }),
|
|
942
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
943
|
+
import_ui_web9.SelectContent,
|
|
707
944
|
{
|
|
708
945
|
className: "bg-card border-border z-50 [&_.checkbox]:!flex",
|
|
709
946
|
classNameViewPort: "gap-2",
|
|
710
|
-
children: years.map((year) => /* @__PURE__ */ (0,
|
|
947
|
+
children: years.map((year) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_ui_web9.SelectItem, { value: year.value.toString(), className: "min-h-8", children: year.label }, year.value))
|
|
711
948
|
}
|
|
712
949
|
)
|
|
713
950
|
]
|
|
714
951
|
}
|
|
715
952
|
),
|
|
716
|
-
/* @__PURE__ */ (0,
|
|
717
|
-
|
|
953
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: (0, import_ui_web9.cn)(hideTypeOnMobile && "hidden sm:block"), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
954
|
+
import_ui_web9.Select,
|
|
718
955
|
{
|
|
719
956
|
value: selectedType?.toString() ?? "",
|
|
720
957
|
onValueChange: (value) => onTypeChange(Number(value)),
|
|
721
958
|
disabled: selectedYear === null,
|
|
722
959
|
children: [
|
|
723
|
-
/* @__PURE__ */ (0,
|
|
724
|
-
/* @__PURE__ */ (0,
|
|
725
|
-
|
|
960
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_ui_web9.SelectTrigger, { variant: "widget", size: "widget", "aria-label": "Season type", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_ui_web9.SelectValue, { placeholder: "Select type" }) }),
|
|
961
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
962
|
+
import_ui_web9.SelectContent,
|
|
726
963
|
{
|
|
727
964
|
className: "bg-card border-border z-50 [&_.checkbox]:!flex",
|
|
728
965
|
classNameViewPort: "gap-2",
|
|
729
|
-
children: types.map((type) => /* @__PURE__ */ (0,
|
|
966
|
+
children: types.map((type) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_ui_web9.SelectItem, { value: type.value.toString(), className: "min-h-8", children: type.label }, type.value))
|
|
730
967
|
}
|
|
731
968
|
)
|
|
732
969
|
]
|
|
@@ -736,9 +973,9 @@ function SeasonSelector({
|
|
|
736
973
|
}
|
|
737
974
|
|
|
738
975
|
// src/team/fact-pills.tsx
|
|
739
|
-
var
|
|
740
|
-
var
|
|
741
|
-
var
|
|
976
|
+
var import_react4 = require("react");
|
|
977
|
+
var import_ui_web10 = require("@nukleus-sports/ui-web");
|
|
978
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
742
979
|
var MAX_ROWS = 2;
|
|
743
980
|
var KEY_SEPARATOR = "";
|
|
744
981
|
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";
|
|
@@ -753,16 +990,16 @@ function pillKeys(items) {
|
|
|
753
990
|
});
|
|
754
991
|
}
|
|
755
992
|
function FactPills({ items, capped = false }) {
|
|
756
|
-
const listId = (0,
|
|
757
|
-
const listRef = (0,
|
|
758
|
-
const [expanded, setExpanded] = (0,
|
|
759
|
-
const [visibleCount, setVisibleCount] = (0,
|
|
760
|
-
const [clipHeight, setClipHeight] = (0,
|
|
761
|
-
const [width, setWidth] = (0,
|
|
993
|
+
const listId = (0, import_react4.useId)();
|
|
994
|
+
const listRef = (0, import_react4.useRef)(null);
|
|
995
|
+
const [expanded, setExpanded] = (0, import_react4.useState)(false);
|
|
996
|
+
const [visibleCount, setVisibleCount] = (0, import_react4.useState)(null);
|
|
997
|
+
const [clipHeight, setClipHeight] = (0, import_react4.useState)(null);
|
|
998
|
+
const [width, setWidth] = (0, import_react4.useState)(0);
|
|
762
999
|
const contentKey = items.join(KEY_SEPARATOR);
|
|
763
1000
|
const keys = pillKeys(items);
|
|
764
1001
|
const collapsible = capped && !expanded;
|
|
765
|
-
(0,
|
|
1002
|
+
(0, import_react4.useLayoutEffect)(() => {
|
|
766
1003
|
const list = listRef.current;
|
|
767
1004
|
if (!capped || !list || typeof ResizeObserver === "undefined") return;
|
|
768
1005
|
const observer = new ResizeObserver((entries) => {
|
|
@@ -773,12 +1010,12 @@ function FactPills({ items, capped = false }) {
|
|
|
773
1010
|
return () => observer.disconnect();
|
|
774
1011
|
}, [capped]);
|
|
775
1012
|
const measurementKey = `${width}:${contentKey}`;
|
|
776
|
-
const [measuredFor, setMeasuredFor] = (0,
|
|
1013
|
+
const [measuredFor, setMeasuredFor] = (0, import_react4.useState)(measurementKey);
|
|
777
1014
|
if (measuredFor !== measurementKey) {
|
|
778
1015
|
setMeasuredFor(measurementKey);
|
|
779
1016
|
if (visibleCount !== null) setVisibleCount(null);
|
|
780
1017
|
}
|
|
781
|
-
(0,
|
|
1018
|
+
(0, import_react4.useLayoutEffect)(() => {
|
|
782
1019
|
const list = listRef.current;
|
|
783
1020
|
if (!collapsible || !list) return;
|
|
784
1021
|
const children = Array.from(list.children).filter(
|
|
@@ -809,19 +1046,19 @@ function FactPills({ items, capped = false }) {
|
|
|
809
1046
|
setExpanded(false);
|
|
810
1047
|
setVisibleCount(null);
|
|
811
1048
|
};
|
|
812
|
-
return /* @__PURE__ */ (0,
|
|
1049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
813
1050
|
"ul",
|
|
814
1051
|
{
|
|
815
1052
|
id: listId,
|
|
816
1053
|
ref: listRef,
|
|
817
|
-
className: (0,
|
|
1054
|
+
className: (0, import_ui_web10.cn)(
|
|
818
1055
|
"flex w-full flex-wrap content-start items-start gap-1",
|
|
819
1056
|
collapsible && "overflow-hidden"
|
|
820
1057
|
),
|
|
821
1058
|
style: collapsible && clipHeight !== null ? { maxHeight: clipHeight } : void 0,
|
|
822
1059
|
children: [
|
|
823
|
-
items.slice(0, shownCount).map((item, index) => /* @__PURE__ */ (0,
|
|
824
|
-
truncated && /* @__PURE__ */ (0,
|
|
1060
|
+
items.slice(0, shownCount).map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("li", { className: PILL_CLASS, title: String(item), children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "truncate", children: item }) }, keys[index])),
|
|
1061
|
+
truncated && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("li", { className: "flex shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
825
1062
|
"button",
|
|
826
1063
|
{
|
|
827
1064
|
type: "button",
|
|
@@ -832,7 +1069,7 @@ function FactPills({ items, capped = false }) {
|
|
|
832
1069
|
children: "Show More"
|
|
833
1070
|
}
|
|
834
1071
|
) }),
|
|
835
|
-
capped && expanded && /* @__PURE__ */ (0,
|
|
1072
|
+
capped && expanded && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("li", { className: "flex shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
836
1073
|
"button",
|
|
837
1074
|
{
|
|
838
1075
|
type: "button",
|
|
@@ -849,9 +1086,9 @@ function FactPills({ items, capped = false }) {
|
|
|
849
1086
|
}
|
|
850
1087
|
|
|
851
1088
|
// src/team/fact-field.tsx
|
|
852
|
-
var
|
|
853
|
-
var
|
|
854
|
-
var
|
|
1089
|
+
var import_ui_web11 = require("@nukleus-sports/ui-web");
|
|
1090
|
+
var import_core7 = require("@nukleus-sports/core");
|
|
1091
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
855
1092
|
function numberFact(facts, key) {
|
|
856
1093
|
const value = facts[key];
|
|
857
1094
|
return typeof value === "number" ? value : null;
|
|
@@ -864,23 +1101,23 @@ function textFact(facts, key) {
|
|
|
864
1101
|
const value = facts[key];
|
|
865
1102
|
return typeof value === "string" ? value : null;
|
|
866
1103
|
}
|
|
867
|
-
function EmptyValue({ children =
|
|
868
|
-
return /* @__PURE__ */ (0,
|
|
1104
|
+
function EmptyValue({ children = import_core7.EMPTY_FACT_VALUE }) {
|
|
1105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "body-text font-ss02-ss05 text-text-secondary", children });
|
|
869
1106
|
}
|
|
870
1107
|
function FieldLabel({ children }) {
|
|
871
|
-
return /* @__PURE__ */ (0,
|
|
1108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "w-full label-xs-text font-ss02-ss05 text-text-secondary", children });
|
|
872
1109
|
}
|
|
873
1110
|
function CountFact({
|
|
874
1111
|
factKey,
|
|
875
1112
|
data
|
|
876
1113
|
}) {
|
|
877
1114
|
const { facts, config } = data;
|
|
878
|
-
const pairedYears =
|
|
879
|
-
const years = pairedYears ? (0,
|
|
880
|
-
return /* @__PURE__ */ (0,
|
|
881
|
-
/* @__PURE__ */ (0,
|
|
882
|
-
/* @__PURE__ */ (0,
|
|
883
|
-
years.length > 0 && /* @__PURE__ */ (0,
|
|
1115
|
+
const pairedYears = import_core7.TEAM_FACT_YEAR_PAIRS[factKey];
|
|
1116
|
+
const years = pairedYears ? (0, import_core7.formatYearPills)(listFact(facts, pairedYears), config.formatChampionshipYear) : [];
|
|
1117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex min-w-0 flex-col items-start gap-1", children: [
|
|
1118
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FieldLabel, { children: config.labels[factKey] }),
|
|
1119
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "stat-count-number title-text text-text-primary", children: (0, import_core7.formatTeamFactNumber)("count", numberFact(facts, factKey)) }),
|
|
1120
|
+
years.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FactPills, { items: years, capped: true })
|
|
884
1121
|
] });
|
|
885
1122
|
}
|
|
886
1123
|
function RivalValue({
|
|
@@ -890,14 +1127,14 @@ function RivalValue({
|
|
|
890
1127
|
}) {
|
|
891
1128
|
switch (rival.status) {
|
|
892
1129
|
case "none":
|
|
893
|
-
return /* @__PURE__ */ (0,
|
|
1130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(EmptyValue, {});
|
|
894
1131
|
case "loading":
|
|
895
|
-
return /* @__PURE__ */ (0,
|
|
1132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_ui_web11.Skeleton, { className: "h-8 w-40", "aria-label": "Loading rival" });
|
|
896
1133
|
case "error":
|
|
897
|
-
return /* @__PURE__ */ (0,
|
|
1134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(EmptyValue, { children: "Couldn't load the rival team" });
|
|
898
1135
|
case "ready": {
|
|
899
|
-
const content = /* @__PURE__ */ (0,
|
|
900
|
-
/* @__PURE__ */ (0,
|
|
1136
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1137
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
901
1138
|
EntityAvatar,
|
|
902
1139
|
{
|
|
903
1140
|
entityType: "initials",
|
|
@@ -908,37 +1145,37 @@ function RivalValue({
|
|
|
908
1145
|
className: "shrink-0"
|
|
909
1146
|
}
|
|
910
1147
|
),
|
|
911
|
-
/* @__PURE__ */ (0,
|
|
1148
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "min-w-0", children: rival.rival.name })
|
|
912
1149
|
] });
|
|
913
1150
|
const className = "inline-flex max-w-full items-center gap-1.5 body-text-semibold font-ss02-ss05 text-primary-color-nuk-text";
|
|
914
|
-
return getRivalHref ? /* @__PURE__ */ (0,
|
|
1151
|
+
return getRivalHref ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("a", { href: getRivalHref(rival.rival.id), className: (0, import_ui_web11.cn)(className, "hover:underline"), children: content }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className, children: content });
|
|
915
1152
|
}
|
|
916
1153
|
}
|
|
917
1154
|
}
|
|
918
1155
|
function factValue(factKey, layout, data, resolveImageUrl, getRivalHref) {
|
|
919
1156
|
const { facts, config } = data;
|
|
920
|
-
const kind =
|
|
1157
|
+
const kind = import_core7.TEAM_FACT_KINDS[factKey];
|
|
921
1158
|
if (kind === "number" || kind === "year" || kind === "text") {
|
|
922
|
-
const display = kind === "text" ? textFact(facts, factKey) : (0,
|
|
923
|
-
const isEmpty = !display || display ===
|
|
924
|
-
return /* @__PURE__ */ (0,
|
|
1159
|
+
const display = kind === "text" ? textFact(facts, factKey) : (0, import_core7.formatTeamFactNumber)(kind, numberFact(facts, factKey));
|
|
1160
|
+
const isEmpty = !display || display === import_core7.EMPTY_FACT_VALUE;
|
|
1161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
925
1162
|
"span",
|
|
926
1163
|
{
|
|
927
|
-
className: (0,
|
|
1164
|
+
className: (0, import_ui_web11.cn)(
|
|
928
1165
|
"w-full header-xl-medium-card font-ss02-ss05 [overflow-wrap:anywhere]",
|
|
929
1166
|
isEmpty ? "text-text-secondary" : "text-text-primary"
|
|
930
1167
|
),
|
|
931
|
-
children: display ??
|
|
1168
|
+
children: display ?? import_core7.EMPTY_FACT_VALUE
|
|
932
1169
|
}
|
|
933
1170
|
);
|
|
934
1171
|
}
|
|
935
1172
|
if (kind === "years" || kind === "labeled_years" || kind === "list") {
|
|
936
1173
|
const raw = listFact(facts, factKey);
|
|
937
|
-
const items = kind === "years" ? (0,
|
|
938
|
-
return items.length > 0 ? /* @__PURE__ */ (0,
|
|
1174
|
+
const items = kind === "years" ? (0, import_core7.formatYearPills)(raw, config.formatChampionshipYear) : raw;
|
|
1175
|
+
return items.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FactPills, { items, capped: layout === "grid" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(EmptyValue, {});
|
|
939
1176
|
}
|
|
940
1177
|
if (kind === "rival") {
|
|
941
|
-
return /* @__PURE__ */ (0,
|
|
1178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
942
1179
|
RivalValue,
|
|
943
1180
|
{
|
|
944
1181
|
rival: data.rival,
|
|
@@ -948,14 +1185,14 @@ function factValue(factKey, layout, data, resolveImageUrl, getRivalHref) {
|
|
|
948
1185
|
);
|
|
949
1186
|
}
|
|
950
1187
|
const text = textFact(facts, factKey);
|
|
951
|
-
return /* @__PURE__ */ (0,
|
|
1188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
952
1189
|
"p",
|
|
953
1190
|
{
|
|
954
|
-
className: (0,
|
|
1191
|
+
className: (0, import_ui_web11.cn)(
|
|
955
1192
|
"w-full body-text font-ss02-ss05 whitespace-pre-line",
|
|
956
1193
|
text ? "text-text-primary" : "text-text-secondary"
|
|
957
1194
|
),
|
|
958
|
-
children: text ??
|
|
1195
|
+
children: text ?? import_core7.EMPTY_FACT_VALUE
|
|
959
1196
|
}
|
|
960
1197
|
);
|
|
961
1198
|
}
|
|
@@ -966,18 +1203,18 @@ function FactField({
|
|
|
966
1203
|
resolveImageUrl,
|
|
967
1204
|
getRivalHref
|
|
968
1205
|
}) {
|
|
969
|
-
const kind =
|
|
970
|
-
if (kind === "count") return /* @__PURE__ */ (0,
|
|
971
|
-
return /* @__PURE__ */ (0,
|
|
1206
|
+
const kind = import_core7.TEAM_FACT_KINDS[factKey];
|
|
1207
|
+
if (kind === "count") return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CountFact, { factKey, data });
|
|
1208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
972
1209
|
"div",
|
|
973
1210
|
{
|
|
974
|
-
className: (0,
|
|
1211
|
+
className: (0, import_ui_web11.cn)(
|
|
975
1212
|
"flex min-w-0 flex-col items-start gap-1.5",
|
|
976
1213
|
layout === "row" && "flex-1",
|
|
977
1214
|
layout === "grid" && kind !== "list" && "gap-1"
|
|
978
1215
|
),
|
|
979
1216
|
children: [
|
|
980
|
-
/* @__PURE__ */ (0,
|
|
1217
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FieldLabel, { children: data.config.labels[factKey] }),
|
|
981
1218
|
factValue(factKey, layout, data, resolveImageUrl, getRivalHref)
|
|
982
1219
|
]
|
|
983
1220
|
}
|
|
@@ -985,16 +1222,16 @@ function FactField({
|
|
|
985
1222
|
}
|
|
986
1223
|
|
|
987
1224
|
// src/team/venue-photo.tsx
|
|
988
|
-
var
|
|
989
|
-
var
|
|
1225
|
+
var import_react5 = require("react");
|
|
1226
|
+
var import_ui_web12 = require("@nukleus-sports/ui-web");
|
|
990
1227
|
var import_icons = require("@nukleus-sports/icons");
|
|
991
|
-
var
|
|
992
|
-
var
|
|
1228
|
+
var import_core8 = require("@nukleus-sports/core");
|
|
1229
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
993
1230
|
var PHOTO_WIDTHS = [640, 960, 1280];
|
|
994
1231
|
var PHOTO_SIZES = "(min-width: 1280px) 420px, 100vw";
|
|
995
1232
|
var LINK_CLASS = "inline-flex shrink-0 items-center gap-1 hover:text-text-primary";
|
|
996
1233
|
function NewTabNote() {
|
|
997
|
-
return /* @__PURE__ */ (0,
|
|
1234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sr-only", children: " (opens in a new tab)" });
|
|
998
1235
|
}
|
|
999
1236
|
function resolvePhotoSources(path, resolveImageUrl) {
|
|
1000
1237
|
const candidates = PHOTO_WIDTHS.flatMap((width) => {
|
|
@@ -1009,18 +1246,18 @@ function resolvePhotoSources(path, resolveImageUrl) {
|
|
|
1009
1246
|
}
|
|
1010
1247
|
function VenueNameOnly({ name, label }) {
|
|
1011
1248
|
if (!name) return null;
|
|
1012
|
-
return /* @__PURE__ */ (0,
|
|
1013
|
-
/* @__PURE__ */ (0,
|
|
1014
|
-
/* @__PURE__ */ (0,
|
|
1249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex min-w-0 flex-col items-start gap-1.5", children: [
|
|
1250
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FieldLabel, { children: label }),
|
|
1251
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w-full header-xl-medium-card font-ss02-ss05 text-text-primary", children: name })
|
|
1015
1252
|
] });
|
|
1016
1253
|
}
|
|
1017
1254
|
function PhotoCaption({ name, image }) {
|
|
1018
|
-
const credit = (0,
|
|
1019
|
-
return /* @__PURE__ */ (0,
|
|
1020
|
-
name && /* @__PURE__ */ (0,
|
|
1021
|
-
/* @__PURE__ */ (0,
|
|
1022
|
-
/* @__PURE__ */ (0,
|
|
1023
|
-
image.sourceUrl && /* @__PURE__ */ (0,
|
|
1255
|
+
const credit = (0, import_core8.facilityImageCredit)(image);
|
|
1256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("figcaption", { className: "flex w-full flex-col gap-1 xxs-body-text font-ss02-ss05", children: [
|
|
1257
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w-full text-text-primary", children: name }),
|
|
1258
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex w-full items-start gap-2 text-greys-text-secondary", children: [
|
|
1259
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "min-w-0 flex-1", children: credit ? `Photo: ${credit}` : "Photo from Wikimedia Commons" }),
|
|
1260
|
+
image.sourceUrl && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1024
1261
|
"a",
|
|
1025
1262
|
{
|
|
1026
1263
|
href: image.sourceUrl,
|
|
@@ -1029,8 +1266,8 @@ function PhotoCaption({ name, image }) {
|
|
|
1029
1266
|
className: LINK_CLASS,
|
|
1030
1267
|
children: [
|
|
1031
1268
|
"Source",
|
|
1032
|
-
/* @__PURE__ */ (0,
|
|
1033
|
-
/* @__PURE__ */ (0,
|
|
1269
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(NewTabNote, {}),
|
|
1270
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { "aria-hidden": "true", className: "flex shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1034
1271
|
import_icons.XsViewInvoiceIcon,
|
|
1035
1272
|
{
|
|
1036
1273
|
width: 16,
|
|
@@ -1041,7 +1278,7 @@ function PhotoCaption({ name, image }) {
|
|
|
1041
1278
|
]
|
|
1042
1279
|
}
|
|
1043
1280
|
),
|
|
1044
|
-
image.licenseUrl && /* @__PURE__ */ (0,
|
|
1281
|
+
image.licenseUrl && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1045
1282
|
"a",
|
|
1046
1283
|
{
|
|
1047
1284
|
href: image.licenseUrl,
|
|
@@ -1050,7 +1287,7 @@ function PhotoCaption({ name, image }) {
|
|
|
1050
1287
|
className: LINK_CLASS,
|
|
1051
1288
|
children: [
|
|
1052
1289
|
"License",
|
|
1053
|
-
/* @__PURE__ */ (0,
|
|
1290
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(NewTabNote, {})
|
|
1054
1291
|
]
|
|
1055
1292
|
}
|
|
1056
1293
|
)
|
|
@@ -1059,14 +1296,14 @@ function PhotoCaption({ name, image }) {
|
|
|
1059
1296
|
}
|
|
1060
1297
|
function VenuePhoto({ venue, label, resolveImageUrl }) {
|
|
1061
1298
|
const { name, image } = venue;
|
|
1062
|
-
const [failed, setFailed] = (0,
|
|
1063
|
-
const [isLoaded, setIsLoaded] = (0,
|
|
1299
|
+
const [failed, setFailed] = (0, import_react5.useState)("none");
|
|
1300
|
+
const [isLoaded, setIsLoaded] = (0, import_react5.useState)(false);
|
|
1064
1301
|
const sources = image && resolveImageUrl ? resolvePhotoSources(image.path, resolveImageUrl) : null;
|
|
1065
1302
|
const useResized = failed === "none" && Boolean(sources?.srcSet);
|
|
1066
1303
|
const src = failed === "all" ? void 0 : useResized ? sources?.resized : sources?.original;
|
|
1067
|
-
if (!image || !src) return /* @__PURE__ */ (0,
|
|
1068
|
-
return /* @__PURE__ */ (0,
|
|
1069
|
-
/* @__PURE__ */ (0,
|
|
1304
|
+
if (!image || !src) return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(VenueNameOnly, { name, label });
|
|
1305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("figure", { className: "flex w-full flex-col gap-3", children: [
|
|
1306
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1070
1307
|
"img",
|
|
1071
1308
|
{
|
|
1072
1309
|
src,
|
|
@@ -1075,20 +1312,20 @@ function VenuePhoto({ venue, label, resolveImageUrl }) {
|
|
|
1075
1312
|
onLoad: () => setIsLoaded(true),
|
|
1076
1313
|
onError: () => setFailed(useResized ? "resized" : "all"),
|
|
1077
1314
|
alt: name ?? label,
|
|
1078
|
-
className: (0,
|
|
1315
|
+
className: (0, import_ui_web12.cn)(
|
|
1079
1316
|
"h-[150px] w-full rounded-[8px] bg-greys-background-hover object-cover",
|
|
1080
1317
|
!isLoaded && "animate-pulse"
|
|
1081
1318
|
),
|
|
1082
1319
|
loading: "lazy"
|
|
1083
1320
|
}
|
|
1084
1321
|
),
|
|
1085
|
-
/* @__PURE__ */ (0,
|
|
1322
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PhotoCaption, { name, image })
|
|
1086
1323
|
] });
|
|
1087
1324
|
}
|
|
1088
1325
|
|
|
1089
1326
|
// src/team/team-facts-content.tsx
|
|
1090
|
-
var
|
|
1091
|
-
var
|
|
1327
|
+
var import_core9 = require("@nukleus-sports/core");
|
|
1328
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1092
1329
|
var SECTION_FIELDS_CLASS = {
|
|
1093
1330
|
grid: "grid grid-cols-2 items-start gap-3",
|
|
1094
1331
|
row: "flex items-start gap-3",
|
|
@@ -1105,7 +1342,7 @@ function TeamFactsContent({
|
|
|
1105
1342
|
getRivalHref
|
|
1106
1343
|
}) {
|
|
1107
1344
|
const { config, venue, hasFacts } = data;
|
|
1108
|
-
const photo = /* @__PURE__ */ (0,
|
|
1345
|
+
const photo = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1109
1346
|
VenuePhoto,
|
|
1110
1347
|
{
|
|
1111
1348
|
venue,
|
|
@@ -1115,14 +1352,14 @@ function TeamFactsContent({
|
|
|
1115
1352
|
venue.image?.path ?? "none"
|
|
1116
1353
|
);
|
|
1117
1354
|
if (!hasFacts) {
|
|
1118
|
-
return /* @__PURE__ */ (0,
|
|
1119
|
-
/* @__PURE__ */ (0,
|
|
1120
|
-
(venue.image || venue.name) && /* @__PURE__ */ (0,
|
|
1355
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
1356
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.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." }),
|
|
1357
|
+
(venue.image || venue.name) && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("section", { className: SECTION_CLASS, children: photo })
|
|
1121
1358
|
] });
|
|
1122
1359
|
}
|
|
1123
|
-
return /* @__PURE__ */ (0,
|
|
1124
|
-
/* @__PURE__ */ (0,
|
|
1125
|
-
/* @__PURE__ */ (0,
|
|
1360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex flex-col gap-3", children: config.sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { "aria-label": section.title, className: SECTION_CLASS, children: [
|
|
1361
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h3", { className: "label-xs-semibold-text font-ss02-ss05 uppercase text-greys-text-secondary", children: section.title }),
|
|
1362
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: SECTION_FIELDS_CLASS[section.layout], children: (0, import_core9.teamFactsDisplayFields)(section).map((key) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1126
1363
|
FactField,
|
|
1127
1364
|
{
|
|
1128
1365
|
factKey: key,
|
|
@@ -1138,8 +1375,8 @@ function TeamFactsContent({
|
|
|
1138
1375
|
}
|
|
1139
1376
|
|
|
1140
1377
|
// src/team/team-facts-widget.tsx
|
|
1141
|
-
var
|
|
1142
|
-
var
|
|
1378
|
+
var import_ui_web13 = require("@nukleus-sports/ui-web");
|
|
1379
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1143
1380
|
var SKELETON_KEYS = ["trophy-case", "tradition", "profile"];
|
|
1144
1381
|
function TeamFactsWidget({
|
|
1145
1382
|
state,
|
|
@@ -1148,32 +1385,32 @@ function TeamFactsWidget({
|
|
|
1148
1385
|
getRivalHref,
|
|
1149
1386
|
className
|
|
1150
1387
|
}) {
|
|
1151
|
-
return /* @__PURE__ */ (0,
|
|
1152
|
-
|
|
1388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1389
|
+
import_ui_web13.Card,
|
|
1153
1390
|
{
|
|
1154
|
-
className: (0,
|
|
1391
|
+
className: (0, import_ui_web13.cn)(
|
|
1155
1392
|
"flex w-full min-w-0 flex-col gap-3 rounded-[10px] border-0 px-4 pb-[22px] pt-4",
|
|
1156
1393
|
// Matches the Team Info card's desktop height (TeamInfoCard `md:min-h-[612px]`).
|
|
1157
1394
|
"xl:min-h-[612px] xl:self-stretch xl:[contain:size]",
|
|
1158
1395
|
className
|
|
1159
1396
|
),
|
|
1160
1397
|
children: [
|
|
1161
|
-
/* @__PURE__ */ (0,
|
|
1162
|
-
/* @__PURE__ */ (0,
|
|
1163
|
-
state.status === "loading" && /* @__PURE__ */ (0,
|
|
1164
|
-
state.status === "error" && /* @__PURE__ */ (0,
|
|
1398
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_ui_web13.CardHeader, { className: "flex h-8 shrink-0 flex-row items-center p-0", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_ui_web13.CardTitle, { className: "header-xl-medium-card font-ss02-ss05 text-text-primary", children: "Team Facts" }) }),
|
|
1399
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_ui_web13.CardContent, { className: "p-0 xl:min-h-0 xl:flex-1 xl:overflow-y-auto xl:[scrollbar-width:none] xl:[&::-webkit-scrollbar]:hidden", children: [
|
|
1400
|
+
state.status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex flex-col gap-3", role: "status", "aria-label": "Loading team facts", children: SKELETON_KEYS.map((key) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_ui_web13.Skeleton, { className: "h-[200px] w-full rounded-[10px]" }, key)) }),
|
|
1401
|
+
state.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1165
1402
|
"div",
|
|
1166
1403
|
{
|
|
1167
1404
|
role: "alert",
|
|
1168
1405
|
className: "flex h-[120px] flex-col items-center justify-center gap-2 text-14.5 text-text-secondary",
|
|
1169
1406
|
children: [
|
|
1170
|
-
/* @__PURE__ */ (0,
|
|
1171
|
-
state.devMessage && /* @__PURE__ */ (0,
|
|
1172
|
-
state.retry && /* @__PURE__ */ (0,
|
|
1407
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "Couldn't load team facts." }),
|
|
1408
|
+
state.devMessage && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "xxs-body-text", children: state.devMessage }),
|
|
1409
|
+
state.retry && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_ui_web13.Button, { type: "button", variant: "outline", size: "sm", onClick: state.retry, children: "Try again" })
|
|
1173
1410
|
]
|
|
1174
1411
|
}
|
|
1175
1412
|
),
|
|
1176
|
-
state.status === "ready" && /* @__PURE__ */ (0,
|
|
1413
|
+
state.status === "ready" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1177
1414
|
TeamFactsContent,
|
|
1178
1415
|
{
|
|
1179
1416
|
data: state.data,
|
|
@@ -1190,31 +1427,31 @@ function TeamFactsWidget({
|
|
|
1190
1427
|
}
|
|
1191
1428
|
|
|
1192
1429
|
// src/team/stat-ranking-leaderboard-dialog.tsx
|
|
1193
|
-
var
|
|
1194
|
-
var
|
|
1430
|
+
var import_react6 = require("react");
|
|
1431
|
+
var import_ui_web14 = require("@nukleus-sports/ui-web");
|
|
1195
1432
|
var import_icons2 = require("@nukleus-sports/icons");
|
|
1196
|
-
var
|
|
1197
|
-
var
|
|
1433
|
+
var import_core10 = require("@nukleus-sports/core");
|
|
1434
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1198
1435
|
var PAGE_BUTTON_BASE = "background";
|
|
1199
1436
|
var PAGE_BUTTON_DESKTOP = "!h-[32px] !w-[32px] p-[6px]";
|
|
1200
1437
|
var PAGE_BUTTON_MOBILE = "!h-11 !w-11 p-3 !outline-0 !border-0 !bg-inherit";
|
|
1201
1438
|
var HIGHLIGHT_CLASS = "text-semantic-color-status-priority-completed-copy bg-primary-color-total-row-table-2";
|
|
1202
1439
|
function formatRank(rank, tied) {
|
|
1203
|
-
return tied ? `T-${(0,
|
|
1440
|
+
return tied ? `T-${(0, import_core10.toOrdinal)(rank)}` : (0, import_core10.toOrdinal)(rank);
|
|
1204
1441
|
}
|
|
1205
1442
|
function Footnotes({ notes }) {
|
|
1206
|
-
return /* @__PURE__ */ (0,
|
|
1443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { children: notes.map((note) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { className: "alert-text-italic text-text-secondary", children: [
|
|
1207
1444
|
"* ",
|
|
1208
1445
|
note
|
|
1209
1446
|
] }, note)) });
|
|
1210
1447
|
}
|
|
1211
1448
|
function Pagination({ page, totalPages, isCountKnown, isSm, onPageChange }) {
|
|
1212
|
-
const buttonClass = (0,
|
|
1213
|
-
return /* @__PURE__ */ (0,
|
|
1214
|
-
/* @__PURE__ */ (0,
|
|
1215
|
-
/* @__PURE__ */ (0,
|
|
1216
|
-
/* @__PURE__ */ (0,
|
|
1217
|
-
|
|
1449
|
+
const buttonClass = (0, import_ui_web14.cn)(PAGE_BUTTON_BASE, isSm ? PAGE_BUTTON_DESKTOP : PAGE_BUTTON_MOBILE);
|
|
1450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
1451
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "label-xs-text text-text-secondary", children: isCountKnown ? `Page ${page} of ${totalPages}` : `Page ${page}` }),
|
|
1452
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
1453
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1454
|
+
import_ui_web14.Button,
|
|
1218
1455
|
{
|
|
1219
1456
|
variant: "secondary-greys",
|
|
1220
1457
|
size: "sm",
|
|
@@ -1222,11 +1459,11 @@ function Pagination({ page, totalPages, isCountKnown, isSm, onPageChange }) {
|
|
|
1222
1459
|
onClick: () => onPageChange(Math.max(1, page - 1)),
|
|
1223
1460
|
disabled: page === 1,
|
|
1224
1461
|
"aria-label": "Go to previous page",
|
|
1225
|
-
children: /* @__PURE__ */ (0,
|
|
1462
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_icons2.ChevronLeftIcon, { className: "h-4 w-4" })
|
|
1226
1463
|
}
|
|
1227
1464
|
),
|
|
1228
|
-
/* @__PURE__ */ (0,
|
|
1229
|
-
|
|
1465
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1466
|
+
import_ui_web14.Button,
|
|
1230
1467
|
{
|
|
1231
1468
|
variant: "secondary-greys",
|
|
1232
1469
|
size: "sm",
|
|
@@ -1234,14 +1471,14 @@ function Pagination({ page, totalPages, isCountKnown, isSm, onPageChange }) {
|
|
|
1234
1471
|
onClick: () => onPageChange(Math.min(totalPages, page + 1)),
|
|
1235
1472
|
disabled: !isCountKnown || page >= totalPages,
|
|
1236
1473
|
"aria-label": "Go to next page",
|
|
1237
|
-
children: /* @__PURE__ */ (0,
|
|
1474
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_icons2.ChevronRightIcon, { className: "h-4 w-4" })
|
|
1238
1475
|
}
|
|
1239
1476
|
)
|
|
1240
1477
|
] })
|
|
1241
1478
|
] });
|
|
1242
1479
|
}
|
|
1243
1480
|
function useLeaderboardColumns(entityLabel, statLabel, formatValue, isSm) {
|
|
1244
|
-
return (0,
|
|
1481
|
+
return (0, import_react6.useMemo)(
|
|
1245
1482
|
() => [
|
|
1246
1483
|
{
|
|
1247
1484
|
accessorKey: "rank",
|
|
@@ -1260,7 +1497,7 @@ function useLeaderboardColumns(entityLabel, statLabel, formatValue, isSm) {
|
|
|
1260
1497
|
},
|
|
1261
1498
|
{
|
|
1262
1499
|
accessorKey: "value",
|
|
1263
|
-
header: () => /* @__PURE__ */ (0,
|
|
1500
|
+
header: () => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "text-right text-wrap line-clamp-2", title: statLabel, children: statLabel }),
|
|
1264
1501
|
meta: {
|
|
1265
1502
|
cellSize: isSm ? "m" : "xs",
|
|
1266
1503
|
rowCellClassName: "text-right tabular-nums break-all"
|
|
@@ -1280,12 +1517,12 @@ function LeaderboardTable(props) {
|
|
|
1280
1517
|
props.isSm
|
|
1281
1518
|
);
|
|
1282
1519
|
if (isConfigError) {
|
|
1283
|
-
return /* @__PURE__ */ (0,
|
|
1520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.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." });
|
|
1284
1521
|
}
|
|
1285
|
-
return /* @__PURE__ */ (0,
|
|
1286
|
-
isError && rows.length > 0 && /* @__PURE__ */ (0,
|
|
1287
|
-
/* @__PURE__ */ (0,
|
|
1288
|
-
|
|
1522
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
1523
|
+
isError && rows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-12 text-destructive px-1 pb-2", children: "Couldn't refresh rankings. Showing the last loaded data." }),
|
|
1524
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1525
|
+
import_ui_web14.BaseTable,
|
|
1289
1526
|
{
|
|
1290
1527
|
columns,
|
|
1291
1528
|
data: rows,
|
|
@@ -1308,17 +1545,17 @@ function LeaderboardContent(props) {
|
|
|
1308
1545
|
const isCountKnown = totalCount !== void 0;
|
|
1309
1546
|
const totalPages = Math.max(1, Math.ceil((totalCount ?? 0) / pageSize));
|
|
1310
1547
|
const showPagination = page > 1 || isCountKnown && totalPages > 1;
|
|
1311
|
-
return /* @__PURE__ */ (0,
|
|
1312
|
-
/* @__PURE__ */ (0,
|
|
1313
|
-
subtitle && /* @__PURE__ */ (0,
|
|
1548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex flex-col h-full overflow-hidden", children: [
|
|
1549
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex flex-col gap-6 sm:gap-4 overflow-hidden px-5", children: [
|
|
1550
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_ui_web14.DialogDescription, { className: "flex flex-col gap-1 header-xl-medium-card text-text-secondary sm:px-4 font-ss02 ss05 leading-normal", children: [
|
|
1314
1551
|
subtitle,
|
|
1315
|
-
!isSm && footnotes.length > 0 && /* @__PURE__ */ (0,
|
|
1552
|
+
!isSm && footnotes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Footnotes, { notes: footnotes })
|
|
1316
1553
|
] }),
|
|
1317
|
-
/* @__PURE__ */ (0,
|
|
1554
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LeaderboardTable, { ...props }) })
|
|
1318
1555
|
] }),
|
|
1319
|
-
(footnotes.length > 0 || showPagination) && /* @__PURE__ */ (0,
|
|
1320
|
-
footnotes.length > 0 && /* @__PURE__ */ (0,
|
|
1321
|
-
showPagination && /* @__PURE__ */ (0,
|
|
1556
|
+
(footnotes.length > 0 || showPagination) && /* @__PURE__ */ (0, import_jsx_runtime16.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: [
|
|
1557
|
+
footnotes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Footnotes, { notes: footnotes }),
|
|
1558
|
+
showPagination && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1322
1559
|
Pagination,
|
|
1323
1560
|
{
|
|
1324
1561
|
page,
|
|
@@ -1334,13 +1571,13 @@ function LeaderboardContent(props) {
|
|
|
1334
1571
|
function StatRankingLeaderboardDialog(props) {
|
|
1335
1572
|
const { open, onOpenChange, title, isSm } = props;
|
|
1336
1573
|
if (isSm) {
|
|
1337
|
-
return /* @__PURE__ */ (0,
|
|
1338
|
-
/* @__PURE__ */ (0,
|
|
1339
|
-
/* @__PURE__ */ (0,
|
|
1574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_ui_web14.Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_ui_web14.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: [
|
|
1575
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_ui_web14.DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_ui_web14.DialogTitle, { className: "header-xl-medium-card", children: title }) }),
|
|
1576
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LeaderboardContent, { ...props })
|
|
1340
1577
|
] }) });
|
|
1341
1578
|
}
|
|
1342
|
-
return /* @__PURE__ */ (0,
|
|
1343
|
-
|
|
1579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1580
|
+
import_ui_web14.MobileModalLayout,
|
|
1344
1581
|
{
|
|
1345
1582
|
onCancel: () => onOpenChange(false),
|
|
1346
1583
|
isOpen: open,
|
|
@@ -1348,15 +1585,15 @@ function StatRankingLeaderboardDialog(props) {
|
|
|
1348
1585
|
title,
|
|
1349
1586
|
cancelButtonName: "Close",
|
|
1350
1587
|
childClassName: "h-auto min-h-full h-[calc(100vh-100px)]",
|
|
1351
|
-
children: /* @__PURE__ */ (0,
|
|
1588
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex flex-col h-full pt-6", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LeaderboardContent, { ...props }) })
|
|
1352
1589
|
}
|
|
1353
1590
|
);
|
|
1354
1591
|
}
|
|
1355
1592
|
|
|
1356
1593
|
// src/team/team-season-stats-widget.tsx
|
|
1357
|
-
var
|
|
1358
|
-
var
|
|
1359
|
-
var
|
|
1594
|
+
var import_ui_web15 = require("@nukleus-sports/ui-web");
|
|
1595
|
+
var import_core11 = require("@nukleus-sports/core");
|
|
1596
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1360
1597
|
var PRESEASON_TYPE = 1;
|
|
1361
1598
|
var RANK_TEXT_CLASS = "label-xs-medium text-text-secondary";
|
|
1362
1599
|
var RANK_LINK_CLASS = `${RANK_TEXT_CLASS} hover:text-text-primary hover:underline cursor-pointer transition-colors`;
|
|
@@ -1368,15 +1605,15 @@ function RankBadge({
|
|
|
1368
1605
|
onRankClick
|
|
1369
1606
|
}) {
|
|
1370
1607
|
if (isRankingsError) {
|
|
1371
|
-
return /* @__PURE__ */ (0,
|
|
1372
|
-
/* @__PURE__ */ (0,
|
|
1373
|
-
/* @__PURE__ */ (0,
|
|
1608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "label-xs-medium text-destructive", title: "Couldn't load ranking", children: [
|
|
1609
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": "true", children: "--" }),
|
|
1610
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "sr-only", children: "Couldn't load ranking" })
|
|
1374
1611
|
] });
|
|
1375
1612
|
}
|
|
1376
1613
|
if (!rankText) return null;
|
|
1377
|
-
if (!onRankClick) return /* @__PURE__ */ (0,
|
|
1378
|
-
return /* @__PURE__ */ (0,
|
|
1379
|
-
|
|
1614
|
+
if (!onRankClick) return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: RANK_TEXT_CLASS, children: rankText });
|
|
1615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1616
|
+
import_ui_web15.Button,
|
|
1380
1617
|
{
|
|
1381
1618
|
type: "button",
|
|
1382
1619
|
variant: "unstyled",
|
|
@@ -1392,7 +1629,7 @@ function RankBadge({
|
|
|
1392
1629
|
);
|
|
1393
1630
|
}
|
|
1394
1631
|
function CenteredMessage({ children }) {
|
|
1395
|
-
return /* @__PURE__ */ (0,
|
|
1632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex items-center justify-center h-full text-14.5 text-text-secondary", children });
|
|
1396
1633
|
}
|
|
1397
1634
|
function StatsBody({
|
|
1398
1635
|
stats,
|
|
@@ -1404,21 +1641,21 @@ function StatsBody({
|
|
|
1404
1641
|
isRankingsError,
|
|
1405
1642
|
onRankClick
|
|
1406
1643
|
}) {
|
|
1407
|
-
const columns = (0,
|
|
1408
|
-
return /* @__PURE__ */ (0,
|
|
1409
|
-
isSummaryError && /* @__PURE__ */ (0,
|
|
1410
|
-
/* @__PURE__ */ (0,
|
|
1644
|
+
const columns = (0, import_core11.getTeamStatColumns)(sportId);
|
|
1645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-col gap-1.5 h-full w-full justify-center", children: [
|
|
1646
|
+
isSummaryError && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-12 text-destructive", children: "Couldn't refresh stats. Showing the last loaded data." }),
|
|
1647
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.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) => {
|
|
1411
1648
|
const configId = configIds?.[index];
|
|
1412
|
-
return /* @__PURE__ */ (0,
|
|
1649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1413
1650
|
StatColumn,
|
|
1414
1651
|
{
|
|
1415
1652
|
label: column.label,
|
|
1416
1653
|
value: stats.values[index],
|
|
1417
1654
|
suffix: column.suffix,
|
|
1418
|
-
rankBadge: showRanks && configId !== void 0 ? /* @__PURE__ */ (0,
|
|
1655
|
+
rankBadge: showRanks && configId !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1419
1656
|
RankBadge,
|
|
1420
1657
|
{
|
|
1421
|
-
rankText: (0,
|
|
1658
|
+
rankText: (0, import_core11.formatStatRankByConfig)(rankings, configId),
|
|
1422
1659
|
statLabel: column.label,
|
|
1423
1660
|
configId,
|
|
1424
1661
|
isRankingsError,
|
|
@@ -1449,22 +1686,22 @@ function TeamSeasonStatsWidget({
|
|
|
1449
1686
|
onRankClick,
|
|
1450
1687
|
className
|
|
1451
1688
|
}) {
|
|
1452
|
-
const isSupportedSport = sportId != null && (0,
|
|
1689
|
+
const isSupportedSport = sportId != null && (0, import_core11.isSupportedTeamStatsSport)(sportId);
|
|
1453
1690
|
const hasSeason = Boolean(seasons?.selectedYear) && seasons?.selectedType != null;
|
|
1454
|
-
const stats = isSupportedSport && hasSeason ? (0,
|
|
1455
|
-
const configIds = (0,
|
|
1691
|
+
const stats = isSupportedSport && hasSeason ? (0, import_core11.computeTeamSeasonStatsFromSummary)(summary, sportId) : null;
|
|
1692
|
+
const configIds = (0, import_core11.getTeamRankingConfigIds)(sportId, leagueId);
|
|
1456
1693
|
const showRanks = seasons?.selectedType !== PRESEASON_TYPE;
|
|
1457
1694
|
if (seasonsLoading) {
|
|
1458
|
-
return /* @__PURE__ */ (0,
|
|
1459
|
-
/* @__PURE__ */ (0,
|
|
1460
|
-
/* @__PURE__ */ (0,
|
|
1695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_ui_web15.Card, { className: (0, import_ui_web15.cn)("border-0 p-4 h-[300px]", className), children: [
|
|
1696
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui_web15.CardHeader, { className: "p-0 pb-4", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui_web15.CardTitle, { className: "text-base font-medium", children: "Season Stats" }) }),
|
|
1697
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui_web15.CardContent, { className: "p-0", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "space-y-3 flex justify-center items-center w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui_web15.IconLoader, {}) }) })
|
|
1461
1698
|
] });
|
|
1462
1699
|
}
|
|
1463
1700
|
let body;
|
|
1464
1701
|
if (statsLoading) {
|
|
1465
|
-
body = /* @__PURE__ */ (0,
|
|
1702
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui_web15.Skeleton, { className: "h-4 w-3/4" }) });
|
|
1466
1703
|
} else if (isSupportedSport && stats) {
|
|
1467
|
-
body = /* @__PURE__ */ (0,
|
|
1704
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1468
1705
|
StatsBody,
|
|
1469
1706
|
{
|
|
1470
1707
|
stats,
|
|
@@ -1478,31 +1715,31 @@ function TeamSeasonStatsWidget({
|
|
|
1478
1715
|
}
|
|
1479
1716
|
);
|
|
1480
1717
|
} else {
|
|
1481
|
-
body = /* @__PURE__ */ (0,
|
|
1718
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CenteredMessage, { children: getEmptyMessage(isSupportedSport, hasSeason, isSummaryError) });
|
|
1482
1719
|
}
|
|
1483
|
-
return /* @__PURE__ */ (0,
|
|
1484
|
-
|
|
1720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1721
|
+
import_ui_web15.Card,
|
|
1485
1722
|
{
|
|
1486
|
-
className: (0,
|
|
1723
|
+
className: (0, import_ui_web15.cn)(
|
|
1487
1724
|
"border-0 px-4 py-3 sm:p-4 flex flex-col gap-[25px] sm:gap-4 sm:h-[300px]",
|
|
1488
1725
|
className
|
|
1489
1726
|
),
|
|
1490
1727
|
children: [
|
|
1491
|
-
/* @__PURE__ */ (0,
|
|
1492
|
-
/* @__PURE__ */ (0,
|
|
1493
|
-
isSupportedSport && seasons && seasons.years.length > 0 && /* @__PURE__ */ (0,
|
|
1728
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui_web15.CardHeader, { className: "p-0", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-row items-center justify-between w-full h-8", children: [
|
|
1729
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui_web15.CardTitle, { className: "header-xl-medium-card text-base text-text-primary", children: "Team Stats" }),
|
|
1730
|
+
isSupportedSport && seasons && seasons.years.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SeasonSelector, { ...seasons, hideTypeOnMobile: true })
|
|
1494
1731
|
] }) }),
|
|
1495
|
-
/* @__PURE__ */ (0,
|
|
1732
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui_web15.CardContent, { className: "p-0 h-auto sm:h-[220px] flex justify-center", children: body })
|
|
1496
1733
|
]
|
|
1497
1734
|
}
|
|
1498
1735
|
);
|
|
1499
1736
|
}
|
|
1500
1737
|
|
|
1501
1738
|
// src/team/recent-games-widget.tsx
|
|
1502
|
-
var
|
|
1503
|
-
var
|
|
1739
|
+
var import_react7 = require("react");
|
|
1740
|
+
var import_ui_web16 = require("@nukleus-sports/ui-web");
|
|
1504
1741
|
var import_icons3 = require("@nukleus-sports/icons");
|
|
1505
|
-
var
|
|
1742
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1506
1743
|
var DATE_FORMAT = new Intl.DateTimeFormat("en-US", {
|
|
1507
1744
|
weekday: "long",
|
|
1508
1745
|
month: "long",
|
|
@@ -1515,33 +1752,33 @@ var MESSAGES = {
|
|
|
1515
1752
|
"games-error": "Couldn't load games. Please try again."
|
|
1516
1753
|
};
|
|
1517
1754
|
function ResultText({ result }) {
|
|
1518
|
-
if (result.outcome === "none") return /* @__PURE__ */ (0,
|
|
1755
|
+
if (result.outcome === "none") return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-text-secondary text-14", children: "--" });
|
|
1519
1756
|
if (result.outcome === "tie") {
|
|
1520
|
-
return /* @__PURE__ */ (0,
|
|
1757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "text-14 font-medium text-text-primary", children: [
|
|
1521
1758
|
"T ",
|
|
1522
1759
|
result.detail
|
|
1523
1760
|
] });
|
|
1524
1761
|
}
|
|
1525
1762
|
const isWin = result.outcome === "win";
|
|
1526
|
-
return /* @__PURE__ */ (0,
|
|
1527
|
-
/* @__PURE__ */ (0,
|
|
1763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "text-14 font-medium", children: [
|
|
1764
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1528
1765
|
"span",
|
|
1529
1766
|
{
|
|
1530
1767
|
className: isWin ? "text-primary-color-nuk-text" : "text-semantic-color-status-priority-blocked-hot-copy",
|
|
1531
1768
|
children: isWin ? "W" : "L"
|
|
1532
1769
|
}
|
|
1533
1770
|
),
|
|
1534
|
-
/* @__PURE__ */ (0,
|
|
1771
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "text-text-primary", children: [
|
|
1535
1772
|
" ",
|
|
1536
1773
|
result.detail
|
|
1537
1774
|
] })
|
|
1538
1775
|
] });
|
|
1539
1776
|
}
|
|
1540
1777
|
function OpponentLogo({ opponent, resolveImageUrl, defaultLogoUrl }) {
|
|
1541
|
-
const [failedUrl, setFailedUrl] = (0,
|
|
1778
|
+
const [failedUrl, setFailedUrl] = (0, import_react7.useState)(null);
|
|
1542
1779
|
const { logo } = opponent;
|
|
1543
1780
|
const resolved = logo ? logo.stored ? resolveImageUrl?.(logo.url) : logo.url : void 0;
|
|
1544
|
-
return /* @__PURE__ */ (0,
|
|
1781
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1545
1782
|
"img",
|
|
1546
1783
|
{
|
|
1547
1784
|
src: resolved && resolved !== failedUrl ? resolved : defaultLogoUrl,
|
|
@@ -1555,13 +1792,13 @@ function OpponentLogo({ opponent, resolveImageUrl, defaultLogoUrl }) {
|
|
|
1555
1792
|
);
|
|
1556
1793
|
}
|
|
1557
1794
|
function GameItem({ row, resolveImageUrl, defaultLogoUrl }) {
|
|
1558
|
-
return /* @__PURE__ */ (0,
|
|
1559
|
-
row.isFirstUpcoming && /* @__PURE__ */ (0,
|
|
1560
|
-
/* @__PURE__ */ (0,
|
|
1561
|
-
/* @__PURE__ */ (0,
|
|
1562
|
-
/* @__PURE__ */ (0,
|
|
1563
|
-
/* @__PURE__ */ (0,
|
|
1564
|
-
/* @__PURE__ */ (0,
|
|
1795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "border-b border-border last:border-0", children: [
|
|
1796
|
+
row.isFirstUpcoming && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "px-2 pt-2 text-12 font-medium uppercase tracking-wide text-text-secondary", children: "Upcoming" }),
|
|
1797
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col p-2 gap-[5px]", children: [
|
|
1798
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-14 font-normal text-text-secondary", children: DATE_FORMAT.format(new Date(row.gameDate)) }),
|
|
1799
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
1800
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-14 font-normal text-text-secondary shrink-0", children: row.isHome ? "vs " : "@ " }),
|
|
1801
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1565
1802
|
OpponentLogo,
|
|
1566
1803
|
{
|
|
1567
1804
|
opponent: row.opponent,
|
|
@@ -1569,18 +1806,18 @@ function GameItem({ row, resolveImageUrl, defaultLogoUrl }) {
|
|
|
1569
1806
|
defaultLogoUrl
|
|
1570
1807
|
}
|
|
1571
1808
|
),
|
|
1572
|
-
/* @__PURE__ */ (0,
|
|
1573
|
-
row.result && /* @__PURE__ */ (0,
|
|
1574
|
-
/* @__PURE__ */ (0,
|
|
1575
|
-
/* @__PURE__ */ (0,
|
|
1809
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-14.5 font-normal text-text-primary truncate", children: row.opponent.name }),
|
|
1810
|
+
row.result && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
1811
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-14 text-text-secondary", children: "-" }),
|
|
1812
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ResultText, { result: row.result })
|
|
1576
1813
|
] })
|
|
1577
1814
|
] }),
|
|
1578
|
-
row.time && /* @__PURE__ */ (0,
|
|
1815
|
+
row.time && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-14 font-normal text-text-secondary", children: row.time })
|
|
1579
1816
|
] })
|
|
1580
1817
|
] });
|
|
1581
1818
|
}
|
|
1582
1819
|
function Message({ children }) {
|
|
1583
|
-
return /* @__PURE__ */ (0,
|
|
1820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "text-text-primary text-14.5 px-1", children });
|
|
1584
1821
|
}
|
|
1585
1822
|
function Body({
|
|
1586
1823
|
status,
|
|
@@ -1589,11 +1826,11 @@ function Body({
|
|
|
1589
1826
|
defaultLogoUrl
|
|
1590
1827
|
}) {
|
|
1591
1828
|
if (status === "loading") {
|
|
1592
|
-
return /* @__PURE__ */ (0,
|
|
1829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "space-y-4 flex justify-center items-center w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_ui_web16.IconLoader, {}) });
|
|
1593
1830
|
}
|
|
1594
|
-
if (status !== "ready") return /* @__PURE__ */ (0,
|
|
1595
|
-
if (rows.length === 0) return /* @__PURE__ */ (0,
|
|
1596
|
-
return /* @__PURE__ */ (0,
|
|
1831
|
+
if (status !== "ready") return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Message, { children: MESSAGES[status] });
|
|
1832
|
+
if (rows.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Message, { children: "There are no games scheduled at this time." });
|
|
1833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex flex-col overflow-y-auto overflow-x-hidden gap-1", children: rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1597
1834
|
GameItem,
|
|
1598
1835
|
{
|
|
1599
1836
|
row,
|
|
@@ -1611,18 +1848,18 @@ function RecentGamesWidget({
|
|
|
1611
1848
|
onExpand,
|
|
1612
1849
|
className
|
|
1613
1850
|
}) {
|
|
1614
|
-
return /* @__PURE__ */ (0,
|
|
1615
|
-
|
|
1851
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1852
|
+
import_ui_web16.Card,
|
|
1616
1853
|
{
|
|
1617
|
-
className: (0,
|
|
1854
|
+
className: (0, import_ui_web16.cn)(
|
|
1618
1855
|
"p-4 w-full xl:w-[420px] flex flex-col overflow-hidden border-none gap-3 h-full md:min-h-[612px]",
|
|
1619
1856
|
className
|
|
1620
1857
|
),
|
|
1621
1858
|
children: [
|
|
1622
|
-
/* @__PURE__ */ (0,
|
|
1623
|
-
/* @__PURE__ */ (0,
|
|
1624
|
-
onExpand && /* @__PURE__ */ (0,
|
|
1625
|
-
|
|
1859
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_ui_web16.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 p-0", children: [
|
|
1860
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_ui_web16.CardTitle, { children: "Recent Games" }),
|
|
1861
|
+
onExpand && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1862
|
+
import_ui_web16.Button,
|
|
1626
1863
|
{
|
|
1627
1864
|
type: "button",
|
|
1628
1865
|
variant: "ghost",
|
|
@@ -1630,11 +1867,11 @@ function RecentGamesWidget({
|
|
|
1630
1867
|
"aria-label": "View full schedule",
|
|
1631
1868
|
onClick: onExpand,
|
|
1632
1869
|
className: "outline-1 background outline-offset-[-1px] outline-[hsl(var(--color-ui-elem-strokes))] outline h-[32px] w-[32px]",
|
|
1633
|
-
children: /* @__PURE__ */ (0,
|
|
1870
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_icons3.ArrowUpRightIcon, { className: "text-greys-icons h-5 w-5" })
|
|
1634
1871
|
}
|
|
1635
1872
|
)
|
|
1636
1873
|
] }),
|
|
1637
|
-
/* @__PURE__ */ (0,
|
|
1874
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_ui_web16.CardContent, { className: "flex-1 flex flex-col overflow-hidden p-0", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1638
1875
|
Body,
|
|
1639
1876
|
{
|
|
1640
1877
|
status,
|
|
@@ -1649,10 +1886,10 @@ function RecentGamesWidget({
|
|
|
1649
1886
|
}
|
|
1650
1887
|
|
|
1651
1888
|
// src/team/team-stats-table.tsx
|
|
1652
|
-
var
|
|
1653
|
-
var
|
|
1654
|
-
var
|
|
1655
|
-
var
|
|
1889
|
+
var import_react8 = require("react");
|
|
1890
|
+
var import_ui_web17 = require("@nukleus-sports/ui-web");
|
|
1891
|
+
var import_core12 = require("@nukleus-sports/core");
|
|
1892
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1656
1893
|
function stripLeadingSlash(path) {
|
|
1657
1894
|
return path.startsWith("/") ? path.slice(1) : path;
|
|
1658
1895
|
}
|
|
@@ -1688,10 +1925,10 @@ function formatTeamStatDate(stat) {
|
|
|
1688
1925
|
const dateStr = stat.stat_details?.game_details?.date;
|
|
1689
1926
|
const date = dateStr ? new Date(dateStr) : null;
|
|
1690
1927
|
if (!date || Number.isNaN(date.getTime())) {
|
|
1691
|
-
return /* @__PURE__ */ (0,
|
|
1928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-text-primary body-text", children: "--" });
|
|
1692
1929
|
}
|
|
1693
1930
|
const formatted = date.toLocaleDateString("en-US", { month: "short", day: "numeric" });
|
|
1694
|
-
return /* @__PURE__ */ (0,
|
|
1931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "text-13.5 font-normal text-text-primary", children: formatted });
|
|
1695
1932
|
}
|
|
1696
1933
|
function getTeamStatResult(stat) {
|
|
1697
1934
|
const gameDetails = stat.stat_details?.game_details;
|
|
@@ -1710,9 +1947,9 @@ function getTeamStatResult(stat) {
|
|
|
1710
1947
|
const opponentScore = isHome ? awayScore : homeScore;
|
|
1711
1948
|
const score = `${teamScore}-${opponentScore}${gameDetails.status_alt_details ? ` ${gameDetails.status_alt_details}` : ""}`;
|
|
1712
1949
|
const colorClass = winLoss === "W" ? "text-primary-color-nuk-text" : winLoss === "L" ? "text-semantic-color-status-priority-blocked-hot-copy" : "text-text-primary";
|
|
1713
|
-
return /* @__PURE__ */ (0,
|
|
1714
|
-
/* @__PURE__ */ (0,
|
|
1715
|
-
/* @__PURE__ */ (0,
|
|
1950
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-baseline gap-1 leading-tight", children: [
|
|
1951
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: (0, import_ui_web17.cn)(colorClass, "body-text"), children: winLoss }),
|
|
1952
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-text-primary body-text", children: score })
|
|
1716
1953
|
] });
|
|
1717
1954
|
}
|
|
1718
1955
|
function StatOpponentCell({
|
|
@@ -1721,18 +1958,18 @@ function StatOpponentCell({
|
|
|
1721
1958
|
defaultLogoUrl,
|
|
1722
1959
|
showName
|
|
1723
1960
|
}) {
|
|
1724
|
-
const [failedUrl, setFailedUrl] = (0,
|
|
1961
|
+
const [failedUrl, setFailedUrl] = (0, import_react8.useState)(null);
|
|
1725
1962
|
const gameDetails = stat.stat_details?.game_details;
|
|
1726
1963
|
const isHome = stat.team_id === gameDetails?.home_team_id;
|
|
1727
1964
|
const opponentName = isHome ? gameDetails?.away_team_name : gameDetails?.home_team_name;
|
|
1728
1965
|
const opponentLogoPath = isHome ? gameDetails?.away_team_logo : gameDetails?.home_team_logo;
|
|
1729
|
-
if (!opponentName) return /* @__PURE__ */ (0,
|
|
1966
|
+
if (!opponentName) return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_jsx_runtime19.Fragment, { children: "--" });
|
|
1730
1967
|
const prefix = isHome ? "vs" : "@";
|
|
1731
1968
|
const resolved = opponentLogoPath ? resolveOpponentLogoUrl(stripLeadingSlash(opponentLogoPath)) : null;
|
|
1732
1969
|
const logoSrc = resolved && resolved !== failedUrl ? resolved : defaultLogoUrl;
|
|
1733
|
-
return /* @__PURE__ */ (0,
|
|
1734
|
-
/* @__PURE__ */ (0,
|
|
1735
|
-
/* @__PURE__ */ (0,
|
|
1970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "h-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex items-center h-full", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex max-sm:gap-1 gap-2 items-center font-normal leading-tight text-12", children: [
|
|
1971
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-text-primary body-text", children: prefix }),
|
|
1972
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1736
1973
|
"img",
|
|
1737
1974
|
{
|
|
1738
1975
|
src: logoSrc,
|
|
@@ -1743,7 +1980,7 @@ function StatOpponentCell({
|
|
|
1743
1980
|
}
|
|
1744
1981
|
}
|
|
1745
1982
|
),
|
|
1746
|
-
showName && /* @__PURE__ */ (0,
|
|
1983
|
+
showName && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-primary-color-nuk-text body-text line-clamp-2", children: opponentName })
|
|
1747
1984
|
] }) }) });
|
|
1748
1985
|
}
|
|
1749
1986
|
function buildStatsColumns({
|
|
@@ -1757,14 +1994,14 @@ function buildStatsColumns({
|
|
|
1757
1994
|
return [
|
|
1758
1995
|
{
|
|
1759
1996
|
id: "game_date",
|
|
1760
|
-
header: () => /* @__PURE__ */ (0,
|
|
1997
|
+
header: () => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w-[50px] shrink-0", children: "Date" }),
|
|
1761
1998
|
cell: ({ row }) => formatTeamStatDate(row.original),
|
|
1762
1999
|
meta: { cellSize: isSm ? "xs" : "xxs", headerClassName: "h-auto" }
|
|
1763
2000
|
},
|
|
1764
2001
|
{
|
|
1765
2002
|
id: "opponent",
|
|
1766
|
-
header: () => /* @__PURE__ */ (0,
|
|
1767
|
-
cell: ({ row }) => /* @__PURE__ */ (0,
|
|
2003
|
+
header: () => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { children: isSm ? "Opponent" : "Opp" }),
|
|
2004
|
+
cell: ({ row }) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1768
2005
|
StatOpponentCell,
|
|
1769
2006
|
{
|
|
1770
2007
|
stat: row.original,
|
|
@@ -1816,33 +2053,33 @@ function StatsBody2({
|
|
|
1816
2053
|
isSmallLaptop,
|
|
1817
2054
|
emptyMessage
|
|
1818
2055
|
}) {
|
|
1819
|
-
return /* @__PURE__ */ (0,
|
|
1820
|
-
/* @__PURE__ */ (0,
|
|
1821
|
-
/* @__PURE__ */ (0,
|
|
1822
|
-
showsCategoryPicker && /* @__PURE__ */ (0,
|
|
1823
|
-
|
|
2056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
2057
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-2 min-[360px]:gap-3 xl:shrink-0", children: [
|
|
2058
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SeasonSelector, { ...seasons, className: "gap-2 min-[360px]:gap-3" }),
|
|
2059
|
+
showsCategoryPicker && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2060
|
+
import_ui_web17.Select,
|
|
1824
2061
|
{
|
|
1825
2062
|
value: selectedStatCategory,
|
|
1826
2063
|
onValueChange: onStatCategoryChange,
|
|
1827
2064
|
disabled: !seasons.selectedYear || seasons.selectedType === null,
|
|
1828
2065
|
children: [
|
|
1829
|
-
/* @__PURE__ */ (0,
|
|
1830
|
-
/* @__PURE__ */ (0,
|
|
1831
|
-
|
|
2066
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ui_web17.SelectTrigger, { variant: "widget", size: "widget", "aria-label": "Stat category", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ui_web17.SelectValue, { placeholder: "Select stat category" }) }),
|
|
2067
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2068
|
+
import_ui_web17.SelectContent,
|
|
1832
2069
|
{
|
|
1833
2070
|
className: "bg-popover border-border z-50 [&_.checkbox]:!flex",
|
|
1834
2071
|
classNameViewPort: "gap-2",
|
|
1835
|
-
children: availableStatCategories.map((category) => /* @__PURE__ */ (0,
|
|
2072
|
+
children: availableStatCategories.map((category) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ui_web17.SelectItem, { value: category, className: "capitalize min-h-8", children: category.charAt(0).toUpperCase() + category.slice(1) }, category))
|
|
1836
2073
|
}
|
|
1837
2074
|
)
|
|
1838
2075
|
]
|
|
1839
2076
|
}
|
|
1840
2077
|
)
|
|
1841
2078
|
] }),
|
|
1842
|
-
/* @__PURE__ */ (0,
|
|
1843
|
-
isStatTypesError && !hasVisibleStatTypes && /* @__PURE__ */ (0,
|
|
1844
|
-
/* @__PURE__ */ (0,
|
|
1845
|
-
|
|
2079
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col space-y-4 xl:flex-1 xl:min-h-0 xl:overflow-hidden", children: [
|
|
2080
|
+
isStatTypesError && !hasVisibleStatTypes && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-text-secondary text-13.5", children: "Couldn't load stat categories -- showing limited columns." }),
|
|
2081
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2082
|
+
import_ui_web17.BaseTable,
|
|
1846
2083
|
{
|
|
1847
2084
|
columns,
|
|
1848
2085
|
data: stats,
|
|
@@ -1878,35 +2115,35 @@ function TeamStatsTable({
|
|
|
1878
2115
|
isSmallLaptop,
|
|
1879
2116
|
className
|
|
1880
2117
|
}) {
|
|
1881
|
-
const [requestedStatCategory, setRequestedStatCategory] = (0,
|
|
2118
|
+
const [requestedStatCategory, setRequestedStatCategory] = (0, import_react8.useState)(null);
|
|
1882
2119
|
const availableStatCategories = getAvailableStatCategories(stats);
|
|
1883
2120
|
const selectedStatCategory = deriveSelectedStatCategory(
|
|
1884
2121
|
requestedStatCategory,
|
|
1885
2122
|
availableStatCategories
|
|
1886
2123
|
);
|
|
1887
2124
|
if (isTeamError) {
|
|
1888
|
-
return /* @__PURE__ */ (0,
|
|
2125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ui_web17.Card, { className: (0, import_ui_web17.cn)("border-0", className), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ui_web17.CardContent, { className: "p-4 flex justify-center items-center", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-text-secondary", children: "Couldn't load team information. Please try again." }) }) });
|
|
1889
2126
|
}
|
|
1890
2127
|
if (seasonsLoading || sportId === null) {
|
|
1891
|
-
return /* @__PURE__ */ (0,
|
|
1892
|
-
/* @__PURE__ */ (0,
|
|
1893
|
-
/* @__PURE__ */ (0,
|
|
1894
|
-
/* @__PURE__ */ (0,
|
|
1895
|
-
/* @__PURE__ */ (0,
|
|
2128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ui_web17.Card, { className: (0, import_ui_web17.cn)("border-0", className), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_ui_web17.CardContent, { className: "space-y-4 pt-6", children: [
|
|
2129
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col gap-3 sm:flex-row justify-start", children: [
|
|
2130
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ui_web17.Skeleton, { className: "h-7 w-[68px] bg-form rounded-[5px]" }),
|
|
2131
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ui_web17.Skeleton, { className: "h-7 w-[142px] bg-form rounded-[5px]" }),
|
|
2132
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ui_web17.Skeleton, { className: "h-7 w-[102px] bg-form rounded-[5px]" })
|
|
1896
2133
|
] }),
|
|
1897
|
-
/* @__PURE__ */ (0,
|
|
2134
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ui_web17.Skeleton, { className: "h-40 w-full bg-form !mt-3" })
|
|
1898
2135
|
] }) });
|
|
1899
2136
|
}
|
|
1900
2137
|
if (!seasons || seasons.years.length === 0) {
|
|
1901
|
-
return /* @__PURE__ */ (0,
|
|
2138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ui_web17.Card, { className: (0, import_ui_web17.cn)("border-none", className), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ui_web17.CardContent, { className: "pt-6", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "text-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime19.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." }) }) }) });
|
|
1902
2139
|
}
|
|
1903
|
-
const visibleStatTypes = (0,
|
|
1904
|
-
const filteredStatTypes = (0,
|
|
2140
|
+
const visibleStatTypes = (0, import_core12.getVisibleTeamStatTypes)(statTypes, sportId);
|
|
2141
|
+
const filteredStatTypes = (0, import_core12.getOrderedTeamStatTypesForCategory)(
|
|
1905
2142
|
visibleStatTypes,
|
|
1906
2143
|
sportId,
|
|
1907
2144
|
selectedStatCategory
|
|
1908
2145
|
);
|
|
1909
|
-
const showsCategoryPicker = availableStatCategories.length > 0 && (0,
|
|
2146
|
+
const showsCategoryPicker = availableStatCategories.length > 0 && (0, import_core12.showsTeamStatCategoryPicker)(sportId);
|
|
1910
2147
|
const columns = buildStatsColumns({
|
|
1911
2148
|
filteredStatTypes,
|
|
1912
2149
|
selectedStatCategory,
|
|
@@ -1916,16 +2153,16 @@ function TeamStatsTable({
|
|
|
1916
2153
|
isSmallLaptop
|
|
1917
2154
|
});
|
|
1918
2155
|
const emptyMessage = getStatsEmptyMessage(seasons, stats.length);
|
|
1919
|
-
return /* @__PURE__ */ (0,
|
|
1920
|
-
|
|
2156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2157
|
+
import_ui_web17.Card,
|
|
1921
2158
|
{
|
|
1922
|
-
className: (0,
|
|
2159
|
+
className: (0, import_ui_web17.cn)(
|
|
1923
2160
|
"border-none p-4 flex flex-col gap-3 xl:h-full xl:min-h-0 xl:flex-1 xl:overflow-hidden",
|
|
1924
2161
|
className
|
|
1925
2162
|
),
|
|
1926
2163
|
children: [
|
|
1927
|
-
/* @__PURE__ */ (0,
|
|
1928
|
-
/* @__PURE__ */ (0,
|
|
2164
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ui_web17.CardHeader, { className: "p-0", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ui_web17.CardTitle, { children: "Stats" }) }),
|
|
2165
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ui_web17.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_runtime19.jsx)(
|
|
1929
2166
|
StatsBody2,
|
|
1930
2167
|
{
|
|
1931
2168
|
seasons,
|
|
@@ -1950,8 +2187,8 @@ function TeamStatsTable({
|
|
|
1950
2187
|
}
|
|
1951
2188
|
|
|
1952
2189
|
// src/team/team-schedule-table.tsx
|
|
1953
|
-
var
|
|
1954
|
-
var
|
|
2190
|
+
var import_ui_web18 = require("@nukleus-sports/ui-web");
|
|
2191
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1955
2192
|
var SPECIAL_LOGO_LEAGUES = ["NFL", "NBA", "NHL", "MLB", "WNBA"];
|
|
1956
2193
|
var COLLEGE_LEAGUE_IDS = [2, 6, 13];
|
|
1957
2194
|
var COMPLETED_STATUS_ID = "3";
|
|
@@ -2000,12 +2237,12 @@ function showsMlbLeaders(leagueId) {
|
|
|
2000
2237
|
}
|
|
2001
2238
|
function leaderCell(leader, small = false) {
|
|
2002
2239
|
if (!leader) return "--";
|
|
2003
|
-
return /* @__PURE__ */ (0,
|
|
2004
|
-
/* @__PURE__ */ (0,
|
|
2005
|
-
/* @__PURE__ */ (0,
|
|
2240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col leading-tight", children: [
|
|
2241
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-text-primary font-normal truncate", children: leader.displayName }),
|
|
2242
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2006
2243
|
"span",
|
|
2007
2244
|
{
|
|
2008
|
-
className: (0,
|
|
2245
|
+
className: (0, import_ui_web18.cn)(
|
|
2009
2246
|
small ? "text-text-secondary text-11" : "text-text-primary body-text",
|
|
2010
2247
|
"truncate"
|
|
2011
2248
|
),
|
|
@@ -2022,7 +2259,7 @@ function formatScheduleDate(game) {
|
|
|
2022
2259
|
const [year, month, day] = rawDate.split("T")[0].split("-").map(Number);
|
|
2023
2260
|
return new Date(year, month - 1, day);
|
|
2024
2261
|
})();
|
|
2025
|
-
return /* @__PURE__ */ (0,
|
|
2262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-text-primary body-text", children: DATE_FORMAT2.format(date) });
|
|
2026
2263
|
} catch {
|
|
2027
2264
|
return "--";
|
|
2028
2265
|
}
|
|
@@ -2040,9 +2277,9 @@ function getScheduleResult(game, teamEspnId) {
|
|
|
2040
2277
|
const winLoss = tied ? "T" : own.winner === true ? "W" : "L";
|
|
2041
2278
|
const score = `${formatScore(own.score)}-${formatScore(other.score)}`;
|
|
2042
2279
|
const colorClass = winLoss === "W" ? "text-primary-color-nuk-text" : winLoss === "L" ? "text-semantic-color-status-priority-blocked-hot-copy" : "text-text-primary";
|
|
2043
|
-
return /* @__PURE__ */ (0,
|
|
2044
|
-
/* @__PURE__ */ (0,
|
|
2045
|
-
/* @__PURE__ */ (0,
|
|
2280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-baseline gap-1 leading-tight", children: [
|
|
2281
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: (0, import_ui_web18.cn)(colorClass, "body-text"), children: winLoss }),
|
|
2282
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-text-primary body-text", children: score })
|
|
2046
2283
|
] });
|
|
2047
2284
|
}
|
|
2048
2285
|
function getScheduleRecord(game, teamEspnId) {
|
|
@@ -2053,7 +2290,7 @@ function getScheduleRecord(game, teamEspnId) {
|
|
|
2053
2290
|
function getWinningGoalie(game) {
|
|
2054
2291
|
const athlete = firstCompetition(game)?.featuredAthletes?.[0]?.athlete;
|
|
2055
2292
|
if (!athlete?.lastName) return "--";
|
|
2056
|
-
return /* @__PURE__ */ (0,
|
|
2293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex flex-col leading-tight", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-text-primary font-normal truncate", children: athlete.lastName }) });
|
|
2057
2294
|
}
|
|
2058
2295
|
function getHockeyTopPlayer(game) {
|
|
2059
2296
|
const competitors = firstCompetition(game)?.competitors;
|
|
@@ -2070,9 +2307,9 @@ function getMlbPitcher(game, pitcherType) {
|
|
|
2070
2307
|
const athlete = pitcher?.athlete;
|
|
2071
2308
|
if (!athlete?.lastName) return "--";
|
|
2072
2309
|
const stat = pitcherType === "savingPitcher" ? athlete.saves : athlete.record;
|
|
2073
|
-
return /* @__PURE__ */ (0,
|
|
2074
|
-
/* @__PURE__ */ (0,
|
|
2075
|
-
/* @__PURE__ */ (0,
|
|
2310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col leading-tight", children: [
|
|
2311
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-text-primary font-normal truncate", children: athlete.lastName }),
|
|
2312
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-text-secondary text-11 truncate", children: stat || "--" })
|
|
2076
2313
|
] });
|
|
2077
2314
|
}
|
|
2078
2315
|
function OpponentCell({
|
|
@@ -2085,15 +2322,15 @@ function OpponentCell({
|
|
|
2085
2322
|
showName
|
|
2086
2323
|
}) {
|
|
2087
2324
|
const match = findCompetitor(firstCompetition(game)?.competitors, teamEspnId);
|
|
2088
|
-
if (!match || leagueId === null || !leagueAbbreviation) return /* @__PURE__ */ (0,
|
|
2325
|
+
if (!match || leagueId === null || !leagueAbbreviation) return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children: "--" });
|
|
2089
2326
|
const prefix = match.own.homeAway === "home" ? "vs" : "@";
|
|
2090
2327
|
const opponentTeam = match.other.team;
|
|
2091
2328
|
const isSpecialLeague = SPECIAL_LOGO_LEAGUES.includes(leagueAbbreviation);
|
|
2092
2329
|
const identifier = isSpecialLeague ? opponentTeam.abbreviation : opponentTeam.id;
|
|
2093
2330
|
const folder = COLLEGE_LEAGUE_IDS.includes(leagueId) ? "NCAA" : leagueAbbreviation;
|
|
2094
|
-
return /* @__PURE__ */ (0,
|
|
2095
|
-
/* @__PURE__ */ (0,
|
|
2096
|
-
/* @__PURE__ */ (0,
|
|
2331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-1 sm:gap-2 h-full overflow-hidden", children: [
|
|
2332
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-text-primary body-text shrink-0 sm:w-4", children: prefix }),
|
|
2333
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2097
2334
|
"img",
|
|
2098
2335
|
{
|
|
2099
2336
|
src: resolveLogoUrl(folder, identifier),
|
|
@@ -2105,7 +2342,7 @@ function OpponentCell({
|
|
|
2105
2342
|
}
|
|
2106
2343
|
}
|
|
2107
2344
|
),
|
|
2108
|
-
showName && /* @__PURE__ */ (0,
|
|
2345
|
+
showName && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-primary-color-nuk-text body-text line-clamp-2", children: opponentTeam.displayName })
|
|
2109
2346
|
] });
|
|
2110
2347
|
}
|
|
2111
2348
|
function buildScheduleColumns({
|
|
@@ -2121,15 +2358,15 @@ function buildScheduleColumns({
|
|
|
2121
2358
|
return [
|
|
2122
2359
|
{
|
|
2123
2360
|
id: "game_date",
|
|
2124
|
-
header: () => /* @__PURE__ */ (0,
|
|
2361
|
+
header: () => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w-[50px] shrink-0", children: "Date" }),
|
|
2125
2362
|
accessorFn: (row) => row.game_date,
|
|
2126
2363
|
cell: ({ row }) => formatScheduleDate(row.original),
|
|
2127
2364
|
meta: { cellSize: isSm ? "xs" : "xxs" }
|
|
2128
2365
|
},
|
|
2129
2366
|
{
|
|
2130
2367
|
id: "opponent",
|
|
2131
|
-
header: () => /* @__PURE__ */ (0,
|
|
2132
|
-
cell: ({ row }) => /* @__PURE__ */ (0,
|
|
2368
|
+
header: () => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { children: isSm ? "Opponent" : "Opp" }),
|
|
2369
|
+
cell: ({ row }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2133
2370
|
OpponentCell,
|
|
2134
2371
|
{
|
|
2135
2372
|
game: row.original,
|
|
@@ -2245,15 +2482,15 @@ function ScheduleBody({
|
|
|
2245
2482
|
isSmallLaptop
|
|
2246
2483
|
}) {
|
|
2247
2484
|
if (seasonsLoading) {
|
|
2248
|
-
return /* @__PURE__ */ (0,
|
|
2485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex justify-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "text-sm text-text-primary", children: "Loading seasons..." }) });
|
|
2249
2486
|
}
|
|
2250
2487
|
if (!seasons || seasons.years.length === 0) {
|
|
2251
|
-
return /* @__PURE__ */ (0,
|
|
2488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "text-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-text-primary", children: isSeasonsError ? "Couldn't load seasons. Please try again." : "No seasons found" }) });
|
|
2252
2489
|
}
|
|
2253
|
-
return /* @__PURE__ */ (0,
|
|
2254
|
-
/* @__PURE__ */ (0,
|
|
2255
|
-
/* @__PURE__ */ (0,
|
|
2256
|
-
|
|
2490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col gap-3 xl:flex-1 xl:min-h-0 xl:overflow-hidden", children: [
|
|
2491
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SeasonSelector, { ...seasons, className: "gap-2 min-[360px]:gap-3 xl:shrink-0" }),
|
|
2492
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "xl:flex-1 xl:min-h-0 xl:overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2493
|
+
import_ui_web18.BaseTable,
|
|
2257
2494
|
{
|
|
2258
2495
|
columns,
|
|
2259
2496
|
data: games,
|
|
@@ -2296,24 +2533,24 @@ function TeamScheduleTable({
|
|
|
2296
2533
|
isSmallLaptop
|
|
2297
2534
|
});
|
|
2298
2535
|
if (isTeamError) {
|
|
2299
|
-
return /* @__PURE__ */ (0,
|
|
2536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_ui_web18.Card, { className: (0, import_ui_web18.cn)("border-0", className), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_ui_web18.CardContent, { className: "p-4 flex justify-center items-center", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-text-secondary", children: "Couldn't load team information. Please try again." }) }) });
|
|
2300
2537
|
}
|
|
2301
2538
|
if (leagueId === null) {
|
|
2302
|
-
return /* @__PURE__ */ (0,
|
|
2303
|
-
/* @__PURE__ */ (0,
|
|
2304
|
-
/* @__PURE__ */ (0,
|
|
2539
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_ui_web18.Card, { className: (0, import_ui_web18.cn)("border-0", className), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_ui_web18.CardContent, { className: "p-4 flex justify-center items-center gap-2", children: [
|
|
2540
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_ui_web18.IconLoader, {}),
|
|
2541
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-text-secondary", children: "Loading team information..." })
|
|
2305
2542
|
] }) });
|
|
2306
2543
|
}
|
|
2307
|
-
return /* @__PURE__ */ (0,
|
|
2308
|
-
|
|
2544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2545
|
+
import_ui_web18.Card,
|
|
2309
2546
|
{
|
|
2310
|
-
className: (0,
|
|
2547
|
+
className: (0, import_ui_web18.cn)(
|
|
2311
2548
|
"border-none p-4 flex flex-col gap-3 xl:h-full xl:min-h-0 xl:flex-1 xl:overflow-hidden",
|
|
2312
2549
|
className
|
|
2313
2550
|
),
|
|
2314
2551
|
children: [
|
|
2315
|
-
/* @__PURE__ */ (0,
|
|
2316
|
-
/* @__PURE__ */ (0,
|
|
2552
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_ui_web18.CardHeader, { className: "p-0 flex flex-row items-center justify-between space-y-0", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_ui_web18.CardTitle, { children: "Schedule" }) }),
|
|
2553
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_ui_web18.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_runtime20.jsx)(
|
|
2317
2554
|
ScheduleBody,
|
|
2318
2555
|
{
|
|
2319
2556
|
seasonsLoading,
|
|
@@ -2345,6 +2582,8 @@ function TeamScheduleTable({
|
|
|
2345
2582
|
TeamFactsWidget,
|
|
2346
2583
|
TeamHeaderCard,
|
|
2347
2584
|
TeamInfoCard,
|
|
2585
|
+
TeamPlacesCard,
|
|
2586
|
+
TeamRosterTable,
|
|
2348
2587
|
TeamScheduleTable,
|
|
2349
2588
|
TeamSeasonScheduleSummaryPanel,
|
|
2350
2589
|
TeamSeasonStatsSummaryPanel,
|