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