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