@nukleus-sports/ui-patterns 0.6.4 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/team.cjs +352 -328
- package/dist/team.cjs.map +1 -1
- package/dist/team.d.cts +13 -1
- package/dist/team.d.ts +13 -1
- package/dist/team.js +313 -290
- package/dist/team.js.map +1 -1
- package/package.json +3 -3
package/dist/team.js
CHANGED
|
@@ -131,16 +131,39 @@ function TeamInfoCard({ team, resolveImageUrl, className }) {
|
|
|
131
131
|
);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
// src/team/team-header-card.tsx
|
|
135
|
+
import { Avatar, AvatarFallback, AvatarImage, Card as Card2, CardContent as CardContent2, cn as cn2 } from "@nukleus-sports/ui-web";
|
|
136
|
+
import { formatTeamName as formatTeamName2, getTeamConferenceInfo, getTeamInitials } from "@nukleus-sports/core";
|
|
137
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
138
|
+
function TeamHeaderCard({ team, logoUrl, className }) {
|
|
139
|
+
const displayName = formatTeamName2(team.team, team.nickname) || "Team not found";
|
|
140
|
+
const initials = getTeamInitials(team.team);
|
|
141
|
+
const conferenceInfo = getTeamConferenceInfo(
|
|
142
|
+
team.specificData?.conference,
|
|
143
|
+
team.specificData?.division
|
|
144
|
+
);
|
|
145
|
+
return /* @__PURE__ */ jsx2(Card2, { className: cn2("border-0", className), children: /* @__PURE__ */ jsx2(CardContent2, { className: "flex h-full items-center gap-6 p-4 sm:p-6", children: /* @__PURE__ */ jsxs2("div", { className: "flex min-w-0 items-center gap-3 sm:gap-0", children: [
|
|
146
|
+
/* @__PURE__ */ jsxs2(Avatar, { className: "h-20 w-20 shrink-0 rounded-none min-[400px]:h-28 min-[400px]:w-28 sm:h-40 sm:w-40", children: [
|
|
147
|
+
/* @__PURE__ */ jsx2(AvatarImage, { src: logoUrl ?? void 0, alt: `${displayName} logo` }),
|
|
148
|
+
/* @__PURE__ */ jsx2(AvatarFallback, { className: "text-2xl font-bold", children: initials })
|
|
149
|
+
] }),
|
|
150
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex min-w-0 flex-col justify-center gap-1 sm:gap-2 sm:px-4", children: [
|
|
151
|
+
/* @__PURE__ */ jsx2("h1", { className: "break-words text-[20px] font-black leading-tight text-text-primary min-[400px]:text-[24px] sm:player-card-name", children: displayName }),
|
|
152
|
+
/* @__PURE__ */ jsx2("p", { className: "text-sm text-text-primary", children: conferenceInfo })
|
|
153
|
+
] })
|
|
154
|
+
] }) }) });
|
|
155
|
+
}
|
|
156
|
+
|
|
134
157
|
// src/team/team-staff-table.tsx
|
|
135
158
|
import { useMemo, useState } from "react";
|
|
136
159
|
import {
|
|
137
160
|
BaseTable,
|
|
138
161
|
createClickableSortableHeader,
|
|
139
162
|
useInfiniteList,
|
|
140
|
-
cn as
|
|
163
|
+
cn as cn3
|
|
141
164
|
} from "@nukleus-sports/ui-web";
|
|
142
165
|
import { sortTeamStaff } from "@nukleus-sports/core";
|
|
143
|
-
import { jsx as
|
|
166
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
144
167
|
var CATEGORY_ORDER = [
|
|
145
168
|
"Head Coaches",
|
|
146
169
|
"Assistant Coaches",
|
|
@@ -168,7 +191,6 @@ function TeamStaffTable({
|
|
|
168
191
|
const [internalSorting, setInternalSorting] = useState(DEFAULT_SORT);
|
|
169
192
|
const activeSorting = sorting ?? internalSorting;
|
|
170
193
|
const handleSortingChange = onSortingChange ?? setInternalSorting;
|
|
171
|
-
const effectiveVirtualized = virtualized && !isSplitLayout;
|
|
172
194
|
const rows = useMemo(() => {
|
|
173
195
|
if (staff.length === 0) return [];
|
|
174
196
|
const grouped = /* @__PURE__ */ new Map();
|
|
@@ -204,7 +226,7 @@ function TeamStaffTable({
|
|
|
204
226
|
const { visibleItems, sentinelRef, hasMore } = useInfiniteList(rows, {
|
|
205
227
|
resetKey: `${staff.length}|${JSON.stringify(activeSorting)}`
|
|
206
228
|
});
|
|
207
|
-
const displayedRows =
|
|
229
|
+
const displayedRows = virtualized ? visibleItems : rows;
|
|
208
230
|
const columns = useMemo(() => {
|
|
209
231
|
const activate = (id) => onStaffClick?.(id);
|
|
210
232
|
const interactionProps = (id, ariaLabel) => interactive ? {
|
|
@@ -230,13 +252,13 @@ function TeamStaffTable({
|
|
|
230
252
|
const member = row.original;
|
|
231
253
|
const fullName = `${member.first_name} ${member.last_name}`.trim();
|
|
232
254
|
const labelText = `View ${fullName}'s profile`;
|
|
233
|
-
return /* @__PURE__ */
|
|
234
|
-
/* @__PURE__ */
|
|
255
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex gap-2 items-center w-full line-clamp-2", children: [
|
|
256
|
+
/* @__PURE__ */ jsx3(
|
|
235
257
|
"div",
|
|
236
258
|
{
|
|
237
|
-
className:
|
|
259
|
+
className: cn3("flex items-center justify-center", interactive && "cursor-pointer"),
|
|
238
260
|
...interactionProps(member.id, labelText),
|
|
239
|
-
children: /* @__PURE__ */
|
|
261
|
+
children: /* @__PURE__ */ jsx3(
|
|
240
262
|
EntityAvatar,
|
|
241
263
|
{
|
|
242
264
|
entityType: "coach",
|
|
@@ -251,10 +273,10 @@ function TeamStaffTable({
|
|
|
251
273
|
)
|
|
252
274
|
}
|
|
253
275
|
),
|
|
254
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ jsx3(
|
|
255
277
|
"div",
|
|
256
278
|
{
|
|
257
|
-
className:
|
|
279
|
+
className: cn3("line-clamp-2", interactive && "cursor-pointer"),
|
|
258
280
|
...interactionProps(member.id, labelText),
|
|
259
281
|
children: fullName
|
|
260
282
|
}
|
|
@@ -267,10 +289,10 @@ function TeamStaffTable({
|
|
|
267
289
|
id: "position",
|
|
268
290
|
header: positionHeader,
|
|
269
291
|
accessorFn: (row) => row.position || "-",
|
|
270
|
-
cell: ({ row }) => /* @__PURE__ */
|
|
292
|
+
cell: ({ row }) => /* @__PURE__ */ jsx3("div", { className: "flex items-center h-full min-h-[46px]", children: /* @__PURE__ */ jsx3(
|
|
271
293
|
"span",
|
|
272
294
|
{
|
|
273
|
-
className:
|
|
295
|
+
className: cn3("line-clamp-2 break-words", interactive && "cursor-pointer"),
|
|
274
296
|
...interactionProps(
|
|
275
297
|
row.original.id,
|
|
276
298
|
`View ${row.original.first_name} ${row.original.last_name}'s position`
|
|
@@ -282,7 +304,7 @@ function TeamStaffTable({
|
|
|
282
304
|
}
|
|
283
305
|
];
|
|
284
306
|
}, [interactive, onStaffClick, sortable, isCompact, resolveImageUrl]);
|
|
285
|
-
return /* @__PURE__ */
|
|
307
|
+
return /* @__PURE__ */ jsx3("div", { className: "w-full xl:flex xl:h-full xl:flex-1 xl:min-h-0 xl:flex-col xl:overflow-hidden", children: /* @__PURE__ */ jsx3(
|
|
286
308
|
BaseTable,
|
|
287
309
|
{
|
|
288
310
|
columns,
|
|
@@ -296,18 +318,18 @@ function TeamStaffTable({
|
|
|
296
318
|
loading,
|
|
297
319
|
emptyMessage: isError ? "Failed to load coaching staff. Please try again." : "No coaches found.",
|
|
298
320
|
pageSize: Math.max(displayedRows.length, 25),
|
|
299
|
-
hidePagination:
|
|
321
|
+
hidePagination: virtualized,
|
|
300
322
|
stickyHeader: true,
|
|
301
323
|
splitLayout: isSplitLayout,
|
|
302
324
|
numberOfColumns: 1,
|
|
303
325
|
splitLayoutGridCols: isCompact ? "!grid-cols-[minmax(120px,120px)_1fr]" : isSplitLayout ? "sm:!grid-cols-[minmax(220px,220px)_1fr]" : "",
|
|
304
|
-
containerClassName:
|
|
305
|
-
className:
|
|
326
|
+
containerClassName: cn3("border-0 rounded-none xl:h-full", virtualized && "h-full"),
|
|
327
|
+
className: cn3(
|
|
306
328
|
"border-none xl:flex-1 xl:min-h-0 xl:overflow-hidden",
|
|
307
|
-
|
|
329
|
+
virtualized && "h-full min-h-0 w-full",
|
|
308
330
|
className
|
|
309
331
|
),
|
|
310
|
-
bottomContent:
|
|
332
|
+
bottomContent: virtualized && hasMore ? /* @__PURE__ */ jsx3("div", { ref: sentinelRef, className: "h-px w-full" }) : null,
|
|
311
333
|
getRowBanner: (row) => row.__isCategoryRow ? row.__categoryLabel : null,
|
|
312
334
|
bannerRowClassName: "bg-greys-background-hover hover:bg-greys-background-hover",
|
|
313
335
|
getRowClassName: (row) => row.__isCategoryRow ? "hidden" : ""
|
|
@@ -316,11 +338,11 @@ function TeamStaffTable({
|
|
|
316
338
|
}
|
|
317
339
|
|
|
318
340
|
// src/team/stat-column.tsx
|
|
319
|
-
import { jsx as
|
|
341
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
320
342
|
function StatColumn({ label, value, suffix, rankBadge }) {
|
|
321
|
-
return /* @__PURE__ */
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
-
/* @__PURE__ */
|
|
343
|
+
return /* @__PURE__ */ jsxs4("div", { className: "flex flex-col items-center h-full justify-center flex-1 gap-1 sm:gap-3 w-full", children: [
|
|
344
|
+
/* @__PURE__ */ jsx4("span", { className: "label-xs-medium text-text-secondary leading-normal opacity-[0.8] ss05", children: label }),
|
|
345
|
+
/* @__PURE__ */ jsxs4("span", { className: "text-[19px] font-semibold sm:text-[32px] sm:font-bold text-text-primary leading-normal title-text opacity-[0.8]", children: [
|
|
324
346
|
value,
|
|
325
347
|
suffix || ""
|
|
326
348
|
] }),
|
|
@@ -329,12 +351,12 @@ function StatColumn({ label, value, suffix, rankBadge }) {
|
|
|
329
351
|
}
|
|
330
352
|
|
|
331
353
|
// src/team/team-season-stats-summary-panel.tsx
|
|
332
|
-
import { Card as
|
|
354
|
+
import { Card as Card3, CardContent as CardContent3, CardHeader, CardTitle, Skeleton, cn as cn4 } from "@nukleus-sports/ui-web";
|
|
333
355
|
import {
|
|
334
356
|
getTeamStatColumns,
|
|
335
357
|
isSupportedTeamStatsSport
|
|
336
358
|
} from "@nukleus-sports/core";
|
|
337
|
-
import { jsx as
|
|
359
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
338
360
|
function getStatusMessage({
|
|
339
361
|
isSupportedSport,
|
|
340
362
|
selectedYear,
|
|
@@ -365,9 +387,9 @@ function TeamSeasonStatsSummaryPanel({
|
|
|
365
387
|
isError,
|
|
366
388
|
stats
|
|
367
389
|
});
|
|
368
|
-
return /* @__PURE__ */
|
|
369
|
-
/* @__PURE__ */
|
|
370
|
-
/* @__PURE__ */
|
|
390
|
+
return /* @__PURE__ */ jsxs5(Card3, { className: cn4("border-0 p-4 flex flex-col gap-4", className), children: [
|
|
391
|
+
/* @__PURE__ */ jsx5(CardHeader, { className: "p-0", children: /* @__PURE__ */ jsx5(CardTitle, { className: "text-base text-text-primary font-medium leading-normal", children: "Season Stats" }) }),
|
|
392
|
+
/* @__PURE__ */ jsx5(CardContent3, { className: "p-0 flex-1 flex justify-center items-center", children: loading ? /* @__PURE__ */ jsx5("div", { className: "flex items-center justify-center w-full", children: /* @__PURE__ */ jsx5(Skeleton, { className: "h-4 w-3/4" }) }) : statusMessage ? /* @__PURE__ */ jsx5("div", { className: "flex items-center justify-center w-full text-14.5 text-text-secondary", children: statusMessage }) : stats && /* @__PURE__ */ jsx5("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__ */ jsx5(
|
|
371
393
|
StatColumn,
|
|
372
394
|
{
|
|
373
395
|
label: col.label,
|
|
@@ -380,8 +402,8 @@ function TeamSeasonStatsSummaryPanel({
|
|
|
380
402
|
}
|
|
381
403
|
|
|
382
404
|
// src/team/team-season-schedule-summary-panel.tsx
|
|
383
|
-
import { Card as
|
|
384
|
-
import { jsx as
|
|
405
|
+
import { Card as Card4, CardContent as CardContent4, CardHeader as CardHeader2, CardTitle as CardTitle2, Skeleton as Skeleton2, cn as cn5 } from "@nukleus-sports/ui-web";
|
|
406
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
385
407
|
function TeamSeasonScheduleSummaryPanel({
|
|
386
408
|
selectedYear,
|
|
387
409
|
selectedType,
|
|
@@ -390,11 +412,11 @@ function TeamSeasonScheduleSummaryPanel({
|
|
|
390
412
|
isError,
|
|
391
413
|
className
|
|
392
414
|
}) {
|
|
393
|
-
return /* @__PURE__ */
|
|
394
|
-
/* @__PURE__ */
|
|
395
|
-
/* @__PURE__ */
|
|
396
|
-
/* @__PURE__ */
|
|
397
|
-
/* @__PURE__ */
|
|
415
|
+
return /* @__PURE__ */ jsxs6(Card4, { className: cn5("border-0 p-4 flex flex-col gap-4", className), children: [
|
|
416
|
+
/* @__PURE__ */ jsx6(CardHeader2, { className: "p-0", children: /* @__PURE__ */ jsx6(CardTitle2, { className: "text-base text-text-primary font-medium leading-normal", children: "Season Summary" }) }),
|
|
417
|
+
/* @__PURE__ */ jsx6(CardContent4, { className: "p-0 flex-1 flex justify-center items-center", children: loading ? /* @__PURE__ */ jsx6("div", { className: "flex items-center justify-center w-full", children: /* @__PURE__ */ jsx6(Skeleton2, { className: "h-4 w-3/4" }) }) : !selectedYear || selectedType === null ? /* @__PURE__ */ jsx6("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__ */ jsx6("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__ */ jsx6("div", { className: "flex items-center justify-center w-full text-14.5 text-text-secondary", children: "No schedule data for the current season." }) : /* @__PURE__ */ jsxs6("div", { className: "w-full flex flex-col sm:flex-row gap-6 sm:gap-3 justify-between items-center", children: [
|
|
418
|
+
/* @__PURE__ */ jsx6(StatColumn, { label: "Record", value: summary.record }),
|
|
419
|
+
/* @__PURE__ */ jsx6(
|
|
398
420
|
StatColumn,
|
|
399
421
|
{
|
|
400
422
|
label: "Games Played",
|
|
@@ -412,9 +434,9 @@ import {
|
|
|
412
434
|
SelectItem,
|
|
413
435
|
SelectTrigger,
|
|
414
436
|
SelectValue,
|
|
415
|
-
cn as
|
|
437
|
+
cn as cn6
|
|
416
438
|
} from "@nukleus-sports/ui-web";
|
|
417
|
-
import { jsx as
|
|
439
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
418
440
|
function SeasonSelector({
|
|
419
441
|
years,
|
|
420
442
|
types,
|
|
@@ -425,39 +447,39 @@ function SeasonSelector({
|
|
|
425
447
|
hideTypeOnMobile = false,
|
|
426
448
|
className
|
|
427
449
|
}) {
|
|
428
|
-
return /* @__PURE__ */
|
|
429
|
-
/* @__PURE__ */
|
|
450
|
+
return /* @__PURE__ */ jsxs7("div", { className: cn6("flex gap-3", className), children: [
|
|
451
|
+
/* @__PURE__ */ jsxs7(
|
|
430
452
|
Select,
|
|
431
453
|
{
|
|
432
454
|
value: selectedYear?.toString() ?? "",
|
|
433
455
|
onValueChange: (value) => onYearChange(Number(value)),
|
|
434
456
|
children: [
|
|
435
|
-
/* @__PURE__ */
|
|
436
|
-
/* @__PURE__ */
|
|
457
|
+
/* @__PURE__ */ jsx7(SelectTrigger, { variant: "widget", size: "widget", "aria-label": "Season year", children: /* @__PURE__ */ jsx7(SelectValue, { placeholder: "Select year" }) }),
|
|
458
|
+
/* @__PURE__ */ jsx7(
|
|
437
459
|
SelectContent,
|
|
438
460
|
{
|
|
439
461
|
className: "bg-card border-border z-50 [&_.checkbox]:!flex",
|
|
440
462
|
classNameViewPort: "gap-2",
|
|
441
|
-
children: years.map((year) => /* @__PURE__ */
|
|
463
|
+
children: years.map((year) => /* @__PURE__ */ jsx7(SelectItem, { value: year.value.toString(), className: "min-h-8", children: year.label }, year.value))
|
|
442
464
|
}
|
|
443
465
|
)
|
|
444
466
|
]
|
|
445
467
|
}
|
|
446
468
|
),
|
|
447
|
-
/* @__PURE__ */
|
|
469
|
+
/* @__PURE__ */ jsx7("div", { className: cn6(hideTypeOnMobile && "hidden sm:block"), children: /* @__PURE__ */ jsxs7(
|
|
448
470
|
Select,
|
|
449
471
|
{
|
|
450
472
|
value: selectedType?.toString() ?? "",
|
|
451
473
|
onValueChange: (value) => onTypeChange(Number(value)),
|
|
452
474
|
disabled: selectedYear === null,
|
|
453
475
|
children: [
|
|
454
|
-
/* @__PURE__ */
|
|
455
|
-
/* @__PURE__ */
|
|
476
|
+
/* @__PURE__ */ jsx7(SelectTrigger, { variant: "widget", size: "widget", "aria-label": "Season type", children: /* @__PURE__ */ jsx7(SelectValue, { placeholder: "Select type" }) }),
|
|
477
|
+
/* @__PURE__ */ jsx7(
|
|
456
478
|
SelectContent,
|
|
457
479
|
{
|
|
458
480
|
className: "bg-card border-border z-50 [&_.checkbox]:!flex",
|
|
459
481
|
classNameViewPort: "gap-2",
|
|
460
|
-
children: types.map((type) => /* @__PURE__ */
|
|
482
|
+
children: types.map((type) => /* @__PURE__ */ jsx7(SelectItem, { value: type.value.toString(), className: "min-h-8", children: type.label }, type.value))
|
|
461
483
|
}
|
|
462
484
|
)
|
|
463
485
|
]
|
|
@@ -468,8 +490,8 @@ function SeasonSelector({
|
|
|
468
490
|
|
|
469
491
|
// src/team/fact-pills.tsx
|
|
470
492
|
import { useId, useLayoutEffect, useRef, useState as useState2 } from "react";
|
|
471
|
-
import { cn as
|
|
472
|
-
import { jsx as
|
|
493
|
+
import { cn as cn7 } from "@nukleus-sports/ui-web";
|
|
494
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
473
495
|
var MAX_ROWS = 2;
|
|
474
496
|
var KEY_SEPARATOR = "";
|
|
475
497
|
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";
|
|
@@ -540,19 +562,19 @@ function FactPills({ items, capped = false }) {
|
|
|
540
562
|
setExpanded(false);
|
|
541
563
|
setVisibleCount(null);
|
|
542
564
|
};
|
|
543
|
-
return /* @__PURE__ */
|
|
565
|
+
return /* @__PURE__ */ jsxs8(
|
|
544
566
|
"ul",
|
|
545
567
|
{
|
|
546
568
|
id: listId,
|
|
547
569
|
ref: listRef,
|
|
548
|
-
className:
|
|
570
|
+
className: cn7(
|
|
549
571
|
"flex w-full flex-wrap content-start items-start gap-1",
|
|
550
572
|
collapsible && "overflow-hidden"
|
|
551
573
|
),
|
|
552
574
|
style: collapsible && clipHeight !== null ? { maxHeight: clipHeight } : void 0,
|
|
553
575
|
children: [
|
|
554
|
-
items.slice(0, shownCount).map((item, index) => /* @__PURE__ */
|
|
555
|
-
truncated && /* @__PURE__ */
|
|
576
|
+
items.slice(0, shownCount).map((item, index) => /* @__PURE__ */ jsx8("li", { className: PILL_CLASS, title: String(item), children: /* @__PURE__ */ jsx8("span", { className: "truncate", children: item }) }, keys[index])),
|
|
577
|
+
truncated && /* @__PURE__ */ jsx8("li", { className: "flex shrink-0", children: /* @__PURE__ */ jsx8(
|
|
556
578
|
"button",
|
|
557
579
|
{
|
|
558
580
|
type: "button",
|
|
@@ -563,7 +585,7 @@ function FactPills({ items, capped = false }) {
|
|
|
563
585
|
children: "Show More"
|
|
564
586
|
}
|
|
565
587
|
) }),
|
|
566
|
-
capped && expanded && /* @__PURE__ */
|
|
588
|
+
capped && expanded && /* @__PURE__ */ jsx8("li", { className: "flex shrink-0", children: /* @__PURE__ */ jsx8(
|
|
567
589
|
"button",
|
|
568
590
|
{
|
|
569
591
|
type: "button",
|
|
@@ -580,7 +602,7 @@ function FactPills({ items, capped = false }) {
|
|
|
580
602
|
}
|
|
581
603
|
|
|
582
604
|
// src/team/fact-field.tsx
|
|
583
|
-
import { Skeleton as Skeleton3, cn as
|
|
605
|
+
import { Skeleton as Skeleton3, cn as cn8 } from "@nukleus-sports/ui-web";
|
|
584
606
|
import {
|
|
585
607
|
EMPTY_FACT_VALUE,
|
|
586
608
|
formatTeamFactNumber,
|
|
@@ -588,7 +610,7 @@ import {
|
|
|
588
610
|
TEAM_FACT_KINDS,
|
|
589
611
|
TEAM_FACT_YEAR_PAIRS
|
|
590
612
|
} from "@nukleus-sports/core";
|
|
591
|
-
import { Fragment, jsx as
|
|
613
|
+
import { Fragment, jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
592
614
|
function numberFact(facts, key) {
|
|
593
615
|
const value = facts[key];
|
|
594
616
|
return typeof value === "number" ? value : null;
|
|
@@ -602,10 +624,10 @@ function textFact(facts, key) {
|
|
|
602
624
|
return typeof value === "string" ? value : null;
|
|
603
625
|
}
|
|
604
626
|
function EmptyValue({ children = EMPTY_FACT_VALUE }) {
|
|
605
|
-
return /* @__PURE__ */
|
|
627
|
+
return /* @__PURE__ */ jsx9("span", { className: "body-text font-ss02-ss05 text-text-secondary", children });
|
|
606
628
|
}
|
|
607
629
|
function FieldLabel({ children }) {
|
|
608
|
-
return /* @__PURE__ */
|
|
630
|
+
return /* @__PURE__ */ jsx9("span", { className: "w-full label-xs-text font-ss02-ss05 text-text-secondary", children });
|
|
609
631
|
}
|
|
610
632
|
function CountFact({
|
|
611
633
|
factKey,
|
|
@@ -614,10 +636,10 @@ function CountFact({
|
|
|
614
636
|
const { facts, config } = data;
|
|
615
637
|
const pairedYears = TEAM_FACT_YEAR_PAIRS[factKey];
|
|
616
638
|
const years = pairedYears ? formatYearPills(listFact(facts, pairedYears), config.formatChampionshipYear) : [];
|
|
617
|
-
return /* @__PURE__ */
|
|
618
|
-
/* @__PURE__ */
|
|
619
|
-
/* @__PURE__ */
|
|
620
|
-
years.length > 0 && /* @__PURE__ */
|
|
639
|
+
return /* @__PURE__ */ jsxs9("div", { className: "flex min-w-0 flex-col items-start gap-1", children: [
|
|
640
|
+
/* @__PURE__ */ jsx9(FieldLabel, { children: config.labels[factKey] }),
|
|
641
|
+
/* @__PURE__ */ jsx9("span", { className: "stat-count-number title-text text-text-primary", children: formatTeamFactNumber("count", numberFact(facts, factKey)) }),
|
|
642
|
+
years.length > 0 && /* @__PURE__ */ jsx9(FactPills, { items: years, capped: true })
|
|
621
643
|
] });
|
|
622
644
|
}
|
|
623
645
|
function RivalValue({
|
|
@@ -627,14 +649,14 @@ function RivalValue({
|
|
|
627
649
|
}) {
|
|
628
650
|
switch (rival.status) {
|
|
629
651
|
case "none":
|
|
630
|
-
return /* @__PURE__ */
|
|
652
|
+
return /* @__PURE__ */ jsx9(EmptyValue, {});
|
|
631
653
|
case "loading":
|
|
632
|
-
return /* @__PURE__ */
|
|
654
|
+
return /* @__PURE__ */ jsx9(Skeleton3, { className: "h-8 w-40", "aria-label": "Loading rival" });
|
|
633
655
|
case "error":
|
|
634
|
-
return /* @__PURE__ */
|
|
656
|
+
return /* @__PURE__ */ jsx9(EmptyValue, { children: "Couldn't load the rival team" });
|
|
635
657
|
case "ready": {
|
|
636
|
-
const content = /* @__PURE__ */
|
|
637
|
-
/* @__PURE__ */
|
|
658
|
+
const content = /* @__PURE__ */ jsxs9(Fragment, { children: [
|
|
659
|
+
/* @__PURE__ */ jsx9(
|
|
638
660
|
EntityAvatar,
|
|
639
661
|
{
|
|
640
662
|
entityType: "initials",
|
|
@@ -645,10 +667,10 @@ function RivalValue({
|
|
|
645
667
|
className: "shrink-0"
|
|
646
668
|
}
|
|
647
669
|
),
|
|
648
|
-
/* @__PURE__ */
|
|
670
|
+
/* @__PURE__ */ jsx9("span", { className: "min-w-0", children: rival.rival.name })
|
|
649
671
|
] });
|
|
650
672
|
const className = "inline-flex max-w-full items-center gap-1.5 body-text-semibold font-ss02-ss05 text-primary-color-nuk-text";
|
|
651
|
-
return getRivalHref ? /* @__PURE__ */
|
|
673
|
+
return getRivalHref ? /* @__PURE__ */ jsx9("a", { href: getRivalHref(rival.rival.id), className: cn8(className, "hover:underline"), children: content }) : /* @__PURE__ */ jsx9("span", { className, children: content });
|
|
652
674
|
}
|
|
653
675
|
}
|
|
654
676
|
}
|
|
@@ -658,10 +680,10 @@ function factValue(factKey, layout, data, resolveImageUrl, getRivalHref) {
|
|
|
658
680
|
if (kind === "number" || kind === "year" || kind === "text") {
|
|
659
681
|
const display = kind === "text" ? textFact(facts, factKey) : formatTeamFactNumber(kind, numberFact(facts, factKey));
|
|
660
682
|
const isEmpty = !display || display === EMPTY_FACT_VALUE;
|
|
661
|
-
return /* @__PURE__ */
|
|
683
|
+
return /* @__PURE__ */ jsx9(
|
|
662
684
|
"span",
|
|
663
685
|
{
|
|
664
|
-
className:
|
|
686
|
+
className: cn8(
|
|
665
687
|
"w-full header-xl-medium-card font-ss02-ss05 [overflow-wrap:anywhere]",
|
|
666
688
|
isEmpty ? "text-text-secondary" : "text-text-primary"
|
|
667
689
|
),
|
|
@@ -672,10 +694,10 @@ function factValue(factKey, layout, data, resolveImageUrl, getRivalHref) {
|
|
|
672
694
|
if (kind === "years" || kind === "labeled_years" || kind === "list") {
|
|
673
695
|
const raw = listFact(facts, factKey);
|
|
674
696
|
const items = kind === "years" ? formatYearPills(raw, config.formatChampionshipYear) : raw;
|
|
675
|
-
return items.length > 0 ? /* @__PURE__ */
|
|
697
|
+
return items.length > 0 ? /* @__PURE__ */ jsx9(FactPills, { items, capped: layout === "grid" }) : /* @__PURE__ */ jsx9(EmptyValue, {});
|
|
676
698
|
}
|
|
677
699
|
if (kind === "rival") {
|
|
678
|
-
return /* @__PURE__ */
|
|
700
|
+
return /* @__PURE__ */ jsx9(
|
|
679
701
|
RivalValue,
|
|
680
702
|
{
|
|
681
703
|
rival: data.rival,
|
|
@@ -685,10 +707,10 @@ function factValue(factKey, layout, data, resolveImageUrl, getRivalHref) {
|
|
|
685
707
|
);
|
|
686
708
|
}
|
|
687
709
|
const text = textFact(facts, factKey);
|
|
688
|
-
return /* @__PURE__ */
|
|
710
|
+
return /* @__PURE__ */ jsx9(
|
|
689
711
|
"p",
|
|
690
712
|
{
|
|
691
|
-
className:
|
|
713
|
+
className: cn8(
|
|
692
714
|
"w-full body-text font-ss02-ss05 whitespace-pre-line",
|
|
693
715
|
text ? "text-text-primary" : "text-text-secondary"
|
|
694
716
|
),
|
|
@@ -704,17 +726,17 @@ function FactField({
|
|
|
704
726
|
getRivalHref
|
|
705
727
|
}) {
|
|
706
728
|
const kind = TEAM_FACT_KINDS[factKey];
|
|
707
|
-
if (kind === "count") return /* @__PURE__ */
|
|
708
|
-
return /* @__PURE__ */
|
|
729
|
+
if (kind === "count") return /* @__PURE__ */ jsx9(CountFact, { factKey, data });
|
|
730
|
+
return /* @__PURE__ */ jsxs9(
|
|
709
731
|
"div",
|
|
710
732
|
{
|
|
711
|
-
className:
|
|
733
|
+
className: cn8(
|
|
712
734
|
"flex min-w-0 flex-col items-start gap-1.5",
|
|
713
735
|
layout === "row" && "flex-1",
|
|
714
736
|
layout === "grid" && kind !== "list" && "gap-1"
|
|
715
737
|
),
|
|
716
738
|
children: [
|
|
717
|
-
/* @__PURE__ */
|
|
739
|
+
/* @__PURE__ */ jsx9(FieldLabel, { children: data.config.labels[factKey] }),
|
|
718
740
|
factValue(factKey, layout, data, resolveImageUrl, getRivalHref)
|
|
719
741
|
]
|
|
720
742
|
}
|
|
@@ -723,15 +745,15 @@ function FactField({
|
|
|
723
745
|
|
|
724
746
|
// src/team/venue-photo.tsx
|
|
725
747
|
import { useState as useState3 } from "react";
|
|
726
|
-
import { cn as
|
|
748
|
+
import { cn as cn9 } from "@nukleus-sports/ui-web";
|
|
727
749
|
import { XsViewInvoiceIcon } from "@nukleus-sports/icons";
|
|
728
750
|
import { facilityImageCredit } from "@nukleus-sports/core";
|
|
729
|
-
import { jsx as
|
|
751
|
+
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
730
752
|
var PHOTO_WIDTHS = [640, 960, 1280];
|
|
731
753
|
var PHOTO_SIZES = "(min-width: 1280px) 420px, 100vw";
|
|
732
754
|
var LINK_CLASS = "inline-flex shrink-0 items-center gap-1 hover:text-text-primary";
|
|
733
755
|
function NewTabNote() {
|
|
734
|
-
return /* @__PURE__ */
|
|
756
|
+
return /* @__PURE__ */ jsx10("span", { className: "sr-only", children: " (opens in a new tab)" });
|
|
735
757
|
}
|
|
736
758
|
function resolvePhotoSources(path, resolveImageUrl) {
|
|
737
759
|
const candidates = PHOTO_WIDTHS.flatMap((width) => {
|
|
@@ -746,18 +768,18 @@ function resolvePhotoSources(path, resolveImageUrl) {
|
|
|
746
768
|
}
|
|
747
769
|
function VenueNameOnly({ name, label }) {
|
|
748
770
|
if (!name) return null;
|
|
749
|
-
return /* @__PURE__ */
|
|
750
|
-
/* @__PURE__ */
|
|
751
|
-
/* @__PURE__ */
|
|
771
|
+
return /* @__PURE__ */ jsxs10("div", { className: "flex min-w-0 flex-col items-start gap-1.5", children: [
|
|
772
|
+
/* @__PURE__ */ jsx10(FieldLabel, { children: label }),
|
|
773
|
+
/* @__PURE__ */ jsx10("span", { className: "w-full header-xl-medium-card font-ss02-ss05 text-text-primary", children: name })
|
|
752
774
|
] });
|
|
753
775
|
}
|
|
754
776
|
function PhotoCaption({ name, image }) {
|
|
755
777
|
const credit = facilityImageCredit(image);
|
|
756
|
-
return /* @__PURE__ */
|
|
757
|
-
name && /* @__PURE__ */
|
|
758
|
-
/* @__PURE__ */
|
|
759
|
-
/* @__PURE__ */
|
|
760
|
-
image.sourceUrl && /* @__PURE__ */
|
|
778
|
+
return /* @__PURE__ */ jsxs10("figcaption", { className: "flex w-full flex-col gap-1 xxs-body-text font-ss02-ss05", children: [
|
|
779
|
+
name && /* @__PURE__ */ jsx10("span", { className: "w-full text-text-primary", children: name }),
|
|
780
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex w-full items-start gap-2 text-greys-text-secondary", children: [
|
|
781
|
+
/* @__PURE__ */ jsx10("span", { className: "min-w-0 flex-1", children: credit ? `Photo: ${credit}` : "Photo from Wikimedia Commons" }),
|
|
782
|
+
image.sourceUrl && /* @__PURE__ */ jsxs10(
|
|
761
783
|
"a",
|
|
762
784
|
{
|
|
763
785
|
href: image.sourceUrl,
|
|
@@ -766,8 +788,8 @@ function PhotoCaption({ name, image }) {
|
|
|
766
788
|
className: LINK_CLASS,
|
|
767
789
|
children: [
|
|
768
790
|
"Source",
|
|
769
|
-
/* @__PURE__ */
|
|
770
|
-
/* @__PURE__ */
|
|
791
|
+
/* @__PURE__ */ jsx10(NewTabNote, {}),
|
|
792
|
+
/* @__PURE__ */ jsx10("span", { "aria-hidden": "true", className: "flex shrink-0", children: /* @__PURE__ */ jsx10(
|
|
771
793
|
XsViewInvoiceIcon,
|
|
772
794
|
{
|
|
773
795
|
width: 16,
|
|
@@ -778,7 +800,7 @@ function PhotoCaption({ name, image }) {
|
|
|
778
800
|
]
|
|
779
801
|
}
|
|
780
802
|
),
|
|
781
|
-
image.licenseUrl && /* @__PURE__ */
|
|
803
|
+
image.licenseUrl && /* @__PURE__ */ jsxs10(
|
|
782
804
|
"a",
|
|
783
805
|
{
|
|
784
806
|
href: image.licenseUrl,
|
|
@@ -787,7 +809,7 @@ function PhotoCaption({ name, image }) {
|
|
|
787
809
|
className: LINK_CLASS,
|
|
788
810
|
children: [
|
|
789
811
|
"License",
|
|
790
|
-
/* @__PURE__ */
|
|
812
|
+
/* @__PURE__ */ jsx10(NewTabNote, {})
|
|
791
813
|
]
|
|
792
814
|
}
|
|
793
815
|
)
|
|
@@ -801,9 +823,9 @@ function VenuePhoto({ venue, label, resolveImageUrl }) {
|
|
|
801
823
|
const sources = image && resolveImageUrl ? resolvePhotoSources(image.path, resolveImageUrl) : null;
|
|
802
824
|
const useResized = failed === "none" && Boolean(sources?.srcSet);
|
|
803
825
|
const src = failed === "all" ? void 0 : useResized ? sources?.resized : sources?.original;
|
|
804
|
-
if (!image || !src) return /* @__PURE__ */
|
|
805
|
-
return /* @__PURE__ */
|
|
806
|
-
/* @__PURE__ */
|
|
826
|
+
if (!image || !src) return /* @__PURE__ */ jsx10(VenueNameOnly, { name, label });
|
|
827
|
+
return /* @__PURE__ */ jsxs10("figure", { className: "flex w-full flex-col gap-3", children: [
|
|
828
|
+
/* @__PURE__ */ jsx10(
|
|
807
829
|
"img",
|
|
808
830
|
{
|
|
809
831
|
src,
|
|
@@ -812,14 +834,14 @@ function VenuePhoto({ venue, label, resolveImageUrl }) {
|
|
|
812
834
|
onLoad: () => setIsLoaded(true),
|
|
813
835
|
onError: () => setFailed(useResized ? "resized" : "all"),
|
|
814
836
|
alt: name ?? label,
|
|
815
|
-
className:
|
|
837
|
+
className: cn9(
|
|
816
838
|
"h-[150px] w-full rounded-[8px] bg-greys-background-hover object-cover",
|
|
817
839
|
!isLoaded && "animate-pulse"
|
|
818
840
|
),
|
|
819
841
|
loading: "lazy"
|
|
820
842
|
}
|
|
821
843
|
),
|
|
822
|
-
/* @__PURE__ */
|
|
844
|
+
/* @__PURE__ */ jsx10(PhotoCaption, { name, image })
|
|
823
845
|
] });
|
|
824
846
|
}
|
|
825
847
|
|
|
@@ -827,7 +849,7 @@ function VenuePhoto({ venue, label, resolveImageUrl }) {
|
|
|
827
849
|
import {
|
|
828
850
|
teamFactsDisplayFields
|
|
829
851
|
} from "@nukleus-sports/core";
|
|
830
|
-
import { jsx as
|
|
852
|
+
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
831
853
|
var SECTION_FIELDS_CLASS = {
|
|
832
854
|
grid: "grid grid-cols-2 items-start gap-3",
|
|
833
855
|
row: "flex items-start gap-3",
|
|
@@ -844,7 +866,7 @@ function TeamFactsContent({
|
|
|
844
866
|
getRivalHref
|
|
845
867
|
}) {
|
|
846
868
|
const { config, venue, hasFacts } = data;
|
|
847
|
-
const photo = /* @__PURE__ */
|
|
869
|
+
const photo = /* @__PURE__ */ jsx11(
|
|
848
870
|
VenuePhoto,
|
|
849
871
|
{
|
|
850
872
|
venue,
|
|
@@ -854,14 +876,14 @@ function TeamFactsContent({
|
|
|
854
876
|
venue.image?.path ?? "none"
|
|
855
877
|
);
|
|
856
878
|
if (!hasFacts) {
|
|
857
|
-
return /* @__PURE__ */
|
|
858
|
-
/* @__PURE__ */
|
|
859
|
-
(venue.image || venue.name) && /* @__PURE__ */
|
|
879
|
+
return /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-3", children: [
|
|
880
|
+
/* @__PURE__ */ jsx11("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." }),
|
|
881
|
+
(venue.image || venue.name) && /* @__PURE__ */ jsx11("section", { className: SECTION_CLASS, children: photo })
|
|
860
882
|
] });
|
|
861
883
|
}
|
|
862
|
-
return /* @__PURE__ */
|
|
863
|
-
/* @__PURE__ */
|
|
864
|
-
/* @__PURE__ */
|
|
884
|
+
return /* @__PURE__ */ jsx11("div", { className: "flex flex-col gap-3", children: config.sections.map((section) => /* @__PURE__ */ jsxs11("section", { "aria-label": section.title, className: SECTION_CLASS, children: [
|
|
885
|
+
/* @__PURE__ */ jsx11("h3", { className: "label-xs-semibold-text font-ss02-ss05 uppercase text-greys-text-secondary", children: section.title }),
|
|
886
|
+
/* @__PURE__ */ jsx11("div", { className: SECTION_FIELDS_CLASS[section.layout], children: teamFactsDisplayFields(section).map((key) => /* @__PURE__ */ jsx11(
|
|
865
887
|
FactField,
|
|
866
888
|
{
|
|
867
889
|
factKey: key,
|
|
@@ -879,14 +901,14 @@ function TeamFactsContent({
|
|
|
879
901
|
// src/team/team-facts-widget.tsx
|
|
880
902
|
import {
|
|
881
903
|
Button,
|
|
882
|
-
Card as
|
|
883
|
-
CardContent as
|
|
904
|
+
Card as Card5,
|
|
905
|
+
CardContent as CardContent5,
|
|
884
906
|
CardHeader as CardHeader3,
|
|
885
907
|
CardTitle as CardTitle3,
|
|
886
908
|
Skeleton as Skeleton4,
|
|
887
|
-
cn as
|
|
909
|
+
cn as cn10
|
|
888
910
|
} from "@nukleus-sports/ui-web";
|
|
889
|
-
import { jsx as
|
|
911
|
+
import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
890
912
|
var SKELETON_KEYS = ["trophy-case", "tradition", "profile"];
|
|
891
913
|
function TeamFactsWidget({
|
|
892
914
|
state,
|
|
@@ -895,32 +917,32 @@ function TeamFactsWidget({
|
|
|
895
917
|
getRivalHref,
|
|
896
918
|
className
|
|
897
919
|
}) {
|
|
898
|
-
return /* @__PURE__ */
|
|
899
|
-
|
|
920
|
+
return /* @__PURE__ */ jsxs12(
|
|
921
|
+
Card5,
|
|
900
922
|
{
|
|
901
|
-
className:
|
|
923
|
+
className: cn10(
|
|
902
924
|
"flex w-full min-w-0 flex-col gap-3 rounded-[10px] border-0 px-4 pb-[22px] pt-4",
|
|
903
925
|
// Matches the Team Info card's desktop height (TeamInfoCard `md:min-h-[612px]`).
|
|
904
926
|
"xl:min-h-[612px] xl:self-stretch xl:[contain:size]",
|
|
905
927
|
className
|
|
906
928
|
),
|
|
907
929
|
children: [
|
|
908
|
-
/* @__PURE__ */
|
|
909
|
-
/* @__PURE__ */
|
|
910
|
-
state.status === "loading" && /* @__PURE__ */
|
|
911
|
-
state.status === "error" && /* @__PURE__ */
|
|
930
|
+
/* @__PURE__ */ jsx12(CardHeader3, { className: "flex h-8 shrink-0 flex-row items-center p-0", children: /* @__PURE__ */ jsx12(CardTitle3, { className: "header-xl-medium-card font-ss02-ss05 text-text-primary", children: "Team Facts" }) }),
|
|
931
|
+
/* @__PURE__ */ jsxs12(CardContent5, { className: "p-0 xl:min-h-0 xl:flex-1 xl:overflow-y-auto xl:[scrollbar-width:none] xl:[&::-webkit-scrollbar]:hidden", children: [
|
|
932
|
+
state.status === "loading" && /* @__PURE__ */ jsx12("div", { className: "flex flex-col gap-3", role: "status", "aria-label": "Loading team facts", children: SKELETON_KEYS.map((key) => /* @__PURE__ */ jsx12(Skeleton4, { className: "h-[200px] w-full rounded-[10px]" }, key)) }),
|
|
933
|
+
state.status === "error" && /* @__PURE__ */ jsxs12(
|
|
912
934
|
"div",
|
|
913
935
|
{
|
|
914
936
|
role: "alert",
|
|
915
937
|
className: "flex h-[120px] flex-col items-center justify-center gap-2 text-14.5 text-text-secondary",
|
|
916
938
|
children: [
|
|
917
|
-
/* @__PURE__ */
|
|
918
|
-
state.devMessage && /* @__PURE__ */
|
|
919
|
-
state.retry && /* @__PURE__ */
|
|
939
|
+
/* @__PURE__ */ jsx12("span", { children: "Couldn't load team facts." }),
|
|
940
|
+
state.devMessage && /* @__PURE__ */ jsx12("span", { className: "xxs-body-text", children: state.devMessage }),
|
|
941
|
+
state.retry && /* @__PURE__ */ jsx12(Button, { type: "button", variant: "outline", size: "sm", onClick: state.retry, children: "Try again" })
|
|
920
942
|
]
|
|
921
943
|
}
|
|
922
944
|
),
|
|
923
|
-
state.status === "ready" && /* @__PURE__ */
|
|
945
|
+
state.status === "ready" && /* @__PURE__ */ jsx12(
|
|
924
946
|
TeamFactsContent,
|
|
925
947
|
{
|
|
926
948
|
data: state.data,
|
|
@@ -947,11 +969,11 @@ import {
|
|
|
947
969
|
DialogHeader,
|
|
948
970
|
DialogTitle,
|
|
949
971
|
MobileModalLayout,
|
|
950
|
-
cn as
|
|
972
|
+
cn as cn11
|
|
951
973
|
} from "@nukleus-sports/ui-web";
|
|
952
974
|
import { ChevronLeftIcon, ChevronRightIcon } from "@nukleus-sports/icons";
|
|
953
975
|
import { toOrdinal } from "@nukleus-sports/core";
|
|
954
|
-
import { Fragment as Fragment2, jsx as
|
|
976
|
+
import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
955
977
|
var PAGE_BUTTON_BASE = "background";
|
|
956
978
|
var PAGE_BUTTON_DESKTOP = "!h-[32px] !w-[32px] p-[6px]";
|
|
957
979
|
var PAGE_BUTTON_MOBILE = "!h-11 !w-11 p-3 !outline-0 !border-0 !bg-inherit";
|
|
@@ -960,17 +982,17 @@ function formatRank(rank, tied) {
|
|
|
960
982
|
return tied ? `T-${toOrdinal(rank)}` : toOrdinal(rank);
|
|
961
983
|
}
|
|
962
984
|
function Footnotes({ notes }) {
|
|
963
|
-
return /* @__PURE__ */
|
|
985
|
+
return /* @__PURE__ */ jsx13("div", { children: notes.map((note) => /* @__PURE__ */ jsxs13("p", { className: "alert-text-italic text-text-secondary", children: [
|
|
964
986
|
"* ",
|
|
965
987
|
note
|
|
966
988
|
] }, note)) });
|
|
967
989
|
}
|
|
968
990
|
function Pagination({ page, totalPages, isCountKnown, isSm, onPageChange }) {
|
|
969
|
-
const buttonClass =
|
|
970
|
-
return /* @__PURE__ */
|
|
971
|
-
/* @__PURE__ */
|
|
972
|
-
/* @__PURE__ */
|
|
973
|
-
/* @__PURE__ */
|
|
991
|
+
const buttonClass = cn11(PAGE_BUTTON_BASE, isSm ? PAGE_BUTTON_DESKTOP : PAGE_BUTTON_MOBILE);
|
|
992
|
+
return /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between", children: [
|
|
993
|
+
/* @__PURE__ */ jsx13("span", { className: "label-xs-text text-text-secondary", children: isCountKnown ? `Page ${page} of ${totalPages}` : `Page ${page}` }),
|
|
994
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-3", children: [
|
|
995
|
+
/* @__PURE__ */ jsx13(
|
|
974
996
|
Button2,
|
|
975
997
|
{
|
|
976
998
|
variant: "secondary-greys",
|
|
@@ -979,10 +1001,10 @@ function Pagination({ page, totalPages, isCountKnown, isSm, onPageChange }) {
|
|
|
979
1001
|
onClick: () => onPageChange(Math.max(1, page - 1)),
|
|
980
1002
|
disabled: page === 1,
|
|
981
1003
|
"aria-label": "Go to previous page",
|
|
982
|
-
children: /* @__PURE__ */
|
|
1004
|
+
children: /* @__PURE__ */ jsx13(ChevronLeftIcon, { className: "h-4 w-4" })
|
|
983
1005
|
}
|
|
984
1006
|
),
|
|
985
|
-
/* @__PURE__ */
|
|
1007
|
+
/* @__PURE__ */ jsx13(
|
|
986
1008
|
Button2,
|
|
987
1009
|
{
|
|
988
1010
|
variant: "secondary-greys",
|
|
@@ -991,7 +1013,7 @@ function Pagination({ page, totalPages, isCountKnown, isSm, onPageChange }) {
|
|
|
991
1013
|
onClick: () => onPageChange(Math.min(totalPages, page + 1)),
|
|
992
1014
|
disabled: !isCountKnown || page >= totalPages,
|
|
993
1015
|
"aria-label": "Go to next page",
|
|
994
|
-
children: /* @__PURE__ */
|
|
1016
|
+
children: /* @__PURE__ */ jsx13(ChevronRightIcon, { className: "h-4 w-4" })
|
|
995
1017
|
}
|
|
996
1018
|
)
|
|
997
1019
|
] })
|
|
@@ -1017,7 +1039,7 @@ function useLeaderboardColumns(entityLabel, statLabel, formatValue, isSm) {
|
|
|
1017
1039
|
},
|
|
1018
1040
|
{
|
|
1019
1041
|
accessorKey: "value",
|
|
1020
|
-
header: () => /* @__PURE__ */
|
|
1042
|
+
header: () => /* @__PURE__ */ jsx13("div", { className: "text-right text-wrap line-clamp-2", title: statLabel, children: statLabel }),
|
|
1021
1043
|
meta: {
|
|
1022
1044
|
cellSize: isSm ? "m" : "xs",
|
|
1023
1045
|
rowCellClassName: "text-right tabular-nums break-all"
|
|
@@ -1037,11 +1059,11 @@ function LeaderboardTable(props) {
|
|
|
1037
1059
|
props.isSm
|
|
1038
1060
|
);
|
|
1039
1061
|
if (isConfigError) {
|
|
1040
|
-
return /* @__PURE__ */
|
|
1062
|
+
return /* @__PURE__ */ jsx13("div", { className: "flex items-center justify-center h-full text-14.5 text-text-secondary", children: "Couldn't load ranking details. Please try again." });
|
|
1041
1063
|
}
|
|
1042
|
-
return /* @__PURE__ */
|
|
1043
|
-
isError && rows.length > 0 && /* @__PURE__ */
|
|
1044
|
-
/* @__PURE__ */
|
|
1064
|
+
return /* @__PURE__ */ jsxs13(Fragment2, { children: [
|
|
1065
|
+
isError && rows.length > 0 && /* @__PURE__ */ jsx13("p", { className: "text-12 text-destructive px-1 pb-2", children: "Couldn't refresh rankings. Showing the last loaded data." }),
|
|
1066
|
+
/* @__PURE__ */ jsx13(
|
|
1045
1067
|
BaseTable2,
|
|
1046
1068
|
{
|
|
1047
1069
|
columns,
|
|
@@ -1065,17 +1087,17 @@ function LeaderboardContent(props) {
|
|
|
1065
1087
|
const isCountKnown = totalCount !== void 0;
|
|
1066
1088
|
const totalPages = Math.max(1, Math.ceil((totalCount ?? 0) / pageSize));
|
|
1067
1089
|
const showPagination = page > 1 || isCountKnown && totalPages > 1;
|
|
1068
|
-
return /* @__PURE__ */
|
|
1069
|
-
/* @__PURE__ */
|
|
1070
|
-
subtitle && /* @__PURE__ */
|
|
1090
|
+
return /* @__PURE__ */ jsxs13("div", { className: "flex flex-col h-full overflow-hidden", children: [
|
|
1091
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-6 sm:gap-4 overflow-hidden px-5", children: [
|
|
1092
|
+
subtitle && /* @__PURE__ */ jsxs13(DialogDescription, { className: "flex flex-col gap-1 header-xl-medium-card text-text-secondary sm:px-4 font-ss02 ss05 leading-normal", children: [
|
|
1071
1093
|
subtitle,
|
|
1072
|
-
!isSm && footnotes.length > 0 && /* @__PURE__ */
|
|
1094
|
+
!isSm && footnotes.length > 0 && /* @__PURE__ */ jsx13(Footnotes, { notes: footnotes })
|
|
1073
1095
|
] }),
|
|
1074
|
-
/* @__PURE__ */
|
|
1096
|
+
/* @__PURE__ */ jsx13("div", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsx13(LeaderboardTable, { ...props }) })
|
|
1075
1097
|
] }),
|
|
1076
|
-
(footnotes.length > 0 || showPagination) && /* @__PURE__ */
|
|
1077
|
-
footnotes.length > 0 && /* @__PURE__ */
|
|
1078
|
-
showPagination && /* @__PURE__ */
|
|
1098
|
+
(footnotes.length > 0 || showPagination) && /* @__PURE__ */ jsxs13("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: [
|
|
1099
|
+
footnotes.length > 0 && /* @__PURE__ */ jsx13(Footnotes, { notes: footnotes }),
|
|
1100
|
+
showPagination && /* @__PURE__ */ jsx13(
|
|
1079
1101
|
Pagination,
|
|
1080
1102
|
{
|
|
1081
1103
|
page,
|
|
@@ -1091,12 +1113,12 @@ function LeaderboardContent(props) {
|
|
|
1091
1113
|
function StatRankingLeaderboardDialog(props) {
|
|
1092
1114
|
const { open, onOpenChange, title, isSm } = props;
|
|
1093
1115
|
if (isSm) {
|
|
1094
|
-
return /* @__PURE__ */
|
|
1095
|
-
/* @__PURE__ */
|
|
1096
|
-
/* @__PURE__ */
|
|
1116
|
+
return /* @__PURE__ */ jsx13(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs13(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: [
|
|
1117
|
+
/* @__PURE__ */ jsx13(DialogHeader, { children: /* @__PURE__ */ jsx13(DialogTitle, { className: "header-xl-medium-card", children: title }) }),
|
|
1118
|
+
/* @__PURE__ */ jsx13(LeaderboardContent, { ...props })
|
|
1097
1119
|
] }) });
|
|
1098
1120
|
}
|
|
1099
|
-
return /* @__PURE__ */
|
|
1121
|
+
return /* @__PURE__ */ jsx13(
|
|
1100
1122
|
MobileModalLayout,
|
|
1101
1123
|
{
|
|
1102
1124
|
onCancel: () => onOpenChange(false),
|
|
@@ -1105,7 +1127,7 @@ function StatRankingLeaderboardDialog(props) {
|
|
|
1105
1127
|
title,
|
|
1106
1128
|
cancelButtonName: "Close",
|
|
1107
1129
|
childClassName: "h-auto min-h-full h-[calc(100vh-100px)]",
|
|
1108
|
-
children: /* @__PURE__ */
|
|
1130
|
+
children: /* @__PURE__ */ jsx13("div", { className: "flex flex-col h-full pt-6", children: /* @__PURE__ */ jsx13(LeaderboardContent, { ...props }) })
|
|
1109
1131
|
}
|
|
1110
1132
|
);
|
|
1111
1133
|
}
|
|
@@ -1113,13 +1135,13 @@ function StatRankingLeaderboardDialog(props) {
|
|
|
1113
1135
|
// src/team/team-season-stats-widget.tsx
|
|
1114
1136
|
import {
|
|
1115
1137
|
Button as Button3,
|
|
1116
|
-
Card as
|
|
1117
|
-
CardContent as
|
|
1138
|
+
Card as Card6,
|
|
1139
|
+
CardContent as CardContent6,
|
|
1118
1140
|
CardHeader as CardHeader4,
|
|
1119
1141
|
CardTitle as CardTitle4,
|
|
1120
1142
|
IconLoader,
|
|
1121
1143
|
Skeleton as Skeleton5,
|
|
1122
|
-
cn as
|
|
1144
|
+
cn as cn12
|
|
1123
1145
|
} from "@nukleus-sports/ui-web";
|
|
1124
1146
|
import {
|
|
1125
1147
|
computeTeamSeasonStatsFromSummary,
|
|
@@ -1128,7 +1150,7 @@ import {
|
|
|
1128
1150
|
getTeamStatColumns as getTeamStatColumns2,
|
|
1129
1151
|
isSupportedTeamStatsSport as isSupportedTeamStatsSport2
|
|
1130
1152
|
} from "@nukleus-sports/core";
|
|
1131
|
-
import { jsx as
|
|
1153
|
+
import { jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1132
1154
|
var PRESEASON_TYPE = 1;
|
|
1133
1155
|
var RANK_TEXT_CLASS = "label-xs-medium text-text-secondary";
|
|
1134
1156
|
var RANK_LINK_CLASS = `${RANK_TEXT_CLASS} hover:text-text-primary hover:underline cursor-pointer transition-colors`;
|
|
@@ -1140,14 +1162,14 @@ function RankBadge({
|
|
|
1140
1162
|
onRankClick
|
|
1141
1163
|
}) {
|
|
1142
1164
|
if (isRankingsError) {
|
|
1143
|
-
return /* @__PURE__ */
|
|
1144
|
-
/* @__PURE__ */
|
|
1145
|
-
/* @__PURE__ */
|
|
1165
|
+
return /* @__PURE__ */ jsxs14("span", { className: "label-xs-medium text-destructive", title: "Couldn't load ranking", children: [
|
|
1166
|
+
/* @__PURE__ */ jsx14("span", { "aria-hidden": "true", children: "--" }),
|
|
1167
|
+
/* @__PURE__ */ jsx14("span", { className: "sr-only", children: "Couldn't load ranking" })
|
|
1146
1168
|
] });
|
|
1147
1169
|
}
|
|
1148
1170
|
if (!rankText) return null;
|
|
1149
|
-
if (!onRankClick) return /* @__PURE__ */
|
|
1150
|
-
return /* @__PURE__ */
|
|
1171
|
+
if (!onRankClick) return /* @__PURE__ */ jsx14("span", { className: RANK_TEXT_CLASS, children: rankText });
|
|
1172
|
+
return /* @__PURE__ */ jsx14(
|
|
1151
1173
|
Button3,
|
|
1152
1174
|
{
|
|
1153
1175
|
type: "button",
|
|
@@ -1164,7 +1186,7 @@ function RankBadge({
|
|
|
1164
1186
|
);
|
|
1165
1187
|
}
|
|
1166
1188
|
function CenteredMessage({ children }) {
|
|
1167
|
-
return /* @__PURE__ */
|
|
1189
|
+
return /* @__PURE__ */ jsx14("div", { className: "flex items-center justify-center h-full text-14.5 text-text-secondary", children });
|
|
1168
1190
|
}
|
|
1169
1191
|
function StatsBody({
|
|
1170
1192
|
stats,
|
|
@@ -1177,17 +1199,17 @@ function StatsBody({
|
|
|
1177
1199
|
onRankClick
|
|
1178
1200
|
}) {
|
|
1179
1201
|
const columns = getTeamStatColumns2(sportId);
|
|
1180
|
-
return /* @__PURE__ */
|
|
1181
|
-
isSummaryError && /* @__PURE__ */
|
|
1182
|
-
/* @__PURE__ */
|
|
1202
|
+
return /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-1.5 h-full w-full justify-center", children: [
|
|
1203
|
+
isSummaryError && /* @__PURE__ */ jsx14("p", { className: "text-12 text-destructive", children: "Couldn't refresh stats. Showing the last loaded data." }),
|
|
1204
|
+
/* @__PURE__ */ jsx14("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) => {
|
|
1183
1205
|
const configId = configIds?.[index];
|
|
1184
|
-
return /* @__PURE__ */
|
|
1206
|
+
return /* @__PURE__ */ jsx14(
|
|
1185
1207
|
StatColumn,
|
|
1186
1208
|
{
|
|
1187
1209
|
label: column.label,
|
|
1188
1210
|
value: stats.values[index],
|
|
1189
1211
|
suffix: column.suffix,
|
|
1190
|
-
rankBadge: showRanks && configId !== void 0 ? /* @__PURE__ */
|
|
1212
|
+
rankBadge: showRanks && configId !== void 0 ? /* @__PURE__ */ jsx14(
|
|
1191
1213
|
RankBadge,
|
|
1192
1214
|
{
|
|
1193
1215
|
rankText: formatStatRankByConfig(rankings, configId),
|
|
@@ -1227,16 +1249,16 @@ function TeamSeasonStatsWidget({
|
|
|
1227
1249
|
const configIds = getTeamRankingConfigIds(sportId, leagueId);
|
|
1228
1250
|
const showRanks = seasons?.selectedType !== PRESEASON_TYPE;
|
|
1229
1251
|
if (seasonsLoading) {
|
|
1230
|
-
return /* @__PURE__ */
|
|
1231
|
-
/* @__PURE__ */
|
|
1232
|
-
/* @__PURE__ */
|
|
1252
|
+
return /* @__PURE__ */ jsxs14(Card6, { className: cn12("border-0 p-4 h-[300px]", className), children: [
|
|
1253
|
+
/* @__PURE__ */ jsx14(CardHeader4, { className: "p-0 pb-4", children: /* @__PURE__ */ jsx14(CardTitle4, { className: "text-base font-medium", children: "Season Stats" }) }),
|
|
1254
|
+
/* @__PURE__ */ jsx14(CardContent6, { className: "p-0", children: /* @__PURE__ */ jsx14("div", { className: "space-y-3 flex justify-center items-center w-full h-full", children: /* @__PURE__ */ jsx14(IconLoader, {}) }) })
|
|
1233
1255
|
] });
|
|
1234
1256
|
}
|
|
1235
1257
|
let body;
|
|
1236
1258
|
if (statsLoading) {
|
|
1237
|
-
body = /* @__PURE__ */
|
|
1259
|
+
body = /* @__PURE__ */ jsx14("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ jsx14(Skeleton5, { className: "h-4 w-3/4" }) });
|
|
1238
1260
|
} else if (isSupportedSport && stats) {
|
|
1239
|
-
body = /* @__PURE__ */
|
|
1261
|
+
body = /* @__PURE__ */ jsx14(
|
|
1240
1262
|
StatsBody,
|
|
1241
1263
|
{
|
|
1242
1264
|
stats,
|
|
@@ -1250,21 +1272,21 @@ function TeamSeasonStatsWidget({
|
|
|
1250
1272
|
}
|
|
1251
1273
|
);
|
|
1252
1274
|
} else {
|
|
1253
|
-
body = /* @__PURE__ */
|
|
1275
|
+
body = /* @__PURE__ */ jsx14(CenteredMessage, { children: getEmptyMessage(isSupportedSport, hasSeason, isSummaryError) });
|
|
1254
1276
|
}
|
|
1255
|
-
return /* @__PURE__ */
|
|
1256
|
-
|
|
1277
|
+
return /* @__PURE__ */ jsxs14(
|
|
1278
|
+
Card6,
|
|
1257
1279
|
{
|
|
1258
|
-
className:
|
|
1280
|
+
className: cn12(
|
|
1259
1281
|
"border-0 px-4 py-3 sm:p-4 flex flex-col gap-[25px] sm:gap-4 sm:h-[300px]",
|
|
1260
1282
|
className
|
|
1261
1283
|
),
|
|
1262
1284
|
children: [
|
|
1263
|
-
/* @__PURE__ */
|
|
1264
|
-
/* @__PURE__ */
|
|
1265
|
-
isSupportedSport && seasons && seasons.years.length > 0 && /* @__PURE__ */
|
|
1285
|
+
/* @__PURE__ */ jsx14(CardHeader4, { className: "p-0", children: /* @__PURE__ */ jsxs14("div", { className: "flex flex-row items-center justify-between w-full h-8", children: [
|
|
1286
|
+
/* @__PURE__ */ jsx14(CardTitle4, { className: "header-xl-medium-card text-base text-text-primary", children: "Team Stats" }),
|
|
1287
|
+
isSupportedSport && seasons && seasons.years.length > 0 && /* @__PURE__ */ jsx14(SeasonSelector, { ...seasons, hideTypeOnMobile: true })
|
|
1266
1288
|
] }) }),
|
|
1267
|
-
/* @__PURE__ */
|
|
1289
|
+
/* @__PURE__ */ jsx14(CardContent6, { className: "p-0 h-auto sm:h-[220px] flex justify-center", children: body })
|
|
1268
1290
|
]
|
|
1269
1291
|
}
|
|
1270
1292
|
);
|
|
@@ -1274,15 +1296,15 @@ function TeamSeasonStatsWidget({
|
|
|
1274
1296
|
import { useState as useState4 } from "react";
|
|
1275
1297
|
import {
|
|
1276
1298
|
Button as Button4,
|
|
1277
|
-
Card as
|
|
1278
|
-
CardContent as
|
|
1299
|
+
Card as Card7,
|
|
1300
|
+
CardContent as CardContent7,
|
|
1279
1301
|
CardHeader as CardHeader5,
|
|
1280
1302
|
CardTitle as CardTitle5,
|
|
1281
1303
|
IconLoader as IconLoader2,
|
|
1282
|
-
cn as
|
|
1304
|
+
cn as cn13
|
|
1283
1305
|
} from "@nukleus-sports/ui-web";
|
|
1284
1306
|
import { ArrowUpRightIcon } from "@nukleus-sports/icons";
|
|
1285
|
-
import { Fragment as Fragment3, jsx as
|
|
1307
|
+
import { Fragment as Fragment3, jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1286
1308
|
var DATE_FORMAT = new Intl.DateTimeFormat("en-US", {
|
|
1287
1309
|
weekday: "long",
|
|
1288
1310
|
month: "long",
|
|
@@ -1295,23 +1317,23 @@ var MESSAGES = {
|
|
|
1295
1317
|
"games-error": "Couldn't load games. Please try again."
|
|
1296
1318
|
};
|
|
1297
1319
|
function ResultText({ result }) {
|
|
1298
|
-
if (result.outcome === "none") return /* @__PURE__ */
|
|
1320
|
+
if (result.outcome === "none") return /* @__PURE__ */ jsx15("span", { className: "text-text-secondary text-14", children: "--" });
|
|
1299
1321
|
if (result.outcome === "tie") {
|
|
1300
|
-
return /* @__PURE__ */
|
|
1322
|
+
return /* @__PURE__ */ jsxs15("span", { className: "text-14 font-medium text-text-primary", children: [
|
|
1301
1323
|
"T ",
|
|
1302
1324
|
result.detail
|
|
1303
1325
|
] });
|
|
1304
1326
|
}
|
|
1305
1327
|
const isWin = result.outcome === "win";
|
|
1306
|
-
return /* @__PURE__ */
|
|
1307
|
-
/* @__PURE__ */
|
|
1328
|
+
return /* @__PURE__ */ jsxs15("span", { className: "text-14 font-medium", children: [
|
|
1329
|
+
/* @__PURE__ */ jsx15(
|
|
1308
1330
|
"span",
|
|
1309
1331
|
{
|
|
1310
1332
|
className: isWin ? "text-primary-color-nuk-text" : "text-semantic-color-status-priority-blocked-hot-copy",
|
|
1311
1333
|
children: isWin ? "W" : "L"
|
|
1312
1334
|
}
|
|
1313
1335
|
),
|
|
1314
|
-
/* @__PURE__ */
|
|
1336
|
+
/* @__PURE__ */ jsxs15("span", { className: "text-text-primary", children: [
|
|
1315
1337
|
" ",
|
|
1316
1338
|
result.detail
|
|
1317
1339
|
] })
|
|
@@ -1321,7 +1343,7 @@ function OpponentLogo({ opponent, resolveImageUrl, defaultLogoUrl }) {
|
|
|
1321
1343
|
const [failedUrl, setFailedUrl] = useState4(null);
|
|
1322
1344
|
const { logo } = opponent;
|
|
1323
1345
|
const resolved = logo ? logo.stored ? resolveImageUrl?.(logo.url) : logo.url : void 0;
|
|
1324
|
-
return /* @__PURE__ */
|
|
1346
|
+
return /* @__PURE__ */ jsx15(
|
|
1325
1347
|
"img",
|
|
1326
1348
|
{
|
|
1327
1349
|
src: resolved && resolved !== failedUrl ? resolved : defaultLogoUrl,
|
|
@@ -1335,13 +1357,13 @@ function OpponentLogo({ opponent, resolveImageUrl, defaultLogoUrl }) {
|
|
|
1335
1357
|
);
|
|
1336
1358
|
}
|
|
1337
1359
|
function GameItem({ row, resolveImageUrl, defaultLogoUrl }) {
|
|
1338
|
-
return /* @__PURE__ */
|
|
1339
|
-
row.isFirstUpcoming && /* @__PURE__ */
|
|
1340
|
-
/* @__PURE__ */
|
|
1341
|
-
/* @__PURE__ */
|
|
1342
|
-
/* @__PURE__ */
|
|
1343
|
-
/* @__PURE__ */
|
|
1344
|
-
/* @__PURE__ */
|
|
1360
|
+
return /* @__PURE__ */ jsxs15("div", { className: "border-b border-border last:border-0", children: [
|
|
1361
|
+
row.isFirstUpcoming && /* @__PURE__ */ jsx15("p", { className: "px-2 pt-2 text-12 font-medium uppercase tracking-wide text-text-secondary", children: "Upcoming" }),
|
|
1362
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex flex-col p-2 gap-[5px]", children: [
|
|
1363
|
+
/* @__PURE__ */ jsx15("p", { className: "text-14 font-normal text-text-secondary", children: DATE_FORMAT.format(new Date(row.gameDate)) }),
|
|
1364
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-3", children: [
|
|
1365
|
+
/* @__PURE__ */ jsx15("span", { className: "text-14 font-normal text-text-secondary shrink-0", children: row.isHome ? "vs " : "@ " }),
|
|
1366
|
+
/* @__PURE__ */ jsx15(
|
|
1345
1367
|
OpponentLogo,
|
|
1346
1368
|
{
|
|
1347
1369
|
opponent: row.opponent,
|
|
@@ -1349,18 +1371,18 @@ function GameItem({ row, resolveImageUrl, defaultLogoUrl }) {
|
|
|
1349
1371
|
defaultLogoUrl
|
|
1350
1372
|
}
|
|
1351
1373
|
),
|
|
1352
|
-
/* @__PURE__ */
|
|
1353
|
-
row.result && /* @__PURE__ */
|
|
1354
|
-
/* @__PURE__ */
|
|
1355
|
-
/* @__PURE__ */
|
|
1374
|
+
/* @__PURE__ */ jsx15("span", { className: "text-14.5 font-normal text-text-primary truncate", children: row.opponent.name }),
|
|
1375
|
+
row.result && /* @__PURE__ */ jsxs15(Fragment3, { children: [
|
|
1376
|
+
/* @__PURE__ */ jsx15("span", { className: "text-14 text-text-secondary", children: "-" }),
|
|
1377
|
+
/* @__PURE__ */ jsx15(ResultText, { result: row.result })
|
|
1356
1378
|
] })
|
|
1357
1379
|
] }),
|
|
1358
|
-
row.time && /* @__PURE__ */
|
|
1380
|
+
row.time && /* @__PURE__ */ jsx15("p", { className: "text-14 font-normal text-text-secondary", children: row.time })
|
|
1359
1381
|
] })
|
|
1360
1382
|
] });
|
|
1361
1383
|
}
|
|
1362
1384
|
function Message({ children }) {
|
|
1363
|
-
return /* @__PURE__ */
|
|
1385
|
+
return /* @__PURE__ */ jsx15("div", { className: "text-text-primary text-14.5 px-1", children });
|
|
1364
1386
|
}
|
|
1365
1387
|
function Body({
|
|
1366
1388
|
status,
|
|
@@ -1369,11 +1391,11 @@ function Body({
|
|
|
1369
1391
|
defaultLogoUrl
|
|
1370
1392
|
}) {
|
|
1371
1393
|
if (status === "loading") {
|
|
1372
|
-
return /* @__PURE__ */
|
|
1394
|
+
return /* @__PURE__ */ jsx15("div", { className: "space-y-4 flex justify-center items-center w-full h-full", children: /* @__PURE__ */ jsx15(IconLoader2, {}) });
|
|
1373
1395
|
}
|
|
1374
|
-
if (status !== "ready") return /* @__PURE__ */
|
|
1375
|
-
if (rows.length === 0) return /* @__PURE__ */
|
|
1376
|
-
return /* @__PURE__ */
|
|
1396
|
+
if (status !== "ready") return /* @__PURE__ */ jsx15(Message, { children: MESSAGES[status] });
|
|
1397
|
+
if (rows.length === 0) return /* @__PURE__ */ jsx15(Message, { children: "There are no games scheduled at this time." });
|
|
1398
|
+
return /* @__PURE__ */ jsx15("div", { className: "flex flex-col overflow-y-auto overflow-x-hidden gap-1", children: rows.map((row) => /* @__PURE__ */ jsx15(
|
|
1377
1399
|
GameItem,
|
|
1378
1400
|
{
|
|
1379
1401
|
row,
|
|
@@ -1391,17 +1413,17 @@ function RecentGamesWidget({
|
|
|
1391
1413
|
onExpand,
|
|
1392
1414
|
className
|
|
1393
1415
|
}) {
|
|
1394
|
-
return /* @__PURE__ */
|
|
1395
|
-
|
|
1416
|
+
return /* @__PURE__ */ jsxs15(
|
|
1417
|
+
Card7,
|
|
1396
1418
|
{
|
|
1397
|
-
className:
|
|
1419
|
+
className: cn13(
|
|
1398
1420
|
"p-4 w-full xl:w-[420px] flex flex-col overflow-hidden border-none gap-3 h-full md:min-h-[612px]",
|
|
1399
1421
|
className
|
|
1400
1422
|
),
|
|
1401
1423
|
children: [
|
|
1402
|
-
/* @__PURE__ */
|
|
1403
|
-
/* @__PURE__ */
|
|
1404
|
-
onExpand && /* @__PURE__ */
|
|
1424
|
+
/* @__PURE__ */ jsxs15(CardHeader5, { className: "flex flex-row items-center justify-between space-y-0 p-0", children: [
|
|
1425
|
+
/* @__PURE__ */ jsx15(CardTitle5, { children: "Recent Games" }),
|
|
1426
|
+
onExpand && /* @__PURE__ */ jsx15(
|
|
1405
1427
|
Button4,
|
|
1406
1428
|
{
|
|
1407
1429
|
type: "button",
|
|
@@ -1410,11 +1432,11 @@ function RecentGamesWidget({
|
|
|
1410
1432
|
"aria-label": "View full schedule",
|
|
1411
1433
|
onClick: onExpand,
|
|
1412
1434
|
className: "outline-1 background outline-offset-[-1px] outline-[hsl(var(--color-ui-elem-strokes))] outline h-[32px] w-[32px]",
|
|
1413
|
-
children: /* @__PURE__ */
|
|
1435
|
+
children: /* @__PURE__ */ jsx15(ArrowUpRightIcon, { className: "text-greys-icons h-5 w-5" })
|
|
1414
1436
|
}
|
|
1415
1437
|
)
|
|
1416
1438
|
] }),
|
|
1417
|
-
/* @__PURE__ */
|
|
1439
|
+
/* @__PURE__ */ jsx15(CardContent7, { className: "flex-1 flex flex-col overflow-hidden p-0", children: /* @__PURE__ */ jsx15(
|
|
1418
1440
|
Body,
|
|
1419
1441
|
{
|
|
1420
1442
|
status,
|
|
@@ -1432,8 +1454,8 @@ function RecentGamesWidget({
|
|
|
1432
1454
|
import { useState as useState5 } from "react";
|
|
1433
1455
|
import {
|
|
1434
1456
|
BaseTable as BaseTable3,
|
|
1435
|
-
Card as
|
|
1436
|
-
CardContent as
|
|
1457
|
+
Card as Card8,
|
|
1458
|
+
CardContent as CardContent8,
|
|
1437
1459
|
CardHeader as CardHeader6,
|
|
1438
1460
|
CardTitle as CardTitle6,
|
|
1439
1461
|
Select as Select2,
|
|
@@ -1442,14 +1464,14 @@ import {
|
|
|
1442
1464
|
SelectTrigger as SelectTrigger2,
|
|
1443
1465
|
SelectValue as SelectValue2,
|
|
1444
1466
|
Skeleton as Skeleton6,
|
|
1445
|
-
cn as
|
|
1467
|
+
cn as cn14
|
|
1446
1468
|
} from "@nukleus-sports/ui-web";
|
|
1447
1469
|
import {
|
|
1448
1470
|
getOrderedTeamStatTypesForCategory,
|
|
1449
1471
|
getVisibleTeamStatTypes,
|
|
1450
1472
|
showsTeamStatCategoryPicker
|
|
1451
1473
|
} from "@nukleus-sports/core";
|
|
1452
|
-
import { Fragment as Fragment4, jsx as
|
|
1474
|
+
import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1453
1475
|
function stripLeadingSlash(path) {
|
|
1454
1476
|
return path.startsWith("/") ? path.slice(1) : path;
|
|
1455
1477
|
}
|
|
@@ -1485,10 +1507,10 @@ function formatTeamStatDate(stat) {
|
|
|
1485
1507
|
const dateStr = stat.stat_details?.game_details?.date;
|
|
1486
1508
|
const date = dateStr ? new Date(dateStr) : null;
|
|
1487
1509
|
if (!date || Number.isNaN(date.getTime())) {
|
|
1488
|
-
return /* @__PURE__ */
|
|
1510
|
+
return /* @__PURE__ */ jsx16("span", { className: "text-text-primary body-text", children: "--" });
|
|
1489
1511
|
}
|
|
1490
1512
|
const formatted = date.toLocaleDateString("en-US", { month: "short", day: "numeric" });
|
|
1491
|
-
return /* @__PURE__ */
|
|
1513
|
+
return /* @__PURE__ */ jsx16("div", { className: "text-13.5 font-normal text-text-primary", children: formatted });
|
|
1492
1514
|
}
|
|
1493
1515
|
function getTeamStatResult(stat) {
|
|
1494
1516
|
const gameDetails = stat.stat_details?.game_details;
|
|
@@ -1507,9 +1529,9 @@ function getTeamStatResult(stat) {
|
|
|
1507
1529
|
const opponentScore = isHome ? awayScore : homeScore;
|
|
1508
1530
|
const score = `${teamScore}-${opponentScore}${gameDetails.status_alt_details ? ` ${gameDetails.status_alt_details}` : ""}`;
|
|
1509
1531
|
const colorClass = winLoss === "W" ? "text-primary-color-nuk-text" : winLoss === "L" ? "text-semantic-color-status-priority-blocked-hot-copy" : "text-text-primary";
|
|
1510
|
-
return /* @__PURE__ */
|
|
1511
|
-
/* @__PURE__ */
|
|
1512
|
-
/* @__PURE__ */
|
|
1532
|
+
return /* @__PURE__ */ jsxs16("div", { className: "flex items-baseline gap-1 leading-tight", children: [
|
|
1533
|
+
/* @__PURE__ */ jsx16("span", { className: cn14(colorClass, "body-text"), children: winLoss }),
|
|
1534
|
+
/* @__PURE__ */ jsx16("span", { className: "text-text-primary body-text", children: score })
|
|
1513
1535
|
] });
|
|
1514
1536
|
}
|
|
1515
1537
|
function StatOpponentCell({
|
|
@@ -1523,13 +1545,13 @@ function StatOpponentCell({
|
|
|
1523
1545
|
const isHome = stat.team_id === gameDetails?.home_team_id;
|
|
1524
1546
|
const opponentName = isHome ? gameDetails?.away_team_name : gameDetails?.home_team_name;
|
|
1525
1547
|
const opponentLogoPath = isHome ? gameDetails?.away_team_logo : gameDetails?.home_team_logo;
|
|
1526
|
-
if (!opponentName) return /* @__PURE__ */
|
|
1548
|
+
if (!opponentName) return /* @__PURE__ */ jsx16(Fragment4, { children: "--" });
|
|
1527
1549
|
const prefix = isHome ? "vs" : "@";
|
|
1528
1550
|
const resolved = opponentLogoPath ? resolveOpponentLogoUrl(stripLeadingSlash(opponentLogoPath)) : null;
|
|
1529
1551
|
const logoSrc = resolved && resolved !== failedUrl ? resolved : defaultLogoUrl;
|
|
1530
|
-
return /* @__PURE__ */
|
|
1531
|
-
/* @__PURE__ */
|
|
1532
|
-
/* @__PURE__ */
|
|
1552
|
+
return /* @__PURE__ */ jsx16("div", { className: "h-full overflow-hidden", children: /* @__PURE__ */ jsx16("div", { className: "flex items-center h-full", children: /* @__PURE__ */ jsxs16("div", { className: "flex max-sm:gap-1 gap-2 items-center font-normal leading-tight text-12", children: [
|
|
1553
|
+
/* @__PURE__ */ jsx16("span", { className: "text-text-primary body-text", children: prefix }),
|
|
1554
|
+
/* @__PURE__ */ jsx16(
|
|
1533
1555
|
"img",
|
|
1534
1556
|
{
|
|
1535
1557
|
src: logoSrc,
|
|
@@ -1540,7 +1562,7 @@ function StatOpponentCell({
|
|
|
1540
1562
|
}
|
|
1541
1563
|
}
|
|
1542
1564
|
),
|
|
1543
|
-
showName && /* @__PURE__ */
|
|
1565
|
+
showName && /* @__PURE__ */ jsx16("span", { className: "text-primary-color-nuk-text body-text line-clamp-2", children: opponentName })
|
|
1544
1566
|
] }) }) });
|
|
1545
1567
|
}
|
|
1546
1568
|
function buildStatsColumns({
|
|
@@ -1554,14 +1576,14 @@ function buildStatsColumns({
|
|
|
1554
1576
|
return [
|
|
1555
1577
|
{
|
|
1556
1578
|
id: "game_date",
|
|
1557
|
-
header: () => /* @__PURE__ */
|
|
1579
|
+
header: () => /* @__PURE__ */ jsx16("div", { className: "w-[50px] shrink-0", children: "Date" }),
|
|
1558
1580
|
cell: ({ row }) => formatTeamStatDate(row.original),
|
|
1559
1581
|
meta: { cellSize: isSm ? "xs" : "xxs", headerClassName: "h-auto" }
|
|
1560
1582
|
},
|
|
1561
1583
|
{
|
|
1562
1584
|
id: "opponent",
|
|
1563
|
-
header: () => /* @__PURE__ */
|
|
1564
|
-
cell: ({ row }) => /* @__PURE__ */
|
|
1585
|
+
header: () => /* @__PURE__ */ jsx16("div", { children: isSm ? "Opponent" : "Opp" }),
|
|
1586
|
+
cell: ({ row }) => /* @__PURE__ */ jsx16(
|
|
1565
1587
|
StatOpponentCell,
|
|
1566
1588
|
{
|
|
1567
1589
|
stat: row.original,
|
|
@@ -1613,32 +1635,32 @@ function StatsBody2({
|
|
|
1613
1635
|
isSmallLaptop,
|
|
1614
1636
|
emptyMessage
|
|
1615
1637
|
}) {
|
|
1616
|
-
return /* @__PURE__ */
|
|
1617
|
-
/* @__PURE__ */
|
|
1618
|
-
/* @__PURE__ */
|
|
1619
|
-
showsCategoryPicker && /* @__PURE__ */
|
|
1638
|
+
return /* @__PURE__ */ jsxs16(Fragment4, { children: [
|
|
1639
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2 min-[360px]:gap-3 xl:shrink-0", children: [
|
|
1640
|
+
/* @__PURE__ */ jsx16(SeasonSelector, { ...seasons, className: "gap-2 min-[360px]:gap-3" }),
|
|
1641
|
+
showsCategoryPicker && /* @__PURE__ */ jsxs16(
|
|
1620
1642
|
Select2,
|
|
1621
1643
|
{
|
|
1622
1644
|
value: selectedStatCategory,
|
|
1623
1645
|
onValueChange: onStatCategoryChange,
|
|
1624
1646
|
disabled: !seasons.selectedYear || seasons.selectedType === null,
|
|
1625
1647
|
children: [
|
|
1626
|
-
/* @__PURE__ */
|
|
1627
|
-
/* @__PURE__ */
|
|
1648
|
+
/* @__PURE__ */ jsx16(SelectTrigger2, { variant: "widget", size: "widget", "aria-label": "Stat category", children: /* @__PURE__ */ jsx16(SelectValue2, { placeholder: "Select stat category" }) }),
|
|
1649
|
+
/* @__PURE__ */ jsx16(
|
|
1628
1650
|
SelectContent2,
|
|
1629
1651
|
{
|
|
1630
1652
|
className: "bg-popover border-border z-50 [&_.checkbox]:!flex",
|
|
1631
1653
|
classNameViewPort: "gap-2",
|
|
1632
|
-
children: availableStatCategories.map((category) => /* @__PURE__ */
|
|
1654
|
+
children: availableStatCategories.map((category) => /* @__PURE__ */ jsx16(SelectItem2, { value: category, className: "capitalize min-h-8", children: category.charAt(0).toUpperCase() + category.slice(1) }, category))
|
|
1633
1655
|
}
|
|
1634
1656
|
)
|
|
1635
1657
|
]
|
|
1636
1658
|
}
|
|
1637
1659
|
)
|
|
1638
1660
|
] }),
|
|
1639
|
-
/* @__PURE__ */
|
|
1640
|
-
isStatTypesError && !hasVisibleStatTypes && /* @__PURE__ */
|
|
1641
|
-
/* @__PURE__ */
|
|
1661
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex flex-col space-y-4 xl:flex-1 xl:min-h-0 xl:overflow-hidden", children: [
|
|
1662
|
+
isStatTypesError && !hasVisibleStatTypes && /* @__PURE__ */ jsx16("p", { className: "text-text-secondary text-13.5", children: "Couldn't load stat categories -- showing limited columns." }),
|
|
1663
|
+
/* @__PURE__ */ jsx16(
|
|
1642
1664
|
BaseTable3,
|
|
1643
1665
|
{
|
|
1644
1666
|
columns,
|
|
@@ -1682,20 +1704,20 @@ function TeamStatsTable({
|
|
|
1682
1704
|
availableStatCategories
|
|
1683
1705
|
);
|
|
1684
1706
|
if (isTeamError) {
|
|
1685
|
-
return /* @__PURE__ */
|
|
1707
|
+
return /* @__PURE__ */ jsx16(Card8, { className: cn14("border-0", className), children: /* @__PURE__ */ jsx16(CardContent8, { className: "p-4 flex justify-center items-center", children: /* @__PURE__ */ jsx16("p", { className: "text-text-secondary", children: "Couldn't load team information. Please try again." }) }) });
|
|
1686
1708
|
}
|
|
1687
1709
|
if (seasonsLoading || sportId === null) {
|
|
1688
|
-
return /* @__PURE__ */
|
|
1689
|
-
/* @__PURE__ */
|
|
1690
|
-
/* @__PURE__ */
|
|
1691
|
-
/* @__PURE__ */
|
|
1692
|
-
/* @__PURE__ */
|
|
1710
|
+
return /* @__PURE__ */ jsx16(Card8, { className: cn14("border-0", className), children: /* @__PURE__ */ jsxs16(CardContent8, { className: "space-y-4 pt-6", children: [
|
|
1711
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-3 sm:flex-row justify-start", children: [
|
|
1712
|
+
/* @__PURE__ */ jsx16(Skeleton6, { className: "h-7 w-[68px] bg-form rounded-[5px]" }),
|
|
1713
|
+
/* @__PURE__ */ jsx16(Skeleton6, { className: "h-7 w-[142px] bg-form rounded-[5px]" }),
|
|
1714
|
+
/* @__PURE__ */ jsx16(Skeleton6, { className: "h-7 w-[102px] bg-form rounded-[5px]" })
|
|
1693
1715
|
] }),
|
|
1694
|
-
/* @__PURE__ */
|
|
1716
|
+
/* @__PURE__ */ jsx16(Skeleton6, { className: "h-40 w-full bg-form !mt-3" })
|
|
1695
1717
|
] }) });
|
|
1696
1718
|
}
|
|
1697
1719
|
if (!seasons || seasons.years.length === 0) {
|
|
1698
|
-
return /* @__PURE__ */
|
|
1720
|
+
return /* @__PURE__ */ jsx16(Card8, { className: cn14("border-none", className), children: /* @__PURE__ */ jsx16(CardContent8, { className: "pt-6", children: /* @__PURE__ */ jsx16("div", { className: "text-center py-8", children: /* @__PURE__ */ jsx16("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." }) }) }) });
|
|
1699
1721
|
}
|
|
1700
1722
|
const visibleStatTypes = getVisibleTeamStatTypes(statTypes, sportId);
|
|
1701
1723
|
const filteredStatTypes = getOrderedTeamStatTypesForCategory(
|
|
@@ -1713,16 +1735,16 @@ function TeamStatsTable({
|
|
|
1713
1735
|
isSmallLaptop
|
|
1714
1736
|
});
|
|
1715
1737
|
const emptyMessage = getStatsEmptyMessage(seasons, stats.length);
|
|
1716
|
-
return /* @__PURE__ */
|
|
1717
|
-
|
|
1738
|
+
return /* @__PURE__ */ jsxs16(
|
|
1739
|
+
Card8,
|
|
1718
1740
|
{
|
|
1719
|
-
className:
|
|
1741
|
+
className: cn14(
|
|
1720
1742
|
"border-none p-4 flex flex-col gap-3 xl:h-full xl:min-h-0 xl:flex-1 xl:overflow-hidden",
|
|
1721
1743
|
className
|
|
1722
1744
|
),
|
|
1723
1745
|
children: [
|
|
1724
|
-
/* @__PURE__ */
|
|
1725
|
-
/* @__PURE__ */
|
|
1746
|
+
/* @__PURE__ */ jsx16(CardHeader6, { className: "p-0", children: /* @__PURE__ */ jsx16(CardTitle6, { children: "Stats" }) }),
|
|
1747
|
+
/* @__PURE__ */ jsx16(CardContent8, { className: "space-y-0 p-0 flex flex-col gap-3 xl:flex-1 xl:min-h-0 xl:overflow-hidden", children: /* @__PURE__ */ jsx16(
|
|
1726
1748
|
StatsBody2,
|
|
1727
1749
|
{
|
|
1728
1750
|
seasons,
|
|
@@ -1749,14 +1771,14 @@ function TeamStatsTable({
|
|
|
1749
1771
|
// src/team/team-schedule-table.tsx
|
|
1750
1772
|
import {
|
|
1751
1773
|
BaseTable as BaseTable4,
|
|
1752
|
-
Card as
|
|
1753
|
-
CardContent as
|
|
1774
|
+
Card as Card9,
|
|
1775
|
+
CardContent as CardContent9,
|
|
1754
1776
|
CardHeader as CardHeader7,
|
|
1755
1777
|
CardTitle as CardTitle7,
|
|
1756
1778
|
IconLoader as IconLoader3,
|
|
1757
|
-
cn as
|
|
1779
|
+
cn as cn15
|
|
1758
1780
|
} from "@nukleus-sports/ui-web";
|
|
1759
|
-
import { Fragment as Fragment5, jsx as
|
|
1781
|
+
import { Fragment as Fragment5, jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1760
1782
|
var SPECIAL_LOGO_LEAGUES = ["NFL", "NBA", "NHL", "MLB", "WNBA"];
|
|
1761
1783
|
var COLLEGE_LEAGUE_IDS = [2, 6, 13];
|
|
1762
1784
|
var COMPLETED_STATUS_ID = "3";
|
|
@@ -1805,12 +1827,12 @@ function showsMlbLeaders(leagueId) {
|
|
|
1805
1827
|
}
|
|
1806
1828
|
function leaderCell(leader, small = false) {
|
|
1807
1829
|
if (!leader) return "--";
|
|
1808
|
-
return /* @__PURE__ */
|
|
1809
|
-
/* @__PURE__ */
|
|
1810
|
-
/* @__PURE__ */
|
|
1830
|
+
return /* @__PURE__ */ jsxs17("div", { className: "flex flex-col leading-tight", children: [
|
|
1831
|
+
/* @__PURE__ */ jsx17("span", { className: "text-text-primary font-normal truncate", children: leader.displayName }),
|
|
1832
|
+
/* @__PURE__ */ jsx17(
|
|
1811
1833
|
"span",
|
|
1812
1834
|
{
|
|
1813
|
-
className:
|
|
1835
|
+
className: cn15(
|
|
1814
1836
|
small ? "text-text-secondary text-11" : "text-text-primary body-text",
|
|
1815
1837
|
"truncate"
|
|
1816
1838
|
),
|
|
@@ -1827,7 +1849,7 @@ function formatScheduleDate(game) {
|
|
|
1827
1849
|
const [year, month, day] = rawDate.split("T")[0].split("-").map(Number);
|
|
1828
1850
|
return new Date(year, month - 1, day);
|
|
1829
1851
|
})();
|
|
1830
|
-
return /* @__PURE__ */
|
|
1852
|
+
return /* @__PURE__ */ jsx17("span", { className: "text-text-primary body-text", children: DATE_FORMAT2.format(date) });
|
|
1831
1853
|
} catch {
|
|
1832
1854
|
return "--";
|
|
1833
1855
|
}
|
|
@@ -1845,9 +1867,9 @@ function getScheduleResult(game, teamEspnId) {
|
|
|
1845
1867
|
const winLoss = tied ? "T" : own.winner === true ? "W" : "L";
|
|
1846
1868
|
const score = `${formatScore(own.score)}-${formatScore(other.score)}`;
|
|
1847
1869
|
const colorClass = winLoss === "W" ? "text-primary-color-nuk-text" : winLoss === "L" ? "text-semantic-color-status-priority-blocked-hot-copy" : "text-text-primary";
|
|
1848
|
-
return /* @__PURE__ */
|
|
1849
|
-
/* @__PURE__ */
|
|
1850
|
-
/* @__PURE__ */
|
|
1870
|
+
return /* @__PURE__ */ jsxs17("div", { className: "flex items-baseline gap-1 leading-tight", children: [
|
|
1871
|
+
/* @__PURE__ */ jsx17("span", { className: cn15(colorClass, "body-text"), children: winLoss }),
|
|
1872
|
+
/* @__PURE__ */ jsx17("span", { className: "text-text-primary body-text", children: score })
|
|
1851
1873
|
] });
|
|
1852
1874
|
}
|
|
1853
1875
|
function getScheduleRecord(game, teamEspnId) {
|
|
@@ -1858,7 +1880,7 @@ function getScheduleRecord(game, teamEspnId) {
|
|
|
1858
1880
|
function getWinningGoalie(game) {
|
|
1859
1881
|
const athlete = firstCompetition(game)?.featuredAthletes?.[0]?.athlete;
|
|
1860
1882
|
if (!athlete?.lastName) return "--";
|
|
1861
|
-
return /* @__PURE__ */
|
|
1883
|
+
return /* @__PURE__ */ jsx17("div", { className: "flex flex-col leading-tight", children: /* @__PURE__ */ jsx17("span", { className: "text-text-primary font-normal truncate", children: athlete.lastName }) });
|
|
1862
1884
|
}
|
|
1863
1885
|
function getHockeyTopPlayer(game) {
|
|
1864
1886
|
const competitors = firstCompetition(game)?.competitors;
|
|
@@ -1875,9 +1897,9 @@ function getMlbPitcher(game, pitcherType) {
|
|
|
1875
1897
|
const athlete = pitcher?.athlete;
|
|
1876
1898
|
if (!athlete?.lastName) return "--";
|
|
1877
1899
|
const stat = pitcherType === "savingPitcher" ? athlete.saves : athlete.record;
|
|
1878
|
-
return /* @__PURE__ */
|
|
1879
|
-
/* @__PURE__ */
|
|
1880
|
-
/* @__PURE__ */
|
|
1900
|
+
return /* @__PURE__ */ jsxs17("div", { className: "flex flex-col leading-tight", children: [
|
|
1901
|
+
/* @__PURE__ */ jsx17("span", { className: "text-text-primary font-normal truncate", children: athlete.lastName }),
|
|
1902
|
+
/* @__PURE__ */ jsx17("span", { className: "text-text-secondary text-11 truncate", children: stat || "--" })
|
|
1881
1903
|
] });
|
|
1882
1904
|
}
|
|
1883
1905
|
function OpponentCell({
|
|
@@ -1890,15 +1912,15 @@ function OpponentCell({
|
|
|
1890
1912
|
showName
|
|
1891
1913
|
}) {
|
|
1892
1914
|
const match = findCompetitor(firstCompetition(game)?.competitors, teamEspnId);
|
|
1893
|
-
if (!match || leagueId === null || !leagueAbbreviation) return /* @__PURE__ */
|
|
1915
|
+
if (!match || leagueId === null || !leagueAbbreviation) return /* @__PURE__ */ jsx17(Fragment5, { children: "--" });
|
|
1894
1916
|
const prefix = match.own.homeAway === "home" ? "vs" : "@";
|
|
1895
1917
|
const opponentTeam = match.other.team;
|
|
1896
1918
|
const isSpecialLeague = SPECIAL_LOGO_LEAGUES.includes(leagueAbbreviation);
|
|
1897
1919
|
const identifier = isSpecialLeague ? opponentTeam.abbreviation : opponentTeam.id;
|
|
1898
1920
|
const folder = COLLEGE_LEAGUE_IDS.includes(leagueId) ? "NCAA" : leagueAbbreviation;
|
|
1899
|
-
return /* @__PURE__ */
|
|
1900
|
-
/* @__PURE__ */
|
|
1901
|
-
/* @__PURE__ */
|
|
1921
|
+
return /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-1 sm:gap-2 h-full overflow-hidden", children: [
|
|
1922
|
+
/* @__PURE__ */ jsx17("span", { className: "text-text-primary body-text shrink-0 sm:w-4", children: prefix }),
|
|
1923
|
+
/* @__PURE__ */ jsx17(
|
|
1902
1924
|
"img",
|
|
1903
1925
|
{
|
|
1904
1926
|
src: resolveLogoUrl(folder, identifier),
|
|
@@ -1910,7 +1932,7 @@ function OpponentCell({
|
|
|
1910
1932
|
}
|
|
1911
1933
|
}
|
|
1912
1934
|
),
|
|
1913
|
-
showName && /* @__PURE__ */
|
|
1935
|
+
showName && /* @__PURE__ */ jsx17("span", { className: "text-primary-color-nuk-text body-text line-clamp-2", children: opponentTeam.displayName })
|
|
1914
1936
|
] });
|
|
1915
1937
|
}
|
|
1916
1938
|
function buildScheduleColumns({
|
|
@@ -1926,15 +1948,15 @@ function buildScheduleColumns({
|
|
|
1926
1948
|
return [
|
|
1927
1949
|
{
|
|
1928
1950
|
id: "game_date",
|
|
1929
|
-
header: () => /* @__PURE__ */
|
|
1951
|
+
header: () => /* @__PURE__ */ jsx17("div", { className: "w-[50px] shrink-0", children: "Date" }),
|
|
1930
1952
|
accessorFn: (row) => row.game_date,
|
|
1931
1953
|
cell: ({ row }) => formatScheduleDate(row.original),
|
|
1932
1954
|
meta: { cellSize: isSm ? "xs" : "xxs" }
|
|
1933
1955
|
},
|
|
1934
1956
|
{
|
|
1935
1957
|
id: "opponent",
|
|
1936
|
-
header: () => /* @__PURE__ */
|
|
1937
|
-
cell: ({ row }) => /* @__PURE__ */
|
|
1958
|
+
header: () => /* @__PURE__ */ jsx17("div", { children: isSm ? "Opponent" : "Opp" }),
|
|
1959
|
+
cell: ({ row }) => /* @__PURE__ */ jsx17(
|
|
1938
1960
|
OpponentCell,
|
|
1939
1961
|
{
|
|
1940
1962
|
game: row.original,
|
|
@@ -2050,14 +2072,14 @@ function ScheduleBody({
|
|
|
2050
2072
|
isSmallLaptop
|
|
2051
2073
|
}) {
|
|
2052
2074
|
if (seasonsLoading) {
|
|
2053
|
-
return /* @__PURE__ */
|
|
2075
|
+
return /* @__PURE__ */ jsx17("div", { className: "flex justify-center py-8", children: /* @__PURE__ */ jsx17("div", { className: "text-sm text-text-primary", children: "Loading seasons..." }) });
|
|
2054
2076
|
}
|
|
2055
2077
|
if (!seasons || seasons.years.length === 0) {
|
|
2056
|
-
return /* @__PURE__ */
|
|
2078
|
+
return /* @__PURE__ */ jsx17("div", { className: "text-center py-8", children: /* @__PURE__ */ jsx17("p", { className: "text-text-primary", children: isSeasonsError ? "Couldn't load seasons. Please try again." : "No seasons found" }) });
|
|
2057
2079
|
}
|
|
2058
|
-
return /* @__PURE__ */
|
|
2059
|
-
/* @__PURE__ */
|
|
2060
|
-
/* @__PURE__ */
|
|
2080
|
+
return /* @__PURE__ */ jsxs17("div", { className: "flex flex-col gap-3 xl:flex-1 xl:min-h-0 xl:overflow-hidden", children: [
|
|
2081
|
+
/* @__PURE__ */ jsx17(SeasonSelector, { ...seasons, className: "gap-2 min-[360px]:gap-3 xl:shrink-0" }),
|
|
2082
|
+
/* @__PURE__ */ jsx17("div", { className: "xl:flex-1 xl:min-h-0 xl:overflow-hidden", children: /* @__PURE__ */ jsx17(
|
|
2061
2083
|
BaseTable4,
|
|
2062
2084
|
{
|
|
2063
2085
|
columns,
|
|
@@ -2101,24 +2123,24 @@ function TeamScheduleTable({
|
|
|
2101
2123
|
isSmallLaptop
|
|
2102
2124
|
});
|
|
2103
2125
|
if (isTeamError) {
|
|
2104
|
-
return /* @__PURE__ */
|
|
2126
|
+
return /* @__PURE__ */ jsx17(Card9, { className: cn15("border-0", className), children: /* @__PURE__ */ jsx17(CardContent9, { className: "p-4 flex justify-center items-center", children: /* @__PURE__ */ jsx17("p", { className: "text-text-secondary", children: "Couldn't load team information. Please try again." }) }) });
|
|
2105
2127
|
}
|
|
2106
2128
|
if (leagueId === null) {
|
|
2107
|
-
return /* @__PURE__ */
|
|
2108
|
-
/* @__PURE__ */
|
|
2109
|
-
/* @__PURE__ */
|
|
2129
|
+
return /* @__PURE__ */ jsx17(Card9, { className: cn15("border-0", className), children: /* @__PURE__ */ jsxs17(CardContent9, { className: "p-4 flex justify-center items-center gap-2", children: [
|
|
2130
|
+
/* @__PURE__ */ jsx17(IconLoader3, {}),
|
|
2131
|
+
/* @__PURE__ */ jsx17("p", { className: "text-text-secondary", children: "Loading team information..." })
|
|
2110
2132
|
] }) });
|
|
2111
2133
|
}
|
|
2112
|
-
return /* @__PURE__ */
|
|
2113
|
-
|
|
2134
|
+
return /* @__PURE__ */ jsxs17(
|
|
2135
|
+
Card9,
|
|
2114
2136
|
{
|
|
2115
|
-
className:
|
|
2137
|
+
className: cn15(
|
|
2116
2138
|
"border-none p-4 flex flex-col gap-3 xl:h-full xl:min-h-0 xl:flex-1 xl:overflow-hidden",
|
|
2117
2139
|
className
|
|
2118
2140
|
),
|
|
2119
2141
|
children: [
|
|
2120
|
-
/* @__PURE__ */
|
|
2121
|
-
/* @__PURE__ */
|
|
2142
|
+
/* @__PURE__ */ jsx17(CardHeader7, { className: "p-0 flex flex-row items-center justify-between space-y-0", children: /* @__PURE__ */ jsx17(CardTitle7, { children: "Schedule" }) }),
|
|
2143
|
+
/* @__PURE__ */ jsx17(CardContent9, { className: "space-y-0 p-0 flex flex-col gap-3 xl:flex-1 xl:min-h-0 xl:overflow-hidden", children: /* @__PURE__ */ jsx17(
|
|
2122
2144
|
ScheduleBody,
|
|
2123
2145
|
{
|
|
2124
2146
|
seasonsLoading,
|
|
@@ -2147,6 +2169,7 @@ export {
|
|
|
2147
2169
|
StatRankingLeaderboardDialog,
|
|
2148
2170
|
TeamFactsContent,
|
|
2149
2171
|
TeamFactsWidget,
|
|
2172
|
+
TeamHeaderCard,
|
|
2150
2173
|
TeamInfoCard,
|
|
2151
2174
|
TeamScheduleTable,
|
|
2152
2175
|
TeamSeasonScheduleSummaryPanel,
|